Commit a475898a authored by XieZhiXiong's avatar XieZhiXiong

feat: 对接 入库协议 相关

parent 5fd3a53d
@import '~antd/es/style/themes/default.less';
.agreement {
padding: @padding-lg @padding-md;
background-color: #FFFFFF;
}
\ No newline at end of file
......@@ -6,10 +6,19 @@
* @Description: 入库协议
*/
import React from 'react';
import styles from './index.less';
const ComingAgreement: React.FC = () => {
interface IProps {
/**
* 协议
*/
richText: string,
}
const ComingAgreement: React.FC<IProps> = (props: IProps) => {
const { richText } = props;
return (
<div>这里是入库协议</div>
<div className={styles.agreement} dangerouslySetInnerHTML={{ __html: richText }} />
);
};
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-26 16:52:48
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-07 12:01:36
* @LastEditTime: 2021-06-07 14:12:47
* @Description: 申请会员
*/
import React, { useState, useEffect, useRef } from 'react';
......@@ -82,6 +82,8 @@ const MemberQueryApplyMember: React.FC = () => {
const [unsaved, setUnsaved] = useState(false);
const [depositInfo, setDepositInfo] = useState<GroupItem[]>([]);
const [loading, setLoading] = useState(false);
const [agreement, setAgreement] = useState('');
const [agreementLoading, setAgreementLoading] = useState(false);
const stepRef = useRef(!validateId ? 0 : 1);
......@@ -99,17 +101,6 @@ const MemberQueryApplyMember: React.FC = () => {
}, 1000);
};
useEffect(() => {
if (!validateId) {
countDown();
}
return () => {
if (timer) {
clearTimeout(timer);
}
}
}, []);
// 新增操作
// 根据上级会员id 角色id 获取入库资料相关
const getDepositInfo = async () => {
......@@ -143,9 +134,31 @@ const MemberQueryApplyMember: React.FC = () => {
setLoading(false);
};
// 获取入库协议
const getDepositAgreement = async () => {
setAgreementLoading(true);
const res = await PublicApi.getManageContentNoticeFindAllByColumnType({
columnType: `${3}`,
});
if (res.code === 1000) {
setAgreement(res.data && res.data.length ? res.data[0].content : '');
}
setAgreementLoading(false);
countDown();
};
useEffect(() => {
return () => {
if (timer) {
clearTimeout(timer);
}
}
}, []);
useEffect(() => {
getDepositInfo();
getDepositInfoByValidateId();
getDepositAgreement();
}, []);
const handleSubmit = (values: ValueType) => {
......@@ -202,7 +215,7 @@ const MemberQueryApplyMember: React.FC = () => {
};
return (
<Spin spinning={loading}>
<Spin spinning={loading || agreementLoading}>
<PageHeaderWrapper
style={{
padding: 24,
......@@ -246,11 +259,11 @@ const MemberQueryApplyMember: React.FC = () => {
) : null}
{currenStep === 2 ? (
<>
<Button
{/* <Button
onClick={() => {}}
>
保存为草稿
</Button>
</Button> */}
<Button
onClick={() => {
formActions.dispatch('onStepPrevious', {})
......@@ -271,11 +284,11 @@ const MemberQueryApplyMember: React.FC = () => {
) : null}
{currenStep === 3 ? (
<>
<Button
{/* <Button
onClick={() => {}}
>
保存为草稿
</Button>
</Button> */}
<Button
onClick={() => {
formActions.dispatch('onStepPrevious', {})
......@@ -311,7 +324,7 @@ const MemberQueryApplyMember: React.FC = () => {
}}
expressionScope={{
currenStep,
ComingAgreement: <ComingAgreement />,
ComingAgreement: <ComingAgreement richText={agreement} />,
RegisterInfo: <RegisterInfo upperMemberId={upperMemberId} upperRoleId={upperRoleId} />,
SubmitSuccess: <SubmitSuccess />,
}}
......
......@@ -18,15 +18,8 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import { PublicApi } from '@/services/api';
import {
MEMBER_LEVEL_TYPE_PLATFORM,
MEMBER_LEVEL_TYPE_MERCHANT,
MEMBER_LEVEL_TYPE_CHANNEL,
MEMBER_OUTER_STATUS_FAILED,
} from '@/constants/member';
import useSpliceArray from '@/hooks/useSpliceArray';
import { querySchema } from './schema';
import { coverColFiltersItem } from '../utils';
import {
MEMBER_OUTER_STATUS_BADGE_COLOR,
} from '../constant';
......
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