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
6f687d3a
Commit
6f687d3a
authored
Jun 16, 2021
by
maolipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:logo切换位置换到leftmenu
parent
98b93d21
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
17 deletions
+47
-17
src/modules/root/App.tsx
+1
-2
src/modules/root/Header.jsx
+17
-14
src/modules/root/Menu.less
+10
-1
src/modules/root/Menu.tsx
+19
-0
No files found.
src/modules/root/App.tsx
View file @
6f687d3a
...
@@ -116,7 +116,6 @@ const App: React.FC = (props: any) => {
...
@@ -116,7 +116,6 @@ const App: React.FC = (props: any) => {
setMenuType
(
!
menuType
);
setMenuType
(
!
menuType
);
}
}
if
(
!
storeUserId
)
{
if
(
!
storeUserId
)
{
return
<
div
></
div
>
return
<
div
></
div
>
}
}
...
@@ -127,7 +126,7 @@ const App: React.FC = (props: any) => {
...
@@ -127,7 +126,7 @@ const App: React.FC = (props: any) => {
<
ConfigProvider
locale=
{
zhCN
}
autoInsertSpaceInButton=
{
false
}
>
<
ConfigProvider
locale=
{
zhCN
}
autoInsertSpaceInButton=
{
false
}
>
<
Main
menuType=
{
menuType
}
/>
<
Main
menuType=
{
menuType
}
/>
</
ConfigProvider
>
</
ConfigProvider
>
<
Menu
menuType=
{
menuType
}
handleMenuType=
{
handleMenuType
}
/>
<
Menu
menuType=
{
menuType
}
handleMenuType=
{
handleMenuType
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
src/modules/root/Header.jsx
View file @
6f687d3a
...
@@ -19,6 +19,7 @@ import CourseService from "@/domains/course-domain/CourseService";
...
@@ -19,6 +19,7 @@ import CourseService from "@/domains/course-domain/CourseService";
import
qrcode
from
"@/libs/qrcode/qrcode.js"
;
import
qrcode
from
"@/libs/qrcode/qrcode.js"
;
import
Bus
from
'@/core/tbus'
;
import
Bus
from
'@/core/tbus'
;
import
ClickOutside
from
'../../components/ClickOutside'
;
import
ClickOutside
from
'../../components/ClickOutside'
;
import
_
from
"underscore"
;
const
baseImg
=
"https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png"
;
const
baseImg
=
"https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png"
;
const
{
confirm
}
=
Modal
;
const
{
confirm
}
=
Modal
;
...
@@ -34,12 +35,13 @@ function Header(props) {
...
@@ -34,12 +35,13 @@ function Header(props) {
const
[
list
,
setList
]
=
useState
([]);
const
[
list
,
setList
]
=
useState
([]);
const
[
openDropdown
,
setOpenDropdown
]
=
useState
(
false
);
const
[
openDropdown
,
setOpenDropdown
]
=
useState
(
false
);
const
[
instScroll
,
setInstScroll
]
=
useState
(
false
);
const
[
instScroll
,
setInstScroll
]
=
useState
(
false
);
const
[
topLeftLogo
,
setTopLeftLogo
]
=
useState
(
"https://image.xiaomaiketang.com/xm/WEsMPAYxAs.png"
)
const
ctx
=
useContext
(
XMContext
);
const
ctx
=
useContext
(
XMContext
);
const
htmlUrl
=
`
${
LIVE_SHARE
}
store/index?id=
${
User
.
getStoreId
()}
&userId=
${
User
.
getUserId
()}
&from=work_weixin`
;
const
htmlUrl
=
`
${
LIVE_SHARE
}
store/index?id=
${
User
.
getStoreId
()}
&userId=
${
User
.
getUserId
()}
&from=work_weixin`
;
const
storeUserId
=
User
.
getStoreUserId
();
const
storeUserId
=
User
.
getStoreUserId
();
const
enterpriseId
=
User
.
getEnterpriseId
();
const
enterpriseId
=
User
.
getEnterpriseId
();
const
messageHelpRef
=
useRef
(
null
)
const
domRef
=
useRef
(
null
);
const
domRef
=
useRef
(
null
);
const
listRef
=
useRef
(
list
);
const
listRef
=
useRef
(
list
);
...
@@ -49,13 +51,23 @@ function Header(props) {
...
@@ -49,13 +51,23 @@ function Header(props) {
setStoreName
(
value
);
setStoreName
(
value
);
});
});
getStoreList
();
getStoreList
();
getTopLeftLogo
()
},
[]);
},
[]);
useEffect
(()
=>
{
useEffect
(()
=>
{
storeUserId
&&
getUserInfo
();
storeUserId
&&
getUserInfo
();
enterpriseId
?
getEnterpriseUser
()
:
User
.
setIsAdmin
(
false
);
enterpriseId
?
getEnterpriseUser
()
:
User
.
setIsAdmin
(
false
);
},
[
storeUserId
]);
},
[
storeUserId
]);
useEffect
(()
=>
{
if
(
!
messageHelpRef
.
current
)
{
return
}
if
(
menuType
)
{
messageHelpRef
.
current
.
style
.
marginLeft
=
"194px"
}
else
{
messageHelpRef
.
current
.
style
.
marginLeft
=
"76px"
}
},[
menuType
])
function
getUserInfo
()
{
function
getUserInfo
()
{
const
param
=
{
const
param
=
{
...
@@ -80,15 +92,6 @@ function Header(props) {
...
@@ -80,15 +92,6 @@ function Header(props) {
});
});
}
}
function
getTopLeftLogo
()
{
if
(
User
.
getToken
())
{
StoreService
.
getStoreDetail
({
storeId
:
User
.
getStoreId
()})
.
then
(
res
=>
{
setTopLeftLogo
(
res
.
result
.
logo
)
})
}
}
function
getStoreList
()
{
function
getStoreList
()
{
if
(
!
enterpriseId
)
return
null
;
if
(
!
enterpriseId
)
return
null
;
const
params
=
{
const
params
=
{
...
@@ -230,10 +233,10 @@ function Header(props) {
...
@@ -230,10 +233,10 @@ function Header(props) {
return
(
return
(
<
div
id=
"top-container"
className=
"top-container"
>
<
div
id=
"top-container"
className=
"top-container"
>
<
div
className=
"top top-nav"
>
<
div
className=
"top top-nav"
>
<
div
>
{
/*
<div>
<img src={topLeftLogo} className="logo" alt="" />
<img src={topLeftLogo} className="logo" alt="" />
</
div
>
</div>
*/
}
<
div
className=
"message-help"
>
<
div
className=
"message-help"
ref=
{
messageHelpRef
}
>
{
list
.
length
?
(
{
list
.
length
?
(
<
ClickOutside
<
ClickOutside
onClickOutside=
{
()
=>
{
onClickOutside=
{
()
=>
{
...
...
src/modules/root/Menu.less
View file @
6f687d3a
@import '../../core/variables.less';
@import '../../core/variables.less';
@top-height:
6
0px;
@top-height: 0px;
@menu-bakg: #FFF;
@menu-bakg: #FFF;
@active-color: #2966FF;
@active-color: #2966FF;
.left-container {
.left-container {
...
@@ -12,6 +12,15 @@
...
@@ -12,6 +12,15 @@
width: @xm-left-width;
width: @xm-left-width;
background: @menu-bakg;
background: @menu-bakg;
color: #333;
color: #333;
.topLogo {
height: 62px;
img {
width: 138px;
height: 35px;
margin-left: 19px;
margin-top: 13px;
}
}
.menu-type-icon{
.menu-type-icon{
margin:4px 0 0px 150px;
margin:4px 0 0px 150px;
cursor: pointer;
cursor: pointer;
...
...
src/modules/root/Menu.tsx
View file @
6f687d3a
...
@@ -5,6 +5,9 @@ import {
...
@@ -5,6 +5,9 @@ import {
import
{
Menu
}
from
'antd'
;
import
{
Menu
}
from
'antd'
;
import
{
menuList
}
from
'../../routes//config/menuList'
import
{
menuList
}
from
'../../routes//config/menuList'
import
{
XMContext
}
from
'../../store/context'
;
import
{
XMContext
}
from
'../../store/context'
;
import
Service
from
"@/common/js/service"
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
User
from
"@/common/js/user"
;
import
_
from
'underscore'
;
import
_
from
'underscore'
;
import
"./Menu.less"
;
import
"./Menu.less"
;
...
@@ -14,6 +17,7 @@ function Aside(props: any) {
...
@@ -14,6 +17,7 @@ function Aside(props: any) {
const
ctx
:
any
=
useContext
(
XMContext
);
const
ctx
:
any
=
useContext
(
XMContext
);
const
[
selectKey
,
setSelectKey
]
=
useState
();
const
[
selectKey
,
setSelectKey
]
=
useState
();
const
[
openKeys
,
setOpenKeys
]
=
useState
([
''
]);
const
[
openKeys
,
setOpenKeys
]
=
useState
([
''
]);
const
[
topLogoUrl
,
setTopLogoUrl
]
=
useState
(
""
)
const
rootSubmenuKeys
=
_
.
pluck
(
menuList
,
'groupCode'
);
const
rootSubmenuKeys
=
_
.
pluck
(
menuList
,
'groupCode'
);
useEffect
(()
=>
{
useEffect
(()
=>
{
const
link
=
props
.
location
.
pathname
;
const
link
=
props
.
location
.
pathname
;
...
@@ -31,6 +35,17 @@ function Aside(props: any) {
...
@@ -31,6 +35,17 @@ function Aside(props: any) {
return
item
;
return
item
;
})
})
},
[
props
.
location
.
pathname
])
},
[
props
.
location
.
pathname
])
useEffect
(()
=>
{
getTopLeftLogo
()
})
function
getTopLeftLogo
()
{
if
(
User
.
getToken
())
{
StoreService
.
getStoreDetail
({
storeId
:
User
.
getStoreId
()})
.
then
(
res
=>
{
setTopLogoUrl
(
res
.
result
.
logo
)
})
}
}
function
toggleMenu
(
item
:
any
)
{
function
toggleMenu
(
item
:
any
)
{
window
.
RCHistory
.
push
(
item
.
link
)
window
.
RCHistory
.
push
(
item
.
link
)
}
}
...
@@ -54,6 +69,10 @@ function Aside(props: any) {
...
@@ -54,6 +69,10 @@ function Aside(props: any) {
:
"left-container left-container-vertical"
:
"left-container left-container-vertical"
}
}
>
>
<
div
className=
"topLogo"
>
{
menuType
?
(<
img
src=
{
topLogoUrl
}
alt=
""
></
img
>)
:
(
""
)
}
</
div
>
<
div
className=
"menu-type-icon"
onClick=
{
handleMenu
}
>
<
div
className=
"menu-type-icon"
onClick=
{
handleMenu
}
>
{
menuType
?
(
{
menuType
?
(
<
span
<
span
...
...
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