hare8999@163.com преди 1 година
родител
ревизия
22548ca134
променени са 3 файла, в които са добавени 16 реда и са изтрити 17 реда
  1. 4 1
      src/components/TransferMixin.js
  2. 0 8
      src/router/index.js
  3. 12 8
      src/views/index/components/index-card-test4.vue

+ 4 - 1
src/components/TransferMixin.js

@@ -58,9 +58,12 @@ export default {
         localStorage.setItem(safeKey, query.data)
         query = { cacheKey: safeKey, ts: new Date().getTime() }
       }
-      const location = {
+      const location = typeof path === 'string' ? {
         path: path,
         query: query
+      } : {
+        ...path,
+        query: query
       }
       if (useReplace !== '_blank') {
         return useReplace ? this.$router.replace(location) : this.$router.push(location)

+ 0 - 8
src/router/index.js

@@ -752,14 +752,6 @@ export const constantRoutes = [{
     component: Layout,
     hidden: true,
     children: [
-      {
-        path: '/elective/test/index',
-        component: (resolve) => require(['@/views/elective/test/index'], resolve),
-        name: 'ElectiveTestIndex',
-        meta: {
-          title: '选科测评'
-        }
-      },
       {
         path: '/elective/test/elective-paper',
         component: (resolve) => require(['@/views/elective/test/elective-paper'], resolve),

+ 12 - 8
src/views/index/components/index-card-test4.vue

@@ -2,16 +2,16 @@
   <index-card simple title="我的测评">
     <el-row :gutter="12">
       <el-col :span="6" @click.native="goTestElective">
-        <el-image :src="require('@/assets/images/index/elective/test-elective.png')" class="rd8 pointer" />
+        <el-image :src="require('@/assets/images/index/elective/test-elective.png')" class="rd8 pointer"/>
       </el-col>
       <el-col :span="6" @click.native="goTestCareer">
-        <el-image :src="require('@/assets/images/index/elective/test-career.png')" class="rd8 pointer" />
+        <el-image :src="require('@/assets/images/index/elective/test-career.png')" class="rd8 pointer"/>
       </el-col>
       <el-col v-if="!isHiddenV2" :span="6" @click.native="goTestMentalHealth">
-        <el-image :src="require('@/assets/images/index/elective/test-mental-health.png')" class="rd8 pointer" />
+        <el-image :src="require('@/assets/images/index/elective/test-mental-health.png')" class="rd8 pointer"/>
       </el-col>
       <el-col v-if="!isHiddenV2" :span="6" @click.native="goTestMultiway">
-        <el-image :src="require('@/assets/images/index/elective/test-multiway.png')" class="rd8 pointer" />
+        <el-image :src="require('@/assets/images/index/elective/test-multiway.png')" class="rd8 pointer"/>
       </el-col>
     </el-row>
   </index-card>
@@ -34,16 +34,20 @@ export default {
   },
   methods: {
     async goTestElective() {
-
+      await this.loginCheck()
+      this.transferTo({name: 'ElectiveTestIndex'})
     },
     async goTestCareer() {
-
+      await this.loginCheck()
+      this.transferTo({name: 'CareerTestIndex'})
     },
     async goTestMentalHealth() {
-
+      await this.loginCheck()
+      this.transferTo({name: 'MentalHealthIndex'})
     },
     async goTestMultiway() {
-
+      await this.loginCheck()
+      this.transferTo({name: 'MultiwayIndex'})
     }
   }
 }