From c4246ca910f28014efaace64ebf92f47a673a9cf Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Mon, 25 Jan 2021 11:47:46 +0800
Subject: [PATCH] gx

---
 hive-app/pages/member/projectPlan.vue |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/hive-app/pages/member/projectPlan.vue b/hive-app/pages/member/projectPlan.vue
index ea64477..0149427 100644
--- a/hive-app/pages/member/projectPlan.vue
+++ b/hive-app/pages/member/projectPlan.vue
@@ -29,10 +29,12 @@
 							<text class="font-12 red">{{item.isInvalid | formatIsInvalid}}</text>
 						</view>
 						<text class="font-10 gray mt-5">时长: {{item.timeLength}}分钟</text>
-						<text class="font-10 gray mt-5">有效期至: {{item.invalidTime || '-'}}</text>
 						<view class="flex align-center justify-between">
-							<text class="font-12 blue">剩余次数: {{item.count}}次</text>
-							
+							<view>
+								<text class="font-10 gray mt-5">有效期至: {{item.invalidTime || '-'}}</text>
+								<text class="font-12 blue block">剩余次数: {{item.count}}次</text>
+							</view>
+							<button class="blue-btn" v-if="item.count" @click="order(item)">立即预约</button>
 						</view>
 					</view>
 				</view>
@@ -52,9 +54,12 @@
 						<image class="product-img" mode="aspectFill" :src="op.img?op.img:'../../static/images/no-img.png'"></image>
 						<view class="flex flex-v ml-10 flex-1">
 							<text class="font-12">{{op.name}}</text>
-							<text class="font-10 gray mt-5">时长: {{op.timeLength}}分钟</text>
 							<view class="flex align-center justify-between">
-								<text class="font-12 blue">剩余次数: {{op.count}}次</text>
+								<view>
+									<text class="font-10 gray mt-5">时长: {{op.timeLength}}分钟</text>
+									<text class="font-12 blue block">剩余次数: {{op.count}}次</text>
+								</view>
+								<button class="blue-btn" v-if="op.count" @click="order(op)">立即预约</button>
 							</view>
 						</view>
 					</view>
@@ -97,12 +102,14 @@
 				},
 			],
 			id: '',
+			vipName: '',
 			comboList: [], //套餐
 			projectList: [], //项目
 		  }  
 		},
 		onLoad(options) {
 			this.id = options.id;
+			this.vipName = options.vipName;
 			this.loadList();
 		},
 		methods:{
@@ -121,6 +128,15 @@
 			tabChange(e){
 				this.type = e;
 				this.loadList()
+			},
+			// 立即预约
+			order(goods){
+				goods = Object.assign(goods, {num: 1});
+				let selectItems = [goods];
+				let str = (encodeURIComponent(JSON.stringify(selectItems))).replace(/%/g, '%25');
+				uni.navigateTo({
+					url: '../workbench/selectService/index?id='+this.id+'&vipName='+this.vipName+'&selectItems='+str
+				})
 			}
 		},
 		filters:{
@@ -180,6 +196,7 @@
 	}
 	.status{
 		width: 80px;
+		flex: 0 0 80px;
 		text-align: right;
 		color: #a5abaf;
 		font-weight: 700;
@@ -187,4 +204,10 @@
 	.no-record{
 		margin: 20px 0!important;
 	}
+	.blue-btn{
+		margin: 0;
+		font-size: 12px;
+		line-height: 30px;
+		border-radius: 16px;
+	}
 </style>

--
Gitblit v1.9.1