449137bf by ex

获取定位

1 parent b124e651
...@@ -113,10 +113,17 @@ angular.module('myApp') ...@@ -113,10 +113,17 @@ angular.module('myApp')
113 // return; 113 // return;
114 // } 114 // }
115 $rootScope.openScan = false; 115 $rootScope.openScan = false;
116 console.log(appClient) 116 if(appClient){
117 appClient.getERCode('getERCode', function (res) { 117 appClient.getERCode('getERCode', function (res) {
118 alert(JSON.parse(res)) 118 alert(JSON.parse(res))
119 }, '') 119 }, '')
120 } else {
121 layer.open({
122 content: 'JSBridge 初始化失败',
123 time:2
124 });
125 }
126
120 // wx.scanQRCode({ 127 // wx.scanQRCode({
121 // needResult: 1, // 默认为1,扫描结果由微信处理,1则直接返回扫描结果, 128 // needResult: 1, // 默认为1,扫描结果由微信处理,1则直接返回扫描结果,
122 // scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有 129 // scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有
......
...@@ -297,14 +297,17 @@ angular.module('myApp') ...@@ -297,14 +297,17 @@ angular.module('myApp')
297 // onSuccess(res) 297 // onSuccess(res)
298 // } 298 // }
299 // }); 299 // });
300 // appClient.getERCode('getGPS', function (res) { 300 if(appClient){
301 // alert(JSON.parse(res)) 301 appClient.getERCode('getGPS', function (res) {
302 // onSuccess({ 302 alert(JSON.parse(res))
303 // latitude:30.2741500000, 303 onSuccess({
304 // longitude:120.1551500000 304 latitude:30.2741500000,
305 // }) 305 longitude:120.1551500000
306 // 306 })
307 // }, '') 307
308 }, '')
309 }
310
308 // onSuccess({latitude:30.2741500000,longitude:120.1551500000}) 311 // onSuccess({latitude:30.2741500000,longitude:120.1551500000})
309 } 312 }
310 313
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!