btnPopous.vue 13 KB

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