|
|
@ -1,34 +1,39 @@ |
|
|
|
<template> |
|
|
|
<view class="my-comment-page"> |
|
|
|
<navbar title="我的评论" :leftClick="true" @leftClick="goBack" /> |
|
|
|
<view class="comment-section"> |
|
|
|
<view class="section-title">未读评论·{{ unreadComments.length }}</view> |
|
|
|
<myCommentItem :item="item" v-for="(item, idx) in unreadComments" :key="idx"/> |
|
|
|
<uv-empty mode="list" v-if="unreadComments.length == 0"></uv-empty> |
|
|
|
</view> |
|
|
|
<view class="comment-section history-section"> |
|
|
|
<view class="section-title">历史评论</view> |
|
|
|
<!-- <view v-for="(item, idx) in list" :key="idx" class="comment-card"> |
|
|
|
<uv-avatar :src="item.hanHaiMember.headImage" size="44" shape="circle" class="avatar" /> |
|
|
|
<view class="comment-main"> |
|
|
|
<view class="comment-header"> |
|
|
|
<text class="username">{{ item.hanHaiMember.nickName }}</text> |
|
|
|
<text class="from">来自《{{ item.commonShop.name }}》</text> |
|
|
|
</view> |
|
|
|
<view class="comment-content">{{ item.comment }}</view> |
|
|
|
<view class="comment-footer"> |
|
|
|
<text class="comment-time">{{ item.createTime }}</text> |
|
|
|
<view class="reply-btn-wrap" @click="goToReply(item)"> |
|
|
|
<text class="reply-btn">回复</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<uv-empty mode="list" v-if="list.length == 0"></uv-empty> |
|
|
|
|
|
|
|
<myCommentItem :item="item" v-for="(item, idx) in list" :key="idx"/> |
|
|
|
</view> |
|
|
|
<navbar title="我的评论" :leftClick="true" @leftClick="$utils.navigateBack" /> |
|
|
|
|
|
|
|
<uv-tabs :list="tabs" |
|
|
|
:activeStyle="{ color: '#0A2463', fontWeight: 600 }" |
|
|
|
lineColor="#0A2463" lineHeight="8rpx" |
|
|
|
lineWidth="50rpx" |
|
|
|
:scrollable="false" |
|
|
|
:current="current" |
|
|
|
@click="clickTabs"></uv-tabs> |
|
|
|
|
|
|
|
<template v-if="current == 0"> |
|
|
|
<view class="comment-section"> |
|
|
|
<myCommentItem :item="item" |
|
|
|
edit |
|
|
|
@getData="getData" |
|
|
|
v-for="(item, idx) in list" :key="idx"/> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template v-if="current == 1"> |
|
|
|
<view class="comment-section"> |
|
|
|
<view class="section-title">未读评论·{{ unreadComments.length }}</view> |
|
|
|
<myCommentItem :item="item" v-for="(item, idx) in unreadComments" :key="idx"/> |
|
|
|
<uv-empty mode="list" v-if="unreadComments.length == 0"></uv-empty> |
|
|
|
</view> |
|
|
|
<view class="comment-section history-section"> |
|
|
|
<view class="section-title">历史评论</view> |
|
|
|
<myCommentItem |
|
|
|
:item="item" |
|
|
|
v-for="(item, idx) in list" :key="idx"/> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<uv-empty mode="list" v-if="list.length == 0"></uv-empty> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -44,18 +49,41 @@ |
|
|
|
return { |
|
|
|
mixinsListApi : 'getMyCommentList', |
|
|
|
unreadComments: [], |
|
|
|
tabs: [ |
|
|
|
{ |
|
|
|
name: '我的评论' |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '回复我的' |
|
|
|
}, |
|
|
|
], |
|
|
|
current : 0, |
|
|
|
apiList : [ |
|
|
|
'getMyCommentList', |
|
|
|
'getMyReplyCommentList' |
|
|
|
], |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.queryParams.type = 'Y' |
|
|
|
this.mixinsListApi = this.apiList[this.current] |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//点击tab栏 |
|
|
|
clickTabs({ index }) { |
|
|
|
this.queryParams.pageSize = 10 |
|
|
|
this.current = index |
|
|
|
|
|
|
|
this.mixinsListApi = this.apiList[this.current] |
|
|
|
|
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
//获取未读 |
|
|
|
getList(){ |
|
|
|
this.$fetch('getMyCommentList', { |
|
|
|
this.$fetch('getMyReplyCommentList', { |
|
|
|
type : 'N', |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 100000 |
|
|
|