982bafbd by ex

无法获取定位提示

1 parent 1cffe74c
......@@ -53,10 +53,29 @@ 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', function (data, responseCallback) {
window.WebViewJavascriptBridge.registerHandler('postERCode', callback)
} else {
this.appObj.registerHandler("postERCOde", callback)
this.appObj.callHandler("getERCode", param, function (data, responseCallback) {
});
}
};
AppClient.prototype.getGPS = function (jsonStr, callback) {
var dataParams = "";
if(isJson(jsonStr)) {
dataParams = JSON.parse(jsonStr);
}
var param = {
from: 'H5',
params: dataParams
};
var isRes = false
if(this.isAndroid) {
window.WebViewJavascriptBridge.callHandler('getGPS', jsonStr, function (data, responseCallback) {
isRes = true
var latitude = ''
var longitude = ''
......@@ -67,7 +86,7 @@ AppClient.prototype.getERCode = function (jsonStr, callback) {
callback(latitude, longitude, responseCallback)
})
} else {
this.appObj.registerHandler("postERCOde", function (data, responseCallback) {
this.appObj.registerHandler("postGPS", function (data, responseCallback) {
isRes = true
var latitude = ''
var longitude = ''
......@@ -77,7 +96,7 @@ AppClient.prototype.getERCode = function (jsonStr, callback) {
longitude = arr[1].split(':')[1]
callback(latitude, longitude, responseCallback)
})
this.appObj.callHandler("getERCode", param, function (data, responseCallback) {
this.appObj.callHandler("getGPS", param, function (data, responseCallback) {
});
}
......@@ -90,24 +109,6 @@ AppClient.prototype.getERCode = function (jsonStr, callback) {
}
}, 3000)
};
AppClient.prototype.getGPS = function (jsonStr, callback) {
var dataParams = "";
if(isJson(jsonStr)) {
dataParams = JSON.parse(jsonStr);
}
var param = {
from: 'H5',
params: dataParams
};
if(this.isAndroid) {
window.WebViewJavascriptBridge.callHandler('getGPS', jsonStr, callback);
} else {
this.appObj.registerHandler("postGPS", callback)
this.appObj.callHandler("getGPS", param, function (data, responseCallback) {
});
}
};
if(isAndroid || isiOS) {
......
......@@ -302,6 +302,7 @@ angular.module('myApp')
$rootScope.isLoadFinish = true
},1000)
} else {
appClient.getGPS('', function (latitude, longitude, cb) {
onSuccess({
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!