Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
frontend
Project
Project
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
Schedules
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
h5-communicate
frontend
Commits
8d387ab5
Commit
8d387ab5
authored
Jul 24, 2020
by
熊成伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first-submit
parent
a1ad9165
Pipeline
#16454
passed with stages
in 1 minute and 5 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
8 deletions
+28
-8
BlankLayout.jsx
src/layout/BlankLayout.jsx
+7
-1
CommonLayout.jsx
src/layout/CommonLayout.jsx
+7
-1
Footer.jsx
src/layout/Footer.jsx
+14
-6
No files found.
src/layout/BlankLayout.jsx
View file @
8d387ab5
import
React
from
'react'
;
import
React
,
{
useEffect
}
from
'react'
;
import
{
withRouter
}
from
'react-router-dom'
import
'./index.less'
import
queryString
from
"query-string"
;
const
BlankLayout
=
(
props
)
=>
{
useEffect
(()
=>
{
const
query
=
queryString
.
parse
(
props
.
location
.
search
);
const
keys
=
Object
.
keys
(
query
);
keys
.
length
>
0
&&
query
.
token
&&
localStorage
.
setItem
(
'token'
,
query
.
token
);
},
[])
return
(
<
div
>
{
props
.
children
}
...
...
src/layout/CommonLayout.jsx
View file @
8d387ab5
...
...
@@ -2,6 +2,7 @@ import React, {useEffect} from 'react';
import
Footer
from
'./Footer'
import
{
withRouter
}
from
'react-router-dom'
import
'./index.less'
import
queryString
from
"query-string"
;
const
CommonLayout
=
(
props
)
=>
{
...
...
@@ -35,7 +36,12 @@ const CommonLayout = (props) => {
const
defaultH
=
window
.
innerHeight
;
window
.
addEventListener
(
'resize'
,
()
=>
resize
(
defaultH
));
return
()
=>
window
.
removeEventListener
(
'resize'
,
resize
);
},
[])
},
[]);
useEffect
(()
=>
{
const
query
=
queryString
.
parse
(
props
.
location
.
search
);
const
keys
=
Object
.
keys
(
query
);
keys
.
length
>
0
&&
query
.
token
&&
localStorage
.
setItem
(
'token'
,
query
.
token
);
},
[]);
return
(
<
div
>
<
div
id=
"common-content"
className=
"common-layout-content"
>
...
...
src/layout/Footer.jsx
View file @
8d387ab5
...
...
@@ -2,15 +2,11 @@ import React, {useState, useEffect} from 'react';
import
{
TabBar
}
from
'antd-mobile'
import
'./index.less'
import
axiosRequest
from
'../utils/request'
;
import
queryString
from
"query-string"
;
const
Footer
=
(
props
)
=>
{
const
[
current
,
setCurrent
]
=
useState
();
const
[
badge
,
setBadge
]
=
useState
()
useEffect
(()
=>
{
const
keysArray
=
props
.
location
.
pathname
.
replace
(
`
${
props
.
match
.
path
}
/`
,
''
).
split
(
"/"
);
keysArray
.
length
>
0
&&
setCurrent
(
keysArray
[
0
]);
getData
()
},
[]);
const
[
badge
,
setBadge
]
=
useState
();
const
getData
=
()
=>
{
axiosRequest
({
method
:
'post'
,
...
...
@@ -29,6 +25,18 @@ const Footer = (props) => {
{
title
:
'通讯录'
,
key
:
'addressList'
,
icon
:
'/img/footer-communicate.png'
,
selectedIcon
:
'/img/footer-communicate-s.png'
,
badge
:
''
,
onPress
:
'/bord/addressList'
},
{
title
:
'通知'
,
key
:
'notice'
,
icon
:
'/img/footer-notice.png'
,
selectedIcon
:
'/img/footer-notice-s.png'
,
badge
:
badge
,
onPress
:
'/bord/notice'
}
];
useEffect
(()
=>
{
new
Promise
((
resolve
=>
{
const
query
=
queryString
.
parse
(
props
.
location
.
search
);
const
keys
=
Object
.
keys
(
query
);
keys
.
length
>
0
&&
query
.
token
&&
localStorage
.
setItem
(
'token'
,
query
.
token
);
resolve
()
})).
then
(()
=>
{
const
keysArray
=
props
.
location
.
pathname
.
replace
(
`
${
props
.
match
.
path
}
/`
,
''
).
split
(
"/"
);
keysArray
.
length
>
0
&&
setCurrent
(
keysArray
[
0
]);
getData
()
})
},
[]);
return
(
<
div
id=
"footer"
className=
"footer"
>
<
TabBar
...
...
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