会员申请cont.
This commit is contained in:
parent
9552761094
commit
c55a9cb5cf
|
|
@ -1,5 +1,5 @@
|
|||
import React , {forwardRef, useEffect, useState} from 'react';
|
||||
import { Modal , Form , Input , Button } from 'antd';
|
||||
import { Modal , Form , Input , Button, Icon } from 'antd';
|
||||
import UploadImage from '../../Team/Component/UploadImage';
|
||||
import { getImageUrl } from 'educoder';
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ function MemberApply(props){
|
|||
>
|
||||
<div>
|
||||
<p className="mb15 edu-txt-center" style={{maxWidth:"600px",margin:"0px auto"}}>
|
||||
若您未填写会员头像,会员名称,我们会将您的GitLink用户头像及昵称自动填入,请知悉
|
||||
<Icon type="info-circle" theme="filled" className="mr10" style={{ color: '#466aff' }} />若您未填写会员头像,会员名称,我们会将您的GitLink用户头像及昵称自动填入,请知悉
|
||||
</p>
|
||||
<Form {...layout }>
|
||||
<Form.Item label="会员名称" name="name">
|
||||
|
|
|
|||
|
|
@ -9,13 +9,19 @@ import { getVIPLists, getAuditStatus, applyJoin } from '../api';
|
|||
|
||||
import '../indexZone1.scss';
|
||||
|
||||
const memberStatusEnum = {
|
||||
notMember: 0,
|
||||
isMember: 1,
|
||||
applying: 2
|
||||
}
|
||||
|
||||
function ZoneVIP(props){
|
||||
const { deptId } = props.match.params;
|
||||
const [ vipLists , setVIPLists ] = useState(undefined);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
const [ applyVisible , setApplyVisible ] = useState(false);
|
||||
const { id } = props;
|
||||
const [ memberStatus , setMemberStatus] = useState(memberStatusEnum.notMember);
|
||||
const { id, showNotification } = props;
|
||||
const temp = props.pathName
|
||||
|
||||
useEffect(()=>{
|
||||
|
|
@ -37,13 +43,23 @@ function ZoneVIP(props){
|
|||
|
||||
function getMemberStatus() {
|
||||
getAuditStatus(id).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
if (res && res.code === 200) {
|
||||
setMemberStatus(res.data)
|
||||
} else {
|
||||
setMemberStatus(memberStatusEnum.notMember)
|
||||
}
|
||||
}).catch(() => { setMemberStatus(memberStatusEnum.notMember) })
|
||||
}
|
||||
|
||||
function onOk(e) {
|
||||
applyJoin(id, e).then(res => {
|
||||
console.log(res)
|
||||
if (res) {
|
||||
showNotification(res.msg)
|
||||
setApplyVisible(!applyVisible)
|
||||
if (res.code === 200) {
|
||||
setMemberStatus(memberStatusEnum.applying)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -51,8 +67,9 @@ function ZoneVIP(props){
|
|||
<div className={`boxmain ${temp}_VIP_box`}>
|
||||
<p className="in_title">{ tempConfig[temp].member }</p>
|
||||
<p className="vip_sub_title">{ tempConfig[temp].vipDesc }</p>
|
||||
<Button className="apply_button" onClick={() => setApplyVisible(!applyVisible)}>申请加入</Button>
|
||||
<MemberApply visible={applyVisible} onOk={ onOk } onCancel={() => setApplyVisible(!applyVisible)} current_user={props.current_user}/>
|
||||
{ memberStatus === memberStatusEnum.notMember && <Button className="apply_button" onClick={() => setApplyVisible(!applyVisible)}>申请加入</Button> }
|
||||
{ memberStatus === memberStatusEnum.applying && <Button className="apply_button" disabled>申请中</Button> }
|
||||
<MemberApply visible={applyVisible} onOk={ onOk } onCancel={() => setApplyVisible(!applyVisible)} current_user={props.current_user}/>
|
||||
|
||||
<Spin spinning={isSpin}>
|
||||
<div style={{minHeight:400}}>
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ export function getAuditStatus(id){
|
|||
/**会员申请状态 */
|
||||
export function applyJoin(id,data) {
|
||||
return fetch({
|
||||
url: '/zone/member/applyToJoin/zone/${id}',
|
||||
url: `/zone/member/applyToJoin/zone/${id}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue