tianyi 1 week ago
parent
commit
29b2eb9069
  1. 15
      pages/shop/shopEvaluate.vue

15
pages/shop/shopEvaluate.vue

@ -63,16 +63,16 @@
<view class="eval-img" v-if="item.picture"> <view class="eval-img" v-if="item.picture">
<img @tap="largeImg" :src="item.picture" alt=""> <img @tap="largeImg" :src="item.picture" alt="">
</view> </view>
<view class="reply-card" :class="{'expanded': isExpanded}" v-for="(item1,index1) in item.comments" :key="index1"> <view class="reply-card" :class="{'expanded': item1.isOpen}" v-for="(item1,index1) in item.comments" :key="index1">
<!-- 标题行商家回复 + 展开/收起按钮 --> <!-- 标题行商家回复 + 展开/收起按钮 -->
<view class="reply-header"> <view class="reply-header">
<!-- 回复内容区域动态类控制展开/折叠 --> <!-- 回复内容区域动态类控制展开/折叠 -->
<view class="reply-content" :class="{ collapsed: !isExpanded, expanded: isExpanded }"> <view class="reply-content" :class="{ collapsed: !item1.isOpen, expanded: item1.isOpen }">
<text>{{item1.createByName}} : {{ item1.remark }}</text> <text>{{item1.createByName}} : {{ item1.remark }}</text>
<img :src="item1.picture" alt="" class="upload-img" style="margin-top: 10px;border-radius: 10px;"> <img :src="item1.picture" v-if="item1.picture" alt="" class="upload-img" style="margin-top: 10px;border-radius: 10px;">
</view> </view>
<view class="reply-expand-btn" @click="toggleReply"> <view class="reply-expand-btn" @click="toggleReply(index,index1)">
<text v-if="!isExpanded">展开</text> <text v-if="!item1.isOpen">展开</text>
<text v-else>收起</text> <text v-else>收起</text>
</view> </view>
</view> </view>
@ -273,8 +273,9 @@
uni.hideLoading() uni.hideLoading()
}).catch((res) => {}) }).catch((res) => {})
}, },
toggleReply() { toggleReply(i,m) {
this.isExpanded = !this.isExpanded; this.shopComments[i].comments[m].isOpen = !this.shopComments[i].comments[m].isOpen;
this.$forceUpdate()
}, },
changeStatus(v){ changeStatus(v){
this.shopComments[v].isReply = !this.shopComments[v].isReply this.shopComments[v].isReply = !this.shopComments[v].isReply

Loading…
Cancel
Save