This commit is contained in:
Gdpao 2020-08-06 10:35:59 +08:00
parent 720af35b11
commit 046f2e50c5
2 changed files with 59 additions and 15 deletions

View File

@ -5,7 +5,7 @@
<view class="backes"></view>
<image class="head" :src="item.article_pic" ></image>
</view>
<view class="title" v-if="!isguanzhu">{{ item.article_title }}</view>
<view class="title" v-if="">{{ item.article_title }}</view>
<view class="jianjie">{{ item.article_content }}</view>
<view class="user">
<view class="info">

View File

@ -30,7 +30,7 @@
<u-icon name="arrow-down" color="#333" size="28" @click="is_comment=false"></u-icon>
</view>
<scroll-view class="scroll-box" scroll-y="true" @scrolltolower="scrollBottom">
<block v-for="(item,index) in commentList" :key="index" v-if="commentList.length">
<block v-for="(item,index) in commentList" :key="index">
<view class="box">
<image :src="item.member_avatar" mode="aspectFill"></image>
<view class="info">
@ -43,13 +43,19 @@
{{ item.content }}
</view>
<view class="child-content">
<view>
<view class="child-box" v-for="(child,cid) in allList[item.id]" :key="cid">
<view class="info">
<image :src="child.member_avatar" mode=""></image>
<text>{{ child.member_nickname }}</text>
<u-icon v-if="!child.is_nickanme" class="icon" name="play-right-fill" color="#666" size="10rpx"></u-icon>
<text v-if="!child.is_nickanme">{{ child.reply_member_nickname }}</text>
</view>
<view class="child_content">{{ child.content }}</view>
</view>
<!-- <view class="more-reply" v-if="item.reply_count">展开更多回复<u-icon name="arrow-down"></u-icon></view> -->
<view class="more-reply" v-if="item.reply_count" @click="getReplyList(item.id)">展开更多回复<u-icon name="arrow-down"></u-icon></view>
</view>
</block>
<view class="no-data" v-else>111</view>
<!-- <view class="no-data" v-else>111</view> -->
</scroll-view>
<view class="editing" @click="openKeyInput">
<input type="text" value="" :placeholder="edit_text" disabled="disabled" />
@ -187,7 +193,7 @@
}
.scroll-box {
z-index: 99;
margin: 88rpx 0 150rpx 0;
margin: 88rpx 0 100rpx 0;
height: 100%;
.box {
display: flex;
@ -223,6 +229,28 @@
}
.child-content {
margin: 6rpx 90rpx 6rpx;
.child-box {
.info {
display: flex;
align-items: center;
margin-bottom: 10rpx;
color: #666;
font-size: 20rpx;
& > image {
flex-shrink: 0;
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
border-radius: 50%;
}
.icon {
margin: 0 10rpx;
}
}
.child_content {
margin: 18rpx 0 18rpx 30rpx;
}
}
.more-reply {
font-size: 22rpx;
color: #999;
@ -373,7 +401,8 @@ export default {
return {
list:{},
swiper_id: "",
page: 1, //
page: 0, //
page_: [], //
cart_type: false, //
is_comment: false, //
is_focus: false, //
@ -385,7 +414,7 @@ export default {
edit_text: "有爱评论,说点好听的 ~",
edit_text_other: "有爱评论,说点好听的 ~",
commentList: [], //
allList: {}, //
allList: [], //
}
},
onLoad(option){
@ -419,25 +448,30 @@ export default {
// console.log(e.detail.current);
this.swiper_id = e.detail.current; // swiper id
},
//
//
openPopup(data) {
// console.log(data);
this.cart_type = data.cart;
this.is_comment = data.comment;
if (this.is_comment) {
this.page = 0;
this.getComment(this.article_id,0);
}
},
//
getComment(id,page) {
getComment() {
this.$u.post("article/articleCommentList",{
article_id: id,
page: page,
article_id: this.article_id,
page: this.page,
}).then(res => {
console.log(res);
if (res.errCode == 0) {
if (res.errCode == 0 && this.page == 0) {
this.commentList = res.data;
}
} else if (res.errCode == 0 && this.page > 0) {
this.commentList = this.commentList.concat(res.data);
} else {
}
})
},
//
@ -479,6 +513,14 @@ export default {
}
})
},
//
getReplyList(id) {
this.page_[id] = 0;
console.log(this.page_);
this.$u.post("article/articleReplyList", {id: id, page: 0}).then(res => {
this.allList[id] = res.data;
})
},
//
viewImage(e) {
let arr = [];
@ -492,6 +534,8 @@ export default {
},
//
scrollBottom(e) {
this.page++;
this.getComment();
console.log(e);
},
//