Commit 64adc16c authored by 李腾's avatar 李腾

fix: 修复地址提醒展示问题

parent c11ebaeb
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre'; const isPre = process.env.PRE_ENV === 'pre';
const environment = 'sc'; const environment = 'yxm2';
const envAPi = { const envAPi = {
api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net', api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net',
kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`, kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`,
......
...@@ -82,20 +82,23 @@ const FormSearch = props => { ...@@ -82,20 +82,23 @@ const FormSearch = props => {
// 选择日期范围类型 // 选择日期范围类型
const FormItemRangePicker = config => { const FormItemRangePicker = config => {
const { originOptions = {}, bindKey, rangeNum, rangeUnit } = config; const { originOptions = {}, bindKey, limit } = config;
const attrs = { placeholder: ['开始日期', '结束日期'], ...originOptions }; const attrs = { placeholder: ['开始日期', '结束日期'], ...originOptions };
// 自动截取日期限制的范围 // 自动截取日期限制的范围
const onOpenChange = open => { const onOpenChange = open => {
if (!open) { if (!open) {
const [date1, date2] = form.getFieldValue(bindKey); if (limit) {
const diffNum = date2.diff(date1, 'months'); const { rangeNum, rangeUnit } = limit;
if (diffNum >= 3) { const [date1, date2] = form.getFieldValue(bindKey);
setTimeout(() => { const diffNum = date2.diff(date1, rangeNum);
form.setFieldsValue({ if (diffNum >= rangeNum) {
[bindKey]: [moment(date1), moment(date1).add(3, 'month')], setTimeout(() => {
form.setFieldsValue({
[bindKey]: [moment(date1), moment(date1).add(3, 'month')],
});
}); });
}); }
} }
} }
}; };
......
...@@ -134,6 +134,10 @@ export const getFormConfig = (props = {}) => { ...@@ -134,6 +134,10 @@ export const getFormConfig = (props = {}) => {
label: '售后日期', label: '售后日期',
column: 5, column: 5,
bindKey: 'afterTime', bindKey: 'afterTime',
limit: {
rangeNum: 3,
rangeUnit: 'months',
},
originOptions: { originOptions: {
placeholder: ['开始日期', '结束日期'], placeholder: ['开始日期', '结束日期'],
allowClear: false, allowClear: false,
......
...@@ -188,19 +188,18 @@ const TableList = props => { ...@@ -188,19 +188,18 @@ const TableList = props => {
width: 150, width: 150,
render: (_, record) => { render: (_, record) => {
const { updateAddressList, platformRemark } = record; const { updateAddressList, platformRemark } = record;
let addressData; // let addressData;
if (updateAddressList) { // if (updateAddressList) {
addressData = updateAddressList.pop(); // addressData = updateAddressList.pop();
} // }
const content = () =>
updateAddressList?.map(item => (
<PopoverNotice time={item?.time} content={item?.content} />
));
return ( return (
<div className={style['notice-btn']}> <div className={style['notice-btn']}>
{updateAddressList ? ( {updateAddressList ? (
<Popover <Popover placement="top" title="收货地址变更" content={content()} trigger="hover">
placement="top"
title="收货地址变更"
content={<PopoverNotice time={addressData?.time} content={addressData?.content} />}
trigger="hover"
>
<Button block type="primary"> <Button block type="primary">
收货地址变更 收货地址变更
</Button> </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