index.vue 5.2 KB

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