gdpao
This commit is contained in:
@@ -72,7 +72,9 @@
|
||||
<text class="child_content">{{ child.content }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="more-comment" @click="getReplyList(item.id)" v-if="item.reply_count">展开更多回复</text>
|
||||
<text class="more-comment" @click="getReplyList(item.id)" v-if="item.reply_count">
|
||||
{{ child_end[item.id] ? "暂无更多回复" : "展开更多回复" }}
|
||||
</text>
|
||||
<text></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -167,6 +169,7 @@
|
||||
time_count: 0,
|
||||
linear: null,
|
||||
loadinging: false,
|
||||
child_end: {},
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
@@ -246,6 +249,16 @@
|
||||
// console.log(res.data);
|
||||
this.commentList = res.data.data;
|
||||
}
|
||||
let list = this.commentList;
|
||||
list.forEach((item,index) => {
|
||||
console.log(item);
|
||||
item.page = 0;
|
||||
item.commentList = [];
|
||||
this.page_[item.id] = 0;
|
||||
this.child_end[item.id] = false;
|
||||
})
|
||||
console.log(list);
|
||||
this.commentList = list;
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -317,7 +330,6 @@
|
||||
uni.showLoading({
|
||||
title: "loading..."
|
||||
})
|
||||
if (!this.page_[id] === 0) {}
|
||||
uni.request({
|
||||
url: temp_url + "article/articleReplyList",
|
||||
method: "POST",
|
||||
@@ -332,14 +344,18 @@
|
||||
uni.hideLoading();
|
||||
console.log(this.page_);
|
||||
if (res.data.errCode == 0) {
|
||||
if (res.data.data.length < 10) {
|
||||
this.is_more = false;
|
||||
if (this.page_[id] == 0) {
|
||||
this.allList[id] = res.data.data;
|
||||
} else {
|
||||
this.allList[id] = this.allList[id].concat(res.data.data);
|
||||
}
|
||||
this.page_[id]++;
|
||||
console.log(this.page_);
|
||||
this.allList[id] = res.data.data;
|
||||
this.$forceUpdate();
|
||||
} else if (res.data.errCode == 1) {
|
||||
this.child_end[id] = true;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
console.log(this.allList);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user