index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <view 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 v-for="(desc, index) in preferred.introduce.describe" :key="index" class="ss-m-b-30 color-666" :nodes="desc" style="display: block;"></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: 240px;"
  33. class="ss-m-t-30"
  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 PositionList from '@/components/PositionList'
  78. const title = ref('')
  79. const enterpriseId = ref(null)
  80. const preferred = ref({}) // 当前企业信息
  81. const preferredGroup = ref({}) // 优选集团信息
  82. onLoad(async (options) => {
  83. enterpriseId.value = options.id
  84. uni.request({
  85. url: 'https://minio.menduner.com/dev/8f6f14c642e55254c28098bdbe22c42de33d4673dffd28069c03bf090cf479b9.json',
  86. method: 'GET',
  87. success: (res) => {
  88. preferredGroup.value = res.data
  89. if (!enterpriseId.value || !preferredGroup.value[enterpriseId.value]) return uni.navigateBack({ delta: 1 })
  90. preferred.value = preferredGroup.value[enterpriseId.value]
  91. title.value = preferred.value.title
  92. console.log(preferred.value, 'preferred.value')
  93. },
  94. fail: res => {
  95. log(res, 'fail')
  96. }
  97. })
  98. await getPositionList()
  99. })
  100. onShareAppMessage(() => {
  101. if(!title.value){
  102. setTimeout(() => {},1000)
  103. }
  104. return {
  105. title: title.value || '门墩儿 专注顶尖招聘',
  106. path: '/pagesB/preferredGroup/index?id=' + enterpriseId.value
  107. }
  108. })
  109. const current = ref(0)
  110. const swiperDotIndex = ref(0)
  111. const change = (e) => {
  112. current.value = e.detail.current
  113. }
  114. // 招聘职位
  115. const status = ref('more')
  116. const queryParams = ref({
  117. pageNo: 1,
  118. pageSize: 10,
  119. enterpriseId: ''
  120. })
  121. const positionList = ref([])
  122. // 招聘职位列表
  123. const getPositionList = async () => {
  124. queryParams.value.enterpriseId = enterpriseId.value
  125. const { data } = await getJobAdvertisedSearch(queryParams.value)
  126. const list = data?.list || []
  127. if (list?.length) {
  128. list.forEach(e => {
  129. e.job = { ...e.job, ...dealDictObjData({}, e.job) }
  130. e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
  131. })
  132. positionList.value = positionList.value.concat(list)
  133. }
  134. status.value = list?.length < queryParams.value.pageSize ? 'noMore' : 'more'
  135. }
  136. const loadingMore = () => {
  137. status.value = 'loading'
  138. queryParams.value.pageNo++
  139. getPositionList()
  140. }
  141. </script>
  142. <style scoped lang="scss">
  143. .scrollBox {
  144. height: 100vh;
  145. }
  146. </style>