shop.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <div class="shop" :class="'terminal' + terminal">
  3. <swiper class="swiper" :indicator-dots="true" :autoplay="true">
  4. <swiper-item class="shop-item" v-for="(item,index) in imgList" :key="index">
  5. <div class="shop-item-warp">
  6. <img class="img" :src="item.img" mode="widthFix">
  7. <div class="a-link" @click="jumpLink(item.linkObj)">
  8. 进店逛逛<i class="iconfont icon-arrow-right"></i>
  9. </div>
  10. </div>
  11. </swiper-item>
  12. </swiper>
  13. <!-- <div class="pagination shop-pagination"></div>-->
  14. </div>
  15. </template>
  16. <script>
  17. // import { directive, Swiper, SwiperSlide } from 'vue-awesome-swiper'
  18. // import 'swiper/css/swiper.css'
  19. import {funMixin} from '../config/mixin'
  20. export default {
  21. name: 'shop',
  22. mixins: [funMixin],
  23. data () {
  24. return {
  25. // swiperOption: {
  26. // autoplay: false, // 可选选项,自动滑动
  27. // loop: true,
  28. // pagination: {
  29. // el: '.shop-pagination'
  30. // }
  31. // }
  32. }
  33. },
  34. props: {
  35. terminal: {
  36. type: Number,
  37. default: 4
  38. },
  39. componentContent: {
  40. type: Object
  41. }
  42. },
  43. // components: {
  44. // Swiper,
  45. // SwiperSlide
  46. // },
  47. // directives: {
  48. // swiper: directive
  49. // },
  50. computed: {
  51. imgList: function () {
  52. console.log(this.componentContent)
  53. return this.componentContent.imgTextData.filter(function (item) {
  54. return item.img
  55. })
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. .shop{
  62. position: relative;
  63. .swiper{
  64. height: 480upx;
  65. }
  66. &-item{
  67. &-warp{
  68. position: relative;
  69. padding: 0 20upx;
  70. .img{
  71. width: 100%;
  72. }
  73. .a-link{
  74. width: 220upx;
  75. height: 80upx;
  76. line-height: 80upx;
  77. background: linear-gradient(225deg, #585858 0%, #333333 100%);
  78. box-shadow: 0px 20upx 40upx rgba(0, 0, 0, 0.3);
  79. display: block;
  80. color: #fff;
  81. font-size: 28upx;
  82. text-align: center;
  83. position: absolute;
  84. right: 0;
  85. bottom: 30upx;
  86. .icon{
  87. margin-left: 20upx;
  88. }
  89. }
  90. }
  91. }
  92. //.pagination{
  93. // display: flex;
  94. // justify-content: center;
  95. // padding:20upx 0;
  96. // ::v-deep .swiper-pagination-bullet{
  97. // width: 12upx;
  98. // height: 12upx;
  99. // background: #333333;
  100. // border-radius: 50%;
  101. // opacity: 0.2;
  102. // margin: 0 10upx;
  103. // }
  104. // ::v-deep .swiper-pagination-bullet-active{
  105. // width: 24upx;
  106. // height: 12upx;
  107. // background: #333333;
  108. // opacity: 1;
  109. // border-radius: 8upx;
  110. // }
  111. //}
  112. ::v-deep .uni-swiper-dots{
  113. display: flex;
  114. justify-content: center;
  115. padding: 0upx 0;
  116. .uni-swiper-dot{
  117. width: 10upx;
  118. height: 10upx;
  119. background: #333333;
  120. opacity: 0.3;
  121. border-radius: 5upx;
  122. margin: 0 5upx;
  123. &-active{
  124. width: 20upx;
  125. height: 10upx;
  126. opacity: 1;
  127. }
  128. }
  129. }
  130. }
  131. </style>