Commit ddeae51c authored by XieZhiXiong's avatar XieZhiXiong

chore: 删除无用文件

parent 2b5668bf
import React, { useState, useEffect } from 'react';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { PageHeader, Tag, Descriptions, Button, Modal, Badge, Spin } from 'antd';
import { SettingOutlined, StopOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { STATUS_COLOR_MAP, STATUS_COLOR_TXT } from '../constant';
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import { GetMemberAbilityMaintenanceDetailBasicResponse } from '@/services/MemberApi';
import {
MEMBER_STATUS_NORMAL,
MEMBER_STATUS_FROZEN,
MEMBER_TYPE_CHANNEL_CORPORATE,
MEMBER_TYPE_CHANNEL_INDIVIDUAL,
} from '@/constants';
import NiceForm from '@/components/NiceForm';
import AvatarWrap from '@/components/AvatarWrap';
import { auditModalSchema } from './schema';
import AuditProcess from '../components/AuditProcess';
import BasicInfo from '../components/BasicInfo';
import StatusTag from '../components/StatusTag';
import styles from './index.less';
const formActions = createFormActions();
const MaintainDetail: React.FC<{}> = () => {
const { pageStatus, id, validateId } = usePageStatus();
const [detailed, setDetailed] = useState<GetMemberAbilityMaintenanceDetailBasicResponse>(null);
const [modalVisible, setModalVisible] = useState(false);
const [infoLoading, setInfoLoaading] = useState(false);
const getDetailed = () => {
if (!id || !validateId) {
return;
}
setInfoLoaading(true);
PublicApi.getMemberAbilityMaintenanceDetailBasic({
memberId: id,
validateId,
}).then(res => {
if (res.code === 1000) {
setDetailed(res.data);
}
}).finally(() => {
setInfoLoaading(false);
});
};
useEffect(() => {
getDetailed();
}, []);
// 冻结与解冻
const handleSubmit = (values: { remark: string }) => {
return PublicApi.postMemberMaintenanceStatus({
memberId: id,
validateId: validateId,
status: detailed && detailed.status === MEMBER_STATUS_NORMAL ? MEMBER_STATUS_FROZEN : MEMBER_STATUS_NORMAL,
remark: values.remark || '',
}).then(res => {
if (res.code === 1000) {
getDetailed();
}
});
};
return (
<Spin spinning={infoLoading}>
<PageHeaderWrapper
title={
<>
<PageHeader
style={{ padding: '0' }}
onBack={() => history.goBack()}
title={
<AvatarWrap
info={{
name: detailed?.name,
}}
extra={(
<span style={{ fontSize: 12, fontWeight: 'normal' }}>{detailed?.levelTag}</span>
)}
/>
}
extra={(
<>
{detailed && detailed.status === MEMBER_STATUS_NORMAL ? (
<Button
icon={<StopOutlined />}
onClick={() => {}}
>
冻结
</Button>
) : (
<Button
type="primary"
icon={<SettingOutlined />}
onClick={() => {}}
>
解冻
</Button>
)}
</>
)}
>
<Descriptions
size="small"
column={3}
style={{
padding: '0 32px',
}}
>
<Descriptions.Item label="会员类型">{detailed?.memberTypeName}</Descriptions.Item>
<Descriptions.Item label="会员角色" span={2}>{detailed?.roleName}</Descriptions.Item>
<Descriptions.Item label="会员状态">
{/* <Tag color={STATUS_COLOR_MAP[1]}>{STATUS_COLOR_TXT[1]}</Tag> */}
<StatusTag type="success" title="正常" />
</Descriptions.Item>
<Descriptions.Item label="外部状态">
<StatusTag type="success" title={detailed?.innerStatusName} />
</Descriptions.Item>
<Descriptions.Item label="内部状态">
<Badge color={STATUS_COLOR_MAP[2]} text={detailed?.outerStatusName} />
</Descriptions.Item>
</Descriptions>
</PageHeader>
</>
}
>
<div
style={{
marginBottom: 24,
}}
>
<AuditProcess
outerVerifySteps={detailed?.outerVerifySteps}
innerVerifySteps={detailed?.innerVerifySteps}
/>
</div>
<BasicInfo
basic={{
account: detailed?.account,
phone: detailed?.phone,
email: detailed?.email,
created: detailed?.createTime,
}}
channel={{
memberType: detailed?.memberTypeEnum,
level: detailed?.channelLevelTag,
type: detailed?.channelTypeName,
areas: detailed?.areas,
desc: detailed?.remark,
}}
extra={detailed?.groups}
outerHistory={detailed?.outerHistory}
innerHistory={detailed?.innerHistory}
/>
<Modal
title={detailed && detailed.status === 1 ? '会员解冻' : '会员冻结'}
visible={modalVisible}
onOk={() => formActions.submit()}
onCancel={() => setModalVisible(false)}
destroyOnClose
>
<NiceForm
previewPlaceholder="' '"
effects={($, { setFieldState }) => {
FormEffectHooks.onFieldInit$('remark').subscribe(state => {
setFieldState('remark', targetState => {
targetState.props.title = `会员${detailed && detailed.status === 1 ? '解冻' : '冻结'}原因`;
});
});
}}
actions={formActions}
schema={auditModalSchema}
onSubmit={handleSubmit}
/>
</Modal>
</PageHeaderWrapper>
</Spin>
);
};
export default MaintainDetail;
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