wangliang_wd

feat:优化个人主页UI显示

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){
... ...
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()
... ...