seckillProduct.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="diy-seckillProduct" v-if="itemData.data.product_list.length>0">
  3. <view class="sharpproduct-head d-b-c" :style="'background-image: url('+itemData.style.background_image+');'">
  4. <view class="left d-s-c">
  5. <view class="name d-c-c">
  6. </view>
  7. <view class="datetime d-s-c ml20">
  8. <Countdown :back_color="itemData.style.countdown_back_color" :color='itemData.style.color' :cut_color="itemData.style.countdown_color" :config="countdownConfig"></Countdown>
  9. </view>
  10. </view>
  11. <view class="right d-e-c" @click="gotoList">
  12. <text class="white f26">更多</text>
  13. <text class="iconfont icon-jiantou mr10"></text>
  14. </view>
  15. </view>
  16. <view class="sharpproduct-body column__3">
  17. <scroll-view scroll-x="true">
  18. <view class="product-list">
  19. <view class="product-item" v-for="(item, index) in itemData.data.product_list" :key="index"
  20. @click="gotoDetail(item.seckill_product_id)">
  21. <!-- 两列三列 -->
  22. <template>
  23. <view class="product-cover">
  24. <image :src="item.product.file_path" mode="aspectFit"></image>
  25. </view>
  26. <view class="product-info p-0-10">
  27. <view v-if="itemData.style.show.productName == true" class="product-title">
  28. {{ item.product.product_name }}</view>
  29. <view class="price d-c-c">
  30. <view v-if="itemData.style.show.seckillPrice == true" class="red">
  31. <text class="f20">¥</text>
  32. <text class="f32 fb">{{ item.seckill_price }}</text>
  33. </view>
  34. <text class="ml10 gray9 f20 text-d-line"
  35. v-if="itemData.style.show.linePrice == true">¥</text>
  36. <text class="gray9 f24 text-d-line"
  37. v-if="itemData.style.show.linePrice == true">{{ item.product_price }}</text>
  38. </view>
  39. </view>
  40. </template>
  41. </view>
  42. </view>
  43. </scroll-view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import Countdown from '@/components/countdown/countdown.vue';
  49. export default {
  50. components: {
  51. Countdown
  52. },
  53. data() {
  54. return {
  55. /*倒计时配置*/
  56. countdownConfig: {
  57. /*开始时间*/
  58. startstamp: 0,
  59. /*结束时间*/
  60. endstamp: 0,
  61. /*标题*/
  62. title: ' '
  63. }
  64. };
  65. },
  66. props: ['itemData'],
  67. created() {
  68. this.countdownConfig.endstamp = this.itemData.data.end_time;
  69. this.countdownConfig.startstamp = this.itemData.data.start_time;
  70. },
  71. methods: {
  72. scroll(e) {},
  73. /*跳转列表*/
  74. gotoList() {
  75. let url = '/pages/plus/seckill/list/list';
  76. this.gotoPage(url);
  77. },
  78. /*跳转产品详情*/
  79. gotoDetail(e) {
  80. let url = '/pages/plus/seckill/detail/detail?seckill_product_id=' + e;
  81. this.gotoPage(url);
  82. }
  83. }
  84. };
  85. </script>
  86. <style lang="scss">
  87. .diy-seckillProduct {
  88. margin: 20rpx 20rpx;
  89. border-radius: 20rpx;
  90. background: #ffffff;
  91. overflow: hidden;
  92. }
  93. .diy-seckillProduct .sharpproduct-head {
  94. height: 90rpx;
  95. color: #000000;
  96. background-size: 100% 100%;
  97. }
  98. .diy-seckillProduct .name {
  99. width: 200rpx;
  100. }
  101. .diy-seckillProduct .sharpproduct-body {
  102. padding: 0 20rpx;
  103. }
  104. .diy-seckillProduct .sharpproduct-head .name {
  105. font-size: 32rpx;
  106. font-weight: bold;
  107. }
  108. .diy-seckillProduct .sharpproduct-head .datetime::v-deep text {
  109. font-size: 24rpx;
  110. color: #ffffff;
  111. }
  112. .diy-seckillProduct .sharpproduct-head .datetime::v-deep .box {
  113. padding: 4rpx 10rpx;
  114. font-size: 22rpx;
  115. background: #FFEBEB;
  116. color: #EE1413;
  117. }
  118. .diy-seckillProduct .sharpproduct-head .icon-jiantou {
  119. margin-left: 8rpx;
  120. color: #ffffff;
  121. font-size: 22rpx;
  122. }
  123. .diy-seckillProduct .product-list .product-item {
  124. overflow: hidden;
  125. flex-shrink: 0;
  126. }
  127. .diy-seckillProduct .product-list .product-cover image {
  128. width: 100%;
  129. height: 100%;
  130. background-color: #F4F4F4;
  131. border-radius: 12rpx;
  132. }
  133. .diy-seckillProduct .product-list .price {
  134. font-size: 20rpx;
  135. color: #F01A1A;
  136. line-height: 26rpx;
  137. padding-top: 16rpx;
  138. padding-bottom: 8rpx;
  139. }
  140. .diy-seckillProduct .product-list .product-title {
  141. margin-top: 26rpx;
  142. height: 30rpx;
  143. line-height: 30rpx;
  144. display: -webkit-box;
  145. overflow: hidden;
  146. -webkit-line-clamp: 1;
  147. -webkit-box-orient: vertical;
  148. font-size: 30rpx;
  149. }
  150. .diy-seckillProduct .column__3 .product-list .product-title {
  151. font-size: 28rpx;
  152. }
  153. .diy-seckillProduct .column__3 .product-list {
  154. display: flex;
  155. flex-wrap: nowrap;
  156. justify-content: flex-start;
  157. }
  158. .diy-seckillProduct .column__3 .product-item {
  159. width: 240rpx;
  160. margin-right: 20rpx;
  161. border-radius: 12rpx;
  162. overflow: hidden;
  163. background: #ffffff;
  164. margin-top:20rpx;
  165. margin-bottom: 20rpx;
  166. }
  167. .diy-seckillProduct .column__3 .product-cover {
  168. width: 240rpx;
  169. height: 240rpx;
  170. margin: 0 auto;
  171. }
  172. .diy-assembleproduct .product-list {
  173. flex-wrap: nowrap;
  174. }
  175. </style>