<template>
	<view class="my-wallet">
		<view class="header">
			<view class="title">
				<text>余额(元)</text>
			</view>
			<view class="money">
				<text>{{(userInfo.FBalanceAmount).toFixed(2)}}</text>
			</view>
		</view>
		<view class="container">
			<u-cell-group>
				<u-cell-item v-for="(item,key) in cellList" :key="key" :arrow="true" @click="navigator(item.url)">
					<view slot="icon">
						<u-icon size="35" margin-left="20" :name="item.icon" :label="item.label"></u-icon>
					</view>
				</u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	import {init} from '../../api/api.js'
	export default {
		onShow(){
			init()
		},
		onLoad() {
			uni.$u.mpShare.title = '页面分享';
		},
		data(){
			return {
				cellList:[
					{
						label:'提现',
						url:'withdrawal/withdrawal',
						icon:'/static/images/my/money.png'
					},
					{
						label:'账户工单结算明细',
						url:'detail/detail',
						icon:'/static/images/my/renzheng.png'
					}
				],
				userInfo:this.$store.state.userInfo
			}
		},
		methods:{
			navigator(url){
				uni.navigateTo({
					url:url
				})
			}
		}
	}
</script>

<style>
	.header{
		background-color: #7c59fc;
		color: #FFFFFF;
		padding: 5% 5%;
	}
	.title{
		margin-bottom: 5%;
	}
	.money{
		font-size: 40px;
		font-weight: 1000;
	}
</style>
