yanlu

fix:16987 UI还原问题-直播间,日期格式和日期样式,看图

@@ -23,8 +23,8 @@ export struct LiveCountdownComponent { @@ -23,8 +23,8 @@ export struct LiveCountdownComponent {
23 aboutToAppear(): void { 23 aboutToAppear(): void {
24 //注册字体 24 //注册字体
25 font.registerFont({ 25 font.registerFont({
26 - familyName: 'BebasNeue_Regular',  
27 - familySrc: $rawfile('font/BebasNeue_Regular.otf') 26 + familyName: 'BebasNeueBold',
  27 + familySrc: $rawfile('font/BebasNeueBold.otf')
28 }) 28 })
29 setTimeout(() => { 29 setTimeout(() => {
30 this.textTimerController.start() 30 this.textTimerController.start()
@@ -69,13 +69,16 @@ export struct LiveCountdownComponent { @@ -69,13 +69,16 @@ export struct LiveCountdownComponent {
69 .showTimeStyleBold() 69 .showTimeStyleBold()
70 Text('月') 70 Text('月')
71 .showTimeStyleNormal() 71 .showTimeStyleNormal()
72 - .margin({ left: 3 }) 72 + .margin({ left: 1 })
  73 + .baselineOffset('-6vp')
73 Text(this.day) 74 Text(this.day)
74 .showTimeStyleBold() 75 .showTimeStyleBold()
75 .margin({ left: 3 }) 76 .margin({ left: 3 })
76 Text('日') 77 Text('日')
77 .showTimeStyleNormal() 78 .showTimeStyleNormal()
78 - .margin({ left: 3 }) 79 + .margin({ left: 1 })
  80 + .baselineOffset('-6vp')
  81 +
79 Text(this.hour) 82 Text(this.hour)
80 .showTimeStyleBold() 83 .showTimeStyleBold()
81 .margin({ left: 10 }) 84 .margin({ left: 10 })
@@ -85,15 +88,15 @@ export struct LiveCountdownComponent { @@ -85,15 +88,15 @@ export struct LiveCountdownComponent {
85 .showTimeStyleBold() 88 .showTimeStyleBold()
86 } 89 }
87 .margin({ top: 10 }) 90 .margin({ top: 10 })
88 - .visibility(this.isCountDownStart ? Visibility.None : Visibility.Visible  
89 - ) 91 + .visibility(this.isCountDownStart ? Visibility.None : Visibility.Visible)
90 92
  93 + // 倒计时
91 TextTimer({ isCountDown: true, count: this.differenceTimeStamp, controller: this.textTimerController }) 94 TextTimer({ isCountDown: true, count: this.differenceTimeStamp, controller: this.textTimerController })
92 .format(this.format) 95 .format(this.format)
93 - .fontSize('40fp') 96 + .fontSize('40vp')
94 .fontWeight(FontWeight.Bold) 97 .fontWeight(FontWeight.Bold)
95 .fontColor('#222222') 98 .fontColor('#222222')
96 - .fontFamily('BebasNeue_Regular') 99 + .fontFamily('BebasNeueBold')
97 .onTimer((utc: number, elapsedTime: number) => { 100 .onTimer((utc: number, elapsedTime: number) => {
98 console.info('textTimer notCountDown utc is:' + utc + ', elapsedTime: ' + elapsedTime) 101 console.info('textTimer notCountDown utc is:' + utc + ', elapsedTime: ' + elapsedTime)
99 }) 102 })
@@ -139,7 +142,7 @@ export struct LiveCountdownComponent { @@ -139,7 +142,7 @@ export struct LiveCountdownComponent {
139 //2024-04-01 19:44:00-trim->2024-04-0119:44:00 142 //2024-04-01 19:44:00-trim->2024-04-0119:44:00
140 if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) { 143 if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) {
141 let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime?.trim() 144 let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime?.trim()
142 - this.month = playStartTimeTmp.substring(5, 7) 145 + this.month = Number(playStartTimeTmp.substring(5, 7)).toString()
143 this.day = playStartTimeTmp.substring(8, 10) 146 this.day = playStartTimeTmp.substring(8, 10)
144 this.hour = playStartTimeTmp.substring(11, 13) 147 this.hour = playStartTimeTmp.substring(11, 13)
145 this.minute = playStartTimeTmp.substring(14, 16) 148 this.minute = playStartTimeTmp.substring(14, 16)
@@ -182,7 +185,7 @@ export struct LiveCountdownComponent { @@ -182,7 +185,7 @@ export struct LiveCountdownComponent {
182 185
183 @Extend(Text) 186 @Extend(Text)
184 function showTimeStyleNormal() { 187 function showTimeStyleNormal() {
185 - .fontSize('16fp') 188 + .fontSize('16vp')
186 .fontWeight(500) 189 .fontWeight(500)
187 .fontColor('#222222') 190 .fontColor('#222222')
188 } 191 }
@@ -190,7 +193,7 @@ function showTimeStyleNormal() { @@ -190,7 +193,7 @@ function showTimeStyleNormal() {
190 @Extend(Text) 193 @Extend(Text)
191 function showTimeStyleBold() { 194 function showTimeStyleBold() {
192 .fontSize('40fp') 195 .fontSize('40fp')
193 - .fontFamily('BebasNeue_Regular') 196 + .fontFamily('BebasNeueBold')
194 .fontWeight(FontWeight.Bold) 197 .fontWeight(FontWeight.Bold)
195 .fontColor('#222222') 198 .fontColor('#222222')
196 } 199 }