wangyong_wd

新增本地精选卡

... ... @@ -6,7 +6,7 @@ export const enum CompStyle {
Carousel_Layout_01 = 'Zh_Carousel_Layout-01', // 通用轮播卡:视频、直播、活动、专题、榜单、外链
Carousel_Layout_02 = 'Carousel_Layout-02', // 直播轮播卡:直播
Single_Row_01 = 'Zh_Single_Row-01', // 三格方形小卡(排名):专题、活动
Zh_Single_Row_01 = 'Zh_Single_Row-01', // 横划卡
Zh_Single_Row_01 = 'Zh_Single_Row-01', // 横划卡 imageScale-封面图比例 1-4:3, 2-16:9, 3-3:2
Single_Row_02 = 'Zh_Single_Row-02', // 通用横划卡:视频、直播、专题
Single_Row_03 = 'Single_Row-03', // 直播横划卡:直播
Single_Row_04 = 'Single_Row-04', // 三格方形小卡:专题、活动
... ... @@ -26,5 +26,8 @@ export const enum CompStyle {
Single_ImageCard_03 = '13',//单图卡:3行标题
Single_ImageCard_01 = '6',//单图卡,竖图
ZhGrid_Layout_03 = 'Zh_Grid_Layout-03', //金刚位卡
Album_Card_01 = '17' //图卡集
Album_Card_01 = '17', //图卡集
Zh_Single_Row_04 = 'Zh_Single_Row-04', // 地方精选卡
CompStyle_09 = 9, // 时间链卡
CompStyle_10 = 10, // 大专题卡
}
... ...
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from '../../utils/ProcessUtils';
/**
* 本地精选卡
* ZhSingleRow04
*/
@Component
export struct ZhSingleRow04 {
@State compDTO: CompDTO = {} as CompDTO
aboutToAppear() {}
build() {
Column(){
//顶部
Row(){
Row() {
Image($r("app.media.local_selection"))
.width(24)
.height(24)
.margin({ right: 4 })
Text(this.compDTO.objectTitle)
.fontSize($r("app.float.font_size_17"))
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
}
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_999999"))
.margin({ right: 1 })
Image($r("app.media.more"))
.width(14)
.height(14)
}
}
.justifyContent(FlexAlign.SpaceBetween)
.margin({ top: 8, bottom: 8 })
.width('100%')
// 列表内容
List({ space: 12 }) {
ForEach(this.compDTO.operDataList, (item: ContentDTO) => {
ListItem() {
Row(){
if(item.coverUrl) {
Image(item.coverUrl)
.width(84)
.height(56)
.borderRadius(3)
.objectFit(ImageFit.Cover)
.padding({right: 6})
}
Column(){
Text(item.newsTitle)
.fontSize($r("app.float.font_size_16"))
.fontColor($r("app.color.color_212228"))
.fontWeight(400)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.margin({ top: 8 })
Row(){
Text(item.source)
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_B0B0B0'))
Image($r("app.media.point"))
.width(16)
.height(16)
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.compDTO.operDataList[0].publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
}
.width('100%')
}
.width(200)
}
// .margin({right: 18})
.onClick(() =>{
ProcessUtils.processPage(item)
})
}
})
}
.listDirection(Axis.Horizontal)
.width('100%')
}
.width(CommonConstants.FULL_WIDTH)
.padding({
top: 14,
left: 16,
right: 16,
bottom: 14
})
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
}
}
\ No newline at end of file
... ...