comjobs.vue 15 KB

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