<template>
	<view class="rechargeDetail">
		<view class="contentWrapper">
			<view class="wrapper">
				<view class="topBg" :style="'background-image: url('+this.$ImgUrl + 'user/greyBgTop.png'+')'">
					<view class="line"></view>
				</view>
				<view class="title">{{Record['optionName']||''}}</view>
				<view class="amount">{{itemAmount(Record['amount']||0)}}</view>
				<view class="rowItem" style="margin-top: 92rpx;">
					<view class="label">学生姓名</view>
					<view class="value">{{Record['userName']||''}}</view>
				</view>
				<view class="rowItem">
					<view class="label">年级班级</view>
					<view class="value">{{Record['gradeName']||''}}/{{Record['className']||''}}</view>
				</view>
				<view class="rowItem">
					<view class="label">服务费</view>
					<view class="value"> {{Record['serviceFee']||'0.00'}}</view>
				</view>
				<view class="rowItem">
					<view class="label">消费时间</view>
					<view class="value">{{Record['payTime']||''}}</view>
				</view>
				<view class="rowItem">
					<view class="label">交易订单号</view>
					<view class="value">{{Record['outTradeNo']||''}}</view>
				</view>
				<view class="rowItem">
					<view class="label">支付订单号</view>
					<view class="value">{{Record['tradeNo']||''}}</view>
				</view>
				<view class="btn" @click="goToPage(1)">
					<view class="button">对此订单有疑问？</view>
				</view>
			</view>
			<view class="bottomBg" :style="'background-image: url('+this.$ImgUrl + 'user/greyBgBottom.png'+')'"></view>
		</view>
	</view>
</template>

<script>
	import {
		Dialog,
		Toast
	} from 'vant';
	import config from '../common/config.js'
	import {
		requestGet,
		requestPost
	} from '../common/request.js'
	export default {
		data() {
			return {
				ImgUrl: this.$ImgUrl,
				mealType: {
					1: '早餐',
					2: '中餐',
					3: '晚餐',
					4: '夜宵',
					5: '夜夜宵'
				},
				status: {
					0: '待扣款',
					1: '已付款',
					2: '已撤销',
					3: '已退款',
					4: '异常订单'
				},
				Record: uni.getStorageSync('rechargeDetail')
			}
		},
		onLoad(options) {},
		onUnload: function() {
			uni.removeStorageSync('rechargeDetail')
		},
		computed: {
			itemAmount() {
				return function(Amount) {
					if (Amount) {
						return (Amount / 100).toFixed(2)
					} else {
						return "0.00"
					}
				}
			},
		},
		methods: {
			// 跳转页面
			async goToPage(value) {
				switch (value) {
					case 1:
						uni.makePhoneCall({
							phoneNumber: '400-9656-210'
						})
						break;
					case 2:
						break;
					case 3:
						break;
					default:
						break;
				}
			},
		}
	}
</script>

<style lang="scss">
	.rechargeDetail {
		width: 100%;
		height: 100%;
		min-height: 100vh;
		background: #F1F1F3;

		.status {
			height: 45rpx;
			font-size: 32rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #FA6400;
			line-height: 45rpx;
			text-align: center;
		}

		.contentWrapper {
			padding: 25rpx 22rpx 0 25rpx;
			display: flex;
			flex-direction: column;



			.wrapper {
				margin: 0 8rpx;
				padding-top: 59rpx;
				width: 686rpx;
				display: flex;
				flex-direction: column;
				background: white;
				font-family: PingFangSC-Regular, PingFang SC;
				position: relative;

				.topBg {
					position: absolute;
					top: 0;
					left: -8rpx;
					width: 703rpx;
					height: 59rpx;
					background-size: cover;
					background-position: center center;
					z-index: 1;

					.line {
						width: 686rpx;
						height: 22rpx;
						margin-top: 9rpx;
						margin-left: 8rpx;
						background: linear-gradient(180deg, #D9D9D9 0%, #FFFFFF 100%);
						opacity: 0.75;
					}
				}

				.title {
					margin-top: 78rpx;
					width: 100%;
					height: 42rpx;
					font-size: 30rpx;
					font-weight: 400;
					color: #333333;
					line-height: 42rpx;
					text-align: center;
				}

				.amount {
					margin-top: 4rpx;
					width: 100%;
					height: 90rpx;
					font-size: 64rpx;
					color: #333333;
					font-weight: 600;
					line-height: 90rpx;
					text-align: center;
				}

				.rowItem {
					padding: 0 32rpx;
					margin-bottom: 37rpx;
					display: inline-flex;
					justify-content: space-between;
					height: 42rpx;
					line-height: 42rpx;
					font-size: 30rpx;
					color: #333333;

					.label {
						height: 42rpx;
						font-size: 30rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #333333;
						line-height: 42rpx;
					}

					.value {
						color: rgba(0, 0, 0, 0.5);
					}
				}

				.btn {
					padding: 165rpx 0 35rpx;

					.button {
						margin: 0 auto;
						width: 622rpx;
						height: 71rpx;
						line-height: 71rpx;
						background: #F1F1F3;
						border-radius: 12rpx;
						text-align: center;
						font-size: 28rpx;
						color: rgba(0, 0, 0, 0.5);
					}
				}
			}

			.bottomBg {
				width: 686rpx;
				height: 29rpx;
				background-size: cover;
				background-position: center center;
				margin: 0 8rpx;
			}
		}
	}
</style>