detail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  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">{{demand.title}}
  6. <text class="text-sm text-red">({{demand.type_text}})</text>
  7. {{demand.num}}人
  8. </view>
  9. <view class="basis-sm text-right text-df">
  10. <view v-if="demand.wtype==1"><text class="text-red text-bold">{{demand.zwagall}}</text></view>
  11. <view v-if="demand.wtype==5"><text class="text-red text-bold">其他</text></view>
  12. <view v-else><text class="text-red text-bold">{{demand.bwagall}}</text></view>
  13. </view>
  14. </view>
  15. <view class="bg-white padding-top text-gray">
  16. <view v-for="(item,index) in demand.tags" :key="index" class="cu-tag light bg-red echo-tags-item">{{item}}</view>
  17. </view>
  18. <view class="text-gray padding-top-sm pad text-sm flex justify-between">
  19. <view class="text-red">{{demand.ftype_text}}:{{demand.fwagall}}</view>
  20. <view>截止日期:{{demand.enddate}}</view>
  21. </view>
  22. </view>
  23. <view class="cu-bar bg-white solids-bottom">
  24. <view class="action">
  25. <text class="cuIcon-titles text-red"></text> 任职要求
  26. </view>
  27. </view>
  28. <view class="echo-article-details bg-white margin-bottom-sm">
  29. <text>{{demand.requirement}}</text>
  30. </view>
  31. <!-- <view class="cu-bar bg-white">
  32. <view class="action">
  33. <text class="cuIcon-titles text-blue"></text> 环境图片
  34. </view>
  35. <view class="action" data-modalname="picallModal" @tap="showModal">
  36. <text class="text-df">查看全部 </text>
  37. <view class="cuIcon-right"></view>
  38. </view>
  39. </view>
  40. <view class="echo-article-details bg-white flex justify-between" v-if="demand.picall.length != 0" style="padding-top: 0rpx;" data-modalname="picallModal" @tap="showModal">
  41. <image class="picallitem" :src="demand.picall[0]" mode="aspectFill"></image>
  42. <image class="picallitem" :src="demand.picall[1]" mode="aspectFill"></image>
  43. </view> -->
  44. <view v-if="videosrc!==null" class="bg-white" style="padding: 0rpx 30rpx 30rpx 30rpx;" data-modalname="videoModal" @tap="showModal">
  45. <image style="width: 690rpx;" src="https://sc.laowushangcheng.com/static/images/videobtn.jpg" mode="widthFix"></image>
  46. </view>
  47. <!-- <view class="echo-article-details bg-white" style="padding-top: 0rpx;">
  48. <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>
  49. </view> -->
  50. <view class="cu-bar bg-white solids-top">
  51. <view class="action">
  52. <text class="cuIcon-titles text-red"></text> 企业介绍
  53. </view>
  54. </view>
  55. <view class="echo-article-details bg-white" style="padding-top: 0rpx;">
  56. <text>{{demand.comdetails}}</text>
  57. </view>
  58. <view class="echo-article-details bg-white solids-bottom flex justify-start">
  59. <image class="solid margin-right-sm" :src="demand.worker.tilpic" style="width: 150rpx; height: 150rpx;"></image>
  60. <view>
  61. <view @tap="goShop(demand.workerid)">本信息由<text class="text-red">{{demand.worker.title}}</text>发布</view>
  62. <view class="flex align-center justify-between padding-bottom-xs align-center" style="width: 520rpx;">
  63. <view class="flex align-center">
  64. <image class="iconyrz" :src="$getImageUrl('static/images/applet/iconyrz.png')" mode="scaleToFill"></image>
  65. <image class="iconwyp" :src="$getImageUrl('static/images/applet/iconwyp.png')" v-if="demand.recruitment_cate==2"></image>
  66. </view>
  67. <view class="text-gray text-right basis-xs text-sm" @tap="goShop(demand.workerid)">
  68. <text class="cuIcon-shop margin-right-xs text-lg"></text>
  69. 进店
  70. </view>
  71. </view>
  72. <view class="text-gray" @tap="setAddress()"><text class="cuIcon-locationfill text-red margin-right-xs"></text> {{demand.worker.city}} {{demand.worker.district}} {{demand.worker.address}}</view>
  73. </view>
  74. </view>
  75. <view class="cu-bar bg-white solids-bottom margin-top-sm">
  76. <view class="action">
  77. <text class="cuIcon-titles text-red"></text> 店铺推荐
  78. </view>
  79. <view class="action" @tap="goPage('/pages/worker/shop?workerid='+demand.workerid)">
  80. <text class="text-df">进店看看 </text>
  81. <view class="cuIcon-right"></view>
  82. </view>
  83. </view>
  84. <block v-for="(item,index) in demandlist" :key="index">
  85. <view class="cu-card dynamic no-card solid-bottom echo-demand-item">
  86. <view class="cu-item shadow padding-top-sm padding-bottom">
  87. <view class="padding-lr padding-bottom-xs flex justify-between align-center" @tap="goDetail(item.id)">
  88. <view class="basis-lg text-bold text-lg text-cut">{{item.title}}</view>
  89. <view class="basis-sm text-cut text-right text-gray text-sm">{{item.city}}</view>
  90. </view>
  91. <view class="padding-lr text-lg" @tap="goDetail(item.id)">
  92. <view v-if="item.wtype==1"><text class="text-red text-bold">{{item.bwagall}}~{{item.zwagall}}</text> <text class="text-gray text-sm padding-left-xs">元/月</text></view>
  93. <view v-if="item.wtype==2"><text class="text-red text-bold">{{item.bwagall}}</text> <text class="text-gray text-sm padding-left-xs">元/日</text></view>
  94. <view v-if="item.wtype==3"><text class="text-red text-bold">{{item.bwagall}}</text> <text class="text-gray text-sm padding-left-xs">元/时</text></view>
  95. <view v-if="item.wtype==4"><text class="text-red text-bold">面议</text></view>
  96. </view>
  97. <view class="padding-lr text-cut" @tap="goDetail(item.id)">
  98. <view v-for="(titem,tindex) in item.tags" :key="tindex" class="cu-tag light bg-gray text-grey sm">{{titem}}</view>
  99. </view>
  100. <view class="padding-lr text-sm text-cut" @tap="goDetail(item.id)">
  101. <view class="text-gray">{{item.worker.title}}</view>
  102. </view>
  103. <view class="text-gray text-sm padding-lr flex align-center justify-between" @tap="goShop(item.workerid)">
  104. <view class="flex align-center">
  105. <image class="iconwyd" style="margin: 0rpx !important;" :src="$getImageUrl('static/images/applet/iconwyd.png')" mode="scaleToFill"></image>
  106. </view>
  107. <view class="text-gray text-right basis-xs">
  108. <text class="cuIcon-shop margin-right-xs text-lg"></text>
  109. 进店
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </block>
  115. <view class="padding"></view>
  116. <view class="padding"></view>
  117. <view class="cu-bar bg-white tabbar border shop foot">
  118. <view class="action" @tap="goPage('/pages/worker/shop?workerid='+demand.workerid)">
  119. <view class="cuIcon-shop"></view>
  120. 进店
  121. </view>
  122. <!-- <button class="action" open-type="share">
  123. <view class="cuIcon-weixin text-green">
  124. <view class="cu-tag badge" style="font-size: 16rpx;">邀好友</view>
  125. </view>
  126. 分享
  127. </button> -->
  128. <view class="action" v-if="demand.telephone!=''" :data-telephone="demand.telephone" @tap="makeTelephone">
  129. <view class="cuIcon-dianhua text-red"></view>
  130. 电话
  131. </view>
  132. <view class="bg-red submit echo-foot-button" @tap="showSnatch" v-if="demand.status==3"> <text>立马抢单</text> </view>
  133. <view class="bg-grey submit echo-foot-button" v-else> <text>已停招</text> </view>
  134. </view>
  135. <view class="cu-modal bottom-modal show" v-if="modal.name=='videoModal'" @tap="hideModal">
  136. <view class="cu-dialog" @tap.stop="">
  137. <view class="cu-bar bg-white">
  138. <view class="action text-black">视频</view>
  139. <view class="action text-blue" @tap="hideModal">取消</view>
  140. </view>
  141. <view class="solid-top" v-if="videosrc!==null">
  142. <video class="myVideo" :src="demand.video" enable-danmu :controls="true"></video>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="cu-modal bottom-modal show" v-if="modal.name=='picallModal'" @tap="hideModal">
  147. <view class="cu-dialog" @tap.stop="">
  148. <view class="cu-bar bg-white">
  149. <view class="action text-black">环境图片</view>
  150. <view class="action text-blue" @tap="hideModal">取消</view>
  151. </view>
  152. <view class="solid-top">
  153. <scroll-view scroll-y="true" class="bg-white padding-tb padding-lr-sm solids-top echo-picalllist">
  154. <view class="flex justify-between">
  155. <view class="picitem">
  156. <block v-for="(item,index) in demand.picall" :key="index">
  157. <image class="solid" :data-current="index" @tap="previewImage" v-if="index%2==0" mode="widthFix" :src="item"></image>
  158. </block>
  159. </view>
  160. <view class="picitem">
  161. <block v-for="(item,index) in demand.picall" :key="index">
  162. <image class="solid" :data-current="index" @tap="previewImage" v-if="index%2==1" mode="widthFix" :src="item"></image>
  163. </block>
  164. </view>
  165. </view>
  166. </scroll-view>
  167. </view>
  168. </view>
  169. </view>
  170. <view class="cu-modal show" v-if="modal.name=='demandpicModal'">
  171. <view class="cu-dialog picmodal">
  172. <view class="bg-img">
  173. <image mode="widthFix" :src="modal.demandpic"></image>
  174. <view class="cu-bar justify-end text-white picmodalclose">
  175. <view class="action" @tap="hideModal">
  176. <text class="cuIcon-close "></text>
  177. </view>
  178. </view>
  179. </view>
  180. <view class="cu-bar bg-white margin-top-xs">
  181. <view class="action margin-0 flex-sub solid-left" @tap="saveImage">保存到相册</view>
  182. </view>
  183. </view>
  184. </view>
  185. <modal v-if="snatchShow" title="输入人数" confirm-text="抢单" cancel-text="取消" @cancel="cancelSnatch" @confirm="confirmSnatch">
  186. <input type="number" style="background-color: #eee;" v-model="num" placeholder="请输入人数"></input>
  187. </modal>
  188. <wxContact></wxContact>
  189. </view>
  190. </template>
  191. <script>
  192. var _this;
  193. export default {
  194. data() {
  195. return {
  196. pageloading: false,
  197. userinfo: false,
  198. workerinfo: false,
  199. param: {},
  200. demand: null,
  201. videosrc: null,
  202. iscantele: false,
  203. demandlist: {},
  204. modal: {
  205. name: "",
  206. demandpic: ""
  207. },
  208. snatchShow: false,
  209. num: '',
  210. }
  211. },
  212. onLoad: function(option) {
  213. _this = this;
  214. var demandid = option.demandid || 0;
  215. var parentid = option.parentid || 0;
  216. if (option.scene) {
  217. const scene = decodeURIComponent(option.scene);
  218. if (scene != "undefined") {
  219. demandid = scene.split("&")[0];
  220. parentid = scene.split('&')[1];
  221. }
  222. }
  223. uni.setStorageSync('parentid', parentid);
  224. _this.userinfo = _this.checkLogin("/pages/my/my");
  225. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  226. if (_this.userinfo === false || _this.workerinfo === false) {
  227. uni.reLaunch({
  228. url: "/pages/my/my"
  229. });
  230. return false;
  231. }
  232. _this.$req.ajax({
  233. path: "demand/getdemand",
  234. title: "加载中...",
  235. data: {
  236. demandid: demandid,
  237. userid: _this.userinfo == null ? 0 : _this.userinfo.id
  238. }
  239. }).then((data) => {
  240. _this.param = data.param;
  241. _this.demand = data.demand;
  242. _this.iscantele = data.iscantele;
  243. _this.demandlist = data.demandlist;
  244. setTimeout(function (){
  245. _this.videosrc = _this.demand.video=='' ? null : _this.demand.video;
  246. }, 1500);
  247. _this.pageloading = true;
  248. }).catch((err) => {
  249. uni.showModal({
  250. title: '信息提示',
  251. content: err,
  252. showCancel: false
  253. });
  254. });
  255. },
  256. onShareAppMessage: function(res) {
  257. return {
  258. title: _this.demand.title,
  259. path: "/pages/demand/detail?demandid=" + _this.demand.id + "&parentid=" + _this.userinfo == null ? 0 : _this.userinfo.id
  260. }
  261. },
  262. methods: {
  263. getDemandCode: function() {
  264. _this.userinfo = _this.checkLogin("/pages/demand/detail?demandid=" + _this.demand.id);
  265. if (_this.userinfo === false) {
  266. return false;
  267. }
  268. _this.$req.ajax({
  269. title: "招聘简章生成中...",
  270. path: "demand/getdemandcode",
  271. data: {
  272. demandid: _this.demand.id,
  273. userid: _this.userinfo.id
  274. }
  275. }).then((data) => {
  276. _this.modal.demandpic = data.demandpic;
  277. _this.modal.isshow = "demandpicModal";
  278. }).catch((err) => {
  279. uni.showModal({
  280. title: '温馨提示',
  281. content: err,
  282. showCancel: false
  283. });
  284. });
  285. },
  286. saveImage: function() {
  287. uni.downloadFile({
  288. url: _this.modal.demandpic, //仅为示例,并非真实的资源
  289. success: (res) => {
  290. if (res.statusCode === 200) {
  291. uni.saveImageToPhotosAlbum({
  292. filePath: res.tempFilePath,
  293. success: function() {
  294. uni.showModal({
  295. title: '信息提示',
  296. content: "已保存到手机相册,注意查收。",
  297. showCancel: false
  298. });
  299. }
  300. });
  301. }
  302. }
  303. });
  304. },
  305. goPage: function(pageurl) {
  306. uni.navigateTo({
  307. url: pageurl,
  308. fail: function() {
  309. uni.switchTab({
  310. url: pageurl
  311. });
  312. }
  313. });
  314. },
  315. goDetail: function(demandid) {
  316. uni.navigateTo({
  317. url: '/pages/demand/detail?demandid=' + demandid
  318. });
  319. },
  320. goShop: function(workerid) {
  321. uni.navigateTo({
  322. url: '/pages/worker/shop?workerid=' + workerid
  323. });
  324. },
  325. navigate: function(href, e) {
  326. // #ifdef H5
  327. location.href = href;
  328. uni.navigateTo({
  329. url: '/pages/tool/webview?pagesrc=' + encodeURIComponent(href)
  330. });
  331. // #endif
  332. },
  333. // 接单
  334. setDemandLog: function() {
  335. uni.showModal({
  336. title: '信息提示',
  337. content: '接单&咨询该订单会扣除'+_this.param.teldemand+'积分,确定要接单&咨询该订单吗?',
  338. success: function(res) {
  339. if (res.confirm) {
  340. _this.$req.ajax({
  341. title: "接单中",
  342. path: "demand/setdemandlog",
  343. data: {
  344. demandid: _this.demand.id,
  345. gworkerid: _this.workerinfo.id,
  346. userid: _this.userinfo.id
  347. }
  348. }).then((data) => {
  349. _this.iscantele = true;
  350. uni.showModal({
  351. title: '温馨提示',
  352. content: "恭喜您,接单成功,请尽快提供就业人员。",
  353. showCancel: false
  354. });
  355. }).catch((err) => {
  356. uni.showModal({
  357. title: '温馨提示',
  358. content: err,
  359. showCancel: false
  360. });
  361. });
  362. }
  363. },
  364. });
  365. },
  366. // 弹窗显示隐藏
  367. showModal: function(e) {
  368. var modalname = e.currentTarget.dataset.modalname;
  369. _this.modal.name = modalname;
  370. },
  371. hideModal: function() {
  372. _this.modal.name = null;
  373. },
  374. // 工作环境
  375. previewImage: function(e) {
  376. var current = e.currentTarget.dataset.current;
  377. uni.previewImage({
  378. current: current,
  379. urls: _this.demand.picall
  380. });
  381. },
  382. setAddress: function() {
  383. uni.openLocation({
  384. latitude: parseFloat(_this.demand.worker.latitude),
  385. longitude: parseFloat(_this.demand.worker.longitude),
  386. name: _this.demand.worker.title,
  387. address: _this.demand.worker.city + " " + _this.demand.worker.district + " " + _this.demand.worker.address,
  388. success: function () {
  389. console.log('success');
  390. }
  391. });
  392. },
  393. // 咨询电话
  394. makeTelephone: function(e) {
  395. var telephone = e.currentTarget.dataset.telephone;
  396. if (_this.iscantele){
  397. uni.makePhoneCall({
  398. phoneNumber: telephone
  399. });
  400. return;
  401. }
  402. uni.showModal({
  403. title: '信息提示',
  404. content: '报名&咨询该订单会扣除'+_this.param.teldemand+'积分,确定要报名&咨询该订单吗?',
  405. success: function(res) {
  406. if (res.confirm) {
  407. _this.$req.ajax({
  408. path: "demand/setdemandlog",
  409. data: {
  410. demandid: _this.demand.id,
  411. gworkerid: _this.workerinfo.id,
  412. userid: _this.userinfo.id
  413. }
  414. }).then((data) => {
  415. _this.iscantele = true;
  416. uni.makePhoneCall({
  417. phoneNumber: telephone
  418. });
  419. }).catch((err) => {
  420. uni.showModal({
  421. title: '信息提示',
  422. content: err,
  423. showCancel: false
  424. });
  425. });
  426. }
  427. }
  428. });
  429. },
  430. cancelSnatch() {
  431. _this.snatchShow = false;
  432. },
  433. showSnatch() {
  434. _this.snatchShow = true;
  435. },
  436. confirmSnatch() {
  437. if (isNaN(_this.num)) {
  438. uni.showModal({
  439. title: '信息提示',
  440. content: "请输入数字",
  441. showCancel: false
  442. });
  443. }
  444. _this.$req.ajax({
  445. title: "抢单中",
  446. path: "demand/demandSnatch",
  447. data: {
  448. id: _this.demand.id,
  449. workerid: _this.workerinfo.id,
  450. num: _this.num,
  451. }
  452. }).then((data) => {
  453. _this.iscantele = true;
  454. _this.snatchShow = false;
  455. uni.showModal({
  456. title: '温馨提示',
  457. content: "恭喜您,接单成功,请尽快提供就业人员。",
  458. showCancel: false
  459. });
  460. }).catch((err) => {
  461. uni.showModal({
  462. title: '温馨提示',
  463. content: err,
  464. showCancel: false
  465. });
  466. });
  467. }
  468. }
  469. }
  470. </script>
  471. <style lang="scss">
  472. .flex-1 {
  473. flex: 1;
  474. }
  475. .flex-6 {
  476. flex: 6;
  477. }
  478. .picmodal {
  479. width: 640rpx;
  480. background-color: transparent;
  481. }
  482. .picmodal image {
  483. width: 100%;
  484. }
  485. .picmodal .bg-img {
  486. position: relative;
  487. }
  488. .picmodalclose {
  489. position: absolute;
  490. top: 0rpx;
  491. right: 0rpx;
  492. }
  493. .picallitem{ width: 340rpx; height: 260rpx; }
  494. .echo-picalllist{ height: calc(100vh - 105rpx); }
  495. .echo-picalllist .picitem{ width: 345rpx !important; }
  496. .echo-picalllist image{ width: 345rpx; padding-bottom: 15rpx; }
  497. .myVideo{ width: 750rpx; height: calc(100vh - 130px); }
  498. </style>