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
wangliang_wd
2024-09-20 15:04:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
35b0dafd02eebcce062224248b813a0bd9bcbbbc
35b0dafd
1 parent
2f8a8ddd
feat:优化个人主页UI显示
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
25 deletions
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
sight_harmony/features/wdComponent/src/main/ets/pages/OtherNormalUserHomePage.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
View file @
35b0daf
import router from '@ohos.router'
import { DateTimeUtils, NetworkUtil, StringUtils, WindowModel } from 'wdKit';
import { DateTimeUtils, NetworkUtil,
NumberFormatterUtils,
StringUtils, WindowModel } from 'wdKit';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { editModelParams } from '../model/EditInfoModel';
import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent';
...
...
@@ -154,7 +154,7 @@ struct MineHomePage {
Row() {
Row() {
Text(
this.handlerNum(this.browseNum.toString())
)
Text(
`${NumberFormatterUtils.formatNumberWithWan(this.browseNum)}`
)
.textStyle()
Text("阅读")
.textStyle2()
...
...
@@ -168,7 +168,7 @@ struct MineHomePage {
.vertical(true)
.opacity(0.4)
Row() {
Text(
this.handlerNum(this.commentNum.toString())
)
Text(
`${NumberFormatterUtils.formatNumberWithWan(this.commentNum)}`
)
.textStyle()
Text("评论")
.textStyle2()
...
...
@@ -182,7 +182,7 @@ struct MineHomePage {
.vertical(true)
.opacity(0.4)
Row() {
Text(
this.handlerNum(this.attentionNum.toString())
)
Text(
`${NumberFormatterUtils.formatNumberWithWan(this.attentionNum)}`
)
.textStyle()
Text("关注")
.textStyle2()
...
...
@@ -520,23 +520,6 @@ struct MineHomePage {
})
}
handlerNum(number: string) {
const num = number??'0';
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); // 千
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);
return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
}
return num
}
getUserLevel(){
MinePageDatasModel.getUserLevelData(getContext(this)).then((value)=>{
if(value!=null){
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/OtherNormalUserHomePage.ets
View file @
35b0daf
import router from '@ohos.router'
import { Params } from 'wdBean';
import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit';
import { DateTimeUtils, NetworkUtil,
NumberFormatterUtils,
StringUtils } from 'wdKit';
import { TrackingPageBrowse, TrackConstants, ParamType, Tracking } from 'wdTracking/Index';
import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent';
import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent';
...
...
@@ -129,7 +129,7 @@ struct OtherNormalUserHomePage {
Row() {
Row() {
Text(`${
this.browseNum
}`)
Text(`${
NumberFormatterUtils.formatNumberWithWan(this.browseNum)
}`)
.textStyle()
Text("阅读")
.textStyle2()
...
...
@@ -143,7 +143,7 @@ struct OtherNormalUserHomePage {
.vertical(true)
.opacity(0.4)
Row() {
Text(`${
this.commentNum
}`)
Text(`${
NumberFormatterUtils.formatNumberWithWan(this.commentNum)
}`)
.textStyle()
Text("评论")
.textStyle2()
...
...
@@ -156,7 +156,7 @@ struct OtherNormalUserHomePage {
.vertical(true)
.opacity(0.4)
Row() {
Text(`${
this.attentionNum
}`)
Text(`${
NumberFormatterUtils.formatNumberWithWan(this.attentionNum)
}`)
.textStyle()
Text("关注")
.textStyle2()
...
...
Please
register
or
login
to post a comment