<template>
	<view class="page-wrap">
		<u-navbar
			title="我的余额"
			:autoBack="false"
			 @leftClick="leftClick"
			 :safeAreaInsetTop="true"
		>
		</u-navbar>
		<view class="panel">
			<view class="title">个人余额（元）</view>
			<view class="number">{{memberInfo.balance}}</view>
			<u-button text="立即充值" @click="$u.route('/center/recharge')"></u-button>
		</view>
		
		<u-cell-group>
			<u-cell @click="$u.route('/center/dealList')" icon="order" title="交易明细" :isLink="true"></u-cell>
			<u-cell @click="$u.route('/center/setPaypass',{fromPage:'reset'})" icon="setting-fill" title="支付设置" :isLink="true"></u-cell>
		</u-cell-group>
			
	</view>
</template>

<script>
	export default {
		data() {
			return {
				memberInfo:{},
				params:{
				}
				
			}
		},
		onShow() {
			this.getMemberInfo();
		},
		onLoad() {

		},
		methods: {
			leftClick(){
				uni.reLaunch({url: '/center/center'});
			},
			getMemberInfo(){
				this.$u.api.memberInfo({id:this.vuex_member_info.id}).then(res=>{
					this.memberInfo = res.data;
					this.avatar =  res.data.avatar;
					this.$u.vuex('vuex_member_info', res.data);
					// console.log('memberInfo',this.memberInfo);
					}).catch(err=>{
					console.log('memberInfo',err.data);
				})
			},

		}
	}
</script>

<style lang="scss" scoped>
.panel{
	text-align: center;
	background-color: #ddd;
	padding: 20rpx;
	border-radius: 8rpx;
	margin-bottom: 40rpx;
	.title{
		
	}
	.number{
		
	}
}
</style>