|
@@ -44,7 +44,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row id="content1">
|
|
<el-row id="content1">
|
|
- <el-col :span="24">
|
|
|
|
|
|
+ <el-col :span="8">
|
|
联系电话:<span>{{ corpInfo.job_tel }}</span>
|
|
联系电话:<span>{{ corpInfo.job_tel }}</span>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -70,16 +70,23 @@
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="3">
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-button type="primary" @click="guanzhuAdd()">{{ guanzhu ? '关注企业' : '取消关注' }}</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<web-intro title="单位简介" :info="corpInfo"></web-intro>
|
|
<web-intro title="单位简介" :info="corpInfo"></web-intro>
|
|
<web-jobs title="招聘职位" :info="jobList" @search="searchJobs"> </web-jobs>
|
|
<web-jobs title="招聘职位" :info="jobList" @search="searchJobs"> </web-jobs>
|
|
</template>
|
|
</template>
|
|
</recruitdetail-layout>
|
|
</recruitdetail-layout>
|
|
|
|
+ <toLogin :display="loginDialog" @close="loginDialog = false" title="请登录"></toLogin>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import recruitdetailLayout from '@/layout/recruitdetail-layout.vue';
|
|
import recruitdetailLayout from '@/layout/recruitdetail-layout.vue';
|
|
|
|
+import toLogin from '@/components/to-login.vue';
|
|
import share from '@/layout/share.vue';
|
|
import share from '@/layout/share.vue';
|
|
import webIntro from '@/layout/detail/web-intro.vue';
|
|
import webIntro from '@/layout/detail/web-intro.vue';
|
|
import webJobs from '@/layout/detail/web-jobs.vue';
|
|
import webJobs from '@/layout/detail/web-jobs.vue';
|
|
@@ -92,17 +99,24 @@ export default {
|
|
share,
|
|
share,
|
|
webIntro,
|
|
webIntro,
|
|
webJobs,
|
|
webJobs,
|
|
|
|
+ toLogin,
|
|
},
|
|
},
|
|
data: () => ({
|
|
data: () => ({
|
|
corpInfo: {},
|
|
corpInfo: {},
|
|
jobList: [],
|
|
jobList: [],
|
|
|
|
+ loginDialog: false,
|
|
|
|
+ guanzhuData: [],
|
|
|
|
+ guanzhu: true,
|
|
}),
|
|
}),
|
|
created() {
|
|
created() {
|
|
this.search();
|
|
this.search();
|
|
|
|
+ if (this.user.id) this.ticketSearch();
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
},
|
|
},
|
|
- computed: {},
|
|
|
|
methods: {
|
|
methods: {
|
|
- ...mapActions(['corpOperation', 'postOperation']),
|
|
|
|
|
|
+ ...mapActions(['corpOperation', 'postOperation', 'userOperation', 'stucorpOperation']),
|
|
async search() {
|
|
async search() {
|
|
if (!this.$route.query.id) return;
|
|
if (!this.$route.query.id) return;
|
|
let result = await this.corpOperation({ type: 'component', data: { corpid: this.$route.query.id } });
|
|
let result = await this.corpOperation({ type: 'component', data: { corpid: this.$route.query.id } });
|
|
@@ -120,6 +134,49 @@ export default {
|
|
this.$set(this, `jobList`, result);
|
|
this.$set(this, `jobList`, result);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async ticketSearch() {
|
|
|
|
+ let result = await this.stucorpOperation({ type: 'search', data: { studid: this.user.id, corpid: this.$route.query.id } });
|
|
|
|
+ this.$set(this, `guanzhuData`, result.data[0]);
|
|
|
|
+ if (result.data && result.data.length > 0) {
|
|
|
|
+ this.guanzhu = false;
|
|
|
|
+ } else {
|
|
|
|
+ this.guanzhu = true;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async getTicket() {
|
|
|
|
+ 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 } });
|
|
|
|
+ let info = result.data.info;
|
|
|
|
+ let body = {};
|
|
|
|
+ body.studid = this.user.id;
|
|
|
|
+ body.corpid = this.corpInfo.id;
|
|
|
|
+ body.corpname = this.corpInfo.corpname;
|
|
|
|
+ body.studname = info.xm;
|
|
|
|
+ body.studschool = info.yx;
|
|
|
|
+ result = await this.stucorpOperation({ type: 'add', data: { query: query, body: body } });
|
|
|
|
+ this.$set(this, `guanzhuData`, result.data);
|
|
|
|
+ this.$message.success('关注成功');
|
|
|
|
+ this.guanzhu = false;
|
|
|
|
+ } else {
|
|
|
|
+ let result = await this.stucorpOperation({ type: 'delete', data: { id: this.guanzhuData.id } }); //this.guanzhuData.id
|
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
|
+ this.$message.success('取消关注成功');
|
|
|
|
+ this.ticketSearch();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(result.errmsg ? result.errmsg : '取消关注失败');
|
|
|
|
+ }
|
|
|
|
+ this.guanzhu = true;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|