Commit 17114574 by 胡悦

feat(home): 新增AI视频页面并调整导航顺序

- 添加新的AI视频组件(AiVideo)作为导航选项
- 将原运营看板(view-operational)从位置4调整到位置5
- 更新导航标题,位置4现在显示"广联新能源车主服务行业大模型"
- 调整导航逻辑,下一页边界从4改为5
- 将变量声明从let改为const以提高代码质量
1 parent d8d2684a
<template>
<div class="video-container">
<video controls class="video-box" ref="video">
<source :src="videoSrc" type="video/mp4" />
</video>
<div class="video-pause" @click="hanldPlay('pause')" v-if="status == 'play'">
<img src="@/assets/images/play-icon.png" />
</div>
<div class="video-play" @click="hanldPlay('play')" v-if="status == 'pause'"><img src="@/assets/images/pause-icon.png" /></div>
</div>
</template>
<script>
export default {
name: 'AiVideo',
data() {
return {
videoSrc: 'https://img02.glsx.com.cn/weapp/resource/saas/video/video_20260311.mp4',
status: 'play',
timer: null
}
},
mounted() {
this.watchVideo()
},
watch: {
status(val) {
if (this.timer) {
clearTimeout(this.timer)
}
if (val == 'pause') {
this.timer = setTimeout(() => {
this.status = ''
}, 3000)
}
}
},
methods: {
watchVideo() {
this.$refs.video.addEventListener('ended', () => {
this.status = 'play'
})
this.$refs.video.addEventListener('play', () => {
this.status = 'pause'
})
this.$refs.video.addEventListener('pause', () => {
this.status = 'play'
})
document.addEventListener('keydown', this.handleDown)
document.addEventListener('fullscreenchange', function (e) {
let isFull
if (document.fullscreenElement) {
isFull = true
} else {
isFull = false
}
this.isFull = true
})
},
handleDown(e) {
if (e.keyCode === 32) {
// 执行相应的操作
if (this.status == 'play') {
this.$refs.video.play()
} else {
this.$refs.video.pause()
}
}
},
hanldPlay(status) {
if (status == 'pause') {
this.$refs.video.play()
} else {
this.$refs.video.pause()
}
}
},
beforeDestroy() {
document.removeEventListener('keydown', this.handleDown)
// this.$refs.video.pause()
}
}
</script>
<style lang="scss" scoped>
.video-container {
width: 1824px;
height: 876px;
background: url('../../assets/images/home-bg.png') no-repeat;
background-size: 100%;
// border: 4px solid rgba(18, 117, 248, 0.5);
box-sizing: border-box;
// margin: 20px calc((100vw - 1560px) / 2);
margin: 20px auto;
position: relative;
display: flex;
justify-content: center;
align-items: center;
.video-box {
width: 1440px;
height: 810px;
}
.video-pause,
.video-play {
position: absolute;
top: 50%;
left: 50%;
width: 120px;
height: 120px;
margin-left: -60px;
margin-top: -60px;
border-radius: 50%;
}
}
.video-full {
z-index: 999;
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background: #000000;
.video-box {
position: absolute;
left: 324px;
width: calc(100% - 648px);
}
}
</style>
......@@ -20,7 +20,8 @@
<video-page v-if="current == 0" />
<view-life-scene-data v-if="current == 3" />
<energy-car v-if="current == 2" />
<view-operational v-if="current == 4" />
<ai-video v-if="current == 4" />
<view-operational v-if="current == 5" />
<view-entire-lifecycleOf-car v-if="current == 1" />
<!-- <GlskDataViewSceneIndex v-if="current == 4"></GlskDataViewSceneIndex> -->
</transition>
......@@ -41,7 +42,8 @@ import FixedArrow from '@/components/Arrow.vue'
import ViewEntireLifecycleOfCar from './pages/viewEntireLifecycleOfCar.vue'
import GlskDataViewSceneIndex from '../newPage/index.vue'
import videoPage from '@/views/videoPage/index.vue'
//energyCar ViewEntireLifecycleOfCar
// energyCar ViewEntireLifecycleOfCar
import AiVideo from '@/views/aiVideo/index.vue'
import EnergyCar from '@/views/energyCar/index.vue'
export default {
name: '',
......@@ -52,7 +54,8 @@ export default {
ViewEntireLifecycleOfCar,
EnergyCar,
videoPage,
GlskDataViewSceneIndex
GlskDataViewSceneIndex,
AiVideo
},
data() {
return {
......@@ -63,7 +66,7 @@ export default {
1: '广联企业全景介绍',
2: '广联数据要素大屏',
3: '广联新能源车主服务行业大模型',
4: '广联数科运营看板',
4: '广联新能源车主服务行业大模型',
5: '广联数科运营看板'
},
startX: 0,
......@@ -72,7 +75,7 @@ export default {
}
},
created() {
let _this = this
const _this = this
this.$bus.$on('selectVal', data => {
this.activeName = data
})
......@@ -104,9 +107,9 @@ export default {
// 前一页
prevClick() {
let index = this.current
const index = this.current
if (index == 0) {
//this.current = 3
// this.current = 3
return false
}
this.transitionName = 'slide-right'
......@@ -115,9 +118,9 @@ export default {
// 下一页
nextClick() {
let index = this.current
if (index == 4) {
//this.current = 0
const index = this.current
if (index == 5) {
// this.current = 0
// window.open('https://bi-view.beta.glsx.com.cn/#/home', '_blank')
// return false
this.$router.push({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!