index.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/libs/models'
  15. import Banner from '../../components/banner.vue'
  16. import PageHelper from '@/components/page-helper.vue'
  17. // const { data, run: setData } = useRequest(
  18. // () =>
  19. // getContents({
  20. // contentType: '3',
  21. // contentCategory: '301',
  22. // }),
  23. // {
  24. // initialData: { list: [] },
  25. // },
  26. // )
  27. const query = computed(() => ({
  28. contentType: "3",
  29. contentCategory: "301",
  30. }))
  31. const { data: banners, run: setBanners } = useRequest(
  32. () => getBanners({ mode: BannerMode.DesignAwards }),
  33. { initialData: [] },
  34. )
  35. const swiperList = computed(() => banners.value.map((it) => it.bannerImgUrl))
  36. const current = ref<number>(0)
  37. const products = ref([{}, {}, {}])
  38. function handleClick(e) {
  39. console.log(e)
  40. }
  41. function onChange(e) {
  42. console.log(e)
  43. }
  44. onMounted(async () => {
  45. // await setData()
  46. await setBanners()
  47. })
  48. </script>
  49. <template>
  50. <view class="bg-white flex-grow flex flex-col px-3.5 py-5.5 gap-5.5">
  51. <!-- <wd-swiper
  52. custom-class="rounded-2xl overflow-hidden aspect-[2.71/1]"
  53. width="100%"
  54. height="100%"
  55. :list="swiperList"
  56. autoplay
  57. v-model:current="current"
  58. :indicator="{ type: 'dots-bar' } as any"
  59. @click="handleClick"
  60. @change="onChange"
  61. ></wd-swiper> -->
  62. <Banner :mode="BannerMode.DesignAwards"></Banner>
  63. <SectionHeading title="筑巢奖"></SectionHeading>
  64. <PageHelper
  65. v-slot="{ source }"
  66. class="flex-grow flex flex-col"
  67. :request="getContents"
  68. :query="query"
  69. >
  70. <template v-for="(it, i) in source.list" :key="i">
  71. <ElegantInfoCard :options="it"></ElegantInfoCard>
  72. </template>
  73. </PageHelper>
  74. <!-- <template v-for="(it, i) in data.list" :key="i">
  75. <ElegantInfoCard :options="it"></ElegantInfoCard>
  76. </template>
  77. <wd-status-tip
  78. v-if="!data.list?.length"
  79. :image="NetImages.NotContent"
  80. tip="暂无内容"
  81. ></wd-status-tip> -->
  82. </view>
  83. </template>
  84. <style scoped lang="scss"></style>