会员申请cont.
This commit is contained in:
parent
c71011222a
commit
9552761094
|
|
@ -1,4 +1,4 @@
|
|||
import React , {forwardRef, useEffect} from 'react';
|
||||
import React , {forwardRef, useEffect, useState} from 'react';
|
||||
import { Modal , Form , Input , Button } from 'antd';
|
||||
import UploadImage from '../../Team/Component/UploadImage';
|
||||
import { getImageUrl } from 'educoder';
|
||||
|
|
@ -8,23 +8,25 @@ const { TextArea } = Input;
|
|||
function MemberApply(props){
|
||||
const { getFieldDecorator, validateFields , setFieldsValue } = props.form;
|
||||
const { current_user, onOk, visible, onCancel } = props
|
||||
const [imageUrl, setImageUrl] = useState(undefined)
|
||||
|
||||
useEffect(()=>{
|
||||
// if(email){
|
||||
// setFieldsValue({email})
|
||||
// }
|
||||
if (current_user) {
|
||||
setImageUrl(current_user.image_url);
|
||||
}
|
||||
},[current_user])
|
||||
|
||||
function onSure(){
|
||||
validateFields((error,values)=>{
|
||||
if(!error){
|
||||
console.log(values)
|
||||
values.imageUrl = imageUrl
|
||||
onOk(values)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getImageId(id){
|
||||
console.log(image)
|
||||
setImageUrl(`/api/attachments/${id}`)
|
||||
}
|
||||
|
||||
const layout = {
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ import Crown from '../img/crown.png';
|
|||
import Nodata from '../../Nodata';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Spin, Button } from 'antd';
|
||||
import { httpUrl } from '../fetch';
|
||||
import axios from 'axios';
|
||||
import { tempConfig } from '../tempInfo'
|
||||
import MemberApply from '../Component/memberApply';
|
||||
import { getVIPLists, getAuditStatus, applyJoin } from '../api';
|
||||
|
||||
import '../indexZone1.scss'
|
||||
import '../indexZone1.scss';
|
||||
|
||||
|
||||
function ZoneVIP(props){
|
||||
|
|
@ -23,29 +22,37 @@ function ZoneVIP(props){
|
|||
if(id){
|
||||
setIsSpin(true);
|
||||
getLists();
|
||||
getMemberStatus();
|
||||
}
|
||||
},[id])
|
||||
|
||||
function getLists(){
|
||||
const url = `${httpUrl}/zone/open/${id}/member/overviewList`;
|
||||
axios.get(url).then(response=>{
|
||||
getVIPLists(id).then(response=>{
|
||||
if(response){
|
||||
setVIPLists(response.data.rows);
|
||||
setVIPLists(response.rows);
|
||||
setIsSpin(false);
|
||||
}
|
||||
}).catch(error=>{setIsSpin(false);})
|
||||
}
|
||||
|
||||
function getMemberStatus() {
|
||||
getAuditStatus(id).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
|
||||
function onOk(e) {
|
||||
console.log(e)
|
||||
applyJoin(id, e).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
|
||||
return(
|
||||
<div className={`boxmain ${temp}_VIP_box`}>
|
||||
<p className="in_title">{ tempConfig[temp].member }</p>
|
||||
<p className="vip_sub_title">{ tempConfig[temp].vipDesc }</p>
|
||||
<Button onClick={() => setApplyVisible(!applyVisible)}>日期</Button>
|
||||
<MemberApply visible={applyVisible} onOk={onOk} onCancel={() => setApplyVisible(!applyVisible)} current_user={props.current_user}/>
|
||||
<Button className="apply_button" onClick={() => setApplyVisible(!applyVisible)}>申请加入</Button>
|
||||
<MemberApply visible={applyVisible} onOk={ onOk } onCancel={() => setApplyVisible(!applyVisible)} current_user={props.current_user}/>
|
||||
|
||||
<Spin spinning={isSpin}>
|
||||
<div style={{minHeight:400}}>
|
||||
|
|
|
|||
|
|
@ -81,4 +81,21 @@ export function getVIPLists(id){
|
|||
url:`/zone/open/${id}/member/overviewList`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
/**会员申请状态 */
|
||||
export function getAuditStatus(id){
|
||||
return fetch({
|
||||
url:`/zone/member/zone/${id}/auditStatus`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
/**会员申请状态 */
|
||||
export function applyJoin(id,data) {
|
||||
return fetch({
|
||||
url: '/zone/member/applyToJoin/zone/${id}',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
|
@ -901,6 +901,17 @@
|
|||
}
|
||||
.zone_VIP_box{
|
||||
padding:50px 0px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.apply_button {
|
||||
flex-grow: 0;
|
||||
margin-top: 10px;
|
||||
&:hover, &:active, &:focus {
|
||||
color: var(--primary-color);
|
||||
border-color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
.vip_sub_title{
|
||||
color:#1f2329;
|
||||
font-size:15px;
|
||||
|
|
|
|||
|
|
@ -510,6 +510,17 @@
|
|||
}
|
||||
.zone1_VIP_box{
|
||||
padding:50px 0px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.apply_button {
|
||||
flex-grow: 0;
|
||||
margin-top: 10px;
|
||||
&:hover, &:active, &:focus {
|
||||
color: var(--primary-color);
|
||||
border-color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
.in_title{
|
||||
font-size: 38px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue