Showing
2 changed files
with
11 additions
and
3 deletions
| @@ -5,7 +5,8 @@ import { | @@ -5,7 +5,8 @@ import { | ||
| 5 | EmitterUtils, | 5 | EmitterUtils, |
| 6 | EmitterEventId, | 6 | EmitterEventId, |
| 7 | NetworkUtil, | 7 | NetworkUtil, |
| 8 | - DisplayUtils | 8 | + DisplayUtils, |
| 9 | + ToastUtils | ||
| 9 | } from 'wdKit'; | 10 | } from 'wdKit'; |
| 10 | import { | 11 | import { |
| 11 | Action, | 12 | Action, |
| @@ -439,6 +440,9 @@ export struct ImageAndTextPageComponent { | @@ -439,6 +440,9 @@ export struct ImageAndTextPageComponent { | ||
| 439 | PageRepository.postExecuteLike(params).then(res => { | 440 | PageRepository.postExecuteLike(params).then(res => { |
| 440 | // console.log(TAG, '点赞、res', JSON.stringify(res)) | 441 | // console.log(TAG, '点赞、res', JSON.stringify(res)) |
| 441 | // console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | 442 | // console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) |
| 443 | + if (res.code != 0){ | ||
| 444 | + ToastUtils.showToast(res.message, 1000); | ||
| 445 | + }else { | ||
| 442 | if (this.newsStatusOfUser) { | 446 | if (this.newsStatusOfUser) { |
| 443 | //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | 447 | //内容点赞、取消点赞Tracking 1点赞 0取消点赞 |
| 444 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | 448 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' |
| @@ -454,7 +458,7 @@ export struct ImageAndTextPageComponent { | @@ -454,7 +458,7 @@ export struct ImageAndTextPageComponent { | ||
| 454 | // 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象 | 458 | // 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象 |
| 455 | this.getInteractDataStatus() | 459 | this.getInteractDataStatus() |
| 456 | } | 460 | } |
| 457 | - | 461 | + } |
| 458 | }) | 462 | }) |
| 459 | } | 463 | } |
| 460 | 464 |
| 1 | -import { NumberFormatterUtils, SPHelper } from 'wdKit'; | 1 | +import { NumberFormatterUtils, SPHelper, ToastUtils } from 'wdKit'; |
| 2 | import promptAction from '@ohos.promptAction'; | 2 | import promptAction from '@ohos.promptAction'; |
| 3 | import { | 3 | import { |
| 4 | batchLikeAndCollectParams, | 4 | batchLikeAndCollectParams, |
| @@ -526,6 +526,9 @@ export struct OperRowListView { | @@ -526,6 +526,9 @@ export struct OperRowListView { | ||
| 526 | 526 | ||
| 527 | console.log(TAG, '收藏点击', JSON.stringify(params)) | 527 | console.log(TAG, '收藏点击', JSON.stringify(params)) |
| 528 | PageRepository.postExecuteCollectRecord(params).then(res => { | 528 | PageRepository.postExecuteCollectRecord(params).then(res => { |
| 529 | + if (res.code != 0){ | ||
| 530 | + ToastUtils.showToast(res.message, 1000); | ||
| 531 | + }else { | ||
| 529 | if (this.newsStatusOfUser) { | 532 | if (this.newsStatusOfUser) { |
| 530 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | 533 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 |
| 531 | if (this.newsStatusOfUser.collectStatus === 1) { | 534 | if (this.newsStatusOfUser.collectStatus === 1) { |
| @@ -536,6 +539,7 @@ export struct OperRowListView { | @@ -536,6 +539,7 @@ export struct OperRowListView { | ||
| 536 | } | 539 | } |
| 537 | this.queryContentInteractCount() | 540 | this.queryContentInteractCount() |
| 538 | } | 541 | } |
| 542 | + } | ||
| 539 | console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | 543 | console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) |
| 540 | }) | 544 | }) |
| 541 | 545 |
-
Please register or login to post a comment