welfare.vue 733 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <layout-page>
  3. <view class="box">
  4. <SwiperAd :list="swiperAdList"></SwiperAd>
  5. <view class=""></view>
  6. </view>
  7. </layout-page>
  8. </template>
  9. <script setup>
  10. import { ref } from 'vue'
  11. import layoutPage from '@/layout'
  12. import SwiperAd from '@/components/SwiperAd'
  13. import { swiperAdListTest } from '@/utils/testData'
  14. import { onShow } from '@dcloudio/uni-app'
  15. // 设置自定义tabbar选中值
  16. onShow(() => {
  17. const currentPage = getCurrentPages()[0]; // 获取当前页面实例
  18. const currentTabBar = currentPage?.getTabBar?.();
  19. // 设置当前tab页的下标index
  20. currentTabBar?.setData({ selected: 2 });
  21. })
  22. const swiperAdList = ref(swiperAdListTest)
  23. </script>
  24. <style scoped lang="scss">
  25. </style>