datalist.vue 1.6 KB

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