<template>
	<view class="content">
		<view class="t-header">
			<view class="title">待使用</view>
			<view class="time"><text>0017 1712 5994</text>待使用，请按课表到上课地点按时上课。</view>
		</view>
		<view class="t-shoping-card">
			<view class="t-shoping-info">
				<image class="shoping-img" src="https://img.shetu66.com/2023/06/13/1686646672844195.jpg" mode="">
				</image>
				<view class="shoping-info">
					<view class="name">一对一篮球30分钟室内精品课程，一对...</view>
					<view class="shoping-price">
						<view class="price">￥45.9</view>
						<view class="text">
							<text>实付</text>
							<text class="mini-text">￥</text>
							<text>25.1</text>
						</view>
					</view>
				</view>
			</view>
			<view class="t-shoping-address">
				<view class="time">02</view>
				<view class="unit">天</view>
				<view class="time">08</view>
				<view class="unit">:</view>
				<view class="time">56</view>
				<view class="unit">:</view>
				<view class="time">10</view>
				<view class="">后比赛开始</view>
			</view>
		</view>
		<!-- 待使用展示 -->
		<view class="t-qrcode-card">
			<view class="qrcode">
				<uv-qrcode ref="qrcode" size="100px" value="https://h5.uvui.cn"></uv-qrcode>
			</view>
			<view class="download-qrcode" @click="download_qrcode">下载到手机</view>
			<view class="t-todeused">
				<view class="todeused">
					<view class="text">待使用</view>
					<view class="time">07-25 14：25：45 到期</view>
				</view>
				<view class="order-num" v-for="item in 2">0017 1712 5994</view>
			</view>
		</view>
		<!-- 已使用已过期展示 -->
		<view class="t-qrcode-card">
			<view class="t-todeused" v-for="item in 2" style="border-bottom: 1rpx solid #F0F0F0;">
				<view class="todeused">
					<view class="text">已使用</view>
					<view class="time">07-25 14：25：45 到期</view>
				</view>
				<view class="order-num" @click="RouterUtils.to_page('/pages/index/tryUseRecord/index')">
					<text>0017 1712 5994  杨锦新</text>
					<zzx-icon name="ashRight" size="12"></zzx-icon>
				</view>
			</view>
		</view>
		<view class="t-address-card">
			<view class="address">
				<zzx-icon name="location"></zzx-icon>
				<view class="">印象城购物中心6楼</view>
			</view>
			<view class="nav-info">
				<view class="nav">
					<zzx-icon name="navigation" size="14"></zzx-icon>
					<view class="nav-text">导航</view>
				</view>
				<view class="phone">
					<zzx-icon name="phone" size="14"></zzx-icon>
					<view class="">电话</view>
				</view>
			</view>
		</view>
		<view class="t-order-info-card">
			<view class="title">订单信息</view>
			<view class="info-list">
				<view class="item-left">实际付款</view>
				<view class="item-right">￥25.9</view>
			</view>
			<view class="info-list">
				<view class="item-left">手机号码</view>
				<view class="item-right">189****5960</view>
			</view>
			<view class="info-list">
				<view class="item-left">订单编号</view>
				<view class="item-right">46476465456464156486</view>
			</view>
			<view class="info-list">
				<view class="item-left">下单时间</view>
				<view class="item-right">2023-7-25 14：25：45</view>
			</view>
			<view class="info-list">
				<view class="item-left">付款时间</view>
				<view class="item-right">2023-7-25 14：25：45</view>
			</view>
		</view>
		<!-- 已使用展示 -->
		<view class="appraise-btn">
			<view class="left">更多功能</view>
			<view class="right">查看成绩</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { ref } from 'vue';
	import {TipsUtils,RouterUtils} from '@/utils/util'
	const qrcode = ref()
	const download_qrcode = () => {     //下载二维码
		uni.showLoading()
		qrcode.value.save({
			success: (res) => {
				uni.hideLoading()
				TipsUtils.tips_toast('下载成功')
			},
			fail: (err) => {
				uni.hideLoading()
			}
		});
	}
	
	const torecord_page=()=>{
		uni.navigateTo({
			url:'/pages/index/verificationRecord/index'
		})
	}
</script>

