feat: 快速预定的处理
This commit is contained in:
@@ -4,16 +4,16 @@
|
||||
<template #top>
|
||||
<TopNavBar title="快速预定" :background="$theme-color-100" />
|
||||
|
||||
<Tabs @change="handleTabChange" />
|
||||
<Tabs @change="handleTabChange"/>
|
||||
|
||||
<!-- 选择入住、离店日期 0:是酒店 -->
|
||||
<view v-if="currentType === '0' && dataList.length > 0" class="bg-white border-box flex flex-items-center p-12">
|
||||
<view v-if="didSelectedTabItem && didSelectedTabItem.orderType === 0" class="bg-white border-box flex flex-items-center p-12">
|
||||
<view class="in flex flex-items-center">
|
||||
<text class="font-size-11 font-500 color-99A0AE mr-4">入住</text>
|
||||
<text class="font-size-14 font-500 color-171717">
|
||||
{{ selectedDate.startDate }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 几晚 -->
|
||||
<text class="nights bg-E5E8EE border-box font-size-11 font-500 color-525866 rounded-50 ml-8 mr-8">
|
||||
@@ -57,17 +57,22 @@ const selectedDate = ref({
|
||||
});
|
||||
const dataList = ref([]);
|
||||
const paging = ref(null);
|
||||
const currentType = ref("0"); // 当前选中类型
|
||||
// 当前选中项
|
||||
const didSelectedTabItem = ref(null);
|
||||
|
||||
const queryList = async (pageNum = 1, pageSize = 10) => {
|
||||
if (!didSelectedTabItem.value) {
|
||||
paging.value.complete([]);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const params = {
|
||||
commodityTypeCode: currentType.value,
|
||||
commodityTypeCode: didSelectedTabItem.value.typeCode,
|
||||
size: pageSize,
|
||||
current: pageNum,
|
||||
};
|
||||
|
||||
if (currentType.value === "0") {
|
||||
if (didSelectedTabItem.value.orderType === 0) {
|
||||
params.checkInDate = selectedDate.value.startDate;
|
||||
params.checkOutDate = selectedDate.value.endDate;
|
||||
}
|
||||
@@ -92,12 +97,8 @@ const queryList = async (pageNum = 1, pageSize = 10) => {
|
||||
};
|
||||
|
||||
const handleTabChange = ({ item }) => {
|
||||
console.log("item typeCode: ", item.typeCode);
|
||||
currentType.value = item.typeCode;
|
||||
|
||||
if (currentType.value === "0") {
|
||||
}
|
||||
|
||||
console.log("选中的tab item: ", item);
|
||||
didSelectedTabItem.value = item;
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user