<template>
	<view class="">
  <balance @send="getSonValue" :currencySymbol="currencySymbol" :currentBalance="currentBalance"></balance>
     <view class="index-body">
     	<view class="index-body-p1">
     		Game
     	</view>
		<view class="index-body-img" @click="goColor">
			<image src="../../../static/home/bg_color@2x.png" mode=""></image>
		</view>
     </view>
		
	</view>

</template>

<script>
	import Vue from 'vue';
		import balance from "@/components/balance/balance.vue"
	export default {
		data() {
			return {
			currencySymbol:'',
			currentBalance:'',
			}
		},
		onLoad() {
            this.currencySymbol=uni.getStorageSync('siteInfo').currencySymbol;
			uni.request({
				url: '/start/api/withdraw/withdrawConfig',
				data: {
					"ticket": uni.getStorageSync('logInfo').data,
				},
				header: {
					'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息
				},
				method: 'POST', //请求方式  或GET，必须为大写
				success: (res) => {		
					this.currentBalance=res.data.data.currentBalance;
					uni.setStorage({
						key: 'currentBalance',
						data: this.currentBalance,
						success: function() {
							console.log('success')
						}
					});
				},
				fail: (res) => {
					console.log(res.data);
				}
			});
		},
		methods: {
			getSonValue(){
					  uni.reLaunch({
					  	url:'../recharge/index'
					  })
			},
			
			goColor(){
				uni.reLaunch({
					url:'../color/index'
				})
			},
		}
	}
</script>

<style>
	@import './index.css';
	

</style>
