|
|
|
|
<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:50px;
|
|
|
|
|
line-height: 50px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
background: #fff;
|
|
|
|
|
font-size: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
.container {
|
|
|
|
|
.top {
|
|
|
|
|
width: 100vw;
|
|
|
|
|
|
|
|
|
|
image {
|
|
|
|
|
width: 100vw;
|
|
|
|
|
height: 400rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.uni-searchbar {
|
|
|
|
|
border: 1px solid #11A8FD;
|
|
|
|
|
margin: 0 40rpx;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
|
|
.uni-searchbar__box {
|
|
|
|
|
padding: 0;
|
|
|
|
|
border-radius: 16rpx !important;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
>text {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
display: block;
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding-top: 40rpx;
|
|
|
|
|
padding-bottom: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-list {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
align-items: center;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
|
|
|
|
|
.user-list-box {
|
|
|
|
|
width: 140rpx;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
|
|
image {
|
|
|
|
|
width: 100rpx;
|
|
|
|
|
height: 100rpx;
|
|
|
|
|
border-radius: 100rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
text {
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
color: #1E1E1E;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.middle {
|
|
|
|
|
text-align: center;
|
|
|
|
|
height: calc(100vh - 248rpx);
|
|
|
|
|
padding-top: 40rpx;
|
|
|
|
|
|
|
|
|
|
text {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
image {
|
|
|
|
|
width: 40rpx;
|
|
|
|
|
height: 40rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|