Fix:3959 【商城小程序】资讯详情页点赞或者取消点赞,评论数刷新为0

This commit is contained in:
LinCyJang
2025-07-03 23:42:10 +08:00
parent 9e7835ce0b
commit a3fb2e5bcf
+3 -3
View File
@@ -73,7 +73,7 @@
</view>
<view class="flex">
<u-icon name="chat" size="24"></u-icon>
<text class="seeNum-txt">{{ item.replyCount || 0 }}</text>
<text class="seeNum-txt">{{ item.replyCount || comments.length }}</text>
</view>
</view>
</view>
@@ -301,7 +301,7 @@ export default {
addComment(params).then((res) => {
console.log(res);
uni.hideLoading();
this.getComment()
this.init()
this.reply = ''
this.currentComment = {}
this.item.replyCount === null ? this.item.replyCount = 1 : this.item.replyCount++
@@ -335,7 +335,7 @@ export default {
getHotelNewsZan(this.id)
.then((res) => {
uni.hideLoading();
this.item = res.data;
getHotelNewsDetail(this.id).then(({ data }) => (this.item = data));
})
.catch((err) => {
uni.hideLoading();