comjobs.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <template>
  2. <view>
  3. <view class="cu-bar search bg-gray">
  4. <view class="search-form round text-center">
  5. <text class="cuIcon-search"></text>
  6. <input v-model="searchval" :adjust-position="false" type="text" placeholder="请输入关键字"
  7. confirm-type="search" @confirm="btnSearch()"></input>
  8. </view>
  9. <view class="action" v-if="searchval!==''">
  10. <button class="cu-btn bg-white shadow-blur round" @click="btnSearch()">搜索</button>
  11. </view>
  12. </view>
  13. <view class="filterbg">
  14. <view class="flex justify-between solids-bottom padding bg-white">
  15. <view class="text-bold">
  16. <view class="cu-tag radius bg-red" @tap="resetFilter">重置</view>
  17. </view>
  18. <view class="flex justify-end">
  19. <!-- <view class="cu-tag radius bg-green" data-filterbox="rectype" @tap="showFilter">
  20. {{rectypelist.title}}</view> -->
  21. <view class="cu-tag radius bg-green" data-filterbox="wtype" @tap="showFilter">{{wtypelist.title}}
  22. </view>
  23. <view class="cu-tag radius bg-green" data-filterbox="cate" @tap="showFilter">{{catelist.title}}
  24. </view>
  25. <view class="cu-tag radius bg-green" data-filterbox="area" @tap="showFilter">{{arealist.title}}
  26. </view>
  27. </view>
  28. </view>
  29. <view class="filtercon" v-if="filterbox!==null" @click="hideFilter()">
  30. <view class="padding bg-white" v-if="filterbox=='rectype'" @click.stop>
  31. <block v-for="(item,index) in rectypelist.data" :key="index">
  32. <button class="cu-btn margin-lr-xs margin-tb-xs"
  33. @click="checkRectype(item.title,item.value)">{{item.title}}</button>
  34. </block>
  35. </view>
  36. <view class="padding bg-white" v-if="filterbox=='wtype'" @click.stop>
  37. <block v-for="(item,index) in wtypelist.data" :key="index">
  38. <button class="cu-btn margin-lr-xs margin-tb-xs"
  39. @click="checkWtype(item.title,item.value)">{{item.title}}</button>
  40. </block>
  41. </view>
  42. <view class="padding bg-white" v-if="filterbox=='cate'" @click.stop>
  43. <block v-for="(item,index) in catelist.data" :key="index">
  44. <button class="cu-btn margin-lr-xs margin-tb-xs"
  45. @click="checkCate(item.title,item.value)">{{item.title}}</button>
  46. </block>
  47. </view>
  48. <view class="grid margin-bottom text-left col-3 bg-white" v-if="filterbox=='area'" @click.stop>
  49. <view class="solids-right padding-bottom">
  50. <scroll-view scroll-y="true" style="height: 600rpx;">
  51. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择市</view>
  52. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(4,0)">全部</view>
  53. <block v-for="(item,index) in arealist.data" :key="index">
  54. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(1,index)">
  55. {{item.title}}
  56. </view>
  57. </block>
  58. </scroll-view>
  59. </view>
  60. <view class="solids-right padding-bottom">
  61. <scroll-view scroll-y="true" style="height: 600rpx;">
  62. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择区县</view>
  63. <block v-for="(item,index) in arealist.cityarr" :key="index">
  64. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(2,index)">
  65. {{item.title}}
  66. </view>
  67. </block>
  68. </scroll-view>
  69. </view>
  70. <view class="padding-bottom">
  71. <scroll-view scroll-y="true" style="height: 600rpx;">
  72. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择镇街</view>
  73. <block v-for="(item,index) in arealist.districtarr" :key="index">
  74. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(3,index)">
  75. {{item.title}}
  76. </view>
  77. </block>
  78. </scroll-view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="comjobsList">
  84. <view class="listCard" v-for="(item,index) in plist" :key="index" @tap="goDetail(item.id)">
  85. <view class="listCard-item">
  86. <view class="item-left">
  87. <image class="item-left-icon" :src="$getImageUrl('static/images/applet/index/cardA.png')"
  88. mode="widthFix"></image>
  89. <view class="item-left-content bold">{{item.title}}</view>
  90. </view>
  91. <view class="item-right">
  92. <image class="item-right-icon" src="../../static/images/comJobs/icon-sum.png" mode="widthFix"></image>
  93. <view class="item-right-content red">{{item.zwagall}}</view>
  94. </view>
  95. </view>
  96. <view class="listCard-itemTag">
  97. <view v-for="(titem,tindex) in item.tags" :key="tindex" class="tag-item">{{titem}}</view>
  98. </view>
  99. <view class="listCard-item">
  100. <view class="item-left">
  101. <image class="item-left-icon" :src="$getImageUrl('static/images/applet/index/cardD.png')"
  102. mode="widthFix"></image>
  103. <view class="item-left-content">地点:{{item.address}}</view>
  104. </view>
  105. <view class="item-right">
  106. <image class="item-right-icon" src="../../static/images/comJobs/icon-pageView.png" mode="widthFix">
  107. </image>
  108. <view class="item-right-content">浏览量:{{item.volume}}</view>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. <block v-for="(item,index) in plist" :key="index" v-if="false">
  114. <view class="cu-card dynamic no-card solid-bottom echo-comjobs-item padding-top-sm padding-lr-sm radius">
  115. <view class="cu-item shadow padding-top-sm padding-bottom" @tap="goDetail(item.id)">
  116. <view class="padding-lr flex justify-between align-center">
  117. <view class="basis-lg text-bold text-df text-cut">
  118. {{item.title}}
  119. <text class="text-red text-sm" v-if="item.wtype==1">(按月)</text>
  120. <text class="text-red text-sm" v-if="item.wtype==2">(按时)</text>
  121. <text class="text-red text-sm" v-if="item.wtype==3">(按件)</text>
  122. <text class="text-red text-sm" v-if="item.wtype==4">(按项目)</text>
  123. <text class="text-sm">{{item.recruit_num}}名</text>
  124. </view>
  125. <view class="basis-sm text-cut text-right text-gray text-sm">
  126. <view><text class="text-red text-bold">{{item.zwagall}}</text></view>
  127. <view v-if="item.recruitment_cate == 2"><text
  128. class="text-red text-bold">悬赏{{item.retmoney}}{{item.is_pay == 1 ? '(已支付)' : ''}}</text>
  129. </view>
  130. </view>
  131. </view>
  132. <view class="padding-lr padding-tb-xs text-cut">
  133. <view v-for="(titem,tindex) in item.tags" :key="tindex"
  134. class="cu-tag light bg-blue lg echo-tags-item">{{titem}}</view>
  135. </view>
  136. <view class="padding-lr text-cut text-sm flex justify-between align-center">
  137. <view class="basis-lg text-df text-cut">{{item.worker.title}}</view>
  138. <view class="basis-sm text-cut text-right text-sm">
  139. 浏览量:{{item.volume}}
  140. </view>
  141. </view>
  142. <!-- <view class="text-gray padding-lr flex align-center justify-between" @tap="goShop(item.workerid)">
  143. <view class="flex align-center">
  144. <image class="iconyrz" :src="$getImageUrl('static/images/applet/iconyrz.png')" mode="scaleToFill"></image>
  145. <image class="iconwyp" :src="$getImageUrl('static/images/applet/iconwyp.png')" mode="scaleToFill" v-if="item.recruitment_cate==2"></image>
  146. </view>
  147. <view class="text-gray text-right basis-xs text-sm">
  148. <text class="cuIcon-shop margin-right-xs text-lg"></text>
  149. 进店
  150. </view>
  151. </view> -->
  152. </view>
  153. </view>
  154. </block>
  155. <uni-load-more :status="pstatus"></uni-load-more>
  156. <wxContact></wxContact>
  157. <view class="padding-sm"></view>
  158. <view class="padding-xl"></view>
  159. <view class="cu-bar tabbar bg-white foot">
  160. <view class="action text-gray" @tap="goNavPage('/pages/index/index')">
  161. <view class="cuIcon-cu-image">
  162. <image src="../../static/tabbar/index.png"></image>
  163. </view>
  164. 首页
  165. </view>
  166. <view class="action text-red" @tap="goNavPage('/pages/comjobs/comjobs')">
  167. <view class="cuIcon-cu-image">
  168. <image src="../../static/tabbar/jobsSelected.png"></image>
  169. </view>
  170. 招聘
  171. </view>
  172. <!-- #ifndef MP-WEIXIN -->
  173. <view class="action text-gray videoimg" @tap="goNavPage('/pages/video/videolist')">
  174. <view class="cuIcon-cu-image">
  175. <image src="../../static/tabbar/video.png"></image>
  176. </view>
  177. 微工作
  178. </view>
  179. <!-- #endif -->
  180. <view class="action text-gray" @tap="goNavPage('/pages/broker/brokerlist')">
  181. <view class="cuIcon-cu-image">
  182. <image src="../../static/tabbar/broker.png"></image>
  183. </view>
  184. 经纪人
  185. </view>
  186. <view class="action text-gray" @tap="goNavPage('/pages/my/my')">
  187. <view class="cuIcon-cu-image">
  188. <image src="../../static/tabbar/my.png"></image>
  189. </view>
  190. 我的
  191. </view>
  192. </view>
  193. </view>
  194. </template>
  195. <script>
  196. import slFilter from '@/components/sl-filter/sl-filter.vue';
  197. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  198. var _this;
  199. export default {
  200. components: {
  201. slFilter,
  202. uniLoadMore
  203. },
  204. data() {
  205. return {
  206. filterbox: null,
  207. rectypelist: {
  208. title: "悬赏/普通",
  209. value: 0
  210. },
  211. wtypelist: {
  212. title: "类型",
  213. value: 0,
  214. data: []
  215. },
  216. catelist: {
  217. title: "岗位",
  218. value: 0,
  219. data: []
  220. },
  221. arealist: {
  222. title: "区域",
  223. value: "",
  224. cityarr: [],
  225. districtarr: [],
  226. area_2: 0,
  227. data: [],
  228. community: "",
  229. },
  230. searchval: "",
  231. pstatus: 'more',
  232. ppage: 1,
  233. psize: 20,
  234. plist: []
  235. };
  236. },
  237. onLoad: function(option) {
  238. _this = this;
  239. _this.searchval = option.searchval || "";
  240. // _this.rectypelist.value = option.rectypelistID || 0;
  241. // if(_this.rectypelist.value != 0) {
  242. // _this.rectypelist.title = "悬赏聘";
  243. // } else {
  244. // _this.rectypelist.title = "悬赏/普通";
  245. // }
  246. // console.log("参数",_this.rectypelist.value)
  247. _this.$req.ajax({
  248. path: "comjobs/pagecomjobs",
  249. }).then((data) => {
  250. console.log("分类", data)
  251. _this.catelist.data = data.catelist;
  252. _this.wtypelist.data = data.wtypelist;
  253. _this.rectypelist.data = data.rectypelist;
  254. _this.arealist.data = require('@/common/area.json');
  255. _this.getMore();
  256. }).catch((err) => {
  257. uni.showModal({
  258. title: '信息提示',
  259. content: err,
  260. showCancel: false
  261. });
  262. });
  263. },
  264. onPullDownRefresh: function() {
  265. _this.pageRefresh();
  266. },
  267. onReachBottom: function() {
  268. if (_this.pstatus !== 'more') {
  269. return;
  270. }
  271. _this.getMore();
  272. },
  273. onShareAppMessage: function(res) {
  274. return {
  275. title: "企业招聘",
  276. path: "/pages/comjobs/comjobs"
  277. }
  278. },
  279. methods: {
  280. showFilter: function(e) {
  281. var nowfilterbox = e.currentTarget.dataset.filterbox;
  282. if (_this.filterbox == nowfilterbox) {
  283. _this.filterbox = null;
  284. } else {
  285. _this.filterbox = nowfilterbox;
  286. }
  287. uni.pageScrollTo({
  288. scrollTop: 0,
  289. duration: 300
  290. });
  291. },
  292. hideFilter: function(e) {
  293. _this.filterbox = null;
  294. },
  295. checkRectype: function(title, value) {
  296. _this.rectypelist.title = title;
  297. _this.rectypelist.value = value;
  298. console.log("悬赏聘", _this.rectypelist.title, _this.rectypelist.value)
  299. _this.filterbox = null;
  300. _this.pageRefresh();
  301. },
  302. checkWtype: function(title, value) {
  303. _this.wtypelist.title = title;
  304. _this.wtypelist.value = value;
  305. _this.filterbox = null;
  306. _this.pageRefresh();
  307. },
  308. checkCate: function(title, value) {
  309. _this.catelist.title = title;
  310. _this.catelist.value = value;
  311. _this.filterbox = null;
  312. _this.pageRefresh();
  313. },
  314. checkArea: function(level, index) {
  315. if (level == 1) {
  316. _this.arealist.cityarr = _this.arealist.data[index].children;
  317. _this.arealist.districtarr = [];
  318. } else if (level == 2) {
  319. _this.arealist.districtarr = _this.arealist.cityarr[index].children;
  320. _this.arealist.area_2 = _this.arealist.cityarr[index].value;
  321. } else if (level == 3) {
  322. _this.arealist.value = _this.arealist.community = "";
  323. _this.arealist.title = _this.arealist.districtarr[index].title;
  324. if (_this.arealist.area_2 == "350582") {
  325. //晋江
  326. if (_this.arealist.cityarr[index].value == "350582") {
  327. _this.arealist.value = _this.arealist.districtarr[index].title;
  328. } else {
  329. _this.arealist.community = _this.arealist.districtarr[index].value;
  330. }
  331. } else {
  332. //其他区域
  333. _this.arealist.value = _this.arealist.districtarr[index].title;
  334. }
  335. _this.filterbox = null;
  336. _this.pageRefresh();
  337. } else if (level == 4) {
  338. _this.arealist.cityarr = [];
  339. _this.arealist.districtarr = [];
  340. _this.arealist.title = "全部";
  341. _this.arealist.value = "";
  342. _this.filterbox = null;
  343. _this.pageRefresh();
  344. }
  345. },
  346. // 搜索
  347. bindInput: function(e) {
  348. _this.searchval = e.detail.value;
  349. },
  350. btnSearch: function() {
  351. if (_this.searchval == "") {
  352. uni.showModal({
  353. title: '信息提示',
  354. content: "请输入要搜索的关键字...",
  355. showCancel: false
  356. });
  357. return false;
  358. }
  359. _this.pageRefresh();
  360. },
  361. resetFilter: function() {
  362. _this.searchval = "";
  363. _this.rectypelist.title = '悬赏/普通';
  364. _this.rectypelist.value = 1;
  365. _this.wtypelist.title = '类型';
  366. _this.wtypelist.value = 0;
  367. _this.catelist.title = '岗位';
  368. _this.catelist.value = 0;
  369. _this.arealist.title = '区域';
  370. _this.arealist.value = '';
  371. _this.arealist.cityarr = [];
  372. _this.arealist.districtarr = [];
  373. _this.pageRefresh();
  374. },
  375. pageRefresh: function() {
  376. _this.pstatus = 'more';
  377. _this.ppage = 1;
  378. _this.plist = [];
  379. _this.getMore();
  380. },
  381. getMore: function() {
  382. _this.$req.ajax({
  383. path: "comjobs/listcomjobs",
  384. data: {
  385. ppage: _this.ppage,
  386. psize: _this.psize,
  387. searchval: _this.searchval,
  388. cateid: _this.catelist.value,
  389. wtype: _this.wtypelist.value,
  390. rectype: _this.rectypelist.value,
  391. district: _this.arealist.value,
  392. community: _this.arealist.community
  393. }
  394. }).then((data) => {
  395. console.log("查看数据", data)
  396. _this.pstatus = data.pstatus;
  397. _this.plist = _this.plist.concat(data.plist);
  398. _this.ppage += 1;
  399. uni.stopPullDownRefresh();
  400. }).catch((err) => {
  401. uni.showModal({
  402. title: '信息提示',
  403. content: err,
  404. showCancel: false
  405. });
  406. });
  407. },
  408. goDetail: function(comjobsid) {
  409. uni.navigateTo({
  410. url: '/pages/comjobs/detail?comjobsid=' + comjobsid
  411. });
  412. },
  413. goShop: function(workerid) {
  414. uni.navigateTo({
  415. url: '/pages/worker/shop?workerid=' + workerid
  416. });
  417. },
  418. result: function(e) {
  419. _this.cateid = e.cateid;
  420. _this.wtype = e.wtype;
  421. _this.province = e.province;
  422. _this.pageRefresh();
  423. },
  424. goNavPage: function(pageurl) {
  425. uni.redirectTo({
  426. url: pageurl
  427. });
  428. }
  429. }
  430. }
  431. </script>
  432. <style lang="scss">
  433. .comjobsList {
  434. padding: 28rpx 26rpx 0;
  435. .listCard {
  436. margin-bottom: 40rpx;
  437. padding: 28rpx 24rpx;
  438. background: #FFFFFF;
  439. border-radius: 12rpx;
  440. .listCard-itemTag {
  441. display: flex;
  442. flex-wrap: wrap;
  443. margin: 28rpx 0 8rpx;
  444. .tag-item {
  445. margin-right: 15rpx;
  446. background: #E6F2FF;
  447. font-size: 20rpx;
  448. color: #CA151C;
  449. padding: 5rpx 12rpx;
  450. margin-bottom: 20rpx;
  451. white-space: nowrap;
  452. text-overflow: ellipsis;
  453. white-space: nowrap;
  454. overflow: hidden;
  455. }
  456. }
  457. .listCard-item {
  458. display: flex;
  459. align-items: center;
  460. .item-left {
  461. width: 60%;
  462. display: flex;
  463. .item-left-icon {
  464. width: 35rpx;
  465. height: 35rpx;
  466. }
  467. .item-left-content {
  468. flex: 1;
  469. margin-left: 15rpx;
  470. font-size: 28rpx;
  471. font-weight: 400;
  472. color: #747474;
  473. overflow: hidden;
  474. text-overflow: ellipsis;
  475. -webkit-line-clamp: 1;
  476. display: -webkit-box;
  477. -webkit-box-orient: vertical;
  478. }
  479. .bold {
  480. font-size: 28rpx;
  481. font-weight: 600;
  482. color: #383838;
  483. }
  484. .red {
  485. font-size: 28rpx;
  486. font-weight: 500;
  487. color: #CA151C;
  488. }
  489. }
  490. .item-right {
  491. width: 35%;
  492. margin-left: 15rpx;
  493. display: flex;
  494. .item-right-icon {
  495. width: 35rpx;
  496. height: 35rpx;
  497. }
  498. .item-right-content {
  499. flex: 1;
  500. margin-left: 15rpx;
  501. font-size: 28rpx;
  502. font-weight: 400;
  503. color: #747474;
  504. overflow: hidden;
  505. text-overflow: ellipsis;
  506. -webkit-line-clamp: 1;
  507. display: -webkit-box;
  508. -webkit-box-orient: vertical;
  509. }
  510. .bold {
  511. font-size: 28rpx;
  512. font-weight: 600;
  513. color: #383838;
  514. }
  515. .red {
  516. font-size: 28rpx;
  517. font-weight: 500;
  518. color: #CA151C;
  519. }
  520. }
  521. }
  522. }
  523. }
  524. </style>