index.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <template>
  2. <view>
  3. <view class="headTop">
  4. <u-dropdown ref="uDropdown" @open="open" z-index="9999">
  5. <u-dropdown-item :title="titlex1" @click.native="cityShow = true">
  6. </u-dropdown-item>
  7. <u-dropdown-item @change="changex2" v-model="titlesx2" :title="titlex2" :options="filterDatas2">
  8. </u-dropdown-item>
  9. <u-dropdown-item @change="change1" v-model="titles1" :title="title1" :options="filterData1">
  10. </u-dropdown-item>
  11. <u-dropdown-item @change="change2" v-model="titles2" :title="title2" :options="filterData2">
  12. </u-dropdown-item>
  13. <!-- <u-dropdown-item @change="changex1" v-model="titlesx1" :title="titlex1" :options="filterDatas1">
  14. </u-dropdown-item> -->
  15. </u-dropdown>
  16. </view>
  17. <!-- #ifdef H5 -->
  18. <view style="margin-top: 100upx;">
  19. <!-- #endif -->
  20. <!-- #ifndef H5 -->
  21. <view style="margin-top: 100upx;">
  22. <!-- #endif -->
  23. <homeuserList @click="clickItems" :list="lists"></homeuserList>
  24. <!-- <view class="listbox" v-for="(item,index) in list" :key="index">
  25. <view class="flex align-center justify-between">
  26. <view class="text-xl text-bold" style="color: #6696FF;">UI设计师</view>
  27. <view class="text-lg text-bold" style="color: #FF4A28;">5-7K</view>
  28. </view>
  29. <view class="flex align-center margin-top-sm">
  30. <view class="argrtn" v-for="(ite,index) in item.lable" :key="index">{{ite.name}}</view>
  31. </view>
  32. <view class="flex align-center justify-between margin-top">
  33. <view class="" style="color: #666666;">UI界面交互设计</view>
  34. <view>西安 莲湖区</view>
  35. </view>
  36. </view> -->
  37. </view>
  38. <empty v-if="lists.length==0" content="暂无数据"></empty>
  39. <!-- 省市区选择 -->
  40. <u-picker cancel-text="重置" :mask-close-able="false" v-model="cityShow" mode="region" :params="params" @cancel="cancel" @confirm="cityConfirm"></u-picker>
  41. </view>
  42. </template>
  43. <script>
  44. import homeuserList from '../../components/home-list/homeuserList.vue'
  45. import empty from '@/components/empty.vue'
  46. export default {
  47. components: {
  48. homeuserList,
  49. empty
  50. },
  51. data() {
  52. return {
  53. params:{
  54. province: true,
  55. city: true,
  56. area: true
  57. },
  58. cityShow:false,
  59. lists: [],
  60. defaultIndex: [0, 0],
  61. titlesx1: '',
  62. titlex1: '项目位置',
  63. titlesx2: '',
  64. titlex2: '项目类型',
  65. filterDatas1: [],
  66. filterDatas2: [],
  67. page: 1,
  68. limit: 10,
  69. projectType: '',
  70. count: '',
  71. postPrice: '',
  72. titles1: '',
  73. title1: '岗位',
  74. titles2: '',
  75. title2: '专业',
  76. filterData1: [{
  77. label: '全部',
  78. value: '',
  79. }, ],
  80. filterData2: [],
  81. resumesPost: '', //岗位id
  82. resumesMajor: '', //专业
  83. }
  84. },
  85. onLoad() {
  86. this.getuserList(2)
  87. //项目类型
  88. this.getObjectType();
  89. //薪资列表
  90. this.getMonyList();
  91. //岗位
  92. this.getruleList();
  93. },
  94. onReachBottom() {
  95. if (this.lists.length == this.count) {
  96. uni.showToast({
  97. title: '已经到底了',
  98. icon: 'none'
  99. })
  100. } else {
  101. this.page = this.page + 1;
  102. this.getuserList(2)
  103. }
  104. },
  105. onPullDownRefresh: function() {
  106. this.page = 1;
  107. this.getuserList(2)
  108. },
  109. methods: {
  110. cancel(){
  111. this.titlex1 = '项目位置'
  112. this.getuserList(2)
  113. this.$refs.uDropdown.close();
  114. },
  115. open(e){
  116. console.log(e)
  117. if(e==0){
  118. this.cityShow = true
  119. }else if(e==2){
  120. this.title2 = '专业'
  121. this.resumesMajor = ''
  122. }else if(e==3){
  123. if(this.resumesPost==''){
  124. this.$refs.uDropdown.close();
  125. uni.showToast({
  126. title:'请先选择岗位',
  127. icon:'none'
  128. })
  129. }
  130. }
  131. },
  132. cityConfirm(e){
  133. console.log(e)
  134. this.titlex1 = e.area.label
  135. this.getuserList(2)
  136. this.$refs.uDropdown.close();
  137. },
  138. //查询岗位
  139. getruleList() {
  140. this.$Request.get("/app/rule/selectRuleClassifyList", {
  141. status: 1
  142. }).then(res => {
  143. if (res.code == 0) {
  144. let arr = res.data
  145. arr = JSON.parse(JSON.stringify(arr).replace(/ruleClassifyName/g, 'label'))
  146. arr = JSON.parse(JSON.stringify(arr).replace(/ruleClassifyId/g, 'value'))
  147. this.filterData1 = [{
  148. label: '全部',
  149. value: ''
  150. }]
  151. this.filterData1 = [...this.filterData1, ...arr]
  152. }
  153. })
  154. },
  155. //岗位
  156. change1(e) {
  157. this.filterData1.map(res => {
  158. if (res.value == this.titles1) {
  159. if (res.label == '全部') {
  160. this.title1 = '岗位'
  161. this.page = 1
  162. this.resumesPost = res.value
  163. this.getuserList(2)
  164. } else {
  165. this.title1 = res.label
  166. this.page = 1
  167. // this.resumesPost = res.label
  168. this.resumesPost = res.value
  169. this.getuserList(2)
  170. this.getPostList();
  171. }
  172. }
  173. })
  174. },
  175. //获取专业
  176. getPostList() {
  177. let data = {
  178. ruleClassifyId: this.resumesPost
  179. }
  180. this.$Request.post('/app/rule/selectRulePostList', data).then(res => {
  181. if (res.code == 0) {
  182. let arr = res.data
  183. arr = JSON.parse(JSON.stringify(arr).replace(/rulePostName/g, 'label'))
  184. arr = JSON.parse(JSON.stringify(arr).replace(/rulePostId/g, 'value'))
  185. this.filterData2 = arr
  186. }
  187. })
  188. },
  189. //专业
  190. change2(e) {
  191. this.filterData2.map(res => {
  192. if (res.value == this.titles2) {
  193. if (res.label == '全部') {
  194. this.title2 = '专业'
  195. this.page = 1
  196. this.resumesMajor = res.label
  197. this.getuserList(2)
  198. } else {
  199. this.title2 = res.label
  200. this.page = 1
  201. this.resumesMajor = res.label
  202. this.getuserList(2)
  203. }
  204. }
  205. })
  206. },
  207. //薪资
  208. changex1(e) {
  209. this.filterDatas1.map(res => {
  210. if (res.value == this.titlesx1) {
  211. if (res.label == '全部') {
  212. this.titlex1 = '薪资'
  213. this.postPrice = res.value //薪资
  214. this.page = 1
  215. this.getuserList(2)
  216. } else {
  217. this.titlex1 = res.label
  218. this.page = 1
  219. this.postPrice = res.value //薪资
  220. this.getuserList(2)
  221. }
  222. }
  223. })
  224. },
  225. //项目类型
  226. changex2(e) {
  227. this.filterDatas2.map(res => {
  228. if (res.value == this.titlesx2) {
  229. if (res.label == '全部') {
  230. this.titlex2 = '项目类型'
  231. this.page = 1
  232. this.projectType = res.value //项目类型
  233. this.getuserList(2)
  234. } else {
  235. this.titlex2 = res.label
  236. this.page = 1
  237. this.projectType = res.value //项目类型
  238. this.getuserList(2)
  239. }
  240. }
  241. })
  242. },
  243. //薪资列表
  244. getMonyList() {
  245. this.$Request.get('/app/dict/list', {
  246. type: '薪资'
  247. }).then(res => {
  248. if (res.code == 0) {
  249. let arr = res.data
  250. arr = JSON.parse(JSON.stringify(arr).replace(/code/g, 'label'))
  251. this.filterDatas1 = [{
  252. label: '全部',
  253. value: ''
  254. }]
  255. this.filterDatas1 = [...this.filterDatas1, ...arr]
  256. }
  257. })
  258. },
  259. //获取项目类型
  260. getObjectType() {
  261. this.$Request.get("/app/dict/list", {
  262. type: '项目类型'
  263. }).then(res => {
  264. if (res.code == 0) {
  265. let arr = res.data
  266. arr = JSON.parse(JSON.stringify(arr).replace(/code/g, 'label'))
  267. this.filterDatas2 = [{
  268. label: '全部',
  269. value: ''
  270. }]
  271. this.filterDatas2 = [...this.filterDatas2, ...arr]
  272. }
  273. })
  274. },
  275. //详情
  276. clickItems(item, index) {
  277. uni.navigateTo({
  278. url: '/pages/index/game/order?postPushId=' + item.item.postPushId
  279. })
  280. },
  281. //获取数据
  282. getuserList(stauts) {
  283. let userId = uni.getStorageSync('userId')
  284. let data = {
  285. page: this.page,
  286. limit: this.limit,
  287. status: stauts,
  288. classify: 2,
  289. projectType: this.projectType, //项目类型
  290. postPrice: this.postPrice, //薪资
  291. ruleClassifyId: this.resumesPost, //岗位
  292. rulePostName: this.resumesMajor, //专业
  293. address:this.titlex1=='项目位置'?'':this.titlex1,//项目位置
  294. }
  295. this.$Request.get("/app/postPush/selectPostPushList", data).then(res => {
  296. uni.hideLoading();
  297. if (res.code == 0) {
  298. res.data.records.map(item => {
  299. switch (item.address) {
  300. case '北京市北京市':
  301. item.address = '北京市'
  302. break;
  303. case '北京市市辖区':
  304. item.address = '北京市'
  305. break;
  306. case '天津市天津市':
  307. item.address = '天津市'
  308. break;
  309. case '上海市上海市':
  310. item.address = '上海市'
  311. break;
  312. case '重庆市重庆市':
  313. item.address = '重庆市'
  314. break;
  315. default:
  316. break;
  317. }
  318. })
  319. this.count = res.data.total
  320. if (this.page == 1) {
  321. this.lists = res.data.records
  322. for (var i = 0; i < this.lists.length; i++) {
  323. this.lists[i].projectType = this.lists[i].projectType.split(',')
  324. }
  325. } else {
  326. this.lists = [...this.lists, ...res.data.records]
  327. for (var i = 0; i < this.lists.length; i++) {
  328. this.lists[i].projectType = this.lists[i].projectType.split(',')
  329. }
  330. }
  331. }
  332. uni.stopPullDownRefresh();
  333. })
  334. },
  335. },
  336. }
  337. </script>
  338. <style lang="less">
  339. page {
  340. background: #F2F2F7;
  341. }
  342. .headTop {
  343. background: #ffffff;
  344. position: fixed;
  345. /* #ifndef H5 */
  346. top: 0upx;
  347. /* #endif */
  348. /* #ifdef H5 */
  349. top: 80upx;
  350. /* #endif */
  351. left: 0;
  352. right: 0;
  353. z-index: 999;
  354. }
  355. .navs {
  356. background: #ffffff !important;
  357. }
  358. .listbox {
  359. background: #FFFFFF;
  360. border-radius: 24upx;
  361. margin: 20upx 30upx;
  362. padding: 30upx;
  363. }
  364. .argrtn {
  365. background: #F6F6F6;
  366. color: #666666;
  367. font-size: 24upx;
  368. border-radius: 8upx;
  369. padding: 5upx 20upx;
  370. margin-right: 20upx;
  371. }
  372. </style>