guhongwei 5 năm trước cách đây
mục cha
commit
15790ba723

+ 1 - 1
src/pages/corp/router.js

@@ -6,7 +6,7 @@ Vue.use(Router);
 const router = new Router({
   routes: [
     {
-      path: '/',
+      path: '/:id',
       component: () => import('./views/corp/corpDetail.vue'),
     },
   ],

+ 2 - 0
src/pages/corp/store/index.js

@@ -10,6 +10,7 @@ import * as letters from '@/store/letters';
 import * as jobfair from '@/store/jobfair';
 import * as school from '@/store/schoolList';
 import * as user from '@/store/user';
+import * as corp from '@/store/corp';
 
 Vue.use(Vuex);
 
@@ -25,5 +26,6 @@ export default new Vuex.Store({
     jobfair: jobfair,
     school: school,
     user: user,
+    corp: corp,
   },
 });

+ 34 - 25
src/pages/corp/views/corp/corpDetail.vue

@@ -1,56 +1,65 @@
 <template>
   <div id="corpDetail">
-    <el-row style="padding:10px;background:#fff;">
+    <el-row style="padding:10px;background:#fff;min-height: 736px;" v-if="!loading">
       <el-col :span="24" class="top">
         <el-col :span="4" class="image">
-          <el-image style="width:60px;height:60px;" :src="info.logo_url"></el-image>
+          <el-image style="width:60px;height:60px;" :src="getData('identity.logo_url')"></el-image>
         </el-col>
         <el-col :span="19" class="right">
           <el-col :span="24" class="corpname">
-            <p class="textOver">{{ info.corpname }}</p>
+            <p class="textOver">{{ getData('base.corpname') }}</p>
           </el-col>
           <el-col :span="24" class="zhuye">
-            <p class="textOver">{{ info.url }}</p>
+            <p class="textOver">{{ getData('info.url') }}</p>
           </el-col>
         </el-col>
       </el-col>
       <el-col :span="24" class="main">
-        <p>所属行业:{{ info.industry }}</p>
-        <p>标签:{{ info.tags }}</p>
-        <p>规模:{{ info.scale }}</p>
-        <p>地址:{{ info.address }}</p>
-        <p>性质:{{ info.nature }}</p>
-        <p>注册资金:{{ info.reg_capital }}</p>
+        <p>所属行业:{{ getData('identity.industry') }}</p>
+        <p>
+          标签:<span v-for="(item, index) in getData('identity.tags')" :key="index">{{ item }}</span>
+        </p>
+        <p>规模:{{ getData('info.scale') }}</p>
+        <p>地址:{{ getData('info.address') }}</p>
+        <p>性质:{{ getData('identity.nature') }}</p>
+        <p>注册资金:{{ getData('identity.reg_capital') }}</p>
       </el-col>
       <el-col :span="24" class="content">
-        <p>{{ info.intro }}</p>
+        <p>{{ getData('info.intro') }}</p>
       </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
+import { mapActions, mapState } from 'vuex';
+import _ from 'lodash';
 export default {
   name: 'corpDetail',
   props: {},
   components: {},
   data: () => ({
-    info: {
-      logo_url: require('@/assets/logo.png'),
-      corpname: '测试企业',
-      url: 'http://www.baidu.com',
-      industry: '所属行业',
-      tags: '500强',
-      scale: '1万人',
-      address: '吉林省长春市力旺广场B座16楼1608',
-      nature: '其他企业',
-      reg_capital: '1000万以上',
-      intro: '这是企业介绍',
-    },
+    corpInfo: {},
+    loading: true,
   }),
-  created() {},
+  async created() {
+    if (this.$route.params.id) {
+      await this.search();
+    }
+  },
   computed: {},
-  methods: {},
+  methods: {
+    ...mapActions(['corpOperation']),
+    async search() {
+      let { info, base, identity } = await this.corpOperation({ type: 'search', data: { corpid: this.$route.params.id } });
+      this.$set(this, 'corpInfo', { info: info, identity: identity, base: base });
+      this.$set(this, `loading`, false);
+      console.log(this.corpInfo);
+    },
+    getData(target) {
+      return _.get(this.corpInfo, target);
+    },
+  },
 };
 </script>
 

+ 14 - 1
src/pages/jobinfo/views/detail.vue

@@ -3,7 +3,7 @@
     <detail-layout>
       <!-- mainInfo根据内容来撑起;在线招聘直接mainInfo,啥也没有 -->
       <template v-slot:mainInfo>
-        <el-row :span="24" class="jobinfoTop">
+        <el-row :span="24" class="jobinfoTop" @click.native="toHtml(`corp.html#/${info.corpid}`)">
           <h2 class="text-owt">{{ info.corpname }}</h2>
           <p>{{ info.schname }}</p>
         </el-row>
@@ -62,6 +62,19 @@ export default {
         }
       }
     },
+    toHtml(uri, type) {
+      if (type) {
+        let url = '';
+        if (typeof this.user === 'object') {
+          this.user.corpid === undefined ? (url = 'student.html#/') : (url = 'http://hr.smart.cc-lotus.info/mobile/');
+        } else {
+          url = 'register.html#/';
+        }
+        window.location.href = url;
+      } else {
+        window.location.href = uri;
+      }
+    },
   },
 };
 </script>

+ 14 - 1
src/pages/talk/views/detail.vue

@@ -2,7 +2,7 @@
   <div id="detail">
     <detailLayout typeInfo="公司招聘">
       <template v-slot:header>
-        <el-row :span="24" class="talkTop">
+        <el-row :span="24" class="talkTop" @click.native="toHtml(`corp.html#/${info.corpid}`)">
           <el-col :span="24">{{ info.corpname }}</el-col>
         </el-row>
       </template>
@@ -132,6 +132,19 @@ export default {
         message: `${result.errcode}` === '0' ? '成功领到门票' : result.errmsg === '数据已存在' ? '已领取过门票,不能重复领取' : result.errmsg,
       });
     },
+    toHtml(uri, type) {
+      if (type) {
+        let url = '';
+        if (typeof this.user === 'object') {
+          this.user.corpid === undefined ? (url = 'student.html#/') : (url = 'http://hr.smart.cc-lotus.info/mobile/');
+        } else {
+          url = 'register.html#/';
+        }
+        window.location.href = url;
+      } else {
+        window.location.href = uri;
+      }
+    },
   },
 };
 </script>

+ 1 - 1
src/pages/talkList/views/list.vue

@@ -20,7 +20,7 @@
             <el-row :span="24" class="talk_li" v-for="(item, index) in list" :key="index" @click.native="link(item.id)">
               <el-col :span="4"><el-image :src="item.corp.identity.logo_url"></el-image> </el-col>
               <el-col :span="14" class="talk_li14">
-                <el-row class="talk_li14_1" :span="4">{{ item.corpname }}</el-row>
+                <el-row class="talk_li14_1" :span="4">{{ item.title }}</el-row>
                 <el-row><i class="el-icon-location-outline el-icon--left"></i>{{ item.schname }}</el-row>
                 <el-row class="talk_li14_3"><i class="el-icon-office-building el-icon--left"></i>{{ item.address }} </el-row>
               </el-col>