提交 1de77e83 编写于 作者: K kongbai121

搞定

上级 5ebe2eb4
......@@ -20,20 +20,31 @@ Page({
names:'',
noSignIn:'您还未登录,请前往登录',
commentOne:'我来抢楼',
fuId:''
fuId: -1,
nickname:'',
touserid:-1
},
//回到父级评论
rollBACK(){
this.setData({
fuId:-1,
nickname:null,
touserid:-1,
commentOne:'我来抢楼',
})
},
// 点击回复评论
clickComment(e){
// console.log(e);
var that = this;
wx.request({
url: app.globalData.myUrl + '/comment/deliver',
method:'GET',
data:{
fuId:e.currentTarget.dataset.fuid
}
this.setData({
fuId:e.currentTarget.dataset.fuid,
nickname:e.currentTarget.dataset.nickname,
touserid:e.currentTarget.dataset.touserid,
commentOne:'回复->'+e.currentTarget.dataset.nickname,
})
// console.log(this.data);
},
......@@ -214,12 +225,20 @@ toggleDialogtwo(e) {
data: {
content:that.data.userMessage, //评论内容
articleId: that.data.articleId, //文章id
commentId: that.data.fuId,
toUserId:that.data.touserid,
token:app.globalData.token
},
success: (res) => {
// console.log(res);
if (res.data.success) {
that.sucShowToast(res.data.msg)
that.setData({
fuId:-1,
nickname:null,
touserid:-1,
commentOne:'我来抢楼',
})
}
that.comment();
},
......
......@@ -38,7 +38,7 @@
<!-- 回复 -->
<text class="tail_text">全部回复</text>
<!-- 评论用户信息 -->
<view class="tail" wx:for="{{comment}}" wx:key="index">
<view class="tail" wx:for="{{comment}}" wx:key="index" bindtap="rollBACK">
<view class="tail_left"> <!-- 头像 -->
<image src="{{item.user.avatarUrl}}" bindtap="toggleDialogtwo" data-imgs="{{item.user.avatarUrl}}" data-names="{{item.user.nickName}}" data-userid="{{item.user.id}}"></image>
</view>
......@@ -48,11 +48,13 @@
</image>
<view class="tail_center">
<text class="tail_center_text" bindtap="clickComment" data-fuid="{{item.user.nickName}}">{{item.content}}</text>
<text class="tail_center_text" catchtap="clickComment" data-touserid="{{item.user.id}}" data-nickname="{{item.user.nickName}}"
data-fuid="{{item.id}}" wx:key="key">{{item.content}}</text>
<view class="hr"></view>
<view class="father">
<text>shui回复{{fuId}}:32165451</text>
<view class="father" wx:for="{{item.comments}}" wx:key="this" wx:for-item="cell">
<text catchtap="clickComment" wx:key="key1" data-touserid="{{cell.user.id}}" data-nickname="{{cell.user.nickName}}"
data-fuid="{{item.id}}">{{cell.user.nickName}} 回复 {{cell.toUser.nickName}} : {{cell.content}}</text>
</view>
</view>
</view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册