|
|
@ -4,7 +4,7 @@ |
|
|
<view class="tab-item" |
|
|
<view class="tab-item" |
|
|
:class="current==index?'text-orange':'text-black1'" |
|
|
:class="current==index?'text-orange':'text-black1'" |
|
|
v-for="(item, index) in tab_list" :key="index" |
|
|
v-for="(item, index) in tab_list" :key="index" |
|
|
@click="current = index">{{ item.name }} |
|
|
|
|
|
|
|
|
@click="changeTab(index)">{{ item.name }} |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
@ -17,11 +17,11 @@ |
|
|
v-if="tabIndex == current"> |
|
|
v-if="tabIndex == current"> |
|
|
<view class="flex lf-p-30 solid-bottom" v-for="(item, index) in tabItem.list" :key="index"> |
|
|
<view class="flex lf-p-30 solid-bottom" v-for="(item, index) in tabItem.list" :key="index"> |
|
|
<view> |
|
|
<view> |
|
|
<image src="../../static/center/shop-logo.png" style="height: 120rpx;width: 120rpx;" mode="aspectFill"></image> |
|
|
|
|
|
|
|
|
<image :src="item.avatar" style="height: 120rpx;width: 120rpx;" mode="aspectFill"></image> |
|
|
</view> |
|
|
</view> |
|
|
<view class="flex flex-direction justify-around lf-p-l-20"> |
|
|
<view class="flex flex-direction justify-around lf-p-l-20"> |
|
|
<view class="lf-font-32 text-black1">时空网的内部网友 <text class="bg-red lf-font-24 lf-m-l-10" style="border-radius: 30rpx;padding: 5rpx 16rpx;">达人</text></view> |
|
|
|
|
|
<view class="lf-font-24 lf-color-gray">2021-7-6 21:32:53</view> |
|
|
|
|
|
|
|
|
<view class="lf-font-32 text-black1">{{item.username}} <text class="bg-red lf-font-24 lf-m-l-10" style="border-radius: 30rpx;padding: 5rpx 16rpx;">{{item.state}}</text></view> |
|
|
|
|
|
<view class="lf-font-24 lf-color-gray">{{item.created_at}}</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
@ -44,14 +44,14 @@ |
|
|
windowHeight: 0, |
|
|
windowHeight: 0, |
|
|
tab_list: [{ |
|
|
tab_list: [{ |
|
|
name: '内部粉丝', |
|
|
name: '内部粉丝', |
|
|
list: [1], |
|
|
|
|
|
|
|
|
list: [], |
|
|
page: 1, |
|
|
page: 1, |
|
|
isPage: false, |
|
|
isPage: false, |
|
|
loadingClass: false, |
|
|
loadingClass: false, |
|
|
loadingText: '已加载全部数据' |
|
|
loadingText: '已加载全部数据' |
|
|
},{ |
|
|
},{ |
|
|
name: '外部粉丝', |
|
|
name: '外部粉丝', |
|
|
list: [1,2,3,4,5,6,7,8,9], |
|
|
|
|
|
|
|
|
list: [], |
|
|
page: 1, |
|
|
page: 1, |
|
|
isPage: false, |
|
|
isPage: false, |
|
|
loadingClass: true, |
|
|
loadingClass: true, |
|
|
@ -61,19 +61,52 @@ |
|
|
}, |
|
|
}, |
|
|
onLoad(){ |
|
|
onLoad(){ |
|
|
this.windowHeight = uni.getSystemInfoSync().windowHeight; |
|
|
this.windowHeight = uni.getSystemInfoSync().windowHeight; |
|
|
|
|
|
this.getInFans() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
changeTab(index) { |
|
|
|
|
|
if(this.current == index) { |
|
|
|
|
|
return |
|
|
|
|
|
}else { |
|
|
|
|
|
this.current = index |
|
|
|
|
|
this.getInFans() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
getInFans() { |
|
|
|
|
|
let per_page = this.pageSize; |
|
|
|
|
|
let tab_item = this.tab_list[this.current]; |
|
|
|
|
|
let fansType = this.current+1 |
|
|
|
|
|
this.$http(this.API.API_FANS, { |
|
|
|
|
|
page: tab_item.page, |
|
|
|
|
|
limit: per_page, |
|
|
|
|
|
type: fansType |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
this.isRefresher = false; |
|
|
|
|
|
let isPage = res.data.has_more_page; |
|
|
|
|
|
tab_item.isPage = isPage; |
|
|
|
|
|
if(!isPage){ |
|
|
|
|
|
tab_item.loadingClass = false; |
|
|
|
|
|
tab_item.loadingText = '没有更多数据啦~'; |
|
|
|
|
|
} |
|
|
|
|
|
if(tab_item.page == 1){ |
|
|
|
|
|
tab_item.list = res.data.items; |
|
|
|
|
|
}else{ |
|
|
|
|
|
tab_item.list.push(...res.data.items); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
// 页面触底,加载下一页 |
|
|
// 页面触底,加载下一页 |
|
|
onScrolltolower(){ |
|
|
onScrolltolower(){ |
|
|
console.log('加载下一页') |
|
|
|
|
|
|
|
|
let tab_item = this.tab_list[this.current]; |
|
|
|
|
|
if(tab_item.isPage){ |
|
|
|
|
|
tab_item.page = tab_item.page + 1; |
|
|
|
|
|
this.getInFans() |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
// scroll-view 下拉刷新 |
|
|
// scroll-view 下拉刷新 |
|
|
onRefresherrefresh(){ |
|
|
onRefresherrefresh(){ |
|
|
this.isRefresher = true; |
|
|
this.isRefresher = true; |
|
|
console.log('下拉刷新') |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.isRefresher = false; |
|
|
|
|
|
},1000) |
|
|
|
|
|
|
|
|
this.getInFans() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|