<template>
	<view class="box">
			<view class="headerView">
				<view class="leftTitle">累计提现: <text class="rightMoney">￥{{detailData.withdrawalMoney}}</text></view>
				<view class="leftTitle">提现中: <text class="rightMoney">￥{{detailData.frozenMoney}}</text></view>
			</view>
			
			
					<view v-for="(item,index) in arr" :key="index" >
						<view class="itemBg">
							<view class="first">
								<view class="time">{{item.createTIme}}</view>
								<!-- 0待审核1通过2拒绝 -->
								<view class="state" v-if="item.AuditState == 0" style="color: #F19D01;">待审核</view>
								<view class="state" v-if="item.AuditState == 1" style="color: #00A040;">审核通过</view>
								<view class="state" v-if="item.AuditState == 2" style="color: #FF3B30;">审核拒绝</view>
							</view>
							<view class="second">
								<view class="name">{{item.aliName}}  {{item.aliPhone}}</view>
								<view class="monty">￥{{item.money}}</view>
							</view>
							
							<view class="content" v-if="item.AuditState == 2">拒绝原因：{{item.AuditComment}}</view>
						</view>
					</view>
				
			<!-- 上拉 加载更多 -->
			<view class="noMore" v-if="noMoreShow">没有更多数据</view>
			<!-- 无数据空白页 -->
			<nodata v-if="arr.length==0"></nodata>
			
	</view>
</template>

<script>
	import nodata from '../../components/nodata/nodata.vue'
	export default {
		components: {
			nodata,
		},
		
		data() {
			return {
				arr: [],
				page: 1,
				noMoreShow: false,
				detailData:{},
			}
		},
		onShow() {
			this.getDetailData();
			this.page = 1;
			this.getItemData();
		},
		methods: {
			getDetailData() {
				uni.showLoading({
					title: '加载中'
				})
				let url = 'worldKeepCar/worldDistribution/queryDistributionIndexDetail',
					params = {
						
					}
				this.$http(url, params, 'GET').then(res => {
					uni.hideLoading();
					var data = res.data
					
					
					// 处理 undefined和null转为空白字符串
					
						for (const key in data) {
							data[key] = this.$praseStrEmpty(data[key])
						}
					
					this.detailData = data
					
					
					
				})
			},
			getItemData() {
				uni.showLoading({
					title: '加载中'
				})
				let url = 'worldKeepCar/worldDistribution/listTSApplySheetPage',
					params = {
						page:this.page,
						limit:10,
					}
				this.$http(url, params, 'GET').then(res => {
					uni.hideLoading();
					var list = res.data.Items
					
					// 处理 undefined和null转为空白字符串
					list.forEach((item, index) => {
						for (const key in item) {
							item[key] = this.$praseStrEmpty(item[key])
						}
					})
					
					
					if (this.page == 1) {
						this.arr = list
					} else {
						this.arr = this.arr.concat(list)
					}
					
					if (list.length < 10) {
						this.noMoreShow = true
					} else {
						this.noMoreShow = false
					}
					
					
				})
			},
		},
		// 下拉刷新 上拉加载更多
		onPullDownRefresh() {
			this.page = 1;
			this.getItemData()
			
			this.getDetailData()
			setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		onReachBottom() {
			this.page++;
		
			this.getItemData()
		
		},
	}
</script>

<style>
	.box {
		min-height: 100vh;
		background: #F4F5F7;
		padding-bottom: 20rpx;
	}
	.headerView{
		padding: 20rpx 16rpx;
		
		display: flex;
		justify-content: space-between;
	}
	.leftTitle{
		font-size: 26rpx;
		color: #999999;
	}
	.rightMoney{
		font-size: 26rpx;
		color: #3C3C3C;
		font-weight: bold;
	}
	.itemBg{
		margin: 0 16rpx 20rpx;
		background-color: #FFFFFF;
		border-radius: 10rpx;
		padding: 30rpx 20rpx;
	}
	.first{
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.second{
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 15rpx;
	}
	.content{
		margin-top: 15rpx;
	}
	.time{
		font-size: 28rpx;
		color: #999999;
	}
	.state{
		font-size: 28rpx;
	}
	.name{
		font-size: 28rpx;
		color: #3C3C3C;
	}
	.monty {
		
		font-size: 38rpx;
		font-weight: bold;
		color: #000000;
	}
	.content{
		font-size: 28rpx;
		color: #666666;
	}
	.noMore {
		text-align: center;
		line-height: 50rpx;
		color: #999999;
		font-size: 28rpx;
	}
</style>
