detail_recruit.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template>
  2. <div>
  3. <!-- 面包屑导航 -->
  4. <div class="breadcrumb">
  5. <div class="inner">
  6. <span class="location">当前位置:</span>
  7. <el-breadcrumb :separator-icon="ArrowRight">
  8. <el-breadcrumb-item>
  9. <NuxtLink to="/">首页</NuxtLink>
  10. </el-breadcrumb-item>
  11. <el-breadcrumb-item v-if="p_parent_name != ''">
  12. <NuxtLink :to="`/${targetSegment}/index.html`"> {{ p_parent_name }}</NuxtLink>
  13. </el-breadcrumb-item>
  14. <el-breadcrumb-item v-if="parent_name != ''">
  15. <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`"> {{ parent_name }}
  16. </NuxtLink>
  17. </el-breadcrumb-item>
  18. <el-breadcrumb-item>
  19. <NuxtLink :to="`/${targetSegment}/${targetSegment1}/${targetSegment2}/list-1.html`">
  20. {{ navTitle }}
  21. </NuxtLink>
  22. </el-breadcrumb-item>
  23. <el-breadcrumb-item>简历详情</el-breadcrumb-item>
  24. </el-breadcrumb>
  25. </div>
  26. </div>
  27. <!-- 岗位 -->
  28. <div class="gangwei" v-if="type == 1">
  29. <main class="color_main">
  30. <main class="index_main">
  31. <section class="index_1 clearfix">
  32. <div class="cruit_head_box clearfix">
  33. <div class="cruit_head_left">
  34. <a class="cruit_head_a cruit_head_only" title="">基本信息</a>
  35. </div>
  36. </div>
  37. <div class="index_1_box clearfix">
  38. <div class="demand_head_box clearfix">
  39. <div class="demand_head_name">{{ jobInfo.title }}</div>
  40. <div class="demand_head_btn hand" v-if="type_id == 1" @click="applyJob">申请该职位</div>
  41. <div class="demand_head_btn1" v-if="type_id != 1">申请该职位</div>
  42. </div>
  43. <div class="cruit_li_2_foot clearfix">
  44. <span class="cruit_li_2_foot_tag cruit_li_2_foot_exper">
  45. {{ jobInfo.hy_name }}
  46. &gt;
  47. {{ jobInfo.zw_name }}
  48. </span>
  49. <span class="cruit_li_2_foot_tag cruit_li_2_foot_addres">{{ jobInfo.city_name }}</span>
  50. </div>
  51. </div>
  52. </section>
  53. </main>
  54. </main>
  55. <main class="index_main">
  56. <section class="index_2 clearfix">
  57. <div class="demand_1 clearfix">
  58. <div class="demand_left_1 clearfix">
  59. <div class="cruit_head_box clearfix">
  60. <div class="cruit_head_left">
  61. <a class="cruit_head_a cruit_head_only" title="">基本要求</a>
  62. </div>
  63. </div>
  64. <div class="demand_ul_2">
  65. <div class="demand_li_2 clearfix">
  66. <div class="demand_li_2_label">工作性质:</div>
  67. <div class="demand_li_2_text clearfix">{{ jobInfo.job_nature_name }}</div>
  68. </div>
  69. <div class="demand_li_2 clearfix">
  70. <div class="demand_li_2_label">工作经验:</div>
  71. <div class="demand_li_2_text clearfix">{{ jobInfo.experience_name }}</div>
  72. </div>
  73. <div class="demand_li_2 clearfix">
  74. <div class="demand_li_2_label">学历文凭:</div>
  75. <div class="demand_li_2_text clearfix">{{ jobInfo.education_name }}</div>
  76. </div>
  77. <div class="demand_li_2 clearfix">
  78. <div class="demand_li_2_label">语言选择:</div>
  79. <div class="demand_li_2_text clearfix">{{ jobInfo.language_name }}</div>
  80. </div>
  81. <div class="demand_li_2 clearfix">
  82. <div class="demand_li_2_label">薪资待遇:</div>
  83. <div class="demand_li_2_text clearfix">{{ jobInfo.salary_name }}</div>
  84. </div>
  85. <div class="demand_li_2 clearfix">
  86. <div class="demand_li_2_label">截止日期:</div>
  87. <div class="demand_li_2_text clearfix">
  88. {{ getTime(jobInfo.created_at, 'year', 1) }}
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="demand_left_2 clearfix">
  94. <div class="cruit_head_box clearfix">
  95. <div class="cruit_head_left">
  96. <a class="cruit_head_a cruit_head_only" title="">岗位职责</a>
  97. </div>
  98. </div>
  99. <article class="demand_article_1">
  100. {{ jobInfo.description }}
  101. </article>
  102. </div>
  103. <div class="demand_left_3 clearfix">
  104. <div class="cruit_head_box clearfix">
  105. <div class="cruit_head_left">
  106. <a class="cruit_head_a cruit_head_only" title="">具体要求</a>
  107. </div>
  108. </div>
  109. <article class="demand_article_1">
  110. {{ jobInfo.jt_description }}
  111. </article>
  112. </div>
  113. <div class="demand_left_4 clearfix">
  114. <div class="cruit_head_box clearfix">
  115. <div class="cruit_head_left">
  116. <a class="cruit_head_a cruit_head_only" title="">联系方式</a>
  117. </div>
  118. </div>
  119. <div class="demand_ul_2">
  120. <div class="demand_li_2 clearfix">
  121. <div class="demand_li_2_label">地址:</div>
  122. <div class="demand_li_2_text clearfix">{{ companyInfo.address_name }}</div>
  123. </div>
  124. <div class="demand_li_2 clearfix">
  125. <div class="demand_li_2_label">邮箱:</div>
  126. <div class="demand_li_2_text clearfix">{{ companyInfo.email }}</div>
  127. </div>
  128. </div>
  129. </div>
  130. <div class="demand_left_5 clearfix">
  131. <div class="cruit_head_box clearfix">
  132. <div class="cruit_head_left">
  133. <a class="cruit_head_a cruit_head_only" title="">公司介绍</a>
  134. </div>
  135. </div>
  136. <div class="demand_ul_2">
  137. <div class="demand_li_2 clearfix">
  138. <div class="demand_li_2_label">公司规模:</div>
  139. <div class="demand_li_2_text clearfix">{{ companyInfo.company_size_name }}</div>
  140. </div>
  141. <div class="demand_li_2 clearfix">
  142. <div class="demand_li_2_label">公司性质:</div>
  143. <div class="demand_li_2_text clearfix">{{ companyInfo.company_nature_name }}</div>
  144. </div>
  145. <div class="demand_li_2 clearfix">
  146. <div class="demand_li_2_label">公司行业:</div>
  147. <div class="demand_li_2_text clearfix">{{ companyInfo.hy_name }}</div>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. <div class="demand_2 clearfix">
  153. <div class="demand_right_1 clearfix">
  154. <div class="cruit_head_box clearfix">
  155. <div class="cruit_head_left">
  156. <a class="cruit_head_a cruit_head_only" title="">招聘单位</a>
  157. </div>
  158. </div>
  159. <div class="demand_ul_1">
  160. <span class="demand_ul_1_span dot1">
  161. {{ companyInfo.business_name }}
  162. </span>
  163. </div>
  164. </div>
  165. <div class="demand_right_2 clearfix">
  166. <div class="cruit_head_box clearfix">
  167. <div class="cruit_head_left">
  168. <a class="cruit_head_a cruit_head_only" title="">其他职位</a>
  169. </div>
  170. </div>
  171. <div class="demand_ul_1">
  172. <NuxtLink class="demand_ul_1_a dot1" :href="`/${item.pinyin}/${item.id}.html`" title=""
  173. v-for="(item, index) in other_job" :key="item.id">
  174. {{ item.title }}
  175. </NuxtLink>
  176. </div>
  177. </div>
  178. </div>
  179. </section>
  180. </main>
  181. </div>
  182. </div>
  183. </template>
  184. <script setup>
  185. import { ref, reactive } from 'vue'
  186. import { ElBreadcrumb, ElBreadcrumbItem, ElMessage } from 'element-plus'
  187. import { ArrowRight } from '@element-plus/icons-vue'
  188. const route = useRoute();
  189. const type = ref(1);
  190. const nuxtApp = useNuxtApp();
  191. const axios = nuxtApp.$axios;
  192. //获取用户信息
  193. let type_id = ref('')
  194. let website_id = ref('')
  195. let getUserInfo = () => {
  196. axios.get("/user/getUserInfo").then(response => {
  197. console.log("gettypeid", response.data);
  198. type_id.value = response.data.type_id
  199. website_id.value = response.data.website_id
  200. })
  201. }
  202. onMounted(() => {
  203. getUserInfo()
  204. })
  205. //1.1 获得跳转过来的id
  206. const articleId = parseInt(route.params.id); //获得该页面的id
  207. const articleIdArr = reactive([articleId]);
  208. //1.2 获得路由
  209. const targetSegment = getRoutePath(1);
  210. const targetSegment1 = getRoutePath(2);
  211. const targetSegment2 = getRoutePath(3);
  212. //1.1 获得当前的路由id
  213. let routeId;
  214. let routeType;
  215. let navTitle = ref('')//二级导航标题
  216. let navCid = ref('')//二级导航id
  217. //通过导航路径反向查询导航id
  218. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  219. method: 'GET',
  220. query: {
  221. 'pinyin': targetSegment2,
  222. },
  223. });
  224. console.log("getRouteId", getRouteId);
  225. if (getRouteId.code == 200) {
  226. navTitle.value = getRouteId.data.alias
  227. navCid.value = getRouteId.data.category_id
  228. } else {
  229. console.log("获得路由id出错!", getRouteId.message)
  230. }
  231. //1.2 获取二级栏目
  232. let parent_name = ref('');//父级名称
  233. let parent_id = ref('');//父级id
  234. let parent_pinyin = ref('');//父级拼音
  235. const getRoutePName = await requestDataPromise('/web/getWebsiteRoute', {
  236. method: 'GET',
  237. query: {
  238. 'pinyin': targetSegment1,
  239. },
  240. });
  241. console.log("getRoutePName", getRoutePName);
  242. if (getRoutePName.code == 200) {
  243. routeId = getRoutePName.data.category_id
  244. parent_id.value = getRoutePName.data.category_id
  245. parent_name.value = getRoutePName.data.alias
  246. routeType = getRoutePName.data.type
  247. } else {
  248. console.log("获得路由id出错!", getRoutePName.message)
  249. }
  250. //1.3 获取一级栏目
  251. let p_parent_name = ref('');//父级名称
  252. let p_parent_id = ref('');//父级id
  253. const getRoutePName_parent = await requestDataPromise('/web/getWebsiteRoute', {
  254. method: 'GET',
  255. query: {
  256. 'pinyin': targetSegment,
  257. },
  258. });
  259. console.log("getRoutePName_parent", getRoutePName_parent);
  260. if (getRoutePName_parent.code == 200) {
  261. p_parent_id.value = getRoutePName_parent.data.category_id
  262. p_parent_name.value = getRoutePName_parent.data.alias
  263. } else {
  264. console.log("获得路由id出错!", getRoutePName_parent.message)
  265. }
  266. //1.4 展示广告
  267. let adImg1 = ref({})
  268. let adImg2 = ref({})
  269. onMounted(async () => {
  270. //从客户端获取行政职能部门 加快打开速度
  271. const { $webUrl, $CwebUrl } = useNuxtApp();
  272. //广告1
  273. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_detail_0001`
  274. const responseAd1 = await fetch(url, {
  275. headers: {
  276. 'Content-Type': 'application/json',
  277. 'Userurl': $CwebUrl,
  278. 'Origin': $CwebUrl
  279. }
  280. });
  281. const resultAd1 = await responseAd1.json();
  282. adImg1.value = resultAd1.data[0];
  283. //广告2
  284. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_detail_0002`
  285. const responseAd2 = await fetch(url2, {
  286. headers: {
  287. 'Content-Type': 'application/json',
  288. 'Userurl': $CwebUrl,
  289. 'Origin': $CwebUrl
  290. }
  291. });
  292. const resultAd2 = await responseAd2.json();
  293. adImg2.value = resultAd2.data[0];
  294. })
  295. // 2 获取详情
  296. let jobInfo = ref([]) //基本信息
  297. let companyInfo = ref([])// 公司介绍
  298. let category = ref([]) // 栏目
  299. let other_job = ref([]) // 岗位
  300. let experienceInfo = ref([]) // 工作经历
  301. let education = ref([]) // 教育背景
  302. let skillList = ref([]) // 专业技能
  303. let resume = ref(0)
  304. const getDetail = async () => {
  305. const listData = await requestDataPromise('/web/getWebsiteJobInfo', {
  306. method: 'GET',
  307. query: {
  308. 'id': articleId,
  309. 'type': type.value,
  310. 'pageSize': 10,
  311. },
  312. });
  313. if (listData.code == 200) {
  314. console.log("详情1111", listData.data);
  315. // console.log("详情1111222", listData.data.job[0].job_experience);
  316. // console.log("详情111122233", JSON.parse(listData.data.job[0].job_experience));
  317. // console.log("详情1111222233344", JSON.parse(listData.data.job[0].education_experience));
  318. // jobInfo.value = listData.data.job[0];
  319. // category.value = listData.data.category;
  320. if (type.value == 1) {
  321. jobInfo.value = listData.data.job[0];
  322. category.value = listData.data.category;
  323. companyInfo.value = listData.data.company[0];
  324. other_job.value = listData.data.other_job;
  325. }
  326. if (type.value == 2) {
  327. jobInfo.value = listData.data.job[0];
  328. category.value = listData.data.category;
  329. experienceInfo.value = listData.data.job_experience;
  330. education.value = listData.data.education_experience;
  331. skillList.value = JSON.parse(listData.data.job[0].skillList);
  332. resume.value = listData.data.resume;
  333. }
  334. }
  335. }
  336. getDetail();
  337. //获取行业 职位 具体职位
  338. const industry_categoryList = ref([]) //行业类别列表
  339. const position_categoryList = ref([]) //职位类别列表
  340. const positionList = ref([]) //具体职位列表
  341. const getData = async () => {
  342. const getData = await requestDataPromise('/web/getWebsiteJobSelect', {
  343. method: 'GET',
  344. query: {},
  345. });
  346. if (getData.code == 200) {
  347. // console.log("获取到的分类数据:", getData.data);
  348. industry_categoryList.value = getData.data.hy; //行业
  349. position_categoryList.value = getData.data.zw; //职位
  350. positionList.value = getData.data.jtzw; //具体职位
  351. }
  352. }
  353. getData()
  354. // 3 申请该职位
  355. const applyJob = () => {
  356. // console.log("点击了申请该职位", typeof website_id.value);
  357. // console.log("点击了申请该职位", articleIdArr);
  358. axios.post('/web/getWebsiteJobApply', {
  359. website_id: website_id.value,
  360. recruit_id: articleIdArr,
  361. }).then(response => {
  362. // console.log("申请该职位11111111", response);
  363. if (response.code == 200) {
  364. ElMessage({
  365. message: '申请成功',
  366. type: 'success',
  367. });
  368. } else {
  369. ElMessage({
  370. message: response.message,
  371. type: 'error',
  372. });
  373. }
  374. }).catch(error => {
  375. console.error('Error:', error);
  376. });
  377. }
  378. //4.设置seo信息 start---------------------------------------->
  379. //4.1 设置seo信息
  380. const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
  381. method: 'GET',
  382. query: {
  383. 'catid': routeId,
  384. },
  385. });
  386. if (setData.code == 200) {
  387. let seoTitle = setData.data.seo_title;
  388. let seoDescription = setData.data.seo_description;
  389. let seoKeywords = setData.data.seo_keywords;
  390. let seoSuffix = setData.data.suffix;
  391. let seoName = setData.data.website_name;
  392. useSeoMeta({
  393. title: seoTitle + "_" + seoName + "_" + seoSuffix,
  394. meta: [
  395. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  396. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
  397. ]
  398. });
  399. } else {
  400. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  401. console.log("错误位置:设置列表页面SEO数据")
  402. console.log("后端错误反馈:", setData.message)
  403. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  404. }
  405. //4.设置seo信息 end---------------------------------------->
  406. </script>
  407. <style scoped lang="less">
  408. @import "@/assets/css/job/detail_jianli.less";
  409. @import "@/assets/css/job/detail_zhaopin.less";
  410. </style>