Browse Source

房态修改,新增订单部分修改

17755135699 10 months ago
parent
commit
09ca95b52c
2 changed files with 63 additions and 32 deletions
  1. 57 26
      pages/house/createOrder.vue
  2. 6 6
      pages/house/index.vue

+ 57 - 26
pages/house/createOrder.vue

@@ -52,24 +52,6 @@
 				</view>
 			</view>
 			<u-cell-group :border="false" customStyle="margin:0 -30rpx">
-				<!-- <u-cell>
-					<text slot="icon" class="label">入住日期</text>
-					<view slot="title" class="title">
-						{{dataForm.arriveDate}}
-					</view>
-				</u-cell>
-				<u-cell>
-					<text slot="icon" class="label">离店日期</text>
-					<view slot="title" class="title">
-						{{dataForm.leaveDate}}
-					</view>
-				</u-cell> -->
-				<!-- <u-cell>
-					<text slot="icon" class="label">共几晚</text>
-					<view slot="title" class="title">
-						{{dataForm.num}}
-					</view>
-				</u-cell> -->
 				<u-cell isLink="true" @click="checkInTypeShow=true">
 					<text slot="icon" class="label">入住类型</text>
 					<view slot="title" class="title">
@@ -83,22 +65,24 @@
 					</view>
 				</u-cell>
 				<u-cell>
-					<text slot="icon" class="label">房间号</text>
+					<text slot="icon" class="label bold">房间号</text>
 					<view slot="title" class="title">
 						{{dataForm.detailFormList[0].roomNumber}}
 					</view>
 				</u-cell>
-				<u-cell>
-					<text slot="icon" class="label">房价</text>
+				<!-- <u-cell>
+					<text slot="icon" class="label bold"></text>
 					<view slot="title" class="title">
 						{{dataForm.detailFormList[0].roomAmount}}
 					</view>
-				</u-cell>
-				<u-cell customStyle="height:88rpx">
-					<text slot="icon" class="label">备注</text>
+					
+				</u-cell> -->
+				<u-cell customStyle="height:88rpx" :border="false">
+					<text slot="icon" class="label bold">房价</text>
 					<view slot="title" class="title">
 						<u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx"
-							type="textarea" placeholder="请输入" v-model="dataForm.remarks" height="200"></u--input>
+							type="textarea" placeholder="请输入" @change="compoutPrice()" v-model="dataForm.detailFormList[0].roomAmount"
+							height="200"></u--input>
 					</view>
 				</u-cell>
 			</u-cell-group>
@@ -142,6 +126,17 @@
 				</u-swipe-action-item>
 			</u-swipe-action>
 		</view>
+		<view class="box">
+			<u-cell-group :border="false" customStyle="margin:0 -30rpx">
+				<u-cell customStyle="height:88rpx" :border="false">
+					<text slot="icon" class="label bold">备注</text>
+					<view slot="title" class="title">
+						<u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx"
+							type="textarea" placeholder="请输入" v-model="dataForm.remarks" height="200"></u--input>
+					</view>
+				</u-cell>
+			</u-cell-group>
+		</view>
 		<view class="footer">
 			<view class="total"><text>订单金额:</text><text>¥{{totalMOney}}</text></view>
 			<view class="btns">
@@ -236,13 +231,17 @@
 				//加密备用
 				tempCheckInPersonList: [],
 				tempGuestName: null,
