myfans.vue 4.5 KB

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