Merge pull request 'gdpaoup' (#122) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/122
This commit is contained in:
		
						commit
						b158080eb7
					
				@ -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">
 | 
			
		||||
 | 
			
		||||
@ -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);
 | 
			
		||||
        },
 | 
			
		||||
		// 跳转到商品
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user