diff --git a/src/pages-quick/components/Tabs/index.vue b/src/pages-quick/components/Tabs/index.vue
index 65f1c51..ffc4d5d 100644
--- a/src/pages-quick/components/Tabs/index.vue
+++ b/src/pages-quick/components/Tabs/index.vue
@@ -10,14 +10,24 @@
]"
@click="handleTabClick(index)"
>
-
- {{ item.label }}
-
+
+
+ {{ zniconsMap[item.icon] }}
+
+
+ {{ item.label }}
+
+
@@ -45,6 +55,7 @@ import {
watch,
getCurrentInstance,
} from "vue";
+import { zniconsMap } from "@/static/fonts/znicons";
// 获取组件实例
const instance = getCurrentInstance();
@@ -54,10 +65,10 @@ const props = defineProps({
tabs: {
type: Array,
default: () => [
- { label: "客房", value: "0" },
- { label: "门票", value: "1" },
- { label: "餐食", value: "2" },
- { label: "套餐", value: "3" },
+ { label: "客房", value: "0", icon: "zn-nav-room" },
+ { label: "门票", value: "1", icon: "zn-nav-ticket" },
+ { label: "餐食", value: "2", icon: "zn-nav-meal" },
+ // { label: "套餐", value: "3", icon: "zn-package" },
],
},
defaultActive: {
diff --git a/src/pages-quick/components/Tabs/styles/index.scss b/src/pages-quick/components/Tabs/styles/index.scss
index b84aea7..304979d 100644
--- a/src/pages-quick/components/Tabs/styles/index.scss
+++ b/src/pages-quick/components/Tabs/styles/index.scss
@@ -7,6 +7,11 @@
height: 100%;
}
+.icon {
+ height: 20px;
+ width: 20px;
+}
+
.tab-item-active {
&::before {
content: "";
diff --git a/src/pages-quick/list.vue b/src/pages-quick/list.vue
index 66bac5b..598165e 100644
--- a/src/pages-quick/list.vue
+++ b/src/pages-quick/list.vue
@@ -10,42 +10,44 @@
>
-
-
-
-
-
- 入住
-
- {{ DateUtils.formatDate() }}
-
-
+
-
-
- {{ 1 }}晚
+
+
+
+ 入住
+
+ {{ selectedDate.startDate }}
-
-
- 离店
-
- {{ DateUtils.formatDate() }}
-
-
-
-
-
-
+
+
+
+ {{ selectedDate.totalDays }}晚
+
+
+
+ 离店
+
+ {{ selectedDate.endDate }}
+
+
+
+
+
+
@@ -54,10 +56,10 @@
@@ -71,9 +73,15 @@ import { quickBookingComponent } from "@/request/api/MainPageDataApi";
import { DateUtils } from "@/utils";
const calendarVisible = ref(false);
-const selectedDate = ref("");
+const selectedDate = ref({
+ startDate: DateUtils.formatDate(), // 当天日期
+ endDate: DateUtils.formatDate(new Date(Date.now() + 24 * 60 * 60 * 1000)), // 第二天日期
+ totalDays: 1,
+});
const dataList = ref([]);
+const commodityGroupDTOList = ref([]);
const paging = ref(null);
+const currentType = ref("0"); // 当前选中类型
const queryList = async (pageNum = 1, pageSize = 10) => {
try {
@@ -81,6 +89,7 @@ const queryList = async (pageNum = 1, pageSize = 10) => {
console.log("API响应:", res.data.commodityGroupDTOList);
if (res && res.data && res.data.commodityGroupDTOList) {
+ commodityGroupDTOList.value = res.data.commodityGroupDTOList;
const records = res.data.commodityGroupDTOList[0].commodityList;
// 完成数据加载,第二个参数表示是否还有更多数据
@@ -96,7 +105,17 @@ const queryList = async (pageNum = 1, pageSize = 10) => {
}
};
-const handleTabChange = ({ index, item }) => {};
+const handleTabChange = ({ item }) => {
+ console.log("item", item.value);
+ currentType.value = item.value;
+ // 从列表中找到对应的商品列表
+ const { commodityList } =
+ commodityGroupDTOList.value.find(
+ (i) => i.commodityTypeCode === item.value
+ ) || {};
+ dataList.value = commodityList || [];
+ paging.value.complete(commodityList);
+};
// 处理日历关闭
const handleCalendarClose = () => {
@@ -105,9 +124,9 @@ const handleCalendarClose = () => {
// 处理日期选择
const handleDateSelect = (data) => {
- selectedDate.value = data.date;
+ selectedDate.value = data;
calendarVisible.value = false;
- console.log("选择的日期:", data.date);
+ console.log("选择的日期:", data);
};