50a98b3e by ex

h5 2

1 parent 9f0d88d7
...@@ -111,7 +111,7 @@ if(isAndroid || isiOS) { ...@@ -111,7 +111,7 @@ if(isAndroid || isiOS) {
111 } 111 }
112 setupWebViewJavascriptBridge(function(bridge) { 112 setupWebViewJavascriptBridge(function(bridge) {
113 if(isAndroid) { 113 if(isAndroid) {
114 appClient = new AppClient(bridge, isAndroid); 114 // appClient = new AppClient(bridge, isAndroid);
115 } 115 }
116 if (isiOS) { 116 if (isiOS) {
117 appClient = new AppClient(bridge, isAndroid); 117 appClient = new AppClient(bridge, isAndroid);
......
...@@ -163,6 +163,7 @@ angular.module('myApp') ...@@ -163,6 +163,7 @@ angular.module('myApp')
163 content: appClient, 163 content: appClient,
164 time: 5 164 time: 5
165 }) 165 })
166
166 if(appClient){ 167 if(appClient){
167 appClient.appObj.registerHandler('postERCode', function(data, responseCallback) { 168 appClient.appObj.registerHandler('postERCode', function(data, responseCallback) {
168 layer.open({ 169 layer.open({
......
...@@ -297,8 +297,26 @@ angular.module('myApp') ...@@ -297,8 +297,26 @@ angular.module('myApp')
297 // onSuccess(res) 297 // onSuccess(res)
298 // } 298 // }
299 // }); 299 // });
300 if(isAndroid){
301 window.WebViewJavascriptBridge.callHandler('postGPS', '', function(data, responseCallback) {
302 var res = JSON.parse(data)
303 layer.open({
304 content: data,
305 time: 2
306 });
307 })
308 appClient.getGPS('getGPS', function (res) {
309 // layer.open({
310 // content: JSON.stringify(res) + 'cb',
311 // time: 10
312 // });
313 onSuccess({
314 latitude:30.2741500000,
315 longitude:120.1551500000
316 })
300 317
301 if(appClient){ 318 }, '')
319 } else if(appClient){
302 appClient.appObj.registerHandler('postGPS', function(data, responseCallback) { 320 appClient.appObj.registerHandler('postGPS', function(data, responseCallback) {
303 var res = JSON.parse(data) 321 var res = JSON.parse(data)
304 layer.open({ 322 layer.open({
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!