<template>
	<div class="sf-city-services">
		<div class="header">
			<div class="logo">
				<img src="/logo.png" alt="Logo" class="logo-image">
				<span class="title">顺丰快递</span>
			</div>
			<nav>
				<ul>
					<a href="">
						<li><router-link to="">首页</router-link></li>
					</a>
					<a href="">
						<li><router-link to="">物流服务</router-link></li>
					</a>
					<a href="">
						<li><router-link to="">智慧科技</router-link></li>
					</a>
					<a href="">
						<li><router-link to="">服务支持</router-link></li>
					</a>
					<a href="">
						<li><router-link to="">可持续发展</router-link></li>
					</a>
					<a href="">
						<li><router-link to="">投资者关系</router-link></li>
					</a>
					<a href="">
						<li><router-link to="">关于我们</router-link></li>
					</a>
				</ul>
			</nav>
			<div @click="loginToRouter" class="auth">快速登录/注册</div>
		</div>
		<div class="carousel">
			<div v-for="(item, index) in carouselItems" :key="index" class="carousel-item"
				:class="{ active: currentIndex === index }">
				<img :src="item.image" alt="轮播图" />
				<div class="carousel-caption">
					<h2>{{ item.title }}</h2>
					<p>{{ item.description }}</p>
				</div>
			</div>
			<button @click="prevSlide" class="carousel-control prev"><i class="fas fa-angle-left"></i></button>
			<button @click="nextSlide" class="carousel-control next"><i class="fas fa-angle-right"></i></button>
		</div>
		<div class="main-content">

			<h1 style="text-align: center;">旭日城市服务</h1>
			<h2 style="text-align: center;">「批发市场」寄递方案</h2>
			<p style="text-align: center;">满足多重寄递需求灵活高效价更优</p>
			<div class="search-section">
				<input type="text" placeholder="您可以输运单号进行查询" class="search-input" />
				<button class="search-button">马上查单</button>
			</div>

			<div class="services-grid">
				<div class="service-item">
					<img src="/a1.png" alt="服务图片" />
					<h3>快递服务</h3>
					<p>快速、安全、可靠</p>
				</div>
				<div class="service-item">
					<img src="/a2.png" alt="服务图片" />
					<h3>快运服务</h3>
					<p>大件物品运输专家</p>
				</div>
				<div class="service-item">
					<img src="/a3.png" alt="服务图片" />
					<h3>冷运服务</h3>
					<p>全程冷链，新鲜保障</p>
				</div>
				<div class="service-item">
					<img src="/a4.png" alt="服务图片" />
					<h3>医药服务</h3>
					<p>专业医药物流解决方案</p>
				</div>
			</div>
			<div class="additional-services">
				<h3 style="text-align: center;">顺丰特快</h3>
				<p>旭日致力于成为连接亚洲与世界的全球领先物流企业。未来，顺丰将继续稳固国内市场领导地位，持续扩大在亚洲和全球市场影响力，携手客户共同成长，共创价值</p>
				<div class="customer-service">
					<h4 class="contact-title" style="text-align: center;">联系客服</h4>
					<p style="text-align: center;">整车直达</p>
					<p style="text-align: center;">满足客户一辆或多辆整车发货需求的定制的整车直达产品</p>
				</div>
			</div>
		</div>
		<footer class="footer">
			<div class="footer-content">
				<div class="footer-section">
					<h4>关于我们</h4>
					<a href="">
						<p>公司简介</p>
					</a>
					<a href="">
						<p>企业文化</p>
					</a>
					<a href="">
						<p>发展历程</p>
					</a>
				</div>
				<div class="footer-section">
					<h4>联系我们</h4>
					<p>电话：123-456-7890</p>
					<p>邮箱：info@sf-express.com</p>
					<p>地址：中国福建省福州市</p>
				</div>
				<div class="footer-section">
					<h4>关注我们</h4>
					<p>QQ：123456789</p>
					<p>微博：旭日快递</p>
				</div>
			</div>
			<div class="footer-bottom">
				<p>&copy; 2024 旭日速运有限公司. 版权所有。</p>
			</div>
		</footer>
	</div>
</template>

<script setup>
	import {
		ref,
		computed,
		onMounted
	} from "vue";
	import {
		useRouter
	} from "vue-router";

	const router = useRouter();

	const currentIndex = ref(0);
	const carouselItems = ref([{
				image: '/1.png',
				title: '全程保障，畅行无忧',
				description: '精确时效，完美物流体验'
			},
			{
				image: '/2.png',
				title: '智能物流，开创未来',
				description: '深度融合科技，提升运输效率'
			},
			{
				image: '/3.png',
				title: '绿色运输，保护环境',
				description: '低碳排放，绿色物流，让未来更美好'
			}
		]);

	const nextSlide = () => {
		currentIndex.value = (currentIndex.value + 1) % carouselItems.value.length;
	};

	const prevSlide = () => {
		currentIndex.value = (currentIndex.value - 1 + carouselItems.value.length) % carouselItems.value.length;
	};

	const loginToRouter = () => {
		router.push({
			name: "login"
		});
	};

	onMounted(() => {
		setInterval(() => {
			nextSlide();
		}, 5000); // 每5秒自动切换一次
	});
</script>

