construction.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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 clamp">鑫旺零售台州店鑫旺零售台州店鑫旺零售台州店鑫旺零售台州店鑫旺零售台州店</view>
  9. <!-- <view class="store-detail">台州市椒江区市府大道120号</view> -->
  10. <view class="info clamp">鑫旺零售台州店鑫旺零售台州店</view>
  11. <view class="price-box">
  12. <view class="new-price">
  13. ¥160.00
  14. <text class="old-price"> ¥220.00</text>
  15. </view>
  16. </view>
  17. <view class="qb-btn">立即购买</view>
  18. </view>
  19. </view>
  20. <uni-load-more :status="loadingType" v-if="list != 0"></uni-load-more>
  21. </scroll-view>
  22. </view>
  23. </template>
  24. <script>
  25. import empty from '@/components/empty';
  26. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  27. export default {
  28. components: {
  29. uniLoadMore,
  30. empty
  31. },
  32. data() {
  33. return {
  34. list: [1, 2, 3],
  35. storeList: [],
  36. loadingType: 'more',
  37. page: 1,
  38. limit: 10,
  39. height: '', //滚动区域高度
  40. loaded: false
  41. };
  42. },
  43. onReady(res) {
  44. var _this = this;
  45. uni.getSystemInfo({
  46. success: resu => {
  47. const query = uni.createSelectorQuery();
  48. query.select('.list').boundingClientRect();
  49. query.exec(function(res) {
  50. console.log(res, 'ddddddddddddd');
  51. _this.height = resu.windowHeight - res[0].top + 'px';
  52. console.log('打印页面的剩余高度', _this.height);
  53. });
  54. },
  55. fail: res => {}
  56. });
  57. },
  58. onLoad() {
  59. this.loadData();
  60. },
  61. methods: {
  62. //获取门店list
  63. loadData() {
  64. let obj = this;
  65. if (obj.loadingType == 'loading') {
  66. return;
  67. }
  68. if (obj.loadingType == 'noMore') {
  69. return;
  70. }
  71. }
  72. }
  73. };
  74. </script>
  75. <style lang="scss" scoped>
  76. .store-list {
  77. padding-top: 20rpx;
  78. }
  79. .store {
  80. margin: 0 auto 20rpx;
  81. // width: 710rpx;
  82. // height: 210rpx;
  83. // background: #ffffff;
  84. // box-shadow: 0px 0px 10rpx 0px rgba(0, 0, 0, 0.1);
  85. // border-radius: 10rpx;
  86. padding: 40rpx 20rpx;
  87. justify-content: flex-start;
  88. width: 710rpx;
  89. height: 280rpx;
  90. background: #ffffff;
  91. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  92. border-radius: 8rpx;
  93. .store-img {
  94. flex-shrink: 0;
  95. background-color: red;
  96. width: 190rpx;
  97. height: 200rpx;
  98. border-radius: 10rpx;
  99. }
  100. .store-info {
  101. width: 481rpx;
  102. height: 100%;
  103. padding-left: 19rpx;
  104. position: relative;
  105. .store-name {
  106. width: 461rpx;
  107. padding-top: 10rpx;
  108. font-size: 30rpx;
  109. font-family: PingFang SC;
  110. font-weight: bold;
  111. color: #333333;
  112. }
  113. .store-detail {
  114. padding-top: 10rpx;
  115. font-size: 22rpx;
  116. font-family: PingFang SC;
  117. font-weight: 500;
  118. color: #666666;
  119. }
  120. .info {
  121. padding-top: 20rpx;
  122. font-size: 24rpx;
  123. font-family: PingFang SC;
  124. font-weight: 500;
  125. color: #FE6A42;
  126. }
  127. .qb-btn {
  128. width: 160rpx;
  129. height: 60rpx;
  130. line-height: 60rpx;
  131. line-height: 60rpx;
  132. text-align: center;
  133. background: linear-gradient(180deg, #fd4646, #ff3535);
  134. box-shadow: 0px 2rpx 20rpx 0px rgba(253, 67, 67, 0.5);
  135. border-radius: 30rpx;
  136. position: absolute;
  137. right: 0;
  138. bottom: 0;
  139. font-size: 28rpx;
  140. font-family: PingFang SC;
  141. font-weight: 500;
  142. color: #ffffff;
  143. text-align: center;
  144. }
  145. .price-box {
  146. padding-left: 20rpx;
  147. display: flex;
  148. align-items: flex-end;
  149. height: 42rpx;
  150. position: absolute;
  151. left: 0;
  152. bottom: 0;
  153. .new-price {
  154. font-size: 32rpx;
  155. font-family: PingFang SC;
  156. font-weight: bold;
  157. color: #ff0000;
  158. .old-price {
  159. display: inline-block;
  160. padding-left: 8rpx;
  161. font-size: 20rpx;
  162. font-family: PingFang SC;
  163. font-weight: 500;
  164. text-decoration: line-through;
  165. color: #999999;
  166. }
  167. }
  168. }
  169. }
  170. }
  171. </style>