recommend.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="recommend">
  3. <view class="title">
  4. <image src="@/static/img/recommend.png" mode=""></image>
  5. </view>
  6. <view class="list">
  7. <view class="item" v-for="d in data">
  8. <view class="img">
  9. <image :src="d.image" mode=""></image>
  10. </view>
  11. <view class="name nowarp">
  12. {{ d.store_name }}
  13. </view>
  14. <view class="about">
  15. </view>
  16. <view class="allprice">
  17. <text class="price">¥{{ d.price }}</text>
  18. <text class="ot-price">¥{{ d.ot_price }}</text>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="load">
  23. ---------{{ loadingType == 'loadmore'?'加载中': '加载完成'}}---------
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. props: ['data'],
  30. data() {
  31. return {
  32. page: 1,
  33. limit: 10,
  34. sum: 0,
  35. loadingType: 'loadmore',
  36. }
  37. },
  38. mounted() {
  39. },
  40. methods: {
  41. }
  42. }
  43. </script>
  44. <style lang="scss">
  45. $grey: #95A0B1;
  46. $text: #333333;
  47. $red: #FF4C4C;
  48. .recommend {
  49. background-color: #fff;
  50. padding: 30rpx;
  51. .title {
  52. text-align: center;
  53. image {
  54. width: 350rpx;
  55. height: 30rpx;
  56. }
  57. }
  58. .list {
  59. padding: 20rpx 0;
  60. display: flex;
  61. justify-content: space-between;
  62. flex-wrap: wrap;
  63. .item {
  64. // background-color: #fff;
  65. border-radius: 10rpx;
  66. overflow: hidden;
  67. box-shadow: 2rpx 2rpx 10rpx #e1e1e1;
  68. margin: 10rpx 0;
  69. width: 48%;
  70. height: 0;
  71. padding-bottom: calc(48% + 120rpx);
  72. .img {
  73. border-radius: 10rpx;
  74. overflow: hidden;
  75. width: 100%;
  76. height: 0;
  77. padding-bottom: 100%;
  78. image {
  79. width: 100%;
  80. height: 100%;
  81. }
  82. }
  83. .name {
  84. margin: 0 10rpx;
  85. font-size: 30rpx;
  86. font-weight: bold;
  87. }
  88. .allprice {
  89. padding: 20rpx 0;
  90. .price {
  91. color: $red;
  92. }
  93. .ot-price {
  94. color: $grey;
  95. text-decoration: line-through;
  96. font-size: 26rpx;
  97. }
  98. }
  99. }
  100. }
  101. .load {
  102. text-align: center;
  103. color: $grey;
  104. font-size: 28rpx;
  105. }
  106. }
  107. </style>