获取定位
Showing
2 changed files
with
19 additions
and
9 deletions
| ... | @@ -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 | ... | ... |
-
Please register or sign in to post a comment