Showing
2 changed files
with
106 additions
and
2 deletions
| @@ -6,7 +6,7 @@ export const enum CompStyle { | @@ -6,7 +6,7 @@ export const enum CompStyle { | ||
| 6 | Carousel_Layout_01 = 'Zh_Carousel_Layout-01', // 通用轮播卡:视频、直播、活动、专题、榜单、外链 | 6 | Carousel_Layout_01 = 'Zh_Carousel_Layout-01', // 通用轮播卡:视频、直播、活动、专题、榜单、外链 |
| 7 | Carousel_Layout_02 = 'Carousel_Layout-02', // 直播轮播卡:直播 | 7 | Carousel_Layout_02 = 'Carousel_Layout-02', // 直播轮播卡:直播 |
| 8 | Single_Row_01 = 'Zh_Single_Row-01', // 三格方形小卡(排名):专题、活动 | 8 | Single_Row_01 = 'Zh_Single_Row-01', // 三格方形小卡(排名):专题、活动 |
| 9 | - Zh_Single_Row_01 = 'Zh_Single_Row-01', // 横划卡 | 9 | + Zh_Single_Row_01 = 'Zh_Single_Row-01', // 横划卡 imageScale-封面图比例 1-4:3, 2-16:9, 3-3:2 |
| 10 | Single_Row_02 = 'Zh_Single_Row-02', // 通用横划卡:视频、直播、专题 | 10 | Single_Row_02 = 'Zh_Single_Row-02', // 通用横划卡:视频、直播、专题 |
| 11 | Single_Row_03 = 'Single_Row-03', // 直播横划卡:直播 | 11 | Single_Row_03 = 'Single_Row-03', // 直播横划卡:直播 |
| 12 | Single_Row_04 = 'Single_Row-04', // 三格方形小卡:专题、活动 | 12 | Single_Row_04 = 'Single_Row-04', // 三格方形小卡:专题、活动 |
| @@ -26,5 +26,8 @@ export const enum CompStyle { | @@ -26,5 +26,8 @@ export const enum CompStyle { | ||
| 26 | Single_ImageCard_03 = '13',//单图卡:3行标题 | 26 | Single_ImageCard_03 = '13',//单图卡:3行标题 |
| 27 | Single_ImageCard_01 = '6',//单图卡,竖图 | 27 | Single_ImageCard_01 = '6',//单图卡,竖图 |
| 28 | ZhGrid_Layout_03 = 'Zh_Grid_Layout-03', //金刚位卡 | 28 | ZhGrid_Layout_03 = 'Zh_Grid_Layout-03', //金刚位卡 |
| 29 | - Album_Card_01 = '17' //图卡集 | 29 | + Album_Card_01 = '17', //图卡集 |
| 30 | + Zh_Single_Row_04 = 'Zh_Single_Row-04', // 地方精选卡 | ||
| 31 | + CompStyle_09 = 9, // 时间链卡 | ||
| 32 | + CompStyle_10 = 10, // 大专题卡 | ||
| 30 | } | 33 | } |
| 1 | +import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 2 | +import { CommonConstants } from 'wdConstant'; | ||
| 3 | +import { DateTimeUtils } from 'wdKit'; | ||
| 4 | +import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 本地精选卡 | ||
| 8 | + * ZhSingleRow04 | ||
| 9 | + */ | ||
| 10 | + | ||
| 11 | +@Component | ||
| 12 | +export struct ZhSingleRow04 { | ||
| 13 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 14 | + | ||
| 15 | + aboutToAppear() {} | ||
| 16 | + | ||
| 17 | + build() { | ||
| 18 | + Column(){ | ||
| 19 | + //顶部 | ||
| 20 | + Row(){ | ||
| 21 | + Row() { | ||
| 22 | + Image($r("app.media.local_selection")) | ||
| 23 | + .width(24) | ||
| 24 | + .height(24) | ||
| 25 | + .margin({ right: 4 }) | ||
| 26 | + Text(this.compDTO.objectTitle) | ||
| 27 | + .fontSize($r("app.float.font_size_17")) | ||
| 28 | + .fontColor($r("app.color.color_222222")) | ||
| 29 | + .fontWeight(600) | ||
| 30 | + } | ||
| 31 | + Row() { | ||
| 32 | + Text("更多") | ||
| 33 | + .fontSize($r("app.float.font_size_14")) | ||
| 34 | + .fontColor($r("app.color.color_999999")) | ||
| 35 | + .margin({ right: 1 }) | ||
| 36 | + Image($r("app.media.more")) | ||
| 37 | + .width(14) | ||
| 38 | + .height(14) | ||
| 39 | + } | ||
| 40 | + } | ||
| 41 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 42 | + .margin({ top: 8, bottom: 8 }) | ||
| 43 | + .width('100%') | ||
| 44 | + // 列表内容 | ||
| 45 | + List({ space: 12 }) { | ||
| 46 | + ForEach(this.compDTO.operDataList, (item: ContentDTO) => { | ||
| 47 | + ListItem() { | ||
| 48 | + Row(){ | ||
| 49 | + if(item.coverUrl) { | ||
| 50 | + Image(item.coverUrl) | ||
| 51 | + .width(84) | ||
| 52 | + .height(56) | ||
| 53 | + .borderRadius(3) | ||
| 54 | + .objectFit(ImageFit.Cover) | ||
| 55 | + .padding({right: 6}) | ||
| 56 | + } | ||
| 57 | + Column(){ | ||
| 58 | + Text(item.newsTitle) | ||
| 59 | + .fontSize($r("app.float.font_size_16")) | ||
| 60 | + .fontColor($r("app.color.color_212228")) | ||
| 61 | + .fontWeight(400) | ||
| 62 | + .maxLines(2) | ||
| 63 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 64 | + .margin({ top: 8 }) | ||
| 65 | + | ||
| 66 | + Row(){ | ||
| 67 | + Text(item.source) | ||
| 68 | + .fontSize($r('app.float.font_size_12')) | ||
| 69 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 70 | + Image($r("app.media.point")) | ||
| 71 | + .width(16) | ||
| 72 | + .height(16) | ||
| 73 | + Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.compDTO.operDataList[0].publishTime))) | ||
| 74 | + .fontSize($r("app.float.font_size_12")) | ||
| 75 | + .fontColor($r("app.color.color_B0B0B0")) | ||
| 76 | + } | ||
| 77 | + .width('100%') | ||
| 78 | + } | ||
| 79 | + .width(200) | ||
| 80 | + } | ||
| 81 | + // .margin({right: 18}) | ||
| 82 | + .onClick(() =>{ | ||
| 83 | + ProcessUtils.processPage(item) | ||
| 84 | + }) | ||
| 85 | + } | ||
| 86 | + }) | ||
| 87 | + } | ||
| 88 | + .listDirection(Axis.Horizontal) | ||
| 89 | + .width('100%') | ||
| 90 | + } | ||
| 91 | + .width(CommonConstants.FULL_WIDTH) | ||
| 92 | + .padding({ | ||
| 93 | + top: 14, | ||
| 94 | + left: 16, | ||
| 95 | + right: 16, | ||
| 96 | + bottom: 14 | ||
| 97 | + }) | ||
| 98 | + .backgroundColor($r("app.color.white")) | ||
| 99 | + .margin({ bottom: 8 }) | ||
| 100 | + } | ||
| 101 | +} |
-
Please register or login to post a comment