2 Commits b1f32c7ca8 ... 5864e583c5

Author SHA1 Message Date
  LiChengjin 5864e583c5 opt:登陆后若没有酒店信息则默认选择查询到的第一家酒店 3 weeks ago
  LiChengjin 1abd6db1df opt:退出登录后不再删除酒店信息 3 weeks ago
2 changed files with 10 additions and 9 deletions
  1. 9 8
      pages/login/login.vue
  2. 1 1
      pages/my/my.vue

+ 9 - 8
pages/login/login.vue

@@ -244,16 +244,15 @@
 				if (this.hotelId) {
 				if (this.hotelId) {
 					await this.setHotel(this.hotelId)
 					await this.setHotel(this.hotelId)
 				}
 				}
-				//当前用户没设置身份证号则跳转
-				if (this.currentHotel && this.currentHotel != {}) {
-					uni.switchTab({
-						url: '/pages/home/home'
-					})
-				} else {
-					uni.reLaunch({
-						url: '/subpkg/chooseHotel/chooseHotel?source=home'
+				if (!(this.currentHotel && JSON.stringify(this.currentHotel) != '{}')) {
+					let res = await uni.$http.post('/hotel/available', {
+						appId: this.appId
 					})
 					})
+					this.updateCurrentHotel(res.data.data[0])
 				}
 				}
+				uni.switchTab({
+					url: '/pages/home/home'
+				})
 			},
 			},
 			async getVerificationCode() {
 			async getVerificationCode() {
 				var pattern = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
 				var pattern = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
@@ -288,6 +287,8 @@
 			},
 			},
 		},
 		},
 		async onLoad(query) {
 		async onLoad(query) {
+			const {miniProgram: {appId}} = uni.getAccountInfoSync();
+			this.appId = appId
 			// #ifdef MP-WEIXIN
 			// #ifdef MP-WEIXIN
 			//二维码扫描时传入hotelId
 			//二维码扫描时传入hotelId
 			if (query.q !== null && query.q !== undefined) {
 			if (query.q !== null && query.q !== undefined) {

+ 1 - 1
pages/my/my.vue

@@ -131,7 +131,7 @@
 					name: ''
 					name: ''
 				})
 				})
 				this.updateToken('')
 				this.updateToken('')
-				this.updateCurrentHotel({})
+				// this.updateCurrentHotel({})
 				this.updateIdCardInfo([])
 				this.updateIdCardInfo([])
 
 
 				uni.redirectTo({
 				uni.redirectTo({