index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <div class="group-list" v-if="productData&&productData.composeProducts&&productData.composeProducts.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/price/img-title.png" alt="组合优惠" mode="widthFix"/>
  8. <!-- #endif -->
  9. <!-- #ifdef H5 || APP-PLUS -->
  10. <image class="title-img" src="../../../static/images/price/img-title.png" alt="组合优惠" mode="widthFix"/>
  11. <!-- #endif -->
  12. </label>
  13. <div class="price-text">
  14. <swiper class="swiper" :autoplay="true" :vertical="true">
  15. <swiper-item v-for="(item,index) in productData.rules" :key="index">
  16. {{item.price}}元任选{{item.number}}件
  17. </swiper-item>
  18. </swiper>
  19. </div>
  20. <a v-show="componentContent.showMore" class="btn-all a-link" @click="jumpCombination(productData)">更多<i class="iconfont icon-arrow-right"></i></a>
  21. </div>
  22. <div>
  23. <swiper class="swiper pro-box" :indicator-dots="false" :autoplay="true" :display-multiple-items="2" @change="swiperChange">
  24. <swiper-item class="pro-item-warp" v-for="(item,index) in productData.composeProducts" :key="index" @click="jumpProductDetail(item)">
  25. <div class="pro-item-inner">
  26. <div class="pro-item">
  27. <div class="pro-item-img">
  28. <img class="img default-img" :src="item.image">
  29. </div>
  30. <div class="pro-item-info">
  31. <h3 class="name">
  32. {{item.productName}}
  33. </h3>
  34. <div class="stock">
  35. 还剩{{item.stockNumber}}件
  36. </div>
  37. <div class="price-warp">
  38. <div class="price">
  39. ¥ {{item.price}}
  40. </div>
  41. <div class="original-price">
  42. ¥ {{item.originalPrice}}
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </swiper-item>
  49. </swiper>
  50. <view class="swiper-dots" v-if="productData.composeProducts && productData.composeProducts.length > 2">
  51. <text class="dot" :class="index - swiperCurrent <= 1 && index - swiperCurrent >=0 && 'dot-active'" v-for="(dot, index) in productData.composeProducts.length"
  52. :key="index"></text>
  53. </view>
  54. </div>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import {commonMixin} from '../mixin'
  60. export default {
  61. mixins: [commonMixin],
  62. data () {
  63. return {
  64. swiperCurrent: 0,
  65. }
  66. },
  67. methods:{
  68. swiperChange(e) {
  69. this.swiperCurrent = e.detail.current;
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .group-list{
  76. padding: 30upx 20upx 60upx;
  77. .group-warp{
  78. height: 544upx;
  79. padding: 0 10upx;
  80. background: #333333;
  81. box-shadow: 0 20upx 30upx rgba(0, 0, 0, 0.3);
  82. opacity: 1;
  83. border-radius: 20upx;
  84. position: relative;
  85. }
  86. .title{
  87. display: flex;
  88. align-items:center;
  89. position: relative;
  90. padding: 32upx 0 20upx 20upx;
  91. .title-img{
  92. width: 203upx;
  93. }
  94. .price-text{
  95. width: 300upx;
  96. height: 50upx;
  97. background: linear-gradient(90deg, #C83732 0%, #E25C44 100%);
  98. box-shadow: 0 6upx 12upx rgba(233, 0, 0, 0.3);
  99. border-radius: 26upx;
  100. font-size: 24upx;
  101. color: #fff;
  102. text-align: center;
  103. line-height: 50upx;
  104. margin-left: 20upx;
  105. .swiper{
  106. height: 50upx;
  107. }
  108. }
  109. .btn-all{
  110. position: absolute;
  111. right: 8upx;
  112. top: 40upx;
  113. line-height: 33upx;
  114. padding-right: 25upx;
  115. font-size: 24upx;
  116. color: #FFEBC4;
  117. .iconfont{
  118. content: '';
  119. font-size: 26upx;
  120. position: absolute;
  121. right: 0;
  122. top: 0;
  123. }
  124. }
  125. }
  126. .pro-box{
  127. padding-bottom: 20upx;
  128. height: 450upx;
  129. .pro-item-inner{
  130. padding: 0 10upx;
  131. }
  132. .pro-item{
  133. width: 100%;
  134. height: 412upx;
  135. background: #FFFFFF;
  136. .pro-item-img{
  137. .img{
  138. width: 100%;
  139. height: 236upx;
  140. }
  141. }
  142. .pro-item-info{
  143. padding: 0 20upx;
  144. .name{
  145. font-size: 24upx;
  146. line-height: 40upx;
  147. color: #333333;
  148. overflow: hidden;
  149. text-overflow:ellipsis;
  150. white-space: nowrap;
  151. }
  152. .stock{
  153. padding: 0 8upx;
  154. height: 40upx;
  155. border: 2upx solid #E4E5E6;
  156. line-height: 40upx;
  157. margin: 10upx 0;
  158. display: inline-block;
  159. font-size: 20upx;
  160. color: #C5AA7B;
  161. }
  162. .price{
  163. font-size: 32upx;
  164. font-weight: bold;
  165. line-height: 44upx;
  166. color: #C83732;
  167. padding-right: 10upx;
  168. display: inline-block;
  169. }
  170. .original-price{
  171. font-size: 20upx;
  172. line-height: 28upx;
  173. color: #CCCCCC;
  174. display: inline-block;
  175. }
  176. }
  177. }
  178. }
  179. //.pagination{
  180. // display: flex;
  181. // justify-content: center;
  182. // ::v-deep .swiper-pagination-bullet{
  183. // width: 24upx;
  184. // height: 4upx;
  185. // background: #fff;
  186. // opacity: 0.5;
  187. // border-radius: 2upx;
  188. // margin: 0 5upx;
  189. // }
  190. // ::v-deep .swiper-pagination-bullet-active{
  191. // opacity: 1;
  192. // }
  193. //}
  194. .swiper-dots {
  195. display: flex;
  196. position: absolute;
  197. left: 50%;
  198. transform: translateX(-50%);
  199. bottom: 15rpx;
  200. z-index: 66;
  201. .dot {
  202. width: 24upx;
  203. height: 4upx;
  204. background: #fff;
  205. opacity: 0.5;
  206. border-radius: 2upx;
  207. margin: 0 10upx;
  208. }
  209. .dot-active {
  210. opacity: 1;
  211. }
  212. }
  213. }
  214. </style>