lhl 3 anni fa
parent
commit
7c3883974c
3 ha cambiato i file con 55 aggiunte e 16 eliminazioni
  1. 9 0
      api/user.js
  2. 45 16
      pages/user/myfans.vue
  3. 1 0
      pages/user/myjj.vue

+ 9 - 0
api/user.js

@@ -99,6 +99,15 @@ export function delcollect(data) {
 		method: 'post',
 		data
 	});
+}
+
+// 获取我的粉丝
+export function getMyfans(data) {
+	return request({
+		url: '/api/auction/lower',
+		method: 'get',
+		data
+	});
 }
 
 

+ 45 - 16
pages/user/myfans.vue

@@ -4,7 +4,7 @@
 		<view class="fans-base flex">
 			<view class="base-item">
 				<view class="base-item-val">
-					0
+					{{fans.count || 0}}
 				</view>
 				<view class="base-item-name">
 					我的粉丝
@@ -13,7 +13,7 @@
 			<view class="jg"></view>
 			<view class="base-item">
 				<view class="base-item-val">
-					0
+					{{fans.active || 0}}
 				</view>
 				<view class="base-item-name">
 					活跃粉丝
@@ -22,7 +22,7 @@
 			<view class="jg"></view>
 			<view class="base-item">
 				<view class="base-item-val">
-					0
+					{{fans.money || 0}}
 				</view>
 				<view class="base-item-name">
 					总成交额
@@ -36,9 +36,9 @@
 			<view class="list-item">
 				ID
 			</view>
-			<view class="list-item">
+			<!-- <view class="list-item">
 				粉丝
-			</view>
+			</view> -->
 			<view class="list-item">
 				当日业绩
 			</view>
@@ -46,33 +46,42 @@
 				粉丝数
 			</view>
 		</view>
-		<scroll-view scroll-y="true" class="swiper-box" :style="{'height':height}">
+		<scroll-view scroll-y="true" class="swiper-box" :style="{'height':height}" @scrolltolower="getMyfans()">
 			<view class="fans-list-val flex" v-for="(item,index) in list" :style="{'background':index%2 ==0 ? '#F9F9F9':'#fff'}">
-				<view class="list-item">
-					李丹丹
+				<view class="list-item clamp">
+					{{item.nickname}}
 				</view>
-				<view class="list-item">
+				<!-- <view class="list-item">
 					粉丝
-				</view>
+				</view> -->
 				<view class="list-item">
-					200
+					{{item.money}}
 				</view>
 				<view class="list-item">
-					300
+					{{item.count}}
 				</view>
 			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
 		</scroll-view>
 	</view>
 </template>
 
 <script>
+	import { getMyfans } from '@/api/user.js'
 	export default {
 		data() {
 			return {
 				height: '',
-				list: [1,2,3,4,5,6,7,8,9,10]
+				list: [],
+				page: 1,
+				limit: 10,
+				fans: {},
+				loadingType: 'more'
 			}
 		},
+		onLoad() {
+			this.getMyfans()
+		},
 		onReady(res) {
 			var _this = this;
 			uni.getSystemInfo({
@@ -89,7 +98,27 @@
 			});
 		},
 		methods: {
-			
+			getMyfans() {
+				let obj = this
+				if(obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
+					return
+				}
+				
+				getMyfans({
+					page: obj.page,
+					limit: obj.limit
+				}).then(res => {
+					console.log(res)
+					obj.fans = res.data
+					obj.list = obj.list.concat(res.data.user)
+					obj.page++
+					if(res.data.user.length == obj.limit) {
+						obj.loadingType = 'more'
+					}else {
+						obj.loadingType = 'noMore'
+					}
+				})
+			}
 		}
 		
 	}
@@ -155,7 +184,7 @@
 		font-weight: bold;
 		color: #375AFE;
 		.list-item {
-			width: 25%;
+			width: 33%;
 			flex-shrink: 0;
 		}
 	}
@@ -170,7 +199,7 @@
 		color: #0C1732;
 		.list-item {
 			// flex-grow: 1;
-			width: 25%;
+			width: 33%;
 			flex-shrink: 0;
 		}
 	}

+ 1 - 0
pages/user/myjj.vue

@@ -104,6 +104,7 @@
 			// 导航栏点击
 			navClick(index) {
 				this.jjIndex = index
+				this.loadData('nav')
 			},
 			// swiper 切换
 			swiperChange(e) {