<template>
	<view class="index-content-other" v-show="isShow">
		<view class="index-content-right">
			<!-- 解决margin重叠问题 -->
			<view class="index-right-height"></view>
			<view class="index-right-title">
				<view class="index-right-name">
					采购单号
				</view>
				<input class="index-right-input" placeholder="请输入采购单号" />
				<view class="index-right-name">
					供应商
				</view>
				<input class="index-right-input" placeholder="请输入供应商" />
				<view class="index-right-name">
					订单流程
				</view>
				<input class="index-right-input" placeholder="请输入货品拼音" />
				<view class="index-right-name">
					订单状态
				</view>
				<picker :value="stateTarget" :range="stateArray" @change="changeStateTarget">
					<view class="index-right-input" v-if="stateTarget!==-1">{{stateArray[stateTarget]}}</view>
					<view class="index-right-input" style="color: #999;" v-else>
						请选择订单状态
					</view>
				</picker>
				<view class="ball-bgc">
					<view class="ball-yellow">
						采购
					</view>
				</view>
				<view class="ball-bgc">
					<view class="ball-green">
						拣货
					</view>
				</view>
				<view class="ball-bgc">
					<view class="ball-blue">
						结账
					</view>
				</view>
				<view class="index-right-button-all">
					<view class="" v-for="(item,index) in buttonList" :key="index">
						<view class="index-right-button">
							<image class="index-right-button-img" :src="item.url" />
							<view class="index-right-button-font">
								{{item.name}}
							</view>
						</view>
					</view>

				</view>
			</view>
			<view class="swiper-contain">
				<scroll-view scroll-y style="height: 98%;" :show-scrollbar="false">
					<view class="swiper-flex">
						<view v-for="(item,index) in cardArray" :key="index">
							<view class="swiper-card" style="border-color: #FF642F ;" v-if="!item.cardType">
								<view class="swiper-title" style="background: linear-gradient(to bottom,#FF642F  ,#FF5D36  ,#FFAD91  );">
									<view class="swiper-title-contect" style="background: linear-gradient( to right,#E1E9FF ,#DDC9FF,#FF642F );">
										<view class="swiper-states">
											<view class="swiper-states-heng-one"></view>
											<view class="swiper-states-heng-two"></view>
											<view class="ball-bgc">
												<view class="ball-red">
													采购
												</view>
											</view>
											<view class="ball-bgc">
												<view class="ball-white">
													拣货
												</view>
											</view>
											<view class="ball-bgc">
												<view class="ball-white">
													结账
												</view>
											</view>
										</view>
										<view class="title-button-red">
											已作废
										</view>
									</view>
								</view>
							</view>
							<view class="swiper-card" style="border-color: #149A00 ;" v-if="item.cardType===5">
								<view class="swiper-title" style="background: linear-gradient(to bottom,#149A00  ,#BFF47D   );">
									<view class="swiper-title-contect" style="background: linear-gradient( to right,#CEDDFD  ,#F2EAFF ,#E2EDFE,#89CE3F  );">
										<view class="swiper-states">
											<view class="swiper-states-heng-one"></view>
											<view class="swiper-states-heng-two"></view>
											<view class="ball-bgc">
												<view class="ball-yellow">
													采购
												</view>
											</view>
											<view class="ball-bgc">
												<view class="ball-green">
													拣货
												</view>
											</view>
											<view class="ball-bgc">
												<view class="ball-blue">
													结账
												</view>
											</view>
										</view>
										<view class="title-button">
											已结账
										</view>
									</view>
								</view>
							</view>
							<view class="swiper-card" v-if="item.cardType!==5 && item.cardType !==0">
								<view class="swiper-title">
									<view class="swiper-title-contect">
										<view class="swiper-states">
											<view class="swiper-states-heng-one"></view>
											<view class="swiper-states-heng-two"></view>
											<view class="ball-bgc">
												<view class="ball-yellow">
													采购
												</view>
											</view>
											<view class="ball-bgc">
												<view class="ball-green">
													拣货
												</view>
											</view>
											<view class="ball-bgc">
												<view class="ball-blue">
													结账
												</view>
											</view>
										</view>
										<view class="title-button">
											未确认
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
		</view>
		<view class="index-content-down">
			长春市朝阳区久泰开运养老服务有限公司
		</view>
	</view>
	<!-- 表格详情的的弹出层 -->
	<view v-show="detailisopen && isShow" class="popup-detail" @click="detailisopen=false">
		<view class="popup-detail-content" :style="{ opacity: detailisopacity ? 1 : 0 }" @click.stop>
			<view class="popup-detail-left">
				<view class="popup-detail-left-white">
					<image class="popup-detail-left-white-img" :src="`/static/index/project3.png`"
						@click="opendetail" />
				</view>
				<view class="popup-detail-left-bottom">

				</view>
			</view>
			<view class="popup-detail-right">

			</view>
		</view>
	</view>

