ref |> 修复评论相关问题
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Showing
2 changed files
with
19 additions
and
1 deletions
| @@ -279,6 +279,7 @@ export struct CommentComponent { | @@ -279,6 +279,7 @@ export struct CommentComponent { | ||
| 279 | 279 | ||
| 280 | if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { | 280 | if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { |
| 281 | 281 | ||
| 282 | + this.allDatas.clearAllData() // 防止数据重复问题 | ||
| 282 | commentListModel.list.forEach(element => { | 283 | commentListModel.list.forEach(element => { |
| 283 | element.hasMore = Number.parseInt(element.childCommentNum) ? true : false | 284 | element.hasMore = Number.parseInt(element.childCommentNum) ? true : false |
| 284 | let newModel = commentViewModel.deepCopyCommentItemModel(element) | 285 | let newModel = commentViewModel.deepCopyCommentItemModel(element) |
| 1 | -import { DisplayUtils, EmitterEventId, EmitterUtils } from 'wdKit/Index' | 1 | +import { DisplayUtils, EmitterEventId, EmitterUtils, ToastUtils } 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' |
| 5 | import { ContentDetailDTO } from 'wdBean/Index' | 5 | import { ContentDetailDTO } from 'wdBean/Index' |
| 6 | +import { HttpUtils } from 'wdNetwork/Index' | ||
| 7 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 6 | 8 | ||
| 7 | @Preview | 9 | @Preview |
| 8 | @Component | 10 | @Component |
| @@ -120,6 +122,21 @@ export struct CommentTabComponent { | @@ -120,6 +122,21 @@ export struct CommentTabComponent { | ||
| 120 | if(this.contentDetail.appstyle === 9) return | 122 | if(this.contentDetail.appstyle === 9) return |
| 121 | this.onCommentFocus && this.onCommentFocus() | 123 | this.onCommentFocus && this.onCommentFocus() |
| 122 | 124 | ||
| 125 | + // 未登录,游客评论未打开 则先登录 | ||
| 126 | + if (!HttpUtils.isLogin()) { | ||
| 127 | + if (this.contentDetail.visitorComment != 1) { | ||
| 128 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 129 | + return | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + if (this.contentDetail.openComment != 1 && this.contentDetail.commentDisplay != 1) { | ||
| 134 | + ToastUtils.showToast("暂时无法评论", 3000) | ||
| 135 | + return | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + //TODO: 用户被禁言 也不能评论 | ||
| 139 | + | ||
| 123 | this.publishCommentModel.rootCommentId = '-1'; | 140 | this.publishCommentModel.rootCommentId = '-1'; |
| 124 | this.publishCommentModel.parentId = '-1'; | 141 | this.publishCommentModel.parentId = '-1'; |
| 125 | this.publishCommentModel.placeHolderText = "说两句..." | 142 | this.publishCommentModel.placeHolderText = "说两句..." |
-
Please register or login to post a comment