<template>
	<view class="center">
		<view class="bg"></view>
		<view class="box first">
			<view class="top flex">
				<view class="top-bg"><image src="../../static/img/index4.png"></image></view>
				<view class="top-font">汇总数据</view>
			</view>
			<view class="title">总发行量：20亿</view>
			<view class="item flex">
				<view class="left">
					<view class="item-font">
						流通量：
						<span>{{ hui_zong_shu_ju.liu_tong_liang || '0000' }}</span>
					</view>
					<view class="item-font">
						持币地址数：
						<span>{{ hui_zong_shu_ju.chi_bi_di_zhi_shu || '0000' }}</span>
					</view>
					<view class="item-font">
						当前质押：
						<span>{{ hui_zong_shu_ju.dang_qian_zhi_ya_liang || '0' }}</span>
					</view>
					<view class="item-font">
						昨日销毁量：
						<span>{{ hui_zong_shu_ju.zuo_ri_xiao_hui_liang * 1 || '0000' }}</span>
					</view>
				</view>
				<view class="right">
					<view class="item-font">
						当天价格：
						<span>{{ (hui_zong_shu_ju.dang_tian_jia_ge * 1).toFixed(4) || '0000' }}</span>
					</view>
					<view class="item-font">
						节点数：
						<span>{{ hui_zong_shu_ju.jie_dian_shu * 1 || '0000' }}</span>
					</view>
					<view class="item-font">
						合伙人数：
						<span>{{ hui_zong_shu_ju.he_huo_ren_shu || '0000' }}</span>
					</view>
					<view class="item-font">
						累计销毁量：
						<span>{{ hui_zong_shu_ju.lei_ji_xiao_hui_liang * 1 || '0000' }}</span>
					</view>
				</view>
			</view>
		</view>
		<view class="box">
			<view class="top flex">
				<view class="top-bg"><image src="../../static/img/index4.png"></image></view>
				<view class="top-font">昨日经营数据</view>
			</view>
			<view class="item flex">
				<view class="left">
					<view class="item-font">
						拼团数：
						<span>{{ zuo_ri_jing_ying.pin_tuan_shu || '0' }}</span>
					</view>
					<view class="item-font">
						业 绩：
						<span>{{ zuo_ri_jing_ying.ye_ji * 1 || '0000' }}</span>
					</view>
					<view class="item-font">
						参与人数：
						<span>{{ zuo_ri_jing_ying.can_yu_ren_shu * 1 || '0' }}</span>
					</view>
					<view class="item-font">
						转账手续费：
						<span>{{ zuo_ri_jing_ying.zhuan_zhang_shou_xu_fei || '0' }}</span>
					</view>
					<view class="item-font">
						转账销毁数：
						<span>{{ zuo_ri_jing_ying.zhuan_zhang_xiao_hui_shu || '0' }}</span>
					</view>
				</view>
				<view class="right">
					<view class="item-font">
						门票数：
						<span>{{ zuo_ri_jing_ying.men_piao_shu * 1 || '0000' }}</span>
					</view>
					<view class="item-font">
						门票销毁数：
						<span>{{ zuo_ri_jing_ying.men_piao_xiao_hui_shu * 1 || '0000' }}</span>
					</view>
					<view class="item-font">
						门票分红：
						<span>{{ (zuo_ri_jing_ying.men_piao_fen_hong * 1).toFixed(2) || '0000' }}</span>
					</view>
				</view>
			</view>
		</view>
		<view class="box">
			<view class="top flex">
				<view class="top-bg"><image src="../../static/img/index4.png"></image></view>
				<view class="top-font">累计经营数据</view>
			</view>
			<view class="item flex">
				<view class="left">
					<view class="item-font">
						拼团数：
						<span>{{ le_ji_jing_ying.pin_tuan_shu || '0' }}</span>
					</view>
					<view class="item-font">
						总业绩：
						<span>{{ le_ji_jing_ying.ye_ji * 1 || '0000' }}</span>
					</view>
					<view class="item-font">
						参与人数：
						<span>{{ le_ji_jing_ying.can_yu_ren_shu * 1 || '0' }}</span>
					</view>
					<view class="item-font">
						转账手续费：
						<span>{{ le_ji_jing_ying.zhuan_zhang_shou_xu_fei || '0' }}</span>
					</view>
					<view class="item-font">
						转账销毁数：
						<span>{{ le_ji_jing_ying.zhuan_zhang_xiao_hui_shu || '0' }}</span>
					</view>
				</view>
				<view class="right">
					<view class="item-font">
						门票数：
						<span>{{ le_ji_jing_ying.men_piao_shu * 1 || '0000' }}</span>
					</view>
					<view class="item-font">
						门票销毁数：
						<span>{{ le_ji_jing_ying.men_piao_xiao_hui_shu * 1 || '0000' }}</span>
					</view>
					<view class="item-font">
						门票分红：
						<span>{{ (le_ji_jing_ying.men_piao_fen_hong * 1).toFixed(2) || '0000' }}</span>
					</view>
				</view>
			</view>
		</view>
		<view class="join">
			<view class="xian"></view>
			<view class="join-font">流动池数据</view>
		</view>
		<view class="tabBox">
			<view class="tabBox-top flex">
				<view class="tabBox-item one">矿池类型</view>
				<view class="tabBox-item two">初始量</view>
				<view class="tabBox-item three">占比</view>
				<view class="tabBox-item four">当前量</view>
				<view class="tabBox-item five">变动</view>
			</view>
			<view v-for="(item, index) in list" class="tabBox-top flex">
				<view class="tabBox-item one">{{ item.name }}</view>
				<view class="tabBox-item two">{{ item.num }}</view>
				<view class="tabBox-item three">{{ item.bi }}</view>
				<view class="tabBox-item four">{{ item.now }}</view>
				<view class="tabBox-item five">-{{ item.bian }}</view>
			</view>
		</view>

		<view class="join">
			<view class="xian"></view>
			<view class="join-font">通证模型</view>
		</view>
		<view class="image"><image src="../../static/img/info-image.png" mode=""></image></view>
		<view class="box">
			<view class="top flex">
				<view class="top-bg"><image src="../../static/img/index4.png"></image></view>
				<view class="top-font">链上数据查询</view>
			</view>
			<view class="item">1.合伙池：</view>
			<view class="item" @click="goto()">TXECLF5VPQ52pvyUAa9KiPpEYcxmMtQFVN</view>
			<view class="item">2.质押池：</view>
			<view class="item" @click="goto()">TL1Z9aBSWw6A1NkxQRvdWAnfyPJ6QYKFzF</view>
			<view class="item">3.流动池：</view>
			<view class="item" @click="goto()">TJQ9A51MsnK3pkXpSqAjjw69yDUfE6tB62</view>
			<view class="item">4.交易池：</view>
			<view class="item" @click="goto()">TWb36FhVHZKeTKHVi9nkz1cwGNPGKuWMDd</view>
			<view class="item">5.链商池：</view>
			<view class="item" @click="goto()">TAbsEXijPaN4PXSAodnVJnzxxkynGgNQ7x</view>
			<view class="item">6.平台池：</view>
			<view class="item" @click="goto()">TX8MBniPxdyebmhcT4Yej4GffZoN6DfyH2</view>
			<view class="item">7.推广池：</view>
			<view class="item" @click="goto()">TCPH6ZXQrCQ2LetXuMd5X6EUmmTMUC1R7h</view>
			<view class="item">8.团队池：</view>
			<view class="item" @click="goto()">TJq5kwQPZczw5LjKdVw3Hg6FwKgQZe4Dp9</view>
		</view>
		
	</view>
