yuzhilin

稿件详情页点赞

@@ -11,6 +11,8 @@ export class H5CallNativeType { @@ -11,6 +11,8 @@ export class H5CallNativeType {
11 static jsCall_appInnerLinkMethod = 'jsCall_appInnerLinkMethod' 11 static jsCall_appInnerLinkMethod = 'jsCall_appInnerLinkMethod'
12 static jsCall_receiveH5Data = 'jsCall_receiveH5Data' 12 static jsCall_receiveH5Data = 'jsCall_receiveH5Data'
13 static jsCall_getAppLoginAuthInfo = 'jsCall_getAppLoginAuthInfo' 13 static jsCall_getAppLoginAuthInfo = 'jsCall_getAppLoginAuthInfo'
  14 + static jsCall_appNotifyEvent = 'jsCall_appNotifyEvent'
  15 +
14 // TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。 16 // TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。
15 17
16 static { 18 static {
@@ -21,7 +23,7 @@ export class H5CallNativeType { @@ -21,7 +23,7 @@ export class H5CallNativeType {
21 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appInnerLinkMethod) 23 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appInnerLinkMethod)
22 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveH5Data) 24 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveH5Data)
23 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppLoginAuthInfo) 25 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppLoginAuthInfo)
24 - 26 + H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appNotifyEvent)
25 } 27 }
26 } 28 }
27 29
@@ -13,7 +13,6 @@ import { @@ -13,7 +13,6 @@ import {
13 import DetailViewModel from '../viewmodel/DetailViewModel'; 13 import DetailViewModel from '../viewmodel/DetailViewModel';
14 import { ImageAndTextWebComponent } from './ImageAndTextWebComponent'; 14 import { ImageAndTextWebComponent } from './ImageAndTextWebComponent';
15 import { OperRowListView } from './view/OperRowListView'; 15 import { OperRowListView } from './view/OperRowListView';
16 -import router from '@ohos.router';  
17 import { RecommendList } from '../components/view/RecommendList' 16 import { RecommendList } from '../components/view/RecommendList'
18 import { CommonConstants } from 'wdConstant'; 17 import { CommonConstants } from 'wdConstant';
19 import { HttpUrlUtils } from 'wdNetwork/Index'; 18 import { HttpUrlUtils } from 'wdNetwork/Index';
@@ -75,6 +74,45 @@ export struct ImageAndTextPageComponent { @@ -75,6 +74,45 @@ export struct ImageAndTextPageComponent {
75 isPageEnd: $isPageEnd 74 isPageEnd: $isPageEnd
76 }) 75 })
77 Column() { 76 Column() {
  77 + // 点赞
  78 + if (this.contentDetailData[0]?.openLikes) {
  79 + // 点赞
  80 + Row() {
  81 + Row() {
  82 + if (this.newsStatusOfUser?.likeStatus === '1') {
  83 + Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.ic_like_check') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer_active') : $r('app.media.icon_candle_active')))
  84 + .width(24)
  85 + .height(24)
  86 + .margin({ right: 5 })
  87 + } else {
  88 + Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.icon_like') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer') : $r('app.media.icon_candle')))
  89 + .width(24)
  90 + .height(24)
  91 + .margin({ right: 5 })
  92 + }
  93 + Text(`${this.interactData?.likeNum || 0}`)
  94 + .fontSize(16)
  95 + .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
  96 + .fontWeight(500)
  97 + }
  98 + .width(140)
  99 + .height(36)
  100 + .justifyContent(FlexAlign.Center)
  101 + .alignItems(VerticalAlign.Center)
  102 + .borderRadius(20)
  103 + .border({
  104 + width: 1,
  105 + color: '#EDEDED',
  106 + })
  107 + .onClick(() => {
  108 + this.toggleLikeStatus()
  109 + })
  110 +
  111 + }.width(CommonConstants.FULL_WIDTH).height(80)
  112 + .justifyContent(FlexAlign.Center)
  113 +
  114 + Divider().strokeWidth(6).color('#f5f5f5')
  115 + }
78 if (this.recommendList.length > 0) { 116 if (this.recommendList.length > 0) {
79 RecommendList({ recommendList: this.recommendList }) 117 RecommendList({ recommendList: this.recommendList })
80 } 118 }
@@ -92,43 +130,7 @@ export struct ImageAndTextPageComponent { @@ -92,43 +130,7 @@ export struct ImageAndTextPageComponent {
92 } 130 }
93 131
94 //底部交互区 132 //底部交互区
95 - OperRowListView({contentDetailData: this.contentDetailData[0]})  
96 - /* Row() {  
97 - Image($r('app.media.icon_arrow_left'))  
98 - .width(24)  
99 - .height(24)  
100 - .onClick((event: ClickEvent) => {  
101 - router.back()  
102 - })  
103 -  
104 - Row() {  
105 - Image($r('app.media.icon_comment'))  
106 - .width(24)  
107 - .height(24)  
108 - .margin({ right: 24 })  
109 - .id('comment')  
110 -  
111 - Image($r('app.media.icon_star'))  
112 - .width(24)  
113 - .height(24)  
114 - .margin({ right: 24 })  
115 -  
116 - Image($r('app.media.icon_listen'))  
117 - .width(24)  
118 - .height(24)  
119 - .margin({ right: 24 })  
120 -  
121 - Image($r('app.media.icon_forward'))  
122 - .width(24)  
123 - .height(24)  
124 -  
125 - }  
126 - }  
127 - .width(CommonConstants.FULL_WIDTH)  
128 - .height(56)  
129 - .padding({ left: 15, right: 15, bottom: 50, top: 20 })  
130 - .justifyContent(FlexAlign.SpaceBetween)  
131 - .backgroundColor(Color.White)*/ 133 + OperRowListView({ contentDetailData: this.contentDetailData[0] })
132 } 134 }
133 135
134 } 136 }