recommend.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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" @click="navto('/pages/product/product?id=' + d.id)">
  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. navto(url) {
  42. uni.navigateTo({
  43. url: url
  44. })
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss">
  50. $grey: #95A0B1;
  51. $text: #333333;
  52. $red: #FF4C4C;
  53. .recommend {
  54. background-color: #fff;
  55. padding: 30rpx;
  56. .title {
  57. text-align: center;
  58. image {
  59. width: 350rpx;
  60. height: 30rpx;
  61. }
  62. }
  63. .list {
  64. padding: 20rpx 0;
  65. display: flex;
  66. justify-content: space-between;
  67. flex-wrap: wrap;
  68. .item {
  69. // background-color: #fff;
  70. border-radius: 10rpx;
  71. overflow: hidden;
  72. box-shadow: 2rpx 2rpx 10rpx #e1e1e1;
  73. margin: 10rpx 0;
  74. width: 48%;
  75. height: 0;
  76. padding-bottom: calc(48% + 120rpx);
  77. .img {
  78. border-radius: 10rpx;
  79. overflow: hidden;
  80. width: 100%;
  81. height: 344rpx;
  82. image {
  83. width: 100%;
  84. height: 100%;
  85. }
  86. }
  87. .name {
  88. margin: 0 10rpx;
  89. font-size: 30rpx;
  90. font-weight: bold;
  91. }
  92. .allprice {
  93. padding: 20rpx 0;
  94. .price {
  95. color: $red;
  96. }
  97. .ot-price {
  98. color: $grey;
  99. text-decoration: line-through;
  100. font-size: 26rpx;
  101. }
  102. }
  103. }
  104. }
  105. .load {
  106. text-align: center;
  107. color: $grey;
  108. font-size: 28rpx;
  109. }
  110. }
  111. </style>