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
d7627360
authored
2018-09-01 16:22:05 +0800
by
ex
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
h5
1 parent
4e46c07e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
19 deletions
js/JSBridge.js
js/controller/mainController.js
js/controller/mapController.js
js/JSBridge.js
View file @
d762736
...
...
@@ -14,11 +14,12 @@ function isJson(str) {
return
true
;
}
function
toJson
(
str
)
{
var
i
=
str
.
index
(
'"{'
)
try
{
var
arr
=
str
.
split
(
2
,
str
.
length
-
4
)
console
.
log
(
arr
)
}
catch
(
e
)
{
return
''
return
{}
}
}
// window.invokeJsPassCompanyCodeAndName = function(_params) {
...
...
js/controller/mainController.js
View file @
d762736
...
...
@@ -161,24 +161,23 @@ angular.module('myApp')
if
(
isAndroid
){
// appClient.appObj.registerHandler('postERCode', function(data, responseCallback) {
// layer.open({
// content: JSON.stringify(data),
// time: 10
// });
// // log('ObjC called testJavascriptHandler with', data)
// // var responseData = { 'Javascript Says':'Right back atcha!' }
// // log('JS responding with', responseData)
// // responseCallback(responseData)
// })
window
.
WebViewJavascriptBridge
.
callHandler
(
'getGPS'
,
''
,
function
(
res
,
responseCallback
)
{
// var data = JSON.parse(res
window
.
WebViewJavascriptBridge
.
registerHandler
(
'postERCode'
,
function
(
data
,
responseCallback
)
{
// layer.open({
// content: JSON.stringify(data),
// time: 10
// });
layer
.
open
({
content
:
res
,
time
:
2
content
:
data
,
time
:
10
});
// onSuccess(data)
// log('ObjC called testJavascriptHandler with', data)
// var responseData = { 'Javascript Says':'Right back atcha!' }
// log('JS responding with', responseData)
// responseCallback(responseData)
})
window
.
WebViewJavascriptBridge
.
callHandler
(
'getERCode'
,
function
(
data
,
responseCallback
)
{
})
// window.WebViewJavascriptBridge.callHandler('getGPS', function (res) {
// layer.open({
// content: res,
...
...
@@ -197,7 +196,7 @@ angular.module('myApp')
// log('JS responding with', responseData)
// responseCallback(responseData)
})
appClient
.
getERCode
(
'
pos
tERCode'
,
function
(
res
)
{
appClient
.
getERCode
(
'
ge
tERCode'
,
function
(
res
)
{
// layer.open({
// content: JSON.stringify(res) + 'cb',
// time: 10
...
...
js/controller/mapController.js
View file @
d762736
...
...
@@ -298,10 +298,19 @@ angular.module('myApp')
// }
// });
if
(
isAndroid
){
// window.WebViewJavascriptBridge.callHandler('getGPS', '', function(res, responseCallback) {
// var res = JSON.parse(data)
// layer.open({
// content: data,
// time: 2
// });
// onSuccess(data)
// })
window
.
WebViewJavascriptBridge
.
callHandler
(
'getGPS'
,
''
,
function
(
res
,
responseCallback
)
{
var
res
=
JSON
.
parse
(
data
)
// var data = JSON.parse(res
// var data = eval(res)
layer
.
open
({
content
:
data
,
content
:
res
,
time
:
2
});
onSuccess
(
data
)
...
...
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