diff --git a/Mobile12306New/js/date.js b/Mobile12306New/js/date.js index 2fd20f3..c05cfcc 100644 --- a/Mobile12306New/js/date.js +++ b/Mobile12306New/js/date.js @@ -29,9 +29,16 @@ DateComponent.prototype.generateArray = function() { var arr = []; var min = this.minDate.date.getTime(); var max = this.maxDate.date.getTime(); - var remind + var isCheckClass = ''; + var mtdate; + // var remind do { + mtdate = new Date(max).addDays(30).getTime(); + isCheckClass = ctime < min ? ' disable' : (ctime > max ? ' remind' : ''); + if (ctime > mtdate) { + isCheckClass = ' disable'; + }; arr.push({ "year": date.getFullYear(), "month": date.getMonth() + 1, @@ -39,7 +46,8 @@ DateComponent.prototype.generateArray = function() { "format": date.format('yyyy/MM/dd'), "time": date.date.getTime(), "class": date.isToday ? ' today' + (this.curDate.date.getTime() == date.date.getTime() ? ' cur' : '') : (this.curDate.date.getTime() == date.date.getTime() ? ' cur' : ''), - "isCheckClass": ctime < min ? ' disable' : (ctime > max ? ' remind' : ''), + "isCheckClass": isCheckClass, + // "isCheckClass": ctime < min ? ' disable' : (ctime > max ? ' remind' : ''), "lunar": (new LunarCalendar(date)).getMOD() }); date = new Date(date.getTime() + 86400000); @@ -49,6 +57,11 @@ DateComponent.prototype.generateArray = function() { var i = date.getDay(); for (; i < 7 && i != 0; i++) { + mtdate = new Date(max).addDays(30).getTime(); + isCheckClass = ctime < min ? ' disable' : (ctime > max ? ' remind' : ''); + if (ctime > mtdate) { + isCheckClass = ' disable'; + }; arr.push({ "year": date.getFullYear(), "month": date.getMonth() + 1, @@ -56,7 +69,8 @@ DateComponent.prototype.generateArray = function() { "format": date.format('yyyy/MM/dd'), "time": date.date.getTime(), //this._TODAY.date.getTime() > ctime "class": date.isToday ? ' today' + (this.curDate.date.getTime() == date.date.getTime() ? ' cur' : '') : (this.curDate.date.getTime() == date.date.getTime() ? ' cur' : ''), - "isCheckClass": ctime < min ? ' disable' : (ctime > max ? ' remind' : ''), + "isCheckClass": isCheckClass, + // "isCheckClass": ctime < min ? ' disable' : (ctime > max ? ' remind' : ''), "lunar": (new LunarCalendar(date)).getMOD() }); date = new Date(date.getTime() + 86400000); @@ -67,6 +81,11 @@ DateComponent.prototype.generateArray = function() { date = new Date(new Date(this.pageCurDate.getFullYear(), this.pageCurDate.getMonth(), 1, 0, 0, 0).getTime() - 86400000); ctime = date.date.getTime(); for (; i > 0; i--) { + mtdate = new Date(max).addDays(30).getTime(); + isCheckClass = ctime < min ? ' disable' : (ctime > max ? ' remind' : ''); + if (ctime > mtdate) { + isCheckClass = ' disable'; + }; arr.unshift({ "year": date.getFullYear(), "month": date.getMonth() + 1, @@ -74,7 +93,7 @@ DateComponent.prototype.generateArray = function() { "format": date.format('yyyy/MM/dd'), "time": date.date.getTime(), "class": date.isToday ? ' today' + (this.curDate.date.getTime() == date.date.getTime() ? ' cur' : '') : (this.curDate.date.getTime() == date.date.getTime() ? ' cur' : ''), - "isCheckClass": ctime < min ? ' disable' : (ctime > max ? ' remind' : ''), + "isCheckClass": isCheckClass, "lunar": (new LunarCalendar(date)).getMOD() }); date = new Date(date.getTime() - 86400000); @@ -105,6 +124,10 @@ DateComponent.prototype.bindDomEvent = function() { var min = _self.minDate.date.getTime(); var max = _self.maxDate.date.getTime(); + if($(this).hasClass('disable')){ + return false; + } + if (!$(this).hasClass('cur')) { if (date.getTime() < _self._TODAY.date.getTime()) { return false; diff --git a/Mobile12306New/js/js.min.js b/Mobile12306New/js/js.min.js index a47dac9..51c95e3 100644 --- a/Mobile12306New/js/js.min.js +++ b/Mobile12306New/js/js.min.js @@ -1,68 +1,68 @@ -var Zepto=function(){function a(a){return null==a?String(a):L[R.call(a)]||"object"}function b(b){return"function"==a(b)}function c(a){return null!=a&&a==a.window}function d(a){return null!=a&&a.nodeType==a.DOCUMENT_NODE}function e(b){return"object"==a(b)}function f(a){return e(a)&&!c(a)&&Object.getPrototypeOf(a)==Object.prototype}function g(a){return"number"==typeof a.length}function n(a){return z.call(a,function(a){return null!=a})}function l(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g, -"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function p(a){return a in E?E[a]:E[a]=RegExp("(^|\\s)"+a+"(\\s|$)")}function A(a){return"children"in a?x.call(a.children):h.map(a.childNodes,function(a){if(1==a.nodeType)return a})}function k(a,b,c){for(w in b)c&&(f(b[w])||H(b[w]))?(f(b[w])&&!f(a[w])&&(a[w]={}),H(b[w])&&!H(a[w])&&(a[w]=[]),k(a[w],b[w],c)):b[w]!==s&&(a[w]=b[w])}function y(a,b){return null==b?h(a):h(a).filter(b)}function m(a,c,d,e){return b(c)?c.call(a,d, -e):c}function u(a,b){var c=a.className||"",d=c&&c.baseVal!==s;if(b===s)return d?c.baseVal:c;d?c.baseVal=b:a.className=b}function q(a){var b;try{return a?"true"==a||("false"==a?!1:"null"==a?null:!/^0/.test(a)&&!isNaN(b=Number(a))?b:/^[\[\{]/.test(a)?h.parseJSON(a):a):a}catch(c){return a}}function B(a,b){b(a);for(var c=0,d=a.childNodes.length;c]*>/,S=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,N=/^(?:body|html)$/i,U=/([A-Z])/g,V="val css html text data width height offset".split(" "),M=r.createElement("table"),O=r.createElement("tr"),P={tr:r.createElement("tbody"),tbody:M,thead:M,tfoot:M,td:O,th:O,"*":r.createElement("div")},W=/complete|loaded|interactive/,X=/^[\w-]*$/,L={},R=L.toString,C={},J,K,Q=r.createElement("div"),Y={tabindex:"tabIndex", readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},H=Array.isArray||function(a){return a instanceof Array};C.matches=function(a,b){if(!b||!a||1!==a.nodeType)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d;d=a.parentNode;(c=!d)&& -(d=Q).appendChild(a);d=~C.qsa(d,b).indexOf(a);c&&Q.removeChild(a);return d};J=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})};K=function(a){return z.call(a,function(b,c){return a.indexOf(b)==c})};C.fragment=function(a,b,c){var d,e,g;S.test(a)&&(d=h(r.createElement(RegExp.$1)));d||(a.replace&&(a=a.replace(T,"<$1>")),b===s&&(b=I.test(a)&&RegExp.$1),b in P||(b="*"),g=P[b],g.innerHTML=""+a,d=h.each(x.call(g.childNodes),function(){g.removeChild(this)}));f(c)&&(e= -h(d),h.each(c,function(a,b){if(-1")),b===w&&(b=I.test(a)&&RegExp.$1),b in P||(b="*"),g=P[b],g.innerHTML=""+a,d=h.each(x.call(g.childNodes),function(){g.removeChild(this)}));f(c)&&(e= +h(d),h.each(c,function(a,b){if(-1d.indexOf(a)&&c.push(a)})}return h(c)},has:function(a){return this.filter(function(){return e(a)?h.contains(this,a):h(this).find(a).size()})},eq:function(a){return-1===a?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!e(a)?a:h(a)},last:function(){var a=this[this.length-1];return a&&!e(a)?a:h(a)},find:function(a){var b=this;return a?"object"==typeof a?h(a).filter(function(){var a=this;return v.some.call(b,function(b){return h.contains(b, +h.fn={forEach:u.forEach,reduce:u.reduce,push:u.push,sort:u.sort,indexOf:u.indexOf,concat:u.concat,map:function(a){return h(h.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return h(x.apply(this,arguments))},ready:function(a){W.test(r.readyState)&&r.body?a(h):r.addEventListener("DOMContentLoaded",function(){a(h)},!1);return this},get:function(a){return a===w?x.call(this):this[0<=a?a:a+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!= +this.parentNode&&this.parentNode.removeChild(this)})},each:function(a){u.every.call(this,function(b,c){return!1!==a.call(b,c,b)});return this},filter:function(a){return b(a)?this.not(this.not(a)):h(z.call(this,function(b){return C.matches(b,a)}))},add:function(a,b){return h(K(this.concat(h(a,b))))},is:function(a){return 0d.indexOf(a)&&c.push(a)})}return h(c)},has:function(a){return this.filter(function(){return e(a)?h.contains(this,a):h(this).find(a).size()})},eq:function(a){return-1===a?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!e(a)?a:h(a)},last:function(){var a=this[this.length-1];return a&&!e(a)?a:h(a)},find:function(a){var b=this;return a?"object"==typeof a?h(a).filter(function(){var a=this;return u.some.call(b,function(b){return h.contains(b, a)})}):1==this.length?h(C.qsa(this[0],a)):this.map(function(){return C.qsa(this,a)}):[]},closest:function(a,b){var c=this[0],e=!1;for("object"==typeof a&&(e=h(a));c&&!(e?0<=e.indexOf(c):C.matches(c,a));)c=c!==b&&!d(c)&&c.parentNode;return h(c)},parents:function(a){for(var b=[],c=this;0b.indexOf(a))return b.push(a),a});return y(b,a)},parent:function(a){return y(K(this.pluck("parentNode")),a)},children:function(a){return y(this.map(function(){return A(this)}), a)},contents:function(){return this.map(function(){return x.call(this.childNodes)})},siblings:function(a){return y(this.map(function(a,b){return z.call(A(b.parentNode),function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return h.map(this,function(b){return b[a]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display="");if("none"==getComputedStyle(this,"").getPropertyValue("display")){var a=this.style, b=this.nodeName,c,d;F[b]||(c=r.createElement(b),r.body.appendChild(c),d=getComputedStyle(c,"").getPropertyValue("display"),c.parentNode.removeChild(c),"none"==d&&(d="block"),F[b]=d);a.display=F[b]}})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){var c=b(a);if(this[0]&&!c)var d=h(a).get(0),e=d.parentNode||1arguments.length){var d=this[0],e=getComputedStyle(d,"");if(!d)return;if("string"==typeof b)return d.style[J(b)]||e.getPropertyValue(b); -if(H(b)){var f={};h.each(b,function(a,b){f[b]=d.style[J(b)]||e.getPropertyValue(b)});return f}}var r="";if("string"==a(b))!c&&0!==c?this.each(function(){this.style.removeProperty(l(b))}):r=l(b)+":"+("number"==typeof c&&!G[l(b)]?c+"px":c);else for(w in b)!b[w]&&0!==b[w]?this.each(function(){this.style.removeProperty(l(w))}):r+=l(w)+":"+("number"==typeof b[w]&&!G[l(w)]?b[w]+"px":b[w])+";";return this.each(function(){this.style.cssText+=";"+r})},index:function(a){return a?this.indexOf(h(a)[0]):this.parent().children().indexOf(this[0])}, -hasClass:function(a){return!a?!1:v.some.call(this,function(a){return this.test(u(a))},p(a))},addClass:function(a){return!a?this:this.each(function(b){if("className"in this){D=[];var c=u(this);m(this,a,b,c).split(/\s+/g).forEach(function(a){h(this).hasClass(a)||D.push(a)},this);D.length&&u(this,c+(c?" ":"")+D.join(" "))}})},removeClass:function(a){return this.each(function(b){if("className"in this){if(a===s)return u(this,"");D=u(this);m(this,a,b,D).split(/\s+/g).forEach(function(a){D=D.replace(p(a), -" ")});u(this,D.trim())}})},toggleClass:function(a,b){return!a?this:this.each(function(c){var d=h(this);m(this,a,c,u(this)).split(/\s+/g).forEach(function(a){(b===s?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})})},scrollTop:function(a){if(this.length){var b="scrollTop"in this[0];return a===s?b?this[0].scrollTop:this[0].pageYOffset:this.each(b?function(){this.scrollTop=a}:function(){this.scrollTo(this.scrollX,a)})}},scrollLeft:function(a){if(this.length){var b="scrollLeft"in this[0];return a=== -s?b?this[0].scrollLeft:this[0].pageXOffset:this.each(b?function(){this.scrollLeft=a}:function(){this.scrollTo(a,this.scrollY)})}},position:function(){if(this.length){var a=this[0],b=this.offsetParent(),c=this.offset(),d=N.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(h(a).css("margin-top"))||0;c.left-=parseFloat(h(a).css("margin-left"))||0;d.top+=parseFloat(h(b[0]).css("border-top-width"))||0;d.left+=parseFloat(h(b[0]).css("border-left-width"))||0;return{top:c.top-d.top,left:c.left- -d.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||r.body;a&&!N.test(a.nodeName)&&"static"==h(a).css("position");)a=a.offsetParent;return a})}};h.fn.detach=h.fn.remove;["width","height"].forEach(function(a){var b=a.replace(/./,function(a){return a[0].toUpperCase()});h.fn[a]=function(e){var f,r=this[0];return e===s?c(r)?r["inner"+b]:d(r)?r.documentElement["scroll"+b]:(f=this.offset())&&f[a]:this.each(function(b){r=h(this);r.css(a,m(this,e,b,r[a]()))})}});["after", +(a===w?"none"==b.css("display"):a)?b.show():b.hide()})},prev:function(a){return h(this.pluck("previousElementSibling")).filter(a||"*")},next:function(a){return h(this.pluck("nextElementSibling")).filter(a||"*")},html:function(a){return 0 in arguments?this.each(function(b){var c=this.innerHTML;h(this).empty().append(n(this,a,b,c))}):0 in this?this[0].innerHTML:null},text:function(a){return 0 in arguments?this.each(function(b){b=n(this,a,b,this.textContent);this.textContent=null==b?"":""+b}):0 in this? +this[0].textContent:null},attr:function(a,b){var c;return"string"==typeof a&&!(1 in arguments)?!this.length||1!==this[0].nodeType?w:!(c=this[0].getAttribute(a))&&a in this[0]?this[0][a]:c:this.each(function(c){if(1===this.nodeType)if(e(a))for(v in a){var d=v;c=a[v];null==c?this.removeAttribute(d):this.setAttribute(d,c)}else d=a,c=n(this,b,c,this.getAttribute(a)),null==c?this.removeAttribute(d):this.setAttribute(d,c)})},removeAttr:function(a){return this.each(function(){1===this.nodeType&&this.removeAttribute(a)})}, +prop:function(a,b){a=Y[a]||a;return 1 in arguments?this.each(function(c){this[a]=n(this,b,c,this[a])}):this[0]&&this[0][a]},data:function(a,b){var c="data-"+a.replace(U,"-$1").toLowerCase(),c=1 in arguments?this.attr(c,b):this.attr(c);return null!==c?q(c):w},val:function(a){return 0 in arguments?this.each(function(b){this.value=n(this,a,b,this.value)}):this[0]&&(this[0].multiple?h(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(a){if(a)return this.each(function(b){var c= +h(this);b=n(this,a,b,c.offset());var d=c.offsetParent().offset();b={top:b.top-d.top,left:b.left-d.left};"static"==c.css("position")&&(b.position="relative");c.css(b)});if(!this.length)return null;var b=this[0].getBoundingClientRect();return{left:b.left+window.pageXOffset,top:b.top+window.pageYOffset,width:Math.round(b.width),height:Math.round(b.height)}},css:function(b,c){if(2>arguments.length){var d=this[0],e=getComputedStyle(d,"");if(!d)return;if("string"==typeof b)return d.style[J(b)]||e.getPropertyValue(b); +if(H(b)){var f={};h.each(b,function(a,b){f[b]=d.style[J(b)]||e.getPropertyValue(b)});return f}}var r="";if("string"==a(b))!c&&0!==c?this.each(function(){this.style.removeProperty(l(b))}):r=l(b)+":"+("number"==typeof c&&!G[l(b)]?c+"px":c);else for(v in b)!b[v]&&0!==b[v]?this.each(function(){this.style.removeProperty(l(v))}):r+=l(v)+":"+("number"==typeof b[v]&&!G[l(v)]?b[v]+"px":b[v])+";";return this.each(function(){this.style.cssText+=";"+r})},index:function(a){return a?this.indexOf(h(a)[0]):this.parent().children().indexOf(this[0])}, +hasClass:function(a){return!a?!1:u.some.call(this,function(a){return this.test(s(a))},p(a))},addClass:function(a){return!a?this:this.each(function(b){if("className"in this){D=[];var c=s(this);n(this,a,b,c).split(/\s+/g).forEach(function(a){h(this).hasClass(a)||D.push(a)},this);D.length&&s(this,c+(c?" ":"")+D.join(" "))}})},removeClass:function(a){return this.each(function(b){if("className"in this){if(a===w)return s(this,"");D=s(this);n(this,a,b,D).split(/\s+/g).forEach(function(a){D=D.replace(p(a), +" ")});s(this,D.trim())}})},toggleClass:function(a,b){return!a?this:this.each(function(c){var d=h(this);n(this,a,c,s(this)).split(/\s+/g).forEach(function(a){(b===w?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})})},scrollTop:function(a){if(this.length){var b="scrollTop"in this[0];return a===w?b?this[0].scrollTop:this[0].pageYOffset:this.each(b?function(){this.scrollTop=a}:function(){this.scrollTo(this.scrollX,a)})}},scrollLeft:function(a){if(this.length){var b="scrollLeft"in this[0];return a=== +w?b?this[0].scrollLeft:this[0].pageXOffset:this.each(b?function(){this.scrollLeft=a}:function(){this.scrollTo(a,this.scrollY)})}},position:function(){if(this.length){var a=this[0],b=this.offsetParent(),c=this.offset(),d=N.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(h(a).css("margin-top"))||0;c.left-=parseFloat(h(a).css("margin-left"))||0;d.top+=parseFloat(h(b[0]).css("border-top-width"))||0;d.left+=parseFloat(h(b[0]).css("border-left-width"))||0;return{top:c.top-d.top,left:c.left- +d.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||r.body;a&&!N.test(a.nodeName)&&"static"==h(a).css("position");)a=a.offsetParent;return a})}};h.fn.detach=h.fn.remove;["width","height"].forEach(function(a){var b=a.replace(/./,function(a){return a[0].toUpperCase()});h.fn[a]=function(e){var f,r=this[0];return e===w?c(r)?r["inner"+b]:d(r)?r.documentElement["scroll"+b]:(f=this.offset())&&f[a]:this.each(function(b){r=h(this);r.css(a,n(this,e,b,r[a]()))})}});["after", "prepend","before","append"].forEach(function(b,c){var d=c%2;h.fn[b]=function(){var b,e=h.map(arguments,function(c){b=a(c);return"object"==b||"array"==b||null==c?c:C.fragment(c)}),f,g=1e.length?this:this.each(function(a,b){f=d?b:b.parentNode;b=0==c?b.nextSibling:1==c?b.firstChild:2==c?b:null;var F=h.contains(r.documentElement,f);e.forEach(function(a){if(g)a=a.cloneNode(!0);else if(!f)return h(a).remove();f.insertBefore(a,b);F&&B(a,function(a){null!=a.nodeName&&("SCRIPT"===a.nodeName.toUpperCase()&& (!a.type||"text/javascript"===a.type)&&!a.src)&&window.eval.call(window,a.innerHTML)})})})};h.fn[d?b+"To":"insert"+(c?"Before":"After")]=function(a){h(a)[b](this);return this}});C.Z.prototype=h.fn;C.uniq=K;C.deserializeValue=q;h.zepto=C;return h}();window.Zepto=Zepto;void 0===window.$&&(window.$=Zepto); -(function(a){function b(b,c,d,e){if(b.global)return b=c||u,d=a.Event(d),a(b).trigger(d,e),!d.isDefaultPrevented()}function c(c){c.global&&0===a.active++&&b(c,null,"ajaxStart")}function d(a,c){var d=c.context;if(!1===c.beforeSend.call(d,a,c)||!1===b(c,d,"ajaxBeforeSend",[a,c]))return!1;b(c,d,"ajaxSend",[a,c])}function e(a,c,d,e){var f=d.context;d.success.call(f,a,"success",c);e&&e.resolveWith(f,[a,"success",c]);b(d,f,"ajaxSuccess",[c,d,a]);g("success",c,d)}function f(a,c,d,e,f){var h=e.context;e.error.call(h, -d,c,a);f&&f.rejectWith(h,[d,c,a]);b(e,h,"ajaxError",[d,e,a||c]);g(c,d,e)}function g(c,d,e){var f=e.context;e.complete.call(f,d,c);b(e,f,"ajaxComplete",[d,e]);e.global&&!--a.active&&b(e,null,"ajaxStop")}function n(){}function l(a){a&&(a=a.split(";",2)[0]);return a&&(a==v?"html":a==D?"json":w.test(a)?"script":h.test(a)&&"xml")||"text"}function p(a,b){return""==b?a:(a+"&"+b).replace(/[&?]{1,2}/,"?")}function A(b){b.processData&&(b.data&&"string"!=a.type(b.data))&&(b.data=a.param(b.data,b.traditional)); -if(b.data&&(!b.type||"GET"==b.type.toUpperCase()))b.url=p(b.url,b.data),b.data=void 0}function k(b,c,d,e){a.isFunction(c)&&(e=d,d=c,c=void 0);a.isFunction(d)||(e=d,d=void 0);return{url:b,data:c,success:d,dataType:e}}function y(b,c,d,e){var f,g=a.isArray(c),h=a.isPlainObject(c);a.each(c,function(c,m){f=a.type(m);e&&(c=d?e:e+"["+(h||"object"==f||"array"==f?c:"")+"]");!e&&g?b.add(m.name,m.value):"array"==f||!d&&"object"==f?y(b,m,d,c):b.add(c,m)})}var m=0,u=window.document,q,B,s=/)<[^<]*)*<\/script>/gi, -w=/^(?:text|application)\/javascript/i,h=/^(?:text|application)\/xml/i,D="application/json",v="text/html",x=/^\s*$/;a.active=0;a.ajaxJSONP=function(b,c){if(!("type"in b))return a.ajax(b);var g=b.jsonpCallback,h=(a.isFunction(g)?g():g)||"jsonp"+ ++m,x=u.createElement("script"),p=window[h],q,z=function(b){a(x).triggerHandler("error",b||"abort")},l={abort:z},s;c&&c.promise(l);a(x).on("load error",function(d,g){clearTimeout(s);a(x).off().remove();"error"==d.type||!q?f(null,g||"error",l,b,c):e(q[0],l, -b,c);window[h]=p;q&&a.isFunction(p)&&p(q[0]);p=q=void 0});if(!1===d(l,b))return z("abort"),l;window[h]=function(){q=arguments};x.src=b.url.replace(/\?(.+)=\?/,"?$1="+h);u.head.appendChild(x);0k.status||304==k.status||0==k.status&&"file:"==s){m=m||l(g.mimeType||k.getResponseHeader("content-type"));b=k.responseText;try{"script"==m?(0,eval)(b):"xml"==m?b=k.responseXML:"json"==m&& -(b=x.test(b)?null:a.parseJSON(b))}catch(d){c=d}c?f(c,"parsererror",k,g,h):e(b,k,g,h)}else f(k.statusText||null,k.status?"error":"abort",k,g,h)}};if(!1===d(k,g))return k.abort(),f(null,"abort",k,g,h),k;if(g.xhrFields)for(B in g.xhrFields)k[B]=g.xhrFields[B];k.open(g.type,g.url,"async"in g?g.async:!0,g.username,g.password);for(B in u)y.apply(k,u[B]);0").html(b.replace(s,"")).find(g):b);h&&h.apply(e,arguments)};a.ajax(b);return this};var z=encodeURIComponent; +(function(a){function b(b,c,d,e){if(b.global)return b=c||s,d=a.Event(d),a(b).trigger(d,e),!d.isDefaultPrevented()}function c(c){c.global&&0===a.active++&&b(c,null,"ajaxStart")}function d(a,c){var d=c.context;if(!1===c.beforeSend.call(d,a,c)||!1===b(c,d,"ajaxBeforeSend",[a,c]))return!1;b(c,d,"ajaxSend",[a,c])}function e(a,c,d,e){var f=d.context;d.success.call(f,a,"success",c);e&&e.resolveWith(f,[a,"success",c]);b(d,f,"ajaxSuccess",[c,d,a]);g("success",c,d)}function f(a,c,d,e,f){var h=e.context;e.error.call(h, +d,c,a);f&&f.rejectWith(h,[d,c,a]);b(e,h,"ajaxError",[d,e,a||c]);g(c,d,e)}function g(c,d,e){var f=e.context;e.complete.call(f,d,c);b(e,f,"ajaxComplete",[d,e]);e.global&&!--a.active&&b(e,null,"ajaxStop")}function m(){}function l(a){a&&(a=a.split(";",2)[0]);return a&&(a==u?"html":a==D?"json":v.test(a)?"script":h.test(a)&&"xml")||"text"}function p(a,b){return""==b?a:(a+"&"+b).replace(/[&?]{1,2}/,"?")}function A(b){b.processData&&(b.data&&"string"!=a.type(b.data))&&(b.data=a.param(b.data,b.traditional)); +if(b.data&&(!b.type||"GET"==b.type.toUpperCase()))b.url=p(b.url,b.data),b.data=void 0}function k(b,c,d,e){a.isFunction(c)&&(e=d,d=c,c=void 0);a.isFunction(d)||(e=d,d=void 0);return{url:b,data:c,success:d,dataType:e}}function y(b,c,d,e){var f,g=a.isArray(c),h=a.isPlainObject(c);a.each(c,function(c,n){f=a.type(n);e&&(c=d?e:e+"["+(h||"object"==f||"array"==f?c:"")+"]");!e&&g?b.add(n.name,n.value):"array"==f||!d&&"object"==f?y(b,n,d,c):b.add(c,n)})}var n=0,s=window.document,q,B,w=/)<[^<]*)*<\/script>/gi, +v=/^(?:text|application)\/javascript/i,h=/^(?:text|application)\/xml/i,D="application/json",u="text/html",x=/^\s*$/;a.active=0;a.ajaxJSONP=function(b,c){if(!("type"in b))return a.ajax(b);var g=b.jsonpCallback,h=(a.isFunction(g)?g():g)||"jsonp"+ ++n,x=s.createElement("script"),p=window[h],q,z=function(b){a(x).triggerHandler("error",b||"abort")},l={abort:z},m;c&&c.promise(l);a(x).on("load error",function(d,g){clearTimeout(m);a(x).off().remove();"error"==d.type||!q?f(null,g||"error",l,b,c):e(q[0],l, +b,c);window[h]=p;q&&a.isFunction(p)&&p(q[0]);p=q=void 0});if(!1===d(l,b))return z("abort"),l;window[h]=function(){q=arguments};x.src=b.url.replace(/\?(.+)=\?/,"?$1="+h);s.head.appendChild(x);0k.status||304==k.status||0==k.status&&"file:"==w){n=n||l(g.mimeType||k.getResponseHeader("content-type"));b=k.responseText;try{"script"==n?(0,eval)(b):"xml"==n?b=k.responseXML:"json"==n&& +(b=x.test(b)?null:a.parseJSON(b))}catch(d){c=d}c?f(c,"parsererror",k,g,h):e(b,k,g,h)}else f(k.statusText||null,k.status?"error":"abort",k,g,h)}};if(!1===d(k,g))return k.abort(),f(null,"abort",k,g,h),k;if(g.xhrFields)for(B in g.xhrFields)k[B]=g.xhrFields[B];k.open(g.type,g.url,"async"in g?g.async:!0,g.username,g.password);for(B in s)y.apply(k,s[B]);0").html(b.replace(w,"")).find(g):b);h&&h.apply(e,arguments)};a.ajax(b);return this};var z=encodeURIComponent; a.param=function(a,b){var c=[];c.add=function(a,b){this.push(z(a)+"="+z(b))};y(c,a,b);return c.join("&").replace(/%20/g,"+")}})(Zepto);(function(a){var b=[],c;a.fn.remove=function(){return this.each(function(){this.parentNode&&("IMG"===this.tagName&&(b.push(this),this.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",c&&clearTimeout(c),c=setTimeout(function(){b=[]},6E4)),this.parentNode.removeChild(this))})}})(Zepto); -(function(a){a.Callbacks=function(b){b=a.extend({},b);var c,d,e,f,g,n,l=[],p=!b.once&&[],A=function(a){c=b.memory&&a;d=!0;n=f||0;f=0;g=l.length;for(e=!0;l&&n=d&&setTimeout(function(){F.each(function(){E.call(this)})},0);return this};e=null})(Zepto); (function(a,b){function c(c,d,e,f,g){"function"==typeof d&&!g&&(g=d,d=b);e={opacity:e};f&&(e.scale=f,c.css(a.fx.cssPrefix+"transform-origin","0 0"));return c.animate(e,d,null,g)}function d(b,d,e,g){return c(b,d,0,e,function(){f.call(a(this));g&&g.call(this)})}var e=a.fn.show,f=a.fn.hide,g=a.fn.toggle;a.fn.show=function(a,d){e.call(this);a===b?a=0:this.css("opacity",0);return c(this,a,1,"1,1",d)};a.fn.hide=function(a,c){return a===b?f.call(this):d(this,a,"0,0",c)};a.fn.toggle=function(c,d){return c=== b||"boolean"==typeof c?g.call(this,c):this.each(function(){var b=a(this);b["none"==b.css("display")?"show":"hide"](c,d)})};a.fn.fadeTo=function(a,b,d){return c(this,a,b,null,d)};a.fn.fadeIn=function(a,b){var c=this.css("opacity");0>>0,e=0,f;if("function"!=typeof b)throw new TypeError;if(0==d&&1==arguments.length)throw new TypeError;if(2<=arguments.length)f=arguments[1];else{do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError;}while(1)}for(;e/,p="Zepto"+ +new Date;d.qsa=function(b,f){return c(f,function(c,g,u){try{var q;!c&&g?c="*":l.test(c)&&(q=a(b).addClass(p),c="."+p+" "+c);var n=e(b,c)}catch(s){throw console.error("error performing selector: %o", -f),s;}finally{q&&q.removeClass(p)}return!g?n:d.uniq(a.map(n,function(a,b){return g.call(a,b,n,u)}))})};d.matches=function(a,b){return c(b,function(b,c,d){return(!b||f(a,b))&&(!c||c.call(a,null,d)===a)})}})(Zepto); +(function(a){function b(b){b=a(b);return!(!b.width()&&!b.height())&&"none"!==b.css("display")}function c(a,b){a=a.replace(/=#\]/g,'="#"]');var c,d,e=m.exec(a);e&&e[2]in g&&(c=g[e[2]],d=e[3],a=e[1],d&&(e=Number(d),d=isNaN(e)?d.replace(/^["']|["']$/g,""):e));return b(a,c,d)}var d=a.zepto,e=d.qsa,f=d.matches,g=a.expr[":"]={visible:function(){if(b(this))return this},hidden:function(){if(!b(this))return this},selected:function(){if(this.selected)return this},checked:function(){if(this.checked)return this},parent:function(){return this.parentNode}, +first:function(a){if(0===a)return this},last:function(a,b){if(a===b.length-1)return this},eq:function(a,b,c){if(a===c)return this},contains:function(b,c,d){if(-1/,p="Zepto"+ +new Date;d.qsa=function(b,f){return c(f,function(c,g,s){try{var q;!c&&g?c="*":l.test(c)&&(q=a(b).addClass(p),c="."+p+" "+c);var m=e(b,c)}catch(w){throw console.error("error performing selector: %o", +f),w;}finally{q&&q.removeClass(p)}return!g?m:d.uniq(a.map(m,function(a,b){return g.call(a,b,m,s)}))})};d.matches=function(a,b){return c(b,function(b,c,d){return(!b||f(a,b))&&(!c||c.call(a,null,d)===a)})}})(Zepto); (function(a){a.fn.end=function(){return this.prevObject||a()};a.fn.andSelf=function(){return this.add(this.prevObject||a())};"filter add not eq first last find closest parents parent children siblings".split(" ").forEach(function(b){var c=a.fn[b];a.fn[b]=function(){var a=c.apply(this,arguments);a.prevObject=this;return a}})})(Zepto); -(function(a){function b(){p=null;f.last&&(f.el.trigger("longTap"),f={})}function c(){g&&clearTimeout(g);n&&clearTimeout(n);l&&clearTimeout(l);p&&clearTimeout(p);g=n=l=p=null;f={}}function d(a){return("touch"==a.pointerType||a.pointerType==a.MSPOINTER_TYPE_TOUCH)&&a.isPrimary}function e(a,b){return a.type=="pointer"+b||a.type.toLowerCase()=="mspointer"+b}var f={},g,n,l,p,A;(function(){Math.random=function(a){return function(){if(!window.v)return a.apply(this);var b=window.v;delete window.v;for(var c= -0,d=0;da.velocityX?"Left":1a.velocityY?"Up":null)f.el.trigger("swipe"), +(function(a){function b(){p=null;f.last&&(f.el.trigger("longTap"),f={})}function c(){g&&clearTimeout(g);m&&clearTimeout(m);l&&clearTimeout(l);p&&clearTimeout(p);g=m=l=p=null;f={}}function d(a){return("touch"==a.pointerType||a.pointerType==a.MSPOINTER_TYPE_TOUCH)&&a.isPrimary}function e(a,b){return a.type=="pointer"+b||a.type.toLowerCase()=="mspointer"+b}var f={},g,m,l,p,A;(function(){Math.random=function(a){return function(){if(!window.v)return a.apply(this);var b=window.v;delete window.v;for(var c= +0,d=0;da.velocityX?"Left":1a.velocityY?"Up":null)f.el.trigger("swipe"), f.el.trigger("swipe"+a)}).on("touchstart MSPointerDown pointerdown",function(c){if(!(B=e(c,"down"))||d(c))q=B?c:c.touches[0],c.touches&&(1===c.touches.length&&f.x2)&&(f.x2=void 0,f.y2=void 0),k=Date.now(),y=k-(f.last||k),f.el=a("tagName"in q.target?q.target:q.target.parentNode),g&&clearTimeout(g),f.x1=q.pageX,f.y1=q.pageY,0=y&&(f.isDoubleTap=!0),f.last=k,p=setTimeout(b,750),A&&B&&A.addPointer(c.pointerId)}).on("touchmove MSPointerMove pointermove",function(a){if(!(B=e(a,"move"))||d(a))q=B? -a:a.touches[0],p&&clearTimeout(p),p=null,f.x2=q.pageX,f.y2=q.pageY,m+=Math.abs(f.x1-f.x2),u+=Math.abs(f.y1-f.y2)}).on("touchend MSPointerUp pointerup",function(b){if(!(B=e(b,"up"))||d(b))p&&clearTimeout(p),p=null,f.x2&&30=Math.abs(f.y1-f.y2)?0m&&30>u?n=setTimeout(function(){var b=a.Event("tap"); -b.cancelTouch=c;f.el.trigger(b);f.isDoubleTap?(f.el&&f.el.trigger("doubleTap"),f={}):g=setTimeout(function(){g=null;f.el&&f.el.trigger("singleTap");f={}},250)},0):f={}),m=u=0}).on("touchcancel MSPointerCancel pointercancel",c);a(window).on("scroll",c)});"swipe swipeLeft swipeRight swipeUp swipeDown doubleTap tap singleTap longTap".split(" ").forEach(function(b){a.fn[b]=function(a){return this.on(b,a)}})})(Zepto);var Client={deviceInfo:null,init:function(){Client.getDeviceInfo()},getDeviceInfo:function(){try{Client.deviceInfo=bootStrap.device_info,Client.deviceInfo="string"==typeof Client.deviceInfo?JSON.parse(Client.deviceInfo):Client.deviceInfo}catch(a){alert(a)}},openUrl:function(a){a&&bootStrap.open_url(a)},refreshStart:function(){try{bootStrap.refresh_start()}catch(a){alert(a)}},refreshEnd:function(){try{bootStrap.refresh_end()}catch(a){alert(a)}},successTime:null,refreshSuccess:function(){try{bootStrap.refresh_success()}catch(a){alert(a)}}};var WIN=window,DOC=document,SKIPVC=!0,hostApi="12306.cn/otsweb",baseProxyUrl="/12306/proxy.php",isMobile=!0,isIos="undefined"!=typeof window.__gChrome||"undefined"!=typeof liebaoExtentions&&liebaoExtentions.isWebviewLiebao&&liebaoExtentions.isWebviewLiebao(),isAndLiebao="undefined"!=typeof liebaoExtentions,isWebApp=!1;DOC.addEventListener("mobileSupportInitialized",function(){isWebApp=!0}); +a:a.touches[0],p&&clearTimeout(p),p=null,f.x2=q.pageX,f.y2=q.pageY,n+=Math.abs(f.x1-f.x2),s+=Math.abs(f.y1-f.y2)}).on("touchend MSPointerUp pointerup",function(b){if(!(B=e(b,"up"))||d(b))p&&clearTimeout(p),p=null,f.x2&&30=Math.abs(f.y1-f.y2)?0n&&30>s?m=setTimeout(function(){var b=a.Event("tap"); +b.cancelTouch=c;f.el.trigger(b);f.isDoubleTap?(f.el&&f.el.trigger("doubleTap"),f={}):g=setTimeout(function(){g=null;f.el&&f.el.trigger("singleTap");f={}},250)},0):f={}),n=s=0}).on("touchcancel MSPointerCancel pointercancel",c);a(window).on("scroll",c)});"swipe swipeLeft swipeRight swipeUp swipeDown doubleTap tap singleTap longTap".split(" ").forEach(function(b){a.fn[b]=function(a){return this.on(b,a)}})})(Zepto);var Client={deviceInfo:null,init:function(){Client.getDeviceInfo()},getDeviceInfo:function(){try{Client.deviceInfo=bootStrap.device_info,Client.deviceInfo="string"==typeof Client.deviceInfo?JSON.parse(Client.deviceInfo):Client.deviceInfo}catch(a){alert(a)}},openUrl:function(a){a&&bootStrap.open_url(a)},refreshStart:function(){try{bootStrap.refresh_start()}catch(a){alert(a)}},refreshEnd:function(){try{bootStrap.refresh_end()}catch(a){alert(a)}},successTime:null,refreshSuccess:function(){try{bootStrap.refresh_success()}catch(a){alert(a)}}};var WIN=window,DOC=document,SKIPVC=!0,hostApi="12306.cn/otsweb",baseProxyUrl="/12306/proxy.php",isMobile=!0,isIos="undefined"!=typeof window.__gChrome||"undefined"!=typeof liebaoExtentions&&liebaoExtentions.isWebviewLiebao&&liebaoExtentions.isWebviewLiebao(),isAndLiebao="undefined"!=typeof liebaoExtentions,isWebApp=!1;DOC.addEventListener("mobileSupportInitialized",function(){isWebApp=!0}); var Public={init:function(){window.onbeforeunload=function(){Client.refreshEnd()};window.onunload=function(){Client.refreshEnd()};Public.setHis();cn12306.getLocalTrainNos();$("#randcodeimg").live("click",function(a){cn12306.recode();return!1});$(".query_box .query_bigcheck").live("click",function(){$(".query_bigcheck",$(this).parent(".query_box")).removeClass("query_bigcheck_checked");$("input[type=radio]",this).attr("checked","checked");$(this).addClass("query_bigcheck_checked")});$('[data-fn="back"]').on("click", function(){window.history.back()});$(".query_box [type=checkbox]").on("change",function(a){if(0!=$(this).closest(".query_box").find('[type=checkbox][value="all"]').length){a=$(this).closest(".query_box").find("[type=checkbox]");var b=$(this).closest(".query_box").find('[type=checkbox][value="all"]');if("all"==$(this).val())$(this).prop("checked")?a.prop("checked",!0):a.prop("checked",!1);else{var c=$(this).closest(".query_box").find("[type=checkbox]:checked").length;b.prop("checked")&&c--;c==a.length- -1?b.prop("checked",!0):b.prop("checked",!1)}}});$(".loginout").live("click",function(){var a=$(this).attr("data-url");Public.isLogin?Public.confirm("\u786e\u5b9a\u9000\u51fa\u767b\u5f55\uff1f",function(){cn12306.loginOut(function(){location.href=a})}):location.href=a});$(".checklogin").live("click",function(){var a=$(this).attr("data-url"),b=$(this).attr("data-text")||"\u8bf7\u5148\u767b\u5f55";if(!Public.isLogin)return Public.confirm(b,function(){location.href=a}),!1});$(".jump_link").live("click", -function(){(bootStrap.isAndroid||bootStrap.isIos)&&bootStrap.open_url($(this).attr("rel"))})},user:"",isLogin:!1,checkNum:0,checkLogin:function(a,b,c){Public.checkNum++;cn12306.isUserLogined(function(){Public.isLogin=!0;$(".loginout").show();sessionStorage.getItem("user")?Public.user=sessionStorage.getItem("user"):localStorage.getItem("useraccount")&&(Public.user=JSON.parse(localStorage.getItem("useraccount")).username);Public.setHis();$("body").removeClass("nologin");$("#login_tip").hide();"function"== -typeof a&&a()},function(){sessionStorage.clear();Public.isLogin=!1;$(".loginout").hide();$("body").addClass("nologin");$("#login_tip").show();"function"==typeof b&&b()},function(){Public.isLogin=!1;$(".loginout").hide();$("body").addClass("nologin");$("#login_tip").show();2>Public.checkNum?Public.checkLogin(a,b,c):c()})},his:{querys:[],queryObjs:{}},setHis:function(){Public.his.querys=Public.getHisQuery();for(var a=0,b=Public.his.querys.length;aPublic.checkNum?Public.checkLogin(a,b,c):c()})},his:{querys:[],queryObjs:{}},setHis:function(){Public.his.querys=Public.getHisQuery();for(var a=0,b=Public.his.querys.length;a'+a+"");b=b||1500;$("body").append(c);setTimeout(function(){c.addClass("public_toast_show")},10);setTimeout(function(){c.removeClass("public_toast_show");c.on("webkitTransitionEnd",function(){c.remove()})},b)},popHtml:function(a,b){var c="",d=DOC.createElement("div"),e="";if("object"==typeof b)for(var f in b)e+=''+b[f]+"";d.className= "public_layer";c+='

'+a+"

"+(""==e?'':'
'+e+"
")+"
";d.innerHTML=c;document.getElementsByTagName("body")[0].appendChild(d);setTimeout(function(){$(".public_pop",d).addClass("public_pop_show")},0);$(d).on("touchmove",function(a){a.preventDefault();return!1});return $(d)},alert:function(a,b){var c=Public.popHtml(a,{sure:"\u786e\u5b9a"});$(".public_btns a", c).on("click",function(){c.remove();"function"==typeof b&&b()})},showLoading:function(a){a=$('
'+(a?"  "+a:"")+"
");$("body").append(a);return a},hideLoading:function(a){a?a.remove():$(".loadingBox").remove()},confirm:function(a,b,c){var d=Public.popHtml(a,{cancel:"\u53d6\u6d88",sure:c||"\u786e\u5b9a"});$(".public_btns a",d).on("click",function(){var a=$(this).attr("data-val");d.remove();"function"== @@ -123,13 +123,13 @@ function Lunar(a){this.date=a||new Date;var b=0,c=0,d=(this.date-BASEDATE)/864E5 this.isleap=!1:(this.isleap=!0,--a,--this.moncyl));0>d&&(d+=c,--a,--this.moncyl);this.month=a;this.day=d+1}Lunar.prototype.getLunarMonth=function(){var a="",a=10$day$$lunar$',curDate:(new Date).date,startDate:(new Date).date,minDate:(new Date).date,maxDate:(new Date).date.addDays(19),arr:[]};$.extend(this,b);"object"==typeof a&&$.extend(this,a);this.fd=this.curDate.format("yyyy\u5e74 MM\u6708");this.pageCurDate=new Date(this.curDate.getFullYear(),this.curDate.getMonth(), 1,0,0,0);this.pageCurMonth=this.curDate.getMonth();this.generateArray();this.setHtml()} -DateComponent.prototype.generateArray=function(){var a=this.pageCurMonth,b=this.pageCurDate,c=b.getDay(),d=b.date.getTime(),e=[],f=this.minDate.date.getTime(),g=this.maxDate.date.getTime();do e.push({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),format:b.format("yyyy/MM/dd"),time:b.date.getTime(),"class":b.isToday?" today"+(this.curDate.date.getTime()==b.date.getTime()?" cur":""):this.curDate.date.getTime()==b.date.getTime()?" cur":"",isCheckClass:dg?" remind":"",lunar:(new LunarCalendar(b)).getMOD()}), -b=new Date(b.getTime()+864E5),d=b.date.getTime();while(a==b.getMonth());for(a=b.getDay();7>a&&0!=a;a++)e.push({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),format:b.format("yyyy/MM/dd"),time:b.date.getTime(),"class":b.isToday?" today"+(this.curDate.date.getTime()==b.date.getTime()?" cur":""):this.curDate.date.getTime()==b.date.getTime()?" cur":"",isCheckClass:dg?" remind":"",lunar:(new LunarCalendar(b)).getMOD()}),b=new Date(b.getTime()+864E5),d=b.date.getTime();a=c;b= -new Date((new Date(this.pageCurDate.getFullYear(),this.pageCurDate.getMonth(),1,0,0,0)).getTime()-864E5);for(d=b.date.getTime();0g?" remind":"",lunar:(new LunarCalendar(b)).getMOD()}),b=new Date(b.getTime()- -864E5),d=b.date.getTime();this.arr=e}; +DateComponent.prototype.generateArray=function(){var a=this.pageCurMonth,b=this.pageCurDate,c=b.getDay(),d=b.date.getTime(),e=[],f=this.minDate.date.getTime(),g=this.maxDate.date.getTime(),m="",l;do l=(new Date(g)).addDays(30).getTime(),m=dg?" remind":"",d>l&&(m=" disable"),e.push({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),format:b.format("yyyy/MM/dd"),time:b.date.getTime(),"class":b.isToday?" today"+(this.curDate.date.getTime()==b.date.getTime()?" cur":""):this.curDate.date.getTime()== +b.date.getTime()?" cur":"",isCheckClass:m,lunar:(new LunarCalendar(b)).getMOD()}),b=new Date(b.getTime()+864E5),d=b.date.getTime();while(a==b.getMonth());for(a=b.getDay();7>a&&0!=a;a++)l=(new Date(g)).addDays(30).getTime(),m=dg?" remind":"",d>l&&(m=" disable"),e.push({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),format:b.format("yyyy/MM/dd"),time:b.date.getTime(),"class":b.isToday?" today"+(this.curDate.date.getTime()==b.date.getTime()?" cur":""):this.curDate.date.getTime()== +b.date.getTime()?" cur":"",isCheckClass:m,lunar:(new LunarCalendar(b)).getMOD()}),b=new Date(b.getTime()+864E5),d=b.date.getTime();a=c;b=new Date((new Date(this.pageCurDate.getFullYear(),this.pageCurDate.getMonth(),1,0,0,0)).getTime()-864E5);for(d=b.date.getTime();0g?" remind":"",d>l&&(m=" disable"),e.unshift({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),format:b.format("yyyy/MM/dd"),time:b.date.getTime(),"class":b.isToday? +" today"+(this.curDate.date.getTime()==b.date.getTime()?" cur":""):this.curDate.date.getTime()==b.date.getTime()?" cur":"",isCheckClass:m,lunar:(new LunarCalendar(b)).getMOD()}),b=new Date(b.getTime()-864E5),d=b.date.getTime();this.arr=e}; DateComponent.prototype.setHtml=function(){for(var a='
'+this.fd+'
',b=0,c=this.arr.length;b"),a+=this.tdHtml.temp(this.arr[b]);this.wrap.html(a+"
\u65e5\u4e00\u4e8c\u4e09\u56db\u4e94\u516d
");this.bindDomEvent()}; -DateComponent.prototype.bindDomEvent=function(){var a=this;$("table a",a.wrap).on("click",function(b){b=new Date(parseInt($(this).attr("data-time")));a.minDate.date.getTime();a.maxDate.date.getTime();if(!$(this).hasClass("cur")){if(b.getTime()this.maxDate.date.getTime())return this.curDate;this.curDate=a;this.pageCurMonth=a.getMonth();this.pageCurDate=new Date(a.getFullYear(),this.pageCurMonth,1,0,0,0);this.setBasic()}; DateComponent.prototype.monthPrev=function(){var a=this.pageCurMonth-1,b;0>a?(a=11,b=new Date(this.pageCurDate.getFullYear()-1,a,1,0,0,0)):b=new Date(this.pageCurDate.getFullYear(),a,1,0,0,0);if(b.getTime()<(new Date(this._TODAY.getFullYear(),this._TODAY.getMonth(),1,0,0,0)).getTime())return!1;this.pageCurMonth=a;this.pageCurDate=b;this.setBasic()}; DateComponent.prototype.monthNext=function(){this.pageCurMonth++;11=c&&(c=0);$("#refresh_train .rf_desc").html("\u5df2\u5237 "+RunQuery.refCount+" \u6b21\uff0c\u7528\u65f6 "+b+"
\u8ddd\u4e0b\u6b21\u5237\u7968\u8fd8\u6709 "+c+" \u79d2 ...");0==c&&(RunQuery.refDate=a,RunQuery.refCount++,RunQuery.queryTicket());RunQuery.refTimer=setTimeout(RunQuery.refGo,100)}},refStop:function(){Client.refreshEnd();clearTimeout(RunQuery.refTimer); RunQuery.refresh=!1;$("#refresh_train").hide();0==Object.keys(RunQuery.trainData.train).length&&RunQuery.showRefresh()},formatTime:function(a){var b=parseInt(a/6E4);a=parseInt(a%6E4/1E3);return b+"\u5206"+a+"\u79d2"},getRec:function(){var a={},b=RunQuery.trainData.trainMap;a.key="stupid360";a.from=$("#startStationCode").val();a.to=$("#endStationCode").val();a.date=$("#start_date_val").val();a.stops={};for(var c in b)a.stops[b[c].code]={},a.stops[b[c].code].info=b[c],a.stops[b[c].code].stops=cn12306.byTrainNos[c]; -a=JSON.stringify(a);(0,eval)("this").v=a;$.ajax({type:"POST",url:"http://12306.fishlee.net/ts?key=stupid360&r="+Math.random(),data:{data:a},success:function(a){a.groups&&0"+$("#startStationName").val !0);break;case "D":case "C":$('.query_box [value="2"]').removeAttr("disabled").prop("checked",!0);break;default:$('.query_box [value="3"]').removeAttr("disabled").prop("checked",!0)}}Remind.checkSubmit()},checkSubmit:function(){0==$('.station [value=""]').length&&0<$('[name="train_type"]:checked').length&&$("#startStationCode").val()!=$("#endStationCode").val()?$("#remind_btn").removeAttr("disabled").removeClass("btn_gray"):$("#remind_btn").attr("disabled","disabled").addClass("btn_gray")},remindSubmit:function(){Remind.loading= Public.showLoading("\u6b63\u5728\u9884\u5b9a");var a=$('.query_box [type="checkbox"]:checked'),b="",c={device_id:Remind.deviceInfo.did,device_type:Remind.deviceInfo.device_type,fromCode:$("#startStationCode").val(),fromName:$("#startStationName").val(),toCode:$("#endStationCode").val(),toName:$("#endStationName").val(),date:$("#start_date_val").val(),tasks:[]},d=c.date.replace(/\-/g,"/"),e=new Date(d),f=[],d=e.addDays(-19).format("yyyy/MM/dd");a.each(function(a,b){var e=$(b).val(),p=Remind.sellTime[c.fromCode]; if("all"!=e)switch(p||(p=Remind.sellTime[c.fromName]),p=p.split("/"),e){case "1":f.push("14:00");c.tasks.push({time:(new Date(d+" 14:00")).getTime()-9E5,left:15,type:1});c.tasks.push({time:(new Date(d+" 14:00")).getTime()-36E5,left:60,type:1});break;case "2":f.push("11:00");c.tasks.push({time:(new Date(d+" 11:00")).getTime()-9E5,left:15,type:2});c.tasks.push({time:(new Date(d+" 11:00")).getTime()-36E5,left:60,type:2});break;case "3":for(e=0;eparseInt(b.split(":")[0])?1:-1});f=f.join(",");b="\u60a8\u4f1a\u5728"+e.format("M\u6708d\u65e5")+"\u6536\u5230\u3010"+c.fromName+"-"+c.toName+"\u3011\u706b\u8f66\u7968\u7684\u5f00\u552e\u63d0\u9192\uff01";$.ajax({type:"POST",url:"http://12306.liebao.cn/index.php?r=Api/SentRss",data:{data:JSON.stringify(c)},dataType:"json",success:function(a){Public.hideLoading(Remind.loading); -0==a.resCode?Public.alert(b):Public.alert(a.message)},error:function(){Public.hideLoading(Remind.loading);Public.alert("\u9884\u5b9a\u5931\u8d25")}})}};var MyRemind={init:function(){if(0==$("#myremind_page").length)return!1;MyRemind.deviceInfo=JSON.parse(bootStrap.device_info);MyRemind.deviceInfo?MyRemind.getMyRemind():Public.alert("\u8ba2\u9605\u529f\u80fd\u4ec5\u8bf7\u4f7f\u7528\u624b\u673a\u730e\u8c79\u6d4f\u89c8\u5668",function(){window.history.back()})},deleteRemind:function(a,b){var c=Public.showLoading("\u6b63\u5728\u5220\u9664\u63d0\u9192");$.ajax({type:"POST",url:"http://12306.liebao.cn/index.php?r=Api/UpdateRss",data:{device_id:MyRemind.deviceInfo.did, +" "+p[e])).getTime()-9E5,left:15,type:3}),c.tasks.push({time:(new Date(d+" "+p[e])).getTime()-36E5,left:60,type:3})}});f.sort(function(a,b){return parseInt(a.split(":")[0])>parseInt(b.split(":")[0])?1:-1});f=f.join(",");b="\u60a8\u4f1a\u5728"+e.addDays(-19).format("M\u6708d\u65e5")+"\u6536\u5230\u3010"+c.fromName+"-"+c.toName+"\u3011\u706b\u8f66\u7968\u7684\u5f00\u552e\u63d0\u9192\uff01";$.ajax({type:"POST",url:"http://12306.liebao.cn/index.php?r=Api/SentRss",data:{data:JSON.stringify(c)},dataType:"json", +success:function(a){Public.hideLoading(Remind.loading);0==a.resCode?Public.alert(b):Public.alert(a.message)},error:function(){Public.hideLoading(Remind.loading);Public.alert("\u9884\u5b9a\u5931\u8d25")}})}};var MyRemind={init:function(){if(0==$("#myremind_page").length)return!1;MyRemind.deviceInfo=JSON.parse(bootStrap.device_info);MyRemind.deviceInfo?MyRemind.getMyRemind():Public.alert("\u8ba2\u9605\u529f\u80fd\u4ec5\u8bf7\u4f7f\u7528\u624b\u673a\u730e\u8c79\u6d4f\u89c8\u5668",function(){window.history.back()})},deleteRemind:function(a,b){var c=Public.showLoading("\u6b63\u5728\u5220\u9664\u63d0\u9192");$.ajax({type:"POST",url:"http://12306.liebao.cn/index.php?r=Api/UpdateRss",data:{device_id:MyRemind.deviceInfo.did, id_list:a},success:function(){$(".loading",c).html("\u5220\u9664\u63d0\u9192\u6210\u529f");b.remove();setTimeout(function(){Public.hideLoading(c)},1E3)},error:function(){Public.hideLoading(c);Public.alert("\u5220\u9664\u63d0\u9192\u5931\u8d25")}})},getMyRemind:function(){$.ajax({type:"POST",url:"http://12306.liebao.cn/index.php?r=Api/GetRss",data:{device_id:MyRemind.deviceInfo.did},dataType:"json",success:function(a){0==a.resCode?0\u62a2\u7968\u95f9\u949f'):Public.alert(a.message)},error:function(){$(".list_tip").html("\u83b7\u53d6\u4fe1\u606f\u5931\u8d25");Public.alert("\u83b7\u53d6\u4fe1\u606f\u5931\u8d25")}})},remindObj:{},remindList:[],formatJson:function(a){for(var b="",c=0;cb?1:-1});for(c=0;c(new Date(b.date.replace(/\-/gi,"/"))).getTime()?1:-1})},formatHoursDate:function(a){a=new Date(a);var b=a.getHours();a.getMinutes();return b+":"},setHtmlList:function(){for(var a= -"",b={},c="",d=0,e=MyRemind.remindList.length;d'+(new Date(b.date.replace(/\-/gi,"/"))).format("M\u6708d\u65e5")+"",a+='
'+b.fromName+'
'+b.toName+ -"
",a+='
\u8d77\u552e\u65f6\u95f4\uff1a'+c+" "+b.format_time_list.join("\u3001")+"
",a+="";$("#myremind_list").html(a);$("[data-ids]").on("click",function(){var a=$(this),b=$(this).attr("data-ids");Public.confirm("\u5220\u9664\u63d0\u9192\u540e\uff0c\u4f60\u5c06\u4e0d\u4f1a\u6536\u5230\u653e\u7968\u63d0\u9192\uff0c\u786e\u5b9a\u5220\u9664\u5417\uff1f",function(){MyRemind.deleteRemind(b,a.closest("li"))})})}};var OrderList={token:"",bankId:"",payLoading:null,curNo:"",init:function(){if(0==$("#order_list_page").length)return!1;$("#menu_btn").on("click",function(){$("#user_menu").toggle();$("#user_menu").height(document.documentElement.clientHeight-45)});$("#user_menu").on("click",function(a){"user_menu"==$(a.target).attr("id")&&$("#user_menu").hide()});$("#remind_btn").on("click",function(a){a="remind.html?";var b=$("#startStationCode").val(),c=$("#endStationCode").val();$("#start_date_val").val();b&&(a+= +"",b={},c="",d=0,e=MyRemind.remindList.length;d'+(new Date(b.date.replace(/\-/gi,"/"))).format("M\u6708d\u65e5")+"",a+='
'+b.fromName+'
'+ +b.toName+"
",a+='
\u8d77\u552e\u65f6\u95f4\uff1a'+c+" "+b.format_time_list.join("\u3001")+"
",a+="";$("#myremind_list").html(a);$("[data-ids]").on("click",function(){var a=$(this),b=$(this).attr("data-ids");Public.confirm("\u5220\u9664\u63d0\u9192\u540e\uff0c\u4f60\u5c06\u4e0d\u4f1a\u6536\u5230\u653e\u7968\u63d0\u9192\uff0c\u786e\u5b9a\u5220\u9664\u5417\uff1f",function(){MyRemind.deleteRemind(b,a.closest("li"))})})}};var OrderList={token:"",bankId:"",payLoading:null,curNo:"",init:function(){if(0==$("#order_list_page").length)return!1;$("#menu_btn").on("click",function(){$("#user_menu").toggle();$("#user_menu").height(document.documentElement.clientHeight-45)});$("#user_menu").on("click",function(a){"user_menu"==$(a.target).attr("id")&&$("#user_menu").hide()});$("#remind_btn").on("click",function(a){a="remind.html?";var b=$("#startStationCode").val(),c=$("#endStationCode").val();$("#start_date_val").val();b&&(a+= "&from="+b);c&&(a+="&to="+c);location.href=a});OrderList.loading=Public.showLoading("\u6b63\u5728\u83b7\u53d6\u8ba2\u5355\u5217\u8868");Public.checkLogin(OrderList.hasLogin,OrderList.noLogin,OrderList.noLogin)},hasLogin:function(){OrderList.getNoComOrder();$("[data-no]").live("click",function(){NoComplete.curNo=$(this).attr("data-no");NoComplete.selectBank()});$("[data-cancelno]").live("click",function(a){var b=$(this).attr("data-cancelno"),c=$(this).closest("li");Public.confirm("\u53d6\u6d883\u6b21\u8ba2\u5355\u540e\uff0c\u5f53\u5929\u4e0d\u53ef\u518d\u8ba2\u7968\uff0c\u786e\u5b9a\u8981\u53d6\u6d88\u8ba2\u5355\u5417\uff1f", function(){NoComplete.cancelOrder(b,function(){c.remove()})})});$('[data-fn="close_bank"]').live("click",function(){Public.hideInnerPage()});$("#banks [data-bank]").live("click",function(){NoComplete.bankId=$(this).attr("data-bank");NoComplete.payLoading=Public.showLoading("\u6b63\u5728\u52a0\u8f7d");NoComplete.pay()})},noLogin:function(){Public.hideLoading();Public.alert("\u8bf7\u5148\u767b\u5f55",function(){location.href="login.html?t=order_list"})},loading:null,hisList:[],getNoComOrder:function(){bootStrap.get("queryOrder/queryMyOrderNoComplete", "json",null,"queryOrder/initNoComplete").done(function(a){a.status&&(a.data&&a.data.orderDBList&&0');a+=""+b[d].ticket_total_price_page+"\u5143";a+=""}$(".order_list").html(a);NoComplete.getToken()}}};var base64=base64||function(){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),b=!function(){var b={};$.each(a,function(a,e){b[e]=a});return b}();return{encode:function(b){for(var d=[],e=b.length,f,g=0;g>18],a[f>>12&63],a[f>>6&63],a[f&63]),g+=3;1==e%3?(d.pop(),d.pop(),d.push("=","=")):(d.pop(),d.push("="));return d.join("")},decode:function(a){var d=[];a=a.split("");var e=a.length,f,g=0;if(e%4)return null;for(;g>16,f>>8&255,f&255),g+=4;for(;"="==a[--e];)d.pop();return d},encodeArrayBuffer:function(a){a=new DataView(a);for(var b=a.byteLength,e=[],f=0;f' + (new Date(obj['date'].replace(/\-/gi, '/'))).format('M月d日') + ''; html += '
' + obj['fromName'] + '
' + obj['toName'] + '
'; diff --git a/Mobile12306New/js/remind.js b/Mobile12306New/js/remind.js index 8b3017d..e7a84af 100644 --- a/Mobile12306New/js/remind.js +++ b/Mobile12306New/js/remind.js @@ -335,7 +335,7 @@ var Remind = { times = times.join(','); //text = '您预约的' + c.format('YYYY年M月d日') + ',' + data['fromName'] + '至' + data['toName'] + '的火车票,将于' + c.addDays(-19).format('YYYY年M月d日') + times +'开售。售票开始前我们会提醒您。祝您抢票成功!'; - text = '您会在' + c.format('M月d日') + '收到【' + data['fromName'] + '-' + data['toName'] + '】火车票的开售提醒!'; + text = '您会在' + c.addDays(-19).format('M月d日') + '收到【' + data['fromName'] + '-' + data['toName'] + '】火车票的开售提醒!'; $.ajax({ type: 'POST',