2 Commits 19a46d3f40 ... 8820b98cd1

Author SHA1 Message Date
  lifanzai 8820b98cd1 修改页面 9 months ago
  lifanzai 1276d3d75a 增加功能 9 months ago
4 changed files with 88 additions and 31 deletions
  1. 1 0
      pages.json
  2. 1 1
      pages/house/createOrder.vue
  3. 8 3
      pages/house/orderInfo.vue
  4. 78 27
      pages/house/stayCheck.vue

+ 1 - 0
pages.json

@@ -70,6 +70,7 @@
 				"navigationStyle": "custom"
 			}
 		},
+		
 		{
 			"path": "pages/house/stayCheck",
 			"style": {

+ 1 - 1
pages/house/createOrder.vue

@@ -64,7 +64,7 @@
 					remarks: "",
 				},
 				roomId: '',
-				laiyuan: []
+				laiyuan: [[]]
 			}
 		},
 		onLoad(opt) {

+ 8 - 3
pages/house/orderInfo.vue

@@ -68,7 +68,7 @@
 			</u-cell-group>
 			<!-- 按钮 -->
 			<view class="button">
-				<button class="edit">编辑订单</button>
+				<button class="edit" @click="editOrder(id)">编辑订单</button>
 				<button  class="goRoom">办理入住</button>
 			</view>
 		</view>
@@ -96,7 +96,7 @@
 					// console.log(res)
 					if(res.data.code==0){
 						this.orderInfo = res.data.data
-						console.log(this.orderInfo)
+						// console.log(this.orderInfo)
 					}
 				})
 			},
@@ -116,11 +116,16 @@
 					return '状态异常'
 				}
 			},
-			goStayCheck(){
+			goStayCheck(id){
 				uni.navigateTo({
 				  url: '/pages/house/stayCheck'
 				})
 				// console.log(1111)
+			},
+			editOrder(id){
+				uni.navigateTo({
+					url:`/pages/house/stayCheck?id=${this.orderId}`
+				})
 			}
 		},
 		computed:{

+ 78 - 27
pages/house/stayCheck.vue

@@ -1,27 +1,31 @@
 <template>
 	<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
-		<c-nav-bar title="新增订单" :showIcon="false"></c-nav-bar>
+		<c-nav-bar title="新增订单" :showIcon="true"></c-nav-bar>
 		<view class="box">
 		
 			 <u-form :model="form" ref="form">
-				 <u-form-item label="姓名" label-width="172rpx" border-bottom>
+				 <u-form-item label="姓名" prop="guestName" label-width="172rpx" border-bottom>
 					 <u-input border="false" v-model="form.guestName" placeholder="请输入姓名"/>
 				 </u-form-item>
-				 <u-form-item label="手机号码" label-width="172rpx" border-bottom>
+				 <u-form-item label="手机号码" prop="guestPhone" label-width="172rpx" border-bottom>
 				 	<u-input border="false" v-model="form.guestPhone" placeholder="请输入手机号"/>
 				 </u-form-item>
 				 <u-form-item label="证件类型" label-width="172rpx" border-bottom>
-							<view class="personInfo">
-								<text style="font-size: 30rpx;">身份证</text>
-								<!-- <text style="margin-left: 90%;">></text> -->
-								<u-icon name="arrow-right"></u-icon>
+					    <view class="personInfo" @click.native="show=true">
+								<text style="font-size: 30rpx;">{{form.idName}}</text>
+								<!-- 证件下拉框 -->
+								<u-picker :itemHeight="88" :immediateChange="true" :show="show" :columns="list" keyName="label"
+									:defaultIndex="passengerDefault" @cancel="show=false;"
+									@confirm="passengerConfirm"></u-picker>
+								<!-- <u-select v-model="show"  mode="single-column" :list="list" @confirm="confirm"></u-select> -->
+								<u-icon name="arrow-right" ></u-icon>
 							</view>
 				 </u-form-item> 
-				 <u-form-item label="证件号" label-width="172rpx" border-bottom>
-				 	<u-input border="false" v-model="form.idNumber" placeholder="请输入证件号"/>
+				 <u-form-item label="证件号" prop="idCard" label-width="172rpx" border-bottom>
+				 	<u-input border="false" v-model="form.idCard" placeholder="请输入证件号"/>
 				 </u-form-item>
 				 <u-form-item class="delete" >
-						<view class="delete">
+						<view class="delete" @click="del">
 							<u-icon name="trash"></u-icon>
 							<text style="font-size: 30rpx;">删除</text>
 						</view>
@@ -35,12 +39,10 @@
 		<!-- 按钮 -->
 		<!-- 按钮 -->
 		
-			<view class="yes">
+			<view class="yes" @click.native="submit">
 				确定
 			</view>
 			
-		 
-		
 	</view>
 </template>
 
@@ -48,28 +50,77 @@
 	export default{
 		data(){
 			return {
+				passengerDefault:[0],
 				form:{
 					guestPhone:'',
-					idNumber:'',
-					guestName:'',
-					
+					idCard:'',
+					idName:'',
+					guestName:'',					
 				},
-			 show: false,
-			        selected: 0,
-			        columns: ['Option 1', 'Option 2', 'Option 3'] // 用来展示在选择器中的数据
+				orderInfo:[],
+				orderId:null,
+				show: false,
+								list: [[
+									{
+										value: '1',
+										label: '身份证'
+									},
+									{
+										value: '2',
+										label: '居住证'
+									}]
+								],
 			}
 			
 		},
+		onLoad({id}){
+			console.log(id)
+			this.orderId=id
+			console.log(this.orderId)	
+			this.getOrderInfo()
+		},
 		methods:{
+			passengerConfirm(e){
+				this.form.idName=e.value[0].label
+			},
+			// 证件下拉菜单
+			showCardChoose(){
+				console.log(11)
+				this.show=true
+			},
+					
+			// 订单数据回显
+			getOrderInfo(){
+				this.$api.get(`/merchant/hotel/order/getMerchantOrderInfo/${this.orderId}`,{
+					orderId:this.orderId
+				}).then((res)=>{
+					console.log(res)
+					if(res.data.code==0){
+						this.orderInfo = res.data.data
+						// console.log(this.orderInfo)
+						this.form.guestName=res.data.data.guestName
+						this.form.guestPhone=res.data.data.guestPhone
+					}
+				})
+			},
+			
+			
 			del(){
-				this.dataForm.guestName=''
-				this.dataForm.idNumber=''
-				this.dataForm.guestPhone=''
-			}
-		},
-		togglePicker(){
-		        this.show = !this.show;
-		      }
+				this.form.guestName=''
+				this.form.idCard=''
+				this.form.guestPhone=''
+			},			
+			submit(){
+				uni.navigateTo({
+					url:'/pages/house/orderInfo'
+				})
+			},			
+			
+		}
+		// onReady(){
+		// 	this.$refs.form.setRules(this.rules)
+		// }
+		
 	}
 </script>