shop.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <view>
  3. <view class="bg-blue" 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" :style="'background-image:url('+shopworker.tilpic+');'"></view>
  8. <view class="content">
  9. <view class="text-pink">
  10. <view class="text-cut text-black">{{shopworker.ftitle}}</view>
  11. </view>
  12. <view class="text-gray text-sm flex">
  13. <view class="text-cut">{{shopworker.title}}</view>
  14. </view>
  15. </view>
  16. <view class="action">
  17. <button class="cu-btn bg-blue cuIcon" @tap="setAddress">
  18. <text class="cuIcon-locationfill"></text>
  19. </button>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="padding-tb-lg"></view>
  26. <view class="cu-bar bg-white solids-bottom margin-top-sm">
  27. <view class="action">
  28. <text class="cuIcon-titles text-blue"></text> 企业介绍
  29. </view>
  30. </view>
  31. <view class="padding-tb-sm padding-lr bg-white margin-bottom-sm">
  32. <text>{{shopworker.details}}</text>
  33. </view>
  34. <!-- <view class="padding grid flex justify-between">
  35. <view class="padding-lr-xs bg-white echo-grid-item" @tap="makeTelephone" :data-telephone="shopworker.mobile">
  36. <view class="bg-white padding-bottom-xs padding-top-sm padding-lr-sm"><text class="padding-right-xs cuIcon-dianhua text-orange"></text> 拨打电话</view>
  37. <view class="bg-white padding-top-sm padding-bottom-xs padding-lr-sm text-sm text-gray">{{shopworker.mobile}}</view>
  38. </view>
  39. <view class="padding-lr-xs bg-white echo-grid-item">
  40. <view class="bg-white padding-bottom-xs padding-top-sm padding-lr-sm"><text class="padding-right-xs cuIcon-weixin text-green"></text> 加我微信</view>
  41. <view class="bg-white padding-top-sm padding-bottom-xs padding-lr-sm text-sm text-gray">{{shopworker.weixin}}</view>
  42. </view>
  43. <view class="padding-lr-xs bg-white echo-grid-item" @tap="setAddress">
  44. <view class="bg-white padding-bottom-xs padding-top-sm padding-lr-sm"><text class="padding-right-xs cuIcon-locationfill text-blue"></text> 公司地址</view>
  45. <view class="bg-white padding-top-sm padding-bottom-xs padding-lr-sm text-sm text-gray">{{shopworker.city}} {{shopworker.district}}</view>
  46. </view>
  47. </view> -->
  48. <view class="cu-bar bg-white solids-bottom" v-if="workerinfo==false">
  49. <view class="action">
  50. <text class="cuIcon-titles text-blue"></text> 招聘推荐
  51. </view>
  52. <view class="action">
  53. <text class="text-df">共 {{countarr.comjobs}} 条 </text>
  54. <view class="cuIcon-right"></view>
  55. </view>
  56. </view>
  57. <scroll-view scroll-x class="bg-white nav" v-if="workerinfo!=false">
  58. <view class="flex text-center">
  59. <view class="cu-item flex-sub" :class="tablename=='comjobs'?'text-blue cur':''" @tap="tabSelect" data-tablename="comjobs">招聘 <text class="cu-tag bg-blue sm round margin-lr-sm">{{countarr.comjobs}}</text></view>
  60. <view class="cu-item flex-sub" :class="tablename=='demand'?'text-blue cur':''" @tap="tabSelect" data-tablename="demand">订单 <text class="cu-tag bg-blue sm round margin-lr-sm">{{countarr.demand}}</text></view>
  61. <view class="cu-item flex-sub" :class="tablename=='supply'?'text-blue cur':''" @tap="tabSelect" data-tablename="supply">供人 <text class="cu-tag bg-blue sm round margin-lr-sm">{{countarr.supply}}</text></view>
  62. </view>
  63. </scroll-view>
  64. <view class="solids-top">
  65. <block v-if="tablename=='comjobs'">
  66. <view class="cu-card dynamic no-card solid-bottom echo-comjobs-item" v-for="(item,index) in plist" :key="index">
  67. <view class="cu-item shadow padding-top-sm padding-bottom">
  68. <view class="padding-lr padding-bottom-xs flex justify-between align-center" @tap="goDetail(item.id)">
  69. <view class="basis-xl text-bold text-lg text-cut">{{item.title}}</view>
  70. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.city}}</view>
  71. </view>
  72. <view class="padding-lr flex justify-between align-bottom" @tap="goDetail(item.id)">
  73. <view v-if="item.wtype==1"><text class="text-red text-bold">{{item.zwagall}}</text></view>
  74. <view v-if="item.wtype==5"><text class="text-red text-bold">其他</text></view>
  75. <view v-else><text class="text-red text-bold">{{item.bwagall}}</text></view>
  76. <view class="text-red">{{item.fwagall}}</view>
  77. </view>
  78. <view class="padding-lr text-cut" @tap="goDetail(item.id)">
  79. <view v-for="(titem,tindex) in item.tags" :key="tindex" class="cu-tag light bg-blue sm echo-tags-item">{{titem}}</view>
  80. </view>
  81. </view>
  82. </view>
  83. </block>
  84. <block v-if="tablename=='demand'">
  85. <view class="cu-card dynamic no-card solid-bottom echo-demand-item" v-for="(item,index) in plist" :key="index">
  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.zwagall}}</text></view>
  93. <view v-if="item.wtype==5"><text class="text-red text-bold">其他</text></view>
  94. <view v-else><text class="text-red text-bold">{{item.bwagall}}</text></view>
  95. </view>
  96. <view class="padding-lr text-cut" @tap="goDetail(item.id)">
  97. <view v-for="(titem,tindex) in item.tags" :key="tindex" class="cu-tag light bg-gray text-grey sm">{{titem}}</view>
  98. </view>
  99. </view>
  100. </view>
  101. </block>
  102. <block v-if="tablename=='supply'">
  103. <view class="cu-card dynamic no-card solid-bottom echo-supply-item" v-for="(item,index) in plist" :key="index">
  104. <view class="cu-item shadow padding-top-sm padding-bottom" @tap="goDetail(item.id)">
  105. <view class="padding-lr padding-bottom-sm flex justify-between align-center">
  106. <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>
  107. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.updatetime_text}}</view>
  108. </view>
  109. <view class="padding-lr padding-bottom-sm text-cut text-gray text-sm">
  110. {{item.province}} {{item.city}} <text class="cuIcon-move margin-lr-xs text-gray"></text> {{item.descity}}
  111. </view>
  112. <view class="padding-lr text-sm text-gray"> 可到岗日期:{{item.candate}} </view>
  113. </view>
  114. </view>
  115. </block>
  116. </view>
  117. <uni-load-more :status="pstatus"></uni-load-more>
  118. </view>
  119. </template>
  120. <script>
  121. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  122. var _this;
  123. export default {
  124. components: {
  125. uniLoadMore
  126. },
  127. data() {
  128. return {
  129. userinfo: false,
  130. workerinfo: false,
  131. shopworker: false,
  132. countarr: {
  133. comjobs: 0,
  134. demand: 0,
  135. supply: 0
  136. },
  137. tablename: 'comjobs',
  138. pstatus: 'more',
  139. ppage: 1,
  140. psize: 20,
  141. plist: [],
  142. }
  143. },
  144. onLoad: function(option) {
  145. _this = this;
  146. var workerid = option.workerid || 0;
  147. var parentid = option.parentid || 0;
  148. if (option.scene) {
  149. const scene = decodeURIComponent(option.scene);
  150. if (scene != "undefined") {
  151. workerid = scene.split("&")[0];
  152. parentid = scene.split('&')[1];
  153. }
  154. }
  155. uni.setStorageSync('parentid', parentid);
  156. _this.userinfo = uni.getStorageSync('userinfo') || false;
  157. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  158. _this.$req.ajax({
  159. path: "worker/pageshop",
  160. data: {
  161. workerid: workerid,
  162. userid: _this.userinfo == false ? 0 : _this.userinfo.id
  163. }
  164. }).then((data) => {
  165. _this.countarr = data.countarr;
  166. _this.shopworker = data.shopworker;
  167. _this.getMore();
  168. }).catch((err) => {
  169. uni.showModal({
  170. title: '信息提示',
  171. content: err,
  172. showCancel: false,
  173. success: function(res) {
  174. if (res.confirm) {
  175. uni.navigateBack();
  176. }
  177. }
  178. });
  179. });
  180. },
  181. onShareAppMessage: function(res) {
  182. return {
  183. title: _this.shopworker.title,
  184. path: "/pages/worder/shop?workerid=" + _this.shopworker.id + "&parentid=" + _this.userinfo == false ? 0 : _this.userinfo.id
  185. }
  186. },
  187. onPullDownRefresh: function() {
  188. _this.pageRefresh();
  189. },
  190. onReachBottom: function() {
  191. if (_this.pstatus !== 'more') {
  192. return;
  193. }
  194. _this.getMore();
  195. },
  196. methods: {
  197. pageRefresh: function() {
  198. _this.pstatus = 'more';
  199. _this.ppage = 1;
  200. _this.plist = [];
  201. _this.getMore();
  202. },
  203. getMore: function() {
  204. var path = "worker/shopcomjobs";
  205. if (_this.tablename=="demand"){
  206. path = "worker/shopdemand";
  207. }else if(_this.tablename=="supply"){
  208. path = "worker/shopsupply";
  209. }
  210. _this.$req.ajax({
  211. path: path,
  212. data: {
  213. ppage: _this.ppage,
  214. psize: _this.psize,
  215. workerid: _this.shopworker.id
  216. }
  217. }).then((data) => {
  218. _this.pstatus = data.pstatus;
  219. _this.plist = _this.plist.concat(data.plist);
  220. _this.ppage += 1;
  221. uni.stopPullDownRefresh();
  222. }).catch((err) => {
  223. uni.showModal({
  224. title: '信息提示',
  225. content: err,
  226. showCancel: false
  227. });
  228. });
  229. },
  230. tabSelect: function(e) {
  231. _this.tablename = e.currentTarget.dataset.tablename;
  232. _this.pageRefresh();
  233. },
  234. goDetail: function(id) {
  235. if (_this.tablename=="demand"){
  236. uni.navigateTo({
  237. url: '/pages/demand/detail?demandid=' + id
  238. });
  239. }else if(_this.tablename=="supply"){
  240. uni.navigateTo({
  241. url: '/pages/supply/detail?supplyid=' + id
  242. });
  243. }else{
  244. uni.navigateTo({
  245. url: '/pages/comjobs/detail?comjobsid=' + id
  246. });
  247. }
  248. },
  249. goShop: function(workerid) {
  250. uni.navigateTo({
  251. url: '/pages/worker/shop?workerid=' + workerid
  252. });
  253. },
  254. setAddress: function() {
  255. uni.openLocation({
  256. latitude: parseFloat(_this.shopworker.latitude),
  257. longitude: parseFloat(_this.shopworker.longitude),
  258. name: _this.shopworker.title,
  259. address: _this.shopworker.city + " " + _this.shopworker.district + " " + _this.shopworker.address,
  260. success: function () {
  261. console.log('success');
  262. }
  263. });
  264. },
  265. makeTelephone: function(e) {
  266. var telephone = e.currentTarget.dataset.telephone;
  267. uni.makePhoneCall({
  268. phoneNumber: telephone
  269. });
  270. }
  271. }
  272. }
  273. </script>
  274. <style>
  275. .codebox {
  276. width: 690rpx;
  277. margin: 0rpx auto 0rpx auto;
  278. border-radius: 8rpx;
  279. overflow: hidden;
  280. }
  281. .codebox>view{
  282. margin-top: 20rpx;
  283. }
  284. .echo-grid-item{
  285. width: 220rpx;
  286. height: 140rpx;
  287. }
  288. </style>