|
@@ -1,41 +1,71 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <swiper class="swiper" circular autoplay :interval="5000">
|
|
|
- <swiper-item
|
|
|
- v-for="item in bannerList"
|
|
|
- :key="item.id"
|
|
|
- class="swiper-item"
|
|
|
- >
|
|
|
- <image :src="item.imgUrlsAfterConvert[0]" mode="aspectFill" />
|
|
|
- </swiper-item>
|
|
|
- </swiper>
|
|
|
+ <div class="flex flex-col h-screen-reduced">
|
|
|
+ <HomeBanner class="h-250 shrink" />
|
|
|
+ <div
|
|
|
+ class="z-[999] flex-1 flex overflow-auto pt-20 -mt-15 bg-white rounded-t-2xl"
|
|
|
+ >
|
|
|
+ <TravelFirstLevelDirectoryMenu
|
|
|
+ class="shrink"
|
|
|
+ @change="handleMenuChange"
|
|
|
+ />
|
|
|
+ <div class="flex-1 pt-10 flex flex-col">
|
|
|
+ <div class="text-black-3 pl-10 text-base font-semibold shrink">
|
|
|
+ 热门目的地
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="flex flex-wrap px-10 items-start gap-x-10 gap-y-15 mt-15 pb-30 flex-1 content-start overflow-auto"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ v-for="item in rightData"
|
|
|
+ :key="item"
|
|
|
+ :to="`/travel/${item.id}?menuName=${item.menuName}`"
|
|
|
+ class="flex flex-1 flex-col w-83 aspect-1 space-y-8 art items-center"
|
|
|
+ >
|
|
|
+ <image
|
|
|
+ :src="
|
|
|
+ item.hotPictureUrlsAfterConvert?.length
|
|
|
+ ? item.hotPictureUrlsAfterConvert[0]
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ mode="widthFix"
|
|
|
+ class="aspect-[84/63] h-62 w-full object-cover rounded-lg overflow-hidden"
|
|
|
+ />
|
|
|
+ <span class="text-sm text-black-3 truncate">{{
|
|
|
+ item.menuName
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {
|
|
|
- getBannerList,
|
|
|
-} from "@/api/common";
|
|
|
+import HomeBanner from '../../components/Home/Banner.vue';
|
|
|
+import TravelFirstLevelDirectoryMenu from '../../components/Travel/FirstLevelDirectoryMenu/index.vue';
|
|
|
+import { getDirectoryList } from '@/api/common';
|
|
|
|
|
|
-const bannerList = ref([]);
|
|
|
-async function requestBannerList() {
|
|
|
- const { data } = await getBannerList({ belongTab: 10 });
|
|
|
- bannerList.value = data.dataList;
|
|
|
+function handleMenuChange(menu) {
|
|
|
+ getRightData(menu.id);
|
|
|
}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
- requestBannerList();
|
|
|
+const rightData = ref([]);
|
|
|
+
|
|
|
+async function getRightData(id) {
|
|
|
+ const { data } = await getDirectoryList({
|
|
|
+ parentId: id ?? '',
|
|
|
+ isAll: !id ? 1 : 0,
|
|
|
+ });
|
|
|
+ rightData.value = data.dataList;
|
|
|
+}
|
|
|
+
|
|
|
+onLoad((option) => {
|
|
|
+ getRightData(option.parentId);
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.swiper {
|
|
|
- height: 500rpx;
|
|
|
- .swiper-item {
|
|
|
- height: 100%;
|
|
|
- image {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- }
|
|
|
-}</style>
|
|
|
+.h-screen-reduced {
|
|
|
+ height: calc(100vh - 50px);
|
|
|
+}
|
|
|
+</style>
|