<template>
	<view class="advance">
		<view class="mainbox">
			<!-- <image src="../../static/images/back_1.png" mode="" class="main_back"></image> -->
			<image src="../../static/images/back_1.png" mode=""  class="main_back"></image>
			<view class="list">
				患者姓名：{{user_name}}
			</view>
			<view class="list">
				可用余额(元)
			</view>
			<view class="list_pay">
				{{balance}}
			</view>
			<!-- <VanButton>明细详情</VanButton> -->
			<van-button class="de_btn" @click="to_details">明细详情</van-button>
		</view>
	</view>
</template>

<script>
	// import VanButton from '@/wxcomponents/vant/button/index'
	import { getgetbalance } from '@/api/api.js';
	export default {
		comments: {
			// VanButton
		},
		data() {
			return {
				user_name: "",
				balance: "",
				patient_id: 15652,
				org_id:10265,
			}
		},
		onLoad() {
			this.getmoney()
		},
		methods: {
			to_details() {
				uni.navigateTo({
					// url: '/pages/advancePay/details'
					url:'/subpackages/pages/advancePay/details'
				})
			},
			
			async getmoney(){
				let params = {
					patient_id:15652,
					org_id:10265
				}
				console.log('22222',params);
				let res = await getgetbalance(params)
				this.user_name = res.data.data.patient.name
				this.balance = res.data.data.balance
					console.log(res,'resres')
			}
		}
	}
</script>

<style>
	@import url(../advancePay/advance.css);

	.mainBox {}

	.main_back {
		position: absolute;
		width: 100%;
		top: 0;
	}
</style>
<style lang="scss" scoped>
	/deep/ .de_btn {
		margin-left: 60rpx;
		padding-left: 0px;

		button {
			border-radius: 50rpx;
			width: 260rpx;

			.van-button__text {
				padding-left: 0rpx;
				color: #00c4b3;
			}
		}
	}
</style>
