wangliang_wd

feat:优化人民号主页展示UI,增加点赞提示

... ... @@ -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
... ...
... ... @@ -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
})
... ...