|
@@ -59,8 +59,8 @@ Component({
|
|
|
this.setData({
|
|
|
commentList: this.data.commentList,
|
|
|
commentNum: commentNum
|
|
|
- },()=>{
|
|
|
- console.log('评论列表',this.data.commentList)
|
|
|
+ }, () => {
|
|
|
+ console.log('评论列表', this.data.commentList)
|
|
|
})
|
|
|
});
|
|
|
},
|
|
@@ -73,6 +73,13 @@ Component({
|
|
|
console.log('showControl', this.data.commentList[index].showControl)
|
|
|
},
|
|
|
|
|
|
+ textInput: function(e){
|
|
|
+ console.log('键入',e.detail.value)
|
|
|
+ this.setData({
|
|
|
+ inputValue: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// 评论作品
|
|
|
sendReply: function sendReply(e) {
|
|
|
console.log('sendReply', e.detail.value)
|
|
@@ -80,16 +87,16 @@ Component({
|
|
|
let data = {
|
|
|
columnId: this.data.commentId,
|
|
|
colunmNames: 'what',
|
|
|
- detailDesc: e.detail.value,
|
|
|
+ detailDesc: e.detail.value ? e.detail.value : this.data.inputValue,
|
|
|
}
|
|
|
this.replyWorks(data);
|
|
|
}
|
|
|
if (this.data.replyType === 'comment') {
|
|
|
let data = {
|
|
|
postsId: this.data.postId,
|
|
|
- content: e.detail.value
|
|
|
+ content: e.detail.value ? e.detail.value : this.data.inputValue
|
|
|
}
|
|
|
- console.log(321232123123,data)
|
|
|
+ console.log(321232123123, data)
|
|
|
|
|
|
this.replyComment(data);
|
|
|
}
|
|
@@ -101,16 +108,16 @@ Component({
|
|
|
let postId = e.currentTarget.dataset.id ? e.currentTarget.dataset.id : e.target.dataset.id;
|
|
|
let index = e.currentTarget.dataset.index || e.currentTarget.dataset.index === 0 ? e.currentTarget.dataset.index : e.target.dataset.index;
|
|
|
httpRequestApi.likeCommend(postId).success(res => {
|
|
|
- console.log('点赞点赞点赞',res.data);
|
|
|
+ console.log('点赞点赞点赞', res.data);
|
|
|
const str = `commentList[${index}].likes`;
|
|
|
const strImg = `commentList[${index}].isLike`;
|
|
|
- if(res.data.data){
|
|
|
+ if (res.data.data) {
|
|
|
this.setData({
|
|
|
[str]: res.data.data,
|
|
|
[strImg]: true
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
// 回复作品
|
|
@@ -161,12 +168,12 @@ Component({
|
|
|
httpRequestApi.getReply(this.uid, columnId, 1, 10).success((res) => {
|
|
|
const commentList = res.data.data.list;
|
|
|
commentList.forEach((item, index) => {
|
|
|
- console.log('回复列表',index)
|
|
|
- console.log('回复列表',this.data.postIndex)
|
|
|
-
|
|
|
+ console.log('回复列表', index)
|
|
|
+ console.log('回复列表', this.data.postIndex)
|
|
|
+
|
|
|
if (index === this.data.postIndex) {
|
|
|
let replyList = item.replyVOList;
|
|
|
- console.log('回复列表',replyList)
|
|
|
+ console.log('回复列表', replyList)
|
|
|
let str = `commentList[${index}].replyList`;
|
|
|
let strShow = `commentList[${index}].showControl`;
|
|
|
let strReply = `commentList[${index}].replyCount`;
|
|
@@ -174,8 +181,8 @@ Component({
|
|
|
[str]: replyList,
|
|
|
[strShow]: 10,
|
|
|
[strReply]: replyList.length
|
|
|
- },()=>{
|
|
|
- console.log('刷新后列表',this.data.commentList)
|
|
|
+ }, () => {
|
|
|
+ console.log('刷新后列表', this.data.commentList)
|
|
|
})
|
|
|
return;
|
|
|
};
|