storeList.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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" @click="navTo('/pages/store/storeDetail')">
  6. <image src="" mode="" class="store-img"></image>
  7. <view class="store-info">
  8. <view class="store-name clamp">鑫旺零售台州店鑫旺零售台州店鑫旺零售台州店</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. navTo(url) {
  70. uni.navigateTo({
  71. url: url
  72. })
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .store-list {
  79. padding-top: 20rpx;
  80. }
  81. .store {
  82. margin: 0 auto 20rpx;
  83. width: 710rpx;
  84. height: 210rpx;
  85. background: #ffffff;
  86. box-shadow: 0px 0px 10rpx 0px rgba(0, 0, 0, 0.1);
  87. border-radius: 10rpx;
  88. padding: 19rpx 25rpx 11rpx 20rpx;
  89. justify-content: flex-start;
  90. .store-img {
  91. flex-shrink: 0;
  92. width: 180rpx;
  93. height: 180rpx;
  94. border-radius: 10rpx;
  95. background-color: red;
  96. }
  97. .store-info {
  98. width: 100%;
  99. height: 100%;
  100. padding-left: 19rpx;
  101. position: relative;
  102. .store-name {
  103. max-width: 400rpx;
  104. font-size: 30rpx;
  105. font-family: PingFang SC;
  106. font-weight: bold;
  107. color: #333333;
  108. }
  109. .store-detail {
  110. padding-top: 10rpx;
  111. font-size: 22rpx;
  112. font-family: PingFang SC;
  113. font-weight: 500;
  114. color: #666666;
  115. }
  116. .store-tip {
  117. width: 66rpx;
  118. height: 40rpx;
  119. background: linear-gradient(120deg, #ffc063, #ffa163);
  120. border-radius: 8rpx;
  121. position: absolute;
  122. right: 0;
  123. top: 0;
  124. font-size: 24rpx;
  125. font-family: PingFang SC;
  126. font-weight: 500;
  127. color: #ffffff;
  128. line-height: 40rpx;
  129. text-align: center;
  130. }
  131. .store-des {
  132. // width: 400rpx;
  133. position: absolute;
  134. bottom: 0;
  135. font-size: 24rpx;
  136. font-family: PingFang SC;
  137. font-weight: 500;
  138. color: #999999;
  139. height: 35rpx;
  140. image {
  141. margin-right: 8rpx;
  142. width: 17rpx;
  143. height: 24rpx;
  144. background-color: red;
  145. }
  146. }
  147. }
  148. }
  149. </style>