فهرست منبع

视频、资讯路由整合

shilipojs 2 سال پیش
والد
کامیت
60e2eb8469

+ 0 - 68
src/views/career/information/careerInfo.vue

@@ -1,68 +0,0 @@
-<template>
-  <div class="info-container">
-    <el-container>
-      <el-main>
-        <info-list
-          class="mt10"
-          :type="type"
-          v-show="!detailMode"
-          @click="detailList"
-        ></info-list>
-        <info-detail
-          class="mt10"
-          v-if="detailMode"
-          :type="type"
-          :title="detailTitle"
-          :id="detailId"
-          @close="detailClose"
-        />
-      </el-main>
-<!--      <el-aside width="400px" style="background-color: #ffffff">-->
-<!--        <el-card class="mt20" v-for="opt in typeOptions" :key="opt.value">-->
-<!--          <info-sample-->
-<!--            :type="opt.label"-->
-<!--            :title="opt.label"-->
-<!--            @click="detailSample"-->
-<!--          /></el-card>-->
-<!--      </el-aside>-->
-    </el-container>
-  </div>
-</template>
-<script>
-import InfoDetail from "../components/infoDetail.vue";
-import infoList from "../components/infoList.vue";
-import InfoSample from "../components/infoSample.vue";
-import * as career from "@/api/webApi/career-news";
-
-export default {
-  components: { infoList, InfoSample, InfoDetail },
-  data() {
-    return {
-      detailMode: false,
-      detailTitle: "",
-      detailId: 0,
-      type: "",
-    };
-  },
-  mounted() {
-    this.type = '生涯资讯'
-  },
-  methods: {
-    detailList(item) {
-      this.detailTitle = item.title;
-      this.detailId = item.id;
-      this.detailMode = true;
-    },
-    detailSample(item) {
-      this.detailTitle = item.title;
-      this.detailId = item.id;
-      this.detailMode = true;
-    },
-    detailClose() {
-      this.detailMode = false;
-    }
-  },
-};
-</script>
-<style lang="scss" scoped>
-</style>

+ 8 - 9
src/views/career/information/singleStroke.vue

@@ -17,14 +17,6 @@
           @close="detailClose"
         />
       </el-main>
-<!--      <el-aside width="400px" style="background-color: #ffffff">-->
-<!--        <el-card class="mt20" v-for="opt in typeOptions" :key="opt.value">-->
-<!--          <info-sample-->
-<!--            :type="opt.label"-->
-<!--            :title="opt.label"-->
-<!--            @click="detailSample"-->
-<!--          /></el-card>-->
-<!--      </el-aside>-->
     </el-container>
   </div>
 </template>
