|
@@ -1,36 +1,40 @@
|
|
|
<template>
|
|
|
- <el-row class="introduce">
|
|
|
- <el-col :span="24" class="bigImage"></el-col>
|
|
|
- <el-col :span="24" class="info">
|
|
|
- <el-col :span="24" class="menus">
|
|
|
- <menusIndex />
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="bottom">
|
|
|
- <el-col :span="24" class="zero top">
|
|
|
- <top-index :info="{ title: '集团介绍', enTitle: 'INTRODUCTION' }" />
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="zero">
|
|
|
- <brief-index />
|
|
|
- </el-col>
|
|
|
- <!-- <el-col :span="24" class="zero">
|
|
|
- <setting-index />
|
|
|
- </el-col> -->
|
|
|
- <el-col :span="24" class="zero">
|
|
|
- <combrief-index />
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="zero">
|
|
|
- <fengmao-index />
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="foot">
|
|
|
- <foot-index />
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
+ <el-row class="introduce">
|
|
|
+ <el-col :span="24" class="bigImage" :class="{ 'new-style': isScrollingDown }"></el-col>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <el-col :span="24" class="menus">
|
|
|
+ <menusIndex />
|
|
|
+ </el-col>
|
|
|
+ <transition name="fade">
|
|
|
+ <el-row v-if="isScrollingDown" class="new-title">
|
|
|
+ <div class="title">集团介绍</div>
|
|
|
+ </el-row>
|
|
|
+ </transition>
|
|
|
+ <div ref="targetDiv" class="bottom">
|
|
|
+ <el-col :span="24" class="zero top">
|
|
|
+ <top-index :info="{ title: '集团介绍', enTitle: 'INTRODUCTION' }" />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="zero">
|
|
|
+ <brief-index />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="zero">
|
|
|
+ <combrief-index />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="zero">
|
|
|
+ <fengmao-index />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="foot">
|
|
|
+ <foot-index />
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
|
+import { throttle } from 'lodash-es'
|
|
|
+
|
|
|
defineOptions({ name: 'introduceIndex' })
|
|
|
/* 菜单 */
|
|
|
import menusIndex from '../../components/windows/menusIndex.vue'
|
|
@@ -49,48 +53,95 @@ import fengmaoIndex from './introduceParts/fengmaoIndex.vue'
|
|
|
|
|
|
/* 底部信息 */
|
|
|
import footIndex from '../../components/windows/footIndex.vue'
|
|
|
+
|
|
|
+// 创建一个 ref 来引用目标 div
|
|
|
+const targetDiv = ref()
|
|
|
+// 用于存储是否向下滚动的状态
|
|
|
+const isScrollingDown = ref(false)
|
|
|
+// 滚动事件处理函数
|
|
|
+const handleScroll = () => {
|
|
|
+ const currentScrollTop = targetDiv.value.scrollTop
|
|
|
+ console.log(currentScrollTop)
|
|
|
+ // 判断是否不在最上面且向下滚动
|
|
|
+ if (currentScrollTop > 250) isScrollingDown.value = true
|
|
|
+ else isScrollingDown.value = false
|
|
|
+}
|
|
|
+
|
|
|
+// 创建节流后的滚动处理函数,每 200 毫秒触发一次
|
|
|
+const throttledScroll = throttle(handleScroll, 200)
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ // 组件挂载后,添加滚动事件监听器
|
|
|
+ targetDiv.value.addEventListener('scroll', throttledScroll)
|
|
|
+})
|
|
|
+
|
|
|
+onBeforeUnmount(() => {
|
|
|
+ // 组件卸载前,移除滚动事件监听器
|
|
|
+ targetDiv.value.removeEventListener('scroll', throttledScroll)
|
|
|
+})
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
.introduce {
|
|
|
- position: relative;
|
|
|
-
|
|
|
- .bigImage {
|
|
|
- height: 480px;
|
|
|
- overflow: hidden;
|
|
|
- background-image: url('/brief5.png');
|
|
|
- background-repeat: no-repeat;
|
|
|
- background-size: 100% 100%;
|
|
|
- }
|
|
|
-
|
|
|
- .info {
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- width: 100%;
|
|
|
- height: 100vh;
|
|
|
- overflow: hidden;
|
|
|
+ position: relative;
|
|
|
|
|
|
- .menus {
|
|
|
- height: 66px;
|
|
|
- overflow: hidden;
|
|
|
- }
|
|
|
+ .bigImage {
|
|
|
+ height: 480px;
|
|
|
+ overflow: hidden;
|
|
|
+ background-image: url('/brief5.png');
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
|
|
|
- .bottom {
|
|
|
- height: calc(100vh - 66px);
|
|
|
- overflow-y: auto;
|
|
|
- margin: 0 auto;
|
|
|
+ .new-style {
|
|
|
+ height: 10em;
|
|
|
+ width: 100%;
|
|
|
+ top: 0;
|
|
|
+ }
|
|
|
|
|
|
+ .info {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100vh;
|
|
|
+ overflow: hidden;
|
|
|
|
|
|
- .zero {
|
|
|
- margin: 0 0 40px 0;
|
|
|
+ .menus {
|
|
|
+ height: 66px;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ /* 定义淡入淡出过渡效果的 CSS 类 */
|
|
|
+ .fade-enter-active,
|
|
|
+ .fade-leave-active {
|
|
|
+ transition: opacity 0.5s ease;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ .fade-enter-from,
|
|
|
+ .fade-leave-to {
|
|
|
+ opacity: 0;
|
|
|
+ }
|
|
|
+ .new-title {
|
|
|
+ display: flex;
|
|
|
+ padding: 0 17%;
|
|
|
+ color: rgb(25, 25, 26);
|
|
|
+ font-family: '宋体';
|
|
|
+ font-size: 40px;
|
|
|
+ font-weight: 700;
|
|
|
+ line-height: 90px;
|
|
|
+ letter-spacing: 8px;
|
|
|
+ }
|
|
|
+ .bottom {
|
|
|
+ height: calc(100vh - 66px);
|
|
|
+ overflow-y: auto;
|
|
|
+ margin: 0 auto;
|
|
|
|
|
|
- .top {
|
|
|
- padding: 0 17%;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+ .zero {
|
|
|
+ margin: 0 0 40px 0;
|
|
|
}
|
|
|
|
|
|
+ .top {
|
|
|
+ padding: 0 17%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|