<template>
	<view class="uni-container" v-if="cardData">
		<u-navbar :autoBack="true" :placeholder="true" :bgColor="bgColor">
			<view slot='center' style="font-size: 36rpx; font-weight: bold;">
				权益详情
			</view>
		</u-navbar>
		<view class="date-box">
			<view class="title">有效日期</view>
			<view class="time">
				{{cardData.orderItemList[0].ticketOrderDetailList[0].availableStartTime.split(' ')[0]}}
				至
				{{cardData.orderItemList[0].ticketOrderDetailList[0].availableEndTime.split(' ')[0]}}
			</view>
		</view>
		<view class="date-box">
			<view class="title">年卡权益</view>
			<view class="row" v-for="(i, index) in cardData.orderItemList[0].ticketChildList" :key="index">
				<view class="mr32">{{i.childTicketName}} </view>
				<view class="time">{{i.isUnlimited == '1' ? '不限次数' : ('限' + i.canVerificationNum + '次，每月最多' + i.monthVerificationNum + '次，每日最多' + i.dayVerificationNum + '次')}}</view>
			</view>
		</view>
	</view>
</template>
<script>
	import _config from '../../common/http/config.js'
	export default {
		data() {
			return {
				bgColor: '#FFF',
                id: null,
				cardData: null
			};
		},
		onLoad(options) {
            this.id = options.id;
			this.orderNkDetail()
        },
		methods: {
			async orderNkDetail() {
				let info = await this.$http.orderNkDetail(this.id)
				this.cardData = info.data;
			},
		}
	}
</script>

<style lang="scss" scoped>
	.uni-container {
		width: 100%;
		min-height: 100vh;
		box-sizing: border-box;
		background: #FBFBFB;
		.date-box {
			background: #FFFFFF;
			border-radius: 10rpx;
			padding: 24rpx 32rpx;
			margin: 20rpx 32rpx 0;
			&:first-child {
				margin-top: 32rpx;
			}
			.title {
				font-weight: 500;
				font-size: 32rpx;
				color: #333333;
				margin-bottom: 20rpx;
			}
			.time {
				font-weight: 400;
				font-size: 28rpx;
				color: #666666;
			}
			.row {
				margin-top: 10rpx;
				font-size: 28rpx;
				color: #666666;
				display: flex;
				&:first-child {
					margin-top: 20rpx;
				}
				.mr32 {
					margin-right: 32rpx; max-width: 220rpx;  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
				}
				.time {
					flex: 1;
					.num {
						color: #03AE80;
					}
				}
			}
		}
	}
</style>