多租户商城-商户小程序端
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.

196 lines
6.1 KiB

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