shop.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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="$getImageUrl('static/images/applet/comJobs/icon-sum.png')" mode="widthFix">
  89. </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="$getImageUrl('static/images/applet/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-tag">
  101. <view v-for="(titem,tindex) in item.tags" :key="tindex" class="tag-item">{{titem}}</view>
  102. </view>
  103. </view>
  104. <!-- <view class="cu-card dynamic no-card solid-bottom echo-comjobs-item" v-for="(item,index) in plist"
  105. :key="index">
  106. <view class="cu-item shadow padding-top-sm padding-bottom">
  107. <view class="padding-lr padding-bottom-xs flex justify-between align-center"
  108. @tap="goDetail(item.id)">
  109. <view class="basis-xl text-bold text-lg text-cut">{{item.title}}</view>
  110. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.city}}</view>
  111. </view>
  112. <view class="padding-lr flex justify-between align-bottom" @tap="goDetail(item.id)">
  113. <view v-if="item.wtype==1"><text class="text-red text-bold">{{item.zwagall}}</text></view>
  114. <view v-if="item.wtype==5"><text class="text-red text-bold">其他</text></view>
  115. <view v-else><text class="text-red text-bold">{{item.bwagall}}</text></view>
  116. <view class="text-red">{{item.fwagall}}</view>
  117. </view>
  118. <view class="padding-lr text-cut" @tap="goDetail(item.id)">
  119. <view v-for="(titem,tindex) in item.tags" :key="tindex"
  120. class="cu-tag light bg-red sm echo-tags-item">{{titem}}</view>
  121. </view>
  122. </view>
  123. </view> -->
  124. </block>
  125. <block v-if="tablename=='demand'">
  126. <view class="listCard" v-for="(item,index) in plist" :key="index" @tap="goDetail(item.id)">
  127. <view class="listCard-item">
  128. <view class="item-left">
  129. <image class="item-icon" :src="$getImageUrl('static/images/applet/index/cardA.png')"
  130. mode="widthFix"></image>
  131. <view class="item-content bold">{{item.title}}</view>
  132. </view>
  133. <view class="item-right">
  134. <image class="item-icon" :src="$getImageUrl('static/images/applet/index/cardD.png')"
  135. mode="widthFix"></image>
  136. <view class="item-content">{{item.city}}</view>
  137. </view>
  138. </view>
  139. <view class="listCard-item">
  140. <view class="item-left">
  141. <image class="item-icon" :src="$getImageUrl('static/images/applet/comJobs/icon-sum.png')" mode="widthFix">
  142. </image>
  143. <view class="item-content red" v-if="item.wtype==1">{{item.zwagall}}</view>
  144. <view class="item-content red" v-else-if="item.wtype==5">其他</view>
  145. <view class="item-content red" v-else>{{item.bwagall}}</view>
  146. </view>
  147. <!-- <view class="item-right">
  148. <image class="item-icon" src="../../static/images/comJobs/icon-pageView.png"
  149. mode="widthFix"></image>
  150. <view class="item-content red">{{item.fwagall}}</view>
  151. </view> -->
  152. </view>
  153. <view class="listCard-tag">
  154. <view v-for="(titem,tindex) in item.tags" :key="tindex" class="tag-item">{{titem}}</view>
  155. </view>
  156. </view>
  157. <!-- <view class="cu-card dynamic no-card solid-bottom echo-demand-item" v-for="(item,index) in plist"
  158. :key="index">
  159. <view class="cu-item shadow padding-top-sm padding-bottom">
  160. <view class="padding-lr padding-bottom-xs flex justify-between align-center"
  161. @tap="goDetail(item.id)">
  162. <view class="basis-lg text-bold text-lg text-cut">{{item.title}}</view>
  163. <view class="basis-sm text-cut text-right text-gray text-sm">{{item.city}}</view>
  164. </view>
  165. <view class="padding-lr text-lg" @tap="goDetail(item.id)">
  166. <view v-if="item.wtype==1"><text class="text-red text-bold">{{item.zwagall}}</text></view>
  167. <view v-if="item.wtype==5"><text class="text-red text-bold">其他</text></view>
  168. <view v-else><text class="text-red text-bold">{{item.bwagall}}</text></view>
  169. </view>
  170. <view class="padding-lr text-cut" @tap="goDetail(item.id)">
  171. <view v-for="(titem,tindex) in item.tags" :key="tindex"
  172. class="cu-tag light bg-gray text-grey sm">{{titem}}</view>
  173. </view>
  174. </view>
  175. </view> -->
  176. </block>
  177. <block v-if="tablename=='supply'">
  178. <view class="cu-card dynamic no-card solid-bottom echo-supply-item" v-for="(item,index) in plist"
  179. :key="index">
  180. <view class="cu-item shadow padding-top-sm padding-bottom" @tap="goDetail(item.id)">
  181. <view class="padding-lr padding-bottom-sm flex justify-between align-center">
  182. <view class="basis-xl text-bold text-lg text-cut"><text v-if="item.mnumber>0">
  183. 男{{item.mnumber}}人,</text><text v-if="item.wnumber>0">
  184. 女{{item.wnumber}}人</text>【{{item.agegroup}}】</view>
  185. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.updatetime_text}}</view>
  186. </view>
  187. <view class="padding-lr padding-bottom-sm text-cut text-gray text-sm">
  188. {{item.province}} {{item.city}} <text class="cuIcon-move margin-lr-xs text-gray"></text>
  189. {{item.descity}}
  190. </view>
  191. <view class="padding-lr text-sm text-gray"> 可到岗日期:{{item.candate}} </view>
  192. </view>
  193. </view>
  194. </block>
  195. </view>
  196. <uni-load-more :status="pstatus"></uni-load-more>
  197. </view>
  198. </template>
  199. <script>
  200. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  201. var _this;
  202. export default {
  203. components: {
  204. uniLoadMore
  205. },
  206. data() {
  207. return {
  208. userinfo: false,
  209. workerinfo: false,
  210. shopworker: false,
  211. countarr: {
  212. comjobs: 0,
  213. demand: 0,
  214. supply: 0
  215. },
  216. tablename: 'comjobs',
  217. pstatus: 'more',
  218. ppage: 1,
  219. psize: 20,
  220. plist: [],
  221. }
  222. },
  223. onLoad: function(option) {
  224. _this = this;
  225. var workerid = option.workerid || 0;
  226. var parentid = option.parentid || 0;
  227. if (option.scene) {
  228. const scene = decodeURIComponent(option.scene);
  229. if (scene != "undefined") {
  230. workerid = scene.split("&")[0];
  231. parentid = scene.split('&')[1];
  232. }
  233. }
  234. uni.setStorageSync('parentid', parentid);
  235. _this.userinfo = uni.getStorageSync('userinfo') || false;
  236. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  237. _this.$req.ajax({
  238. path: "worker/pageshop",
  239. data: {
  240. workerid: workerid,
  241. userid: _this.userinfo == false ? 0 : _this.userinfo.id
  242. }
  243. }).then((data) => {
  244. _this.countarr = data.countarr;
  245. _this.shopworker = data.shopworker;
  246. _this.getMore();
  247. }).catch((err) => {
  248. uni.showModal({
  249. title: '信息提示',
  250. content: err,
  251. showCancel: false,
  252. success: function(res) {
  253. if (res.confirm) {
  254. uni.navigateBack();
  255. }
  256. }
  257. });
  258. });
  259. },
  260. onShareAppMessage: function(res) {
  261. return {
  262. title: _this.shopworker.title,
  263. path: "/pages/worder/shop?workerid=" + _this.shopworker.id + "&parentid=" + _this.userinfo == false ?
  264. 0 : _this.userinfo.id
  265. }
  266. },
  267. onPullDownRefresh: function() {
  268. _this.pageRefresh();
  269. },
  270. onReachBottom: function() {
  271. if (_this.pstatus !== 'more') {
  272. return;
  273. }
  274. _this.getMore();
  275. },
  276. methods: {
  277. pageRefresh: function() {
  278. _this.pstatus = 'more';
  279. _this.ppage = 1;
  280. _this.plist = [];
  281. _this.getMore();
  282. },
  283. getMore: function() {
  284. var path = "worker/shopcomjobs";
  285. if (_this.tablename == "demand") {
  286. path = "worker/shopdemand";
  287. } else if (_this.tablename == "supply") {
  288. path = "worker/shopsupply";
  289. }
  290. _this.$req.ajax({
  291. path: path,
  292. data: {
  293. ppage: _this.ppage,
  294. psize: _this.psize,
  295. workerid: _this.shopworker.id
  296. }
  297. }).then((data) => {
  298. _this.pstatus = data.pstatus;
  299. _this.plist = _this.plist.concat(data.plist);
  300. _this.ppage += 1;
  301. uni.stopPullDownRefresh();
  302. }).catch((err) => {
  303. uni.showModal({
  304. title: '信息提示',
  305. content: err,
  306. showCancel: false
  307. });
  308. });
  309. },
  310. tabSelect: function(e) {
  311. _this.tablename = e.currentTarget.dataset.tablename;
  312. _this.pageRefresh();
  313. },
  314. goDetail: function(id) {
  315. if (_this.tablename == "demand") {
  316. uni.navigateTo({
  317. url: '/pages/demand/detail?demandid=' + id
  318. });
  319. } else if (_this.tablename == "supply") {
  320. uni.navigateTo({
  321. url: '/pages/supply/detail?supplyid=' + id
  322. });
  323. } else {
  324. uni.navigateTo({
  325. url: '/pages/comjobs/detail?comjobsid=' + id
  326. });
  327. }
  328. },
  329. goShop: function(workerid) {
  330. uni.navigateTo({
  331. url: '/pages/worker/shop?workerid=' + workerid
  332. });
  333. },
  334. setAddress: function() {
  335. uni.openLocation({
  336. latitude: parseFloat(_this.shopworker.latitude),
  337. longitude: parseFloat(_this.shopworker.longitude),
  338. name: _this.shopworker.title,
  339. address: _this.shopworker.city + " " + _this.shopworker.district + " " + _this.shopworker
  340. .address,
  341. success: function() {
  342. console.log('success');
  343. }
  344. });
  345. },
  346. makeTelephone: function(e) {
  347. var telephone = e.currentTarget.dataset.telephone;
  348. uni.makePhoneCall({
  349. phoneNumber: telephone
  350. });
  351. }
  352. }
  353. }
  354. </script>
  355. <style lang="scss">
  356. .codebox {
  357. width: 690rpx;
  358. margin: 0rpx auto 0rpx auto;
  359. border-radius: 8rpx;
  360. overflow: hidden;
  361. }
  362. .codebox>view {
  363. margin-top: 20rpx;
  364. }
  365. .echo-grid-item {
  366. width: 220rpx;
  367. height: 140rpx;
  368. }
  369. .listCard {
  370. margin: 0 20rpx 20rpx;
  371. padding: 20rpx 24rpx 0;
  372. background: #FFFFFF;
  373. border-radius: 12rpx;
  374. .listCard-tag {
  375. display: flex;
  376. flex-wrap: wrap;
  377. .tag-item {
  378. margin-right: 15rpx;
  379. background: #E6F2FF;
  380. font-size: 20rpx;
  381. color: #CA151C;
  382. padding: 5rpx 12rpx;
  383. margin-bottom: 20rpx;
  384. white-space: nowrap;
  385. text-overflow: ellipsis;
  386. white-space: nowrap;
  387. overflow: hidden;
  388. }
  389. }
  390. .listCard-item {
  391. display: flex;
  392. margin-bottom: 28rpx;
  393. .item-left {
  394. width: 60%;
  395. display: flex;
  396. .item-icon {
  397. width: 35rpx;
  398. height: 35rpx;
  399. }
  400. .item-content {
  401. flex: 1;
  402. margin-left: 15rpx;
  403. font-size: 28rpx;
  404. color: #747474;
  405. overflow: hidden;
  406. text-overflow: ellipsis;
  407. -webkit-line-clamp: 1;
  408. display: -webkit-box;
  409. -webkit-box-orient: vertical;
  410. }
  411. .bold {
  412. font-size: 28rpx;
  413. font-weight: 600;
  414. color: #383838;
  415. }
  416. .red {
  417. font-size: 28rpx;
  418. font-weight: 600;
  419. color: #CA151C;
  420. }
  421. }
  422. .item-right {
  423. width: 35%;
  424. margin-left: 15rpx;
  425. display: flex;
  426. .item-icon {
  427. width: 35rpx;
  428. height: 35rpx;
  429. }
  430. .item-content {
  431. flex: 1;
  432. margin-left: 15rpx;
  433. font-size: 28rpx;
  434. line-height: 35rpx;
  435. color: #747474;
  436. overflow: hidden;
  437. text-overflow: ellipsis;
  438. -webkit-line-clamp: 1;
  439. display: -webkit-box;
  440. -webkit-box-orient: vertical;
  441. }
  442. .bold {
  443. font-size: 28rpx;
  444. font-weight: 600;
  445. color: #383838;
  446. }
  447. .red {
  448. font-size: 28rpx;
  449. font-weight: 600;
  450. color: #CA151C;
  451. }
  452. }
  453. }
  454. }
  455. </style>