no commit message

This commit is contained in:
雨中磐石
2024-10-18 15:27:40 +08:00
parent 9a2a3a2c8a
commit 559c388ea0
103 changed files with 2021 additions and 783 deletions

View File

@@ -120,17 +120,39 @@ js.dw = {
this.clearchao();
js.dw.ondwerr(msg);
}else{
this.wait('浏览器定位中...');
//本地虚拟定位
if(HOST=='127.0.0.1'){this.showPosition({coords:{latitude:24.51036967,longitude:118.178837299,accuracy:100}});return;}
navigator.geolocation.getCurrentPosition(this.showPosition,this.showError,{
enableHighAccuracy: true,
timeout: 19000,
maximumAge: 3000
});
this.liulqdw();
}
},
liulqdw:function(){
this.wait('浏览器定位中...');
var dwrand = sessionStorage.getItem('dwrand');
if(dwrand){
sessionStorage.setItem('dwrand', '');
this.wait('跳转定位获取中...');
$.ajax({
url:'api.php?m=kaoqin&a=dwget&dwrand='+dwrand+'',
dataType:'json',
success:function(ret){
if(ret.success && ret.data){
js.dw.showPosition({coords:ret.data});
}else{
js.dw.showErrors('跳转定位错误:'+ret.msg);
}
},
error:function(){
js.dw.showErrors('跳转定位错误');
}
});
return;
}
if(HOST=='127.0.0.1'){this.showPosition({coords:{latitude:24.51036967,longitude:118.178837299,accuracy:100}});return;}//本地虚拟定位
navigator.geolocation.getCurrentPosition(this.showPosition,this.showError,{
enableHighAccuracy: true,
timeout: 10000,
maximumAge: 3000
});
},
//微信定位
wxdingw:function(){
@@ -200,7 +222,20 @@ js.dw = {
msg="未知错误。"
break;
}
if(NOWURL.substr(0,5)!='https')msg+='必须使用https访问';
if(NOWURL.substr(0,5)!='https'){
msg+='必须使用https访问';
js.confirm('点确定继续去定位', function(jg){
if(jg=='yes'){
setTimeout('js.dw.gotodingw()',100);
}else{
js.dw.showErrors(msg);
}
});
}else{
js.dw.showErrors(msg);
}
},
showErrors:function(msg){
js.dw.timeerrbo = setTimeout(function(){
if(!js.dw.successbo){
js.msg('msg', msg);
@@ -210,7 +245,21 @@ js.dw = {
}
},1000);
},
gotodingw:function(){
js.alert('跳转在定位中,可点确定读取定位内容。','', function(){
js.reload();
});
var dwrand = js.getrand();
$.ajax({
url:'api.php?m=kaoqin&a=dwurl&dwrand='+dwrand+'',
dataType:'json',
success:function(ret){
var da = ret.data;
sessionStorage.setItem('dwrand', da.dwrand);
js.location(da.url);
}
});
},
showPosition:function(position){
js.dw.successbo = true;
clearTimeout(js.dw.timeerrbo);