<template>
	<view class="pageBg">
		<view class="pad">
			<view class="tps">请与教练协商，确认达成一致后填写协商好的退款金额</view>
			<myform :info="info" :orderId="orderId" :balanceAmount="balanceAmount"></myform>
		</view>
	</view>
</template>

<script>
	import myform from './comp/myform'
	import { applyOrderGet, applyOnlineFund, refund_amount } from '@/config/api.js'
	export default {
		components: { myform },
		data() {
			return {
				orderId: '',
				info: {},
				title: '退款申请',
				balanceAmount: 0
			}
		},
		onLoad(options) {
			if(!options.orderId) return 
			this.orderId = options.orderId
			this.applyOrderGetFn()
			this.refund_amountFn()
		},
		onPullDownRefresh() {
			this.applyOrderGetFn()
			this.refund_amountFn()
		},
		methods: {
			async applyOrderGetFn() {
				const {data: res} = await applyOrderGet({ orderId: this.orderId})
				this.info = res
				uni.stopPullDownRefresh()
			},
			async refund_amountFn() {
				const {data: res} = await refund_amount()
				if(res) {
					this.balanceAmount = res.balanceAmount
				}
				console.log(res)
			}
		}
	}
</script>

<style lang="scss" scoped>
	  .tps {
		  font-size: 24rpx;
		  color: #FF7270;
		  padding: 20rpx 0;
	  }
	
	  
</style>