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>
<view class="flex"> <view class="flex">
<u-icon name="chat" size="24"></u-icon> <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> </view>
</view> </view>
@@ -301,7 +301,7 @@ export default {
addComment(params).then((res) => { addComment(params).then((res) => {
console.log(res); console.log(res);
uni.hideLoading(); uni.hideLoading();
this.getComment() this.init()
this.reply = '' this.reply = ''
this.currentComment = {} this.currentComment = {}
this.item.replyCount === null ? this.item.replyCount = 1 : this.item.replyCount++ this.item.replyCount === null ? this.item.replyCount = 1 : this.item.replyCount++
@@ -335,7 +335,7 @@ export default {
getHotelNewsZan(this.id) getHotelNewsZan(this.id)
.then((res) => { .then((res) => {
uni.hideLoading(); uni.hideLoading();
this.item = res.data; getHotelNewsDetail(this.id).then(({ data }) => (this.item = data));
}) })
.catch((err) => { .catch((err) => {
uni.hideLoading(); uni.hideLoading();