Showing
8 changed files
with
129 additions
and
81 deletions
| @@ -5,7 +5,6 @@ import { Card3Component } from './cardview/Card3Component'; | @@ -5,7 +5,6 @@ import { Card3Component } from './cardview/Card3Component'; | ||
| 5 | import { Card4Component } from './cardview/Card4Component'; | 5 | import { Card4Component } from './cardview/Card4Component'; |
| 6 | import { Card5Component } from './cardview/Card5Component'; | 6 | import { Card5Component } from './cardview/Card5Component'; |
| 7 | import { Card6Component } from './cardview/Card6Component'; | 7 | import { Card6Component } from './cardview/Card6Component'; |
| 8 | -import { Card9Component } from './cardview/Card9Component'; | ||
| 9 | import { Card10Component } from './cardview/Card10Component'; | 8 | import { Card10Component } from './cardview/Card10Component'; |
| 10 | import { Card11Component } from './cardview/Card11Component'; | 9 | import { Card11Component } from './cardview/Card11Component'; |
| 11 | import { Card12Component } from './cardview/Card12Component'; | 10 | import { Card12Component } from './cardview/Card12Component'; |
| @@ -48,8 +47,6 @@ export struct CardParser { | @@ -48,8 +47,6 @@ export struct CardParser { | ||
| 48 | } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle | 47 | } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle |
| 49 | .Card_13) { | 48 | .Card_13) { |
| 50 | Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) | 49 | Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) |
| 51 | - } else if (contentDTO.appStyle === CompStyle.Card_09) { | ||
| 52 | - Card9Component({ contentDTO }) | ||
| 53 | } else if (contentDTO.appStyle === CompStyle.Card_10) { | 50 | } else if (contentDTO.appStyle === CompStyle.Card_10) { |
| 54 | Card10Component({ compDTO: this.compDTO, contentDTO }) | 51 | Card10Component({ compDTO: this.compDTO, contentDTO }) |
| 55 | } else if (contentDTO.appStyle === CompStyle.Card_11) { | 52 | } else if (contentDTO.appStyle === CompStyle.Card_11) { |
| @@ -4,6 +4,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -4,6 +4,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 4 | import PageModel from '../viewmodel/PageModel'; | 4 | import PageModel from '../viewmodel/PageModel'; |
| 5 | import { CardParser } from './CardParser'; | 5 | import { CardParser } from './CardParser'; |
| 6 | import { Card2Component } from './cardview/Card2Component'; | 6 | import { Card2Component } from './cardview/Card2Component'; |
| 7 | +import { Card9Component } from './cardview/Card9Component'; | ||
| 7 | import { Card5Component } from './cardview/Card5Component'; | 8 | import { Card5Component } from './cardview/Card5Component'; |
| 8 | import { AdvCardParser } from './cardViewAdv/AdvCardParser'; | 9 | import { AdvCardParser } from './cardViewAdv/AdvCardParser'; |
| 9 | import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01'; | 10 | import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01'; |
| @@ -67,64 +68,68 @@ export struct CompParser { | @@ -67,64 +68,68 @@ export struct CompParser { | ||
| 67 | 68 | ||
| 68 | if (this.compDTO.compStyle === CompStyle.Label_03) { | 69 | if (this.compDTO.compStyle === CompStyle.Label_03) { |
| 69 | LabelComponent({ compDTO: this.compDTO }) | 70 | LabelComponent({ compDTO: this.compDTO }) |
| 70 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 71 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 71 | } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | 72 | } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { |
| 72 | if (this.compDTO.operDataList.length > this.audioItems.length) { | 73 | if (this.compDTO.operDataList.length > this.audioItems.length) { |
| 73 | ZhCarouselLayout01({ compDTO: this.compDTO }) | 74 | ZhCarouselLayout01({ compDTO: this.compDTO }) |
| 74 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 75 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 75 | } | 76 | } |
| 76 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && | 77 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && |
| 77 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" | 78 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" |
| 78 | 79 | ||
| 79 | LiveHorizontalCardComponent({ compDTO: this.compDTO }) | 80 | LiveHorizontalCardComponent({ compDTO: this.compDTO }) |
| 80 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 81 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 81 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { | 82 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { |
| 82 | if (this.compDTO.operDataList.length > 1) { | 83 | if (this.compDTO.operDataList.length > 1) { |
| 83 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO }) | 84 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO }) |
| 84 | } else { | 85 | } else { |
| 85 | HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO }) | 86 | HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO }) |
| 86 | } | 87 | } |
| 87 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 88 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 88 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { | 89 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { |
| 89 | ZhSingleRow02({ compDTO: this.compDTO }) | 90 | ZhSingleRow02({ compDTO: this.compDTO }) |
| 90 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 91 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 91 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | 92 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { |
| 92 | ZhSingleRow03({ compDTO: this.compDTO }) | 93 | ZhSingleRow03({ compDTO: this.compDTO }) |
| 93 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 94 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 94 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 | 95 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 |
| 95 | //ZhGridLayout02({ compDTO: this.compDTO }) | 96 | //ZhGridLayout02({ compDTO: this.compDTO }) |
| 96 | CompNormalTitle({ compDTO: this.compDTO }) | 97 | CompNormalTitle({ compDTO: this.compDTO }) |
| 97 | - // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 98 | + // Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 98 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 | 99 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 |
| 99 | 100 | ||
| 100 | ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList }) | 101 | ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList }) |
| 101 | 102 | ||
| 102 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { | 103 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { |
| 103 | ZhGridLayout03({ compDTO: this.compDTO }) | 104 | ZhGridLayout03({ compDTO: this.compDTO }) |
| 104 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 105 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 105 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) { | 106 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) { |
| 106 | ZhSingleRow04({ compDTO: this.compDTO }) | 107 | ZhSingleRow04({ compDTO: this.compDTO }) |
| 107 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 108 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 108 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) { | 109 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) { |
| 109 | // ZhSingleRow05({ compDTO }) | 110 | // ZhSingleRow05({ compDTO }) |
| 110 | - // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 111 | + // Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 111 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { | 112 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { |
| 112 | ZhSingleRow06({ compDTO: this.compDTO }) | 113 | ZhSingleRow06({ compDTO: this.compDTO }) |
| 113 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 114 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 114 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | 115 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { |
| 115 | //头图卡 和comStyle 2相同, | 116 | //头图卡 和comStyle 2相同, |
| 116 | Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy }) | 117 | Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy }) |
| 117 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 118 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 118 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { | 119 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { |
| 119 | // 大图卡 | 120 | // 大图卡 |
| 120 | Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] }) | 121 | Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] }) |
| 121 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 122 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 123 | + } else if (this.compDTO.compStyle === CompStyle.Card_09) { | ||
| 124 | + //时间链卡 | ||
| 125 | + Card9Component({ contentDTO:this.compDTO.operDataList[0] }) | ||
| 126 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | ||
| 122 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) { | 127 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) { |
| 123 | ZhSingleColumn04({ compDTO: this.compDTO }) | 128 | ZhSingleColumn04({ compDTO: this.compDTO }) |
| 124 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 129 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 125 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) { | 130 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) { |
| 126 | // ZhSingleColumn05({ compDTO: compDTO }) | 131 | // ZhSingleColumn05({ compDTO: compDTO }) |
| 127 | - // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 132 | + // Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 128 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { | 133 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { |
| 129 | Divider().strokeWidth(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 }) | 134 | Divider().strokeWidth(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 }) |
| 130 | Divider().strokeWidth(6).color('#f5f5f5') | 135 | Divider().strokeWidth(6).color('#f5f5f5') |
| @@ -133,10 +138,10 @@ export struct CompParser { | @@ -133,10 +138,10 @@ export struct CompParser { | ||
| 133 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 | 138 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 |
| 134 | AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) | 139 | AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) |
| 135 | //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 }) | 140 | //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 }) |
| 136 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 141 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 137 | } else if (!Number.isNaN(Number(this.compDTO.compStyle))) { | 142 | } else if (!Number.isNaN(Number(this.compDTO.compStyle))) { |
| 138 | CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); | 143 | CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); |
| 139 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | 144 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 140 | } else { | 145 | } else { |
| 141 | // Text(this.compDTO.compStyle) | 146 | // Text(this.compDTO.compStyle) |
| 142 | // .width(CommonConstants.FULL_PARENT) | 147 | // .width(CommonConstants.FULL_PARENT) |
| @@ -21,7 +21,7 @@ export struct MultiPictureDetailItemComponent { | @@ -21,7 +21,7 @@ export struct MultiPictureDetailItemComponent { | ||
| 21 | .alt($r('app.media.datail_imageLoading_w')) | 21 | .alt($r('app.media.datail_imageLoading_w')) |
| 22 | 22 | ||
| 23 | .width(this.imageWidth) | 23 | .width(this.imageWidth) |
| 24 | - .objectFit(ImageFit.Contain) | 24 | + .objectFit(ImageFit.Auto) |
| 25 | .interpolation(ImageInterpolation.High) | 25 | .interpolation(ImageInterpolation.High) |
| 26 | .onComplete(event => { | 26 | .onComplete(event => { |
| 27 | this.imageWidth = '100%' | 27 | this.imageWidth = '100%' |
| @@ -114,7 +114,7 @@ export class commentItemModel { | @@ -114,7 +114,7 @@ export class commentItemModel { | ||
| 114 | /*评论点赞状态 0-未点赞 1-已点赞*/ | 114 | /*评论点赞状态 0-未点赞 1-已点赞*/ |
| 115 | api_status: boolean = false; | 115 | api_status: boolean = false; |
| 116 | api_level: string = ''; | 116 | api_level: string = ''; |
| 117 | - api_levelHead: string = 'http'; | 117 | + api_levelHead: string = ''; |
| 118 | api_userId: string = ''; | 118 | api_userId: string = ''; |
| 119 | api_creatorId: string = ''; | 119 | api_creatorId: string = ''; |
| 120 | api_userType: string = ''; | 120 | api_userType: string = ''; |
| 1 | -import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource } from 'wdKit/Index'; | 1 | +import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource, StringUtils } from 'wdKit/Index'; |
| 2 | import { commentItemModel, WDPublicUserType } from '../model/CommentModel'; | 2 | import { commentItemModel, WDPublicUserType } from '../model/CommentModel'; |
| 3 | import commentViewModel from '../viewmodel/CommentViewModel'; | 3 | import commentViewModel from '../viewmodel/CommentViewModel'; |
| 4 | import { CommentText } from './CommentText'; | 4 | import { CommentText } from './CommentText'; |
| @@ -303,34 +303,7 @@ struct ChildCommentItem { | @@ -303,34 +303,7 @@ struct ChildCommentItem { | ||
| 303 | Column() { | 303 | Column() { |
| 304 | Row() { | 304 | Row() { |
| 305 | //头像 | 305 | //头像 |
| 306 | - Stack() { | ||
| 307 | - Image(this.item.fromUserHeader) | ||
| 308 | - .alt($r('app.media.default_head')) | ||
| 309 | - .width('24') | ||
| 310 | - .height('24') | ||
| 311 | - .objectFit(ImageFit.Cover) | ||
| 312 | - .borderRadius(16) | ||
| 313 | - Image(this.item.api_levelHead) | ||
| 314 | - .width('36') | ||
| 315 | - .height('36') | ||
| 316 | - .objectFit(ImageFit.Cover) | ||
| 317 | - .borderRadius(24) | ||
| 318 | - } | ||
| 319 | - .width(48) | ||
| 320 | - .height(48) | ||
| 321 | - .margin({ left: 47 }) | ||
| 322 | - .alignContent(Alignment.Center) | ||
| 323 | - .onClick(() => { | ||
| 324 | - // TODO 跳转个人详情 | ||
| 325 | - // 跳转到号主页 | ||
| 326 | - if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 327 | - const params: Params = { | ||
| 328 | - creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 329 | - pageID: '' | ||
| 330 | - } | ||
| 331 | - WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 332 | - } | ||
| 333 | - }) | 306 | + this.headerView() |
| 334 | 307 | ||
| 335 | //昵称 | 308 | //昵称 |
| 336 | Text() { | 309 | Text() { |
| @@ -354,7 +327,7 @@ struct ChildCommentItem { | @@ -354,7 +327,7 @@ struct ChildCommentItem { | ||
| 354 | /// 人民号>置顶>作者 | 327 | /// 人民号>置顶>作者 |
| 355 | 328 | ||
| 356 | //人民号 | 329 | //人民号 |
| 357 | - if (this.item.fromUserType === WDPublicUserType.WDPublicUserType_Matrix) { | 330 | + if (this.item.fromUserType !== 1) { |
| 358 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); | 331 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); |
| 359 | } | 332 | } |
| 360 | //置顶 | 333 | //置顶 |
| @@ -400,6 +373,53 @@ struct ChildCommentItem { | @@ -400,6 +373,53 @@ struct ChildCommentItem { | ||
| 400 | .width('100%') | 373 | .width('100%') |
| 401 | } | 374 | } |
| 402 | 375 | ||
| 376 | + @Builder headerView() { | ||
| 377 | + Stack() { | ||
| 378 | + Stack() { | ||
| 379 | + Image(this.item.fromUserHeader) | ||
| 380 | + .alt($r('app.media.default_head')) | ||
| 381 | + .width(24) | ||
| 382 | + .height(24) | ||
| 383 | + .objectFit(ImageFit.Cover) | ||
| 384 | + .borderRadius(16) | ||
| 385 | + | ||
| 386 | + if (this.item.api_authIcon && this.item.api_authIcon.length) { | ||
| 387 | + Image(this.item.api_authIcon) // 加v | ||
| 388 | + .width(14).height(14) | ||
| 389 | + .objectFit(ImageFit.Cover) | ||
| 390 | + } | ||
| 391 | + }.width(24).height(24) | ||
| 392 | + .alignContent(Alignment.BottomEnd) | ||
| 393 | + | ||
| 394 | + if ((!this.item.api_authIcon || this.item.api_authIcon.length == 0) | ||
| 395 | + && this.item.fromUserType === 1 | ||
| 396 | + && ((this.item.api_levelHead && this.item.api_levelHead.length > 0) | ||
| 397 | + || (this.item.avatarFrame && this.item.avatarFrame.length > 0))) { | ||
| 398 | + Image(this.customBorderIconURL()) | ||
| 399 | + .width('36') | ||
| 400 | + .height('36') | ||
| 401 | + .objectFit(ImageFit.Cover) | ||
| 402 | + .borderRadius(24) | ||
| 403 | + } | ||
| 404 | + } | ||
| 405 | + .width(48).height(48) | ||
| 406 | + .margin({ left: 47 }) | ||
| 407 | + .alignContent(Alignment.Center) | ||
| 408 | + .onClick(() => { | ||
| 409 | + commentViewModel.jumpToAccountPage(this.item) | ||
| 410 | + }) | ||
| 411 | + } | ||
| 412 | + | ||
| 413 | + customBorderIconURL() : string { | ||
| 414 | + if (this.item.avatarFrame.length > 0) { | ||
| 415 | + return this.item.avatarFrame | ||
| 416 | + } | ||
| 417 | + if (this.item.fromUserType === 1) { | ||
| 418 | + return this.item.api_levelHead | ||
| 419 | + } | ||
| 420 | + return "" | ||
| 421 | + } | ||
| 422 | + | ||
| 403 | replyComment() { | 423 | replyComment() { |
| 404 | if (this.item.id && this.item.checkStatus == '2') { // 审核通过的才显示回复 | 424 | if (this.item.id && this.item.checkStatus == '2') { // 审核通过的才显示回复 |
| 405 | this.publishCommentModel.rootCommentId = this.item.rootCommentId | 425 | this.publishCommentModel.rootCommentId = this.item.rootCommentId |
| @@ -498,26 +518,7 @@ struct commentHeaderView { | @@ -498,26 +518,7 @@ struct commentHeaderView { | ||
| 498 | Column() { | 518 | Column() { |
| 499 | Row() { | 519 | Row() { |
| 500 | //头像 | 520 | //头像 |
| 501 | - Stack() { | ||
| 502 | - Image(this.item.fromUserHeader) | ||
| 503 | - .alt($r('app.media.default_head')) | ||
| 504 | - .width('32') | ||
| 505 | - .height('32') | ||
| 506 | - .objectFit(ImageFit.Cover) | ||
| 507 | - .borderRadius(16) | ||
| 508 | - Image(this.item.api_levelHead) | ||
| 509 | - .width('48') | ||
| 510 | - .height('48') | ||
| 511 | - .objectFit(ImageFit.Cover) | ||
| 512 | - .borderRadius(24) | ||
| 513 | - } | ||
| 514 | - .width(48) | ||
| 515 | - .height(48) | ||
| 516 | - .margin({ left: 8 }) | ||
| 517 | - .alignContent(Alignment.Center) | ||
| 518 | - .onClick(() => { | ||
| 519 | - commentViewModel.jumpToAccountPage(this.item) | ||
| 520 | - }) | 521 | + this.headerView() |
| 521 | 522 | ||
| 522 | //昵称 | 523 | //昵称 |
| 523 | Text(this.item.fromUserName) | 524 | Text(this.item.fromUserName) |
| @@ -531,7 +532,7 @@ struct commentHeaderView { | @@ -531,7 +532,7 @@ struct commentHeaderView { | ||
| 531 | /// 人民号>置顶>作者 | 532 | /// 人民号>置顶>作者 |
| 532 | 533 | ||
| 533 | //人民号 | 534 | //人民号 |
| 534 | - if (this.item.fromUserType === WDPublicUserType.WDPublicUserType_Matrix) { | 535 | + if (this.item.fromUserType !== 1) { |
| 535 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); | 536 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); |
| 536 | } | 537 | } |
| 537 | //置顶 | 538 | //置顶 |
| @@ -573,6 +574,53 @@ struct commentHeaderView { | @@ -573,6 +574,53 @@ struct commentHeaderView { | ||
| 573 | .padding({bottom: 8}) | 574 | .padding({bottom: 8}) |
| 574 | } | 575 | } |
| 575 | 576 | ||
| 577 | + @Builder headerView() { | ||
| 578 | + Stack() { | ||
| 579 | + Stack() { | ||
| 580 | + Image(this.item.fromUserHeader) | ||
| 581 | + .alt($r('app.media.default_head')) | ||
| 582 | + .width(32) | ||
| 583 | + .height(32) | ||
| 584 | + .objectFit(ImageFit.Cover) | ||
| 585 | + .borderRadius(16) | ||
| 586 | + | ||
| 587 | + if (this.item.api_authIcon && this.item.api_authIcon.length > 0) { | ||
| 588 | + Image(this.item.api_authIcon) // 加v | ||
| 589 | + .width(14).height(14) | ||
| 590 | + .objectFit(ImageFit.Cover) | ||
| 591 | + } | ||
| 592 | + }.width(32).height(32) | ||
| 593 | + .alignContent(Alignment.BottomEnd) | ||
| 594 | + | ||
| 595 | + if ((!this.item.api_authIcon || this.item.api_authIcon.length == 0) | ||
| 596 | + && this.item.fromUserType === 1 | ||
| 597 | + && ((this.item.api_levelHead && this.item.api_levelHead.length > 0) | ||
| 598 | + || (this.item.avatarFrame && this.item.avatarFrame.length > 0))) { | ||
| 599 | + Image(this.customBorderIconURL()) | ||
| 600 | + .width(48) | ||
| 601 | + .height(48) | ||
| 602 | + .objectFit(ImageFit.Cover) | ||
| 603 | + .borderRadius(24) | ||
| 604 | + } | ||
| 605 | + } | ||
| 606 | + .width(48).height(48) | ||
| 607 | + .margin({ left: 8 }) | ||
| 608 | + .alignContent(Alignment.Center) | ||
| 609 | + .onClick(() => { | ||
| 610 | + commentViewModel.jumpToAccountPage(this.item) | ||
| 611 | + }) | ||
| 612 | + } | ||
| 613 | + | ||
| 614 | + customBorderIconURL() : string { | ||
| 615 | + if (this.item.avatarFrame.length > 0) { | ||
| 616 | + return this.item.avatarFrame | ||
| 617 | + } | ||
| 618 | + if (this.item.fromUserType === 1) { | ||
| 619 | + return this.item.api_levelHead | ||
| 620 | + } | ||
| 621 | + return "" | ||
| 622 | + } | ||
| 623 | + | ||
| 576 | replyComment() { | 624 | replyComment() { |
| 577 | if (this.item.id && this.item.checkStatus == '2') { // 审核通过的才显示回复 | 625 | if (this.item.id && this.item.checkStatus == '2') { // 审核通过的才显示回复 |
| 578 | this.publishCommentModel.rootCommentId = this.item.rootCommentId | 626 | this.publishCommentModel.rootCommentId = this.item.rootCommentId |
| @@ -596,7 +644,7 @@ struct commentFooterView { | @@ -596,7 +644,7 @@ struct commentFooterView { | ||
| 596 | Row() { | 644 | Row() { |
| 597 | 645 | ||
| 598 | Row({ space: 6 }) { | 646 | Row({ space: 6 }) { |
| 599 | - Text(this.item.region ? (this.item.region + '网友') : '人民日报客户端网友') | 647 | + Text(this.item.region.length > 0 ? (this.item.region + '网友') : '人民日报客户端网友') |
| 600 | .fontColor($r('app.color.color_B0B0B0')) | 648 | .fontColor($r('app.color.color_B0B0B0')) |
| 601 | .fontSize(12); | 649 | .fontSize(12); |
| 602 | Image($r('app.media.comment_hyphen')) | 650 | Image($r('app.media.comment_hyphen')) |
| @@ -419,7 +419,7 @@ class CommentViewModel { | @@ -419,7 +419,7 @@ class CommentViewModel { | ||
| 419 | newModel.fromUserHeader = model.fromUserHeader | 419 | newModel.fromUserHeader = model.fromUserHeader |
| 420 | newModel.fromUserId = model.fromUserId | 420 | newModel.fromUserId = model.fromUserId |
| 421 | newModel.fromUserName = model.fromUserName | 421 | newModel.fromUserName = model.fromUserName |
| 422 | - if (model.toUserType != null) { | 422 | + if (model.fromUserType) { |
| 423 | newModel.fromUserType = model.fromUserType | 423 | newModel.fromUserType = model.fromUserType |
| 424 | } | 424 | } |
| 425 | newModel.id = model.id | 425 | newModel.id = model.id |
| @@ -443,7 +443,7 @@ class CommentViewModel { | @@ -443,7 +443,7 @@ class CommentViewModel { | ||
| 443 | // newModel.isLoading = model.isLoading | 443 | // newModel.isLoading = model.isLoading |
| 444 | 444 | ||
| 445 | 445 | ||
| 446 | - if (model.toUserType != null) { | 446 | + if (model.toUserType) { |
| 447 | newModel.toUserType = model.toUserType.toString() | 447 | newModel.toUserType = model.toUserType.toString() |
| 448 | } | 448 | } |
| 449 | newModel.topFlag = model.topFlag | 449 | newModel.topFlag = model.topFlag |
| @@ -34,7 +34,6 @@ export struct PageComponent { | @@ -34,7 +34,6 @@ export struct PageComponent { | ||
| 34 | needload: boolean = true; | 34 | needload: boolean = true; |
| 35 | build() { | 35 | build() { |
| 36 | Column() { | 36 | Column() { |
| 37 | - Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | ||
| 38 | if (this.pageModel.viewType == ViewType.LOADING) { | 37 | if (this.pageModel.viewType == ViewType.LOADING) { |
| 39 | this.LoadingLayout() | 38 | this.LoadingLayout() |
| 40 | } else if (this.pageModel.viewType == ViewType.LOADED) { | 39 | } else if (this.pageModel.viewType == ViewType.LOADED) { |
| @@ -148,10 +148,9 @@ export struct OperRowListView { | @@ -148,10 +148,9 @@ export struct OperRowListView { | ||
| 148 | // 视频详情页 | 148 | // 视频详情页 |
| 149 | 149 | ||
| 150 | Column() { | 150 | Column() { |
| 151 | - Image($r('app.media.ic_news_detail_division')) | ||
| 152 | - .width('100%') | ||
| 153 | - .height($r('app.float.margin_1')) | ||
| 154 | - // .margin({bottom: -2}) | 151 | + if(this.styleType != 3) { |
| 152 | + Divider().strokeWidth(1).color(this.styleType == 1 ? '#F5F5F5' : this.styleType == 2 ? '#262626' : 'rgba(0,0,0,0)') | ||
| 153 | + } | ||
| 155 | 154 | ||
| 156 | Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { | 155 | Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { |
| 157 | // AudioDialog() | 156 | // AudioDialog() |
-
Please register or login to post a comment