This commit is contained in:
Mauve
2026-10-26 09:33:21 +08:00
parent 3f8930df4c
commit 0338dfb427
7 changed files with 39 additions and 10 deletions
+27 -3
View File
@@ -437,6 +437,10 @@
showWhenScreenshot: true, showWhenScreenshot: true,
opt: '', opt: '',
isDaylight:false, isDaylight:false,
// 仅点击 extension 时刷新一次,拿到 expDate;后续不再重复触发
hasExtendedRefresh:false,
// 缓存上一次刷新获取的 expDate,非刷新调用时用它避免被 db 缓存覆盖
cachedExpDate:null,
} }
}, },
onLoad(opt) { onLoad(opt) {
@@ -557,7 +561,7 @@
return this.showWhenScreenshot ? data : "-"; return this.showWhenScreenshot ? data : "-";
}, },
// 數據方法 // 數據方法
async getBookingByConf(conf,id){ async getBookingByConf(conf,id,isRefresh=false){
uni.showLoading({ uni.showLoading({
title: this.$t("common.loading") title: this.$t("common.loading")
}); });
@@ -565,6 +569,7 @@
try{ try{
let params = {}; let params = {};
params.conf = conf; params.conf = conf;
params.refresh = isRefresh;
requestBody = JSON.stringify(params); requestBody = JSON.stringify(params);
const res = await getBookingByConf(params); const res = await getBookingByConf(params);
if(res!=null && res.success==true){ if(res!=null && res.success==true){
@@ -591,6 +596,14 @@
}else{ }else{
this.bookingData = res.data[0]; 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){ if(this.bookingData.requestedCoDate!=null){
let ciDate = this.bookingData.checkoutDate; let ciDate = this.bookingData.checkoutDate;
let coDatge = dayjs(this.bookingData.requestedCoDate).format("YYYY-MM-DD"); let coDatge = dayjs(this.bookingData.requestedCoDate).format("YYYY-MM-DD");
@@ -907,6 +920,10 @@
this.showMsg = true; this.showMsg = true;
return; return;
} }
// 仅用户点击 extension 时刷新一次以拿回 expDate,之后不再重复触发
if(!this.hasExtendedRefresh && this.opt && this.opt.conf){
await this.getBookingByConf(this.opt.conf, this.opt.id, true);
}
await this.buildCalendar(); await this.buildCalendar();
this.showCalendar = true; this.showCalendar = true;
}, },
@@ -1023,11 +1040,18 @@
this.getBooking(this.opt); this.getBooking(this.opt);
}else{ }else{
this.iconPath = '../../static/images/ico_err.png'; 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.showMsgBox = true;
this.showETAMsg = false; this.showETAMsg = false;
this.showMisChargeMsg = 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){ }catch(e){
@@ -560,6 +560,7 @@
RoomType: allRoomType, RoomType: allRoomType,
StartDate: dateRange.startDate, StartDate: dateRange.startDate,
EndDate: dateRange.endDate, EndDate: dateRange.endDate,
category: this.currentProperty.category,
}; };
}, },
getUniqueCodes(codes) { getUniqueCodes(codes) {
+2 -2
View File
@@ -139,10 +139,10 @@
<!-- <view class="hz-font-bolder hz-font-lg" >{{ handleShowWhenScreenshot(bookingData.eta) }}</view> --> <!-- <view class="hz-font-bolder hz-font-lg" >{{ handleShowWhenScreenshot(bookingData.eta) }}</view> -->
</view> </view>
</view> </view>
<view v-if="bookingData.mischarge!=null" class="hz-flex-row"> <view v-if="bookingData.miscCharge!=null" class="hz-flex-row">
<view style="width:100%"> <view style="width:100%">
<view class="hz-font-color-black hz-font-sm">{{ $t("common.misCharge") }}</view> <view class="hz-font-color-black hz-font-sm">{{ $t("common.misCharge") }}</view>
<view class="hz-font-bolder hz-font-lg">{{ bookingData.mischarge || "-" }}</view> <view class="hz-font-bolder hz-font-lg">{{ bookingData.miscCharge || "-" }}</view>
</view> </view>
</view> </view>
</view> </view>
+2 -2
View File
@@ -4,13 +4,13 @@ class config {
// this.internalUrl = 'https://localhost:9086'; // this.internalUrl = 'https://localhost:9086';
// mgm web DEV // mgm web DEV
// this.internalUrl = 'https://localhost'; this.internalUrl = 'https://localhost';
// willtech DEV // willtech DEV
// this.internalUrl = 'https://47.238.46.81'; // this.internalUrl = 'https://47.238.46.81';
// MGM APP DEV // MGM APP DEV
this.internalUrl = 'https://dlahcadev.mcmsapoc.com'; // this.internalUrl = 'https://dlahcadev.mcmsapoc.com';
//this.version = "beta 2.0"; //this.version = "beta 2.0";
//ali ECS //ali ECS
-1
View File
@@ -44,7 +44,6 @@
"common.alterSharerExist": "該客人已添加", "common.alterSharerExist": "該客人已添加",
"common.alterSharerLimit": "同住人限制", "common.alterSharerLimit": "同住人限制",
"common.errorMsg": "錯誤信息", "common.errorMsg": "錯誤信息",
"common.misCharge":"雜項費用",
"common.goBack": "返回", "common.goBack": "返回",
"common.back": "返回", "common.back": "返回",
"common.language": "語言", "common.language": "語言",
+4 -1
View File
@@ -306,7 +306,7 @@
if(res.success === true){ if(res.success === true){
if(res !== null){ if(res !== null){
uni.setStorageSync("idToken",res.idToken); uni.setStorageSync("idToken",res.idToken);
uni.setStorageSync("token",res.token); uni.setStorageSync("token",res.accessToken);
uni.setStorageSync("userData",res.userData); uni.setStorageSync("userData",res.userData);
uni.setStorageSync("clientId",res.clientId); uni.setStorageSync("clientId",res.clientId);
uni.setStorageSync("timeOut",dayjs().add(30,'day').unix()); uni.setStorageSync("timeOut",dayjs().add(30,'day').unix());
@@ -345,6 +345,9 @@
await this.getSetting(); await this.getSetting();
const userData = uni.getStorageSync("userData"); const userData = uni.getStorageSync("userData");
// this.siteData.mockSSO = true;
let loginTag = false; let loginTag = false;
uni.setStorageSync("todoSwitch","true"); uni.setStorageSync("todoSwitch","true");
if(userData!==undefined && userData!==null && userData!==''){ if(userData!==undefined && userData!==null && userData!==''){
+2
View File
@@ -462,6 +462,7 @@
RoomType: allRoomType, RoomType: allRoomType,
StartDate: dateRange.startDate, StartDate: dateRange.startDate,
EndDate: dateRange.endDate, EndDate: dateRange.endDate,
category: this.currentProperty.category,
}; };
const res = await requestRoomCalendar(params, this.getCalendarRequestConfig(requestId)); const res = await requestRoomCalendar(params, this.getCalendarRequestConfig(requestId));
if (!this.isLatestCalendarRequest(requestId)) return; if (!this.isLatestCalendarRequest(requestId)) return;
@@ -548,6 +549,7 @@
RoomType: allRoomType, RoomType: allRoomType,
StartDate: dateRange.startDate, StartDate: dateRange.startDate,
EndDate: dateRange.endDate, EndDate: dateRange.endDate,
category: this.currentProperty.category,
}; };
}, },
getUniqueCodes(codes) { getUniqueCodes(codes) {