hurx 1 deň pred
rodič
commit
a03afc72ae

BIN
public/猜你喜欢.png


+ 4 - 0
src/layout/components/workbench.vue

@@ -6,6 +6,10 @@
         <img src="@/assets/images/layout/workbench.png" alt="" />
         <div>收起菜单</div>
       </div>
+      <div class="workbench-expand1 flex-row-start" @click="onPath('/indexDataDiy')">
+        <img src="@/assets/images/layout/workbench.png" alt="" />
+        <div>首页</div>
+      </div>
       <!-- 修改点1: 增加 v-if="item1.show" 过滤无权限菜单 -->
       <template v-for="(item1, index1) in menuList" :key="index1">
         <div class="menu-list1" v-if="item1.show" @click="toggleMenu(item1.path)">

+ 17 - 1
src/views/home/datacomponents/JDHeader.vue

@@ -11,7 +11,7 @@
                 d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"
               ></path>
             </svg>
-            <span>武汉</span>
+            <span>{{ locationText }}</span>
           </div>
 
           <!-- 登录者公司下拉 (图2高奢重构) -->
@@ -204,12 +204,28 @@ import { useUserStore } from '@/store/modules/user';
 import { getPlatformConfigList } from '@/api/breg/index';
 import { cartStore } from '@/store/modules/cart';
 import { currentSearchConfig, topMenuList } from '@/api/home/index-data';
+import { regionData } from 'element-china-area-data';
 
 interface Props {
   userInfo?: any;
 }
 const props = defineProps<Props>();
 
+const locationText = computed(() => {
+  const cityCode = props.userInfo?.regCityNo;
+  if (!cityCode) return '武汉';
+
+  for (const province of regionData) {
+    if (province.children) {
+      const city = province.children.find((item: any) => item.value === cityCode);
+      if (city) {
+        return city.label === '市辖区' ? province.label : city.label;
+      }
+    }
+  }
+  return '武汉市';
+});
+
 const route = useRoute();
 
 // 根据路由路径返回不同的 class