1cffe74c by ex

无法获取定位提示

1 parent 5cf7468e
......@@ -53,41 +53,42 @@ 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);
window.WebViewJavascriptBridge.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)
})
} else {
var isRes = false
this.appObj.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]
} else {
latitude = arr[0].split(':')[1]
longitude = arr[1].split(':')[1]
}
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({
content: '无法获取定位信息,检查定位设置,或重新开发'
})
callback(30.2741500000, 120.1551500000, function(){})
}
}, 3000)
}
setTimeout(function () {
if(!isRes){
layer.open({
content: '无法获取定位信息,检查定位设置,或重新开发'
})
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!