Commit 284c4297 by maolipeng

fix:每周优化。。。。

parent 9e611ef6
......@@ -12,31 +12,28 @@
width: @xm-left-width;
background: @menu-bakg;
color: #333;
.topLogo {
height: 62px;
background: rgba(255, 255, 255, 0.5);
.img1 {
width: 138px;
height: 35px;
margin-left: 19px;
margin-top: 13px;
}
.img0 {
display: none;
width: 35px;
height: 35px;
margin-left: 10px;
margin-top: 13px;
.top-ctrl {
display: flex;
align-items: center;
.topLogo {
height: 60px;
background: rgba(255, 255, 255, 0.5);
.img1 {
width: 138px;
height: 35px;
margin: 15px 0 15px 8px;
}
}
}
.menu-type-icon{
margin:4px 0 0px 150px;
cursor: pointer;
.icon{
font-size:14px;
color:#5E606A;
.menu-type-icon{
margin: 8px 14px 0px 4px;
cursor: pointer;
.icon{
font-size:14px;
color:#5E606A;
}
}
}
.ant-menu {
padding-left: 0 !important;
color: #333;
......
......@@ -10,7 +10,6 @@ import StoreService from "@/domains/store-domain/storeService";
import User from "@/common/js/user";
import _ from 'underscore';
import "./Menu.less";
console.log('2021-06-17')
const { SubMenu } = Menu;
function Aside(props: any) {
......@@ -19,8 +18,6 @@ function Aside(props: any) {
const [selectKey, setSelectKey] = useState();
const [openKeys, setOpenKeys] = useState(['']);
const [topLogoUrl, setTopLogoUrl] = useState("")
const logoImg0Ref = useRef<any>()
const logoImg1Ref = useRef<any>()
const rootSubmenuKeys = _.pluck(menuList, 'groupCode');
useEffect(() => {
const link = props.location.pathname;
......@@ -56,6 +53,9 @@ function Aside(props: any) {
}
function toggleMenu(item: any) {
window.RCHistory.push(item.link)
if (!menuType) {
setOpenKeys([])
}
}
function onOpenChange(key: any) {
if (openKeys.includes(key)) {
......@@ -64,26 +64,19 @@ function Aside(props: any) {
setOpenKeys([key]);
}
}
function handleMenu() {
handleMenuType();
}
useEffect(()=> {
if (!logoImg0Ref.current || !logoImg1Ref.current) {
function onOpenChangeForHover(key: any) {
if (menuType) {
return
}
if (!menuType) {
if (topLogoUrl.indexOf("xiaomaiketang.com") < 0) {
logoImg0Ref.current.style.display = "none"
logoImg1Ref.current.style.display = "none"
} else {
logoImg0Ref.current.style.display = "inline"
logoImg1Ref.current.style.display = "none"
}
if (openKeys.includes(key)) {
setOpenKeys([]);
} else {
logoImg0Ref.current.style.display = "none"
logoImg1Ref.current.style.display = "inline"
setOpenKeys([key]);
}
},[menuType])
}
function handleMenu() {
handleMenuType();
}
return (
<div
......@@ -94,9 +87,9 @@ function Aside(props: any) {
: "left-container left-container-vertical"
}
>
<div className="top-ctrl">
<div className="topLogo">
<img ref={logoImg0Ref} src="https://image.xiaomaiketang.com/xm/c4KiP2epBP.png" alt="" className="img0"></img>
<img ref={logoImg1Ref} src={topLogoUrl} alt="" className="img1"></img>
{ menuType && <img src={topLogoUrl} alt="" className="img1"></img> }
</div>
<div className="menu-type-icon" onClick={handleMenu}>
{menuType ? (
......@@ -113,6 +106,8 @@ function Aside(props: any) {
</span>
)}
</div>
</div>
<div className="left">
<div className="nav">
......@@ -129,7 +124,7 @@ function Aside(props: any) {
return null;
}
if (item.children) {
return <SubMenu key={item.groupCode} style={{ marginTop: 0 }} className="first-menu-item" title={<div >
return <SubMenu onTitleMouseEnter={() => onOpenChangeForHover(item.groupCode)} key={item.groupCode} style={{ marginTop: 0 }} className="first-menu-item" title={<div >
{/* <span style={{ marginRight: 16 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span> */}
<img src={item.img} className="icon-img"></img>
{menuType &&
......
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