117 lines
2.4 KiB
Vue
117 lines
2.4 KiB
Vue
<template>
|
||
<div class="banner">
|
||
<div class="banner-content">
|
||
<div class="banner-text">
|
||
<h1 class="title">开启 CAD 学习之旅</h1>
|
||
<p class="subtitle">为你的创意引擎注入强劲动力,驱动设计梦想在市场中乘风破浪</p>
|
||
<button class="join-button" @click="handleService">客服联系</button>
|
||
</div>
|
||
<div class="banner-image">
|
||
<img src="~/assets/images/foreign_banner.png" alt="CAD工作环境" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- 打开客服弹窗 弄成组件 -->
|
||
<KlService v-if="dialogVisible" v-model:dialog-visible="dialogVisible"></KlService>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import useUserStore from '~/stores/user'
|
||
import KlService from '~/components/kl-quick-menu/components/kl-service.vue'
|
||
// 组件逻辑可以在这里添加
|
||
const dialogVisible = ref(false)
|
||
const handleService = () => {
|
||
// 判断是否登录
|
||
const userStore = useUserStore()
|
||
if (!userStore.token) {
|
||
ElMessage.error('请先登录')
|
||
return
|
||
}
|
||
dialogVisible.value = true
|
||
// 读取未读消息
|
||
// readCount.value = false
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
.banner {
|
||
background: #f4f6f6;
|
||
padding: 60px 40px;
|
||
min-height: 400px;
|
||
}
|
||
|
||
.banner-content {
|
||
max-width: 1400px;
|
||
margin: 0 auto;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
/* gap: 40px; */
|
||
}
|
||
|
||
.banner-text {
|
||
flex: 1;
|
||
}
|
||
|
||
.title {
|
||
font-size: 2.5rem;
|
||
font-weight: bold;
|
||
color: #333;
|
||
margin-bottom: 20px;
|
||
}
|
||
|
||
.subtitle {
|
||
font-size: 1.2rem;
|
||
color: #666;
|
||
line-height: 1.6;
|
||
margin-bottom: 30px;
|
||
}
|
||
|
||
.join-button {
|
||
background-color: #1a73e8;
|
||
color: white;
|
||
border: none;
|
||
padding: 12px 32px;
|
||
border-radius: 4px;
|
||
font-size: 1.1rem;
|
||
cursor: pointer;
|
||
transition: background-color 0.3s;
|
||
}
|
||
|
||
.join-button:hover {
|
||
background-color: #1557b0;
|
||
}
|
||
|
||
.banner-image {
|
||
flex: 1;
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
}
|
||
|
||
.banner-image img {
|
||
width: 100%;
|
||
max-width: 600px;
|
||
border-radius: 8px;
|
||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||
}
|
||
|
||
@media (max-width: 768px) {
|
||
.banner {
|
||
padding: 20px;
|
||
}
|
||
|
||
.banner-content {
|
||
flex-direction: column;
|
||
text-align: center;
|
||
}
|
||
|
||
.title {
|
||
font-size: 2rem;
|
||
}
|
||
|
||
.subtitle {
|
||
font-size: 1rem;
|
||
}
|
||
}
|
||
</style>
|