瀏覽代碼

大客户站点

weixin_52219567 15 小時之前
父節點
當前提交
92c89a24c6

+ 9 - 0
src/api/home/index-data.ts

@@ -111,3 +111,12 @@ export function currentScenarioConfig(query: any) {
     params: query
   });
 }
+
+// 顶部菜单
+export function topMenuList(query: any) {
+  return request({
+    url: '/system/pcDkhMenuSettings/topMenuList',
+    method: 'get',
+    params: query
+  });
+}

+ 2 - 1
src/api/pc/system/announcement.ts

@@ -9,6 +9,7 @@ export interface AnnouncementQuery {
   pageSize?: number;
   title?: string;
   status?: string;
+  isShow?: number;
 }
 
 /**
@@ -29,7 +30,7 @@ export interface AnnouncementVO {
  */
 export function getAnnouncementList(query?: AnnouncementQuery): AxiosPromise<AnnouncementVO[]> {
   return request({
-    url: '/pc/announcement/list',
+    url: '/system/pc/announcement/list',
     method: 'get',
     params: query
   });

+ 93 - 22
src/layout/components/nav.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 导航组件 -->
-  <div class="nav-pages" :class="meta.info ? 'nav-pages1' : ''">
-    <div class="nav-bos" :style="{ 'max-width': route.path == '/item' ? '1600px' : '1500px' }" @mouseleave="leaveClassify">
+  <div class="nav-pages" :class="headerClass">
+    <div class="nav-bos" @mouseleave="leaveClassify">
       <div class="nav-all flex-row-start" @mouseenter="openClassify">
         <img src="@/assets/images/layout/layout2.png" alt="" />
         <div>全部商品分类</div>
@@ -39,7 +39,7 @@
               <ArrowRight />
             </el-icon>
             <div class="classify-label">
-              <div v-for="(item1, index1) in item.children" :key="index1" @click="onPath('/search?type=3&bottomCategoryId=' + item1.id)">
+              <div v-for="(item1, index1) in item.children" :key="index1" @click.stop="onPath('/search?type=3&bottomCategoryId=' + item1.id)">
                 {{ item1.label || '' }}
               </div>
             </div>
@@ -55,6 +55,11 @@ import { onPath } from '@/utils/siteConfig';
 import { categoryStore } from '@/store/modules/category';
 import { getProductCategoryTree } from '@/api/home/index';
 import { getHomeNav } from '@/api/home/index';
+import { useUserStore } from '@/store/modules/user';
+import { stationStore } from '@/store/modules/station';
+import { categoryMainList, headerCategoryList } from '@/api/home/index-data';
+const station = stationStore();
+const userStore = useUserStore();
 const categoryStoreStore = categoryStore();
 const route = useRoute();
 const classifyList = ref<any>([]);
@@ -75,13 +80,39 @@ const props = defineProps<{
   meta?: any;
 }>();
 
-onMounted(async () => {
-  // 获取分类
-  getProductCategoryTree({ platform: 0 }).then((res) => {
-    if (res.code == 200) {
-      classifyList.value = res.data;
+// 根据路由路径返回不同的 class
+const headerClass = computed(() => {
+  const path = route.path;
+  if (path === '/item') {
+    return 'nav-item';
+  } else {
+    return 'nav-default';
+  }
+});
+
+const headerType = computed(() => {
+  if (station.stationData && Object.keys(station.stationData).length > 0) {
+    const data = station.stationData.data || station.stationData;
+    const isDiy = data?.isDiy;
+
+    if (isDiy === 0 || isDiy === '0') {
+      return 'dataHeader';
+    } else if (isDiy !== undefined && isDiy !== null) {
+      return 'dataHeader';
     }
-  });
+  }
+  // 2. 判断是否显示 jdHeader(userSonType 为 '3' 且允许 /indexEnterprise)
+  if (userStore.userInfo?.user?.userSonType == '3') {
+    return 'jdHeader';
+  }
+
+  // 3. 其他情况显示普通 Header
+  return 'default';
+});
+
+onMounted(async () => {
+  initData();
+
   // 获取导航栏
   // getHomeNav(1).then((res) => {
   //   if (res.code == 200) {
@@ -89,6 +120,46 @@ onMounted(async () => {
   // });
 });
 
+const initData = () => {
+  if (headerType.value == 'jdHeader') {
+  } else if (headerType.value == 'dataHeader') {
+    categoryMainList({ status: 1 }).then((res) => {
+      if (res.code == 200) {
+        document.documentElement.style.setProperty('--hover-data2', res.rows.length > 0 ? res.rows[0].categoryThemeColor || '#E7000B' : '#E7000B');
+        res.rows.forEach((item1: any) => {
+          item1.label = item1.name;
+          item1.id = item1.syncCategoryId;
+          item1.subMenus.forEach((item2: any) => {
+            item2.label = item2.name;
+            item2.id = item2.syncCategoryId;
+            item2.children.forEach((item3: any) => {
+              item3.label = item3.name;
+              item3.id = item3.syncCategoryId;
+            });
+          });
+          item1.children = item1.subMenus;
+        });
+        classifyList.value = res.rows;
+      }
+    });
+    headerCategoryList({}).then((res) => {
+      if (res.code == 200) {
+        document.documentElement.style.setProperty('--hover-data3', res.rows.length > 0 ? res.rows[0].headerThemeColor || '#E7000B' : '#E7000B');
+        res.rows.forEach((item: any) => {
+          item.url = item.linkUrl;
+        });
+        navList.value = res.rows;
+      }
+    });
+  } else {
+    getProductCategoryTree({ platform: 0 }).then((res) => {
+      if (res.code == 200) {
+        classifyList.value = res.data;
+      }
+    });
+  }
+};
+
 //移入分类
 const openClassify = () => {
   const path = route.path;
@@ -114,7 +185,7 @@ const leaveClassify = () => {
 .nav-pages {
   width: 100%;
   background-color: #ffffff;
-  border-bottom: 2px solid var(--el-color-primary);
+  border-bottom: 2px solid var(--hover-data2);
 
   .nav-bos {
     margin: 0 auto;
@@ -129,7 +200,7 @@ const leaveClassify = () => {
     .nav-all {
       width: 234px;
       height: 40px;
-      background: #e7000b;
+      background: var(--hover-data2);
       padding: 0 10px;
       font-size: 15px;
       color: #ffffff;
@@ -153,7 +224,7 @@ const leaveClassify = () => {
       cursor: pointer;
 
       &.hig {
-        color: #e7000b;
+        color: var(--hover-data3);
         position: relative;
 
         &::before {
@@ -164,13 +235,13 @@ const leaveClassify = () => {
           display: inline-block;
           width: 100%;
           height: 3px;
-          background: #e7000b;
+          background: var(--hover-data3);
           margin-right: 8px;
         }
       }
 
       &:hover {
-        color: #e7000b;
+        color: var(--hover-data3);
       }
     }
 
@@ -197,8 +268,8 @@ const leaveClassify = () => {
           position: relative;
 
           &.classify-hig {
-            border: 1px solid var(--el-color-primary);
-            border-right: 0px solid var(--el-color-primary);
+            border: 1px solid var(--hover-data2);
+            border-right: 0px solid var(--hover-data2);
           }
 
           .label {
@@ -210,7 +281,7 @@ const leaveClassify = () => {
             margin-right: 10px;
 
             &:hover {
-              color: var(--el-color-primary);
+              color: var(--hover-data2);
             }
           }
 
@@ -225,7 +296,7 @@ const leaveClassify = () => {
             }
 
             &:hover {
-              color: var(--el-color-primary);
+              color: var(--hover-data2);
             }
           }
 
@@ -248,7 +319,7 @@ const leaveClassify = () => {
         left: 234px;
         // width: 966px;
         height: 540px;
-        border: 1px solid var(--el-color-primary);
+        border: 1px solid var(--hover-data2);
         background-color: #ffffff;
         overflow-y: auto;
         padding-left: 30px;
@@ -261,7 +332,7 @@ const leaveClassify = () => {
           .two-level {
             width: 90px;
             font-size: 14px;
-            color: var(--el-color-primary);
+            color: var(--hover-data2);
             cursor: pointer;
           }
 
@@ -282,7 +353,7 @@ const leaveClassify = () => {
               cursor: pointer;
 
               &:hover {
-                color: var(--el-color-primary);
+                color: var(--hover-data2);
               }
             }
           }
@@ -291,7 +362,7 @@ const leaveClassify = () => {
     }
   }
 
-  &.nav-pages1 {
+  &.nav-item {
     .nav-bos {
       width: 1200px;
       min-width: 0;

+ 2 - 3
src/layout/components/workbench.vue

@@ -52,8 +52,7 @@
             <div class="popover-bos">
               <div class="popover-title">{{ item1.title }}</div>
               <template v-for="(item2, index2) in item1.children" :key="index2">
-                <div class="popover-list" :class="{ 'popover-hig': activeMenu == item2.path }"
-                  @click="onPath(item2.path)">
+                <div class="popover-list" :class="{ 'popover-hig': activeMenu == item2.path }" @click="onPath(item2.path)">
                   {{ item2.title }}
                 </div>
               </template>
@@ -246,7 +245,7 @@ const checkCurrentRoutePermission = () => {
   const currentPath = route.path;
   const publicPaths = ['/', '/login', '/404'];
   if (!publicPaths.includes(currentPath) && !allowedPaths.value.has(currentPath) && menuLists.value.includes(currentPath)) {
-    console.log('jinlai')
+    console.log('jinlai');
     onPath('/');
   }
 };

+ 34 - 2
src/layout/index.vue

@@ -1,7 +1,12 @@
 <template>
   <div class="app-wrapper">
-    <Header v-if="meta.header != 'hide'" />
-    <Search v-if="meta.search != 'hide'" :meta="meta" />
+    <!-- 根据 permission.ts 的判断逻辑决定显示哪个header -->
+    <template v-if="meta.header != 'hide'">
+      <dataHeader :userInfo="userStore.userInfo" v-if="headerType == 'dataHeader'" />
+      <jdHeader v-else-if="headerType == 'jdHeader'" />
+      <Header v-else />
+    </template>
+    <Search v-if="meta.search != 'hide' && headerType == 'default'" :meta="meta" />
     <Nav v-if="meta.nav" :meta="meta" />
     <Breadcrumb v-if="meta.breadcrumb" />
     <div class="pages-bos" :class="meta.workbench ? 'pages-bos1' : 'pages-bos2'" :style="{ minHeight: boxHeight }">
@@ -14,11 +19,38 @@
 
 <script setup lang="ts">
 import { Header, Search, Nav, Breadcrumb, Foot, Workbench } from './components';
+import dataHeader from '@/views/home/datacomponents/JDHeader.vue';
+import jdHeader from '@/views/home/jdcomponents/JDHeader.vue';
+import { stationStore } from '@/store/modules/station';
+import { useUserStore } from '@/store/modules/user';
 
 const route = useRoute();
 const meta = ref<any>({});
 const WorkbenchRef = ref<any>(null);
 const boxHeight = ref<any>('0px');
+const station = stationStore();
+const userStore = useUserStore();
+
+// 根据 permission.ts 中的逻辑判断应该显示哪个 Header
+const headerType = computed(() => {
+  if (station.stationData && Object.keys(station.stationData).length > 0) {
+    const data = station.stationData.data || station.stationData;
+    const isDiy = data?.isDiy;
+
+    if (isDiy === 0 || isDiy === '0') {
+      return 'dataHeader';
+    } else if (isDiy !== undefined && isDiy !== null) {
+      return 'dataHeader';
+    }
+  }
+  // 2. 判断是否显示 jdHeader(userSonType 为 '3' 且允许 /indexEnterprise)
+  if (userStore.userInfo?.user?.userSonType == '3') {
+    return 'jdHeader';
+  }
+
+  // 3. 其他情况显示普通 Header
+  return 'default';
+});
 
 const observeHeight = () => {
   if (!WorkbenchRef.value?.$el) return;

+ 2 - 2
src/views/home/datacomponents/JDCategory.vue

@@ -11,7 +11,7 @@
     <ul class="cate-list">
       <li v-for="(c, i) in displayedCategories" :key="i" class="cate-item" :class="{ active: activeIndex === i }" @mouseenter="activeIndex = i">
         <div class="cate-link-container">
-          <span @click="onPath('/search?type=2&topCategoryId=' + c.syncCategoryId)" class="main-cat-link">
+          <span @click="onPath('/search?type=1&topCategoryId=' + c.syncCategoryId)" class="main-cat-link">
             {{ c.name.length > 4 ? c.name.slice(0, 3) + '...' : c.name }}</span
           >
           <div class="sub-cats-wrapper">
@@ -48,7 +48,7 @@
             <span @click="onPath('/search?type=2&mediumCategoryId=' + sub.syncCategoryId)" class="sub-dt-link">{{ sub.name }}</span>
           </dt>
           <dd>
-            <span v-for="(item, iIdx) in sub.children" :key="iIdx" @click="onPath('/search?type=2&bottomCategoryId=' + item.syncCategoryId)">
+            <span v-for="(item, iIdx) in sub.children" :key="iIdx" @click="onPath('/search?type=3&bottomCategoryId=' + item.syncCategoryId)">
               {{ item.name }}
             </span>
           </dd>

+ 35 - 2
src/views/home/datacomponents/JDHeader.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="jd-header">
+  <div class="jd-header" :class="headerClass">
     <!-- 1. 始终吸顶的 44px 纯白背景顶部窄条 (无边框线,字号调大) -->
     <div class="header-top">
       <div class="top-inner flex-between w">
@@ -210,6 +210,21 @@ interface Props {
 }
 const props = defineProps<Props>();
 
+const route = useRoute();
+
+// 根据路由路径返回不同的 class
+const headerClass = computed(() => {
+  const path = route.path;
+
+  if (path === '/indexDataDiy') {
+    return 'header-indexDataDiy';
+  } else if (path === '/item') {
+    return 'header-item';
+  } else {
+    return 'header-default';
+  }
+});
+
 const topMenuData = ref<any>({});
 const dataInfo = ref<any>({});
 const wechatLink = ref<any>('');
@@ -308,7 +323,7 @@ onUnmounted(() => {
 });
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 /* 整个Header容器背景清透 */
 .jd-header {
   background: transparent;
@@ -1041,4 +1056,22 @@ onUnmounted(() => {
   pointer-events: none; /* 保证悬停在红点上依然完美触发按钮 Hover */
   z-index: 10;
 }
+
+.header-default {
+  .top-inner,
+  .header-mid {
+    min-width: 1200px;
+    max-width: 1500px;
+  }
+}
+
+.header-item {
+  .top-inner,
+  .header-mid {
+    width: 1200px;
+    @media (min-width: 1600px) {
+      width: 1600px;
+    }
+  }
+}
 </style>

+ 0 - 1
src/views/home/datacomponents/JDSceneRed.vue

@@ -31,7 +31,6 @@ currentScenarioConfig({}).then((res) => {
   if (res.code == 200) {
     dataInfo.value = res.rows[0];
     dataInfo.value.subCardsJson = JSON.parse(dataInfo.value.subCardsJson);
-    console.log(dataInfo.value, 'dataInfo.value.subCardsJson');
   }
 });
 const redScenes = [{ img: '/images/方案图1.png' }, { img: '/images/方案图2.png' }, { img: '/images/方案图3.png' }, { img: '/images/方案图4.png' }];

+ 206 - 275
src/views/home/index-dataDiy.vue

@@ -15,7 +15,7 @@
       <!-- 菜单项列表 -->
       <div class="sidebar-menu-list">
         <!-- 首页 (无子菜单) -->
-        <div class="sidebar-item active">
+        <div class="sidebar-item active" @click="onPath('/indexDataDiy')">
           <div class="item-icon-wrapper">
             <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
               <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" stroke-linecap="round" stroke-linejoin="round" />
@@ -26,7 +26,7 @@
         </div>
 
         <!-- 工作台 (无子菜单) -->
-        <div class="sidebar-item">
+        <div class="sidebar-item" @click="onPath('/enterprise/companyInfo')">
           <div class="item-icon-wrapper">
             <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
               <rect x="2" y="3" width="20" height="14" rx="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -37,252 +37,30 @@
           <span class="item-text">{{ isSidebarCollapsed ? '工作台' : '采购工作台' }}</span>
         </div>
 
-        <!-- 采购单管理 -->
-        <div class="sidebar-item has-sub" :class="{ 'sub-open': openMenus.purchase }" @click="toggleMenu('purchase')">
-          <div class="item-icon-wrapper">
-            <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-              <path d="M9 11l3 3L22 4" stroke-linecap="round" stroke-linejoin="round" />
-              <path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" stroke-linecap="round" stroke-linejoin="round" />
-            </svg>
-          </div>
-          <span class="item-text">{{ isSidebarCollapsed ? '采购单' : '采购单管理' }}</span>
-          <svg class="arrow-icon" v-if="!isSidebarCollapsed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-            <polyline points="6 9 12 15 18 9" />
-          </svg>
-
-          <!-- 窄栏折叠悬停二级菜单 (通用 absolute 气泡弹出,完美卡合在对应项右侧) -->
-          <div class="sidebar-hover-pop" v-if="isSidebarCollapsed">
-            <div class="sub-item">
-              我的购物车
-              <span class="cart-badge">1</span>
+        <template v-for="(item1, index1) in menuList" :key="index1">
+          <div v-if="item1.show" class="sidebar-item has-sub" :class="{ 'sub-open': openMenus[item1.title] }" @click="toggleMenu(item1.title)">
+            <div class="item-icon-wrapper">
+              <img :src="item1.icon" alt="" class="s-icon" />
             </div>
-            <div class="sub-item">我的采购单</div>
-            <div class="sub-item">清单选品</div>
-            <div class="sub-item">我的收藏</div>
-          </div>
-        </div>
-        <!-- 二级子菜单 -->
-        <div class="sidebar-sub-menu" v-if="!isSidebarCollapsed" :class="{ 'show': openMenus.purchase }">
-          <div class="sub-item">
-            我的购物车
-            <span class="cart-badge">1</span>
-          </div>
-          <div class="sub-item">我的采购单</div>
-          <div class="sub-item">清单选品</div>
-          <div class="sub-item">我的收藏</div>
-        </div>
-
-        <!-- 非招标采购 -->
-        <div class="sidebar-item has-sub" :class="{ 'sub-open': openMenus.nonTender }" @click="toggleMenu('nonTender')">
-          <div class="item-icon-wrapper">
-            <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-              <rect x="3" y="7" width="18" height="13" rx="2" stroke-linecap="round" stroke-linejoin="round" />
-              <path d="M20 7h-9M14 3L7 21" stroke-linecap="round" />
-            </svg>
-          </div>
-          <span class="item-text">非招标采购</span>
-          <svg class="arrow-icon" v-if="!isSidebarCollapsed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-            <polyline points="6 9 12 15 18 9" />
-          </svg>
-
-          <!-- 折叠悬停二级菜单 -->
-          <div class="sidebar-hover-pop" v-if="isSidebarCollapsed">
-            <div class="sub-item">竞价采购</div>
-          </div>
-        </div>
-        <!-- 二级子菜单 -->
-        <div class="sidebar-sub-menu" v-if="!isSidebarCollapsed" :class="{ 'show': openMenus.nonTender }">
-          <div class="sub-item">竞价采购</div>
-        </div>
-
-        <!-- 订单管理 -->
-        <div class="sidebar-item has-sub" :class="{ 'sub-open': openMenus.order }" @click="toggleMenu('order')">
-          <div class="item-icon-wrapper">
-            <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-              <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" stroke-linecap="round" stroke-linejoin="round" />
-              <polyline points="14 2 14 8 20 8" stroke-linecap="round" stroke-linejoin="round" />
-              <line x1="16" y1="13" x2="8" y2="13" stroke-linecap="round" />
-              <line x1="16" y1="17" x2="8" y2="17" stroke-linecap="round" />
-            </svg>
-          </div>
-          <span class="item-text">{{ isSidebarCollapsed ? '订单' : '订单管理' }}</span>
-          <svg class="arrow-icon" v-if="!isSidebarCollapsed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-            <polyline points="6 9 12 15 18 9" />
-          </svg>
-
-          <!-- 折叠悬停二级菜单 -->
-          <div class="sidebar-hover-pop" v-if="isSidebarCollapsed">
-            <div class="sub-item">我的订单</div>
-            <div class="sub-item">订单打印</div>
-          </div>
-        </div>
-        <!-- 二级子菜单 -->
-        <div class="sidebar-sub-menu" v-if="!isSidebarCollapsed" :class="{ 'show': openMenus.order }">
-          <div class="sub-item">我的订单</div>
-          <div class="sub-item">订单打印</div>
-        </div>
-
-        <!-- 发票管理 -->
-        <div class="sidebar-item has-sub" :class="{ 'sub-open': openMenus.invoice }" @click="toggleMenu('invoice')">
-          <div class="item-icon-wrapper">
-            <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-              <rect x="2" y="4" width="20" height="16" rx="2" stroke-linecap="round" stroke-linejoin="round" />
-              <line x1="12" y1="4" x2="12" y2="20" stroke-linecap="round" />
-              <line x1="2" y1="12" x2="22" y2="12" stroke-linecap="round" />
-            </svg>
-          </div>
-          <span class="item-text">{{ isSidebarCollapsed ? '发票' : '发票管理' }}</span>
-          <svg class="arrow-icon" v-if="!isSidebarCollapsed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-            <polyline points="6 9 12 15 18 9" />
-          </svg>
-
-          <!-- 折叠悬停二级菜单 -->
-          <div class="sidebar-hover-pop" v-if="isSidebarCollapsed">
-            <div class="sub-item">普票抬头管理</div>
-            <div class="sub-item">开具发票</div>
-          </div>
-        </div>
-        <!-- 二级子菜单 -->
-        <div class="sidebar-sub-menu" v-if="!isSidebarCollapsed" :class="{ 'show': openMenus.invoice }">
-          <div class="sub-item">普票抬头管理</div>
-          <div class="sub-item">开具发票</div>
-        </div>
-
-        <!-- 售后管理 -->
-        <div class="sidebar-item has-sub" :class="{ 'sub-open': openMenus.afterSale }" @click="toggleMenu('afterSale')">
-          <div class="item-icon-wrapper">
-            <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-              <path d="M21.5 2v6h-6M21.34 15.57a10 10 0 1 1-.57-8.38l5.67-5.67" stroke-linecap="round" stroke-linejoin="round" />
-            </svg>
-          </div>
-          <span class="item-text">{{ isSidebarCollapsed ? '售后' : '售后管理' }}</span>
-          <svg class="arrow-icon" v-if="!isSidebarCollapsed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-            <polyline points="6 9 12 15 18 9" />
-          </svg>
-
-          <!-- 折叠悬停二级菜单 -->
-          <div class="sidebar-hover-pop" v-if="isSidebarCollapsed">
-            <div class="sub-item">退换货</div>
-            <div class="sub-item">售后记录</div>
-          </div>
-        </div>
-        <!-- 二级子菜单 -->
-        <div class="sidebar-sub-menu" v-if="!isSidebarCollapsed" :class="{ 'show': openMenus.afterSale }">
-          <div class="sub-item">退换货</div>
-          <div class="sub-item">售后记录</div>
-        </div>
-
-        <!-- 财务管理 -->
-        <div class="sidebar-item has-sub" :class="{ 'sub-open': openMenus.finance }" @click="toggleMenu('finance')">
-          <div class="item-icon-wrapper">
-            <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-              <circle cx="12" cy="12" r="10" stroke-linecap="round" stroke-linejoin="round" />
-              <path d="M12 8V16M8 12h8" stroke-linecap="round" stroke-linejoin="round" />
+            <span class="item-text">{{ isSidebarCollapsed ? item1.title.slice(0, 2) : item1.title }}</span>
+            <svg class="arrow-icon" v-if="!isSidebarCollapsed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+              <polyline points="6 9 12 15 18 9" />
             </svg>
-          </div>
-          <span class="item-text">{{ isSidebarCollapsed ? '财务' : '财务管理' }}</span>
-          <svg class="arrow-icon" v-if="!isSidebarCollapsed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-            <polyline points="6 9 12 15 18 9" />
-          </svg>
 
-          <!-- 折叠悬停二级菜单 -->
-          <div class="sidebar-hover-pop" v-if="isSidebarCollapsed">
-            <div class="sub-item">结算中心</div>
-            <div class="sub-item">自助认款</div>
-            <div class="sub-item">合并支付</div>
-            <div class="sub-item">企业结算</div>
-            <div class="sub-item">企业金采</div>
-            <div class="sub-item">金采报销</div>
-            <div class="sub-item">商家结算</div>
-            <div class="sub-item">我的余额</div>
-          </div>
-        </div>
-        <!-- 二级子菜单 -->
-        <div class="sidebar-sub-menu" v-if="!isSidebarCollapsed" :class="{ 'show': openMenus.finance }">
-          <div class="sub-item">结算中心</div>
-          <div class="sub-item">自助认款</div>
-          <div class="sub-item">合并支付</div>
-          <div class="sub-item">企业结算</div>
-          <div class="sub-item">企业金采</div>
-          <div class="sub-item">金采报销</div>
-          <div class="sub-item">商家结算</div>
-          <div class="sub-item">我的余额</div>
-        </div>
-
-        <!-- 数据中心 -->
-        <div class="sidebar-item has-sub" :class="{ 'sub-open': openMenus.dataCenter }" @click="toggleMenu('dataCenter')">
-          <div class="item-icon-wrapper">
-            <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-              <line x1="18" y1="20" x2="18" y2="10" stroke-linecap="round" stroke-linejoin="round" />
-              <line x1="12" y1="20" x2="12" y2="4" stroke-linecap="round" stroke-linejoin="round" />
-              <line x1="6" y1="20" x2="6" y2="14" stroke-linecap="round" stroke-linejoin="round" />
-            </svg>
-          </div>
-          <span class="item-text">{{ isSidebarCollapsed ? '数据' : '数据中心' }}</span>
-          <svg class="arrow-icon" v-if="!isSidebarCollapsed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-            <polyline points="6 9 12 15 18 9" />
-          </svg>
-
-          <!-- 折叠悬停二级菜单 -->
-          <div class="sidebar-hover-pop" v-if="isSidebarCollapsed">
-            <div class="sub-item">下载中心</div>
-            <div class="sub-item">数据报表</div>
-            <div class="sub-item">明细数据报表</div>
-          </div>
-        </div>
-        <!-- 二级子菜单 -->
-        <div class="sidebar-sub-menu" v-if="!isSidebarCollapsed" :class="{ 'show': openMenus.dataCenter }">
-          <div class="sub-item">下载中心</div>
-          <div class="sub-item">数据报表</div>
-          <div class="sub-item">明细数据报表</div>
-        </div>
-
-        <!-- 地址管理 -->
-        <div class="sidebar-item has-sub" :class="{ 'sub-open': openMenus.address }" @click="toggleMenu('address')">
-          <div class="item-icon-wrapper">
-            <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-              <path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" stroke-linecap="round" stroke-linejoin="round" />
-              <circle cx="12" cy="10" r="3" stroke-linecap="round" stroke-linejoin="round" />
-            </svg>
-          </div>
-          <span class="item-text">{{ isSidebarCollapsed ? '地址' : '地址管理' }}</span>
-          <svg class="arrow-icon" v-if="!isSidebarCollapsed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-            <polyline points="6 9 12 15 18 9" />
-          </svg>
-
-          <!-- 折叠悬停二级菜单 -->
-          <div class="sidebar-hover-pop" v-if="isSidebarCollapsed">
-            <div class="sub-item">我的地址</div>
+            <!-- 折叠悬停二级菜单 -->
+            <div class="sidebar-hover-pop" v-if="isSidebarCollapsed">
+              <template v-for="(item2, index2) in item1.children" :key="index2">
+                <div @click.stop="onPath(item2.path)" class="sub-item">{{ item2.title }}</div>
+              </template>
+            </div>
           </div>
-        </div>
-        <!-- 二级子菜单 -->
-        <div class="sidebar-sub-menu" v-if="!isSidebarCollapsed" :class="{ 'show': openMenus.address }">
-          <div class="sub-item">我的地址</div>
-        </div>
-
-        <!-- 账号安全 -->
-        <div class="sidebar-item has-sub" :class="{ 'sub-open': openMenus.security }" @click="toggleMenu('security')">
-          <div class="item-icon-wrapper">
-            <svg class="s-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-              <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" stroke-linecap="round" stroke-linejoin="round" />
-            </svg>
+          <!-- 二级子菜单 -->
+          <div class="sidebar-sub-menu" v-if="!isSidebarCollapsed" :class="{ 'show': openMenus[item1.title] }">
+            <template v-for="(item2, index2) in item1.children" :key="index2">
+              <div @click.stop="onPath(item2.path)" class="sub-item">{{ item2.title }}</div>
+            </template>
           </div>
-          <span class="item-text">{{ isSidebarCollapsed ? '安全' : '账号安全' }}</span>
-          <svg class="arrow-icon" v-if="!isSidebarCollapsed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-            <polyline points="6 9 12 15 18 9" />
-          </svg>
-
-          <!-- 折叠悬停二级菜单 -->
-          <div class="sidebar-hover-pop" v-if="isSidebarCollapsed">
-            <div class="sub-item">账号设置</div>
-            <div class="sub-item">绑定员工</div>
-          </div>
-        </div>
-        <!-- 二级子菜单 -->
-        <div class="sidebar-sub-menu" v-if="!isSidebarCollapsed" :class="{ 'show': openMenus.security }">
-          <div class="sub-item">账号设置</div>
-          <div class="sub-item">绑定员工</div>
-        </div>
+        </template>
       </div>
     </div>
 
@@ -291,7 +69,7 @@
       <!-- 采购单 (悬停时呈现为纯大红背景 58x58,图2完美复刻) -->
       <div class="toolbar-item selection-item">
         <!-- 购物车微型数字红圈角标 -->
-        <div class="cart-badge">5</div>
+        <div class="cart-badge">{{ cartCount }}</div>
         <div class="toolbar-icon-wrapper">
           <svg class="t-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
             <circle cx="9" cy="21" r="1" />
@@ -302,16 +80,6 @@
         <span class="toolbar-text">采购单</span>
       </div>
 
-      <!-- 企业消息 (悬停时呈现为纯大红背景 58x58,图3完美复刻) -->
-      <div class="toolbar-item msg-item">
-        <div class="toolbar-icon-wrapper">
-          <svg class="t-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-            <path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9M13.73 21a2 2 0 0 1-3.46 0" stroke-linecap="round" stroke-linejoin="round" />
-          </svg>
-        </div>
-        <span class="toolbar-text">消息</span>
-      </div>
-
       <!-- 我的客服 (悬停时呈现为纯大红背景 58x58,并向左滑出精致气泡面板,图4完美复刻) -->
       <div class="toolbar-item service-item">
         <div class="toolbar-icon-wrapper">
@@ -399,18 +167,18 @@
           <div class="purchase-classroom">
             <div class="classroom-header">
               <span class="classroom-title">采购课堂</span>
-              <span class="classroom-more">查看全部</span>
+              <span class="classroom-more"></span>
             </div>
-            <div class="classroom-content">
+            <div class="classroom-content" @click="onPath('/solve/real?id=' + announcement.id)">
               <div class="classroom-time">
-                <span class="c-year">2026年</span>
-                <span class="c-week">第 21 周</span>
+                <span class="c-year">{{ announcement.yearAndWeek?.yearField }}</span>
+                <span class="c-week">{{ announcement.yearAndWeek?.weekField }}</span>
               </div>
               <div class="classroom-info">
-                <p class="c-desc">防洪防汛特辑 | 工厂园区篇</p>
+                <p class="c-desc">{{ announcement.announcementTitle }}</p>
               </div>
               <div class="classroom-cover">
-                <img src="@/assets/data/classroom_cover.png" alt="课程封面" />
+                <img :src="announcement.coverImage" alt="课程封面" />
               </div>
             </div>
           </div>
@@ -436,6 +204,154 @@ import { headerCategoryList } from '@/api/home/index-data';
 import { getInfo } from '@/api/login';
 import { computed } from 'vue';
 import { onPath } from '@/utils/siteConfig';
+import workbench1 from '@/assets/images/layout/workbench1.png';
+import workbench2 from '@/assets/images/layout/workbench2.png';
+import workbench3 from '@/assets/images/layout/workbench3.png';
+import workbench4 from '@/assets/images/layout/workbench4.png';
+import workbench5 from '@/assets/images/layout/workbench5.png';
+import workbench6 from '@/assets/images/layout/workbench6.png';
+import workbench7 from '@/assets/images/layout/workbench7.png';
+import { cartStore } from '@/store/modules/cart';
+import { getWorkbenchMenuList } from '@/api/pc/system/index';
+import { getAnnouncementList } from '@/api/pc/system/announcement';
+const announcement = ref<any>({});
+const cartStoreData = cartStore();
+const cartCount = computed(() => cartStoreData.cartCount);
+const menuList = ref<any>([
+  {
+    path: '/enterprise',
+    title: '企业账户',
+    icon: workbench1,
+    show: false,
+    children: [
+      { path: '/enterprise/companyInfo', title: '企业信息' },
+      { path: '/enterprise/messageNotice', title: '消息通知' }, // 接口没返这个,应该被过滤
+      { path: '/easybuv', title: '地址管理' },
+      { path: '/enterprise/invoiceManage', title: '发票抬头管理' },
+      { path: '/enterprise/purchasePlan', title: '专属采购方案' },
+      { path: '/enterprise/agreementSupply', title: '协议供货' },
+      { path: '/enterprise/myCollection', title: '我的收藏' },
+      { path: '/enterprise/purchaseHistory', title: '历史购买' },
+      { path: '/enterprise/myFootprint', title: '我的足迹' }
+    ]
+  },
+  {
+    path: '/order',
+    title: '交易管理',
+    icon: workbench2,
+    show: false,
+    children: [
+      { path: '/order/orderManage', title: '订单管理' },
+      { path: '/order/orderAudit', title: '审核订单' },
+      { path: '/order/afterSale', title: '售后服务' },
+      { path: '/order/batchOrder', title: '批量下单' },
+      { path: '/order/orderEvaluation', title: '订单评价' }
+    ]
+  },
+  {
+    path: '/organization',
+    title: '组织管理',
+    icon: workbench3,
+    show: false,
+    children: [
+      { path: '/i', title: '个人信息' },
+      { path: '/organization/deptManage', title: '部门管理' },
+      { path: '/organization/staffManage', title: '人员管理' },
+      { path: '/organization/roleManage', title: '角色管理' },
+      { path: '/organization/approvalFlow', title: '审批流程' },
+      { path: '/organization/groupEnterprise', title: '集团关联企业' }
+    ]
+  },
+  {
+    path: '/cost',
+    title: '成本管理',
+    icon: workbench4,
+    show: false,
+    children: [
+      { path: '/cost/itemExpense', title: '分项费用' },
+      { path: '/cost/quotaControl', title: '额度控制' }
+    ]
+  },
+  {
+    path: '/reconciliation',
+    title: '对账管理',
+    icon: workbench5,
+    show: false,
+    children: [
+      { path: '/reconciliation/billManage', title: '对账单管理' },
+      { path: '/reconciliation/invoiceManage', title: '开票管理' }
+    ]
+  },
+  {
+    path: '/valueAdded',
+    title: '增值服务',
+    icon: workbench6,
+    show: false,
+    children: [
+      { path: '/valueAdded/maintenance', title: '维保服务' },
+      { path: '/valueAdded/complaint', title: '投诉与建议' }
+    ]
+  },
+  {
+    path: '/analysis',
+    title: '采购分析',
+    icon: workbench7,
+    show: false,
+    children: [
+      { path: '/analysis/orderAnalysis', title: '订单交易分析' },
+      { path: '/analysis/purchaseDetail', title: '商品采购明细' },
+      { path: '/analysis/orderStatus', title: '订单执行状态' },
+      { path: '/analysis/settlementStatus', title: '对账结算状况' },
+      { path: '/analysis/deptPurchase', title: '部门采购金额' }
+    ]
+  }
+]);
+
+getWorkbenchMenuList().then((res: any) => {
+  const apiData = res.data || res;
+  if (Array.isArray(apiData)) {
+    processMenuPermissions(apiData);
+  }
+});
+
+const allowedPaths = ref<Set<string>>(new Set());
+const processMenuPermissions = (apiMenuList: any[]) => {
+  // 1. 收集接口返回的所有合法 path
+  const paths = new Set<string>();
+  const traverse = (items: any[]) => {
+    items.forEach((item) => {
+      // 统一格式:确保以 / 开头
+      const p = item.path.startsWith('/') ? item.path : `/${item.path}`;
+      paths.add(p);
+      if (item.children && item.children.length > 0) {
+        traverse(item.children);
+      }
+    });
+  };
+  traverse(apiMenuList);
+  allowedPaths.value = paths;
+
+  // 2. 更新本地 menuList:过滤子菜单并设置父级显示状态
+  menuList.value.forEach((menu) => {
+    if (!menu.children) {
+      menu.show = false;
+      return;
+    }
+
+    // 【核心修改】过滤出有权限的子菜单
+    const permittedChildren = menu.children.filter((child) => {
+      const childPath = child.path.startsWith('/') ? child.path : `/${child.path}`;
+      return paths.has(childPath);
+    });
+
+    // 将过滤后的子菜单重新赋值给 menu.children
+    // 这样模板里 v-for 循环时就只有有权限的子项了
+    menu.children = permittedChildren;
+
+    // 如果过滤后还有子菜单,则显示父级;否则隐藏父级
+    menu.show = permittedChildren.length > 0;
+  });
+};
 
 const userInfo = ref<any>({});
 getInfo().then((res) => {
@@ -444,6 +360,35 @@ getInfo().then((res) => {
   }
 });
 
+getAnnouncementList({ pageNum: 1, pageSize: 1, isShow: 1 }).then((res) => {
+  if (res.code == 200) {
+    if (res.rows.length > 0) {
+      announcement.value = res.rows[0];
+      announcement.value.yearAndWeek = getYearAndWeek(announcement.value.createTime);
+    }
+  }
+});
+
+function getYearAndWeek(dateStr) {
+  const date = new Date(dateStr.replace(/-/g, '/')); // 兼容 Safari 等浏览器
+  const year = date.getFullYear();
+
+  // 获取当年的 1月1日
+  const firstDayOfYear = new Date(year, 0, 1);
+
+  // 计算两个日期相差的毫秒数,转换为天数
+  const diffTime = date.getTime() - firstDayOfYear.getTime();
+  const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
+
+  // 1月1日为第一周,所以天数差除以7向上取整
+  const weekNumber = Math.ceil((diffDays + 1) / 7);
+
+  return {
+    yearField: `${year}年`,
+    weekField: `第${weekNumber}周`
+  };
+}
+
 const navItems = ref<any>([]);
 headerCategoryList({}).then((res) => {
   if (res.code == 200) {
@@ -455,17 +400,7 @@ headerCategoryList({}).then((res) => {
 const isSidebarCollapsed = ref(true);
 
 // 一二级子菜单的高保真展开折叠状态管理 (默认展开图2、图3中所有可展开的项,且地址、账号默认关闭符合图2初始态)
-const openMenus = ref({
-  purchase: true, // 采购单管理,默认展开
-  nonTender: false, // 非招标采购,默认闭合 (图2为闭合,小箭头向下)
-  order: true, // 订单管理,默认展开
-  invoice: true, // 发票管理,默认展开
-  afterSale: true, // 售后管理,默认展开
-  finance: true, // 财务管理,默认展开
-  dataCenter: true, // 数据中心,默认展开
-  address: false, // 地址管理,图2为闭合,图3为展开
-  security: false // 账号安全,图2为闭合,图3为展开
-});
+const openMenus = ref<any>({});
 
 // 通用子菜单展开/闭合切换处理器,带窄栏时自动展宽逻辑
 const toggleMenu = (key) => {
@@ -477,10 +412,6 @@ const toggleMenu = (key) => {
   }
 };
 
-// 完美向后兼容原先对采购单管理展开状态的引用
-const isPurchaseMenuOpen = computed(() => openMenus.value.purchase);
-const handlePurchaseClick = () => toggleMenu('purchase');
-
 const scrollToTop = () => {
   window.scrollTo({ top: 0, behavior: 'smooth' });
 };

+ 31 - 0
src/views/home/index-dataDiyold.vue

@@ -0,0 +1,31 @@
+<template>
+  <div class="w100%">
+    <diyIndex v-if="dataInfo && dataInfo.isHome" :dataInfo="dataInfo"></diyIndex>
+    <template v-else>
+      <div class="h-[30px]"></div>
+      <el-empty description="您的专属页面还未设计,请联系管理员~" />
+    </template>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { getBigCustomerPlatformIndexDiyPcPage } from '@/api/home/diy';
+import diyIndex from '@/views/home/pccomponents/index.vue';
+import { stationStore } from '@/store/modules/station';
+const dataInfo = ref<any>(null);
+const station = stationStore();
+onMounted(() => {
+  loadComponents();
+});
+
+// 加载组件
+const loadComponents = async () => {
+  getBigCustomerPlatformIndexDiyPcPage({ siteId: station.stationData.id }).then((res) => {
+    if (res.code == 200) {
+      dataInfo.value = res.data;
+    }
+  });
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 184 - 0
src/views/home/index-enterpriseold.vue

@@ -0,0 +1,184 @@
+<template>
+  <div class="home-pages">
+    <!--  头部 -->
+    <comHead v-if="headData.show" :row="headData" :datas="realList"></comHead>
+    <!-- 导航 -->
+    <div class="nav-bos">
+      <div v-for="(item, index) in navList" :key="index" class="nav-list" @click="onPath(item.url)">
+        <img class="nav-image" :src="item.img" alt="" />
+        <div class="flex-row-between">
+          <div>
+            <div class="name1">{{ item.name1 }}</div>
+            <div class="name2">{{ item.name2 }}</div>
+          </div>
+          <div class="nav-more flex-row-center">
+            <el-icon><ArrowRight /></el-icon>
+          </div>
+        </div>
+      </div>
+    </div>
+    <!-- 猜你喜欢 -->
+    <indexMorTitle :datas="{ title1: '猜你喜欢' }"></indexMorTitle>
+    <comGoods :row="{ styleType: 1, goodsShow: [1, 2, 3], goodsTitleType: 3 }" :datas="recommendList"></comGoods>
+  </div>
+</template>
+
+<script setup lang="ts">
+import indexMorTitle from '@/views/home/pccomponents/pages/indexMorTitle.vue';
+import comHead from '@/views/home/pccomponents/pages/headData.vue';
+import comGoods from '@/views/home/pccomponents/pages/goods.vue';
+import { onPath } from '@/utils/siteConfig';
+import { getSearchTitle, getHomeNav } from '@/api/home/index';
+import {
+  getEnterpriseRightsMemberEquityList,
+  getEnterpriseHomeAdList,
+  getCustomerProductPage,
+  customerMessageList
+} from '@/api/home/index-enterprise';
+import enterprise1 from '@/assets/images/home/enterprise1.png';
+import enterprise2 from '@/assets/images/home/enterprise2.png';
+import enterprise3 from '@/assets/images/home/enterprise3.png';
+import enterprise4 from '@/assets/images/home/enterprise4.png';
+
+const headData = ref<any>({});
+const realList = ref<any>([]);
+const recommendList = ref<any>([]);
+//导航
+const navList = ref<any>([
+  { name1: '采购日历', name2: '提前制定和管理月度采购计划', url: '/enterprise/purchaseHistory', img: enterprise1 },
+  { name1: '自助开票', name2: '灵活自助开票 换开管票服务', url: '/enterprise/invoiceManage', img: enterprise2 },
+  { name1: '下载中心', name2: '批量订单打印', url: '/order/orderManage', img: enterprise3 },
+  { name1: '批量下单', name2: '智能识别多商品多地址一键下单', url: '/cart', img: enterprise4 }
+]);
+
+onMounted(() => {
+  document.documentElement.style.setProperty('--hover-color', '#E7000B');
+  getHead();
+});
+
+//头部
+const getHead = async () => {
+  headData.value.topStyle = 1;
+  headData.value.toplabel = [];
+  headData.value.classifyShow = true;
+  headData.value.headType = 3;
+  headData.value.leftStyle = 1;
+  headData.value.carouselList = [];
+  headData.value.advertList = [];
+  headData.value.realDataType = 1;
+  headData.value.realNumber = 6;
+  headData.value.navlList = [];
+  try {
+    const datas1 = await getSearchTitle(5);
+    if (datas1.code == 200) {
+      datas1.data.forEach((item: any) => {
+        headData.value.toplabel.push({
+          title: item.navigationName
+        });
+      });
+    }
+
+    const datas2 = await getHomeNav(5);
+    headData.value.topNav = [];
+    datas2.data.forEach((item: any) => {
+      headData.value.topNav.push({
+        title: item.navigationName,
+        url: item.url ? item.url : ''
+      });
+    });
+
+    const datas3 = await getEnterpriseHomeAdList({});
+    if (datas3.code == 200) {
+      datas3.data.forEach((item: any) => {
+        headData.value.carouselList.push({
+          imageUrl: item.imageUrl
+        });
+      });
+    }
+
+    const datas5 = await customerMessageList({ status: '0', pageSize: 20 });
+    if (datas5.code == 200) realList.value = datas5.rows;
+
+    const datas6 = await getEnterpriseRightsMemberEquityList({});
+    if (datas6.code == 200) {
+      datas6.data.forEach((item: any) => {
+        headData.value.navlList.push({
+          imageUrl: item.imageUrl,
+          title: item.title,
+          url: item.link ? item.link : ''
+        });
+      });
+    }
+
+    headData.value.show = true;
+  } catch (error) {}
+};
+
+//猜你喜欢
+getCustomerProductPage({}).then((res) => {
+  if (res.code == 200) {
+    recommendList.value = res.rows;
+  }
+});
+</script>
+
+<style lang="scss" scoped>
+.home-pages {
+  width: 100%;
+  padding-bottom: 30px;
+
+  :deep(.hover-color) {
+    cursor: pointer;
+
+    &:hover {
+      color: var(--hover-color) !important;
+
+      .zi-hover {
+        color: var(--hover-color) !important;
+      }
+    }
+  }
+  // 导航
+  .nav-bos {
+    margin: 0 auto;
+    width: 100%;
+    max-width: 1500px;
+    min-width: 1200px;
+    display: flex;
+    gap: 0 10px;
+    .nav-list {
+      margin-top: 15px;
+      flex: 0 0 calc((100% - 30px) / 4);
+      height: 150px;
+      background: #ffffff;
+      border-radius: 5px;
+      padding: 20px;
+      display: flex;
+      flex-direction: column;
+      justify-content: space-between;
+      cursor: pointer;
+      .nav-image {
+        width: 50px;
+        height: 50px;
+        background: #ffeeea;
+        border-radius: 6px 6px 6px 6px;
+      }
+      .name1 {
+        font-size: 15px;
+        margin-bottom: 5px;
+        color: #101828;
+      }
+      .name2 {
+        font-size: 13px;
+        color: #6a7282;
+      }
+      .nav-more {
+        width: 20px;
+        height: 20px;
+        border-radius: 20px;
+        border: 1px solid #3d3e3f;
+      }
+    }
+  }
+}
+</style>

+ 96 - 43
src/views/search/index.vue

@@ -164,11 +164,17 @@ import { getPcProductPage, getBrandPage, getBrandByCategoryList, getBrandDetail
 import { getProductCategoryTree } from '@/api/home/index';
 import { onPath } from '@/utils/siteConfig';
 import Pagination from '@/components/Pagination/index.vue';
+import { useUserStore } from '@/store/modules/user';
+import { stationStore } from '@/store/modules/station';
+import { categoryMainList } from '@/api/home/index-data';
+const station = stationStore();
+const userStore = useUserStore();
 const route = useRoute();
 const type = ref<any>(1);
 const dataList = ref<any>([]);
 const checkList = ref<any>([]);
 const classifyList = ref<any>([]);
+const classifyData = ref<any>([]);
 const brandList = ref<any>([]);
 const categoryName = ref<any>('');
 const hasMore = ref(true); // 是否还有更多数据
@@ -224,60 +230,107 @@ const getList = () => {
   });
 };
 
+const headerType = computed(() => {
+  if (station.stationData && Object.keys(station.stationData).length > 0) {
+    const data = station.stationData.data || station.stationData;
+    const isDiy = data?.isDiy;
+
+    if (isDiy === 0 || isDiy === '0') {
+      return 'dataHeader';
+    } else if (isDiy !== undefined && isDiy !== null) {
+      return 'dataHeader';
+    }
+  }
+  // 2. 判断是否显示 jdHeader(userSonType 为 '3' 且允许 /indexEnterprise)
+  if (userStore.userInfo?.user?.userSonType == '3') {
+    return 'jdHeader';
+  }
+
+  // 3. 其他情况显示普通 Header
+  return 'default';
+});
 // 获取分类
 const getClassify = () => {
-  getProductCategoryTree({}).then((res) => {
-    if (res.code == 200) {
-      if (type.value == 2 && httpObj.value.mediumCategoryId) {
-        res.data.forEach((item1: any) => {
-          if (item1.children && item1.children.length > 0) {
-            item1.children.unshift({
+  if (headerType.value == 'jdHeader') {
+  } else if (headerType.value == 'dataHeader') {
+    categoryMainList({ status: 1 }).then((res) => {
+      if (res.code == 200) {
+        res.rows.forEach((item1: any) => {
+          item1.label = item1.name;
+          item1.id = item1.syncCategoryId;
+          item1.subMenus.forEach((item2: any) => {
+            item2.label = item2.name;
+            item2.id = item2.syncCategoryId;
+            item2.children.forEach((item3: any) => {
+              item3.label = item3.name;
+              item3.id = item3.syncCategoryId;
+            });
+          });
+          item1.children = item1.subMenus;
+        });
+        classifyData.value = res.rows;
+        onClassify();
+      }
+    });
+  } else {
+    getProductCategoryTree({}).then((res) => {
+      if (res.code == 200) {
+        classifyData.value = res.data;
+        onClassify();
+      }
+    });
+  }
+};
+
+const onClassify = () => {
+  if (type.value == 2 && httpObj.value.mediumCategoryId) {
+    classifyData.value.forEach((item1: any) => {
+      if (item1.children && item1.children.length > 0) {
+        item1.children.unshift({
+          label: '全部',
+          id: ''
+        });
+        item1.children.forEach((item2: any) => {
+          if (item2.id == httpObj.value.mediumCategoryId) {
+            httpObj.value.topCategoryId = item1.id;
+            classifyList.value = item1.children;
+          }
+        });
+      }
+    });
+    getList();
+    //获取当前分类下得品牌
+    getBrand2();
+  } else if (type.value == 3 && httpObj.value.bottomCategoryId) {
+    classifyData.value.forEach((item1: any) => {
+      if (item1.children && item1.children.length > 0) {
+        item1.children.forEach((item2: any) => {
+          if (item2.children && item2.children.length > 0) {
+            item2.children.unshift({
               label: '全部',
               id: ''
             });
-            item1.children.forEach((item2: any) => {
-              if (item2.id == httpObj.value.mediumCategoryId) {
+            item2.children.forEach((item3: any) => {
+              if (item3.id == httpObj.value.bottomCategoryId) {
                 httpObj.value.topCategoryId = item1.id;
-                classifyList.value = item1.children;
-              }
-            });
-          }
-        });
-        getList();
-        //获取当前分类下得品牌
-        getBrand2();
-      } else if (type.value == 3 && httpObj.value.bottomCategoryId) {
-        res.data.forEach((item1: any) => {
-          if (item1.children && item1.children.length > 0) {
-            item1.children.forEach((item2: any) => {
-              if (item2.children && item2.children.length > 0) {
-                item2.children.unshift({
-                  label: '全部',
-                  id: ''
-                });
-                item2.children.forEach((item3: any) => {
-                  if (item3.id == httpObj.value.bottomCategoryId) {
-                    httpObj.value.topCategoryId = item1.id;
-                    httpObj.value.mediumCategoryId = item2.id;
-                    classifyList.value = item2.children;
-                  }
-                });
+                httpObj.value.mediumCategoryId = item2.id;
+                classifyList.value = item2.children;
               }
             });
           }
         });
-        getList();
-        //获取当前分类下得品牌
-        getBrand2();
-      } else {
-        res.data.unshift({
-          label: '全部',
-          id: ''
-        });
-        classifyList.value = res.data;
       }
-    }
-  });
+    });
+    getList();
+    //获取当前分类下得品牌
+    getBrand2();
+  } else {
+    classifyData.value.unshift({
+      label: '全部',
+      id: ''
+    });
+    classifyList.value = classifyData.value;
+  }
 };
 
 const onHead = (item: any, type: string) => {