<style lang="less" scoped>
	.t-header {
		margin-top: 20rpx;

		.title {
			font-weight: bold;
			font-size: 36rpx;
			color: #222222;
		}

		.time {
			margin-top: 20rpx;
			font-size: 24rpx;
			color: #AAAAAA;

			&>text {
				font-size: 28rpx;
				color: #222222;
			}
		}
	}

	.t-shoping-card {
		margin-top: 20rpx;
		padding: 20rpx;
		background: #FFFFFF;
		border-radius: 32rpx;

		.t-shoping-info {
			display: flex;
			align-items: center;
			gap: 20rpx;

			.shoping-img {
				width: 200rpx;
				height: 200rpx;
				border-radius: 32rpx;
			}

			.shoping-info {
				width: 450rpx;

				.name {
					font-weight: 800;
					font-size: 32rpx;
					color: #222222;
				}

				.shoping-price {
					display: flex;
					align-items: center;
					justify-content: space-between;

					.price {
						font-weight: bold;
						font-size: 32rpx;
						color: #FB5B5B;
					}

					.text {
						&>text:first-child {
							font-size: 28rpx;
							color: #222222;
						}

						&>text:last-child {
							font-weight: 800;
							font-size: 48rpx;
							color: #FB5B5B;
						}
					}
				}
			}
		}

		.t-shoping-address {
			margin-top: 20rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			gap: 8rpx;
			font-weight: bold;
			font-size: 28rpx;
			color: #222222;
			border-top: 1rpx solid #F0F0F0;
			height: 80rpx;
			.time{
				width: 60rpx;
				height: 60rpx;
				background: rgba(200,255,12,0.5);
				border-radius: 16rpx;
				text-align: center;
				line-height: 60rpx;
			}
		}

		.t-invite {
			margin-top: 24rpx;
			font-size: 28rpx;
			color: #FDD143;
			text-align: center;
		}
	}

	.t-qrcode-card {
		margin-top: 20rpx;
		padding: 20rpx;
		background: #FFFFFF;
		border-radius: 32rpx;

		.qrcode {
			margin: auto;
			width: 200rpx;
			height: 200rpx;
			border-radius: 16rpx;
		}

		.download-qrcode {
			margin: auto;
			margin-top: 24rpx;
			width: 226rpx;
			height: 68rpx;
			background: #C8FF0C;
			border-radius: 60rpx;
			font-weight: bold;
			font-size: 28rpx;
			color: #222222;
			text-align: center;
			line-height: 68rpx;
		}

		.t-todeused {
			margin-top: 20rpx;

			.todeused {
				display: flex;
				align-items: center;
				gap: 20rpx;

				.text {
					font-size: 28rpx;
					color: #222222;
				}

				.time {
					font-size: 28rpx;
					color: #AAAAAA;
				}
			}

			.order-num {
				margin-top: 20rpx;
				font-size: 28rpx;
				color: #AAAAAA;
				display: flex;
				align-items: center;
				gap: 8rpx;
				&>text{
					margin-bottom: 8rpx;
				}
			}
		}
	}
	.t-scheduled-card{
		margin-top: 20rpx;
		padding: 20rpx;
		background: #FFFFFF;
		border-radius: 32rpx;
		.s-title{
			font-weight: bold;
			font-size: 28rpx;
			color: #222222;
		}
		.t-scheduled-list{
			.item-list{
				display: flex;
				align-items: center;
				gap: 20rpx;
				margin-top: 20rpx;
				.list-left{
					font-size: 24rpx;
					color: #AAAAAA;
				}
				.list-right{
					font-weight: bold;
					font-size: 24rpx;
					color: #222222;
				}
			}
		}
	}

	.t-address-card {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 20rpx;
		padding: 20rpx;
		background: #FFFFFF;
		border-radius: 32rpx;

		.address {
			display: flex;
			align-items: center;
			gap: 4rpx;
			font-weight: bold;
			font-size: 24rpx;
			color: #222222;
		}

		.nav-info {
			display: flex;
			align-items: center;
			text-align: center;
			gap: 32rpx;
			font-size: 22rpx;
			color: #222222;
		}
	}

	.t-use-card {
		margin-top: 20rpx;
		padding: 20rpx;
		background: #FFFFFF;
		border-radius: 32rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;

		.use-tips {
			.title {
				font-weight: bold;
				font-size: 32rpx;
				color: #222222;
			}

			.text {
				margin-top: 20rpx;
				font-size: 28rpx;
				color: #AAAAAA;
			}
		}

		.check-all {
			display: flex;
			align-items: center;
			gap: 10rpx;
			font-size: 24rpx;
			color: #AAAAAA;

			&>text {
				margin-bottom: 10rpx;
			}
		}
	}

	.t-order-info-card {
		margin-top: 20rpx;
		padding: 20rpx;
		background: #FFFFFF;
		border-radius: 32rpx;

		.title {
			font-weight: bold;
			font-size: 32rpx;
			color: #222222;
		}

		.info-list {
			display: flex;
			align-items: center;
			gap: 24rpx;
			margin-top: 20rpx;

			.item-left {
				font-size: 28rpx;
				color: #AAAAAA;
			}

			.item-right {
				font-size: 28rpx;
				color: #222222;
			}
		}
	}
	.appraise-btn{
		margin-top: 20rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: #FFFFFF;
		border-radius: 32rpx;
		padding: 20rpx;
		.left{
			font-weight: bold;
			font-size: 32rpx;
			color: #222222;
		}
		.right{
			width: 226rpx;
			height: 68rpx;
			background: #C8FF0C;
			border-radius: 60rpx;
			text-align: center;
			line-height: 68rpx;
			font-weight: bold;
			font-size: 28rpx;
			color: #222222;
		}
	}
</style>