Commit c0e9859a authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复待提交退货申请单无法选择退货地址的问题

parent 90a73683
......@@ -2,12 +2,12 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-07 13:57:03
* @LastEditTime: 2021-02-04 15:32:24
* @Description: 退货地址信息
*/
import React from 'react';
import React, { useEffect } from 'react';
import MellowCard from '@/components/MellowCard';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { createAsyncFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { useLinkageUtils } from '@/utils/formEffectUtils';
......@@ -15,7 +15,7 @@ import NiceForm from '@/components/NiceForm';
import { schema } from './schema';
import styles from './index.less';
const modalFormActions = createFormActions();
const modalFormActions = createAsyncFormActions();
const {
onFieldValueChange$,
onFieldInputChange$,
......@@ -74,6 +74,25 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
onSubmit,
}) => {
useEffect(() => {
const { setFieldState } = modalFormActions;
if (isEdit) {
setFieldState('deliveryAddress', state => {
state.visible = true;
});
setFieldState('deliveryAddressShow', state => {
state.visible = false;
});
} else {
setFieldState('deliveryAddress', state => {
state.visible = false;
});
setFieldState('deliveryAddressShow', state => {
state.visible = true;
});
}
}, [isEdit]);
const handleSubmit = values => {
};
......@@ -134,14 +153,6 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
onFieldValueChange$('deliveryType').subscribe(fieldState => {
const { name, value } = fieldState;
if (isEdit) {
linkage.show('deliveryAddress');
linkage.hide('deliveryAddressShow');
} else {
linkage.hide('deliveryAddress');
linkage.show('deliveryAddressShow');
}
switch (value) {
// 物流
case 1: {
......
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