demand.vue 17 KB

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