detail.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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">
  5. <text v-if="supply.mnumber>0"> 男{{supply.mnumber}}人,</text><text v-if="supply.wnumber>0"> 女{{supply.wnumber}}人</text>【{{supply.agegroup}}】
  6. </view>
  7. <view class="bg-white padding-top-sm text-gray flex justify-between">
  8. <view><text style="min-width: calc(6em);">可到岗日期:</text>{{supply.candate}}</view>
  9. <view>{{supply.updatetime_text}}</view>
  10. </view>
  11. <view class="bg-white padding-top-sm text-gray flex justify-start">
  12. <text style="min-width: calc(6em);">人员所在地:</text><text>{{supply.province}} {{supply.city}} {{supply.district}}</text>
  13. </view>
  14. <view class="bg-white padding-top-sm text-gray flex justify-start">
  15. <text style="min-width: calc(6em);">期望工作地:</text><text>{{supply.descity}}</text>
  16. </view>
  17. <view class="bg-white padding-top-sm text-gray text-right text-sm">
  18. {{supply.worker.title}}
  19. </view>
  20. </view>
  21. <view class="cu-bar bg-white solids-bottom">
  22. <view class="action">
  23. <text class="cuIcon-titles text-red"></text> 情况说明
  24. </view>
  25. </view>
  26. <view class="echo-article-details bg-white margin-bottom-sm">
  27. <text>{{supply.remark}}</text>
  28. </view>
  29. <view class="cu-bar bg-white solids-bottom margin-top-sm">
  30. <view class="action">
  31. <text class="cuIcon-titles text-red"></text> 店铺推荐
  32. </view>
  33. <view class="action" @tap="goPage('/pages/worker/shop?workerid='+supply.workerid)">
  34. <text class="text-df">进店看看 </text>
  35. <view class="cuIcon-right"></view>
  36. </view>
  37. </view>
  38. <block v-for="(item,index) in supplylist" :key="index">
  39. <view class="cu-card dynamic no-card solid-bottom echo-supply-item">
  40. <view class="cu-item shadow padding-top-sm padding-bottom" @tap="goDetail(item.id)">
  41. <view class="padding-lr padding-bottom-sm flex justify-between align-center">
  42. <view class="basis-xl text-bold text-lg text-cut"><text v-if="item.mnumber>0"> 男{{item.mnumber}}人,</text><text v-if="item.wnumber>0"> 女{{item.wnumber}}人</text>【{{item.agegroup}}】</view>
  43. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.updatetime_text}}</view>
  44. </view>
  45. <view class="padding-lr padding-bottom-sm text-cut text-gray text-sm">
  46. {{item.province}} {{item.city}} <text class="cuIcon-move margin-lr-xs text-gray"></text> {{item.descity}}
  47. </view>
  48. <view class="padding-lr text-sm text-gray"> 可到岗日期:{{item.candate}} </view>
  49. <view class="text-gray padding-lr text-sm padding-top-sm flex align-center justify-between" @tap="goShop(item.workerid)">
  50. <view class="text-cut basis-xl flex align-center">
  51. <image class="iconyrz" :src="$getImageUrl('static/images/applet/iconyrz.png')" mode="scaleToFill"></image>
  52. <view class="margin-left-sm">{{item.worker.title}}</view>
  53. </view>
  54. <view class="text-gray text-right basis-xs">
  55. <text class="cuIcon-shop margin-right-xs text-lg"></text>
  56. 进店
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </block>
  62. <view class="padding"></view>
  63. <view class="padding"></view>
  64. <view class="cu-bar bg-white tabbar border shop foot">
  65. <view class="action" @tap="goPage('/pages/worker/shop?workerid='+supply.workerid)">
  66. <view class="cuIcon-shop"></view>
  67. 进店
  68. </view>
  69. <button class="action" open-type="share" v-if="appplatform!='ios'">
  70. <view class="cuIcon-weixin text-green">
  71. <view class="cu-tag badge" style="font-size: 16rpx;">邀好友</view>
  72. </view>
  73. 分享
  74. </button>
  75. <view class="bg-red submit echo-foot-button" :data-telephone="supply.telephone" @tap="makeTelephone"> <text>电话咨询</text> </view>
  76. </view>
  77. <wxContact></wxContact>
  78. </view>
  79. </template>
  80. <script>
  81. var _this;
  82. export default {
  83. data() {
  84. return {
  85. appplatform: "",
  86. pageloading: false,
  87. userinfo: false,
  88. workerinfo: false,
  89. param: {},
  90. supply: {},
  91. iscantele: false,
  92. supplylist: {},
  93. modal: {
  94. isshow: "",
  95. supplypic: ""
  96. }
  97. }
  98. },
  99. onLoad: function(option) {
  100. _this = this;
  101. //#ifdef APP-PLUS
  102. _this.appplatform = uni.getSystemInfoSync().platform;
  103. //#endif
  104. var supplyid = option.supplyid || 0;
  105. var parentid = option.parentid || 0;
  106. if (option.scene) {
  107. const scene = decodeURIComponent(option.scene);
  108. if (scene != "undefined") {
  109. supplyid = scene.split("&")[0];
  110. parentid = scene.split('&')[1];
  111. }
  112. }
  113. uni.setStorageSync('parentid', parentid);
  114. _this.userinfo = _this.checkLogin("/pages/my/my");
  115. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  116. if (_this.userinfo === false || _this.workerinfo === false) {
  117. uni.reLaunch({
  118. url: "/pages/my/my"
  119. });
  120. return false;
  121. }
  122. _this.$req.ajax({
  123. path: "supply/getsupply",
  124. title: "加载中...",
  125. data: {
  126. supplyid: supplyid,
  127. userid: _this.userinfo == null ? 0 : _this.userinfo.id
  128. }
  129. }).then((data) => {
  130. _this.param = data.param;
  131. _this.supply = data.supply;
  132. _this.iscantele = data.iscantele;
  133. _this.supplylist = data.supplylist;
  134. _this.pageloading = true;
  135. }).catch((err) => {
  136. uni.showModal({
  137. title: '信息提示',
  138. content: err,
  139. showCancel: false
  140. });
  141. });
  142. },
  143. onShareAppMessage: function(res) {
  144. return {
  145. title: ( _this.supply.mnumber>0?("男"+ _this.supply.mnumber +"人,"):"")+(_this.supply.wnumber>0?("女"+ _this.supply.wnumber +"人"):"")+"【"+_this.supply.agegroup+"】",
  146. path: "/pages/supply/detail?supplyid=" + _this.supply.id + "&parentid=" + _this.userinfo == null ? 0 : _this.userinfo.id
  147. }
  148. },
  149. methods: {
  150. getSupplyCode: function() {
  151. _this.userinfo = _this.checkLogin("/pages/supply/detail?supplyid=" + _this.supply.id);
  152. if (_this.userinfo === false) {
  153. return false;
  154. }
  155. _this.$req.ajax({
  156. title: "招聘简章生成中...",
  157. path: "supply/getsupplycode",
  158. data: {
  159. supplyid: _this.supply.id,
  160. userid: _this.userinfo.id
  161. }
  162. }).then((data) => {
  163. _this.modal.supplypic = data.supplypic;
  164. _this.modal.isshow = "show";
  165. }).catch((err) => {
  166. uni.showModal({
  167. title: '温馨提示',
  168. content: err,
  169. showCancel: false
  170. });
  171. });
  172. },
  173. saveImage: function() {
  174. uni.downloadFile({
  175. url: _this.modal.supplypic, //仅为示例,并非真实的资源
  176. success: (res) => {
  177. if (res.statusCode === 200) {
  178. uni.saveImageToPhotosAlbum({
  179. filePath: res.tempFilePath,
  180. success: function() {
  181. uni.showModal({
  182. title: '信息提示',
  183. content: "已保存到手机相册,注意查收。",
  184. showCancel: false
  185. });
  186. }
  187. });
  188. }
  189. }
  190. });
  191. },
  192. hideModal: function() {
  193. _this.modal.isshow = "";
  194. },
  195. setSupplyLog: function() {
  196. _this.$req.ajax({
  197. title: "报名中",
  198. path: "supply/setsupplylog",
  199. data: {
  200. supplyid: _this.supply.id,
  201. gworkerid: _this.workerinfo.id
  202. }
  203. }).then((data) => {
  204. uni.showModal({
  205. title: '温馨提示',
  206. content: "恭喜您,报名成功,请尽快提供就业人员。",
  207. showCancel: false
  208. });
  209. }).catch((err) => {
  210. uni.showModal({
  211. title: '温馨提示',
  212. content: err,
  213. showCancel: false
  214. });
  215. });
  216. },
  217. goPage: function(pageurl) {
  218. uni.navigateTo({
  219. url: pageurl,
  220. fail: function() {
  221. uni.switchTab({
  222. url: pageurl
  223. });
  224. }
  225. });
  226. },
  227. goDetail: function(supplyid) {
  228. uni.navigateTo({
  229. url: '/pages/supply/detail?supplyid=' + supplyid
  230. });
  231. },
  232. goShop: function(workerid) {
  233. uni.navigateTo({
  234. url: '/pages/worker/shop?workerid=' + workerid
  235. });
  236. },
  237. navigate: function(href, e) {
  238. // #ifdef H5
  239. location.href = href;
  240. // #endif
  241. // #ifndef H5
  242. uni.navigateTo({
  243. url: '/pages/tool/webview?pagesrc=' + encodeURIComponent(href)
  244. });
  245. // #endif
  246. },
  247. // 咨询电话
  248. makeTelephone: function(e) {
  249. var telephone = e.currentTarget.dataset.telephone;
  250. if (_this.iscantele){
  251. uni.makePhoneCall({
  252. phoneNumber: telephone
  253. });
  254. return;
  255. }
  256. uni.showModal({
  257. title: '信息提示',
  258. content: '拨打咨询电话会扣除'+_this.param.telsupply+'积分,确定要拨打咨询电话吗?',
  259. success: function(res) {
  260. if (res.confirm) {
  261. _this.$req.ajax({
  262. path: "supply/telesupply",
  263. data: {
  264. supplyid: _this.supply.id,
  265. userid: _this.userinfo.id
  266. }
  267. }).then((data) => {
  268. _this.iscantele = true;
  269. uni.makePhoneCall({
  270. phoneNumber: telephone
  271. });
  272. }).catch((err) => {
  273. uni.showModal({
  274. title: '信息提示',
  275. content: err,
  276. showCancel: false
  277. });
  278. });
  279. }
  280. }
  281. });
  282. }
  283. }
  284. }
  285. </script>
  286. <style lang="scss">
  287. .flex-1 {
  288. flex: 1;
  289. }
  290. .flex-6 {
  291. flex: 6;
  292. }
  293. .picmodal {
  294. width: 640rpx;
  295. background-color: transparent;
  296. }
  297. .picmodal image {
  298. width: 100%;
  299. }
  300. .picmodal .bg-img {
  301. position: relative;
  302. }
  303. .picmodalclose {
  304. position: absolute;
  305. top: 0rpx;
  306. right: 0rpx;
  307. }
  308. </style>