Преглед изворни кода

修改必刷题获取知识点参数

shmily1213 пре 1 месец
родитељ
комит
05b6edb3c3

+ 4 - 0
src/App.vue

@@ -1,10 +1,14 @@
 <script>
 import { useAppStore } from '@/store/appStore';
+import { checkUpdate } from "@/utils/update.ts";
 export default {
   onLaunch: function () {
     console.log('App Launch')
     const appStore = useAppStore();
     appStore.init();
+    // #ifdef MP-WEIXIN
+    checkUpdate();
+    // #endif
   },
   onShow: function () {
     console.log('App Show')

+ 8 - 0
src/common/routes.ts

@@ -120,6 +120,14 @@ export const routes = {
    * 试题收藏夹
    */
   pageQuestionFavorites: '/pagesStudy/pages/question-favorites/question-favorites',
+  /**
+   * 登录
+   */
+  pageLogin: '/pagesSystem/pages/login/login',
+  /**
+   * 首页
+   */
+  pageIndex: '/pagesMain/pages/index/index',
 
 } as const;
 

+ 73 - 75
src/pagesMain/pages/index/components/index-map.vue

@@ -1,110 +1,108 @@
 <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 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-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">
+          第{{ i + 1 }}步
         </view>
-        <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">
-                    第{{ i + 1 }}步
-                </view>
-                <view class="w-full bg-back-light rounded-10 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>
-                            <view class="bg-black rounded-full p-4">
-                              <uv-icon name="arrow-right" color="white" size="6" />
-                            </view>
-                        </view>
-                        <view class="mt-3 text-22 text-fore-tip">{{ m.desc }}</view>
-                    </view>
-                </view>
+        <view class="w-full bg-back-light rounded-10 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>
+              <view class="bg-black rounded-full p-4">
+                <uv-icon name="arrow-right" color="white" size="6" />
+              </view>
             </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";
-import {useUserStore} from "@/store/userStore";
+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
+  title: string;
+  desc: string;
+  pagePath: string;
+  handler?: () => void
 }
 
 const userStore = useUserStore()
-const {transferTo} = useTransferPage()
+const { transferTo } = useTransferPage()
 
-const goSimulate = () => {
+const goSimulate = async () => {
+  const isLogin = await userStore.checkLogin();
+  if (isLogin) {
     const list = userStore.directedSchoolList || []
     const first = list[0] || {}
     if (!list.length || first.notice) {
-        transferTo(routes.studyIndex)
+      transferTo(routes.studyIndex)
     } else {
-        transferTo(routes.studySimulate, {
-            data: first
-        });
+      transferTo(routes.studySimulate, {
+        data: first
+      });
     }
+  }
 }
 
 const maps = computed<SiteMap[]>(() => [{
-    title: '本省规则',
-    desc: '填志愿不踩坑',
-    pagePath: routes.newsDetail + '?id=' + (userStore.isHN ? 1065 : 1078)
+  title: '本省规则',
+  desc: '填志愿不踩坑',
+  pagePath: routes.newsDetail + '?id=' + (userStore.isHN ? 1065 : 1078)
 }, {
-    title: '自我评价',
-    desc: '了解自身优势',
-    pagePath: ''
+  title: '自我评价',
+  desc: '了解自身优势',
+  pagePath: ''
 }, {
-    title: '职业规划',
-    desc: '锁定职业方向',
-    pagePath: routes.careerIndex
+  title: '职业规划',
+  desc: '锁定职业方向',
+  pagePath: routes.careerIndex
 }, {
-    title: '了解专业',
-    desc: '选择对口专业',
-    pagePath: routes.majorIndex
+  title: '了解专业',
+  desc: '选择对口专业',
+  pagePath: routes.majorIndex
 }, {
-    title: '锁定院校',
-    desc: '了解院校实力',
-    pagePath: routes.universityIndex
+  title: '锁定院校',
+  desc: '了解院校实力',
+  pagePath: routes.universityIndex
 }, {
-    title: '定向刷题',
-    desc: '根据考纲练习',
-    pagePath: routes.studyIndex
+  title: '定向刷题',
+  desc: '根据考纲练习',
+  pagePath: routes.studyIndex
 }, {
-    title: '模拟测试',
-    desc: '全真模拟',
-    pagePath: '',
-    handler: goSimulate
+  title: '模拟测试',
+  desc: '全真模拟',
+  pagePath: '',
+  handler: goSimulate
 }, {
-    title: '测录取率',
-    desc: '录取风险评估',
-    pagePath: routes.voluntaryIndex
+  title: '测录取率',
+  desc: '录取风险评估',
+  pagePath: routes.voluntaryIndex
 }])
 
 const handleMap = (m: SiteMap) => {
-    if (m.handler) return m.handler()
-    if (!m.pagePath) return
-    transferTo(m.pagePath)
+  if (m.handler) return m.handler()
+  if (!m.pagePath) return
+  transferTo(m.pagePath)
 }
-
-
-onMounted(() => userStore.getDirectedSchoolList())
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 5 - 0
src/pagesMain/pages/index/index.vue

@@ -109,6 +109,11 @@ onShow(() => {
   }, 500);
   isHide.value = false;
 });
