vipDetail.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="content">
  3. <view class="background">
  4. <image src="../../static/merchant/vipbackground.png" mode=""></image>
  5. <view class="title">
  6. {{ number }}
  7. <text class="ren">人</text>
  8. </view>
  9. </view>
  10. <scroll-view scroll-y="true" class="scroll-wrapper" :style="{ height: height }">
  11. <!-- 空白页 -->
  12. <!-- <empty v-if=" loaded && vipList.length == 0"></empty> -->
  13. <view class="vip-wrapper">
  14. <view class="vip" v-for="item in vipList">
  15. <view class="img"><image :src="item.avatar" mode=""></image></view>
  16. <view class="vip-content">
  17. <view class="left">
  18. <view class="top">
  19. <view class="name">{{ item.nickname }}</view>
  20. <view class="nameplate"></view>
  21. </view>
  22. <view class="bottom">{{ item.phone }}</view>
  23. </view>
  24. <view class="right">消费:¥{{ item.consume_sum }}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <uni-load-more :status="loadingType"></uni-load-more>
  29. </scroll-view>
  30. <!-- <view class="vip-box">
  31. </view> -->
  32. </view>
  33. </template>
  34. <script>
  35. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  36. import empty from '@/components/empty';
  37. import { member } from '@/api/merchant.js'
  38. export default {
  39. components: {
  40. empty,
  41. uniLoadMore
  42. },
  43. data() {
  44. return {
  45. loadingType: 'more',
  46. page: 1,
  47. limit: 10,
  48. height: '',
  49. number: 0, //人数
  50. vipList: []
  51. };
  52. },
  53. onReady(res) {
  54. var _this = this;
  55. uni.getSystemInfo({
  56. success: resu => {
  57. const query = uni.createSelectorQuery();
  58. query.select('.scroll-wrapper').boundingClientRect();
  59. query.exec(function(res) {
  60. console.log(res, 'ddddddddddddd');
  61. _this.height = resu.windowHeight - res[0].top + 'px';
  62. console.log('打印页面的剩余高度', _this.height);
  63. });
  64. },
  65. fail: res => {}
  66. });
  67. },
  68. onLoad() {
  69. this.loadData();
  70. },
  71. methods: {
  72. loadData() {
  73. let obj = this;
  74. console.log('加载数据');
  75. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  76. return;
  77. }
  78. obj.loadingType = 'loading'
  79. member({}).then(({data}) =>{
  80. console.log(data)
  81. this.number = data.count
  82. this.vipList = this.vipList.concat(data.data)
  83. obj.page ++
  84. if (data.data.length == obj.limit) {
  85. obj.loadingType = 'more';
  86. } else {
  87. obj.loadingType = 'noMore';
  88. }
  89. })
  90. }
  91. }
  92. };
  93. </script>
  94. <style lang="scss">
  95. .background {
  96. display: flex;
  97. justify-content: center;
  98. position: relative;
  99. width: 100%;
  100. height: 360rpx;
  101. image {
  102. width: 100%;
  103. height: 100%;
  104. }
  105. }
  106. .title {
  107. position: absolute;
  108. text-align: center;
  109. line-height: 360rpx;
  110. font-size: 72rpx;
  111. font-family: PingFang SC;
  112. font-weight: bold;
  113. color: #ffffff;
  114. .ren {
  115. font-size: 36rpx;
  116. font-family: PingFang SC;
  117. font-weight: bold;
  118. color: #ffffff;
  119. line-height: 43rpx;
  120. }
  121. }
  122. .scroll-wrapper {
  123. margin-top: 20rpx;
  124. }
  125. .vip-wrapper {
  126. padding: 0 26rpx 0 23rpx;
  127. background-color: #fff;
  128. }
  129. .vip {
  130. border-top: 1rpx solid #e3e3e3;
  131. display: flex;
  132. align-items: center;
  133. .img {
  134. margin: 0 20rpx;
  135. width: 80rpx;
  136. height: 80rpx;
  137. border-radius: 50%;
  138. image {
  139. border-radius: 50%;
  140. width: 100%;
  141. height: 100%;
  142. }
  143. }
  144. .vip-content {
  145. margin: 30rpx 0;
  146. display: flex;
  147. justify-content: space-between;
  148. width: 580rpx;
  149. display: flex;
  150. align-items: center;
  151. .left {
  152. display: flex;
  153. flex-direction: column;
  154. .top {
  155. display: flex;
  156. .name {
  157. font-size: 30rpx;
  158. font-family: PingFangSC;
  159. font-weight: 500;
  160. color: #3f454b;
  161. }
  162. .nameplate {
  163. }
  164. }
  165. .bottom {
  166. font-size: 22rpx;
  167. font-family: PingFang SC;
  168. font-weight: 400;
  169. color: #999999;
  170. }
  171. }
  172. .right {
  173. font-size: 30rpx;
  174. font-family: PingFang SC;
  175. font-weight: bold;
  176. color: #ff6f0f;
  177. }
  178. }
  179. }
  180. </style>