<style scoped>
.sf-city-services {
		font-family: 'Helvetica Neue', Arial, sans-serif;
		background-color: #f5f5f5;
		min-height: 100vh;
		display: flex;
		flex-direction: column;
	}

	.header {
		background-color: #409EFF;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
		padding: 20px;
		display: flex;
		justify-content: space-between;
		align-items: center;
		flex-wrap: wrap;
		gap: 20px;
	}

	.logo {
		display: flex;
		align-items: center;
	}

	.logo-image {
		width: 50px;
		margin-right: 10px;
	}

	.title {
		font-size: 1.8em;
		font-weight: bold;
		color: #fff;
		letter-spacing: 1px;
	}

	nav ul {
		list-style: none;
		display: flex;
		gap: 30px;
		padding: 0;
		margin-right: auto;
	}

	nav ul li a {
		text-decoration: none;
		color: #fff;
		font-weight: bold;
		transition: color 0.3s ease, opacity 0.3s ease;
		font-size: 1.1em;
	}

	nav ul li a:hover {
		color: #ffd700;
		opacity: 0.8;
	}

	.auth {
		font-size: 16px;
		color: #fff;
		padding: 10px 20px;
		cursor: pointer;
		border: 2px solid #ffd700;
		border-radius: 5px;
		transition: background-color 0.3s ease, color 0.3s ease;
	}

	.auth:hover {
		background-color: #ffd700;
		color: #409EFF;
		opacity: 0.9;
	}

	.carousel {
		position: relative;
		overflow: hidden;
		height: 500px;
		width: 100%;
		margin: 40px 0;
		border-radius: 8px;
		box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
	}

	.carousel-item {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		display: none;
		transition: transform 0.5s ease;
	}

	.carousel-item.active {
		display: block;
	}

	.carousel-item img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		border-radius: 8px;
	}

	.carousel-caption {
		position: absolute;
		bottom: 30px;
		left: 30px;
		color: #fff;
		background: rgba(0, 0, 0, 0.5);
		padding: 10px 20px;
		border-radius: 4px;
	}

	.carousel-caption h2 {
		font-size: 32px;
		margin-bottom: 10px;
		font-weight: 700;
	}

	.carousel-caption p {
		font-size: 20px;
	}

	.carousel-control {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		background-color: rgba(0, 0, 0, 0.5);
		color: #fff;
		border: none;
		padding: 15px;
		cursor: pointer;
		border-radius: 50%;
		transition: background-color 0.3s ease;
	}

	.carousel-control:hover {
		background-color: rgba(0, 0, 0, 0.7);
	}

	.carousel-control.prev {
		left: 20px;
	}

	.carousel-control.next {
		right: 20px;
	}

	.carousel-control i {
		font-size: 30px;
	}

	.main-content {
		max-width: 1200px;
		margin: 40px auto;
		background-color: #fff;
		padding: 40px;
		border-radius: 8px;
		box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
		flex: 1;
	}

	.main-content h1 {
		font-size: 36px;
		color: #333;
		margin-bottom: 20px;
		font-weight: 700;
	}

	.main-content h2 {
		font-size: 28px;
		color: #555;
		margin-bottom: 20px;
	}

	.main-content p {
		color: #666;
		line-height: 1.8;
		margin-bottom: 40px;
		font-size: 18px;
	}

	.search-section {
		display: flex;
		gap: 15px;
		margin-bottom: 40px;
		align-items: center;
	}

	.search-input {
		padding: 15px;
		border: 1px solid #ddd;
		border-radius: 4px;
		flex-grow: 1;
		transition: border-color 0.3s ease;
		font-size: 16px;
	}

	.search-input:focus {
		border-color: #409EFF;
		outline: none;
	}

	.search-button {
		padding: 15px 25px;
		background-color: #409EFF;
		color: white;
		border: none;
		border-radius: 4px;
		cursor: pointer;
		transition: background-color 0.3s ease;
		font-size: 16px;
	}

	.search-button:hover {
		background-color: #357bb3;
	}

	.services-grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
		gap: 30px;
		margin-bottom: 40px;
	}

	.service-item {
		border: 1px solid #ddd;
		border-radius: 8px;
		padding: 20px;
		background-color: #fff;
		transition: transform 0.3s ease, box-shadow 0.3s ease;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	}

	.service-item:hover {
		transform: translateY(-5px);
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	}

	.service-item img {
		width: 100%;
		max-height: 150px;
		object-fit: contain;
		margin-bottom: 15px;
		border-radius: 8px;
	}

	.additional-services {
		text-align: center;
		margin-bottom: 40px;
	}

	.additional-services h3 {
		font-size: 32px;
		color: #333;
		font-weight: 700;
		margin-bottom: 15px;
	}

	.additional-services p {
		font-size: 18px;
		color: #666;
		line-height: 1.8;
		max-width: 800px;
		margin: 0 auto 30px;
	}

	.customer-service {
		background-color: #f7f7f7;
		padding: 40px;
		border-radius: 8px;
		box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
	}

	.customer-service h4 {
		font-size: 24px;
		color: #333;
		margin-bottom: 15px;
	}

	.footer {
		background-color: #333;
		color: #fff;
		padding: 40px 20px;
	}

	.footer-content {
		display: flex;
		justify-content: space-between;
	}

	.footer-section {
		flex: 1;
		margin-right: 30px;
	}

	.footer-section:last-child {
		margin-right: 0;
	}

	.footer-section h4 {
		font-size: 20px;
		margin-bottom: 15px;
		font-weight: 700;
	}

	.footer-section p {
		font-size: 14px;
		color: #ccc;
		margin: 5px 0;
	}

	.footer-bottom {
		text-align: center;
		font-size: 14px;
		color: #ccc;
		margin-top: 20px;
	}

	.footer-bottom p {
		margin: 0;
	}
</style>