Showing
3 changed files
with
12 additions
and
3 deletions
| @@ -38,6 +38,7 @@ export class DateTimeUtils { | @@ -38,6 +38,7 @@ export class DateTimeUtils { | ||
| 38 | // 日期+时间格式 | 38 | // 日期+时间格式 |
| 39 | static readonly PATTERN_DATE_TIME_DEFAULT: string = 'yyyyMMddHHmmss'; // 年月日时分秒 | 39 | static readonly PATTERN_DATE_TIME_DEFAULT: string = 'yyyyMMddHHmmss'; // 年月日时分秒 |
| 40 | static readonly PATTERN_DATE_TIME_HYPHEN: string = 'yyyy-MM-dd HH:mm:ss'; // 日期中包含连字符/中划线(HYPHEN),时间是以冒号(Colon)分割 | 40 | static readonly PATTERN_DATE_TIME_HYPHEN: string = 'yyyy-MM-dd HH:mm:ss'; // 日期中包含连字符/中划线(HYPHEN),时间是以冒号(Colon)分割 |
| 41 | + static readonly PATTERN_DATE_TIME_HYPHEN_MM: string = 'yyyy-MM-dd HH:mm'; // 日期中包含连字符/中划线(HYPHEN),时间是以冒号(Colon)分割 | ||
| 41 | static readonly PATTERN_DATE_TIME_HYPHEN_MS: string = 'yyyy-MM-dd HH:mm:ss.SSS'; // 日期中包含连字符/中划线(HYPHEN),时间是以冒号(Colon)分割 | 42 | static readonly PATTERN_DATE_TIME_HYPHEN_MS: string = 'yyyy-MM-dd HH:mm:ss.SSS'; // 日期中包含连字符/中划线(HYPHEN),时间是以冒号(Colon)分割 |
| 42 | static readonly PATTERN_DATE_TIME_SLASH: string = 'yyyy/MM/dd HH:mm:ss'; // 日期中包含正斜杠(forward slash '/') | 43 | static readonly PATTERN_DATE_TIME_SLASH: string = 'yyyy/MM/dd HH:mm:ss'; // 日期中包含正斜杠(forward slash '/') |
| 43 | static readonly PATTERN_DATE_TIME_BACK_SLASH: string = 'yyyy\\MM\\dd HH:mm:ss'; // 日期中包含反斜杠(back slash '\') | 44 | static readonly PATTERN_DATE_TIME_BACK_SLASH: string = 'yyyy\\MM\\dd HH:mm:ss'; // 日期中包含反斜杠(back slash '\') |
| @@ -38,6 +38,7 @@ export struct PlayerProgressView { | @@ -38,6 +38,7 @@ export struct PlayerProgressView { | ||
| 38 | ToastUtils.shortToast('网络出小差了,请检查下网络') | 38 | ToastUtils.shortToast('网络出小差了,请检查下网络') |
| 39 | }, 10000) | 39 | }, 10000) |
| 40 | } else { | 40 | } else { |
| 41 | + // console.log("PlayerProgressView22", this.timer) | ||
| 41 | clearTimeout(this.timer) | 42 | clearTimeout(this.timer) |
| 42 | this.loadingWidth = 1 | 43 | this.loadingWidth = 1 |
| 43 | this.showLoading = false | 44 | this.showLoading = false |
| @@ -2,6 +2,7 @@ import measure from '@ohos.measure' | @@ -2,6 +2,7 @@ import measure from '@ohos.measure' | ||
| 2 | import { ContentDetailDTO } from 'wdBean/Index' | 2 | import { ContentDetailDTO } from 'wdBean/Index' |
| 3 | import { DetailDialog } from './DetailDialog' | 3 | import { DetailDialog } from './DetailDialog' |
| 4 | import { componentUtils } from '@kit.ArkUI' | 4 | import { componentUtils } from '@kit.ArkUI' |
| 5 | +import { DateTimeUtils } from 'wdKit' | ||
| 5 | 6 | ||
| 6 | const TAG = 'PlayerTitleView'; | 7 | const TAG = 'PlayerTitleView'; |
| 7 | @Preview | 8 | @Preview |
| @@ -152,7 +153,6 @@ export struct PlayerTitleView { | @@ -152,7 +153,6 @@ export struct PlayerTitleView { | ||
| 152 | .fontSize(12) | 153 | .fontSize(12) |
| 153 | .lineHeight(14) | 154 | .lineHeight(14) |
| 154 | .fontWeight(400) | 155 | .fontWeight(400) |
| 155 | - .margin({ bottom: 8 }) | ||
| 156 | .onClick(() => { | 156 | .onClick(() => { |
| 157 | this.isOpenDetail = true | 157 | this.isOpenDetail = true |
| 158 | this.dialogController?.open() | 158 | this.dialogController?.open() |
| @@ -198,9 +198,16 @@ export struct PlayerTitleView { | @@ -198,9 +198,16 @@ export struct PlayerTitleView { | ||
| 198 | top: 4, | 198 | top: 4, |
| 199 | bottom: 4 | 199 | bottom: 4 |
| 200 | }) | 200 | }) |
| 201 | - .margin({ bottom: 8 }) | ||
| 202 | } | 201 | } |
| 203 | } | 202 | } |
| 203 | + Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(), DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM)) | ||
| 204 | + .fontSize(12) | ||
| 205 | + .fontColor(Color.White) | ||
| 206 | + .opacity(0.7) | ||
| 207 | + .lineHeight(16) | ||
| 208 | + .fontWeight(400) | ||
| 209 | + .fontFamily('PingFang SC-Regular') | ||
| 210 | + .margin({ top: 8, bottom: 8 }) | ||
| 204 | 211 | ||
| 205 | } | 212 | } |
| 206 | .width(this.windowWidth - 150 + 'px') | 213 | .width(this.windowWidth - 150 + 'px') |
| @@ -208,4 +215,4 @@ export struct PlayerTitleView { | @@ -208,4 +215,4 @@ export struct PlayerTitleView { | ||
| 208 | .alignItems(HorizontalAlign.Start) | 215 | .alignItems(HorizontalAlign.Start) |
| 209 | .visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible) | 216 | .visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible) |
| 210 | } | 217 | } |
| 211 | -} | ||
| 218 | +} |
-
Please register or login to post a comment