ec50b287 by ex

h5

1 parent b74756ac
......@@ -114,18 +114,14 @@ if(isAndroid || isiOS) {
}
setupWebViewJavascriptBridge(function(bridge) {
layer.open({
content: bridge ,
time: 2
})
if(isAndroid) {
bridge.init(function (message, responseCallback) {
responseCallback({'Javascript Responds': 'Wee!'})
appClient = new AppClient(bridge, isAndroid);
})
// appClient = new AppClient(bridge, isAndroid);
}
if (isiOS) {
appClient = new AppClient(bridge, isAndroid);
appClient = new AppClient(bridge, false);
}
// 此处可以调用一些init的方法
});
......
......@@ -171,12 +171,20 @@ angular.module('myApp')
// // log('JS responding with', responseData)
// // responseCallback(responseData)
// })
window.WebViewJavascriptBridge.callHandler('getGPS', function (res) {
window.WebViewJavascriptBridge.callHandler('getGPS', '', function(res, responseCallback) {
var res = JSON.parse(data)
layer.open({
content: res,
time: 5
content: data,
time: 2
});
}, '')
// onSuccess(data)
})
// window.WebViewJavascriptBridge.callHandler('getGPS', function (res) {
// layer.open({
// content: res,
// time: 5
// });
// }, '')
}else if(isiOS){
appClient.appObj.registerHandler('postERCode', function(data, responseCallback) {
......
......@@ -298,24 +298,25 @@ angular.module('myApp')
// }
// });
if(isAndroid){
window.WebViewJavascriptBridge.callHandler('postGPS', '', function(data, responseCallback) {
window.WebViewJavascriptBridge.callHandler('getGPS', '', function(res, responseCallback) {
var res = JSON.parse(data)
layer.open({
content: data,
time: 2
});
onSuccess(data)
})
window.WebViewJavascriptBridge.callHandler.getGPS('getGPS','1', function (res) {
// layer.open({
// content: JSON.stringify(res) + 'cb',
// time: 10
// });
onSuccess({
latitude:30.2741500000,
longitude:120.1551500000
})
}, '')
// window.WebViewJavascriptBridge.callHandler('getGPS','1', function (res) {
// // layer.open({
// // content: JSON.stringify(res) + 'cb',
// // time: 10
// // });
// // onSuccess({
// // latitude:30.2741500000,
// // longitude:120.1551500000
// // })
//
// }, '')
} else if(isiOS){
appClient.appObj.registerHandler('postGPS', function(data, responseCallback) {
var res = JSON.parse(data)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!