abpcoder 10 годин тому
батько
коміт
463fca54ed

+ 87 - 0
src/pagesMain/pages/index/components/index-map.vue

@@ -0,0 +1,87 @@
+<template>
+    <view class="mx-30 mt-32 bg-white shadow-card overflow-hidden rounded-15 relative">
+        <view class="w-full h-150 bg-[#F7FEE7] absolute"/>
+        <view class="flex justify-between z-1 relative">
+            <view class="py-14 pl-40 pr-80 bg-white"
+                  style="clip-path: polygon(0 0, calc(100% - 40rpx) 0, 100% 80rpx, 100% 100%, 0 100%);">
+                <ie-image src="/map-title.png" is-oss custom-class="w-182 h-57"/>
+            </view>
+            <view class="flex-1 flex justify-center items-center text-24 text-fore-title">
+                分步拆解,指引升学每一步
+            </view>
+        </view>
+        <view class="bg-white rounded-tr-15 z-1 relative px-12 py-20 grid grid-cols-3 gap-x-10 gap-y-20">
+            <view v-for="(m,i) in maps" :key="i" class="flex flex-col items-center" @click="handleMap(m)">
+                <view class="px-24 leading-36 text-20 text-fore-title font-bold bg-[#CEF57B] rounded-full z-1"
+                      style="margin-bottom: -18rpx">
+                    第{{ i + 1 }}步
+                </view>
+                <view class="w-full bg-back-light rounded-15 flex flex-col items-center pt-36 pb-28"
+                      style="box-shadow: 1px 2px 0px 0px #DCF8BC;">
+                    <view>
+                        <view class="text-24 text-fore-title flex items-center gap-12">
+                            <view class="font-bold">{{ m.title }}</view>
+                            <uv-icon name="arrow-right" color="white" size="12" custom-class="bg-black rounded-full"/>
+                        </view>
+                        <view class="mt-3 text-22 text-fore-tip">{{ m.desc }}</view>
+                    </view>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script setup lang="ts">
+import {routes} from "@/common/routes";
+import {useTransferPage} from "@/hooks/useTransferPage";
+
+interface SiteMap {
+    title: string;
+    desc: string;
+    pagePath: string;
+}
+
+const {transferTo} = useTransferPage()
+const maps = ref<SiteMap[]>([{
+    title: '本省规则',
+    desc: '填志愿不踩坑',
+    pagePath: routes.newsDetail + '?id=' + 1065
+}, {
+    title: '自我评价',
+    desc: '了解自身优势',
+    pagePath: ''
+}, {
+    title: '职业规划',
+    desc: '锁定职业方向',
+    pagePath: routes.careerIndex
+}, {
+    title: '了解专业',
+    desc: '选择对口专业',
+    pagePath: routes.majorIndex
+}, {
+    title: '锁定院校',
+    desc: '了解院校实力',
+    pagePath: routes.universityIndex
+}, {
+    title: '定向刷题',
+    desc: '根据考纲练习',
+    pagePath: routes.studyIndex
+}, {
+    title: '模拟测试',
+    desc: '全真模拟',
+    pagePath: routes.studySimulate
+}, {
+    title: '测录取率',
+    desc: '录取风险评估',
+    pagePath: routes.voluntaryIndex
+}])
+
+const handleMap = (m: SiteMap) => {
+    if (!m.pagePath) return
+    transferTo(m.pagePath)
+}
+</script>
+
+<style scoped>
+
+</style>

+ 81 - 77
src/pagesMain/pages/index/index.vue

@@ -1,113 +1,117 @@
 <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>
-          <text>·</text>
-          <view class="text-30 font-medium">升学备考好帮手</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>
-      </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>
 
 <script lang="ts" setup>
 import IndexBanner from './components/index-banner.vue';
 import IndexGuide from './components/index-guide.vue';
 import IndexNews from './components/index-news.vue';
+import IndexMap from "./components/index-map.vue";
 import indexPopup from './components/index-popup.vue';
 
-import { useUserStore } from '@/store/userStore';
+import {useUserStore} from '@/store/userStore';
 // @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 isHide = ref(false);
 const userStore = useUserStore();
 const orgName = computed(() => userStore.orgInfo.orgName);
 
 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 checkProvinceInfo = () => {
-  if (!userStore.isLogin && !userStore.tempInfo?.location) {
-    popupRef.value.open();
-  }
+    if (!userStore.isLogin && !userStore.tempInfo?.location) {
+        popupRef.value.open();
+    }
 }
 const checkTeacherInfo = async () => {
-  await userStore.checkInfoComplete();
+    await userStore.checkInfoComplete();
 }
 const reloadUserInfo = async () => {
-  if (userStore.isLogin) {
-    await userStore.getUserInfo();
-  }
+    if (userStore.isLogin) {
+        await userStore.getUserInfo();
+    }
 }
 const handleChangeLocation = () => {
-  if (userStore.isLogin) {
-    return;
-  }
-  popupRef.value.open();
+    if (userStore.isLogin) {
+        return;
+    }
+    popupRef.value.open();
 }
 onHide(() => {
-  isHide.value = true;
+    isHide.value = true;
 })
 onPageScroll((e) => {
-  if (!isHide.value) {
-    scrollTop.value = e.scrollTop;
-  }
+    if (!isHide.value) {
+        scrollTop.value = e.scrollTop;
+    }
 });
 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>
 

+ 7 - 2
src/pagesOther/pages/university/detail/components/plan-enroll-list.vue

@@ -82,7 +82,6 @@ const props = withDefaults(defineProps<{
     mode: 'plan',
     list: () => []
 })
-const emits = defineEmits(['rule'])
 
 const {transferTo} = useTransferPage()
 const detail = inject(UNIVERSITY_DETAIL, ref({} as UniversityDetail))
@@ -139,7 +138,13 @@ const handleQuery = () => {
 }
 
 const handleRuleClick = (descriptor: IPlanEnrollDescriptor, history: IPlanEnrollHistory) => {
-    if (descriptor.titleOnly) emits('rule', history.totalRule)
+    if (descriptor.titleOnly) {
+        uni.$ie.showConfirm({
+            title: '录取规则',
+            content: history.totalRule || '暂无录取规则',
+            showCancel: false
+        })
+    }
 }
 
 const handleAddVoluntary = async (item: IPlanEnrollHistory) => {

+ 2 - 1
src/pagesOther/pages/university/detail/components/plus/plan-enroll-descriptor.vue

@@ -1,5 +1,5 @@
 <template>
-    <view class="flex flex-col justify-center items-center rounded-lg bg-white py-10">
+    <view class="flex flex-col justify-center items-center rounded-lg bg-white py-10" @click="$emit('click')">
         <template v-if="!titleOnly">
             <text class="text-fore-title text-30 font-bold">{{ value || '-' }}</text>
             <text class="text-fore-tip text-24">{{ title }}</text>
@@ -15,6 +15,7 @@
 import {IPlanEnrollDescriptor} from "@/types/university";
 
 defineProps<IPlanEnrollDescriptor>()
+defineEmits(['click'])
 </script>
 
 <style scoped>

+ 2 - 10
src/pagesOther/pages/university/detail/detail.vue

@@ -16,10 +16,10 @@
                         <college-brochure />
                     </template>
                     <template #plan>
-                        <plan-enroll-list mode="plan" :list="planList" @rule="handleRulePopup"/>
+                        <plan-enroll-list mode="plan" :list="planList"/>
                     </template>
                     <template #enroll>
-                        <plan-enroll-list mode="enroll" :list="enrollList" @rule="handleRulePopup"/>
+                        <plan-enroll-list mode="enroll" :list="enrollList"/>
                     </template>
                     <template #exam>
                         <college-exam/>
@@ -75,14 +75,6 @@ const tabs = ref<SwiperTabItem[]>([{
     slot: 'exam'
 }])
 
-const handleRulePopup = (rule: string) => {
-    uni.$ie.showConfirm({
-        title: '录取规则',
-        content: rule || '暂无录取规则',
-        showCancel: false
-    })
-}
-
 provide(UNIVERSITY_DETAIL, detail)
 provide(MAJOR_TREE, majorTree)
 onMounted(() => {