Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx

This commit is contained in:
luyuan 2020-08-06 10:45:18 +08:00
commit 2a8ee65a94
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
2 changed files with 59 additions and 15 deletions

View File

@ -5,7 +5,7 @@
<view class="backes"></view> <view class="backes"></view>
<image class="head" :src="item.article_pic" ></image> <image class="head" :src="item.article_pic" ></image>
</view> </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="jianjie">{{ item.article_content }}</view>
<view class="user"> <view class="user">
<view class="info"> <view class="info">

View File

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