Commit bca7e23a authored by 王玉鑫's avatar 王玉鑫

feat: 首页菜单样式修改

parent b5a4e9d5
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- <div>logo</div> --> <!-- <div>logo</div> -->
<div class="flex flex-1 justify-start"> <div class="flex flex-1 justify-start">
<div v-if="route.name === 'home'" class="mr-7 flex w-[224px] items-center"> <div v-if="route.name === 'home'" class="mr-7 flex w-[224px] items-center">
<img class="w-[123px] h-[33px]" src="@/assets/images/nav-logo.png" alt="" /> <img class="h-[33px] w-[123px]" src="@/assets/images/nav-logo.png" alt="" />
<div <div
class="city-space ml-4 flex items-center" class="city-space ml-4 flex items-center"
@mouseenter="changeCityStatus(1)" @mouseenter="changeCityStatus(1)"
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
</div> </div>
<ElMenu <ElMenu
class="!border-none" class="!border-none"
:class="{ 'no-select': route.name === 'home' }"
mode="horizontal" mode="horizontal"
:default-active="currentPath" :default-active="currentPath"
:ellipsis="false" :ellipsis="false"
...@@ -49,7 +50,10 @@ ...@@ -49,7 +50,10 @@
</template> </template>
</ElMenu> </ElMenu>
</div> </div>
<div class="flex items-center pr-[56px] text-base text-[#333333]" :style="{color: route.name === 'home'? 'white': '#333' }"> <div
class="flex items-center pr-[56px] text-base text-[#333333]"
:style="{ color: route.name === 'home' ? 'white' : '#333' }"
>
<div> <div>
<div v-if="userInfo" class="flex items-center"> <div v-if="userInfo" class="flex items-center">
<ElDropdown <ElDropdown
...@@ -95,8 +99,15 @@ ...@@ -95,8 +99,15 @@
<span @click="handleLogin('register')">注册</span> <span @click="handleLogin('register')">注册</span>
</div> </div>
</div> </div>
<div class="ml-4 flex items-center text-base font-medium text-[#C0322B]" :style="{color: route.name === 'home'? 'white': '#C0322B' }"> <div
<img v-if="route.name === 'home'" class="mr-2 h-4 w-4" src="@/assets/images/icon-phone_white.png" /> class="ml-4 flex items-center text-base font-medium text-[#C0322B]"
:style="{ color: route.name === 'home' ? 'white' : '#C0322B' }"
>
<img
v-if="route.name === 'home'"
class="mr-2 h-4 w-4"
src="@/assets/images/icon-phone_white.png"
/>
<img v-else class="mr-2 h-4 w-4" src="@/assets/images/icon-phone_call.png" /> <img v-else class="mr-2 h-4 w-4" src="@/assets/images/icon-phone_call.png" />
<span>400-833-0813</span> <span>400-833-0813</span>
</div> </div>
...@@ -112,7 +123,7 @@ ...@@ -112,7 +123,7 @@
<div <div
v-for="cities in cityList" v-for="cities in cityList"
:key="cities.label" :key="cities.label"
class="text-[#1a1a1a] mr-[41px] shrink-0 text-base" class="mr-[41px] shrink-0 text-base text-[#1a1a1a]"
> >
<span class="font-medium">{{ cities.label }}</span> <span class="font-medium">{{ cities.label }}</span>
<p <p
...@@ -301,6 +312,10 @@ const handleMenuChange = (menu: HeaderMenuItem) => { ...@@ -301,6 +312,10 @@ const handleMenuChange = (menu: HeaderMenuItem) => {
cityInFilter.value && menuRoute.name !== RouteName.home cityInFilter.value && menuRoute.name !== RouteName.home
? JSON.stringify({ provinceName: cityInFilter.value.name }) ? JSON.stringify({ provinceName: cityInFilter.value.name })
: undefined; : undefined;
const isNewPage = menuRoute.name === RouteName.industryCategory;
if (isNewPage) {
console.log(isNewPage);
}
openPage( openPage(
{ {
path: menu.path, path: menu.path,
...@@ -308,38 +323,43 @@ const handleMenuChange = (menu: HeaderMenuItem) => { ...@@ -308,38 +323,43 @@ const handleMenuChange = (menu: HeaderMenuItem) => {
searchParams, searchParams,
}, },
}, },
menuRoute.name === RouteName.industryCategory, isNewPage,
); );
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.header-view { .header-view {
box-shadow: 0 2px 8px 0 rgba(90, 0, 0, 0.1); box-shadow: 0 2px 8px 0 rgba(90, 0, 0, 0.1);
position: relative; position: relative;
min-width: 1200px; min-width: 1200px;
z-index: 100; z-index: 100;
::v-deep { .el-menu-item {
.el-menu-item { padding: 0 16px;
padding: 0 16px; }
.el-menu--horizontal > .el-menu-item {
color: #333333;
// font-weight: 600;
font-size: 16px;
border: none;
&:hover {
background-color: #fff;
color: #c0322b;
} }
.el-menu--horizontal > .el-menu-item { &.is-active {
color: #333333; border-bottom-color: #fff;
// font-weight: 600; color: #c0322b !important;
font-size: 16px;
&:hover { &:hover {
background-color: #fff;
color: #c0322b; color: #c0322b;
} }
} }
.el-menu--horizontal .el-menu-item:not(.is-disabled):focus { }
background: #fff; .no-select.el-menu--horizontal {
} .el-menu-item.is-active {
.el-menu--horizontal > .el-menu-item.is-active { color: white !important;
border-bottom-color: #fff; background: transparent !important;
color: #c0322b !important;
} }
.el-menu--horizontal > .el-menu-item.is-active:hover { & > .el-menu-item:hover {
color: #c0322b !important; color: white !important;
} }
} }
} }
...@@ -363,26 +383,23 @@ const handleMenuChange = (menu: HeaderMenuItem) => { ...@@ -363,26 +383,23 @@ const handleMenuChange = (menu: HeaderMenuItem) => {
.city-item:hover { .city-item:hover {
color: #c0322b; color: #c0322b;
} }
} ::v-deep .el-dropdown__popper.el-popper.user-menu {
.city-active { top: 43px !important;
color: #c0322b; border: none;
} border-radius: 0;
::v-deep .el-dropdown__popper.el-popper.user-menu { box-shadow: 0 2px 8px 0 rgba(90, 0, 0, 0.1);
top: 43px !important; &::before {
border: none; content: '';
border-radius: 0; position: absolute;
box-shadow: 0 2px 8px 0 rgba(90, 0, 0, 0.1); background-color: #fff;
&::before { height: 9px;
content: ''; left: -7px;
position: absolute; top: -9px;
background-color: #fff; width: 187px;
height: 9px; }
left: -7px; .el-popper__arrow {
top: -9px; display: none;
width: 187px; }
}
.el-popper__arrow {
display: none;
} }
} }
.home-page_header { .home-page_header {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment