Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
dy-wx2
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1cffe74c
authored
2018-09-08 17:20:58 +0800
by
ex
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
无法获取定位提示
1 parent
5cf7468e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
js/JSBridge.js
js/JSBridge.js
View file @
1cffe74
...
...
@@ -53,41 +53,42 @@ AppClient.prototype.getERCode = function (jsonStr, callback) {
from
:
'H5'
,
params
:
dataParams
};
var
isRes
=
false
if
(
this
.
isAndroid
)
{
window
.
WebViewJavascriptBridge
.
callHandler
(
'getERCode'
,
jsonStr
);
window
.
WebViewJavascriptBridge
.
registerHandler
(
'postERCode'
,
callback
);
window
.
WebViewJavascriptBridge
.
registerHandler
(
'postERCode'
,
function
(
data
,
responseCallback
)
{
isRes
=
true
var
latitude
=
''
var
longitude
=
''
var
result
=
/
\{([\s\S]
*
)\}
/
.
exec
(
data
);
var
arr
=
result
[
1
].
split
(
','
)
latitude
=
arr
[
0
].
split
(
'='
)[
1
]
longitude
=
arr
[
1
].
split
(
'='
)[
1
]
callback
(
latitude
,
longitude
,
responseCallback
)
})
}
else
{
var
isRes
=
false
this
.
appObj
.
registerHandler
(
"postERCOde"
,
function
(
data
,
responseCallback
)
{
isRes
=
true
var
latitude
=
''
var
longitude
=
''
var
result
=
/
\{([\s\S]
*
)\}
/
.
exec
(
data
);
var
arr
=
result
[
1
].
split
(
','
)
if
(
isAndroid
){
latitude
=
arr
[
0
].
split
(
'='
)[
1
]
longitude
=
arr
[
1
].
split
(
'='
)[
1
]
}
else
{
latitude
=
arr
[
0
].
split
(
':'
)[
1
]
longitude
=
arr
[
1
].
split
(
':'
)[
1
]
}
latitude
=
arr
[
0
].
split
(
':'
)[
1
]
longitude
=
arr
[
1
].
split
(
':'
)[
1
]
callback
(
latitude
,
longitude
,
responseCallback
)
})
this
.
appObj
.
callHandler
(
"getERCode"
,
param
,
function
(
data
,
responseCallback
)
{
});
setTimeout
(
function
()
{
if
(
!
isRes
){
layer
.
open
({
content
:
'无法获取定位信息,检查定位设置,或重新开发'
})
callback
(
30.2741500000
,
120.1551500000
,
function
(){})
}
},
3000
)
}
setTimeout
(
function
()
{
if
(
!
isRes
){
layer
.
open
({
content
:
'无法获取定位信息,检查定位设置,或重新开发'
})
callback
(
30.2741500000
,
120.1551500000
,
function
(){})
}
},
3000
)
};
AppClient
.
prototype
.
getGPS
=
function
(
jsonStr
,
callback
)
{
var
dataParams
=
""
;
...
...
Write
Preview
Styling with
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