Commit c346b1e3 authored by GuanHua's avatar GuanHua

fix: 修复在线结算无收获地址情况下,页面一直在加载状态的问题

parent f7616513
......@@ -7,11 +7,12 @@ import { GetLogisticsReceiverAddressPageResponseDetail, GetLogisticsReceiverAddr
import styles from './index.less'
interface AddressPropsType {
onChange: Function
onChange: Function,
onHideLoading?: Function,
}
const Address: React.FC<AddressPropsType> = (props) => {
const { onChange } = props
const { onChange, onHideLoading } = props
const [selectKey, setSelectKey] = useState<number>()
const [expand, setExpand] = useState<boolean>(false)
const [addressFormVisible, setAddressFormVisible] = useState<boolean>(false)
......@@ -47,9 +48,12 @@ const Address: React.FC<AddressPropsType> = (props) => {
}
}
if (selectItem) {
setSelectKey(selectItem.id)
const res = await PublicApi.getLogisticsReceiverAddressGet({ id: selectItem.id })
onChange(Object.assign(selectItem, res.data))
} else {
onHideLoading()
}
}
......
......@@ -535,9 +535,12 @@ const Order: React.FC<OrderPropsType> = (props) => {
<div className={styles.order_container}>
{
orderInfo.logistics.deliveryType === 1 && (
<Address onChange={(selectItem) => {
setSelectAddressInfo(selectItem)
}} />
<Address
onChange={(selectItem) => {
setSelectAddressInfo(selectItem)
}}
onHideLoading={() => setSpinningState(false)}
/>
)
}
<PayWay supplyMembersId={orderInfo.supplyMembersId} deliveryType={orderInfo.logistics.deliveryType} supplyMembersRoleId={orderInfo.supplyMembersRoleId} selectItem={selectPayWay} payWayList={orderInfo.payWayList} onChange={(val) => setSelectPayWay(val)} />
......
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