Przeglądaj źródła

Merge branch 'master' of http://git.cc-lotus.info/smart-jobs/web-bench

lrf402788946 5 lat temu
rodzic
commit
5635cf5c72
3 zmienionych plików z 50 dodań i 6 usunięć
  1. 36 2
      src/store.js
  2. 12 3
      src/views/home/index.vue
  3. 2 1
      vue.config.js

+ 36 - 2
src/store.js

@@ -12,8 +12,10 @@ const api = {
   corpSchInfo: '/api/corp/corps/{corpid}/schs',
   schs: '/api/corp/schs', //get:按学校查询入驻企业列表;post:申请入驻学校
   profiles: '/api/jobs/profiles', //get查询招生简章列表;post创建招生简章
-  posts: '/api/jobs/posts',
-  postsinfo: '/api/jobs/posts/{id}',
+  // posts: '/api/jobs/posts',
+  // postsinfo: '/api/jobs/posts/{id}',
+  posts: `/adminapi${process.env.NODE_ENV === 'development' ? '' : ' / jobs'}/posts`,
+  postsinfo: `/adminapi${process.env.NODE_ENV === 'development' ? '' : ' / jobs'}/posts/{id}`,
   profilesinfo: '/api/jobs/profiles/{id}',
   infos: '/api/jobs/infos',
   fairs: '/api/jobs/fairs',
@@ -40,6 +42,12 @@ const api = {
   //短信验证码
   message: '/adminapi/verify/sendmessage',
   checkMessage: '/adminapi/verify/check_message',
+  // 关注数
+  stucorp: `/adminapi${process.env.NODE_ENV === 'development' ? '' : ' / jobs'}/studentcorp`,
+  stucorpsearch: `/adminapi${process.env.NODE_ENV === 'development' ? '' : ' / jobs'}/studentcorp`,
+  stucorplist: `/adminapi${process.env.NODE_ENV === 'development' ? '' : ' / jobs'}/studentcorp`,
+  stucorpupdate: `/adminapi${process.env.NODE_ENV === 'development' ? '' : ' / jobs'}/studentcorp`,
+  stucorpdelete: `/adminapi${process.env.NODE_ENV === 'development' ? '' : ' / jobs'}/studentcorp/{id}`,
 };
 
 export default new Vuex.Store({
@@ -369,6 +377,32 @@ export default new Vuex.Store({
       }
       return result;
     },
+    // 学生关注企业
+    async stucorpOperation({ state }, { type, data }) {
+      let result;
+      let { skip, limit } = data;
+      if (type === 'add') {
+        let { query, body } = data;
+        result = await this.$axios.$post(api.stucorp, body, {}, query);
+      }
+      if (type === 'list') {
+        let { corpid } = data;
+        result = await this.$axios.$get(api.stucorplist, {}, { corpid: corpid, skip: skip, limit: limit });
+      }
+      if (type === 'search') {
+        let { id, studid, corpid } = data;
+        result = await this.$axios.$get(api.stucorpsearch, {}, { studid: studid, corpid: corpid });
+      }
+      if (type === 'update') {
+        let { info, id } = data;
+        result = await this.$axios.$post(api.stucorpupdate, info, { id: id });
+      }
+      if (type === 'delete') {
+        let { id } = data;
+        result = await this.$axios.$delete(api.stucorpdelete, {}, { id: id });
+      }
+      return result;
+    },
   },
 });
 

+ 12 - 3
src/views/home/index.vue

@@ -59,8 +59,8 @@
           <li>
             <a href="">
               <span>
-                <em class="number number_s">0</em>
-                <strong class="title">微信关注数</strong>
+                <em class="number number_s">{{ totalGuanzhu }}</em>
+                <strong class="title">关注数</strong>
               </span>
             </a>
           </li>
@@ -135,6 +135,7 @@ export default {
     totalRow: 0,
     totalRowPost: 0,
     totalRowResume: 0,
+    totalGuanzhu: 0,
     resumeListSys: [
       { message: '【在线招聘】您申请的在线招聘:"fffffff,已通过审批', day: '2019-07-02 16:05' },
       { message: '【在线招聘】您申请的在线招聘:"fffffff,已通过审批', day: '2019-07-02 16:05' },
@@ -153,7 +154,7 @@ export default {
     ...mapState(['user']),
   },
   methods: {
-    ...mapActions(['resumesOperation', 'lettersOperation', 'corpSchInfo', 'postOperation']),
+    ...mapActions(['resumesOperation', 'lettersOperation', 'corpSchInfo', 'postOperation', 'stucorpOperation']),
     async search(searchInfo) {
       //1直接拿着参数发送请求
       let result = await this.lettersOperation({ type: 'list', data: { corpname: this.user.corpname } });
@@ -163,6 +164,14 @@ export default {
       } else {
         this.$message.error(result.errmsg ? result.errmsg : 'error');
       }
+      result = await this.stucorpOperation({ type: 'list', data: { corpid: this.user.corpid } });
+      if (`${result.errcode}` === '0') {
+        //给this=>vue的实例下在中的list属性,赋予result.data的值
+        console.log(result);
+        this.$set(this, `totalGuanzhu`, result.total);
+      } else {
+        this.$message.error(result.errmsg ? result.errmsg : 'error');
+      }
       result = await this.resumesOperation({ type: 'list', data: { schid: 999991, year: 2018, ...searchInfo } });
       if (`${result.errcode}` === '0') {
         let arr = [];

+ 2 - 1
vue.config.js

@@ -36,8 +36,9 @@ module.exports = {
         ws: true,
       },
       '/adminapi': {
-        target: 'http://10.16.5.15:8105',
+        target: 'http://10.16.5.15:8101',
         ws: true,
+        pathRewrite: { '^/adminapi': '/api' },
       },
     },
   },