Showing
8 changed files
with
25 additions
and
18 deletions
| @@ -224,6 +224,9 @@ export struct CompParser { | @@ -224,6 +224,9 @@ export struct CompParser { | ||
| 224 | } else { | 224 | } else { |
| 225 | Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) | 225 | Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) |
| 226 | } | 226 | } |
| 227 | + } else if (this.compDTO.compStyle === CompStyle.Card_03 || this.compDTO.compStyle === CompStyle.Card_13 || this.compDTO.compStyle === CompStyle.Card_06 || | ||
| 228 | + this.compDTO.compStyle === CompStyle.Card_04 || this.compDTO.compStyle === CompStyle.Card_02 || this.compDTO.compStyle === CompStyle.Card_17) { // 无图卡 左文右图卡 小视频卡 三图卡 大图卡 图集卡 | ||
| 229 | + Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }).margin({top:14}) | ||
| 227 | } else if (this.compDTO.compType === 'appStyle' || this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 || this.compDTO.compStyle === CompStyle.Card_Comp_Adv || this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | 230 | } else if (this.compDTO.compType === 'appStyle' || this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 || this.compDTO.compStyle === CompStyle.Card_Comp_Adv || this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { |
| 228 | if ( | 231 | if ( |
| 229 | this.nextCompDTO.compStyle === CompStyle.Card_09 || | 232 | this.nextCompDTO.compStyle === CompStyle.Card_09 || |
| @@ -234,7 +237,6 @@ export struct CompParser { | @@ -234,7 +237,6 @@ export struct CompParser { | ||
| 234 | ) { | 237 | ) { |
| 235 | Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) | 238 | Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) |
| 236 | } else { | 239 | } else { |
| 237 | - // Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }).margin({top:8}) | ||
| 238 | Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) | 240 | Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) |
| 239 | } | 241 | } |
| 240 | } else { | 242 | } else { |
| @@ -3,6 +3,7 @@ import { DateTimeUtils } from 'wdKit/Index' | @@ -3,6 +3,7 @@ import { DateTimeUtils } from 'wdKit/Index' | ||
| 3 | import { LottieView } from '../../components/lottie/LottieView'; | 3 | import { LottieView } from '../../components/lottie/LottieView'; |
| 4 | import { LiveModel } from '../../viewmodel/LiveModel' | 4 | import { LiveModel } from '../../viewmodel/LiveModel' |
| 5 | import font from '@ohos.font'; | 5 | import font from '@ohos.font'; |
| 6 | +import text from '@ohos.graphics.text'; | ||
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| 8 | * 这里是样式卡中,右下角显示的音视频信息 | 9 | * 这里是样式卡中,右下角显示的音视频信息 |
| @@ -27,7 +28,6 @@ export struct CardMediaInfo { | @@ -27,7 +28,6 @@ export struct CardMediaInfo { | ||
| 27 | this.getJoinPeopleNum(); | 28 | this.getJoinPeopleNum(); |
| 28 | } | 29 | } |
| 29 | 30 | ||
| 30 | - | ||
| 31 | font.registerFont({ | 31 | font.registerFont({ |
| 32 | familyName: 'BebasNeue', | 32 | familyName: 'BebasNeue', |
| 33 | familySrc: $rawfile('font/BebasNeue.ttf') | 33 | familySrc: $rawfile('font/BebasNeue.ttf') |
| @@ -82,6 +82,7 @@ export struct CardMediaInfo { | @@ -82,6 +82,7 @@ export struct CardMediaInfo { | ||
| 82 | 82 | ||
| 83 | build() { | 83 | build() { |
| 84 | Row() { | 84 | Row() { |
| 85 | + // Text(`${this.contentDTO?.objectType}`) | ||
| 85 | if (this.contentDTO?.objectType === '1' || this.contentDTO?.objectType === '15') { | 86 | if (this.contentDTO?.objectType === '1' || this.contentDTO?.objectType === '15') { |
| 86 | // 点播、动态视频 | 87 | // 点播、动态视频 |
| 87 | Row() { | 88 | Row() { |
| @@ -94,7 +95,7 @@ export struct CardMediaInfo { | @@ -94,7 +95,7 @@ export struct CardMediaInfo { | ||
| 94 | 95 | ||
| 95 | } | 96 | } |
| 96 | } | 97 | } |
| 97 | - // .margin({ left: 68,top: 135}) | 98 | + .margin({ right: 8}) |
| 98 | } else if (this.contentDTO.objectType === '2') { | 99 | } else if (this.contentDTO.objectType === '2') { |
| 99 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 100 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 100 | // 显示直播信息 | 101 | // 显示直播信息 |
| @@ -137,7 +138,7 @@ export struct CardMediaInfo { | @@ -137,7 +138,7 @@ export struct CardMediaInfo { | ||
| 137 | .mediaText() | 138 | .mediaText() |
| 138 | } | 139 | } |
| 139 | 140 | ||
| 140 | - }else { | 141 | + } else { |
| 141 | // 当liveInfo存在时后 | 142 | // 当liveInfo存在时后 |
| 142 | 143 | ||
| 143 | if (this.contentDTO?.liveInfo?.liveState === 'wait') { | 144 | if (this.contentDTO?.liveInfo?.liveState === 'wait') { |
| @@ -192,7 +193,7 @@ export struct CardMediaInfo { | @@ -192,7 +193,7 @@ export struct CardMediaInfo { | ||
| 192 | .mediaTextImgtype() | 193 | .mediaTextImgtype() |
| 193 | .fontFamily('BebasNeue') | 194 | .fontFamily('BebasNeue') |
| 194 | } | 195 | } |
| 195 | - // .margin({ left: 80,top: 55}) | 196 | + .margin({ right: 8}) |
| 196 | 197 | ||
| 197 | } else if (this.contentDTO.objectType === '13') { | 198 | } else if (this.contentDTO.objectType === '13') { |
| 198 | // 显示音频信息 | 199 | // 显示音频信息 |
| @@ -144,7 +144,7 @@ export struct CardSourceInfo { | @@ -144,7 +144,7 @@ export struct CardSourceInfo { | ||
| 144 | // 标签 | 144 | // 标签 |
| 145 | if (this.contentDTO.cornerMark || this.contentDTO.corner) { | 145 | if (this.contentDTO.cornerMark || this.contentDTO.corner) { |
| 146 | Text(this.contentDTO.cornerMark || this.contentDTO.corner) | 146 | Text(this.contentDTO.cornerMark || this.contentDTO.corner) |
| 147 | - .fontSize($r("app.float.font_size_11")) | 147 | + .fontSize(12) |
| 148 | .fontColor($r("app.color.color_ED2800")) | 148 | .fontColor($r("app.color.color_ED2800")) |
| 149 | .margin({ right: 6 }) | 149 | .margin({ right: 6 }) |
| 150 | .flexShrink(0) | 150 | .flexShrink(0) |
| @@ -153,7 +153,7 @@ export struct CardSourceInfo { | @@ -153,7 +153,7 @@ export struct CardSourceInfo { | ||
| 153 | // 来源信息 | 153 | // 来源信息 |
| 154 | if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) { | 154 | if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) { |
| 155 | Text(this.displayText) | 155 | Text(this.displayText) |
| 156 | - .fontSize($r("app.float.font_size_11")) | 156 | + .fontSize(12) |
| 157 | .fontColor($r("app.color.color_B0B0B0")) | 157 | .fontColor($r("app.color.color_B0B0B0")) |
| 158 | .maxLines(1) | 158 | .maxLines(1) |
| 159 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 159 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| @@ -183,7 +183,7 @@ export struct CardSourceInfo { | @@ -183,7 +183,7 @@ export struct CardSourceInfo { | ||
| 183 | // 发布日期 | 183 | // 发布日期 |
| 184 | if (this.showTime()) { | 184 | if (this.showTime()) { |
| 185 | Text(this.handleTimeStr()) | 185 | Text(this.handleTimeStr()) |
| 186 | - .fontSize($r("app.float.font_size_11")) | 186 | + .fontSize(12) |
| 187 | .fontColor($r("app.color.color_B0B0B0")) | 187 | .fontColor($r("app.color.color_B0B0B0")) |
| 188 | .flexShrink(0) | 188 | .flexShrink(0) |
| 189 | .margin({ right: 4 }) | 189 | .margin({ right: 4 }) |
| @@ -196,14 +196,14 @@ export struct CardSourceInfo { | @@ -196,14 +196,14 @@ export struct CardSourceInfo { | ||
| 196 | if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | 196 | if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && |
| 197 | this.showCommentNum()) { | 197 | this.showCommentNum()) { |
| 198 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) | 198 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) |
| 199 | - .fontSize($r("app.float.font_size_11")) | 199 | + .fontSize(12) |
| 200 | .fontColor($r("app.color.color_B0B0B0")) | 200 | .fontColor($r("app.color.color_B0B0B0")) |
| 201 | .flexShrink(0) | 201 | .flexShrink(0) |
| 202 | } else { | 202 | } else { |
| 203 | 203 | ||
| 204 | if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | 204 | if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { |
| 205 | Text(`${this.handlerNum(this.contentDTO.interactData?.commentNum.toString())}评`) | 205 | Text(`${this.handlerNum(this.contentDTO.interactData?.commentNum.toString())}评`) |
| 206 | - .fontSize($r("app.float.font_size_11")) | 206 | + .fontSize(12) |
| 207 | .fontColor($r("app.color.color_B0B0B0")) | 207 | .fontColor($r("app.color.color_B0B0B0")) |
| 208 | .flexShrink(0) | 208 | .flexShrink(0) |
| 209 | } | 209 | } |
| @@ -229,11 +229,11 @@ export struct CardSourceInfo { | @@ -229,11 +229,11 @@ export struct CardSourceInfo { | ||
| 229 | Span(this.contentDTO.newsTitle) | 229 | Span(this.contentDTO.newsTitle) |
| 230 | } | 230 | } |
| 231 | } | 231 | } |
| 232 | - .fontSize($r('app.float.font_size_11')) | 232 | + .fontSize(12) |
| 233 | .fontColor($r("app.color.color_B0B0B0")) | 233 | .fontColor($r("app.color.color_B0B0B0")) |
| 234 | .align(Alignment.Start) | 234 | .align(Alignment.Start) |
| 235 | .width('100%') | 235 | .width('100%') |
| 236 | - .margin({top:5}) | 236 | + .margin({top:8}) |
| 237 | } | 237 | } |
| 238 | } | 238 | } |
| 239 | .width(CommonConstants.FULL_WIDTH) | 239 | .width(CommonConstants.FULL_WIDTH) |
| @@ -63,6 +63,9 @@ export struct Card17Component { | @@ -63,6 +63,9 @@ export struct Card17Component { | ||
| 63 | .lineHeight(25) | 63 | .lineHeight(25) |
| 64 | .maxLines(3) | 64 | .maxLines(3) |
| 65 | .width(CommonConstants.FULL_WIDTH) | 65 | .width(CommonConstants.FULL_WIDTH) |
| 66 | + .margin({ | ||
| 67 | + top: 14 | ||
| 68 | + }) | ||
| 66 | 69 | ||
| 67 | Stack({ alignContent: Alignment.BottomEnd }) { | 70 | Stack({ alignContent: Alignment.BottomEnd }) { |
| 68 | // 三个图, | 71 | // 三个图, |
| @@ -112,6 +115,7 @@ export struct Card17Component { | @@ -112,6 +115,7 @@ export struct Card17Component { | ||
| 112 | CardMediaInfo({ contentDTO: this.contentDTO }) | 115 | CardMediaInfo({ contentDTO: this.contentDTO }) |
| 113 | } | 116 | } |
| 114 | .width(CommonConstants.FULL_WIDTH) | 117 | .width(CommonConstants.FULL_WIDTH) |
| 118 | + .margin({ top: 8 }) | ||
| 115 | .onClick((event: ClickEvent) => { | 119 | .onClick((event: ClickEvent) => { |
| 116 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 120 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 117 | if (router.getState().name !== 'MyCollectionListPage') { | 121 | if (router.getState().name !== 'MyCollectionListPage') { |
| @@ -133,7 +137,7 @@ export struct Card17Component { | @@ -133,7 +137,7 @@ export struct Card17Component { | ||
| 133 | }) | 137 | }) |
| 134 | 138 | ||
| 135 | // 评论等信息 | 139 | // 评论等信息 |
| 136 | - CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO, viewShowData: false }) | 140 | + CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO }) |
| 137 | } | 141 | } |
| 138 | .padding({ | 142 | .padding({ |
| 139 | left: 10, | 143 | left: 10, |
| @@ -79,7 +79,7 @@ export struct Card2Component { | @@ -79,7 +79,7 @@ export struct Card2Component { | ||
| 79 | .fontSize($r('app.float.font_size_18')) | 79 | .fontSize($r('app.float.font_size_18')) |
| 80 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 80 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 81 | .maxLines(2) | 81 | .maxLines(2) |
| 82 | - .lineHeight(27) | 82 | + .lineHeight(25) |
| 83 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 83 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 84 | .align(Alignment.Start) | 84 | .align(Alignment.Start) |
| 85 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 85 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| @@ -106,8 +106,8 @@ export struct Card2Component { | @@ -106,8 +106,8 @@ export struct Card2Component { | ||
| 106 | }) | 106 | }) |
| 107 | } | 107 | } |
| 108 | .alignContent(Alignment.BottomEnd) | 108 | .alignContent(Alignment.BottomEnd) |
| 109 | - .margin({ top: 8 }) | ||
| 110 | } | 109 | } |
| 110 | + .margin({ top: 8 }) | ||
| 111 | .width(CommonConstants.FULL_WIDTH) | 111 | .width(CommonConstants.FULL_WIDTH) |
| 112 | .alignItems(HorizontalAlign.Start) | 112 | .alignItems(HorizontalAlign.Start) |
| 113 | 113 |
| @@ -65,7 +65,7 @@ export struct Card3Component { | @@ -65,7 +65,7 @@ export struct Card3Component { | ||
| 65 | Span(this.contentDTO.newsTitle) | 65 | Span(this.contentDTO.newsTitle) |
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | - .lineHeight(27) | 68 | + .lineHeight(25) |
| 69 | .fontSize($r("app.float.font_size_18")) | 69 | .fontSize($r("app.float.font_size_18")) |
| 70 | .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | 70 | .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) |
| 71 | .width(CommonConstants.FULL_WIDTH) | 71 | .width(CommonConstants.FULL_WIDTH) |
| @@ -76,7 +76,7 @@ export struct Card4Component { | @@ -76,7 +76,7 @@ export struct Card4Component { | ||
| 76 | } | 76 | } |
| 77 | } | 77 | } |
| 78 | .fontSize(17.5) | 78 | .fontSize(17.5) |
| 79 | - .lineHeight(27) | 79 | + .lineHeight(25) |
| 80 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 80 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 81 | .maxLines(3) | 81 | .maxLines(3) |
| 82 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 82 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| @@ -76,7 +76,7 @@ export struct Card6Component { | @@ -76,7 +76,7 @@ export struct Card6Component { | ||
| 76 | } | 76 | } |
| 77 | .fontColor(this.clicked ? 0x848484 : 0x222222) | 77 | .fontColor(this.clicked ? 0x848484 : 0x222222) |
| 78 | .fontSize(18) | 78 | .fontSize(18) |
| 79 | - .lineHeight(27) | 79 | + .lineHeight(25) |
| 80 | .fontWeight(FontWeight.Normal) | 80 | .fontWeight(FontWeight.Normal) |
| 81 | .maxLines(this.contentDTO.appStyle === '6' ? 4 : 3) | 81 | .maxLines(this.contentDTO.appStyle === '6' ? 4 : 3) |
| 82 | .alignSelf(ItemAlign.Start) | 82 | .alignSelf(ItemAlign.Start) |
-
Please register or login to post a comment