officialWebsite/src/views/companyprofil/size768/index.vue

1078 lines
29 KiB
Vue
Raw Normal View History

2025-02-19 11:04:19 +00:00
<template>
2025-02-20 05:23:38 +00:00
<div class="page-container">
2025-02-22 11:07:59 +00:00
<n-divider class="divider1" vertical />
<n-divider class="divider5" vertical />
2025-02-20 05:23:38 +00:00
<header className="header flex items-center justify-between">
<div class="logo">
<img src="@/assets/image/logo.png" alt="logo" />
2025-02-19 11:04:19 +00:00
</div>
2025-02-20 05:23:38 +00:00
<div class="tabs">
2025-02-19 11:59:32 +00:00
<div
2025-02-20 05:23:38 +00:00
class="tab-item"
:class="{ active: currentTab === 'home' }"
@click="handleTabClick('home')"
2025-02-19 11:59:32 +00:00
>
2025-02-26 09:15:36 +00:00
{{ t("home.nav.home") }}
2025-02-19 11:04:19 +00:00
</div>
<div
2025-02-20 05:23:38 +00:00
class="tab-item"
2025-02-22 09:37:27 +00:00
:class="{ active: currentTab === 'companyprofil' }"
@click="handleTabClick('companyprofil')"
2025-02-19 11:04:19 +00:00
>
2025-02-26 09:15:36 +00:00
{{ t("home.nav.company") }}
2025-02-19 11:04:19 +00:00
</div>
2025-02-20 05:23:38 +00:00
<div
class="tab-item"
2025-02-22 09:37:27 +00:00
:class="{ active: currentTab === 'businessintroduction' }"
@click="handleTabClick('businessintroduction')"
2025-02-20 05:23:38 +00:00
>
2025-02-26 09:15:36 +00:00
{{ t("home.nav.businessintroduction") }}
</div>
<div class="tab-item" @click="handleLanguageChange">
{{ currentLanguageLabel }}
<img
src="@/assets/image/home/768/icon-language.png"
alt="language"
class="w-[18px] ml-[13px]"
/>
2025-02-19 11:04:19 +00:00
</div>
</div>
2025-02-20 05:23:38 +00:00
</header>
2025-02-26 09:15:36 +00:00
<!-- 语言选择模态框 - 使用纯div实现 -->
<div
v-if="showLanguageModal"
class="language-modal"
@touchmove.prevent.stop
>
<div class="language-modal-backdrop" @click="closeLanguageModal"></div>
<div class="language-modal-content">
<div class="modal-header font-semibold flex items-center">
{{ t("home.nav.please_select") }}
<img
src="@/assets/image/home/375/icon-close.png"
alt="close"
class="close-btn w-[51px]"
@click="closeLanguageModal"
/>
</div>
<div class="language-modal-body" @wheel.stop @touchmove.stop>
<div
v-for="option in languageOptions"
:key="option.value"
class="language-option"
:class="{ active: selectedLanguage === option.value }"
@click="selectedLanguage = option.value"
>
{{ option.label }}
</div>
</div>
<div class="language-modal-footer">
<button class="confirm-btn" @click="confirmLanguageChange">
{{ t("home.nav.confirm_select") }}
</button>
</div>
</div>
</div>
2025-02-21 03:12:53 +00:00
<main>
2025-02-21 03:51:56 +00:00
<section style="background: #ffffff" className="relative">
<div
class="relative section-first h-[1524px] box-contain pt-[718px] mb-[400px]"
>
2025-02-22 14:03:20 +00:00
<div ref="moveRef3" class="absolute top-[603px] right-[63px]">
<img
class="w-[949px] h-[574px]"
src="@/assets/image/companyprofil/768/image-q.png"
/>
</div>
2025-02-19 11:59:32 +00:00
<div
2025-02-22 14:03:20 +00:00
class="title ml-[188px]"
2025-02-19 11:59:32 +00:00
:ref="
(el) => {
2025-02-20 05:23:38 +00:00
moveRefs[0].value = el;
2025-02-19 11:59:32 +00:00
}
"
>
2025-02-22 14:03:20 +00:00
<div>{{ $t("companyprofil.slogan.title1") }}</div>
<div>{{ $t("companyprofil.slogan.title2") }}</div>
2025-02-19 11:04:19 +00:00
</div>
2025-02-19 11:59:32 +00:00
<div
:ref="
(el) => {
2025-02-20 05:23:38 +00:00
moveRefs[1].value = el;
2025-02-19 11:59:32 +00:00
}
"
class="text-[35px] text-[#8B59F7] w-[958px] ml-[188px] mt-[55px]"
2025-02-19 11:59:32 +00:00
>
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.slogan.desc") }}
2025-02-20 05:23:38 +00:00
</div>
2025-02-19 11:04:19 +00:00
</div>
2025-02-22 11:07:59 +00:00
<div class="w-[1920px] absolute bottom-[-660px] z-4">
<img
src="@/assets/image/companyprofil/768/icon-lang.png"
alt="logo"
/>
2025-02-19 11:04:19 +00:00
</div>
2025-02-20 05:23:38 +00:00
</section>
<section style="background: #f8f9ff">
<div class="flex flex-wrap justify-center">
<div class="w-full px-[188px] mt-[400px]">
2025-02-22 14:03:20 +00:00
<div class="text-[#8B59F7] text-[40px]">
{{ $t("companyprofil.intro.label") }}
</div>
2025-02-20 05:23:38 +00:00
</div>
<div class="w-full title mt-[58px] px-[188px]">
2025-02-22 14:03:20 +00:00
<div>{{ $t("companyprofil.intro.title1") }}</div>
<div>{{ $t("companyprofil.intro.title2") }}</div>
2025-02-20 05:23:38 +00:00
</div>
<div class="w-full px-[188px] mt-[140px]">
<div
:ref="
(el) => {
moveRefs[2].value = el;
}
"
class="text-[#455363] text-[40px] w-[1345px]"
>
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.intro.desc") }}
2025-02-20 05:23:38 +00:00
</div>
</div>
2025-02-19 11:59:32 +00:00
<div
:ref="
(el) => {
2025-02-20 05:23:38 +00:00
moveRefs[4].value = el;
2025-02-19 11:59:32 +00:00
}
"
2025-02-20 05:23:38 +00:00
class="mt-[140px] mb-[235px] overflow-hidden"
2025-02-19 11:59:32 +00:00
>
2025-02-20 05:23:38 +00:00
<img
:ref="
(el) => {
moveRefs[5].value = el;
}
"
class="w-[1625px] h-[1038px]"
src="@/assets/image/companyprofil/768/imageshow-2.png"
2025-02-20 05:23:38 +00:00
/>
2025-02-19 11:04:19 +00:00
</div>
</div>
2025-02-20 05:23:38 +00:00
</section>
<section class="relative" style="background: #fff">
<div class="flex flex-wrap justify-center">
<div class="w-full px-[188px] mt-[113px]">
2025-02-22 14:03:20 +00:00
<div class="text-[#8B59F7] text-[40px]">
{{ $t("companyprofil.team.label") }}
</div>
2025-02-19 11:04:19 +00:00
</div>
2025-02-20 05:23:38 +00:00
<div class="w-full title mt-[58px] px-[188px]">
2025-02-22 14:03:20 +00:00
<div>{{ $t("companyprofil.team.title1") }}</div>
<div>{{ $t("companyprofil.team.title2") }}</div>
2025-02-19 11:04:19 +00:00
</div>
2025-02-20 05:23:38 +00:00
<div class="w-full px-[188px] mt-[140px]">
<div
:ref="
(el) => {
moveRefs[6].value = el;
}
"
class="text-[#455363] text-[40px] w-[1345px]"
>
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.team.desc") }}
2025-02-20 05:23:38 +00:00
</div>
2025-02-19 11:04:19 +00:00
</div>
2025-02-20 05:23:38 +00:00
<div class="mt-[143px] mb-[188px] overflow-hidden">
<img
:ref="
(el) => {
moveRefs[7].value = el;
}
"
class="w-[1625px] h-[1038px]"
src="@/assets/image/companyprofil/768/imageshow-3.png"
2025-02-20 05:23:38 +00:00
/>
2025-02-19 11:04:19 +00:00
</div>
2025-02-20 05:23:38 +00:00
<div class="w-full px-[188px]">
<img
class="w-[145px] h-[145px]"
src="@/assets/image/companyprofil/768/icon-lun.png"
2025-02-20 05:23:38 +00:00
/>
2025-02-22 11:07:59 +00:00
<div
class="w-full mt-[50px] text-[#10253E] text-[45px] font-semibold"
>
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.team.features.global.title") }}
2025-02-20 05:23:38 +00:00
</div>
<div class="mt-[38px] text-[#455363] text-[40px] w-[1345px]">
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.team.features.global.desc") }}
2025-02-20 05:23:38 +00:00
</div>
2025-02-19 11:04:19 +00:00
</div>
2025-02-20 05:23:38 +00:00
<div class="w-full px-[188px] mt-[170px]">
<img
class="w-[145px] h-[145px]"
src="@/assets/image/companyprofil/768/icon-love.png"
2025-02-20 05:23:38 +00:00
/>
2025-02-22 11:07:59 +00:00
<div
class="w-full mt-[50px] text-[#10253E] text-[45px] font-semibold"
>
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.team.features.fans.title") }}
2025-02-20 05:23:38 +00:00
</div>
<div class="mt-[38px] text-[#455363] text-[40px] w-[1345px]">
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.team.features.fans.desc") }}
2025-02-20 05:23:38 +00:00
</div>
2025-02-19 11:04:19 +00:00
</div>
2025-02-20 05:23:38 +00:00
<div class="w-full px-[188px] mt-[160px] mb-[250px]">
<img
class="w-[145px] h-[145px]"
src="@/assets/image/companyprofil/768/icon-p.png"
2025-02-20 05:23:38 +00:00
/>
2025-02-19 11:04:19 +00:00
2025-02-22 11:07:59 +00:00
<div
class="w-full mt-[50px] text-[#10253E] text-[45px] font-semibold"
>
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.team.features.talent.title") }}
2025-02-20 05:23:38 +00:00
</div>
<div class="mt-[38px] text-[#455363] text-[40px] w-[1345px]">
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.team.features.talent.desc") }}
2025-02-20 05:23:38 +00:00
</div>
</div>
2025-02-22 11:07:59 +00:00
<div class="icon-langmul z-4">
2025-02-20 05:23:38 +00:00
<img
class="w-[846px] h-[216px]"
src="@/assets/image/companyprofil/768/icon-langmul.png"
2025-02-20 05:23:38 +00:00
/>
</div>
2025-02-19 11:59:32 +00:00
</div>
2025-02-20 05:23:38 +00:00
</section>
<section class="section-four">
<div class="flex flex-wrap justify-center">
<div class="w-full px-[188px] mt-[458px]">
2025-02-22 14:03:20 +00:00
<div class="text-[#8B59F7] text-[40px]">
{{ $t("companyprofil.achievement.label") }}
</div>
2025-02-20 05:23:38 +00:00
</div>
2025-02-19 11:59:32 +00:00
<div
:ref="
(el) => {
2025-02-20 05:23:38 +00:00
moveRefs[8].value = el;
2025-02-19 11:59:32 +00:00
}
"
2025-02-20 05:23:38 +00:00
class="w-full title mt-[58px] px-[188px]"
2025-02-19 11:59:32 +00:00
>
2025-02-22 14:03:20 +00:00
<div>{{ $t("companyprofil.achievement.title1") }}</div>
<div>{{ $t("companyprofil.achievement.title2") }}</div>
2025-02-19 11:59:32 +00:00
</div>
2025-02-20 05:23:38 +00:00
<div class="w-full px-[188px] mt-[140px]">
<div
:ref="
(el) => {
moveRefs[9].value = el;
}
"
class="text-[#455363] text-[40px] w-[1345px]"
>
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.achievement.desc") }}
2025-02-20 05:23:38 +00:00
</div>
2025-02-19 11:59:32 +00:00
</div>
<div
:ref="
(el) => {
2025-02-20 05:23:38 +00:00
moveRefs[10].value = el;
2025-02-19 11:59:32 +00:00
}
"
2025-02-20 05:23:38 +00:00
class="w-full mt-[260px] px-[188px] text-[55px] font-semibold"
2025-02-19 11:59:32 +00:00
>
2025-02-22 14:03:20 +00:00
<div>
{{ $t("companyprofil.achievement.certification.title1") }}
</div>
<div>
{{ $t("companyprofil.achievement.certification.title2") }}
</div>
2025-02-20 05:23:38 +00:00
</div>
<div
:ref="
(el) => {
moveRefs[11].value = el;
}
"
class="w-full px-[188px] mt-[60px]"
>
<div class="text-[#455363] text-[40px] w-[1345px]">
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.achievement.certification.desc") }}
2025-02-19 11:59:32 +00:00
</div>
</div>
2025-02-20 05:23:38 +00:00
<div
2025-02-19 11:59:32 +00:00
:ref="
(el) => {
2025-02-20 05:23:38 +00:00
moveRefs[12].value = el;
2025-02-19 11:59:32 +00:00
}
"
2025-02-20 05:23:38 +00:00
class="mt-[120px] mb-[260px] overflow-hidden"
>
<img
class="w-[1625px] h-[1038px]"
src="@/assets/image/companyprofil/768/imageshow-4.png"
2025-02-20 05:23:38 +00:00
/>
</div>
2025-02-20 02:29:53 +00:00
<div
:ref="
(el) => {
2025-02-20 05:23:38 +00:00
moveRefs[13].value = el;
2025-02-20 02:29:53 +00:00
}
"
2025-02-20 05:23:38 +00:00
class="w-full px-[188px] text-[55px] font-semibold"
2025-02-20 02:29:53 +00:00
>
2025-02-22 14:03:20 +00:00
<div>{{ $t("companyprofil.achievement.platform.title1") }}</div>
<div>{{ $t("companyprofil.achievement.platform.title2") }}</div>
2025-02-20 05:23:38 +00:00
</div>
<div class="w-full px-[188px] mt-[60px]">
<div
:ref="
(el) => {
moveRefs[14].value = el;
}
"
class="text-[#455363] text-[40px] w-[1345px]"
>
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.achievement.platform.desc") }}
2025-02-20 05:23:38 +00:00
</div>
</div>
<div class="mt-[120px] mb-[220px] overflow-hidden">
<img
:ref="
(el) => {
moveRefs[15].value = el;
}
"
class="w-[1625px] h-[1038px]"
src="@/assets/image/companyprofil/768/imageshow-5.png"
2025-02-20 05:23:38 +00:00
/>
2025-02-20 02:29:53 +00:00
</div>
</div>
2025-02-20 05:23:38 +00:00
</section>
<section style="background: #fff">
<div class="flex flex-wrap justify-center">
<div class="w-full px-[188px] mt-[245px]">
2025-02-22 14:03:20 +00:00
<div class="text-[#8B59F7] text-[40px]">
{{ $t("companyprofil.news.label") }}
</div>
2025-02-20 05:23:38 +00:00
</div>
<div
:ref="
(el) => {
moveRefs[16].value = el;
}
"
class="w-full title mt-[58px] px-[188px]"
>
2025-02-22 14:03:20 +00:00
<div>{{ $t("companyprofil.news.title1") }}</div>
<div>{{ $t("companyprofil.news.title2") }}</div>
2025-02-20 05:23:38 +00:00
</div>
<div class="w-full px-[188px] mt-[140px]">
2025-02-20 02:29:53 +00:00
<div
2025-02-20 05:23:38 +00:00
:ref="
(el) => {
moveRefs[17].value = el;
}
"
class="text-[#455363] text-[40px] w-[1345px]"
2025-02-20 02:29:53 +00:00
>
2025-02-22 14:03:20 +00:00
{{ $t("companyprofil.news.desc") }}
2025-02-20 05:23:38 +00:00
</div>
</div>
<div class="w-full mt-[143px] flex flex-wrap justify-end">
<div class="flex flex-wrap">
<div class="arrow-btn" @click="handlePrev">
<img
class="w-[95px] h-[95px]"
src="@/assets/image/companyprofil/768/icon-left.png"
2025-02-20 05:23:38 +00:00
/>
</div>
<div class="arrow-btn ml-[63px] mr-[230px]" @click="handleNext">
<img
class="w-[95px] h-[95px]"
src="@/assets/image/companyprofil/768/icon-right.png"
2025-02-20 05:23:38 +00:00
/>
</div>
</div>
</div>
<div
2025-02-22 11:07:59 +00:00
class="mt-[73px] mb-[253px] carousel-container px-[80px] py-[40px] z-4"
2025-02-20 05:23:38 +00:00
>
<div
ref="carouselTrack"
class="carousel-track"
:style="{
transform: `translateX(-${getSlideOffset()}px)`,
}"
@mousedown="handleDragStart"
@mousemove="handleDragMove"
@mouseup="handleDragEnd"
@mouseleave="handleDragEnd"
@touchstart="handleDragStart"
@touchmove="handleDragMove"
@touchend="handleDragEnd"
>
<div
v-for="(item, idx) in getVisibleItems()"
:key="idx"
class="carousel-item"
2025-02-21 02:09:59 +00:00
@click="handleCarouselClick(item, $event)"
2025-02-20 05:23:38 +00:00
>
<img class="carousel-image" :src="item.imgUrl" />
<div class="carousel-content">
<div class="carousel-title">
<div>{{ item.title }}</div>
</div>
<div class="carousel-subtitle">
<div>{{ item.subTitle }}</div>
</div>
2025-02-20 02:29:53 +00:00
</div>
</div>
</div>
2025-02-20 05:23:38 +00:00
</div>
2025-02-20 02:29:53 +00:00
</div>
2025-02-20 05:23:38 +00:00
</section>
<section
style="background: #fff"
className="flex flex-wrap justify-center"
>
<img
class="w-[580px] h-[55px] my-[85px]"
2025-02-20 06:31:56 +00:00
src="@/assets/image/image-footer.png"
2025-02-20 05:23:38 +00:00
alt="logo"
/>
</section>
</main>
</div>
2025-02-19 11:04:19 +00:00
</template>
<script setup>
2025-02-22 11:07:59 +00:00
import { NDivider } from "naive-ui";
2025-02-26 09:15:36 +00:00
import { onUnmounted, ref, onMounted, reactive, nextTick, watch } from "vue";
2025-02-19 11:04:19 +00:00
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { useHome } from "@/store/home/index.js";
import { useTransitionComposable } from "@/composables/transition-composable";
2025-02-22 14:03:20 +00:00
import { useI18n } from "vue-i18n";
const { t } = useI18n();
2025-02-26 09:15:36 +00:00
import { useLanguage } from "@/utils/changeLanguage.js";
const {
languageOptions,
currentLanguageLabel,
changeLanguage,
initLanguage,
currentLang,
} = useLanguage();
2025-02-19 11:04:19 +00:00
2025-02-20 05:23:38 +00:00
// 定义组件的自定义事件
defineEmits(["sendCode"]);
2025-02-19 11:04:19 +00:00
// 注册 ScrollTrigger 插件
gsap.registerPlugin(ScrollTrigger);
const { transitionState } = useTransitionComposable();
2025-02-21 03:12:53 +00:00
2025-02-19 11:59:32 +00:00
const moveRefs = ref(
2025-02-20 02:29:53 +00:00
Array(18)
2025-02-19 11:59:32 +00:00
.fill(null)
.map(() => ref(null))
);
2025-02-19 11:04:19 +00:00
const { currentTab } = useHome();
let ctx;
2025-02-21 02:09:59 +00:00
// 导入图片
import carouselShow1 from "@/assets/image/companyprofil/768/carouselShow-1.png";
import carouselShow2 from "@/assets/image/companyprofil/768/carouselShow-2.png";
import carouselShow3 from "@/assets/image/companyprofil/768/carouselShow-3.png";
import carouselShow4 from "@/assets/image/companyprofil/768/carouselShow-4.png";
import carouselShow5 from "@/assets/image/companyprofil/768/carouselShow-5.png";
2025-02-20 02:29:53 +00:00
const state = reactive({
marqueeArr: [
{
2025-02-22 09:37:27 +00:00
titleNo: "1",
2025-02-22 14:03:20 +00:00
title: t("companyprofil.news.carousel.item1.title"),
subTitle: t("companyprofil.news.carousel.item1.desc"),
2025-02-21 02:09:59 +00:00
imgUrl: carouselShow1,
2025-02-20 02:29:53 +00:00
},
{
2025-02-22 09:37:27 +00:00
titleNo: "2",
2025-02-22 14:03:20 +00:00
title: t("companyprofil.news.carousel.item2.title"),
subTitle: t("companyprofil.news.carousel.item2.desc"),
2025-02-21 02:09:59 +00:00
imgUrl: carouselShow2,
2025-02-20 02:29:53 +00:00
},
{
2025-02-22 09:37:27 +00:00
titleNo: "3",
2025-02-22 14:03:20 +00:00
title: t("companyprofil.news.carousel.item3.title"),
subTitle: t("companyprofil.news.carousel.item3.desc"),
2025-02-21 02:09:59 +00:00
imgUrl: carouselShow3,
2025-02-20 02:29:53 +00:00
},
{
2025-02-22 09:37:27 +00:00
titleNo: "4",
2025-02-22 14:03:20 +00:00
title: t("companyprofil.news.carousel.item4.title"),
subTitle: t("companyprofil.news.carousel.item4.desc"),
2025-02-21 02:09:59 +00:00
imgUrl: carouselShow4,
2025-02-20 02:29:53 +00:00
},
{
2025-02-22 09:37:27 +00:00
titleNo: "5",
2025-02-22 14:03:20 +00:00
title: t("companyprofil.news.carousel.item5.title"),
subTitle: t("companyprofil.news.carousel.item5.desc"),
2025-02-21 02:09:59 +00:00
imgUrl: carouselShow5,
2025-02-20 02:29:53 +00:00
},
],
});
2025-02-20 05:23:38 +00:00
const carouselTrack = ref(null);
const currentIndex = ref(0);
const isTransitioning = ref(false);
2025-02-20 05:23:38 +00:00
const getVisibleItems = () => {
const items = state.marqueeArr;
// 创建一个包含所有项目的数组,前后各复制一组用于无缝循环
return [...items, ...items, ...items];
};
// 计算实际滑动距离
const getSlideOffset = () => {
if (!carouselTrack.value) return 0;
const firstItem = carouselTrack.value.querySelector(".carousel-item");
if (!firstItem) return 0;
const itemWidth = firstItem.offsetWidth;
const itemMargin = parseInt(window.getComputedStyle(firstItem).marginRight);
const totalWidth = itemWidth + itemMargin;
const len = state.marqueeArr.length;
if (currentIndex.value <= -len) {
currentIndex.value = -currentIndex.value % len;
} else if (currentIndex.value >= len) {
currentIndex.value = currentIndex.value % len;
}
// 初始偏移一组数据的长度
const initialOffset = len * totalWidth + 32;
2025-02-20 05:23:38 +00:00
return initialOffset + currentIndex.value * totalWidth;
};
// 定义 resize 处理函数
const handleResize = () => {
if (carouselTrack.value) {
carouselTrack.value.style.transform = `translateX(-${getSlideOffset()}px)`;
}
};
// 监听窗口大小变化
2025-02-19 11:04:19 +00:00
onMounted(() => {
ctx = gsap.context(() => {
2025-02-19 11:59:32 +00:00
moveRefs.value.forEach((moveRef, index) => {
if (moveRef.value) {
2025-02-20 05:23:38 +00:00
// 修改初始状态设置
gsap.set(moveRef.value, {
opacity: 0,
// 使用 translateX 替代 x并且初始位置设置在元素自身宽度范围内
transform: `translateX(${index % 2 === 0 ? "-100%" : "100%"})`,
// 添加 overflow: hidden 确保不会影响布局
overflow: "hidden",
});
// 修改动画设置
gsap.to(moveRef.value, {
opacity: 1,
transform: "translateX(0)", // 使用 transform 替代 x
2025-02-19 11:59:32 +00:00
duration: 1.2,
ease: "power2.out",
scrollTrigger: {
trigger: moveRef.value,
start: "top 80%",
end: "top 40%",
toggleActions: "play none none reverse",
2025-02-20 05:23:38 +00:00
markers: false,
2025-02-19 11:59:32 +00:00
},
});
}
2025-02-19 11:04:19 +00:00
});
});
2025-02-20 05:23:38 +00:00
// 使用定义的 handleResize 函数
window.addEventListener("resize", handleResize);
// 初始化位置为第二组的开头
currentIndex.value = 0;
nextTick(() => {
if (carouselTrack.value) {
carouselTrack.value.style.transition = "none";
carouselTrack.value.style.transform = `translateX(-${getSlideOffset()}px)`;
// 重新启用过渡效果
setTimeout(() => {
carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
}, 50);
}
});
2025-02-19 11:04:19 +00:00
});
onUnmounted(() => {
if (ctx) {
ctx.revert();
}
ScrollTrigger.killAll();
2025-02-20 05:23:38 +00:00
// 移除事件监听
window.removeEventListener("resize", handleResize);
2025-02-19 11:04:19 +00:00
});
const handleTabClick = (tab) => {
currentTab.value = tab;
2025-02-22 09:37:27 +00:00
router.push("/" + tab);
2025-02-19 11:04:19 +00:00
};
const goToSection = (i) => {
ctx.data.forEach((e) => {
if (e.vars && e.vars.id === "scrollTween") {
e.kill();
}
});
ctx.add(() => {
scrollTween = gsap.to(window, {
scrollTo: { y: i * window.innerHeight, autoKill: false },
duration: 1,
id: "scrollTween",
onComplete: () => (scrollTween = null),
overwrite: true,
});
});
};
2025-02-20 05:23:38 +00:00
// 向前滑动
const handlePrev = () => {
if (isTransitioning.value) return;
isTransitioning.value = true;
2025-02-20 05:23:38 +00:00
if (!carouselTrack.value) return;
2025-02-20 05:23:38 +00:00
carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
currentIndex.value--;
if (currentIndex.value < -state.marqueeArr.length) {
setTimeout(() => {
carouselTrack.value.style.transition = "none";
currentIndex.value = -1;
carouselTrack.value.offsetHeight; // 强制重排
carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
isTransitioning.value = false;
}, 500);
} else {
setTimeout(() => {
isTransitioning.value = false;
2025-02-20 05:23:38 +00:00
}, 500);
}
};
// 向后滑动
const handleNext = () => {
if (isTransitioning.value) return;
isTransitioning.value = true;
2025-02-20 05:23:38 +00:00
if (!carouselTrack.value) return;
2025-02-20 05:23:38 +00:00
carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
currentIndex.value++;
if (currentIndex.value >= state.marqueeArr.length) {
setTimeout(() => {
carouselTrack.value.style.transition = "none";
currentIndex.value = 0;
carouselTrack.value.offsetHeight; // 强制重排
carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
isTransitioning.value = false;
}, 500);
} else {
setTimeout(() => {
isTransitioning.value = false;
2025-02-20 05:23:38 +00:00
}, 500);
}
};
// 添加滑动相关的状态
const isDragging = ref(false);
const startX = ref(0);
const scrollLeft = ref(0);
// 处理鼠标/触摸按下事件
const handleDragStart = (e) => {
isDragging.value = true;
startX.value = e.type === "mousedown" ? e.pageX : e.touches[0].pageX;
scrollLeft.value = getSlideOffset();
// 禁用过渡效果,实现平滑拖动
if (carouselTrack.value) {
carouselTrack.value.style.transition = "none";
}
};
// 处理鼠标/触摸移动事件
const handleDragMove = (e) => {
if (!isDragging.value) return;
e.preventDefault();
const x = e.type === "mousemove" ? e.pageX : e.touches[0].pageX;
const walk = startX.value - x;
if (carouselTrack.value) {
carouselTrack.value.style.transform = `translateX(-${
scrollLeft.value + walk
}px)`;
}
};
// 处理鼠标/触摸释放事件
const handleDragEnd = (e) => {
if (!isDragging.value) return;
isDragging.value = false;
if (carouselTrack.value) {
// 恢复过渡效果
carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
const x = e.type === "mouseup" ? e.pageX : e.changedTouches[0].pageX;
const walk = startX.value - x;
// 获取单个项目的宽度
const firstItem = carouselTrack.value.querySelector(".carousel-item");
if (!firstItem) return;
const itemWidth = firstItem.offsetWidth;
const itemMargin = parseInt(window.getComputedStyle(firstItem).marginRight);
const totalWidth = itemWidth + itemMargin;
// 根据滑动距离决定是否切换到下一个/上一个
if (Math.abs(walk) > totalWidth / 3) {
if (walk > 0) {
handleNext();
} else {
handlePrev();
}
} else {
// 如果滑动距离不够,回到当前位置
carouselTrack.value.style.transform = `translateX(-${getSlideOffset()}px)`;
}
}
};
2025-02-21 02:09:59 +00:00
import { useRouter } from "vue-router";
const router = useRouter();
const handleCarouselClick = (item, event) => {
// 检查事件类型是否为点击
if (event.type === "click") {
event.stopPropagation(); // 阻止事件传播
event.preventDefault(); // 阻止默认行为
router.push({
2025-02-21 03:12:53 +00:00
path: "/companyprofildetail",
2025-02-21 02:09:59 +00:00
query: {
2025-02-22 09:37:27 +00:00
titleNo: item.titleNo,
2025-02-21 02:09:59 +00:00
},
});
}
};
2025-02-26 09:15:36 +00:00
// 语言选择模态框相关变量
const showLanguageModal = ref(false);
// 默认选中的语言从localStorage获取如果没有则默认为简体中文
const selectedLanguage = ref(localStorage.getItem("language") || "zh");
// 打开语言选择模态框
const handleLanguageChange = () => {
showLanguageModal.value = true;
// 打开时设置当前选中的语言
selectedLanguage.value = localStorage.getItem("language") || "zh";
// 禁止背景滚动
document.body.style.overflow = "hidden";
};
const currentLanguage = ref(localStorage.getItem("language") || "zh");
// 添加语言变化的监听
watch(
() => localStorage.getItem("language"),
(newLang) => {
if (newLang) {
currentLanguage.value = newLang;
}
},
{ immediate: true }
);
// 确认语言选择
const confirmLanguageChange = () => {
changeLanguage(selectedLanguage.value);
// 更新轮播图
currentLanguage.value = selectedLanguage.value;
// 关闭模态框
showLanguageModal.value = false;
// 恢复背景滚动
document.body.style.overflow = "";
};
// 关闭语言选择模态框
const closeLanguageModal = () => {
showLanguageModal.value = false;
// 恢复背景滚动
document.body.style.overflow = "";
};
2025-02-19 11:04:19 +00:00
</script>
<style scoped lang="scss">
2025-02-20 05:23:38 +00:00
.page-container {
width: 100%;
overflow-x: hidden;
position: relative;
}
2025-02-19 11:04:19 +00:00
.header {
width: 100%;
height: 155px;
position: fixed;
z-index: 10;
top: 0;
left: 0;
right: 0;
2025-02-22 14:03:20 +00:00
padding: 0 200px 0 188px;
2025-02-24 01:10:16 +00:00
background-color: #fff;
2025-02-19 11:04:19 +00:00
}
.logo {
img {
width: 270px;
height: 83px;
}
}
.tabs {
display: flex;
gap: 32px;
margin-right: 32px;
}
.tab-item {
font-size: 30px;
color: #000000;
cursor: pointer;
transition: color 0.3s ease;
padding: 4px 8px;
&.active {
color: #8b59fa;
}
&:hover {
color: #8b59fa;
}
}
.title {
2025-02-20 12:03:42 +00:00
font-size: 85px;
2025-02-19 11:04:19 +00:00
font-weight: 600;
}
.section-first {
background: url("@/assets/image/companyprofil/768/image-x.png");
2025-02-19 11:04:19 +00:00
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
2025-02-19 11:59:32 +00:00
.section-four {
background: url("@/assets/image/companyprofil/768/bg-3.png");
2025-02-19 11:59:32 +00:00
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.icon-langmul {
position: absolute;
2025-02-22 14:03:20 +00:00
bottom: -88px;
2025-02-19 11:59:32 +00:00
right: 0;
}
2025-02-20 05:23:38 +00:00
.carousel-container {
width: 96%;
overflow: hidden;
position: relative;
}
.arrow-btn {
cursor: pointer;
}
.carousel-track {
display: flex;
will-change: transform;
cursor: grab;
user-select: none;
&:active {
cursor: grabbing;
}
}
.carousel-item {
width: 785px;
margin-right: 28px;
flex: 0 0 auto;
2025-02-20 12:03:42 +00:00
display: block;
2025-02-20 05:23:38 +00:00
padding: 23px 20px 40px;
2025-02-20 02:29:53 +00:00
border-radius: 30px;
box-shadow: 0 8px 35px 3px rgba(0, 0, 0, 0.16);
}
2025-02-20 05:23:38 +00:00
.carousel-image {
2025-02-20 12:03:42 +00:00
width: 748px;
height: 563px;
object-fit: cover;
display: block;
2025-02-20 05:23:38 +00:00
}
.carousel-content {
2025-02-24 03:48:39 +00:00
padding: 0 20px 0 20px;
2025-02-20 12:03:42 +00:00
margin-top: 38px;
2025-02-20 05:23:38 +00:00
}
.carousel-title {
font-size: 50px;
font-weight: 500;
2025-02-21 02:09:59 +00:00
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.5;
max-height: calc(1.5em * 5);
2025-02-20 05:23:38 +00:00
}
.carousel-subtitle {
margin-top: 23px;
color: #455363;
font-size: 40px;
2025-02-21 02:09:59 +00:00
display: -webkit-box;
-webkit-line-clamp: 5;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.5;
max-height: calc(1.5em * 5);
2025-02-20 05:23:38 +00:00
}
// 添加一个通用的溢出控制类
.overflow-hidden {
overflow: hidden;
}
2025-02-22 11:07:59 +00:00
.divider1 {
position: absolute;
z-index: 3;
2025-02-22 12:42:33 +00:00
background-color: rgba(230, 234, 238, 0.5) !important;
2025-02-22 11:07:59 +00:00
left: 142px;
width: 1px;
height: 100%;
}
.divider5 {
position: absolute;
z-index: 3;
2025-02-22 12:42:33 +00:00
background-color: rgba(230, 234, 238, 0.5) !important;
2025-02-22 11:07:59 +00:00
right: 142px;
width: 1px;
height: 100%;
}
2025-02-26 09:15:36 +00:00
/* 语言选择模态框样式 */
.language-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
touch-action: none; /* 防止触摸事件影响背景 */
}
.language-modal-backdrop {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1001;
}
.language-modal-content {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
max-height: 90vh; /* 最大高度为视口高度的90% */
background-color: #fff;
z-index: 1002;
box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
overflow: hidden; /* 内容溢出隐藏 */
}
.modal-header {
padding: 33px 38px 55px 38px;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 40px;
color: #000000;
position: relative;
flex-shrink: 0; /* 不允许头部收缩 */
}
.close-btn {
cursor: pointer;
}
.language-modal-body {
padding: 10px 0;
overflow-y: auto; /* 只有内容区域可滚动 */
-webkit-overflow-scrolling: touch; /* 为iOS设备提供平滑滚动 */
flex: 1; /* 内容区域填充剩余空间 */
overscroll-behavior: contain; /* 阻止滚动穿透 */
}
.language-option {
padding: 30px 0;
font-size: 40px;
color: #333;
cursor: pointer;
transition: background-color 0.3s;
text-align: center;
}
.language-option:hover,
.language-option.active {
background-color: #f5f5f5;
color: #8b59f7;
}
.language-modal-footer {
padding: 40px 38px;
display: flex;
justify-content: center;
flex-shrink: 0; /* 不允许底部收缩 */
}
.confirm-btn {
background-color: #8b59f7;
color: white;
border: none;
border-radius: 10px;
padding: 23px 0;
width: 100%;
font-size: 40px;
cursor: pointer;
}
.confirm-btn:hover {
background-color: #7a48e6;
}
2025-02-19 11:04:19 +00:00
</style>