wangliang_wd

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

@@ -137,7 +137,7 @@ struct PeopleShipHomePage { @@ -137,7 +137,7 @@ struct PeopleShipHomePage {
137 // .height('calc(100% - 44vp)') 137 // .height('calc(100% - 44vp)')
138 .onDidScroll(() => { 138 .onDidScroll(() => {
139 this.topOpacity = this.scroller.currentOffset().yOffset / 120 139 this.topOpacity = this.scroller.currentOffset().yOffset / 120
140 - if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) { 140 + if (this.scroller.currentOffset().yOffset >= this.topHeight) {
141 this.attentionOpacity = true 141 this.attentionOpacity = true
142 } else { 142 } else {
143 this.attentionOpacity = false 143 this.attentionOpacity = false
@@ -11,6 +11,7 @@ import { @@ -11,6 +11,7 @@ import {
11 batchLikeAndCollectParams, 11 batchLikeAndCollectParams,
12 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; 12 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
13 import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; 13 import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
  14 +import { promptAction } from '@kit.ArkUI';
14 15
15 const TAG = 'LikeComponent'; 16 const TAG = 'LikeComponent';
16 17
@@ -437,6 +438,9 @@ export struct LikeComponent { @@ -437,6 +438,9 @@ export struct LikeComponent {
437 console.log(TAG, "点赞 params", JSON.stringify(params)) 438 console.log(TAG, "点赞 params", JSON.stringify(params))
438 ContentDetailRequest.postExecuteLike(params).then((data) => { 439 ContentDetailRequest.postExecuteLike(params).then((data) => {
439 440
  441 + if (data.code != 0) {
  442 + promptAction.showToast({ message: data.message })
  443 + }else {
440 console.log(TAG, '点赞接口调用成功', JSON.stringify(data)) 444 console.log(TAG, '点赞接口调用成功', JSON.stringify(data))
441 445
442 // 直播点赞一直增加 446 // 直播点赞一直增加
@@ -461,6 +465,8 @@ export struct LikeComponent { @@ -461,6 +465,8 @@ export struct LikeComponent {
461 } 465 }
462 466
463 this.enableBtn = true 467 this.enableBtn = true
  468 +
  469 + }
464 }).catch(() => { 470 }).catch(() => {
465 this.enableBtn = true 471 this.enableBtn = true
466 }) 472 })