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
王士厅
2024-07-17 18:03:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
656b3dcc126a21c2c55d94b06b1fb4d0c37093de
656b3dcc
1 parent
31683f4e
轮播卡-文章专题_已收藏专题进入详情页、收藏按钮未点亮展示
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
9 deletions
sight_harmony/features/wdBean/src/main/ets/bean/detail/ContentDetailDTO.ts
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdBean/src/main/ets/bean/detail/ContentDetailDTO.ts
View file @
656b3dc
...
...
@@ -76,4 +76,5 @@ export class ContentDetailDTO {
// 本地字段
showTime
:
boolean
=
false
;
isLogin
?:
string
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
656b3dc
...
...
@@ -48,7 +48,6 @@ export struct ImageAndTextPageComponent {
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State recommendList: ContentDTO[] = []
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State getNewsStatusOfUser: boolean = false // 接口获取点赞、收藏状态,为true时获取失败
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State isPageEnd: boolean = false
@State publishTime: string = ''
...
...
@@ -74,10 +73,6 @@ export struct ImageAndTextPageComponent {
pageShowForUpdateData() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
// 未登录查不到稿件收藏状态,导致newsStatusOfUser为undefined,影响后续点赞效果
if(this.getNewsStatusOfUser) {
this.getInteractDataStatus()
}
}
//内容浏览Tracking
...
...
@@ -373,11 +368,9 @@ export struct ImageAndTextPageComponent {
// console.log(TAG,'contentDetailData', JSON.stringify(params.contentList))
let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
console.log(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data))
this.getNewsStatusOfUser = false // 获取成功
this.newsStatusOfUser = data[0];
// console.log(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
} catch (exception) {
this.getNewsStatusOfUser = true // 获取失败
console.error(TAG,'exception', JSON.stringify(exception))
}
}
...
...
@@ -461,6 +454,10 @@ export struct ImageAndTextPageComponent {
}
}
})
// 登录成功
EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => {
this.getInteractDataStatus()
})
}
aboutToDisappear() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
View file @
656b3dc
...
...
@@ -83,6 +83,12 @@ export struct LiveOperRowListView {
this.onDetailUpdated()
this.contentTrackingDict()
this.checkCanInputComment()
// 登录成功
EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => {
this.getInteractDataStatus()
// 激活点赞组件监听
this.contentDetailData['isLogin'] = 'y'
})
}
contentTrackingDict(){
...
...
@@ -103,7 +109,7 @@ export struct LiveOperRowListView {
if (user_id) {
this.getInteractDataStatus()
}
await
this.queryContentInteractCount()
this.queryContentInteractCount()
console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
656b3dc
...
...
@@ -114,6 +114,12 @@ export struct OperRowListView {
}
}
})
// 登录成功
EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => {
this.getInteractDataStatus()
// 激活点赞组件监听
this.likeBean['isLogin'] = 'y'
})
this.contentTrackingDict()
}
...
...
@@ -135,7 +141,7 @@ export struct OperRowListView {
if (user_id) {
this.getInteractDataStatus()
}
await
this.queryContentInteractCount()
this.queryContentInteractCount()
// 点赞需要数据
this.likeBean['contentId'] = this.contentDetailData.newsId + ''
if(this.contentDetailData.userInfo?.userName) {
...
...
Please
register
or
login
to post a comment