邀请好友列表增加触底加载

This commit is contained in:
2024-12-28 18:59:20 +08:00
parent 0801eed870
commit 47bd309729

View File

@@ -99,7 +99,7 @@
<view class="margin u-m-t-40 u-m-b-32 padding bg-white radius-16">
<view class="u-font-32 color-333 font-bold u-text-center">已邀请列表</view>
<view v-if="inviterList.length" class="u-m-t-20">
<view class="flex justify-between" style="line-height: 80rpx;" v-for="(item, index) in inviterList"
<view class="flex justify-between u-m-b-20" style="line-height: 80rpx;" v-for="(item, index) in inviterList"
:key='index'>
<view class="flex">
<!-- <u-image :src="item.avatar == null?avatar:item.avatar" width="40px" mode="widthFix"></u-image> -->
@@ -115,7 +115,9 @@
<!-- <view class="u-p-t-30 u-p-b-30 empty" v-if="hasAjax&&!inviterList.length">
<my-empty ></my-empty>
</view> -->
</view>
<view class="u-p-b-32">
<u-loadmore v-if="hasAjax" :status="comStatus" />
</view>
<!-- <view class="padding" style="position: relative;height: 250rpx;">
@@ -172,6 +174,7 @@
},
data() {
return {
loading:false,
earning: {
inviteMoney: 0,
inviteGoldMoney: 0,
@@ -200,6 +203,7 @@
},
page: 1,
limit: 10,
isEnd:false,
inviterName: '', //邀请码
cumulativeRevenue: '', //累计收益
inviterNumber: '', //邀请人数
@@ -214,9 +218,21 @@
h5SaveImg: '',
modalName: '',
haibaoImgH5: '',
inviteSignCount:0,
qdCode: '', //渠道码
}
},
computed:{
comStatus(){
if(this.isEnd){
return 'nomore'
}
if(this.loading){
return 'loading'
}
return 'loadmore'
}
},
onShareAppMessage(res) {
return {
path: '/pages/index/index?invitation=' + this.invitationCode + '&qdCode=' + this
@@ -262,6 +278,13 @@
this.getTouTiao()
// #endif
},
onReachBottom() {
if(this.isEnd||this.loading){
return
}
this.page+=1
this.getInviter()
},
methods: {
toGold(){
uni.navigateTo({
@@ -436,14 +459,18 @@
this.erweimapath = path;
},
getInviter() {
let data = {
page: this.page,
limit: this.limit
}
this.loading=true;
this.$u.api.inviter(data).then(res => {
this.loading=false;
if (res.code == 0) {
this.inviterList = res.data.list
this.inviterList =this.inviterList.concat(res.data.list)
this.hasAjax = true;
this.isEnd=this.page>=res.data.totalPage?true:false;
} else {
uni.showToast({
title: res.msg,