assembleProduct.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view class="diy-assembleproduct" v-if="itemData.data.product_list.length>0">
  3. <view class="diy-head d-b-c" :style="'background-image: url('+itemData.style.background_image+');'">
  4. <view class="right" @click="gotoList">
  5. <text class="f26 gray9">更多</text>
  6. <text class="iconfont icon-jiantou"></text>
  7. </view>
  8. </view>
  9. <view class="diy-body">
  10. <scroll-view scroll-x="true">
  11. <view class="product-list column__3">
  12. <view class="product-item" v-for="(item, index) in itemData.data.product_list" :key="index" @click="gotoDetail(item)">
  13. <!-- 两列三列 -->
  14. <template>
  15. <view class="product-cover pr">
  16. <image :src="item.product.file_path" mode="aspectFit"></image>
  17. <view class="assemble-num"><text>{{ item.assemble_num }}人团</text></view>
  18. </view>
  19. <view class="product-info p-0-10">
  20. <view class="product-title" v-if="itemData.style.show.productName === true">{{ item.product.product_name }}</view>
  21. <view class="product-price" v-if="itemData.style.show.assemblePrice == true">
  22. <text class="red f20">¥</text>
  23. <text class="red fb f32">{{ item.assemble_price }}</text>
  24. <text class="ml10 gray9 text-d-line f20" v-if="itemData.style.show.linePrice == true">¥</text>
  25. <text class="gray9 f24 text-d-line" v-if="itemData.style.show.linePrice == true">{{ item.product_price }}</text>
  26. </view>
  27. </view>
  28. <view class="assemble_btn">去开团</view>
  29. </template>
  30. </view>
  31. </view>
  32. </scroll-view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. components: {},
  39. data() {
  40. return {};
  41. },
  42. props: ['itemData'],
  43. created() {
  44. console.log(this.$props.itemData)
  45. },
  46. methods: {
  47. scroll(e) {},
  48. /*跳转列表*/
  49. gotoList() {
  50. let url = '/pages/plus/assemble/list/list';
  51. this.gotoPage(url);
  52. },
  53. /*跳转产品详情*/
  54. gotoDetail(e) {
  55. let url = '/pages/plus/assemble/detail/detail?assemble_product_id=' + e.assemble_product_id;
  56. this.gotoPage(url);
  57. }
  58. }
  59. };
  60. </script>
  61. <style lang="scss">
  62. .diy-assembleproduct {
  63. margin: 20rpx;
  64. border-radius: 20rpx;
  65. padding: 0 20rpx 20rpx;
  66. background: #FFFFFF;
  67. }
  68. .diy-assembleproduct .diy-head {
  69. height: 90rpx;
  70. display: flex;
  71. justify-content: flex-end;
  72. align-items: center;background-size: 100% 100%;
  73. }
  74. .diy-assembleproduct .diy-head .name {
  75. font-size: 32rpx;
  76. font-weight: bold;
  77. }
  78. .diy-assembleproduct .diy-head .datetime {
  79. margin-left: 40rpx;
  80. }
  81. .diy-assembleproduct .diy-head .datetime::v-deep>span {
  82. display: inline-block;
  83. }
  84. .diy-assembleproduct .diy-head .datetime::v-deep text {
  85. font-size: 24rpx;
  86. color: #F6220C;
  87. }
  88. .diy-assembleproduct .diy-head .datetime::v-deep .box {
  89. padding: 4rpx;
  90. font-size: 22rpx;
  91. background: #F6220C;
  92. color: #F6220C;
  93. }
  94. .diy-assembleproduct .diy-head .icon-jiantou {
  95. margin-left: 8rpx;
  96. color: #999999;
  97. font-size: 22rpx;
  98. }
  99. .diy-assembleproduct .product-list {
  100. flex-wrap: nowrap;
  101. }
  102. .diy-assembleproduct .product-list .product-item {
  103. flex-shrink: 0;
  104. border-radius: 12rpx;
  105. width: 245rpx;
  106. overflow: hidden;
  107. }
  108. .diy-assembleproduct .product-list image {
  109. width: 100%;
  110. height: 100%;
  111. background-color: #f6f6f6;
  112. }
  113. .diy-assembleproduct .product-list .product-title {
  114. margin: 0 auto;
  115. margin-top: 32rpx;
  116. width: 80%;
  117. height: 30rpx;
  118. display: -webkit-box;
  119. overflow: hidden;
  120. -webkit-line-clamp: 1;
  121. -webkit-box-orient: vertical;
  122. font-size: 30rpx;
  123. }
  124. .diy-assembleproduct .product-list .product-price {
  125. margin: 0 auto;
  126. margin-top: 16rpx;
  127. margin-bottom: 24rpx;
  128. width: 80%;
  129. // line-height: 24rpx;
  130. display: -webkit-box;
  131. overflow: hidden;
  132. -webkit-line-clamp: 1;
  133. -webkit-box-orient: vertical;
  134. text-align: left;
  135. }
  136. .diy-assembleproduct .product-list.column__3 .product-title {
  137. height: 30rpx;
  138. line-height: 30rpx;
  139. font-size: 30rpx;
  140. }
  141. .diy-assembleproduct .product-list.column__2,
  142. .diy-assembleproduct .product-list.column__3 {
  143. display: flex;
  144. justify-content: flex-start;
  145. align-items: center;
  146. }
  147. .diy-assembleproduct .product-list .assemble-num {
  148. padding: 0rpx 16rpx;
  149. font-size: 24rpx;
  150. color: #ffffff;
  151. position: absolute;
  152. bottom: -2rpx;
  153. left:0;
  154. background-color: #fd5456;
  155. border-top-right-radius: 12rpx;
  156. height: 33rpx;
  157. line-height: 33rpx;
  158. }
  159. .diy-assembleproduct .column__3 .product-item {
  160. width: 245rpx;
  161. margin-right: 20rpx;
  162. }
  163. .diy-assembleproduct .column__3 .product-cover {
  164. width: 244rpx;
  165. height: 226rpx;
  166. margin: 0 auto;
  167. border-radius: 12rpx;
  168. overflow: hidden;
  169. }
  170. .diy-assembleproduct .column__3 .assemble_btn {
  171. background: #fe3c30;
  172. width: 202rpx;
  173. height: 46rpx;
  174. line-height: 46rpx;
  175. font-size: 22rpx;
  176. text-align: center;
  177. color: #FFFFFF;
  178. margin: 0 auto;
  179. border-radius: 24rpx;
  180. }
  181. </style>