updated
This commit is contained in:
@@ -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){
|
||||
|
||||
@@ -560,6 +560,7 @@
|
||||
RoomType: allRoomType,
|
||||
StartDate: dateRange.startDate,
|
||||
EndDate: dateRange.endDate,
|
||||
category: this.currentProperty.category,
|
||||
};
|
||||
},
|
||||
getUniqueCodes(codes) {
|
||||
|
||||
@@ -139,10 +139,10 @@
|
||||
<!-- <view class="hz-font-bolder hz-font-lg" >{{ handleShowWhenScreenshot(bookingData.eta) }}</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 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>
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
"common.alterSharerExist": "該客人已添加",
|
||||
"common.alterSharerLimit": "同住人限制",
|
||||
"common.errorMsg": "錯誤信息",
|
||||
"common.misCharge":"雜項費用",
|
||||
"common.goBack": "返回",
|
||||
"common.back": "返回",
|
||||
"common.language": "語言",
|
||||
|
||||
@@ -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!==''){
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user