shmily1213 1 miesiąc temu
rodzic
commit
efa4187c08

+ 2 - 1
src/components/ie-input/ie-input.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="relative flex items-center px-42 bg-back rounded-40 h-104 box-border" :class="customClass">
-    <input class="flex-1 h-full text-30 text-fore-subcontent" v-model="modelValue" :type="type" :maxlength="maxlength"
+    <input class="flex-1 h-full text-30 text-fore-subcontent" v-model="modelValue" :type="type" :password="password" :maxlength="maxlength"
       :placeholder="placeholder" placeholder-class="text-fore-light" />
     <view>
       <slot></slot>
@@ -20,6 +20,7 @@ interface Props {
   placeholder?: string;
   maxlength?: number;
   customClass?: string;
+  password?: boolean
 }
 
 const props = withDefaults(defineProps<Props>(), {

+ 57 - 0
src/composables/useExamType.ts

@@ -0,0 +1,57 @@
+import { EnumDictName } from "@/common/enum";
+import { useDictStore } from "@/store/dictStore";
+import { useAppStore } from "@/store/appStore";
+import { DictItem } from "@/types";
+import { getExamMajors, getExamTypes, getGraduateYears, getProvinces } from "@/api/modules/system";
+const dictStore = useDictStore();
+const appStore = useAppStore();
+export const useExamType = () => {
+  const form = ref({
+    location: '',
+    examType: '',
+    endYear: undefined,
+    majorType: '',
+  })
+  const provinceList = ref<DictItem[]>([]);
+  const examTypeList = ref<DictItem[]>([]);
+  const examMajorList = ref<DictItem[]>([]);
+  const endYearList = ref<DictItem[]>([]);
+  const loadProvinceData = async () => {
+    const { data } = await getProvinces();
+    provinceList.value = data;
+  }
+  const loadExamTypeData = async () => {
+    const { data } = await getExamTypes(form.value.location);
+    examTypeList.value = data;
+  }
+  const loadExamMajorData = async () => {
+    const { data } = await getExamMajors(form.value.location, form.value.examType);
+    examMajorList.value = data;
+  }
+  const loadGraduateYearData = async () => {
+    const { data } = await getGraduateYears(form.value.location, form.value.examType);
+    endYearList.value = data;
+  }
+  watch(() => form.value.location, (val) => {
+    form.value.examType = '';
+    form.value.majorType = '';
+    if (val) {
+      loadExamTypeData();
+    }
+  });
+  watch(() => form.value.examType, (val) => {
+    if (val) {
+      loadExamMajorData();
+      loadGraduateYearData();
+    }
+  })
+  loadProvinceData();
+
+  return {
+    form,
+    provinceList,
+    examTypeList,
+    examMajorList,
+    endYearList
+  }
+}

+ 2 - 1
src/main.ts

@@ -47,7 +47,8 @@ export function createApp() {
         class: { default: 'mx-loading-page' }
       },
       navbar: {
-        placeholder: { default: true }
+        placeholder: { default: true },
+        clickHover: { default: true }
       },
       tabs: {
         activeStyle: { default: () => ({ color: 'var(--primary-color)' }) }

+ 23 - 6
src/pagesMain/pages/index/components/index-banner.vue

@@ -3,7 +3,7 @@
     <ie-image :is-oss="true" src="/banner/index-banner-1.png" custom-class="w-full min-h-264 overflow-hidden"
       :round="15" />
     <view class="pt-24 pb-40 bg-white grid grid-cols-4 gap-y-32 justify-items-center">
-      <view class="w-fit" v-for="item in menus" :key="item.name" @click="navigateTo(item.pageUrl, item.navigateType)">
+      <view class="w-fit" v-for="item in menus" :key="item.name" @click="navigateTo(item)">
         <ie-image :is-oss="true" custom-class="w-auto h-82" :round="10" :src="item.icon" mode="heightFix" />
         <view class="text-26 text-fore-title">{{ item.name }}</view>
       </view>
@@ -18,7 +18,14 @@ import { useTransferPage } from '@/hooks/useTransferPage';
 const { transferTo } = useTransferPage();
 import { useUserStore } from '@/store/userStore';
 const userStore = useUserStore();
-const menus = [
+type MenuItem = {
+  name: string;
+  icon: string;
+  pageUrl: string;
+  navigateType?: string;
+  noLogin?: boolean
+}
+const menus: MenuItem[] = [
   {
     name: '学习备考',
     icon: '/menu/menu-study.png',
@@ -39,11 +46,13 @@ const menus = [
     name: '查专业',
     icon: '/menu/menu-major.png',
     pageUrl: '/pagesOther/pages/major-library/index/index',
+    noLogin: true
   },
   {
     name: '看职业',
     icon: '/menu/menu-work.png',
     pageUrl: '/pagesOther/pages/vocation-library/index/index',
+    noLogin: true
   },
   {
     name: '自我测评',
@@ -54,6 +63,7 @@ const menus = [
     name: '单招资讯',
     icon: '/menu/menu-news.png',
     pageUrl: '/pagesOther/pages/news/index/index',
+    noLogin: true
   },
   {
     name: '专升本',
@@ -61,13 +71,20 @@ const menus = [
     pageUrl: '/pages/index/index',
   }
 ]
-const navigateTo = async (pageUrl: string, navigateType?: string) => {
-  const isLogin = await userStore.checkLogin();
-  if (isLogin) {
+const navigateTo = async (item: MenuItem) => {
+  const { pageUrl, navigateType, noLogin } = item;
+  if (!noLogin) {
+    const isLogin = await userStore.checkLogin();
+    if (isLogin) {
+      transferTo(pageUrl, {
+        type: navigateType || 'navigate',
+      });
+    };
+  } else {
     transferTo(pageUrl, {
       type: navigateType || 'navigate',
     });
-  };
+  }
 }
 </script>
 <style lang="scss" scoped></style>

+ 7 - 0
src/pagesMain/pages/index/components/index-popup copy.vue

@@ -0,0 +1,7 @@
+<template>
+  <view></view>
+</template>
+<script lang="ts" setup>
+
+</script>
+<style lang="scss" scoped></style>

+ 71 - 0
src/pagesMain/pages/index/components/index-popup.vue

@@ -0,0 +1,71 @@
+<template>
+  <root-portal>
+    <uv-popup ref="popupRef" mode="bottom" :round="16" :closeOnClickOverlay="false">
+      <view class="popup-content">
+        <view class="p-40">
+          <view class="text-32 text-fore-title font-bold">请确认信息</view>
+          <view class="mt-10 text-26 text-fore-light">让我们开始体验升学备考之旅吧!</view>
+        </view>
+        <view class="mx-30 pb-50">
+          <view class="flex items-center px-42 bg-back rounded-40 h-104 box-border">
+            <view class="flex-shrink-0">所在省份</view>
+            <ie-picker ref="pickerRef" v-model="form.location" :list="provinceList" :customStyle="customStyle"
+              placeholder="请选择" key-label="dictLabel" key-value="dictValue">
+            </ie-picker>
+          </view>
+          <view class="mt-30 flex items-center px-42 bg-back rounded-40 h-104 box-border">
+            <view class="flex-shrink-0">考生类别</view>
+            <ie-picker ref="pickerRef" v-model="form.examType" :list="examTypeList" :disabled="!form.location"
+              :customStyle="customStyle" placeholder="请选择" key-label="dictLabel" key-value="dictValue">
+            </ie-picker>
+          </view>
+          <view class="mt-140">
+            <ie-button type="primary" @click="handleConfirm">立即体验</ie-button>
+          </view>
+        </view>
+      </view>
+    </uv-popup>
+  </root-portal>
+</template>
+<script lang="ts" setup>
+import { useExamType } from '@/composables/useExamType';
+import { useUserStore } from '@/store/userStore';
+const userStore = useUserStore();
+const popupRef = ref();
+const { form, provinceList, examTypeList } = useExamType();
+
+const customStyle = {
+  textAlign: 'right'
+}
+const handleConfirm = () => {
+  const { location, examType } = form.value
+  if (!location) {
+    uni.$ie.showToast('请选择省份');
+    return;
+  }
+  if (!examType) {
+    uni.$ie.showToast('请选择考生类别');
+    return;
+  }
+  userStore.tempInfo = {
+    location,
+    examType
+  }
+  popupRef.value.close();
+}
+const open = () => {
+  if (userStore.tempInfo) {
+    console.log()
+    form.value.location = userStore.tempInfo.location;
+    setTimeout(() => {
+      form.value.examType = userStore.tempInfo!.examType;
+    }, 0);
+  }
+  popupRef.value.open();
+}
+const close = () => {
+  popupRef.value.close();
+}
+defineExpose({ open, close })
+</script>
+<style lang="scss" scoped></style>

+ 35 - 19
src/pagesMain/pages/index/index.vue

@@ -1,11 +1,15 @@
 <template>
   <ie-page bg-color="white">
-    <ie-navbar transparent bg-color="#FFFFFF" :placeholder="false">
+    <ie-navbar transparent bg-color="#FFFFFF" :placeholder="false" custom-back :click-hover="false">
       <template #headerLeft>
         <view class="flex items-center">
           <view class="text-36 text-fore-title font-bold">单招一卡通</view>
           <view class="w-6 h-6 rounded-2 bg-black mx-12"></view>
           <view>升学备考好帮手</view>
+          <view v-if="userStore.getLocation" class="ml-10 flex items-center gap-x-4" @click="handleChangeLocation">
+            <ie-image src="/static/image/icon-location.png" custom-class="w-20 h-24" mode="aspectFill" />
+            <text class="text-26 text-primary">{{ userStore.getLocation }}</text>
+          </view>
         </view>
       </template>
     </ie-navbar>
@@ -14,11 +18,12 @@
       <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>
 
@@ -26,6 +31,7 @@
 import IndexBanner from './components/index-banner.vue';
 import IndexGuide from './components/index-guide.vue';
 import IndexNews from './components/index-news.vue';
+import indexPopup from './components/index-popup.vue';
 
 import { useUserStore } from '@/store/userStore';
 // @ts-ignore
@@ -40,25 +46,32 @@ const isHide = ref(false);
 const userStore = useUserStore();
 
 const handleDetail = async (id: number | string, title?: string) => {
-  const isLogin = await userStore.checkLogin();
-  if (isLogin) {
-    if (('' + id).includes(',')) {
-      transferTo(mxConst.routes.newsGroup, {
-        data: {
-          ids: id,
-          title: title
-        }
-      });
-    } else {
-      transferTo(mxConst.routes.newsDetail, {
-        data: {
-          id: id,
-          title: title
-        }
-      })
-    }
+  if (('' + id).includes(',')) {
+    transferTo(mxConst.routes.newsGroup, {
+      data: {
+        ids: id,
+        title: title
+      }
+    });
+  } else {
+    transferTo(mxConst.routes.newsDetail, {
+      data: {
+        id: id,
+        title: title
+      }
+    })
+  }
+}
+
+const popupRef = ref();
+const checkProvinceInfo = () => {
+  if (!userStore.isLogin && !userStore.tempInfo?.location) {
+    popupRef.value.open();
   }
 }
+const handleChangeLocation = () => {
+  popupRef.value.open();
+}
 onHide(() => {
   isHide.value = true;
 })
@@ -68,6 +81,9 @@ onPageScroll((e) => {
   }
 });
 onShow(() => {
+  setTimeout(() => {
+    checkProvinceInfo();
+  }, 500);
   isHide.value = false;
   setTimeout(() => {
     uni.pageScrollTo({

+ 1 - 4
src/pagesMain/pages/me/components/me-info.vue

@@ -51,10 +51,7 @@ const handleHeaderClick = async () => {
   const isLogin = await userStore.checkLogin({ askToLogin: false });
 }
 const handleSettingClick = async () => {
-  const isLogin = await userStore.checkLogin({ askToLogin: true });
-  if (isLogin) {
-    transferTo('/pagesOther/pages/personal-center/setting/setting');
-  }
+  transferTo('/pagesOther/pages/personal-center/setting/setting');
 }
 </script>
 <style lang="scss" scoped></style>

+ 6 - 9
src/pagesMain/pages/me/components/me-menu.vue

@@ -105,15 +105,12 @@ const handleNavigate = async (pagePath: string, title: string) => {
   }
 }
 const handleQuestion = async () => {
-  const isLogin = await userStore.checkLogin();
-  if (isLogin) {
-    transferTo('/pagesOther/pages/h5/h5', {
-      data: {
-        title: '常见问题',
-        url: 'https://www.dz1kt.com/admin/FAQ/FAQ_IE.html'
-      }
-    });
-  }
+  transferTo('/pagesOther/pages/h5/h5', {
+    data: {
+      title: '常见问题',
+      url: 'https://www.dz1kt.com/admin/FAQ/FAQ_IE.html'
+    }
+  });
 }
 const handleLogout = async () => {
   const confirm = await userStore.askLogout();

+ 7 - 5
src/pagesMain/pages/volunteer/volunteer.vue

@@ -11,9 +11,8 @@
       <view
         class="px-46 h-1/2 absolute left-0 right-0 top-1/2 -translate-y-1/2 flex items-center justify-between box-border pt-50 text-24 text-primary">
         <text>姓名:{{ userStore.nickName }}</text>
-        <text>省份:{{ userStore.userInfo.location || '--' }}</text>
-        <text>类别:<ie-dict :dict-name="EnumDictName.EXAM_TYPE"
-            :dict-value="userStore.userInfo.examType || '--'" /></text>
+        <text>省份:{{ userStore.getLocation || '--' }}</text>
+        <text>类别:<ie-dict :dict-name="EnumDictName.EXAM_TYPE" :dict-value="userStore.getExamType || '--'" /></text>
       </view>
     </view>
     <view class="mx-26">
@@ -71,8 +70,11 @@ const menu: MenuItem[] = [
     pagePath: '/pagesOther/pages/ie/entry-calculate/entry-calculate'
   }
 ];
-const handleClick = (item: MenuItem) => {
-  transferTo(item.pagePath);
+const handleClick = async (item: MenuItem) => {
+  const isLogin = await userStore.checkLogin();
+  if (isLogin) {
+    transferTo(item.pagePath);
+  }
 }
 </script>
 

+ 6 - 1
src/pagesOther/pages/personal-center/setting/setting.vue

@@ -22,7 +22,7 @@ import {sizeFormat} from "@/utils";
 const {transferToProtocolUser, transferToProtocolPrivacy, transferToIndex, cleanAllTransferCacheData} = useTransfer()
 const {getSize: getCacheSize, gcCache} = useCacheStore()
 const {systemInfo} = useEnvStore()
-const {LogoutPhysical, GetInfo} = useUserStore()
+const {LogoutPhysical, GetInfo, isLogin} = useUserStore()
 
 const settings = reactive([
     {
@@ -60,6 +60,11 @@ const settings = reactive([
         icon: 'trash',
         isLink: true,
         handler: async () => {
+          if (!isLogin.value) {
+            const msg = '当前未登录'
+            await confirmAsync(msg)
+            return;
+          }
             const msg = '是否注销账号,注销后卡号将不能再注册使用系统且永久失效。请谨慎操作!'
             await confirmAsync(msg)
             await LogoutPhysical()

+ 24 - 15
src/pagesSystem/pages/login/login.vue

@@ -21,24 +21,20 @@
           </ie-input>
         </view>
         <view v-show="loginType === 'card'">
-          <view class="mt-28 relative flex items-center px-42 bg-back rounded-40 h-104 box-border">
-            <input class="flex-1 h-full text-30 text-fore-subcontent" v-model="cardNo" type="number" maxlength="8"
-              placeholder="请输入卡号" placeholder-class="text-fore-light" />
-          </view>
-          <view class="mt-28 relative flex items-center px-42 bg-back rounded-40 h-104 box-border">
-            <input class="flex-1 h-full text-30 text-fore-subcontent" v-model="cardPassword" type="text"
-              :password="!showPassword" placeholder="请输入密码" maxlength="6" placeholder-class="text-fore-light" />
+          <ie-input custom-class="mt-28" type="number" :maxlength="8" v-model="cardNo" placeholder="请输入卡号" />
+          <ie-input custom-class="mt-28" type="number" :password="!showPassword" :maxlength="6" v-model="cardPassword"
+            placeholder="请输入密码">
             <cover-view class="w-60 h-60 flex items-center justify-center" @click="toggleShowPassword">
               <cover-image v-show="!showPassword" src="@/pagesSystem/static/image/icon/icon-eye.png" mode="widthFix"
                 class="w-44 h-44" />
               <cover-image v-show="showPassword" src="@/pagesSystem/static/image/icon/icon-eye-off.png" mode="widthFix"
                 class="w-44 h-44" />
             </cover-view>
-          </view>
+          </ie-input>
         </view>
         <view class="mt-42 ml-26 h-28">
           <uv-checkbox-group v-if="loginType === 'card'" v-model="rememberPassword">
-            <uv-checkbox name="true" label="记住密码" :labelSize="15" :iconSize="14" labelColor="#666666"></uv-checkbox>
+            <uv-checkbox :name="true" label="记住密码" :labelSize="15" :iconSize="14" labelColor="#666666"></uv-checkbox>
           </uv-checkbox-group>
         </view>
       </view>
@@ -73,10 +69,10 @@ const userStore = useUserStore();
 const { validatePhone, validateTelephone } = useValidation();
 
 const loginType = ref('phone');
-const phone = ref('17363958507');
+const phone = ref('');
 const password = ref('');
-const cardNo = ref('20000002');
-const cardPassword = ref('823749');
+const cardNo = ref('');
+const cardPassword = ref('');
 const code = ref('');
 const uuid = ref('');
 const showPassword = ref(false);
@@ -90,9 +86,19 @@ const changeLoginType = (type: string) => {
 
 const handleAgreePrivacy = (type: string) => {
   if (type === 'user') {
-    transferTo('/pagesSystem/pages/login/user-agreement');
+    transferTo('/pagesOther/pages/h5/h5', {
+      data: {
+        title: '用户协议',
+        url: 'https://www.dz1kt.com/admin/protocol/mxjb_user_IE.html'
+      }
+    });
   } else if (type === 'privacy') {
-    transferTo('/pagesSystem/pages/login/privacy-policy');
+    transferTo('/pagesOther/pages/h5/h5', {
+      data: {
+        title: '隐私政策',
+        url: 'https://www.dz1kt.com/admin/protocol/mxjb_privacy_IE.html'
+      }
+    });
   }
 }
 
@@ -142,6 +148,7 @@ const handleLogin = async () => {
     submitLogin();
   } else if (loginType.value === 'card') {
     captchaRef.value.open();
+    userStore.rememberPwd = !!rememberPassword.value[0];
     // submitLogin();
   }
 }
@@ -232,7 +239,9 @@ const handleValid = (data: { code: string; uuid: string }) => {
 }
 
 
-onLoad(() => { });
+onLoad(() => {
+  rememberPassword.value[0] = userStore.rememberPwd;
+});
 </script>
 
 <style lang="scss" scoped>

+ 89 - 139
src/pagesSystem/pages/user-profile/user-profile.vue

@@ -9,23 +9,24 @@
           </uv-input>
         </uv-form-item>
         <uv-form-item label="所在省份" prop="location" borderBottom required>
-          <ie-picker ref="pickerRef" v-model="form.location" :list="appStore.provinceList" placeholder="选择省份"
+          <ie-picker ref="pickerRef" v-model="examTypeForm.location" :list="provinceList" placeholder="选择省份"
             :custom-style="customStyle" key-label="dictLabel" key-value="dictValue" :disabled="isProvinceDisabled"
             :show-arrow="!isProvinceDisabled" @change="handleProvinceChange"></ie-picker>
         </uv-form-item>
         <uv-form-item label="考生类别" prop="examType" borderBottom required>
-          <ie-picker ref="pickerRef" v-model="form.examType" :list="examTypeList" :disabled="isExamTypeDisabled"
+          <ie-picker ref="pickerRef" v-model="examTypeForm.examType" :list="examTypeList" :disabled="isExamTypeDisabled"
             placeholder="选择考生类别" :custom-style="customStyle" key-label="dictLabel" key-value="dictValue"
-            :show-arrow="!isExamTypeDisabled" @change="handleExamTypeChange"></ie-picker>
+            :show-arrow="!isExamTypeDisabled"></ie-picker>
         </uv-form-item>
-        <uv-form-item v-if="form.examType === 'VHS'" label="专业类别" prop="majorType" borderBottom required>
-          <ie-picker ref="pickerRef" v-model="form.majorType" :list="majorTypes" :disabled="!form.examType"
-            placeholder="选择专业类别" :custom-style="customStyle" key-label="dictLabel" key-value="dictValue"
-            @change="handleMajorChange"></ie-picker>
+        <uv-form-item v-if="examTypeForm.examType === 'VHS'" label="专业类别" prop="majorType" borderBottom required>
+          <ie-picker ref="pickerRef" v-model="examTypeForm.majorType" :list="examMajorList"
+            :disabled="!examTypeForm.examType" placeholder="选择专业类别" :custom-style="customStyle" key-label="dictLabel"
+            key-value="dictValue"></ie-picker>
         </uv-form-item>
         <uv-form-item label="毕业年份" prop="year" required>
-          <ie-picker ref="pickerRef" v-model="form.endYear" :list="endYearList" :disabled="!form.examType"
-            placeholder="选择毕业年份" :custom-style="customStyle" key-label="dictLabel" key-value="dictValue"></ie-picker>
+          <ie-picker ref="pickerRef" v-model="examTypeForm.endYear" :list="endYearList"
+            :disabled="!examTypeForm.examType" placeholder="选择毕业年份" :custom-style="customStyle" key-label="dictLabel"
+            key-value="dictValue"></ie-picker>
         </uv-form-item>
 
       </content-card>
@@ -36,7 +37,7 @@
           </uv-input>
         </uv-form-item>
       </content-card>
-      <content-card title="文化素质">
+      <content-card v-if="showCulture" title="文化素质">
         <uv-form-item label="语文" prop="form.scores.chinese" borderBottom :required="isImproveMode">
           <uv-input v-model="scoresForm.chinese" border="none" type="number" placeholder="满分100分" font-size="30rpx"
             :custom-style="customStyle">
@@ -86,92 +87,41 @@
 <script lang="ts" setup>
 import ContentCard from './components/content-card.vue';
 import { useUserStore } from '@/store/userStore';
-import { } from '@/api/modules/login';
-import { getExamTypes, getExamMajors, getGraduateYears } from '@/api/modules/system';
 import { registry, improve } from '@/api/modules/login';
 import { useTransferPage } from '@/hooks/useTransferPage';
-
+import { useExamType } from '@/composables/useExamType';
 import { useAppStore } from '@/store/appStore';
-import { BindCardInfo, ClassItem, RegisterInfo, SchoolItem, Scores, StudentBindCardInfo } from '@/types/user';
-import { DictItem } from '@/types';
-import { STUDENT_BIND_INFO } from '@/types/injectionSymbols';
+import { BindCardInfo, ClassItem, SchoolItem, Scores } from '@/types/user';
+
 import { getClassList } from '@/api/modules/user';
+const { form: examTypeForm, examTypeList, examMajorList, provinceList, endYearList } = useExamType();
 const userStore = useUserStore();
 const appStore = useAppStore();
 const { prevData, transferTo, transferBack } = useTransferPage();
 
-// const form2 = ref<Partial<StudentBindCardInfo>>({});
-// provide(STUDENT_BIND_INFO, form2);
 const form = ref<Partial<BindCardInfo>>({});
 const scoresForm = ref<Scores>({})
 const formRef = ref();
 const customStyle = {
   paddingLeft: '26px'
 };
-const examTypeList = ref<DictItem[]>([]);
-const endYearList = ref<DictItem[]>([]);
-const majorTypes = ref<DictItem[]>([]);
+
 const isImproveMode = computed(() => prevData.value.scene === 'phone_improve' || prevData.value.scene === 'card_improve');
 const isSchoolDisabled = computed(() => prevData.value.scene === 'card_improve' && prevData.value.card.assignSchoolId);
 const isProvinceDisabled = computed(() => prevData.value.scene === 'card_improve' && prevData.value.card.assignLocation);
-const isExamTypeDisabled = computed(() => (prevData.value.scene === 'card_improve' && prevData.value.card.assignExamType) || !form.value.location);
+const isExamTypeDisabled = computed(() => (prevData.value.scene === 'card_improve' && prevData.value.card.assignExamType) || !examTypeForm.value.location);
 const handleProvinceChange = (val: string) => {
   if (isProvinceDisabled.value) {
     return;
   }
   form.value.examType = '';
   form.value.majorType = '';
-  loadExamTypes();
-}
-
-const handleExamTypeChange = (val: string) => {
-  if (isExamTypeDisabled.value) {
-    return;
-  }
-  form.value.majorType = '';
-  loadMajorTypes();
-  loadGraduateYears();
-}
-
-const loadExamTypes = async () => {
-  console.log(111, form.value.location)
-  if (!form.value.location) {
-    return;
-  }
-  getExamTypes(form.value.location).then(res => {
-    examTypeList.value = res.data;
-  }).catch(err => {
-    console.log('获取考生类别失败', err)
-  });
-};
-
-const loadMajorTypes = async () => {
-  if (!form.value.location || !form.value.examType) {
-    return;
-  }
-  getExamMajors(form.value.location, form.value.examType).then(res => {
-    majorTypes.value = res.data;
-  }).catch(err => {
-    console.log('获取专业类别失败', err)
-  });
-}
-
-const loadGraduateYears = async () => {
-  if (!form.value.location || !form.value.examType) {
-    return;
-  }
-  getGraduateYears(form.value.location, form.value.examType).then(res => {
-    endYearList.value = res.data;
-  }).catch(err => {
-    console.log('获取毕业年份失败', err)
-  });
-}
-
-const handleMajorChange = (val: string) => {
-
 }
 
 const classList = ref<ClassItem[]>([]);
+const showCulture = computed(() => {
+  return examTypeForm.value.examType === 'OHS';
+});
 const handleSchoolSelect = () => {
   if (isSchoolDisabled.value) {
     return;
@@ -200,6 +150,10 @@ const handleGetClassList = () => {
 
 
 const loginValidate = () => {
+  form.value = {
+    ...form.value,
+    ...examTypeForm.value,
+  }
   const { nickName, location, examType, endYear } = form.value;
   if (!nickName || nickName.trim() === '') {
     uni.$ie.showToast('请输入姓名');
@@ -223,34 +177,36 @@ const loginValidate = () => {
     uni.$ie.showToast('请选择毕业年份');
     return false;
   }
-  if (isImproveMode.value) {
-    if (!scoresForm.value.chinese || scoresForm.value.chinese < 0 || scoresForm.value.chinese > 100) {
-      uni.$ie.showToast('请输入正确的语文成绩');
-      return false;
+  if (showCulture.value) {
+    if (isImproveMode.value) {
+      if (!scoresForm.value.chinese || scoresForm.value.chinese < 0 || scoresForm.value.chinese > 100) {
+        uni.$ie.showToast('请输入正确的语文成绩');
+        return false;
+      }
     }
-  }
-  if (isImproveMode.value) {
-    if (!scoresForm.value.mathematics || scoresForm.value.mathematics < 0 || scoresForm.value.mathematics > 100) {
-      uni.$ie.showToast('请输入正确的数学成绩');
-      return false;
+    if (isImproveMode.value) {
+      if (!scoresForm.value.mathematics || scoresForm.value.mathematics < 0 || scoresForm.value.mathematics > 100) {
+        uni.$ie.showToast('请输入正确的数学成绩');
+        return false;
+      }
     }
-  }
-  if (isImproveMode.value) {
-    if (!scoresForm.value.foreign || scoresForm.value.foreign < 0 || scoresForm.value.foreign > 100) {
-      uni.$ie.showToast('请输入正确的外语成绩');
-      return false;
+    if (isImproveMode.value) {
+      if (!scoresForm.value.foreign || scoresForm.value.foreign < 0 || scoresForm.value.foreign > 100) {
+        uni.$ie.showToast('请输入正确的外语成绩');
+        return false;
+      }
     }
-  }
-  if (isImproveMode.value) {
-    if (!scoresForm.value.physics || scoresForm.value.physics < 0 || scoresForm.value.physics > 100) {
-      uni.$ie.showToast('请输入正确的物理成绩');
-      return false;
+    if (isImproveMode.value) {
+      if (!scoresForm.value.physics || scoresForm.value.physics < 0 || scoresForm.value.physics > 100) {
+        uni.$ie.showToast('请输入正确的物理成绩');
+        return false;
+      }
     }
-  }
-  if (isImproveMode.value) {
-    if (!scoresForm.value.political || scoresForm.value.political < 0 || scoresForm.value.political > 100) {
-      uni.$ie.showToast('请输入正确的政治成绩');
-      return false;
+    if (isImproveMode.value) {
+      if (!scoresForm.value.political || scoresForm.value.political < 0 || scoresForm.value.political > 100) {
+        uni.$ie.showToast('请输入正确的政治成绩');
+        return false;
+      }
     }
   }
   if (isImproveMode.value) {
@@ -284,28 +240,9 @@ const handleSubmit = async () => {
         }
         console.log('params', params)
         if (prevData.value.scene === 'card_improve') {
-          uni.$ie.showLoading();
-          const { token } = await registry(params as BindCardInfo);
-          if (token) {
-            await userStore.login(token);
-          }
-          uni.$ie.hideLoading();
-          uni.$ie.showSuccess('登录成功');
-          setTimeout(() => {
-            transferTo('/pagesMain/pages/index/index', {
-              type: 'reLaunch'
-            });
-          }, 800);
+          startLogin(params as BindCardInfo);
         } else {
-          uni.$ie.showLoading();
-          await improve(params as BindCardInfo);
-          uni.$ie.hideLoading();
-          uni.$ie.showSuccess('绑定成功');
-          setTimeout(() => {
-            transferTo('/pagesMain/pages/index/index', {
-              type: 'reLaunch'
-            });
-          }, 800);
+          startBind(params as BindCardInfo)
         }
       } else {
         const { mobile, password, code, uuid } = prevData.value;
@@ -316,20 +253,7 @@ const handleSubmit = async () => {
           code,
           uuid,
         }
-        uni.$ie.showLoading();
-        const { token } = await registry(params as RegisterInfo);
-        if (token) {
-          const isLogin = await userStore.login(token);
-          uni.$ie.hideLoading();
-          uni.$ie.showSuccess('登录成功');
-          if (isLogin) {
-            setTimeout(() => {
-              transferTo('/pagesMain/pages/index/index', {
-                type: 'reLaunch'
-              });
-            }, 88);
-          }
-        }
+        startLogin(params as BindCardInfo);
       }
     } catch (error) {
       console.error(error)
@@ -337,9 +261,45 @@ const handleSubmit = async () => {
   }
 }
 
+const startBind = async (params: BindCardInfo) => {
+  uni.$ie.showLoading();
+  await improve(params);
+  uni.$ie.hideLoading();
+  uni.$ie.showSuccess('绑定成功');
+  goHome();
+}
+
+const startLogin = async (params: BindCardInfo) => {
+  uni.$ie.showLoading();
+  const { token } = await registry(params);
+  if (token) {
+    const isLogin = await userStore.login(token);
+    uni.$ie.hideLoading();
+    uni.$ie.showSuccess('登录成功');
+    if (isLogin) {
+      goHome();
+    }
+  }
+}
+
+const goHome = () => {
+  setTimeout(() => {
+    transferTo('/pagesMain/pages/index/index', {
+      type: 'reLaunch'
+    });
+  }, 600);
+}
+
 const gatherInfo = () => {
   const { scene, card, phone, code, uuid } = prevData.value;
   console.log('prevData.value', prevData.value)
+  if (userStore.tempInfo?.location) {
+    examTypeForm.value.location = userStore.tempInfo?.location;
+    setTimeout(() => {
+      examTypeForm.value.examType = userStore.tempInfo!.examType;
+    }, 0)
+  }
+  console.log('examTypeForm', examTypeForm)
   if (scene === 'card_improve') {
     form.value = {
       location: card.assignLocation,
@@ -352,7 +312,6 @@ const gatherInfo = () => {
       mobile: phone
       // code
     };
-    loadExamTypes();
     handleGetClassList();
   } else if (scene === 'phone_improve') {
     const { nickName, location, examType, endYear, scores } = userStore.userInfo;
@@ -364,15 +323,6 @@ const gatherInfo = () => {
       scores
     };
     scoresForm.value = scores;
-    if (location) {
-      loadExamTypes();
-    }
-    if (examType) {
-      loadMajorTypes();
-    }
-    if (endYear) {
-      loadGraduateYears();
-    }
   }
 }
 

BIN
src/static/image/icon-location.png


+ 1 - 1
src/store/appStore.ts

@@ -51,7 +51,7 @@ export const useAppStore = defineStore('ie-app', {
      */
     async loadPreloadData() {
       await this.loadConfig();
-      await this.loadProvince();
+      // await this.loadProvince();
     },
     /**
      * 加载参数配置

+ 30 - 2
src/store/userStore.ts

@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
 import { useTransferPage } from '@/hooks/useTransferPage';
 import { ref, computed } from 'vue';
 import { getUserInfo } from '@/api/modules/login';
-import avatarDefault from '@/static/image/avatar.png';
+
 import { UserStoreState } from '@/types';
 import { UserInfo, VipCardInfo } from '@/types/user';
 import tools from '@/utils/uni-tool';
@@ -23,6 +23,11 @@ export const useUserStore = defineStore('ie-user', {
     card: null,
     isDefaultModifyPwd: false,
     isPasswordExpired: false,
+    tempInfo: {
+      location: '',
+      examType: '',
+    },
+    rememberPwd: false
   }),
   getters: {
     isLogin(state: UserStoreState): boolean {
@@ -43,7 +48,7 @@ export const useUserStore = defineStore('ie-user', {
       }
       return '';
     },
-    isVip(state: UserStoreState): boolean {
+    isVip(): boolean {
       return !!this.userInfo.cardId;
     },
     vipInfo(state: UserStoreState): VipCardInfo {
@@ -52,6 +57,19 @@ export const useUserStore = defineStore('ie-user', {
       }
       return {} as VipCardInfo;
     },
+    // 兼容游客时显示
+    getLocation(): string {
+      if (this.isLogin) {
+        return this.user?.location || '';
+      }
+      return this.tempInfo?.location || '';
+    },
+    getExamType(): string {
+      if (this.isLogin) {
+        return this.user?.examType || '';
+      }
+      return this.tempInfo?.examType || '';
+    }
   },
   actions: {
     async login(token: string) {
@@ -126,7 +144,17 @@ export const useUserStore = defineStore('ie-user', {
       this.user = null;
       this.isDefaultModifyPwd = false;
       this.isPasswordExpired = false;
+      this.tempInfo = {
+        location: '',
+        examType: ''
+      }
       oldUserStore.Logout();
+      const { transferTo } = useTransferPage();
+      setTimeout(() => {
+        transferTo('/pagesMain/pages/index/index', {
+          type: 'reLaunch'
+        })
+      }, 300);
     },
   },
   persist: {

+ 5 - 0
src/types/index.ts

@@ -78,6 +78,11 @@ export interface UserStoreState {
   isDefaultModifyPwd?: boolean;
   isPasswordExpired?: boolean;
   card: VipCardInfo | null;
+  tempInfo?: {
+    location: string;
+    examType: string;
+  },
+  rememberPwd: boolean
 }
 
 /**

+ 0 - 7
src/types/injectionSymbols.ts

@@ -1,6 +1,4 @@
 import type { InjectionKey } from 'vue'
-import { StudentBindCardInfo } from './user';
-
 /**
  * 打开知识点记录详情
  */
@@ -15,8 +13,3 @@ export const OPEN_PRACTICE_DETAIL = Symbol('OPEN_PRACTICE_DETAIL') as InjectionK
  * 打开视频记录详情
  */
 export const OPEN_VIDEO_DETAIL = Symbol('OPEN_VIDEO_DETAIL') as InjectionKey<(id: number, name: string) => void>;
-
-/**
- * 学生绑定卡信息
- */
-export const STUDENT_BIND_INFO = Symbol('STUDENT_BIND_CARD_INFO') as InjectionKey<Ref<Partial<StudentBindCardInfo>>>;

+ 0 - 4
src/types/user.ts

@@ -39,10 +39,6 @@ export interface SchoolInfo {
   classId?: number;
 }
 
-export interface StudentBindCardInfo extends StudentExamInfo, InviteInfo, SchoolInfo {
-  scores: Scores;
-}
-
 
 export interface SchoolListQueryDTO {
   keyword?: string;

+ 1 - 1
src/uni_modules/uv-navbar/components/uv-navbar/uv-navbar.vue

@@ -22,7 +22,7 @@
 			>
 				<view
 					class="uv-navbar__content__left"
-					hover-class="uv-navbar__content__left--hover"
+					:hover-class="clickHover ? 'uv-navbar__content__left--hover' : ''"
 					hover-start-time="150"
 					@tap="leftClick"
 				>