wuyanan

ref |> 调整直播频道直播回顾楼层参与人数使用统一转换方法

@@ -2,7 +2,7 @@ import { CompDTO, ContentDTO } from 'wdBean'; @@ -2,7 +2,7 @@ import { CompDTO, ContentDTO } from 'wdBean';
2 import { ProcessUtils } from 'wdRouter'; 2 import { ProcessUtils } from 'wdRouter';
3 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 3 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
4 import { hasClicked, persistentStorage } from '../../utils/persistentStorage'; 4 import { hasClicked, persistentStorage } from '../../utils/persistentStorage';
5 -import { DateTimeUtils } from 'wdKit/Index'; 5 +import { DateTimeUtils, NumberFormatterUtils } from 'wdKit/Index';
6 import { LottieView } from '../lottie/LottieView'; 6 import { LottieView } from '../lottie/LottieView';
7 import { router } from '@kit.ArkUI'; 7 import { router } from '@kit.ArkUI';
8 8
@@ -155,13 +155,6 @@ export struct LiveBigImage02Component { @@ -155,13 +155,6 @@ export struct LiveBigImage02Component {
155 } 155 }
156 156
157 private computeShowNum(count: number): string { 157 private computeShowNum(count: number): string {
158 - if (count >= 10000) {  
159 - let num = (count / 10000).toFixed(1)  
160 - if (Number(num.substring(num.length - 1)) == 0) {  
161 - num = num.substring(0, num.length - 2)  
162 - }  
163 - return num + '万人参加'  
164 - }  
165 - return `${count}人参加` 158 + return NumberFormatterUtils.formatNumberWithWan(count) + '人参加'
166 } 159 }
167 } 160 }
1 import { CompDTO, ContentDTO, LiveRoomDataBean } from 'wdBean'; 1 import { CompDTO, ContentDTO, LiveRoomDataBean } from 'wdBean';
2 import { CommonConstants } from 'wdConstant/Index'; 2 import { CommonConstants } from 'wdConstant/Index';
3 -import { Logger } from 'wdKit/Index'; 3 +import { Logger, NumberFormatterUtils } from 'wdKit/Index';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
5 import PageViewModel from '../../viewmodel/PageViewModel'; 5 import PageViewModel from '../../viewmodel/PageViewModel';
6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
@@ -98,15 +98,7 @@ export struct ZhGridLayout02NewsContent { @@ -98,15 +98,7 @@ export struct ZhGridLayout02NewsContent {
98 } 98 }
99 99
100 private computeShowNum(bean: LiveRoomDataBean): string { 100 private computeShowNum(bean: LiveRoomDataBean): string {
101 - let count = bean.pv  
102 - if (count >= 10000) {  
103 - let num = (count / 10000).toFixed(1)  
104 - if (Number(num.substring(num.length - 1)) == 0) {  
105 - num = num.substring(0, num.length - 2)  
106 - }  
107 - return num + '万人参加'  
108 - }  
109 - return `${count}人参加` 101 + return NumberFormatterUtils.formatNumberWithWan(bean.pv) + '人参加'
110 } 102 }
111 } 103 }
112 104
1 import measure from '@ohos.measure' 1 import measure from '@ohos.measure'
2 -import { DisplayUtils } from 'wdKit' 2 +import { DisplayUtils, NumberFormatterUtils } from 'wdKit'
3 import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' 3 import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent'
4 import { PeopleShipHomePageAttestationComponent } from './PeopleShipHomePageAttestationComponent' 4 import { PeopleShipHomePageAttestationComponent } from './PeopleShipHomePageAttestationComponent'
5 import { Logger } from 'wdKit' 5 import { Logger } from 'wdKit'
@@ -366,14 +366,7 @@ export struct PeopleShipHomePageTopComponent { @@ -366,14 +366,7 @@ export struct PeopleShipHomePageTopComponent {
366 } 366 }
367 367
368 private computeShowNum(count: number) { 368 private computeShowNum(count: number) {
369 - if (count >= 10000) {  
370 - let num = ( count / 10000).toFixed(1)  
371 - if (Number(num.substring(num.length-1)) == 0) {  
372 - num = num.substring(0, num.length-2)  
373 - }  
374 - return num + '万'  
375 - }  
376 - return `${count}` 369 + return NumberFormatterUtils.formatNumberWithWan(count)
377 } 370 }
378 371
379 // 通过省份code获取IP问题 372 // 通过省份code获取IP问题