datalist.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="dataList">
  3. <view class="list" v-if="data.length > 0">
  4. <view class="item" v-for="d in data" @click="navto('/pages/product/product?id=' + d.id + '&is_integral=' + d.is_integral + '&is_gold=' + d.is_gold)">
  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*1-d.max_integral*1).toFixed(2) }}</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="load">
  19. ---------{{ data.loadingType == 'loadmore'?'加载中': '加载完成'}}---------
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. props: ['data'],
  26. methods: {
  27. navto(url){
  28. uni.navigateTo({
  29. url
  30. })
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. $grey: #95A0B1;
  37. $text: #333333;
  38. $red: #FF4C4C;
  39. .dataList {
  40. .list {
  41. padding: 20rpx;
  42. display: flex;
  43. justify-content: space-between;
  44. flex-wrap: wrap;
  45. .item {
  46. background-color: #fff;
  47. border-radius: 10rpx;
  48. overflow: hidden;
  49. // box-shadow: 2rpx 2rpx 10rpx #e1e1e1;
  50. margin: 10rpx 0;
  51. width: 48%;
  52. height: 0;
  53. padding-bottom: calc(48% + 120rpx);
  54. .img {
  55. border-radius: 10rpx;
  56. overflow: hidden;
  57. width: 100%;
  58. height: 344rpx;
  59. image {
  60. width: 100%;
  61. height: 100%;
  62. }
  63. }
  64. .name {
  65. margin: 0 10rpx;
  66. font-size: 30rpx;
  67. font-weight: bold;
  68. }
  69. .allprice {
  70. padding: 20rpx 0;
  71. .price {
  72. color: $red;
  73. }
  74. .ot-price {
  75. color: $grey;
  76. text-decoration: line-through;
  77. font-size: 26rpx;
  78. }
  79. }
  80. }
  81. }
  82. .load {
  83. text-align: center;
  84. color: $grey;
  85. font-size: 28rpx;
  86. }
  87. }
  88. </style>