Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b79508d9
authored
May 23, 2026
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 更新地址获取接口及数据解析逻辑
1 parent
963245e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
packageEquity/pages/recruitManage/recruitInsert/recruitInsert.js
packageEquity/pages/recruitManage/recruitInsert/recruitInsert.js
View file @
b79508d
...
@@ -75,20 +75,23 @@ Page({
...
@@ -75,20 +75,23 @@ Page({
// 获取高德省市数据
// 获取高德省市数据
initRegionData
()
{
initRegionData
()
{
// const res = await mapApi.detailedAdrress([latitude, longitude])
wx
.
request
({
wx
.
request
({
url
:
'https://
restapi.amap.com/v3/config/district?key=d22348363c34c266f772ae9b635eef2a&subdistrict
=2'
,
url
:
'https://
eshield.didihu.com.cn/nesi/apiRegion/search?keyword=中国&extensions_code=1&sub_admin
=2'
,
method
:
'GET'
,
method
:
'GET'
,
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
if
(
res
.
data
&&
res
.
data
.
status
===
'1'
&&
res
.
data
.
districts
.
length
>
0
)
{
const
obj
=
JSON
.
parse
(
res
.
data
.
data
)
const
countryData
=
res
.
data
.
districts
[
0
].
districts
||
[];
if
(
obj
&&
obj
.
status
==
'0'
&&
obj
.
districts
.
length
>
0
)
{
const
countryData
=
obj
.
districts
[
0
].
districts
||
[];
// 格式化省份数据
// 格式化省份数据
const
provinces
=
countryData
.
map
(
p
=>
({
const
provinces
=
countryData
.
map
(
p
=>
({
name
:
p
.
name
,
name
:
p
.
name
,
adcode
:
p
.
ad
code
,
adcode
:
p
.
code
,
cities
:
p
.
districts
?
p
.
districts
.
map
(
c
=>
({
cities
:
p
.
districts
?
p
.
districts
.
map
(
c
=>
({
name
:
c
.
name
,
name
:
c
.
name
,
adcode
:
c
.
ad
code
adcode
:
c
.
code
}))
:
[]
}))
:
[]
}));
}));
...
@@ -187,7 +190,8 @@ Page({
...
@@ -187,7 +190,8 @@ Page({
const
provinceCode
=
province
?
province
.
adcode
:
''
;
const
provinceCode
=
province
?
province
.
adcode
:
''
;
const
cityCode
=
city
?
city
.
adcode
:
''
;
const
cityCode
=
city
?
city
.
adcode
:
''
;
const
addressStr
=
provinceName
===
cityName
?
provinceName
:
`
${
provinceName
}${
cityName
}
`
;
// const addressStr = provinceName === cityName ? provinceName : `${provinceName}${cityName}`;
const
addressStr
=
`
${
provinceName
}${
cityName
}
`
;
const
addressCode
=
`
${
provinceCode
}
/
${
cityCode
}
`
;
const
addressCode
=
`
${
provinceCode
}
/
${
cityCode
}
`
;
formList
[
FORM_FIELDS
.
ADDRESS
].
value
=
addressCode
;
formList
[
FORM_FIELDS
.
ADDRESS
].
value
=
addressCode
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment