
<template>
	<view>
		<u-navbar title="退费详情"></u-navbar>
		<view class="rechargeDet-head">
			<view class="payPrice">
				<span>￥</span><font>{{refund.refundRealAmount}}</font>
			</view>
			<p>退费金额(元)</p>
		</view>
		<view class="rechargeDet-main">
			<view class="rechargeDet-list">
				<p>退费订单</p><span>{{refund.refundOrderNo}}</span>
			</view>
			<view class="rechargeDet-list">
				<p>手续费</p><span>￥{{refund.proceduresAmount.toFixed(2)}}</span>
			</view>
			<view class="rechargeDet-list">
				<p>退费时间</p><span>{{refund.applicationTime}}</span>
			</view>
			<view class="rechargeDet-list">
				<p>退费渠道</p><span>{{refund.refundChannelText}}</span>
			</view>
			<view class="rechargeDet-list">
				<p>退费金额</p><span>￥{{refund.refundRealAmount.toFixed(2)}}</span>
			</view>
		</view>
		<view class="rechargeDet-main">
			<view class="rechargeDet-list">
				<p>状态</p><span>{{refund.statusText}}</span>
			</view>
		</view>
	</view>
</template>

<script>
	import * as api from "@/apis/refund.js"
	let _self;
	export default {
		data() {
			return {
				elderMode:false,
				refund :{}
			}
		},
		onLoad(op){
			_self = this;
			if(op.id){
				let data ={id:op.id};
				console.log('data'+JSON.stringify(data))
					api.personAccountRefundDetail(data).then(function(res){
						console.log('res'+JSON.stringify(res));
						if(res.result){
							_self.refund = res.data;
							
							if(_self.refund.refundChannel == 'wechat')
								_self.refund.refundChannelText = "微信"
							else if (_self.refund.refundChannel == 'alipay')
								_self.refund.refundChannelText = "支付宝"
								
								
							if(_self.refund.status == '0')
								_self.refund.statusText = "退款中"
							else if (_self.refund.status == '1')
								_self.refund.statusText = "退款成功"
							else if (_self.refund.status == '2')
								_self.refund.statusText = "退款拒绝"
							else if (_self.refund.status == '3')
								_self.refund.statusText = "退款失败"
						}
					},function(err){
						uni.showToast({
							title: err,
							icon: "none"
						})
						//console.log('err'+JSON.stringify(err));
					})
					//console.log('item'+JSON.stringify(item))
				
			}
		},
		onReady(){
			this.elderMode = this.carhelp.get('getElderModeClass');
			if(this.elderMode)
				this.theme('elder')
			else
				this.theme('standard')
		},
		methods: {
			theme(type) { 
			  if(type == 'dark')	
			  {
 				document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
 				  
			  }
			  else
			  {
 				document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
 				  
			  } 
			}
		}
	}
</script>

<style lang="scss" scoped> 
	@import "@/_theme.scss";
	.rechargeDet-head{
		background-color: #fff;
		padding: 24px 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		.payPrice{
			display: flex;
			align-items: flex-end;
			justify-content: center;
			font{
				font-size: 36px;
				line-height: 36px;
			}
		}
		p{
			color:#999;
			margin-top: 4px;
		}
	}
	.rechargeDet-main{
		background-color: #fff;
		padding-left: 16px;
		margin-top: 12px;
		.rechargeDet-list{
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 12px 16px 12px 0;
			border-bottom: 1px solid #f7f7f7;
			&:last-child{
				border-bottom: none;
			}
		}
	}
</style>
