invitation-list.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="invitation-list">
  3. <view class="header-bg"></view>
  4. <view class="header">
  5. <view class="title">
  6. 粉丝
  7. </view>
  8. </view>
  9. <view class="list">
  10. <template v-for="item in subordinates">
  11. <view class="list-item">
  12. <view class="l">
  13. <image class="image" src="/static/img/logo.08771339.png" mode="scaleToFill"></image>
  14. </view>
  15. <view class="c">
  16. <view class="nickname">
  17. 昵称:{{item.nickname}}
  18. </view>
  19. <view>
  20. <text v-show="item.group_id===3" class="wddz">网店店主</text>
  21. <text v-show="item.group_id===2" class="zgcj">直供厂家</text>
  22. </view>
  23. <view class="phone" style="height: 10upx;">
  24. </view>
  25. <view class="time">加入时间:2021-02-20 20:10:11</view>
  26. </view>
  27. </view>
  28. </template>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. subordinates: [],
  37. page: 1,
  38. pageLoading: false
  39. }
  40. },
  41. onLoad() {
  42. this.getSubordinates();
  43. },
  44. onPageScroll(e) {
  45. const query = uni.createSelectorQuery();
  46. query.select("#order").boundingClientRect(data => {
  47. if (e.scrollTop > data.height - uni.getSystemInfoSync().windowHeight * 2 &&
  48. (this.page - 1) * 10 < this.subordinates.length) {
  49. this.getSubordinates();
  50. }
  51. }).exec();
  52. },
  53. methods: {
  54. getSubordinates() {
  55. if (!this.pageLoading) {
  56. console.log("加载下一页");
  57. this.pageLoading = true;
  58. this.$http.get({
  59. url: "/user/subordinates",
  60. data: {
  61. limit: 10,
  62. page: this.page
  63. },
  64. success: (res) => {
  65. this.subordinates = [...this.subordinates, ...res.data.data.rows]
  66. this.page++;
  67. this.pageLoading = false;
  68. }
  69. })
  70. }
  71. },
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .invitation-list {
  77. position: relative;
  78. overflow: hidden;
  79. }
  80. .header-bg {
  81. background: $primary-color;
  82. height: 100upx;
  83. position: absolute;
  84. top: 0;
  85. width: 100%;
  86. z-index: 1;
  87. }
  88. .header {
  89. margin: 20upx;
  90. background: white;
  91. text-align: center;
  92. border-radius: 20upx;
  93. position: relative;
  94. z-index: 2;
  95. .title {
  96. height: 100upx;
  97. font-size: 32upx;
  98. line-height: 100upx;
  99. // font-weight: bold;
  100. }
  101. }
  102. .list {
  103. .list-item {
  104. padding: 20upx;
  105. margin: 20upx;
  106. background: white;
  107. display: flex;
  108. // font-family: "Roboto";
  109. border-radius: 10upx;
  110. .l {
  111. height: 100upx;
  112. .image {
  113. background: #E0E0E0;
  114. width: 100upx;
  115. height: 100upx;
  116. border-radius: 50upx;
  117. }
  118. }
  119. .c {
  120. margin-left: 20upx;
  121. .nickname,
  122. .phone {
  123. font-size: 24upx;
  124. color: #666666;
  125. }
  126. .time {
  127. font-size: 24upx;
  128. color: #999999;
  129. }
  130. }
  131. .r {
  132. margin-left: auto;
  133. font-size: 36upx;
  134. }
  135. }
  136. }
  137. .wddz,
  138. .zgcj {
  139. font-size: 24upx;
  140. color: rgb(255, 93, 91);
  141. border: 2upx solid rgb(255, 93, 91);
  142. border-radius: 20upx;
  143. width: 140upx;
  144. height: 36upx;
  145. line-height: 36upx;
  146. text-align: center;
  147. // text-indent: 20upx;
  148. display: inline-block;
  149. padding: 0;
  150. background: url(../../static/images/do.png) no-repeat;
  151. background-size: 21upx 21upx;
  152. background-position: 10upx;
  153. }
  154. </style>