|
|
@ -2,17 +2,17 @@ |
|
|
|
<div |
|
|
|
ref="pageRef" |
|
|
|
class="homepage" |
|
|
|
:style="{ backgroundImage: `url(${bgImage})` }" |
|
|
|
> |
|
|
|
<!-- 顶部图标 --> |
|
|
|
<img class="top-icon" :src="topIcon" alt="顶部图标" /> |
|
|
|
|
|
|
|
<!-- 中间图示及说明 --> |
|
|
|
<!-- 副标题 --> |
|
|
|
<div class="content-container" > |
|
|
|
<img class="sub-title" :src="subtitle" alt="四维作战体系" /> |
|
|
|
<img class="content-icon" :src="contenicon" alt="四维情绪" /> |
|
|
|
</div> |
|
|
|
<div class="content-container"> |
|
|
|
<!-- 副标题 - 只在屏幕宽度小于等于1024px时显示 --> |
|
|
|
<img v-if="screenWidth <= 1024" class="sub-title" :src="subtitle" alt="四维作战体系" /> |
|
|
|
<!-- 内容图 - 根据屏幕宽度动态切换 --> |
|
|
|
<img class="content-icon" :src="currentContentIcon" alt="四维情绪" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 按钮区域 --> |
|
|
|
<div class="buttons-container"> |
|
|
@ -20,26 +20,41 @@ |
|
|
|
<img :src="btnIcon" alt="开启财运" /> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import { onMounted, ref } from 'vue' |
|
|
|
import { onMounted, ref, computed, onUnmounted } from 'vue' |
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
import bgImage from '@/assets/img/Emotionsmodel/-s-bg.png' |
|
|
|
// 移除背景图片的导入,改用CSS设置 |
|
|
|
import topIcon from '@/assets/img/Emotionsmodel/大标题.png' |
|
|
|
import subtitle from '@/assets/img/Emotionsmodel/-s-标题 拷贝.png' |
|
|
|
import contenicon from '@/assets/img/Emotionsmodel/-s-四维.png' |
|
|
|
import conteniconLarge from '@/assets/img/Emotionsmodel/_s_四维 拷贝.png' |
|
|
|
import conteniconSmall from '@/assets/img/Emotionsmodel/-s-四维.png' |
|
|
|
import btnIcon from '@/assets/img/Emotionsmodel/-s-开启财运.png' |
|
|
|
import { setHeight } from '@/utils/setHeight' |
|
|
|
|
|
|
|
const router = useRouter() |
|
|
|
const pageRef = ref(null) |
|
|
|
const screenWidth = ref(window.innerWidth) |
|
|
|
|
|
|
|
// 根据屏幕宽度选择内容图片 |
|
|
|
const currentContentIcon = computed(() => { |
|
|
|
return screenWidth.value > 1024 ? conteniconLarge : conteniconSmall |
|
|
|
}) |
|
|
|
|
|
|
|
const handleResize = () => { |
|
|
|
screenWidth.value = window.innerWidth |
|
|
|
} |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
setHeight(pageRef.value) |
|
|
|
window.addEventListener('resize', handleResize) |
|
|
|
}) |
|
|
|
|
|
|
|
onUnmounted(() => { |
|
|
|
window.removeEventListener('resize', handleResize) |
|
|
|
}) |
|
|
|
|
|
|
|
const goToAiEmotion = () => { |
|
|
|
// 设置 sessionStorage 控制 homepage.vue 激活 AiEmotion tab |
|
|
@ -53,7 +68,8 @@ const goToAiEmotion = () => { |
|
|
|
.homepage { |
|
|
|
/* width: 100vw; */ |
|
|
|
min-height: 100vh; |
|
|
|
background-image: url('@/assets/img/Emotionsmodel/-s-bg.png'); |
|
|
|
/* 默认使用小屏背景 */ |
|
|
|
background-image: url('@/assets/img/DBQBmodel/-s-bg.png'); |
|
|
|
background-size: cover; |
|
|
|
background-position: center; |
|
|
|
background-repeat: no-repeat; |
|
|
@ -68,13 +84,44 @@ const goToAiEmotion = () => { |
|
|
|
text-align: center; |
|
|
|
font-family: 'Microsoft YaHei', sans-serif; |
|
|
|
} |
|
|
|
|
|
|
|
@media (min-width: 1025px) and (max-width: 1900px){ |
|
|
|
|
|
|
|
/* 顶部图标 */ |
|
|
|
.top-icon { |
|
|
|
width: 40vw; |
|
|
|
max-width: 300px; |
|
|
|
width: 20vw; |
|
|
|
min-width: 300px; |
|
|
|
height: auto; |
|
|
|
margin-top: 10vw !important; |
|
|
|
margin-bottom: 2vw; |
|
|
|
} |
|
|
|
.content-icon { |
|
|
|
width: 80% !important; |
|
|
|
min-width: 300px; |
|
|
|
height: auto; |
|
|
|
margin-top: 50px !important; |
|
|
|
margin-bottom: 20px !important; |
|
|
|
} |
|
|
|
.btn-item img { |
|
|
|
width: 220px; |
|
|
|
min-width: 40vw !important; |
|
|
|
height: auto; |
|
|
|
margin-top: 5vh; |
|
|
|
margin-top: 10px !important; |
|
|
|
} |
|
|
|
} |
|
|
|
/* 大屏幕使用大背景图 */ |
|
|
|
@media screen and (min-width: 1025px) { |
|
|
|
.homepage { |
|
|
|
background-image: url('@/assets/img/DBQBmodel/bg.png'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* 顶部图标 */ |
|
|
|
.top-icon { |
|
|
|
width: 20vw; |
|
|
|
min-width: 300px; |
|
|
|
height: auto; |
|
|
|
margin-top: 2vw; |
|
|
|
margin-bottom: 2vw; |
|
|
|
} |
|
|
|
|
|
|
|
/* 四维体系整体容器修复 */ |
|
|
@ -96,10 +143,10 @@ const goToAiEmotion = () => { |
|
|
|
|
|
|
|
/* 内容图 */ |
|
|
|
.content-icon { |
|
|
|
width: 90%; |
|
|
|
max-width: 520px; |
|
|
|
height: auto; |
|
|
|
margin-top: 10px; |
|
|
|
width: 100%; |
|
|
|
min-width: 400px; |
|
|
|
height: auto; |
|
|
|
margin-top: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
/* 按钮区域 */ |
|
|
@ -125,7 +172,7 @@ const goToAiEmotion = () => { |
|
|
|
|
|
|
|
.btn-item img { |
|
|
|
width: 220px; |
|
|
|
max-width: 80vw; |
|
|
|
min-width: 20vw; |
|
|
|
height: auto; |
|
|
|
padding-top: 30px; |
|
|
|
} |
|
|
|