index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <div class="group-list">
  3. <div class="group-warp">
  4. <div class="title">
  5. <label>
  6. <img src="../../../static/images/group/img-title.png" alt="拼团专区"/>
  7. </label>
  8. <a v-show="componentContent.showMore" class="btn-all a-link" @click="jumpDiscount(productData)">更多<i class="iconfont icon-arrow-right"></i></a>
  9. </div>
  10. <swiper class="pro-box" :options="swiperOption">
  11. <swiper-slide class="pro-item" v-for="(item,index) in productData.products" :key="index" @click="jumpProductDetail(item)">
  12. <div class="pro-item-img">
  13. <img v-show="item.image" class="img" :src="item.image">
  14. </div>
  15. <div class="pro-item-info">
  16. <label class="name">{{item.productName}}</label>
  17. <div class="price">
  18. <label class="unit">¥ </label>
  19. <label class="val"> {{item.price}}</label>
  20. </div>
  21. <label class="buyCount">{{item.workUsers?item.workUsers:0}}人已拼</label>
  22. </div>
  23. </swiper-slide>
  24. </swiper>
  25. <div class="pagination group-pagination"></div>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. import {commonMixin} from '../mixin'
  31. export default {
  32. mixins: [commonMixin],
  33. data () {
  34. return {
  35. swiperOption: {
  36. slidesPerView: 3, // 显示数量
  37. spaceBetween: 16, // 间隔
  38. autoplay: false, // 可选选项,自动滑动
  39. loop: true,
  40. pagination: {
  41. el: '.group-pagination'
  42. },
  43. navigation: {
  44. nextEl: '.swiper-button-next',
  45. prevEl: '.swiper-button-prev'
  46. }
  47. }
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .group-list{
  54. padding: 30px 20px 60px;
  55. .group-warp{
  56. width: 710px;
  57. height: 528px;
  58. padding: 0 10px;
  59. background: #333333;
  60. box-shadow: 0px 20px 30px rgba(0, 0, 0, 0.3);
  61. opacity: 1;
  62. border-radius: 20px;
  63. }
  64. .title{
  65. display: flex;
  66. align-items:center;
  67. position: relative;
  68. padding: 40px 0 30px 20px;
  69. .btn-all{
  70. position: absolute;
  71. right: 8px;
  72. top: 40px;
  73. line-height: 33px;
  74. padding-right: 25px;
  75. font-size: 24px;
  76. color: #FFEBC4;
  77. .iconfont{
  78. content: '';
  79. font-size: 26px;
  80. position: absolute;
  81. right: 0;
  82. top: 0;
  83. }
  84. }
  85. }
  86. .pro-box{
  87. padding-bottom: 20px;
  88. .pro-item{
  89. width: 220px;
  90. height: 382px;
  91. background: #FFFFFF;
  92. .pro-item-img{
  93. .img{
  94. width: 100%;
  95. height: 220px;
  96. }
  97. }
  98. .pro-item-info{
  99. text-align: center;
  100. padding: 0px 10px 20px;
  101. .name{
  102. font-size: 24px;
  103. font-weight: normal;
  104. color: #FFEBC4;
  105. line-height: 50px;
  106. background-color: #333333;
  107. text-align: center;
  108. margin-bottom: 18px;
  109. padding: 0 5px;
  110. display: block;
  111. overflow: hidden;
  112. text-overflow: ellipsis;
  113. white-space: nowrap;
  114. }
  115. .price{
  116. color: #C83732;
  117. font-size: 28px;
  118. font-weight: bold;
  119. line-height: 40px;
  120. }
  121. .buyCount{
  122. font-size: 24px;
  123. color: #ccc;
  124. line-height: 34px;
  125. font-weight: normal;
  126. }
  127. }
  128. }
  129. }
  130. .pagination{
  131. display: flex;
  132. justify-content: center;
  133. ::v-deep .swiper-pagination-bullet{
  134. width: 24px;
  135. height: 4px;
  136. background: #fff;
  137. opacity: 0.5;
  138. border-radius: 2px;
  139. margin: 0 5px;
  140. }
  141. ::v-deep .swiper-pagination-bullet-active{
  142. opacity: 1;
  143. }
  144. }
  145. }
  146. </style>