xugenyuan

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

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
import { inputMethodEngine } from '@kit.IMEKit'
import { commentInfo } from 'wdBean/Index'
import { ToastUtils } from 'wdKit/Index'
import { HttpUtils } from 'wdNetwork/Index'
import { commentItemModel } from '../model/CommentModel'
import { publishCommentModel } from '../model/PublishCommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
... ... @@ -40,6 +42,17 @@ export struct CommentCustomDialog {
}
}
// 未登录,游客评论未打开 则先登录
if (!HttpUtils.isLogin()) {
if (this.publishCommentModel.visitorComment != "1") {
ToastUtils.showToast("暂时无法评论", 3000)
this.publishCommentModel.commentContent = ''
this.controller?.close()
return
}
}
// 点击时 即可埋点
if (this.onPublishBtnClickTrack) {
this.onPublishBtnClickTrack()
... ...
... ... @@ -128,13 +128,13 @@ export struct CommentTabComponent {
if(this.contentDetail.appstyle === 9) return
this.onCommentFocus && this.onCommentFocus()
// 未登录,游客评论未打开 则先登录
if (!HttpUtils.isLogin()) {
if (this.contentDetail.visitorComment != 1) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
}
// 未登录,游客评论未打开 则先登录 ,这里逻辑 放到 发布按钮事件判断了
// if (!HttpUtils.isLogin()) {
// if (this.contentDetail.visitorComment != 1) {
// ToastUtils.showToast("暂时无法评论", 3000)
// return
// }
// }
if (this.contentDetail.openComment != 1 && this.contentDetail.commentDisplay != 1) {
ToastUtils.showToast("暂时无法评论", 3000)
... ...