<template>
	<view class="main">
		<view class="header-content">
			<image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/mybanner.png" style="width:100%;height:260rpx;"></image>
		</view>
		<view class="pr" style="z-index:2">
			<view class="plr15">
				<view class="bdr4 bg-white" style="margin-top: 38rpx;">
					<view class="m-dpflex flex-direction align-center justify-center" style="height: 210rpx;">
						<view class="text-bold text-black" style="font-size: 68rpx;">
							{{info.balance/100}}
						</view>
						<view class="" style="font-size: 28rpx;color: #666;">
							账户余额（元）
						</view>
					</view>
					<view class="pr m-xcenter plr20 header-box" style="padding: 40rpx 40rpx;background-color: #fff;border-radius: 16rpx;">
						<view class="m-flex tl f14 m-ycenter dpb">
							<view class="m-gray-big f20 fb pr10">{{info.topup_balance}}</view>
							<view class="m-gray-letter mt5 f12">充值金额（元）</view>
						</view>
						<view class="m-flex tl f14 m-ycenter">
							<view class="m-gray-big f20 fb">{{info.giving_balance/100}}</view>
							<view class="m-gray-letter mt5 f12">赠送金额（元）</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="margin-lr" style="box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);margin-top: 86rpx;">
			<u-button size="default" :ripple="true" @click="gotopay" :custom-style="customStyle">充值</u-button>
		</view>
		<view class="margin-lr margin-top" style="box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
			<u-button size="default" @click="gotoinfo" :ripple="true" :custom-style="customStyle1">明细</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				customStyle: {
					backgroundColor: '#0B73B9',
					color: '#FFFFFF'
				},
				customStyle1: {
					backgroundColor: '#ffffff',
					color: '#0B73B9'
				},
				info:{}
			};
		},
		methods: {
			gotoinfo() {
				uni.navigateTo({
					url: "balance_info"
				})
			},
			gotopay() {
				uni.navigateTo({
					url: "recharge"
				})
			},
			getMoney: async function() {
				let res = await this.$request.post("/api/v1/user/userInfo")
				console.log(res)
				if(res.status == 0){
					this.info = res.data
				}
			}
		},
		onShow() {
			this.getMoney()
		}
	};
</script>
<style scoped lang="scss">
	@import url("../index/mine.css");

	.header-content {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		z-index: -1;
		overflow: hidden;
		box-sizing: border-box;
	}

	.header-box {
		box-shadow: 0px 8rpx 34rpx -6rpx rgba(248, 151, 164, 0.13);
	}

	.header-img {
		width: 36rpx;
		height: 36rpx;
	}

	.tip {
		position: absolute;
		top: 0;
		right: 20%;
		bottom: 0;
		background-color: red;
		width: 12rpx;
		height: 12rpx;
		border-radius: 50%;
	}

	.msg {
		top: -3rpx;
		right: -9rpx;
	}

	swiper {
		height: 320rpx;
	}

	.swiper-wrapper {
		padding: 0 10rpx;
		box-sizing: border-box;
	}

	.swiper-item {
		width: 100%;
		height: 300rpx;
		box-shadow: 0 26rpx 40rpx 0 rgba(255, 255, 255, 0.31);
		background: url("http://file.supermm.me/miniProgram/images/personal/bg_doc.png") no-repeat bottom center;
	}

	.dots {
		position: absolute;
		left: 0;
		right: 0;
		bottom: -40rpx;
		display: flex;
		justify-content: center;
	}

	.dots .dot {
		margin: 0 8rpx;
		width: 14rpx;
		height: 14rpx;
		background: #E4E4E4;
		border-radius: 8rpx;
		transition: all .6s;
	}

	.dots .dot.active {
		width: 24rpx;
		background: rgb(153, 153, 153);
	}

	.game-wrap {
		position: relative;
		width: 100%;
		height: 100%;
		overflow: hidden;
		box-sizing: border-box;
	}

	.game-item {
		height: 100%;
		background: url("https://file.supermm.me/h5/wechat-h5/integral/personeBg001.jpg") no-repeat;
		background-size: 100% 100%;
		background-position: center center;
		border-radius: 100rpx;
	}
</style>
