index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <script>
  2. export default {
  3. props: {
  4. posterData: {
  5. type: Object,
  6. default: () => {}
  7. }
  8. },
  9. data() {
  10. return {
  11. autoplay: true,
  12. circular: true,
  13. interval: 3000,
  14. duration: 500
  15. };
  16. },
  17. inject: ['goMenuPage'],
  18. methods: {}
  19. };
  20. </script>
  21. <template>
  22. <!-- 轮播 -->
  23. <view class="slider-wrapper" v-if="posterData.list.length && parseInt(posterData.is_show)">
  24. <swiper
  25. :indicator-dots="posterData.list.length > 1 ? true : false"
  26. :autoplay="autoplay"
  27. :circular="circular"
  28. :interval="interval"
  29. :duration="duration"
  30. indicator-color="rgba(255,255,255,0.6)"
  31. indicator-active-color="#fff"
  32. >
  33. <block v-for="(item, index) in posterData.list" :key="index">
  34. <swiper-item>
  35. <view @click="goMenuPage(item.url)" class="slide-navigator acea-row row-between-wrapper" hover-class="none">
  36. <image :src="item.pic" class="slide-image" mode="aspectFill"></image>
  37. </view>
  38. </swiper-item>
  39. </block>
  40. </swiper>
  41. </view>
  42. </template>
  43. <style lang="scss" scoped>
  44. .slider-wrapper {
  45. margin: 20rpx 20rpx;
  46. height: 188rpx;
  47. swiper,
  48. swiper-item {
  49. height: 100%;
  50. }
  51. image {
  52. width: 100%;
  53. height: 188rpx;
  54. border-radius: 16rpx;
  55. }
  56. }
  57. </style>