Showing
3 changed files
with
7 additions
and
7 deletions
| @@ -275,6 +275,7 @@ export struct CommentComponent { | @@ -275,6 +275,7 @@ export struct CommentComponent { | ||
| 275 | 275 | ||
| 276 | // 这里需要先赋值,否则下次UI刷新可能重复进入第1页两次 | 276 | // 这里需要先赋值,否则下次UI刷新可能重复进入第1页两次 |
| 277 | this.currentPage = pageIndex + 1 | 277 | this.currentPage = pageIndex + 1 |
| 278 | + | ||
| 278 | if (Number.parseInt(commentListModel.totalCommentNum) > | 279 | if (Number.parseInt(commentListModel.totalCommentNum) > |
| 279 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | 280 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { |
| 280 | this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' | 281 | this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' |
| 1 | -import { DisplayUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index' | 1 | +import { DisplayUtils, EmitterEventId, EmitterUtils, ToastUtils, NumberFormatterUtils } from 'wdKit/Index' |
| 2 | import { publishCommentModel } from '../model/PublishCommentModel' | 2 | import { publishCommentModel } from '../model/PublishCommentModel' |
| 3 | import { CommentCustomDialog } from './CommentCustomDialog' | 3 | import { CommentCustomDialog } from './CommentCustomDialog' |
| 4 | import measure from '@ohos.measure' | 4 | import measure from '@ohos.measure' |
| @@ -206,7 +206,7 @@ export struct CommentIconComponent { | @@ -206,7 +206,7 @@ export struct CommentIconComponent { | ||
| 206 | // x:-6 | 206 | // x:-6 |
| 207 | // }) | 207 | // }) |
| 208 | .id("Image") | 208 | .id("Image") |
| 209 | - Text(this.showMainText?'正文':this.publishCommentModel.totalCommentNumer)// Text("44444444") | 209 | + Text(this.showMainText?'正文':NumberFormatterUtils.formatNumberWithWan(this.publishCommentModel.totalCommentNumer))// Text("44444444") |
| 210 | .fontSize(8) | 210 | .fontSize(8) |
| 211 | .fontColor(this.showMainText?'#222222':'#ffffff')// .backgroundColor('#ED2800') | 211 | .fontColor(this.showMainText?'#222222':'#ffffff')// .backgroundColor('#ED2800') |
| 212 | .height(12) | 212 | .height(12) |
| @@ -217,7 +217,7 @@ export struct CommentIconComponent { | @@ -217,7 +217,7 @@ export struct CommentIconComponent { | ||
| 217 | })// .margin({left: 4,right:4 | 217 | })// .margin({left: 4,right:4 |
| 218 | // }) | 218 | // }) |
| 219 | /*动态计算文字宽度*/ | 219 | /*动态计算文字宽度*/ |
| 220 | - .width(this.getMeasureText(this.publishCommentModel.totalCommentNumer) + | 220 | + .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.publishCommentModel.totalCommentNumer)) + |
| 221 | 12)// .backgroundColor(Color.Green) | 221 | 12)// .backgroundColor(Color.Green) |
| 222 | .id("Text") | 222 | .id("Text") |
| 223 | .visibility(this.publishCommentModel.totalCommentNumer ? Visibility.Visible : Visibility.Hidden) | 223 | .visibility(this.publishCommentModel.totalCommentNumer ? Visibility.Visible : Visibility.Hidden) |
| @@ -542,16 +542,15 @@ export struct OperRowListView { | @@ -542,16 +542,15 @@ export struct OperRowListView { | ||
| 542 | if (res.data) { | 542 | if (res.data) { |
| 543 | this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum) | 543 | this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum) |
| 544 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) | 544 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) |
| 545 | - this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) | 545 | + // this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) |
| 546 | + this.interactData.commentNum = res.data[0]?.commentNum | ||
| 546 | // 评论组件需要数据 | 547 | // 评论组件需要数据 |
| 547 | - if (Number.parseInt(this.interactData.commentNum) > | 548 | + if (Number.parseInt(this.interactData.commentNum + '') > |
| 548 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | 549 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { |
| 549 | this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' | 550 | this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' |
| 550 | } | 551 | } |
| 551 | } | 552 | } |
| 552 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) | 553 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) |
| 553 | - console.log(TAG, 'this.interactData44', JSON.stringify(this.interactData)) | ||
| 554 | - console.log(TAG, 'this.publishCommentModel', JSON.stringify(this.publishCommentModel)) | ||
| 555 | }) | 554 | }) |
| 556 | } | 555 | } |
| 557 | } | 556 | } |
-
Please register or login to post a comment