index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view v-if="Object.keys(preferred).length > 0">
  3. <view class="ss-p-x-20">
  4. <!-- 轮播图 -->
  5. <swiper
  6. circular
  7. :indicator-dots="preferred?.carousel?.length > 1 ? true : false"
  8. :autoplay="true"
  9. :interval="3000"
  10. :duration="500"
  11. indicator-active-color="#fff"
  12. style="height: 180px;"
  13. >
  14. <swiper-item v-for="(item, index) in preferred.carousel" :key="index">
  15. <image :src="item" style="width: 100%; height: 100%" :lazy-load="true" :fade-show="true"></image>
  16. </swiper-item>
  17. </swiper>
  18. <!-- 集团简介 -->
  19. <view class="ss-m-t-50">
  20. <!-- 标题 -->
  21. <uni-title class="ss-m-b-30" type="h1" :title="preferred?.introduce?.title" align="center"></uni-title>
  22. <!-- 简介 -->
  23. <rich-text class="ss-m-b-30 color-666" :nodes="preferred?.introduce?.describe"></rich-text>
  24. <!-- 小图 -->
  25. <swiper
  26. v-if="preferred?.introduce?.thumbnail?.length"
  27. circular
  28. :indicator-dots="true"
  29. :autoplay="true"
  30. :interval="3000"
  31. :duration="500"
  32. indicator-active-color="#fff"
  33. :style="{'height': preferred?.introduce?.thumbnail.length > 1 ? '230px' : '160px'}"
  34. class="ss-m-t-50"
  35. >
  36. <swiper-item v-for="(item, index) in preferred.introduce?.thumbnail" :key="index">
  37. <image :src="item" style="width: 100%; height: 100%" :lazy-load="true" :fade-show="true"></image>
  38. </swiper-item>
  39. </swiper>
  40. <!-- 大图 -->
  41. <image class="ss-m-y-30" :src="preferred.introduce?.bigPicture?.url" style="width: 100%;" :lazy-load="true" :fade-show="true" :style="{'height': preferred.introduce?.bigPicture?.height + 'px'}"></image>
  42. </view>
  43. <!-- 品牌介绍 -->
  44. <view v-if="preferred?.brandIntroduce?.length" class="ss-m-t-30">
  45. <uni-title class="ss-m-b-30 color-666" type="h1" title="品牌介绍" align="center"></uni-title>
  46. <uni-swiper-dot class="uni-swiper-dot-box" :info="preferred.brandIntroduce" :current="current" mode="nav" field="content">
  47. <swiper :autoplay="true" :interval="5000" class="swiper-box" @change="change" :current="swiperDotIndex" style="height: 172px;">
  48. <swiper-item v-for="(item, index) in preferred.brandIntroduce" :key="index">
  49. <image :src="item.url" style="width: 100%; height: 100%" :lazy-load="true" :fade-show="true"></image>
  50. <view class="swiper-item" :class="'swiper-item' + index">
  51. <text style="color: #fff; font-size: 20px;">{{ item.content }}</text>
  52. </view>
  53. </swiper-item>
  54. </swiper>
  55. </uni-swiper-dot>
  56. <view class="color-666 ss-m-t-20 font-size-14">{{ preferred.brandIntroduce[current].desc }}</view>
  57. </view>
  58. </view>
  59. <!-- 招聘职位 -->
  60. <view class="ss-m-t-50">
  61. <uni-title class="ss-m-b-30 color-666" type="h1" title="招聘职位" align="center"></uni-title>
  62. <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore">
  63. <view v-if="positionList.length > 0">
  64. <PositionList class="pb-10" :list="positionList" :noMore="false"></PositionList>
  65. <uni-load-more :status="status" />
  66. </view>
  67. <view v-else class="nodata-img-parents">
  68. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" class="nodata-img-child"></image>
  69. </view>
  70. </scroll-view>
  71. </view>
  72. </view>
  73. </template>
  74. <script setup>
  75. import { ref } from 'vue'
  76. import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
  77. import { getJobAdvertisedSearch } from '@/api/position'
  78. import { dealDictObjData } from '@/utils/position'
  79. import { getWebContent } from '@/api/common'
  80. import PositionList from '@/components/PositionList'
  81. const title = ref('')
  82. const enterpriseId = ref(null)
  83. const preferred = ref({}) // 当前企业信息
  84. const preferredGroup = ref({}) // 优选集团信息
  85. const getSystemWebContent = async () => {
  86. const { data } = await getWebContent()
  87. preferredGroup.value = data?.appPreferredGroup || {}
  88. if (!enterpriseId.value || !preferredGroup.value[enterpriseId.value]) return uni.navigateBack({ delta: 1 })
  89. preferred.value = preferredGroup.value[enterpriseId.value]
  90. title.value = preferred.value.title
  91. uni.hideLoading()
  92. }
  93. onLoad(async (options) => {
  94. uni.showLoading({ title: '加载中...', mask:true })
  95. enterpriseId.value = options.id
  96. await getSystemWebContent()
  97. await getPositionList()
  98. })
  99. onShareAppMessage(() => {
  100. if(!title.value) setTimeout(() => {},1000)
  101. return {
  102. title: title.value || '门墩儿 专注顶尖招聘',
  103. path: '/pagesB/preferredGroup/index?id=' + enterpriseId.value
  104. }
  105. })
  106. onShareTimeline(() =>{
  107. if (!title.value) setTimeout(() => {}, 1000)
  108. return {
  109. title: title.value || '门墩儿 专注顶尖招聘',
  110. path: '/pagesB/preferredGroup/index?id=' + enterpriseId.value
  111. }
  112. })
  113. const current = ref(0)
  114. const swiperDotIndex = ref(0)
  115. const change = (e) => {
  116. current.value = e.detail.current
  117. }
  118. // 招聘职位
  119. const status = ref('more')
  120. const queryParams = ref({
  121. pageNo: 1,
  122. pageSize: 10,
  123. enterpriseId: ''
  124. })
  125. const positionList = ref([])
  126. // 招聘职位列表
  127. const getPositionList = async () => {
  128. queryParams.value.enterpriseId = enterpriseId.value
  129. const { data } = await getJobAdvertisedSearch(queryParams.value)
  130. const list = data?.list || []
  131. if (list?.length) {
  132. list.forEach(e => {
  133. e.job = { ...e.job, ...dealDictObjData({}, e.job) }
  134. e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
  135. })
  136. positionList.value = positionList.value.concat(list)
  137. }
  138. status.value = list?.length < queryParams.value.pageSize ? 'noMore' : 'more'
  139. }
  140. const loadingMore = () => {
  141. status.value = 'loading'
  142. queryParams.value.pageNo++
  143. getPositionList()
  144. }
  145. </script>
  146. <style scoped lang="scss">
  147. .scrollBox {
  148. height: 100vh;
  149. }
  150. </style>