shmily1213 4 settimane fa
parent
commit
91f4e7a449

+ 1 - 1
src/components/ie-page/components/vip-popup.vue

@@ -14,7 +14,7 @@
               <text>权限</text>
             </view>
             <view class="mt-10 text-32 text-fore-light">开通会员,立即畅享专属权益与服务</view>
-            <ie-button custom-class="mt-60" @click="handleBuy">升级VIP权限</ie-button>
+            <!-- <ie-button custom-class="mt-60" @click="handleBuy">升级VIP权限</ie-button> -->
             <ie-button type="info" custom-class="mt-40" @click="handleActivate">已线下购买,去激活</ie-button>
           </view>
           <ie-image :is-oss="true" src="/study-bg14.png" custom-class="absolute bottom-0 left-0 w-full h-full z-0"

+ 8 - 34
src/pagesStudy/pages/index/index.vue

@@ -91,48 +91,22 @@ const firstDirectedSchool = computed(() => directedSchoolData.value[0] || {});
 const hasDirectedSchool = computed(() => directedSchoolData.value.length > 0);
 
 const handlePracticeAll = () => {
-  console.log('handlePracticeAll called, isVip:', userStore.isVip);
-  if (userStore.isVip) {
-    transferTo('/pagesStudy/pages/knowledge-practice/knowledge-practice', {
-      data: {
-        directed: false
-      }
-    });
-  } else {
-    // 通过 ref 调用 ie-page 的方法
-    if (iePageRef.value) {
-      console.log('calling iePageRef.value.showVipPopup()');
-      iePageRef.value.showVipPopup();
-    } else {
-      console.error('iePageRef is not available');
-      uni.$ie.showToast('VIP弹窗功能暂不可用');
+  transferTo('/pagesStudy/pages/knowledge-practice/knowledge-practice', {
+    data: {
+      directed: false
     }
-  }
+  });
 }
 const handlePracticeDirected = async () => {
   if (!hasDirectedSchool.value) {
     uni.$ie.showToast('请先选择定向院校');
     return;
   }
-  const isVip = await userStore.checkVip();
-  console.log('handlePracticeDirected called, isVip:', isVip);
-  if (isVip) {
-    transferTo('/pagesStudy/pages/knowledge-practice/knowledge-practice', {
-      data: {
-        directed: true
-      }
-    });
-  } else {
-    // 通过 ref 调用 ie-page 的方法
-    if (iePageRef.value) {
-      console.log('calling iePageRef.value.showVipPopup()');
-      iePageRef.value.showVipPopup();
-    } else {
-      console.error('iePageRef is not available');
-      uni.$ie.showToast('VIP弹窗功能暂不可用');
+  transferTo('/pagesStudy/pages/knowledge-practice/knowledge-practice', {
+    data: {
+      directed: true
     }
-  }
-
+  });
 }
 const handleSetting = async () => {
   if (hasDirectedSchool.value) {

+ 20 - 11
src/pagesStudy/pages/knowledge-practice/knowledge-practice.vue

@@ -1,5 +1,5 @@
 <template>
-  <ie-page>
+  <ie-page ref="iePageRef">
     <ie-navbar :title="pageTitle" />
     <uv-tabs :list="subjectList" key-name="subjectName" @click="handleChangeTab" :scrollable="true"></uv-tabs>
     <view class="h-16 bg-back"></view>
@@ -10,13 +10,17 @@
 </template>
 
 <script lang="ts" setup>
+import IePage from '@/components/ie-page/ie-page.vue';
 import { useTransferPage } from '@/hooks/useTransferPage';
 import { getSubjectList, getKnowledgeList } from '@/api/modules/study';
 import knowledgeTree from '@/pagesStudy/components/knowledge-tree.vue';
 import * as Study from '@/types/study';
 import { EnumExamMode } from '@/common/enum';
+import { useUserStore } from '@/store/userStore';
 const { prevData, transferTo } = useTransferPage();
 const currentSubjectIndex = ref<number>(-1);
+const userStore = useUserStore();
+const iePageRef = ref<InstanceType<typeof IePage>>();
 const pageTitle = computed(() => {
   if (prevData.value.directed) {
     return '定向刷题';
@@ -51,16 +55,21 @@ const loadKnowledgeList = async () => {
   }
 }
 
-const handleStartPractice = (node: Study.KnowledgeNode) => {
-  transferTo('/pagesStudy/pages/start-exam/start-exam', {
-    data: {
-      name: node.name,
-      mode: EnumExamMode.PRACTICE,
-      paperType: 'Practice',
-      relateId: node.id,
-      directed: prevData.value.directed
-    }
-  });
+const handleStartPractice = async (node: Study.KnowledgeNode) => {
+  const isVip = await userStore.checkVip();
+  if (isVip) {
+    transferTo('/pagesStudy/pages/start-exam/start-exam', {
+      data: {
+        name: node.name,
+        mode: EnumExamMode.PRACTICE,
+        paperType: 'Practice',
+        relateId: node.id,
+        directed: prevData.value.directed
+      }
+    });
+  } else {
+    iePageRef.value?.showVipPopup();
+  }
 }
 
 watch(() => currentSubjectIndex.value, () => {

+ 1 - 1
src/pagesStudy/pages/study-plan/components/page-calendar.vue

@@ -134,7 +134,7 @@ const handleChangeDate = (e: any) => {
 }
 
 const formatMinutes = (val?: number) => {
-  return val ? val / 60 : 0;
+  return val ? Math.round((val / 60)) : 0;
 }
 
 init();

+ 20 - 19
src/pagesSystem/pages/edit-student-profile/edit-student-profile.vue

@@ -41,44 +41,45 @@
         <content-card v-if="userStore.isStudent" title="文化素质">
           <uv-form-item label="语文" prop="name" borderBottom>
             <uv-input v-model="scores.chinese" border="none" placeholder="请输入" placeholderClass="text-30"
-              font-size="30rpx" :custom-style="customStyle" :readonly="form.examType === 'OHS'">
+              font-size="30rpx" :custom-style="customStyle" :readonly="form.examType === EnumExamType.OHS">
             </uv-input>
-            <ie-image v-if="form.examType === 'OHS'" slot="right" src="/pagesSystem/static/image/icon/icon-lock.png"
-              custom-class="w-24 h-30" mode="aspectFill" />
+            <ie-image v-if="form.examType === EnumExamType.OHS" slot="right"
+              src="/pagesSystem/static/image/icon/icon-lock.png" custom-class="w-24 h-30" mode="aspectFill" />
           </uv-form-item>
           <uv-form-item label="数学" prop="name" borderBottom>
             <uv-input v-model="scores.mathematics" border="none" placeholder="请输入" placeholderClass="text-30"
-              font-size="30rpx" :custom-style="customStyle" :readonly="form.examType === 'OHS'">
+              font-size="30rpx" :custom-style="customStyle" :readonly="form.examType === EnumExamType.OHS">
             </uv-input>
-            <ie-image v-if="form.examType === 'OHS'" slot="right" src="/pagesSystem/static/image/icon/icon-lock.png"
-              custom-class="w-24 h-30" mode="aspectFill" />
+            <ie-image v-if="form.examType === EnumExamType.OHS" slot="right"
+              src="/pagesSystem/static/image/icon/icon-lock.png" custom-class="w-24 h-30" mode="aspectFill" />
           </uv-form-item>
-          <uv-form-item label="外语" prop="name" :borderBottom="form.examType !== 'VHS'">
+          <uv-form-item label="外语" prop="name" :borderBottom="form.examType === EnumExamType.OHS">
             <uv-input v-model="scores.foreign" border="none" placeholder="请输入" placeholderClass="text-30"
-              font-size="30rpx" :custom-style="customStyle" :readonly="form.examType === 'OHS'">
+              font-size="30rpx" :custom-style="customStyle" :readonly="form.examType === EnumExamType.OHS">
             </uv-input>
-            <ie-image v-if="form.examType === 'OHS'" slot="right" src="/pagesSystem/static/image/icon/icon-lock.png"
-              custom-class="w-24 h-30" mode="aspectFill" />
+            <ie-image v-if="form.examType === EnumExamType.OHS" slot="right"
+              src="/pagesSystem/static/image/icon/icon-lock.png" custom-class="w-24 h-30" mode="aspectFill" />
           </uv-form-item>
-          <block v-if="['OHS', 'SVS'].includes(form.examType)">
+          <block v-if="[EnumExamType.OHS].includes(form.examType)">
             <uv-form-item label="物理" prop="name" borderBottom>
               <uv-input v-model="scores.physics" border="none" placeholder="请输入" placeholderClass="text-30"
-                font-size="30rpx" :custom-style="customStyle" :readonly="form.examType === 'OHS'">
+                font-size="30rpx" :custom-style="customStyle" :readonly="form.examType === EnumExamType.OHS">
               </uv-input>
-              <ie-image v-if="form.examType === 'OHS'" slot="right" src="/pagesSystem/static/image/icon/icon-lock.png"
-                custom-class="w-24 h-30" mode="aspectFill" />
+              <ie-image v-if="form.examType === EnumExamType.OHS" slot="right"
+                src="/pagesSystem/static/image/icon/icon-lock.png" custom-class="w-24 h-30" mode="aspectFill" />
             </uv-form-item>
             <uv-form-item label="政治" prop="name">
               <uv-input v-model="scores.political" border="none" placeholder="请输入" placeholderClass="text-30"
-                font-size="30rpx" :custom-style="customStyle" :readonly="form.examType === 'OHS'">
+                font-size="30rpx" :custom-style="customStyle" :readonly="form.examType === EnumExamType.OHS">
               </uv-input>
-              <ie-image v-if="form.examType === 'OHS'" slot="right" src="/pagesSystem/static/image/icon/icon-lock.png"
-                custom-class="w-24 h-30" mode="aspectFill" />
+              <ie-image v-if="form.examType === EnumExamType.OHS" slot="right"
+                src="/pagesSystem/static/image/icon/icon-lock.png" custom-class="w-24 h-30" mode="aspectFill" />
             </uv-form-item>
           </block>
         </content-card>
 
-        <content-card v-if="userStore.isStudent && (form.examType === 'OHS' || form.examType === 'SVS')" title="职业技能成绩">
+        <content-card v-if="userStore.isStudent && ([EnumExamType.OHS, EnumExamType.SVS].includes(form.examType))"
+          title="职业技能成绩">
           <uv-form-item label="职业技能" prop="name">
             <uv-input v-model.number="scores.skill" border="none" placeholder="请输入" placeholderClass="text-30"
               font-size="30rpx" :custom-style="customStyle">
@@ -128,7 +129,7 @@ import { updateUserInfo } from '@/api/modules/login';
 import { useUserStore } from '@/store/userStore';
 import { useSchool } from '@/composables/useSchool';
 import { BindCardInfo, UserInfo } from '@/types/user';
-import { EnumDictName, EnumSmsApiType } from '@/common/enum';
+import { EnumDictName, EnumSmsApiType, EnumExamType } from '@/common/enum';
 import { validatePhone } from '@/hooks/useValidation';
 import { validateSms } from '@/api/modules/system';
 const userStore = useUserStore();

+ 2 - 2
src/types/user.ts

@@ -1,4 +1,4 @@
-import { EnumSmsType, EnumUserType } from "@/common/enum";
+import { EnumExamType, EnumSmsType, EnumUserType } from "@/common/enum";
 
 export interface LoginInfo {
   accessToken: string;
@@ -137,7 +137,7 @@ export interface UserInfo {
   cardId?: number;
   code: string;
   endYear: number;
-  examType: string;
+  examType: EnumExamType;
   majorType?: string;
   inviteCode?: string;
   location: string;