update:新增帖子登录之后才可以评论

This commit is contained in:
lihaoyuan 2025-11-25 16:30:19 +08:00
parent 1a58020062
commit a8b78b20e6

View File

@ -654,7 +654,7 @@
</view>
<view style="height: 87rpx" v-if="!datauser.IsComment"></view>
<view class="input_box" v-if="!datauser.IsComment">
<view @click="texthidden" class="input_box_input">
<!-- <view @click="texthidden" class="input_box_input">
<image
class="xiepinglun"
src="https://media-mall-prod-1259811287.cos.ap-guangzhou.myqcloud.com/static/xcxfile/appicon/img/xq_03.png"
@ -665,6 +665,17 @@
><span style="margin-left: 104rpx" v-else
>{{ sprintf(__("%s人已回复"), 0) }}
</span>
</view> -->
<view class="input_box_input" hover-class="none" @tap="onShowCommentInput">
<image
class="xiepinglun"
src="https://media-mall-prod-1259811287.cos.ap-guangzhou.myqcloud.com/static/xcxfile/appicon/img/xq_03.png"
></image>
<span>{{__('写下看法,参与讨论')}}</span>
<span style="margin-left:104rpx" v-if="dataComment.length>0">
{{sprintf(__('%s人已回复'),datauser.story_comment_count)}}
</span>
<span v-else>{{sprintf(__('%s人已回复'),0)}}</span>
</view>
<view class="input_box_fs" v-if="dataContent.IsCollection">
<image
@ -790,7 +801,9 @@
</navigator>
</block>
</view>
<loginPopup :show="showLoginPopup" @close="showLoginPopup=false" @loginSuccess="onLoginOk"/>
</view>
</template>
<script>
@ -798,7 +811,7 @@ import diy from "../../components/themes/diy.vue";
import wxParse from "@/components/u-parse/u-parse.vue";
import dateUtil from "../../helpers/util_date";
import { mapMutations, mapState } from "vuex";
import loginPopup from "@/components/loginPopup.vue";
let CommentVal = {};
export default {
@ -819,6 +832,8 @@ export default {
dataContent: {
ProList: [],
},
showLoginPopup: false, //
loginCallback: null, //
dataComment: [],
huifuvalue: "写评论...",
timeaid: 0,
@ -859,6 +874,7 @@ export default {
components: {
diy,
wxParse,
loginPopup
},
onLoad: function (options) {
uni.setNavigationBarTitle({
@ -967,15 +983,19 @@ export default {
texthidden: function () {
var that = this;
if (!that.datauser.IsComment) {
if (that.datauser.IsComment) {
wx.showToast({
title: this.__("你已经被禁言"),
icon: 'none',
duration: 2000
});
return;
}
CommentVal = {
user_id: that.userInfo.user_id,
story_id: that.datauser.story_id,
comment_content: that.value,
/*
createNiceName: app.globalData.UserInfo.NickName,
createPhotoPath: app.globalData.UserInfo.Photo,
operateId: that.shopInfo.store_id,*/
comment_reply_id: 0,
comment_id: 0,
to_user_id: that.datauser.user_id,
@ -985,7 +1005,6 @@ export default {
focus: true,
huifuvalue: that.__("写评论..."),
});
}
that.textblock();
},
@ -999,6 +1018,36 @@ export default {
: a.setData({
ishidden: true,
});
},
onShowCommentInput(){
if (!this.hasLogin) {
this.showLoginPopup = true;
wx.showToast({
title: this.__("请先登录后再评论"),
icon: 'none',
duration: 2000
});
return;
}
if (this.datauser.IsComment) {
this.$.alert(this.__("您已被禁言,无法评论!"));
return;
}
//
this.texthidden();
},
onLoginOk(){
this.showLoginPopup = false;
// IsComment
this.GetMemberPostsInfo();
this.GetPostsCommentByPostsId();
//
setTimeout(() => {
this.texthidden();
}, 500);
},
doNothing: function () {},
onComment: function (a) {
@ -3080,4 +3129,18 @@ input {
.u-top1{
bottom: 50px;
}
.input_box_input{
border:none;
background:#f6f6f6;
border-radius:5rpx;
width:587rpx;
height:65rpx;
margin:12rpx 0 14rpx 22rpx;
display:flex;
align-items:center;
font-size:26rpx;
color:#a4a4a4;
min-height: 65rpx;
padding: 0 20rpx;
}
</style>