btnPopous.vue 13 KB

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