Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangliang_wd
2024-09-24 10:19:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
88aa5043cb56ca961bf933e4dcc8ef776d3c1e2b
88aa5043
1 parent
60e3302f
feat:调整用户后台下线时,点赞、收藏提示逻辑
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
23 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
88aa504
...
...
@@ -5,7 +5,8 @@ import {
EmitterUtils,
EmitterEventId,
NetworkUtil,
DisplayUtils
DisplayUtils,
ToastUtils
} from 'wdKit';
import {
Action,
...
...
@@ -439,22 +440,25 @@ 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 (this.newsStatusOfUser) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
this.likeNum = Number(this.likeNum) + 1
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'
if (this.newsStatusOfUser.likeStatus === '1') {
this.likeNum = Number(this.likeNum) + 1
} else {
this.likeNum = Number(this.likeNum) - 1
}
// console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
// this.queryContentInteractCount()
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
} else {
this.likeNum = Number(this.likeNum) - 1
// 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
this.getInteractDataStatus()
}
// console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
// this.queryContentInteractCount()
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
} else {
// 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
this.getInteractDataStatus()
}
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
88aa504
import { NumberFormatterUtils, SPHelper } from 'wdKit';
import { NumberFormatterUtils, SPHelper
, ToastUtils
} from 'wdKit';
import promptAction from '@ohos.promptAction';
import {
batchLikeAndCollectParams,
...
...
@@ -526,15 +526,19 @@ export struct OperRowListView {
console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
} else {
TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
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) {
promptAction.showToast({ message: '收藏成功' })
TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
} else {
TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
}
this.queryContentInteractCount()
}
this.queryContentInteractCount()
}
console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
})
...
...
Please
register
or
login
to post a comment