Showing
10 changed files
with
45 additions
and
21 deletions
| @@ -61,6 +61,8 @@ export struct DynamicDetailComponent { | @@ -61,6 +61,8 @@ export struct DynamicDetailComponent { | ||
| 61 | @State isNetConnected: boolean = true | 61 | @State isNetConnected: boolean = true |
| 62 | @State isPageEnd: boolean = false | 62 | @State isPageEnd: boolean = false |
| 63 | 63 | ||
| 64 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 65 | + | ||
| 64 | 66 | ||
| 65 | async aboutToAppear() { | 67 | async aboutToAppear() { |
| 66 | await this.getContentDetailData() | 68 | await this.getContentDetailData() |
| @@ -431,19 +433,13 @@ export struct DynamicDetailComponent { | @@ -431,19 +433,13 @@ export struct DynamicDetailComponent { | ||
| 431 | } | 433 | } |
| 432 | } | 434 | } |
| 433 | //底部交互区 | 435 | //底部交互区 |
| 434 | - OperRowListView({ contentDetailData: this.contentDetailData | ||
| 435 | - ,interactData:this.interactDataDTO | ||
| 436 | - ,newsStatusOfUser:this.newsStatusOfUser | ||
| 437 | - ,publishCommentModel: { | ||
| 438 | - targetId: String(this.contentDetailData?.newsId || ''), | ||
| 439 | - targetRelId: this.contentDetailData?.reLInfo?.relId, | ||
| 440 | - targetTitle: this.contentDetailData?.newsTitle, | ||
| 441 | - targetRelType: this.contentDetailData?.reLInfo?.relType, | ||
| 442 | - targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId), | ||
| 443 | - keyArticle: String(this.contentDetailData?.keyArticle), | ||
| 444 | - targetType: String(this.contentDetailData?.newsType), | ||
| 445 | - } as publishCommentModel | ||
| 446 | - ,needLike:false}) | 436 | + OperRowListView({ |
| 437 | + contentDetailData: this.contentDetailData, | ||
| 438 | + publishCommentModel: this.publishCommentModel, | ||
| 439 | + operationButtonList: ['comment', 'collect', 'share'], | ||
| 440 | + styleType: 1, | ||
| 441 | + }) | ||
| 442 | + | ||
| 447 | } | 443 | } |
| 448 | } | 444 | } |
| 449 | .alignSelf(ItemAlign.Start) | 445 | .alignSelf(ItemAlign.Start) |
| @@ -176,6 +176,7 @@ export struct ImageAndTextPageComponent { | @@ -176,6 +176,7 @@ export struct ImageAndTextPageComponent { | ||
| 176 | contentDetailData: this.contentDetailData[0], | 176 | contentDetailData: this.contentDetailData[0], |
| 177 | publishCommentModel: this.publishCommentModel, | 177 | publishCommentModel: this.publishCommentModel, |
| 178 | operationButtonList: this.operationButtonList, | 178 | operationButtonList: this.operationButtonList, |
| 179 | + styleType: 1, | ||
| 179 | }) | 180 | }) |
| 180 | } | 181 | } |
| 181 | } | 182 | } |
| @@ -364,6 +364,7 @@ export struct MultiPictureDetailPageComponent { | @@ -364,6 +364,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 364 | contentDetailData: this.contentDetailData, | 364 | contentDetailData: this.contentDetailData, |
| 365 | publishCommentModel: this.publishCommentModel, | 365 | publishCommentModel: this.publishCommentModel, |
| 366 | operationButtonList: this.operationButtonList, | 366 | operationButtonList: this.operationButtonList, |
| 367 | + styleType: 2, | ||
| 367 | }) | 368 | }) |
| 368 | } | 369 | } |
| 369 | .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( | 370 | .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( |
| @@ -15,6 +15,7 @@ export struct CommentTabComponent { | @@ -15,6 +15,7 @@ export struct CommentTabComponent { | ||
| 15 | @State type: number = 1 | 15 | @State type: number = 1 |
| 16 | @State placeHolder: string = '说两句...' | 16 | @State placeHolder: string = '说两句...' |
| 17 | @State dialogController: CustomDialogController | null = null; | 17 | @State dialogController: CustomDialogController | null = null; |
| 18 | + styleType : number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) | ||
| 18 | /*回调方法*/ | 19 | /*回调方法*/ |
| 19 | dialogControllerConfirm: () => void = () => { | 20 | dialogControllerConfirm: () => void = () => { |
| 20 | } | 21 | } |
| @@ -69,6 +70,7 @@ export struct CommentIconComponent { | @@ -69,6 +70,7 @@ export struct CommentIconComponent { | ||
| 69 | @ObjectLink publishCommentModel: publishCommentModel | 70 | @ObjectLink publishCommentModel: publishCommentModel |
| 70 | /*展示类型*/ | 71 | /*展示类型*/ |
| 71 | @State type: number = 1 | 72 | @State type: number = 1 |
| 73 | + styleType : number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) | ||
| 72 | // aboutToAppear(): void { | 74 | // aboutToAppear(): void { |
| 73 | // setTimeout(() => { | 75 | // setTimeout(() => { |
| 74 | // this.publishCommentModel.totalCommentNumer = '444' | 76 | // this.publishCommentModel.totalCommentNumer = '444' |
| @@ -87,7 +89,9 @@ export struct CommentIconComponent { | @@ -87,7 +89,9 @@ export struct CommentIconComponent { | ||
| 87 | build() { | 89 | build() { |
| 88 | Row() { | 90 | Row() { |
| 89 | Stack({ alignContent: Alignment.TopEnd }) { | 91 | Stack({ alignContent: Alignment.TopEnd }) { |
| 90 | - Image($r('app.media.comment_icon')).width(24).height(24) | 92 | + // Image($r('app.media.comment_icon')).width(24).height(24) |
| 93 | + Image(this.styleType == 1 ? $r('app.media.comment_icon') : | ||
| 94 | + $r('app.media.comment_icon_white')).width(24).height(24) | ||
| 91 | // Stack({alignContent:Alignment.Start}) { | 95 | // Stack({alignContent:Alignment.Start}) { |
| 92 | if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) { | 96 | if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) { |
| 93 | RelativeContainer() { | 97 | RelativeContainer() { |
| @@ -14,6 +14,7 @@ export struct LikeComponent { | @@ -14,6 +14,7 @@ export struct LikeComponent { | ||
| 14 | @Prop data: Record<string, string> | 14 | @Prop data: Record<string, string> |
| 15 | enableBtn = true | 15 | enableBtn = true |
| 16 | componentType : number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 | 16 | componentType : number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 |
| 17 | + styleType : number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) | ||
| 17 | @State likeCount: number = 0 //点赞数 | 18 | @State likeCount: number = 0 //点赞数 |
| 18 | 19 | ||
| 19 | //上层传值 样例 | 20 | //上层传值 样例 |
| @@ -81,7 +82,9 @@ export struct LikeComponent { | @@ -81,7 +82,9 @@ export struct LikeComponent { | ||
| 81 | }else { | 82 | }else { |
| 82 | //1: 底部栏目样式 默认样式 | 83 | //1: 底部栏目样式 默认样式 |
| 83 | Column() { | 84 | Column() { |
| 84 | - Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default')) | 85 | + // Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default')) |
| 86 | + Image(this.likeStatus ? $r('app.media.icon_like_select') : this.styleType == 1 ? $r('app.media.icon_like_default') : | ||
| 87 | + $r('app.media.icon_like_default_white')) | ||
| 85 | .width(24) | 88 | .width(24) |
| 86 | .height(24) | 89 | .height(24) |
| 87 | .onClick(() => { | 90 | .onClick(() => { |
| @@ -50,6 +50,7 @@ export struct OperRowListView { | @@ -50,6 +50,7 @@ export struct OperRowListView { | ||
| 50 | @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情 | 50 | @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情 |
| 51 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件 | 51 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件 |
| 52 | @ObjectLink publishCommentModel: publishCommentModel | 52 | @ObjectLink publishCommentModel: publishCommentModel |
| 53 | + @State styleType: number = 1 | ||
| 53 | // @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 54 | // @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 54 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 55 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 55 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 56 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| @@ -59,8 +60,14 @@ export struct OperRowListView { | @@ -59,8 +60,14 @@ export struct OperRowListView { | ||
| 59 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 60 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 60 | needLike: boolean = true | 61 | needLike: boolean = true |
| 61 | 62 | ||
| 62 | - // async aboutToAppear() { | 63 | + async aboutToAppear() { |
| 64 | + console.info(TAG, '22222----', this.styleType) | ||
| 65 | + console.info(TAG, '3333----', this.needLike) | ||
| 66 | + this.handleStyle() | ||
| 67 | + } | ||
| 63 | async onDetailUpdated() { | 68 | async onDetailUpdated() { |
| 69 | + console.info(TAG, '111111----', this.styleType) | ||
| 70 | + this.handleStyle() | ||
| 64 | if (!this.contentDetailData) { | 71 | if (!this.contentDetailData) { |
| 65 | return | 72 | return |
| 66 | } | 73 | } |
| @@ -98,7 +105,8 @@ export struct OperRowListView { | @@ -98,7 +105,8 @@ export struct OperRowListView { | ||
| 98 | // AudioDialog() | 105 | // AudioDialog() |
| 99 | Row() { | 106 | Row() { |
| 100 | Column() { | 107 | Column() { |
| 101 | - Image($r('app.media.icon_arrow_left')) | 108 | + Image(this.styleType == 1 ? $r('app.media.icon_arrow_left') : |
| 109 | + $r('app.media.icon_arrow_left_white')) | ||
| 102 | .width(24) | 110 | .width(24) |
| 103 | .height(24) | 111 | .height(24) |
| 104 | .aspectRatio(1) | 112 | .aspectRatio(1) |
| @@ -160,7 +168,7 @@ export struct OperRowListView { | @@ -160,7 +168,7 @@ export struct OperRowListView { | ||
| 160 | 168 | ||
| 161 | Column() { | 169 | Column() { |
| 162 | if (this.publishCommentModel?.targetId) { | 170 | if (this.publishCommentModel?.targetId) { |
| 163 | - CommentIconComponent({ publishCommentModel: this.publishCommentModel }) | 171 | + CommentIconComponent({ publishCommentModel: this.publishCommentModel, styleType: this.styleType }) |
| 164 | } | 172 | } |
| 165 | } | 173 | } |
| 166 | .width(46) | 174 | .width(46) |
| @@ -174,7 +182,8 @@ export struct OperRowListView { | @@ -174,7 +182,8 @@ export struct OperRowListView { | ||
| 174 | Column() { | 182 | Column() { |
| 175 | if (this.likeBean?.contentId) { | 183 | if (this.likeBean?.contentId) { |
| 176 | LikeComponent({ | 184 | LikeComponent({ |
| 177 | - data: this.likeBean | 185 | + data: this.likeBean, |
| 186 | + styleType: this.styleType | ||
| 178 | }) | 187 | }) |
| 179 | } | 188 | } |
| 180 | } | 189 | } |
| @@ -189,7 +198,8 @@ export struct OperRowListView { | @@ -189,7 +198,8 @@ export struct OperRowListView { | ||
| 189 | Column() { | 198 | Column() { |
| 190 | Stack({ alignContent: Alignment.TopEnd }) { | 199 | Stack({ alignContent: Alignment.TopEnd }) { |
| 191 | Image(this.newsStatusOfUser?.collectStatus == 1 ? $r('app.media.ic_collect_check1') : | 200 | Image(this.newsStatusOfUser?.collectStatus == 1 ? $r('app.media.ic_collect_check1') : |
| 192 | - $r('app.media.iv_live_comment_collect_un')) | 201 | + this.styleType == 1 ? $r('app.media.iv_live_comment_collect_un') : |
| 202 | + $r('app.media.iv_live_comment_collect_un_white')) | ||
| 193 | .width(24) | 203 | .width(24) |
| 194 | .height(24) | 204 | .height(24) |
| 195 | .interpolation(ImageInterpolation.High) | 205 | .interpolation(ImageInterpolation.High) |
| @@ -235,7 +245,8 @@ export struct OperRowListView { | @@ -235,7 +245,8 @@ export struct OperRowListView { | ||
| 235 | @Builder | 245 | @Builder |
| 236 | builderShare() { | 246 | builderShare() { |
| 237 | Column() { | 247 | Column() { |
| 238 | - Image($r('app.media.iv_live_comment_share')) | 248 | + Image(this.styleType == 1 ? $r('app.media.iv_live_comment_share') : |
| 249 | + $r('app.media.iv_live_comment_share_white')) | ||
| 239 | .width(24) | 250 | .width(24) |
| 240 | .height(24) | 251 | .height(24) |
| 241 | .aspectRatio(1) | 252 | .aspectRatio(1) |
| @@ -248,6 +259,14 @@ export struct OperRowListView { | @@ -248,6 +259,14 @@ export struct OperRowListView { | ||
| 248 | .width(42) | 259 | .width(42) |
| 249 | } | 260 | } |
| 250 | 261 | ||
| 262 | + handleStyle() { | ||
| 263 | + if (this.styleType == 1) { | ||
| 264 | + this.bgColor = Color.White | ||
| 265 | + } else if (this.styleType == 2) { | ||
| 266 | + this.bgColor = Color.Black | ||
| 267 | + } | ||
| 268 | + } | ||
| 269 | + | ||
| 251 | share() { | 270 | share() { |
| 252 | WDShare.shareContent(this.contentDetailData) | 271 | WDShare.shareContent(this.contentDetailData) |
| 253 | } | 272 | } |
866 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_like_default_white.png
0 → 100644
1.58 KB
2.41 KB
-
Please register or login to post a comment