</template>

<script>
import { finance,yue } from '@/api/wallet';
export default {
	data() {
		return {
			src:'',
			list: [
				{
					name: '合伙池',
					num: '1亿',
					bi: '5%',
					now: ' ',
					bian: '0%',
					time: ''
				},
				{
					name: '质押池',
					num: '3.2亿',
					bi: '16%',
					now: ' ',
					bian: '0%',
					time: ''
				},
				{
					name: '流动池',
					num: '6.4亿',
					bi: '32%',
					now: ' ',
					bian: '0%',
					time: ''
				},
				{
					name: '交易池',
					num: '3.2亿',
					bi: '16%',
					now: ' ',
					bian: '0%',
					time: ''
				},
				{
					name: '链商池',
					num: '3.2亿',
					bi: '16%',
					now: ' ',
					bian: '0%',
					time: ''
				},
				{
					name: '平台池',
					num: '1.6亿',
					bi: '8%',
					now: ' ',
					bian: '0%',
					time: ''
				},
				{
					name: '推广池',
					num: '0.4亿',
					bi: '2%',
					now: '',
					bian: '0.0%',
					time: ''
				},
				{
					name: '团队池',
					num: '1亿',
					bi: '5%',
					now: ' ',
					bian: '0%',
					time: ''
				}
			],
			hui_zong_shu_ju: '',
			le_ji_jing_ying: '',
			zuo_ri_jing_ying: ''
		};
	},
	onLoad() {
		this.loadData();
	},
	methods: {
		async loadData() {
			const obj = this;
			uni.showLoading({
				title: '加载中',
				// mask: true
			});
			finance().then(({ data }) => {
				// console.log(data);
				this.hui_zong_shu_ju = data.hui_zong_shu_ju;
				this.le_ji_jing_ying = data.le_ji_jing_ying;
				this.zuo_ri_jing_ying = data.zuo_ri_jing_ying;
			});
			yue({address:'TXECLF5VPQ52pvyUAa9KiPpEYcxmMtQFVN',all:'2000000000'}).then(e => {
				uni.hideLoading();
				console.log(e)
				if(e.data.balance%100000000 == 0){
					obj.list[0].now = (e.data.balance/100000000) + '亿'
				}else if(e.data.balance%1000000000 == 0){
					obj.list[0].now = (e.data.balance/100000000).toFixed(1) + '亿'
				} else {
					obj.list[0].now = (e.data.balance/100000000).toFixed(2) + '亿'
				}
				if((100000000 - e.data.balance)%100000000 == 0){
					obj.list[0].bian = ((100000000 - e.data.balance)/100000000) + '%'
				}else if(100000000 - e.data.balance < 0){
					obj.list[0].bian = '0%'
				} else{
					obj.list[0].bian = ((100000000 - e.data.balance)/100000000).toFixed(2) + '%'
				}
			}).catch(err =>{
				console.log(err)
			})
			yue({address:'TL1Z9aBSWw6A1NkxQRvdWAnfyPJ6QYKFzF',all:'2000000000'}).then(e => {
				uni.hideLoading();
				console.log(e)
				if(e.data.balance%100000000 == 0){
					obj.list[1].now = (e.data.balance/100000000) + '亿'
				}else if(e.data.balance%1000000000 == 0){
					obj.list[1].now = (e.data.balance/100000000).toFixed(1) + '亿'
				} else {
					obj.list[1].now = (e.data.balance/100000000).toFixed(2) + '亿'
				}
				if((320000000 - e.data.balance)%320000000 == 0){
					obj.list[1].bian = ((320000000 - e.data.balance)/320000000) + '%'
				}else if(100000000 - e.data.balance < 0){
					obj.list[1].bian = '0%'
				} else {
					obj.list[1].bian = ((320000000 - e.data.balance)/320000000).toFixed(2) + '%'
				}
			}).catch(err =>{
				console.log(err)
			})
			yue({address:'TJQ9A51MsnK3pkXpSqAjjw69yDUfE6tB62',all:'2000000000'}).then(e => {
				uni.hideLoading();
				console.log(e)
				if(e.data.balance%100000000 == 0){
					obj.list[2].now = (e.data.balance/100000000) + '亿'
				}else if(e.data.balance%1000000000 == 0){
					obj.list[2].now = (e.data.balance/100000000).toFixed(1) + '亿'
				} else {
					obj.list[2].now = (e.data.balance/100000000).toFixed(2) + '亿'
				}
				if((640000000 - e.data.balance)%640000000 == 0){
					obj.list[2].bian = ((640000000 - e.data.balance)/640000000) + '%'
				}else if(100000000 - e.data.balance < 0){
					obj.list[2].bian = '0%'
				} else {
					obj.list[2].bian = ((640000000 - e.data.balance)/640000000).toFixed(2) + '%'
				}
			}).catch(err =>{
				console.log(err)
			})
			yue({address:'TWb36FhVHZKeTKHVi9nkz1cwGNPGKuWMDd',all:'2000000000'}).then(e => {
				uni.hideLoading();
				console.log(e)
				if(e.data.balance%100000000 == 0){
					obj.list[3].now = (e.data.balance/100000000) + '亿'
				}else if(e.data.balance%1000000000 == 0){
					obj.list[3].now = (e.data.balance/100000000).toFixed(1) + '亿'
				} else {
					obj.list[3].now = (e.data.balance/100000000).toFixed(2) + '亿'
				}
				if((320000000 - e.data.balance)%320000000 == 0){
					obj.list[3].bian = ((320000000 - e.data.balance)/320000000) + '%'
				}else if(100000000 - e.data.balance < 0){
					obj.list[3].bian = '0%'
				} else {
					obj.list[3].bian = ((320000000 - e.data.balance)/320000000).toFixed(2) + '%'
				}
			}).catch(err =>{
				console.log(err)
			})
			yue({address:'TAbsEXijPaN4PXSAodnVJnzxxkynGgNQ7x',all:'2000000000'}).then(e => {
				uni.hideLoading();
				console.log(e)
				if(e.data.balance%100000000 == 0){
					obj.list[4].now = (e.data.balance/100000000) + '亿'
				}else if(e.data.balance%1000000000 == 0){
					obj.list[4].now = (e.data.balance/100000000).toFixed(1) + '亿'
				} else {
					obj.list[4].now = (e.data.balance/100000000).toFixed(2) + '亿'
				}
				if((320000000 - e.data.balance)%320000000 == 0){
					obj.list[4].bian = ((320000000 - e.data.balance)/320000000) + '%'
				}else if(100000000 - e.data.balance < 0){
					obj.list[4].bian = '0%'
				} else {
					obj.list[4].bian = ((320000000 - e.data.balance)/320000000).toFixed(2) + '%'
				}
			}).catch(err =>{
				console.log(err)
			})
			yue({address:'TX8MBniPxdyebmhcT4Yej4GffZoN6DfyH2',all:'2000000000'}).then(e => {
				uni.hideLoading();
				console.log(e)
				if(e.data.balance%100000000 == 0){
					obj.list[5].now = (e.data.balance/100000000) + '亿'
				}else if(e.data.balance%1000000000 == 0){
					obj.list[5].now = (e.data.balance/100000000).toFixed(1) + '亿'
				} else {
					obj.list[5].now = (e.data.balance/100000000).toFixed(2) + '亿'
				}
				if((160000000 - e.data.balance)%160000000 == 0){
					obj.list[5].bian = ((160000000 - e.data.balance)/160000000) + '%'
				}else if(100000000 - e.data.balance < 0){
					obj.list[5].bian = '0%'
				} else {
					obj.list[5].bian = ((160000000 - e.data.balance)/160000000).toFixed(2) + '%'
				}
			}).catch(err =>{
				console.log(err)
			})
			yue({address:'TCPH6ZXQrCQ2LetXuMd5X6EUmmTMUC1R7h ',all:'2000000000'}).then(e => {
				uni.hideLoading();
				console.log(e)
				if(e.data.balance%100000000 == 0){
					obj.list[6].now = (e.data.balance/100000000) + '亿'
				}else if(e.data.balance%1000000000 == 0){
					obj.list[6].now = (e.data.balance/100000000).toFixed(1) + '亿'
				} else {
					obj.list[6].now = (e.data.balance/100000000).toFixed(2) + '亿'
				}
				if((40000000 - e.data.balance)%40000000 == 0){
					obj.list[6].bian = ((40000000 - e.data.balance)/40000000) + '%'
				}else if(100000000 - e.data.balance < 0){
					obj.list[6].bian = '0%'
				} else {
					obj.list[6].bian = ((40000000 - e.data.balance)/40000000).toFixed(2) + '%'
				}
			}).catch(err =>{
				console.log(err)
			})
			yue({address:'TJq5kwQPZczw5LjKdVw3Hg6FwKgQZe4Dp9',all:'2000000000'}).then(e => {
				uni.hideLoading();
				console.log(e)
				if(e.data.balance%100000000 == 0){
					obj.list[7].now = (e.data.balance/100000000) + '亿'
				}else if(e.data.balance%1000000000 == 0){
					obj.list[7].now = (e.data.balance/100000000).toFixed(1) + '亿'
				} else {
					obj.list[7].now = (e.data.balance/100000000).toFixed(2) + '亿'
				}
				if((100000000 - e.data.balance)%100000000 == 0){
					obj.list[7].bian = ((100000000 - e.data.balance)/100000000) + '%'
				}else if(100000000 - e.data.balance < 0){
					obj.list[7].bian = '0%'
				} else {
					obj.list[7].bian = ((100000000 - e.data.balance)/100000000).toFixed(2) + '%'
				}
			}).catch(err =>{
				console.log(err)
			})
		},
		goto(src){
			let url = 'https://tronscan.io/#/token20/TLuwWZ8MkB6FFJDLYc19u7d4tFq2GV3rPL/holders'
			console.log(url,"123456")
			url = encodeURIComponent(url)
			uni.navigateTo({
				url:'/pages/index/go?url=' + url
			})
		}
	}
};
</script>

