Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
d085e4cb
Commit
d085e4cb
authored
Feb 22, 2021
by
程智春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
to
parent
731ac6f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
src/pages/changeAdr/index.vue
+60
-0
No files found.
src/pages/changeAdr/index.vue
View file @
d085e4cb
...
@@ -174,6 +174,66 @@
...
@@ -174,6 +174,66 @@
}
}
})
})
}
else
{
wx
.
getLocation
({
type
:
'wgs84'
,
success
:
function
(
res
){
const
latitude
=
res
.
latitude
const
longitude
=
res
.
longitude
console
.
log
(
'定位成功'
,
res
)
changeAdr
.
query_Location_operating_area_area_list
({
location
:
longitude
+
','
+
latitude
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
'200'
){
let
city
=
''
;
res
.
data
.
data
.
forEach
(
item
=>
{
if
(
item
.
operatingAreaAreaId
){
city
=
item
}
})
if
(
city
==
''
){
_this
.
positionCity
=
res
.
data
.
data
[
0
];
}
else
{
_this
.
positionCity
=
city
;
}
_this
.
reLocationStatus
=
false
;
_this
.
locationStatus
=
true
;
}
else
{
wx
.
showModal
({
title
:
'提示'
,
content
:
'定位失败,请检查是否开启了定位服务'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
)
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
_this
.
reLocationStatus
=
false
;
_this
.
locationStatus
=
false
;
}
})
},
fail
:
function
(
err
){
console
.
log
(
'定位失败'
,
err
)
wx
.
showModal
({
title
:
'提示'
,
content
:
'定位失败,请检查是否开启了定位服务'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
)
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
_this
.
reLocationStatus
=
false
;
_this
.
locationStatus
=
false
;
}
})
}
}
},
},
resetPosition
(){
resetPosition
(){
...
...
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