25519 “预售提醒”页面中“选择类型”数据拉取不及时,导致多数时候显示不出来:查询的时候增加loading弹窗
This commit is contained in:
parent
399d321ecb
commit
9c1e73bc1c
@ -5,7 +5,7 @@ var Remind = {
|
|||||||
if ($('#remind_page').length == 0) {
|
if ($('#remind_page').length == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Remind.deviceInfo = JSON.parse(bootStrap.device_info);
|
Remind.deviceInfo = JSON.parse(bootStrap.device_info);
|
||||||
// Remind.deviceInfo = {
|
// Remind.deviceInfo = {
|
||||||
@ -41,18 +41,18 @@ var Remind = {
|
|||||||
|
|
||||||
|
|
||||||
var sch = Public.getQueryData(window.location.search);
|
var sch = Public.getQueryData(window.location.search);
|
||||||
|
|
||||||
if(!!sch['date'] && !isNaN((new Date(sch['date'].replace(/\-/gi,'/'))).getTime())){
|
if(!!sch['date'] && !isNaN((new Date(sch['date'].replace(/\-/gi,'/'))).getTime())){
|
||||||
Remind.dateChangeCallback(new Date(sch['date'].replace(/\-/gi,'/')));
|
Remind.dateChangeCallback(new Date(sch['date'].replace(/\-/gi,'/')));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!!sch['from'] && CheckStaion.CodeObj[sch['from']]){
|
if(!!sch['from'] && CheckStaion.CodeObj[sch['from']]){
|
||||||
Remind.startCallback(CheckStaion.CodeObj[sch['from']][1],CheckStaion.CodeObj[sch['from']][2]);
|
Remind.startCallback(CheckStaion.CodeObj[sch['from']][1],CheckStaion.CodeObj[sch['from']][2]);
|
||||||
}
|
}
|
||||||
if(!!sch['to'] && CheckStaion.CodeObj[sch['to']]){
|
if(!!sch['to'] && CheckStaion.CodeObj[sch['to']]){
|
||||||
Remind.endCallback(CheckStaion.CodeObj[sch['to']][1],CheckStaion.CodeObj[sch['to']][2]);
|
Remind.endCallback(CheckStaion.CodeObj[sch['to']][1],CheckStaion.CodeObj[sch['to']][2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
checkLoginCallback: function() {
|
checkLoginCallback: function() {
|
||||||
|
|
||||||
@ -167,13 +167,15 @@ var Remind = {
|
|||||||
Remind.checkType(Remind.trainsHis[key]);
|
Remind.checkType(Remind.trainsHis[key]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Public.showLoading('正在查询数据');
|
||||||
cn12306.queryTicket(data,function(json) {
|
cn12306.queryTicket(data,function(json) {
|
||||||
if (json["status"] == true && json["httpstatus"] == 200) {
|
if (json["status"] == true && json["httpstatus"] == 200) {
|
||||||
if (json['data'].length > 0) {
|
if (json['data'].length > 0) {
|
||||||
Remind.trainsHis[key] = json['data'];
|
Remind.trainsHis[key] = json['data'];
|
||||||
Remind.checkType(json['data']);
|
Remind.checkType(json['data']);
|
||||||
|
Public.hideLoading();
|
||||||
}else{
|
}else{
|
||||||
|
Public.hideLoading();
|
||||||
Public.alert('没有找到从<strong>'+$('#startStationName').val()+'</strong>到<strong>'+$('#endStationName').val()+'</strong>的列车');
|
Public.alert('没有找到从<strong>'+$('#startStationName').val()+'</strong>到<strong>'+$('#endStationName').val()+'</strong>的列车');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -230,11 +232,11 @@ var Remind = {
|
|||||||
types.each(function(idx, el) {
|
types.each(function(idx, el) {
|
||||||
var val = $(el).val(),
|
var val = $(el).val(),
|
||||||
time = Remind.sellTime[data['fromCode']];
|
time = Remind.sellTime[data['fromCode']];
|
||||||
|
|
||||||
if (val == 'all') {
|
if (val == 'all') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!time) {
|
if (!time) {
|
||||||
time = Remind.sellTime[data['fromName']];
|
time = Remind.sellTime[data['fromName']];
|
||||||
}
|
}
|
||||||
@ -288,7 +290,7 @@ var Remind = {
|
|||||||
"type": 3
|
"type": 3
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user