<template>
	<v-page>
		<v-header class="nav-head" :title="$t('contribution.c1')"></v-header>
		<v-paging :ajax="getHistoryEntrust" style="height:100vh">
			<template #box="list">
				<van-empty v-if="!$list(list).length" description="" />
				<div class="item bg-panel-4 m-md rounded-sm box-shadow" v-for="item in $list(list)" :key="item.id">
					<div class="p-x-md p-y-xs">
						<div class="row d-flex m-y-mini justify-between">
							<div class="label fn-sm">{{$t('contribution.c2')}}</div>
							<div class="color-light">{{item.order_no}}</div>
						</div>
						<div class="row d-flex m-y-mini justify-between">
							<div class="label fn-sm">{{$t('contribution.c3')}}</div>
							<div class="color-light">{{parseTime(item.create_time)}}</div>
						</div>
						<div class="row d-flex m-y-mini justify-between">
							<div class="label fn-sm">{{$t('contribution.c4')}}</div>
							<div class="color-light">{{$t('contribution.c5')}}</div>
						</div>
						<div class="row d-flex m-y-mini justify-between">
							<div class="label fn-sm">{{$t('contribution.c6')}}</div>
							<div class="color-light">{{getMoney(item.money)}} USDT</div>
						</div>
					</div>
				</div>
			</template>
		</v-paging>
	</v-page>
	
</template>

<script>
	import Contract from "@/api/contract";
	import Donation from "@/api/donation.js";
	import date from "@/utils/class/date.js"
	export default {
		name: "contract-entrustment",
		data() {
			return {
				show: false
			};
		},
		methods: {
			parseTime(time){
				time = date.parseTime(time)
				return this.$date(time)
			},
			getMoney(money){
				if(!money) return
				console.log(money)
				money = Number(money).toFixed(3)
				return money
			},
			getHistoryEntrust: Donation.getList,
			status(status) {
				switch (status) {
					case 0:
						return this.$t('contract.b6');
					case 1:
						return this.$t('contract.b7');
					case 2:
						return this.$t('contract.b9');
					case 3:
						return this.$t('contract.b9');
				}
			},
		},
	};
</script>

<style lang="scss" scoped>
	.m-y-mini {
		margin-top: 5px;
		margin-bottom: 5px;
	}
</style>