</template>

<script setup lang="ts">
	import { ref, onMounted, onBeforeUnmount, computed, nextTick, defineProps } from 'vue';

	const props = defineProps({
		isShow: {
			type: Boolean,
			required: true,
		},
	});
	// 表格弹窗
	const detailisopen = ref(false);
	const detailisopacity = ref(false);
	// 初始化左侧菜单列表
	const buttonList = ref([
		// { url: '/static/index/Warehousing/zuoce.png', name: '请购单' },
		{ url: '/static/index/Warehousing/sousuo.png', name: '查询' },
		{ url: '/static/index/Warehousing/chongzhi.png', name: '重置' },

	]);
	const stateTarget = ref(-1);
	const stateArray = ref(['所有状态', '未确认', '已确认', '未完结', '待结账', '已结账', '已作废']);
	const cardArray = ref(
		Array.from({ length: 6 }, (_, index) => ({ cardType: index }))
	);
	const opendetail = () => {
		detailisopen.value = true;
		detailisopacity.value = false;
		setTimeout(() => {
			detailisopacity.value = true
		}, 200)
	}
	const changeStateTarget = (e : any) => {
		stateTarget.value = e.detail.value
	}
</script>

<style scoped lang="less">
	.index-content-other {
		width: calc(100% - 170rpx);
		height: 100%;
	}

	.index-content-right {
		height: calc(100% - 100rpx);
		width: calc(100% - 60rpx);
		background-color: rgba(255, 255, 255, 0.5);
		/* 白色背景透明度为 10% */
		background-image: url('/static/index/mountain.png');
		background-position: 70% 45%;
		border-radius: 50rpx;
		box-shadow: 4rpx 8rpx 16rpx 4rpx rgba(0, 0, 0, 0.3);
		border-radius: 1rpx solid #fff;

		.index-right-height {
			height: 20rpx;
		}

		.index-right-title {
			margin-left: 30rpx;
			width: calc(100% - 60rpx);
			height: 120rpx;
			background: linear-gradient(to right, #C4E0FD, #D5CDFF, #D9ECFF);
			border-radius: 35rpx;
			border: 2rpx solid #fff;
			display: flex;
			align-items: center;

			.index-right-name {
				margin-left: 20rpx;
				margin-right: 10rpx;
				color: #19233B;
				font-size: 30rpx;
			}

			.index-right-input {
				font-size: 23rpx;
				width: 180rpx;
				border: 2rpx #a0adc8 solid;
				padding: 15rpx 0 15rpx 10rpx;
				background-color: rgba(234, 243, 254, 0.6);
				border-radius: 10rpx;
			}

			.index-right-button-all {
				height: 100%;
				margin-left: auto;
				display: flex;
				align-items: center;

				.index-right-button {
					// width: 160rpx;
					height: 70rpx;
					background: linear-gradient(to right bottom, #00c9ff, #0076ff);
					color: #fff;
					font-size: 30rpx;
					display: flex;
					align-items: center;
					border-radius: 10rpx;
					border: 1rpx solid #fff;
					margin-right: 20rpx;

					.index-right-button-img {
						width: 45rpx;
						height: 45rpx;
						margin: 0 5rpx 0 10rpx;
					}

					.index-right-button-font {
						margin-right: 20rpx;
					}
				}
			}
		}
	}

	.index-content-down {
		width: calc(100% - 60rpx);
		height: 100rpx;
		display: flex;
		justify-content: flex-end;
		align-items: center;
	}

	.swiper-contain {
		width: 100%;
		margin-left: 10rpx;
		// width: calc(100% - 60rpx);
		height: calc(100% - 140rpx);

		.swiper-flex {
			display: flex;
			flex-wrap: wrap;

			.swiper-card {
				margin: 20rpx 0 0 20rpx;
				width: 1007rpx;
				height: 530rpx;
				// border: 2rpx solid #fff;
				border-top: 4rpx solid #FFA504;
				border-radius: 30rpx;
				/* 设置背景图和白色背景 */
				background: url("/static/index/clearmountain.png") center/cover, rgba(255, 255, 255, 0.5);
				/* 使用 screen 混合模式，让图像与白色混合变淡 */
				background-blend-mode: screen;
				isolation: isolate;
				box-shadow: 2rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.3);
				display: flex;
				position: relative;
				overflow: hidden;
				.swiper-title {
					width: 100%;
					height: 120rpx;
					// background: linear-gradient( to right,#CEDDFD ,#F2EAFF ,#E2EDFE ,#FFD825 );
					background: linear-gradient(to bottom,#FFA504 ,#FFD926 ,#FFF5B3 );
					// border-top-right-radius: 30rpx;
					// border-top-left-radius: 30rpx;
					// border-style: solid linear-gradient(to bottom,#FFA504 , #FFD926, #FFF5B3);
					// border-width: 0 4rpx;
					/* 上下为0，左右为4px */
					// border-image: linear-gradient(to bottom,#FFA504 , #FFD926, #FFF5B3) 1;
					.swiper-title-contect{
						margin: 2rpx 5rpx;
						margin-bottom: 0;
						width: calc(100% - 10rpx);
						height: 115rpx;
						background: linear-gradient( to right,#CEDDFD ,#F2EAFF ,#E2EDFE ,#FFD825 );
						border-top-right-radius: 30rpx;
						border-top-left-radius: 30rpx;
						display: flex;
						justify-content: space-between;
						align-items: center;
						.swiper-states{
							display: flex;
							justify-content: space-between;
							align-items: center;
							width: 350rpx;
							height: 100%;
							position: relative;
							.swiper-states-heng-one{
								position: absolute;
								top: 50%;
								left: 80rpx;
								width: 100rpx;
								height: 10rpx;
								background-color: #C6CBF6 ;
								
							}
							.swiper-states-heng-two{
								position: absolute;
								top: 50%;
								left: 180rpx;
								width: 100rpx;
								height: 10rpx;
								background-color: #C6CBF6 ;
							}
						}
					}
				}
		
			}
		}
	}

	.swiper-heng {
		width: 100rpx;
		height: 10rpx;
		background: linear-gradient(to right, #0EA7DD, #047ADB);
		border-radius: 30rpx;
		margin-top: 10rpx;
		margin-bottom: 30rpx;
	}

	.popup-detail {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		justify-content: center;
		align-items: center;
		backdrop-filter: blur(1rpx);
		background-color: rgba(89, 109, 154, 0.4);
		/* 添加毛玻璃效果 */
		z-index: 999;

		.popup-detail-content {
			display: flex;
			width: 1500rpx;
			height: 900rpx;
			background: url("/static/index/lightbgcnew.png") center/cover, rgba(255, 255, 255, 0.5);
			background-blend-mode: screen;
			border: 2rpx solid #fff;
			/* 使用 screen 混合模式，让图像与白色混合变淡 */
			border-radius: 30rpx;
			box-shadow: 10rpx 10rpx 20rpx rgba(0, 0, 0, 0.1);
			transition: opacity 0.4s ease;

			.popup-detail-left {
				height: 100%;
				width: 45%;

				.popup-detail-left-white {
					margin: 70rpx 0 0rpx 70rpx;
					width: 600rpx;
					height: 600rpx;
					// background-color: #fff;
					background-color: rgba(255, 255, 255, 0.3);
					display: flex;
					border-radius: 30rpx;
					justify-content: center;
					align-items: center;

					.popup-detail-left-white-img {
						width: 550rpx;
						height: 550rpx;
					}
				}

				.popup-detail-left-bottom {
					width: calc(100% - 70rpx);
					margin-left: 70rpx;
					height: 230rpx;
					background-color: #fff;
				}
			}

			.popup-detail-right {
				height: 100%;
				width: 55%;
			}
		}
	}

	.ball-bgc {
		background-color: #fff;
		width: 90rpx;
		height: 90rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 50%;
		margin-left: 20rpx;
		box-shadow: 2rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.3);
		z-index: 1;
	}

	.ball-yellow {
		background: linear-gradient(to top right, #FF9F00, #FFDF2A);
		width: 80rpx;
		height: 80rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 50%;
		color: #A53600;
		font-size: 25rpx;
	}
	.ball-red{
		background: #FF642F;
		width: 80rpx;
		height: 80rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 50%;
		color: #fff;
		font-size: 25rpx;
	}
	.ball-white{
		background: #DEDEDE ;
		width: 80rpx;
		height: 80rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 50%;
		color: #585858 ;
		font-size: 25rpx;
	}
	.ball-green {
		background: linear-gradient(to top right, #72C300, #BFED7F);
		width: 80rpx;
		height: 80rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 50%;
		color: #2C9115;
		font-size: 25rpx;
	}

	.ball-blue {
		background: rgb(139, 221, 221);
		width: 80rpx;
		height: 80rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 50%;
		color: #058482;
		font-size: 25rpx;
	}
	.title-button{
		margin-right: 30rpx;
		border: 2rpx solid #fff;
		border-radius: 20rpx;
		background: linear-gradient(to right,#FFDF2A ,#FF9F00 );
		color: #fff;
		padding: 10rpx 20rpx;
	}
	.title-button-red{
		margin-right: 30rpx;
		border: 2rpx solid #fff;
		border-radius: 20rpx;
		background: linear-gradient(to right,#FF642F  ,#FF5D36  );
		color: #fff;
		padding: 10rpx 20rpx;
	}
</style>