From 6e54af776db885ad1a22ec582bdc97d7e1273c6c Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Wed, 13 Jan 2021 17:31:30 +0800
Subject: [PATCH] 系统优化

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

diff --git a/hive-app/pages/member/projectPlan.vue b/hive-app/pages/member/projectPlan.vue
index ea64477..3f69eb3 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:{
@@ -187,4 +203,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