Merge branch 'master' of http://git.fishlee.net/scm/git/iFish/Light12306
This commit is contained in:
commit
8a7ec29555
@ -82,7 +82,7 @@ namespace TrainInfomationProviderService.Web.Controllers
|
||||
return Json(new
|
||||
{
|
||||
ret = true,
|
||||
data = SameStationManager.SameStationMap.GetValue(id),
|
||||
data = SameStationManager.SameStationMap.GetValue(id) ?? new HashSet<string>() { id.ToUpper() },
|
||||
time = DateTime.Now.ToString()
|
||||
}, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
@ -45,6 +45,10 @@
|
||||
that.fireEvent("passengerLoadFailed");
|
||||
that.fireEvent("passengerLoaded", passengers);
|
||||
_passengerInLoad.reject(result.data && result.data.exMsg);
|
||||
|
||||
if (result.data && result.data.exMsg && result.data.exMsg.indexOf("未登录") !== -1) {
|
||||
document.dispatchEvent(new CustomEvent("loginInvalid"));
|
||||
}
|
||||
} else {
|
||||
var p1 = result.data.normal_passengers;
|
||||
passengers = _.filter(p1, parser.canPassageAddToOrder);
|
||||
@ -63,6 +67,7 @@
|
||||
}, function () {
|
||||
passengers = null;
|
||||
_passengerInLoad.reject("网络错误");
|
||||
_passengerInLoad = null;
|
||||
sessionStorage.removeItem("_passenger");
|
||||
that.fireEvent("passengerLoadFailed");
|
||||
that.fireEvent("passengerLoaded", passengers);
|
||||
|
@ -2,6 +2,11 @@
|
||||
var citydata = require("./station/station_data.js");
|
||||
var utility = require("./utility.js");
|
||||
|
||||
var errorMessages = { randCodeError: "验证码错误!", randCodeExpired: "验证码失效", randCodeLentgh: "验证码长度为4位!", randCodeFormat: "验证码只能由数字或字母组成!", randCodeEmpty: "验证码不能为空!", userNameEmpty: "登录名必须填写!", userNameFormat: "登录名格式不正确,请重新输入!", passwordEmpty: "密码必须填写,且不少于6位!", passwordLength: "密码长度不能少于6位!", pleaseClickCaptcha: "请点击验证码", pleaseClickLeftCaptcha: "请点击左侧验证码", pleaseClickCaptchaRight: "请正确点击验证码", loginError: "当前访问用户过多,请稍候重试!" };
|
||||
exports.parseErrorMessage = function(msg) {
|
||||
return errorMessages[msg] || msg;
|
||||
};
|
||||
|
||||
exports.stationReportApi = "http://srv.12306.liebao.cn/tt/ls2";
|
||||
exports.trainSuggestApi = "http://srv.12306.liebao.cn/ts";
|
||||
exports.onceTransitApi = "http://srv.12306.liebao.cn/tt/tor";
|
||||
|
@ -1,13 +1,14 @@
|
||||
define(function (require, exports) {
|
||||
var utility = require("../utility.js");
|
||||
var data = require("../data.js");
|
||||
|
||||
exports.getError = function (data) {
|
||||
exports.getError = function (json) {
|
||||
/// <summary>获得指定返回数据中的错误信息</summary>
|
||||
|
||||
if (data.messages && data.messages instanceof Array) {
|
||||
return { message: data.messages.join(";") };
|
||||
if (json.messages && json.messages instanceof Array) {
|
||||
return { message: data.parseErrorMessage(json.messages.join(";")) };
|
||||
}
|
||||
if (data.data && data.data.isRelogin) {
|
||||
if (json.data && json.data.isRelogin) {
|
||||
return { message: "12306取消了您的登录,请重新登录。", relogin: true };
|
||||
}
|
||||
|
||||
@ -75,7 +76,7 @@
|
||||
/// <summary>对城市进行排序</summary>
|
||||
|
||||
cities.sort(function(x,y) {
|
||||
if (x.s != y.s)
|
||||
if (x.s !== y.s)
|
||||
return x.s - y.s;
|
||||
return x.c > y.c ? 1 : -1;
|
||||
});
|
||||
|
File diff suppressed because one or more lines are too long
@ -132,6 +132,8 @@
|
||||
//登录失效
|
||||
sessMgr.on("userForcedOut", function () {
|
||||
mp.showMessagePopup("error", "12306取消了您的登录,请重新登录");
|
||||
|
||||
ui_login.showLoginDialog();
|
||||
});
|
||||
$(".search-more-option").click(function () {
|
||||
var div = $("div.options-param");
|
||||
|
@ -317,7 +317,7 @@
|
||||
var ele = listTarget.find("tr.ticket-container td[data-date='" + date + "'][data-traincode='" + code + "'][data-fromcode='" + from + "'][data-tocode='" + to + "']");
|
||||
ele.empty();
|
||||
if (!loaded) {
|
||||
ele.append("<span class='remark remark-warning'>查询发生错误</span>");
|
||||
ele.append("<span class='remark remark-warning'>未能查询余票信息,等待重新查询</span>");
|
||||
ele.attr("data-available", 0);
|
||||
} else if (result.notInSellTime) {
|
||||
ele.append("<span class='remark remark-warning'>当日车次不在预售期</span>");
|
||||
|
@ -47,11 +47,16 @@
|
||||
mp.showMessagePopup("error", "无法加载联系人:" + msg);
|
||||
list.removeClass("loading");
|
||||
list.html("<li>无法加载联系人:" + msg + "</li>");
|
||||
|
||||
if (msg.indexOf("未登录") !== -1) {
|
||||
//未登录
|
||||
that.hide();
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
this.hide = function () {
|
||||
|
||||
widget.hideFloatDialog($("#float-passenger-selector"));
|
||||
};
|
||||
this.filterPassenger = function () {
|
||||
var key = this.value;
|
||||
@ -164,7 +169,7 @@
|
||||
});
|
||||
|
||||
that.fireEvent("passengerSelected");
|
||||
widget.hideFloatDialog($("#float-passenger-selector"));
|
||||
that.hide();
|
||||
});
|
||||
//刷新
|
||||
$("#btnRefreshPassOrder").click(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user