|
|
@@ -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
|