storeList.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="store-list">
  3. <scroll-view scroll-y="true" class="list" @scrolltolower="loadData()">
  4. <empty v-if="loaded && list.length == 0"></empty>
  5. <view class="store flex" v-for="item in list">
  6. <image src="" mode="" class="store-img"></image>
  7. <view class="store-info">
  8. <view class="store-name">鑫旺零售台州店</view>
  9. <view class="store-detail">台州市椒江区市府大道120号</view>
  10. <view class="store-tip">门店</view>
  11. <view class="store-des">
  12. <image src="" mode=""></image>
  13. 距离 15KM
  14. </view>
  15. </view>
  16. </view>
  17. <uni-load-more :status="loadingType" v-if="list !=0"></uni-load-more>
  18. </scroll-view>
  19. </view>
  20. </template>
  21. <script>
  22. import empty from '@/components/empty';
  23. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  24. export default {
  25. components: {
  26. uniLoadMore,
  27. empty
  28. },
  29. data() {
  30. return {
  31. list: [1,2,3],
  32. storeList: [],
  33. loadingType: 'more',
  34. page: 1,
  35. limit: 10,
  36. height: '',//滚动区域高度
  37. loaded: false,
  38. }
  39. },
  40. onReady(res) {
  41. var _this = this;
  42. uni.getSystemInfo({
  43. success: resu => {
  44. const query = uni.createSelectorQuery();
  45. query.select('.list').boundingClientRect();
  46. query.exec(function(res) {
  47. console.log(res, 'ddddddddddddd');
  48. _this.height = resu.windowHeight - res[0].top + 'px';
  49. console.log('打印页面的剩余高度', _this.height);
  50. });
  51. },
  52. fail: res => {}
  53. });
  54. },
  55. onLoad() {
  56. this.loadData()
  57. },
  58. methods: {
  59. //获取门店list
  60. loadData() {
  61. let obj = this
  62. if(obj.loadingType == 'loading') {
  63. return
  64. }
  65. if(obj.loadingType == 'noMore') {
  66. return
  67. }
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .store-list {
  74. padding-top: 20rpx;
  75. }
  76. .store {
  77. margin: 0 auto 20rpx;
  78. width: 710rpx;
  79. height: 210rpx;
  80. background: #ffffff;
  81. box-shadow: 0px 0px 10rpx 0px rgba(0, 0, 0, 0.1);
  82. border-radius: 10rpx;
  83. padding: 19rpx 25rpx 11rpx 20rpx;
  84. justify-content: flex-start;
  85. .store-img {
  86. flex-shrink: 0;
  87. width: 180rpx;
  88. height: 180rpx;
  89. border-radius: 10rpx;
  90. background-color: red;
  91. }
  92. .store-info {
  93. width: 100%;
  94. height: 100%;
  95. padding-left: 19rpx;
  96. position: relative;
  97. .store-name {
  98. font-size: 30rpx;
  99. font-family: PingFang SC;
  100. font-weight: bold;
  101. color: #333333;
  102. }
  103. .store-detail {
  104. padding-top: 10rpx;
  105. font-size: 22rpx;
  106. font-family: PingFang SC;
  107. font-weight: 500;
  108. color: #666666;
  109. }
  110. .store-tip {
  111. width: 66rpx;
  112. height: 40rpx;
  113. background: linear-gradient(120deg, #ffc063, #ffa163);
  114. border-radius: 8rpx;
  115. position: absolute;
  116. right: 0;
  117. top: 0;
  118. font-size: 24rpx;
  119. font-family: PingFang SC;
  120. font-weight: 500;
  121. color: #ffffff;
  122. line-height: 40rpx;
  123. text-align: center;
  124. }
  125. .store-des {
  126. // width: 400rpx;
  127. position: absolute;
  128. bottom: 0;
  129. font-size: 24rpx;
  130. font-family: PingFang SC;
  131. font-weight: 500;
  132. color: #999999;
  133. height: 35rpx;
  134. image {
  135. margin-right: 8rpx;
  136. width: 17rpx;
  137. height: 24rpx;
  138. background-color: red;
  139. }
  140. }
  141. }
  142. }
  143. </style>