jobManagement.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. <template>
  2. <view class="job-management-page">
  3. <!-- 固定顶部导航栏和标签页 -->
  4. <view class="fixed-header">
  5. <!-- 自定义导航栏 -->
  6. <view class="custom-navbar">
  7. <view class="navbar-content">
  8. <view class="nav-left" @click="goBack">
  9. <u-icon name="arrow-leftward" color="#333" size="32"></u-icon>
  10. </view>
  11. <view class="nav-title">职位管理</view>
  12. <view class="nav-right"></view>
  13. </view>
  14. </view>
  15. <!-- 标签页导航 -->
  16. <u-tabs
  17. :list="tabList"
  18. :current="activeTab"
  19. @change="switchTab"
  20. :is-scroll="false"
  21. :height="88"
  22. :font-size="24"
  23. active-color="#016BF6"
  24. inactive-color="rgba(102, 102, 102, 1)"
  25. :bar-width="60"
  26. :bar-height="4"
  27. :gutter="0"
  28. bg-color="#ffffff"
  29. ></u-tabs>
  30. </view>
  31. <!-- 职位列表 -->
  32. <view class="job-list">
  33. <!-- 有数据时显示列表 -->
  34. <scroll-view scroll-y="true" style="width: 100%;height: 70vh;" v-if="jobList.length > 0">
  35. <view
  36. class="job-card"
  37. :class="job.statusClass"
  38. v-for="(job, index) in jobList"
  39. :key="index"
  40. @click="goToJobDetail(job)"
  41. >
  42. <view class="job-card-content">
  43. <view class="job-header">
  44. <view class="job-title-section">
  45. <text class="job-title">{{job.title}}</text>
  46. <view class="urgent-tag" v-if="job.isUrgent">
  47. <text class="urgent-text">急聘</text>
  48. </view>
  49. </view>
  50. <view class="job-status" :class="job.statusClass">
  51. <text class="status-text">{{job.status}}</text>
  52. </view>
  53. </view>
  54. <view class="job-info">
  55. <text class="job-details">{{job.location}} {{job.education}} {{job.experience}} {{job.salary}} {{job.type}}</text>
  56. </view>
  57. </view>
  58. </view>
  59. </scroll-view>
  60. <!-- 空状态显示 -->
  61. <view class="empty-state" v-else>
  62. <view class="empty-illustration">
  63. <image src="../../static/images/index/Hrempty.svg" class="empty-image" mode="aspectFit" />
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 底部发布按钮 -->
  68. <view class="bottom-action">
  69. <view class="publish-btn" @click="publishNewJob">
  70. <text class="publish-text">发布新职位</text>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. activeTab: 0,
  80. tabList: [
  81. { name: '全部' },
  82. { name: '开放中' },
  83. { name: '审核失败' },
  84. { name: '已关闭' }
  85. ],
  86. jobList: []
  87. }
  88. },
  89. created() {
  90. // 页面创建时初始化数据
  91. this.filterJobsByTab(0)
  92. // 动态设置body和html高度
  93. this.setBodyHeight()
  94. },
  95. methods: {
  96. goBack() {
  97. // 检查页面栈,如果没有可返回的页面,则跳转到首页
  98. const pages = getCurrentPages()
  99. if (pages.length > 1) {
  100. uni.navigateBack()
  101. } else {
  102. // 如果没有可返回的页面,跳转到首页
  103. uni.switchTab({
  104. url: '/pages/index/index'
  105. })
  106. }
  107. },
  108. switchTab(e) {
  109. // u-tabs组件的change事件传递的是事件对象,需要获取index
  110. const index = typeof e === 'number' ? e : e.index
  111. this.activeTab = index
  112. // 这里可以根据选中的标签过滤职位列表
  113. this.filterJobsByTab(index)
  114. },
  115. filterJobsByTab(tabIndex) {
  116. // 根据标签过滤职位列表的逻辑
  117. console.log('切换到标签:', this.tabList[tabIndex].name)
  118. // 模拟不同标签的数据
  119. if (tabIndex === 0) { // 全部
  120. this.jobList = [
  121. {
  122. title: '亚马逊运营',
  123. location: '深圳-西乡',
  124. education: '本科',
  125. experience: '1-3年',
  126. salary: '10-15K·13薪',
  127. type: '全职',
  128. status: '免费试用中',
  129. statusClass: 'status-trial',
  130. isUrgent: true
  131. },
  132. {
  133. title: '亚马逊运营',
  134. location: '深圳-西乡',
  135. education: '本科',
  136. experience: '1-3年',
  137. salary: '10-15K·13薪',
  138. type: '全职',
  139. status: '审核中',
  140. statusClass: 'status-review',
  141. isUrgent: false
  142. },
  143. {
  144. title: '亚马逊运营',
  145. location: '深圳-西乡',
  146. education: '本科',
  147. experience: '1-3年',
  148. salary: '10-15K·13薪',
  149. type: '全职',
  150. status: '审核未通过',
  151. statusClass: 'status-failed',
  152. isUrgent: false
  153. },
  154. {
  155. title: '亚马逊运营',
  156. location: '深圳-西乡',
  157. education: '本科',
  158. experience: '1-3年',
  159. salary: '10-15K·13薪',
  160. type: '全职',
  161. status: '免费试用中',
  162. statusClass: 'status-trial',
  163. isUrgent: false
  164. },
  165. {
  166. title: '产品经理',
  167. location: '深圳-南山',
  168. education: '本科',
  169. experience: '3-5年',
  170. salary: '15-25K·14薪',
  171. type: '全职',
  172. status: '审核中',
  173. statusClass: 'status-review',
  174. isUrgent: true
  175. },
  176. {
  177. title: 'UI设计师',
  178. location: '深圳-福田',
  179. education: '本科',
  180. experience: '2-4年',
  181. salary: '12-18K·13薪',
  182. type: '全职',
  183. status: '免费试用中',
  184. statusClass: 'status-trial',
  185. isUrgent: false
  186. },
  187. {
  188. title: '前端开发工程师',
  189. location: '深圳-宝安',
  190. education: '本科',
  191. experience: '2-5年',
  192. salary: '15-22K·13薪',
  193. type: '全职',
  194. status: '审核中',
  195. statusClass: 'status-review',
  196. isUrgent: true
  197. },
  198. {
  199. title: '数据分析师',
  200. location: '深圳-龙岗',
  201. education: '硕士',
  202. experience: '1-3年',
  203. salary: '18-28K·14薪',
  204. type: '全职',
  205. status: '免费试用中',
  206. statusClass: 'status-trial',
  207. isUrgent: false
  208. },
  209. {
  210. title: '销售经理',
  211. location: '深圳-罗湖',
  212. education: '本科',
  213. experience: '3-6年',
  214. salary: '20-35K·15薪',
  215. type: '全职',
  216. status: '审核中',
  217. statusClass: 'status-review',
  218. isUrgent: false
  219. },
  220. {
  221. title: '运营专员',
  222. location: '深圳-盐田',
  223. education: '本科',
  224. experience: '1-2年',
  225. salary: '8-12K·13薪',
  226. type: '全职',
  227. status: '审核未通过',
  228. statusClass: 'status-failed',
  229. isUrgent: false
  230. },
  231. {
  232. title: '运营专员',
  233. location: '深圳-盐田',
  234. education: '本科',
  235. experience: '1-2年',
  236. salary: '8-12K·13薪',
  237. type: '全职',
  238. status: '审核未通过',
  239. statusClass: 'status-failed',
  240. isUrgent: false
  241. },
  242. {
  243. title: '运营专员',
  244. location: '深圳-盐田',
  245. education: '本科',
  246. experience: '1-2年',
  247. salary: '8-12K·13薪',
  248. type: '全职',
  249. status: '审核未通过',
  250. statusClass: 'status-failed',
  251. isUrgent: false
  252. },
  253. {
  254. title: '运营专员',
  255. location: '深圳-盐田',
  256. education: '本科',
  257. experience: '1-2年',
  258. salary: '8-12K·13薪',
  259. type: '全职',
  260. status: '审核未通过',
  261. statusClass: 'status-failed',
  262. isUrgent: false
  263. }
  264. ]
  265. } else if (tabIndex === 1) { // 开放中
  266. this.jobList = [
  267. {
  268. title: '亚马逊运营',
  269. location: '深圳-西乡',
  270. education: '本科',
  271. experience: '1-3年',
  272. salary: '10-15K·13薪',
  273. type: '全职',
  274. status: '免费试用中',
  275. statusClass: 'status-trial',
  276. isUrgent: true
  277. },
  278. {
  279. title: '产品经理',
  280. location: '深圳-南山',
  281. education: '本科',
  282. experience: '3-5年',
  283. salary: '15-25K·14薪',
  284. type: '全职',
  285. status: '免费试用中',
  286. statusClass: 'status-trial',
  287. isUrgent: true
  288. },
  289. {
  290. title: 'UI设计师',
  291. location: '深圳-福田',
  292. education: '本科',
  293. experience: '2-4年',
  294. salary: '12-18K·13薪',
  295. type: '全职',
  296. status: '免费试用中',
  297. statusClass: 'status-trial',
  298. isUrgent: false
  299. }
  300. ]
  301. } else if (tabIndex === 2) { // 审核失败
  302. this.jobList = [
  303. {
  304. title: '亚马逊运营',
  305. location: '深圳-西乡',
  306. education: '本科',
  307. experience: '1-3年',
  308. salary: '10-15K·13薪',
  309. type: '全职',
  310. status: '审核未通过',
  311. statusClass: 'status-failed',
  312. isUrgent: false
  313. }
  314. ]
  315. } else if (tabIndex === 3) { // 已关闭
  316. this.jobList = [
  317. {
  318. title: '运营专员',
  319. location: '深圳-盐田',
  320. education: '本科',
  321. experience: '1-2年',
  322. salary: '8-12K·13薪',
  323. type: '全职',
  324. status: '已关闭',
  325. statusClass: 'status-closed',
  326. isUrgent: false
  327. }
  328. ]
  329. }
  330. },
  331. goToJobDetail(job) {
  332. // 跳转到职位详情页面
  333. uni.navigateTo({
  334. url: '/pages/jobManagement/jobDetail'
  335. })
  336. },
  337. publishNewJob() {
  338. // 跳转到发布新职位页面
  339. uni.navigateTo({
  340. url: '/package/addJob/addJob'
  341. })
  342. },
  343. setBodyHeight() {
  344. // 动态设置body和html高度为auto
  345. if (typeof document !== 'undefined') {
  346. document.body.style.height = 'auto'
  347. document.documentElement.style.height = 'auto'
  348. document.body.style.minHeight = 'auto'
  349. document.documentElement.style.minHeight = 'auto'
  350. }
  351. }
  352. }
  353. }
  354. </script>
  355. <style lang="scss" scoped>
  356. page {
  357. background-color: #ffffff;
  358. }
  359. .job-management-page {
  360. background-color: #ffffff;
  361. }
  362. .fixed-header {
  363. position: fixed;
  364. top: 0;
  365. left: 0;
  366. right: 0;
  367. z-index: 9999;
  368. background-color: #ffffff;
  369. }
  370. .custom-navbar {
  371. padding-top: 80rpx;
  372. background-color: #ffffff;
  373. box-sizing: border-box;
  374. .navbar-content {
  375. display: flex;
  376. align-items: center;
  377. justify-content: space-between;
  378. height: 88rpx;
  379. padding: 0 40rpx;
  380. .nav-left, .nav-right {
  381. width: 60rpx;
  382. height: 60rpx;
  383. display: flex;
  384. align-items: center;
  385. justify-content: center;
  386. }
  387. .nav-title {
  388. color: rgba(51, 51, 51, 1);
  389. font-family: DM Sans;
  390. font-size: 30rpx;
  391. font-weight: 700;
  392. line-height: 52px;
  393. letter-spacing: 0.5%;
  394. text-align: center;
  395. }
  396. }
  397. }
  398. .job-list {
  399. padding: 0 40rpx;
  400. margin-top: 280rpx;
  401. .job-card {
  402. background: #ffffff;
  403. border-radius: 12rpx;
  404. margin-bottom: 20rpx;
  405. padding: 32rpx;
  406. border: 0.5px solid rgba(227, 231, 236, 1);
  407. // box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
  408. .job-card-content {
  409. .job-header {
  410. display: flex;
  411. justify-content: space-between;
  412. align-items: flex-start;
  413. margin-bottom: 16rpx;
  414. .job-title-section {
  415. display: flex;
  416. align-items: center;
  417. flex: 1;
  418. gap: 28rpx;
  419. .job-title {
  420. color: rgba(23, 23, 37, 1);
  421. font-family: DM Sans;
  422. font-size: 28rpx;
  423. font-weight: 400;
  424. line-height: 44rpx;
  425. letter-spacing: 0.5%;
  426. text-align: left;
  427. }
  428. .urgent-tag {
  429. border-radius: 8rpx;
  430. background: rgba(252, 233, 220, 1);
  431. padding: 4rpx 8rpx;
  432. .urgent-text {
  433. color: rgba(1, 107, 246, 1);
  434. font-family: DM Sans;
  435. font-size: 16rpx;
  436. font-weight: 400;
  437. // line-height: 20rpx;
  438. // letter-spacing: -0.5px;
  439. text-align: left;
  440. }
  441. }
  442. }
  443. .job-status {
  444. &.status-trial {
  445. color: rgba(1, 107, 246, 1);
  446. }
  447. &.status-review {
  448. color: rgba(1, 107, 246, 1);
  449. }
  450. &.status-failed {
  451. color: rgba(153, 153, 153, 1);
  452. .status-text {
  453. color: rgba(153, 153, 153, 1) !important;
  454. background: none !important;
  455. -webkit-background-clip: unset !important;
  456. -webkit-text-fill-color: rgba(153, 153, 153, 1) !important;
  457. background-clip: unset !important;
  458. text-fill-color: rgba(153, 153, 153, 1) !important;
  459. }
  460. }
  461. &.status-closed {
  462. color: rgba(153, 153, 153, 1);
  463. .status-text {
  464. color: rgba(153, 153, 153, 1) !important;
  465. background: none !important;
  466. -webkit-background-clip: unset !important;
  467. -webkit-text-fill-color: rgba(153, 153, 153, 1) !important;
  468. background-clip: unset !important;
  469. text-fill-color: rgba(153, 153, 153, 1) !important;
  470. }
  471. }
  472. .status-text {
  473. background: linear-gradient(132.53deg, rgba(106.94185638427734, 84.63434600830078, 214.0178680419922, 0.96),rgba(144.87640380859375, 87.8011474609375, 191.25, 1) 95%);
  474. -webkit-background-clip: text;
  475. -webkit-text-fill-color: transparent;
  476. background-clip: text;
  477. text-fill-color: transparent;
  478. font-family: DM Sans;
  479. font-size: 18rpx;
  480. font-weight: 400;
  481. line-height: 20rpx;
  482. letter-spacing: -0.5px;
  483. text-align: right;
  484. }
  485. }
  486. }
  487. .job-info {
  488. .job-details {
  489. color: rgba(120, 130, 138, 1);
  490. font-family: DM Sans;
  491. font-size: 28rpx;
  492. font-weight: 400;
  493. line-height: 36rpx;
  494. letter-spacing: 0.5%;
  495. text-align: left;
  496. }
  497. }
  498. }
  499. &.status-failed {
  500. .job-title {
  501. color: rgba(153, 153, 153, 1) !important;
  502. }
  503. .job-details {
  504. color: rgba(153, 153, 153, 1) !important;
  505. }
  506. }
  507. &.status-closed {
  508. .job-title {
  509. color: rgba(153, 153, 153, 1) !important;
  510. }
  511. .job-details {
  512. color: rgba(153, 153, 153, 1) !important;
  513. }
  514. }
  515. }
  516. }
  517. .empty-state {
  518. display: flex;
  519. // flex-direction: column;
  520. align-items: center;
  521. justify-content: center;
  522. padding: 40rpx;
  523. .empty-illustration {
  524. margin-bottom: 40rpx;
  525. .empty-image {
  526. width: 700rpx;
  527. height: 800rpx;
  528. }
  529. }
  530. .empty-text {
  531. color: rgba(120, 130, 138, 1);
  532. font-family: DM Sans;
  533. font-size: 28rpx;
  534. font-weight: 400;
  535. line-height: 36rpx;
  536. letter-spacing: 0.5%;
  537. text-align: center;
  538. }
  539. }
  540. .bottom-action {
  541. position: fixed;
  542. bottom: 0;
  543. left: 0;
  544. right: 0;
  545. padding: 30rpx 40rpx;
  546. background: #ffffff;
  547. z-index: 9999;
  548. .publish-btn {
  549. width: 100%;
  550. height: 88rpx;
  551. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  552. border-radius: 44rpx;
  553. display: flex;
  554. align-items: center;
  555. justify-content: center;
  556. .publish-text {
  557. color: rgba(255, 255, 255, 1);
  558. font-family: DM Sans;
  559. font-size: 32rpx;
  560. font-weight: 400;
  561. line-height: 48rpx;
  562. letter-spacing: 0%;
  563. text-align: center;
  564. }
  565. }
  566. }
  567. </style>