demand.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. <template>
  2. <view class="content">
  3. <view class="search">
  4. <u-input v-model="serach_value" type="text" :border="true" placeholder="热搜榜单" shape="circle"
  5. prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" @change="change">
  6. <template slot="suffix">
  7. <view @click="search">搜索</view>
  8. </template>
  9. </u-input>
  10. </view>
  11. <view class="box hflex acenter jbetween">
  12. <block v-for="(item,index) in tabs" :key="index">
  13. <view class="tab_item hflex acenter jcenter" @click="toTab(item.url)">
  14. <image :src="item.src" mode="aspectFill" class="tab_img"></image>
  15. <view class="tab_text">{{item.text}}</view>
  16. </view>
  17. </block>
  18. </view>
  19. <view class="box1">
  20. <view class="hflex acenter jbetween box1_top">
  21. <view class="hflex acenter">
  22. <block v-for="(item,index) in tabs2" :key="index">
  23. <view class="tabs_item" :class="tab_active == index? 'tabs_active' : ''" @click="changeTab(index)">{{item.text}}</view>
  24. </block>
  25. </view>
  26. <view class="screen hflex acenter jcenter" @click="open" v-show="tab_active == 0">
  27. <view class="screen_text">筛选</view>
  28. <u-icon name="arrow-down-fill" color="#666666" size="6"></u-icon>
  29. </view>
  30. </view>
  31. <view class="list" v-if="tab_active == 0">
  32. <block v-for="(item,index) in pageList" :key="index">
  33. <view class="list_item" @click="toDetail(item.id)">
  34. <view class="hflex acenter jbetween">
  35. <view class="item_title">{{item.title}}</view>
  36. <view class="item_blue">{{item.salary_start}}-{{item.salary_end}}薪</view>
  37. </view>
  38. <view class="hflex acenter" style="padding: 20rpx 0 24rpx;">
  39. <view class="item_box">{{item.city}}</view>
  40. <view class="item_box">{{item.schooling}}</view>
  41. <view class="item_box">{{item.experience}}</view>
  42. </view>
  43. <view class="item_name">{{item.shipyard.name}}</view>
  44. <view class="hflex acenter jbetween" style="padding-top: 16rpx;">
  45. <view class="hflex acenter">
  46. <image class="item_avatar" mode="aspectFill" :src="item.contact_headimg"></image>
  47. <view class="user_name">{{item.contact_position}}·{{item.contact_person}}</view>
  48. </view>
  49. <view class="user_right">{{item.province}}·{{item.city}}</view>
  50. </view>
  51. </view>
  52. </block>
  53. </view>
  54. <view class="list" v-if="tab_active == 1 && pageList.length > 0">
  55. <block v-for="(item,index) in pageList" :key="index">
  56. <view class="list_item hflex jbetween" @click="toDetail2(item.id)">
  57. <view class="hflex">
  58. <image class="item_avatar1" :src="item.head_img"></image>
  59. <view class="item_right1 vflex">
  60. <view class="item_title">{{item.real_name}}</view>
  61. <!-- <u-text class="item_title" mode="name" :text="item.real_name" format="encrypt"></u-text> -->
  62. <view class="hflex acenter">
  63. <view class="text_style1">{{item.city}}</view>
  64. <view style="padding: 0 8rpx;">|</view>
  65. <view class="text_style1">{{item.age}}岁</view>
  66. <view style="padding: 0 8rpx;">|</view>
  67. <view class="text_style1">{{item.work_year}}年</view>
  68. <view style="padding: 0 8rpx;">|</view>
  69. <view class="text_style1">{{item.schooling}}</view>
  70. </view>
  71. <view class="item_box1 text_hide hflex acenter">应聘岗位<view style="padding: 0 8rpx;">|</view>{{item.job_application}}</view>
  72. </view>
  73. </view>
  74. <view class="item_btn1" @click.stop="into_chatroom(index)">打招呼</view>
  75. </view>
  76. </block>
  77. </view>
  78. <!-- <view class="list" v-if="tab_active == 1 && pageList.length <= 0">
  79. <u-empty icon="https://ship-expert.zhousi.hdlkeji.com/common/zhan.png" text="暂时没有数据哦">
  80. </view> -->
  81. </view>
  82. <u-popup :show="show" mode="bottom" :round="20" :closeable="true" @close="close" @open="open">
  83. <view class="popup">
  84. <view class="popup_title">筛选</view>
  85. <view class="popup_label">薪资待遇<span class="subtitle">(单选)</span></view>
  86. <view class="hflex acenter fwrap">
  87. <block v-for="(item,index) in salaryList" :key="index">
  88. <view class="popup_box" :class="index == salary_active ? 'box_active' : ''" @click="changgeSalary(index)">{{item.value}}</view>
  89. </block>
  90. </view>
  91. <view class="popup_label">学历要求</view>
  92. <view class="hflex acenter fwrap">
  93. <block v-for="(item,index) in educationList" :key="index">
  94. <view class="popup_box" :class="item.id == education_active ? 'box_active' : ''" @click="changgeEdu(item.id)">{{item.value}}</view>
  95. </block>
  96. </view>
  97. <view class="popup_bottom hflex acenter jbetween">
  98. <view class="reset_btn" @click="reset">重置</view>
  99. <view class="reset_btn confirm_btn" @click="confirm">确认</view>
  100. </view>
  101. </view>
  102. </u-popup>
  103. <u-modal :show="first_show" :closeOnClickOverlay="true" :showConfirmButton="false">
  104. <view class="popup1">
  105. <view class="popup1_title">Hello</view>
  106. <view class="popup1_subtitle">欢迎进入此页</view>
  107. <view class="popup1_line"></view>
  108. <view class="popup1_text">此项内容<span style="color: #516EFF;">{{is_free}}</span>使用</view>
  109. <view class="popup1_btn" @click="close">我知道了</view>
  110. </view>
  111. </u-modal>
  112. <!-- <u-empty icon="https://ship-expert.zhousi.hdlkeji.com/common/zhan.png" text="暂时没有数据哦"> -->
  113. </view>
  114. </template>
  115. <script>
  116. import $api from '@/static/js/api.js'
  117. var that = ''
  118. export default {
  119. data() {
  120. return {
  121. serach_value: '',
  122. tabs: [
  123. {
  124. url: '/page_index/pages/demand/publish',
  125. src: '/static/images/index/demand/tab1.png',
  126. text: '发布应聘',
  127. },
  128. {
  129. url: '/page_index/pages/demand/collect',
  130. src: '/static/images/index/demand/tab3.png',
  131. text: '我的收藏',
  132. }
  133. ],
  134. tabs2: [
  135. {
  136. id: 0,
  137. text: '招聘信息'
  138. },
  139. {
  140. id: 1,
  141. text: '应聘信息'
  142. }
  143. ],
  144. tab_active: 0,
  145. pageList: [],
  146. salaryList: [
  147. {
  148. id: 0,
  149. value: '不限'
  150. },
  151. {
  152. id: 1,
  153. value: '4k以下'
  154. },
  155. {
  156. id: 2,
  157. value: '4k-6k'
  158. },
  159. {
  160. id: 3,
  161. value: '6k-8k'
  162. },
  163. {
  164. id: 4,
  165. value: '8k-12k'
  166. },
  167. {
  168. id: 5,
  169. value: '12k以上'
  170. }
  171. ],
  172. educationList: [
  173. {
  174. id: 0,
  175. value: '不限'
  176. },
  177. {
  178. id: 1,
  179. value: '初中及以下'
  180. },
  181. {
  182. id: 2,
  183. value: '中专/中技'
  184. },
  185. {
  186. id: 3,
  187. value: '高中'
  188. },
  189. {
  190. id: 4,
  191. value: '大专'
  192. },
  193. {
  194. id: 5,
  195. value: '本科'
  196. },
  197. {
  198. id: 6,
  199. value: '硕士'
  200. },
  201. {
  202. id: 7,
  203. value: '博士'
  204. }
  205. ],
  206. show: false,
  207. salary_active: -1,
  208. education_active: -1,
  209. is_first: true,
  210. first_show: false,
  211. is_free: '免费',
  212. page: 1,
  213. total: 1,
  214. limit: 15,
  215. }
  216. },
  217. onLoad() {
  218. that = this
  219. that.is_first = uni.getStorageSync('is_first')
  220. if(!that.is_first) {
  221. that.first_show = true
  222. uni.setStorageSync('is_first', true)
  223. }
  224. that.getList()
  225. },
  226. onShow() {
  227. var token = uni.getStorageSync('token')
  228. if(!token) {
  229. $api.info('请先登录')
  230. setTimeout(() =>{
  231. $api.jump('/pages/login/code_login')
  232. }, 1000)
  233. }
  234. },
  235. methods: {
  236. getList() {
  237. $api.req({
  238. url: '/data/api.auth.DemandLabor/demandlist',
  239. method: 'POST',
  240. data: {
  241. type: that.tab_active + 1,
  242. keyword: that.serach_value,
  243. salary: that.salary_active + 1,
  244. page: that.page
  245. }
  246. }, function(res) {
  247. if(res.code == 1) {
  248. if(that.page == 1) {
  249. that.pageList = res.data.data
  250. } else {
  251. that.pageList = that.pageList.concat(res.data.data)
  252. }
  253. that.limit = res.data.per_page
  254. that.total = res.data.total
  255. if(that.tab_active == 1) {
  256. for(var i=0;i<that.pageList.length;i++) {
  257. that.pageList[i].real_name = '*' + that.pageList[i].real_name.slice(1)
  258. }
  259. }
  260. }
  261. })
  262. },
  263. // 点击tabs
  264. toTab(url) {
  265. $api.jump(url)
  266. },
  267. // 切换tabs
  268. changeTab(index) {
  269. that.tab_active = index
  270. that.page = 1
  271. that.pageList = []
  272. that.getList()
  273. },
  274. // 打开弹出层
  275. open() {
  276. that.show = true
  277. },
  278. // 关闭弹出层
  279. close() {
  280. that.first_show = false
  281. that.show = false
  282. },
  283. // 选择薪资待遇
  284. changgeSalary(index) {
  285. console.log(index);
  286. that.salary_active = index
  287. },
  288. // 选择学历要求
  289. changgeEdu(id) {
  290. that.education_active = id
  291. },
  292. // 重置按钮
  293. reset() {
  294. that.salary_active = -1
  295. that.education_active = -1
  296. },
  297. // 确认按钮
  298. confirm() {
  299. that.close()
  300. that.page = 1
  301. that.pageList = []
  302. that.getList()
  303. },
  304. toDetail(id) {
  305. $api.jump('/page_index/pages/demand/recruitDetail?id='+id)
  306. },
  307. toDetail2(id) {
  308. $api.jump('/page_index/pages/demand/wantedDetail?id='+id)
  309. },
  310. into_chatroom(index) {
  311. var my = uni.getStorageSync("myUsername");
  312. var nameList = {
  313. myName: my,
  314. your: that.pageList[index].huanxinID,
  315. };
  316. uni.navigateTo({
  317. url: "/pages/chatroom/chatroom?username=" + JSON.stringify(nameList),
  318. });
  319. },
  320. search() {
  321. that.getList()
  322. },
  323. change(e) {
  324. console.log(e);
  325. if(e == '') {
  326. that.getList()
  327. }
  328. },
  329. onReachBottom() {
  330. if (that.page * that.limit >= that.total) {
  331. $api.info("没有更多了")
  332. } else {
  333. this.page++
  334. this.getList()
  335. }
  336. }
  337. },
  338. }
  339. </script>
  340. <style lang="scss" scoped>
  341. .content::v-deep {
  342. position: relative;
  343. background: #EEF1F8;
  344. padding: 0 30rpx;
  345. .search {
  346. width: 100%;
  347. height: 88rpx;
  348. box-sizing: border-box;
  349. padding: 12rpx 30rpx;
  350. .u-input {
  351. background-color: #fff;
  352. height: 64rpx;
  353. padding: 0 0 0 18rpx !important;
  354. border: 1rpx solid #506Dff;
  355. margin-bottom: 12rpx;
  356. }
  357. .u-input__content__subfix-icon {
  358. width: 128rpx;
  359. height: 64rpx;
  360. background-color: #506Dff;
  361. border-radius: 32rpx;
  362. color: #fff;
  363. font-size: 28rpx;
  364. text-align: center;
  365. line-height: 64rpx;
  366. }
  367. }
  368. .box {
  369. width: 100%;
  370. // background: #FFFFFF;
  371. border-radius: 20rpx;
  372. box-sizing: border-box;
  373. // padding: 16rpx 60rpx 30rpx;
  374. margin-top: 24rpx;
  375. .tab_item {
  376. width: 336rpx;
  377. height: 132rpx;
  378. background: #FFFFFF;
  379. border-radius: 20rpx;
  380. padding: 24rpx 0;
  381. .tab_img {
  382. width: 84rpx;
  383. height: 84rpx;
  384. }
  385. .tab_text {
  386. font-size: 30rpx;
  387. font-weight: 400;
  388. color: #444444;
  389. padding-left: 28rpx;
  390. }
  391. }
  392. }
  393. .box1 {
  394. width: 100%;
  395. background: #FFFFFF;
  396. border-radius: 20rpx;
  397. box-sizing: border-box;
  398. padding: 28rpx 20rpx;
  399. margin-top: 24rpx;
  400. .box1_top {
  401. width: 100%;
  402. padding-bottom: 12rpx;
  403. // border-bottom: 1rpx solid #F4F4F4;
  404. .tabs_item {
  405. font-size: 32rpx;
  406. font-weight: 400;
  407. color: #666666;
  408. margin-right: 52rpx;
  409. }
  410. .tabs_active {
  411. font-size: 32rpx;
  412. font-weight: 500;
  413. color: #222222;
  414. position: relative;
  415. }
  416. .tabs_active::before {
  417. content: '';
  418. position: absolute;
  419. width: 88rpx;
  420. height: 16rpx;
  421. background: linear-gradient(270deg, #FFFFFF 0%, #506DFF 100%);
  422. border-radius: 10rpx;
  423. bottom: 1rpx;
  424. left: 1rpx;
  425. opacity: 0.8;
  426. }
  427. .screen {
  428. width: 92rpx;
  429. height: 40rpx;
  430. background: #F3F3F3;
  431. border-radius: 4rpx;
  432. .screen_text {
  433. font-size: 24rpx;
  434. color: #666666;
  435. margin-right: 8rpx;
  436. }
  437. }
  438. }
  439. .list {
  440. width: 100%;
  441. .list_item {
  442. width: 100%;
  443. padding: 28rpx 0 20rpx;
  444. border-top: 1rpx solid #F4F4F4;
  445. .item_title {
  446. font-size: 32rpx;
  447. font-weight: 600;
  448. color: #222222;
  449. }
  450. .item_blue {
  451. font-size: 32rpx;
  452. font-weight: bold;
  453. color: #506DFF;
  454. }
  455. .item_box {
  456. height: 40rpx;
  457. background: #F0F2F6;
  458. border-radius: 2px;
  459. box-sizing: border-box;
  460. padding: 4rpx 18rpx;
  461. font-size: 22rpx;
  462. font-weight: 400;
  463. color: #444444;
  464. margin-right: 20rpx;
  465. }
  466. .item_name {
  467. font-size: 24rpx;
  468. font-weight: 400;
  469. color: #666666;
  470. }
  471. .item_avatar {
  472. width: 40rpx;
  473. height: 40rpx;
  474. border-radius: 50%;
  475. margin-right: 12rpx;
  476. }
  477. .item_avatar1 {
  478. width: 88rpx;
  479. height: 88rpx;
  480. border-radius: 50%;
  481. margin-right: 20rpx;
  482. }
  483. .item_right1 {
  484. }
  485. .text_style1 {
  486. font-size: 22rpx;
  487. font-weight: 400;
  488. color: #666666;
  489. padding: 12rpx 0;
  490. }
  491. .item_box1 {
  492. max-width: 350rpx;
  493. width: max-content;
  494. margin-top: 8rpx;
  495. background: #EDF0FF;
  496. border-radius: 8rpx;
  497. box-sizing: border-box;
  498. padding: 4rpx 16rpx;
  499. font-size: 24rpx;
  500. font-weight: 400;
  501. color: #506DFF;
  502. }
  503. .item_btn1 {
  504. width: 140rpx;
  505. height: 52rpx;
  506. background: #F1F3FF;
  507. border-radius: 28rpx;
  508. font-size: 26rpx;
  509. font-weight: 500;
  510. color: #506DFF;
  511. line-height: 52rpx;
  512. text-align: center;
  513. }
  514. .user_name {
  515. font-size: 20rpx;
  516. font-weight: 400;
  517. color: #333333;
  518. }
  519. .user_right {
  520. font-size: 20rpx;
  521. font-weight: 400;
  522. color: #A1A1A1;
  523. }
  524. }
  525. }
  526. }
  527. .popup {
  528. width: 100%;
  529. background: #FFFFFF;
  530. box-sizing: border-box;
  531. padding: 40rpx;
  532. .popup_title {
  533. width: 100%;
  534. text-align: center;
  535. font-size: 36rpx;
  536. font-weight: 500;
  537. color: #222222;
  538. }
  539. .popup_label {
  540. font-size: 32rpx;
  541. font-weight: 500;
  542. color: #222222;
  543. margin: 36rpx 0 28rpx;
  544. }
  545. .subtitle {
  546. font-size: 24rpx;
  547. font-weight: 400;
  548. color: #919191;
  549. }
  550. .popup_box {
  551. width: 208rpx;
  552. height: 76rpx;
  553. background: #F2F2F2;
  554. border-radius: 4rpx;
  555. text-align: center;
  556. font-size: 26rpx;
  557. font-weight: 400;
  558. color: #222222;
  559. line-height: 76rpx;
  560. margin: 0 24rpx 20rpx 0;
  561. }
  562. .popup_box:nth-child(3n) {
  563. margin: 0 0 20rpx;
  564. }
  565. .box_active {
  566. background: #F1F6FF;
  567. color: #506DFF;
  568. }
  569. .popup_bottom {
  570. margin: 82rpx 0 10rpx;
  571. width: 100%;
  572. .reset_btn {
  573. width: 240rpx;
  574. height: 76rpx;
  575. background: #F1F6FF;
  576. border-radius: 42rpx;
  577. font-size: 32rpx;
  578. font-weight: 500;
  579. color: #506DFF;
  580. text-align: center;
  581. line-height: 76rpx;
  582. }
  583. .confirm_btn {
  584. width: 400rpx;
  585. background: #506DFF;
  586. color: #FFFFFF;
  587. }
  588. }
  589. }
  590. .popup1 {
  591. width: 530rpx;
  592. height: 520rpx;
  593. border-radius: 40rpx;
  594. box-sizing: border-box;
  595. padding: 40rpx;
  596. .popup1_title {
  597. font-size: 48rpx;
  598. font-weight: 400;
  599. color: #222222;
  600. }
  601. .popup1_subtitle {
  602. font-size: 36rpx;
  603. font-weight: 500;
  604. color: #222222;
  605. margin: 8rpx 0 60rpx;
  606. }
  607. .popup1_line {
  608. width: 52rpx;
  609. height: 12rpx;
  610. background: #5572FF;
  611. border-radius: 6rpx;
  612. }
  613. .popup1_text {
  614. width: 100%;
  615. text-align: center;
  616. font-size: 40rpx;
  617. font-weight: 500;
  618. color: #222222;
  619. margin: 28rpx 0 52rpx;
  620. }
  621. .popup1_btn {
  622. margin: 0 auto;
  623. width: 310rpx;
  624. height: 84rpx;
  625. background: linear-gradient(90deg, #506DFF 0%, #88A6FF 100%);
  626. box-shadow: 0px 4rpx 24rpx 0px rgba(90,119,255,0.36);
  627. border-radius: 42rpx;
  628. text-align: center;
  629. line-height: 84rpx;
  630. font-size: 32rpx;
  631. font-weight: 500;
  632. color: #FFFFFF;
  633. }
  634. }
  635. .u-modal__content {
  636. padding: 0 !important;
  637. }
  638. .u-modal {
  639. width: 530rpx !important;
  640. background: url('https://ship-expert.zhousi.hdlkeji.com/common/eject.png') no-repeat;
  641. background-size: 100%;
  642. }
  643. }
  644. </style>