Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
前端-吴智勇
jinfa-platform
Commits
ad4bec1b
Commit
ad4bec1b
authored
Feb 24, 2022
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复首次编辑地址省市区信息出不来的问题
parent
97b29fd4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
index.tsx
src/components/AddressSelect/index.tsx
+20
-18
No files found.
src/components/AddressSelect/index.tsx
View file @
ad4bec1b
...
...
@@ -563,27 +563,29 @@ const AddressSelect: React.FC<AddressSelectProps> = (props) => {
});
const
res
=
addressType
===
2
?
await
getLogisticsShipperAddressGet
({
id
:
`
${
id
}
`
})
:
await
getLogisticsReceiverAddressGet
({
id
:
`
${
id
}
`
});
if
(
res
.
code
===
1000
)
{
formActions
.
setFieldValue
(
'name'
,
addressType
===
2
?
(
res
.
data
as
GetLogisticsShipperAddressGetResponse
).
shipperName
:
(
res
.
data
as
GetLogisticsReceiverAddressGetResponse
).
receiverName
);
formActions
.
setFieldValue
(
'provinceCode'
,
res
.
data
.
provinceCode
);
formActions
.
setFieldValue
(
'cityCode'
,
res
.
data
.
cityCode
);
formActions
.
setFieldValue
(
'districtCode'
,
res
.
data
.
districtCode
);
formActions
.
setFieldValue
(
'streetCode'
,
res
.
data
.
streetCode
);
formActions
.
setFieldValue
(
'detailed'
,
res
.
data
.
address
);
formActions
.
setFieldValue
(
'postalCode'
,
res
.
data
.
postalCode
);
formActions
.
setFieldValue
(
'areaCode'
,
res
.
data
.
areaCode
);
formActions
.
setFieldValue
(
'phone'
,
res
.
data
.
phone
);
formActions
.
setFieldValue
(
'tel'
,
res
.
data
.
tel
);
formActions
.
setFieldValue
(
'isDefault'
,
res
.
data
.
isDefault
);
formActions
.
setFieldState
(
'ADDRESS_NEW'
,
state
=>
{
state
.
visible
=
true
;
});
formActions
.
setFieldState
(
'ADD_ACTION'
,
state
=>
{
state
.
props
[
'x-component-props'
]
=
{
flag
:
false
,
};
});
editAddressId
.
current
=
id
;
setTimeout
(()
=>
{
formActions
.
setFieldValue
(
'name'
,
addressType
===
2
?
(
res
.
data
as
GetLogisticsShipperAddressGetResponse
).
shipperName
:
(
res
.
data
as
GetLogisticsReceiverAddressGetResponse
).
receiverName
);
formActions
.
setFieldValue
(
'provinceCode'
,
res
.
data
.
provinceCode
);
formActions
.
setFieldValue
(
'cityCode'
,
res
.
data
.
cityCode
);
formActions
.
setFieldValue
(
'districtCode'
,
res
.
data
.
districtCode
);
formActions
.
setFieldValue
(
'streetCode'
,
res
.
data
.
streetCode
);
formActions
.
setFieldValue
(
'detailed'
,
res
.
data
.
address
);
formActions
.
setFieldValue
(
'postalCode'
,
res
.
data
.
postalCode
);
formActions
.
setFieldValue
(
'areaCode'
,
res
.
data
.
areaCode
);
formActions
.
setFieldValue
(
'phone'
,
res
.
data
.
phone
);
formActions
.
setFieldValue
(
'tel'
,
res
.
data
.
tel
);
formActions
.
setFieldValue
(
'isDefault'
,
res
.
data
.
isDefault
);
formActions
.
setFieldState
(
'ADD_ACTION'
,
state
=>
{
state
.
props
[
'x-component-props'
]
=
{
flag
:
false
,
};
});
editAddressId
.
current
=
id
;
},
20
);
}
else
{
message
.
warn
(
intl
.
formatMessage
({
id
:
'components.huoqudizhixinxishibai'
},
{
default
:
'获取地址信息失败'
}));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment