1
0

2 Ревизии 8251567828 ... 84d24a94fb

Автор SHA1 Съобщение Дата
  abpcoder 84d24a94fb Merge branch 'mp' of http://49.234.186.218:9000/root/ieplus-app into mp преди 9 часа
  abpcoder 048e317421 index map update преди 9 часа
променени са 1 файла, в които са добавени 23 реда и са изтрити 2 реда
  1. 23 2
      src/pagesMain/pages/index/components/index-map.vue

+ 23 - 2
src/pagesMain/pages/index/components/index-map.vue

@@ -10,7 +10,7 @@
                 分步拆解,指引升学每一步
             </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 class="bg-white rounded-tr-15 z-1 relative px-12 py-20 grid grid-cols-4 gap-x-12 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">
@@ -34,14 +34,30 @@
 <script setup lang="ts">
 import {routes} from "@/common/routes";
 import {useTransferPage} from "@/hooks/useTransferPage";
+import {useUserStore} from "@/store/userStore";
 
 interface SiteMap {
     title: string;
     desc: string;
     pagePath: string;
+    handler?: () => void
 }
 
+const userStore = useUserStore()
 const {transferTo} = useTransferPage()
+
+const goSimulate = () => {
+    const list = userStore.directedSchoolList || []
+    const first = list[0] || {}
+    if (!list.length || first.notice) {
+        transferTo(routes.studyIndex)
+    } else {
+        transferTo(routes.studySimulate, {
+            data: first
+        });
+    }
+}
+
 const maps = ref<SiteMap[]>([{
     title: '本省规则',
     desc: '填志愿不踩坑',
@@ -69,7 +85,8 @@ const maps = ref<SiteMap[]>([{
 }, {
     title: '模拟测试',
     desc: '全真模拟',
-    pagePath: routes.studySimulate
+    pagePath: '',
+    handler: goSimulate
 }, {
     title: '测录取率',
     desc: '录取风险评估',
@@ -77,9 +94,13 @@ const maps = ref<SiteMap[]>([{
 }])
 
 const handleMap = (m: SiteMap) => {
+    if (m.handler) return m.handler()
     if (!m.pagePath) return
     transferTo(m.pagePath)
 }
+
+
+onMounted(() => userStore.getDirectedSchoolList())
 </script>
 
 <style scoped>