<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.withdraw.title2"></myNav>
			<!-- 身体 -->
			<view class="width-750 padding-b-40">
				<view @click="goDetails(item.id)" v-for="(item,index) in list"
					class="padding-w-30 padding-t-24 flex direction-column margin-t-16">
					<view class="flex align-center justify-between">
						<text class="font-32 color-FF4040 nummedium-font">-{{item.price}}</text>
						<text v-if="item.status==0" class="font-28 nummedium-font">{{i18n.recharge.title12}}</text>
						<text v-if="item.status==1" class="font-28 nummedium-font">{{i18n.recharge.title13}}</text>
						<text v-if="item.status==2" class="font-28 nummedium-font">{{i18n.recharge.title14}}</text>
					</view>
					<text class="font-24 color-C3C3C3 nummedium-font margin-t-20">{{item.createtime}}</text>
					<view v-if="item.description" class="padding-20 color-FF4040">
						{{item.description}}
					</view>
				</view>
			</view>

		</z-paging>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				theme: '',
			}
		},
		computed: {
			i18n() {
				return this.$t('message');
			}
		},
		onShow() {
			if (uni.getStorageSync("theme") == "dark") {
				this.theme = this.$store.state.darkTheme
			} else {
				this.theme = this.$store.state.lightTheme
			}
		},
		methods: {
			queryList(pageNo, pageSize) {
				setTimeout(() => {
					this.post('/wallet/get_width_log', {
						page: pageNo,
						page_num: pageSize
					}).then(res => {
						if (res.code == 1) {
							console.log(res)
							this.$refs.paging.complete(res.data.data);
						}
					})
				}, 500)
			},
			goDetails(id) {
				uni.navigateTo({
					url: '/pages/index/withdrawalDetails?id=' + id
				})
			},
		}
	}
</script>

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