<template>
	<view class="">
		<view class="bg padding">
			<view class="box">
				<view class="tit">可用资金(元)</view>
				<view class="pri"><text>{{balance?balance:'0'}}</text> </view>
				<view class="flex align-center justify-between margin-top-xl">
					<!-- <view class="">
						<view>总资金</view>
						<view style="font-size: 44rpx;">{{money?money:'0'}}</view>
					</view> -->
					<!-- <view class="">
						<view>冻结资金</view>
						<view style="font-size: 44rpx;">2.00</view>
					</view> -->
				</view>
			</view>
			<view class="flex align-center justify-between padding-top">
				<view>
					<view class="padding-bottom-xs">总资产（元）</view>
					<view class="text-bold" style="font-size: 48rpx;">{{balance?balance:'0'}}</view>
				</view>
				<view class="flex align-center">
					<view class="cz" @click="goTo('/my/wallet/Txmoney')">提现</view>
					<!-- <view class="tx" @click="gocz()">充值</view> -->
				</view>
			</view>
		</view>

		<!-- 我的列表 -->
		<view class="mylist">
			<view class="list_box" @click="goTo('/my/wallet/Acontlist')">
				<view class="list_left">
					<view class="margin-right-xs">
						<image src="../static/zijin.png" style="width: 52rpx;height: 52rpx;"></image>
					</view>
					<view class="t">资金明细</view>
				</view>
				<view class="">
					<image src="../static/icon_go.png" style="width: 18rpx;height: 32rpx;"></image>
				</view>
			</view>
			<view class="list_box" @click="goTo('/my/wallet/zhifubao')">
				<view class="list_left">
					<view class="margin-right-xs">
						<image src="../static/zhanghao.png" style="width: 52rpx;height: 52rpx;"></image>
					</view>
					<view class="t">提现账号</view>
				</view>
				<view class="">
					<image src="../static/icon_go.png" style="width: 18rpx;height: 32rpx;"></image>
				</view>
			</view>
			<view class="list_box" @click="goTo('/my/wallet/cashList')">
				<view class="list_left">
					<view class="margin-right-xs">
						<image src="../static/tixian.png" style="width: 52rpx;height: 52rpx;"></image>
					</view>
					<view class="t">提现记录</view>
				</view>
				<view class="">
					<image src="../static/icon_go.png" style="width: 18rpx;height: 32rpx;"></image>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				money: 0,
				mylist: [{
					id: 1,
					name: '保证金',
					image: '../../../static/rider/qqq.png'
				}, {
					id: 2,
					name: '账户明细',
					image: '../../../static/rider/qq.png'
				}],
				shangxian: '是',
				balance:0
			}
		},
		onLoad() {
			this.shangxian = uni.getStorageSync('shangxian')
		},
		onShow() {
			// this.taskData()
			this.getUserInfo()
		},
		methods: {
			// 获取个人信息
			getUserInfo() {
				let userId = this.$queue.getData('userId');
				this.$Request.getT("/app/user/selectUserDetails?userId=" + userId).then(res => {
					if (res.code == 0) {
						this.balance = res.data.balance
					} else {
						this.$queue.logout();
						uni.showModal({
							showCancel: false,
							title: '登录失败',
							content: res.msg,
						});
					}
				});
			},
			goTo(url){
				uni.navigateTo({
					url
				})
			},
			// 获取任务数据
			taskData() {
				this.$Request.getT('/app/userinfo/findBalance').then(res => {
					if (res.code == 0) {
						if (res.data) {
							this.money = res.data
						}

					}
					console.log('res', res)

				});
			},
			bindTxmoney() {
				uni.navigateTo({
					url: '/pages/riderMy/myAccount/Txmoney/Txmoney'
				})
			},
		}
	}
</script>

<style lang="less">
	page {
		background: #F5F5F5;
	}

	.bg {
		background: #FFFFFF;
	}

	.box {
		width: 690rpx;
		// height: 312rpx;
		background: linear-gradient(90deg, #3C7BFC 0%, #6FB3FF 100%);
		border-radius: 16rpx;
		color: #FFFFFF;
		// text-align: center;
		padding: 50rpx 40rpx 30rpx;


		.tit {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
		}

		.pri {
			margin-top: 20rpx;

			text {
				font-size: 68rpx;
				font-family: DINPro;
				font-weight: 500;
				color: #FFFFFF;
				margin-right: 10rpx;
			}
		}
	}

	.tx {
		width: 160rpx;
		height: 70rpx;
		border: 3rpx solid #0186FF;
		border-radius: 8rpx;
		text-align: center;
		line-height: 70rpx;
		color: #0186FF;
	}

	.cz {
		width: 160rpx;
		height: 70rpx;
		border-radius: 8rpx;
		text-align: center;
		line-height: 70rpx;
		color: #FFFFFF;
		margin-left: 20rpx;
		background: #0186FF;
	}


	/* 我的列表 */
	.mylist {
		background-color: #FFFFFF;
		margin-top: 20rpx;
		padding: 30rpx 28rpx;
	}

	.list_box {
		display: flex;
		height: 95rpx;
		align-items: center;
	}

	.list_left {
		flex: 1;
		display: flex;
		justify-content: left;
		align-items: center;
		.t{
			letter-spacing: 1rpx;
		}
	}
</style>