@@ -42,10 +34,17 @@ export default {
       detailTitle: "",
       detailId: 0,
       type: "",
+      category: {
+        single: '单招志愿',
+        syzx: '生涯资讯',
+      },
     };
   },
   mounted() {
-    this.type = '单招志愿'
+    const subPaths = this.$route.path.split("/");
+    const lastSubPath = subPaths[subPaths.length - 1]
+    const typeKey = lastSubPath.split("_")[lastSubPath.split("_").length - 1]
+    this.type = this.category[typeKey]
   },
   methods: {
     detailList(item) {

+ 0 - 79
src/views/career/newGaokao/raisePoints.vue

@@ -1,79 +0,0 @@
-<template>
-  <div class="app-container">
-    <div class="career-course-body mt10">
-      <el-row v-if="total > 0" :gutter="10">
-        <el-col class="evaluation-card-wrapper" v-for="c in dataList" :key="c.id" :span="4">
-          <el-card>
-            <course-card @click.native="detail(c)" :img="c.coverUrl" :title="c.title" :count="c.clicked"></course-card>
-          </el-card>
-        </el-col>
-      </el-row>
-      <evaluation-empty class="mt10" v-else />
-      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" :page-size="12" :pageSizes="[12, 24, 48]" @pagination="getList" />
-    </div>
-  </div>
-</template>
-<script>
-import {
-  gkVideo,
-  saveClicked
-} from "@/api/webApi/career-news";
-import courseCard from "../components/courseCard.vue";
-
-export default {
-  components:{
-    courseCard
-  },
-  data() {
-    return {
-      type:'高考提分',
-      queryParams:{
-        pageSize:12,
-        pageNum: 1
-      },
-      total:0,
-      dataList:[]
-    };
-  },
-  mounted() {
-    this.type = '高考提分'
-    this.getList()
-  },
-  methods: {
-    detail (item) {
-      this.saveClick(item.id)
-      const nextParams = {
-        id: item.id,
-        aliid: item.aliId.split(',')[1],
-        aliIdType: item.aliIdType,
-        name: item.title,
-        count: item.clicked,
-        img: item.coverUrl,
-      };
-      this.$router.push({
-        path: "/career/plan/detail",
-        query: nextParams,
-      });
-    },
-    saveClick(id) {
-      saveClicked({
-        id: id
-      }).then(res => {
-        console.log(res)
-      })
-    },
-    getList() {
-      gkVideo({
-        type: this.type,
-        tag: '',
-        ...this.queryParams
-      }).then(res => {
-        this.total = res.total
-        this.dataList = res.rows
-      })
-    }
-  },
-};
-</script>
-<style lang="scss" scoped>
-</style>

+ 30 - 25
src/views/career/newGaokao/video.vue

@@ -4,44 +4,49 @@
       <el-row v-if="total > 0" :gutter="10">
         <el-col class="evaluation-card-wrapper" v-for="c in dataList" :key="c.id" :span="4">
           <el-card>
-            <course-card @click.native="detail(c)" :img="c.coverUrl" :title="c.title" :count="c.clicked"></course-card>
+            <course-card class="pointer" @click.native="detail(c)" :img="c.coverUrl" :title="c.title" :count="c.clicked"></course-card>
           </el-card>
         </el-col>
       </el-row>
-      <evaluation-empty class="mt10" v-else />
-      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" :page-size="12" :pageSizes="[12, 24, 48]" @pagination="getList" />
+      <evaluation-empty class="mt10" v-else/>
+      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+                  :page-size="12" :pageSizes="[12, 24, 48]" @pagination="getList"
+      />
     </div>
   </div>
 </template>
 <script>
-import {
-  gkVideo,
-  saveClicked
-} from "@/api/webApi/career-news";
-import courseCard from "../components/courseCard.vue";
+import { gkVideo, saveClicked } from '@/api/webApi/career-news'
+import courseCard from '../components/courseCard.vue'
 
 export default {
-  components:{
+  components: {
     courseCard
   },
   data() {
     return {
-      type:'高考视频',
-      queryParams:{
-        pageSize:12,
+      type: '',
+      queryParams: {
+        pageSize: 12,
         pageNum: 1
       },
-      total:0,
-      dataList:[]
-    };
+      category: {
+        gksp: '高考视频',
+        gktf: '高考提分',
+      },
+      total: 0,
+      dataList: []
+    }
   },
   mounted() {
-    console.log(this.$route.query.type)
-    this.type = '高考视频'
+    const subPaths = this.$route.path.split("/");
+    const lastSubPath = subPaths[subPaths.length - 1]
+    const typeKey = lastSubPath.split("_")[lastSubPath.split("_").length - 1]
+    this.type = this.category[typeKey]
     this.getList()
   },
   methods: {
-    detail (item) {
+    detail(item) {
       this.saveClick(item.id)
       const nextParams = {
         id: item.id,
@@ -49,12 +54,12 @@ export default {
         aliIdType: item.aliIdType,
         name: item.title,
         count: item.clicked,
-        img: item.coverUrl,
-      };
+        img: item.coverUrl
+      }
       this.$router.push({
-        path: "/career/plan/detail",
-        query: nextParams,
-      });
+        path: '/career/plan/detail',
+        query: nextParams
+      })
     },
     saveClick(id) {
       saveClicked({
@@ -73,8 +78,8 @@ export default {
         this.dataList = res.rows
       })
     }
-  },
-};
+  }
+}
 </script>
 <style lang="scss" scoped>
 </style>