-				tempGuestPhone: null
+				tempGuestPhone: null,
+				oldVal:''
 			}
 		},
 		onReady() {
 			// 微信小程序需要用此写法
 		},
 		onLoad(opt) {
+			setTimeout(()=>{
+				this.getLaiyuan();
+			},1000)
 			this.getLaiyuan();
 			if (opt.roomId) {
 				this.roomId = opt.roomId.split(',');
@@ -266,7 +265,30 @@
 			day = day > 9 ? day : '0' + day;
 			this.currentDate = year + '-' + mon + '-' + day;
 		},
+		watch: {
+			// 'dataForm.detailFormList': {
+			// 	handler(newVal, oldVal) {
+			// 		let disp = newVal[0].roomAmount - this.oldVal;
+			// 		console.log(disp)
+			// 		console.log(this.totalMOney)
+			// 		console.log(newVal[0].roomAmount)
+			// 		this.oldval = newVal[0].roomAmount; //上一次价格
+			// 		this.totalMOney += parseFloat(disp);
+			// 	},
+			// 	deep: true
+			// }
+		},
 		methods: {
+			compoutPrice(e){
+				console.log(e)
+				console.log(this.oldval)
+				let disp = e - this.oldVal;
+				console.log(69-169)
+				console.log(disp)
+				this.oldval = e; //上一次价格
+				console.log(this.oldval)
+				this.totalMOney += disp;
+			},
 			showPick() {
 				this.leaveDateShow = true;
 				this.$refs.picker.innerValue = new Date().getTime()
@@ -520,6 +542,7 @@
 					.then((res) => {
 						if (res.data.code == 0) {
 							this.laiyuan = [res.data.data];
+							console.log(this.laiyuan)
 						}
 					});
 			},
@@ -543,6 +566,7 @@
 						this.dataForm.detailFormList[0].checkInTypeName = this.checkInType[0].filter((item => item
 							.val == this.dataForm.detailFormList[0].checkInType))[0].label;
 						this.totalMOney = this.dataForm.orderAmount;
+						this.oldVal = this.totalMOney;
 						this.dataForm.flowRecord.forEach((i, index) => {
 							let flowTypeName = i.flowType == 1 ? '收款' : '退款';
 							var payTypeName = '微信';
@@ -566,6 +590,7 @@
 						this.dataForm.detailFormList[0].checkInTypeName = this.checkInType[0].filter((item => item
 							.val == res.data.data.checkInType))[0].label;
 						this.dataForm.detailFormList[0].roomAmount = res.data.data.roomAmount;
+
 						this.dataForm.arriveDate = res.data.data.arriveDate;
 						this.compareDate(this.dataForm.arriveDate);
 						this.dataForm.leaveDate = res.data.data.leaveDate;
@@ -573,6 +598,7 @@
 						this.dataForm.houseBaseName = res.data.data.houseBaseName;
 						this.dataForm.num = res.data.data.num;
 						this.totalMOney = res.data.data.roomAmount;
+						this.oldVal = this.totalMOney;
 
 					}
 				})
@@ -679,6 +705,11 @@
 		.label {
 			color: #333;
 			font-size: 30rpx;
+
+			&.bold {
+				font-weight: bold;
+				font-size: 32rpx;
+			}
 		}
 
 		&.box1 {

+ 6 - 6
pages/house/index.vue

@@ -34,16 +34,16 @@
 			<view class="content" v-if="xdata.length!=0">
 				<view class="tj" :style="{'top':mt+'px'}">
 					<view class="item">
-						<text class="label">{{info.totalRooms}}</text>
-						<text>房间总数</text>
+						<text class="label">{{info.bookRooms}}</text>
+						<text>待入住</text>
 					</view>
 					<view class="item">
 						<text class="label">{{info.checkinRooms}}</text>
-						<text>在入住房间</text>
+						<text>已入住</text>
 					</view>
 					<view class="item">
-						<text class="label">{{info.bookRooms}}</text>
-						<text>待入住房间</text>
+						<text class="label">{{info.checkoutRooms}}</text>
+						<text>已退房</text>
 					</view>
 				</view>
 				<view class="date">
@@ -113,7 +113,7 @@
 			</view>
 			<view class="opration" v-if="checkDataRoomId.length!=0">
 				<text @click="areaShow=true">关房</text>
-				<text @click="createOrder()">新增</text>
+				<text @click="createOrder()">预定</text>
 			</view>
 		</view>
 		<Tabbar :tabbarIndex="1"></Tabbar>