1cffe74c by ex

无法获取定位提示

1 parent 5cf7468e
......@@ -53,30 +53,34 @@ AppClient.prototype.getERCode = function (jsonStr, callback) {
from: 'H5',
params: dataParams
};
var isRes = false
if(this.isAndroid) {
window.WebViewJavascriptBridge.callHandler('getERCode', jsonStr);
window.WebViewJavascriptBridge.registerHandler('postERCode', callback);
} else {
var isRes = false
this.appObj.registerHandler("postERCOde", function (data, responseCallback) {
window.WebViewJavascriptBridge.registerHandler('postERCode', function (data, responseCallback) {
isRes = true
var latitude = ''
var longitude = ''
var result = /\{([\s\S]*)\}/.exec(data);
var arr = result[1].split(',')
if(isAndroid){
latitude = arr[0].split('=')[1]
longitude = arr[1].split('=')[1]
callback(latitude, longitude, responseCallback)
})
} else {
this.appObj.registerHandler("postERCOde", function (data, responseCallback) {
isRes = true
var latitude = ''
var longitude = ''
var result = /\{([\s\S]*)\}/.exec(data);
var arr = result[1].split(',')
latitude = arr[0].split(':')[1]
longitude = arr[1].split(':')[1]
}
callback(latitude, longitude, responseCallback)
})
this.appObj.callHandler("getERCode", param, function (data, responseCallback) {
});
}
setTimeout(function () {
if(!isRes){
layer.open({
......@@ -85,9 +89,6 @@ AppClient.prototype.getERCode = function (jsonStr, callback) {
callback(30.2741500000, 120.1551500000, function(){})
}
}, 3000)
}
};
AppClient.prototype.getGPS = function (jsonStr, callback) {
var dataParams = "";
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!