_id.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. <template>
  2. <div class="jobDetailMobile wrapper mobile" v-if="mobile">
  3. <div class="contentArea">
  4. <div class="header">
  5. <div class="title-wrapper">
  6. <div class="title">{{recruitData.title}}</div>
  7. <div class="price">{{recruitData.salaryName}}</div>
  8. </div>
  9. <div class="require-list">
  10. <div class="require-item">
  11. <div class="require-label">技能要求:</div>
  12. <div class="require-text">
  13. <span>{{recruitData.skills.map(s=> s.name).join(',')}}</span>
  14. </div>
  15. </div>
  16. <div class="require-item">
  17. <span class="require-label">经验要求:</span>
  18. <span class="require-text">{{recruitData.experienceName}}</span>
  19. </div>
  20. </div>
  21. <div class="publish-info">
  22. <div class="left">
  23. <div class="l userImage" :class="calcUserVip">
  24. <img :src="defaultIcon(recruitData.ownerInfo && recruitData.ownerInfo.iconUrl)" alt="">
  25. </div>
  26. <div class="r">
  27. {{recruitData.ownerInfo.nickname}}
  28. </div>
  29. </div>
  30. <div class="right">
  31. {{recruitData.auditAtFormat}}
  32. </div>
  33. </div>
  34. </div>
  35. <!--发布者&&是企业身份,增加招聘数据展示-->
  36. <div class="data-wrapper myJobDetail" @click="jumpToDetail('communicated')" v-if="recruitData.role==='owner'">
  37. <!--<div class="data-wrapper myJobDetail">-->
  38. <div class="data-title">招聘数据</div>
  39. <div class="value-box">
  40. <div class="left">已投递: <span>{{recruitData.countApplied || 0}}</span>
  41. </div>
  42. <div class="right">沟通中: <span>{{recruitData.countTalk || 0}}</span>
  43. </div>
  44. <div class="rightIcon"></div>
  45. </div>
  46. </div>
  47. <div class="detail-wrapper">
  48. <div class="detail-title">详情描述</div>
  49. <div class="detail-text" v-html="whiteSpace(recruitData.description)"></div>
  50. </div>
  51. <!--公司信息-->
  52. <div class="company-wrapper" @click="jumpToCompany">
  53. <div class="data-title">公司信息</div>
  54. <div class="value-box">
  55. <div class="left">
  56. <img :src="defaultIcon(recruitData.companyInfo && recruitData.companyInfo.logo)" alt=""/>
  57. </div>
  58. <div class="center">
  59. <div class="ctitle" :class="calcCompanyVip"><p>{{recruitData.companyInfo.name}}</p></div>
  60. <div class="cdesc">{{recruitData.companyInfo.description}}</div>
  61. </div>
  62. <div class="right">
  63. <div class="rightIcon"></div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="tips-wrapper">
  68. <div class="tips-title">温馨提示</div>
  69. <div v-if="recruitData.role==='owner'">
  70. <div class="tips-text">1.完善企业信息和岗位工作描述,有助于开发者了解岗位信息。</div>
  71. <div class="tips-text">2.您还可以每天刷新岗位,将其置于列表顶部。</div>
  72. </div>
  73. <div v-else>
  74. <div class="tips-text">如沟通过程中,发现需求方有不当行为,请立即联系客服处理!</div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="bottomArea">
  79. <!--如果是发布者-->
  80. <template v-if="recruitData.role==='owner'">
  81. <div class="btn" v-if="recruitData.status==='2'">正在审核中</div>
  82. <div class="btn-list" v-else-if="recruitData.status==='3'">
  83. <div class="btn-item" v-if="recruitData.canRefresh>0" @click="handleRefreshClick()">刷新</div>
  84. <div class="btn-item none" v-else>刷新</div>
  85. <div class="btn-item" @click="handleOfflineClick()">关闭岗位</div>
  86. </div>
  87. <div class="btn-list" v-else-if="recruitData.status==='4' || recruitData.status==='6'">
  88. <div class="btn-item" @click="handleEditClick()">编辑</div>
  89. <div class="btn-item" @click="handleReopenClick()">发布</div>
  90. </div>
  91. </template>
  92. <!--不是发布者-->
  93. <template v-else-if="recruitData.role==='developer'">
  94. <div class="btn-list" v-if="recruitData.status==='3'">
  95. <div class="btn-item applyBtn" @click="handleSendClick()"
  96. :class="{none: Number(recruitData.applicationState) === 1}">
  97. {{Number(recruitData.applicationState) === 1 ? '已投递': '投递'}}
  98. </div>
  99. <div class="btn-item " @click="handleContactClick()">
  100. {{Number(recruitData.chatState) === 1 ? '继续沟通': '立即沟通'}}
  101. </div>
  102. </div>
  103. <div class="contact-wrapper" :style="{backgroundColor: recruitData.statusColor}" v-else>
  104. <p>{{recruitData.statusName}}</p>
  105. </div>
  106. </template>
  107. </div>
  108. <div class="confirmBox" v-if="showConfirm">
  109. <div class="body">
  110. <div class="desc">您当前尚未签约,无法投递简历</div>
  111. <div class="button">
  112. <div class="cancle" @click="showConfirm=false">暂不考虑</div>
  113. <div class="submit" @click="jumpToAAA">前往签约</div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="jobDetail" v-else>
  119. <div class="breadcrumb">
  120. <a
  121. v-for="(item, index) in breadcrumbList"
  122. :key="'breadcrumb'+index"
  123. :href="item.url"
  124. :title="item.name"
  125. >
  126. <p v-if="index!==breadcrumbList.length-1">{{item.name}} <span>&nbsp;>&nbsp;</span></p>
  127. <h1 v-else>{{item.name}}</h1>
  128. </a>
  129. </div>
  130. <div class="contentArea">
  131. <div class="jobTitleArea">
  132. <div class="jobTitle">{{recruitData.title}}</div>
  133. <div class="jobPrice">{{recruitData.salaryName}}</div>
  134. </div>
  135. <div class="skills">技能要求:<span>{{recruitData.skills.map(s=> s.name).join(',')}}</span></div>
  136. <div class="workTime">经验要求:<span>{{recruitData.experienceName}}</span></div>
  137. <div class="publishUser">
  138. <div class="userInfo" @click="jumpToCompany">
  139. <div class="img" :class="calcUserVip">
  140. <img :src="defaultIcon(recruitData.ownerInfo && recruitData.ownerInfo.iconUrl)" alt="">
  141. </div>
  142. <div class="name">
  143. {{recruitData.ownerInfo.nickname}}
  144. </div>
  145. </div>
  146. <div class="publishTime"><span>{{recruitData.auditAtFormat}}</span></div>
  147. </div>
  148. <div class="desc">
  149. <div class="descTitle">
  150. 工作描述:
  151. </div>
  152. <div class="descValue" v-html="whiteSpace(recruitData.description)">>
  153. </div>
  154. </div>
  155. <div class="companyInfoArea">
  156. <div class="companyTitle">公司信息</div>
  157. <div class="companyInfo">
  158. <div class="img">
  159. <img :src="defaultIcon(recruitData.companyInfo && recruitData.companyInfo.logo)" alt=""/>
  160. </div>
  161. <div class="ctitle" :class="calcCompanyVip"><p>{{recruitData.companyInfo.name}}</p></div>
  162. </div>
  163. </div>
  164. <div class="btnArea">
  165. <div class="btn submitNow" :class="{noneClick: recruitData.role === 'owner'}" @click="showGoAppTipsHandler">
  166. <p>立即申请</p>
  167. </div>
  168. </div>
  169. </div>
  170. <!--<div class="rightArea">-->
  171. <!--<div class="qrcode" v-if="qrCodeBase64">-->
  172. <!--<img class="code" :src="qrCodeBase64" alt="">-->
  173. <!--<img class="logo" src="~@/assets/img/job/logo_icon_reverse2.jpg" alt="">-->
  174. <!--</div>-->
  175. <!--<p class="tips">使用程序员客栈APP,扫描二维码,</p>-->
  176. <!--<p class="tips">直接与雇主沟通!</p>-->
  177. <!--</div>-->
  178. <BottomBanner></BottomBanner>
  179. <SeoFooter style="margin-top: 30px;" :data="footer"/>
  180. </div>
  181. </template>
  182. <script>
  183. // '审核中', // 2
  184. // '开放中', //3
  185. // '停止招聘', //4
  186. // '已删除', //5
  187. // '审核失败', //6
  188. import { MessageBox } from 'mint-ui';
  189. import "mint-ui/lib/style.css";
  190. import DealSeoFooter from "@/components/job/dealSeoFooter"
  191. import SeoFooter from "@/components/SeoFooter"
  192. import BottomBanner from "@/components/job/bottomBanner"
  193. let qrcode = null
  194. if (process.browser) {
  195. qrcode = require("qrcode");
  196. }
  197. const COMPANY = 1;
  198. const PERSONAL = 2;
  199. export default {
  200. name: "JobListSeoDetail",
  201. components: { SeoFooter, BottomBanner },
  202. data() {
  203. return {
  204. showConfirm: false,
  205. showConfirmWord: "",
  206. qrCodeBase64: ""
  207. }
  208. },
  209. head() {
  210. return {
  211. title: `${this.recruitData.title}-程序员客栈`,
  212. meta: [ {
  213. 'name': 'keywords',
  214. 'content': `${this.recruitData.title}`
  215. }, {
  216. 'name': 'descrption',
  217. 'content': `程序员客栈提供${this.recruitData.title}招聘,欢迎各位应聘者提供简历积极应聘,祝应聘${this.recruitData.title}成功!`
  218. }, {
  219. 'name': 'h1',
  220. 'content': `${this.recruitData.title}`
  221. } ],
  222. link: [
  223. { rel: 'canonical', href: this.nowUrl },
  224. ]
  225. }
  226. },
  227. async asyncData({ ...params }) {
  228. try {
  229. params.store.commit("updateNoneCommonFooter", true)
  230. } catch ( e ) {
  231. console.log("updateNoneCommonFooter", e)
  232. }
  233. const { android } = params.app.$deviceType
  234. const { id } = params.app.context.route.params || {}
  235. let recruitId = id
  236. const p = {
  237. recruitId
  238. }
  239. let recruitData = {
  240. companyInfo: {},
  241. ownerInfo: {},
  242. skills: []
  243. }
  244. let res = await params.$axios.$post("/api/recruit/getRecruit", p)
  245. if (res.status === 1) {
  246. recruitData = res.data
  247. }
  248. /** 处理面包屑导航 **/
  249. let dealBreadcrumbList = [
  250. { name: '首页', url: "/" },
  251. { name: '兼职招聘', url: "/job/" },
  252. { name: recruitData.title, url: `/job/detail/${recruitData.id}.html` },
  253. ]
  254. let dealSeoFooterObj = new DealSeoFooter(params, recruitData)
  255. let footer = await dealSeoFooterObj.dealData()
  256. let nowUrl = ""
  257. try {
  258. const { headers: { host } } = params.app.context.req || {};
  259. let { fullPath } = params.app.context.route
  260. //设置baseLink
  261. if (host.indexOf('local') !== -1) {
  262. nowUrl = 'http://' + host + fullPath
  263. } else {
  264. nowUrl = 'https://' + host + fullPath
  265. }
  266. } catch ( e ) {
  267. console.log(e)
  268. }
  269. return {
  270. nowUrl: nowUrl,
  271. android,
  272. recruitId: recruitId,
  273. recruitData,
  274. mobile: params.app.$deviceType.isMobile(),
  275. breadcrumbList: dealBreadcrumbList,
  276. ...footer,
  277. }
  278. },
  279. computed: {
  280. /** 计算用户vip **/
  281. calcUserVip() {
  282. const { isVip, vipTypeID } = this.recruitData.ownerInfo
  283. if (isVip && Number(vipTypeID) < 3) {
  284. return { [ 'vip' + vipTypeID ]: isVip }
  285. } else {
  286. return {}
  287. }
  288. },
  289. /** 计算企业vip **/
  290. calcCompanyVip() {
  291. const { isVip, vipTypeID } = this.recruitData.ownerInfo
  292. if (isVip && Number(vipTypeID) >= 3) {
  293. return { [ 'vip' + vipTypeID ]: isVip }
  294. } else {
  295. return {}
  296. }
  297. },
  298. },
  299. mounted() {
  300. const path = this.$route.path
  301. const string = path.split('.')[ 0 ]
  302. this.recruitId = string.split('/')[ 3 ]
  303. let { role, longTimeTip } = this.recruitData
  304. //拥有者&企业方&需要提示
  305. if (role === 'owner' && Number(longTimeTip) === 1 && this.mobile) {
  306. MessageBox({
  307. title: '温馨提示',
  308. message: '如果您长时间未招聘到优质程序员,可以试试发布【整包/云端项目】,有专属客服帮您人工对接开发者。',
  309. cancelButtonText: "我知道了",
  310. confirmButtonText: "前往发布",
  311. closeOnClickModal: true,
  312. showCancelButton: true,
  313. showConfirmButton: true,
  314. }).then(action => {
  315. console.log(action)
  316. if (action !== 'cancel') {
  317. location.href = "proginn://project_publish"
  318. }
  319. });
  320. }
  321. if (!this.mobile) {
  322. let baseUrl = this.$store.state.domainConfig.siteUrl
  323. let jumpUrl = `${baseUrl}${location.pathname}`
  324. this.createCode(jumpUrl)
  325. }
  326. //处理分享信息
  327. //
  328. if (this.$deviceType.app) {
  329. try {
  330. // briefIntroduction: "全球不哈的吧"
  331. // description: "测试公司介绍"
  332. // logo: "https://inn.proginn.com/useralbum/666709/5e43f82e9fe94/recordsay1581512750.jpg"
  333. // name: "程序员"
  334. // shortName: ""
  335. // uid: "666709"
  336. // website: "http://jjjjjj"
  337. let { companyInfo: { name, shortName, logo }, description, occupationName, workTypeName, salaryName } = this.recruitData
  338. let companyName = shortName || name
  339. if (companyName.length > 7) {
  340. companyName = companyName.slice(0, 7) + '...'
  341. }
  342. let shareData = {
  343. title: `【程序员客栈】强烈推荐!${companyName}正在招聘${workTypeName}兼职${occupationName}工程师,待遇${salaryName}!`,
  344. description: "找程序员上程序员客栈~ ",
  345. logo_url: logo
  346. }
  347. console.log("分享信息", shareData)
  348. if (this.$deviceType.android) {
  349. shareData = JSON.stringify(shareData)
  350. }
  351. window.app_event.load_share_data(shareData)
  352. } catch ( e ) {
  353. console.log("处理分享信息 error ", e)
  354. }
  355. }
  356. },
  357. methods: {
  358. async getRecruit() {
  359. const recruitId = this.recruitId
  360. const params = {
  361. recruitId
  362. }
  363. let res = await this.$axios.$post("/api/recruit/getRecruit", params)
  364. if (res.status === 1) {
  365. this.recruitData = res.data
  366. }
  367. },
  368. /** 刷新 **/
  369. async handleRefreshClick() {
  370. const recruitId = this.recruitId
  371. const params = {
  372. recruitId
  373. }
  374. let res = await this.$axios.$post("/api/recruit/refresh", params)
  375. if (res.status === 1) {
  376. console.log(res)
  377. this.$message({
  378. message: '岗位刷新成功!',
  379. type: 'success'
  380. })
  381. this.getRecruit()
  382. }
  383. },
  384. /** 关闭岗位 **/
  385. async handleOfflineClick() {
  386. const recruitId = this.recruitId
  387. const params = {
  388. recruitId
  389. }
  390. let res = await this.$axios.$post("/api/recruit/offline", params)
  391. console.log("关闭岗位", res)
  392. if (res.status === 1) {
  393. this.$message({
  394. message: '岗位关闭成功!',
  395. type: 'success'
  396. })
  397. setTimeout(() => {
  398. MessageBox({
  399. title: '温馨提示',
  400. message: '程序员客栈邀请您评价本次兼职招聘,希望您能抽出5-10秒的时间参与,以帮助我们更好的提升服务。',
  401. cancelButtonText: "残忍拒绝",
  402. confirmButtonText: "前往评价",
  403. closeOnClickModal: true,
  404. showCancelButton: true,
  405. showConfirmButton: true,
  406. }).then(action => {
  407. if (action !== 'cancel') {
  408. location.href = `proginn://recruit/company_comment?id=${this.recruitId}`
  409. }
  410. this.getRecruit()
  411. });
  412. }, 1500)
  413. }
  414. },
  415. /** 发布 **/
  416. async handleReopenClick() {
  417. const recruitId = this.recruitId
  418. const params = {
  419. recruitId
  420. }
  421. let res = await this.$axios.$post("/api/recruit/reopen", params)
  422. if (res.status === 1) {
  423. console.log(res)
  424. this.$message({
  425. message: '岗位已提交审核,请您耐心等待!',
  426. type: 'success'
  427. })
  428. this.getRecruit()
  429. }
  430. },
  431. /** 编辑 **/
  432. async handleEditClick() {
  433. const recruitId = this.recruitId
  434. location.href = `proginn://recruit/edit?id=${recruitId}`
  435. },
  436. async handleContactClick() {
  437. // 是否是APP
  438. if (this.judgeToDownloadApp()) {
  439. return
  440. }
  441. if (this.recruitData.loginStatus === -99) {
  442. location.href = 'proginn://login'
  443. return
  444. }
  445. let { realname_re } = this.$store.state.userinfo
  446. realname_re = Number(realname_re)
  447. //未签约,弹出提示
  448. if (realname_re !== 2) {
  449. this.showConfirm = true
  450. this.showConfirmWord = "发起沟通"
  451. return
  452. }
  453. let checkAns = await this.dealTips("沟通")
  454. if (!checkAns) {
  455. return
  456. }
  457. const recruitId = this.recruitId
  458. const params = {
  459. recruitId
  460. }
  461. let res = await this.$axios.$post("/api/recruit/chat", params)
  462. if (res.status === 1) {
  463. const { uid, title } = this.recruitData
  464. this.getRecruit()
  465. location.href = `proginn://recruit/chat?uid=${uid}&title=${encodeURIComponent(title)}&url=${encodeURIComponent(location.href)}`
  466. }
  467. },
  468. /** 投递 **/
  469. async handleSendClick() {
  470. // 是否是APP
  471. if (this.judgeToDownloadApp()) {
  472. return
  473. }
  474. const { applicationState, id } = this.recruitData
  475. if (!(Number(applicationState) === 0)) {
  476. return
  477. }
  478. if (!await this.checkLogin(true)) {
  479. return
  480. }
  481. let { realname_re } = this.$store.state.userinfo
  482. realname_re = Number(realname_re)
  483. //未签约,弹出提示
  484. if (realname_re !== 2) {
  485. this.showConfirm = true
  486. this.showConfirmWord = "投递简历"
  487. return
  488. }
  489. let checkAns = await this.dealTips("投递")
  490. if (!checkAns) {
  491. return
  492. }
  493. let loadingStatus = this.$loading({ fullscreen: true, text: '发送中...' });
  494. let p = {
  495. recruitId: id
  496. }
  497. this.$axios.post("/api/recruit/apply", p).then(res => {
  498. if (Number(res.data.status) === 1) {
  499. loadingStatus && loadingStatus.close()
  500. this.$message.success("投递成功!")
  501. this.getRecruit()
  502. }
  503. }).finally(() => {
  504. loadingStatus && loadingStatus.close()
  505. })
  506. },
  507. /**
  508. * 换行符 转化
  509. * @param desc
  510. */
  511. whiteSpace(desc) {
  512. let regx = /\n|↵/g;
  513. if (desc && desc.length > 0) {
  514. return desc.replace(regx, '<br/>')
  515. } else {
  516. return ''
  517. }
  518. },
  519. jumpToCompany() {
  520. const { uid } = this.recruitData
  521. if (this.$deviceType.app) {
  522. location.href = `proginn://resume?uid=${uid}&company=1`
  523. } else {
  524. location.href = `/company/${uid}`
  525. }
  526. },
  527. defaultIcon(url) {
  528. if (!url) {
  529. return 'https://stacdn.proginn.com/image/usericon/3.png'
  530. }
  531. return url
  532. },
  533. /** 跳转到招聘详情 **/
  534. jumpToDetail(type) {
  535. location.href = `proginn://recruit/data?id=${this.recruitId}&type=${type || 'applicated'}`
  536. },
  537. /** 跳转签约 **/
  538. jumpToAAA() {
  539. location.href = "proginn://developer_sign"
  540. },
  541. async dealTips(word = "投递") {
  542. let { directionNotMatch, workTypeNotMatch } = this.recruitData
  543. //职位类型
  544. if (Number(directionNotMatch) === 1) {
  545. let ans1 = await MessageBox({
  546. title: '温馨提示',
  547. message: `该兼职岗位与您的【职位方向不符】,请您确认是否继续${word}。`,
  548. cancelButtonText: "再考虑下",
  549. confirmButtonText: "继续操作",
  550. closeOnClickModal: true,
  551. showCancelButton: true,
  552. showConfirmButton: true,
  553. })
  554. if (ans1 === "cancel") {
  555. return false
  556. }
  557. }
  558. //工作方式
  559. if (Number(workTypeNotMatch) === 1) {
  560. let ans2 = await MessageBox({
  561. title: '温馨提示',
  562. message: `该兼职岗位与您选择的【工作方式不符】,请您确认是否继续${word}。`,
  563. cancelButtonText: "再考虑下",
  564. confirmButtonText: "继续操作",
  565. closeOnClickModal: true,
  566. showCancelButton: true,
  567. showConfirmButton: true,
  568. })
  569. if (ans2 === "cancel") {
  570. return false
  571. }
  572. }
  573. return true
  574. },
  575. //创建二维码
  576. createCode(url) {
  577. console.log('warn', url)
  578. qrcode.toDataURL(url, {
  579. width: 250,
  580. margin: 0,
  581. errorCorrectionLevel: "H"
  582. }).then(res => {
  583. this.qrCodeBase64 = res
  584. }).catch(err => {
  585. this.$toast.clear()
  586. this.$toast('生成二维码出错')
  587. console.warn(JSON.stringfy(err))
  588. })
  589. },
  590. showGoAppTipsHandler() {
  591. if (this.recruitData.role !== 'owner') {
  592. this.$message.info("用程序员客栈APP,扫描右侧二维码,直接与雇主沟通!")
  593. }
  594. },
  595. judgeToDownloadApp() {
  596. // 应用宝:https://sj.qq.com/myapp/detail.htm?apkName=com.proginn
  597. // iOS:https://apps.apple.com/cn/app/id979914687
  598. if (!this.$deviceType.app) {
  599. let url = this.$deviceType.ios ?
  600. "https://apps.apple.com/cn/app/id979914687" :
  601. "https://sj.qq.com/myapp/detail.htm?apkName=com.proginn"
  602. location.href = url
  603. return true
  604. }
  605. return false
  606. }
  607. }
  608. }
  609. </script>
  610. <style lang="scss" scope>
  611. @import "~@/assets/css/job/_post_id.scss";
  612. </style>