多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

214 lines
5.8 KiB

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