7 changed files with 109 additions and 102 deletions
@ -1,81 +0,0 @@ |
|||
<template> |
|||
<view class="container"> |
|||
<uni-list border-full v-for="(item,index) in inviteLogList" :key="index"> |
|||
<uni-list-item :title="item.invitedScanCode" :note="item.createTime" :thumb="item.img" thumb-size="lg" /> |
|||
</uni-list> |
|||
<view class="ivOver" v-if="flag">-----已经到底啦-----</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getInviteLog |
|||
} from '@/api/userInfo.js' |
|||
export default { |
|||
data() { |
|||
return { |
|||
inviteLogList: [], |
|||
pageSize: 10, |
|||
pageNum: 1, |
|||
userInfo: {}, |
|||
flag: false |
|||
} |
|||
}, |
|||
created() { |
|||
const userInfoSync = uni.getStorageSync('userInfo') |
|||
this.userInfo = userInfoSync |
|||
this.getInviteLog(); |
|||
}, |
|||
// 下拉刷新 |
|||
onPullDownRefresh() { |
|||
this.pageNum = 1 |
|||
this.inviteLogList = [] |
|||
this.getInviteLog(); |
|||
uni.stopPullDownRefresh() |
|||
}, |
|||
// 上划加载更多 |
|||
onReachBottom() { |
|||
if (this.inviteLogList.length > this.pageSize*this.pageNum-1) { |
|||
this.flag = false; |
|||
this.pageNum += 1 |
|||
this.getInviteLog(); |
|||
}else{ |
|||
this.flag = true; |
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
// 获取邀请记录 |
|||
async getInviteLog() { |
|||
const res = await getInviteLog({ |
|||
pageSize: this.pageSize, |
|||
pageNum: this.pageNum, |
|||
creatorId: this.userInfo.id |
|||
}) |
|||
console.log('res', res) |
|||
if (res.data.code === 200) { |
|||
this.inviteLogList.push(...res.data.rows) |
|||
console.log('inviteLogList', this.inviteLogList) |
|||
} else { |
|||
uni.showModal({ |
|||
content: '邀请记录加载失败!', |
|||
showCancel: false |
|||
}); |
|||
} |
|||
}, |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.ivOver{ |
|||
width: 100%; |
|||
height:100rpx; |
|||
line-height: 100rpx; |
|||
text-align: center; |
|||
background: #fff; |
|||
font-size: 20rpx; |
|||
} |
|||
|
|||
|
|||
</style> |
|||
Loading…
Reference in new issue