index.vue 5.6 KB

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