|
@@ -30,6 +30,8 @@
|
|
|
</el-icon>
|
|
</el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="userInfo-box">姓名:{{ userInfo.user.nickName }}</div>
|
|
<div class="userInfo-box">姓名:{{ userInfo.user.nickName }}</div>
|
|
|
|
|
+ <div class="userInfo-box">部门:{{ userInfo.user.deptName || '' }}</div>
|
|
|
|
|
+
|
|
|
<div class="userInfo-box" @click="onlogout">退出登录</div>
|
|
<div class="userInfo-box" @click="onlogout">退出登录</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div v-if="!userInfo.user" class="header-text end" @click="onPath('/login')" style="cursor: pointer">请登录</div>
|
|
<div v-if="!userInfo.user" class="header-text end" @click="onPath('/login')" style="cursor: pointer">请登录</div>
|
|
@@ -38,9 +40,9 @@
|
|
|
<div v-else class="header-text" @click="goEnterprise">切换到企业</div> -->
|
|
<div v-else class="header-text" @click="goEnterprise">切换到企业</div> -->
|
|
|
<div class="header-text" @click="onPath('/order/orderManage')">我的订单</div>
|
|
<div class="header-text" @click="onPath('/order/orderManage')">我的订单</div>
|
|
|
<div v-if="userInfo.user && userInfo.user.userSonType != 4" class="header-text" @click="onPath('/enterprise/companyInfo')">会员中心</div>
|
|
<div v-if="userInfo.user && userInfo.user.userSonType != 4" class="header-text" @click="onPath('/enterprise/companyInfo')">会员中心</div>
|
|
|
- <div class="header-text" @click="onPath('/theme?id=1')">人才招聘</div>
|
|
|
|
|
- <div class="header-text">帮助中心</div>
|
|
|
|
|
- <div class="header-text">在线客服</div>
|
|
|
|
|
|
|
+ <template v-for="(item, index) in headerNavList" :key="index">
|
|
|
|
|
+ <div class="header-text" @click="handleNavClick(item)">{{ item.navigationName }}</div>
|
|
|
|
|
+ </template>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -51,9 +53,11 @@ import { useUserStore } from '@/store/modules/user';
|
|
|
import { onPath } from '@/utils/siteConfig';
|
|
import { onPath } from '@/utils/siteConfig';
|
|
|
import Cookies from 'js-cookie';
|
|
import Cookies from 'js-cookie';
|
|
|
import { getInfo } from '@/api/login';
|
|
import { getInfo } from '@/api/login';
|
|
|
|
|
+import { getHeaderNav } from '@/api/home/index';
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
const userInfoOpen = ref<any>(false);
|
|
const userInfoOpen = ref<any>(false);
|
|
|
const userInfo = ref<any>({});
|
|
const userInfo = ref<any>({});
|
|
|
|
|
+const headerNavList = ref<any[]>([]);
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
// getCurrentLocation();
|
|
// getCurrentLocation();
|
|
@@ -65,6 +69,8 @@ onMounted(() => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ // 获取头部导航数据
|
|
|
|
|
+ fetchHeaderNav();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const handleMouseEnter = () => {
|
|
const handleMouseEnter = () => {
|
|
@@ -145,6 +151,27 @@ const onlogout = () => {
|
|
|
onPath('/login');
|
|
onPath('/login');
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+// 获取头部导航数据
|
|
|
|
|
+const fetchHeaderNav = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await getHeaderNav('header'); // 使用 header 作为页面类型参数
|
|
|
|
|
+ if (res.code == 200 && res.data) {
|
|
|
|
|
+ headerNavList.value = res.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('获取头部导航失败:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 处理导航点击事件
|
|
|
|
|
+const handleNavClick = (item: any) => {
|
|
|
|
|
+ if (item.url) {
|
|
|
|
|
+ onPath(item.url);
|
|
|
|
|
+ } else if (item.link) {
|
|
|
|
|
+ onPath(item.link);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -194,7 +221,7 @@ const onlogout = () => {
|
|
|
&.open {
|
|
&.open {
|
|
|
background-color: #ffffff;
|
|
background-color: #ffffff;
|
|
|
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.12);
|
|
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.12);
|
|
|
- height: 110px;
|
|
|
|
|
|
|
+ height: 130px;
|
|
|
overflow: visible;
|
|
overflow: visible;
|
|
|
|
|
|
|
|
.userInfo-customer {
|
|
.userInfo-customer {
|