naweigete-web/pages/index_clients.vue

173 lines
5.4 KiB
Vue
Raw Normal View History

2025-03-13 17:37:54 +08:00
<template>
<div class="bg-white">
<!-- Banner section with background image -->
2025-03-14 15:53:35 +08:00
<div class="aboutimgBg h-[300px] md:h-[600px]" :style="{
2025-03-19 18:01:04 +08:00
backgroundImage: `url(${bgImage5})`,
2025-03-13 17:37:54 +08:00
backgroundSize: 'cover',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}">
<div class="banDes">
<div class="clientTit text-center">
2025-03-14 15:53:35 +08:00
<h2 class="text-3xl md:text-[50px] font-bold animated fadeInLeft">{{ $t('clients_b1') }}</h2>
2025-03-13 17:37:54 +08:00
</div>
</div>
</div>
<!-- Clients content section -->
2025-03-14 15:53:35 +08:00
<div class="mainBg pb-10 md:pb-[100px]">
2025-03-13 17:37:54 +08:00
<div class="oneBox1Bg">
<div class="container mx-auto px-4">
<div class="clientBox1">
2025-03-14 15:53:35 +08:00
<h3 class="animated fadeInUp text-lg md:text-2xl font-medium text-center text-[#606060] px-4 mt-[-60px] md:mt-[-120px]">{{ $t('clients_b2') }}</h3>
2025-03-13 17:37:54 +08:00
</div>
2025-03-14 15:53:35 +08:00
<div class="clientBg1 mt-12 md:mt-[100px]">
<div class="clientBg1img flex flex-col md:flex-row items-center justify-between">
2025-03-19 18:01:04 +08:00
<div class="clientBg1imgdx w-full md:w-[300px] mb-6 md:mb-0 flex justify-center md:justify-start">
<img class="oneBox1Bg1img1 w-[150px] md:w-[400px] h-[200px] md:h-[400px] object-contain" :src="info.image" alt="Client">
2025-03-13 17:37:54 +08:00
</div>
2025-03-14 15:53:35 +08:00
<div class="clientBg1imgt text-center md:text-left pl-0 md:pl-[30px]" style="flex: 1;">
2025-03-19 18:01:04 +08:00
<h3 style="display: inline-block;" class="text-2xl md:text-[40px] font-bold mb-2">{{ locale == 'zh' ? info.name : info.en_name }}</h3>
<h4 class="text-base md:text-xl text-[#606060] mt-4 md:mt-[30px] px-4 md:px-0">{{ locale == 'zh' ? info.context : info.en_context }}</h4>
2025-03-13 17:37:54 +08:00
</div>
</div>
</div>
<div class="clientxiah1 w-full h-[1px] bg-gray-200 my-8"></div>
2025-03-19 18:01:04 +08:00
<div class="mt-8">
<!-- 使用 Swiper 实现左右滚动 -->
2025-04-22 19:23:36 +08:00
<Swiper
:modules="[SwiperAutoplay,SwiperThumbs]"
2025-03-19 18:01:04 +08:00
:slides-per-view="slidesPerView"
:loop="true"
:autoplay="{
delay: 3000,
disableOnInteraction: false
}"
class="client-swiper"
>
<swiper-slide v-for="item in list" :key="item.id" class="flex justify-center">
<img @click="info = item" :src="item.image" class="w-[150px] md:w-[200px] h-auto cursor-pointer" alt="Client">
</swiper-slide>
2025-04-22 19:23:36 +08:00
</Swiper>
2025-03-14 15:53:35 +08:00
</div>
2025-03-13 17:37:54 +08:00
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
2025-03-19 18:01:04 +08:00
import { onMounted, ref, computed } from 'vue'
import $api from '@/service/webRequest'
import { useI18n } from 'vue-i18n'
import { useStore } from '~/store'
// 导入 Swiper 相关模块
import { Swiper, SwiperSlide } from 'swiper/vue'
2025-04-22 19:23:36 +08:00
import { Navigation, Pagination, Autoplay,Thumbs } from 'swiper/modules'
2025-03-19 18:01:04 +08:00
import 'swiper/css'
import 'swiper/css/navigation'
import 'swiper/css/pagination'
// 添加第五个背景图片
import bgImage5 from '../public/images/maskgroup2.png'
const { locale } = useI18n()
const SwiperNavigation = Navigation
const SwiperPagination = Pagination
const SwiperAutoplay = Autoplay
2025-04-22 19:23:36 +08:00
const SwiperThumbs = Thumbs
2025-03-13 17:37:54 +08:00
onMounted(() => {
2025-03-19 18:01:04 +08:00
getList();
})
const list = ref([])
const info = ref({})
// 根据屏幕宽度计算显示的幻灯片数量
const slidesPerView = computed(() => {
return window.innerWidth < 768 ? 2 : 5
2025-03-13 17:37:54 +08:00
})
2025-03-19 18:01:04 +08:00
const getList = () => {
$api.get("/api/caseinfo/customer")
.then((res: any) => {
console.log(res)
list.value = res.data.data
info.value = res.data.data[0]
})
.catch((err) => {
console.dir(err)
})
}
2025-03-13 17:37:54 +08:00
</script>
<style lang="scss" scoped>
@import "@/assets/animate/animate.min.css";
.aboutimgBg {
position: relative;
}
.container {
2025-03-14 15:53:35 +08:00
max-width: 100%;
@media (min-width: 768px) {
max-width: 1310px;
}
2025-03-13 17:37:54 +08:00
}
.clientTit h2::after {
content: '';
margin: 0 auto;
2025-03-14 15:53:35 +08:00
width: 180px;
height: 20px;
@media (min-width: 768px) {
2025-04-08 09:08:12 +08:00
width: 250px;
2025-03-14 15:53:35 +08:00
height: 28px;
2025-04-08 09:08:12 +08:00
margin-top: -15px;
2025-03-14 15:53:35 +08:00
}
2025-03-13 17:37:54 +08:00
background: #A8CBFF;
display: block;
2025-04-08 09:08:12 +08:00
margin-top: -15px;
2025-03-13 17:37:54 +08:00
}
.clientBox1 h3 {
font-weight: 500;
text-align: center;
2025-03-14 15:53:35 +08:00
font-size: 18px;
@media (min-width: 768px) {
font-size: 24px;
line-height: 31px;
}
2025-03-13 17:37:54 +08:00
color: #606060;
2025-03-14 15:53:35 +08:00
line-height: 1.5;
2025-03-13 17:37:54 +08:00
}
.clientBg1imgt h3::after {
content: '';
2025-04-08 09:08:12 +08:00
width: 100%;
2025-03-14 15:53:35 +08:00
height: 16px;
@media (min-width: 768px) {
2025-04-08 09:08:12 +08:00
margin-top: -10px;
2025-03-19 18:01:04 +08:00
width: 100%;
2025-03-14 15:53:35 +08:00
height: 20px;
margin-left: -4px;
}
2025-03-13 17:37:54 +08:00
background: #A8CBFF;
display: block;
2025-03-14 15:53:35 +08:00
margin-top: -14px;
margin-left: auto;
margin-right: auto;
@media (min-width: 768px) {
margin-left: -4px;
margin-right: 0;
}
}
@media (max-width: 768px) {
2025-03-19 18:01:04 +08:00
.client-swiper {
padding: 0 20px;
2025-03-14 15:53:35 +08:00
}
2025-03-13 17:37:54 +08:00
}
</style>