<template>
	<view class="content">
		<empty v-if="loaded === true && list.length === 0"></empty>
		<view class="flex tab">
			<view class="td">
				消费人
			</view>
			<view class="td">
				消费额度
			</view>
			<view class="td">
				是否结算
			</view>
		</view>
		<view class="flex tab tab-1" v-for="item in list">
			<view class="td clamp">
				{{item.nickname}}
			</view>
			<view class="td clamp">
				{{item.pay_price}}
			</view>
			<view class="td clamp">
				{{item.is_participate == 0 ? '未结算': '已结算'}}
			</view>
		</view>
		<uni-load-more :status="loadingType"></uni-load-more>
	</view>
</template>

<script>
	import {
		myspread,
		myteam,
		getPushList
	} from '@/api/user.js';
	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
	import empty from '@/components/empty';
	export default {
		components: {
			empty,
			uniLoadMore
		},
		data() {
			return {
				list: [],
				page: 1,
				limit: 100,
				loaded: false,
				loadingType: 'more'
			}
		},
		onLoad() {
			this.getPushList()
		},
		onShow() {

		},
		onReachBottom() {
			this.getPushList()
		},
		onReady() {

		},
		methods: {
			getPushList() {
				let that = this
				if (that.loadingType == 'loading' || that.loadingType == 'noMore') {
					return
				}
				that.loadingType = 'loading'
				getPushList({
					page: that.page,
					limit: that.limit
				}).then(res => {
					// console.log(res)
					that.list = that.list.concat(res.data.data)
					if (that.limit == res.data.data.length) {
						that.loadingType = 'more'
					} else {
						that.loadingType = 'noMore'
					}
					this.loaded = true
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		height: auto;
		min-height: 100%;
		background-color: #fff;
	}
.tab {
	width: 100%;
	height: 100rpx;
	text-align: center;
	font-size: 32rpx;
	border-bottom: 1px solid #eee;
	.td {
		text-align: center;
		width: 33.3%;
	}
}
.tab-1 {
	height: 50rpx;
}
</style>
