index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div v-if="productData.length > 0" class="hom-pro-list">
  3. <div class="product-swiper">
  4. <div class="product-swiper-box">
  5. <div v-for="(item, index) in productData.slice(0, 3)" :key="index" class="product-swiper-warp">
  6. <div class=" product-swiper-item" @click="jumpProductDetail(item)">
  7. <div class="product-swiper-img">
  8. <img class="img pic-img default-img" :src="item.image">
  9. </div>
  10. <div class="product-swiper-info">
  11. <label class="product-name">{{ item.productName }}</label>
  12. <div class="price-warp">
  13. <!-- #ifdef MP-WEIXIN -->
  14. <img v-if="item.activityType == 1" class="iconImg" src="../../../static/images/groupBuyIcon.png">
  15. <img v-if="item.activityType == 2" class="iconImg" src="../../../static/images/spikeIcon.png">
  16. <img v-if="item.activityType == 4" class="iconImg" src="../../../static/images/spikeIcon.png">
  17. <img v-if="item.activityType == 3" class="iconImg" src="../../../static/images/discountListIcon.png">
  18. <img v-if="item.activityType == 5" class="iconImg" src="../../../static/images/discountListIcon.png">
  19. <img v-if="item.activityType == 9" class="iconImg" src="../../../static/images/memberCenterIcon.png">
  20. <img
  21. v-if="item.activityType == 8" class="iconImg"
  22. src="../../../../../static/images/new-business/shop/jierizhekou.png"
  23. >
  24. <!-- #endif -->
  25. <!-- #ifdef H5 || APP-PLUS -->
  26. <image v-if="item.activityType == 1" class="iconImg" src="../../../static/images/groupBuyIcon.png">
  27. </image>
  28. <image v-if="item.activityType == 2" class="iconImg" src="../../../static/images/spikeIcon.png"></image>
  29. <image v-if="item.activityType == 4" class="iconImg" src="../../../static/images/spikeIcon.png"></image>
  30. <image v-if="item.activityType == 3" class="iconImg" src="../../../static/images/discountListIcon.png">
  31. </image>
  32. <image v-if="item.activityType == 5" class="iconImg" src="../../../static/images/discountListIcon.png">
  33. </image>
  34. <image v-if="item.activityType == 9" class="iconImg" src="../../../static/images/memberCenterIcon.png">
  35. </image>
  36. <image
  37. v-if="item.activityType == 8" class="iconImg"
  38. src="../../../../../static/images/new-business/shop/jierizhekou.png"
  39. >
  40. </image>
  41. <!-- #endif -->
  42. <div class="price">
  43. ¥ {{ item.price }}
  44. </div>
  45. <!-- <div class="original-price"> -->
  46. <!-- ¥ {{item.originalPrice}} -->
  47. <!-- </div> -->
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="pagination new-pagination"></div>
  54. </div>
  55. <button v-show="componentContent.showMore" class="btn-more" @click="jumpProList(componentContent.productData)">
  56. 查看全部
  57. <span class="icon iconfont icon-arrow-right"></span>
  58. </button>
  59. </div>
  60. </template>
  61. <script>
  62. import { commonMixin } from '../mixin'
  63. export default {
  64. mixins: [ commonMixin ]
  65. // data () {
  66. // return {
  67. // index: 1,
  68. // swiperOption: {
  69. // slidesPerView: 3,
  70. // spaceBetween: 12,
  71. // autoplay: false, // 可选选项,自动滑动
  72. // loop: true,
  73. // pagination: {
  74. // el: '.new-pagination'
  75. // }
  76. // }
  77. // }
  78. // }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .hom-pro-list {
  83. ::v-deep .swiper-wrapper {
  84. position: static;
  85. }
  86. /**横向滑动**/
  87. .product-swiper {
  88. width: 100%;
  89. height: 454upx;
  90. padding: 90upx 34upx 0;
  91. background: url("../../../static/images/newProduct/bg-product-card.png") no-repeat center;
  92. background-size: 710upx 454upx;
  93. box-sizing: border-box;
  94. position: relative;
  95. &+.btn-more {
  96. margin-top: 20upx;
  97. }
  98. .title {
  99. padding: 22upx 0upx 0 0;
  100. label {
  101. background-image: none;
  102. color: #A56C4C;
  103. font-style: italic;
  104. padding: 0;
  105. }
  106. }
  107. &-box {
  108. padding-bottom: 20upx;
  109. display: flex;
  110. }
  111. &-warp {
  112. padding: 0 5upx;
  113. }
  114. &-item {
  115. width: 220upx;
  116. position: relative;
  117. background-color: #FFFFFF;
  118. }
  119. &-img {
  120. width: 220upx;
  121. height: 220upx;
  122. position: relative;
  123. &:after {
  124. content: '';
  125. display: block;
  126. width: 54upx;
  127. height: 54upx;
  128. background: url("../../../static/images/newProduct/flag-new.png") no-repeat;
  129. background-size: 100% 100%;
  130. position: absolute;
  131. top: 0;
  132. left: 0;
  133. }
  134. .img {
  135. width: 100%;
  136. height: 100%;
  137. object-fit: contain;
  138. }
  139. }
  140. &-info {
  141. background-color: #FFFFFF;
  142. padding: 10upx;
  143. text-align: center;
  144. .product-name {
  145. font-size: 20upx;
  146. color: #333;
  147. display: block;
  148. overflow: hidden;
  149. text-overflow: ellipsis;
  150. white-space: nowrap;
  151. margin-bottom: 6upx;
  152. line-height: 28upx;
  153. }
  154. .price-warp {
  155. display: flex;
  156. justify-content: center;
  157. align-items: center;
  158. line-height: 28upx;
  159. .iconImg {
  160. width: 58rpx;
  161. height: 36rpx;
  162. margin-right: 10rpx;
  163. }
  164. .price {
  165. color: #C83732;
  166. font-size: 20upx;
  167. margin-right: 10upx;
  168. }
  169. .original-price {
  170. font-size: 16upx;
  171. color: #ccc;
  172. text-decoration: line-through;
  173. }
  174. }
  175. }
  176. }
  177. }
  178. .pagination {
  179. display: flex;
  180. justify-content: center;
  181. width: 100%;
  182. bottom: 0;
  183. ::v-deep .swiper-pagination-bullet {
  184. width: 24upx;
  185. height: 4upx;
  186. background: #FFFFFF;
  187. opacity: 0.5;
  188. border-radius: 2upx;
  189. margin: 0 10upx;
  190. }
  191. ::v-deep .swiper-pagination-bullet-active {
  192. opacity: 1;
  193. }
  194. }
  195. .btn-more {
  196. width: 170upx;
  197. height: 54upx;
  198. border: 2upx solid #C5AA7B;
  199. color: #C5AA7B;
  200. font-size: 24upx;
  201. background-color: transparent;
  202. margin: 20upx auto 0;
  203. display: flex;
  204. align-items: center;
  205. }
  206. </style>