diff --git a/RwTicketAssistantV2/app/air/js/init.js b/RwTicketAssistantV2/app/air/js/init.js index 9df0932..c9860a5 100644 --- a/RwTicketAssistantV2/app/air/js/init.js +++ b/RwTicketAssistantV2/app/air/js/init.js @@ -9,4 +9,10 @@ $(document).ready(function() { //} (new Gallery()).initShow('intro12306'); + + + //HACK 解决chrome34核中蛋疼的弹出层滚动条bug + setTimeout(function() { + $("div.wrap").css("height", "371px"); + }, 10); }); diff --git a/RwTicketAssistantV2/app/air/popup.html b/RwTicketAssistantV2/app/air/popup.html index b6de4b3..3986a53 100644 --- a/RwTicketAssistantV2/app/air/popup.html +++ b/RwTicketAssistantV2/app/air/popup.html @@ -1,4 +1,4 @@ -锘 +锘 @@ -6,6 +6,7 @@ +
diff --git a/RwTicketAssistantV2/app/background.js b/RwTicketAssistantV2/app/background.js index 7c2a25f..175d597 100644 --- a/RwTicketAssistantV2/app/background.js +++ b/RwTicketAssistantV2/app/background.js @@ -1005,11 +1005,12 @@ window.cbl = function (u, h) { } }); setInterval(function () { + entry12306 = false; chrome.tabs.query({ url: "*://*.12306.cn/otn*" }, function (a) { - entry12306 = a && a.length > 0; + entry12306 |= a && a.length > 0; }); chrome.tabs.query({ url: "*://12306.*/*" }, function (a) { - entry12306 = a && a.length > 0; + entry12306 |= a && a.length > 0; }); }, 20000); })(); @@ -1323,7 +1324,7 @@ window.cbl = function (u, h) { if (!m || !m.action) return; - if (m.action === "serverStateChange") + if (m.action === "serverStateChange" || m.action === "sysConfigUpdate") postMessageToPort(m); }); @@ -1444,6 +1445,7 @@ window.cbl = function (u, h) { var task = alarmData[btnId]; var data = task.data; + delete alarmData[btnId]; chrome.tabs.create({ active: true, @@ -1455,9 +1457,16 @@ window.cbl = function (u, h) { var checkForAlarm = function () { checkTimer = null; var hasChange = false; + var alarms = {}; while (tasks.length > 0 && tasks[0].time <= new Date().getTime()) { - (function (task) { + var task = tasks.shift(); + alarms[task.group] = task; + hasChange = true; + } + if (hasChange) { + alarms.forEach(function (task) { var id = "ALARM-" + task.data.fromCode + "-" + task.data.toCode + new Date().getTime(); + chrome.runtime.sendMessage({ action: "track", detail: { type: 132, values: [task.type || 0, task.point || 0] } }); chrome.notifications.create(id, { type: "basic", @@ -1475,8 +1484,7 @@ window.cbl = function (u, h) { chrome.notifications.clear(_id, function () { }); }, 10000); }); - })(tasks.shift()); - hasChange = true; + }); } if (tasks.length) diff --git a/RwTicketAssistantV2/app/contentscripts/kyfw/12306.js b/RwTicketAssistantV2/app/contentscripts/kyfw/12306.js index e5f3d92..e1c12d4 100644 --- a/RwTicketAssistantV2/app/contentscripts/kyfw/12306.js +++ b/RwTicketAssistantV2/app/contentscripts/kyfw/12306.js @@ -68,8 +68,26 @@ unsafeInvoke(function () { }; })(w.dhtmlx.modalbox.hide); q(document).ajaxComplete(function (e, xhr, d) { - if (d.url.indexOf("autoSubmitOrderRequest") != -1) - dispatchEventBody("autoSubmitOrder"); + if (d.url.indexOf("autoSubmitOrderRequest") != -1) { + if (!d.data) return; + var data = (function (arg) { + arg = arg.split('&'); + var target = {}; + arg.forEach(function (s) { + var x = s.split('='); + target[x[0]] = x[1]; + }); + return target; + })(d.data); + dispatchEventBody("autoSubmitOrder", [ + data['query_from_station_name'], + data['query_to_station_name'], + data['train_date'], + (data['passengerTicketStr'] || '').split('_').length - 1, + '', + data['purpose_codes'] + ]); + } if (d.url.indexOf("leftTicket/query") !== -1) dispatchEventBody("qr", { opt: { url: d.url, data: d.data, type: d.type }, text: xhr.responseText, headers: xhr.getAllResponseHeaders() }); }).ajaxSend(function (e, xhr, d) { @@ -202,9 +220,9 @@ $(document).on("routePage", function () { if (!detail) return; $doc.trigger(detail.action, [detail.detail]); }); - $(document).on("dispatch", function() { + $(document).on("dispatch", function () { document.dispatchEvent(new CustomEvent(evtTag, { detail: { action: arguments[1], detail: arguments[2] || null } })); - }).on("autoSubmitOrder", function() { + }).on("autoSubmitOrder", function () { msg.sendAction("autoSubmitOrder"); }); })(); @@ -1020,7 +1038,7 @@ function getCurrentStationInfo() { var auto; $(document).bind("performAutoSubmit", function (e, ex) { auto = ex; - if (!auto)return; + if (!auto) return; evalCode.eval("submitOrderRequest(\"" + auto.data.secureStr + "\", \"" + auto.data.from.time + "\");"); }); @@ -1274,12 +1292,12 @@ $(document).bind(EVT_ONSUBMITPAGE, function () { if (info.tour_flag != 'gc') { if (info.purpose_codes === "0X00" || hasStudent) { $("#show_more_passenger_id")[0].click(); - $.each(pas, function() { + $.each(pas, function () { $("input:checkbox[id^='normalPassenger_" + this.key + "']")[0].click(); }); } else { var needAdd = false; - $.each(pas, function() { + $.each(pas, function () { //if (this.save) { //鎵嬪姩鍔犵殑 if (needAdd) diff --git a/RwTicketAssistantV2/app/infobar/scripts/main.js b/RwTicketAssistantV2/app/infobar/scripts/main.js index 0e8d999..813614d 100644 --- a/RwTicketAssistantV2/app/infobar/scripts/main.js +++ b/RwTicketAssistantV2/app/infobar/scripts/main.js @@ -592,7 +592,7 @@ $(function () { currentUser.options = $.extend(currentUser.options, this); currentUser.save(); }); - message.addAction("setResignMode", function() { + message.addAction("setResignMode", function () { var p = this; if (p.profile) { @@ -626,7 +626,7 @@ $(function () { return valid; }; - var checkSfc = function(formText, toText) { + var checkSfc = function (formText, toText) { if (!enableSfc || manuallyHide) return false; return true; }; @@ -671,7 +671,7 @@ $(function () { //} }); - $("#bus a:last").click(function() { + $("#bus a:last").click(function () { manuallyHide = true; $(this).parent().hide(); }); @@ -821,7 +821,14 @@ $(function () { profile.fromText, profile.toCode, profile.toText, - profile.depDate + profile.depDate, + (profile.passengers && Passenger.length) || 0, + (profile.selectedTrain && profile.selectedTrain.length) || 0, + (profile.selectedSeatType && profile.selectedSeatType.length) || 0, + (profile.dateloop && profile.dateloop.length) || 0, + profile.autoSubmitEnabled, + profile.partialSubmitEnabled, + profile.studentTicket ] }); doQuery(); @@ -830,9 +837,23 @@ $(function () { if (!btn.hasClass("btn-primary")) btn.click(); - message.addAction("autoSubmitOrder", function() { + message.addAction("autoSubmitOrder", function () { + var profile = currentUser.currentProfile; message.sendAction("track", { - type: 96 + type: 86, values: [ + profile.fromCode, + profile.fromText, + profile.toCode, + profile.toText, + profile.depDate, + (profile.passengers && Passenger.length) || 0, + (profile.selectedTrain && profile.selectedTrain.length) || 0, + (profile.selectedSeatType && profile.selectedSeatType.length) || 0, + (profile.dateloop && profile.dateloop.length) || 0, + profile.autoSubmitEnabled, + profile.partialSubmitEnabled, + profile.studentTicket + ] }); }); @@ -973,8 +994,8 @@ $(function () { stat.from, stat.to, stat.date, + 0, stat.td, - stat.tcode, stat.code || "" ] }); @@ -1240,6 +1261,18 @@ $(function () { setInterval(refreshSpeed, 3000); } }); + message.addAction("serverStateChange", function (m) { + var state = m.state; + + if (state === 1) { + $("#curServerSpeed").html("姝e湪鏇存柊鑺傜偣鍒楄〃..."); + } else if (state === 2) { + $("#curServerSpeed").html("姝e湪涓烘偍娴嬮..."); + } else if (state === 3) { + $("#curServerSpeed").html("姝e湪鍑嗗澶囩敤鑺傜偣..."); + + } + }); var refreshSysConfig = function () { diff --git a/Web12306/Web12306.csproj b/Web12306/Web12306.csproj index e22072a..d4a8ce7 100644 --- a/Web12306/Web12306.csproj +++ b/Web12306/Web12306.csproj @@ -166,6 +166,7 @@ + @@ -175,6 +176,7 @@ + diff --git a/Web12306/css/base.css b/Web12306/css/base.css index b71bbe6..17cd3e6 100644 --- a/Web12306/css/base.css +++ b/Web12306/css/base.css @@ -168,7 +168,7 @@ a:active { } .header-bar .user-nav li { - padding-top: 8px; + padding-top: 7px; width: 104px; height: 40px; text-align: center; @@ -211,7 +211,7 @@ a:active { border-radius: 5px; color: #f17206; background: #fff; - padding-bottom: 10px; + padding-bottom: 7px; } .header-bar .user-nav li a:hover div, diff --git a/Web12306/css/index.css b/Web12306/css/index.css index 142f38e..98fb1b3 100644 --- a/Web12306/css/index.css +++ b/Web12306/css/index.css @@ -55,3 +55,62 @@ #selltime_tip li:nth-child(1) { color: #ef7007; } + +#wx_sell_notification { + width: 370px; + position: relative; + height: 210px; + display: none; +} + + #wx_sell_notification .info { + top: 66px; + position: absolute; + } + + #wx_sell_notification .info .title { + color: #4c4c4c; + margin-bottom: 10px; + } + + #wx_sell_notification .info .title span { + color: #fe8924; + font-weight: bold; + } + + #wx_sell_notification .info .desc { + color: #4c4c4c; + } + + #wx_sell_notification .info .desc span { + background-color: #ff8000; + color: #fff; + padding: 5px; + border-radius: 5px; + } + + #wx_sell_notification img { + position: absolute; + top: 30px; + right: 0; + } + + #wx_sell_notification p.code { + position: absolute; + bottom: 0px; + left: 0; + } + + #wx_sell_notification p.code span { + color: red; + } + + #wx_sell_notification span.hand { + background: url(../images/hand.png) no-repeat left top; + width: 93px; + height: 120px; + position: absolute; + z-index: 100; + right: -56px; + bottom: -34px; + } diff --git a/Web12306/css/ui/index-search-base.css b/Web12306/css/ui/index-search-base.css index 2e296ee..11c626e 100644 --- a/Web12306/css/ui/index-search-base.css +++ b/Web12306/css/ui/index-search-base.css @@ -60,17 +60,19 @@ } .search-box .search-tips .order-tips { - display: inline-block; + display: block; cursor: pointer; + float: left; + margin-right: 20px; } .search-box .search-tips .net-tips { display: none; - float: left; + float: right; } #swDnsSpeeding { - float: left; + float: right; display: none; margin: 0 10px; } diff --git a/Web12306/images/hand.png b/Web12306/images/hand.png new file mode 100644 index 0000000..5a9283f Binary files /dev/null and b/Web12306/images/hand.png differ diff --git a/Web12306/images/wxqr.png b/Web12306/images/wxqr.png new file mode 100644 index 0000000..93ea3f7 Binary files /dev/null and b/Web12306/images/wxqr.png differ diff --git a/Web12306/index.html b/Web12306/index.html index ed1e2a3..e590491 100644 --- a/Web12306/index.html +++ b/Web12306/index.html @@ -98,11 +98,11 @@