<template>
	<view class="pages-box">
		<uv-navbar autoBack title="下单支付" placeholder bgColor="transparent" />
		<view class="pay-content">
			<view class="pay-price">
				<text class="pay-tag">￥</text>
				<text class="pay-num">1000.00</text>
			</view>
			<view class="pay-hint">实际付款金额</view>
		</view>
		<view class="pay-way">
			<view class="way-label">支付方式</view>
			<template v-for="item in payWayList">
				<view :class="['way-item' , payWay === item.value ? 'active-way-item' : '']"
					@click.stop="payWay = item.value">
					<view class="way-item-label">
						<text :class="['iconfont' , item.class] " v-html="item.icon" />
						<text class="label-text">{{item.label}}</text>
					</view>
					<view class="select-box" />
				</view>
			</template>

			<view class="pay-btn">
				确认支付 00.19.59
			</view>
			<view class="pay-time-hint">
				请在<text>20</text>分钟内完成付款，否则订单失效
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { ref } from 'vue';

	const payWayList = [
		{
			label: '支付宝支付',
			value: 'zfb',
			icon: '&#xe611;',
			class: 'zfb-icon'
		},
		{
			label: '微信支付',
			value: 'weixin',
			icon: '&#xe663;',
			class: 'wx-icon'
		}
	]


	const payWay = ref<'zfb' | 'weixin'>('zfb')
</script>

<style lang="scss" scoped>
	.pages-box {
		min-height: 100vh;
		background-color: $my-pages-bg;
		display: flex;
		flex-direction: column;

		.pay-content {
			width: 100%;
			height: 250rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			flex-direction: column;

			.pay-price {
				color: #eb5153;

				.pay-tag {
					font-size: 30rpx;
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: 400;
				}

				.pay-num {
					font-size: 60rpx;
					font-weight: normal;
				}
			}

			.pay-hint {
				padding-top: 10rpx;
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Regular;
				font-weight: 400;
				color: #1a1a1a;
			}
		}

		.pay-way {
			flex: 1;
			background-color: #fff;
			padding: 40rpx 54rpx 0;

			.way-label {
				font-size: 38rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #1a1a1a;
				line-height: 53rpx;
				padding-bottom: 32rpx;
			}

			.way-item {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding-bottom: 20rpx;

				.way-item-label {
					display: flex;
					align-items: center;

					.label-text {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						color: #1a1a1a;
						padding-left: 18rpx;
					}

					.iconfont {
						font-size: 40rpx;
					}

					.zfb-icon {
						color: #3775F6;
					}

					.wx-icon {
						color: #09BB07;
					}
				}

				.select-box {
					width: 36rpx;
					height: 36rpx;
					border: 2rpx solid #b3b3b3;
					border-radius: 50%;
				}
			}

			.active-way-item {
				.select-box {
					border-color: #3775f6;
					position: relative;

					&:before {
						content: '';
						position: absolute;
						left: 50%;
						top: 50%;
						width: 18rpx;
						height: 18rpx;
						background: #3775f6;
						border-radius: 50%;
						transform: translate(-50%, -50%);
					}
				}
			}

			.pay-btn {
				width: 100%;
				height: 90rpx;
				background: #eb5153;
				border-radius: 45rpx;
				text-align: center;
				line-height: 90rpx;
				font-size: 32rpx;
				font-family: PingFang SC, PingFang SC-Regular;
				font-weight: 400;
				color: #ffffff;
				margin-top: 135rpx;
			}

			.pay-time-hint {
				padding-top: 20rpx;
				font-size: 24rpx;
				// font-family: .PingFang SC, .PingFang SC-Light;
				font-weight: 300;
				text-align: center;
				color: #808080;

				text {
					color: #FF0000;
				}
			}
		}
	}
</style>