+onLoad(() => {
+  if (userStore.isLogin) {
+    userStore.getDirectedSchoolList();
+  }
+});
 </script>
 
 <style lang="scss" scoped></style>

+ 1 - 1
src/pagesMain/pages/splash/splash.vue

@@ -21,7 +21,7 @@ import { load } from '@/utils/loadFont';
 const splashTimeout = 1200;
 const appStore = useAppStore();
 const userStore = useUserStore();
-const { transferTo } = useTransferPage();
+const { transferTo, routes } = useTransferPage();
 // #ifdef H5
 uni.hideTabBar();
 // #endif

+ 2 - 6
src/pagesOther/pages/university/index/components/college-list.vue

@@ -30,7 +30,7 @@ const props = withDefaults(defineProps<{
   customItemClick: false,
   extraFilter: () => ({})
 })
-const emits = defineEmits(['item-click'])
+const emits = defineEmits(['click'])
 
 const { prevData, transferTo } = useTransferPage()
 const paging = ref<ZPagingInstance>()
@@ -63,11 +63,7 @@ const handleQuery = (pageNum: number, pageSize: number) => {
 }
 
 const handleDetail = (u: University) => {
-  if (props.customItemClick) {
-    return emits('item-click', u)
-  }
-  const { id, code, name } = u
-  transferTo(routes.universityDetail, { data: { id, code, name } })
+  emits('click', u)
 }
 
 provide(UNIVERSITY_FILTER, queryParams)

+ 23 - 23
src/pagesOther/pages/university/index/components/college-rank.vue

@@ -1,42 +1,42 @@
 <template>
-    <view class="h-full">
-        <z-paging ref="paging" v-model="list" @query="handleQuery">
-            <view class="p-20 flex flex-col gap-20">
-                <college-item v-for="i in list" :key="i.code" :item="i" class="mx-card" @click="handleDetail(i)"/>
-            </view>
-        </z-paging>
-    </view>
+  <view class="h-full">
+    <z-paging ref="paging" v-model="list" @query="handleQuery">
+      <view class="p-20 flex flex-col gap-20">
+        <college-item v-for="i in list" :key="i.code" :item="i" class="mx-card" @click="handleDetail(i)" />
+      </view>
+    </z-paging>
+  </view>
 </template>
 
 <script setup lang="ts">
-import {useTransferPage} from "@/hooks/useTransferPage";
-import {universityList} from "@/api/modules/university";
-import {University} from "@/types/university";
-import {useUserStore} from "@/store/userStore";
+import { useTransferPage } from "@/hooks/useTransferPage";
+import { universityList } from "@/api/modules/university";
+import { University } from "@/types/university";
+import { useUserStore } from "@/store/userStore";
 import CollegeItem from "@/pagesOther/pages/university/index/components/plus/college-item.vue";
-import {routes} from "@/common/routes";
+import { routes } from "@/common/routes";
 
-const {transferTo} = useTransferPage()
+const { transferTo } = useTransferPage()
 const paging = ref<ZPagingInstance>()
 const list = ref<University[]>([])
