<template>
	<view class="all">
		<view class="row">
			<view class="row1">
				<view class="shu">{{total || 0}}</view>
				<view class="wenben">{{$t('huiyuan.a1')}}</view>
			</view>
			<view class="row2">
				<view class="shu">{{group_num || 0}}</view>
				<view class="wenben">{{$t('huiyuan.a2')}}</view>
			</view>
		
		</view>
	
	    <view class="rowT">
	    	<view class="row1">
	    		<view class="shu">{{totalLevel || 0}}</view>
	    		<view class="wenben">{{$t('huiyuan.a3')}}</view>
	    	</view>
	    	<view class="row2">
	    		<view class="shu">{{valid_user || 0}}</view>
	    		<view class="wenben">{{$t('huiyuan.a4')}}</view>
	    	</view>
	    </view>
		
		<view class="list" v-for="(item, ind) in list" :key="ind">
			<view class="top">
				<view class="nc">{{item.nickname}}</view>
				<view class="">
					<image class="img" src="/static/shouye/huiyuan.png" mode=""></image>
				</view>
			</view>
			<view class="center"  @click="navX">
				<view class="sj">{{item.time}}</view>
				<view class="xq">{{$t('huiyuan.a5')}}</view>
				<view class="">
					<image class="ima" src="/static/icon/jt.png" mode=""></image>
				</view>
			</view>
			<view class="xian"></view>
			<view class="last">
				<view class="left">{{$t('huiyuan.a6')}}：</view>
				<view class="leftT">{{item.join_usdt}}</view>
				<view class="right">{{$t('huiyuan.a7')}}：</view>
				<view class="rightT">{{item.childCount}}</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 {
				id: '',
				page: 1,
				limit: 10,
				list: [],
				group_num: '',  //团队人数
				total: '',  // 用户总数
				totalLevel: '', // 账户总数
				valid_user: '',  // 有效账户
			};
		},
		onLoad(option) {
			this.id = option.id
			this.spread()
			
			uni.setNavigationBarTitle({
				title: this.$t("tab.b1"),
			});
		},
		//下拉刷新
		onPullDownRefresh() {
			let obj = this;
			//监听下拉刷新动作的执行方法，每次手动下拉刷新都会执行一次
			setTimeout(function() {
				obj.loadCodeList();
				uni.stopPullDownRefresh(); //停止下拉刷新动画
			}, 1000);
		},
		
		computed: {
			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
		},
		
		methods: {
			// 会员记录
			spread() {
				let that = this
				if (that.loadingType == 'loading' || that.loadingType == 'noMore') {
					return
				}
				spread({
					page: that.page,
					limit: that.limit,
					// id: that.userInfo.uid,
				}).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=>{
					console.log(e);
				})
			},
			navX() {
				uni.navigateTo({
					url: '/pages/user/vip/details'
				})
			}
	
		}
	};
</script>

<style lang="scss">
.all {
	width: 750rpx;
	min-height: 100vh;
	background-color: $page-color-base;
}
.row {
	display: flex;
	justify-content: space-between;
}
.rowT {
	display: flex;
	justify-content: space-between;
	margin-top: 20rpx;
}
.row1 {
	width: 325rpx;
	height: 168rpx;
	background: #191A1F;
	border-radius: 10rpx;
	margin-left: 36rpx;
}
.wenben {
	height: 27rpx;
	font-size: 28rpx;
	font-weight: 500;
	color: #FFFFFF;
	margin-left: 107rpx;
	margin-top: 22rpx;
}
.shu {
	width: 52rpx;
	height: 35rpx;
	font-size: 46rpx;
	font-weight: bold;
	color: #FEB041;
	margin-left: 136rpx;
	margin-top: 43rpx;
}
.row2 {
	width: 325rpx;
	height: 168rpx;
	background: #191A1F;
	border-radius: 10rpx;
	margin-right: 36rpx;
}

.list {
	width: 684rpx;
	height: 262rpx;
	background: #191A1F;
	border-radius: 16rpx;
	margin-left: 36rpx;
	margin-top: 25rpx;
}
.top {
	display: flex;
	justify-content: start;
}
.nc {
	height: 31rpx;
	font-size: 32rpx;
	font-weight: bold;
	color: #FFFFFF;
	margin-left: 35rpx;
	padding-top: 40rpx;
}
.img {
	width: 100rpx;
	height: 32rpx;
	margin-left: 20rpx;
	margin-top: 46rpx;
	object-fit: cover;
}

.center {
	display: flex;
	justify-content: start;
}
.sj {
	margin-left: 34rpx;
	margin-top: 25rpx;
	height: 22rpx;
	float: length($list: 231rpx);
	font-size: 28rpx;
	font-weight: 500;
	color: #999999;
}
.xq {
	margin-top: 25rpx;
	margin-left: 290rpx;
	height: 26rpx;
	font-size: 28rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #999999;
	float: length($list: 54rpx);
}
.ima {
	width: 13rpx;
	height: 19rpx;
	margin-top: 35rpx;
	margin-left: 20rpx;
}
.xian {
	width: 618rpx;
	height: 1rpx;
	background: #DDE1EB;
	opacity: 0.2;
	margin-left: 20rpx;
	margin-top: 30rpx;
}
.last {
	display: flex;
	justify-content: start;
}
.left {
	font-size: 28rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #999999;
	margin-left: 36rpx;
	margin-top: 30rpx;
}
.leftT {
	font-size: 28rpx;
	font-weight: 500;
	color: #b98134;
	margin-top: 30rpx;
}
.right {
	font-size: 28rpx;
	font-weight: 500;
	color: #999999;
	margin-left: 200rpx;
	margin-top: 30rpx;
}
.rightT {
	font-size: 28rpx;
	font-weight: 500;
	color: #ffffff;
	margin-top: 30rpx;
	
}
</style>
