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-19 14:52:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
94c058fd5985f767421477cd4355a3b9e445e599
94c058fd
1 parent
8a8cc404
feat:优化人民号主页展示UI,增加点赞提示
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
18 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/PeopleShipHomePage.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/PeopleShipHomePage.ets
View file @
94c058f
...
...
@@ -137,7 +137,7 @@ struct PeopleShipHomePage {
// .height('calc(100% - 44vp)')
.onDidScroll(() => {
this.topOpacity = this.scroller.currentOffset().yOffset / 120
if (this.scroller.currentOffset().yOffset >= this.topHeight
- 66
) {
if (this.scroller.currentOffset().yOffset >= this.topHeight) {
this.attentionOpacity = true
} else {
this.attentionOpacity = false
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
View file @
94c058f
...
...
@@ -11,6 +11,7 @@ import {
batchLikeAndCollectParams,
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
import { promptAction } from '@kit.ArkUI';
const TAG = 'LikeComponent';
...
...
@@ -437,30 +438,35 @@ export struct LikeComponent {
console.log(TAG, "点赞 params", JSON.stringify(params))
ContentDetailRequest.postExecuteLike(params).then((data) => {
console.log(TAG, '点赞接口调用成功', JSON.stringify(data))
if (data.code != 0) {
promptAction.showToast({ message: data.message })
}else {
console.log(TAG, '点赞接口调用成功', JSON.stringify(data))
// 直播点赞一直增加
if (this.contentDetailData.liveInfo) {
this.likeStatus = true
this.likeCount++
TrackingContent.like(true,this.pageId,this.pageName,this.pageParam)
} else {
this.likeStatus = !this.likeStatus
//点赞和取消点赞成功后更新点赞数
if (this.likeStatus) {
// 直播点赞一直增加
if (this.contentDetailData.liveInfo) {
this.likeStatus = true
this.likeCount++
TrackingContent.like(true,this.pageId,this.pageName,this.pageParam)
} else {
this.likeCount--
TrackingContent.like(false,this.pageId,this.pageName,this.pageParam)
this.likeStatus = !this.likeStatus
//点赞和取消点赞成功后更新点赞数
if (this.likeStatus) {
this.likeCount++
TrackingContent.like(true,this.pageId,this.pageName,this.pageParam)
} else {
this.likeCount--
TrackingContent.like(false,this.pageId,this.pageName,this.pageParam)
}
}
}
if (this.likeCount <= 0) {
this.likeCount = 0
}
if (this.likeCount <= 0) {
this.likeCount = 0
}
this.enableBtn = true
this.enableBtn = true
}
}).catch(() => {
this.enableBtn = true
})
...
...
Please
register
or
login
to post a comment