<template>
	<view class="pages-box">
		<uv-navbar autoBack title="确认订单" placeholder />
		<view class="tab-container">
			<!-- 标签栏 -->
			<view class="tabs">
				<template v-for="item in tabList">
					<view class="tab-item" :class="{ 'active-tab-item': currentTab === item.value }"
						@click.stop="currentTab = item.value">
						{{ item.lable }}
					</view>
				</template>
			</view>
		</view>

		<view class="shipping-address">
			<text class="iconfont icon">&#xe990;</text>
			<view class="text">
				<view>暂无收货地址</view>
				<view>立即添加收货地址</view>
			</view>
			<text class="iconfont more">&#xe671;</text>
		</view>


		<view class="divide" />
		<!-- 商品信息 -->
		<OrderGoods />
		<view class="divide" />
		<!-- 订单金额信息 -->
		<OrderPrice />
		<view class="divide" />
		<!-- 备注 -->
		<view class="remark-box">
			<view class="remark-label">
				备注：
			</view>
			<view class="remark-content">
				<textarea class="remark-textarea" auto-height placeholder-style="color:#CCCCCC"
					placeholder="选填，给商家留言" />
			</view>
		</view>


		<view class="footer-box">
			<view class="footer-divide" />
			<view class="footer-btns">
				<view class="footer-value">
					<text class="tag">￥</text>
					<text class="price">37.6</text>
					共计
					<text class="num">4</text>
					件
				</view>
				<view class="footer-btn confirm-btn" @click.stop="submitOrder()">
					提交订单
				</view>
			</view>
		</view>


	</view>


</template>

<script lang="ts" setup>
	import { ref } from "vue";
	import OrderGoods from "./components/OrderGoods.vue";
	import OrderPrice from "./components/OrderPrice.vue";
	import OrderInfo from "./components/OrderInfo.vue";

	const tabList = [
		{
			lable: '快递配送',
			value: 'dispatching'
		},
		{
			lable: '上门自提',
			value: 'willCall'
		}
	]
	const currentTab = ref<'dispatching' | 'willCall'>('dispatching');
	
	
	const submitOrder = () => {
		uni.navigateTo({
			url:"/pages/order/OrderParticulars"
		})
	}
</script>

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

	.divide {
		width: 100%;
		height: 30rpx;
	}

	.tabs {
		// position: fixed;
		width: 100%;
		display: flex;
		align-items: center;
		background-color: #fdeee9;
		border-radius: 24rpx 24rpx 0rpx 0rpx;
		height: 85rpx;

		.tab-item {
			width: 50%;
			height: 85rpx;
			line-height: 85rpx;
			flex-shrink: 0;
			text-align: center;
			font-size: 34rpx;
			font-family: PingFang SC, PingFang SC-Regular;
			font-weight: 400;
			color: #1a1a1a;
		}

		.active-tab-item {
			background-color: #fff;
			// clip-path: polygon(0% 0%, 95% 0%, 95.5% 3%, 96% 6%, 96.5% 9%, 94% 12%, 95% 15%, 96% 60%, 97% 70%, 98% 80%, 99% 90%, 100% 100%, 0% 100%);
			// /* 这将创建一个波浪形的效果 */ 
			// clip-path: path('M0,0 L200,0 L200,80 Q80,65, 180,60 L0,60 Z');
			// clip-path: path("M0 100 Q50 0, 100 100 T200 100 T300 100 V200 H0 Z");
		}
	}

	.shipping-address {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 28rpx 30rpx 40rpx;
		box-sizing: border-box;
		background-color: #fff;

		.icon {
			flex-shrink: 0;
			font-size: 40rpx;
			color: red;
		}

		.more {
			flex-shrink: 0;
		}

		.text {
			padding: 0 25rpx;
			flex: 1;
			overflow: hidden;
		}
	}

	.remark-box {
		box-sizing: border-box;
		padding: 30rpx;
		width: 100%;
		background-color: #fff;
		display: flex;
		justify-content: flex-start;

		.remark-label {
			font-size: 28rpx;
			font-family: PingFang SC, PingFang SC-Regular;
			font-weight: 400;
			color: #060606;
			padding: 10rpx 10rpx 0 0;
		}

		.remark-content {
			flex: 1;
			background: #f7f7f7;
			border: 1rpx solid #e6e6e6;
			border-radius: 10rpx;
			padding: 10rpx 20rpx;

			.remark-textarea {
				width: 100%;
				min-height: 200rpx;
			}
		}
	}




	.footer-box {
		.footer-divide {
			width: 100%;
			height: 160rpx;
		}

		.footer-btns {
			position: fixed;
			left: 0;
			right: 0;
			bottom: 0;
			z-index: 1;
			width: 100%;
			height: 130rpx;
			background: #ffffff;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 23rpx;
			box-sizing: border-box;

			.footer-btn {
				width: 192rpx;
				height: 76rpx;
				border-radius: 10rpx;
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				text-align: center;
				line-height: 76rpx;
			}

			.footer-value {
				display: flex;
				align-items: baseline;
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Regular;
				font-weight: 400;
				color: #666666;

				.tag {
					font-size: 24rpx;
					color: #DA4F4F;
				}

				.price {
					font-size: 41rpx;
					font-weight: normal;
					color: #da4f4f;
					padding-right: 15rpx;
				}

				.num {
					color: #da4f4f;
				}
			}

			.confirm-btn {
				margin-left: 30rpx;
				background: #e93534;
				color: #ffffff;
			}
		}
	}
</style>