Merge pull request 'gdpao' (#98) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/98
This commit is contained in:
		
						commit
						c118eced7f
					
				@ -47,6 +47,9 @@ const store = new Vuex.Store({
 | 
			
		||||
			uni.removeStorage({
 | 
			
		||||
				key: "token"
 | 
			
		||||
			})
 | 
			
		||||
			uni.removeStorage({
 | 
			
		||||
				key: "user_info"
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		setOrderType(state, type) {
 | 
			
		||||
			state.orderType = type;
 | 
			
		||||
 | 
			
		||||
@ -180,6 +180,9 @@
 | 
			
		||||
							return false
 | 
			
		||||
						} else {
 | 
			
		||||
							me.loginIn(res.data.token); //存储一个字符传值
 | 
			
		||||
							// 缓存用户的信息
 | 
			
		||||
							uni.setStorageSync('user_info',res.data);
 | 
			
		||||
							
 | 
			
		||||
							if (res.data.member.has_labels) {
 | 
			
		||||
								uni.switchTab({
 | 
			
		||||
									url: '/pages/index/index'
 | 
			
		||||
@ -189,14 +192,6 @@
 | 
			
		||||
									url: '/pageA/topick/topick'
 | 
			
		||||
								})
 | 
			
		||||
							}
 | 
			
		||||
							// 缓存用户的信息
 | 
			
		||||
							uni.setStorageSync({ 
 | 
			
		||||
								key: 'user_info',
 | 
			
		||||
								data: res.data,
 | 
			
		||||
								success: function() {
 | 
			
		||||
									console.log('success');
 | 
			
		||||
								}
 | 
			
		||||
							});
 | 
			
		||||
						}
 | 
			
		||||
 | 
			
		||||
						// 存储接口请求所需token
 | 
			
		||||
 | 
			
		||||
@ -98,7 +98,7 @@ export default {
 | 
			
		||||
			this.is_cart = newValue;
 | 
			
		||||
		},
 | 
			
		||||
		comment(newValue,old) {
 | 
			
		||||
			console.log(newValue,old);
 | 
			
		||||
			// console.log(newValue,old);
 | 
			
		||||
			this.is_content = newValue;
 | 
			
		||||
		},
 | 
			
		||||
		deep: true
 | 
			
		||||
 | 
			
		||||
@ -22,21 +22,41 @@
 | 
			
		||||
			</view>
 | 
			
		||||
        </view>
 | 
			
		||||
		<!-- 用户操作 -->
 | 
			
		||||
        <userinfo class="userinfo" :list="list" :cart="cart_type" :comment="is_comment" @openCart="openCart"></userinfo>
 | 
			
		||||
        <userinfo class="userinfo" :list="list" :cart="cart_type" :comment="is_comment" @openCart="openPopup"></userinfo>
 | 
			
		||||
		<!-- 评论 -->
 | 
			
		||||
		<u-popup v-model="is_comment" class="pl" mode="bottom" border-radius="10" height="700rpx">
 | 
			
		||||
			<view class="top">
 | 
			
		||||
				<text>评论</text>
 | 
			
		||||
				<u-icon name="arrow-down" color="#333" size="28" @click="close"></u-icon>
 | 
			
		||||
				<u-icon name="arrow-down" color="#333" size="28" @click="is_comment=false"></u-icon>
 | 
			
		||||
			</view>
 | 
			
		||||
			<scroll-view class="scroll-box" scroll-y="true" >
 | 
			
		||||
				<view></view>
 | 
			
		||||
				<block v-for="(item,index) in commentList" :key="index" v-if="commentList.length">
 | 
			
		||||
					<view class="box">
 | 
			
		||||
						<image :src="item.member_avatar" mode=""></image>
 | 
			
		||||
						<view class="info">
 | 
			
		||||
							<text>{{ item.member_nickname }}</text>
 | 
			
		||||
							<text class="time">{{ item.create_time }}</text>
 | 
			
		||||
						</view>
 | 
			
		||||
						<text class="reply" @click="openKeyInput(item)">回复</text>
 | 
			
		||||
					</view>
 | 
			
		||||
					<view class="content">
 | 
			
		||||
						{{ item.content }}
 | 
			
		||||
					</view>
 | 
			
		||||
				</block>
 | 
			
		||||
				<view class="no-data" v-else>111</view>
 | 
			
		||||
			</scroll-view>
 | 
			
		||||
			<view class="editing">
 | 
			
		||||
				<input type="text" value="" />
 | 
			
		||||
			<view class="editing" @click="openKeyInput()">
 | 
			
		||||
				<input type="text" value="" :placeholder="edit_text" disabled="disabled" />
 | 
			
		||||
				<text>发送</text>
 | 
			
		||||
			</view>
 | 
			
		||||
		</u-popup>
 | 
			
		||||
		<!-- 评论box -->
 | 
			
		||||
		<u-popup v-model="is_edit" mode="bottom" border-radius="10" height="100rpx">
 | 
			
		||||
			<view class="edit-box">
 | 
			
		||||
				<input type="text" :placeholder="edit_text" :focus="is_focus" @focus="focus" v-model="send_value">
 | 
			
		||||
				<text @click="sendComment">发送</text>
 | 
			
		||||
			</view>
 | 
			
		||||
		</u-popup>
 | 
			
		||||
		<!-- 购物车 -->
 | 
			
		||||
		<u-popup v-if="cart_len > 1" class="cart" v-model="cart_type" mode="bottom" length="782" border-radius="20">
 | 
			
		||||
			<view class="top">
 | 
			
		||||
@ -95,6 +115,7 @@
 | 
			
		||||
        .item{
 | 
			
		||||
            display: flex;
 | 
			
		||||
            align-items: center;
 | 
			
		||||
			width: 50%;
 | 
			
		||||
            padding: 8rpx 16rpx;
 | 
			
		||||
            font-size: 24rpx;
 | 
			
		||||
            color: #fff;
 | 
			
		||||
@ -147,6 +168,7 @@
 | 
			
		||||
    }
 | 
			
		||||
	.pl {
 | 
			
		||||
		.top {
 | 
			
		||||
			z-index: 1000;
 | 
			
		||||
			position: fixed;
 | 
			
		||||
			top: 0;
 | 
			
		||||
			width: 100%;
 | 
			
		||||
@ -162,8 +184,45 @@
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		.scroll-box {
 | 
			
		||||
			margin: 88rpx 0 100rpx 0;
 | 
			
		||||
			z-index: 99;
 | 
			
		||||
			margin: 88rpx 0 150rpx 0;
 | 
			
		||||
			height: 100%;
 | 
			
		||||
			.box {
 | 
			
		||||
				display: flex;
 | 
			
		||||
				align-items: center;
 | 
			
		||||
				justify-content: space-between;
 | 
			
		||||
				padding: 20rpx;
 | 
			
		||||
				& > image {
 | 
			
		||||
					width: 60rpx;
 | 
			
		||||
					height: 60rpx;
 | 
			
		||||
					border-radius: 50%;
 | 
			
		||||
					margin-right: 10rpx;
 | 
			
		||||
				}
 | 
			
		||||
				.info {
 | 
			
		||||
					flex: 1;
 | 
			
		||||
					display: flex;
 | 
			
		||||
					flex-direction: column;
 | 
			
		||||
					justify-content: space-between;
 | 
			
		||||
					height: 60rpx;
 | 
			
		||||
					font-size: 26rpx;
 | 
			
		||||
					color: #333;
 | 
			
		||||
					.time {
 | 
			
		||||
						font-size: 22rpx;
 | 
			
		||||
						color: #999;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				.reply {
 | 
			
		||||
					font-size: 26rpx;
 | 
			
		||||
					color: #333;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			.content {
 | 
			
		||||
				padding: 0 20rpx 10rpx 90rpx;
 | 
			
		||||
				border-bottom: 1px solid #ececec;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		.no-data {
 | 
			
		||||
			margin-top: 100rpx;
 | 
			
		||||
		}
 | 
			
		||||
		.editing {
 | 
			
		||||
			position: fixed;
 | 
			
		||||
@ -172,18 +231,30 @@
 | 
			
		||||
			align-items: center;
 | 
			
		||||
			justify-content: space-between;
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			height: 90rpx;
 | 
			
		||||
			height: 88rpx;
 | 
			
		||||
			padding: 0 30rpx;
 | 
			
		||||
			background-color: #ECECEC;
 | 
			
		||||
			border-top: 1px solid #ececec;
 | 
			
		||||
			background-color: #fff;
 | 
			
		||||
			& > input {
 | 
			
		||||
				width: 80%;
 | 
			
		||||
				height: 60rpx;
 | 
			
		||||
				height: 50rpx;
 | 
			
		||||
				padding: 0 20rpx;
 | 
			
		||||
				border-radius: 30rpx;
 | 
			
		||||
				border-radius: 20rpx;
 | 
			
		||||
				background-color: #fff;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	// 弹出输入框
 | 
			
		||||
	.edit-box {
 | 
			
		||||
		display: flex;
 | 
			
		||||
		align-items: center;
 | 
			
		||||
		height: 90rpx;
 | 
			
		||||
		& > input {
 | 
			
		||||
			width: 80%;
 | 
			
		||||
			padding: 4rpx 20rpx;
 | 
			
		||||
			border-radius: 20rpx;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	.cart {
 | 
			
		||||
		.top{
 | 
			
		||||
			z-index: 1000;
 | 
			
		||||
@ -293,15 +364,20 @@ export default {
 | 
			
		||||
        return {
 | 
			
		||||
            list:{},
 | 
			
		||||
			swiper_id: "",
 | 
			
		||||
			cart_type: false,
 | 
			
		||||
			is_comment: false,
 | 
			
		||||
			cart_type: false, // 显示购物车
 | 
			
		||||
			is_comment: false, // 显示评论
 | 
			
		||||
			is_focus: false, // 聚焦
 | 
			
		||||
			is_edit: false, // 输入框
 | 
			
		||||
			send_value: "", // 输入的值
 | 
			
		||||
			cartList: [],
 | 
			
		||||
			cart_len: 0,
 | 
			
		||||
			edit_text: "有爱评论,说点好听的 ~",
 | 
			
		||||
			commentList: [], // 评论
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
	onLoad(o){
 | 
			
		||||
	    this.id = o.id;
 | 
			
		||||
	    this.articleInfo(this.id);
 | 
			
		||||
	onLoad(option){
 | 
			
		||||
	    this.article_id = option.id;
 | 
			
		||||
	    this.articleInfo(this.article_id);
 | 
			
		||||
	},
 | 
			
		||||
    methods:{
 | 
			
		||||
		// 发现详情
 | 
			
		||||
@ -317,17 +393,47 @@ export default {
 | 
			
		||||
			this.swiper_id = e.detail.current; // 储存swiper id
 | 
			
		||||
		},
 | 
			
		||||
		// 更改购物车状态
 | 
			
		||||
		openCart(data) {
 | 
			
		||||
			console.log(data);
 | 
			
		||||
			this.cart_type = data.cart;
 | 
			
		||||
			this.is_comment = data.comment;
 | 
			
		||||
		},
 | 
			
		||||
		hideCart(data) {
 | 
			
		||||
		openPopup(data) {
 | 
			
		||||
			// console.log(data);
 | 
			
		||||
			this.cart_type = data.cart;
 | 
			
		||||
			this.is_comment = data.comment;
 | 
			
		||||
			if (this.is_comment) {
 | 
			
		||||
				this.getComment(this.article_id,0);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		close() {
 | 
			
		||||
			this.is_comment = false;
 | 
			
		||||
		// 获取评论
 | 
			
		||||
		getComment(id,page) {
 | 
			
		||||
			this.$u.post("article/articleCommentList",{
 | 
			
		||||
				article_id: id,
 | 
			
		||||
				page: page,
 | 
			
		||||
			}).then(res => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				if (res.errCode == 0) {
 | 
			
		||||
					this.commentList = res.data;
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		// 打开评论输入
 | 
			
		||||
		openKeyInput(data) {
 | 
			
		||||
			console.log(data);
 | 
			
		||||
			this.is_edit = true;
 | 
			
		||||
			this.is_focus = true;
 | 
			
		||||
		},
 | 
			
		||||
		// 发布评论
 | 
			
		||||
		sendComment(data) {
 | 
			
		||||
			this.$u.post("article/articleAddComment",{
 | 
			
		||||
				article_id: this.article_id,
 | 
			
		||||
				content: this.send_value,
 | 
			
		||||
				pid: data.id,
 | 
			
		||||
				reply_id: data.member_id,
 | 
			
		||||
			}).then(res => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				if (res.errCode == 0) {
 | 
			
		||||
					this.is_edit = false;
 | 
			
		||||
				} else {
 | 
			
		||||
					this.$u.toast(res.message);
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		// 预览图片
 | 
			
		||||
		viewImage(e) {
 | 
			
		||||
@ -351,6 +457,11 @@ export default {
 | 
			
		||||
			uni.navigateBack({
 | 
			
		||||
				delta: 1
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		focus() {
 | 
			
		||||
			setTimeout(function(){
 | 
			
		||||
				uni.showSoftKeybord;
 | 
			
		||||
			}, 200)
 | 
			
		||||
		}
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										47
									
								
								pages.json
									
									
									
									
									
								
							
							
						
						
									
										47
									
								
								pages.json
									
									
									
									
									
								
							@ -109,16 +109,7 @@
 | 
			
		||||
						"navigationBarTitleText": "商品详情",
 | 
			
		||||
						"app-plus":{
 | 
			
		||||
							"titleNView":{
 | 
			
		||||
								"backgroundColor":"#ffffff",
 | 
			
		||||
								"buttons": [
 | 
			
		||||
									{
 | 
			
		||||
										"type":"none",
 | 
			
		||||
										"text":"\ue636",
 | 
			
		||||
										"float":"right",
 | 
			
		||||
										"fontSize":"18",
 | 
			
		||||
										"fontSrc": "/static/fonts/cart.ttf"
 | 
			
		||||
									}
 | 
			
		||||
								]
 | 
			
		||||
								"backgroundColor":"#ffffff"
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
@ -140,16 +131,7 @@
 | 
			
		||||
						"navigationBarTitleText": "商品评价",
 | 
			
		||||
						"app-plus":{
 | 
			
		||||
							"titleNView":{
 | 
			
		||||
								"backgroundColor":"#ffffff",
 | 
			
		||||
								"buttons": [
 | 
			
		||||
									{
 | 
			
		||||
										"type":"none",
 | 
			
		||||
										"text":"\ue636",
 | 
			
		||||
										"float":"right",
 | 
			
		||||
										"fontSize":"18",
 | 
			
		||||
										"fontSrc": "/static/fonts/cart.ttf"
 | 
			
		||||
									}
 | 
			
		||||
								]
 | 
			
		||||
								"backgroundColor":"#ffffff"
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
@ -214,8 +196,10 @@
 | 
			
		||||
					"path": "photo/index",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"navigationBarTitleText": "",
 | 
			
		||||
						"navigationStyle": "custom"
 | 
			
		||||
						
 | 
			
		||||
						"navigationStyle": "custom",
 | 
			
		||||
						"app-plus": {
 | 
			
		||||
							"softinputMode": "adjustResize"
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			]
 | 
			
		||||
@ -253,7 +237,6 @@
 | 
			
		||||
				{
 | 
			
		||||
					"path": "cart/index",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"enablePullDownRefresh": true,
 | 
			
		||||
						"navigationBarTitleText": "购物车",
 | 
			
		||||
						"app-plus": {
 | 
			
		||||
							"titleSize": "36px",
 | 
			
		||||
@ -621,7 +604,6 @@
 | 
			
		||||
				{
 | 
			
		||||
					"path": "tool/Manicure",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"enablePullDownRefresh": true,
 | 
			
		||||
						"navigationBarTitleText": "美甲",
 | 
			
		||||
						"app-plus": {
 | 
			
		||||
							"titleSize": "36px",
 | 
			
		||||
@ -658,19 +640,6 @@
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					"path": "tool/washComment",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"navigationBarTitleText": "送洗评价",
 | 
			
		||||
						"app-plus": {
 | 
			
		||||
							"titleSize": "36px",
 | 
			
		||||
							"titleNView": {
 | 
			
		||||
								"titleColor": "#333333",
 | 
			
		||||
								"backgroundColor": "#FFFFFF"
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					"path": "tool/WashOrder",
 | 
			
		||||
					"style": {
 | 
			
		||||
@ -863,7 +832,6 @@
 | 
			
		||||
				{
 | 
			
		||||
					"path": "order/Index",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"enablePullDownRefresh": true,
 | 
			
		||||
						"navigationBarTitleText": "我的订单",
 | 
			
		||||
						"app-plus": {
 | 
			
		||||
							"titleSize": "36px",
 | 
			
		||||
@ -877,7 +845,6 @@
 | 
			
		||||
				{
 | 
			
		||||
					"path": "order/Details",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"enablePullDownRefresh": true,
 | 
			
		||||
						"navigationBarTitleText": "订单详情",
 | 
			
		||||
						"app-plus": {
 | 
			
		||||
							"titleSize": "36px",
 | 
			
		||||
@ -937,7 +904,6 @@
 | 
			
		||||
		{
 | 
			
		||||
			"path": "pages/index/index",
 | 
			
		||||
			"style": {
 | 
			
		||||
				"enablePullDownRefresh": true,
 | 
			
		||||
				"navigationStyle": "custom"
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
@ -961,7 +927,6 @@
 | 
			
		||||
		{
 | 
			
		||||
			"path": "pages/mine/index",
 | 
			
		||||
			"style": {
 | 
			
		||||
				"enablePullDownRefresh": true,
 | 
			
		||||
				"navigationBarTitleText": "我的",
 | 
			
		||||
				"app-plus": {
 | 
			
		||||
					"titleSize": "36px",
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
	<view>
 | 
			
		||||
		<view class="status_bar"></view>
 | 
			
		||||
		<view class="index">
 | 
			
		||||
			<navigator url="/pageB/photo/index?id=28">qqq</navigator>
 | 
			
		||||
			<navigator url="/pageB/photo/index?id=28">bbb</navigator>
 | 
			
		||||
			<view class="top">
 | 
			
		||||
				<view class="sosuo"></view>
 | 
			
		||||
				<view class="tabs">
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user