From ce405c6142cabaede82ef8358df4e64eade528c3 Mon Sep 17 00:00:00 2001 From: iFish Date: Tue, 9 Sep 2014 14:55:30 +0800 Subject: [PATCH] many adjust --- Web12306/Properties/AssemblyInfo.cs | 2 +- Web12306/TrainSuggestion.cs | 21 ++++++++------ Web12306/css/ui/chat/chat-container.css | 7 +++++ Web12306/css/ui/passenger-selector.css | 1 - Web12306/css/ui/travel-method.css | 4 +-- Web12306/index.html | 1 + Web12306/js/account/sessionMgr.js | 2 +- Web12306/js/otn/trainstationsuggest.js | 3 +- Web12306/js/ui/chat/roomsession.js | 37 +++++++++++++++++++------ Web12306/js/ui/ui-autosubmitform.js | 2 +- Web12306/js/ui/ui-submit-order.js | 2 +- Web12306/js/ui/widget_message_popup.js | 2 +- 12 files changed, 58 insertions(+), 26 deletions(-) diff --git a/Web12306/Properties/AssemblyInfo.cs b/Web12306/Properties/AssemblyInfo.cs index f9663de..3833a19 100644 --- a/Web12306/Properties/AssemblyInfo.cs +++ b/Web12306/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // // 你可以指定所有值,也可以让修订版本和内部版本号采用默认值, // 方法是按如下所示使用 "*": -[assembly: AssemblyVersion("1.0.14248.66")] +[assembly: AssemblyVersion("1.0.14252.72")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Web12306/TrainSuggestion.cs b/Web12306/TrainSuggestion.cs index a10d3cd..9f7fd8e 100644 --- a/Web12306/TrainSuggestion.cs +++ b/Web12306/TrainSuggestion.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text.RegularExpressions; @@ -223,14 +224,18 @@ namespace Web12306 if (ep1 != ep2) return ep2 - ep1; + //再看价格 - var ap1 = (int)x.Lines.Min(s => s.ExtraPrice); - var ap2 = (int)y.Lines.Min(s => s.ExtraPrice); + var ap1 = x.Lines.Min(s => s.Radio); + var ap2 = y.Lines.Min(s => s.Radio); if (ap1 != ap2) return ap1 - ap2; return 0; }); + //最多推荐5条线路 + if (line.Count > 5) + line.RemoveRange(5, line.Count - 5); //再对组内排序 foreach (var current in line) @@ -303,7 +308,7 @@ namespace Web12306 if (i != 0) { //对于非始发站,停靠时间相同或更短,则不做推荐。 - if (stopTime <= stopTimeFrom) + if (stopTime < stopTimeFrom && i < indexFrom - 3) continue; } @@ -323,8 +328,8 @@ namespace Web12306 //排序 altFrom.Sort(new AlternativeStationComparer()); - if (altFrom.Count > 3) - altFrom.RemoveRange(altFrom.Count - 3, 3); + if (altFrom.Count > 5) + altFrom.RemoveRange(5, altFrom.Count - 5); } if (indexTo != stops.Length - 1) { @@ -342,7 +347,7 @@ namespace Web12306 if (i != stops.Length - 1) { //对于非终到站,停靠时间相同或更短,则不做推荐。 - if (stopTime <= stopTimeTo) + if (stopTime < stopTimeTo && i > indexTo + 3) continue; } @@ -358,8 +363,8 @@ namespace Web12306 }); } altTo.Sort(new AlternativeStationComparer()); - if (altTo.Count > 3) - altTo.RemoveRange(altFrom.Count - 3, 3); + if (altTo.Count > 5) + altTo.RemoveRange(5, altTo.Count - 5); } //plus 原始线路 altFrom.Add(new AlternativeStation diff --git a/Web12306/css/ui/chat/chat-container.css b/Web12306/css/ui/chat/chat-container.css index ca07b69..f5568ba 100644 --- a/Web12306/css/ui/chat/chat-container.css +++ b/Web12306/css/ui/chat/chat-container.css @@ -115,6 +115,13 @@ #chat_container .chat-editor > header { } + #chat_container .chat-editor > header > select, + #chat_container .chat-editor > header > input, + #chat_container .chat-editor > header > button { + margin-right: 5px; + } + + #chat_container .chat-editor input[type='color'] { padding: 0; background: none; diff --git a/Web12306/css/ui/passenger-selector.css b/Web12306/css/ui/passenger-selector.css index d6805f2..cf8c8eb 100644 --- a/Web12306/css/ui/passenger-selector.css +++ b/Web12306/css/ui/passenger-selector.css @@ -30,7 +30,6 @@ background-color: #ffffff; padding: 6px; display: none; - min-width: 600px; } .passenger-notverified { diff --git a/Web12306/css/ui/travel-method.css b/Web12306/css/ui/travel-method.css index 6e5615a..a3881ce 100644 --- a/Web12306/css/ui/travel-method.css +++ b/Web12306/css/ui/travel-method.css @@ -12,7 +12,7 @@ padding: 14px; border-radius: 0 5px 5px 5px; z-index: 100; - width: 320px; + width: 420px; border: 1px solid #c7c7c7; display: none; } @@ -36,7 +36,7 @@ .travel-theme-wrap section ul li { float: left; - width: 150px; + width: 200px; margin-right: 14px; line-height: 35px; position: relative; diff --git a/Web12306/index.html b/Web12306/index.html index f4ca842..71fbbfa 100644 --- a/Web12306/index.html +++ b/Web12306/index.html @@ -994,6 +994,7 @@
+
diff --git a/Web12306/js/account/sessionMgr.js b/Web12306/js/account/sessionMgr.js index 35e4ebd..c5a2649 100644 --- a/Web12306/js/account/sessionMgr.js +++ b/Web12306/js/account/sessionMgr.js @@ -256,7 +256,7 @@ get: function () { return session && session.currentProfile; }, set: function (value) { - session.currentProfile = $.extend({}, _.clone(that.defaultProfile), value); + session.currentProfile = $.extend({}, JSON.parse(JSON.stringify(that.defaultProfile)), value); that.fireEvent("currentProfileChanged"); that.save(); } diff --git a/Web12306/js/otn/trainstationsuggest.js b/Web12306/js/otn/trainstationsuggest.js index 717c076..c5a07f4 100644 --- a/Web12306/js/otn/trainstationsuggest.js +++ b/Web12306/js/otn/trainstationsuggest.js @@ -84,6 +84,7 @@ //木有结果。 suggestion = []; cachedSuggest.data = suggestion; + localStorage['trainsuggestion'] = JSON.stringify(cachedSuggest); isInQuery = false; return; } @@ -179,7 +180,7 @@ lastQuerySuggest = null; }; this.checkTrainSuggestion = function () { - var suggestKey = cp.fromCode + cp.toCode + ((cp.selectedTrain || []).join("|")) + ((cp.selectedSeatType || []).join("|")); + var suggestKey = cp.fromCode + cp.toCode + cp.depDate + ((cp.selectedTrain || []).join("|")) + ((cp.selectedSeatType || []).join("|")); if (suggestKey === cachedSuggest.key && cachedSuggest.data) { if (!lastQuerySuggest || (new Date() - lastQuerySuggest) > data.suggestRefreshInterval) { diff --git a/Web12306/js/ui/chat/roomsession.js b/Web12306/js/ui/chat/roomsession.js index 22ee404..7916eb2 100644 --- a/Web12306/js/ui/chat/roomsession.js +++ b/Web12306/js/ui/chat/roomsession.js @@ -170,6 +170,8 @@ var editor = page.find("section.chat-editor"); var sendBtn = editor.find(">footer>button.button-primary"); var editorArea = editor.find(".chat-editor-container"); + var specChars ="(^.^)\n(;_;)\n(¬_¬)\n(u_u)\n♪(´ε`)\n♪(´▽`)\n*_*\n⊙﹏⊙!\n(ーー;)\n(-_-)zz\n↖(^ω^)↗\n囧rz\n^_^\n`(*∩_∩*)′\n ̄□ ̄||\nO(∩_∩)O\n*^_^* \n^_^#\n(☆_☆)/~~\n→_→ \n(~ o ~)~zZ\n(^ω^) \n(ˇ^ˇ)\no(>_<)o ~~\n>_<#\n⊙▂⊙\n╰_╯\n`(*>﹏<*)′\n(⊙o⊙)\no(╯□╰)o\n::>_<:: \n=_=\nT_T\no(>_<)o ~~\n(#‵′)凸\n:-x\n{{{(>_< )}}} \n(╯-╰)/ \nY(^o^)Y~\nY(^o^)Y~\n($ _ $)\no(︶︿︶)o\n⊙△⊙?\n~~~^o^~~~\n╮(╯_╰)╭\n^_^#\n`(*∩_∩*)′\n(⊙_⊙;)\n>_<||| \n@_@\n(⊙⊙?)\n^_~ \n(ˉ(∞)ˉ) \n^(oo)^ \n(◦ \"̮ ◦)\nヽミ ´∀`ミノ< \nヽ〔゚Д゚〕丿\nヽ(●´ε`●)ノ \nヽ(≧Д≦)ノ\nヽ(^0^)ノ\nヾ(@^▽^@)ノ \nヽ(*´∀`)ノ\nヾ ^_^♪\n━(゚∀゚)━!\n(^▽^)コ祝贺你\nლ(╹ε╹ლ) \nლ(╹◡╹ლ)\nლ(^o^ლ) \nΣ(゚д゚lll)\nΣ(゚д゚;)\nΣ(TωT)努力--\nσ(´┰`=)\nε=┌(;・∀・)┘\nε=(・д・`*)ハァ…\nY(・∀・)Y 蟹\nY(>_<、)Y\nw(^_^)ン\nv(=^0^=)v\nT(;_;)T\np(^^)q\no(TヘTo)\no(^∀^)o\nm(-_-m)~ \nm(__)m\n♪~(´ε` )\n☆彡\n☆ミ\n☆⌒(>。≪)\n☆⌒(*^-゜)v\n≡((  ´Д`)/≡=\n∑(O_O;)\n∑(・∀・) コ坏了 !!\n<(ToT)>\n{[(-_-)(-_-)]}zzz\n\(・o・)/!\n\(◎o◎)/!\n\(^o^)/了解!\n(つд⊂)伤心\n(゚Θ゚ )< \n(T▽T)\n(T_T)/~~\n(o・・o)/~\n(๑╹ڡ╹)╭ ~ ♡\n(・。・)\n(・(仝)・)\n(・(ェ)・)\n(¬з¬)\n(=゚Д゚=)\n(=-ω-)zzZZ乙乙\n(--〆)\n( ̄Д ̄)ノ\n(-_-メ) \n(^^♪\n(^。^)y\n-.。o○\n(^ _ ^)/~~\n(-。-)y-゜゜゜\n(*゚Д゚)つミ匚___\n(*°∀°)=3\n(ー_ー)!!\n( ^ω^)\n( ^∀^)".split('\n'); + var faceSelector = editor.find(">header>select"); var initEditor = function () { if (!sessMgr.current) @@ -177,6 +179,19 @@ var color = sessMgr.current.options.chatColor || "#000000"; editor.find(">header .chat-editor-color").val(color); editor.find(".chat-editor-container").css("color", color); + + var faceDom = faceSelector[0]; + specChars.forEach(function(f) { + var x = new Option(f, f); + faceDom.options[faceDom.options.length] = x; + }); + faceSelector.change(function() { + var v = faceSelector.val(); + if (v) { + pasteHtml(v); + } + faceSelector[0].selectedIndex = 0; + }); }; var delayEnableSend = function () { sendBtn.prop("disabled", true); @@ -184,6 +199,18 @@ sendBtn.prop("disabled", false); }, param.chatSendMsgDelay); }; + var pasteHtml = function(html) { + editorArea.append(html); + + var range = document.createRange(); + range.selectNodeContents(editorArea[0]); + range.collapse(false); + var selection = window.getSelection(); + selection.removeAllRanges(); + selection.addRange(range); + editorArea[0].focus(); + + }; initEditor(); editor.find(".chat-editor-container").keyup(function (e) { @@ -240,15 +267,7 @@ return; var html = "@" + name + " "; - editorArea.append(html); - - var range = document.createRange(); - range.selectNodeContents(editorArea[0]); - range.collapse(false); - var selection = window.getSelection(); - selection.removeAllRanges(); - selection.addRange(range); - editorArea[0].focus(); + pasteHtml(html); }); $(document).on("click", "a.chat-frame-reconnect", function () { $(".chat-item").remove(); diff --git a/Web12306/js/ui/ui-autosubmitform.js b/Web12306/js/ui/ui-autosubmitform.js index 07350aa..a5cc535 100644 --- a/Web12306/js/ui/ui-autosubmitform.js +++ b/Web12306/js/ui/ui-autosubmitform.js @@ -95,7 +95,7 @@ var currentList = null; var currentPageIndex = 1; var allpasseengers = null; - var pagesize = 12; + var pagesize = 15; var totalpage = 0; var performSearch = function (key) { key = key || uiInput.val(); diff --git a/Web12306/js/ui/ui-submit-order.js b/Web12306/js/ui/ui-submit-order.js index 39e6ba5..b3ab47f 100644 --- a/Web12306/js/ui/ui-submit-order.js +++ b/Web12306/js/ui/ui-submit-order.js @@ -110,7 +110,7 @@ dom.find("div>p:eq(0) span").html(data.orderId); submitProgress.removeClass().addClass("ticket-submit-status ticket-submit-status-ok"); submitProgress.find("span").html("订票成功!订单号为 " + data.orderId); - share.makeWeiboShare(document.getElementById("lnkShareWb"), null, "尝试了各种办法买国庆火车票,差点就要放弃,没想到用 @猎豹浏览器 一下子就抢到了想要的车票,给力啊! #国庆抢票,就用猎豹# ", null); + share.makeWeiboShare(document.getElementById("lnkShareWb"), null, "国庆假期的火车票太难买了,还好 @猎豹浏览器 抢票杠杠的,帮我瞬间抢到了车票! #国庆抢票就用猎豹# http://www.ijinshan.com/12306/?f=weiboshare", null); submitBtn[0].disabled = false; //track diff --git a/Web12306/js/ui/widget_message_popup.js b/Web12306/js/ui/widget_message_popup.js index da728a5..c376e0b 100644 --- a/Web12306/js/ui/widget_message_popup.js +++ b/Web12306/js/ui/widget_message_popup.js @@ -149,7 +149,7 @@ } } ]; - if (isLb) { + if (!isLb) { btns.unshift({ text: "安装猎豹浏览器", type: "primary",