Showing
2 changed files
with
14 additions
and
8 deletions
| @@ -11,6 +11,14 @@ import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRe | @@ -11,6 +11,14 @@ import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRe | ||
| 11 | export struct FollowChildComponent{ | 11 | export struct FollowChildComponent{ |
| 12 | @ObjectLink data: FollowListDetailItem | 12 | @ObjectLink data: FollowListDetailItem |
| 13 | @State type:number = 0 | 13 | @State type:number = 0 |
| 14 | + @State columnHeight:number = 202 | ||
| 15 | + | ||
| 16 | + | ||
| 17 | + aboutToAppear(): void { | ||
| 18 | + if(this.type == 0 && StringUtils.isEmpty(this.data.introduction)){ | ||
| 19 | + this.columnHeight = 202 - 31 | ||
| 20 | + } | ||
| 21 | + } | ||
| 14 | 22 | ||
| 15 | build() { | 23 | build() { |
| 16 | if(this.type == 0 ){ | 24 | if(this.type == 0 ){ |
| @@ -115,7 +123,7 @@ export struct FollowChildComponent{ | @@ -115,7 +123,7 @@ export struct FollowChildComponent{ | ||
| 115 | .justifyContent(FlexAlign.SpaceBetween) | 123 | .justifyContent(FlexAlign.SpaceBetween) |
| 116 | .alignItems(VerticalAlign.Top) | 124 | .alignItems(VerticalAlign.Top) |
| 117 | 125 | ||
| 118 | - }.height('202lpx') | 126 | + }.height(`${this.columnHeight}lpx`) |
| 119 | .justifyContent(FlexAlign.Start) | 127 | .justifyContent(FlexAlign.Start) |
| 120 | 128 | ||
| 121 | Divider() | 129 | Divider() |
| @@ -144,13 +144,11 @@ export struct FollowListDetailUI { | @@ -144,13 +144,11 @@ export struct FollowListDetailUI { | ||
| 144 | value.list.forEach((value) => { | 144 | value.list.forEach((value) => { |
| 145 | let fansNum: number = value.fansNum | 145 | let fansNum: number = value.fansNum |
| 146 | let fansNumString = "" | 146 | let fansNumString = "" |
| 147 | - if (fansNum > 10000) { | ||
| 148 | - let temp = (fansNum / 10000) + "" | ||
| 149 | - let index = temp.indexOf('.') | ||
| 150 | - if (index != -1) { | ||
| 151 | - temp = temp.substring(0, index + 2) | ||
| 152 | - } else { | ||
| 153 | - temp = temp | 147 | + |
| 148 | + if (fansNum >= 10000) { | ||
| 149 | + let temp = (fansNum / 10000) .toFixed(1) | ||
| 150 | + if (Number(temp.substring(temp.length-1)) == 0) { | ||
| 151 | + temp = temp.substring(0, temp.length-2) | ||
| 154 | } | 152 | } |
| 155 | fansNumString = temp + "万" | 153 | fansNumString = temp + "万" |
| 156 | } else { | 154 | } else { |
-
Please register or login to post a comment