|
@@ -2,14 +2,19 @@
|
|
<div class="main">
|
|
<div class="main">
|
|
<div class="content">
|
|
<div class="content">
|
|
<sub-header />
|
|
<sub-header />
|
|
|
|
+
|
|
<div class="left">
|
|
<div class="left">
|
|
- <n-tabs type="line" pane-class="tab-content">
|
|
|
|
|
|
+ <n-tabs type="line" pane-class="tab-content" v-model:value="currentTab">
|
|
<template #prefix>
|
|
<template #prefix>
|
|
<span class="meta-title">
|
|
<span class="meta-title">
|
|
- <img src="img/subtitle_1.png" />
|
|
|
|
|
|
+ <img src="@/assets/subtitle_1.png" />
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
- <n-tab-pane name="展览" tab="展览">
|
|
|
|
|
|
+ <n-tab-pane
|
|
|
|
+ name="exhibition"
|
|
|
|
+ tab="展览"
|
|
|
|
+ v-infinite-scroll="onLoadMore"
|
|
|
|
+ >
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<template v-for="(_, index) in 16">
|
|
<template v-for="(_, index) in 16">
|
|
<n-gi>
|
|
<n-gi>
|
|
@@ -23,7 +28,7 @@
|
|
</template>
|
|
</template>
|
|
</n-grid>
|
|
</n-grid>
|
|
</n-tab-pane>
|
|
</n-tab-pane>
|
|
- <n-tab-pane name="活动" tab="活动">
|
|
|
|
|
|
+ <n-tab-pane name="activity" tab="活动">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<template v-for="(_, index) in 16">
|
|
<template v-for="(_, index) in 16">
|
|
<n-gi>
|
|
<n-gi>
|
|
@@ -37,7 +42,7 @@
|
|
</template>
|
|
</template>
|
|
</n-grid>
|
|
</n-grid>
|
|
</n-tab-pane>
|
|
</n-tab-pane>
|
|
- <n-tab-pane name="新闻" tab="新闻">
|
|
|
|
|
|
+ <n-tab-pane name="news" tab="新闻">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<template v-for="item in 16">
|
|
<template v-for="item in 16">
|
|
<n-gi>
|
|
<n-gi>
|
|
@@ -50,7 +55,7 @@
|
|
</template>
|
|
</template>
|
|
</n-grid>
|
|
</n-grid>
|
|
</n-tab-pane>
|
|
</n-tab-pane>
|
|
- <n-tab-pane name="通知" tab="通知">
|
|
|
|
|
|
+ <n-tab-pane name="notice" tab="通知">
|
|
<n-grid :y-gap="YGap" :cols="1" class="tab-grid">
|
|
<n-grid :y-gap="YGap" :cols="1" class="tab-grid">
|
|
<template v-for="(_, index) in 16">
|
|
<template v-for="(_, index) in 16">
|
|
<n-gi>
|
|
<n-gi>
|
|
@@ -72,22 +77,51 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { onMounted } from "vue";
|
|
|
|
-import { useFullscreen } from "@vueuse/core";
|
|
|
|
|
|
+import { onMounted, watch } from "vue";
|
|
|
|
+import { vInfiniteScroll } from "@vueuse/components";
|
|
import infoBox from "../components/infoBox";
|
|
import infoBox from "../components/infoBox";
|
|
import subHeader from "../components/subHeader";
|
|
import subHeader from "../components/subHeader";
|
|
import sideMenu from "../components/sideMenu";
|
|
import sideMenu from "../components/sideMenu";
|
|
import noticeBox from "../components/noticeBox";
|
|
import noticeBox from "../components/noticeBox";
|
|
import { useInfoStore } from "../store/info";
|
|
import { useInfoStore } from "../store/info";
|
|
|
|
+const infoStore = useInfoStore();
|
|
|
|
+
|
|
|
|
+const currentTab = ref("exhibition");
|
|
|
|
+
|
|
|
|
+const handleTabFetch = (type) => {
|
|
|
|
+ switch (type) {
|
|
|
|
+ case "exhibition":
|
|
|
|
+ infoStore.getExhibition();
|
|
|
|
+ break;
|
|
|
|
+ case "activity":
|
|
|
|
+ infoStore.getActivity();
|
|
|
|
+ break;
|
|
|
|
+ case "news":
|
|
|
|
+ infoStore.getNews();
|
|
|
|
+ break;
|
|
|
|
+ case "notice":
|
|
|
|
+ infoStore.getNews();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
|
|
+watch(
|
|
|
|
+ currentTab,
|
|
|
|
+ (val) => {
|
|
|
|
+ console.log("currentTab", val);
|
|
|
|
+ handleTabFetch(val);
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ immediate: true,
|
|
|
|
+ }
|
|
|
|
+);
|
|
const XGap = ref(50);
|
|
const XGap = ref(50);
|
|
const YGap = ref(50);
|
|
const YGap = ref(50);
|
|
-const { isFullscreen, enter, exit, toggle } = useFullscreen();
|
|
|
|
-const InfoStore = useInfoStore();
|
|
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
- InfoStore.getData();
|
|
|
|
-});
|
|
|
|
|
|
+const onLoadMore = (type) => {
|
|
|
|
+ // console.log("type", type);
|
|
|
|
+ console.log("onLoadMore");
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|
|
<style lang="scss" scoped></style>
|