陈剑华

fix: 16578 进入直播列表。直播预约按钮和时间没有显示

@@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean'; @@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean';
4 import { PageRepository } from '../../repository/PageRepository'; 4 import { PageRepository } from '../../repository/PageRepository';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import { HttpUtils } from 'wdNetwork/Index'; 6 import { HttpUtils } from 'wdNetwork/Index';
  7 +import { DateTimeUtils } from 'wdKit';
7 8
8 /** 9 /**
9 * 直播预约卡 10 * 直播预约卡
@@ -17,6 +18,22 @@ export struct ZhSingleRow03 { @@ -17,6 +18,22 @@ export struct ZhSingleRow03 {
17 @State compDTO: CompDTO = {} as CompDTO 18 @State compDTO: CompDTO = {} as CompDTO
18 scroller: Scroller = new Scroller() 19 scroller: Scroller = new Scroller()
19 20
  21 + format(timeNum: number) {
  22 + const todayDate = new Date().setHours(0,0,0,0)
  23 + const parseDate = new Date(timeNum).setHours(0,0,0,0);
  24 + if (todayDate === parseDate) {
  25 + return '今天'
  26 + } else { const str = DateTimeUtils.formatDate(timeNum, 'MM月dd日')
  27 + const month: string = str.split('月')[0];
  28 + if (month[0] === "0") {
  29 + return str.slice(1)
  30 + } else {
  31 + return str.slice(0)
  32 + }
  33 + }
  34 +
  35 + }
  36 +
20 build() { 37 build() {
21 Column() { 38 Column() {
22 //顶部 39 //顶部
@@ -42,7 +59,8 @@ export struct ZhSingleRow03 { @@ -42,7 +59,8 @@ export struct ZhSingleRow03 {
42 Row() { 59 Row() {
43 Flex({justifyContent: FlexAlign.SpaceBetween}){ 60 Flex({justifyContent: FlexAlign.SpaceBetween}){
44 Row() { 61 Row() {
45 - Text(item.liveInfo.liveStartTime.split(' ')[0].slice(5).split('-').join('月')+'日') 62 + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
  63 + // Text(item.liveInfo.liveStartTime.split(' ')[0].slice(5).split('-').join('月')+'日')
46 .margin({right: 6}) 64 .margin({right: 6})
47 .fontColor(0x000000) 65 .fontColor(0x000000)
48 .fontSize(13) 66 .fontSize(13)
@@ -106,7 +124,7 @@ export struct ZhSingleRow03 { @@ -106,7 +124,7 @@ export struct ZhSingleRow03 {
106 .width(3) 124 .width(3)
107 .height(16) 125 .height(16)
108 .margin({ right: 4 }) 126 .margin({ right: 4 })
109 - Text('直播预') 127 + Text('直播预')
110 .fontSize($r("app.float.font_size_17")) 128 .fontSize($r("app.float.font_size_17"))
111 .fontColor($r("app.color.color_222222")) 129 .fontColor($r("app.color.color_222222"))
112 .fontWeight(600) 130 .fontWeight(600)