<template>
	<view class="container">
		<view class="row b-b flex">
			<text class="tit">卡片类型</text>
			<view class="input">{{ info.cards[0].type == 1 ? '时效卡' : '次卡' }}</view>
		</view>
		<view v-for="(item, index) in info.cards">
			<view class="row b-b flex">
				<text class="tit">服务类型</text>
				<view class="input">{{ item.name }}</view>
			</view>
			<view class="row b-b flex" v-if="info.cards[0].type != 1">
				<text class="tit">剩余次数</text>
				<view class="input">{{ item.number }}</view>
			</view>
		</view>
		<view class="main">
			<view class="title">
				<view class="title-left"></view>
				<view class="title-font">卡片详情</view>
				<view class="title-right"></view>
			</view>
			<view class="detail-desc"><rich-text :nodes="info.introduce"></rich-text></view>
		</view>
	</view>
</template>

<script>
import { user_card_details } from '@/api/jdr.js';
import { mapState, mapMutations } from 'vuex';
export default {
	data() {
		return {
			id: '',
			info: '',
			istype: false
		};
	},
	computed: {
		// #ifdef H5
		...mapState(['weichatObj']),
		// #endif
		...mapState('user', ['userInfo'])
	},
	onLoad(opt) {
		this.id = opt.id;
		this.loadData();
	},
	methods: {
		loadData() {
			user_card_details({}, this.id).then(({ data }) => {
				this.info = data;
			});
		}
	}
};
</script>

<style lang="scss">
page,
.container {
	min-height: 100%;
	height: auto;
	background: #ffffff;
}
.top {
	position: relative;
	height: 346rpx;
	width: 750rpx;
	image {
		width: 100%;
		height: 100%;
	}
}
.main {
	position: relative;
	z-index: 2;
	width: 750rpx;
	background: #ffffff;
	border-radius: 20rpx 20rpx 5rpx 5rpx;
	margin-top: -10rpx;
	padding: 46rpx 44rpx;
	.title {
		display: flex;
		justify-content: center;
		align-items: center;
		.title-font {
			font-size: 32rpx;
			font-family: ZhenyanGB;
			font-weight: 400;
			color: #bd9360;
		}
	}
}
.btn {
	width: 620rpx;
	height: 80rpx;
	background: linear-gradient(270deg, #ffe7c4, #ffce8a);
	border-radius: 40rpx;
	margin: 58rpx auto 0;
	font-size: 32rpx;
	font-family: PingFang SC;
	font-weight: bold;
	color: #9f570e;
	line-height: 80rpx;
	text-align: center;
}
.two {
	margin: 26rpx 0 0;
	font-size: 28rpx;
	text-align: center;
	font-family: PingFang SC;
	font-weight: 500;
	color: #999999;
	text {
		color: #ff383e;
	}
}
.row {
	display: flex;
	align-items: center;
	position: relative;
	padding: 30rpx;
	background: #fff;
	.order-status {
		font-size: $font-lg;
		color: $color-red;
		font-weight: 500;
	}
	.refund {
		font-size: 30rpx;
		color: $font-color-dark;
	}
	.noRefund {
		font-size: 30rpx;
		color: $font-color-light;
	}
	.tit {
		flex-shrink: 0;
		width: 120rpx;
		font-size: 30rpx;
		color: $font-color-dark;
	}
	.input {
		text-align: right;
		flex: 1;
		font-size: 30rpx;
		color: $font-color-dark;
		&.payColor {
			color: $color-red;
		}
	}
	.iconlocation {
		font-size: 36rpx;
		color: $font-color-light;
	}
}
</style>
