index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="discounts">
  3. <view class="title">
  4. <text>搭配购</text>
  5. <span class="iconfont icon-xiangyou"></span>
  6. </view>
  7. <view class="discounts-list">
  8. <view class="discounts-box" v-for="item in discountsData" :key="item.id">
  9. <image class="discounts-img" :src="item.image" mode=""></image>
  10. <view class="discounts-msg">
  11. <text class="discounts-title line1">{{item.title}}</text>
  12. <view class="discounts-attr">
  13. <text class="line2" v-for="(attr,index) in item.products" :key="index">
  14. <text v-if="index > 0">+</text>
  15. <text>
  16. {{attr.title.substring(0,5)}}
  17. </text>
  18. </text>
  19. </view>
  20. <text class="discounts-kc">库存:{{item.is_limit ? item.limit_num : '充足'}}</text>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. }
  31. },
  32. props: {
  33. discountsData: {
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .discounts {
  40. background-color: #fff;
  41. .title {
  42. display: flex;
  43. justify-content: space-between;
  44. border-bottom: 1px solid #EEEEEE;
  45. padding: 24rpx 30rpx;
  46. margin-top: 20rpx;
  47. color: #333;
  48. .iconfont {
  49. font-size: 14px;
  50. color: #7a7a7a;
  51. }
  52. }
  53. .discounts-list {
  54. display: flex;
  55. align-items: center;
  56. width: 100%;
  57. overflow-x: scroll;
  58. .discounts-box {
  59. display: flex;
  60. align-items: center;
  61. padding: 24rpx;
  62. .discounts-img {
  63. width: 180rpx;
  64. height: 180rpx;
  65. border-radius: 8rpx;
  66. margin-right: 24rpx;
  67. }
  68. .discounts-msg {
  69. display: flex;
  70. flex-direction: column;
  71. justify-content: space-around;
  72. color: #333333;
  73. height: 164rpx;
  74. .discounts-title {
  75. font-size: 28rpx;
  76. font-weight: bold;
  77. width: 150px;
  78. span{
  79. width: 100%;
  80. }
  81. }
  82. .discounts-attr {
  83. display: flex;
  84. flex-wrap: wrap;
  85. width: 300rpx;
  86. max-height: 2rem;
  87. font-size: 20rpx;
  88. overflow: hidden;
  89. }
  90. .discounts-kc {
  91. color: var(--view-theme);
  92. font-size: 20rpx;
  93. }
  94. }
  95. }
  96. }
  97. }
  98. </style>