Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
9201571d
Commit
9201571d
authored
Dec 23, 2020
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改首页
parent
bd6c9875
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
8 deletions
+43
-8
index.less
src/pages/home/components/UserCenter/index.less
+20
-4
index.tsx
src/pages/home/components/UserCenter/index.tsx
+23
-4
No files found.
src/pages/home/components/UserCenter/index.less
View file @
9201571d
...
...
@@ -54,13 +54,29 @@
.randomLogo {
background-color: #255BA3;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 100%;
border-radius: 50%;
color: #fff;
position: relative;
overflow: hidden;
.text {
position: absolute;
top: 50%;
left: 50%;
margin-top: -12px;
margin-left: -4px;
}
.upload {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,0.3);
text-align: center;
color: #fff;
height: 20px;
cursor: pointer;
}
}
}
...
...
src/pages/home/components/UserCenter/index.tsx
View file @
9201571d
import
React
from
'react'
;
import
React
,
{
useReducer
}
from
'react'
;
import
styles
from
'./index.less'
;
import
moment
from
'moment'
;
import
{
Row
,
Col
,
Badge
}
from
'antd'
;
import
{
Badge
,
Upload
}
from
'antd'
;
import
level1
from
'@/assets/imgs/level1.png'
;
import
level2
from
'@/assets/imgs/level2.png'
;
import
level3
from
'@/assets/imgs/level3.png'
;
...
...
@@ -18,12 +18,25 @@ const EDIT_USER_URL = '/memberCenter/memberAbility/query';
const
USER_CENTER_URL
=
'/memberCenter/memberAbility/manage/maintain'
const
STATUS_COLOR
:
(
"default"
|
"processing"
|
"error"
|
"success"
)[]
=
[
"default"
,
"processing"
,
"error"
,
"success"
]
function
reducer
(
state
,
action
)
{
switch
(
action
.
type
)
{
case
'increment'
:
return
{
count
:
state
.
count
+
1
};
case
'decrement'
:
return
{
count
:
state
.
count
-
1
};
default
:
throw
new
Error
();
}
}
const
UserCenter
:
React
.
FC
<
Iprops
>
=
()
=>
{
// const [uploadLoading, setUpload]
const
today
=
moment
();
const
userAuth
=
getAuth
();
const
hasChangeMemberAuth
=
userAuth
?.
urls
.
includes
(
EDIT_USER_URL
);
const
hasCenterAuth
=
userAuth
?.
urls
.
includes
(
USER_CENTER_URL
);
const
currentRole
=
userAuth
.
roles
.
filter
((
item
)
=>
item
.
memberRoleId
===
userAuth
.
memberRoleId
)
// const [state, dispatch] = useReducer(reducer, { })
if
(
!
userAuth
)
{
return
null
}
...
...
@@ -46,11 +59,17 @@ const UserCenter: React.FC<Iprops> = () => {
<
div
className=
{
styles
.
content
}
>
{
/* http://10.0.0.25:4000/project/15/interface/api/38926 上传用户头像 */
}
<
div
className=
{
styles
.
userLogo
}
>
{
{
/* {
userAuth.logo
? <img src={userAuth.logo || ''} />
: <div className={styles.randomLogo}>H</div>
}
} */
}
<
div
className=
{
styles
.
randomLogo
}
>
<
span
className=
{
styles
.
text
}
>
H
</
span
>
<
Upload
>
<
span
className=
{
styles
.
upload
}
>
修改
</
span
>
</
Upload
>
</
div
>
</
div
>
<
div
className=
{
styles
.
infos
}
>
<
div
>
...
...
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