Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
9e611ef6
Commit
9e611ef6
authored
Jun 17, 2021
by
maolipeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/maolipeng/youhua' into 'master'
Feature/maolipeng/youhua See merge request
!47
parents
641a814b
054837cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
5 deletions
+37
-5
src/modules/root/Menu.less
+9
-1
src/modules/root/Menu.tsx
+28
-4
No files found.
src/modules/root/Menu.less
View file @
9e611ef6
...
...
@@ -14,12 +14,20 @@
color: #333;
.topLogo {
height: 62px;
img {
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;
}
}
.menu-type-icon{
margin:4px 0 0px 150px;
...
...
src/modules/root/Menu.tsx
View file @
9e611ef6
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useContext
,
useEffect
,
use
Ref
,
use
State
}
from
'react'
;
import
{
withRouter
,
}
from
'react-router-dom'
;
...
...
@@ -19,6 +19,8 @@ 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
;
...
...
@@ -43,7 +45,12 @@ function Aside(props: any) {
if
(
User
.
getToken
())
{
StoreService
.
getStoreDetail
({
storeId
:
User
.
getStoreId
()})
.
then
(
res
=>
{
setTopLogoUrl
(
res
.
result
.
logo
)
if
(
_
.
isEmpty
(
res
.
result
.
logo
))
{
setTopLogoUrl
(
"https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png"
)
}
else
{
setTopLogoUrl
(
res
.
result
.
logo
)
}
})
}
}
...
...
@@ -60,6 +67,23 @@ function Aside(props: any) {
function
handleMenu
()
{
handleMenuType
();
}
useEffect
(()
=>
{
if
(
!
logoImg0Ref
.
current
||
!
logoImg1Ref
.
current
)
{
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"
}
}
else
{
logoImg0Ref
.
current
.
style
.
display
=
"none"
logoImg1Ref
.
current
.
style
.
display
=
"inline"
}
},[
menuType
])
return
(
<
div
...
...
@@ -71,8 +95,8 @@ function Aside(props: any) {
}
>
<
div
className=
"topLogo"
>
{
menuType
?
(<
img
src=
{
topLogoUrl
}
alt=
""
></
img
>)
:
(
""
)
}
<
img
ref=
{
logoImg0Ref
}
src=
"https://image.xiaomaiketang.com/xm/c4KiP2epBP.png"
alt=
""
className=
"img0"
></
img
>
<
img
ref=
{
logoImg1Ref
}
src=
{
topLogoUrl
}
alt=
""
className=
"img1"
></
img
>
</
div
>
<
div
className=
"menu-type-icon"
onClick=
{
handleMenu
}
>
{
menuType
?
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment