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

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

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