shop.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <template>
  2. <view>
  3. <view class="bg-themeRed" style="position: relative; height: 130rpx;">
  4. <view class="text-center padding-tb-lg padding-lr" style="position: absolute;">
  5. <view class="cu-list menu-avatar codebox">
  6. <view class="cu-item">
  7. <view class="cu-avatar radius lg" v-if="shopworker!=false"
  8. :style="'background-image:url('+shopworker.tilpic+');'"></view>
  9. <view class="content">
  10. <view class="text-pink">
  11. <view class="text-cut text-black">{{shopworker.ftitle}}</view>
  12. </view>
  13. <view class="text-gray text-sm flex">
  14. <view class="text-cut">{{shopworker.title}}</view>
  15. </view>
  16. </view>
  17. <view class="action">
  18. <button class="cu-btn bg-red cuIcon" @tap="setAddress">
  19. <text class="cuIcon-locationfill"></text>
  20. </button>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="padding-tb-lg"></view>
  27. <view class="cu-bar bg-white solids-bottom margin-top-sm">
  28. <view class="action">
  29. <text class="cuIcon-titles text-red"></text> 企业介绍
  30. </view>
  31. </view>
  32. <view class="padding-tb-sm padding-lr bg-white margin-bottom-sm">
  33. <text>{{shopworker.details}}</text>
  34. </view>
  35. <!-- <view class="padding grid flex justify-between">
  36. <view class="padding-lr-xs bg-white echo-grid-item" @tap="makeTelephone" :data-telephone="shopworker.mobile">
  37. <view class="bg-white padding-bottom-xs padding-top-sm padding-lr-sm"><text class="padding-right-xs cuIcon-dianhua text-orange"></text> 拨打电话</view>
  38. <view class="bg-white padding-top-sm padding-bottom-xs padding-lr-sm text-sm text-gray">{{shopworker.mobile}}</view>
  39. </view>
  40. <view class="padding-lr-xs bg-white echo-grid-item">
  41. <view class="bg-white padding-bottom-xs padding-top-sm padding-lr-sm"><text class="padding-right-xs cuIcon-weixin text-green"></text> 加我微信</view>
  42. <view class="bg-white padding-top-sm padding-bottom-xs padding-lr-sm text-sm text-gray">{{shopworker.weixin}}</view>
  43. </view>
  44. <view class="padding-lr-xs bg-white echo-grid-item" @tap="setAddress">
  45. <view class="bg-white padding-bottom-xs padding-top-sm padding-lr-sm"><text class="padding-right-xs cuIcon-locationfill text-blue"></text> 公司地址</view>
  46. <view class="bg-white padding-top-sm padding-bottom-xs padding-lr-sm text-sm text-gray">{{shopworker.city}} {{shopworker.district}}</view>
  47. </view>
  48. </view> -->
  49. <view class="cu-bar bg-white solids-bottom" v-if="workerinfo==false">
  50. <view class="action">
  51. <text class="cuIcon-titles text-red"></text> 招聘推荐
  52. </view>
  53. <view class="action">
  54. <text class="text-df">共 {{countarr.comjobs}} 条 </text>
  55. <view class="cuIcon-right"></view>
  56. </view>
  57. </view>
  58. <scroll-view scroll-x class="bg-white nav" v-if="workerinfo!=false">
  59. <view class="flex text-center">
  60. <view class="cu-item flex-sub" :class="tablename=='comjobs'?'text-red cur':''" @tap="tabSelect"
  61. data-tablename="comjobs">招聘 <text
  62. class="cu-tag bg-red sm round margin-lr-sm">{{countarr.comjobs}}</text></view>
  63. <view class="cu-item flex-sub" :class="tablename=='demand'?'text-red cur':''" @tap="tabSelect"
  64. data-tablename="demand">订单 <text
  65. class="cu-tag bg-red sm round margin-lr-sm">{{countarr.demand}}</text></view>
  66. <view class="cu-item flex-sub" :class="tablename=='supply'?'text-red cur':''" @tap="tabSelect"
  67. data-tablename="supply">供人 <text
  68. class="cu-tag bg-red sm round margin-lr-sm">{{countarr.supply}}</text></view>
  69. </view>
  70. </scroll-view>
  71. <view class="solids-top">
  72. <block v-if="tablename=='comjobs'">
  73. <view class="listCard" v-for="(item,index) in plist" :key="index" @tap="goDetail(item.id)">
  74. <view class="listCard-item">
  75. <view class="item-left">
  76. <image class="item-icon" :src="$getImageUrl('static/images/applet/index/cardA.png')"
  77. mode="widthFix"></image>
  78. <view class="item-content bold">{{item.title}}</view>
  79. </view>
  80. <view class="item-right">
  81. <image class="item-icon" :src="$getImageUrl('static/images/applet/index/cardD.png')"
  82. mode="widthFix"></image>
  83. <view class="item-content">{{item.city}}</view>
  84. </view>
  85. </view>
  86. <view class="listCard-item">
  87. <view class="item-left">
  88. <image class="item-icon" src="../../static/images/comJobs/icon-sum.png"
  89. mode="widthFix"></image>
  90. <view class="item-content red" v-if="item.wtype==1">{{item.zwagall}}</view>
  91. <view class="item-content red" v-else-if="item.wtype==5">其他</view>
  92. <view class="item-content red" v-else>{{item.bwagall}}</view>
  93. </view>
  94. <view class="item-right">
  95. <image class="item-icon" src="../../static/images/comJobs/icon-pageView.png"
  96. mode="widthFix"></image>
  97. <view class="item-content red">{{item.fwagall}}</view>
  98. </view>
  99. </view>
  100. <view class="listCard-item">
  101. <view v-for="(titem,tindex) in item.tags" :key="tindex"
  102. class="cu-tag light bg-gray text-grey sm">{{titem}}</view>
  103. </view>
  104. </view>
  105. <!-- <view class="cu-card dynamic no-card solid-bottom echo-comjobs-item" v-for="(item,index) in plist"
  106. :key="index">
  107. <view class="cu-item shadow padding-top-sm padding-bottom">
  108. <view class="padding-lr padding-bottom-xs flex justify-between align-center"
  109. @tap="goDetail(item.id)">
  110. <view class="basis-xl text-bold text-lg text-cut">{{item.title}}</view>
  111. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.city}}</view>
  112. </view>
  113. <view class="padding-lr flex justify-between align-bottom" @tap="goDetail(item.id)">
  114. <view v-if="item.wtype==1"><text class="text-red text-bold">{{item.zwagall}}</text></view>
  115. <view v-if="item.wtype==5"><text class="text-red text-bold">其他</text></view>
  116. <view v-else><text class="text-red text-bold">{{item.bwagall}}</text></view>
  117. <view class="text-red">{{item.fwagall}}</view>
  118. </view>
  119. <view class="padding-lr text-cut" @tap="goDetail(item.id)">
  120. <view v-for="(titem,tindex) in item.tags" :key="tindex"
  121. class="cu-tag light bg-red sm echo-tags-item">{{titem}}</view>
  122. </view>
  123. </view>
  124. </view> -->
  125. </block>
  126. <block v-if="tablename=='demand'">
  127. <view class="listCard" v-for="(item,index) in plist" :key="index" @tap="goDetail(item.id)">
  128. <view class="listCard-item">
  129. <view class="item-left">
  130. <image class="item-icon" :src="$getImageUrl('static/images/applet/index/cardA.png')"
  131. mode="widthFix"></image>
  132. <view class="item-content bold">{{item.title}}</view>
  133. </view>
  134. <view class="item-right">
  135. <image class="item-icon" :src="$getImageUrl('static/images/applet/index/cardD.png')"
  136. mode="widthFix"></image>
  137. <view class="item-content">{{item.city}}</view>
  138. </view>
  139. </view>
  140. <view class="listCard-item">
  141. <view class="item-left">
  142. <image class="item-icon" src="../../static/images/comJobs/icon-sum.png"
  143. mode="widthFix"></image>
  144. <view class="item-content red" v-if="item.wtype==1">{{item.zwagall}}</view>
  145. <view class="item-content red" v-else-if="item.wtype==5">其他</view>
  146. <view class="item-content red" v-else>{{item.bwagall}}</view>
  147. </view>
  148. <!-- <view class="item-right">
  149. <image class="item-icon" src="../../static/images/comJobs/icon-pageView.png"
  150. mode="widthFix"></image>
  151. <view class="item-content red">{{item.fwagall}}</view>
  152. </view> -->
  153. </view>
  154. <view class="listCard-item">
  155. <view v-for="(titem,tindex) in item.tags" :key="tindex"
  156. class="cu-tag light bg-gray text-grey sm">{{titem}}</view>
  157. </view>
  158. </view>
  159. <!-- <view class="cu-card dynamic no-card solid-bottom echo-demand-item" v-for="(item,index) in plist"
  160. :key="index">
  161. <view class="cu-item shadow padding-top-sm padding-bottom">
  162. <view class="padding-lr padding-bottom-xs flex justify-between align-center"
  163. @tap="goDetail(item.id)">
  164. <view class="basis-lg text-bold text-lg text-cut">{{item.title}}</view>
  165. <view class="basis-sm text-cut text-right text-gray text-sm">{{item.city}}</view>
  166. </view>
  167. <view class="padding-lr text-lg" @tap="goDetail(item.id)">
  168. <view v-if="item.wtype==1"><text class="text-red text-bold">{{item.zwagall}}</text></view>
  169. <view v-if="item.wtype==5"><text class="text-red text-bold">其他</text></view>
  170. <view v-else><text class="text-red text-bold">{{item.bwagall}}</text></view>
  171. </view>
  172. <view class="padding-lr text-cut" @tap="goDetail(item.id)">
  173. <view v-for="(titem,tindex) in item.tags" :key="tindex"
  174. class="cu-tag light bg-gray text-grey sm">{{titem}}</view>
  175. </view>
  176. </view>
  177. </view> -->
  178. </block>
  179. <block v-if="tablename=='supply'">
  180. <view class="cu-card dynamic no-card solid-bottom echo-supply-item" v-for="(item,index) in plist"
  181. :key="index">
  182. <view class="cu-item shadow padding-top-sm padding-bottom" @tap="goDetail(item.id)">
  183. <view class="padding-lr padding-bottom-sm flex justify-between align-center">
  184. <view class="basis-xl text-bold text-lg text-cut"><text v-if="item.mnumber>0">
  185. 男{{item.mnumber}}人,</text><text v-if="item.wnumber>0">
  186. 女{{item.wnumber}}人</text>【{{item.agegroup}}】</view>
  187. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.updatetime_text}}</view>
  188. </view>
  189. <view class="padding-lr padding-bottom-sm text-cut text-gray text-sm">
  190. {{item.province}} {{item.city}} <text class="cuIcon-move margin-lr-xs text-gray"></text>
  191. {{item.descity}}
  192. </view>
  193. <view class="padding-lr text-sm text-gray"> 可到岗日期:{{item.candate}} </view>
  194. </view>
  195. </view>
  196. </block>
  197. </view>
  198. <uni-load-more :status="pstatus"></uni-load-more>
  199. </view>
  200. </template>
  201. <script>
  202. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  203. var _this;
  204. export default {
  205. components: {
  206. uniLoadMore
  207. },
  208. data() {
  209. return {
  210. userinfo: false,
  211. workerinfo: false,
  212. shopworker: false,
  213. countarr: {
  214. comjobs: 0,
  215. demand: 0,
  216. supply: 0
  217. },
  218. tablename: 'comjobs',
  219. pstatus: 'more',
  220. ppage: 1,
  221. psize: 20,
  222. plist: [],
  223. }
  224. },
  225. onLoad: function(option) {
  226. _this = this;
  227. var workerid = option.workerid || 0;
  228. var parentid = option.parentid || 0;
  229. if (option.scene) {
  230. const scene = decodeURIComponent(option.scene);
  231. if (scene != "undefined") {
  232. workerid = scene.split("&")[0];
  233. parentid = scene.split('&')[1];
  234. }
  235. }
  236. uni.setStorageSync('parentid', parentid);
  237. _this.userinfo = uni.getStorageSync('userinfo') || false;
  238. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  239. _this.$req.ajax({
  240. path: "worker/pageshop",
  241. data: {
  242. workerid: workerid,
  243. userid: _this.userinfo == false ? 0 : _this.userinfo.id
  244. }
  245. }).then((data) => {
  246. _this.countarr = data.countarr;
  247. _this.shopworker = data.shopworker;
  248. _this.getMore();
  249. }).catch((err) => {
  250. uni.showModal({
  251. title: '信息提示',
  252. content: err,
  253. showCancel: false,
  254. success: function(res) {
  255. if (res.confirm) {
  256. uni.navigateBack();
  257. }
  258. }
  259. });
  260. });
  261. },
  262. onShareAppMessage: function(res) {
  263. return {
  264. title: _this.shopworker.title,
  265. path: "/pages/worder/shop?workerid=" + _this.shopworker.id + "&parentid=" + _this.userinfo == false ?
  266. 0 : _this.userinfo.id
  267. }
  268. },
  269. onPullDownRefresh: function() {
  270. _this.pageRefresh();
  271. },
  272. onReachBottom: function() {
  273. if (_this.pstatus !== 'more') {
  274. return;
  275. }
  276. _this.getMore();
  277. },
  278. methods: {
  279. pageRefresh: function() {
  280. _this.pstatus = 'more';
  281. _this.ppage = 1;
  282. _this.plist = [];
  283. _this.getMore();
  284. },
  285. getMore: function() {
  286. var path = "worker/shopcomjobs";
  287. if (_this.tablename == "demand") {
  288. path = "worker/shopdemand";
  289. } else if (_this.tablename == "supply") {
  290. path = "worker/shopsupply";
  291. }
  292. _this.$req.ajax({
  293. path: path,
  294. data: {
  295. ppage: _this.ppage,
  296. psize: _this.psize,
  297. workerid: _this.shopworker.id
  298. }
  299. }).then((data) => {
  300. _this.pstatus = data.pstatus;
  301. _this.plist = _this.plist.concat(data.plist);
  302. _this.ppage += 1;
  303. uni.stopPullDownRefresh();
  304. }).catch((err) => {
  305. uni.showModal({
  306. title: '信息提示',
  307. content: err,
  308. showCancel: false
  309. });
  310. });
  311. },
  312. tabSelect: function(e) {
  313. _this.tablename = e.currentTarget.dataset.tablename;
  314. _this.pageRefresh();
  315. },
  316. goDetail: function(id) {
  317. if (_this.tablename == "demand") {
  318. uni.navigateTo({
  319. url: '/pages/demand/detail?demandid=' + id
  320. });
  321. } else if (_this.tablename == "supply") {
  322. uni.navigateTo({
  323. url: '/pages/supply/detail?supplyid=' + id
  324. });
  325. } else {
  326. uni.navigateTo({
  327. url: '/pages/comjobs/detail?comjobsid=' + id
  328. });
  329. }
  330. },
  331. goShop: function(workerid) {
  332. uni.navigateTo({
  333. url: '/pages/worker/shop?workerid=' + workerid
  334. });
  335. },
  336. setAddress: function() {
  337. uni.openLocation({
  338. latitude: parseFloat(_this.shopworker.latitude),
  339. longitude: parseFloat(_this.shopworker.longitude),
  340. name: _this.shopworker.title,
  341. address: _this.shopworker.city + " " + _this.shopworker.district + " " + _this.shopworker
  342. .address,
  343. success: function() {
  344. console.log('success');
  345. }
  346. });
  347. },
  348. makeTelephone: function(e) {
  349. var telephone = e.currentTarget.dataset.telephone;
  350. uni.makePhoneCall({
  351. phoneNumber: telephone
  352. });
  353. }
  354. }
  355. }
  356. </script>
  357. <style lang="scss">
  358. .codebox {
  359. width: 690rpx;
  360. margin: 0rpx auto 0rpx auto;
  361. border-radius: 8rpx;
  362. overflow: hidden;
  363. }
  364. .codebox>view {
  365. margin-top: 20rpx;
  366. }
  367. .echo-grid-item {
  368. width: 220rpx;
  369. height: 140rpx;
  370. }
  371. .listCard {
  372. margin: 0 20rpx 40rpx;
  373. padding: 28rpx 24rpx 0;
  374. background: #FFFFFF;
  375. border-radius: 12rpx;
  376. .listCard-item {
  377. display: flex;
  378. margin-bottom: 28rpx;
  379. .item-left {
  380. width: 60%;
  381. display: flex;
  382. .item-icon {
  383. width: 35rpx;
  384. height: 35rpx;
  385. }
  386. .item-content {
  387. flex: 1;
  388. margin-left: 15rpx;
  389. font-size: 28rpx;
  390. color: #747474;
  391. overflow: hidden;
  392. text-overflow: ellipsis;
  393. -webkit-line-clamp: 1;
  394. display: -webkit-box;
  395. -webkit-box-orient: vertical;
  396. }
  397. .bold {
  398. font-size: 28rpx;
  399. font-weight: 600;
  400. color: #383838;
  401. }
  402. .red {
  403. font-size: 28rpx;
  404. font-weight: 600;
  405. color: #CA151C;
  406. }
  407. }
  408. .item-right {
  409. width: 35%;
  410. margin-left: 15rpx;
  411. display: flex;
  412. .item-icon {
  413. width: 35rpx;
  414. height: 35rpx;
  415. }
  416. .item-content {
  417. flex: 1;
  418. margin-left: 15rpx;
  419. font-size: 28rpx;
  420. line-height: 35rpx;
  421. color: #747474;
  422. overflow: hidden;
  423. text-overflow: ellipsis;
  424. -webkit-line-clamp: 1;
  425. display: -webkit-box;
  426. -webkit-box-orient: vertical;
  427. }
  428. .bold {
  429. font-size: 28rpx;
  430. font-weight: 600;
  431. color: #383838;
  432. }
  433. .red {
  434. font-size: 28rpx;
  435. font-weight: 600;
  436. color: #CA151C;
  437. }
  438. }
  439. }
  440. }
  441. </style>