demand.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <view>
  3. <view class="cu-bar search">
  4. <view class="search-form round text-center">
  5. <text class="cuIcon-search"></text>
  6. <input @input="bindInput" :adjust-position="false" type="text" placeholder="搜索岗位或公司" confirm-type="search"></input>
  7. </view>
  8. <view class="action" v-if="searchval!==''">
  9. <button class="cu-btn bg-white shadow-blur round" @click="btnSearch()">搜索</button>
  10. </view>
  11. </view>
  12. <view class="filterbg">
  13. <view class="flex justify-between solids-bottom padding bg-white">
  14. <view class="text-bold">推荐</view>
  15. <view class="flex justify-end">
  16. <view class="cu-tag radius" data-filterbox="rectype" @tap="showFilter">{{rectypelist.title}}</view>
  17. <view class="cu-tag radius" data-filterbox="wtype" @tap="showFilter">{{wtypelist.title}}</view>
  18. <view class="cu-tag radius" data-filterbox="ftype" @tap="showFilter">{{ftypelist.title}}</view>
  19. <view class="cu-tag radius" data-filterbox="cate" @tap="showFilter">{{catelist.title}}</view>
  20. <view class="cu-tag radius" data-filterbox="area" @tap="showFilter">{{arealist.title}}</view>
  21. </view>
  22. </view>
  23. <view class="filtercon" v-if="filterbox!==null">
  24. <view class="padding bg-white" v-if="filterbox=='rectype'">
  25. <block v-for="(item,index) in rectypelist.data" :key="index">
  26. <button class="cu-btn margin-lr-xs margin-tb-xs" @click="checkRectype(item.title,item.value)">{{item.title}}</button>
  27. </block>
  28. </view>
  29. <view class="padding bg-white" v-if="filterbox=='wtype'">
  30. <block v-for="(item,index) in wtypelist.data" :key="index">
  31. <button class="cu-btn margin-lr-xs margin-tb-xs" @click="checkWtype(item.title,item.value)">{{item.title}}</button>
  32. </block>
  33. </view>
  34. <view class="padding bg-white" v-if="filterbox=='ftype'">
  35. <block v-for="(item,index) in ftypelist.data" :key="index">
  36. <button class="cu-btn margin-lr-xs margin-tb-xs" @click="checkFtype(item.title,item.value)">{{item.title}}</button>
  37. </block>
  38. </view>
  39. <view class="padding bg-white" v-if="filterbox=='cate'">
  40. <block v-for="(item,index) in catelist.data" :key="index">
  41. <button class="cu-btn margin-lr-xs margin-tb-xs" @click="checkCate(item.title,item.value)">{{item.title}}</button>
  42. </block>
  43. </view>
  44. <view class="grid margin-bottom text-left col-3 bg-white" v-if="filterbox=='area'">
  45. <view class="solids-right padding-bottom">
  46. <scroll-view scroll-y="true" style="height: 600rpx;">
  47. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择省</view>
  48. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(4,0)">全部</view>
  49. <block v-for="(item,index) in arealist.data" :key="index">
  50. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(1,index)">{{item.title}}</view>
  51. </block>
  52. </scroll-view>
  53. </view>
  54. <view class="solids-right padding-bottom">
  55. <scroll-view scroll-y="true" style="height: 600rpx;">
  56. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择市</view>
  57. <block v-for="(item,index) in arealist.cityarr" :key="index">
  58. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(2,index)">{{item.title}}</view>
  59. </block>
  60. </scroll-view>
  61. </view>
  62. <view class="padding-bottom">
  63. <scroll-view scroll-y="true" style="height: 600rpx;">
  64. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择区县</view>
  65. <block v-for="(item,index) in arealist.districtarr" :key="index">
  66. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(3,index)">{{item.title}}</view>
  67. </block>
  68. </scroll-view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <block v-for="(item,index) in plist" :key="index">
  74. <view class="cu-card dynamic no-card solid-bottom echo-demand-item">
  75. <view class="cu-item shadow padding-top-sm padding-bottom">
  76. <view class="padding-lr padding-bottom-xs flex justify-between align-center" @tap="goDetail(item.id)">
  77. <view class="basis-lg text-bold text-lg text-cut">{{item.title}}
  78. <text class="text-sm text-red">({{item.type_text}})</text>
  79. {{item.num}}人
  80. </view>
  81. <view class="basis-sm text-cut text-right text-gray text-sm">{{item.city}}</view>
  82. </view>
  83. <view class="padding-lr text-lg" @tap="goDetail(item.id)">
  84. <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>
  85. <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>
  86. <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>
  87. <view v-if="item.wtype==4"><text class="text-red text-bold">面议</text></view>
  88. </view>
  89. <view class="padding-lr text-cut" @tap="goDetail(item.id)">
  90. <view v-for="(titem,tindex) in item.tags" :key="tindex" class="cu-tag light bg-gray text-grey sm">{{titem}}</view>
  91. </view>
  92. <view class="padding-lr text-sm text-cut" @tap="goShop(item.workerid)">
  93. <view class="text-gray">{{item.worker.title}}</view>
  94. </view>
  95. <view class="text-gray text-sm padding-lr flex align-center justify-between" @tap="goShop(item.workerid)">
  96. <view class="flex align-center">
  97. <image class="iconwyd" style="margin: 0rpx !important;" :src="$getImageUrl('static/images/applet/iconwyd.png')" mode="scaleToFill" v-if="item.isfree==2"></image>
  98. </view>
  99. <view class="text-gray text-right basis-xs">
  100. <text class="cuIcon-shop margin-right-xs text-lg"></text>
  101. 进店
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </block>
  107. <uni-load-more :status="pstatus"></uni-load-more>
  108. <view class="padding-sm"></view>
  109. <view class="padding-xl"></view>
  110. <view class="cu-bar tabbar bg-white foot">
  111. <view class="action text-gray" @tap="goNavPage('/pages/worker/worker')">
  112. <view class="cuIcon-cu-image">
  113. <image src="../../static/tabbar/windex.png"></image>
  114. </view>
  115. 首页
  116. </view>
  117. <view class="action text-blue" @tap="goNavPage('/pages/demand/demand')">
  118. <view class="cuIcon-cu-image">
  119. <image src="../../static/tabbar/wdemandSelected.png"></image>
  120. </view>
  121. 抢单大厅
  122. </view>
  123. <!-- #ifndef MP-WEIXIN -->
  124. <view class="action text-gray videoimg" @tap="goNavPage('/pages/video/video')">
  125. <view class="cuIcon-cu-image">
  126. <image src="../../static/tabbar/video.png"></image>
  127. </view>
  128. 录视频
  129. </view>
  130. <!-- #endif -->
  131. <view class="action text-gray" @tap="goNavPage('/pages/resume/resume')">
  132. <view class="cuIcon-cu-image">
  133. <image src="../../static/tabbar/resume.png"></image>
  134. </view>
  135. 简历
  136. </view>
  137. <view class="action text-gray" @tap="goNavPage('/pages/supply/supply')">
  138. <view class="cuIcon-cu-image">
  139. <image src="../../static/tabbar/wsupply.png"></image>
  140. </view>
  141. 共享用工
  142. </view>
  143. <!--
  144. <view class="action text-gray" @tap="goNavPage('/pages/worker/workerlist')">
  145. <view class="cuIcon-cu-image">
  146. <image src="../../static/tabbar/wworker.png"></image>
  147. </view>
  148. 企业1
  149. </view>
  150. -->
  151. </view>
  152. <wxContact></wxContact>
  153. </view>
  154. </template>
  155. <script>
  156. import slFilter from '@/components/sl-filter/sl-filter.vue';
  157. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  158. var _this;
  159. export default {
  160. components: {
  161. slFilter,
  162. uniLoadMore
  163. },
  164. data() {
  165. return {
  166. filterbox: null,
  167. rectypelist: {
  168. title: "悬赏/普通",
  169. value: 0
  170. },
  171. wtypelist: {
  172. title: "薪资",
  173. value: 0,
  174. data: []
  175. },
  176. ftypelist: {
  177. title: "返费",
  178. value: 0,
  179. data: []
  180. },
  181. catelist: {
  182. title: "岗位",
  183. value: 0,
  184. data: []
  185. },
  186. arealist: {
  187. title: "区域",
  188. value: "",
  189. cityarr: [],
  190. districtarr: [],
  191. data: []
  192. },
  193. searchval: "",
  194. pstatus: 'more',
  195. ppage: 1,
  196. psize: 20,
  197. plist: []
  198. };
  199. },
  200. onLoad: function(option){
  201. _this = this;
  202. _this.$req.ajax({
  203. path: "demand/pagedemand",
  204. }).then((data) => {
  205. _this.catelist.data = data.catelist;
  206. _this.wtypelist.data = data.wtypelist;
  207. _this.rectypelist.data = data.rectypelist;
  208. _this.ftypelist.data = data.ftypelist;
  209. _this.arealist.data = require('@/common/area.json');
  210. // _this.menuList[2].detailList = data.ftypelist;
  211. // _this.menuList[3].detailList = data.provincelist;
  212. // _this.$refs.slFilter.resetMenuList(_this.menuList);
  213. _this.getMore();
  214. }).catch((err) => {
  215. uni.showModal({
  216. title: '信息提示',
  217. content: err,
  218. showCancel: false
  219. });
  220. });
  221. },
  222. onPullDownRefresh: function() {
  223. _this.pageRefresh();
  224. },
  225. onReachBottom: function() {
  226. if (_this.pstatus !== 'more') {
  227. return;
  228. }
  229. _this.getMore();
  230. },
  231. onShareAppMessage: function(res) {
  232. return {
  233. title: "企业招聘",
  234. path: "/pages/demand/demand"
  235. }
  236. },
  237. methods: {
  238. showFilter: function(e) {
  239. var nowfilterbox = e.currentTarget.dataset.filterbox;
  240. if (_this.filterbox == nowfilterbox){
  241. _this.filterbox = null;
  242. }else{
  243. _this.filterbox = nowfilterbox;
  244. }
  245. uni.pageScrollTo({
  246. scrollTop: 0,
  247. duration: 300
  248. });
  249. },
  250. checkRectype: function(title,value) {
  251. _this.rectypelist.title = title;
  252. _this.rectypelist.value = value;
  253. _this.filterbox = null;
  254. _this.pageRefresh();
  255. },
  256. checkWtype: function(title,value) {
  257. _this.wtypelist.title = title;
  258. _this.wtypelist.value = value;
  259. _this.filterbox = null;
  260. _this.pageRefresh();
  261. },
  262. checkFtype: function(title,value) {
  263. _this.ftypelist.title = title;
  264. _this.ftypelist.value = value;
  265. _this.filterbox = null;
  266. _this.pageRefresh();
  267. },
  268. checkCate: function(title,value) {
  269. _this.catelist.title = title;
  270. _this.catelist.value = value;
  271. _this.filterbox = null;
  272. _this.pageRefresh();
  273. },
  274. checkArea: function(level, index) {
  275. if (level==1){
  276. _this.arealist.cityarr = _this.arealist.data[index].children;
  277. _this.arealist.districtarr = [];
  278. }else if (level==2){
  279. _this.arealist.districtarr = _this.arealist.cityarr[index].children;
  280. }else if (level==3){
  281. _this.arealist.title = _this.arealist.districtarr[index].title;
  282. _this.arealist.value = _this.arealist.districtarr[index].title;
  283. _this.filterbox = null;
  284. _this.pageRefresh();
  285. }else if (level==4){
  286. _this.arealist.cityarr = [];
  287. _this.arealist.districtarr = [];
  288. _this.arealist.title = "全部";
  289. _this.arealist.value = "";
  290. _this.filterbox = null;
  291. _this.pageRefresh();
  292. }
  293. },
  294. // 搜索
  295. bindInput: function(e) {
  296. _this.searchval = e.detail.value;
  297. },
  298. btnSearch: function() {
  299. if (_this.searchval == "") {
  300. uni.showModal({
  301. title: '信息提示',
  302. content: "请输入要搜索的关键字...",
  303. showCancel: false
  304. });
  305. return false;
  306. }
  307. _this.pageRefresh();
  308. },
  309. pageRefresh: function() {
  310. _this.pstatus = 'more';
  311. _this.ppage = 1;
  312. _this.plist = [];
  313. _this.getMore();
  314. },
  315. getMore: function() {
  316. _this.$req.ajax({
  317. path: "demand/listdemand",
  318. data: {
  319. ppage: _this.ppage,
  320. psize: _this.psize,
  321. searchval: _this.searchval,
  322. cateid: _this.catelist.value,
  323. wtype: _this.wtypelist.value,
  324. rectype: _this.rectypelist.value,
  325. ftype: _this.ftypelist.value,
  326. district: _this.arealist.value
  327. }
  328. }).then((data) => {
  329. _this.pstatus = data.pstatus;
  330. _this.plist = _this.plist.concat(data.plist);
  331. _this.ppage += 1;
  332. uni.stopPullDownRefresh();
  333. }).catch((err) => {
  334. uni.showModal({
  335. title: '信息提示',
  336. content: err,
  337. showCancel: false
  338. });
  339. });
  340. },
  341. goDetail: function(demandid) {
  342. uni.navigateTo({
  343. url: '/pages/demand/detail?demandid=' + demandid
  344. });
  345. },
  346. goShop: function(workerid) {
  347. uni.navigateTo({
  348. url: '/pages/worker/shop?workerid=' + workerid
  349. });
  350. },
  351. result: function(e) {
  352. _this.cateid = e.cateid;
  353. _this.wtype = e.wtype;
  354. _this.ftype = e.ftype;
  355. _this.province = e.province;
  356. _this.pageRefresh();
  357. },
  358. goNavPage: function(pageurl) {
  359. _this.userinfo = _this.checkLogin("/pages/my/my");
  360. if (_this.userinfo === false) {
  361. return false;
  362. }
  363. uni.redirectTo({
  364. url: pageurl
  365. });
  366. },
  367. }
  368. }
  369. </script>
  370. <style>
  371. </style>