Commit 9201571d authored by Bill's avatar Bill

修改首页

parent bd6c9875
......@@ -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;
}
}
}
......
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>
......
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