珠宝小程序前端代码
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.

132 lines
2.4 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
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"
  4. v-for="(item, index) in list"
  5. @click="$utils.navigateTo('/pages_order/product/productDetail?id=' + item.id)"
  6. :key="index">
  7. <image
  8. class="image"
  9. :src="item.image &&
  10. item.image.split(',')[0]" mode=""></image>
  11. <view class="info">
  12. <view class="title">
  13. {{ item.title }}
  14. </view>
  15. <view style="display: flex;align-items: flex-end;">
  16. <view class="price">
  17. <text>{{ item.price }}</text>/
  18. </view>
  19. <view class="oldPrice">
  20. <text>{{ item.oldPrice }}</text>/
  21. </view>
  22. </view>
  23. <!-- <view class="favorable">
  24. <view class="t">
  25. 限时优惠
  26. </view>
  27. <view class="p">
  28. 48
  29. </view>
  30. </view> -->
  31. <view class="num">
  32. 已售卖5000+
  33. </view>
  34. </view>
  35. <view class="btn">
  36. 购买
  37. <!-- <uv-icon name="shopping-cart"
  38. color="#fff"></uv-icon> -->
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. name:"productList",
  46. props : {
  47. list : {
  48. default : []
  49. },
  50. },
  51. data() {
  52. return {
  53. };
  54. },
  55. methods : {
  56. },
  57. }
  58. </script>
  59. <style scoped lang="scss">
  60. .list{
  61. display: flex;
  62. flex-wrap: wrap;
  63. .item{
  64. position: relative;
  65. width: 300rpx;
  66. padding: 20rpx;
  67. // padding-bottom: 50rpx;
  68. background-color: #fff;
  69. border-radius: 20rpx;
  70. margin-top: 20rpx;
  71. &:nth-child(odd){
  72. margin-right: 20rpx;
  73. }
  74. .image{
  75. width: 300rpx;
  76. height: 250rpx;
  77. border-radius: 20rpx;
  78. }
  79. .info{
  80. font-size: 24rpx;
  81. .title{
  82. font-size: 28rpx;
  83. overflow:hidden; //超出的文本隐藏
  84. text-overflow:ellipsis; //溢出用省略号显示
  85. white-space:nowrap; //溢出不换行
  86. }
  87. .price{
  88. color: $uni-color;
  89. margin-top: 6rpx;
  90. text{
  91. font-size: 30rpx;
  92. font-weight: 900;
  93. }
  94. }
  95. .oldPrice{
  96. color: #888;
  97. text-decoration: line-through;
  98. }
  99. .favorable{
  100. display: flex;
  101. background-image: url(/static/image/product/favorable.png);
  102. background-size: 100% 100%;
  103. width: fit-content;
  104. padding: 5rpx 10rpx;
  105. font-size: 18rpx;
  106. margin-top: 6rpx;
  107. .p{
  108. color: #fff;
  109. margin-left: 10rpx;
  110. }
  111. }
  112. .num{
  113. margin-top: 6rpx;
  114. font-size: 22rpx;
  115. color: #888;
  116. }
  117. }
  118. .btn{
  119. padding: 10rpx 20rpx;
  120. border-radius: 10rpx;
  121. font-size: 24rpx;
  122. color: #fff;
  123. margin-left: auto;
  124. width: fit-content;
  125. background-color: $uni-color;
  126. }
  127. }
  128. }
  129. </style>