敢为人鲜小程序前端代码仓库
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.

129 lines
2.3 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <template>
  2. <view class="list">
  3. <view class="item" v-for="(item, index) in list"
  4. @click="$utils.navigateTo('/pages_order/product/productDetail?id=' + item.id)" :key="index">
  5. <image class="image" :src="item.image &&
  6. item.image.split(',')[0]" mode="aspectFill"></image>
  7. <view class="product-info">
  8. <view class="product-title">
  9. {{ item.title }}
  10. </view>
  11. <view class="product-main">
  12. <view class="sale-information">
  13. <view style="display: flex;align-items: flex-end;">
  14. <view class="price">
  15. <text>{{ item.price }}</text>/
  16. </view>
  17. <view class="oldPrice">
  18. <text>{{ item.oldPrice }}</text>/
  19. </view>
  20. </view>
  21. <view class="num">
  22. 已售卖5000+
  23. </view>
  24. </view>
  25. <view class="btn">
  26. 购买
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. name: "productList",
  36. props: {
  37. list: {
  38. default: []
  39. },
  40. },
  41. data() {
  42. return {
  43. };
  44. },
  45. methods: {
  46. },
  47. }
  48. </script>
  49. <style scoped lang="scss">
  50. .list {
  51. display: flex;
  52. flex-wrap: wrap;
  53. .item {
  54. position: relative;
  55. width: 345rpx;
  56. padding: 20rpx;
  57. box-sizing: border-box;
  58. background-color: #fff;
  59. border-radius: 20rpx;
  60. margin-left: 20rpx;
  61. .image {
  62. width: 300rpx;
  63. height: 250rpx;
  64. border-radius: 20rpx;
  65. }
  66. .product-info {
  67. font-size: 24rpx;
  68. .product-title {}
  69. .product-main {
  70. display: flex;
  71. .sale-information {
  72. width: 75%;
  73. .title {
  74. font-size: 28rpx;
  75. overflow: hidden; //超出的文本隐藏
  76. text-overflow: ellipsis; //溢出用省略号显示
  77. white-space: nowrap; //溢出不换行
  78. }
  79. .price {
  80. color: $uni-color;
  81. margin-top: 6rpx;
  82. text {
  83. font-size: 30rpx;
  84. font-weight: 900;
  85. }
  86. }
  87. .oldPrice {
  88. color: #888;
  89. text-decoration: line-through;
  90. }
  91. .num {
  92. margin-top: 6rpx;
  93. font-size: 22rpx;
  94. color: #888;
  95. }
  96. }
  97. .btn {
  98. display: flex;
  99. align-items: center;
  100. justify-content: center;
  101. border-radius: 10rpx;
  102. font-size: 24rpx;
  103. height: 60rpx;
  104. width: 25%;
  105. color: #fff;
  106. background-color: $uni-color;
  107. }
  108. }
  109. }
  110. }
  111. }
  112. </style>