<template>
	<view>
		<z-paging :language="$i18n.locale" ref="paging" v-model="list" @query="queryList" :pageSize="20"
			:style="'background-color: '+theme.bg+';color: '+theme.text">
			<!-- 下拉刷新 -->
			<custom-refresher slot="refresher" slot-scope="{refresherStatus}" :status="refresherStatus">
			</custom-refresher>

			<myNav slot="top" :title="i18n.tabBar.quantify"></myNav>
			<view class="width-690 margin-0-auto height-100 radiu-16 flex align-center justify-between padding-w-10"
				:style="'background-color: '+theme.fu_bg">
				<view class="flex-1 height-80 flex direction-column align-center justify-around">
					<text class="font-24">{{i18n.ico.tos3}}</text>
					<text class="font-24">{{succ_usdt}} USDT</text>
				</view>
				<view class="flex-1 height-80 flex direction-column align-center justify-around">
					<text class="font-24">{{i18n.ico.tos4}}</text>
					<text class="font-24">{{have_usdt}} USDT</text>
				</view>
			</view>

			<!-- 身体 -->
			<view class="width-750 padding-b-40">
				<view v-for="(item,index) in list"
					class="height-180 padding-w-30 padding-t-24 padding-b-27 flex direction-column justify-between margin-t-16">
					<view class="flex align-center justify-between">
						<text class="font-32 color-00C481 nummedium-font">{{item.name}}</text>
						<text v-if="item.status==0" class="font-28 nummedium-font">{{i18n.ico.text15}}</text>
						<text v-if="item.status==1" class="font-28 nummedium-font">{{i18n.ico.text16}}</text>
					</view>
					<view class="height-50 flex align-center justify-between">
						<text class="font-28 nummedium-font">{{i18n.ico.tos5}}：{{item.price}} USDT</text>
						<text class="font-26 nummedium-font">{{i18n.ico.tos6}}/{{i18n.ico.tos7}}</text>
					</view>
					<view class="flex align-center justify-between">
						<text class="font-24 nummedium-font">{{item.createtime}}</text>
						<text class="font-26 nummedium-font">{{item.real_num}}/{{item.num}}</text>
					</view>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				theme: '',
				have_usdt: 0,
				succ_usdt: 0,
			}
		},
		computed: {
			i18n() {
				return this.$t('message');
			}
		},
		onShow() {
			this.getico_usdt()
			if (uni.getStorageSync("theme") == "dark") {
				this.theme = this.$store.state.darkTheme
			} else {
				this.theme = this.$store.state.lightTheme
			}
		},
		methods: {
			getico_usdt() {
				this.post('/index/ico_usdt').then(res => {
					console.log('', res)
					if (res.code == 1) {
						this.have_usdt = res.data.have_usdt
						this.succ_usdt = res.data.succ_usdt
					}
				})
			},
			queryList(pageNo, pageSize) {
				setTimeout(() => {
					this.post('/index/ico_user_log', {
						page: pageNo,
						page_num: pageSize
					}).then(res => {
						if (res.code == 1) {
							console.log(res)
							this.$refs.paging.complete(res.data.data);
						}
					})
				}, 500)
			},
		}
	}
</script>

<style lang="scss">
</style>
