会员申请优化
This commit is contained in:
parent
c55a9cb5cf
commit
391e846e01
|
|
@ -10,9 +10,9 @@ import { getVIPLists, getAuditStatus, applyJoin } from '../api';
|
|||
import '../indexZone1.scss';
|
||||
|
||||
const memberStatusEnum = {
|
||||
notMember: 0,
|
||||
isMember: 1,
|
||||
applying: 2
|
||||
applying: '0',
|
||||
isMember: '1',
|
||||
notMember: '2'
|
||||
}
|
||||
|
||||
function ZoneVIP(props){
|
||||
|
|
@ -21,7 +21,7 @@ function ZoneVIP(props){
|
|||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
const [ applyVisible , setApplyVisible ] = useState(false);
|
||||
const [ memberStatus , setMemberStatus] = useState(memberStatusEnum.notMember);
|
||||
const { id, showNotification } = props;
|
||||
const { id, showNotification, checkIfLogin, showLoginDialog } = props;
|
||||
const temp = props.pathName
|
||||
|
||||
useEffect(()=>{
|
||||
|
|
@ -63,11 +63,19 @@ function ZoneVIP(props){
|
|||
})
|
||||
}
|
||||
|
||||
function apply() {
|
||||
if(checkIfLogin()===false){
|
||||
showLoginDialog()
|
||||
return false;
|
||||
}
|
||||
setApplyVisible(!applyVisible)
|
||||
}
|
||||
|
||||
return(
|
||||
<div className={`boxmain ${temp}_VIP_box`}>
|
||||
<p className="in_title">{ tempConfig[temp].member }</p>
|
||||
<p className="vip_sub_title">{ tempConfig[temp].vipDesc }</p>
|
||||
{ memberStatus === memberStatusEnum.notMember && <Button className="apply_button" onClick={() => setApplyVisible(!applyVisible)}>申请加入</Button> }
|
||||
{ memberStatus === memberStatusEnum.notMember && <Button className="apply_button" onClick={ apply }>申请加入</Button> }
|
||||
{ memberStatus === memberStatusEnum.applying && <Button className="apply_button" disabled>申请中</Button> }
|
||||
<MemberApply visible={applyVisible} onOk={ onOk } onCancel={() => setApplyVisible(!applyVisible)} current_user={props.current_user}/>
|
||||
|
||||
|
|
|
|||
|
|
@ -52,9 +52,6 @@ function Index(props){
|
|||
const { deptId } = props.match.params;
|
||||
const [ id , setId ] = useState(undefined);
|
||||
const temp = props.pathName
|
||||
const current_user = props.current_user
|
||||
console.log(current_user)
|
||||
console.log(props)
|
||||
|
||||
useEffect(()=>{
|
||||
if(deptId){
|
||||
|
|
|
|||
|
|
@ -906,7 +906,7 @@
|
|||
align-items: center;
|
||||
.apply_button {
|
||||
flex-grow: 0;
|
||||
margin-top: 10px;
|
||||
margin-top: 20px;
|
||||
&:hover, &:active, &:focus {
|
||||
color: var(--primary-color);
|
||||
border-color: var(--primary-color);
|
||||
|
|
|
|||
|
|
@ -515,7 +515,7 @@
|
|||
align-items: center;
|
||||
.apply_button {
|
||||
flex-grow: 0;
|
||||
margin-top: 10px;
|
||||
margin-top: 20px;
|
||||
&:hover, &:active, &:focus {
|
||||
color: var(--primary-color);
|
||||
border-color: var(--primary-color);
|
||||
|
|
|
|||
Loading…
Reference in New Issue