index.vue 5.7 KB

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