Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-09-21 16:02:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
efd9b216d237cc34a5a598eea83948e6be73ae98
efd9b216
1 parent
98d77063
fix: 20235 【uat】 大图卡回看观看人数andriod 显示26万,鸿蒙显示25.9万人参加
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardMediaInfo.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardMediaInfo.ets
View file @
efd9b21
...
...
@@ -57,12 +57,24 @@ export struct CardMediaInfo {
if (Number.parseInt(num) <= 9999) {
return Number.parseInt(num).toString()
} else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) {
const num1: string = num.slice(0, -4); // 万
const num2: string = num.slice(-4, -3); // 千
let num1: string = num.slice(0, -4); // 万
let num2: string = num.slice(-4, -3); // 千
const num3: string = num.slice(-3, -2); // 百
if (Math.round(Number(`0.${num3}`)) === 1) num2 = `${Number(num2) + 1}`
if (Number(num2) === 10) {
num2 = '0';
num1 = `${Number(num1) + 1}`
}
return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万'
} else if (Number.parseInt(num) > 99999999) {
const num1: string = num.slice(0, -8); // 亿
const num2: string = num.slice(-8, -7);
let num1: string = num.slice(0, -8); // 亿
let num2: string = num.slice(-8, -7);
const num3: string = num.slice(-3, -2); // 百
if (Math.round(Number(`0.${num3}`)) === 1) num2 = `${Number(num2) + 1}`
if (Number(num2) === 10) {
num2 = '0';
num1 = `${Number(num1) + 1}`
}
return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
}
return num
...
...
@@ -78,6 +90,7 @@ export struct CardMediaInfo {
let liveIdList: string = this.contentDTO.objectId
let data: joinPeopleNum[] = await LiveModel.getJoinPeopleNum(liveIdList)
this.joinPeopleNum = data[0].pv;
console.log('getJoinPeopleNum ', this.joinPeopleNum)
}
build() {
...
...
Please
register
or
login
to post a comment