yangchenggong1_wd

fix:bug[18407] 关注列表下的粉丝数精度鸿蒙与安卓不一致

@@ -231,13 +231,10 @@ export struct FollowListDetailUI { @@ -231,13 +231,10 @@ export struct FollowListDetailUI {
231 value.forEach((item) => { 231 value.forEach((item) => {
232 if (data.creatorId == item.creatorId) { 232 if (data.creatorId == item.creatorId) {
233 data.headPhotoUrl = item.headPhotoUrl 233 data.headPhotoUrl = item.headPhotoUrl
234 - if (item.fansNum > 10000) {  
235 - let temp = (item.fansNum / 10000) + ""  
236 - let index = temp.indexOf('.')  
237 - if (index != -1) {  
238 - temp = temp.substring(0, index + 2)  
239 - } else {  
240 - temp = temp 234 + if (item.fansNum >= 10000) {
  235 + let temp = (item.fansNum / 10000) .toFixed(1)
  236 + if (Number(temp.substring(temp.length-1)) == 0) {
  237 + temp = temp.substring(0, temp.length-2)
241 } 238 }
242 data.cnFansNum = temp + "万" 239 data.cnFansNum = temp + "万"
243 } else { 240 } else {
@@ -207,13 +207,10 @@ export struct HomePageBottomFollowComponent { @@ -207,13 +207,10 @@ export struct HomePageBottomFollowComponent {
207 value.list.forEach((value) => { 207 value.list.forEach((value) => {
208 let fansNum: number = value.fansNum 208 let fansNum: number = value.fansNum
209 let fansNumString = "" 209 let fansNumString = ""
210 - if (fansNum > 10000) {  
211 - let temp = (fansNum / 10000) + ""  
212 - let index = temp.indexOf('.')  
213 - if (index != -1) {  
214 - temp = temp.substring(0, index + 2)  
215 - } else {  
216 - temp = temp 210 + if (fansNum >= 10000) {
  211 + let temp = (fansNum / 10000) .toFixed(1)
  212 + if (Number(temp.substring(temp.length-1)) == 0) {
  213 + temp = temp.substring(0, temp.length-2)
217 } 214 }
218 fansNumString = temp + "万" 215 fansNumString = temp + "万"
219 } else { 216 } else {
@@ -168,7 +168,18 @@ export struct OtherHomePageBottomFollowComponent{ @@ -168,7 +168,18 @@ export struct OtherHomePageBottomFollowComponent{
168 this.hasMore = false 168 this.hasMore = false
169 }else{ 169 }else{
170 value.list.forEach((value)=>{ 170 value.list.forEach((value)=>{
171 - this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId,value.mainControl,value.banControl,value.authIcon)) 171 + let fansNum: number = value.fansNum
  172 + let fansNumString = ""
  173 + if (fansNum >= 10000) {
  174 + let temp = (fansNum / 10000) .toFixed(1)
  175 + if (Number(temp.substring(temp.length-1)) == 0) {
  176 + temp = temp.substring(0, temp.length-2)
  177 + }
  178 + fansNumString = temp + "万"
  179 + } else {
  180 + fansNumString = fansNum + ""
  181 + }
  182 + this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,fansNumString,value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId,value.mainControl,value.banControl,value.authIcon))
172 }) 183 })
173 this.data_follow.notifyDataReload() 184 this.data_follow.notifyDataReload()
174 this.count = this.data_follow.totalCount() 185 this.count = this.data_follow.totalCount()