From 5227ce05a36d16fc32691b73e4d75c8aee9cea51 Mon Sep 17 00:00:00 2001
From: li-guang <153605324@qq.com>
Date: Mon, 11 Jan 2021 16:46:37 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/jyyforjava/hive-app

---
 hive-app/pages/workbench/confirmService.vue |   67 ++++++++++++++++++++++++++++++---
 1 files changed, 61 insertions(+), 6 deletions(-)

diff --git a/hive-app/pages/workbench/confirmService.vue b/hive-app/pages/workbench/confirmService.vue
index 13bbfdf..1955d9d 100644
--- a/hive-app/pages/workbench/confirmService.vue
+++ b/hive-app/pages/workbench/confirmService.vue
@@ -55,14 +55,28 @@
 		<view class="footer">
 			<button :disabled="isDisabled" class="blue-btn" @click="createOrder">提交服务单</button>
 		</view>
+		
+		<uni-popup ref="popup" type="center" @change="popupChange">
+			<view class="popup-container">
+				<view class="popup-title">请输入资金密码</view>
+				<password-input :numLng='password'></password-input>
+			</view>
+		</uni-popup>
+		<number-keyboard ref='KeyboarHid' :topBarShow="false" @input='changePwd' psdLength='6' :value="password"></number-keyboard>
 	</view>
 </template>
 
 <script>
+	import numberKeyboard from '@/components/number-keyboard/number-keyboard.vue'
+	import passwordInput from '@/components/password-input/password-input.vue'
 	import DateTimePicker from '../../components/bory-dateTimePicker/bory-dateTimePicker.vue'
+	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	export default{
 		components:{
-			DateTimePicker
+			DateTimePicker,
+			numberKeyboard,
+			passwordInput,
+			uniPopup
 		},
 		data(){
 			return{
@@ -73,7 +87,8 @@
 				curEmployee: {},
 				memberInfo: {},
 				remark: '',
-				isDisabled: false
+				isDisabled: false,
+				password: ''
 			}
 		},
 		computed:{
@@ -140,11 +155,34 @@
 					return false
 				}
 			},
+			// 弹窗状态change
+			popupChange(e) {
+				if(!e.show){
+					this.password = '';
+					this.$refs.KeyboarHid.close();
+				}
+			},
+			changePwd(val){
+				this.password = val;
+				if(this.password.length == 6){
+					this.submit()
+				}
+			},
 			createOrder(){
 				if(this.valid() === false){
 					return;
 				}
-				this.isDisabled = true;
+				this.$refs.popup.open();
+				setTimeout(() => {
+					this.$refs.KeyboarHid.open()
+				}, 50)
+				
+			},
+			submit(){
+				if(this.isRequesting){
+					return;
+				}
+				this.isRequesting = true;
 				let projItems = this.list.map((item) => {
 					return {
 						"count": item.num,
@@ -157,7 +195,8 @@
 					remark: this.remark,
 					totalTime: this.totalTime,
 					yyTime: this.yyTime,
-					vipId: this.id
+					vipId: this.id,
+					password: this.password
 				}, 'POST').then((res) => {
 					if(res.status == 200){
 						uni.navigateTo({
@@ -165,9 +204,9 @@
 						})
 					}
 					this.$toast.info(res.info);
-					this.isDisabled = false;
+					this.isRequesting = false;
 				}).catch(() => {
-					this.isDisabled = false;
+					this.isRequesting = false;
 				})
 			}
 		}
@@ -175,6 +214,22 @@
 </script>
 
 <style>
+	.popup-container{
+		background: #FFFFFF;
+		width: 500rpx;
+		padding: 20px 20px 20px;
+		border-radius: 6px;
+	}
+	.popup-title{
+		font-size: 16px;
+		text-align: center;
+		margin-bottom: 20px;
+	}
+	.popup-sub-title{
+		font-size: 15px;
+		text-align: center;
+		padding: 10px 0;
+	}
 	page{
 		background: #F6F6F8;
 		padding-top: 10px;

--
Gitblit v1.9.1