更新前端相关

This commit is contained in:
扫地僧 2026-02-06 00:06:16 +08:00
parent fed2bd63c7
commit e9a051520e
5 changed files with 125 additions and 43 deletions

View File

@ -10,4 +10,10 @@ export const getHeadMenu = async () => {
export const getOnePageByPath = async (path: string) => {
const response = await service.get(`index/onepage/${encodeURIComponent(path)}`)
return response.data
}
// 获取前端底部数据
export const getFooterData = async () => {
const response = await service.get('index/footerdata')
return response.data
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -7,62 +7,55 @@
<div class="footer-main">
<div class="left">
<div class="footer-column">
<div class="title">关于美天</div>
<div class="title">YUNZER</div>
<ul>
<li>企业概况</li>
<li>公司证件</li>
<li>关于我们</li>
<li>站点资讯</li>
</ul>
</div>
<div class="footer-column">
<div class="title">资源</div>
<ul>
<li>办公资源</li>
<li>游戏下载</li>
<li>程序下载</li>
</ul>
</div>
<div class="footer-column">
<div class="title">联系我们</div>
<ul>
<li>加入我们</li>
<li>联系我们</li>
</ul>
</div>
<div class="footer-column">
<div class="title">产品中心</div>
<div class="title">法律信息</div>
<ul>
<li>金蝶·云星空</li>
<li>金蝶·KIS Cloud</li>
<li>金蝶·EAS Cloud</li>
<li>警务保障系统</li>
<li>义警联盟平台</li>
<li>商超进销存系统</li>
</ul>
</div>
<div class="footer-column">
<div class="title">解决方案</div>
<ul>
<li>财务云</li>
<li>供应链云</li>
<li>全渠道云</li>
<li>制造云</li>
</ul>
</div>
<div class="footer-column">
<div class="title">服务支持</div>
<ul>
<li>常见问题</li>
<li>软件下载</li>
<li>投诉与建议</li>
</ul>
</div>
<div class="footer-column">
<div class="title">商务合作</div>
<ul>
<li>商务合作</li>
<li>隐私</li>
<li>条款</li>
<li>Cookie</li>
</ul>
</div>
</div>
<div class="right">
<div class="logo-w">
<img
v-if="footerData && footerData.logow"
:src="getenvurl(footerData.logow)"
alt="logo"
>
</div>
<div class="footer-column">
<div class="title">订阅我们</div>
<div>第一时间了解我们的最新信息</div>
</div>
</div>
</div>
<div class="footer-bottom">
<div class="footer-bottom" v-if="footerData" >
<div class="left">
<span>美天为您用心多一点</span>
<span>江苏美天智能科技有限公司·所有版权©2019-2026</span>
<span>备案号:苏ICP备2020053493号</span>
<span class="mr-3">{{ footerData.description }}</span>
<span class="mr-3">{{ footerData.companyname }}&nbsp;&nbsp;&nbsp;&nbsp;{{ footerData.copyright }}</span>
<span class="mr-3"><a href="https://beian.miit.gov.cn/" target="_blank">{{ footerData.icp }}</a></span>
</div>
<div class="right">
<span>法律声明 | 隐私条款</span>
@ -74,8 +67,23 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted } from 'vue'
import { getFooterData } from '@/api/index'
const showGototop = ref(false)
const footerData = ref<any | null>(null)
// logo
const getenvurl = (url: string) => {
if (!url) return ''
// http/https
if (/^https?:\/\//.test(url)) {
return url
}
const base = import.meta.env.VITE_API_BASE_URL || ''
const normalizedBase = base.replace(/\/+$/, '')
const normalizedUrl = String(url).replace(/^\/+/, '')
return `${normalizedBase}/${normalizedUrl}`
}
const handleScroll = () => {
showGototop.value = window.scrollY > 300
@ -88,7 +96,26 @@ const goToTop = () => {
})
}
//
const fetchFooterData = async () => {
const res = await getFooterData()
if (res.code === 200 && Array.isArray(res.data)) {
const map: Record<string, string> = {}
res.data.forEach((item: any) => {
if (item && item.label) {
map[item.label] = item.value
}
})
// sitename
if (map.sitename) {
document.title = map.sitename
}
footerData.value = map
}
}
onMounted(() => {
fetchFooterData()
window.addEventListener('scroll', handleScroll)
handleScroll()
})
@ -101,7 +128,7 @@ onUnmounted(() => {
<style lang="scss" scoped>
.footer {
width: 100%;
background-color: var(--tw-bg-opacity);
background-color: #161616;
color: var(--footer-color);
font-size: var(--footer-size);
padding: 20px 0;
@ -139,7 +166,8 @@ onUnmounted(() => {
.footer-main {
display: flex;
padding: 40px 0;
margin: 0 auto;
padding: 2rem 0 5rem 0;
.left {
width: 80%;
@ -148,11 +176,23 @@ onUnmounted(() => {
.footer-column {
flex: 1;
padding: 0 15px;
li{
font-size: 1rem;
}
}
}
.right {
width: 20%;
.logo-w{
margin-bottom: 20px;
img{
height: 45px;
object-fit: contain;
}
}
}
}

View File

@ -3,7 +3,12 @@
<div class="container">
<div class="maincontent">
<div class="logo">
<img src="@/assets/images/logo.png" alt="Logo" />
<!-- <img src="@/assets/images/logo.png" alt="Logo" /> -->
<img
v-if="footerData && footerData.logo"
:src="getenvurl(footerData.logo)"
alt="logo"
>
</div>
<div class="menu">
<ul @mouseleave="handleMenuLeave">
@ -357,9 +362,11 @@
</div>
</template>
<script setup>
<script setup lang="ts">
import { ref, onMounted, onUnmounted } from 'vue'
import { getHeadMenu } from '@/api/index'
import { getHeadMenu,getFooterData } from '@/api/index'
//
const menuItems = ref([])
@ -393,6 +400,19 @@ const loadMenu = async () => {
}
}
// logo
const getenvurl = (url: string) => {
if (!url) return ''
// http/https
if (/^https?:\/\//.test(url)) {
return url
}
const base = import.meta.env.VITE_API_BASE_URL || ''
const normalizedBase = base.replace(/\/+$/, '')
const normalizedUrl = String(url).replace(/^\/+/, '')
return `${normalizedBase}/${normalizedUrl}`
}
const activeMenu = ref(null)
const activeCategory = ref(0)
const showSearch = ref(false)
@ -400,6 +420,7 @@ const showLanguage = ref(false)
const searchQuery = ref('')
const currentLanguage = ref('zh')
const isScrolled = ref(false)
const footerData = ref<any | null>(null)
let closeTimer = null
const handleScroll = () => {
@ -449,7 +470,22 @@ const handleExternalLink = (url) => {
}
}
//
const fetchFooterData = async () => {
const res = await getFooterData()
if (res.code === 200 && Array.isArray(res.data)) {
const map: Record<string, string> = {}
res.data.forEach((item: any) => {
if (item && item.label) {
map[item.label] = item.value
}
})
footerData.value = map
}
}
onMounted(() => {
fetchFooterData()
window.addEventListener('scroll', handleScroll)
loadMenu() //
})
@ -504,7 +540,7 @@ onUnmounted(() => {
.logo {
img {
max-width: 300px;
height: 45px;
object-fit: contain;
}
}