-const {getLocation} = useUserStore()
+const { getLocation } = useUserStore()
 
 const rankTips = computed(() => `${getLocation || '湖南'}省招生院校竞争力排名`)
 
 const handleQuery = (pageNum: number, pageSize: number) => {
-    const payload = {pageNum, pageSize, filterRank: true}
-    universityList(payload)
-        .then(res => paging.value?.completeByTotal(res.rows, res.total))
-        .catch(e => paging.value?.complete(false))
+  const payload = { pageNum, pageSize, filterRank: true }
+  universityList(payload)
+    .then(res => paging.value?.completeByTotal(res.rows, res.total))
+    .catch(e => paging.value?.complete(false))
 }
 
+const emits = defineEmits<{
+  (e: 'click', college: University): void
+}>()
 const handleDetail = (college: University) => {
-    const {id, code, name} = college
-    transferTo(routes.universityDetail, {data: {id, code, name}})
+  emits('click', college)
 }
 
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 16 - 3
src/pagesOther/pages/university/index/index.vue

@@ -4,20 +4,25 @@
     <ie-auto-resizer>
       <ie-tabs-swiper v-model="current" :list="tabs" :scrollable="false">
         <template #list>
-          <college-list :absolute="true" />
+          <college-list :absolute="true" @click="handleDetail" />
         </template>
         <template #rank>
-          <college-rank />
+          <college-rank @click="handleDetail" />
         </template>
       </ie-tabs-swiper>
     </ie-auto-resizer>
   </ie-page>
 </template>
 <script lang="ts" setup>
-import { SwiperTabItem } from "@/types";
+import type { SwiperTabItem, University } from "@/types";
 import CollegeList from "@/pagesOther/pages/university/index/components/college-list.vue";
 import CollegeRank from "@/pagesOther/pages/university/index/components/college-rank.vue";
+import { useTransferPage } from "@/hooks/useTransferPage";
+import { useAuth } from "@/hooks/useAuth";
+import { EnumUserRole } from "@/common/enum";
 
