project sync
This commit is contained in:
parent
49f110bc73
commit
39f05dafb9
@ -1,5 +1,5 @@
|
|||||||
var MANIFEST = chrome.runtime.getManifest();
|
var MANIFEST = chrome.runtime.getManifest();
|
||||||
var INFOBAR = chrome.infobars || (chrome.experimental && chrome.experimental.infobars);
|
//var INFOBAR = chrome.infobars || (chrome.experimental && chrome.experimental.infobars);
|
||||||
var isDebug = (compressFunc + '').indexOf("false") != -1;
|
var isDebug = (compressFunc + '').indexOf("false") != -1;
|
||||||
var bv = window.external.LiebaoGetVersion && window.external.LiebaoGetVersion() || /Chrome\/([\d\.]+)/i.exec(navigator.userAgent)[1];
|
var bv = window.external.LiebaoGetVersion && window.external.LiebaoGetVersion() || /Chrome\/([\d\.]+)/i.exec(navigator.userAgent)[1];
|
||||||
var entry12306 = false;
|
var entry12306 = false;
|
||||||
@ -136,61 +136,61 @@ var notification = (function () {
|
|||||||
return new notify();
|
return new notify();
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(function () {
|
//(function () {
|
||||||
var notifyId;
|
// var notifyId;
|
||||||
var tabid, message;
|
// var tabid, message;
|
||||||
//未加载提醒
|
// //未加载提醒
|
||||||
var closeCallback = function (id) {
|
// var closeCallback = function (id) {
|
||||||
if (id === notifyId) {
|
// if (id === notifyId) {
|
||||||
notifyId = null;
|
// notifyId = null;
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
var clickCallback = function (id, idx) {
|
// var clickCallback = function (id, idx) {
|
||||||
if (id === notifyId && idx === 0) {
|
// if (id === notifyId && idx === 0) {
|
||||||
chrome.tabs.update(tabid, {
|
// chrome.tabs.update(tabid, {
|
||||||
url: chrome.extension.getURL(message.detail.url.indexOf("/otn") != -1 ? "/infobar/main.html?new" : "/infobar/main.html"),
|
// url: chrome.extension.getURL(message.detail.url.indexOf("/otn") != -1 ? "/infobar/main.html?new" : "/infobar/main.html"),
|
||||||
selected: true
|
// selected: true
|
||||||
}, function () { });
|
// }, function () { });
|
||||||
chrome.notifications.clear("notLoadMessage", function () { });
|
// chrome.notifications.clear("notLoadMessage", function () { });
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
chrome.notifications.onClosed.addListener(closeCallback);
|
// chrome.notifications.onClosed.addListener(closeCallback);
|
||||||
chrome.notifications.onButtonClicked.addListener(clickCallback);
|
// chrome.notifications.onButtonClicked.addListener(clickCallback);
|
||||||
|
|
||||||
chrome.runtime.onMessage.addListener(function (m, sender, response) {
|
// chrome.runtime.onMessage.addListener(function (m, sender, response) {
|
||||||
if (m.action && m.action === "notLoadTip") {
|
// if (m.action && m.action === "notLoadTip") {
|
||||||
message = m;
|
// message = m;
|
||||||
tabid = sender.tab.id;
|
// tabid = sender.tab.id;
|
||||||
if (notifyId) {
|
// if (notifyId) {
|
||||||
chrome.notifications.update(notifyId, {
|
// chrome.notifications.update(notifyId, {
|
||||||
type: 'basic',
|
// type: 'basic',
|
||||||
iconUrl: '/icons/icon_n.png',
|
// iconUrl: '/icons/icon_n.png',
|
||||||
title: '订票助手未启动',
|
// title: '订票助手未启动',
|
||||||
message: '订票助手未加载,请点击工具栏『订票助手』图标并点击订票菜单来使用。',
|
// message: '订票助手未加载,请点击工具栏『订票助手』图标并点击订票菜单来使用。',
|
||||||
buttons: [
|
// buttons: [
|
||||||
{ title: '或点击这里启动订票助手', iconUrl: "/infobar/theme/plus_16.png" }
|
// { title: '或点击这里启动订票助手', iconUrl: "/infobar/theme/plus_16.png" }
|
||||||
]
|
// ]
|
||||||
}, function () {
|
// }, function () {
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
chrome.notifications.create('', {
|
// chrome.notifications.create('', {
|
||||||
type: 'basic',
|
// type: 'basic',
|
||||||
iconUrl: '/icons/icon_n.png',
|
// iconUrl: '/icons/icon_n.png',
|
||||||
title: '订票助手未启动',
|
// title: '订票助手未启动',
|
||||||
message: '订票助手未加载,请点击工具栏『订票助手』图标并点击订票菜单来使用。',
|
// message: '订票助手未加载,请点击工具栏『订票助手』图标并点击订票菜单来使用。',
|
||||||
buttons: [
|
// buttons: [
|
||||||
{ title: '或点击这里启动订票助手', iconUrl: "/infobar/theme/plus_16.png" }
|
// { title: '或点击这里启动订票助手', iconUrl: "/infobar/theme/plus_16.png" }
|
||||||
]
|
// ]
|
||||||
}, function (id) {
|
// }, function (id) {
|
||||||
notifyId = id;
|
// notifyId = id;
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
setTimeout(function () {
|
// setTimeout(function () {
|
||||||
closeCallback(notifyId);
|
// closeCallback(notifyId);
|
||||||
}, 5000);
|
// }, 5000);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
})();
|
//})();
|
||||||
|
|
||||||
//#region 系统配置处理
|
//#region 系统配置处理
|
||||||
|
|
||||||
@ -336,62 +336,62 @@ var CFG_MANGER = (function () {
|
|||||||
|
|
||||||
//#region 运行环境检测,以及自动处理启动
|
//#region 运行环境检测,以及自动处理启动
|
||||||
|
|
||||||
(function checkRunModeAndBootStrap() {
|
//(function checkRunModeAndBootStrap() {
|
||||||
localStorage["inforbarMode"] = INFOBAR ? "1" : "0";
|
// localStorage["inforbarMode"] = INFOBAR ? "1" : "0";
|
||||||
if (!INFOBAR) return;
|
// if (!INFOBAR) return;
|
||||||
|
|
||||||
chrome.runtime.onMessage.addListener(function (msg, sender, resp) {
|
// chrome.runtime.onMessage.addListener(function (msg, sender, resp) {
|
||||||
if (msg.action && msg.action == "isInforbarEnabled") {
|
// if (msg.action && msg.action == "isInforbarEnabled") {
|
||||||
resp(INFOBAR ? true : false);
|
// resp(INFOBAR ? true : false);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
function checkIfInfobarShown(tabid) {
|
// function checkIfInfobarShown(tabid) {
|
||||||
var views = chrome.extension.getViews({ type: "infobar" });
|
// var views = chrome.extension.getViews({ type: "infobar" });
|
||||||
for (var i in views) {
|
// for (var i in views) {
|
||||||
var v = views[i];
|
// var v = views[i];
|
||||||
if (v.location.search == "?" + tabid) {
|
// if (v.location.search == "?" + tabid) {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
var showInfobar = function (tabid, page, isOtn) {
|
// var showInfobar = function (tabid, page, isOtn) {
|
||||||
//if (checkIfInfobarShown(tabid)) {
|
// //if (checkIfInfobarShown(tabid)) {
|
||||||
// INFOBAR.show({
|
// // INFOBAR.show({
|
||||||
// tabId: tabid,
|
// // tabId: tabid,
|
||||||
// height: 155
|
// // height: 155
|
||||||
// });
|
// // });
|
||||||
|
|
||||||
// return;
|
// // return;
|
||||||
//}
|
// //}
|
||||||
|
|
||||||
//显示infobar
|
// //显示infobar
|
||||||
INFOBAR.show({
|
// INFOBAR.show({
|
||||||
tabId: tabid,
|
// tabId: tabid,
|
||||||
height: 155,
|
// height: 155,
|
||||||
path: "/infobar/" + page + ".html?" + (isOtn ? "new" : "old") + tabid
|
// path: "/infobar/" + page + ".html?" + (isOtn ? "new" : "old") + tabid
|
||||||
});
|
// });
|
||||||
};
|
// };
|
||||||
|
|
||||||
chrome.tabs.onUpdated.addListener(function (tabid, changeinfo, tab) {
|
// chrome.tabs.onUpdated.addListener(function (tabid, changeinfo, tab) {
|
||||||
if (changeinfo.status == "complete") {
|
// if (changeinfo.status == "complete") {
|
||||||
if (/https?:\/\/(www|dynamic|kyfw)\.12306\.cn\/otn.*/i.test(tab.url)) {
|
// if (/https?:\/\/(www|dynamic|kyfw)\.12306\.cn\/otn.*/i.test(tab.url)) {
|
||||||
showInfobar(tab.id, "main", true);
|
// showInfobar(tab.id, "main", true);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
//初始化infobar
|
// //初始化infobar
|
||||||
/*chrome.tabs.query({ url: "*://kyfw.12306.cn/*" }, function (ta) {
|
// /*chrome.tabs.query({ url: "*://kyfw.12306.cn/*" }, function (ta) {
|
||||||
$.each(ta, function () {
|
// $.each(ta, function () {
|
||||||
if (!checkIfInfobarShown(this.id)) {
|
// if (!checkIfInfobarShown(this.id)) {
|
||||||
showInfobar(this.id, true);
|
// showInfobar(this.id, true);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
});*/
|
// });*/
|
||||||
})();
|
//})();
|
||||||
|
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -1195,7 +1195,7 @@ window.cbl = function (u, h) {
|
|||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
var cv = parseInt(/Chrome\/(\d+)/i.exec(navigator.userAgent)[1]);
|
var cv = parseInt(/Chrome\/(\d+)/i.exec(navigator.userAgent)[1]);
|
||||||
var updateurl = "http://www.fishlee.net/service/update2/44/" + (cv < 34 ? "44" : "60") + "/version_v6" + (INFOBAR ? "" : "_1") + ".json?" + Math.random();
|
var updateurl = "http://www.fishlee.net/service/update2/44/" + (cv < 34 ? "44" : "60") + "/version_v6.json?" + Math.random();
|
||||||
var lastCheckUpdate = null;
|
var lastCheckUpdate = null;
|
||||||
var hasUpdate = false, lastVersion = null, lastMessage = null, updateInfo = null;
|
var hasUpdate = false, lastVersion = null, lastMessage = null, updateInfo = null;
|
||||||
|
|
||||||
|
@ -1,34 +1,6 @@
|
|||||||
{
|
{
|
||||||
"content_security_policy": "script-src 'self' https://hm.baidu.com; object-src 'self';",
|
"content_security_policy": "script-src 'self' https://hm.baidu.com; object-src 'self';",
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
|
||||||
"all_frames": true,
|
|
||||||
"exclude_globs": [ ],
|
|
||||||
"exclude_matches": [ ],
|
|
||||||
"include_globs": [ ],
|
|
||||||
"js": [ "libs/jquery.js", "libs/underscore/underscore.js", "contentscripts/framework.js", "contentscripts/morweb/12306.js" ],
|
|
||||||
"matches": [ "http://dynamic.12306.cn/otsweb/*", "https://dynamic.12306.cn/otsweb/*" ],
|
|
||||||
"run_at": "document_end"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"all_frames": true,
|
|
||||||
"exclude_globs": [ ],
|
|
||||||
"exclude_matches": [ ],
|
|
||||||
"include_globs": [ ],
|
|
||||||
"js": [ "libs/jquery.js", "libs/underscore/underscore.js", "contentscripts/kyfw/12306_pre.js" ],
|
|
||||||
"matches": [ "http://*.12306.cn/otn/*", "https://*.12306.cn/otn/*" ],
|
|
||||||
"run_at": "document_start"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"all_frames": true,
|
|
||||||
"exclude_globs": [ ],
|
|
||||||
"exclude_matches": [ ],
|
|
||||||
"include_globs": [ ],
|
|
||||||
"js": [ "libs/jquery.js", "libs/underscore/underscore.js", "contentscripts/framework.js", "contentscripts/kyfw/12306.js" ],
|
|
||||||
"css": [ "contentscripts/kyfw/12306.css" ],
|
|
||||||
"matches": [ "http://*.12306.cn/otn/*", "https://*.12306.cn/otn/*" ],
|
|
||||||
"run_at": "document_end"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"all_frames": true,
|
"all_frames": true,
|
||||||
"exclude_globs": [ ],
|
"exclude_globs": [ ],
|
||||||
@ -37,15 +9,6 @@
|
|||||||
"js": [ "libs/jquery.js", "12306/mobileproxy.js" ],
|
"js": [ "libs/jquery.js", "12306/mobileproxy.js" ],
|
||||||
"matches": [ "http://test.fishlee.net/*", "http://dev.fishlee.net/*", "http://app.fishlee.net/*", "http://12306.liebao.cn/*" ],
|
"matches": [ "http://test.fishlee.net/*", "http://dev.fishlee.net/*", "http://app.fishlee.net/*", "http://12306.liebao.cn/*" ],
|
||||||
"run_at": "document_end"
|
"run_at": "document_end"
|
||||||
},
|
|
||||||
{
|
|
||||||
"all_frames": false,
|
|
||||||
"exclude_globs": [ ],
|
|
||||||
"exclude_matches": [ ],
|
|
||||||
"include_globs": [ ],
|
|
||||||
"css": [ "contentscripts/morweb/12306_style.css" ],
|
|
||||||
"matches": [ "http://www.12306.cn/mormhweb/kyfw/*" ],
|
|
||||||
"run_at": "document_end"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"browser_action": {
|
"browser_action": {
|
||||||
@ -65,7 +28,7 @@
|
|||||||
"128": "icons/icon_128.png"
|
"128": "icons/icon_128.png"
|
||||||
},
|
},
|
||||||
"homepage_url": "http://www.fishlee.net/",
|
"homepage_url": "http://www.fishlee.net/",
|
||||||
"permissions": [ "management", "tabs", "http://*.12306.cn/*", "https://*.12306.cn/*", "http://*.fishlee.net/*", "http://*.liebao.cn/*", "notifications", "webRequest", "webRequestBlocking", "http://*.fishlee.net/*", "http://*.ijinshan.com/*", "*://*/*", "infobars" ],
|
"permissions": [ "management", "tabs", "http://*.12306.cn/*", "https://*.12306.cn/*", "http://*.fishlee.net/*", "http://*.liebao.cn/*", "notifications", "webRequest", "webRequestBlocking", "http://*.fishlee.net/*", "http://*.ijinshan.com/*", "*://*/*" ],
|
||||||
"update_url": "http://www.fishlee.net/service/update2/44/44/update_lb.xml",
|
"update_url": "http://www.fishlee.net/service/update2/44/44/update_lb.xml",
|
||||||
"background": {
|
"background": {
|
||||||
"page": "background.html"
|
"page": "background.html"
|
||||||
|
@ -11,7 +11,6 @@ using TrainInfomationProviderService.TrainInfo.Entities;
|
|||||||
|
|
||||||
namespace TrainInfomationProviderService.Web.Controllers
|
namespace TrainInfomationProviderService.Web.Controllers
|
||||||
{
|
{
|
||||||
[AllowOriginFilter(@"(https?://.*?\.(fishlee\.net|liebao\.cn)|chrome-extension://.*)")]
|
|
||||||
public class TransitController : Controller
|
public class TransitController : Controller
|
||||||
{
|
{
|
||||||
#region Overrides of Controller
|
#region Overrides of Controller
|
||||||
@ -24,6 +23,7 @@ namespace TrainInfomationProviderService.Web.Controllers
|
|||||||
{
|
{
|
||||||
base.OnAuthorization(filterContext);
|
base.OnAuthorization(filterContext);
|
||||||
|
|
||||||
|
filterContext.HttpContext.Response.Headers.Add("Access-Control-Allow-Origin", "*");
|
||||||
if (!TrainInfoSearchProvider.Instance.IsReady)
|
if (!TrainInfoSearchProvider.Instance.IsReady)
|
||||||
filterContext.Result = Json(new { ret = false, msg = "service not ready." }, JsonRequestBehavior.AllowGet);
|
filterContext.Result = Json(new { ret = false, msg = "service not ready." }, JsonRequestBehavior.AllowGet);
|
||||||
}
|
}
|
||||||
@ -119,6 +119,8 @@ namespace TrainInfomationProviderService.Web.Controllers
|
|||||||
{
|
{
|
||||||
from = s.First.FromStation.Code,
|
from = s.First.FromStation.Code,
|
||||||
to = s.First.ToStation.Code,
|
to = s.First.ToStation.Code,
|
||||||
|
fe = s.First.IsBegin,
|
||||||
|
ae = s.First.IsEnd,
|
||||||
train = new
|
train = new
|
||||||
{
|
{
|
||||||
id = s.First.Train.Id,
|
id = s.First.Train.Id,
|
||||||
@ -131,6 +133,8 @@ namespace TrainInfomationProviderService.Web.Controllers
|
|||||||
second = new
|
second = new
|
||||||
{
|
{
|
||||||
from = s.Second.FromStation.Code,
|
from = s.Second.FromStation.Code,
|
||||||
|
fe = s.Second.IsBegin,
|
||||||
|
ae = s.Second.IsEnd,
|
||||||
to = s.Second.ToStation.Code,
|
to = s.Second.ToStation.Code,
|
||||||
train = new
|
train = new
|
||||||
{
|
{
|
||||||
@ -148,6 +152,7 @@ namespace TrainInfomationProviderService.Web.Controllers
|
|||||||
|
|
||||||
var data = new
|
var data = new
|
||||||
{
|
{
|
||||||
|
@base = result.Date.ToString(),
|
||||||
cities,
|
cities,
|
||||||
corder = result.CityOrder,
|
corder = result.CityOrder,
|
||||||
lines,
|
lines,
|
||||||
|
@ -195,6 +195,8 @@
|
|||||||
<Content Include="js\data.js" />
|
<Content Include="js\data.js" />
|
||||||
<Content Include="js\modules\colorbox\jquery.colorbox.js" />
|
<Content Include="js\modules\colorbox\jquery.colorbox.js" />
|
||||||
<Content Include="js\modules\doT.js" />
|
<Content Include="js\modules\doT.js" />
|
||||||
|
<Content Include="js\platform\encode.js" />
|
||||||
|
<Content Include="js\ui\ui-oncetrainsitquery.js" />
|
||||||
<Content Include="js\otn\orderprocess.js" />
|
<Content Include="js\otn\orderprocess.js" />
|
||||||
<Content Include="js\otn\passenger.js" />
|
<Content Include="js\otn\passenger.js" />
|
||||||
<Content Include="js\otn\queryticket.js" />
|
<Content Include="js\otn\queryticket.js" />
|
||||||
|
@ -181,7 +181,7 @@ a:active {
|
|||||||
display: block;
|
display: block;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-bar .user-nav li.selected > a {
|
.header-bar .user-nav li.selected > a {
|
||||||
color: #f17206;
|
color: #f17206;
|
||||||
@ -348,3 +348,30 @@ div.text-input-wrap {
|
|||||||
color: #6f7379;
|
color: #6f7379;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-align-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remark {
|
||||||
|
padding: 5px;
|
||||||
|
background: rgb(102, 102, 102);
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 3px;
|
||||||
|
font-size: 12px;
|
||||||
|
vertical-align: 10%;
|
||||||
|
font-weight: normal;
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remark-mini {
|
||||||
|
padding: 0 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remark-warning {
|
||||||
|
background-color: #C56063;
|
||||||
|
}
|
||||||
|
.remark-primary {
|
||||||
|
background-color: #5088DF;
|
||||||
|
}
|
||||||
|
@ -10,22 +10,26 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#dateSelector:hover {
|
#dateSelector:hover {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
#dateSelector.open {
|
#dateSelector.open {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
#dateSelector.open:hover {
|
#dateSelector.open:hover {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
#dateSelector .month-first, #dateSelector .month-second {
|
#dateSelector .month-first, #dateSelector .month-second {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
#dateSelector .month-second {
|
#dateSelector .month-second {
|
||||||
border-left: 1px solid #d1d1d1;
|
border-left: 1px solid #d1d1d1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#dateSelector .date-thismonth {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
@ -258,7 +258,6 @@
|
|||||||
.date-selector .date-commonavailable {
|
.date-selector .date-commonavailable {
|
||||||
color: #d8a15e;
|
color: #d8a15e;
|
||||||
background-color: #FFF1E0;
|
background-color: #FFF1E0;
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.date-selector .date-notavailable {
|
.date-selector .date-notavailable {
|
||||||
@ -271,3 +270,6 @@
|
|||||||
background: none;
|
background: none;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
}
|
}
|
||||||
|
.date-selector .date-thismonth {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
@ -281,7 +281,7 @@
|
|||||||
button#btnResetOptions {
|
button#btnResetOptions {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
bottom: 0;
|
bottom: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-traintypes {
|
.search-traintypes {
|
||||||
|
@ -9,13 +9,14 @@
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.options-param >dl {
|
.options-param > dl {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
|
||||||
.options-param > dl:nth-child(1) {
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.options-param > dl:nth-child(1) {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.options-param dt {
|
.options-param dt {
|
||||||
height: 36px;
|
height: 36px;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
@ -117,6 +118,14 @@
|
|||||||
color: #ff6a00;
|
color: #ff6a00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.options-param .options-seat-type ul li:last-child {
|
||||||
|
float: none;
|
||||||
|
clear: both;
|
||||||
|
border-top: 1px dotted #ccc;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.options-param .options-train-selectorwarp {
|
.options-param .options-train-selectorwarp {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
@ -178,6 +178,11 @@
|
|||||||
border-top: 1px solid #cccccc;
|
border-top: 1px solid #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.result .train-list-func {
|
||||||
|
text-align: center;
|
||||||
|
line-height: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
/*购票建议*/
|
/*购票建议*/
|
||||||
#suggestion {
|
#suggestion {
|
||||||
display: none;
|
display: none;
|
||||||
@ -275,6 +280,7 @@
|
|||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-indent: 10px;
|
text-indent: 10px;
|
||||||
|
background: linear-gradient(to bottom, #efefef, #d9d9d9);
|
||||||
}
|
}
|
||||||
|
|
||||||
#oncetrainsit > header a {
|
#oncetrainsit > header a {
|
||||||
@ -283,6 +289,16 @@
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#oncetrainsit > header > ul {
|
||||||
|
float: right;
|
||||||
|
overflow: hidden;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
#oncetrainsit > header > ul > li {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
#oncetrainsit > footer {
|
#oncetrainsit > footer {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
@ -298,13 +314,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#oncetrainsit th {
|
#oncetrainsit th {
|
||||||
border-bottom: 1px solid #cccccc;
|
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
#oncetrainsit td {
|
#oncetrainsit tr:nth-child(6n+5),
|
||||||
|
#oncetrainsit tr:nth-child(6n+6),
|
||||||
|
#oncetrainsit tr:nth-child(6n+7) {
|
||||||
|
background-color: #FFF9E9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#oncetrainsit .ticket-container td {
|
||||||
border-bottom: 1px solid #f8f8f8;
|
border-bottom: 1px solid #f8f8f8;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 5px;
|
||||||
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
#oncetrainsit tr.recommand th {
|
#oncetrainsit tr.recommand th {
|
||||||
@ -313,32 +337,35 @@
|
|||||||
|
|
||||||
#oncetrainsit tr.header th {
|
#oncetrainsit tr.header th {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border-bottom: 1px solid #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#oncetrainsit tr.header th:nth-child(n+2) {
|
#oncetrainsit tr.header th:nth-child(n+2) {
|
||||||
|
border-left: 1px solid #cccccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
#oncetrainsit tr.sub th:nth-child(6) {
|
||||||
|
border-left: 1px solid #cccccc;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 130%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#oncetrainsit tr.sub th:nth-child(1) {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 130%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#oncetrainsit tr.sub th:nth-child(11) {
|
||||||
border-left: 1px solid #cccccc;
|
border-left: 1px solid #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#oncetrainsit tr.sub th {
|
#oncetrainsit tr.sub th:nth-child(3),
|
||||||
|
#oncetrainsit tr.sub th:nth-child(8) {
|
||||||
|
color: #ff6a00;
|
||||||
|
font-size: 120%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#oncetrainsit tr.sub th:nth-child(2),
|
|
||||||
#oncetrainsit tr.sub th:nth-child(4),
|
|
||||||
#oncetrainsit tr.sub th:nth-child(7),
|
|
||||||
#oncetrainsit tr.sub th:nth-child(9),
|
|
||||||
#oncetrainsit tr.sub th:nth-child(11) {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#oncetrainsit tr.sub th:nth-child(1) {
|
|
||||||
}
|
|
||||||
#oncetrainsit tr.sub th:nth-child(6) {
|
|
||||||
border-left: 1px solid #cccccc;
|
|
||||||
}
|
|
||||||
#oncetrainsit tr.sub th:nth-child(11) {
|
|
||||||
border-left: 1px solid #cccccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
#oncetrainsit tr.row td {
|
#oncetrainsit tr.row td {
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
border-bottom: 1px solid #cccccc;
|
border-bottom: 1px solid #cccccc;
|
||||||
@ -350,14 +377,54 @@
|
|||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#oncetrainsit tr.ticket-container td:nth-child(n+2) {
|
#oncetrainsit tr.ticket-container td:nth-child(n+2) {
|
||||||
border-left: 1px solid #cccccc;
|
border-left: 1px solid #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#oncetrainsit table .button {
|
#oncetrainsit .button {
|
||||||
padding: 0 2px;
|
padding: 0 4px;
|
||||||
|
font-size: 90%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#oncetrainsit .remark {
|
#oncetrainsit .remark {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#oncetrainsit tr.catalog th {
|
||||||
|
background: linear-gradient(to bottom, #fff, #f9f9f9);
|
||||||
|
border-bottom: 1px solid #cccccc;
|
||||||
|
text-align: left;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
#oncetrainsit .ae, #oncetrainsit .fe {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
#oncetrainsit .ae:after,
|
||||||
|
#oncetrainsit .fe:after {
|
||||||
|
content: '终';
|
||||||
|
color: white;
|
||||||
|
display: inline-block;
|
||||||
|
background: #FF9310;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 2px 3px;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-left: 4px;
|
||||||
|
line-height: 12px;
|
||||||
|
vertical-align: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#oncetrainsit .fe:after {
|
||||||
|
content: '始';
|
||||||
|
}
|
||||||
|
|
||||||
|
#oncetrainsit .btn-ticket-block {
|
||||||
|
margin-right: 5px;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
#oncetrainsit time {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
@ -281,7 +281,6 @@
|
|||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
text-shadow: 0 0 1px rgba(200, 50, 50, 0.4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ticket-submit-info .ticket-submit-info-status-failed div p,
|
#ticket-submit-info .ticket-submit-info-status-failed div p,
|
||||||
@ -297,5 +296,4 @@
|
|||||||
|
|
||||||
#ticket-submit-info .ticket-submit-info-status-ok div {
|
#ticket-submit-info .ticket-submit-info-status-ok div {
|
||||||
color: #4169E1;
|
color: #4169E1;
|
||||||
text-shadow: 0 0 1px rgba(50, 50, 200, 0.4);
|
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<input class="submit-btn" id="btnQuery" type="button" value="查询余票" />
|
<input class="submit-btn" id="btnQuery" type="button" value="立即刷票" />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<a class="search-more-option" href="javascript:;">
|
<a class="search-more-option" href="javascript:;">
|
||||||
@ -133,37 +133,37 @@
|
|||||||
<li>
|
<li>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" value="G" id="" />
|
<input type="checkbox" value="G" id="" />
|
||||||
高铁(G)
|
高铁
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" value="D" id="" />
|
<input type="checkbox" value="D" id="" />
|
||||||
动车(D)
|
动车
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" value="C" id="" />
|
<input type="checkbox" value="C" id="" />
|
||||||
城铁(C)
|
城铁
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" value="Z" id="" />
|
<input type="checkbox" value="Z" id="" />
|
||||||
直达(Z)
|
直达
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" value="T" id="" />
|
<input type="checkbox" value="T" id="" />
|
||||||
特快(T)
|
特快
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" value="K" id="" />
|
<input type="checkbox" value="K" id="" />
|
||||||
快车(K)
|
快车
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -213,6 +213,14 @@
|
|||||||
<span class="optional-block" data-code="{{=seat}}"> {{=it.getName(seat)}}<span class="close">x</span></span>{{~}}
|
<span class="optional-block" data-code="{{=seat}}"> {{=it.getName(seat)}}<span class="close">x</span></span>{{~}}
|
||||||
</script>
|
</script>
|
||||||
<label><input type="text" class="options-input" id="travel-seat-select" placeholder="添加想要的席别" readonly="readonly" /></label>
|
<label><input type="text" class="options-input" id="travel-seat-select" placeholder="添加想要的席别" readonly="readonly" /></label>
|
||||||
|
<label style="display:none;" id="opt_seat_first">
|
||||||
|
<input type="checkbox" data-profile-key="selectSeatFirst" value="1" id="" />
|
||||||
|
席别优先
|
||||||
|
</label>
|
||||||
|
<label style="display:none;" id="opt_seat_tb">
|
||||||
|
<input type="checkbox" data-profile-key="tryBottomSeat" value="1" id="" />
|
||||||
|
尝试预定下铺
|
||||||
|
</label>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="cl">
|
<dl class="cl">
|
||||||
@ -354,42 +362,6 @@
|
|||||||
</script>
|
</script>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="cl">
|
|
||||||
<dt>更多选项:</dt>
|
|
||||||
<dd class="param-array">
|
|
||||||
<p>
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" data-profile-key="hideNoTicket" value="1" id="" />
|
|
||||||
隐藏无票车次
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" data-profile-key="hideNotInListTrain" value="1" id="" />
|
|
||||||
隐藏未选车次
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" data-profile-key="autoWaitToSell" value="1" id="" />
|
|
||||||
自动等待起售
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" data-profile-key="tryBottomSeat" value="1" id="" />
|
|
||||||
尝试预定下铺
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" data-profile-key="selectSeatFirst" value="1" id="" />
|
|
||||||
席别优先
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" data-profile-key="autoSubmitEnabled" value="1" id="" />
|
|
||||||
自动提交
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
刷新间隔
|
|
||||||
<input type="number" data-profile-key="autoRefreshDelay" min="1" max="30" value="5" id="" title="两次自动刷新之间的时间间隔,不建议过短" />
|
|
||||||
秒
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<div class="split"></div>
|
<div class="split"></div>
|
||||||
<dl class="cl">
|
<dl class="cl">
|
||||||
<dt>出行计划:</dt>
|
<dt>出行计划:</dt>
|
||||||
@ -412,7 +384,27 @@
|
|||||||
</button>
|
</button>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" data-profile-key="hideNoTicket" value="1" id="" />
|
||||||
|
隐藏无票车次
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" data-profile-key="hideNotInListTrain" value="1" id="" />
|
||||||
|
隐藏未选车次
|
||||||
|
</label>
|
||||||
|
<label style="display:none;">
|
||||||
|
<input type="checkbox" data-profile-key="autoWaitToSell" value="1" id="" />
|
||||||
|
自动等待起售
|
||||||
|
</label>
|
||||||
|
<label style="display:none;">
|
||||||
|
<input type="checkbox" data-profile-key="autoSubmitEnabled" value="1" id="" />
|
||||||
|
自动提交
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
刷新间隔
|
||||||
|
<input type="number" data-profile-key="autoRefreshDelay" min="1" max="30" value="5" id="" title="两次自动刷新之间的时间间隔,不建议过短" />
|
||||||
|
秒
|
||||||
|
</label>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<button id="btnResetOptions" class="button button-default">重置选项</button>
|
<button id="btnResetOptions" class="button button-default">重置选项</button>
|
||||||
@ -510,77 +502,152 @@
|
|||||||
</footer>
|
</footer>
|
||||||
</section>
|
</section>
|
||||||
<!--一次中转-->
|
<!--一次中转-->
|
||||||
<section id="oncetrainsit">
|
<section id="oncetrainsit" style="display:none;">
|
||||||
<header>
|
<header>
|
||||||
<a href="javascript:;">
|
<a href="javascript:;">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
关闭
|
关闭
|
||||||
</a>
|
</a>
|
||||||
中转查询
|
车站中转推荐
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label><input type="radio" name="tt_level" value="3" id="" /> 显示全部线路及不推荐线路</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label><input type="radio" name="tt_level" value="2" id="" /> 显示全部线路</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label><input type="radio" name="tt_level" checked="checked" value="1" id="" /> 仅显示推荐线路</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</header>
|
</header>
|
||||||
<table>
|
<section></section>
|
||||||
<tr class="header">
|
<script type="text/x-dot-template">
|
||||||
<th colspan="5">前车信息</th>
|
{{var lastCity;}}
|
||||||
<th colspan="5">后车信息</th>
|
<table>
|
||||||
<th>时间</th>
|
<colgroup>
|
||||||
</tr>
|
<col style="width:70px;" />
|
||||||
<tr class="sub recommand">
|
<col style="width:100px;" />
|
||||||
<th rowspan="2">K656</th>
|
<col style="width:30px;" />
|
||||||
<th>北京</th>
|
<col style="width:100px;" />
|
||||||
<th rowspan="2">
|
<col style="width:100px;" />
|
||||||
<i class="fa fa-arrow-circle-right"></i>
|
</colgroup>
|
||||||
</th>
|
<colgroup>
|
||||||
<th>南京</th>
|
<col style="width:70px;" />
|
||||||
<th rowspan="2">
|
<col style="width:100px;" />
|
||||||
历时
|
<col style="width:30px;" />
|
||||||
<br />
|
<col style="width:100px;" />
|
||||||
10:00
|
<col style="width:100px;" />
|
||||||
</th>
|
</colgroup>
|
||||||
<th rowspan="2">K656</th>
|
<colgroup style="width:110px;" />
|
||||||
<th>北京</th>
|
<tr class="header">
|
||||||
<th rowspan="2">
|
<th colspan="5">前车信息</th>
|
||||||
<i class="fa fa-arrow-circle-right"></i>
|
<th colspan="5">后车信息</th>
|
||||||
</th>
|
<th>
|
||||||
<th>南京</th>
|
<strong>总耗时</strong> / 等候
|
||||||
<th rowspan="2">
|
</th>
|
||||||
历时
|
</tr>
|
||||||
<br />
|
{{~it.showLines:line:index}}
|
||||||
10:00
|
{{?ext.l>1&&lastCity!==line.first.to}}
|
||||||
</th>
|
{{lastCity=line.first.to}}
|
||||||
<th>总历时 24:00</th>
|
<tr class="catalog">
|
||||||
</tr>
|
<th colspan="11">
|
||||||
<tr class="recommand">
|
<i class="fa fa-star"></i>
|
||||||
<th>10:00</th>
|
中转站:<strong>{{!line.first.toName}}</strong>
|
||||||
<th>13:00</th>
|
</th>
|
||||||
<th>3:00</th>
|
</tr>
|
||||||
<th>16:00</th>
|
{{?}}
|
||||||
<th>等候 2:00</th>
|
<tr class="sub {{=line.ne?'':'recommand'}}">
|
||||||
</tr>
|
<th rowspan="2">{{=line.first.train.code}}</th>
|
||||||
<tr class="ticket-container">
|
<th>
|
||||||
<td colspan="5">
|
<span class="{{=line.first.fe?'fe':''}}">
|
||||||
<button class="button button-default">
|
{{!line.first.fromName}}
|
||||||
二等座 768张 ¥768.00
|
</span>
|
||||||
</button>
|
</th>
|
||||||
</td>
|
<th rowspan="2">
|
||||||
<td colspan="5">
|
<i class="fa fa-arrow-circle-o-right"></i>
|
||||||
<button class="button button-default">
|
</th>
|
||||||
二等座 768张 ¥768.00
|
<th>
|
||||||
</button>
|
<span class="{{=line.first.ae?'ae':''}}">
|
||||||
</td>
|
{{!line.first.toName}}
|
||||||
<td class="remark">
|
</span>
|
||||||
<span>需要换车站</span>
|
</th>
|
||||||
</td>
|
<th rowspan="2">
|
||||||
</tr>
|
历时
|
||||||
</table>
|
<br />
|
||||||
|
{{!line.first.elapsedStr}}
|
||||||
|
</th>
|
||||||
|
<th rowspan="2">{{=line.second.train.code}}</th>
|
||||||
|
<th>
|
||||||
|
<span class="{{=line.second.fe?'fe':''}}">
|
||||||
|
{{!line.second.fromName}}
|
||||||
|
</span>
|
||||||
|
</th>
|
||||||
|
<th rowspan="2">
|
||||||
|
<i class="fa fa-arrow-circle-o-right"></i>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<span class="{{=line.second.ae?'ae':''}}">
|
||||||
|
{{!line.second.toName}}
|
||||||
|
</span>
|
||||||
|
</th>
|
||||||
|
<th rowspan="2">
|
||||||
|
历时
|
||||||
|
<br />
|
||||||
|
{{!line.second.elapsedStr}}
|
||||||
|
</th>
|
||||||
|
<th><strong>{{=line.totalTimeStr}}</strong></th>
|
||||||
|
</tr>
|
||||||
|
<tr class="{{=line.ne?'':'recommand'}}">
|
||||||
|
<th>{{=line.first.leftShort}}</th>
|
||||||
|
<th>
|
||||||
|
{{=line.first.arriveShort}}
|
||||||
|
{{?line.first.days>0}}
|
||||||
|
<span class="remark remark-mini remark-primary" title="隔{{=line.first.days}}天">+{{=line.first.days}}</span>
|
||||||
|
{{?}}
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
{{=line.second.leftShort}}
|
||||||
|
{{?line.second.leftDays>0}}
|
||||||
|
<span class="remark remark-mini remark-primary" title="隔{{=line.second.leftDays}}天">+{{=line.second.leftDays}}</span>
|
||||||
|
{{?}}
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
{{=line.second.arriveShort}}
|
||||||
|
{{?line.second.arriveDays>0}}
|
||||||
|
<span class="remark remark-mini remark-primary" title="隔{{=line.second.arriveDays}}天">+{{=line.second.arriveDays}}</span>
|
||||||
|
{{?}}
|
||||||
|
</th>
|
||||||
|
<th><time>{{=line.waitTimeStr}}</time></th>
|
||||||
|
</tr>
|
||||||
|
<tr class="ticket-container">
|
||||||
|
<td colspan="5" data-traincode="{{=line.first.train.code}}" data-trainid="{{=line.first.train.id}}" data-date="{{=line.first.left.split(' ')[0]}}">
|
||||||
|
<span class="loading">
|
||||||
|
<i class="fa fa-spinner fa-spin"></i>
|
||||||
|
|
||||||
|
正在查询余票...
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td colspan="5" data-traincode="{{=line.second.train.code}}" data-trainid="{{=line.second.train.id}}" data-date="{{=line.second.left.split(' ')[0]}}">
|
||||||
|
<span class="loading">
|
||||||
|
<i class="fa fa-spinner fa-spin"></i>
|
||||||
|
|
||||||
|
正在查询余票...
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="text-align-center">
|
||||||
|
{{?line.ne}}
|
||||||
|
<span class="remark remark-warning">需要换车站</span>
|
||||||
|
{{?}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{~}}
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</script>
|
||||||
<footer>
|
<footer>
|
||||||
<button type="button" class="button button-default">
|
订票助手会在后台为您刷新以上余票信息。
|
||||||
<i class="fa fa-angle-double-up"></i>
|
|
||||||
显示更多中转线路
|
|
||||||
</button>
|
|
||||||
<button type="button" class="button button-default">
|
|
||||||
<i class="fa fa-angle-double-up"></i>
|
|
||||||
显示全部中转线路
|
|
||||||
</button>
|
|
||||||
</footer>
|
</footer>
|
||||||
</section>
|
</section>
|
||||||
<!-- 月日期选择 -->
|
<!-- 月日期选择 -->
|
||||||
@ -615,24 +682,6 @@
|
|||||||
<th style="width:130px;">发/到站</th>
|
<th style="width:130px;">发/到站</th>
|
||||||
<th>余票信息</th>
|
<th>余票信息</th>
|
||||||
</tr>
|
</tr>
|
||||||
{{?!it.auto&&it.enableAuto&&!it.notInSellTime}}
|
|
||||||
<tr class="train-needauto" style='{{=it.inAutoRefresh?"display:none;":""}}'>
|
|
||||||
<td colspan="4">
|
|
||||||
没有符合要求的车次和席别
|
|
||||||
<button type="button" class="button button-primary" id="btn_start_autorefresh">
|
|
||||||
<i class="fa fa-refresh"></i>
|
|
||||||
|
|
||||||
开始刷票
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{??!it.inAutoRefresh&&!it.notInSellTime}}
|
|
||||||
<tr class="train-autotip">
|
|
||||||
<td colspan="4">
|
|
||||||
点击“显示更多选项”并设置您需要的席别和车次以开启刷票模式。
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{?}}
|
|
||||||
{{~it.available:t:index}}
|
{{~it.available:t:index}}
|
||||||
<tr class="{{=t.selected?'selected':''}}">
|
<tr class="{{=t.selected?'selected':''}}">
|
||||||
<td class="train-num">
|
<td class="train-num">
|
||||||
@ -694,6 +743,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{{?}}
|
{{?}}
|
||||||
|
<tr style='{{=it.notInSellTime||ext.cp.studentTicket||it.showTransit||ext.cp.resign?"display:none;":""}}'>
|
||||||
|
<td colspan="4" class="train-list-func">
|
||||||
|
<button type="button" class="button button-primary" id="btn_start_transit">
|
||||||
|
<i class="fa fa-exchange"></i>
|
||||||
|
|
||||||
|
查询中转换乘
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</script>
|
</script>
|
||||||
<article id="save-travel-method" class="float-dialog">
|
<article id="save-travel-method" class="float-dialog">
|
||||||
|
@ -110,7 +110,7 @@
|
|||||||
//备份当前的查询,并取代为默认的查询
|
//备份当前的查询,并取代为默认的查询
|
||||||
var cp = that.currentProfile;
|
var cp = that.currentProfile;
|
||||||
if (cp) {
|
if (cp) {
|
||||||
cp.passengers = null; //不保留乘客
|
cp.passengers = null; //不保留乘客
|
||||||
}
|
}
|
||||||
|
|
||||||
var profile = storage.obj("12306_user_" + dispname) || { hasNotVerifyedPassenger: false, dispname: dispname, passengers: [], savedProfile: { list: [] }, currentProfile: {}, rawPassenger: [], options: { soundPrompt: true } };
|
var profile = storage.obj("12306_user_" + dispname) || { hasNotVerifyedPassenger: false, dispname: dispname, passengers: [], savedProfile: { list: [] }, currentProfile: {}, rawPassenger: [], options: { soundPrompt: true } };
|
||||||
@ -129,7 +129,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//fix passenger issue
|
//fix passenger issue
|
||||||
profile.currentProfile.passengers = _.filter(profile.currentProfile.passengers || [], function(p) {
|
profile.currentProfile.passengers = _.filter(profile.currentProfile.passengers || [], function (p) {
|
||||||
return p.passenger_name || false;
|
return p.passenger_name || false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -189,8 +189,7 @@
|
|||||||
|
|
||||||
d1 = new $.Deferred();
|
d1 = new $.Deferred();
|
||||||
d1.resolve(passengers);
|
d1.resolve(passengers);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
//that.once("passengerLoaded", function () {
|
//that.once("passengerLoaded", function () {
|
||||||
// callback(passengers);
|
// callback(passengers);
|
||||||
//});
|
//});
|
||||||
@ -222,6 +221,10 @@
|
|||||||
passengers: [],
|
passengers: [],
|
||||||
hideNoSeat: false
|
hideNoSeat: false
|
||||||
};
|
};
|
||||||
|
this.forceProfile = {
|
||||||
|
autoSubmitEnabled: true,
|
||||||
|
autoWaitToSell: false
|
||||||
|
};
|
||||||
|
|
||||||
Object.defineProperty(this, "current", {
|
Object.defineProperty(this, "current", {
|
||||||
get: function () {
|
get: function () {
|
||||||
@ -260,7 +263,7 @@
|
|||||||
get: function () {
|
get: function () {
|
||||||
return session && session.currentProfile;
|
return session && session.currentProfile;
|
||||||
}, set: function (value) {
|
}, set: function (value) {
|
||||||
session.currentProfile = $.extend({}, JSON.parse(JSON.stringify(that.defaultProfile)), value);
|
session.currentProfile = $.extend({}, JSON.parse(JSON.stringify(that.defaultProfile)), value, JSON.parse(JSON.stringify(that.forceProfile)));
|
||||||
that.fireEvent("currentProfileChanged");
|
that.fireEvent("currentProfileChanged");
|
||||||
that.save();
|
that.save();
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
exports.citynameMap = _.mapObject(exports.cities, function (c) {
|
exports.citynameMap = _.mapObject(exports.cities, function (c) {
|
||||||
return c.n;
|
return c.n;
|
||||||
});
|
});
|
||||||
|
exports.getCityName = function(code) {
|
||||||
|
var city = null;
|
||||||
|
return (city = exports.cities[code]) && city.n;
|
||||||
|
};
|
||||||
exports.findSimilarStation = function (name) {
|
exports.findSimilarStation = function (name) {
|
||||||
var extractname = null;
|
var extractname = null;
|
||||||
//查找最接近的站点
|
//查找最接近的站点
|
||||||
|
@ -130,10 +130,10 @@
|
|||||||
def.reject({ msg: (parser.getError(json) || { message: "未知错误" }).message });
|
def.reject({ msg: (parser.getError(json) || { message: "未知错误" }).message });
|
||||||
} else if (json.data.isRelogin) {
|
} else if (json.data.isRelogin) {
|
||||||
def.reject({ msg: "登录状态异常,请重新登录。" });
|
def.reject({ msg: "登录状态异常,请重新登录。" });
|
||||||
//TODO: 警告!这里对余票不足不做出错处理!
|
//TODO: 警告!这里对余票不足不做出错处理!
|
||||||
//} else if (json.data.op_2 === "true") {
|
//} else if (json.data.op_2 === "true") {
|
||||||
// def.resolve({ success: true });
|
// def.resolve({ success: true });
|
||||||
// def.reject({ msg: "余票不足,无法提交订单。请重试或重新刷新。" });
|
// def.reject({ msg: "余票不足,无法提交订单。请重试或重新刷新。" });
|
||||||
} else {
|
} else {
|
||||||
def.resolve({ success: true });
|
def.resolve({ success: true });
|
||||||
}
|
}
|
||||||
@ -173,7 +173,10 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
var submitOrder = function () {
|
var submitOrder = function () {
|
||||||
def.notify({ msg: "正在提交订单..." });
|
//def.notify({ msg: "正在提交订单..." });
|
||||||
|
//def.resolve({ orderId: "EXXXXXXXXXXXXXXXXX" });
|
||||||
|
//def.reject({ msg: "測試失敗" });
|
||||||
|
//return;
|
||||||
|
|
||||||
var url = "confirmPassenger/confirmSingleForQueueAsys";
|
var url = "confirmPassenger/confirmSingleForQueueAsys";
|
||||||
var data = {
|
var data = {
|
||||||
@ -207,7 +210,7 @@
|
|||||||
passenger[0].seat,
|
passenger[0].seat,
|
||||||
passenger.length,
|
passenger.length,
|
||||||
train.byAuto ? 1 : 0,
|
train.byAuto ? 1 : 0,
|
||||||
train.suggest ? 1 : 0
|
train.suggest || 0
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, function () {
|
}, function () {
|
||||||
@ -375,7 +378,7 @@
|
|||||||
passenger[0].seat,
|
passenger[0].seat,
|
||||||
passenger.length,
|
passenger.length,
|
||||||
train.byAuto ? 1 : 0,
|
train.byAuto ? 1 : 0,
|
||||||
train.suggest ? 1 : 0
|
train.suggest||0
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, function () {
|
}, function () {
|
||||||
|
@ -313,9 +313,7 @@
|
|||||||
setQueryResult: function (result, queryCount) {
|
setQueryResult: function (result, queryCount) {
|
||||||
registerSameStation(result);
|
registerSameStation(result);
|
||||||
//改签或学生票,忽略
|
//改签或学生票,忽略
|
||||||
//TODO 屏蔽
|
if (cp.resign || cp.studentTicket)
|
||||||
return;
|
|
||||||
if (cp.reisgn || cp.studentTicket)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ctx.TSS.setQueryResult(result, queryCount);
|
ctx.TSS.setQueryResult(result, queryCount);
|
||||||
|
113
Web12306/js/platform/encode.js
Normal file
113
Web12306/js/platform/encode.js
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
define(function (require, exports, module) {
|
||||||
|
function bin216(s) {
|
||||||
|
var i, l, o = "",
|
||||||
|
n;
|
||||||
|
s += "";
|
||||||
|
b = "";
|
||||||
|
for (i = 0, l = s.length; i < l; i++) {
|
||||||
|
b = s.charCodeAt(i);
|
||||||
|
n = b.toString(16);
|
||||||
|
o += n.length < 2 ? "0" + n : n;
|
||||||
|
}
|
||||||
|
return o;
|
||||||
|
};
|
||||||
|
var Base32 = new function () {
|
||||||
|
var delta = 0x9E3779B8;
|
||||||
|
|
||||||
|
function longArrayToString(data, includeLength) {
|
||||||
|
var length = data.length;
|
||||||
|
var n = (length - 1) << 2;
|
||||||
|
if (includeLength) {
|
||||||
|
var m = data[length - 1];
|
||||||
|
if ((m < n - 3) || (m > n)) return null;
|
||||||
|
n = m;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < length; i++) {
|
||||||
|
data[i] = String.fromCharCode(data[i] & 0xff, data[i] >>> 8 & 0xff, data[i] >>> 16 & 0xff, data[i] >>> 24 & 0xff);
|
||||||
|
}
|
||||||
|
if (includeLength) {
|
||||||
|
return data.join('').substring(0, n);
|
||||||
|
} else {
|
||||||
|
return data.join('');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function stringToLongArray(string, includeLength) {
|
||||||
|
var length = string.length;
|
||||||
|
var result = [];
|
||||||
|
for (var i = 0; i < length; i += 4) {
|
||||||
|
result[i >> 2] = string.charCodeAt(i) | string.charCodeAt(i + 1) << 8 | string.charCodeAt(i + 2) << 16 | string.charCodeAt(i + 3) << 24;
|
||||||
|
}
|
||||||
|
if (includeLength) {
|
||||||
|
result[result.length] = length;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
this.encrypt = function (string, key) {
|
||||||
|
if (string == "") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var v = stringToLongArray(string, true);
|
||||||
|
var k = stringToLongArray(key, false);
|
||||||
|
if (k.length < 4) {
|
||||||
|
k.length = 4;
|
||||||
|
}
|
||||||
|
var n = v.length - 1;
|
||||||
|
var z = v[n],
|
||||||
|
y = v[0];
|
||||||
|
var mx, e, p, q = Math.floor(6 + 52 / (n + 1)),
|
||||||
|
sum = 0;
|
||||||
|
while (0 < q--) {
|
||||||
|
sum = sum + delta & 0xffffffff;
|
||||||
|
e = sum >>> 2 & 3;
|
||||||
|
for (p = 0; p < n; p++) {
|
||||||
|
y = v[p + 1];
|
||||||
|
mx = (z >>> 5 ^ y << 2) + (y >>> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
|
||||||
|
z = v[p] = v[p] + mx & 0xffffffff;
|
||||||
|
}
|
||||||
|
y = v[0];
|
||||||
|
mx = (z >>> 5 ^ y << 2) + (y >>> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
|
||||||
|
z = v[n] = v[n] + mx & 0xffffffff;
|
||||||
|
}
|
||||||
|
return longArrayToString(v, false);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||||
|
|
||||||
|
function encode32(input) {
|
||||||
|
input = escape(input);
|
||||||
|
var output = "";
|
||||||
|
var chr1, chr2, chr3 = "";
|
||||||
|
var enc1, enc2, enc3, enc4 = "";
|
||||||
|
var i = 0;
|
||||||
|
do {
|
||||||
|
chr1 = input.charCodeAt(i++);
|
||||||
|
chr2 = input.charCodeAt(i++);
|
||||||
|
chr3 = input.charCodeAt(i++);
|
||||||
|
enc1 = chr1 >> 2;
|
||||||
|
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
||||||
|
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
||||||
|
enc4 = chr3 & 63;
|
||||||
|
if (isNaN(chr2)) {
|
||||||
|
enc3 = enc4 = 64;
|
||||||
|
} else if (isNaN(chr3)) {
|
||||||
|
enc4 = 64;
|
||||||
|
}
|
||||||
|
output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);
|
||||||
|
chr1 = chr2 = chr3 = "";
|
||||||
|
enc1 = enc2 = enc3 = enc4 = "";
|
||||||
|
} while (i < input.length);
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
|
||||||
|
var exp = {
|
||||||
|
encode: function (key, value) {
|
||||||
|
return encode32(bin216(Base32.encrypt(value, key)));
|
||||||
|
},
|
||||||
|
createEncodeStr: function (key, value) {
|
||||||
|
//keyVlues[0] + ",-," + encode32(bin216(Base32.encrypt(keyVlues[1], keyVlues[0]))) + ":::" + 'myversion' + ",-," + window.helperVersion
|
||||||
|
return key + ",-," + exp.encode(key, value) + ":::" + 'myversion' + ",-,undefined";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return exp;
|
||||||
|
});
|
@ -227,10 +227,12 @@
|
|||||||
if (_.some(cp.passengers, function (p) { return p.passenger_type !== '3'; })) {
|
if (_.some(cp.passengers, function (p) { return p.passenger_type !== '3'; })) {
|
||||||
mp.confirm("确认", "您选择的是学生票,但是添加的联系人并不全是学生,将无法提交订单,确定继续查票吗?", ui_result.load);
|
mp.confirm("确认", "您选择的是学生票,但是添加的联系人并不全是学生,将无法提交订单,确定继续查票吗?", ui_result.load);
|
||||||
} else {
|
} else {
|
||||||
ui_result.load();
|
//ui_result.load();
|
||||||
|
autorefresh.start();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ui_result.load();
|
//ui_result.load();
|
||||||
|
autorefresh.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
//track
|
//track
|
||||||
@ -300,6 +302,26 @@
|
|||||||
//服务器加速
|
//服务器加速
|
||||||
require("./ui-dnsspeeding.js");
|
require("./ui-dnsspeeding.js");
|
||||||
|
|
||||||
|
//自动查询
|
||||||
|
var lastAutoQueryKey;
|
||||||
|
var autoQuery = function () {
|
||||||
|
var cp = sessMgr.currentProfile;
|
||||||
|
if (!cp)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (cp.fromCode && cp.toCode && cp.depDate) {
|
||||||
|
var key = cp.fromCode + cp.toCode + cp.depDate + cp.studentTicket;
|
||||||
|
if (key !== lastAutoQueryKey) {
|
||||||
|
lastAutoQueryKey = key;
|
||||||
|
ui_result.load();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
sessMgr.on("save", function () {
|
||||||
|
autoQuery();
|
||||||
|
});
|
||||||
|
autoQuery();
|
||||||
|
|
||||||
//$("#passenger_editor").showModalDialog({
|
//$("#passenger_editor").showModalDialog({
|
||||||
// title: "新增联系人",
|
// title: "新增联系人",
|
||||||
// buttons: [
|
// buttons: [
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
var trainSuggest = require("../otn/trainstationsuggest.js");
|
var trainSuggest = require("../otn/trainstationsuggest.js");
|
||||||
var port = require("../platform/extensionPort.js");
|
var port = require("../platform/extensionPort.js");
|
||||||
var utility = require("../utility.js");
|
var utility = require("../utility.js");
|
||||||
|
var onceTransit = require("./ui-oncetrainsitquery.js");
|
||||||
|
|
||||||
sessMgr.on("sessionChanged", function () {
|
sessMgr.on("sessionChanged", function () {
|
||||||
session = sessMgr.current;
|
session = sessMgr.current;
|
||||||
@ -130,8 +131,11 @@
|
|||||||
query.events.on("processTrains", function (e, d) {
|
query.events.on("processTrains", function (e, d) {
|
||||||
isAutoRefreshBlock = false;
|
isAutoRefreshBlock = false;
|
||||||
processTrains(d);
|
processTrains(d);
|
||||||
if (inAutoRefresh)
|
|
||||||
|
if (inAutoRefresh) {
|
||||||
trainSuggest.setQueryResult(d, refreshCount);
|
trainSuggest.setQueryResult(d, refreshCount);
|
||||||
|
d.showTransit = onceTransit.setQueryResult(d, refreshCount);
|
||||||
|
}
|
||||||
|
|
||||||
if (!d.noAction) {
|
if (!d.noAction) {
|
||||||
if (!d.auto && (d.nextTime && inAutoRefresh)) {
|
if (!d.auto && (d.nextTime && inAutoRefresh)) {
|
||||||
@ -169,8 +173,8 @@
|
|||||||
that.updateDisplay();
|
that.updateDisplay();
|
||||||
$("#result>table").addClass("auto-refresh");
|
$("#result>table").addClass("auto-refresh");
|
||||||
location.hash = "#result";
|
location.hash = "#result";
|
||||||
trainSuggest.isSuggestLoopDisabled = false;
|
|
||||||
trainSuggest.clearQueryResultCache();
|
trainSuggest.clearQueryResultCache();
|
||||||
|
onceTransit.clearQueryResultCache();
|
||||||
|
|
||||||
//track
|
//track
|
||||||
var cp = sessMgr.currentProfile;
|
var cp = sessMgr.currentProfile;
|
||||||
@ -223,6 +227,7 @@
|
|||||||
sessMgr.currentProfile.depDate = $("#dep_date").val();
|
sessMgr.currentProfile.depDate = $("#dep_date").val();
|
||||||
//currentSelectedDate = null;
|
//currentSelectedDate = null;
|
||||||
trainSuggest.clearQueryResultCache();
|
trainSuggest.clearQueryResultCache();
|
||||||
|
onceTransit.clearQueryResultCache();
|
||||||
|
|
||||||
$("tr.train-needauto").show();
|
$("tr.train-needauto").show();
|
||||||
//隐藏监控
|
//隐藏监控
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
var data = require("../data.js");
|
var data = require("../data.js");
|
||||||
var passenger = require("../otn/passenger.js");
|
var passenger = require("../otn/passenger.js");
|
||||||
var port = require("../platform/extensionPort.js");
|
var port = require("../platform/extensionPort.js");
|
||||||
|
var login = require("./ui-login.js");
|
||||||
|
|
||||||
require("./widget_modalDialog.js");
|
require("./widget_modalDialog.js");
|
||||||
|
|
||||||
@ -33,6 +34,11 @@
|
|||||||
performSearch();
|
performSearch();
|
||||||
}).fail(function (msg) {
|
}).fail(function (msg) {
|
||||||
mp.showMessagePopup("error", "加载联系人失败:" + msg);
|
mp.showMessagePopup("error", "加载联系人失败:" + msg);
|
||||||
|
|
||||||
|
if (msg.indexOf("登录") !== -1) {
|
||||||
|
login.showLoginDialog();
|
||||||
|
}
|
||||||
|
|
||||||
uiDlg.removeClass("loading");
|
uiDlg.removeClass("loading");
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -521,7 +527,7 @@
|
|||||||
if (!cp || !cp.dateloop)
|
if (!cp || !cp.dateloop)
|
||||||
return;
|
return;
|
||||||
var idx = _.indexOf(cp.dateloop, d);
|
var idx = _.indexOf(cp.dateloop, d);
|
||||||
if (idx == -1)
|
if (idx === -1)
|
||||||
return;
|
return;
|
||||||
cp.dateloop.splice(idx, 1);
|
cp.dateloop.splice(idx, 1);
|
||||||
sessmgr.save();
|
sessmgr.save();
|
||||||
@ -558,19 +564,18 @@
|
|||||||
isRecommand: function (seat) { return _.indexOf(recommand, seat) != -1; },
|
isRecommand: function (seat) { return _.indexOf(recommand, seat) != -1; },
|
||||||
getName: data.toSeatTypeName
|
getName: data.toSeatTypeName
|
||||||
}));
|
}));
|
||||||
|
|
||||||
dropDown = container.find("ul");
|
dropDown = container.find("ul");
|
||||||
dropDown.mousedown(function (e) {
|
dropDown.mousedown(function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}).click(function () {
|
}).click(function () {
|
||||||
input[0].focus();
|
input[0].focus();
|
||||||
});
|
}).append($("<li></li>").append($("#opt_seat_first, #opt_seat_tb").show()));
|
||||||
};
|
};
|
||||||
var initProfile = function () {
|
var initProfile = function () {
|
||||||
cp = sessmgr.currentProfile;
|
cp = sessmgr.currentProfile;
|
||||||
container.find("span.optional-block").remove();
|
container.find("span.optional-block").remove();
|
||||||
dropDown.find(":checkbox").prop("checked", false);
|
dropDown.find(":checkbox:not([data-profile-key])").prop("checked", false);
|
||||||
if (!cp || !cp.selectedSeatType)
|
if (!cp || !cp.selectedSeatType)
|
||||||
return;
|
return;
|
||||||
container.append(listTpl({
|
container.append(listTpl({
|
||||||
@ -606,7 +611,7 @@
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var idx = _.indexOf(cp.selectedSeatType, code);
|
var idx = _.indexOf(cp.selectedSeatType, code);
|
||||||
if (idx == -1)
|
if (idx === -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cp.selectedSeatType.splice(idx, 1);
|
cp.selectedSeatType.splice(idx, 1);
|
||||||
@ -614,7 +619,7 @@
|
|||||||
container.find(">span[data-code='" + code + "']").remove();
|
container.find(">span[data-code='" + code + "']").remove();
|
||||||
dropDown.find(":checkbox[value='" + code + "']").prop("checked", false);
|
dropDown.find(":checkbox[value='" + code + "']").prop("checked", false);
|
||||||
};
|
};
|
||||||
container.on("change", ":checkbox", function () {
|
container.on("change", ":checkbox:not([data-profile-key])", function () {
|
||||||
if (this.checked)
|
if (this.checked)
|
||||||
exports.addSeat(this.value);
|
exports.addSeat(this.value);
|
||||||
else exports.removeSeat(this.value);
|
else exports.removeSeat(this.value);
|
||||||
|
424
Web12306/js/ui/ui-oncetrainsitquery.js
Normal file
424
Web12306/js/ui/ui-oncetrainsitquery.js
Normal file
@ -0,0 +1,424 @@
|
|||||||
|
define(function (require, exports, module) {
|
||||||
|
var data = require("../data.js");
|
||||||
|
var sessmgr = require("../account/sessionMgr.js");
|
||||||
|
var query = require("../otn/queryticket.js");
|
||||||
|
var utility = require("../utility.js");
|
||||||
|
var cachedSuggest = JSON.parse(localStorage['trainTransit'] || '{"key":"", "data":null}');
|
||||||
|
var loadTime = 1000;
|
||||||
|
var mp = require("./widget_message_popup.js");
|
||||||
|
|
||||||
|
//DOM
|
||||||
|
var listContainer = $("#oncetrainsit");
|
||||||
|
var listTemplate = listContainer.find(">script").doT();
|
||||||
|
var listTarget = listContainer.find(">section");
|
||||||
|
|
||||||
|
var cp = sessmgr.currentProfile;
|
||||||
|
sessmgr.on("currentProfileChanged", function () {
|
||||||
|
cp = sessmgr.currentProfile;
|
||||||
|
});
|
||||||
|
|
||||||
|
var isInQuery = false;
|
||||||
|
var startQueryLimit = data.startTrainStationSuggestQueryLimit;
|
||||||
|
var isSuggestLoopDisabled = false;
|
||||||
|
var isSuggestReported = false;
|
||||||
|
|
||||||
|
//当前查询结果
|
||||||
|
var currentResult = null;
|
||||||
|
var forceShowSuggestion = false;
|
||||||
|
var showlevel = 1;
|
||||||
|
var currentTransit;
|
||||||
|
var queryQueue, queryKeyQueue;
|
||||||
|
var queryLoopTimer = null;
|
||||||
|
var lastLoopKey = null;
|
||||||
|
|
||||||
|
var calculateTimeForCompare = function (trainClass, minutes) {
|
||||||
|
var rate = 1.0;
|
||||||
|
switch (trainClass) {
|
||||||
|
case 'G':
|
||||||
|
rate = 1.0;
|
||||||
|
break;
|
||||||
|
case 'D':
|
||||||
|
rate = 0.71428;
|
||||||
|
break;
|
||||||
|
case 'Z':
|
||||||
|
rate = 0.45714;
|
||||||
|
break;
|
||||||
|
case 'T':
|
||||||
|
rate = 0.4;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
rate = 0.28571;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Math.floor(rate * minutes);
|
||||||
|
};
|
||||||
|
|
||||||
|
var setQueryResult = function (result, queryCount) {
|
||||||
|
currentResult = result;
|
||||||
|
var cacheKey = cp.fromCode + cp.toCode + cp.depDate;
|
||||||
|
if (!isAutoShowTransit())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
if (cachedSuggest.key === cacheKey) {
|
||||||
|
if (cachedSuggest.data === null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
//load result;
|
||||||
|
isInQuery = true;
|
||||||
|
|
||||||
|
var cdata = _.clone(cachedSuggest.data);
|
||||||
|
prepareData(cdata);
|
||||||
|
renderTransitResult(cdata);
|
||||||
|
} else {
|
||||||
|
//判断检测等级
|
||||||
|
//1-自动检测换乘,要求车次在4趟以下,无始发终到
|
||||||
|
//2-不建议换乘,在上述条件以外
|
||||||
|
|
||||||
|
var url = "http://12306.fishlee.net/tt/tor?date=" + cp.depDate + "&from=" + cp.fromCode + "&to=" + cp.toCode + "&maxAge=" + getCalcBasedTime();
|
||||||
|
var dlg = forceShowSuggestion ? mp.showMessagePopup("loading", "查询换乘中,请稍等...") : null;
|
||||||
|
$.get(url).done(function (resp) {
|
||||||
|
if (!resp || !resp.ret) {
|
||||||
|
dlg.setState("error", (resp && resp.msg) || "咱的服务器计算不过来了,请等等服务器...");
|
||||||
|
dlg.delayClose();
|
||||||
|
isInQuery = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cachedSuggest.key = cacheKey;
|
||||||
|
cachedSuggest.data = _.clone(resp.data);
|
||||||
|
localStorage['trainTransit'] = JSON.stringify(cachedSuggest);
|
||||||
|
|
||||||
|
if (!resp.data)
|
||||||
|
return;
|
||||||
|
|
||||||
|
prepareData(resp.data);
|
||||||
|
renderTransitResult(resp.data);
|
||||||
|
if (dlg)
|
||||||
|
dlg.close();
|
||||||
|
}).fail(function () {
|
||||||
|
if (dlg) {
|
||||||
|
dlg.setState("error", "咱的服务器计算不过来了,请等等服务器...");
|
||||||
|
dlg.delayClose();
|
||||||
|
isInQuery = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
isInQuery = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var prepareData = function (result) {
|
||||||
|
//城市
|
||||||
|
var corder = result.corder;
|
||||||
|
var line;
|
||||||
|
|
||||||
|
result.corderName = [];
|
||||||
|
for (var j = 0; j < corder.length; j++) {
|
||||||
|
var city = data.cities[corder[j]];
|
||||||
|
if (!city) {
|
||||||
|
corder.splice(j, 1);
|
||||||
|
j--;
|
||||||
|
} else {
|
||||||
|
result.corderName.push(city.n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//推荐线路
|
||||||
|
result.recommandLines = _.map(result.toplines, function (index) { return result.lines[index]; });
|
||||||
|
//线路
|
||||||
|
var lines = result.lines;
|
||||||
|
for (var i = 0; i < lines.length; i++) {
|
||||||
|
line = lines[i];
|
||||||
|
line.first.fromName = data.getCityName(line.first.from);
|
||||||
|
line.first.toName = data.getCityName(line.first.to);
|
||||||
|
line.second.fromName = data.getCityName(line.second.from);
|
||||||
|
line.second.toName = data.getCityName(line.second.to);
|
||||||
|
|
||||||
|
if (!line.second.fromName || !line.second.toName || !line.first.fromName || !line.first.toName) {
|
||||||
|
lines.splice(i, 1);
|
||||||
|
i--;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//时间
|
||||||
|
line.first.leftShort = /\s(\d+:\d+)/.exec(line.first.left) && RegExp.$1;
|
||||||
|
line.first.arriveShort = /\s(\d+:\d+)/.exec(line.first.arrive) && RegExp.$1;
|
||||||
|
line.first.days = utility.getDaysDifference(line.first.left, line.first.arrive);
|
||||||
|
line.first.elapsedStr = utility.formatMinutesToShortStr(line.first.elapsed);
|
||||||
|
|
||||||
|
line.second.leftShort = /\s(\d+:\d+)/.exec(line.second.left) && RegExp.$1;
|
||||||
|
line.second.arriveShort = /\s(\d+:\d+)/.exec(line.second.arrive) && RegExp.$1;
|
||||||
|
line.second.leftDays = utility.getDaysDifference(line.first.left, line.second.left);
|
||||||
|
line.second.arriveDays = utility.getDaysDifference(line.first.left, line.second.arrive);
|
||||||
|
line.second.elapsedStr = utility.formatMinutesToShortStr(line.second.elapsed);
|
||||||
|
|
||||||
|
line.totalTimeStr = utility.formatMinutesToShortStr(line.total);
|
||||||
|
line.waitTimeStr = utility.formatMinutesToShortStr(line.wait);
|
||||||
|
}
|
||||||
|
|
||||||
|
//过滤推荐线路
|
||||||
|
for (var k = 0; k < result.recommandLines.length; k++) {
|
||||||
|
line = result.recommandLines[k];
|
||||||
|
if (!line.second.fromName || !line.second.toName || !line.first.fromName || !line.first.toName) {
|
||||||
|
result.recommandLines.splice(k, 1);
|
||||||
|
k--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var renderTransitResult = function (result) {
|
||||||
|
if (result) {
|
||||||
|
currentTransit = result;
|
||||||
|
|
||||||
|
if (forceShowSuggestion) {
|
||||||
|
listContainer.slideDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (showlevel == 1)
|
||||||
|
currentTransit.showLines = currentTransit.recommandLines;
|
||||||
|
else if (showlevel == 2) {
|
||||||
|
currentTransit.showLines = _.where(currentTransit.lines, { ne: false });
|
||||||
|
if (!currentTransit.showLines || !currentTransit.showLines.length)
|
||||||
|
currentTransit.showLines = currentTransit.lines;
|
||||||
|
}
|
||||||
|
else currentTransit.showLines = currentTransit.lines;
|
||||||
|
|
||||||
|
var html = listTemplate(currentTransit, {
|
||||||
|
u: utility,
|
||||||
|
d: data,
|
||||||
|
l: showlevel
|
||||||
|
});
|
||||||
|
|
||||||
|
listTarget.html(html);
|
||||||
|
|
||||||
|
queryQueue = _.groupBy(_.flatten(_.map(currentTransit.showLines, function (line) { return [line.first, line.second]; })), function (seg) {
|
||||||
|
seg.key = seg.from + "," + seg.fromName + "," + seg.to + "," + seg.toName + "," + seg.left.split(' ')[0];
|
||||||
|
seg.queryData = seg.key.split(',');
|
||||||
|
seg.queryData.push(false);
|
||||||
|
seg.queryData.push(false);
|
||||||
|
seg.queryData.push(true);
|
||||||
|
seg.queryData.push(true);
|
||||||
|
seg.queryData.push(false);
|
||||||
|
seg.target = null;
|
||||||
|
|
||||||
|
return seg.key;
|
||||||
|
});
|
||||||
|
queryKeyQueue = _.keys(queryQueue);
|
||||||
|
loadTime = 1000;
|
||||||
|
lastLoopKey = null;
|
||||||
|
startQueryTimer();
|
||||||
|
};
|
||||||
|
|
||||||
|
var getCalcBasedTime = function () {
|
||||||
|
var times = _.map(currentResult.original, function (t) {
|
||||||
|
return calculateTimeForCompare(t.code[0], utility.parseTimeSpanToMinutes(t.elapsedTime.total));
|
||||||
|
});
|
||||||
|
|
||||||
|
return times.length ? (_.max(times) + _.min(times)) / 2 : 999999;
|
||||||
|
};
|
||||||
|
|
||||||
|
var isAutoShowTransit = function () {
|
||||||
|
if (forceShowSuggestion)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
//无效数据,或车次数大于4
|
||||||
|
if (!currentResult || !currentResult.original || currentResult.original.length >= 4) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//如果存在始发终到车
|
||||||
|
if (_.some(currentResult.original, function (x) {
|
||||||
|
return x.from.endpoint && x.to.endpoint;
|
||||||
|
}))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var closeTransitSuggest = function () {
|
||||||
|
clearQueryTimer();
|
||||||
|
isSuggestLoopDisabled = true;
|
||||||
|
listContainer.slideUp();
|
||||||
|
};
|
||||||
|
|
||||||
|
var clearQueryTimer = function () {
|
||||||
|
if (!queryLoopTimer)
|
||||||
|
return;
|
||||||
|
|
||||||
|
clearInterval(queryLoopTimer);
|
||||||
|
queryLoopTimer = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
var startQueryTimer = function () {
|
||||||
|
if (queryLoopTimer)
|
||||||
|
return;
|
||||||
|
|
||||||
|
queryLoopTimer = setTimeout(queryLoop, loadTime);
|
||||||
|
};
|
||||||
|
|
||||||
|
var queryLoop = function () {
|
||||||
|
if (!queryKeyQueue || !queryKeyQueue.length)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var key = queryKeyQueue.shift();
|
||||||
|
var trains = queryQueue[key];
|
||||||
|
queryKeyQueue.push(key);
|
||||||
|
lastLoopKey = lastLoopKey || key;
|
||||||
|
|
||||||
|
var date = trains[0].queryData[4];
|
||||||
|
var trainCodes = _.groupBy(trains, function (x) {
|
||||||
|
return x.train.code;
|
||||||
|
});
|
||||||
|
|
||||||
|
var processResponse = function (loaded, result) {
|
||||||
|
queryLoopTimer = null;
|
||||||
|
|
||||||
|
_.each(_.keys(trainCodes), function (code) {
|
||||||
|
var ele = listTarget.find("tr.ticket-container td[data-date='" + date + "'][data-traincode='" + code + "']");
|
||||||
|
ele.empty();
|
||||||
|
if (!loaded) {
|
||||||
|
ele.append("<span class='remark remark-warning'>查询发生错误</span>");
|
||||||
|
} else if (result.notInSellTime) {
|
||||||
|
ele.append("<span class='remark remark-warning'>当日车次不在预售期</span>");
|
||||||
|
//从列表中移除,这个车次之后不用再查了。
|
||||||
|
delete queryQueue[key];
|
||||||
|
queryKeyQueue.pop();
|
||||||
|
} else if (result.selltime) {
|
||||||
|
ele.append("<span class='remark remark-primary'>" + utility.format + "</span>");
|
||||||
|
} else {
|
||||||
|
//显示余票信息
|
||||||
|
var train = _.findWhere(result.original, { code: code });
|
||||||
|
if (!train) {
|
||||||
|
//车次不存在,可能是过程中会自动变号的车次
|
||||||
|
ele.closest("tr").prevUntil(".header, .ticket-container").andSelf().remove();
|
||||||
|
|
||||||
|
//从列表中移除
|
||||||
|
var args = _.clone(trainCodes[code]);
|
||||||
|
args.unshift(trains);
|
||||||
|
queryQueue[key] = _.without.apply(this, args);
|
||||||
|
|
||||||
|
console.log("中转站查询:找不到车次 " + code + ", 查询信息:" + key);
|
||||||
|
|
||||||
|
//从缓存的信息中移除。
|
||||||
|
var matchedLines = _.filter(currentTransit.lines, function (line) {
|
||||||
|
return _.some(trainCodes[code], function (t) { return t === line.first || t === line.second; });
|
||||||
|
});
|
||||||
|
delete trainCodes[code];
|
||||||
|
if (matchedLines && matchedLines.length) {
|
||||||
|
matchedLines.unshift(currentTransit.lines);
|
||||||
|
currentTransit.lines = _.without.apply(this, matchedLines);
|
||||||
|
|
||||||
|
matchedLines[0] = currentTransit.recommandLines;
|
||||||
|
currentTransit.recommandLines = _.without.apply(this, matchedLines);
|
||||||
|
}
|
||||||
|
} else if (train.limitSellInfo) {
|
||||||
|
//限售信息
|
||||||
|
ele.append("<span class='remark remark-warning'>" + train.limitSellInfo + "</span>");
|
||||||
|
delete trainCodes[code];
|
||||||
|
} else if (train.selltime) {
|
||||||
|
ele.append("<span class='remark remark-primary'>" + utility.formatSellDate(train.limitSellInfo) + "</span>");
|
||||||
|
} else if (train.available < 1) {
|
||||||
|
ele.append("<span class='remark remark-warning'>本车次暂无可售票</span>");
|
||||||
|
} else {
|
||||||
|
_.each(trainCodes[code], function (t) {
|
||||||
|
t.secureStr = train.secureStr;
|
||||||
|
t.rtrain = train;
|
||||||
|
});
|
||||||
|
//显示车次车票
|
||||||
|
var tickets = [];
|
||||||
|
_.each(data.seatDisplayOrder, function (seat) {
|
||||||
|
var seatinfo = train.ticketMap[seat];
|
||||||
|
//不显示无票以及没有的席别
|
||||||
|
if (!seatinfo || !seatinfo.count) return;
|
||||||
|
|
||||||
|
var selected = cp && $.inArray(seat, cp.selectedSeatType) !== -1;
|
||||||
|
tickets.push("<button class='button button-" + (selected ? "primary" : "default") + " btn-ticket-block' data-seatcode='" + seat + "' data-traincode='" + code + "' data-sec='" + train.secureStr + "' data-transmit='1'>" + seatinfo.name + " " + seatinfo.count + "张 " + (seatinfo.price > 0 ? "¥" + (seatinfo.price / 10) : "") + "</button>");
|
||||||
|
});
|
||||||
|
ele.append(tickets.join(""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!_.keys(trainCodes).length && queryQueue[key]) {
|
||||||
|
//已经没有车次了。。移除
|
||||||
|
delete queryQueue[key];
|
||||||
|
queryKeyQueue.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query.queryTicket.apply(this, trains[0].queryData)
|
||||||
|
.done(function () {
|
||||||
|
processResponse(true, this);
|
||||||
|
}).fail(function () {
|
||||||
|
processResponse(false);
|
||||||
|
}).always(function () {
|
||||||
|
if (queryKeyQueue[0] === lastLoopKey) {
|
||||||
|
loadTime = 5000;
|
||||||
|
|
||||||
|
if (listContainer.find("table tr").length > 1) {
|
||||||
|
listContainer.slideDown();
|
||||||
|
queryLoopTimer = setTimeout(queryLoop, loadTime);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
queryLoopTimer = setTimeout(queryLoop, loadTime);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
listContainer.on("change", "input[name=tt_level]", function () {
|
||||||
|
showlevel = listContainer.find("input[name=tt_level]:checked").val();
|
||||||
|
renderTransitResult();
|
||||||
|
});
|
||||||
|
listContainer.find(">header>a").click(closeTransitSuggest);
|
||||||
|
|
||||||
|
var ctx = {
|
||||||
|
setQueryResult: function (result, queryCount) {
|
||||||
|
if (cp.resign || cp.studentTicket || isSuggestLoopDisabled)
|
||||||
|
return false;
|
||||||
|
if ((queryCount < startQueryLimit && !forceShowSuggestion) || isInQuery || isSuggestLoopDisabled)
|
||||||
|
return isInQuery;
|
||||||
|
|
||||||
|
return setQueryResult(result, queryCount);
|
||||||
|
},
|
||||||
|
clearQueryResultCache: function () {
|
||||||
|
isSuggestLoopDisabled = false;
|
||||||
|
isSuggestReported = false;
|
||||||
|
isInQuery = false;
|
||||||
|
forceShowSuggestion = false;
|
||||||
|
clearQueryTimer();
|
||||||
|
},
|
||||||
|
findTrain: function (secstr) {
|
||||||
|
var train = _.findWhere(_.flatten(_.map(_.values(currentTransit.lines), function (t) { return [t.first, t.second]; })), { secureStr: secstr });
|
||||||
|
return train && train.rtrain;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Object.defineProperty(ctx, "isInSuggestQuery", {
|
||||||
|
get: function () {
|
||||||
|
return isInQuery;
|
||||||
|
},
|
||||||
|
set: function (value) {
|
||||||
|
isInQuery = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Object.defineProperty(ctx, "isSuggestLoopDisabled",
|
||||||
|
{
|
||||||
|
get: function () {
|
||||||
|
return isSuggestLoopDisabled;
|
||||||
|
},
|
||||||
|
set: function (value) {
|
||||||
|
isSuggestLoopDisabled = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Object.defineProperty(ctx, "forceTransit",
|
||||||
|
{
|
||||||
|
get: function () {
|
||||||
|
return forceShowSuggestion;
|
||||||
|
},
|
||||||
|
set: function (value) {
|
||||||
|
forceShowSuggestion = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return ctx;
|
||||||
|
});
|
@ -97,7 +97,7 @@
|
|||||||
pPassengers[0].seat,
|
pPassengers[0].seat,
|
||||||
pPassengers.length,
|
pPassengers.length,
|
||||||
pTrain.byAuto ? 1 : 0,
|
pTrain.byAuto ? 1 : 0,
|
||||||
pTrain.suggest ? 1 : 0
|
pTrain.suggest || 0
|
||||||
]);
|
]);
|
||||||
|
|
||||||
submitBtn[0].disabled = true;
|
submitBtn[0].disabled = true;
|
||||||
@ -122,7 +122,7 @@
|
|||||||
pPassengers[0].seat,
|
pPassengers[0].seat,
|
||||||
pPassengers.length,
|
pPassengers.length,
|
||||||
pTrain.byAuto ? 1 : 0,
|
pTrain.byAuto ? 1 : 0,
|
||||||
pTrain.suggest ? 1 : 0
|
pTrain.suggest || 0
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
submitDef.fail(function (data) {
|
submitDef.fail(function (data) {
|
||||||
@ -151,7 +151,7 @@
|
|||||||
pPassengers[0].seat,
|
pPassengers[0].seat,
|
||||||
pPassengers.length,
|
pPassengers.length,
|
||||||
pTrain.byAuto ? 1 : 0,
|
pTrain.byAuto ? 1 : 0,
|
||||||
pTrain.suggest ? 1 : 0
|
pTrain.suggest || 0
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
submitDef.progress(function (data) {
|
submitDef.progress(function (data) {
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
var utility = require("../utility.js");
|
var utility = require("../utility.js");
|
||||||
var port = require("../platform/extensionPort.js");
|
var port = require("../platform/extensionPort.js");
|
||||||
var media = require("../platform/media.js");
|
var media = require("../platform/media.js");
|
||||||
|
var transmit = require("./ui-oncetrainsitquery.js");
|
||||||
|
|
||||||
//引入过滤
|
//引入过滤
|
||||||
require("../otn/trainfilter.js").init();
|
require("../otn/trainfilter.js").init();
|
||||||
@ -39,7 +40,8 @@
|
|||||||
$("#result").html(tpl(data, {
|
$("#result").html(tpl(data, {
|
||||||
param: param,
|
param: param,
|
||||||
parser: parser,
|
parser: parser,
|
||||||
utility: utility
|
utility: utility,
|
||||||
|
cp: sessMgr.currentProfile
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
this.resetStatus = function () {
|
this.resetStatus = function () {
|
||||||
@ -165,17 +167,20 @@
|
|||||||
__.load();
|
__.load();
|
||||||
});
|
});
|
||||||
//监听订票请求
|
//监听订票请求
|
||||||
$(document).on("click", "a.ticket-block", function () {
|
$(document).on("click", ".ticket-block, .btn-ticket-block", function() {
|
||||||
var id = this.dataset.traincode;
|
var id = this.dataset.traincode;
|
||||||
var seatcode = this.dataset.seatcode;
|
var seatcode = this.dataset.seatcode;
|
||||||
var train;
|
var train;
|
||||||
var cp = sessMgr.currentProfile;
|
var cp = sessMgr.currentProfile;
|
||||||
var bySuggest = false;
|
|
||||||
|
|
||||||
if (this.dataset.suggest) {
|
if (this.dataset.suggest) {
|
||||||
train = trainSuggest.findTrain(this.dataset.sec);
|
train = trainSuggest.findTrain(this.dataset.sec);
|
||||||
train.suggest = true;
|
train.suggest = 1;
|
||||||
bySuggest = true;
|
} else if (this.dataset.transmit) {
|
||||||
|
train = transmit.findTrain(this.dataset.sec);
|
||||||
|
if (!train)
|
||||||
|
return;
|
||||||
|
train.suggest = 2;
|
||||||
} else {
|
} else {
|
||||||
train = _.findWhere(queryResult.original, { id: id });
|
train = _.findWhere(queryResult.original, { id: id });
|
||||||
}
|
}
|
||||||
@ -188,9 +193,9 @@
|
|||||||
var pas = _.first(cp.passengers || [], pcount);
|
var pas = _.first(cp.passengers || [], pcount);
|
||||||
seatcode = seatcode === "0" ? (train.ticketMap['1'] ? "1" : "O") : seatcode;
|
seatcode = seatcode === "0" ? (train.ticketMap['1'] ? "1" : "O") : seatcode;
|
||||||
|
|
||||||
pas.forEach(function (p) { p.seat = seatcode; });
|
pas.forEach(function(p) { p.seat = seatcode; });
|
||||||
if (cp.submitStuAsCommon && !cp.studentTicket) {
|
if (cp.submitStuAsCommon && !cp.studentTicket) {
|
||||||
pas.forEach(function (p) { if (p.passenger_type == "3") p.passenger_type = "1"; });
|
pas.forEach(function(p) { if (p.passenger_type == "3") p.passenger_type = "1"; });
|
||||||
}
|
}
|
||||||
train.byAuto = true;
|
train.byAuto = true;
|
||||||
__.dispatchEvent("requireSubmitOrder", {
|
__.dispatchEvent("requireSubmitOrder", {
|
||||||
@ -209,6 +214,10 @@
|
|||||||
// ]);
|
// ]);
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
}).on("click", "#btn_start_transit", function () {
|
||||||
|
transmit.clearQueryResultCache();
|
||||||
|
transmit.forceTransit = true;
|
||||||
|
transmit.setQueryResult(queryResult);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
init();
|
init();
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
var that = this;
|
var that = this;
|
||||||
var today = utility.addDays(new Date(), 0);
|
var today = utility.addDays(new Date(), 0);
|
||||||
var date = null;
|
var date = null;
|
||||||
var maxdays = utility.addDays(today, 30);
|
var maxdays = utility.maxDate;
|
||||||
var currentHightDate = today;
|
var currentHightDate = today;
|
||||||
|
|
||||||
ev.apply(this);
|
ev.apply(this);
|
||||||
|
@ -32,7 +32,11 @@
|
|||||||
var cell = cells.eq(i);
|
var cell = cells.eq(i);
|
||||||
cell.html(dateTmp.getDate());
|
cell.html(dateTmp.getDate());
|
||||||
cell.removeClass();
|
cell.removeClass();
|
||||||
if (dateTmp.getMonth() !== thismonth || dateTmp.getTime() < minTime) {
|
|
||||||
|
if (dateTmp.getMonth() === thismonth) {
|
||||||
|
cell.addClass("date-thismonth");
|
||||||
|
}
|
||||||
|
if (/*dateTmp.getMonth() !== thismonth || */dateTmp.getTime() < minTime) {
|
||||||
cell.addClass("date-notavailable");
|
cell.addClass("date-notavailable");
|
||||||
}else if (dateTmp.getTime() === currentDate.getTime()) {
|
}else if (dateTmp.getTime() === currentDate.getTime()) {
|
||||||
cell.addClass("date-current");
|
cell.addClass("date-current");
|
||||||
|
@ -5,9 +5,7 @@
|
|||||||
d = new Date(d + '');
|
d = new Date(d + '');
|
||||||
}
|
}
|
||||||
|
|
||||||
var x = new Date();
|
return new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
||||||
x.setTime(d.getTime() - d.getTime() % (1000 * 3600 * 24));
|
|
||||||
return x;
|
|
||||||
};
|
};
|
||||||
//exports.addDays = function (date, days) {
|
//exports.addDays = function (date, days) {
|
||||||
// var x = new Date();
|
// var x = new Date();
|
||||||
@ -22,7 +20,6 @@
|
|||||||
date = exports.toDate(date);
|
date = exports.toDate(date);
|
||||||
return new Date(date.getFullYear(), date.getMonth() + offset, date.getDate());
|
return new Date(date.getFullYear(), date.getMonth() + offset, date.getDate());
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.toDate = function (date) {
|
exports.toDate = function (date) {
|
||||||
if (date instanceof Date)
|
if (date instanceof Date)
|
||||||
return date;
|
return date;
|
||||||
@ -77,10 +74,7 @@
|
|||||||
exports.getDaysDifference = function (date1, date2) {
|
exports.getDaysDifference = function (date1, date2) {
|
||||||
/// <summary>获得date1到date2之间隔了多少天</summary>
|
/// <summary>获得date1到date2之间隔了多少天</summary>
|
||||||
|
|
||||||
var time1 = Math.floor(exports.toDate(date1).getTime() / 1000 / 60 / 60 / 24);
|
return Math.floor((exports.trimToDay(exports.toDate(date2)).getTime()-exports.trimToDay(exports.toDate(date1)).getTime()) / 1000 / 60 / 60 / 24);
|
||||||
var time2 = Math.floor(exports.toDate(date2).getTime() / 1000 / 60 / 60 / 24);
|
|
||||||
|
|
||||||
return time2 - time1;
|
|
||||||
}
|
}
|
||||||
exports.format24hTo12h = function (str) {
|
exports.format24hTo12h = function (str) {
|
||||||
/// <summary>将24小时制式时间转换为12小时制式</summary>
|
/// <summary>将24小时制式时间转换为12小时制式</summary>
|
||||||
@ -130,7 +124,19 @@
|
|||||||
exports.getVcValidate = function (vc) {
|
exports.getVcValidate = function (vc) {
|
||||||
return vc + " " + new Date().toLocaleDateString() + " keyup " + JSON.stringify({ keyCode: vc.charCodeAt(vc.length - 1) });
|
return vc + " " + new Date().toLocaleDateString() + " keyup " + JSON.stringify({ keyCode: vc.charCodeAt(vc.length - 1) });
|
||||||
};
|
};
|
||||||
|
exports.parseTimeSpanToMinutes = function (value) {
|
||||||
|
/// <summary>将“小时:分钟”格式的时间标签转换为分钟</summary>
|
||||||
|
return /0*(\d+)\s*:\s*0*(\d+)/.exec(value) ? (parseInt(RegExp.$1, 10) * 60 + parseInt(RegExp.$2)) : 0;
|
||||||
|
};
|
||||||
|
exports.formatMinutesToShortStr = function (minutes) {
|
||||||
|
/// <summary>将分钟格式化为时间字符串</summary>
|
||||||
|
|
||||||
|
var days = Math.floor(minutes / 1440);
|
||||||
|
var hours = Math.floor(minutes % 1440 / 60);
|
||||||
|
minutes = minutes % 60;
|
||||||
|
|
||||||
|
return (days > 0 ? days + "天" : "") + (hours > 0 ? hours + "小时" : "") + (minutes > 0 ? minutes + "分钟" : "");
|
||||||
|
};
|
||||||
$.fn.toBase64Data = function () {
|
$.fn.toBase64Data = function () {
|
||||||
var arr = [];
|
var arr = [];
|
||||||
this.each(function () {
|
this.each(function () {
|
||||||
|
16
build.cmd
16
build.cmd
@ -20,16 +20,16 @@ rem copy tools\onInstall_openWelcome.js deploy\air\js\background\onInstall.js /Y
|
|||||||
rem "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--pack-extension=%~dp0deploy" "--pack-extension-key=%~dp0src_lb.pem"
|
rem "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--pack-extension=%~dp0deploy" "--pack-extension-key=%~dp0src_lb.pem"
|
||||||
rem ren deploy.crx 12306订票助手(猎豹浏览器专版)_打开欢迎页.crx
|
rem ren deploy.crx 12306订票助手(猎豹浏览器专版)_打开欢迎页.crx
|
||||||
|
|
||||||
BuildTools\SourceFileUtility.exe deploy\manifest.json ", ""infobars""" ", ""experimental"""
|
rem BuildTools\SourceFileUtility.exe deploy\manifest.json ", ""infobars""" ", ""experimental"""
|
||||||
BuildTools\SourceFileUtility.exe deploy\manifest.json ".1""," ".0"","
|
rem BuildTools\SourceFileUtility.exe deploy\manifest.json ".1""," ".0"","
|
||||||
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--pack-extension=%~dp0deploy" "--pack-extension-key=%~dp0src_lb.pem"
|
rem "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--pack-extension=%~dp0deploy" "--pack-extension-key=%~dp0src_lb.pem"
|
||||||
ren deploy.crx 12306订票助手(猎豹浏览器专版)_B29.crx
|
rem ren deploy.crx 12306订票助手(猎豹浏览器专版)_B29.crx
|
||||||
|
|
||||||
|
|
||||||
BuildTools\SourceFileUtility.exe deploy\manifest.json ", ""experimental""" ""
|
rem BuildTools\SourceFileUtility.exe deploy\manifest.json ", ""experimental""" ""
|
||||||
BuildTools\SourceFileUtility.exe deploy\manifest.json "44/44/update_lb.xml" "44/44/update_chrome.xml"
|
rem BuildTools\SourceFileUtility.exe deploy\manifest.json "44/44/update_lb.xml" "44/44/update_chrome.xml"
|
||||||
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--pack-extension=%~dp0deploy" "--pack-extension-key=%~dp0src_lb.pem"
|
rem "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--pack-extension=%~dp0deploy" "--pack-extension-key=%~dp0src_lb.pem"
|
||||||
ren deploy.crx 12306订票助手_Chrome.crx
|
rem ren deploy.crx 12306订票助手_Chrome.crx
|
||||||
|
|
||||||
|
|
||||||
rem experimental
|
rem experimental
|
||||||
|
Loading…
Reference in New Issue
Block a user