
<template>
	<view>
		<ujp-navbar title="充值详情"></ujp-navbar>
		<view class="rechargeDet-head">
			<view class="payPrice" v-if="type==1">
				<font>{{detail.payFee.toFixed(2)}}</font><span>元</span>
			</view>
			<view class="payPrice" v-if="type==2">
				<font>{{detail.depositAmount.toFixed(2)}}</font><span>元</span>
			</view>
			<view class="payPrice" v-if="type==3">
				<font>{{detail.depositAmount.toFixed(2)}}</font><span>元</span>
			</view>
			<p class="oldTextjp2" oldstyle="font-size: 16px;"  v-if="type==1">充值金额(元)</p>
			<p class="oldTextjp2" oldstyle="font-size: 16px;"  v-if="type==2">充电金(元)</p>
			
			<p class="oldTextjp2" oldstyle="font-size: 16px;"  v-if="type==3">现金分红(元)</p>
			
		</view>
		<view class="rechargeDet-main oldTextjp2" oldstyle="font-size: 18px;" v-if="type==3||type==2">
		
			<view class="rechargeDet-list">
				<p>充值时间</p><span>{{detail.createTime}}</span>
			</view>
		
		</view>
		<view class="rechargeDet-main oldTextjp2" oldstyle="font-size: 18px;" v-if="type==1">
			<view class="rechargeDet-list">
				<p>充值订单</p><span>{{detail.outOrderNo}}</span>
			</view>
			<view class="rechargeDet-list">
				<p>交易单号</p><span class="transactionClass">{{detail.transactionId}}</span>
			</view>
			<view class="rechargeDet-list">
				<p>充值时间</p><span>{{detail.payTime}}</span>
			</view>
			<view class="rechargeDet-list">
				<p>充值渠道</p><span>{{detail.payNameStr}}</span>
			</view>
			<view class="rechargeDet-list">

				<p>充值金额</p><span>{{detail.payFee.toFixed(2)}}元</span>

			</view>
		</view>
		<view class="rechargeDet-main" v-if="type==1">
			<view class="rechargeDet-list oldTextjp2" oldstyle="font-size: 18px;">
				<p>状态</p><span>{{detail.payStatusStr}}</span>
			</view>
		</view>
	</view>
</template>

<script>
	import * as API from '@/apis/index.js'
	
	export default {
		data() {
			return {
				id: '',
				detail: {},
				elderStatus: false,
			}
		},
		onLoad(op) {
			if(op.id) {
				this.id = op.id
					this.type = op.type
				this.getAccountDetail();
			}
			
			if(this.carhelp.get("getElderModeClass") == "长辈模式") {
				this.elderStatus = true;
			} else {
				this.elderStatus = false;
			}
		},
		methods: {
			getAccountDetail() {
				uni.showLoading({
					title: "加载中",
					mask: true,
				})		
				API.rechargeAmountRecordDetail({
				id:	this.id,
				type:	this.type
				}).then((res) => {
					uni.hideLoading();
					
					this.detail = res.data.recordDetail;
				}).catch(error => {
					uni.showToast({
						title: error,
						icon: "none"
					})
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.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;
			}
			.transactionClass {
				width: 70%;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
				text-align: right;
			}
		}
	}
</style>
