comjobs.vue 15 KB

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