+const { hasPermission } = useAuth();
+const { transferTo, routes } = useTransferPage();
 const current = ref(0);
 const tabs = ref<SwiperTabItem[]>([{
   name: '院校库',
@@ -30,5 +35,13 @@ const tabs = ref<SwiperTabItem[]>([{
 const handleChangeSwiper = function (e: any) {
   current.value = e.detail.current;
 }
+const handleDetail = (u: University.University) => {
+  const hasAuth = hasPermission([EnumUserRole.VIP]);
+  if (!hasAuth) {
+    return;
+  }
+  const { id, code, name } = u
+  transferTo(routes.universityDetail, { data: { id, code, name } })
+}
 </script>
 <style lang="scss" scoped></style>

+ 1 - 1
src/pagesOther/pages/university/picker/picker.vue

@@ -1,6 +1,6 @@
 <template>
     <ie-page>
-        <college-list custom-item-click @item-click="handleItemClick">
+        <college-list @click="handleItemClick">
             <template #top>
                 <ie-navbar :title="title"/>
             </template>

+ 109 - 112
src/pagesOther/pages/voluntary/index/components/voluntary-form-core.vue

@@ -1,25 +1,24 @@
 <template>
-    <view v-if="rulesInit" class="mt-40 flex flex-col gap-30">
-        <view v-for="(r,i) in renderRules.filter(i => i.details?.length)" :key="i" class="flex flex-col gap-30">
-            <view class="text-32 font-bold">{{ r.category }}</view>
-            <uv-form ref="form" :model="model" :rules="rules" label-position="top">
-                <uv-form-item v-for="d in r.details" :key="d.fieldName" :prop="d.fieldName">
-                    <view class="flex-1 flex items-center justify-between gap-40">
-                        <text class="text-30 text-fore-title" :style="{width: getLabelWidth(r)}">{{ d.label }}</text>
-                        <uv-input v-model="model[d.fieldName]" :disabled="d.readonly"
-                                  :placeholder="d.placeholder || '请输入'"
-                                  :suffix-icon="d.readonly ? 'lock': undefined"/>
-                        <text class="text-28 text-fore-placeholder">(总分 {{ d.options.toString() }})</text>
-                    </view>
-                </uv-form-item>
-            </uv-form>
-        </view>
+  <view v-if="rulesInit && renderRules" class="mt-40 flex flex-col gap-30">
+    <view v-for="(r, i) in renderRules.filter(i => i.details?.length)" :key="i" class="flex flex-col gap-30">
+      <view class="text-32 font-bold">{{ r.category }}</view>
+      <uv-form ref="form" :model="model" :rules="rules" label-position="top">
+        <uv-form-item v-for="d in r.details" :key="d.fieldName" :prop="d.fieldName">
+          <view class="flex-1 flex items-center justify-between gap-40">
+            <text class="text-30 text-fore-title" :style="{ width: getLabelWidth(r) }">{{ d.label }}</text>
+            <uv-input v-model="model[d.fieldName]" :disabled="d.readonly" :placeholder="d.placeholder || '请输入'"
+              :suffix-icon="d.readonly ? 'lock' : undefined" />
+            <text v-if="d.options" class="text-28 text-fore-placeholder">(总分 {{ d.options.toString() }})</text>
+          </view>
+        </uv-form-item>
+      </uv-form>
     </view>
+  </view>
 </template>
 
 <script setup lang="ts">
-import {VOLUNTARY_RULES, VOLUNTARY_MODEL} from "@/types/injectionSymbols";
-import {EnrollRule, EnrollRuleItem, VoluntaryModel} from "@/types/voluntary";
+import { VOLUNTARY_RULES, VOLUNTARY_MODEL } from "@/types/injectionSymbols";
+import { EnrollRule, EnrollRuleItem, VoluntaryModel } from "@/types/voluntary";
 import _ from "lodash";
 
 const renderRules = inject(VOLUNTARY_RULES) || ref<EnrollRule[]>()
@@ -29,112 +28,110 @@ const rules = ref({})
 const rulesInit = ref(false)
 
 const getLabelWidth = function (rule: EnrollRule) {
-    const maxLen = _.maxBy(rule.details, d => d.label.length)
-    return (maxLen?.label.length || 2) * 30 + 'rpx'
+  const maxLen = _.maxBy(rule.details, d => d.label.length)
+  return (maxLen?.label.length || 2) * 30 + 'rpx'
 }
 
 const validate = () => {
-    if (!form.value) return
-    const validates = form.value.map(f => f.validate())
-    return Promise.all(validates)
+  if (!form.value) return
+  const validates = form.value.map(f => f.validate())
+  return Promise.all(validates)
 }
 
 watch([renderRules, model], ([renderRules, model]) => {
-    if (!renderRules || !model) return
-    const autoRules: Record<string, any> = {}
-    renderRules.forEach((item: EnrollRule) => {
-        item.details?.forEach((r: EnrollRuleItem) => {
-            // TODO: 此规则逻辑从旧的uni-vueuse mx-base分支迁移过来,可能不完全适用于新版本。
-            const fieldRules = []
-            // 录取规则,自动添加非空校验
-            if (r.enumRuleCategory == 'Enroll') {
-                fieldRules.push({required: true, message: `请填写${r.label}分数`})
+  if (!renderRules || !model) return
+  const autoRules: Record<string, any> = {}
+  renderRules.forEach((item: EnrollRule) => {
+    item.details?.forEach((r: EnrollRuleItem) => {
+      // TODO: 此规则逻辑从旧的uni-vueuse mx-base分支迁移过来,可能不完全适用于新版本。
+      const fieldRules = []
+      // 录取规则,自动添加非空校验
+      if (r.enumRuleCategory == 'Enroll') {
+        fieldRules.push({ required: true, message: `请填写${r.label}分数` })
+      }
+      // 分制类型的输入,要同时校验分制与得分
+      if (r.enumInputType == 'Score') {
+        fieldRules.push({
+          validator: (_r: any, _v: any, cb: (arg0: string | undefined) => void) => {
+            const fieldTotal = r.fieldName + 'Total'
+            let score = Number(model[r.fieldName]) || 0
+            let total = Number(model[fieldTotal]) || 0
+            if (!total) {
+              cb(`请选择总分`)
+              return
             }
-            // 分制类型的输入,要同时校验分制与得分
-            if (r.enumInputType == 'Score') {
-                fieldRules.push({
-                    validator: (_r: any, _v: any, cb: (arg0: string | undefined) => void) => {
-                        const fieldTotal = r.fieldName + 'Total'
-                        let score = Number(model[r.fieldName]) || 0
-                        let total = Number(model[fieldTotal]) || 0
-                        if (!total) {
-                            cb(`请选择总分`)
-                            return
-                        }
-                        if (!score) {
-                            cb(`请填写${r.label}分数`)
-                            return
-                        }
-                        if (score < 0 || score > total) {
-                            cb(`分数不能超过总分${total}`)
-                            return
-                        }
-                        cb(undefined)
-                    }
-                })
+            if (!score) {
+              cb(`请填写${r.label}分数`)
+              return
             }
-            const hasVal = (val: any) => val !== null && val !== undefined
-            if (hasVal(r.min) || hasVal(r.max)) {
-                const createRangeMsg = () => {
-                    if (r.enumInputType == 'Text') {
-                        if (hasVal(r.min) && hasVal(r.max)) return `长度必须在${r.min}-${r.max}个字符之间`
-                        if (hasVal(r.min)) return `长度至少${r.min}个字符`
-                        if (hasVal(r.max)) return `长度不超过${r.max}个字符`
-                    } else if (r.enumInputType == 'Number') {
-                        if (hasVal(r.min) && hasVal(r.max)) return `数值必须在${r.min}-${r.max}之间`
-                        if (hasVal(r.min)) return `数值不能小于${r.min}`
-                        if (hasVal(r.max)) return `数值不能大于${r.max}`
-                    } else if (r.enumInputType == 'Checkbox') {
-                        if (hasVal(r.min) && hasVal(r.max)) return `必须选择${r.min}-${r.max}项`
-                        if (hasVal(r.min)) return `至少选择${r.min}项`
-                        if (hasVal(r.max)) return `至多选择${r.max}项`
-                    }
-                }
-                const createRangeType = () => {
-                    switch (r.enumInputType) {
-                        case 'Number':
-                        case 'Score':
-                            return 'number'
-                        case 'Checkbox':
-                            return 'array'
-                        default:
-                            return 'string'
-                    }
-                }
-                const rangeRule : {
-                    type: string,
-                    min?: number,
-                    max?: number,
-                    message: string | undefined
-                    transform?: (val: any) => any
-                } = {
-                    type: createRangeType(),
-                    min: r.min,
-                    max: r.max,
-                    message: createRangeMsg()
-                }
-                if (!hasVal(r.min)) delete rangeRule.min
-                if (!hasVal(r.max)) delete rangeRule.max
-                if (r.enumInputType == 'Number')
-                    rangeRule.transform = val => hasVal(val) ? val * 1 : val
-                fieldRules.push(rangeRule)
+            if (score < 0 || score > total) {
+              cb(`分数不能超过总分${total}`)
+              return
             }
-            if (r.regex) {
-                fieldRules.push({
-                    pattern: r.regex,
-                    message: `${r.label}格式不符合要求`
-                })
-            }
-            if (fieldRules.length) autoRules[r.fieldName] = fieldRules
+            cb(undefined)
+          }
+        })
+      }
+      const hasVal = (val: any) => val !== null && val !== undefined
+      if (hasVal(r.min) || hasVal(r.max)) {
+        const createRangeMsg = () => {
+          if (r.enumInputType == 'Text') {
+            if (hasVal(r.min) && hasVal(r.max)) return `长度必须在${r.min}-${r.max}个字符之间`
+            if (hasVal(r.min)) return `长度至少${r.min}个字符`
+            if (hasVal(r.max)) return `长度不超过${r.max}个字符`
+          } else if (r.enumInputType == 'Number') {
+            if (hasVal(r.min) && hasVal(r.max)) return `数值必须在${r.min}-${r.max}之间`
+            if (hasVal(r.min)) return `数值不能小于${r.min}`
+            if (hasVal(r.max)) return `数值不能大于${r.max}`
+          } else if (r.enumInputType == 'Checkbox') {
+            if (hasVal(r.min) && hasVal(r.max)) return `必须选择${r.min}-${r.max}项`
+            if (hasVal(r.min)) return `至少选择${r.min}项`
+            if (hasVal(r.max)) return `至多选择${r.max}项`
+          }
+        }
+        const createRangeType = () => {
+          switch (r.enumInputType) {
+            case 'Number':
+            case 'Score':
+              return 'number'
+            case 'Checkbox':
+              return 'array'
+            default:
+              return 'string'
+          }
+        }
+        const rangeRule: {
+          type: string,
+          min?: number,
+          max?: number,
+          message: string | undefined
+          transform?: (val: any) => any
+        } = {
+          type: createRangeType(),
+          min: r.min,
+          max: r.max,
+          message: createRangeMsg()
+        }
+        if (!hasVal(r.min)) delete rangeRule.min
+        if (!hasVal(r.max)) delete rangeRule.max
+        if (r.enumInputType == 'Number')
+          rangeRule.transform = val => hasVal(val) ? val * 1 : val
+        fieldRules.push(rangeRule)
+      }
+      if (r.regex) {
+        fieldRules.push({
+          pattern: r.regex,
+          message: `${r.label}格式不符合要求`
         })
+      }
+      if (fieldRules.length) autoRules[r.fieldName] = fieldRules
     })
-    rules.value = autoRules
-    rulesInit.value = true
-}, {immediate: true})
+  })
+  rules.value = autoRules
+  rulesInit.value = true
+}, { immediate: true })
 
-defineExpose({validate})
+defineExpose({ validate })
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 0 - 2
src/pagesOther/pages/voluntary/index/components/voluntary-form-simulate.vue

@@ -28,8 +28,6 @@ const goSimulate = () => {
         });
     }
 }
-
-onMounted(() => userStore.getDirectedSchoolList())
 </script>
 
 <style scoped>

+ 0 - 7
src/pagesStudy/pages/index/index.vue

@@ -40,13 +40,6 @@ const { hasPermission } = useAuth();
 const iePageRef = ref<InstanceType<typeof IePage>>();
 const { hasDirectedSchool, directedSchoolList, getExamType, isVHS } = storeToRefs(userStore);
 const firstDirectedSchool = computed(() => directedSchoolList.value[0] || {});
-
-const loadData = async () => {
-  await userStore.getDirectedSchoolList();
-}
-onLoad(() => {
-  loadData();
-});
 </script>
 
 <style></style>

+ 7 - 3
src/pagesStudy/pages/knowledge-practice/knowledge-practice.vue

@@ -77,10 +77,14 @@ const loadKnowledgeList = async () => {
   }
   try {
     uni.$ie.showLoading();
-    const { data } = await getKnowledgeList({
+    const params: Study.KnowledgeListRequestDTO = {
       subjectId: currentSubjectId.value,
-      directed: prevData.value.directed
-    });
+      directed: prevData.value.directed,
+    };
+    if (userStore.isVHS) {
+      params.questionType = prevData.value.questionType;
+    }
+    const { data } = await getKnowledgeList(params);
     treeData.value = data as Study.KnowledgeNode[];
     pagingRef.value?.complete(data);
   } catch (error) {

+ 4 - 1
src/pagesSystem/pages/login/login.vue

@@ -189,7 +189,10 @@ const handleMobileLogin = async (params: LoginRequestDTO) => {
       if (res.token) {
         userStore.login(res.token).then(({ success, userInfo }) => {
           if (success) {
-            transferBack(true);
+            // transferBack(true);
+            transferTo(routes.pageIndex, {
+              type: 'reLaunch'
+            });
           } else {
             uni.$ie.showToast('登录失败')
           }

+ 1 - 0
src/types/study.ts

@@ -311,6 +311,7 @@ export interface SubjectListRequestDTO {
 export interface KnowledgeListRequestDTO {
   subjectId: number;
   directed: boolean;
+  questionType?: boolean
 }
 
 export interface OpenExamineeRequestDTO {

+ 27 - 0
src/utils/update.ts

@@ -0,0 +1,27 @@
+
+export function checkUpdate() {
+  const { scene } = uni.getEnterOptionsSync();
+  // 从朋友圈单页模式打开页面
+  if (scene === 1154) {
+    return;
+  }
+  const updateManager = uni.getUpdateManager();
+  updateManager.onCheckForUpdate(res => {});
+  updateManager.onUpdateReady(() => {
+      uni.showModal({
+          title: '更新提示',
+          content: '新版本已经准备好,是否重启应用?',
+          success(res) {
+              if (res.confirm) {
+                  updateManager.applyUpdate();
+              }
+          }
+      });
+  });
+  updateManager.onUpdateFailed((error) => {
+      uni.showModal({
+          title: '更新失败',
+          content: '请删除小程序后重新打开'
+      });
+  });
+}