<style lang="scss">
.center,
page {
	height: 100%;
	background: #f7fbfe;
}
.bg {
	width: 750rpx;
	height: 248rpx;
	background: linear-gradient(30deg, #2E58FF, #33EEFF);
	border-bottom-left-radius: 150rpx;
	border-bottom-right-radius: 150rpx;
}
.first {
	margin-top: -160rpx !important;
}
.box {
	width: 690rpx;
	height: auto;
	background: #ffffff;
	box-shadow: 0rpx 0rpx 17rpx 0rpx rgba(0, 0, 0, 0.05);
	border-radius: 20rpx;
	margin: 20rpx auto 0;
	padding: 33rpx 55rpx 45rpx 30rpx;
	.top {
		justify-content: flex-start;
		align-items: center;
		.top-bg {
			width: 48rpx;
			height: 46rpx;
			image {
				width: 100%;
				height: 100%;
			}
		}
		.top-font {
			margin-left: 11rpx;
			font-size: 34rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #0f253a;
		}
	}
	.title {
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #2E58FF;
		margin-top: 30rpx;
	}
	.item {
		width: auto;
		align-items: flex-start;
		margin-top: 20rpx;
		font-size: 26rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #6d7c88;
		text-align: left;
		.address {
			display: inline;
			
		}
		.item-font {
			margin-top: 20rpx;
			span {
				color: #0f253a;
			}
		}
	}
}
.join {
	margin-top: 44rpx;
	padding-left: 30rpx;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	.xian {
		width: 6rpx;
		height: 30rpx;
		background: #0f253a;
		border-radius: 4rpx;
	}
	.join-font {
		padding-left: 16rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #0f253a;
	}
}
.image {
	width: 690rpx;
	height: 489rpx;
	border-radius: 20rpx;
	background: #FFFFFF;
	box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
	margin: 26rpx auto 0;
	image {
		border-radius: 20rpx;
		width: 690rpx;
		height: 480rpx;
	}
}
.tabBox {
	margin: 30rpx auto 0;
	width: 690rpx;
	height: auto;
	background: #ffffff;
	border: 2rpx solid #2E58FF;
	box-shadow: 0px 0px 16rpx 0px rgba(0, 0, 0, 0.05);
	overflow: hidden;
	border-radius: 20rpx;
	.tabBox-top:last-child {
		border-bottom: none;
	}
	.tabBox-top {
		justify-content: flex-start;
		overflow: hidden;
		width: 100%;
		height: 70rpx;
		border-bottom: 2rpx solid #2E58FF;
		.tabBox-item:last-child {
			border-right: none;
		}
		.tabBox-item {
			overflow: hidden;
			text-align: center;
			line-height: 70rpx;
			border-right: 2rpx solid #2E58FF;
			font-size: 22rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #0f253a;
		}
		.one {
			width: 160rpx !important;
		}
		.two {
			width: 140rpx !important;
		}
		.three {
			width: 175rpx !important;
		}
		.four {
			width: 140rpx !important;
		}
		.five {
			width: 175rpx !important;
		}
	}
}
</style>
