瀏覽代碼

opt:修改后端地址;优化部分逻辑

LiChengjin 2 月之前
父節點
當前提交
250c9cd7ba

+ 2 - 2
config.js

@@ -2,10 +2,10 @@
 const PRO_BASE_URL = "https://pro.cloud.boyuantech.net/manage/api/v1/miniScmApp"
 const PRO_IMG_BASE_URL = "https://pro.cloud.boyuantech.net/img"
 //测试
-const TEST_BASE_URL = "https://test.cloud.boyuantech.net/manage/api/v1/miniScmApp"
+const TEST_BASE_URL = "https://test.cloud.boyuantech.net/mp/api/v1"
 const TEST_IMG_BASE_URL = "https://test.cloud.boyuantech.net/img"
 //本地
-const DEV_BASE_URL = "http://localhost:9001/manage/api/v1/miniScmApp"
+const DEV_BASE_URL = "http://localhost:9041/api/v1"
 const DEV_IMG_BASE_URL = "https://pro.cloud.boyuantech.net/img"
 
 let BASE_URL

+ 3 - 3
pages/home/home.vue

@@ -155,6 +155,7 @@
 			}
 		},
 		async onLoad() {
+			console.log(__wxConfig)
 			//获取openid
 			if (!this.userInfo.openid) {
 				// #ifdef MP-WEIXIN
@@ -162,9 +163,8 @@
 					success: (res) => {
 						if (res.code) {
 							//发起网络请求
-							uni.$http.post('/userInfo/openid', {
-								code: res.code,
-								platform: 'WECHAT'
+							uni.$http.post('/user/weChatOpenid', {
+								code: res.code
 							}).then((res) => {
 								this.userInfo.openid = res.data.data
 								this.updateUserInfo(this.userInfo)

+ 51 - 68
pages/login/login.vue

@@ -4,15 +4,15 @@
 		<view class="title">
 			<text class="title--text">欢迎使用源享住</text>
 		</view>
-		<view v-if="quickLogin" class="quick-login">
+		<view v-if="isQuickLogin" class="quick-login">
 			<!-- #ifdef MP-WEIXIN -->
-			<u-button text="本机号码一键登录" :openType="openType" @getphonenumber="getPhoneNumber" @click="checkAgree"
+			<u-button text="本机号码一键登录" :openType="openType" @getphonenumber="quickLogin" @click="checkAgree"
 				shape="circle" color="#de9db7"></u-button>
 			<!-- #endif -->
 
 			<!-- #ifdef MP-ALIPAY -->
 			<button class="quick-login--alipay" :openType="openTypeAlipay" :scope="scopeAlipay" @click="checkAgree"
-				@getAuthorize="getPhoneNumberAlipay" @error="handleAuthError">本机号码一键登录</button>
+				@getAuthorize="quickLoginAlipay" @error="handleAuthError">本机号码一键登录</button>
 			<!-- #endif -->
 		</view>
 		<view v-else class="phone-login">
@@ -37,17 +37,17 @@
 		</view>
 		<view class="other-phone">
 			<u-text :text="changeLoginTypeText" size="24rpx" color="#FFFFFF;" align="center"
-				@click="quickLogin=!quickLogin"></u-text>
+				@click="isQuickLogin=!isQuickLogin"></u-text>
 		</view>
 		<view class="agree">
 			<checkbox-group @change="checkboxChange">
 				<label>
 					<!-- #ifdef MP-WEIXIN -->
-					<checkbox style="transform:scale(0.75)" color="#9e97c3" />
+					<checkbox :checked="agree" style="transform:scale(0.75)" color="#9e97c3" />
 					<!-- #endif -->
 
 					<!-- #ifdef MP-ALIPAY -->
-					<checkbox style="transform:scale(0.75)" color="#FFFFFF" />
+					<checkbox :checked="agree" style="transform:scale(0.75)" color="#FFFFFF" />
 					<!-- #endif -->
 
 					<text>请阅读并同意源享住</text>
@@ -86,7 +86,7 @@
 				agree: false,
 				hotelId: null,
 				version: '',
-				quickLogin: true,
+				isQuickLogin: true,
 			}
 		},
 		computed: {
@@ -104,7 +104,7 @@
 			},
 			// #endif
 			changeLoginTypeText() {
-				return this.quickLogin ? '使用其他手机号登录' : '手机号快速登录'
+				return this.isQuickLogin ? '使用其他手机号登录' : '手机号快速登录'
 			}
 		},
 		methods: {
@@ -113,11 +113,6 @@
 			checkboxChange() {
 				this.agree = !this.agree
 			},
-			gotoLogin() {
-				uni.navigateTo({
-					url: '/pages/login/login'
-				})
-			},
 			gotoProtocol() {
 				uni.navigateTo({
 					url: '/subpkg/protocol/protocol'
@@ -127,16 +122,20 @@
 				if (!this.agree) {
 					uni.showModal({
 						content: "请同意相关条款,勾选后代表您同意《用户协议》、《隐私条款》",
-						confirmText: "我知道了",
-						showCancel: false
+						confirmText: "同意",
+						success: (res) => {
+							if (res.confirm) {
+								this.agree = true
+							}
+						}
 					})
 				}
 			},
-			async getPhoneNumber(e) {
+			async quickLogin(e) {
 				// console.log("获取手机号", e);
 				if (e.detail.errMsg === 'getPhoneNumber:ok') {
 
-					let res = await uni.$http.post('/userInfo/login', {
+					let res = await uni.$http.post('/user/quickLogin', {
 						code: e.detail.code,
 						platform: "WECHAT"
 					})
@@ -153,8 +152,8 @@
 				console.log(e)
 			},
 			// #ifdef MP-ALIPAY
-			async getPhoneNumberAlipay(e) {
-				// console.log("getPhoneNumberAlipay", e);
+			async quickLoginAlipay(e) {
+				// console.log("quickLoginAlipay", e);
 
 				let cipherText = await my.getPhoneNumber({
 					protocols: {
@@ -193,68 +192,57 @@
 				if (!this.agree) {
 					uni.showModal({
 						content: "请同意相关条款,勾选后代表您同意《用户协议》、《隐私条款》",
-						confirmText: "我知道了",
-						showCancel: false
+						confirmText: "同意",
+						success: (res) => {
+							if (res.confirm) {
+								this.agree = true
+							}
+						}
 					})
 					return
 				}
-				//没有输入验证码
-				let codeLength = this.verificationCode.length
-				if (!numberNotZero(codeLength)) {
-					uni.$showMsg('请输入验证码')
-					return;
-				}
-				if (codeLength < 4) {
+				//校验验证码
+				let codeReg = /^\d{4}$/
+				if (!codeReg.test(this.verificationCode)) {
 					uni.$showMsg('验证码格式错误')
 					return;
 				}
 				//输入4位数字验证码
-				const res = await uni.$http.post(`/login`, {
+				const res = await uni.$http.post(`/user/login`, {
 					phone: this.phone,
 					verificationCode: this.verificationCode,
 				})
 				console.log(res)
 				if (res.data.code === 200 && res.data.success === true) {
 					await this.afterLoginSuccess(res)
+				} else {
+					uni.$showMsg('登陆失败,验证码错误')
 				}
 			},
 			async afterLoginSuccess(res) {
 				let userInfo = res.data.data.userInfo
-				//是否跳过人证比对
 				let params = JSON.parse(res.data.data.params)
 				console.log(params)
-				if (params && jsonParamIsTrue(params.skipIdMatching)) {
-					userInfo.skipIdMatching = true
-				} else {
-					userInfo.skipIdMatching = false
-				}
-				//是否调用人脸动态检测
-				if (params && jsonParamIsTrue(params.staticFaceCheck)) {
-					userInfo.staticFaceCheck = true
-				} else {
-					userInfo.staticFaceCheck = false
-				}
-				//是否可以选择酒店
-				if (params && jsonParamIsTrue(params.selectHotel)) {
-					userInfo.selectHotel = true
-				} else {
-					userInfo.selectHotel = false
-				}
-				//是否为测试账号
-				if (params && jsonParamIsTrue(params.isDebug)) {
-					userInfo.isDebug = true
-				} else {
-					userInfo.isDebug = false
+				//设置用户参数
+				if (params) {
+					//是否跳过人证比对
+					userInfo.skipIdMatching = params.skipIdMatching === true
+					//是否调用人脸动态检测
+					userInfo.staticFaceCheck = params.staticFaceCheck === true
+					//是否可以选择酒店
+					userInfo.selectHotel = params.selectHotel === true
+					//是否为测试账号
+					userInfo.isDebug = params.isDebug === true
 				}
 				//保存用户信息至local storage
-				this.updateUserInfo(res.data.data.userInfo)
+				this.updateUserInfo(userInfo)
 				//保存token
 				this.updateToken(res.data.data.tokenValue)
-				//上次登录的手机号
+				//保存上次登录的手机号
 				this.updateLastLoginPhone(this.phone)
 				//设置酒店信息
 				if (this.hotelId) {
-					await this.setHotelInfoById(this.hotelId)
+					await this.setHotel(this.hotelId)
 				}
 				//当前用户没设置身份证号则跳转
 				if (this.currentHotel && this.currentHotel != {}) {
@@ -275,7 +263,7 @@
 				}
 				if (this.$refs.uCode.canGetCode) {
 					this.$refs.uCode.start()
-					const res = await uni.$http.get(`/verificationCode/${this.phone}`)
+					const res = await uni.$http.get(`/user/verificationCode/${this.phone}`)
 					if (res.statusCode == 200 && res.data.data === true) {
 						// uni.$showMsg("验证码发送成功!")
 					} else {
@@ -290,15 +278,10 @@
 					e = e.substring(0, e.length - 5) + 's'
 				this.tips = e;
 			},
-			async setHotelInfoById(hotelId) {
-				let res = await uni.$http.post('/hotel', {
-					hotelId: hotelId,
-					pageNo: 1,
-					pageSize: 2
-				})
-				let hotelList = res.data.data.records
-				if (hotelList.length === 1) {
-					this.updateCurrentHotel(hotelList[0])
+			async setHotel(hotelId) {
+				let res = await uni.$http.get(`/hotel/${hotelId}`)
+				if (res.data.code === 200) {
+					this.updateCurrentHotel(res.data.data)
 				} else {
 					this.updateCurrentHotel({})
 				}
@@ -320,7 +303,7 @@
 				//未登录则在登录后查询hotelId是否存在对应酒店
 				//已登录则直接查询
 				if (this.token) {
-					await this.setHotelInfoById(this.hotelId)
+					await this.setHotel(this.hotelId)
 				}
 			} else {
 				this.hotelId = null
@@ -337,13 +320,13 @@
 			if (stringHasText(this.hotelId)) {
 				if (stringHasText(this.token)) {
 					this.hotelId = Number(this.hotelId)
-					await this.setHotelInfoById(this.hotelId)
+					await this.setHotel(this.hotelId)
 				}
 			}
 			// #endif
 
 			this.phone = this.lastLoginPhone
-			if (stringHasText(this.token)) {
+			if (this.token) {
 				uni.switchTab({
 					url: '/pages/home/home'
 				})

+ 15 - 11
pages/my/my.vue

@@ -16,14 +16,15 @@
 						<u-text size="20" :text="userInfo.name" mode="name" format="encrypt" color="#FFFFFF"></u-text>
 					</view>
 					<view class="top--desc__word-phone">
-						<u-text size="16" :text="renderPhoneNumber(userInfo.phone)" mode="name"color="#FFFFFF"></u-text>
+						<u-text size="16" :text="renderPhoneNumber(userInfo.phone)" mode="name"
+							color="#FFFFFF"></u-text>
 					</view>
 				</view>
 			</view>
 		</view>
 
 		<view class="middle">
-			<view class="middle--item" v-for="(item, index) in itemList">
+			<view class="middle--item" v-for="(item, index) in itemList" :key="item.src">
 				<view class="middle--item__content" @click="navigateTo(item.url)">
 					<view class="middle--item__img">
 						<u-image :src="item.src" :width="item.width" :height="item.height" mode="aspectFit"></u-image>
@@ -40,7 +41,9 @@
 </template>
 
 <script>
-	import { stringHasText } from '../../utils/commonUtils.js'
+	import {
+		stringHasText
+	} from '../../utils/commonUtils.js'
 	import {
 		mapState,
 		mapMutations
@@ -53,8 +56,7 @@
 		data() {
 			return {
 				userPicPath: '/static/user.png',
-				itemList:[
-					{
+				itemList: [{
 						src: "/static/my_order.png",
 						text: "我的订单",
 						url: '/pages/order/order',
@@ -115,9 +117,11 @@
 			},
 			async logout() {
 				console.log(this.token)
-				let res = await uni.$http.post('/logout')
+				let res = await uni.$http.post('/user/logout')
 				console.log(res)
-				this.updateUserInfo({name:''})
+				this.updateUserInfo({
+					name: ''
+				})
 				this.updateToken('')
 				this.updateCurrentHotel({})
 				this.updateIdCardInfo([])
@@ -125,12 +129,12 @@
 				uni.redirectTo({
 					url: '/pages/login/login'
 				})
-				
+
 			},
 			renderPhoneNumber(str) {
-				if(!stringHasText(this.userInfo.phone)) return ""
+				if (!stringHasText(this.userInfo.phone)) return ""
 				let strArray = str.split("")
-				for(let i = 3; i < 7; i++) {
+				for (let i = 3; i < 7; i++) {
 					strArray[i] = "*"
 				}
 				let string = strArray.join("")
@@ -219,7 +223,7 @@
 						display: flex;
 						align-items: center;
 					}
-				}	
+				}
 			}
 		}
 

+ 4 - 14
pages/order/order.vue

@@ -97,7 +97,7 @@
 						name: '已完成',
 					}
 				],
-				status: ['ORDER_PLACED_OR_ROOM_SELECTED', 'CHECK_IN', 'CHECK_OUT_OR_FINISHED'],
+				status: ['NOT_CHECKIN', 'CHECKIN', 'FINISHED'],
 				current: 0,
 				pageSize: 10,
 				pageNo: 1,
@@ -142,23 +142,13 @@
 				})
 
 				let condition = {
-					name: this.userInfo.name,
-					// phone: this.userInfo.phone,
-					deleted: false,
 					pageNo: this.pageNo,
 					pageSize: this.pageSize,
-					status: this.status[index],
+					orderStatus: this.status[index],
 					hotelId: this.currentHotel.hotelId
 				}
-				if (index == 0) {
-					//只查询没过期的,pms推送的
-					condition.outDated = false
-					condition.orderSource = 'PMS_GREEN_CLOUD'
-				} else {
-					condition.paymentStatus = 'PAID'
-				}
-
-				let res = await uni.$http.post('/hotelOrder/queryByCondition', condition)
+				
+				let res = await uni.$http.post(`/order/status`, condition)
 				this.orderList = [...this.orderList, ...res.data.data.records]
 				this.total = res.data.data.total
 				uni.hideLoading()

+ 7 - 23
subpkg/chooseHotel/chooseHotel.vue

@@ -22,8 +22,6 @@
 			</view>
 		</view>
 
-
-
 		<view class="choose-hotel--dispaly-area" v-if="!notFound">
 
 			<view class="choose-hotel--description" v-for="(hotel, index) in hotelList" :key="index">
@@ -72,17 +70,12 @@
 			async inputChanged() {
 				this.notFound = false
 
-				let res = await uni.$http.post('/hotel', {
-					name: this.hotelName,
-					isTest: false,
-					pageNo: 1,
-					pageSize: 999
-				})
-				if (res.data.data.records.length === 0) {
+				let res = await uni.$http.get(`/hotel/hotelName/${this.hotelName}`)
+				if (res.data.data.length === 0) {
 					this.notFound = true
 					return
 				}
-				this.hotelList = res.data.data.records
+				this.hotelList = res.data.data
 			},
 			inputFocusd() {
 				// 取得焦点时显示shortcut
@@ -115,21 +108,12 @@
 				// #endif
 			},
 			async getHotels() {
-				let res = await uni.$http.post('/hotel', {
-					isTest: false,
-					pageNo: 1,
-					pageSize: 999
-				})
-				this.hotelList = res.data.data.records
+				let res = await uni.$http.get('/hotel')
+				this.hotelList = res.data.data
 			},
 			async queryHotelByHotelId(hotelId) {
-				let res = await uni.$http.post('/hotel', {
-					hotelId: hotelId,
-					isTest: false,
-					pageNo: 1,
-					pageSize: 999
-				})
-				return res.data.data.records[0]
+				let res = await uni.$http.get(`/hotel/${hotelId}`)
+				return res.data.data
 			},
 			getHotelPicPath(path) {
 				return IMG_BASE_URL + '/' + path

+ 75 - 88
subpkg/extend/extend.vue

@@ -8,7 +8,7 @@
 			<NavigateBar title="我的订单" bgcolor="#9e97c3"></NavigateBar>
 			<!-- #endif -->
 		</view>
-		<view v-if="Object.keys(checkinInfo).length > 0">
+		<view v-if="roomTypePicPath">
 			<view class="top-background">
 				<view class="room-type-item">
 					<view class="room-type-item-left">
@@ -24,7 +24,7 @@
 					</view>
 					<view class="room-type-item-right">
 						<view class="room-type-item-right-text">
-							<u-text :text="unitPrice" color="#FF5C58" align="right" size="24px" bold></u-text>
+							<u-text :text="'¥'+unitPrice" color="#FF5C58" align="right" size="24px" bold></u-text>
 						</view>
 					</view>
 				</view>
@@ -56,7 +56,8 @@
 				</view>
 			</view>
 			<view class="guest-info">
-				<u-form v-for="info in guestInfos" labelPosition="left" labelWidth="240rpx" labelAlign="left">
+				<u-form v-for="info in guestInfos" :key="info.name" labelPosition="left" labelWidth="240rpx"
+					labelAlign="left">
 					<u-form-item label="住客姓名" prop="name">
 						<u-text :text="info.name" color="#333333" bold size="16"></u-text>
 					</u-form-item>
@@ -64,7 +65,7 @@
 						<u-text :text="info.phone" color="#333333" bold size="16"></u-text>
 					</u-form-item>
 					<u-form-item label="离店时间">
-						<u-text :text="checkinInfo.endTime" color="#333333" bold size="16"></u-text>
+						<u-text :text="endTime" color="#333333" bold size="16"></u-text>
 					</u-form-item>
 				</u-form>
 			</view>
@@ -72,8 +73,7 @@
 				<u-text :text="extendTip" align="center"></u-text>
 			</view>
 			<view class="btn-area">
-				<button v-if="fromExtend == true" class="btn" hover-class="btn-hover"
-					@click="queryCanExtend">续住</button>
+				<button v-if="fromExtend == true" class="btn" hover-class="btn-hover" @click="showCalendar">续住</button>
 				<button v-else class="btn" hover-class="btn-hover" @click="confirmCheckout">退房</button>
 			</view>
 			<view>
@@ -131,14 +131,19 @@
 				maxDate: 0,
 				oldEndTime: '',
 				extendTip: '',
-				needAuthPay: false
+				needAuthPay: false,
+				breakfastNum: 0,
+				orderId: '',
+				endTime: '',
+				canExtend: false,
+				checkinInfoId: ''
 			};
 		},
 		computed: {
 			...mapState('m_user', ['userInfo']),
 			...mapState('m_business', ['currentHotel']),
 			breakfastNumText() {
-				return this.order.breakfastNum ? `含${this.order.breakfastNum}早` : '不含早'
+				return this.breakfastNum ? `含${this.breakfastNum}早` : '不含早'
 			}
 		},
 		methods: {
@@ -154,9 +159,7 @@
 				})
 			},
 			async checkout() {
-				let res = await uni.$http.post('/checkout', {
-					id: this.checkinInfo.id
-				});
+				let res = await uni.$http.post(`/scm/checkout/${this.checkinInfoId}`);
 				if (res.data.success === true) {
 					this.updateCheckinInfo({})
 					uni.$showMsg('退房办理成功!')
@@ -170,19 +173,22 @@
 				}
 			},
 			async queryCanExtend() {
-				let res = await uni.$http.post('/canExtend', {
-					orderId: this.order.orderId
-				})
+				let res = await uni.$http.get(`/scm/canExtend/${this.orderId}`)
 				if (res.data.data == true) {
-					this.calendarShow = true
+					this.canExtend = true
 				} else {
+					this.canExtend = false
+				}
+			},
+			showCalendar() {
+				if (!this.canExtend) {
 					uni.$showMsg('不满足续住条件,请至前台办理')
+					return
 				}
+				this.calendarShow = true
 			},
 			async extend() {
-				let res = await uni.$http.post('/extend', {
-					orderId: this.newOrderId
-				});
+				let res = await uni.$http.post(`/scm/extend/${this.newOrderId}`);
 				if (res.data.success === true) {
 					this.updateCheckinInfo({})
 					uni.$showMsg('续住办理成功!')
@@ -194,7 +200,6 @@
 				} else {
 					uni.$showMsg('续住办理失败')
 				}
-
 			},
 			async confirmEndTime(e) {
 				this.newEndTime = e[0]
@@ -211,10 +216,10 @@
 			},
 			async createExtendOrder() {
 				let info = {
-					id: this.checkinInfo.id,
+					id: this.checkinInfoId,
 					dayNum: this.dayNum
 				}
-				let createRes = await uni.$http.post('/extend/orderId', info)
+				let createRes = await uni.$http.post('/scm/extend/orderId', info)
 				if (createRes.data.code === 200) {
 					let resData = createRes.data.data
 					this.newOrderId = resData.orderId
@@ -228,11 +233,9 @@
 				console.log("pay start");
 
 				// #ifdef MP-WEIXIN
-				let res = await uni.$http.post('/hotelOrder/payment', {
+				let res = await uni.$http.post('/order/payment/weChat', {
 					openid: this.userInfo.openid,
 					orderId: orderId,
-					platform: 'WECHAT',
-					hotelId: this.currentHotel.hotelId
 				})
 				res.data.data.package = res.data.data.packageStr
 				let paymentResult = await wx.requestPayment(res.data.data)
@@ -252,79 +255,62 @@
 				// #endif
 			},
 			async getCheckinInfo() {
-				let res = await uni.$http.post('/checkinInfo/queryByCondition', {
-					userIdNumber: this.userInfo.idNumber,
-					status: 1,
-					hotelId: this.currentHotel.hotelId,
-					pageNo: 1,
-					pageSize: 1
-				});
+				let res = await uni.$http.get(`/user/checkinInfo/${this.currentHotel.hotelId}`);
 				if (res.data.code == 200) {
-					if (res.data.data.records.length > 0) {
-						console.log(res.data.data.records[0].endTime)
-						let originEndTime = new Date(res.data.data.records[0].endTime);
-						this.newEndTime = new Date(originEndTime.valueOf() + 24 * 60 * 60 * 1000)
-						this.oldEndTime = res.data.data.records[0].endTime
-						this.checkinInfo = res.data.data.records[0];
-
-						//根据订单号查询订单信息
-						let orderRes = await uni.$http.post('/hotelOrder/queryByCondition', {
-							orderId: this.checkinInfo.orderId,
-							hotelId: this.currentHotel.hotelId,
-							pageNo: 1,
-							pageSize: 1
-						});
-						let guest = {}
-						guest.name = this.checkinInfo.customerName
-						let order = orderRes.data.data.records[0]
-						//查询到订单则直接按订单内容显示,否则
-						if (order) {
-							this.order = order
-							this.roomTypePicPath = IMG_BASE_URL + '/' + order.roomPicPath
-							this.roomInfo = order.roomTypeName + order.room
-							this.unitPrice = '¥' + order.unitPrice
-							guest.phone = order.checkinPhone
-						} else {
-							let roomInfoRes = await uni.$http.post('/roomInfo', {
-								hotelId: this.checkinInfo.hotelId,
-								room: this.checkinInfo.room,
-								pageNo: 1,
-								pageSize: 1
-							})
-							console.log('roominfo', roomInfoRes)
-							let roomTypeRes = await uni.$http.post('/roomType', {
-								roomType: roomInfoRes.data.data.records[0].roomType,
-								pageNo: 1,
-								pageSize: 1
-							})
-							let roomType = roomTypeRes.data.data.records[0]
-							this.roomTypePicPath = IMG_BASE_URL + '/' + roomType.roomPicPath
-							this.roomInfo = roomType.roomTypeName + this.checkinInfo.room
-							this.unitPrice = '¥' + roomType.unitPrice
+					let checkinInfo = res.data.data
+					console.log(checkinInfo)
+					if (checkinInfo) {
+						this.roomTypePicPath = IMG_BASE_URL + '/' + checkinInfo.roomPicPath
+						this.roomInfo = checkinInfo.roomTypeName + checkinInfo.room
+						this.unitPrice = checkinInfo.unitPrice
+						this.breakfastNum = checkinInfo.breakfastNum
+						this.endTime = moment(checkinInfo.endTime).format('M月DD日 HH:mm')
+						this.orderId = checkinInfo.orderId
+						this.checkinInfoId = checkinInfo.id
+						let guest = {
+							name: checkinInfo.name,
+							phone: checkinInfo.phone
 						}
+						// if (order) {
+						// 	this.order = order
+						// 	this.roomTypePicPath = IMG_BASE_URL + '/' + order.roomPicPath
+						// 	this.roomInfo = order.roomTypeName + order.room
+						// 	this.unitPrice = '¥' + order.unitPrice
+						// } else {
+						// 	let roomInfoRes = await uni.$http.post('/roomInfo', {
+						// 		hotelId: this.checkinInfo.hotelId,
+						// 		room: this.checkinInfo.room,
+						// 		pageNo: 1,
+						// 		pageSize: 1
+						// 	})
+						// 	console.log('roominfo', roomInfoRes)
+						// 	let roomTypeRes = await uni.$http.post('/roomType', {
+						// 		roomType: roomInfoRes.data.data.records[0].roomType,
+						// 		pageNo: 1,
+						// 		pageSize: 1
+						// 	})
+						// 	let roomType = roomTypeRes.data.data.records[0]
+						// 	this.roomTypePicPath = IMG_BASE_URL + '/' + roomType.roomPicPath
+						// 	this.roomInfo = roomType.roomTypeName + this.checkinInfo.room
+						// 	this.unitPrice = '¥' + roomType.unitPrice
+						// }
 						this.guestInfos.push(guest)
 
-						this.start.date = moment(this.checkinInfo.startTime).format('MM月DD日')
-						this.start.day = getDay(new Date(this.checkinInfo.startTime).getDay())
-						this.end.date = moment(this.checkinInfo.endTime).format('MM月DD日')
-						this.end.day = getDay(new Date(this.checkinInfo.endTime).getDay())
+						let originEndTime = new Date(checkinInfo.endTime);
+						this.newEndTime = new Date(originEndTime.valueOf() + 24 * 60 * 60 * 1000)
+						this.oldEndTime = checkinInfo.endTime
 
-						let start = new Date(moment(this.checkinInfo.startTime).format('YYYY/MM/DD'))
-						let end = new Date(moment(this.checkinInfo.endTime).format('YYYY/MM/DD'))
-						// console.log(start.getTime())
-						// console.log(end)
-						let dayNum = (end.getTime() - start.getTime()) / (24 * 60 * 60 * 1000)
-						dayNum = dayNum < 1 ? 1 : dayNum
-						this.dayNumText = '共' + dayNum + '晚'
+						this.start.date = moment(checkinInfo.startTime).format('MM月DD日')
+						this.start.day = getDay(new Date(checkinInfo.startTime).getDay())
+						this.end.date = moment(checkinInfo.endTime).format('MM月DD日')
+						this.end.day = getDay(new Date(checkinInfo.endTime).getDay())
+
+						this.dayNumText = '共' + checkinInfo.dayNum + '晚'
 
 						//设置日历
-						let endDate = new Date(this.checkinInfo.endTime)
+						let endDate = new Date(checkinInfo.endTime)
 						endDate.setDate(endDate.getDate() + 1)
 						this.minDate = moment(new Date(endDate)).format('YYYY-MM-DD')
-						// this.defaultDate = moment(new Date(endDate)).format('YYYY-MM-DD')
-
-						this.checkinInfo.startTime = moment(this.checkinInfo.startTime).format('YYYY/MM/DD HH:mm')
-						this.checkinInfo.endTime = moment(this.checkinInfo.endTime).format('YYYY/MM/DD HH:mm')
 					} else {
 						this.checkinInfo = {}
 					}
@@ -421,6 +407,7 @@
 		},
 		async onLoad(options) {
 			await this.getCheckinInfo()
+			await this.queryCanExtend()
 			this.fromExtend = options.fromExtend == 'true'
 		},
 		onShow() {

+ 2 - 7
subpkg/orderDetail/orderDetail.vue

@@ -105,14 +105,9 @@
 		},
 		methods: {
 			async queryOrder() {
-				let res = await uni.$http.post('/hotelOrder/queryByCondition', {
-					orderId: this.orderId,
-					deleted: false,
-					pageNo: 1,
-					pageSize: 999
-				})
+				let res = await uni.$http.get(`/order/orderId/${this.orderId}`, )
 				console.log(res)
-				this.orderInfo = JSON.parse(JSON.stringify(res.data.data.records[0]))
+				this.orderInfo = JSON.parse(JSON.stringify(res.data.data))
 				this.orderInfo.orderId = this.orderInfo.orderId.toUpperCase()
 				this.orderInfo.startTime = moment(this.orderInfo.startTime).format('YYYY-MM-DD')
 				this.orderInfo.endTime = moment(this.orderInfo.endTime).format('YYYY-MM-DD')

+ 4 - 4
subpkg/updateNameAndIdNumber/updateNameAndIdNumber.vue

@@ -18,7 +18,8 @@
 			<view class="tip">
 				<u-text text="身份证:"></u-text>
 			</view>
-			<u-input placeholder="请输入身份证号" border="surround" v-model="idNumber" type="idcard" clearable :maxlength="18"></u-input>
+			<u-input placeholder="请输入身份证号" border="surround" v-model="idNumber" type="idcard" clearable
+				:maxlength="18"></u-input>
 		</view>
 		<view class="btn">
 			<u-button text="确定" color="#a09cc4" @click="updateNameAndIdNumber"></u-button>
@@ -60,8 +61,7 @@
 					uni.$showMsg('姓名格式错误!')
 					return;
 				}
-				let res = await uni.$http.put('/userInfo/' + this.userInfo.id, {
-					id: this.userInfo.id,
+				let res = await uni.$http.put('/user', {
 					idNumber: this.idNumber,
 					name: this.name
 				});
@@ -78,7 +78,7 @@
 						});
 					}, 1000);
 				} else {
-					uni.$showMsg('修改失败:' + value.data.msg);
+					uni.$showMsg('修改失败:' + res.data.msg);
 				}
 			}
 		},

+ 135 - 238
subpkg_checkin/addGuest/addGuest.vue

@@ -18,7 +18,8 @@
 					<u-input v-model="name" border="none" clearable fontSize="36rpx"></u-input>
 				</u-form-item>
 				<u-form-item label="手机号" prop="phone">
-					<u-input v-model="phone" border="none" clearable fontSize="36rpx" type="number" maxlength="11"></u-input>
+					<u-input v-model="phone" border="none" clearable fontSize="36rpx" type="number"
+						maxlength="11"></u-input>
 				</u-form-item>
 				<u-form-item label="身份证" prop="idNumber">
 					<u-input v-model="idNumber" border="none" clearable fontSize="36rpx"></u-input>
@@ -52,7 +53,8 @@
 		<view class="shoot-id-card" v-if="shootCard">
 			<camera id="card-camera" flash="off" device-position="back" @ready="cameraContext"
 				:style="[cardCameraStyle]" />
-			<cover-image :src="frontSelect ? '/static/mp-alipay/identity_info.png' : '/static/mp-alipay/national_emblem.png'"
+			<cover-image
+				:src="frontSelect ? '/static/mp-alipay/identity_info.png' : '/static/mp-alipay/national_emblem.png'"
 				:style="[cardCameraStyle]"></cover-image>
 			<view class="camera-btn">
 				<image v-if="shot" src="/static/mp-alipay/camera.svg" style="width: 140rpx; height: 140rpx;"></image>
@@ -173,7 +175,7 @@
 	import NavigateBar from '../../components/navigateBar/navigate-bar.vue';
 	// #ifdef MP-ALIPAY
 	// 最大图片大小为2.0M
-	const maxPhotoSize = 2097152
+	const maxPhotoSize = 2 * 1024 * 1024
 	// OCR类型,人像面为"0",国徽面为"1"
 	const ocrType = {
 		face: "0",
@@ -318,14 +320,12 @@
 			...mapState('m_user', ['userInfo']),
 			...mapState('m_business', ['checkinInfo', 'currentHotel', 'idCardInfo', 'order']),
 			getAllInfo() {
-				let getAll = true
 				for (const info of this.infoList) {
 					if (!this.idCardInfoInPage[info]) {
-						getAll = false
-						break
+						return false
 					}
 				}
-				return getAll
+				return true
 			},
 			// #ifdef MP-ALIPAY
 			cardCameraStyle() {
@@ -388,14 +388,11 @@
 					}
 				}
 				//检查该顾客是否在当前酒店入住
-				let res = await uni.$http.post('/checkinInfo/queryByCondition', {
-					userIdNumber: this.idNumber,
-					status: 1,
-					hotelId: this.currentHotel.hotelId,
-					pageNo: 1,
-					pageSize: 1
+				let res = await uni.$http.post('/user/isCheckin', {
+					idNumber: this.idNumber,
+					hotelId: this.currentHotel.hotelId
 				})
-				if (res.data.code == 200 && res.data.data.records.length > 0) {
+				if (res.data.code === 200 && res.data.data === true) {
 					uni.$showMsg('该顾客已入住!')
 					return
 				}
@@ -410,16 +407,14 @@
 				}
 
 				//本地缓存没有顾客身份信息,到后台查询
-				let idCardInfoQueryRes = await uni.$http.post('/idCardInfo/queryByCondition', {
-					pageNo: 1,
-					pageSize: 1,
+				let idCardInfoQueryRes = await uni.$http.post('/user/idCardInfo', {
 					idNumber: this.idNumber,
 					name: this.name
 				})
 
 				//查询到,写入local storage,跳转checkIdentity
-				if (idCardInfoQueryRes.data.data.records.length === 1) {
-					let info = idCardInfoQueryRes.data.data.records[0]
+				if (idCardInfoQueryRes.data.code === 200 && idCardInfoQueryRes.data.data) {
+					let info = idCardInfoQueryRes.data.data
 					info.birth = info.birthday
 					let keys = Object.keys(this.idCardInfoInPage)
 					for (const key of keys) {
@@ -437,7 +432,7 @@
 					return
 				}
 
-				//没查询到,跳转step 1,上传身份证
+				//没查询到,跳转uploadCard,上传身份证
 				this.step = "uploadCard"
 			},
 			// #ifdef MP-WEIXIN
@@ -605,7 +600,7 @@
 				}
 			},
 			async afterIdCardRead(event) {
-				console.log(event)
+				console.log('afterIdCardRead', event)
 				//正面还是反面
 				this.idCardDirection = event.name
 				await this.setImageUploadInfo(event.file.url)
@@ -634,41 +629,34 @@
 					})
 					return
 				}
-				let baseUrl = BASE_URL.slice(0, -11)
 				uni.showLoading({
 					title: '上传中',
 					mask: true
 				})
-				let filePath = this['idCard' + this.idCardDirection + 'PicPath']
-				// uni.getFileSystemManager().readFile({
-				// filePath: filePath, //选择图片返回的相对路径
-				// encoding: 'base64',
-				// success: res => {
-				let data = {
-					image: filePath.split(',')[1],
-					imageType: 'BASE64',
-				}
-				data.ocrType = detectInfo.label
-				uni.request({
-					url: baseUrl + '/verification/idCardOcr',
-					method: 'POST',
-					data: data,
-					success: res => {
-						console.log(res)
-						if (res.data.data.imageStatus !== 'normal') {
-							uni.showModal({
-								content: '获取信息失败,请检查图片并重新上传',
-								showCancel: false,
-							})
-						}
-						if (!this.name) {
-							this.name = res.data.data.name
-						}
-						if (!this.idNumber) {
-							this.idNumber = res.data.data.cardNum
-						}
-						if (event.name === 'Front' && (res.data.data.cardNum != this.idNumber || res.data
-								.data.name != this.name)) {
+
+				try {
+					let filePath = this['idCard' + this.idCardDirection + 'PicPath']
+
+					let res = await uni.$http.post('/user/idCardOcr', {
+						image: filePath.split(',')[1],
+						ocrType: detectInfo.label,
+						imageType: 'BASE64'
+					})
+					if (res.data.data.imageStatus !== 'normal') {
+						uni.showModal({
+							content: '获取信息失败,请检查图片并重新上传',
+							showCancel: false,
+						})
+						return
+					}
+					if (!this.name) {
+						this.name = res.data.data.name
+					}
+					if (!this.idNumber) {
+						this.idNumber = res.data.data.cardNum
+					}
+					if (event.name === 'Front') {
+						if (res.data.data.cardNum != this.idNumber || res.data.data.name != this.name) {
 							uni.showModal({
 								content: '填写信息与身份证不一致',
 								showCancel: false,
@@ -676,38 +664,30 @@
 									this.step = "fillForm"
 									this.idCardFrontPicPath =
 										'../../static/upload_front.png'
-									return
-								}
+								},
 							})
+							return
 						}
-						this['idCard' + this.idCardDirection + 'Base64'] = data.image
-						if (event.name === 'Front') {
-							this.idCardInfoInPage.name = res.data.data.name
-							this.idCardInfoInPage.sex = res.data.data.sex
-							this.idCardInfoInPage.nation = res.data.data.nation
-							this.idCardInfoInPage.birth = res.data.data.birth
-							this.idCardInfoInPage.address = res.data.data.address
-							this.idCardInfoInPage.idNumber = res.data.data.cardNum
-						} else {
-							this.idCardInfoInPage.issuingAuthority = res.data.data.issuingAuthority
-							this.idCardInfoInPage.issuingDate = res.data.data.issuingDate
-							this.idCardInfoInPage.expiryDate = res.data.data.expiryDate
-						}
-					},
-					fail: err => {
-						uni.$showMsg('上传失败')
-					},
-					complete: () => {
-						console.log('complete')
-						uni.hideLoading()
+						this.idCardFrontBase64 = filePath.split(',')[1]
+						this.idCardInfoInPage.name = res.data.data.name
+						this.idCardInfoInPage.sex = res.data.data.sex
+						this.idCardInfoInPage.nation = res.data.data.nation
+						this.idCardInfoInPage.birth = res.data.data.birth
+						this.idCardInfoInPage.address = res.data.data.address
+						this.idCardInfoInPage.idNumber = res.data.data.cardNum
+					} else {
+						this.idCardBackBase64 = filePath.split(',')[1]
+						this.idCardInfoInPage.issuingAuthority = res.data.data.issuingAuthority
+						this.idCardInfoInPage.issuingDate = res.data.data.issuingDate
+						this.idCardInfoInPage.expiryDate = res.data.data.expiryDate
 					}
-				})
-				// 	},
-				// 	complete: () => {
-				// 		uni.hideLoading()
-				// 	}
-				// })
-
+				} catch (err) {
+					uni.showModal({
+						title: err.message
+					})
+				} finally {
+					uni.hideLoading()
+				}
 			},
 			oversize() {
 				uni.$showMsg('图片超出允许大小(1.5M)')
@@ -759,14 +739,11 @@
 						}
 					}
 					//检查该顾客是否在当前酒店入住
-					let res = await uni.$http.post('/checkinInfo/queryByCondition', {
-						userIdNumber: this.idNumber,
-						status: 1,
-						hotelId: this.currentHotel.hotelId,
-						pageNo: 1,
-						pageSize: 1
+					let res = await uni.$http.post('/user/isCheckin', {
+						idNumber: this.idNumber,
+						hotelId: this.currentHotel.hotelId
 					})
-					if (res.data.code == 200 && res.data.data.records.length > 0) {
+					if (res.data.code === 200 && res.data.data === true) {
 						uni.$showMsg('该顾客已入住!')
 						return
 					}
@@ -1375,159 +1352,77 @@
 			//上传
 			async afterRead(mybase64) {
 				let that = this;
-				uni.$http.post('/faceVerification/checkPic', {
-						hotelId: that.currentHotel.hotelId,
-						faceData: mybase64,
+				let res = await uni.$http.post('/user/faceCheckAll', {
+					hotelId: this.currentHotel.hotelId,
+					imageBase64: mybase64,
+					name: this.name,
+					idNumber: this.idNumber
+				})
+				if (res.data.code === 200 && res.data.success === true) {
+					let infoFromIdCard = {}
+					this.infoList.forEach(info => {
+						infoFromIdCard[info] = this.idCardInfoInPage[info]
 					})
-					.then(async (res) => {
-						uni.hideLoading();
-						console.log('mybase64', mybase64);
-						if (res.data.code === 200 && res.data.success === true) {
-							if (that.userInfo.skipIdMatching === true) {
-								uni.showModal({
-									content: '图片检查通过!',
-									showCancel: false,
-									success: function(res) {
-										if (res.confirm) {
-											console.log('用户点击确定');
-											let infoFromIdCard = {}
-											that.infoList.forEach(info => {
-												infoFromIdCard[info] = that[info]
-											})
-											let currentCheckinInfo = {
-												name: that.name,
-												idNumber: that.idNumber,
-												phone: that.phone,
-												faceData: mybase64
-											}
-											currentCheckinInfo = {
-												...currentCheckinInfo,
-												...infoFromIdCard
-											}
-											that.checkinInfo.push(currentCheckinInfo)
-											that.updateCheckinInfo(that.checkinInfo)
-
-											let currentGuestInfo = {
-												name: that.name,
-												idNumber: that.idNumber,
-											}
-
-											let i
-											for (i = 0; i < that.guestInfo.length; i++) {
-												if (that.guestInfo[i].idNumber == that.idNumber) {
-													that.guestInfo[i] = {
-														...currentGuestInfo,
-														...infoFromIdCard
-													}
-													that.updateGuestInfo(that.guestInfo)
-												}
-											}
-											if (i === that.guestInfo.length) {
-												that.guestInfo.push({
-													...currentGuestInfo,
-													...infoFromIdCard
-												})
-												that.updateGuestInfo(that.guestInfo)
-											}
-
-											setTimeout(() => uni.reLaunch({
-												url: '/subpkg_checkin/confirmOrder/confirmOrder'
-											}), 1000);
-										}
-									},
-								});
-							} else {
-								uni.showLoading({
-									title: '正在身份核验,请稍后',
-								});
-								let yunjiFaceCheckInfo = {
-									idNo: that.idNumber,
-									name: that.name,
-									image: mybase64,
-								};
-								let checkRes = await uni.$http.post(
-									'/faceVerification/yunjiVerification',
-									yunjiFaceCheckInfo
-								);
-
-								if (checkRes.data.success === true) {
-									let infoFromIdCard = {}
-									that.infoList.forEach(info => {
-										infoFromIdCard[info] = that.idCardInfoInPage[info]
-									})
-									let currentCheckinInfo = {
-										name: that.name,
-										idNumber: that.idNumber,
-										faceData: mybase64,
-										phone: that.phone,
-										...infoFromIdCard
-									}
-									//更新local storage 中的入住信息
-									let checkinInfoToUpdate = that.checkinInfo
-									checkinInfoToUpdate.push(currentCheckinInfo)
-									that.updateCheckinInfo(checkinInfoToUpdate)
-									//更新local storage 中的身份证信息
-									let idCardInfoToUpdate = that.idCardInfo
-									idCardInfoToUpdate.push(that.idCardInfoInPage)
-									that.updateIdCardInfo(idCardInfoToUpdate)
-									//如果上传过照片则更新服务器中的身份证信息
-									if (that.idCardFrontDetectInfo.detected && that.idCardBackDetectInfo
-										.detected) {
-										uni.$http.post('/idCardInfo', {
-											...that.idCardInfoInPage,
-											birthday: that.idCardInfoInPage.birth,
-											idCardFrontBase64: that.idCardFrontPicPath.split(',')[1],
-											idCardBackBase64: that.idCardBackPicPath.split(',')[1]
-										})
-									}
-									if (this.isMainCustomer) {
-										//如果是主入住人,且当前账号姓名和身份证号为空,则更新账号信息为主入住人信息
-										if (!this.userInfo.name || !this.userInfo.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('身份核验通过!')
-									setTimeout(() => uni.reLaunch({
-										url: '/subpkg_checkin/confirmOrder/confirmOrder'
-									}), 1000)
-								} else {
-									uni.hideLoading()
-									uni.showModal({
-										content: '身份核验失败,请重试',
-										showCancel: false,
-										success: function(res) {
-											if (res.confirm) {
-												console.log('用户点击确定');
-												that.initData();
-											}
-										},
-									});
-								}
-							}
-						} else {
-							uni.hideLoading()
-							uni.showModal({
-								content: '身份核验失败,请重试',
-								showCancel: false,
-								success: function(res) {
-									if (res.confirm) {
-										console.log('用户点击确定');
-										that.initData();
-									}
-								},
-							});
+					let currentCheckinInfo = {
+						name: this.name,
+						idNumber: this.idNumber,
+						faceData: mybase64,
+						phone: this.phone,
+						...infoFromIdCard
+					}
+					//更新local storage 中的入住信息
+					let checkinInfoToUpdate = this.checkinInfo
+					checkinInfoToUpdate.push(currentCheckinInfo)
+					this.updateCheckinInfo(checkinInfoToUpdate)
+					//更新local storage 中的身份证信息
+					let idCardInfoToUpdate = this.idCardInfo
+					idCardInfoToUpdate.push(this.idCardInfoInPage)
+					this.updateIdCardInfo(idCardInfoToUpdate)
+					//如果上传过照片则更新服务器中的身份证信息
+					if (this.idCardFrontDetectInfo.detected && this.idCardBackDetectInfo
+						.detected) {
+						uni.$http.post('/user/idCardInfo/add', {
+							...this.idCardInfoInPage,
+							birthday: this.idCardInfoInPage.birth,
+							idCardFrontBase64: this.idCardFrontPicPath.split(',')[1],
+							idCardBackBase64: this.idCardBackPicPath.split(',')[1]
+						})
+					}
+					if (this.isMainCustomer) {
+						//如果是主入住人,且当前账号姓名和身份证号为空,则更新账号信息为主入住人信息
+						if (!this.userInfo.name || !this.userInfo.idNumber) {
+							this.userInfo.name = this.name
+							this.userInfo.idNumber = this.idNumber
+							this.updateUserInfo(this.userInfo)
+							uni.$http.put(`/user`, {
+								name: this.name,
+								idNumber: this.idNumber
+							})
 						}
-						console.log('checkPicRes', res);
+						//更新订单预定人信息为主入住人信息
+						let orderToUpdate = this.order
+						orderToUpdate.name = this.name
+						orderToUpdate.phone = this.phone
+						this.updateOrder(orderToUpdate)
+					}
+					uni.hideLoading();
+					uni.$showMsg('身份核验通过!')
+					setTimeout(() => uni.reLaunch({
+						url: '/subpkg_checkin/confirmOrder/confirmOrder'
+					}), 1000)
+				} else {
+					uni.hideLoading()
+					uni.showModal({
+						content: `身份核验失败,${res.data.msg},请重试`,
+						showCancel: false,
+						success: function(res) {
+							if (res.confirm) {
+								console.log('用户点击确定');
+								that.initData();
+							}
+						},
 					});
+				}
 			},
 			// #endif
 		},
@@ -1812,6 +1707,7 @@
 				.btn {
 					margin: 20rpx;
 				}
+
 				/* #endif */
 			}
 
@@ -1839,6 +1735,7 @@
 					bottom: 50rpx;
 				}
 			}
+
 			/* #endif */
 		}
 	}

+ 1 - 1
subpkg_checkin/checkin/checkin.vue

@@ -83,7 +83,7 @@
 						info.issuingAuthority = this.checkinInfo[i].issuingAuthority
 						info.issuingDate = this.checkinInfo[i].issuingDate
 						info.expiryDate = this.checkinInfo[i].expiryDate
-						let res = await uni.$http.post('/checkin', info)
+						let res = await uni.$http.post('/scm/checkin', info)
 						console.log(res)
 						if (res.data.code == 200 && res.data.success === true) {
 							checkinResult[i] = true

+ 10 - 14
subpkg_checkin/confirmOrder/confirmOrder.vue

@@ -51,7 +51,7 @@
 
 		<!-- #ifdef MP-WEIXIN  -->
 		<u-swipe-action>
-			<u-swipe-action-item :options="options" v-for="(info,index) in checkinInfo" @click="deleteGuest"
+			<u-swipe-action-item :options="options" v-for="(info,index) in checkinInfo" :key=index @click="deleteGuest"
 				:name="index" :disabled="index ===0">
 				<u-form labelPosition="left" labelWidth="180rpx" labelAlign="center">
 					<u-form-item label="姓名" prop="name">
@@ -177,7 +177,7 @@
 				//小程序创建的订单,先在后台创建订单,创建成功后跳转至支付页面
 				if (this.order.orderSource === 'MINI_APP') {
 					if (!this.order.orderId) {
-						let createOrderRes = await uni.$http.post('/hotelOrder', this.order)
+						let createOrderRes = await uni.$http.post('/order', this.order)
 						if (createOrderRes.data.code !== 200) {
 							uni.$showMsg('订单创建失败,请重试')
 							return
@@ -202,11 +202,9 @@
 				console.log("pay start");
 
 				// #ifdef MP-WEIXIN
-				let res = await uni.$http.post('/hotelOrder/payment', {
+				let res = await uni.$http.post('/order/payment/weChat', {
 					openid: this.userInfo.openid,
 					orderId: this.order.orderId,
-					platform: 'WECHAT',
-					hotelId: this.currentHotel.hotelId
 				})
 				if (res.data.code == 200) {
 					res.data.data.package = res.data.data.packageStr
@@ -220,7 +218,7 @@
 							})
 						}
 					} catch {
-						uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
+						uni.$http.post(`/order/cancelPayment/${this.order.id}`)
 					}
 				} else {
 					//小程序创建的订单跳转至选择房间,pms预订单跳转至查询订单
@@ -438,15 +436,13 @@
 			// #endif
 		},
 		async onLoad() {
-			let res = await uni.$http.post('/roomType', {
-				roomType: this.order.roomType,
-				hotelId: this.currentHotel.hotelId,
-				pageNo: 1,
-				pageSize: 999
+			let res = await uni.$http.post(`/hotel/roomType`, {
+				hotelId: this.order.hotelId,
+				roomType: this.order.roomType
 			})
-			this.roomPicPath = IMG_BASE_URL + '/' + res.data.data.records[0].roomPicPath
-			this.roomTypeName = res.data.data.records[0].roomTypeName
-			this.unitPrice = res.data.data.records[0].unitPrice
+			this.roomPicPath = IMG_BASE_URL + '/' + res.data.data.roomPicPath
+			this.roomTypeName = res.data.data.roomTypeName
+			this.unitPrice = res.data.data.unitPrice
 			this.startDate = moment(new Date(this.order.startTime)).format('MM月DD日')
 			this.startDay = getDay(new Date(this.order.startTime).getDay())
 			this.endDate = moment(new Date(this.order.endTime)).format('MM月DD日')

+ 2 - 6
subpkg_checkin/queryOrder/queryOrder.vue

@@ -52,16 +52,12 @@
 					return
 				}
 
-				let res = await uni.$http.post('/hotelOrder/queryByCondition', {
+				let res = await uni.$http.post('/order/reservation', {
 					name: this.name,
 					phone: this.phone,
 					hotelId: this.currentHotel.hotelId,
-					deleted: false,
-					status: 'ROOM_SELECTED',
-					outDated: false,
-					orderSource: 'PMS_GREEN_CLOUD',
 					pageNo: 1,
-					pageSize: 99
+					pageSize: 10
 				})
 
 				this.orderList = res.data.data.records

+ 2 - 4
subpkg_checkin/queryOrderResult/queryOrderResult.vue

@@ -10,14 +10,13 @@
 		</view>
 		<view class="order-item" v-for="(order,index) in orderList" @click="gotoSelectRoom(index)" :key="index">
 			<view class="order-item-top">
-				<u-text :text="order.roomTypeName" color="#333333" bold size="18"></u-text>
+				<u-text :text="order.roomTypeName+order.room" color="#333333" bold size="18"></u-text>
 				<view class="order-item-top-right">
 					<u-text :text="order.status" color="#A5B6F1" align="center"></u-text>
 				</view>
 			</view>
 			<u-text :text="order.orderId"></u-text>
 			<u-text :text="order.createTime"></u-text>
-			<u-text :text="order.room"></u-text>
 			<u-text :text="order.duration"></u-text>
 			<view class="payment-info">
 				<view class="">
@@ -73,8 +72,7 @@
 				order.paymentStatus = this.paymentStatus[order.paymentStatus] + ':'
 				order.status = '待入住'
 				order.orderId = '订单号:' + order.orderId
-				order.createTime = '订单创建时间:' + moment(order.createTime).format('YYYY/MM/DD hh:mm:ss')
-				order.room = '房间号:' + order.room
+				order.createTime = '订单创建时间:' + moment(order.createTime).format('YYYY/MM/DD HH:mm:ss')
 				order.duration = moment(order.startTime).format('YYYY-MM-DD') + '至' + moment(order.endTime).format(
 					'YYYY-MM-DD')
 				order.price = '¥' + order.price

+ 8 - 23
subpkg_checkin/selectRoom/selectRoom.vue

@@ -11,15 +11,9 @@
 		<u-modal :show="modalShow" :title="modalTitle" :showCancelButton="true" @confirm="confirmSelectRoom"
 			@cancel="modalShow=false"></u-modal>
 		<view class="select-room">
-			<view class="room-item" v-for="item in roomList" :key=item.room @click="select(item)" id="item.room"
-				:style="{'background':' #'+item.color}">
+			<view class="room-item" v-for="(item,index) in roomList" :key=item.room @click="select(item)">
 				<view class="room-item-inner">
-					<view>
-						<text>{{item.room}}</text>
-					</view>
-					<view>
-						<text>({{item.text}})</text>
-					</view>
+					<text>{{item.room}}</text>
 				</view>
 			</view>
 		</view>
@@ -53,24 +47,15 @@
 		methods: {
 			...mapMutations('m_business', ['updateOrder']),
 			async getRoomInfo() {
-				let res = await uni.$http.post('/roomInfo', {
+				let res = await uni.$http.post('/hotel/room', {
 					hotelId: this.currentHotel.hotelId,
 					roomType: this.roomType,
 					startTime: this.order.startTime,
 					endTime: this.order.endTime,
 					pageNo: 1,
-					pageSize: 999
+					pageSize: 10
 				})
 				this.roomList = res.data.data.records
-				this.roomList?.forEach(info => {
-					if (info.isAvail == true && info.isResv == false && info.status == 0) {
-						info.text = '可选'
-						info.color = 'a09cc4'
-					} else {
-						info.text = '不可预订'
-						info.color = '999999'
-					}
-				})
 			},
 			select(item) {
 				if (item.text === '不可预订') {
@@ -151,11 +136,11 @@
 					margin: 10rpx 10rpx;
 					text-align: center;
 					color: #FFFFFF;
+					background-color: #a09cc4;
 					border-radius: 15rpx;
-
-					.room-item-inner {
-						margin-top: 40rpx;
-					}
+					display: flex;
+					justify-content: center;
+					align-items: center;
 				}
 			}
 		}

+ 2 - 8
subpkg_checkin/selectRoomType/selectRoomType.vue

@@ -108,8 +108,6 @@
 					startTime: startTime,
 					endTime: endTime,
 					dayNum: this.dayNum,
-					status: 'ORDER_PLACED',
-					paymentStatus: 'UNPAID',
 					createHotelOrderReason: 'CHECKIN',
 					orderSource: 'MINI_APP'
 				})
@@ -118,12 +116,8 @@
 				});
 			},
 			async getRoomTypeList() {
-				let res = await uni.$http.post('/roomType', {
-					hotelId: this.currentHotel.hotelId,
-					pageNo: 1,
-					pageSize: 999
-				})
-				this.roomTypeList = res.data.data.records
+				let res = await uni.$http.get(`/hotel/${this.currentHotel.hotelId}/roomType`)
+				this.roomTypeList = res.data.data
 				this.roomTypeList.forEach((item) => {
 					item.roomPicPath = IMG_BASE_URL + '/' + item.roomPicPath
 				})