comjobs.vue 13 KB

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