index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <route lang="json5">
  2. {
  3. style: {
  4. navigationBarTitleText: '设计奖项',
  5. navigationBarBackgroundColor: '#fff',
  6. },
  7. }
  8. </route>
  9. <script setup lang="ts">
  10. import SectionHeading from '@/components/section-heading.vue'
  11. import ElegantInfoCard from '../../components/elegant-info-card.vue'
  12. import { getBanners, getContents } from '../../../../core/libs/requests'
  13. import { NetImages } from '../../../../core/libs/net-images'
  14. import { BannerMode } from '../../../../core/models/moment'
  15. const { data, run: setData } = useRequest(
  16. () =>
  17. getContents({
  18. contentType: '3',
  19. contentCategory: '301',
  20. }),
  21. {
  22. initialData: { list: [] },
  23. },
  24. )
  25. const { data: banners, run: setBanners } = useRequest(
  26. () => getBanners({ mode: BannerMode.DesignAwards }),
  27. { initialData: [] },
  28. )
  29. const swiperList = computed(() => banners.value.map((it) => it.bannerImgUrl))
  30. const current = ref<number>(0)
  31. const products = ref([{}, {}, {}])
  32. function handleClick(e) {
  33. console.log(e)
  34. }
  35. function onChange(e) {
  36. console.log(e)
  37. }
  38. onMounted(async () => {
  39. await setData()
  40. await setBanners()
  41. })
  42. </script>
  43. <template>
  44. <view class="bg-white flex-grow flex flex-col px-3.5 py-5.5 gap-5.5">
  45. <wd-swiper
  46. custom-class="rounded-2xl overflow-hidden aspect-[2.71/1]"
  47. width="100%"
  48. height="100%"
  49. :list="swiperList"
  50. autoplay
  51. v-model:current="current"
  52. :indicator="{ type: 'dots-bar' } as any"
  53. @click="handleClick"
  54. @change="onChange"
  55. ></wd-swiper>
  56. <SectionHeading title="筑巢奖"></SectionHeading>
  57. <template v-for="(it, i) in data.list" :key="i">
  58. <ElegantInfoCard :options="it"></ElegantInfoCard>
  59. </template>
  60. <wd-status-tip
  61. v-if="!data.list?.length"
  62. :image="NetImages.NotContent"
  63. tip="暂无内容"
  64. ></wd-status-tip>
  65. </view>
  66. </template>
  67. <style scoped lang="scss"></style>