Commit d8eb6e95 authored by XieZhiXiong's avatar XieZhiXiong

feat: 去掉HOC形式,改为hook + component

parent 8c2a0c4d
......@@ -12,9 +12,10 @@ import {
} from '@ant-design/icons';
import { history, useIntl } from 'umi';
import { usePageStatus } from '@/hooks/usePageStatus';
import { useHttpRequest } from '@/hooks/useHttpRequest';
import { postMemberDepositClassify, getMemberDepositClassifyDetail } from '@/services/MemberV2Api';
import fetchDetailHoc from '../common/hoc/fetchDetailHoc';
import MemberProfile from '../components/MemberProfile';
import { IRequestSuccess } from '@/index';
import MemberProfile, { DetailType } from '../components/MemberProfile';
import { MemberDocCategoryProRef, MemberDocCategoryProProps, SubmitValueType } from '../components/MemberDocCategoryPro';
import VerifyModal, { ValueType as VerifyData } from '../components/VerifyModal';
......@@ -28,6 +29,17 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
const intl = useIntl();
const fetchDetail = (): Promise<IRequestSuccess<DetailType>> => (
getMemberDepositClassifyDetail({
validateId,
})
);
const {
data: dataSource,
loading,
} = useHttpRequest<DetailType>(fetchDetail, { manual: false });
const handleVisibleVerifyModal = (flag?) => {
setVisibleVerifyModal(!!flag);
};
......@@ -58,12 +70,6 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
});
};
const MemberProfilePro = fetchDetailHoc({
fetchDetail: () => getMemberDepositClassifyDetail({
validateId,
}),
}, MemberProfile);
const handleVerify = () => {
categoryFormRef?.current.submit();
};
......@@ -74,7 +80,9 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
};
return (
<MemberProfilePro
<MemberProfile
dataSource={dataSource}
loading={loading}
extra={() => (
<>
<Button
......
......@@ -12,9 +12,10 @@ import {
} from '@ant-design/icons';
import { history, useIntl } from 'umi';
import { usePageStatus } from '@/hooks/usePageStatus';
import { useHttpRequest } from '@/hooks/useHttpRequest';
import { postMemberDepositClassify, getMemberDepositClassifyDetail } from '@/services/MemberV2Api';
import fetchDetailHoc from '../common/hoc/fetchDetailHoc';
import MemberProfile from '../components/MemberProfile';
import { IRequestSuccess } from '@/index';
import MemberProfile, { DetailType } from '../components/MemberProfile';
import { MemberDocCategoryProRef, MemberDocCategoryProProps, SubmitValueType } from '../components/MemberDocCategoryPro';
import VerifyModal, { ValueType as VerifyData } from '../components/VerifyModal';
......@@ -29,6 +30,17 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
const intl = useIntl();
const fetchDetail = (): Promise<IRequestSuccess<DetailType>> => (
getMemberDepositClassifyDetail({
validateId,
})
);
const {
data: dataSource,
loading,
} = useHttpRequest<DetailType>(fetchDetail, { manual: false });
const handleVisibleVerifyModal = (flag?) => {
setVisibleVerifyModal(!!flag);
};
......@@ -59,12 +71,6 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
});
};
const MemberProfilePro = fetchDetailHoc({
fetchDetail: () => getMemberDepositClassifyDetail({
validateId,
}),
}, MemberProfile);
const handleVerify = () => {
categoryFormRef?.current.submit();
};
......@@ -75,7 +81,9 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
};
return (
<MemberProfilePro
<MemberProfile
dataSource={dataSource}
loading={loading}
extra={() => (
<>
<Button
......
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