merge limo to daylight
This commit is contained in:
@@ -165,13 +165,11 @@
|
||||
propertyTabItemStyle() {
|
||||
return {
|
||||
height: '78rpx',
|
||||
padding: '0 24rpx',
|
||||
flexShrink: 0,
|
||||
padding: '0',
|
||||
};
|
||||
},
|
||||
propertyTabActiveStyle() {
|
||||
return {
|
||||
whiteSpace: 'nowrap',
|
||||
color: '#C39A4B',
|
||||
fontFamily: 'Inter-Bold',
|
||||
fontSize: '30rpx',
|
||||
@@ -180,7 +178,6 @@
|
||||
},
|
||||
propertyTabInactiveStyle() {
|
||||
return {
|
||||
whiteSpace: 'nowrap',
|
||||
color: '#111111',
|
||||
fontFamily: 'Inter-Bold',
|
||||
fontSize: '30rpx',
|
||||
@@ -197,12 +194,6 @@
|
||||
this.title = this.$t("roomCalendar.title");
|
||||
this.userData = uni.getStorageSync("userData");
|
||||
this.showTabbarByPermission(this.userData);
|
||||
if (!this.userData || this.userData.canViewCalendar !== true) {
|
||||
this.calendarNoPermission = true;
|
||||
this.calendarReady = false;
|
||||
return;
|
||||
}
|
||||
this.calendarNoPermission = false;
|
||||
this.loadPropertiesRoomTypes();
|
||||
},
|
||||
onUnload() {
|
||||
@@ -211,10 +202,6 @@
|
||||
},
|
||||
methods: {
|
||||
async loadPropertiesRoomTypes() {
|
||||
if (!this.userData || this.userData.canViewCalendar !== true) {
|
||||
this.showCalendarNoPermission();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.calendarReady = false;
|
||||
uni.showLoading({
|
||||
@@ -222,19 +209,14 @@
|
||||
});
|
||||
await this.loadCalendarSetting();
|
||||
const res = await getPropertiesRoomTypes({});
|
||||
if (this.isNoPermissionResponse(res)) {
|
||||
this.showCalendarNoPermission();
|
||||
return;
|
||||
}
|
||||
this.propertyList = Array.isArray(res && res.propertyList) ? res.propertyList : [];
|
||||
if (!this.propertyList.length) throw new Error('No calendar properties configured');
|
||||
this.propertyList = res.propertyList;
|
||||
this.selectedPropertyCode = this.propertyList[0].code;
|
||||
this.selectDefaultOptions();
|
||||
this.buildCalendar();
|
||||
await this.loadAvailabilityData();
|
||||
this.calendarRenderKey += 1;
|
||||
this.$nextTick(() => {
|
||||
this.calendarReady = !this.calendarNoPermission;
|
||||
this.calendarReady = true;
|
||||
});
|
||||
} catch (e) {
|
||||
uni.$u.toast(e.message || e.errMsg || 'Load property room types failed');
|
||||
@@ -437,7 +419,6 @@
|
||||
}));
|
||||
},
|
||||
refreshCalendar() {
|
||||
if (!this.userData || this.userData.canViewCalendar !== true || this.calendarNoPermission) return;
|
||||
this.ensureSelectedOptionsForRefresh(true);
|
||||
this.loadAvailabilityData();
|
||||
},
|
||||
@@ -520,7 +501,7 @@
|
||||
});
|
||||
},
|
||||
isNoPermissionResponse(res) {
|
||||
return res && res.success === false && (res.errorCode || res.code) === 'NO_PERMISSION';
|
||||
return res && res.success === false && res.errorCode === 'NO_PERMISSION';
|
||||
},
|
||||
showCalendarNoPermission() {
|
||||
this.availabilityMap = {};
|
||||
|
||||
Reference in New Issue
Block a user