xugenyuan

ref |> 全局规则-游客评论开关关闭,弹出提示暂时无法评论

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
1 import { inputMethodEngine } from '@kit.IMEKit' 1 import { inputMethodEngine } from '@kit.IMEKit'
2 import { commentInfo } from 'wdBean/Index' 2 import { commentInfo } from 'wdBean/Index'
  3 +import { ToastUtils } from 'wdKit/Index'
  4 +import { HttpUtils } from 'wdNetwork/Index'
3 import { commentItemModel } from '../model/CommentModel' 5 import { commentItemModel } from '../model/CommentModel'
4 import { publishCommentModel } from '../model/PublishCommentModel' 6 import { publishCommentModel } from '../model/PublishCommentModel'
5 import commentViewModel from '../viewmodel/CommentViewModel' 7 import commentViewModel from '../viewmodel/CommentViewModel'
@@ -40,6 +42,17 @@ export struct CommentCustomDialog { @@ -40,6 +42,17 @@ export struct CommentCustomDialog {
40 } 42 }
41 } 43 }
42 44
  45 + // 未登录,游客评论未打开 则先登录
  46 + if (!HttpUtils.isLogin()) {
  47 + if (this.publishCommentModel.visitorComment != "1") {
  48 + ToastUtils.showToast("暂时无法评论", 3000)
  49 +
  50 + this.publishCommentModel.commentContent = ''
  51 + this.controller?.close()
  52 + return
  53 + }
  54 + }
  55 +
43 // 点击时 即可埋点 56 // 点击时 即可埋点
44 if (this.onPublishBtnClickTrack) { 57 if (this.onPublishBtnClickTrack) {
45 this.onPublishBtnClickTrack() 58 this.onPublishBtnClickTrack()
@@ -128,13 +128,13 @@ export struct CommentTabComponent { @@ -128,13 +128,13 @@ export struct CommentTabComponent {
128 if(this.contentDetail.appstyle === 9) return 128 if(this.contentDetail.appstyle === 9) return
129 this.onCommentFocus && this.onCommentFocus() 129 this.onCommentFocus && this.onCommentFocus()
130 130
131 - // 未登录,游客评论未打开 则先登录  
132 - if (!HttpUtils.isLogin()) {  
133 - if (this.contentDetail.visitorComment != 1) {  
134 - WDRouterRule.jumpWithPage(WDRouterPage.loginPage)  
135 - return  
136 - }  
137 - } 131 + // 未登录,游客评论未打开 则先登录 ,这里逻辑 放到 发布按钮事件判断了
  132 + // if (!HttpUtils.isLogin()) {
  133 + // if (this.contentDetail.visitorComment != 1) {
  134 + // ToastUtils.showToast("暂时无法评论", 3000)
  135 + // return
  136 + // }
  137 + // }
138 138
139 if (this.contentDetail.openComment != 1 && this.contentDetail.commentDisplay != 1) { 139 if (this.contentDetail.openComment != 1 && this.contentDetail.commentDisplay != 1) {
140 ToastUtils.showToast("暂时无法评论", 3000) 140 ToastUtils.showToast("暂时无法评论", 3000)