优化网页跳转

This commit is contained in:
suwings 2017-11-19 11:11:16 +08:00
parent f70ad1ac68
commit ca7a2943f7
2 changed files with 18 additions and 17 deletions

View File

@ -39,7 +39,7 @@
type: parameter['type'] || "POST",
url: MCSERVER.URL(parameter['url']),
data: parameter['data'], //具体实例化
timeout: parameter['timeout'] || 5000,
timeout: parameter['timeout'] || 10000,
success: function(data, textStatus) {
try {
data = JSON.parse(data);
@ -75,17 +75,20 @@
RES.redirectHTML = function(url, key, body, callback) {
//静态文件均在 public 目录下动态文件则在不同API接口
var _url = MCSERVER.URL('./public/' + url, 'http://');
//响应事件函数
function responseCallback(response, status, xhr) {
if(status != 'success')
TOOLS.pushMsgWindow("[ " + status + " ] 由于网络或权限问题,请求的网页无法成功!");
callback && callback();
}
if(key == null) {
//不需要API数据的单页
$("#ConsoleMain").load(_url, function() {
callback && callback();
return;
});
$("#ConsoleMain").load(_url, responseCallback);
} else {
WS.sendMsg(key, body || '', function() {
$("#ConsoleMain").load(_url, function() {
callback && callback();
});
$("#ConsoleMain").load(_url, responseCallback);
});
}
}
@ -107,7 +110,7 @@
ToolsLoadingEnd();
MI.rOn('onload');
callback && callback();
});
});
@ -126,21 +129,19 @@
}
function PageLoading() {
ToolsLoading.css("width", "40%");
ToolsLoading.css("width", "60%");
}
function ToolsLoadingEnd() {
ToolsLoading.css("width", "100%");
PageMain.stop(true, true).animate({
'opacity': '1'
}, 150, function() {
setTimeout(function(){
setTimeout(function() {
ToolsPageLoading.css("display", "none");
},100);
}, 100);
});
}

View File

@ -29,7 +29,7 @@
</head>
<!--百度数据统计,如果您不想被统计,请删除这段代码-->
<script>
<!--<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
@ -37,7 +37,7 @@
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</script>-->
<!--
__ ___ __ ___