detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. <template>
  2. <view v-if="pageloading">
  3. <view class="padding-lr padding-tb margin-bottom-sm bg-white">
  4. <view class="bg-white padding-top-sm text-xl text-black text-bold flex align-end">
  5. <view class="basis-lg">
  6. {{comjobs.title}}
  7. <text class="text-red text-sm" v-if="comjobs.wtype==1">(按月)</text>
  8. <text class="text-red text-sm" v-if="comjobs.wtype==2">(按时)</text>
  9. <text class="text-red text-sm" v-if="comjobs.wtype==3">(按件)</text>
  10. <text class="text-red text-sm" v-if="comjobs.wtype==4">(按项目)</text>
  11. <text class="text-sm">{{comjobs.recruit_num}}名</text>
  12. </view>
  13. <view class="basis-sm text-right text-df">
  14. <view><text class="text-red text-bold">{{comjobs.zwagall}}</text></view>
  15. </view>
  16. </view>
  17. <view class="bg-white padding-top text-gray">
  18. <view v-for="(item,index) in comjobs.tags" :key="index" class="cu-tag light bg-blue echo-tags-item">{{item}}</view>
  19. </view>
  20. <view class="text-gray padding-top-sm pad text-sm flex justify-between">
  21. <view class="text-red">{{sex_text}}</view>
  22. <view>截止日期:{{comjobs.enddate}}</view>
  23. </view>
  24. </view>
  25. <block v-if="comjobs.recruitment_cate==2">
  26. <view class="cu-bar bg-white">
  27. <view class="action">
  28. <text class="cuIcon-titles text-blue"></text> 推广介绍
  29. </view>
  30. </view>
  31. <view class="echo-article-details bg-white solids-bottom flex justify-between" style="padding-top: 0rpx;">
  32. <view>
  33. <view class="text-lg">推荐一位朋友入职奖励:<text class="text-red">{{comjobs.retmoney}}</text></view>
  34. <view class="text-red" v-if="comjobs.is_pay == 1">对方已支付悬赏金</view>
  35. </view>
  36. <view v-if="brokertol==0" @tap="gotoBroker">
  37. <image :src="$getImageUrl('static/images/applet/retmoney.png')" mode="widthFix" style="width: 64rpx;"></image>
  38. </view>
  39. <navigator :url="'/pages/comjobs/setreport?comjobsid='+comjobs.id" open-type="navigate" v-else>
  40. <image :src="$getImageUrl('static/images/applet/retmoney.png')" mode="widthFix" style="width: 64rpx;"></image>
  41. </navigator>
  42. </view>
  43. </block>
  44. <view class="cu-bar bg-white">
  45. <view class="action">
  46. <text class="cuIcon-titles text-blue"></text> 职位详情
  47. </view>
  48. </view>
  49. <view class="echo-article-details bg-white solids-bottom" style="padding-top: 0rpx;">
  50. <text>{{comjobs.comdetails}}</text>
  51. </view>
  52. <view class="cu-bar bg-white">
  53. <view class="action">
  54. <text class="cuIcon-titles text-blue"></text> 任职要求
  55. </view>
  56. </view>
  57. <view class="echo-article-details bg-white solids-bottom" style="padding-top: 0rpx;">
  58. <text>{{comjobs.requirement}}</text>
  59. </view>
  60. <view class="cu-bar bg-white">
  61. <view class="action">
  62. <text class="cuIcon-titles text-blue"></text> 环境图片
  63. </view>
  64. <view class="action" data-modalname="picallModal" @tap="showModal">
  65. <text class="text-df">查看全部 </text>
  66. <view class="cuIcon-right"></view>
  67. </view>
  68. </view>
  69. <view class="echo-article-details bg-white flex justify-between" v-if="comjobs.picall.length != 0" style="padding-top: 0rpx;" data-modalname="picallModal" @tap="showModal">
  70. <image class="picallitem" :src="comjobs.picall[0]" mode="aspectFill"></image>
  71. <image class="picallitem" :src="comjobs.picall[1]" mode="aspectFill"></image>
  72. </view>
  73. <view v-if="videosrc!==null" class="bg-white" style="padding: 0rpx 30rpx 30rpx 30rpx;" data-modalname="videoModal" @tap="showModal">
  74. <image style="width: 690rpx;" src="https://sc.laowushangcheng.com/static/images/videobtn.jpg" mode="widthFix"></image>
  75. </view>
  76. <!-- <view class="echo-article-details bg-white" style="padding-top: 0rpx;">
  77. <video v-if="videosrc!==null && modal.name==null" class="myVideo" poster="https://sc.laowushangcheng.com/static/images/videopic.jpg" :src="videosrc" enable-danmu :controls="true"></video>
  78. </view> -->
  79. <view class="cu-bar bg-white solids-top">
  80. <view class="action">
  81. <text class="cuIcon-titles text-blue"></text> 企业介绍
  82. </view>
  83. </view>
  84. <view class="echo-article-details bg-white" style="padding-top: 0rpx;">
  85. <text>{{comjobs.companydetails}}</text>
  86. </view>
  87. <view class="echo-article-details bg-white solids-bottom flex justify-start">
  88. <image class="solid margin-right-sm" :src="comjobs.worker.tilpic" style="width: 150rpx; height: 150rpx;"></image>
  89. <view>
  90. <view @tap="goShop(comjobs.workerid)">本信息由<text class="text-red">{{comjobs.worker.title}}</text>发布</view>
  91. <view class="flex align-center justify-between padding-bottom-xs align-center" style="width: 520rpx;">
  92. <view class="flex align-center">
  93. <image class="iconyrz" :src="$getImageUrl('static/images/applet/iconyrz.png')" mode="scaleToFill"></image>
  94. <image class="iconwyp" :src="$getImageUrl('static/images/applet/iconwyp.png')" mode="scaleToFill" v-if="comjobs.recruitment_cate==2"></image>
  95. </view>
  96. <view class="text-gray text-right basis-xs text-sm" @tap="goShop(comjobs.workerid)">
  97. <text class="cuIcon-shop margin-right-xs text-lg"></text>
  98. 进店
  99. </view>
  100. </view>
  101. <view class="text-gray" @tap="setAddress()"><text class="cuIcon-locationfill text-blue margin-right-xs"></text> {{comjobs.worker.city}} {{comjobs.worker.district}} {{comjobs.worker.address}}</view>
  102. </view>
  103. </view>
  104. <view class="cu-bar bg-white">
  105. <view class="action">
  106. <text class="cuIcon-titles text-blue"></text> 服务流程
  107. </view>
  108. </view>
  109. <view class="echo-article-details bg-white solids-bottom" style="padding-top: 0rpx;">
  110. <image :src="$getImageUrl('static/images/applet/detaillc.png')" mode="widthFix" style="width: 100%;"></image>
  111. </view>
  112. <view class="padding"></view>
  113. <view class="padding"></view>
  114. <view class="cu-bar bg-white tabbar border shop foot">
  115. <button class="text-gray action" data-modalname="shareModal" @tap="showModal" v-if="appplatform!='ios'">
  116. <view class="padding-bottom-xs">
  117. <image style="width: 38rpx; height: 38rpx;" :src="$getImageUrl('static/images/applet/detshare.png')"></image>
  118. </view>
  119. 分享
  120. </button>
  121. <button class="text-gray action" @tap="setComjobsStar">
  122. <view class="padding-bottom-xs">
  123. <image style="width: 38rpx; height: 38rpx;" :src="$getImageUrl('static/images/applet/detstar.png')"></image>
  124. </view>
  125. {{comjobsstar==0 ? '收藏' : '已收藏'}}
  126. </button>
  127. <view class="bg-blue submit echo-foot-button" @tap="setComjobsLog" v-if="comjobs.status==3"> <text>立即报名</text> </view>
  128. <view class="bg-grey submit echo-foot-button" v-else> <text>已招满</text> </view>
  129. </view>
  130. <view class="cu-modal bottom-modal show" v-if="modal.name=='videoModal'" @tap="hideModal">
  131. <view class="cu-dialog" @tap.stop="">
  132. <view class="cu-bar bg-white">
  133. <view class="action text-black">视频</view>
  134. <view class="action text-blue" @tap="hideModal">取消</view>
  135. </view>
  136. <view class="solid-top" v-if="videosrc!==null">
  137. <video class="myVideo" :src="comjobs.video" enable-danmu :controls="true"></video>
  138. </view>
  139. </view>
  140. </view>
  141. <view class="cu-modal bottom-modal show" v-if="modal.name=='picallModal'" @tap="hideModal">
  142. <view class="cu-dialog" @tap.stop="">
  143. <view class="cu-bar bg-white">
  144. <view class="action text-black">环境图片</view>
  145. <view class="action text-blue" @tap="hideModal">取消</view>
  146. </view>
  147. <view class="solid-top">
  148. <scroll-view scroll-y="true" class="bg-white padding-tb padding-lr-sm solids-top echo-picalllist">
  149. <view class="flex justify-between">
  150. <view class="picitem">
  151. <block v-for="(item,index) in comjobs.picall" :key="index">
  152. <image class="solid" :data-current="index" @tap="previewImage" v-if="index%2==0" mode="widthFix" :src="item"></image>
  153. </block>
  154. </view>
  155. <view class="picitem">
  156. <block v-for="(item,index) in comjobs.picall" :key="index">
  157. <image class="solid" :data-current="index" @tap="previewImage" v-if="index%2==1" mode="widthFix" :src="item"></image>
  158. </block>
  159. </view>
  160. </view>
  161. </scroll-view>
  162. </view>
  163. </view>
  164. </view>
  165. <view class="cu-modal show" v-if="modal.name=='comjobspicModal'">
  166. <view class="cu-dialog picmodal">
  167. <view class="bg-img">
  168. <image mode="widthFix" :src="modal.comjobspic"></image>
  169. <view class="cu-bar justify-end text-white picmodalclose">
  170. <view class="action" @tap="hideModal">
  171. <text class="cuIcon-close "></text>
  172. </view>
  173. </view>
  174. </view>
  175. <view class="cu-bar bg-white margin-top-xs">
  176. <view class="action margin-0 flex-sub solid-left" @tap="saveImage">保存到相册</view>
  177. </view>
  178. </view>
  179. </view>
  180. <view class="cu-modal bottom-modal show" v-if="modal.name=='shareModal'" @tap="hideModal">
  181. <view class="cu-dialog" @tap.stop="">
  182. <view class="cu-bar bg-white">
  183. <view class="action text-black">点击海报</view>
  184. <view class="action text-blue" @tap="hideModal">取消</view>
  185. </view>
  186. <view class="solid-top">
  187. <scroll-view scroll-y="true" class="bg-white padding-tb padding-lr-sm solids-top echo-picalllist">
  188. <view class="cu-list grid col-2 no-border padding-lr">
  189. <block v-for="(item,index) in comjobsshare" :key="index">
  190. <view class="cu-item">
  191. <view class="padding-lr-sm" @tap="getComjobsImage(item.id)">
  192. <view class="bg-img" :style="'background-image:url(' + item.tilpic + ');'"></view>
  193. <view class="padding-tb-xs text-cut">{{item.title}}</view>
  194. </view>
  195. </view>
  196. </block>
  197. </view>
  198. </scroll-view>
  199. </view>
  200. </view>
  201. </view>
  202. <wxContact ref="wxContact"></wxContact>
  203. </skeleton>
  204. </view>
  205. </template>
  206. <script>
  207. var _this;
  208. export default {
  209. data() {
  210. return {
  211. appplatform: "",
  212. pageloading: false,
  213. userinfo: {},
  214. comjobs: null,
  215. videosrc: null,
  216. comjobslist: {},
  217. comjobsstar: 0,
  218. comjobsshare: {},
  219. brokertol: 0,
  220. modal: {
  221. name: null,
  222. comjobspic: ""
  223. }
  224. }
  225. },
  226. onLoad: function(option) {
  227. _this = this;
  228. //#ifdef APP-PLUS
  229. _this.appplatform = uni.getSystemInfoSync().platform;
  230. //#endif
  231. var comjobsid = option.comjobsid || 0;
  232. var parentid = option.parentid || 0;
  233. if (option.scene) {
  234. const scene = decodeURIComponent(option.scene);
  235. if (scene != "undefined") {
  236. comjobsid = scene.split("&")[0];
  237. parentid = scene.split('&')[1];
  238. }
  239. }
  240. if(option.q){
  241. const q = decodeURIComponent(option.q);
  242. if (q != "undefined") {
  243. comjobsid = q.split("=")[1];
  244. }
  245. }
  246. uni.setStorageSync('parentid', parentid);
  247. _this.userinfo = uni.getStorageSync('userinfo') || null;
  248. _this.$req.ajax({
  249. path: "comjobs/getcomjobs",
  250. title: "加载中...",
  251. data: {
  252. comjobsid: comjobsid,
  253. userid: _this.userinfo == null ? 0 : _this.userinfo.id
  254. }
  255. }).then((data) => {
  256. _this.comjobs = data.comjobs;
  257. _this.comjobslist = data.comjobslist;
  258. _this.comjobsstar = data.comjobsstar;
  259. _this.comjobsshare = data.comjobsshare;
  260. _this.brokertol = data.brokertol;
  261. setTimeout(function (){
  262. _this.videosrc = _this.comjobs.video=='' ? null : _this.comjobs.video;
  263. }, 1500);
  264. _this.pageloading = true;
  265. }).catch((err) => {
  266. uni.showModal({
  267. title: '信息提示',
  268. content: err,
  269. showCancel: false
  270. });
  271. });
  272. },
  273. onShareAppMessage: function(res) {
  274. _this.$req.ajax({
  275. path: "comjobs/shareComjobs",
  276. title: "分享中...",
  277. data: {
  278. userid: _this.userinfo.id
  279. }
  280. })
  281. return {
  282. title: _this.comjobs.title,
  283. path: "/pages/comjobs/detail?comjobsid=" + _this.comjobs.id + "&parentid=" + _this.userinfo == null ? 0 : _this.userinfo.id
  284. }
  285. },
  286. methods: {
  287. getComjobsImage: function(shareid) {
  288. _this.userinfo = _this.checkLogin("/pages/comjobs/detail?comjobsid=" + _this.comjobs.id);
  289. if (_this.userinfo === false) {
  290. return false;
  291. }
  292. _this.$req.ajax({
  293. title: "推广海报生成中...",
  294. path: "comjobs/getcomjobsimage",
  295. data: {
  296. shareid: shareid,
  297. userid: _this.userinfo.id,
  298. comjobsid: _this.comjobs.id
  299. }
  300. }).then((data) => {
  301. var t1 = Math.round(Math.random()*100);
  302. _this.modal.comjobspic = data.comjobspic + '?' + t1;
  303. _this.modal.name = "comjobspicModal";
  304. }).catch((err) => {
  305. uni.showModal({
  306. title: '温馨提示',
  307. content: err,
  308. showCancel: false
  309. });
  310. });
  311. },
  312. getComjobsCode: function() {
  313. _this.userinfo = _this.checkLogin("/pages/comjobs/detail?comjobsid=" + _this.comjobs.id);
  314. if (_this.userinfo === false) {
  315. return false;
  316. }
  317. _this.$req.ajax({
  318. title: "招聘简章生成中...",
  319. path: "comjobs/getcomjobscode",
  320. data: {
  321. comjobsid: _this.comjobs.id,
  322. userid: _this.userinfo.id
  323. }
  324. }).then((data) => {
  325. _this.modal.comjobspic = data.comjobspic;
  326. _this.modal.isshow = "show";
  327. }).catch((err) => {
  328. uni.showModal({
  329. title: '温馨提示',
  330. content: err,
  331. showCancel: false
  332. });
  333. });
  334. },
  335. saveImage: function() {
  336. uni.downloadFile({
  337. url: _this.modal.comjobspic,
  338. success: (res) => {
  339. if (res.statusCode === 200) {
  340. uni.saveImageToPhotosAlbum({
  341. filePath: res.tempFilePath,
  342. success: function() {
  343. uni.showModal({
  344. title: '信息提示',
  345. content: "已保存到手机相册,注意查收。",
  346. showCancel: false
  347. });
  348. }
  349. });
  350. }
  351. }
  352. });
  353. },
  354. setComjobsLog: function() {
  355. _this.userinfo = _this.checkLogin("/pages/comjobs/detail?comjobsid=" + _this.comjobs.id);
  356. if (_this.userinfo === false) {
  357. uni.navigateTo({
  358. url: "/pages/my/myinfo?pageurl=/pages/comjobs/detail/comjobsid=" + _this.comjobs.id,
  359. });
  360. return false;
  361. }
  362. //检测用户信息是否完整
  363. if(_this.userinfo.education=="" || _this.userinfo.address=="" || _this.userinfo.workexperience==""){
  364. uni.navigateTo({
  365. url: "/pages/my/myinfo?pageurl=/pages/comjobs/detail/comjobsid=" + _this.comjobs.id,
  366. });
  367. return false;
  368. }
  369. _this.$req.ajax({
  370. title: "报名中",
  371. path: "comjobs/setcomjobslog",
  372. data: {
  373. comjobsid: _this.comjobs.id,
  374. userid: _this.userinfo.id
  375. }
  376. }).then((data) => {
  377. if (data.is_public == 1) {
  378. var confirmText = '联系对方';
  379. } else {
  380. var confirmText = '联系客服';
  381. }
  382. uni.showModal({
  383. title: '温馨提示',
  384. content: data.msg,
  385. confirmText: confirmText,
  386. cancelText: "好的",
  387. success: function(res){
  388. if (res.confirm) {
  389. if (data.is_public == 1) {
  390. uni.makePhoneCall({
  391. phoneNumber: data.mobile
  392. });
  393. } else {
  394. _this.$refs.wxContact.showConcatModel();
  395. }
  396. }
  397. },
  398. });
  399. }).catch((err) => {
  400. uni.showModal({
  401. title: '温馨提示',
  402. content: err,
  403. showCancel: false
  404. });
  405. });
  406. },
  407. setComjobsStar: function() {
  408. _this.userinfo = _this.checkLogin("/pages/comjobs/detail?comjobsid=" + _this.comjobs.id);
  409. if (_this.userinfo === false) {
  410. return false;
  411. }
  412. _this.$req.ajax({
  413. path: "comjobs/setcomjobsstar",
  414. data: {
  415. comjobsid: _this.comjobs.id,
  416. userid: _this.userinfo.id
  417. }
  418. }).then((data) => {
  419. _this.comjobsstar = data.comjobsstar;
  420. }).catch((err) => {
  421. uni.showModal({
  422. title: '温馨提示',
  423. content: err,
  424. showCancel: true
  425. });
  426. });
  427. },
  428. goPage: function(pageurl) {
  429. uni.navigateTo({
  430. url: pageurl,
  431. fail: function() {
  432. uni.switchTab({
  433. url: pageurl
  434. });
  435. }
  436. });
  437. },
  438. gotoBroker: function() {
  439. uni.showModal({
  440. title: '温馨提示',
  441. content: '您还不是经纪人,请联系客服,申请成为经纪人',
  442. confirmColor: "#007aff",
  443. success: function (res) {
  444. if (res.confirm) {
  445. _this.$refs.wxContact.showConcatModel();
  446. // uni.redirectTo({
  447. // url: '/pages/form/form?formid=4'
  448. // });
  449. }
  450. }
  451. });
  452. },
  453. goDetail: function(comjobsid) {
  454. uni.navigateTo({
  455. url: '/pages/comjobs/detail?comjobsid=' + comjobsid
  456. });
  457. },
  458. goShop: function(workerid) {
  459. uni.navigateTo({
  460. url: '/pages/worker/shop?workerid=' + workerid
  461. });
  462. },
  463. navigate: function(href, e) {
  464. // #ifdef H5
  465. location.href = href;
  466. // #endif
  467. // #ifndef H5
  468. uni.navigateTo({
  469. url: '/pages/tool/webview?pagesrc=' + encodeURIComponent(href)
  470. });
  471. // #endif
  472. },
  473. setAddress: function() {
  474. uni.openLocation({
  475. latitude: parseFloat(_this.comjobs.worker.latitude),
  476. longitude: parseFloat(_this.comjobs.worker.longitude),
  477. name: _this.comjobs.worker.title,
  478. address: _this.comjobs.worker.city + " " + _this.comjobs.worker.district + " " + _this.comjobs.worker.address,
  479. success: function () {
  480. console.log('success');
  481. }
  482. });
  483. },
  484. makeTelephone: function(e) {
  485. var telephone = e.currentTarget.dataset.telephone;
  486. uni.makePhoneCall({
  487. phoneNumber: telephone
  488. });
  489. },
  490. showModal: function(e) {
  491. var modalname = e.currentTarget.dataset.modalname;
  492. _this.modal.name = modalname;
  493. },
  494. hideModal: function() {
  495. _this.modal.name = null;
  496. },
  497. previewImage: function(e) {
  498. var current = e.currentTarget.dataset.current;
  499. uni.previewImage({
  500. current: current,
  501. urls: _this.comjobs.picall
  502. });
  503. }
  504. },
  505. computed: {
  506. sex_text() {
  507. const arr = ['男女不限','男','女'];
  508. return arr[_this.comjobs.sex];
  509. }
  510. }
  511. }
  512. </script>
  513. <style lang="scss">
  514. .flex-1 {
  515. flex: 1;
  516. }
  517. .flex-6 {
  518. flex: 6;
  519. }
  520. .picmodal {
  521. width: 450rpx;
  522. background-color: transparent;
  523. }
  524. .picmodal image {
  525. width: 100%;
  526. }
  527. .picmodal .bg-img {
  528. position: relative;
  529. }
  530. .picmodalclose {
  531. position: absolute;
  532. top: 0rpx;
  533. right: 0rpx;
  534. }
  535. .picallitem{ width: 340rpx; height: 260rpx; }
  536. .echo-picalllist{ height: calc(100vh - 105rpx); }
  537. .echo-picalllist .picitem{ width: 345rpx !important; }
  538. .echo-picalllist image{ width: 345rpx; padding-bottom: 15rpx; }
  539. .cu-item .bg-img{ width: 100%; height: 390rpx; background-position: center top; }
  540. .myVideo{ width: 750rpx; height: calc(100vh - 130px); }
  541. </style>