Showing
5 changed files
with
48 additions
and
32 deletions
| @@ -8,7 +8,7 @@ export struct CardSourceInfo { | @@ -8,7 +8,7 @@ export struct CardSourceInfo { | ||
| 8 | @ObjectLink compDTO: CompDTO | 8 | @ObjectLink compDTO: CompDTO |
| 9 | 9 | ||
| 10 | build() { | 10 | build() { |
| 11 | - Flex() { | 11 | + Flex({ alignItems: ItemAlign.Center }) { |
| 12 | if (this.contentDTO.corner) { | 12 | if (this.contentDTO.corner) { |
| 13 | Text(this.contentDTO.corner) | 13 | Text(this.contentDTO.corner) |
| 14 | .fontSize($r("app.float.font_size_11")) | 14 | .fontSize($r("app.float.font_size_11")) |
| @@ -28,31 +28,39 @@ export struct CardSourceInfo { | @@ -28,31 +28,39 @@ export struct CardSourceInfo { | ||
| 28 | .maxLines(1) | 28 | .maxLines(1) |
| 29 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 29 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 30 | } | 30 | } |
| 31 | - if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && (this.getContentDtoBean()?.interactData?.commentNum || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '')) { | 31 | + if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && |
| 32 | + this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && | ||
| 33 | + (this.getContentDtoBean()?.interactData?.commentNum || | ||
| 34 | + DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '')) { | ||
| 32 | Image($r("app.media.point")) | 35 | Image($r("app.media.point")) |
| 33 | .width(16) | 36 | .width(16) |
| 34 | .height(16) | 37 | .height(16) |
| 35 | } | 38 | } |
| 36 | // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间 | 39 | // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间 |
| 37 | - if (this.contentDTO.isSearch || this.contentDTO.isCollection || | ||
| 38 | - !this.contentDTO.isSearch && DateTimeUtils.getCommentTime | ||
| 39 | - (Number | ||
| 40 | - .parseFloat(this | ||
| 41 | - .contentDTO.publishTime)) | ||
| 42 | - .indexOf | ||
| 43 | - ('-') === -1) { | 40 | + // if (this.contentDTO.isSearch || this.contentDTO.isCollection || |
| 41 | + // (!this.contentDTO.isSearch && | ||
| 42 | + // DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)).indexOf('-') === -1)) { | ||
| 43 | + // | ||
| 44 | + // Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | ||
| 45 | + // .fontSize($r("app.float.font_size_11")) | ||
| 46 | + // .fontColor($r("app.color.color_B0B0B0")) | ||
| 47 | + // .flexShrink(0); | ||
| 48 | + // } | ||
| 49 | + if (this.contentDTO.source) { | ||
| 44 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | 50 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) |
| 45 | .fontSize($r("app.float.font_size_11")) | 51 | .fontSize($r("app.float.font_size_11")) |
| 46 | .fontColor($r("app.color.color_B0B0B0")) | 52 | .fontColor($r("app.color.color_B0B0B0")) |
| 47 | - .flexShrink(0) | 53 | + .flexShrink(0); |
| 48 | } | 54 | } |
| 49 | - if (this.getContentDtoBean()?.interactData?.commentNum) { | 55 | + |
| 56 | + if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { | ||
| 50 | Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) | 57 | Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) |
| 51 | .fontSize($r("app.float.font_size_11")) | 58 | .fontSize($r("app.float.font_size_11")) |
| 52 | .fontColor($r("app.color.color_B0B0B0")) | 59 | .fontColor($r("app.color.color_B0B0B0")) |
| 53 | .flexShrink(0) | 60 | .flexShrink(0) |
| 54 | .margin({ left: 6 }) | 61 | .margin({ left: 6 }) |
| 55 | - .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : Visibility.Visible) | 62 | + .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : |
| 63 | + Visibility.Visible) | ||
| 56 | } | 64 | } |
| 57 | } | 65 | } |
| 58 | .width(CommonConstants.FULL_WIDTH) | 66 | .width(CommonConstants.FULL_WIDTH) |
| @@ -67,7 +75,7 @@ export struct CardSourceInfo { | @@ -67,7 +75,7 @@ export struct CardSourceInfo { | ||
| 67 | if (this.compDTO == undefined) { | 75 | if (this.compDTO == undefined) { |
| 68 | return this.contentDTO | 76 | return this.contentDTO |
| 69 | } | 77 | } |
| 70 | - if(this.compDTO.operDataList.length == 0){ | 78 | + if (this.compDTO.operDataList.length == 0) { |
| 71 | return this.contentDTO | 79 | return this.contentDTO |
| 72 | } | 80 | } |
| 73 | return this.compDTO.operDataList[0] | 81 | return this.compDTO.operDataList[0] |
| @@ -87,12 +87,12 @@ export struct Card5Component { | @@ -87,12 +87,12 @@ export struct Card5Component { | ||
| 87 | } | 87 | } |
| 88 | .alignContent(Alignment.Bottom) | 88 | .alignContent(Alignment.Bottom) |
| 89 | .width(CommonConstants.FULL_WIDTH) | 89 | .width(CommonConstants.FULL_WIDTH) |
| 90 | - // .padding({ | ||
| 91 | - // left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 92 | - // right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 93 | - // top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 94 | - // bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 95 | - // }) | 90 | + .padding({ |
| 91 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 92 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 93 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 94 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 95 | + }) | ||
| 96 | .onClick((event: ClickEvent) => { | 96 | .onClick((event: ClickEvent) => { |
| 97 | this.clicked = true; | 97 | this.clicked = true; |
| 98 | ProcessUtils.processPage(this.contentDTO) | 98 | ProcessUtils.processPage(this.contentDTO) |
| @@ -54,9 +54,9 @@ export struct Card6Component { | @@ -54,9 +54,9 @@ export struct Card6Component { | ||
| 54 | // } | 54 | // } |
| 55 | Stack() { | 55 | Stack() { |
| 56 | if (this.contentDTO.newTags) { | 56 | if (this.contentDTO.newTags) { |
| 57 | - Notes({ newTags: this.contentDTO.newTags }) | 57 | + Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center) |
| 58 | } else if (this.contentDTO.objectType == '5') { | 58 | } else if (this.contentDTO.objectType == '5') { |
| 59 | - Notes({ objectType: this.contentDTO.objectType }) | 59 | + Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center) |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | Text() { | 62 | Text() { |
| @@ -114,7 +114,7 @@ export struct Card6Component { | @@ -114,7 +114,7 @@ export struct Card6Component { | ||
| 114 | bottom: $r('app.float.card_comp_pagePadding_tb') | 114 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 115 | }) | 115 | }) |
| 116 | .width(CommonConstants.FULL_WIDTH) | 116 | .width(CommonConstants.FULL_WIDTH) |
| 117 | - .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217) | 117 | + // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217) |
| 118 | .justifyContent(FlexAlign.SpaceBetween) | 118 | .justifyContent(FlexAlign.SpaceBetween) |
| 119 | } | 119 | } |
| 120 | } | 120 | } |
| @@ -21,8 +21,9 @@ export struct Notes { | @@ -21,8 +21,9 @@ export struct Notes { | ||
| 21 | bottom: 3 | 21 | bottom: 3 |
| 22 | }) | 22 | }) |
| 23 | .linearGradient({ angle: 90, colors: [['#FFFF2B00', 0.0], ['#FFFE6A00', 1.0]] }) | 23 | .linearGradient({ angle: 90, colors: [['#FFFF2B00', 0.0], ['#FFFE6A00', 1.0]] }) |
| 24 | - .fontColor(Color.White) | ||
| 25 | - .borderRadius($r('app.float.button_border_radius')) | 24 | + .fontColor(Color.White)// .borderRadius($r('app.float.button_border_radius')) |
| 25 | + .borderRadius(2) | ||
| 26 | + .margin({ top: 1 }) | ||
| 26 | } | 27 | } |
| 27 | } | 28 | } |
| 28 | 29 |
| @@ -36,7 +36,8 @@ export struct ZhSingleRow04 { | @@ -36,7 +36,8 @@ export struct ZhSingleRow04 { | ||
| 36 | .width(14) | 36 | .width(14) |
| 37 | .height(14) | 37 | .height(14) |
| 38 | } | 38 | } |
| 39 | - .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible) | 39 | + .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : |
| 40 | + Visibility.Visible) | ||
| 40 | .onClick(() => { | 41 | .onClick(() => { |
| 41 | if (this.compDTO?.objectType === '11') { | 42 | if (this.compDTO?.objectType === '11') { |
| 42 | ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) | 43 | ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) |
| @@ -64,9 +65,11 @@ export struct ZhSingleRow04 { | @@ -64,9 +65,11 @@ export struct ZhSingleRow04 { | ||
| 64 | operDataListItem: item | 65 | operDataListItem: item |
| 65 | } | 66 | } |
| 66 | ) | 67 | ) |
| 67 | - .margin({right: index === this.compDTO.operDataList.length - 1 ? 26 : 0, left: | ||
| 68 | - index === 0 ? $r('app.float.card_comp_pagePadding_lf') : 0, | ||
| 69 | - top: 6}) | 68 | + .margin({ |
| 69 | + right: index === this.compDTO.operDataList.length - 1 ? 26 : 0, left: | ||
| 70 | + index === 0 ? $r('app.float.card_comp_pagePadding_lf') : 0, | ||
| 71 | + top: 6 | ||
| 72 | + }) | ||
| 70 | .onClick(() => { | 73 | .onClick(() => { |
| 71 | ProcessUtils.processPage(item) | 74 | ProcessUtils.processPage(item) |
| 72 | }) | 75 | }) |
| @@ -106,8 +109,7 @@ struct localCard { | @@ -106,8 +109,7 @@ struct localCard { | ||
| 106 | .align(Alignment.TopStart) | 109 | .align(Alignment.TopStart) |
| 107 | .maxLines(3) | 110 | .maxLines(3) |
| 108 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 111 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 109 | - .lineHeight(20) | ||
| 110 | - .margin({bottom: 17}) | 112 | + .lineHeight(25) |
| 111 | .fontWeight(500) | 113 | .fontWeight(500) |
| 112 | Row() { | 114 | Row() { |
| 113 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.operDataListItem.publishTime))) | 115 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.operDataListItem.publishTime))) |
| @@ -115,7 +117,7 @@ struct localCard { | @@ -115,7 +117,7 @@ struct localCard { | ||
| 115 | .fontColor($r("app.color.color_B0B0B0")) | 117 | .fontColor($r("app.color.color_B0B0B0")) |
| 116 | .margin({ right: 5 }) | 118 | .margin({ right: 5 }) |
| 117 | // 这里需要外部查询评论接口后,写入字段 | 119 | // 这里需要外部查询评论接口后,写入字段 |
| 118 | - if(this.operDataListItem.interactData?.commentNum) { | 120 | + if (this.operDataListItem.interactData?.commentNum) { |
| 119 | Text(`${this.operDataListItem.interactData?.commentNum}评`) | 121 | Text(`${this.operDataListItem.interactData?.commentNum}评`) |
| 120 | .fontSize(12) | 122 | .fontSize(12) |
| 121 | } | 123 | } |
| @@ -139,7 +141,12 @@ struct localCard { | @@ -139,7 +141,12 @@ struct localCard { | ||
| 139 | .border({ | 141 | .border({ |
| 140 | radius: 2, | 142 | radius: 2, |
| 141 | }) | 143 | }) |
| 142 | - .shadow({ radius: 6, color: '#1A000000', offsetX: 3, offsetY: 0 }) | 144 | + .shadow({ |
| 145 | + radius: 6, | ||
| 146 | + color: '#1A000000', | ||
| 147 | + offsetX: 0, | ||
| 148 | + offsetY: 3 | ||
| 149 | + }) // 设置下方阴影 | ||
| 143 | .margin({ | 150 | .margin({ |
| 144 | right: 10 | 151 | right: 10 |
| 145 | }) | 152 | }) |
-
Please register or login to post a comment