<template>
	<view class="all">
		<view class="row flex">
			<view class="rowItem">
				<view class="shu">{{total || 0}}</view>
				<view class="wenben">{{$t('huiyuan.a1')}}</view>
			</view>
			<view class="rowItem">
				<view class="shu">{{group_num || 0}}</view>
				<view class="wenben">{{$t('huiyuan.a2')}}</view>
			</view>
		
		</view>
		<view class="row flex margin-t-20">
			<view class="rowItem">
				<view class="shu">{{totalLevel || 0}}</view>
				<view class="wenben">{{$t('huiyuan.a3')}}</view>
			</view>
			<view class="rowItem">
				<view class="shu">{{valid_user || 0}}</view>
				<view class="wenben">{{$t('huiyuan.a4')}}</view>
			</view>
		</view>

		<view class="list margin-t-20 margin-c-30" v-for="(item, ind) in list" :key="ind">
			<view class="top flex">
				<view class="nc clamp">{{item.nickname}}</view>
				<image class="img margin-l-20" src="/static/shouye/huiyuan.png" mode=""></image>
			</view>
			<navigator :url="`/pages/user/vip/details?id=${item.uid}`">
			<view class="center padding-v-30 flex" >
				<view class="sj">{{item.time}}</view>
				<view class="flex-start">
					<view class="xq margin-r-10">{{$t('huiyuan.a5')}}</view>
					<image class="ima" src="/static/icon/jt.png" mode="scaleToFill"></image>
				</view>
			</view>
			</navigator>
			<view class="last flex padding-t-30">
				<view>
					<text class="left">{{$t('huiyuan.a6')}}：</text>
					<text class="leftT">{{item.join_usdt}}</text>
				</view>
				<view>
					<text class="right">{{$t('huiyuan.a7')}}：</text>
					<text class="rightT">{{item.childCount}}</text>
				</view>
			</view>
		</view>
		<view class="bto">

		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	import {
		spread,
		getUserInfo
	} from "@/api/user.js"
	export default {
		data() {
			return {
				page: 1,
				limit: 10,
				loadingType: 'more',
				loaded: false,
				list: [],
				group_num: '', //团队人数
				total: '', // 用户总数
				totalLevel: '', // 账户总数
				valid_user: '', // 有效账户
			};
		},
		onLoad(option) {
			this.spread()

			uni.setNavigationBarTitle({
				title: this.$t("tab.b1"),
			});
		},

		computed: {
			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
		},
		onReachBottom() {
			this.spread()
		},
		methods: {
			// 会员记录
			spread() {
				let that = this
				if (that.loadingType == 'loading' || that.loadingType == 'noMore') {
					return
				}
				that.loadingType = "loading";
				spread({
					page: that.page,
					limit: that.limit,
					// id: that.userInfo.uid,
// <<<<<<< HEAD
				// }).then(res => {
				// 	let data = res.data
				// 	console.log('1111111', data);
				// 	this.group_num = data.group_num
				// 	this.total = data.total
				// 	this.totalLevel = data.totalLevel
				// 	this.valid_user = data.valid_user
					
				// 	this.list = res.data.list
				// 	console.log('list', this.list);
				// }).catch(e=>{
// =======
				}).then(({
					data
				}) => {
					let list = data.list
					that.list = that.list.concat(list)
					that.group_num = data.group_num
					that.total = data.total
					that.totalLevel = data.totalLevel
					that.valid_user = data.valid_user

					if (list.length == that.limit) {
						that.loadingType = 'more'
					} else {
						that.loadingType = 'noMore'
					}
					that.loaded = true
				}).catch(e => {
// >>>>>>> ec643268e144bb15fc39a442eec94ca3d04a70ac
					console.log(e);
				})
			},
		}
	};
</script>

<style lang="scss">
	.all {
		width: 750rpx;
		background-color: $page-color-base;
		line-height: 1;
	}

	.row {
		padding: 0 30rpx;

		.rowItem {
			background: #191A1F;
			border-radius: 10rpx;
			width: 48%;
			text-align: center;
			padding: 40rpx 0;

			.wenben {
				font-size: 28rpx;
				font-weight: 500;
				color: #FFFFFF;
			}

			.shu {
				font-size: 46rpx;
				font-weight: bold;
				color: #FEB041;
			}
		}
	}

	.list {
		background: #191A1F;
		border-radius: 16rpx;
		padding: 30rpx;

		.top {
			.nc {
				font-size: $font-lg;
				font-weight: bold;
				color: #FFFFFF;
				flex-grow: 1;
			}

			.img {
				flex-shrink: 0;
				width: 100rpx;
				height: 32rpx;
			}
		}

		.center {
			border-bottom: 1px solid rgba(255, 255, 255, 0.3);

			.ima {
				width: 13rpx;
				height: 19rpx;
			}
		}

		.center,
		.last {
			font-weight: 500;
			font-size: $font-base;
			color: #999999;
		}

		.last {
			.leftT {
				color: #b98134;
			}

			.rightT {
				color: #ffffff;
			}
		}
	}
</style>