product-item.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view :class="type==='swiper'?'product-swiper-item':'product-list-item'" class="product-item">
  3. <image class="image" :src="image" mode="scaleToFill"></image>
  4. <view class="row row-1">
  5. <text class="title"><text class="sxzg-icon">省心直供</text>{{title}}</text>
  6. </view>
  7. <view class="row row-2">
  8. <text class="org-price">¥{{orgPrice}}</text>
  9. <text class="sales">月销15.8万</text>
  10. </view>
  11. <view class="row row-3">
  12. <text class="sxj-icon">省心价</text>
  13. <text class="price">¥{{price}}</text>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. };
  22. },
  23. props: {
  24. title: {
  25. type: String,
  26. default: "【工厂直营】加厚款手提垃圾袋加厚款手提垃圾袋加厚款手提垃圾袋加厚款手提垃圾袋*50支"
  27. },
  28. image: {
  29. type: String,
  30. default: ""
  31. },
  32. type: {
  33. type: String,
  34. default: "list"
  35. },
  36. sales: {
  37. type: [String, Number],
  38. default: 0
  39. },
  40. orgPrice: {
  41. type: [String, Number],
  42. default: 0
  43. },
  44. price: {
  45. type: [String, Number],
  46. default: 0
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss">
  52. .product-item {
  53. overflow: hidden;
  54. border-radius: 18rpx;
  55. background: white;
  56. box-shadow: 0 0 10rpx #EEEEEE;
  57. padding-bottom: 10upx;
  58. display: inline-block;
  59. }
  60. .product-list-item {
  61. width: 350rpx;
  62. .image {
  63. width: 350rpx;
  64. height: 300rpx;
  65. }
  66. }
  67. .product-swiper-item {
  68. width: 288rpx;
  69. // height: 268rpx;
  70. .image {
  71. width: 288rpx;
  72. height: 288rpx;
  73. }
  74. }
  75. .sxzg-icon {
  76. color: $primary-color;
  77. font-size: 16rpx;
  78. width: 80rpx;
  79. text-align: center;
  80. line-height: normal;
  81. border: 2rpx solid $primary-color;
  82. border-radius: 20rpx;
  83. display: inline-block;
  84. position: relative;
  85. top: -4rpx;
  86. margin-right: 10upx;
  87. // transform: scale(0.9);
  88. }
  89. .title {
  90. font-size: 24rpx;
  91. display: inline-block;
  92. white-space:normal;
  93. display: -webkit-box;
  94. -webkit-box-orient: vertical;
  95. -webkit-line-clamp: 2;
  96. overflow: hidden;
  97. }
  98. .row {
  99. padding: 0 10upx;
  100. }
  101. .row-2 {
  102. display: flex;
  103. justify-content: space-between;
  104. }
  105. .org-price,
  106. .sales {
  107. font-size: 22rpx;
  108. color: #cccccc;
  109. }
  110. .org-price{
  111. text-decoration: line-through;
  112. }
  113. .sxj-icon {
  114. background: $primary-color;
  115. color: white;
  116. font-size: 20upx;
  117. padding: 0 5upx;
  118. border-radius: 5upx;
  119. vertical-align: middle;
  120. }
  121. .price {
  122. font-size: 24rpx;
  123. color: $primary-color;
  124. font-weight: bold;
  125. }
  126. </style>