Showing
2 changed files
with
2 additions
and
2 deletions
| @@ -60,7 +60,7 @@ export struct PlayerRightView { | @@ -60,7 +60,7 @@ export struct PlayerRightView { | ||
| 60 | if (this.newsStatusOfUser.likeStatus === '1') { | 60 | if (this.newsStatusOfUser.likeStatus === '1') { |
| 61 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 | 61 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 |
| 62 | } else { | 62 | } else { |
| 63 | - this.interactData.likeNum = Number(this.interactData.likeNum || 0) - 1 | 63 | + this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) |
| 64 | } | 64 | } |
| 65 | console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) | 65 | console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) |
| 66 | // this.queryContentInteractCount() | 66 | // this.queryContentInteractCount() |
| @@ -94,7 +94,7 @@ export struct PlayerRightView { | @@ -94,7 +94,7 @@ export struct PlayerRightView { | ||
| 94 | if (this.newsStatusOfUser.collectStatus === 1) { | 94 | if (this.newsStatusOfUser.collectStatus === 1) { |
| 95 | this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1 | 95 | this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1 |
| 96 | } else { | 96 | } else { |
| 97 | - this.interactData.collectNum = Number(this.interactData.collectNum || 0) - 1 | 97 | + this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1) |
| 98 | } | 98 | } |
| 99 | console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) | 99 | console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) |
| 100 | } | 100 | } |
-
Please register or login to post a comment