shopGoods.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="body">
  3. <view class="card" v-for="(item, index) in setMealList" :key="index" @tap="routerTo(item)">
  4. <image :src="'https://biaodianfuhao.oss-cn-beijing.aliyuncs.com/'+item.imgUrl"></image>
  5. <view class="title">
  6. {{item.name}}
  7. </view>
  8. <view class="content">
  9. {{item.title}}
  10. </view>
  11. <view class="bottomView">
  12. <view class="priceView">
  13. <view class="unit">
  14. </view>
  15. <view class="price">
  16. {{item.carPrice}}-{{item.truckPrice}}
  17. </view>
  18. </view>
  19. <view class="dprice">
  20. 已售:{{item.buyNum || 0}}
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. components: {},
  29. data() {
  30. return {};
  31. },
  32. props: {
  33. setMealList: {
  34. type: Array,
  35. default: function() {
  36. return {};
  37. }
  38. },
  39. },
  40. methods: {
  41. // 路由跳转
  42. routerTo(item) {
  43. this.$yrouter.push({
  44. path: "/pages/maintenance/setMeal/setMealDetail/index?item=" + JSON.stringify(item)
  45. });
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="less">
  51. .body {
  52. display: flex;
  53. flex-wrap: wrap;
  54. justify-content: space-between;
  55. margin-top: 30rpx;
  56. // padding-bottom: 30rpx;
  57. padding: 0 2rpx 30rpx;
  58. .card {
  59. width: 338rpx;
  60. height: 532rpx;
  61. background: #FFFFFF;
  62. border: 1px solid #E5E5E5;
  63. box-shadow: 0px 0px 14rpx 0px rgba(125, 125, 125, 0.13);
  64. border-radius: 10rpx;
  65. margin-top: 26rpx;
  66. position: relative;
  67. image {
  68. width: 338rpx;
  69. height: 338rpx;
  70. box-shadow: 0px 0px 14rpx 0px rgba(125, 125, 125, 0.13);
  71. border-radius: 10rpx;
  72. }
  73. .title {
  74. height: 27rpx;
  75. font-size: 28rpx;
  76. font-family: PingFang SC;
  77. font-weight: bold;
  78. color: #333333;
  79. line-height: 39rpx;
  80. padding: 24rpx 0 0 20rpx;
  81. }
  82. .content {
  83. font-size: 22rpx;
  84. font-family: PingFang SC;
  85. font-weight: 500;
  86. color: #666666;
  87. line-height: 28rpx;
  88. padding: 16rpx 20rpx 0 20rpx;
  89. overflow: hidden;
  90. text-overflow: ellipsis;
  91. display: -webkit-box;
  92. -webkit-line-clamp: 2;
  93. line-clamp: 2;
  94. -webkit-box-orient: vertical;
  95. }
  96. .bottomView {
  97. width: calc(100% - 34rpx);
  98. display: flex;
  99. align-items: center;
  100. justify-content: space-between;
  101. padding: 0rpx 17rpx 0 17rpx;
  102. position: absolute;
  103. bottom: 10rpx;
  104. .priceView {
  105. display: flex;
  106. align-items: baseline;
  107. .unit {
  108. font-size: 20rpx;
  109. font-family: PingFang SC;
  110. font-weight: bold;
  111. color: #FF3C00;
  112. }
  113. .price {
  114. font-size: 32rpx;
  115. font-family: PingFang SC;
  116. font-weight: bold;
  117. color: #FF3C00;
  118. }
  119. }
  120. .dprice {
  121. font-size: 24rpx;
  122. font-family: PingFang SC;
  123. font-weight: 500;
  124. color: #999999;
  125. }
  126. }
  127. }
  128. }
  129. </style>