details.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. try {
  43. uni.showLoading({ title: '加载中' })
  44. const { data } = await getJobFairPosition(id.value)
  45. if (!data || !data.length) {
  46. jobFairPosition.value = []
  47. return
  48. }
  49. jobFairPosition.value = dealDictArrayData([], data)
  50. } finally {
  51. uni.hideLoading()
  52. }
  53. }
  54. onLoad((options) => {
  55. id.value = options.id
  56. if (!id.value) {
  57. uni.showToast({
  58. title: '缺少招聘会id',
  59. icon: 'none'
  60. })
  61. setTimeout(() => {
  62. uni.navigateBack({ delta: 1 })
  63. }, 1000)
  64. return
  65. }
  66. getJobFairInfo()
  67. getJobFairPositionList()
  68. })
  69. onShow(() => {
  70. if (id.value) getJobFairPositionList()
  71. })
  72. // 加入招聘会
  73. const handleJoinJobFair = () => {
  74. uni.navigateTo({
  75. url: '/pagesB/jobFair/join?jobFairId=' + id.value
  76. })
  77. }
  78. // 我的分享海报
  79. const handleToShare = () => {
  80. uni.navigateTo({
  81. url: '/pagesB/jobFair/jobFairEntShare?jobFairId=' + id.value
  82. })
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. .title {
  87. font-size: 18px;
  88. color: #fff;
  89. }
  90. .title-line {
  91. width: 7px;
  92. height: 18px;
  93. background-color: #fff;
  94. margin-right: 10px;
  95. border-radius: 6px;
  96. margin-top: 3px;
  97. }
  98. .bottom-content {
  99. display: flex;
  100. justify-content: space-evenly;
  101. align-items: center;
  102. width: 100%;
  103. margin: 20rpx 0;
  104. .btnStyle {
  105. flex: 1;
  106. margin-right: 20rpx;
  107. border-radius: 50rpx;
  108. }
  109. .bgButtons {
  110. border: 2rpx solid #00B760;
  111. color: #00B760;
  112. }
  113. &-tool {
  114. width: 160rpx;
  115. display: flex;
  116. justify-content: center;
  117. flex-direction: column;
  118. align-items: center;
  119. }
  120. }
  121. .box {
  122. height: 100vh;
  123. overflow: hidden;
  124. box-sizing: border-box;
  125. display: flex;
  126. flex-direction: column;
  127. }
  128. .scrollBox{
  129. flex: 1;
  130. height: 0 !important;
  131. padding-bottom: 100rpx;
  132. box-sizing: border-box;
  133. }
  134. </style>