comjobs.vue 18 KB

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