details.vue 3.1 KB

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