bargainProduct.vue 4.5 KB

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