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.

91 lines
1.6 KiB

10 months ago
  1. <template>
  2. <view class="productFlashSales">
  3. <u-scroll-list class="productList">
  4. <view class="produce-item"
  5. v-for="(item,index) in list"
  6. :key="index"
  7. @click="goProduct(item)"
  8. >
  9. <view class="">
  10. <image
  11. mode="aspectFill"
  12. :src="item.image ? item.image.split(',')[0] : ''"
  13. alt="" class="img"/>
  14. </view>
  15. <view class="title">
  16. {{ item.title }}
  17. </view>
  18. <view>
  19. <text class="price">{{ item.price }}</text>
  20. <text class="oldPrice" v-if="item.oldPrice">{{ item.oldPrice }}</text>
  21. </view>
  22. </view>
  23. </u-scroll-list>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. name:"productFlashSales",
  29. props : {
  30. list : {
  31. default : [],
  32. }
  33. },
  34. data() {
  35. return {
  36. };
  37. },
  38. methods : {
  39. goProduct(e){
  40. uni.navigateTo({
  41. url: '/pages/productDetail/productDetail?id=' + e.id
  42. });
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. .productFlashSales{
  49. display: flex;
  50. flex-wrap: wrap;
  51. ::v-deep .u-scroll-list__indicator {
  52. display: none !important;
  53. }
  54. .productList{
  55. width: 100%;
  56. .produce-item{
  57. flex-shrink: 0;
  58. width: 33%;
  59. box-sizing: border-box;
  60. background-color: #fff;
  61. padding: 10px;
  62. .img{
  63. width: 100%;
  64. height: 220rpx;
  65. }
  66. .title{
  67. font-size: 23rpx;
  68. line-height: 2em;
  69. text-overflow: ellipsis;
  70. display: -webkit-box;
  71. -webkit-box-orient: vertical;
  72. -webkit-line-clamp: 1;
  73. overflow: hidden;
  74. }
  75. .price{
  76. font-size: 29rpx;
  77. padding-right: 8px;
  78. color: #E01717;
  79. }
  80. .oldPrice{
  81. font-size: 20rpx;
  82. text-decoration: line-through;
  83. color: #B8B8B8;
  84. }
  85. }
  86. }
  87. }
  88. </style>