index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 } 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. console.log('======================================')
  91. }
  92. onLoad(async (options) => {
  93. uni.showLoading({ title: '加载中...', mask:true })
  94. enterpriseId.value = options.id
  95. await getSystemWebContent()
  96. await getPositionList()
  97. })
  98. onShareAppMessage(() => {
  99. if(!title.value){
  100. setTimeout(() => {},1000)
  101. }
  102. return {
  103. title: title.value || '门墩儿 专注顶尖招聘',
  104. path: '/pagesB/preferredGroup/index?id=' + enterpriseId.value
  105. }
  106. })
  107. const current = ref(0)
  108. const swiperDotIndex = ref(0)
  109. const change = (e) => {
  110. current.value = e.detail.current
  111. }
  112. // 招聘职位
  113. const status = ref('more')
  114. const queryParams = ref({
  115. pageNo: 1,
  116. pageSize: 10,
  117. enterpriseId: ''
  118. })
  119. const positionList = ref([])
  120. // 招聘职位列表
  121. const getPositionList = async () => {
  122. queryParams.value.enterpriseId = enterpriseId.value
  123. const { data } = await getJobAdvertisedSearch(queryParams.value)
  124. const list = data?.list || []
  125. if (list?.length) {
  126. list.forEach(e => {
  127. e.job = { ...e.job, ...dealDictObjData({}, e.job) }
  128. e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
  129. })
  130. positionList.value = positionList.value.concat(list)
  131. }
  132. status.value = list?.length < queryParams.value.pageSize ? 'noMore' : 'more'
  133. }
  134. const loadingMore = () => {
  135. status.value = 'loading'
  136. queryParams.value.pageNo++
  137. getPositionList()
  138. }
  139. </script>
  140. <style scoped lang="scss">
  141. .scrollBox {
  142. height: 100vh;
  143. }
  144. </style>