Browse Source

Merge branch 'dev' of http://47.101.131.235:3000/LiChengjin/MiniScm into dev

Shu 3 months ago
parent
commit
7e407f25e6

+ 25 - 9
subpkg_checkin/addGuest/addGuest.vue

@@ -275,7 +275,7 @@
 		},
 		computed: {
 			...mapState('m_user', ['userInfo']),
-			...mapState('m_business', ['checkinInfo', 'currentHotel', 'idCardInfo']),
+			...mapState('m_business', ['checkinInfo', 'currentHotel', 'idCardInfo', 'order']),
 			getAllInfo() {
 				let getAll = true
 				for (const info of this.infoList) {
@@ -300,7 +300,7 @@
 			// #endif
 		},
 		methods: {
-			...mapMutations('m_business', ['updateCheckinInfo', 'updateIdCardInfo']),
+			...mapMutations('m_business', ['updateCheckinInfo', 'updateIdCardInfo', 'updateOrder']),
 			...mapMutations('m_user', ['updateUserInfo']),
 			async finishInput() {
 				//检查格式是否正确
@@ -320,6 +320,15 @@
 					uni.$showMsg('手机号格式错误!')
 					return
 				}
+				//判断此顾客信息是否已添加
+				if (JSON.stringify(this.checkinInfo) !== '{}' && this.checkinInfo.length > 0) {
+					for (let info of this.checkinInfo) {
+						if (info.idNumber === this.idNumber) {
+							uni.$showMsg('已添加此顾客,请检查填写信息')
+							return
+						}
+					}
+				}
 				//检查该顾客是否在当前酒店入住
 				let res = await uni.$http.post('/checkinInfo/queryByCondition', {
 					userIdNumber: this.idNumber,
@@ -1216,13 +1225,20 @@
 											idCardBackBase64: that.idCardBackPicPath.split(',')[1]
 										})
 									}
-									//如果是主入住人,且当前账号姓名和身份证号信息与所传身份证不一致,则更新账号信息为主入住人信息
-									if (this.isMainCustomer && (this.userInfo.name !== this.name || this
-											.userInfo.idNumber !== this.idNumber)) {
-										this.userInfo.name = this.name
-										this.userInfo.idNumber = this.idNumber
-										this.updateUserInfo(this.userInfo)
-										uni.$http.put(`/userInfo/${this.userInfo.id}`, this.userInfo)
+									if (this.isMainCustomer) {
+										//如果是主入住人,且当前账号姓名和身份证号信息与所传身份证不一致,则更新账号信息为主入住人信息
+										if (this.userInfo.name !== this.name || this.userInfo.idNumber !== this
+											.idNumber) {
+											this.userInfo.name = this.name
+											this.userInfo.idNumber = this.idNumber
+											this.updateUserInfo(this.userInfo)
+											uni.$http.put(`/userInfo/${this.userInfo.id}`, this.userInfo)
+										}
+										//更新订单预定人信息为主入住人信息
+										let orderToUpdate = this.order
+										orderToUpdate.name = this.name
+										orderToUpdate.phone = this.phone
+										this.updateOrder(orderToUpdate)
 									}
 									uni.hideLoading();
 									uni.$showMsg('身份核验通过!')

+ 3 - 7
subpkg_checkin/confirmOrder/confirmOrder.vue

@@ -19,9 +19,6 @@
 				<view class="room-type-item-middle-text">
 					<text>{{order.room ? order.room : ""}}</text>
 				</view>
-				<!-- <view class="room-type-item-middle-bottom">
-					<text>{{orderInfo.roomArea}}㎡ </text>
-				</view> -->
 			</view>
 			<view class="room-type-item-right">
 				<view class="room-type-item-right-text">
@@ -95,7 +92,6 @@
 				<view class="price">
 					<text>合计:</text>
 					<text>¥{{order.price ? order.price : ""}}</text>
-					<!-- <text>合计:<text style="color: red;font-weight: bold;">¥{{orderInfo.price}}</text></text> -->
 				</view>
 				<view class="deposit">
 					<text text="" align="right" size="20">(注:需付押金{{order.deposit ? order.deposit : ""}}元)</text>
@@ -138,7 +134,6 @@
 				startDay: this.startDay,
 				endDate: this.endDate,
 				endDay: this.endDay,
-				orderInfo: {},
 				arrowPicPath: '/static/arrow.png',
 				confirmDone: false,
 				options: [{
@@ -180,7 +175,7 @@
 				//小程序创建的订单,先在后台创建订单,创建成功后跳转至支付页面
 				if (this.order.orderSource === 'MINI_APP') {
 					let createOrderRes = await uni.$http.post('/hotelOrder', this.order)
-					if (!createOrderRes.data.code === 200) {
+					if (createOrderRes.data.code !== 200) {
 						uni.$showMsg('订单创建失败,请重试')
 						return
 					}
@@ -226,11 +221,12 @@
 				} else {
 					uni.showModal({
 						content: '房间已被占用,请重新选房',
+						showCancel: false,
 						success: (res) => {
 							if (res.confirm) {
 								uni.navigateTo({
 									url: '/subpkg_checkin/selectRoom/selectRoom?roomType=' +
-										this.orderInfo.roomType
+										this.order.roomType
 								})
 							}
 						}

+ 3 - 3
subpkg_checkin/queryOrderResult/queryOrderResult.vue

@@ -1,6 +1,6 @@
 <template>
-	<view class="page">
-		<view class="top">
+	<view class="container">
+		<view>
 			<!-- #ifdef MP-WEIXIN -->
 			<NavigateBar title="查询结果" control="back" bgcolor="#a09cc4"></NavigateBar>
 			<!-- #endif -->
@@ -99,7 +99,7 @@
 </style>
 
 <style lang="scss" scoped>
-	.page {
+	.container {
 		display: flex;
 		flex-direction: column;
 

+ 0 - 5
subpkg_checkin/selectCheckinType/selectCheckinType.vue

@@ -163,11 +163,6 @@
 				background-color: #9e97c3;
 				margin: 0 60rpx 60rpx;
 				font-size: 33rpx;
-
-				&:hover {
-					color: #FFFFFF;
-					background-color: #CECBE1;
-				}
 			}
 		}
 	}

+ 0 - 2
subpkg_checkin/selectRoomType/selectRoomType.vue

@@ -103,8 +103,6 @@
 				let endTime = this.endDate
 				//本地保存订单信息
 				this.updateOrder({
-					name: this.userInfo.name,
-					phone: this.userInfo.phone,
 					hotelId: this.currentHotel.hotelId,
 					roomType: item.roomType,
 					startTime: startTime,