瑶都万能墙
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.

159 lines
3.1 KiB

3 months ago
  1. <template>
  2. <view class="list">
  3. <view class="item"
  4. v-for="(item, index) in productList"
  5. @click="$utils.navigateTo('/pages_order/product/productDetail?id=' + item.id)"
  6. :key="index">
  7. <image
  8. class="image"
  9. :src="item.image ? item.image.split(',')[0] : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg'" mode="aspectFill"></image>
  10. <view class="info">
  11. <view class="title text-ellipsis">
  12. {{ item.name }}
  13. </view>
  14. <!-- <view class="price">
  15. <text>{{ item.originalPrice }}</text>/
  16. </view>
  17. <view class="favorable" v-if="item.goodsSku">
  18. <view class="t">
  19. 限时优惠
  20. </view>
  21. <view class="p">
  22. {{ item.goodsSku.price }}
  23. </view>
  24. </view> -->
  25. <view class="price"
  26. v-if="isProductPrice(item)">
  27. 现价<text>{{ item.price }}</text>
  28. </view>
  29. <view class="del"
  30. v-if="isProductPrice(item)">
  31. 原价{{ item.oldPrice }}
  32. </view>
  33. <!-- <view class="favorable" v-if="item.oldPrice">
  34. <view class="t">
  35. 原价
  36. </view>
  37. <view class="p">
  38. {{ item.oldPrice }}
  39. </view>
  40. </view> -->
  41. <view class="favorable"
  42. v-if="item.points
  43. && isProductPoint(item)">
  44. <view class="t">
  45. 积分兑换
  46. </view>
  47. <view class="p">
  48. {{ item.points }}
  49. </view>
  50. </view>
  51. <view class="num">
  52. {{ item.shopId }}
  53. </view>
  54. <!-- <view class="num">
  55. 已售卖{{ item.soldNum || 0 }}+
  56. </view> -->
  57. </view>
  58. <view class="btn">
  59. <uv-icon name="shopping-cart"
  60. color="#fff"></uv-icon>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import productMixins from '@/mixins/product.js'
  67. export default {
  68. mixins : [productMixins],
  69. name:"productList",
  70. props : ['productList'],
  71. data() {
  72. return {
  73. };
  74. },
  75. methods : {
  76. },
  77. }
  78. </script>
  79. <style scoped lang="scss">
  80. .list{
  81. display: flex;
  82. flex-wrap: wrap;
  83. .item{
  84. position: relative;
  85. width: 300rpx;
  86. padding: 20rpx;
  87. background-color: #fff;
  88. border-radius: 20rpx;
  89. margin-top: 20rpx;
  90. &:nth-child(odd){
  91. margin-right: 20rpx;
  92. }
  93. .image{
  94. width: 300rpx;
  95. height: 250rpx;
  96. border-radius: 20rpx;
  97. }
  98. .info{
  99. font-size: 26rpx;
  100. .title{
  101. font-size: 28rpx;
  102. }
  103. .price{
  104. color: $uni-price-color;
  105. margin-top: 6rpx;
  106. text{
  107. font-size: 30rpx;
  108. font-weight: 900;
  109. }
  110. }
  111. .del{
  112. font-size: 22rpx;
  113. color: #888;
  114. font-weight: 500;
  115. text-decoration : line-through;
  116. }
  117. .favorable{
  118. display: flex;
  119. // background-image: url(/static/image/product/favorable.png);
  120. background-size: 100% 100%;
  121. width: fit-content;
  122. font-size: 20rpx;
  123. margin-top: 6rpx;
  124. border-radius: 10rpx;
  125. overflow: hidden;
  126. background-color: #ff000011;
  127. .t{
  128. padding: 5rpx 10rpx;
  129. }
  130. .p{
  131. padding: 5rpx 10rpx;
  132. color: #fff;
  133. background-color: #F03F25;
  134. height: 100%;
  135. }
  136. }
  137. .num{
  138. margin-top: 6rpx;
  139. font-size: 22rpx;
  140. color: #888;
  141. }
  142. }
  143. .btn{
  144. position: absolute;
  145. right: 20rpx;
  146. bottom: 20rpx;
  147. padding: 10rpx;
  148. border-radius: 50%;
  149. background-color: $uni-color;
  150. }
  151. }
  152. }
  153. </style>