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
cd5cca68
authored
2018-08-25 18:30:01 +0800
by
ex
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
注册事件
1 parent
91adbbbb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
11 deletions
js/JSBridge.js
js/JSBridge.js
View file @
cd5cca6
...
...
@@ -45,6 +45,16 @@ AppClient.prototype.getERCode = function (callbackName, callback, jsonStr) {
this
.
appObj
.
getERCode
(
'H5'
,
jsonStr
);
}
else
{
this
.
appObj
.
callHandler
(
"getERCode"
,
iOSData
,
callback
);
this
.
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)
})
}
};
AppClient
.
prototype
.
getGPS
=
function
(
callbackName
,
callback
,
jsonStr
)
{
...
...
@@ -60,20 +70,28 @@ AppClient.prototype.getGPS = function (callbackName, callback, jsonStr) {
this
.
appObj
.
getGPS
(
'H5'
,
jsonStr
);
}
else
{
this
.
appObj
.
callHandler
(
"getGPS"
,
iOSData
,
callback
);
}
};
window
.
postERCode
=
function
(
_params
)
{
layer
.
open
({
content
:
JSON
.
stringify
(
_params
),
time
:
10
});
}
window
.
postGPS
=
function
(
params
)
{
this
.
appObj
.
registerHandler
(
'postGPS'
,
function
(
data
,
responseCallback
)
{
layer
.
open
({
content
:
JSON
.
stringify
(
_params
),
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. = function (_params) {
//
// }
// window.postGPS = function (params) {
// layer.open({
// content: JSON.stringify(_params),
// time: 10
// });
// }
if
(
window
.
android
)
{
appClient
=
new
AppClient
(
window
.
android
,
true
);
...
...
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