<template>
	<view class="container">
		<view class="head">
			<uni-icons type="medal" size="50"/>
			<view class="box">
				<text>钱包余额</text>
			</view>
			<view class="box">
				<text>￥{{userInfo.amt}}</text>
			</view>
			<button class="withdrawBtn" size="default" :loading="loadingFlag" @click="withdraw('/pages-userInfo/withdraw/withdraw')" :disabled="checkUpload">发起提现</button>
		</view>
		<view class="bottom">
			<uni-group mode="card">
				<uni-list>
					<uni-list-item title="管理收款账户" :show-extra-icon="true" :extra-icon="wallet" link to="/pages-userInfo/creatorAccount/creatorAccount"></uni-list-item>
					<uni-list-item title="提现记录" :show-extra-icon="true" :extra-icon="withlog" link to="/pages-userInfo/withdraw/withdrawLog"></uni-list-item>
				</uni-list>
			</uni-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {},
				wallet: {
					color:'#0000ff',
					size: '22',
					type: 'wallet'
				},
				withlog: {
					color:'#0000ff',
					size: '22',
					type: 'compose'
				},
			}
			
		},
		created() {
			const userInfo = uni.getStorageSync('userInfo')
			if (!userInfo) {
				console.log('havent userInfo')
				uni.showModal({
					content: '艺术家账户过期,请重新登录！',
					showCancel: false,
					success() {
						//没有缓存则跳转登录页面
						uni.reLaunch({
							url: '/pages/login/login'
						});
					}
				});
			} else {
				this.userInfo = userInfo;
				console.log('have userInfo')
			}
		},
		methods: {
			// targetToDetail(orderId) {
			// 	console.log('orderId', orderId)
			// 	if (orderId) {
			// 		uni.navigateTo({
			// 			url: 'withdrawDetail?orderId=' + orderId,
			// 		});
			// 	}
			// },
			withdraw(url){
				uni.navigateTo({
					url: url
				})
			}
			
		}
	}
</script>

<style lang="scss">
	.container{
		.head{
			margin-bottom: 50rpx;
			text-align: center;
			.box{
				//border:1px red solid;
				padding-bottom: 30rpx;
			}
		}
	}
	
	.withdrawBtn{
		width: 710rpx;
		height: 60rpx;
		background-color: royalblue;
		color: #ffffff;
		font-size: 30rpx;
		line-height: 62rpx;
		border-radius: 17rpx;
		margin-top:100rpx;
	}
	.uni-list-item__icon-img {
	  border-radius: 16rpx;
	}
	
	.uni-list-item__content-title {
	  font-size: 28rpx;
	  color: #3b4144;
	  overflow: hidden;
	}
</style>
