update:新增帖子登录之后才可以评论
This commit is contained in:
parent
1a58020062
commit
a8b78b20e6
@ -654,7 +654,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="height: 87rpx" v-if="!datauser.IsComment"></view>
|
<view style="height: 87rpx" v-if="!datauser.IsComment"></view>
|
||||||
<view class="input_box" v-if="!datauser.IsComment">
|
<view class="input_box" v-if="!datauser.IsComment">
|
||||||
<view @click="texthidden" class="input_box_input">
|
<!-- <view @click="texthidden" class="input_box_input">
|
||||||
<image
|
<image
|
||||||
class="xiepinglun"
|
class="xiepinglun"
|
||||||
src="https://media-mall-prod-1259811287.cos.ap-guangzhou.myqcloud.com/static/xcxfile/appicon/img/xq_03.png"
|
src="https://media-mall-prod-1259811287.cos.ap-guangzhou.myqcloud.com/static/xcxfile/appicon/img/xq_03.png"
|
||||||
@ -665,7 +665,18 @@
|
|||||||
><span style="margin-left: 104rpx" v-else
|
><span style="margin-left: 104rpx" v-else
|
||||||
>{{ sprintf(__("%s人已回复"), 0) }}
|
>{{ sprintf(__("%s人已回复"), 0) }}
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</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">
|
<view class="input_box_fs" v-if="dataContent.IsCollection">
|
||||||
<image
|
<image
|
||||||
@click="onUnCollection"
|
@click="onUnCollection"
|
||||||
@ -790,7 +801,9 @@
|
|||||||
</navigator>
|
</navigator>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
|
<loginPopup :show="showLoginPopup" @close="showLoginPopup=false" @loginSuccess="onLoginOk"/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -798,7 +811,7 @@ import diy from "../../components/themes/diy.vue";
|
|||||||
import wxParse from "@/components/u-parse/u-parse.vue";
|
import wxParse from "@/components/u-parse/u-parse.vue";
|
||||||
import dateUtil from "../../helpers/util_date";
|
import dateUtil from "../../helpers/util_date";
|
||||||
import { mapMutations, mapState } from "vuex";
|
import { mapMutations, mapState } from "vuex";
|
||||||
|
import loginPopup from "@/components/loginPopup.vue";
|
||||||
let CommentVal = {};
|
let CommentVal = {};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -819,6 +832,8 @@ export default {
|
|||||||
dataContent: {
|
dataContent: {
|
||||||
ProList: [],
|
ProList: [],
|
||||||
},
|
},
|
||||||
|
showLoginPopup: false, // 登录弹窗显示控制
|
||||||
|
loginCallback: null, // 存储登录成功后的回调
|
||||||
dataComment: [],
|
dataComment: [],
|
||||||
huifuvalue: "写评论...",
|
huifuvalue: "写评论...",
|
||||||
timeaid: 0,
|
timeaid: 0,
|
||||||
@ -859,6 +874,7 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
diy,
|
diy,
|
||||||
wxParse,
|
wxParse,
|
||||||
|
loginPopup
|
||||||
},
|
},
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
@ -967,28 +983,31 @@ export default {
|
|||||||
texthidden: function () {
|
texthidden: function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
if (!that.datauser.IsComment) {
|
if (that.datauser.IsComment) {
|
||||||
CommentVal = {
|
wx.showToast({
|
||||||
user_id: that.userInfo.user_id,
|
title: this.__("你已经被禁言"),
|
||||||
story_id: that.datauser.story_id,
|
icon: 'none',
|
||||||
comment_content: that.value,
|
duration: 2000
|
||||||
/*
|
});
|
||||||
createNiceName: app.globalData.UserInfo.NickName,
|
return;
|
||||||
createPhotoPath: app.globalData.UserInfo.Photo,
|
}
|
||||||
operateId: that.shopInfo.store_id,*/
|
|
||||||
comment_reply_id: 0,
|
|
||||||
comment_id: 0,
|
|
||||||
to_user_id: that.datauser.user_id,
|
|
||||||
};
|
|
||||||
|
|
||||||
that.setData({
|
CommentVal = {
|
||||||
focus: true,
|
user_id: that.userInfo.user_id,
|
||||||
huifuvalue: that.__("写评论..."),
|
story_id: that.datauser.story_id,
|
||||||
});
|
comment_content: that.value,
|
||||||
}
|
comment_reply_id: 0,
|
||||||
|
comment_id: 0,
|
||||||
|
to_user_id: that.datauser.user_id,
|
||||||
|
};
|
||||||
|
|
||||||
that.textblock();
|
that.setData({
|
||||||
},
|
focus: true,
|
||||||
|
huifuvalue: that.__("写评论..."),
|
||||||
|
});
|
||||||
|
|
||||||
|
that.textblock();
|
||||||
|
},
|
||||||
textblock: function () {
|
textblock: function () {
|
||||||
var a = this;
|
var a = this;
|
||||||
1 == a.ishidden
|
1 == a.ishidden
|
||||||
@ -1000,6 +1019,36 @@ export default {
|
|||||||
ishidden: true,
|
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 () {},
|
doNothing: function () {},
|
||||||
onComment: function (a) {
|
onComment: function (a) {
|
||||||
let that = this;
|
let that = this;
|
||||||
@ -3080,4 +3129,18 @@ input {
|
|||||||
.u-top1{
|
.u-top1{
|
||||||
bottom: 50px;
|
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>
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user