1
0

detail.vue 883 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <view class="detail">
  3. <!-- 轮播图 -->
  4. <view class="uni-margin-wrap">
  5. <swiper class="swiper" circular :indicator-dots="true" indicator-color="white" :autoplay="3000" :interval="2000" :duration="500">
  6. <swiper-item v-for="(item,index) in bannerList" :key="index">
  7. <image class="pictures" :src="item.pic" mode=""></image>
  8. </swiper-item>
  9. </swiper>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import { prodInfo } from '../../api/detail.js'
  15. export default {
  16. data() {
  17. return {
  18. prodList:[],
  19. bannerList: []
  20. }
  21. },
  22. async onLoad(options) {
  23. console.log(options)
  24. let result = await prodInfo({prodId: 71})
  25. console.log(result)
  26. this.bannerList = result.skuList;
  27. }
  28. }
  29. </script>
  30. <style lang="less">
  31. .uni-margin-wrap {
  32. .swiper {
  33. width: 100%;
  34. height: 600rpx;
  35. image {
  36. width: 100%;
  37. height: 100%;
  38. }
  39. }
  40. }
  41. </style>