ec50b287 by ex

h5

1 parent b74756ac
...@@ -114,18 +114,14 @@ if(isAndroid || isiOS) { ...@@ -114,18 +114,14 @@ if(isAndroid || isiOS) {
114 114
115 } 115 }
116 setupWebViewJavascriptBridge(function(bridge) { 116 setupWebViewJavascriptBridge(function(bridge) {
117 layer.open({
118 content: bridge ,
119 time: 2
120 })
121 if(isAndroid) { 117 if(isAndroid) {
122 bridge.init(function (message, responseCallback) { 118 bridge.init(function (message, responseCallback) {
123 responseCallback({'Javascript Responds': 'Wee!'}) 119 responseCallback({'Javascript Responds': 'Wee!'})
120 appClient = new AppClient(bridge, isAndroid);
124 }) 121 })
125 // appClient = new AppClient(bridge, isAndroid);
126 } 122 }
127 if (isiOS) { 123 if (isiOS) {
128 appClient = new AppClient(bridge, isAndroid); 124 appClient = new AppClient(bridge, false);
129 } 125 }
130 // 此处可以调用一些init的方法 126 // 此处可以调用一些init的方法
131 }); 127 });
......
...@@ -171,12 +171,20 @@ angular.module('myApp') ...@@ -171,12 +171,20 @@ angular.module('myApp')
171 // // log('JS responding with', responseData) 171 // // log('JS responding with', responseData)
172 // // responseCallback(responseData) 172 // // responseCallback(responseData)
173 // }) 173 // })
174 window.WebViewJavascriptBridge.callHandler('getGPS', function (res) { 174 window.WebViewJavascriptBridge.callHandler('getGPS', '', function(res, responseCallback) {
175 var res = JSON.parse(data)
175 layer.open({ 176 layer.open({
176 content: res, 177 content: data,
177 time: 5 178 time: 2
178 }); 179 });
179 }, '') 180 // onSuccess(data)
181 })
182 // window.WebViewJavascriptBridge.callHandler('getGPS', function (res) {
183 // layer.open({
184 // content: res,
185 // time: 5
186 // });
187 // }, '')
180 188
181 }else if(isiOS){ 189 }else if(isiOS){
182 appClient.appObj.registerHandler('postERCode', function(data, responseCallback) { 190 appClient.appObj.registerHandler('postERCode', function(data, responseCallback) {
......
...@@ -298,24 +298,25 @@ angular.module('myApp') ...@@ -298,24 +298,25 @@ angular.module('myApp')
298 // } 298 // }
299 // }); 299 // });
300 if(isAndroid){ 300 if(isAndroid){
301 window.WebViewJavascriptBridge.callHandler('postGPS', '', function(data, responseCallback) { 301 window.WebViewJavascriptBridge.callHandler('getGPS', '', function(res, responseCallback) {
302 var res = JSON.parse(data) 302 var res = JSON.parse(data)
303 layer.open({ 303 layer.open({
304 content: data, 304 content: data,
305 time: 2 305 time: 2
306 }); 306 });
307 onSuccess(data)
307 }) 308 })
308 window.WebViewJavascriptBridge.callHandler.getGPS('getGPS','1', function (res) { 309 // window.WebViewJavascriptBridge.callHandler('getGPS','1', function (res) {
309 // layer.open({ 310 // // layer.open({
310 // content: JSON.stringify(res) + 'cb', 311 // // content: JSON.stringify(res) + 'cb',
311 // time: 10 312 // // time: 10
312 // }); 313 // // });
313 onSuccess({ 314 // // onSuccess({
314 latitude:30.2741500000, 315 // // latitude:30.2741500000,
315 longitude:120.1551500000 316 // // longitude:120.1551500000
316 }) 317 // // })
317 318 //
318 }, '') 319 // }, '')
319 } else if(isiOS){ 320 } else if(isiOS){
320 appClient.appObj.registerHandler('postGPS', function(data, responseCallback) { 321 appClient.appObj.registerHandler('postGPS', function(data, responseCallback) {
321 var res = JSON.parse(data) 322 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!