btnPopous.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. <template>
  2. <view>
  3. <block v-if="!userId">
  4. <view class="cover"></view>
  5. </block>
  6. <block v-else>
  7. <cover-view class="cover"></cover-view>
  8. </block>
  9. <view class="jobAll" :class="topY == true ? 'end' : 'start'" @touchstart="start" @touchend="end"
  10. @touchmove.stop="move">
  11. <view class="header">
  12. <view class="shut"><u-icon name="minus" top="10rpx"></u-icon></view>
  13. <view class="headerTitle">所有职位<text>{{ total }}</text></view>
  14. <view class="jobAll-search">
  15. <view @click="searchResult" class="searchBox flex">
  16. <u-icon size="36rpx" color="#999" name="search"></u-icon>
  17. <u-input @confirm="searchResult" v-model="projectName" placeholder="搜索职位" type="text"
  18. input-align="left" confirm-type="search" :custom-style="{ marginLeft: '20rpx' }" />
  19. </view>
  20. <view class="searchBox nobg flex" v-if="!userId">
  21. <u-tag @click="changeClassify('')" class="tag" text="全部"
  22. :type="projectName != '' ? 'info' : 'primary'" mode="light" size="mini" />
  23. <u-tag @click="changeClassify(item.ruleClassifyName)" class="tag" :text="item.ruleClassifyName"
  24. :type="projectName != item.ruleClassifyName ? 'info' : 'primary'" mode="light" size="mini"
  25. v-for="item in classify" />
  26. </view>
  27. </view>
  28. </view>
  29. <!-- <view class="jobAll-search flex justify-center">
  30. <view class="jobAll-search-box">
  31. <u-dropdown :mask='false' active-color="#016BF6">
  32. <u-dropdown-item v-model="value1" title="岗位" @change="change1"
  33. :options="options1"></u-dropdown-item>
  34. <u-dropdown-item v-model="value2" title="经验" @change="change2"
  35. :options="options2"></u-dropdown-item>
  36. <u-dropdown-item v-model="value3" title="薪资" @change="change3"
  37. :options="options3"></u-dropdown-item>
  38. <u-dropdown-item v-model="value4" title="城市" @change="change4"
  39. :options="options4"></u-dropdown-item>
  40. </u-dropdown>
  41. </view>
  42. </view> -->
  43. <view class="jobAll-item flex justify-center">
  44. <view class="jobAll-item-box">
  45. <scroll-view scroll-y="true" v-if="list.length > 0" style="width: 100%;height: 100%;"
  46. :refresher-enabled="true" :refresher-triggered="refresher" @refresherpulling="scrolltoupper"
  47. @refresherrefresh="refresherrefresh" @scrolltolower="scrolltolower">
  48. <view class="jobAll-item-box-item" v-for="(item, index) in list" :key="index"
  49. @tap.stop="gotos(item.postPushId)">
  50. <!-- 标题-薪资 -->
  51. <view class="jobAll-item-box-item-title flex justify-between align-center">
  52. <view class="title-left flex align-center">
  53. <view class="job-title-text">
  54. <!-- <block v-if="isSameName(item.ruleClassifyName,item.stationName)">
  55. {{item.ruleClassifyName}}-
  56. </block> -->
  57. <block>
  58. {{ item.ruleClassifyName }}
  59. </block>
  60. </view>
  61. <!-- <view class="salary-text-box">
  62. <image src="../../static/images/index/jipinIcom.svg" class="jipin-icon" />
  63. <text class="jipin-text">急聘</text>
  64. </view> -->
  65. </view>
  66. <text class="salary-text">{{ item.salaryRange }}</text>
  67. </view>
  68. <!-- 公司名称-公司人数 -->
  69. <view class="jobAll-item-box-item-name flex align-center">
  70. <text class="company-name"
  71. style="margin-right: 8rpx;">{{ item.company ? item.company.companyAllName : '' }}</text>
  72. <text class="company-people"
  73. v-if="item.company">{{ item.company ? item.company.companyPeople : '0人' }}</text>
  74. </view>
  75. <!-- 职位标签 -->
  76. <view class="jobAll-item-box-item-label flex align-center flex-wrap">
  77. <text class="job-tag">{{ item.education }}</text>
  78. <text class="job-tag">{{ item.experience }}</text>
  79. <text class="job-tag">{{ item.industry }}</text>
  80. </view>
  81. <!-- 公司简介-位置 -->
  82. <view class="jobAll-item-box-item-info flex justify-between align-center">
  83. <view class="jobAll-item-box-item-info-l flex align-center">
  84. <image
  85. :src="item.hr && item.hr.hrImg ? item.hr.hrImg : item.user ? item.user.avatar : '../../static/logo.png'"
  86. style="width: 58rpx;height: 58rpx;border-radius: 50%;" mode="aspectFill">
  87. </image>
  88. <view class="company-info-text" v-if="item.company">
  89. {{ item.user && item.user.userName ? item.user.userName : '未知' }}·{{ item.hr && item.hr.hrPosition || '人事总监' }}
  90. </view>
  91. <view v-if="item.respondTime" class="reply-time">{{ item.respondTime }}</view>
  92. </view>
  93. <view class="location-text">
  94. {{ item.distance }} {{ item.county }}
  95. </view>
  96. </view>
  97. <view class="jobAll-item-box-item-line" v-if="(index + 1) != list.length">
  98. </view>
  99. </view>
  100. </scroll-view>
  101. <empty v-else />
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </template>
  107. <script>
  108. import empty from '../empty.vue'
  109. export default {
  110. name: "btnPopous",
  111. components: {
  112. empty
  113. },
  114. props: {
  115. //公司id
  116. companyId: {
  117. type: [String, Number],
  118. default: ''
  119. },
  120. //城市数组
  121. cittArr: {
  122. type: Array,
  123. default: () => []
  124. },
  125. //薪资数组
  126. moneyArr: {
  127. type: Array,
  128. default: () => []
  129. },
  130. //经验数组
  131. jyArr: {
  132. type: Array,
  133. default: () => []
  134. },
  135. //岗位分类
  136. classify: {
  137. type: Array,
  138. default: () => []
  139. },
  140. // HRId
  141. userId:{
  142. type: [String, Number],
  143. default: ''
  144. }
  145. },
  146. data() {
  147. return {
  148. refresher: false,
  149. list: [],
  150. clientX: '',
  151. clientY: '',
  152. topY: false,
  153. value1: 1,
  154. value2: 1,
  155. value3: 1,
  156. value4: 1,
  157. options1: [],
  158. options2: [],
  159. options3: [],
  160. options4: [],
  161. page: 1,
  162. pages: 1,
  163. limit: 10,
  164. projectName: '', //岗位名称
  165. address: '', //城市
  166. salaryRange: '', //薪资
  167. experience: '', //经验
  168. title: '',
  169. total: 0
  170. };
  171. },
  172. watch: {
  173. //城市
  174. cittArr(newArr, oldArr) {
  175. //拿到最新传递的城市数据,处理成需要的格式
  176. let arr = [{
  177. label: '全部',
  178. value: '',
  179. }]
  180. this.cittArr.map(item => {
  181. let obj = {
  182. label: item,
  183. value: item,
  184. }
  185. arr.push(obj)
  186. })
  187. this.options4 = arr
  188. },
  189. //岗位分类列表
  190. classify(newArr, oldArr) {
  191. //拿到最新传递的岗位数据,处理成需要的格式
  192. let arr = [{
  193. label: '全部',
  194. value: '',
  195. }]
  196. this.classify.map(item => {
  197. let obj = {
  198. label: item,
  199. value: item,
  200. }
  201. arr.push(obj)
  202. })
  203. this.options1 = arr
  204. },
  205. //经验
  206. jyArr(newArr, oldArr) {
  207. //拿到最新传递的经验数据,处理成需要的格式
  208. let arr = [{
  209. label: '全部',
  210. value: '',
  211. }]
  212. this.jyArr.map(item => {
  213. let obj = {
  214. label: item.value,
  215. value: item.value,
  216. }
  217. arr.push(obj)
  218. })
  219. this.options2 = arr
  220. },
  221. //薪资
  222. moneyArr(newArr, oldArr) {
  223. //拿到最新传递的薪资数据,处理成需要的格式
  224. let arr = [{
  225. label: '全部',
  226. value: '',
  227. }]
  228. this.moneyArr.map(item => {
  229. let obj = {
  230. label: item.value,
  231. value: item.value,
  232. }
  233. arr.push(obj)
  234. })
  235. this.options3 = arr
  236. },
  237. },
  238. created() {
  239. this.userGetPostPushList()
  240. },
  241. methods: {
  242. //判断岗位名称与职位名称是否相同(不区分大小写)
  243. isSameName(className, name) {
  244. let str1 = className.trim();
  245. let str2 = name ? name.trim() : '';
  246. if (str1.length !== str2.length) {
  247. return true;
  248. }
  249. return str1.toLowerCase() !== str2.toLowerCase();
  250. },
  251. change1(e) {
  252. this.projectName = e
  253. this.userGetPostPushList()
  254. },
  255. change2(e) {
  256. this.experience = e
  257. this.userGetPostPushList()
  258. },
  259. change3(e) {
  260. this.salaryRange = e
  261. this.userGetPostPushList()
  262. },
  263. change4(e) {
  264. this.address = e
  265. this.userGetPostPushList()
  266. },
  267. changeClassify(e) {
  268. console.log(e)
  269. this.page = 1
  270. this.projectName = e
  271. this.userGetPostPushList()
  272. },
  273. searchResult() {
  274. this.page = 1
  275. this.userGetPostPushList()
  276. },
  277. /**
  278. * 上拉加载更多
  279. */
  280. scrolltolower() {
  281. if (this.page < this.pages) {
  282. this.page += 1
  283. this.userGetPostPushList()
  284. }
  285. },
  286. /**
  287. * 获取岗位列表
  288. */
  289. userGetPostPushList() {
  290. let data = {
  291. companyId: this.companyId,
  292. page: this.page,
  293. limit: this.limit,
  294. ruleClassifyName: this.projectName, //岗位名称
  295. city: this.address, //城市
  296. salaryRange: this.salaryRange, //薪资
  297. experience: this.experience, //经验
  298. }
  299. if(this.userId){
  300. data = {
  301. ...data,
  302. hrId:this.userId
  303. }
  304. }
  305. this.$Request.getT("/app/postPush/userGetPostPushList", data).then(res => {
  306. if (res.code == 0) {
  307. this.pages = res.data.pages
  308. this.total = res.data.total
  309. if (this.page == 1) {
  310. this.list = res.data.records
  311. } else {
  312. this.list = [...this.list, ...res.data.records]
  313. }
  314. }
  315. })
  316. },
  317. gotos(postPushId) {
  318. console.log('rrrrrrrrrrrrrrrrrrrrrrrr')
  319. uni.navigateTo({
  320. url: '/pages/index/game/order?postPushId=' + postPushId
  321. })
  322. },
  323. refresherrefresh() {
  324. this.refresher = false
  325. },
  326. scrolltoupper(e) {
  327. // this.refresher = true
  328. this.refresher = true
  329. this.topY = false
  330. },
  331. start(e) {
  332. this.clientX = e.changedTouches[0].clientX
  333. this.clientY = e.changedTouches[0].clientY
  334. },
  335. end(e) {
  336. let subX = e.changedTouches[0].clientX - this.clientX
  337. let subY = e.changedTouches[0].clientY - this.clientY
  338. // 向下拉动超过150px时直接关闭弹窗
  339. if (subY > 150) {
  340. this.topY = false
  341. // 通知父组件关闭弹窗
  342. this.$emit('closePopup')
  343. } else if (subY < -50) {
  344. this.topY = true
  345. }
  346. },
  347. move(e) {
  348. },
  349. }
  350. }
  351. </script>
  352. <style lang="scss">
  353. .cover {
  354. width: 100%;
  355. height: 100%;
  356. background: rgba(0, 0, 0, .5);
  357. position: fixed;
  358. z-index: 99998;
  359. top: 0;
  360. left: 0
  361. }
  362. .jobAll {
  363. width: 100%;
  364. height: 90vh;
  365. background-color: #f4f3f3;
  366. border-radius: 60rpx 60rpx 0px 0px;
  367. position: fixed;
  368. z-index: 99999;
  369. box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.1);
  370. overflow: hidden;
  371. display: flex;
  372. flex-direction: column;
  373. .jobAll-search {
  374. width: 100%;
  375. margin-top: 20rpx;
  376. border-top: 1px solid #ebebeb;
  377. .jobAll-search-box {
  378. width: 686rpx;
  379. height: 100%;
  380. }
  381. }
  382. .jobAll-item {
  383. width: 100%;
  384. flex: 1;
  385. margin-top: 20rpx;
  386. padding: 0 20rpx;
  387. margin-bottom: 20rpx;
  388. overflow: hidden;
  389. .jobAll-item-box {
  390. width: 100%;
  391. height: 100%;
  392. .jobAll-item-box-item {
  393. width: 100%;
  394. background-color: #ffffff;
  395. border-radius: 12rpx;
  396. margin-bottom: 20rpx;
  397. padding: 20rpx;
  398. border: 0.5px solid rgba(227, 231, 236, 1);
  399. background: rgba(253, 253, 253, 1);
  400. .jobAll-item-box-item-name {
  401. margin-top: 14rpx;
  402. color: #999999;
  403. font-size: 28rpx;
  404. font-weight: 500;
  405. }
  406. .jobAll-item-box-item-label {
  407. margin-top: 14rpx;
  408. }
  409. .jobAll-item-box-item-info {
  410. font-size: 26rpx;
  411. margin-top: 20rpx;
  412. .jobAll-item-box-item-info-l {
  413. color: #1A1A1A;
  414. display: flex;
  415. align-items: center;
  416. gap: 12rpx;
  417. }
  418. }
  419. .jobAll-item-box-item-line {
  420. width: 100%;
  421. border-bottom: 1rpx solid #E6E6E6;
  422. margin-top: 30rpx;
  423. }
  424. }
  425. }
  426. }
  427. }
  428. .start {
  429. border-radius: 60rpx 60rpx 0px 0px !important;
  430. bottom: -70vh;
  431. transition-duration: .5s
  432. }
  433. .end {
  434. border-radius: 60rpx 60rpx 0px 0px !important;
  435. bottom: 0;
  436. transition-duration: .5s
  437. }
  438. // 首页样式
  439. .job-title-text {
  440. color: var(--Grayscale/Grayscale 100, rgba(23, 23, 37, 1));
  441. font-family: DM Sans;
  442. font-size: 38rpx;
  443. font-weight: 700;
  444. line-height: 24px;
  445. letter-spacing: undefined;
  446. text-align: left;
  447. }
  448. .salary-text-box {
  449. display: flex;
  450. align-items: center;
  451. margin-left: 16rpx;
  452. .jipin-icon {
  453. width: 32rpx;
  454. height: 32rpx;
  455. margin-right: 8rpx;
  456. }
  457. .jipin-text {
  458. color: #FF6B6B;
  459. font-size: 24rpx;
  460. font-weight: 600;
  461. }
  462. }
  463. .salary-text {
  464. color: rgba(1, 107, 246, 1);
  465. font-family: DM Sans;
  466. font-size: 28rpx;
  467. font-weight: 700;
  468. line-height: 20px;
  469. letter-spacing: 0.5%;
  470. text-align: right;
  471. }
  472. .company-name {
  473. color: var(--Grayscale/Grayscale 60, rgba(156, 164, 171, 1));
  474. font-family: DM Sans;
  475. font-size: 24rpx;
  476. font-weight: 400;
  477. line-height: 20px;
  478. letter-spacing: 0.5%;
  479. text-align: left;
  480. }
  481. .company-people {
  482. color: var(--Grayscale/Grayscale 60, rgba(156, 164, 171, 1));
  483. font-family: DM Sans;
  484. font-size: 24rpx;
  485. font-weight: 400;
  486. line-height: 20px;
  487. letter-spacing: 0.5%;
  488. text-align: left;
  489. }
  490. .job-tag {
  491. height: 42rpx;
  492. display: flex;
  493. flex-direction: row;
  494. justify-content: center;
  495. align-items: center;
  496. padding: 8rpx;
  497. border-radius: 8rpx;
  498. background: rgba(198, 198, 198, 0.1);
  499. margin-right: 16rpx;
  500. color: rgba(153, 153, 153, 1);
  501. font-size: 24rpx;
  502. }
  503. .company-info-text,
  504. .location-text {
  505. color: rgba(156, 164, 171, 1);
  506. font-family: DM Sans;
  507. font-size: 20rpx;
  508. font-weight: 400;
  509. line-height: 40rpx;
  510. letter-spacing: 0.5%;
  511. text-align: left;
  512. }
  513. .reply-time {
  514. display: flex;
  515. flex-direction: row;
  516. justify-content: center;
  517. align-items: center;
  518. padding: 8rpx;
  519. font-family: DM Sans;
  520. font-size: 20rpx;
  521. font-weight: 400;
  522. line-height: 40rpx;
  523. letter-spacing: 0.5%;
  524. text-align: left;
  525. border-radius: 12rpx;
  526. background: #ECE1FD;
  527. color: #8858C5;
  528. }
  529. .header {
  530. width: 100%;
  531. background: #fff;
  532. text-align: center;
  533. color: #111;
  534. padding-bottom: 1rpx;
  535. .headerTitle {
  536. font-size: 34rpx;
  537. text {
  538. font-size: 20rpx;
  539. vertical-align: top
  540. }
  541. }
  542. .shut {
  543. color: #bbb;
  544. font-size: 60rpx;
  545. transform: scaleX(1.6)
  546. }
  547. .searchBox {
  548. width: 92%;
  549. margin: 30rpx auto;
  550. border-radius: 70rpx;
  551. background: #f1f1f1;
  552. padding: 0 20rpx
  553. }
  554. .nobg {
  555. width: initial;
  556. overflow-x: auto;
  557. background: none;
  558. border-radius: 0;
  559. gap: 20rpx;
  560. margin-left: 10rpx;
  561. }
  562. .tag{
  563. flex-shrink: 0;
  564. }
  565. }
  566. </style>