|
@@ -1,111 +1,117 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <ie-page bg-color="white">
|
|
|
|
|
- <ie-navbar transparent bg-color="#FFFFFF" :placeholder="false" custom-back :click-hover="false">
|
|
|
|
|
- <template #headerLeft>
|
|
|
|
|
- <view class="flex items-center gap-7 text-fore-title">
|
|
|
|
|
- <view class="text-38 font-bold">{{ orgName }}</view>
|
|
|
|
|
|
|
+ <ie-page bg-color="white">
|
|
|
|
|
+ <ie-navbar transparent bg-color="#FFFFFF" :placeholder="false" custom-back :click-hover="false">
|
|
|
|
|
+ <template #headerLeft>
|
|
|
|
|
+ <view class="flex items-center gap-7 text-fore-title">
|
|
|
|
|
+ <view class="text-38 font-bold">{{ orgName }}</view>
|
|
|
|
|
+ <text>·</text>
|
|
|
|
|
+ <view class="text-30 font-medium">升学备考好帮手</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #headerRight="{ isTransparent }">
|
|
|
|
|
+ <view v-if="userStore.getLocation" class="ml-10 flex items-center gap-x-4"
|
|
|
|
|
+ @click="handleChangeLocation">
|
|
|
|
|
+ <uv-icon name="map" size="16" :color="isTransparent ? '#333' : 'var(--primary-color)'"/>
|
|
|
|
|
+ <text class="text-30 font-medium"
|
|
|
|
|
+ :class="[isTransparent ? 'text-fore-title' : 'text-primary']">
|
|
|
|
|
+ {{ userStore.getLocation }}
|
|
|
|
|
+ </text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </ie-navbar>
|
|
|
|
|
+ <view class="absolute top-0 left-0 right-0 z-0 h-[489rpx] bg-gradient-to-b from-[#6ACAFF] to-white"></view>
|
|
|
|
|
+ <view class="relative z-2" :style="{ paddingTop: baseStickyTop + 10 + 'px' }">
|
|
|
|
|
+ <index-banner/>
|
|
|
|
|
+ <index-map/>
|
|
|
|
|
+ <index-guide v-if="false" @detail="handleDetail"/>
|
|
|
|
|
+ <index-news @detail="handleDetail"/>
|
|
|
</view>
|
|
</view>
|
|
|
- </template>
|
|
|
|
|
- <template #headerRight="{ isTransparent }">
|
|
|
|
|
- <view v-if="userStore.getLocation" class="ml-10 flex items-center gap-x-4" @click="handleChangeLocation">
|
|
|
|
|
- <uv-icon name="map" size="16" :color="isTransparent ? '#333' : 'var(--primary-color)'" />
|
|
|
|
|
- <text class="text-30 font-medium"
|
|
|
|
|
- :class="[isTransparent ? 'text-fore-title' : 'text-primary']">
|
|
|
|
|
- {{ userStore.getLocation }}
|
|
|
|
|
- </text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </template>
|
|
|
|
|
- </ie-navbar>
|
|
|
|
|
- <view class="absolute top-0 left-0 right-0 z-0 h-[489rpx] bg-gradient-to-b from-[#6ACAFF] to-white"></view>
|
|
|
|
|
- <view class="relative z-2" :style="{ paddingTop: baseStickyTop + 10 + 'px' }">
|
|
|
|
|
- <index-banner />
|
|
|
|
|
- <index-guide @detail="handleDetail" />
|
|
|
|
|
- <index-news @detail="handleDetail" />
|
|
|
|
|
- </view>
|
|
|
|
|
- <template #tabbar>
|
|
|
|
|
- <ie-tabbar :active="0" />
|
|
|
|
|
- <index-popup ref="popupRef" />
|
|
|
|
|
- </template>
|
|
|
|
|
- </ie-page>
|
|
|
|
|
|
|
+ <template #tabbar>
|
|
|
|
|
+ <ie-tabbar :active="0"/>
|
|
|
|
|
+ <index-popup ref="popupRef"/>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </ie-page>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import IndexBanner from './components/index-banner.vue';
|
|
import IndexBanner from './components/index-banner.vue';
|
|
|
import IndexGuide from './components/index-guide.vue';
|
|
import IndexGuide from './components/index-guide.vue';
|
|
|
import IndexNews from './components/index-news.vue';
|
|
import IndexNews from './components/index-news.vue';
|
|
|
|
|
+import IndexMap from "./components/index-map.vue";
|
|
|
import indexPopup from './components/index-popup.vue';
|
|
import indexPopup from './components/index-popup.vue';
|
|
|
|
|
|
|
|
-import { useUserStore } from '@/store/userStore';
|
|
|
|
|
|
|
+import {useUserStore} from '@/store/userStore';
|
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
|
-import { useTransferPage } from '@/hooks/useTransferPage';
|
|
|
|
|
-import { useNavbar } from '@/hooks/useNavbar';
|
|
|
|
|
-import { onPageShow } from '@dcloudio/uni-app';
|
|
|
|
|
-const { routes, transferTo } = useTransferPage();
|
|
|
|
|
-const { baseStickyTop } = useNavbar();
|
|
|
|
|
|
|
+import {useTransferPage} from '@/hooks/useTransferPage';
|
|
|
|
|
+import {useNavbar} from '@/hooks/useNavbar';
|
|
|
|
|
+import {onPageShow} from '@dcloudio/uni-app';
|
|
|
|
|
+
|
|
|
|
|
+const {routes, transferTo} = useTransferPage();
|
|
|
|
|
+const {baseStickyTop} = useNavbar();
|
|
|
const scrollTop = ref(0);
|
|
const scrollTop = ref(0);
|
|
|
const isHide = ref(false);
|
|
const isHide = ref(false);
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
const orgName = computed(() => userStore.orgInfo.orgName);
|
|
const orgName = computed(() => userStore.orgInfo.orgName);
|
|
|
|
|
|
|
|
const handleDetail = async (id: number | string, title?: string) => {
|
|
const handleDetail = async (id: number | string, title?: string) => {
|
|
|
- if (('' + id).includes(',')) {
|
|
|
|
|
- transferTo(routes.newsGroup, {
|
|
|
|
|
- data: {
|
|
|
|
|
- ids: id,
|
|
|
|
|
- title: title
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- transferTo(routes.newsDetail, {
|
|
|
|
|
- data: {
|
|
|
|
|
- id: id,
|
|
|
|
|
- title: title
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (('' + id).includes(',')) {
|
|
|
|
|
+ transferTo(routes.newsGroup, {
|
|
|
|
|
+ data: {
|
|
|
|
|
+ ids: id,
|
|
|
|
|
+ title: title
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ transferTo(routes.newsDetail, {
|
|
|
|
|
+ data: {
|
|
|
|
|
+ id: id,
|
|
|
|
|
+ title: title
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const popupRef = ref();
|
|
const popupRef = ref();
|
|
|
const checkProvinceInfo = () => {
|
|
const checkProvinceInfo = () => {
|
|
|
- if (!userStore.isLogin && !userStore.tempInfo?.location) {
|
|
|
|
|
- popupRef.value.open();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (!userStore.isLogin && !userStore.tempInfo?.location) {
|
|
|
|
|
+ popupRef.value.open();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
const checkTeacherInfo = async () => {
|
|
const checkTeacherInfo = async () => {
|
|
|
- await userStore.checkInfoComplete();
|
|
|
|
|
|
|
+ await userStore.checkInfoComplete();
|
|
|
}
|
|
}
|
|
|
const reloadUserInfo = async () => {
|
|
const reloadUserInfo = async () => {
|
|
|
- if (userStore.isLogin) {
|
|
|
|
|
- await userStore.getUserInfo();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (userStore.isLogin) {
|
|
|
|
|
+ await userStore.getUserInfo();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
const handleChangeLocation = () => {
|
|
const handleChangeLocation = () => {
|
|
|
- if (userStore.isLogin) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- popupRef.value.open();
|
|
|
|
|
|
|
+ if (userStore.isLogin) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ popupRef.value.open();
|
|
|
}
|
|
}
|
|
|
onHide(() => {
|
|
onHide(() => {
|
|
|
- isHide.value = true;
|
|
|
|
|
|
|
+ isHide.value = true;
|
|
|
})
|
|
})
|
|
|
onPageScroll((e) => {
|
|
onPageScroll((e) => {
|
|
|
- if (!isHide.value) {
|
|
|
|
|
- scrollTop.value = e.scrollTop;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (!isHide.value) {
|
|
|
|
|
+ scrollTop.value = e.scrollTop;
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
|
- setTimeout(() => {
|
|
|
|
|
- uni.pageScrollTo({
|
|
|
|
|
- scrollTop: scrollTop.value,
|
|
|
|
|
- duration: 0
|
|
|
|
|
- });
|
|
|
|
|
- }, 0);
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- checkProvinceInfo();
|
|
|
|
|
- checkTeacherInfo();
|
|
|
|
|
- reloadUserInfo();
|
|
|
|
|
- }, 500);
|
|
|
|
|
- isHide.value = false;
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ uni.pageScrollTo({
|
|
|
|
|
+ scrollTop: scrollTop.value,
|
|
|
|
|
+ duration: 0
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 0);
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ checkProvinceInfo();
|
|
|
|
|
+ checkTeacherInfo();
|
|
|
|
|
+ reloadUserInfo();
|
|
|
|
|
+ }, 500);
|
|
|
|
|
+ isHide.value = false;
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|