index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div id="index">
  3. <recruitdetail-layout :needRight="false">
  4. <template v-slot:mainInfoTop>
  5. <el-row>
  6. <el-col :span="24">
  7. <el-breadcrumb separator-class="el-icon-arrow-right">
  8. <el-breadcrumb-item :to="{ path: '/' }">
  9. <i class="el-icon-s-home"></i>
  10. <span>网站首页</span>
  11. </el-breadcrumb-item>
  12. <el-breadcrumb-item class="webDetail">企业详情</el-breadcrumb-item>
  13. </el-breadcrumb>
  14. </el-col>
  15. </el-row>
  16. <share></share>
  17. </template>
  18. <template v-slot:mainLeft>
  19. <el-row class="webMessage" type="flex">
  20. <el-col :span="24">企业信息</el-col>
  21. </el-row>
  22. <el-row type="flex" class="baseRow">
  23. <el-col :span="3">
  24. <el-image style="width:5.25rem;height:5.25rem;" :src="corpInfo.logo_url" fit="fill"></el-image>
  25. </el-col>
  26. <el-col :span="18">
  27. <el-row id="corpname">
  28. <el-col :span="24">{{ corpInfo.corpname }}</el-col>
  29. </el-row>
  30. <el-row id="industry">
  31. <el-col :span="8">
  32. 行业:<span>{{ corpInfo.industry }}</span>
  33. </el-col>
  34. <el-col :span="12">
  35. 规模:<span>{{ corpInfo.scale }}</span>
  36. </el-col>
  37. </el-row>
  38. <el-row id="address">
  39. <el-col :span="8">
  40. 城市:<span>{{ corpInfo.province }}-{{ corpInfo.city }}</span>
  41. </el-col>
  42. <el-col :span="16">
  43. 地址:<span>{{ corpInfo.address }}</span>
  44. </el-col>
  45. </el-row>
  46. <el-row id="content1">
  47. <el-col :span="8">
  48. 联系电话:<span>{{ corpInfo.job_tel }}</span>
  49. </el-col>
  50. </el-row>
  51. <el-row id="content2">
  52. <el-col :span="24">
  53. 邮箱:<span>{{ corpInfo.job_email }}</span>
  54. </el-col>
  55. </el-row>
  56. <el-row id="other">
  57. <el-col :span="8">
  58. 注册资金:<span>{{ corpInfo.reg_capital }}</span>
  59. </el-col>
  60. </el-row>
  61. <el-row>
  62. <el-col :span="24">
  63. 企业标签:
  64. <el-tag v-for="(item, index) in corpInfo.tags" :key="index">{{ item }}</el-tag>
  65. </el-col>
  66. </el-row>
  67. <el-row>
  68. <el-col :span="24" v-if="corpInfo.url">
  69. <el-link :underline="false" href="corpInfo.url">企业官网</el-link>
  70. </el-col>
  71. </el-row>
  72. </el-col>
  73. <el-col :span="3">
  74. <el-col :span="24">
  75. <el-button type="primary" @click="guanzhuAdd()">{{ guanzhu ? '关注企业' : '取消关注' }}</el-button>
  76. </el-col>
  77. </el-col>
  78. </el-row>
  79. <web-intro title="单位简介" :info="corpInfo"></web-intro>
  80. <web-jobs title="招聘职位" :info="jobList" @search="searchJobs"> </web-jobs>
  81. </template>
  82. </recruitdetail-layout>
  83. <toLogin :display="loginDialog" @close="loginDialog = false" title="请登录"></toLogin>
  84. </div>
  85. </template>
  86. <script>
  87. import recruitdetailLayout from '@/layout/recruitdetail-layout.vue';
  88. import toLogin from '@/components/to-login.vue';
  89. import share from '@/layout/share.vue';
  90. import webIntro from '@/layout/detail/web-intro.vue';
  91. import webJobs from '@/layout/detail/web-jobs.vue';
  92. import { mapActions, mapState } from 'vuex';
  93. export default {
  94. name: 'index',
  95. props: {},
  96. components: {
  97. recruitdetailLayout,
  98. share,
  99. webIntro,
  100. webJobs,
  101. toLogin,
  102. },
  103. data: () => ({
  104. corpInfo: {},
  105. jobList: [],
  106. loginDialog: false,
  107. guanzhuData: [],
  108. guanzhu: true,
  109. }),
  110. created() {
  111. this.search();
  112. if (this.user.id) this.ticketSearch();
  113. },
  114. computed: {
  115. ...mapState(['user']),
  116. },
  117. methods: {
  118. ...mapActions(['corpOperation', 'postOperation', 'userOperation', 'stucorpOperation']),
  119. async search() {
  120. if (!this.$route.query.id) return;
  121. let result = await this.corpOperation({ type: 'component', data: { corpid: this.$route.query.id } });
  122. if (`${result.errcode}` === '0') {
  123. this.$set(this, 'corpInfo', result.data);
  124. this.$set(this.corpInfo, `id`, this.$route.query.id);
  125. } else {
  126. this.$message.error(result.errmsg ? result.errmsg : 'error');
  127. }
  128. },
  129. async searchJobs(query) {
  130. console.log(query);
  131. let result = await this.postOperation({ type: 'list', data: { corpid: this.$route.query.id, ...query } });
  132. if (`${result.errcode}` === '0') {
  133. this.$set(this, `jobList`, result);
  134. }
  135. },
  136. async ticketSearch() {
  137. let result = await this.stucorpOperation({ type: 'search', data: { studid: this.user.id, corpid: this.$route.query.id } });
  138. this.$set(this, `guanzhuData`, result.data[0]);
  139. if (result.data && result.data.length > 0) {
  140. this.guanzhu = false;
  141. } else {
  142. this.guanzhu = true;
  143. }
  144. },
  145. async getTicket() {
  146. if (!this.user.id) {
  147. this.loginDialog = true;
  148. return false;
  149. } else {
  150. this.ticketSearch();
  151. }
  152. },
  153. async guanzhuAdd() {
  154. if (this.guanzhu) {
  155. let query = {};
  156. let result = await this.userOperation({ type: 'search', data: { studid: this.user.id } });
  157. let info = result.data.info;
  158. let body = {};
  159. body.studid = this.user.id;
  160. body.corpid = this.corpInfo.id;
  161. body.corpname = this.corpInfo.corpname;
  162. body.studname = info.xm;
  163. body.studschool = info.yx;
  164. result = await this.stucorpOperation({ type: 'add', data: { query: query, body: body } });
  165. this.$set(this, `guanzhuData`, result.data);
  166. this.$message.success('关注成功');
  167. this.guanzhu = false;
  168. } else {
  169. let result = await this.stucorpOperation({ type: 'delete', data: { id: this.guanzhuData.id } }); //this.guanzhuData.id
  170. if (`${result.errcode}` === '0') {
  171. this.$message.success('取消关注成功');
  172. this.ticketSearch();
  173. } else {
  174. this.$message.error(result.errmsg ? result.errmsg : '取消关注失败');
  175. }
  176. this.guanzhu = true;
  177. }
  178. },
  179. },
  180. };
  181. </script>
  182. <style lang="less" scoped>
  183. .webMessage {
  184. border-left: 0.1875rem solid #850000;
  185. font-size: 1rem;
  186. line-height: 1.875rem;
  187. height: 1.875rem;
  188. padding: 0 0.9375rem;
  189. margin: 0 0 0 -0.9375rem;
  190. }
  191. .baseRow {
  192. padding: 1.25rem;
  193. font-size: 0.875rem;
  194. color: #333333;
  195. span {
  196. padding-left: 0.5rem;
  197. }
  198. }
  199. </style>