王士厅

进入人民号“赣州消防”中的图集详情页,点击进入任意图集内容“底部互动入口进行收藏,点击收藏icon无反应

... ... @@ -20,7 +20,7 @@ export struct LikeComponent {
@State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State likeStatus: boolean = false
viewModel: LikeViewModel = new LikeViewModel()
@Prop data: Record<string, string>
@Prop @Watch('onDataUpdated') data: Record<string, string>
enableBtn = true
componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口
styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 3 透明背景
... ... @@ -35,14 +35,20 @@ export struct LikeComponent {
// this.data['channelId'] = "2059" //必须
// this.data['status'] = "1"
aboutToAppear(): void {
aboutToAppear() {
this.onDataUpdated()
}
onDataUpdated() {
if (this.data) {
if (this.data['channelId'] !== 'undefined') {
//获取点赞状态
this.getLikeStatus()
//获取点赞数
this.getLikeCount()
}
}
}
build() {
... ...
... ... @@ -40,6 +40,7 @@ const TAG = 'OperRowListView';
operationButtonList: ['comment', 'like', 'collect', 'listen', 'share']
})
*/
@Preview
@Component
export struct OperRowListView {
... ...