details.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view class="box" :style="`background-color: ${jobFairInfo?.backgroundColour}`">
  3. <view class="d-flex" style="padding: 15px 15px 0 15px;">
  4. <view class="title-line"></view>
  5. <rich-text class="title" :nodes="jobFairInfo?.title?.replace(/<\/?p[^>]*>/gi, '')"></rich-text>
  6. </view>
  7. <scroll-view class="scrollBox" :scroll-y="true" style="position:relative;">
  8. <JobItem v-if="jobFairPosition?.length" :list="jobFairPosition" :jobFairId="id" @refresh="getJobFairPositionList" />
  9. <uni-load-more v-else status="noMore" />
  10. </scroll-view>
  11. <view class="bottom-sticky">
  12. <view class="bottom-content">
  13. <button class="btnStyle bgButtons ss-m-l-15" type="primary" plain="true" @tap.stop="handleToShare">我的分享海报</button>
  14. <button class="buttons btnStyle" type="primary" @tap.stop="handleJoinJobFair">职位加入</button>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script setup>
  20. import { ref } from 'vue'
  21. import { onLoad, onShow } from '@dcloudio/uni-app'
  22. import { getJobFair, getJobFairPosition } from '@/api/jobFair.js'
  23. import { dealDictArrayData } from '@/utils/position.js'
  24. import JobItem from './jobItem.vue'
  25. const id = ref(null)
  26. // 获取招聘会信息
  27. const jobFairInfo = ref({})
  28. const getJobFairInfo = async () => {
  29. const { data } = await getJobFair(id.value)
  30. if (!data) return
  31. jobFairInfo.value = data || {}
  32. }
  33. // 获取招聘会职位
  34. const jobFairPosition = ref([])
  35. const getJobFairPositionList = async () => {
  36. const { data } = await getJobFairPosition(id.value)
  37. if (!data || !data.length) {
  38. jobFairPosition.value = []
  39. return
  40. }
  41. jobFairPosition.value = dealDictArrayData([], data)
  42. }
  43. onLoad((options) => {
  44. id.value = options.id
  45. if (!id.value) {
  46. uni.showToast({
  47. title: '缺少招聘会id',
  48. icon: 'none'
  49. })
  50. setTimeout(() => {
  51. uni.navigateBack({ delta: 1 })
  52. }, 1000)
  53. return
  54. }
  55. getJobFairInfo()
  56. getJobFairPositionList()
  57. })
  58. onShow(() => {
  59. if (id.value) getJobFairPositionList()
  60. })
  61. // 加入招聘会
  62. const handleJoinJobFair = () => {
  63. uni.navigateTo({
  64. url: '/pagesB/jobFair/join?jobFairId=' + id.value
  65. })
  66. }
  67. // 我的分享海报
  68. const handleToShare = () => {
  69. uni.navigateTo({
  70. url: '/pagesB/jobFair/jobFairEntShare?jobFairId=' + id.value
  71. })
  72. }
  73. </script>
  74. <style scoped lang="scss">
  75. .title {
  76. font-size: 18px;
  77. color: #fff;
  78. }
  79. .title-line {
  80. width: 12px;
  81. height: 18px;
  82. background-color: #fff;
  83. margin-right: 10px;
  84. border-radius: 6px;
  85. margin-top: 3px;
  86. }
  87. .bottom-content {
  88. display: flex;
  89. justify-content: space-evenly;
  90. align-items: center;
  91. width: 100%;
  92. margin: 20rpx 0;
  93. .btnStyle {
  94. flex: 1;
  95. margin-right: 20rpx;
  96. border-radius: 50rpx;
  97. }
  98. .bgButtons {
  99. border: 2rpx solid #00B760;
  100. color: #00B760;
  101. }
  102. &-tool {
  103. width: 160rpx;
  104. display: flex;
  105. justify-content: center;
  106. flex-direction: column;
  107. align-items: center;
  108. }
  109. }
  110. .box {
  111. height: 100vh;
  112. overflow: hidden;
  113. box-sizing: border-box;
  114. display: flex;
  115. flex-direction: column;
  116. }
  117. .scrollBox{
  118. flex: 1;
  119. height: 0 !important;
  120. padding-bottom: 100rpx;
  121. box-sizing: border-box;
  122. }
  123. </style>