|
@@ -58,6 +58,7 @@ import { getHomeNav } from '@/api/home/index';
|
|
|
import { useUserStore } from '@/store/modules/user';
|
|
import { useUserStore } from '@/store/modules/user';
|
|
|
import { stationStore } from '@/store/modules/station';
|
|
import { stationStore } from '@/store/modules/station';
|
|
|
import { categoryMainList, headerCategoryList } from '@/api/home/index-data';
|
|
import { categoryMainList, headerCategoryList } from '@/api/home/index-data';
|
|
|
|
|
+import { jdcategoryMainList, jdheaderCategoryList } from '@/api/home/index-enterprise';
|
|
|
const station = stationStore();
|
|
const station = stationStore();
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
const categoryStoreStore = categoryStore();
|
|
const categoryStoreStore = categoryStore();
|
|
@@ -112,20 +113,38 @@ const headerType = computed(() => {
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
initData();
|
|
initData();
|
|
|
-
|
|
|
|
|
- // 获取导航栏
|
|
|
|
|
- // getHomeNav(1).then((res) => {
|
|
|
|
|
- // if (res.code == 200) {
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const initData = () => {
|
|
|
|
|
|
|
+const initData = async () => {
|
|
|
if (headerType.value == 'jdHeader') {
|
|
if (headerType.value == 'jdHeader') {
|
|
|
|
|
+ jdheaderCategoryList({ status: 1 }).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ document.documentElement.style.setProperty('--hover-nav2', res.rows.length > 0 ? res.rows[0].headerThemeColor || '#E7000B' : '#E7000B');
|
|
|
|
|
+ res.rows.forEach((item: any) => {
|
|
|
|
|
+ item.url = item.link;
|
|
|
|
|
+ });
|
|
|
|
|
+ navList.value = res.rows;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ try {
|
|
|
|
|
+ const datas1 = await getProductCategoryTree({});
|
|
|
|
|
+ const datas2 = await jdcategoryMainList({ status: 1 });
|
|
|
|
|
+ document.documentElement.style.setProperty('--hover-nav1', datas2.rows.length > 0 ? datas2.rows[0].categoryThemeColor || '#E7000B' : '#E7000B');
|
|
|
|
|
+ datas1.data.forEach((item1: any) => {
|
|
|
|
|
+ datas2.rows.forEach((item2: any) => {
|
|
|
|
|
+ item2.label = item2.name;
|
|
|
|
|
+ item2.id = item2.syncCategoryId;
|
|
|
|
|
+ if (item2.syncCategoryId == item1.id) {
|
|
|
|
|
+ item2.children = item1.children ? item1.children : [];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ classifyList.value = datas2.rows;
|
|
|
|
|
+ } catch (error) {}
|
|
|
} else if (headerType.value == 'dataHeader') {
|
|
} else if (headerType.value == 'dataHeader') {
|
|
|
categoryMainList({ status: 1 }).then((res) => {
|
|
categoryMainList({ status: 1 }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
- document.documentElement.style.setProperty('--hover-data2', res.rows.length > 0 ? res.rows[0].categoryThemeColor || '#E7000B' : '#E7000B');
|
|
|
|
|
|
|
+ document.documentElement.style.setProperty('--hover-nav1', res.rows.length > 0 ? res.rows[0].categoryThemeColor || '#E7000B' : '#E7000B');
|
|
|
res.rows.forEach((item1: any) => {
|
|
res.rows.forEach((item1: any) => {
|
|
|
item1.label = item1.name;
|
|
item1.label = item1.name;
|
|
|
item1.id = item1.syncCategoryId;
|
|
item1.id = item1.syncCategoryId;
|
|
@@ -144,7 +163,7 @@ const initData = () => {
|
|
|
});
|
|
});
|
|
|
headerCategoryList({}).then((res) => {
|
|
headerCategoryList({}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
- document.documentElement.style.setProperty('--hover-data3', res.rows.length > 0 ? res.rows[0].headerThemeColor || '#E7000B' : '#E7000B');
|
|
|
|
|
|
|
+ document.documentElement.style.setProperty('--hover-nav2', res.rows.length > 0 ? res.rows[0].headerThemeColor || '#E7000B' : '#E7000B');
|
|
|
res.rows.forEach((item: any) => {
|
|
res.rows.forEach((item: any) => {
|
|
|
item.url = item.linkUrl;
|
|
item.url = item.linkUrl;
|
|
|
});
|
|
});
|
|
@@ -152,11 +171,21 @@ const initData = () => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ document.documentElement.style.setProperty('--hover-nav1', '#E7000B');
|
|
|
|
|
+ document.documentElement.style.setProperty('--hover-nav2', '#E7000B');
|
|
|
getProductCategoryTree({ platform: 0 }).then((res) => {
|
|
getProductCategoryTree({ platform: 0 }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
classifyList.value = res.data;
|
|
classifyList.value = res.data;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ getHomeNav(1).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ res.data.forEach((item: any) => {
|
|
|
|
|
+ item.title = item.navigationName;
|
|
|
|
|
+ });
|
|
|
|
|
+ navList.value = res.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -185,7 +214,7 @@ const leaveClassify = () => {
|
|
|
.nav-pages {
|
|
.nav-pages {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
background-color: #ffffff;
|
|
background-color: #ffffff;
|
|
|
- border-bottom: 2px solid var(--hover-data2);
|
|
|
|
|
|
|
+ border-bottom: 2px solid var(--hover-nav1);
|
|
|
|
|
|
|
|
.nav-bos {
|
|
.nav-bos {
|
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|
|
@@ -200,7 +229,7 @@ const leaveClassify = () => {
|
|
|
.nav-all {
|
|
.nav-all {
|
|
|
width: 234px;
|
|
width: 234px;
|
|
|
height: 40px;
|
|
height: 40px;
|
|
|
- background: var(--hover-data2);
|
|
|
|
|
|
|
+ background: var(--hover-nav1);
|
|
|
padding: 0 10px;
|
|
padding: 0 10px;
|
|
|
font-size: 15px;
|
|
font-size: 15px;
|
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
@@ -224,7 +253,7 @@ const leaveClassify = () => {
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&.hig {
|
|
&.hig {
|
|
|
- color: var(--hover-data3);
|
|
|
|
|
|
|
+ color: var(--hover-nav2);
|
|
|
position: relative;
|
|
position: relative;
|
|
|
|
|
|
|
|
&::before {
|
|
&::before {
|
|
@@ -235,13 +264,13 @@ const leaveClassify = () => {
|
|
|
display: inline-block;
|
|
display: inline-block;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 3px;
|
|
height: 3px;
|
|
|
- background: var(--hover-data3);
|
|
|
|
|
|
|
+ background: var(--hover-nav2);
|
|
|
margin-right: 8px;
|
|
margin-right: 8px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
&:hover {
|
|
|
- color: var(--hover-data3);
|
|
|
|
|
|
|
+ color: var(--hover-nav2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -254,6 +283,7 @@ const leaveClassify = () => {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
.classify {
|
|
.classify {
|
|
|
width: 234px;
|
|
width: 234px;
|
|
|
|
|
+ min-height: 540px;
|
|
|
background: #ffffff;
|
|
background: #ffffff;
|
|
|
padding: 10px 0px;
|
|
padding: 10px 0px;
|
|
|
border-radius: 5px 0px 0px 5px;
|
|
border-radius: 5px 0px 0px 5px;
|
|
@@ -268,8 +298,8 @@ const leaveClassify = () => {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
|
|
|
|
|
&.classify-hig {
|
|
&.classify-hig {
|
|
|
- border: 1px solid var(--hover-data2);
|
|
|
|
|
- border-right: 0px solid var(--hover-data2);
|
|
|
|
|
|
|
+ border: 1px solid var(--hover-nav1);
|
|
|
|
|
+ border-right: 0px solid var(--hover-nav1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.label {
|
|
.label {
|
|
@@ -281,7 +311,7 @@ const leaveClassify = () => {
|
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
|
|
|
|
|
|
&:hover {
|
|
&:hover {
|
|
|
- color: var(--hover-data2);
|
|
|
|
|
|
|
+ color: var(--hover-nav1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -296,7 +326,7 @@ const leaveClassify = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
&:hover {
|
|
|
- color: var(--hover-data2);
|
|
|
|
|
|
|
+ color: var(--hover-nav1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -319,7 +349,7 @@ const leaveClassify = () => {
|
|
|
left: 234px;
|
|
left: 234px;
|
|
|
// width: 966px;
|
|
// width: 966px;
|
|
|
height: 540px;
|
|
height: 540px;
|
|
|
- border: 1px solid var(--hover-data2);
|
|
|
|
|
|
|
+ border: 1px solid var(--hover-nav1);
|
|
|
background-color: #ffffff;
|
|
background-color: #ffffff;
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
padding-left: 30px;
|
|
padding-left: 30px;
|
|
@@ -332,7 +362,7 @@ const leaveClassify = () => {
|
|
|
.two-level {
|
|
.two-level {
|
|
|
width: 90px;
|
|
width: 90px;
|
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
|
- color: var(--hover-data2);
|
|
|
|
|
|
|
+ color: var(--hover-nav1);
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -353,7 +383,7 @@ const leaveClassify = () => {
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&:hover {
|
|
&:hover {
|
|
|
- color: var(--hover-data2);
|
|
|
|
|
|
|
+ color: var(--hover-nav1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|