chenjun1_wd

19989 视频详情页:文本框弹出样式,缺少发布时间。

import { DateTimeUtils } from 'wdKit'
@Preview
@CustomDialog
export struct DetailDialog {
... ... @@ -5,6 +7,7 @@ export struct DetailDialog {
@Prop name: string
@Prop title: string
@Prop summary: string
@Prop publishTime: string
@Link isOpenDetail: boolean
build() {
... ... @@ -36,6 +39,16 @@ export struct DetailDialog {
.fontWeight(400)
.margin({ top: 8 })
.lineHeight(21)
Text(DateTimeUtils.formatDate(new Date(this.publishTime).getTime(),
DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
.fontSize(12)
.fontColor(Color.White)
.opacity(0.7)
.lineHeight(16)
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
.margin({ top: 8, bottom: 8 })
}
.alignItems(HorizontalAlign.Start)
... ...
... ... @@ -24,6 +24,7 @@ export struct PlayerTitleView {
name: this.getName(),
title: this.getTitle(),
summary: this.getSummary(),
publishTime: this.getPublishTime(),
isOpenDetail: this.isOpenDetail
}),
... ... @@ -55,6 +56,10 @@ export struct PlayerTitleView {
return this.contentDetailData?.newIntroduction || ''
}
getPublishTime(): string {
return this.contentDetailData?.publishTime || ''
}
/**
* 截断文本
* @param {string} str 要截断的文本 '啊啊啊啊啊'
... ...