shilipojs 2 anni fa
parent
commit
48a7f7d1b9

+ 11 - 0
src/api/webApi/career-course.js

@@ -46,6 +46,17 @@ export function universityFilters(){
     method:'get'
   })
 }
+/**
+ * 点击详情增加点击量
+ */
+export function saveUniversitiesHits(params){
+  return request({
+    url:`/front/university/saveUniversitiesHits`,
+    method:'post',
+    params: params
+  })
+}
+
 /**
  * 院校列表
  */

+ 6 - 2
src/views/career/plan/UniversitiesColleges.vue

@@ -62,8 +62,8 @@
                 <img style="width: 100%;height: 100%" :src="item.logo" alt="">
               </div>
               <div class="info ml20">
-                <div class="college_name pointer f-333 f20 mb5">{{item.name}}</div>
-                <div class="tags">
+                <div class="college_name pointer f-333 f20 mb5" @click="toDetail(item)">{{item.name}}</div>
+                <div class="tags" v-if="item.features">
                   <span class="mr5 el-tag el-tag--info el-tag--plain" v-for="feature in item.features.split(',')">{{ feature }}</span>
                 </div>
                 <div class="college-desc mt5 f14 f-666">
@@ -153,6 +153,10 @@ export default {
     this.getFilter()
   },
   methods: {
+    toDetail(item) {
+      console.log(item)
+      this.$router.push({path:'/career/plan/UniversityDetail',query: {code:item.code}})
+    },
     onChangePage(page) {
       this.pageForm.pageSize = page.limit
       this.pageForm.pageNum = page.page

+ 166 - 26
src/views/career/plan/UniversitiesDetail.vue

@@ -3,16 +3,14 @@
     <el-row :gutter="10" class="mt20 mb30">
       <el-col :span="12" class="fx-row ai-center">
         <div class="mr30">
-          <img width="72px" height="72px" src="https://img1.youzy.cn/content/media/thumbs/p00189999.jpeg" alt=""/>
+          <img width="72px" height="72px" :src="baseInfo.logo" alt=""/>
         </div>
         <div>
-          <span class="f28 ">北京大学</span>
-          <div class="mt5">
-            <el-tag class="mr5" size="mini">985</el-tag>
-            <el-tag class="mr5" size="mini">211</el-tag>
-            <el-tag class="mr5" size="mini">保研</el-tag>
+          <span class="f28 ">{{ baseInfo.name }}</span>
+          <div class="mt5 mb5">
+            <el-tag class="mr5" size="mini" v-for="item in baseInfo.features.split(',')">{{ item }}</el-tag>
           </div>
-          <span class="f14 f-666">北京 / 综合 / 公办 / 教育部</span>
+          <span class="f14 f-666 ">{{`${baseInfo.location} ${baseInfo.cityName} ${baseInfo.type} / ${baseInfo.natureTypeCN} / ${baseInfo.managerType} `}}</span>
         </div>
       </el-col>
       <el-col :span="12" class="text-right">
@@ -30,29 +28,52 @@
             <el-col :span="8"> <img src="https://i6.youzy.cn/basiclib/college/images/10003-647784f7.jpg" width="100%" alt=""></el-col>
             <el-col :span="16">
               <div class="f14 f-666 text-center fx-row">
-                <el-col :span="24"  v-for="item  in 8" >
+                <el-col :span="24" v-for="item in iconList">
+                  <img width="50px" :src="item.img" :alt="item.desc">
+                  <p class="mt10">{{ item.value }}</p>
+                </el-col>
+                <el-col :span="24" >
                   <img width="50px" src="https://pv4y-pc.youzy.cn/static/img/icon_shijian@2x.8463f33f.png" alt="">
-                  <p class="mt10">1911年</p>
+                  <p class="mt10">{{`${baseInfo.location} ${baseInfo.cityName}`}}</p>
                 </el-col>
               </div>
-              <div class="mt10  pl10 f14 " style="line-height: 1.7;text-align: justify;">
-                清华大学的前身清华学堂始建于1911年,1912年更名为清华学校。1928年更名为国立清华大学。1937年抗日战争全面爆发后南迁长沙,与北京大学、南开大学组建国立长沙临时大学,1938年迁至昆明改名为国立西南联合大学。1946年迁回清华园,设有文、法、理、工、农等5个学院、26个系。
-                1952年全国高等学校院系调整后,清华大学成为一所多科性工业大学,重点为国家培养工程技术人才,被誉为“红色工程师...
+              <div class="mt10  pl10 f14">
+                <span class="info-tips"> {{
+                    baseInfo.introduction
+                  }}</span>
+                <p class="text-right mr10"><el-button type="text">全部</el-button></p>
               </div>
             </el-col>
           </el-row>
-          <div class="mt20">
-            <p class="format-tit">特色专业</p>
-          </div>
-          <div class="mt20">
-            <p class="format-tit">重点学科</p>
-          </div>
-          <div class="mt20">
-            <p class="format-tit">双一流学科</p>
-          </div>
-          <div class="mt20">
-            <p class="format-tit">院系设置</p>
+          <div style="width:70%">
+            <div class="mt20" >
+              <p class="format-tit">特色专业</p>
+              <mx-table border :propDefines="professionsProps" :rows="formatProfessions">
+                <template #tmp="{row}">
+                  <p class="major-wrap">
+                    <a v-for="item in row.majors">{{item.name}}</a>
+                  </p>
+                </template>
+              </mx-table>
+            </div>
+            <div class="mt20">
+              <p class="format-tit">重点学科</p>
+            </div>
+            <div class="mt20">
+              <p class="format-tit">双一流学科</p>
+            </div>
+            <div class="mt20">
+              <p class="format-tit">院系设置</p>
+              <mx-table border :propDefines="collegeProps" :rows="departments">
+                <template #tmp="{row}">
+                  <p class="major-wrap">
+                    <a v-for="item in row.departmentMajor">{{item.name}}</a>
+                  </p>
+                </template>
+              </mx-table>
+            </div>
           </div>
+
         </div>
         <!--  招生简章-->
         <enroll-list v-if="tabActive == 1"></enroll-list>
@@ -66,17 +87,116 @@
 <script>
 import EnrollList from './compoents/EnrollList'
 import UniversityStyle from './compoents/UniversityStyle'
+import { saveUniversitiesHits, selectUniversityDetail } from '@/api/webApi/career-course'
+
 export default {
   name: 'UniversityDetail',
   components: {EnrollList,UniversityStyle},
   data() {
     return {
-      tabActive: 0
+      tabActive: 0,
+      baseInfo:'',
+      departments:[],
+      professions:{},
+      professionsProps:{
+        level: {
+          label:'专业层次',
+          width:'200'
+        },
+        count: {
+          label:'数量',
+          width:'100'
+        },
+        majors: {
+          label:'专业',
+          slot: 'tmp'
+        },
+      },
+      subjects:'',
+      collegeProps:{
+        name: {
+          label:'学院',
+          width:'200'
+        },
+        departmentMajor: {
+          label:'包含专业',
+          slot: 'tmp'
+        },
+      }
+    }
+  },
+  created() {
+    this.code = this.$route.query.code
+    this.getHit()
+    this.getDetail()
+  },
+  computed: {
+    formatProfessions(){
+      const arr = []
+      for (const key in this.professions) {
+        console.log(key)
+        let item = {
+          level: key == 'country' ? '国家级' : '省级(直辖市)',
+          count: this.professions[key].length,
+          majors: this.professions[key]
+        }
+        arr.push(item)
+      }
+      return arr
+    },
+    iconList() {
+      const baseInfo  = this.baseInfo
+      return [
+        {
+          img: 'https://pv4y-pc.youzy.cn/static/img/icon_shijian@2x.8463f33f.png',
+          value: `${baseInfo.createdYear}年`,
+          desc:'创办时间'
+        },
+        {
+          img: 'https://pv4y-pc.youzy.cn/static/img/icon_shijian@2x.8463f33f.png',
+          value: baseInfo.natureTypeCN,
+          desc:'办学类型'
+        },
+        {
+          img: 'https://pv4y-pc.youzy.cn/static/img/icon_shijian@2x.8463f33f.png',
+          value: baseInfo.type,
+          desc:'院校类型'
+        },
+        {
+          img: 'https://pv4y-pc.youzy.cn/static/img/icon_shijian@2x.8463f33f.png',
+          value: baseInfo.managerType,
+          desc:'所属部门'
+        },
+        {
+          img: 'https://pv4y-pc.youzy.cn/static/img/icon_shijian@2x.8463f33f.png',
+          value: baseInfo.level,
+          desc:'学历层次'
+        },
+        {
+          img: 'https://pv4y-pc.youzy.cn/static/img/icon_shijian@2x.8463f33f.png',
+          value: `${baseInfo.location} ${baseInfo.cityName}`,
+          desc:'所处地'
+        }
+      ]
     }
   },
-  computed: {},
   watch: {},
-  methods: {}
+  methods: {
+    getHit() {
+      saveUniversitiesHits({code:this.code}).then(res => {
+        console.log(res)
+      })
+    },
+    getDetail() {
+      selectUniversityDetail({code: this.code}).then(res => {
+        this.baseInfo = res.data.baseInfo
+        this.departments = res.data.departments
+        this.professions = res.data.professions
+        this.subjects = res.data.subjects
+        console.log(res)
+      })
+    }
+  }
 }
 </script>
 
@@ -108,5 +228,25 @@ export default {
     margin-bottom: 20px;
     font-size: 20px;
   }
+  .info-tips{
+    overflow : hidden;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-line-clamp: 4;
+    -webkit-box-orient: vertical;
+    word-wrap: break-word;
+  }
+  .major-wrap{
+    text-align: left;
+    a{
+      display: inline-block;
+      margin-right: 20px;
+      margin-top: 10px;
+      margin-bottom: 10px;
+      &:hover{
+        color: #42b983;
+      }
+    }
+  }
 }
 </style>

+ 7 - 7
src/views/career/subject/subjectChoice.vue

@@ -69,10 +69,10 @@
               <el-radio-button label="">所有</el-radio-button>
               <el-radio-button
                 v-for="item in form.features"
-                :key="item.code"
-                :label="item.code"
+                :key="item"
+                :label="item"
                 style="margin-bottom: 10px"
-              >{{item.label}}</el-radio-button>
+              >{{item}}</el-radio-button>
             </el-radio-group>
           </el-row>
           <el-row class="radioInput">
@@ -146,7 +146,7 @@
 </template>
 
 <script>
-  import { selectUniversity } from '@/api/webApi/career-course'
+  import { universityFilters } from '@/api/webApi/career-course'
   import {collectAdd, collectRemove, xkcxlist, xkcxYears,saveSelectCourse} from "@/api/webApi/webQue";
   import MxSearchGroup from "@/components/MxSearch/mx-search-group";
 
@@ -162,7 +162,7 @@
       },
       year: {
         type: Number,
-        default: ''
+        default: 0
       },
       readonly: {
         type: Boolean,
@@ -239,7 +239,7 @@
     created() {
       this.selected.sciences[0] = this.course0 ? [this.course0] : []
       this.selected.sciences[1] = this.course1? this.course1.split(',') :[]
-      this.selected.years = this.year
+      this.selected.years = this.year ?  this.year : this.form.years[0]
       if(this.course0 && this.course1) this.httpGetXkcxList()
       this.getYears();
       this.getUniversity();
@@ -255,7 +255,7 @@
       },
       // 取其他条件清单
       getUniversity() {
-        selectUniversity().then(res => {
+        universityFilters().then(res => {
           this.form.features = res.data.features;
           this.form.locations = res.data.locations;
           this.form.levels = res.data.levels;