wangliang_wd

feat:调整用户后台下线时,点赞、收藏提示逻辑

... ... @@ -5,7 +5,8 @@ import {
EmitterUtils,
EmitterEventId,
NetworkUtil,
DisplayUtils
DisplayUtils,
ToastUtils
} from 'wdKit';
import {
Action,
... ... @@ -439,6 +440,9 @@ export struct ImageAndTextPageComponent {
PageRepository.postExecuteLike(params).then(res => {
// console.log(TAG, '点赞、res', JSON.stringify(res))
// console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (res.code != 0){
ToastUtils.showToast(res.message, 1000);
}else {
if (this.newsStatusOfUser) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
... ... @@ -454,7 +458,7 @@ export struct ImageAndTextPageComponent {
// 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
this.getInteractDataStatus()
}
}
})
}
... ...
import { NumberFormatterUtils, SPHelper } from 'wdKit';
import { NumberFormatterUtils, SPHelper, ToastUtils } from 'wdKit';
import promptAction from '@ohos.promptAction';
import {
batchLikeAndCollectParams,
... ... @@ -526,6 +526,9 @@ export struct OperRowListView {
console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
if (res.code != 0){
ToastUtils.showToast(res.message, 1000);
}else {
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
... ... @@ -536,6 +539,7 @@ export struct OperRowListView {
}
this.queryContentInteractCount()
}
}
console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
})
... ...