Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
Project
Project
Details
Activity
Releases
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
viitto
mallapp
Commits
9d445368
Commit
9d445368
authored
Sep 23, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
bf713b32
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
90 deletions
+105
-90
index.vue
pages/guidecar/index.vue
+49
-45
place_order.vue
pages/guidecar/place_order.vue
+56
-45
No files found.
pages/guidecar/index.vue
View file @
9d445368
...
...
@@ -267,15 +267,7 @@
this
.
amapPlugin
.
getRegeo
({
success
:
(
data
)
=>
{
console
.
log
(
data
,
'获取当前位置'
)
this
.
address
=
data
[
0
].
name
this
.
Pickcar
=
data
[
0
].
regeocodeData
.
addressComponent
.
city
;
this
.
latitude
=
data
[
0
].
latitude
;
this
.
longitude
=
data
[
0
].
longitude
;
let
parseResult
=
AddressParse
(
this
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
this
.
getDestination
(
nameList
);
uni
.
hideLoading
();
}
});
}
,
...
...
@@ -449,38 +441,27 @@
scope
:
'scope.userLocation'
,
success
()
{
// console.log('前用户发起授权请求')
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
if
(
that
.
latitude
!=
''
&&
that
.
longitude
!=
''
){
that
.
getYLocation
()
}
else
{
that
.
getNLocation
()
}
});
},
fail
()
{
// 用户点击不允许引导重新获取授权
console
.
log
(
'111'
)
that
.
fetchAgainLocation
()
}
})
}
else
{
// 已经授权了就会直接进入地图
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
if
(
that
.
latitude
!=
''
&&
that
.
longitude
!=
''
){
that
.
getYLocation
()
}
else
{
that
.
getNLocation
()
}
});
}
}
})
...
...
@@ -492,7 +473,7 @@
let
that
=
this
wx
.
getSetting
({
success
:
(
res
)
=>
{
console
.
log
()
console
.
log
(
res
)
var
statu
=
res
.
authSetting
;
if
(
!
statu
[
'scope.userLocation'
])
{
wx
.
showModal
({
...
...
@@ -508,18 +489,11 @@
icon
:
'success'
,
duration
:
1000
})
uni
.
chooseLocation
({
latitude
:
this
.
latitude
,
longitude
:
this
.
longitude
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
if
(
that
.
latitude
!=
''
&&
that
.
longitude
!=
''
){
that
.
getYLocation
()
}
else
{
that
.
getNLocation
()
}
});
}
else
{
wx
.
showToast
({
title
:
'授权失败'
,
...
...
@@ -540,6 +514,36 @@
complete
:
()
=>
{}
})
},
getYLocation
(){
console
.
log
(
'you'
)
let
that
=
this
uni
.
chooseLocation
({
longitude
:
that
.
longitude
,
latitude
:
that
.
latitude
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
});
},
getNLocation
(){
console
.
log
(
'no'
)
let
that
=
this
uni
.
chooseLocation
({
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
});
},
getDestination
(
nameList
)
{
this
.
request2
(
{
...
...
pages/guidecar/place_order.vue
View file @
9d445368
...
...
@@ -531,22 +531,12 @@
scope
:
'scope.userLocation'
,
success
()
{
// console.log('前用户发起授权请求')
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
if
(
that
.
isShowStart
==
1
){
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
msg
.
ShoppingAddress
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
msg
.
ShoppingAddress
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
if
(
that
.
latitude
!=
''
&&
that
.
longitude
!=
''
){
that
.
getYLocation
()
}
else
{
that
.
orderMsg
.
DestinationAddress
=
res
.
address
;
that
.
getNLocation
()
}
}
});
},
fail
()
{
// 用户点击不允许引导重新获取授权
...
...
@@ -555,23 +545,12 @@
})
}
else
{
// 已经授权了就会直接进入地图
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
if
(
that
.
isShowStart
==
1
){
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
msg
.
ShoppingAddress
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
msg
.
ShoppingAddress
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
if
(
that
.
latitude
!=
''
&&
that
.
longitude
!=
''
){
that
.
getYLocation
()
}
else
{
that
.
orderMsg
.
DestinationAddress
=
res
.
address
;
that
.
getNLocation
()
}
}
});
}
}
})
...
...
@@ -597,18 +576,12 @@
icon
:
'success'
,
duration
:
1000
})
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
if
(
that
.
latitude
!=
''
&&
that
.
longitude
!=
''
){
that
.
getYLocation
()
}
else
{
that
.
getNLocation
()
}
});
}
else
{
wx
.
showToast
({
title
:
'授权失败'
,
...
...
@@ -629,6 +602,44 @@
complete
:
()
=>
{}
})
},
getYLocation
(){
console
.
log
(
'you'
)
let
that
=
this
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
if
(
that
.
isShowStart
==
1
){
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
msg
.
ShoppingAddress
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
msg
.
ShoppingAddress
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
else
{
that
.
orderMsg
.
DestinationAddress
=
res
.
address
;
}
}
});
},
getNLocation
(){
console
.
log
(
'no'
)
let
that
=
this
uni
.
chooseLocation
({
success
:
function
(
res
)
{
if
(
that
.
isShowStart
==
1
){
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
msg
.
ShoppingAddress
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
msg
.
ShoppingAddress
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
else
{
that
.
orderMsg
.
DestinationAddress
=
res
.
address
;
}
}
});
},
//获取数据
getData
()
{
this
.
request2
({
...
...
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