weixin_52219567 il y a 21 heures
Parent
commit
8f43effdf7
1 fichiers modifiés avec 21 ajouts et 33 suppressions
  1. 21 33
      src/views/home/datacomponents/JDHeader.vue

+ 21 - 33
src/views/home/datacomponents/JDHeader.vue

@@ -56,39 +56,20 @@
           <div @click="onPath('/enterprise/companyInfo')" class="nav-item">工作台</div>
           <span class="spacer"></span>
 
-          <!-- 采购合作 ∨ (紧凑美观重构) -->
-          <div class="nav-item has-dropdown">
-            <span>采购合作</span>
-            <svg class="arrow" width="8" height="8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
-              <polyline points="6 9 12 15 18 9" />
-            </svg>
-            <!-- 采购合作下拉面板 -->
-            <div class="dropdown-menu partner-menu">
-              <div class="menu-sub-item">企业入驻</div>
-              <div class="menu-sub-item">合作咨询</div>
-              <div class="menu-sub-item">服务指南</div>
-            </div>
-          </div>
-          <span class="spacer"></span>
-
-          <!-- 优易内购(键礼) -->
-          <div class="nav-item">优易内购(键礼)</div>
-          <span class="spacer"></span>
-
-          <!-- 客户服务 ∨ (紧凑美观重构) -->
-          <div class="nav-item has-dropdown">
-            <span>客户服务</span>
-            <svg class="arrow" width="8" height="8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
-              <polyline points="6 9 12 15 18 9" />
-            </svg>
-            <!-- 客户服务下拉面板 -->
-            <div class="dropdown-menu service-menu">
-              <div class="menu-sub-item">帮助中心</div>
-              <div class="menu-sub-item">售后服务</div>
-              <div class="menu-sub-item">在线客服</div>
+          <template v-for="(item, index) in topMenuData" :key="index">
+            <div class="nav-item has-dropdown">
+              <span @click="onPath(item.link)">{{ item.name }}</span>
+              <template v-if="item.children && item.children.length > 0">
+                <svg class="arrow" width="8" height="8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
+                  <polyline points="6 9 12 15 18 9" />
+                </svg>
+                <div class="dropdown-menu partner-menu">
+                  <div @click="onPath(item1.link)" v-for="(item1, index1) in item.children" :key="index1" class="menu-sub-item">{{ item1.name }}</div>
+                </div>
+              </template>
             </div>
-          </div>
-          <span class="spacer"></span>
+            <span class="spacer"></span>
+          </template>
 
           <!-- 手机慧采 ∨ (最右侧,图3大型高端卡片化布局) -->
           <div class="nav-item has-dropdown mobile-dropdown last-item">
@@ -222,13 +203,14 @@ import { onPath } from '@/utils/siteConfig';
 import { useUserStore } from '@/store/modules/user';
 import { getPlatformConfigList } from '@/api/breg/index';
 import { cartStore } from '@/store/modules/cart';
-import { currentSearchConfig } from '@/api/home/index-data';
+import { currentSearchConfig, topMenuList } from '@/api/home/index-data';
 
 interface Props {
   userInfo?: any;
 }
 const props = defineProps<Props>();
 
+const topMenuData = ref<any>({});
 const dataInfo = ref<any>({});
 const wechatLink = ref<any>('');
 const weiboLink = ref<any>('');
@@ -248,6 +230,12 @@ currentSearchConfig({}).then((res) => {
   }
 });
 
+topMenuList({}).then((res) => {
+  if (res.code == 200) {
+    topMenuData.value = res.rows;
+  }
+});
+
 getPlatformConfigList({ configKey: 'wechatLink' }).then((res) => {
   if (res.code == 200) {
     if (res.rows && res.rows.length > 0) {