Browse Source

经纬度 回撤

wangshan 4 years ago
parent
commit
5281500087
1 changed files with 0 additions and 65 deletions
  1. 0 65
      src/jfw/modules/app/src/web/staticres/jyapp/js/common.js

+ 0 - 65
src/jfw/modules/app/src/web/staticres/jyapp/js/common.js

@@ -316,10 +316,6 @@ var JyObjMessage = new Object();
 $(function () {
   if (mySysIsIos()) {
     window.JyObj = {
-      //获取经纬度
-      getLLitude: function () {
-        return JyObj.IosCall("getLLitude")
-      },
       //调转到指定的webview
       //name 对应的值:search 搜索 subscribe 订阅 box 百宝箱 me 我的
       skipAppointTab: function (name) {
@@ -999,7 +995,6 @@ function afterPageInit () {
   }, 600000);
   try {
     afterJyObjInit();
-    latlongitude();//记录用户经纬度
   } catch (e) {
   }
   var sign = JyObj.getUserToken();
@@ -1423,63 +1418,3 @@ function afterReceivePushMessage (type, url) {
     receivePushMessageHandle(type, url);
   } catch (e) { }
 }
-//获取用户经纬度 每天记录一次
-function latlongitude(){
-	var llitude = JyObj.getLLitude();
-    if(llitude==""){
-      var ai = 0;
-      var llInterval = setInterval(function(){
-        ai=ai+1;
-        try{
-          llitude = JyObj.getLLitude();
-        }catch(e){}
-        //五次获取不到客户端经纬度 就不再获取,获取位置存localStorage 一天
-        //alert(llitude+"---:"+ai)
-        if((llitude!=""&&llitude!=undefined&&llitude.indexOf("null")<0)||ai>4){
-          clearInterval(llInterval);
-          llrequest(llitude)
-        }
-      },500)
-    }else{
-    	//alert("经纬度:"+llitude)
-    	llrequest(llitude)
-    }
-}
-//判断经纬度是否够收录条件
-function llrequest(ll){
-	//localStorage.removeItem("LLitude");
-	var latitude = parseFloat(ll.split("_")[1]);//纬度
-	var longitude =  parseFloat(ll.split("_")[0]);//经度
-	var llitude = localStorage.LLitude;
-	var _lat = 0.0;
-	var _long = 0.0;
-	var nowDate = new Date().getDate()+1;
-	var oldDate = new Date().getDate();
-	if (llitude!=null&&llitude.split("_").length>2){
-		_long =  parseFloat(llitude.split("_")[0]);//经度
-		_lat =  parseFloat(llitude.split("_")[1]);//纬度
-		oldDate =  Number(llitude.split("_")[2]);
-	}
-	if (nowDate!=oldDate&&caculateLL(latitude,longitude,_lat,_long)>0){
-    	$.post("/publicapply/appLoc/action", {
-	        "longitude": longitude,
-	        "latitude": latitude
-	    }, function (r) {
-	        if (r.data) {
-				localStorage.LLitude = ll+"_"+new Date().getDate();
-	        }
-      	})
-    }
-}
-/*计算两经纬度点之间的距离(单位:米)*/
-function caculateLL(lat1, lng1, lat2, lng2) {
-	var radLat1 = lat1 * Math.PI / 180.0;
-	var radLat2 = lat2 * Math.PI / 180.0;
-	var a = radLat1 - radLat2;
-	var b = lng1 * Math.PI / 180.0 - lng2 * Math.PI / 180.0;
-	var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
-	s = s * 6378.137;
-	s = Math.round(s * 10000) / 10;
-	alert("距离上个位置:"+s+" 米")
-	return s
-}