<template>
	<view class="">
		<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>
</template>

<script>
	import {
		spread_se
	} from "@/api/user.js"
	
	export default {
		data() {
			return {
				id: '',
				page: 1,
				limit: 10,
				loadingType: 'more',
				loaded: false,
				list: [],
			};
		},
		onLoad(option) {
			console.log('载入');
			this.id = option.id;
			this.getList()
			
		},
		onReachBottom() {
			this.getList()
		},
		methods:{
			// 获取列表
			getList(){
				let that = this
				if (that.loadingType == 'loading' || that.loadingType == 'noMore') {
					return
				}
				that.loadingType = "loading";
				spread_se({
					page: that.page,
					limit: that.limit,
				},that.id).then(({
					data
				}) => {
					let list = data.list
					that.list = that.list.concat(list)
					if (list.length == that.limit) {
						that.loadingType = 'more'
					} else {
						that.loadingType = 'noMore'
					}
					that.loaded = true
				}).catch(e => {
					console.log(e);
				})
			}
		}
	}
</script>

<style lang="scss">
.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>