Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
70bfa8b4
Commit
70bfa8b4
authored
Jan 12, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化门店经纬度定位
parent
f2126191
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
index.jsx
src/components/GaoDeMap/index.jsx
+1
-3
storeModal.jsx
src/pages/chainStoreManage/components/storeModal.jsx
+18
-1
No files found.
src/components/GaoDeMap/index.jsx
View file @
70bfa8b4
...
@@ -34,11 +34,9 @@ export default props => {
...
@@ -34,11 +34,9 @@ export default props => {
const
geocoder
=
new
window
.
AMap
.
Geocoder
({
const
geocoder
=
new
window
.
AMap
.
Geocoder
({
city
,
city
,
});
});
geocoder
.
getLocation
(
addrInfo
.
address
,
(
status
,
result
)
=>
{
geocoder
.
getLocation
(
addrInfo
.
address
,
(
status
,
result
)
=>
{
if
(
status
===
'
complete
'
&&
result
.
geocodes
.
length
)
{
if
(
status
===
'
complete
'
&&
result
.
geocodes
.
length
)
{
const
{
lng
,
lat
}
=
result
.
geocodes
[
0
].
location
;
const
{
lng
,
lat
}
=
result
.
geocodes
[
0
].
location
;
console
.
log
(
result
.
geocodes
[
0
].
location
);
setLnglat
([
lng
,
lat
]);
setLnglat
([
lng
,
lat
]);
setLnglatText
(
`
${
lng
}
,
${
lat
}
`
);
setLnglatText
(
`
${
lng
}
,
${
lat
}
`
);
}
else
{
}
else
{
...
@@ -73,7 +71,7 @@ export default props => {
...
@@ -73,7 +71,7 @@ export default props => {
created
:
getPoint
,
created
:
getPoint
,
click
:
onGetPoint
,
click
:
onGetPoint
,
}
}
}
}
zoom=
{
1
5
}
zoom=
{
1
4
}
>
>
<
Marker
position=
{
lnglat
}
></
Marker
>
<
Marker
position=
{
lnglat
}
></
Marker
>
</
Map
>
</
Map
>
...
...
src/pages/chainStoreManage/components/storeModal.jsx
View file @
70bfa8b4
...
@@ -76,6 +76,22 @@ const StoreModal = props => {
...
@@ -76,6 +76,22 @@ const StoreModal = props => {
});
});
};
};
const
getAreas
=
arr
=>
{
let
areas
=
areaAddr
;
let
addr
=
''
;
arr
.
forEach
(
c
=>
{
let
index
=
0
;
areas
.
forEach
((
item
,
i
)
=>
{
if
(
item
.
value
===
c
)
{
addr
+=
item
.
label
;
index
=
i
;
}
});
areas
=
areas
[
index
].
children
;
});
return
addr
;
};
// 显示地图
// 显示地图
const
openMap
=
v
=>
{
const
openMap
=
v
=>
{
const
values
=
getFieldsValue
();
const
values
=
getFieldsValue
();
...
@@ -96,9 +112,10 @@ const StoreModal = props => {
...
@@ -96,9 +112,10 @@ const StoreModal = props => {
}
}
});
});
}
}
const
labels
=
getAreas
(
values
.
addr
);
setMapInfo
({
setMapInfo
({
provice
,
provice
,
address
:
values
.
address
,
address
:
labels
+
values
.
address
,
});
});
setVisibleMap
(
v
);
setVisibleMap
(
v
);
};
};
...
...
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