Files
product-uniapp/pages/mine/my_reply.vue
T
2025-12-12 18:34:44 +08:00

155 lines
3.5 KiB
Vue

<template>
<view class="container">
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" title="回复我的"></uni-nav-bar>
<view class="reply-list">
<view class="reply-card" v-for="(reply, index) in replyList" :key="index">
<!-- 主回复 -->
<view class="reply-item">
<view class="reply-heard">
<image :src="reply.avatar" class="avatar"></image>
<view class="reply-content">
<view class="username">{{ reply.username }}</view>
<view class="time">{{ reply.time }}</view>
</view>
</view>
<view class="reply-content">
<text class="reply-text">{{ reply.content }}</text>
</view>
</view>
<!-- 子回复 -->
<view class="sub-reply" v-for="(subReply, subIndex) in reply.subReplies" :key="subIndex">
<view class="reply-heard">
<image :src="subReply.avatar" class="avatar"></image>
<view class="reply-header">
<view class="username">{{ subReply.username }}</view>
</view>
</view>
<view class="reply-content">
<text class="reply-text">{{ subReply.content }}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
replyList: [
{
avatar: '/static/image/user.png',
username: '用户名用户名',
time: '2025年12月04日10:56:44',
content: '这是回复这是回复这是回复这是回复这是回复这是回复这是回复这是回复这是回复这是回复这是回复这是回复',
subReplies: [
{
avatar: '/static/image/user.png',
username: '田户名田户名',
time: '2025年12月04日10:56:44',
content: '西门子全新款饮机品牌西门子全新款饮机品牌西门子全新...'
}
]
},
{
avatar: '/static/image/user.png',
username: '用户名用户名',
time: '2025年12月04日10:56:44',
content: '这是回复这是回复这是回复这是回复这是回复这是回复这是回复这是回复这是回复这是回复这是回复这是回复',
subReplies: [
{
avatar: '/static/image/user.png',
username: '用户名用户名',
time: '2025年12月04日10:56:44',
content: '西门子全新款饮机品牌西门子全新款饮机品牌西门子全新...'
}
]
}
]
}
},
methods: {
leftClick() {
uni.reLaunch({
url: '/pages/index/mine',// 替换为你要跳转的页面路径
});
}
}
}
</script>
<style scoped>
.container {
min-height: 100vh;
}
.reply-list {
padding: 0;
}
.reply-card {
background-color: #fff;
margin: 10px;
border-radius: 8px;
padding: 12px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.reply-item {
/* display: flex; */
margin-bottom: 12px;
}
.reply-heard{
display: flex;
gap: 10px;
}
.sub-reply {
/* margin-left: 30px; */
padding:8px 12px;
background-color: #F5F6FA;
border-radius: 6px;
}
.avatar {
width: 40px;
height: 40px;
border-radius: 50%;
flex-shrink: 0;
}
.reply-content {
flex: 1;
min-width: 0;
}
.reply-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 6px;
}
.username {
font-size: 13px;
color: #333;
font-weight: 500;
}
.time {
font-size: 12px;
color: #999;
}
.reply-text {
font-size: 13px;
color: #666;
line-height: 1.5;
word-break: break-all;
display: block;
}
</style>