|
|
@@ -17,20 +17,17 @@
|
|
|
</div>
|
|
|
<div class="head-right">
|
|
|
<div class="info-bos flex-row-start">
|
|
|
- <div style="margin-right: 140px">
|
|
|
- <div class="info-title">客户服务</div>
|
|
|
- <div class="info-text" style="margin-top: 0">在线客服</div>
|
|
|
- <div class="info-text">问题反馈</div>
|
|
|
- </div>
|
|
|
- <div style="margin-right: 140px">
|
|
|
- <div class="info-title">客户</div>
|
|
|
- <div class="info-text" style="margin-top: 0">客户管理</div>
|
|
|
- <div class="info-text">供应商合作</div>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <div class="info-title">联系</div>
|
|
|
- <div class="info-text" style="margin-top: 0">帮助中心</div>
|
|
|
- <div class="info-text">关于我们</div>
|
|
|
+ <div v-for="(navItem, index) in bottomNavList" :key="index" :style="{ marginRight: index < bottomNavList.length - 1 ? '140px' : '0' }">
|
|
|
+ <div class="info-title">{{ navItem.navigationName }}</div>
|
|
|
+ <div
|
|
|
+ v-for="(link, linkIndex) in navItem.children"
|
|
|
+ :key="linkIndex"
|
|
|
+ class="info-text"
|
|
|
+ :style="{ marginTop: linkIndex === 0 ? '0' : '12px' }"
|
|
|
+ @click="handleNavClick(link)"
|
|
|
+ >
|
|
|
+ {{ link.navigationName }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="contact">
|
|
|
@@ -61,11 +58,39 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { getPlatformConfigList } from '@/api/breg/index';
|
|
|
+import { getBottomNav } from '@/api/home/index';
|
|
|
+import { handleTree } from '@/utils/ruoyi';
|
|
|
+
|
|
|
const icpNo = ref<any>('');
|
|
|
const license = ref<any>('');
|
|
|
const wechatLink = ref<any>('');
|
|
|
const weiboLink = ref<any>('');
|
|
|
const servicePhone = ref<any>('');
|
|
|
+const bottomNavList = ref<any[]>([]);
|
|
|
+
|
|
|
+// 获取底部导航数据
|
|
|
+const fetchBottomNav = async () => {
|
|
|
+ try {
|
|
|
+ const res = await getBottomNav('footer'); // 使用 footer 作为页面类型参数
|
|
|
+ if (res.code == 200 && res.data) {
|
|
|
+ // 后端返回的是扁平列表,使用 handleTree 转换为树形结构
|
|
|
+ // parentId 为 0、null 或 undefined 的是父级节点
|
|
|
+ bottomNavList.value = handleTree(res.data, 'id', 'parentId', 'children');
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取底部导航失败:', error);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 处理导航点击事件
|
|
|
+const handleNavClick = (link: any) => {
|
|
|
+ if (link.url) {
|
|
|
+ window.open(link.url, '_blank');
|
|
|
+ } else if (link.link) {
|
|
|
+ window.open(link.link, '_blank');
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
getPlatformConfigList({ configKey: 'icpNo' }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
if (res.rows && res.rows.length > 0) {
|
|
|
@@ -105,6 +130,11 @@ getPlatformConfigList({ configKey: 'servicePhone' }).then((res) => {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+// 组件挂载时获取底部导航数据
|
|
|
+onMounted(() => {
|
|
|
+ fetchBottomNav();
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|