diff --git a/booking/bookingDetail/bookingDetail.vue b/booking/bookingDetail/bookingDetail.vue index 1032860..db9f49e 100644 --- a/booking/bookingDetail/bookingDetail.vue +++ b/booking/bookingDetail/bookingDetail.vue @@ -437,6 +437,10 @@ showWhenScreenshot: true, opt: '', isDaylight:false, + // 仅点击 extension 时刷新一次,拿到 expDate;后续不再重复触发 + hasExtendedRefresh:false, + // 缓存上一次刷新获取的 expDate,非刷新调用时用它避免被 db 缓存覆盖 + cachedExpDate:null, } }, onLoad(opt) { @@ -557,7 +561,7 @@ return this.showWhenScreenshot ? data : "-"; }, // 數據方法 - async getBookingByConf(conf,id){ + async getBookingByConf(conf,id,isRefresh=false){ uni.showLoading({ title: this.$t("common.loading") }); @@ -565,6 +569,7 @@ try{ let params = {}; params.conf = conf; + params.refresh = isRefresh; requestBody = JSON.stringify(params); const res = await getBookingByConf(params); if(res!=null && res.success==true){ @@ -591,6 +596,14 @@ }else{ this.bookingData = res.data[0]; } + // 只有 isRefresh=true 时后端才返回 expDate; + // 非刷新调用需保留上一次刷新拿到的 expDate,避免被 db 缓存覆盖 + if(isRefresh){ + this.cachedExpDate = this.bookingData.expDate; + this.hasExtendedRefresh = true; + }else if(this.bookingData.expDate==null || this.bookingData.expDate==''){ + this.bookingData.expDate = this.cachedExpDate; + } if(this.bookingData.requestedCoDate!=null){ let ciDate = this.bookingData.checkoutDate; let coDatge = dayjs(this.bookingData.requestedCoDate).format("YYYY-MM-DD"); @@ -907,6 +920,10 @@ this.showMsg = true; return; } + // 仅用户点击 extension 时刷新一次以拿回 expDate,之后不再重复触发 + if(!this.hasExtendedRefresh && this.opt && this.opt.conf){ + await this.getBookingByConf(this.opt.conf, this.opt.id, true); + } await this.buildCalendar(); this.showCalendar = true; }, @@ -1023,11 +1040,18 @@ this.getBooking(this.opt); }else{ this.iconPath = '../../static/images/ico_err.png'; - this.popMsgStr = this.$t("bookingDetail.changeMiscChargeFail"); + let popStr = res.message != null ? ("\n" + res.message) : ""; + this.popMsgStr = this.$t("bookingDetail.changeMisChargeFail") + popStr; this.showMsgBox = true; this.showETAMsg = false; - this.showMisChargeMsg = false; + + if (popStr != '') { + const amountMatch = popStr.match(/Amount cannot be less than original:\s*(\d+(?:\.\d+)?)\s*$/); + if (amountMatch) { + this.bookingData.miscCharge = Number(amountMatch[1]); + } + } } }catch(e){ @@ -2088,4 +2112,4 @@ .font-m{ font-size: 15px; } - \ No newline at end of file + diff --git a/booking/playerRoomCalendar/playerRoomCalendar.vue b/booking/playerRoomCalendar/playerRoomCalendar.vue index b4fc5ff..c3b1495 100644 --- a/booking/playerRoomCalendar/playerRoomCalendar.vue +++ b/booking/playerRoomCalendar/playerRoomCalendar.vue @@ -560,6 +560,7 @@ RoomType: allRoomType, StartDate: dateRange.startDate, EndDate: dateRange.endDate, + category: this.currentProperty.category, }; }, getUniqueCodes(codes) { diff --git a/booking/submitBooking/submitBooking.vue b/booking/submitBooking/submitBooking.vue index 76749a0..7e2fae6 100644 --- a/booking/submitBooking/submitBooking.vue +++ b/booking/submitBooking/submitBooking.vue @@ -139,10 +139,10 @@ - + {{ $t("common.misCharge") }} - {{ bookingData.mischarge || "-" }} + {{ bookingData.miscCharge || "-" }} diff --git a/common/config.js b/common/config.js index 18184c2..43b61d2 100644 --- a/common/config.js +++ b/common/config.js @@ -4,13 +4,13 @@ class config { // this.internalUrl = 'https://localhost:9086'; // mgm web DEV - // this.internalUrl = 'https://localhost'; + this.internalUrl = 'https://localhost'; // willtech DEV // this.internalUrl = 'https://47.238.46.81'; // MGM APP DEV - this.internalUrl = 'https://dlahcadev.mcmsapoc.com'; + // this.internalUrl = 'https://dlahcadev.mcmsapoc.com'; //this.version = "beta 2.0"; //ali ECS diff --git a/locale/zh-Hant.json b/locale/zh-Hant.json index 0eaa6e2..a40293f 100644 --- a/locale/zh-Hant.json +++ b/locale/zh-Hant.json @@ -44,7 +44,6 @@ "common.alterSharerExist": "該客人已添加", "common.alterSharerLimit": "同住人限制", "common.errorMsg": "錯誤信息", - "common.misCharge":"雜項費用", "common.goBack": "返回", "common.back": "返回", "common.language": "語言", diff --git a/pages/login/login.vue b/pages/login/login.vue index afe43db..2dadb4b 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -306,7 +306,7 @@ if(res.success === true){ if(res !== null){ uni.setStorageSync("idToken",res.idToken); - uni.setStorageSync("token",res.token); + uni.setStorageSync("token",res.accessToken); uni.setStorageSync("userData",res.userData); uni.setStorageSync("clientId",res.clientId); uni.setStorageSync("timeOut",dayjs().add(30,'day').unix()); @@ -345,6 +345,9 @@ await this.getSetting(); const userData = uni.getStorageSync("userData"); + + // this.siteData.mockSSO = true; + let loginTag = false; uni.setStorageSync("todoSwitch","true"); if(userData!==undefined && userData!==null && userData!==''){ diff --git a/pages/roomCalendar/roomCalendar.vue b/pages/roomCalendar/roomCalendar.vue index 12636f0..2c8c2cd 100644 --- a/pages/roomCalendar/roomCalendar.vue +++ b/pages/roomCalendar/roomCalendar.vue @@ -462,6 +462,7 @@ RoomType: allRoomType, StartDate: dateRange.startDate, EndDate: dateRange.endDate, + category: this.currentProperty.category, }; const res = await requestRoomCalendar(params, this.getCalendarRequestConfig(requestId)); if (!this.isLatestCalendarRequest(requestId)) return; @@ -548,6 +549,7 @@ RoomType: allRoomType, StartDate: dateRange.startDate, EndDate: dateRange.endDate, + category: this.currentProperty.category, }; }, getUniqueCodes(codes) {