Browse Source

企业关注

lrf402788946 5 years ago
parent
commit
018abce382
3 changed files with 15 additions and 13 deletions
  1. 5 5
      src/store.js
  2. 9 7
      src/views/corp/index.vue
  3. 1 1
      src/views/jobfair/detail.vue

+ 5 - 5
src/store.js

@@ -55,10 +55,10 @@ const api = {
   // 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}`,
-  stucorp: `/api/stud/studentcorp`,
-  stucorpsearch: '/api/stud/studentcorp',
-  stucorplist: '/api/stud/studentcorp',
-  stucorpdelete: '/api/stud/studentcorp/{id}',
+  // stucorp: `/api/stud/studentcorp`,
+  stucorp: '/api/jobs/studentcorp',
+  stucorplist: '/api/jobs/studentcorp',
+  stucorpdelete: '/api/jobs/studentcorp/{id}',
   //测试前缀${process.env.NODE_ENV === 'development' ? '/adminapi' : '${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}'}
   //审核过的企业(主站用)
   getCorps: `/api/corp/corps/`,
@@ -369,7 +369,7 @@ export default new Vuex.Store({
       }
       if (type === 'search') {
         let { id, studid, corpid } = data;
-        result = await this.$axios.$get(api.stucorpsearch, {}, { studid: studid, corpid: corpid });
+        result = await this.$axios.$get(api.stucorp, { id: id }, { studid: studid, corpid: corpid });
       }
       if (type === 'update') {
         let { info, id } = data;

+ 9 - 7
src/views/corp/index.vue

@@ -110,11 +110,18 @@ export default {
   }),
   created() {
     this.search();
-    if (this.user.id) this.ticketSearch();
+    // if (this.user.id) this.ticketSearch();
   },
   computed: {
     ...mapState(['user']),
   },
+  watch: {
+    user: {
+      handler(val) {
+        if (val.id) this.ticketSearch();
+      },
+    },
+  },
   methods: {
     ...mapActions(['corpOperation', 'postOperation', 'userOperation', 'stucorpOperation']),
     async search() {
@@ -128,7 +135,6 @@ export default {
       }
     },
     async searchJobs(query) {
-      console.log(query);
       let result = await this.postOperation({ type: 'list', data: { corpid: this.$route.query.id, ...query } });
       if (`${result.errcode}` === '0') {
         this.$set(this, `jobList`, result);
@@ -143,15 +149,11 @@ export default {
         this.guanzhu = true;
       }
     },
-    async getTicket() {
+    async guanzhuAdd() {
       if (!this.user.id) {
         this.loginDialog = true;
         return false;
-      } else {
-        this.ticketSearch();
       }
-    },
-    async guanzhuAdd() {
       if (this.guanzhu) {
         let query = {};
         let result = await this.userOperation({ type: 'search', data: { studid: this.user.id } });

+ 1 - 1
src/views/jobfair/detail.vue

@@ -134,7 +134,7 @@ export default {
       result = await this.ticketsOperation({ type: 'add', data: { query: query, body: body } });
       this.$message({
         type: `${result.errcode}` === '0' ? 'success' : 'error',
-        message: `${result.errcode}` === '0' ? '成功领到门票' : result.errmsg === '数据已存在' ? '已领取过门票,不能重复领取' : result.errmsg,
+        message: `${result.errcode}` === '0' ? '成功领到门票' : result.errmsg,
       });
     },
   },