index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <div class="group-list" v-if="productData.products&&productData.products.length>0">
  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" :circular="true" :indicator-dots="false" :autoplay="true" :display-multiple-items="3" @change="swiperChange">
  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 class="img default-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. <!-- #ifdef MP-WEIXIN -->
  35. <swiper-item v-if="productData.products.length" class="swiper-slide pro-item-warp" v-for="item in (3 - productData.products.length)">
  36. </swiper-item>
  37. <!-- #endif -->
  38. </swiper>
  39. <view class="swiper-dots" v-if="productData.products && productData.products.length > 3">
  40. <text class="dot" :class="index - swiperCurrent <= 2 && index - swiperCurrent >=0 && 'dot-active'" v-for="(dot, index) in productData.products.length"
  41. :key="index"></text>
  42. </view>
  43. </div>
  44. </div>
  45. </div>
  46. </template>
  47. <script>
  48. import {commonMixin} from '../mixin'
  49. export default {
  50. mixins: [commonMixin],
  51. data () {
  52. return {
  53. swiperCurrent: 0,
  54. }
  55. },
  56. methods:{
  57. swiperChange(e) {
  58. this.swiperCurrent = e.detail.current;
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .group-list{
  65. padding: 30upx 20upx 60upx;
  66. .group-warp{
  67. width: 710upx;
  68. height: 528upx;
  69. padding: 0 2upx;
  70. background: #333333;
  71. box-shadow: 0px 20upx 30upx rgba(0, 0, 0, 0.3);
  72. opacity: 1;
  73. border-radius: 20upx;
  74. position: relative;
  75. }
  76. .title{
  77. display: flex;
  78. align-items:center;
  79. position: relative;
  80. padding: 40upx 0 25upx 20upx;
  81. .title-img{
  82. width: 189upx;
  83. height: 34rpx;
  84. }
  85. .btn-all{
  86. position: absolute;
  87. right: 8upx;
  88. top: 40upx;
  89. line-height: 33upx;
  90. padding-right: 25upx;
  91. font-size: 24upx;
  92. color: #FFEBC4;
  93. .iconfont{
  94. content: '';
  95. font-size: 26upx;
  96. position: absolute;
  97. right: 0;
  98. top: 0;
  99. }
  100. }
  101. }
  102. .pro-box{
  103. height: 390upx;
  104. display: flex;
  105. &.swiper-disabled{
  106. .uni-swiper-wrapper{
  107. position: static;
  108. }
  109. }
  110. .pro-item-warp{
  111. width: 236px;
  112. }
  113. .pro-item{
  114. width: 220upx;
  115. height: 382upx;
  116. background: #FFFFFF;
  117. .pro-item-img{
  118. .img{
  119. width: 100%;
  120. height: 220upx;
  121. }
  122. }
  123. &-inner{
  124. padding: 0 8upx;
  125. }
  126. .pro-item-info{
  127. text-align: center;
  128. padding: 0px 10upx 20upx;
  129. .name{
  130. font-size: 24upx;
  131. font-weight: normal;
  132. color: #FFEBC4;
  133. line-height: 50upx;
  134. background-color: #333333;
  135. text-align: center;
  136. margin-bottom: 18upx;
  137. padding: 0 5px;
  138. display: block;
  139. overflow: hidden;
  140. text-overflow: ellipsis;
  141. white-space: nowrap;
  142. }
  143. .price{
  144. color: #C83732;
  145. font-size: 28upx;
  146. font-weight: bold;
  147. line-height: 40upx;
  148. }
  149. .buyCount{
  150. font-size: 24upx;
  151. color: #ccc;
  152. line-height: 34upx;
  153. font-weight: normal;
  154. }
  155. }
  156. }
  157. }
  158. ::v-deep .uni-swiper-dots{
  159. display: flex;
  160. justify-content: center;
  161. bottom: 27px;
  162. .uni-swiper-dot{
  163. width: 24upx;
  164. height: 4upx;
  165. background: #fff;
  166. opacity: 0.5;
  167. border-radius: 2upx;
  168. margin: 0 5upx;
  169. &-active{
  170. opacity: 1;
  171. }
  172. }
  173. }
  174. //.pagination{
  175. // display: flex;
  176. // justify-content: center;
  177. // ::v-deep .swiper-pagination-bullet{
  178. // width: 24upx;
  179. // height: 4upx;
  180. // background: #fff;
  181. // opacity: 0.5;
  182. // border-radius: 2upx;
  183. // margin: 0 5upx;
  184. // }
  185. // ::v-deep .swiper-pagination-bullet-active{
  186. // opacity: 1;
  187. // }
  188. //}
  189. .swiper-dots {
  190. display: flex;
  191. position: absolute;
  192. left: 50%;
  193. transform: translateX(-50%);
  194. bottom: 15rpx;
  195. z-index: 66;
  196. .dot {
  197. width: 24upx;
  198. height: 4upx;
  199. background: #fff;
  200. opacity: 0.5;
  201. border-radius: 2upx;
  202. margin: 0 10upx;
  203. }
  204. .dot-active {
  205. opacity: 1;
  206. }
  207. }
  208. }
  209. </style>