myfans.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view class="content">
  3. <view class="top-fan"></view>
  4. <view class="fans-base flex">
  5. <view class="base-item">
  6. <view class="base-item-val">
  7. {{fans.count || 0}}
  8. </view>
  9. <view class="base-item-name">
  10. 我的粉丝
  11. </view>
  12. </view>
  13. <view class="jg"></view>
  14. <view class="base-item">
  15. <view class="base-item-val">
  16. {{fans.active || 0}}
  17. </view>
  18. <view class="base-item-name">
  19. 活跃粉丝
  20. </view>
  21. </view>
  22. <view class="jg"></view>
  23. <view class="base-item">
  24. <view class="base-item-val">
  25. {{fans.money || 0}}
  26. </view>
  27. <view class="base-item-name">
  28. 总成交额
  29. </view>
  30. </view>
  31. </view>
  32. <view class="fans-tit">
  33. 我的粉丝列表
  34. </view>
  35. <view class="fans-list-tit flex">
  36. <view class="list-item">
  37. ID
  38. </view>
  39. <!-- <view class="list-item">
  40. 粉丝
  41. </view> -->
  42. <view class="list-item">
  43. 当日业绩
  44. </view>
  45. <view class="list-item">
  46. 粉丝数
  47. </view>
  48. </view>
  49. <scroll-view scroll-y="true" class="swiper-box" :style="{'height':height}" @scrolltolower="getMyfans()">
  50. <view class="fans-list-val flex" v-for="(item,index) in list" :style="{'background':index%2 ==0 ? '#F9F9F9':'#fff'}">
  51. <view class="list-item clamp">
  52. {{item.nickname}}
  53. </view>
  54. <!-- <view class="list-item">
  55. 粉丝
  56. </view> -->
  57. <view class="list-item">
  58. {{item.money}}
  59. </view>
  60. <view class="list-item">
  61. {{item.count}}
  62. </view>
  63. </view>
  64. <uni-load-more :status="loadingType"></uni-load-more>
  65. </scroll-view>
  66. </view>
  67. </template>
  68. <script>
  69. import { getMyfans } from '@/api/user.js'
  70. export default {
  71. data() {
  72. return {
  73. height: '',
  74. list: [],
  75. page: 1,
  76. limit: 10,
  77. fans: {},
  78. loadingType: 'more'
  79. }
  80. },
  81. onLoad() {
  82. this.getMyfans()
  83. },
  84. onReady(res) {
  85. var _this = this;
  86. uni.getSystemInfo({
  87. success: resu => {
  88. const query = uni.createSelectorQuery();
  89. query.select('.swiper-box').boundingClientRect();
  90. query.exec(function(res) {
  91. console.log(res, 'ddddddddddddd');
  92. _this.height = resu.windowHeight - res[0].top + 'px';
  93. console.log('打印页面的剩余高度', _this.height);
  94. });
  95. },
  96. fail: res => {}
  97. });
  98. },
  99. methods: {
  100. getMyfans() {
  101. let obj = this
  102. if(obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
  103. return
  104. }
  105. getMyfans({
  106. page: obj.page,
  107. limit: obj.limit
  108. }).then(res => {
  109. console.log(res)
  110. obj.fans = res.data
  111. obj.list = obj.list.concat(res.data.user)
  112. obj.page++
  113. if(res.data.user.length == obj.limit) {
  114. obj.loadingType = 'more'
  115. }else {
  116. obj.loadingType = 'noMore'
  117. }
  118. })
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. page {
  125. background-color: #f3f5f4;
  126. height: 100%;
  127. }
  128. .content {
  129. background-color: #f3f5f4;
  130. }
  131. .top-fan {
  132. width: 750rpx;
  133. height: 336rpx;
  134. background: linear-gradient(-41deg, rgba(60, 237, 237, 0.99), #04B8FF, #375AFE);
  135. border-radius: 0 0 40rpx 40rpx;
  136. }
  137. .fans-base {
  138. width: 702rpx;
  139. height: 210rpx;
  140. background: #FFFFFF;
  141. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  142. border-radius: 20rpx;
  143. margin: -147rpx auto 0;
  144. text-align: center;
  145. font-size: 30rpx;
  146. font-family: PingFang SC;
  147. font-weight: 500;
  148. color: #666666;
  149. .jg {
  150. width: 2rpx;
  151. height: 96rpx;
  152. background: #DCDCDC;
  153. }
  154. .base-item {
  155. flex-grow: 1;
  156. .base-item-val {
  157. font-size: 50rpx;
  158. font-family: PingFang SC;
  159. font-weight: bold;
  160. color: #0C1732;
  161. }
  162. }
  163. }
  164. .fans-tit {
  165. font-size: 32rpx;
  166. font-family: PingFang SC;
  167. font-weight: bold;
  168. color: #0C1732;
  169. padding: 45rpx 0 29rpx 40rpx;
  170. }
  171. .fans-list-tit {
  172. width: 710rpx;
  173. height: 100rpx;
  174. background: #E2EEFF;
  175. border-radius: 20rpx 20rpx 0px 0px;
  176. margin: auto;
  177. text-align: center;;
  178. font-size: 30rpx;
  179. font-family: PingFang SC;
  180. font-weight: bold;
  181. color: #375AFE;
  182. .list-item {
  183. width: 33%;
  184. flex-shrink: 0;
  185. }
  186. }
  187. .fans-list-val {
  188. width: 710rpx;
  189. height: 100rpx;
  190. margin: auto;
  191. text-align: center;;
  192. font-size: 30rpx;
  193. font-family: PingFang SC;
  194. font-weight: bold;
  195. color: #0C1732;
  196. .list-item {
  197. // flex-grow: 1;
  198. width: 33%;
  199. flex-shrink: 0;
  200. }
  201. }
  202. </style>