detiles.vue 710 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view>
  3. <view>
  4. <view class="home-main">
  5. <view class="custom-swiper">
  6. <up-swiper :list="list3" indicator indicatorMode="line" circular></up-swiper>
  7. </view>
  8. </view>
  9. </view>
  10. </view>
  11. </template>
  12. <script setup>
  13. import { ref } from 'vue';
  14. import {
  15. slideshow,
  16. } from '@/api/home.js'
  17. import {
  18. onShow
  19. } from "@dcloudio/uni-app";
  20. const list3 = ref([]);//轮播图数据
  21. const getBanners = async () => {
  22. try {
  23. const res = await slideshow(7);
  24. if (res.code === 200 && res.data.picture) {
  25. list3.value = res.data.picture.split(',');
  26. }
  27. } catch (error) {
  28. console.log('error', error);
  29. }
  30. }
  31. onShow(() => {
  32. getBanners();
  33. })
  34. </script>
  35. <style scoped>
  36. </style>