|
|
|
@ -16,17 +16,17 @@ FastClick.prototype.destroy=function(){var a=this.layer;this.deviceIsAndroid&&(a
|
|
|
|
|
FastClick.notNeeded=function(a){if("undefined"===typeof window.ontouchstart)return!0;if(/Chrome\/[0-9]+/.test(navigator.userAgent))if(FastClick.prototype.deviceIsAndroid){if((a=document.querySelector("meta[name=viewport]"))&&-1!==a.content.indexOf("user-scalable=no"))return!0}else return!0;return!1};FastClick.cache=[];FastClick.attach=function(a){if(-1!=FastClick.cache.indexOf(a))return!1;FastClick.cache.push(a);return new FastClick(a)};
|
|
|
|
|
"undefined"!==typeof define&&define.amd?define(function(){return FastClick}):"undefined"!==typeof module&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick;FastClick.attach(document);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 y.call(a,function(a){return null!=a})}function m(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 k(a){return a in E?E[a]:E[a]=RegExp("(^|\\s)"+a+"(\\s|$)")}function z(a){return"children"in a?x.call(a.children):h.map(a.childNodes,function(a){if(1==a.nodeType)return a})}function l(a,b,c){for(v in b)c&&(f(b[v])||H(b[v]))?(f(b[v])&&!f(a[v])&&(a[v]={}),H(b[v])&&!H(a[v])&&(a[v]=[]),l(a[v],b[v],c)):b[v]!==r&&(a[v]=b[v])}function w(a,b){return null==b?h(a):h(a).filter(b)}function p(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!==r;if(b===r)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<d;c++)B(a.childNodes[c],b)}var r,v,h,D,s=[],x=s.slice,y=s.filter,A=window.document,F={},E={},G={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,
|
|
|
|
|
e):c}function s(a,b){var c=a.className||"",d=c&&c.baseVal!==r;if(b===r)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<d;c++)B(a.childNodes[c],b)}var r,v,h,D,u=[],x=u.slice,y=u.filter,A=window.document,F={},E={},G={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,
|
|
|
|
|
"z-index":1,zoom:1},I=/^\s*<(\w+|!)[^>]*>/,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=A.createElement("table"),O=A.createElement("tr"),P={tr:A.createElement("tbody"),tbody:M,thead:M,tfoot:M,td:O,th:O,"*":A.createElement("div")},W=/complete|loaded|interactive/,X=/^[\w-]*$/,L={},R=L.toString,C={},J,K,Q=A.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 y.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(A.createElement(RegExp.$1)));d||(a.replace&&(a=a.replace(T,"<$1></$2>")),b===r&&(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<V.indexOf(a))e[a](b);else e.attr(a,b)}));return d};C.Z=function(a,b){a=a||[];a.__proto__=h.fn;a.selector=b||"";return a};C.isZ=function(a){return a instanceof C.Z};C.init=function(a,c){var d;if(a)if("string"==typeof a)if(a=a.trim(),"<"==a[0]&&I.test(a))d=C.fragment(a,RegExp.$1,c),a=null;else{if(c!==r)return h(c).find(a);d=C.qsa(A,a)}else{if(b(a))return h(A).ready(a);if(C.isZ(a))return a;if(H(a))d=n(a);else if(e(a))d=[a],a=null;else if(I.test(a))d=C.fragment(a.trim(),
|
|
|
|
|
RegExp.$1,c),a=null;else{if(c!==r)return h(c).find(a);d=C.qsa(A,a)}}else return C.Z();return C.Z(d,a)};h=function(a,b){return C.init(a,b)};h.extend=function(a){var b,c=x.call(arguments,1);"boolean"==typeof a&&(b=a,a=c.shift());c.forEach(function(c){l(a,c,b)});return a};C.qsa=function(a,b){var c,e="#"==b[0],f=!e&&"."==b[0],g=e||f?b.slice(1):b,A=X.test(g);return d(a)&&A&&e?(c=a.getElementById(g))?[c]:[]:1!==a.nodeType&&9!==a.nodeType?[]:x.call(A&&!e?f?a.getElementsByClassName(g):a.getElementsByTagName(b):
|
|
|
|
|
a.querySelectorAll(b))};h.contains=A.documentElement.contains?function(a,b){return a!==b&&a.contains(b)}:function(a,b){for(;b&&(b=b.parentNode);)if(b===a)return!0;return!1};h.type=a;h.isFunction=b;h.isWindow=c;h.isArray=H;h.isPlainObject=f;h.isEmptyObject=function(a){for(var b in a)return!1;return!0};h.inArray=function(a,b,c){return s.indexOf.call(b,a,c)};h.camelCase=J;h.trim=function(a){return null==a?"":String.prototype.trim.call(a)};h.uuid=0;h.support={};h.expr={};h.map=function(a,b){var c,d=[],
|
|
|
|
|
a.querySelectorAll(b))};h.contains=A.documentElement.contains?function(a,b){return a!==b&&a.contains(b)}:function(a,b){for(;b&&(b=b.parentNode);)if(b===a)return!0;return!1};h.type=a;h.isFunction=b;h.isWindow=c;h.isArray=H;h.isPlainObject=f;h.isEmptyObject=function(a){for(var b in a)return!1;return!0};h.inArray=function(a,b,c){return u.indexOf.call(b,a,c)};h.camelCase=J;h.trim=function(a){return null==a?"":String.prototype.trim.call(a)};h.uuid=0;h.support={};h.expr={};h.map=function(a,b){var c,d=[],
|
|
|
|
|
e;if(g(a))for(e=0;e<a.length;e++)c=b(a[e],e),null!=c&&d.push(c);else for(e in a)c=b(a[e],e),null!=c&&d.push(c);return 0<d.length?h.fn.concat.apply([],d):d};h.each=function(a,b){var c;if(g(a))for(c=0;c<a.length&&!1!==b.call(a[c],c,a[c]);c++);else for(c in a)if(!1===b.call(a[c],c,a[c]))break;return a};h.grep=function(a,b){return y.call(a,b)};window.JSON&&(h.parseJSON=JSON.parse);h.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){L["[object "+b+"]"]=b.toLowerCase()});
|
|
|
|
|
h.fn={forEach:s.forEach,reduce:s.reduce,push:s.push,sort:s.sort,indexOf:s.indexOf,concat:s.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(A.readyState)&&A.body?a(h):A.addEventListener("DOMContentLoaded",function(){a(h)},!1);return this},get:function(a){return a===r?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){s.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(y.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 0<this.length&&C.matches(this[0],a)},not:function(a){var c=[];if(b(a)&&a.call!==r)this.each(function(b){a.call(this,b)||c.push(this)});else{var d="string"==typeof a?this.filter(a):
|
|
|
|
|
g(a)&&b(a.item)?x.call(a):h(a);this.forEach(function(a){0>d.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 s.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(A.readyState)&&A.body?a(h):A.addEventListener("DOMContentLoaded",function(){a(h)},!1);return this},get:function(a){return a===r?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(y.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 0<this.length&&C.matches(this[0],a)},not:function(a){var c=[];if(b(a)&&a.call!==r)this.each(function(b){a.call(this,b)||c.push(this)});else{var d="string"==typeof a?this.filter(a):
|
|
|
|
|
g(a)&&b(a.item)?x.call(a):h(a);this.forEach(function(a){0>d.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;0<c.length;)c=h.map(c,function(a){if((a=a.parentNode)&&!d(a)&&0>b.indexOf(a))return b.push(a),a});return w(b,a)},parent:function(a){return w(K(this.pluck("parentNode")),a)},children:function(a){return w(this.map(function(){return z(this)}),
|
|
|
|
|
a)},contents:function(){return this.map(function(){return x.call(this.childNodes)})},siblings:function(a){return w(this.map(function(a,b){return y.call(z(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=A.createElement(b),A.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||1<this.length;return this.each(function(b){h(this).wrapAll(c?a.call(this,b):e?d.cloneNode(!0):d)})},wrapAll:function(a){if(this[0]){h(this[0]).before(a=h(a));for(var b;(b=
|
|
|
|
@ -36,21 +36,21 @@ this[0].textContent:null},attr:function(a,b){var c;return"string"==typeof a&&!(1
|
|
|
|
|
prop:function(a,b){a=Y[a]||a;return 1 in arguments?this.each(function(c){this[a]=p(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):r},val:function(a){return 0 in arguments?this.each(function(b){this.value=p(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=p(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 g="";if("string"==a(b))!c&&0!==c?this.each(function(){this.style.removeProperty(m(b))}):g=m(b)+":"+("number"==typeof c&&!G[m(b)]?c+"px":c);else for(v in b)!b[v]&&0!==b[v]?this.each(function(){this.style.removeProperty(m(v))}):g+=m(v)+":"+("number"==typeof b[v]&&!G[m(v)]?b[v]+"px":b[v])+";";return this.each(function(){this.style.cssText+=";"+g})},index:function(a){return a?this.indexOf(h(a)[0]):this.parent().children().indexOf(this[0])},
|
|
|
|
|
hasClass:function(a){return!a?!1:s.some.call(this,function(a){return this.test(u(a))},k(a))},addClass:function(a){return!a?this:this.each(function(b){if("className"in this){D=[];var c=u(this);p(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===r)return u(this,"");D=u(this);p(this,a,b,D).split(/\s+/g).forEach(function(a){D=D.replace(k(a),
|
|
|
|
|
" ")});u(this,D.trim())}})},toggleClass:function(a,b){return!a?this:this.each(function(c){var d=h(this);p(this,a,c,u(this)).split(/\s+/g).forEach(function(a){(b===r?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})})},scrollTop:function(a){if(this.length){var b="scrollTop"in this[0];return a===r?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===
|
|
|
|
|
hasClass:function(a){return!a?!1:u.some.call(this,function(a){return this.test(s(a))},k(a))},addClass:function(a){return!a?this:this.each(function(b){if("className"in this){D=[];var c=s(this);p(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===r)return s(this,"");D=s(this);p(this,a,b,D).split(/\s+/g).forEach(function(a){D=D.replace(k(a),
|
|
|
|
|
" ")});s(this,D.trim())}})},toggleClass:function(a,b){return!a?this:this.each(function(c){var d=h(this);p(this,a,c,s(this)).split(/\s+/g).forEach(function(a){(b===r?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})})},scrollTop:function(a){if(this.length){var b="scrollTop"in this[0];return a===r?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===
|
|
|
|
|
r?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||A.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,g=this[0];return e===r?c(g)?g["inner"+b]:d(g)?g.documentElement["scroll"+b]:(f=this.offset())&&f[a]:this.each(function(b){g=h(this);g.css(a,p(this,e,b,g[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=1<this.length;return 1>e.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(A.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 m(a){a&&(a=a.split(";",2)[0]);return a&&(a==s?"html":a==D?"json":v.test(a)?"script":h.test(a)&&"xml")||"text"}function k(a,b){return""==b?a:(a+"&"+b).replace(/[&?]{1,2}/,"?")}function z(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=k(b.url,b.data),b.data=void 0}function l(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 w(b,c,d,e){var f,g=a.isArray(c),h=a.isPlainObject(c);a.each(c,function(c,k){f=a.type(k);e&&(c=d?e:e+"["+(h||"object"==f||"array"==f?c:"")+"]");!e&&g?b.add(k.name,k.value):"array"==f||!d&&"object"==f?w(b,k,d,c):b.add(c,k)})}var p=0,u=window.document,q,B,r=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
|
|
|
|
v=/^(?:text|application)\/javascript/i,h=/^(?:text|application)\/xml/i,D="application/json",s="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"+ ++p,k=u.createElement("script"),x=window[h],q,y=function(b){a(k).triggerHandler("error",b||"abort")},m={abort:y},r;c&&c.promise(m);a(k).on("load error",function(d,g){clearTimeout(r);a(k).off().remove();"error"==d.type||!q?f(null,g||"error",m,b,c):e(q[0],m,
|
|
|
|
|
b,c);window[h]=x;q&&a.isFunction(x)&&x(q[0]);x=q=void 0});if(!1===d(m,b))return y("abort"),m;window[h]=function(){q=arguments};k.src=b.url.replace(/\?(.+)=\?/,"?$1="+h);u.head.appendChild(k);0<b.timeout&&(r=setTimeout(function(){y("timeout")},b.timeout));return m};a.ajaxSettings={type:"GET",beforeSend:n,success:n,error:n,complete:n,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:D,xml:"application/xml, text/xml",
|
|
|
|
|
html:s,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0};a.ajax=function(b){var g=a.extend({},b||{}),h=a.Deferred&&a.Deferred();for(q in a.ajaxSettings)void 0===g[q]&&(g[q]=a.ajaxSettings[q]);c(g);g.crossDomain||(g.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(g.url)&&RegExp.$2!=window.location.host);g.url||(g.url=window.location.toString());z(g);var p=g.dataType,y=/\?.+=\?/.test(g.url);y&&(p="jsonp");if(!1===g.cache||(!b||!0!==b.cache)&&("script"==p||"jsonp"==p))g.url=k(g.url,"_="+
|
|
|
|
|
Date.now());if("jsonp"==p)return y||(g.url=k(g.url,g.jsonp?g.jsonp+"=?":!1===g.jsonp?"":"callback=?")),a.ajaxJSONP(g,h);b=g.accepts[p];var r={},y=function(a,b){r[a.toLowerCase()]=[a,b]},u=/^([\w-]+:)\/\//.test(g.url)?RegExp.$1:window.location.protocol,l=g.xhr(),w=l.setRequestHeader,s;h&&h.promise(l);g.crossDomain||y("X-Requested-With","XMLHttpRequest");y("Accept",b||"*/*");if(b=g.mimeType||b)-1<b.indexOf(",")&&(b=b.split(",",2)[0]),l.overrideMimeType&&l.overrideMimeType(b);if(g.contentType||!1!==
|
|
|
|
|
g.contentType&&g.data&&"GET"!=g.type.toUpperCase())y("Content-Type",g.contentType||"application/x-www-form-urlencoded");if(g.headers)for(B in g.headers)y(B,g.headers[B]);l.setRequestHeader=y;l.onreadystatechange=function(){if(4==l.readyState){l.onreadystatechange=n;clearTimeout(s);var b,c=!1;if(200<=l.status&&300>l.status||304==l.status||0==l.status&&"file:"==u){p=p||m(g.mimeType||l.getResponseHeader("content-type"));b=l.responseText;try{"script"==p?(0,eval)(b):"xml"==p?b=l.responseXML:"json"==p&&
|
|
|
|
|
(b=x.test(b)?null:a.parseJSON(b))}catch(d){c=d}c?f(c,"parsererror",l,g,h):e(b,l,g,h)}else f(l.statusText||null,l.status?"error":"abort",l,g,h)}};if(!1===d(l,g))return l.abort(),f(null,"abort",l,g,h),l;if(g.xhrFields)for(B in g.xhrFields)l[B]=g.xhrFields[B];l.open(g.type,g.url,"async"in g?g.async:!0,g.username,g.password);for(B in r)w.apply(l,r[B]);0<g.timeout&&(s=setTimeout(function(){l.onreadystatechange=n;l.abort();f(null,"timeout",l,g,h)},g.timeout));l.send(g.data?g.data:null);return l};a.get=
|
|
|
|
|
(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 n(){}function m(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 k(a,b){return""==b?a:(a+"&"+b).replace(/[&?]{1,2}/,"?")}function z(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=k(b.url,b.data),b.data=void 0}function l(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 w(b,c,d,e){var f,g=a.isArray(c),h=a.isPlainObject(c);a.each(c,function(c,k){f=a.type(k);e&&(c=d?e:e+"["+(h||"object"==f||"array"==f?c:"")+"]");!e&&g?b.add(k.name,k.value):"array"==f||!d&&"object"==f?w(b,k,d,c):b.add(c,k)})}var p=0,s=window.document,q,B,r=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/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"+ ++p,k=s.createElement("script"),x=window[h],q,y=function(b){a(k).triggerHandler("error",b||"abort")},m={abort:y},r;c&&c.promise(m);a(k).on("load error",function(d,g){clearTimeout(r);a(k).off().remove();"error"==d.type||!q?f(null,g||"error",m,b,c):e(q[0],m,
|
|
|
|
|
b,c);window[h]=x;q&&a.isFunction(x)&&x(q[0]);x=q=void 0});if(!1===d(m,b))return y("abort"),m;window[h]=function(){q=arguments};k.src=b.url.replace(/\?(.+)=\?/,"?$1="+h);s.head.appendChild(k);0<b.timeout&&(r=setTimeout(function(){y("timeout")},b.timeout));return m};a.ajaxSettings={type:"GET",beforeSend:n,success:n,error:n,complete:n,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:D,xml:"application/xml, text/xml",
|
|
|
|
|
html:u,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0};a.ajax=function(b){var g=a.extend({},b||{}),h=a.Deferred&&a.Deferred();for(q in a.ajaxSettings)void 0===g[q]&&(g[q]=a.ajaxSettings[q]);c(g);g.crossDomain||(g.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(g.url)&&RegExp.$2!=window.location.host);g.url||(g.url=window.location.toString());z(g);var p=g.dataType,y=/\?.+=\?/.test(g.url);y&&(p="jsonp");if(!1===g.cache||(!b||!0!==b.cache)&&("script"==p||"jsonp"==p))g.url=k(g.url,"_="+
|
|
|
|
|
Date.now());if("jsonp"==p)return y||(g.url=k(g.url,g.jsonp?g.jsonp+"=?":!1===g.jsonp?"":"callback=?")),a.ajaxJSONP(g,h);b=g.accepts[p];var s={},y=function(a,b){s[a.toLowerCase()]=[a,b]},r=/^([\w-]+:)\/\//.test(g.url)?RegExp.$1:window.location.protocol,l=g.xhr(),w=l.setRequestHeader,u;h&&h.promise(l);g.crossDomain||y("X-Requested-With","XMLHttpRequest");y("Accept",b||"*/*");if(b=g.mimeType||b)-1<b.indexOf(",")&&(b=b.split(",",2)[0]),l.overrideMimeType&&l.overrideMimeType(b);if(g.contentType||!1!==
|
|
|
|
|
g.contentType&&g.data&&"GET"!=g.type.toUpperCase())y("Content-Type",g.contentType||"application/x-www-form-urlencoded");if(g.headers)for(B in g.headers)y(B,g.headers[B]);l.setRequestHeader=y;l.onreadystatechange=function(){if(4==l.readyState){l.onreadystatechange=n;clearTimeout(u);var b,c=!1;if(200<=l.status&&300>l.status||304==l.status||0==l.status&&"file:"==r){p=p||m(g.mimeType||l.getResponseHeader("content-type"));b=l.responseText;try{"script"==p?(0,eval)(b):"xml"==p?b=l.responseXML:"json"==p&&
|
|
|
|
|
(b=x.test(b)?null:a.parseJSON(b))}catch(d){c=d}c?f(c,"parsererror",l,g,h):e(b,l,g,h)}else f(l.statusText||null,l.status?"error":"abort",l,g,h)}};if(!1===d(l,g))return l.abort(),f(null,"abort",l,g,h),l;if(g.xhrFields)for(B in g.xhrFields)l[B]=g.xhrFields[B];l.open(g.type,g.url,"async"in g?g.async:!0,g.username,g.password);for(B in s)w.apply(l,s[B]);0<g.timeout&&(u=setTimeout(function(){l.onreadystatechange=n;l.abort();f(null,"timeout",l,g,h)},g.timeout));l.send(g.data?g.data:null);return l};a.get=
|
|
|
|
|
function(){return a.ajax(l.apply(null,arguments))};a.post=function(){var b=l.apply(null,arguments);b.type="POST";return a.ajax(b)};a.getJSON=function(){var b=l.apply(null,arguments);b.dataType="json";return a.ajax(b)};a.fn.load=function(b,c,d){if(!this.length)return this;var e=this,g=b.split(/\s/),f;b=l(b,c,d);var h=b.success;1<g.length&&(b.url=g[0],f=g[1]);b.success=function(b){e.html(f?a("<div>").html(b.replace(r,"")).find(f):b);h&&h.apply(e,arguments)};a.ajax(b);return this};var y=encodeURIComponent;
|
|
|
|
|
a.param=function(a,b){var c=[];c.add=function(a,b){this.push(y(a)+"="+y(b))};w(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,m=[],k=!b.once&&[],z=function(a){c=b.memory&&a;d=!0;n=f||0;f=0;g=m.length;for(e=!0;m&&n<g;++n)if(!1===m[n].apply(a[0],a[1])&&b.stopOnFalse){c=!1;break}e=!1;m&&(k?k.length&&z(k.shift()):c?m.length=0:l.disable())},l={add:function(){if(m){var d=m.length,k=function(c){a.each(c,function(a,c){"function"===typeof c?(!b.unique||!l.has(c))&&m.push(c):c&&(c.length&&"string"!==typeof c)&&k(c)})};k(arguments);e?g=m.length:c&&(f=d,z(c))}return this},
|
|
|
|
@ -61,24 +61,24 @@ function(d,e){return void 0===e?a.isPlainObject(d)?this.each(function(b,e){a.eac
|
|
|
|
|
(function(a){function b(c){var e=[["resolve","done",a.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",a.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",a.Callbacks({memory:1})]],f="pending",g={state:function(){return f},always:function(){n.done(arguments).fail(arguments);return this},then:function(){var c=arguments;return b(function(b){a.each(e,function(d,e){var f=a.isFunction(c[d])&&c[d];n[e[1]](function(){var c=f&&f.apply(this,arguments);if(c&&a.isFunction(c.promise))c.promise().done(b.resolve).fail(b.reject).progress(b.notify);
|
|
|
|
|
else{var d=this===g?b.promise():this;b[e[0]+"With"](d,f?[c]:arguments)}})});c=null}).promise()},promise:function(b){return null!=b?a.extend(b,g):g}},n={};a.each(e,function(a,b){var c=b[2],d=b[3];g[b[1]]=c.add;d&&c.add(function(){f=d},e[a^1][2].disable,e[2][2].lock);n[b[0]]=function(){n[b[0]+"With"](this===n?g:this,arguments);return this};n[b[0]+"With"]=c.fireWith});g.promise(n);c&&c.call(n,n);return n}var c=Array.prototype.slice;a.when=function(d){var e=c.call(arguments),f=e.length,g=0,n=1!==f||d&&
|
|
|
|
|
a.isFunction(d.promise)?f:0,m=1===n?d:b(),k,z,l,w=function(a,b,d){return function(e){b[a]=this;d[a]=1<arguments.length?c.call(arguments):e;d===k?m.notifyWith(b,d):--n||m.resolveWith(b,d)}};if(1<f){k=Array(f);z=Array(f);for(l=Array(f);g<f;++g)e[g]&&a.isFunction(e[g].promise)?e[g].promise().done(w(g,l,e)).fail(m.reject).progress(w(g,z,k)):--n}n||m.resolveWith(l,e);return m.promise()};a.Deferred=b})(Zepto);
|
|
|
|
|
(function(a){function b(a){var b=this.os={},e=this.browser={},f=a.match(/Web[kK]it[\/]{0,1}([\d.]+)/),g=a.match(/(Android);?[\s\/]+([\d.]+)?/),n=!!a.match(/\(Macintosh\; Intel /),m=a.match(/(iPad).*OS\s([\d_]+)/),k=a.match(/(iPod)(.*OS\s([\d_]+))?/),z=!m&&a.match(/(iPhone\sOS)\s([\d_]+)/),l=a.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),w=a.match(/Windows Phone ([\d.]+)/),p=l&&a.match(/TouchPad/),u=a.match(/Kindle\/([\d.]+)/),q=a.match(/Silk\/([\d._]+)/),B=a.match(/(BlackBerry).*Version\/([\d.]+)/),r=a.match(/(BB10).*Version\/([\d.]+)/),
|
|
|
|
|
v=a.match(/(RIM\sTablet\sOS)\s([\d.]+)/),h=a.match(/PlayBook/),D=a.match(/Chrome\/([\d.]+)/)||a.match(/CriOS\/([\d.]+)/),s=a.match(/Firefox\/([\d.]+)/),x=a.match(/MSIE\s([\d.]+)/)||a.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),y=!D&&a.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),A=y||a.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if(e.webkit=!!f)e.version=f[1];g&&(b.android=!0,b.version=g[2]);z&&!k&&(b.ios=b.iphone=!0,b.version=z[2].replace(/_/g,"."));m&&(b.ios=b.ipad=
|
|
|
|
|
!0,b.version=m[2].replace(/_/g,"."));k&&(b.ios=b.ipod=!0,b.version=k[3]?k[3].replace(/_/g,"."):null);w&&(b.wp=!0,b.version=w[1]);l&&(b.webos=!0,b.version=l[2]);p&&(b.touchpad=!0);B&&(b.blackberry=!0,b.version=B[2]);r&&(b.bb10=!0,b.version=r[2]);v&&(b.rimtabletos=!0,b.version=v[2]);h&&(e.playbook=!0);u&&(b.kindle=!0,b.version=u[1]);q&&(e.silk=!0,e.version=q[1]);!q&&(b.android&&a.match(/Kindle Fire/))&&(e.silk=!0);D&&(e.chrome=!0,e.version=D[1]);s&&(e.firefox=!0,e.version=s[1]);x&&(e.ie=!0,e.version=
|
|
|
|
|
x[1]);if(A&&(n||b.ios))e.safari=!0,n&&(e.version=A[1]);y&&(e.webview=!0);b.tablet=!(!m&&!h&&!(g&&!a.match(/Mobile/)||s&&a.match(/Tablet/)||x&&!a.match(/Phone/)&&a.match(/Touch/)));b.phone=!(b.tablet||b.ipod||!g&&!z&&!l&&!B&&!r&&!(D&&a.match(/Android/)||D&&a.match(/CriOS\/([\d.]+)/)||s&&a.match(/Mobile/)||x&&a.match(/Touch/)))}b.call(a,navigator.userAgent);a.__detect=b})(Zepto);
|
|
|
|
|
(function(a){function b(a){return a._zid||(a._zid=m++)}function c(a,c,e,f){c=d(c);if(c.ns)var g=RegExp("(?:^| )"+c.ns.replace(" "," .* ?")+"(?: |$)");return(p[b(a)]||[]).filter(function(a){return a&&(!c.e||a.e==c.e)&&(!c.ns||g.test(a.ns))&&(!e||b(a.fn)===b(e))&&(!f||a.sel==f)})}function d(a){a=(""+a).split(".");return{e:a[0],ns:a.slice(1).sort().join(" ")}}function e(c,e,f,h,m,l,n){var u=b(c),s=p[u]||(p[u]=[]);e.split(/\s/).forEach(function(b){if("ready"==b)return a(document).ready(f);var e=d(b);
|
|
|
|
|
e.fn=f;e.sel=m;e.e in r&&(f=function(b){var c=b.relatedTarget;if(!c||c!==this&&!a.contains(this,c))return e.fn.apply(this,arguments)});var y=(e.del=l)||f;e.proxy=function(a){a=g(a);if(!a.isImmediatePropagationStopped()){a.data=h;var b=y.apply(c,a._args==k?[a]:[a].concat(a._args));!1===b&&(a.preventDefault(),a.stopPropagation());return b}};e.i=s.length;s.push(e);"addEventListener"in c&&c.addEventListener(r[e.e]||q&&B[e.e]||e.e,e.proxy,e.del&&!q&&e.e in B||!!n)})}function f(a,d,e,f,g){var h=b(a);(d||
|
|
|
|
|
"").split(/\s/).forEach(function(b){c(a,b,e,f).forEach(function(b){delete p[h][b.i];"removeEventListener"in a&&a.removeEventListener(r[b.e]||q&&B[b.e]||b.e,b.proxy,b.del&&!q&&b.e in B||!!g)})})}function g(b,c){if(c||!b.isDefaultPrevented)if(c||(c=b),a.each(s,function(a,d){var e=c[a];b[a]=function(){this[d]=v;return e&&e.apply(c,arguments)};b[d]=h}),c.defaultPrevented!==k?c.defaultPrevented:"returnValue"in c?!1===c.returnValue:c.getPreventDefault&&c.getPreventDefault())b.isDefaultPrevented=v;return b}
|
|
|
|
|
function n(a){var b,c={originalEvent:a};for(b in a)!D.test(b)&&a[b]!==k&&(c[b]=a[b]);return g(c,a)}var m=1,k,z=Array.prototype.slice,l=a.isFunction,w=function(a){return"string"==typeof a},p={},u={},q="onfocusin"in window,B={focus:"focusin",blur:"focusout"},r={mouseenter:"mouseover",mouseleave:"mouseout"};u.click=u.mousedown=u.mouseup=u.mousemove="MouseEvents";a.event={add:e,remove:f};a.proxy=function(c,d){var e=2 in arguments&&z.call(arguments,2);if(l(c)){var f=function(){return c.apply(d,e?e.concat(z.call(arguments)):
|
|
|
|
|
arguments)};f._zid=b(c);return f}if(w(d))return e?(e.unshift(c[d],c),a.proxy.apply(null,e)):a.proxy(c[d],c);throw new TypeError("expected function");};a.fn.bind=function(a,b,c){return this.on(a,b,c)};a.fn.unbind=function(a,b){return this.off(a,b)};a.fn.one=function(a,b,c,d){return this.on(a,b,c,d,1)};var v=function(){return!0},h=function(){return!1},D=/^([A-Z]|returnValue$|layer[XY]$)/,s={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};
|
|
|
|
|
a.fn.delegate=function(a,b,c){return this.on(b,a,c)};a.fn.undelegate=function(a,b,c){return this.off(b,a,c)};a.fn.live=function(b,c){a(document.body).delegate(this.selector,b,c);return this};a.fn.die=function(b,c){a(document.body).undelegate(this.selector,b,c);return this};a.fn.on=function(b,c,d,g,m){var q,p,r=this;if(b&&!w(b))return a.each(b,function(a,b){r.on(a,c,d,b,m)}),r;!w(c)&&(!l(g)&&!1!==g)&&(g=d,d=c,c=k);if(l(d)||!1===d)g=d,d=k;!1===g&&(g=h);return r.each(function(h,k){m&&(q=function(a){f(k,
|
|
|
|
|
a.type,g);return g.apply(this,arguments)});c&&(p=function(b){var d,e=a(b.target).closest(c,k).get(0);if(e&&e!==k)return d=a.extend(n(b),{currentTarget:e,liveFired:k}),(q||g).apply(e,[d].concat(z.call(arguments,1)))});e(k,b,g,d,c,p||q)})};a.fn.off=function(b,c,d){var e=this;if(b&&!w(b))return a.each(b,function(a,b){e.off(a,c,b)}),e;!w(c)&&(!l(d)&&!1!==d)&&(d=c,c=k);!1===d&&(d=h);return e.each(function(){f(this,b,d,c)})};a.fn.trigger=function(b,c){b=w(b)||a.isPlainObject(b)?a.Event(b):g(b);b._args=
|
|
|
|
|
(function(a){function b(a){var b=this.os={},e=this.browser={},f=a.match(/Web[kK]it[\/]{0,1}([\d.]+)/),g=a.match(/(Android);?[\s\/]+([\d.]+)?/),n=!!a.match(/\(Macintosh\; Intel /),m=a.match(/(iPad).*OS\s([\d_]+)/),k=a.match(/(iPod)(.*OS\s([\d_]+))?/),z=!m&&a.match(/(iPhone\sOS)\s([\d_]+)/),l=a.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),w=a.match(/Windows Phone ([\d.]+)/),p=l&&a.match(/TouchPad/),s=a.match(/Kindle\/([\d.]+)/),q=a.match(/Silk\/([\d._]+)/),B=a.match(/(BlackBerry).*Version\/([\d.]+)/),r=a.match(/(BB10).*Version\/([\d.]+)/),
|
|
|
|
|
v=a.match(/(RIM\sTablet\sOS)\s([\d.]+)/),h=a.match(/PlayBook/),D=a.match(/Chrome\/([\d.]+)/)||a.match(/CriOS\/([\d.]+)/),u=a.match(/Firefox\/([\d.]+)/),x=a.match(/MSIE\s([\d.]+)/)||a.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),y=!D&&a.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),A=y||a.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if(e.webkit=!!f)e.version=f[1];g&&(b.android=!0,b.version=g[2]);z&&!k&&(b.ios=b.iphone=!0,b.version=z[2].replace(/_/g,"."));m&&(b.ios=b.ipad=
|
|
|
|
|
!0,b.version=m[2].replace(/_/g,"."));k&&(b.ios=b.ipod=!0,b.version=k[3]?k[3].replace(/_/g,"."):null);w&&(b.wp=!0,b.version=w[1]);l&&(b.webos=!0,b.version=l[2]);p&&(b.touchpad=!0);B&&(b.blackberry=!0,b.version=B[2]);r&&(b.bb10=!0,b.version=r[2]);v&&(b.rimtabletos=!0,b.version=v[2]);h&&(e.playbook=!0);s&&(b.kindle=!0,b.version=s[1]);q&&(e.silk=!0,e.version=q[1]);!q&&(b.android&&a.match(/Kindle Fire/))&&(e.silk=!0);D&&(e.chrome=!0,e.version=D[1]);u&&(e.firefox=!0,e.version=u[1]);x&&(e.ie=!0,e.version=
|
|
|
|
|
x[1]);if(A&&(n||b.ios))e.safari=!0,n&&(e.version=A[1]);y&&(e.webview=!0);b.tablet=!(!m&&!h&&!(g&&!a.match(/Mobile/)||u&&a.match(/Tablet/)||x&&!a.match(/Phone/)&&a.match(/Touch/)));b.phone=!(b.tablet||b.ipod||!g&&!z&&!l&&!B&&!r&&!(D&&a.match(/Android/)||D&&a.match(/CriOS\/([\d.]+)/)||u&&a.match(/Mobile/)||x&&a.match(/Touch/)))}b.call(a,navigator.userAgent);a.__detect=b})(Zepto);
|
|
|
|
|
(function(a){function b(a){return a._zid||(a._zid=m++)}function c(a,c,e,f){c=d(c);if(c.ns)var g=RegExp("(?:^| )"+c.ns.replace(" "," .* ?")+"(?: |$)");return(p[b(a)]||[]).filter(function(a){return a&&(!c.e||a.e==c.e)&&(!c.ns||g.test(a.ns))&&(!e||b(a.fn)===b(e))&&(!f||a.sel==f)})}function d(a){a=(""+a).split(".");return{e:a[0],ns:a.slice(1).sort().join(" ")}}function e(c,e,f,h,m,l,n){var s=b(c),u=p[s]||(p[s]=[]);e.split(/\s/).forEach(function(b){if("ready"==b)return a(document).ready(f);var e=d(b);
|
|
|
|
|
e.fn=f;e.sel=m;e.e in r&&(f=function(b){var c=b.relatedTarget;if(!c||c!==this&&!a.contains(this,c))return e.fn.apply(this,arguments)});var p=(e.del=l)||f;e.proxy=function(a){a=g(a);if(!a.isImmediatePropagationStopped()){a.data=h;var b=p.apply(c,a._args==k?[a]:[a].concat(a._args));!1===b&&(a.preventDefault(),a.stopPropagation());return b}};e.i=u.length;u.push(e);"addEventListener"in c&&c.addEventListener(r[e.e]||q&&B[e.e]||e.e,e.proxy,e.del&&!q&&e.e in B||!!n)})}function f(a,d,e,f,g){var h=b(a);(d||
|
|
|
|
|
"").split(/\s/).forEach(function(b){c(a,b,e,f).forEach(function(b){delete p[h][b.i];"removeEventListener"in a&&a.removeEventListener(r[b.e]||q&&B[b.e]||b.e,b.proxy,b.del&&!q&&b.e in B||!!g)})})}function g(b,c){if(c||!b.isDefaultPrevented)if(c||(c=b),a.each(u,function(a,d){var e=c[a];b[a]=function(){this[d]=v;return e&&e.apply(c,arguments)};b[d]=h}),c.defaultPrevented!==k?c.defaultPrevented:"returnValue"in c?!1===c.returnValue:c.getPreventDefault&&c.getPreventDefault())b.isDefaultPrevented=v;return b}
|
|
|
|
|
function n(a){var b,c={originalEvent:a};for(b in a)!D.test(b)&&a[b]!==k&&(c[b]=a[b]);return g(c,a)}var m=1,k,z=Array.prototype.slice,l=a.isFunction,w=function(a){return"string"==typeof a},p={},s={},q="onfocusin"in window,B={focus:"focusin",blur:"focusout"},r={mouseenter:"mouseover",mouseleave:"mouseout"};s.click=s.mousedown=s.mouseup=s.mousemove="MouseEvents";a.event={add:e,remove:f};a.proxy=function(c,d){var e=2 in arguments&&z.call(arguments,2);if(l(c)){var f=function(){return c.apply(d,e?e.concat(z.call(arguments)):
|
|
|
|
|
arguments)};f._zid=b(c);return f}if(w(d))return e?(e.unshift(c[d],c),a.proxy.apply(null,e)):a.proxy(c[d],c);throw new TypeError("expected function");};a.fn.bind=function(a,b,c){return this.on(a,b,c)};a.fn.unbind=function(a,b){return this.off(a,b)};a.fn.one=function(a,b,c,d){return this.on(a,b,c,d,1)};var v=function(){return!0},h=function(){return!1},D=/^([A-Z]|returnValue$|layer[XY]$)/,u={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};
|
|
|
|
|
a.fn.delegate=function(a,b,c){return this.on(b,a,c)};a.fn.undelegate=function(a,b,c){return this.off(b,a,c)};a.fn.live=function(b,c){a(document.body).delegate(this.selector,b,c);return this};a.fn.die=function(b,c){a(document.body).undelegate(this.selector,b,c);return this};a.fn.on=function(b,c,d,g,p){var m,q,r=this;if(b&&!w(b))return a.each(b,function(a,b){r.on(a,c,d,b,p)}),r;!w(c)&&(!l(g)&&!1!==g)&&(g=d,d=c,c=k);if(l(d)||!1===d)g=d,d=k;!1===g&&(g=h);return r.each(function(h,k){p&&(m=function(a){f(k,
|
|
|
|
|
a.type,g);return g.apply(this,arguments)});c&&(q=function(b){var d,e=a(b.target).closest(c,k).get(0);if(e&&e!==k)return d=a.extend(n(b),{currentTarget:e,liveFired:k}),(m||g).apply(e,[d].concat(z.call(arguments,1)))});e(k,b,g,d,c,q||m)})};a.fn.off=function(b,c,d){var e=this;if(b&&!w(b))return a.each(b,function(a,b){e.off(a,c,b)}),e;!w(c)&&(!l(d)&&!1!==d)&&(d=c,c=k);!1===d&&(d=h);return e.each(function(){f(this,b,d,c)})};a.fn.trigger=function(b,c){b=w(b)||a.isPlainObject(b)?a.Event(b):g(b);b._args=
|
|
|
|
|
c;return this.each(function(){"dispatchEvent"in this?this.dispatchEvent(b):a(this).triggerHandler(b,c)})};a.fn.triggerHandler=function(b,d){var e,g;this.each(function(f,h){e=n(w(b)?a.Event(b):b);e._args=d;e.target=h;a.each(c(h,b.type||b),function(a,b){g=b.proxy(e);if(e.isImmediatePropagationStopped())return!1})});return g};"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(b){a.fn[b]=
|
|
|
|
|
function(a){return a?this.bind(b,a):this.trigger(b)}});["focus","blur"].forEach(function(b){a.fn[b]=function(a){a?this.bind(b,a):this.each(function(){try{this[b]()}catch(a){}});return this}});a.Event=function(a,b){w(a)||(b=a,a=b.type);var c=document.createEvent(u[a]||"Events"),d=!0;if(b)for(var e in b)"bubbles"==e?d=!!b[e]:c[e]=b[e];c.initEvent(a,d,!0);return g(c)}})(Zepto);
|
|
|
|
|
function(a){return a?this.bind(b,a):this.trigger(b)}});["focus","blur"].forEach(function(b){a.fn[b]=function(a){a?this.bind(b,a):this.each(function(){try{this[b]()}catch(a){}});return this}});a.Event=function(a,b){w(a)||(b=a,a=b.type);var c=document.createEvent(s[a]||"Events"),d=!0;if(b)for(var e in b)"bubbles"==e?d=!!b[e]:c[e]=b[e];c.initEvent(a,d,!0);return g(c)}})(Zepto);
|
|
|
|
|
(function(a){a.fn.serializeArray=function(){var b,c,d=[];a([].slice.call(this.get(0).elements)).each(function(){b=a(this);c=b.attr("type");"fieldset"!=this.nodeName.toLowerCase()&&(!this.disabled&&"submit"!=c&&"reset"!=c&&"button"!=c&&("radio"!=c&&"checkbox"!=c||this.checked))&&d.push({name:b.attr("name"),value:b.val()})});return d};a.fn.serialize=function(){var a=[];this.serializeArray().forEach(function(c){a.push(encodeURIComponent(c.name)+"="+encodeURIComponent(c.value))});return a.join("&")};
|
|
|
|
|
a.fn.submit=function(b){b?this.bind("submit",b):this.length&&(b=a.Event("submit"),this.eq(0).trigger(b),b.isDefaultPrevented()||this.get(0).submit());return this}})(Zepto);
|
|
|
|
|
(function(a,b){var c="",d,e=window.document.createElement("div"),f=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,g,n,m,k,z,l,w,p,u,q={};a.each({Webkit:"webkit",Moz:"",O:"o"},function(a,g){if(e.style[a+"TransitionProperty"]!==b)return c="-"+a.toLowerCase()+"-",d=g,!1});g=c+"transform";q[n=c+"transition-property"]=q[m=c+"transition-duration"]=q[z=c+"transition-delay"]=q[k=c+"transition-timing-function"]=q[l=c+"animation-name"]=q[w=c+"animation-duration"]=q[u=c+"animation-delay"]=
|
|
|
|
|
(function(a,b){var c="",d,e=window.document.createElement("div"),f=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,g,n,m,k,z,l,w,p,s,q={};a.each({Webkit:"webkit",Moz:"",O:"o"},function(a,g){if(e.style[a+"TransitionProperty"]!==b)return c="-"+a.toLowerCase()+"-",d=g,!1});g=c+"transform";q[n=c+"transition-property"]=q[m=c+"transition-duration"]=q[z=c+"transition-delay"]=q[k=c+"transition-timing-function"]=q[l=c+"animation-name"]=q[w=c+"animation-duration"]=q[s=c+"animation-delay"]=
|
|
|
|
|
q[p=c+"animation-timing-function"]="";a.fx={off:d===b&&e.style.transitionProperty===b,speeds:{_default:400,fast:200,slow:600},cssPrefix:c,transitionEnd:d?d+"TransitionEnd":"transitionend",animationEnd:d?d+"AnimationEnd":"animationend"};a.fn.animate=function(c,d,e,g,f){a.isFunction(d)&&(g=d,d=e=b);a.isFunction(e)&&(g=e,e=b);a.isPlainObject(d)&&(e=d.easing,g=d.complete,f=d.delay,d=d.duration);d&&(d=("number"==typeof d?d:a.fx.speeds[d]||a.fx.speeds._default)/1E3);f&&(f=parseFloat(f)/1E3);return this.anim(c,
|
|
|
|
|
d,e,g,f)};a.fn.anim=function(c,d,e,h,D){var s,x={},y,A="",F=this,E,G=a.fx.transitionEnd,I=!1;d===b&&(d=a.fx.speeds._default/1E3);D===b&&(D=0);a.fx.off&&(d=0);if("string"==typeof c)x[l]=c,x[w]=d+"s",x[u]=D+"s",x[p]=e||"linear",G=a.fx.animationEnd;else{y=[];for(s in c)f.test(s)?A+=s+"("+c[s]+") ":(x[s]=c[s],y.push(s.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase()));A&&(x[g]=A,y.push(g));0<d&&"object"===typeof c&&(x[n]=y.join(", "),x[m]=d+"s",x[z]=D+"s",x[k]=e||"linear")}E=function(b){if("undefined"!==
|
|
|
|
|
d,e,g,f)};a.fn.anim=function(c,d,e,h,D){var u,x={},y,A="",F=this,E,G=a.fx.transitionEnd,I=!1;d===b&&(d=a.fx.speeds._default/1E3);D===b&&(D=0);a.fx.off&&(d=0);if("string"==typeof c)x[l]=c,x[w]=d+"s",x[s]=D+"s",x[p]=e||"linear",G=a.fx.animationEnd;else{y=[];for(u in c)f.test(u)?A+=u+"("+c[u]+") ":(x[u]=c[u],y.push(u.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase()));A&&(x[g]=A,y.push(g));0<d&&"object"===typeof c&&(x[n]=y.join(", "),x[m]=d+"s",x[z]=D+"s",x[k]=e||"linear")}E=function(b){if("undefined"!==
|
|
|
|
|
typeof b){if(b.target!==b.currentTarget)return;a(b.target).unbind(G,E)}else a(this).unbind(G,E);I=!0;a(this).css(q);h&&h.call(this)};0<d&&(this.bind(G,E),setTimeout(function(){I||E.call(F)},1E3*d+25));this.size()&&this.get(0).clientLeft;this.css(x);0>=d&&setTimeout(function(){F.each(function(){E.call(this)})},0);return this};e=null})(Zepto);
|
|
|
|
|
(function(a,b){function c(c,d,e,g,f){"function"==typeof d&&!f&&(f=d,d=b);e={opacity:e};g&&(e.scale=g,c.css(a.fx.cssPrefix+"transform-origin","0 0"));return c.animate(e,d,null,f)}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<c?this.css("opacity",0):c=1;return e.call(this).fadeTo(a,c,b)};a.fn.fadeOut=function(a,b){return d(this,a,null,b)};a.fn.fadeToggle=function(b,c){return this.each(function(){var d=a(this);d[0==d.css("opacity")||"none"==d.css("display")?"fadeIn":"fadeOut"](b,c)})}})(Zepto);
|
|
|
|
@ -87,27 +87,27 @@ a)}})}})(Zepto);(function(a){"__proto__"in{}||a.extend(a.zepto,{Z:function(b,c){
|
|
|
|
|
(function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});Array.prototype.reduce===a&&(Array.prototype.reduce=function(b){if(void 0===this||null===this)throw new TypeError;var c=Object(this),d=c.length>>>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<d;)e in c&&(f=b.call(a,
|
|
|
|
|
f,c[e],e,c)),e++;return f})})();
|
|
|
|
|
(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=n.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<a(this).text().indexOf(d))return this},has:function(a,b,c){if(d.qsa(this,c).length)return this}},n=/(.*):(\w+)(?:\(([^)]+)\))?$\s*/,m=/^\s*>/,k="Zepto"+ +new Date;d.qsa=function(b,g){return c(g,function(c,f,u){try{var q;!c&&f?c="*":m.test(c)&&(q=a(b).addClass(k),c="."+k+" "+c);var n=e(b,c)}catch(r){throw console.error("error performing selector: %o",
|
|
|
|
|
g),r;}finally{q&&q.removeClass(k)}return!f?n:d.uniq(a.map(n,function(a,b){return f.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);
|
|
|
|
|
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<a(this).text().indexOf(d))return this},has:function(a,b,c){if(d.qsa(this,c).length)return this}},n=/(.*):(\w+)(?:\(([^)]+)\))?$\s*/,m=/^\s*>/,k="Zepto"+ +new Date;d.qsa=function(b,g){return c(g,function(c,f,s){try{var q;!c&&f?c="*":m.test(c)&&(q=a(b).addClass(k),c="."+k+" "+c);var n=e(b,c)}catch(r){throw console.error("error performing selector: %o",
|
|
|
|
|
g),r;}finally{q&&q.removeClass(k)}return!f?n:d.uniq(a.map(n,function(a,b){return f.call(a,b,n,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(){k=null;f.last&&(f.el.trigger("longTap"),f={})}function c(){g&&clearTimeout(g);n&&clearTimeout(n);m&&clearTimeout(m);k&&clearTimeout(k);g=n=m=k=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,m,k,z;a(document).ready(function(){var l,w,p=0,u=0,q,B;"MSGesture"in window&&(z=new MSGesture,z.target=document.body);a(document).bind("MSGestureEnd",
|
|
|
|
|
function(a){if(a=1<a.velocityX?"Right":-1>a.velocityX?"Left":1<a.velocityY?"Down":-1>a.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),l=Date.now(),w=l-(f.last||l),f.el=a("tagName"in q.target?q.target:q.target.parentNode),g&&clearTimeout(g),f.x1=q.pageX,f.y1=q.pageY,0<w&&250>=w&&(f.isDoubleTap=!0),f.last=l,k=setTimeout(b,
|
|
|
|
|
750),z&&B&&z.addPointer(c.pointerId)}).on("touchmove MSPointerMove pointermove",function(a){if(!(B=e(a,"move"))||d(a))q=B?a:a.touches[0],k&&clearTimeout(k),k=null,f.x2=q.pageX,f.y2=q.pageY,p+=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))k&&clearTimeout(k),k=null,f.x2&&30<Math.abs(f.x1-f.x2)||f.y2&&30<Math.abs(f.y1-f.y2)?m=setTimeout(function(){f.el.trigger("swipe");f.el.trigger("swipe"+(Math.abs(f.x1-f.x2)>=Math.abs(f.y1-f.y2)?
|
|
|
|
|
0<f.x1-f.x2?"Left":"Right":0<f.y1-f.y2?"Up":"Down"));f={}},0):"last"in f&&(30>p&&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={}),p=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});
|
|
|
|
|
(function(a){function b(){k=null;f.last&&(f.el.trigger("longTap"),f={})}function c(){g&&clearTimeout(g);n&&clearTimeout(n);m&&clearTimeout(m);k&&clearTimeout(k);g=n=m=k=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,m,k,z;(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;d<b.length-1;d+=2)c+=b.charCodeAt(d)^b.charCodeAt(d+1),48360<c&&(c-=36048);1===b.length%2&&(c+=b.charCodeAt(b.length-1));48360<c&&(c-=36048);c=(c^5299)+"";b=a()+"";return b.substr(0,b.length-c.length)+c}}(Math.random)})();a(document).ready(function(){var l,w,p=0,s=0,q,B;"MSGesture"in window&&(z=new MSGesture,z.target=document.body);a(document).bind("MSGestureEnd",function(a){if(a=1<a.velocityX?"Right":-1>a.velocityX?"Left":1<a.velocityY?"Down":-1>a.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),l=Date.now(),w=l-(f.last||l),f.el=a("tagName"in q.target?q.target:q.target.parentNode),g&&clearTimeout(g),f.x1=q.pageX,f.y1=q.pageY,0<w&&250>=w&&(f.isDoubleTap=!0),f.last=l,k=setTimeout(b,750),z&&B&&z.addPointer(c.pointerId)}).on("touchmove MSPointerMove pointermove",function(a){if(!(B=e(a,"move"))||d(a))q=B?
|
|
|
|
|
a:a.touches[0],k&&clearTimeout(k),k=null,f.x2=q.pageX,f.y2=q.pageY,p+=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))k&&clearTimeout(k),k=null,f.x2&&30<Math.abs(f.x1-f.x2)||f.y2&&30<Math.abs(f.y1-f.y2)?m=setTimeout(function(){f.el.trigger("swipe");f.el.trigger("swipe"+(Math.abs(f.x1-f.x2)>=Math.abs(f.y1-f.y2)?0<f.x1-f.x2?"Left":"Right":0<f.y1-f.y2?"Up":"Down"));f={}},0):"last"in f&&(30>p&&30>s?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={}),p=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(){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]").live("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)}}})},user:"",isLogin:!1,checkNum:0,checkLogin:function(a,
|
|
|
|
|
b,c){Public.checkNum++;cn12306.isUserLogined(function(){Public.isLogin=!0;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;$("body").addClass("nologin");$("#login_tip").show();"function"==typeof b&&b()},function(){Public.isLogin=
|
|
|
|
|
!1;$("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;a<b;a++)Public.his.queryObjs[Public.his.querys[a][0]]=Public.getQueryData(Public.his.querys[a][1])},toast:function(a,b){if(!a)return!1;var c=$('<div class="public_toast">'+a+"</div>");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+='<a href="javascript:;" data-val="'+f+'">'+b[f]+"</a>";d.className="public_layer";c+='<div class="public_pop"><p>'+a+"</p>"+(""==e?'<div class="public_btns"><a href="javascript:;" data-type="sure">\u786e\u5b9a</a></div>':'<div class="public_btns">'+e+"</div>")+"</div>";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=$('<div class="loadingBox"><div class="loading"><i class="icon_loading"></i><span>'+(a?" "+a:"")+"</span></div></div>");$("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"==typeof b&&"sure"==a&&b()})},getQueryData:function(a){a=a.replace(/^\?+/,"").replace(/&/,"&");a=a.split("&");for(var b=a.length,c={};b--;)if(item=a[b].split("="),item[0]){var d=item[1]||"";try{d=decodeURIComponent(d)}catch(e){d=unescape(d)}c[decodeURIComponent(item[0])]=
|
|
|
|
|
d}return c},objToQueryString:function(a){var b=[],c,d,e;for(c in a)if(d=a[c],d instanceof Array)for(e=d.length;e--;)b.push(c+"[]="+encodeURIComponent(d[e]));else b.push(c+(""===d?"":"="+encodeURIComponent(d)));return b.join("&")},hasArrObjKey:function(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)if(a[e][b]==c){d=e;break}return d},getHisQuery:function(){var a=localStorage.getItem(Public.user+"hisQuery");return!a?[]:JSON.parse(a)},setHisQuery:function(a,b){var c=Public.getHisQuery(),d=Public.hasArrObjKey(c,
|
|
|
|
|
0,a);-1!=d&&c.splice(d,1);c.unshift([a,b]);6<c.length&&6==c.length;localStorage.setItem(Public.user+"hisQuery",JSON.stringify(c))},showInnerPage:function(a){$(".fixed_box").removeClass("fixed_box_show");$("#"+a).addClass("fixed_box_show");$("#wrap").hide()},hideInnerPage:function(){$(".fixed_box").removeClass("fixed_box_show");$("#wrap").show()},formatString:"yyyy\u5e74M\u6708d\u65e5",setDate:function(a){if(0==$("#calendar").length)return!1;a=a||(new Date).date;$("#start_date").html(a.format(Public.formatString)+
|
|
|
|
|
" "+a.day(3));$("#start_date_val").val(a.format("yyyy-MM-dd"));Public.calendar||(Public.calendar=new DateComponent({wrap:$("#calendar"),curDate:a,checkCallback:Public.dateChangeCallback}));$("#check_left,#check_right").on("click",function(){var a;if(a="check_left"==$(this).attr("id")?Public.calendar.dayPrev():Public.calendar.dayNext())$("#start_date").html(a.format(Public.formatString)+" "+a.day(3)),$("#start_date_val").val(a.format("yyyy-MM-dd"))});$("#start_date").on("click",function(){Public.showInnerPage("date_box")});
|
|
|
|
|
$("[name=type]").on("change",function(){var a=$("[name=type]:checked").val();1==a?(Public.calendar.maxDate=Public.calendar._TODAY.addDays(19),Public.calendar.curDate.date.getTime()>Public.calendar.maxDate.date.getTime()&&(Public.calendar.curDate=Public.calendar.maxDate,Public.calendar.checkCallback(Public.calendar.curDate)),Public.calendar.setBasic()):2==a&&(Public.calendar.maxDate=Public.calendar._TODAY.addDays(29),Public.calendar.setBasic())})},dateChangeCallback:function(a){var b=a.date.getTime();
|
|
|
|
|
b>=Public.calendar.minDate.date.getTime()&&b<=Public.calendar.maxDate.date.getTime()?($("#date_tip").hide(),Public.hideInnerPage("date_box"),$("#start_date").html(Public.calendar.curDate.format(Public.formatString)+" "+Public.calendar.curDate.day(3)),$("#start_date_val").val(Public.calendar.curDate.format("yyyy-MM-dd"))):(b=$("a.cur",Public.calendar.wrap).offset(),$("#date_tip").css({left:b.left,top:b.top,display:"block"}).html("<p>"+a.format("M\u6708d\u65e5")+'\u4e0d\u5728\u9884\u552e\u671f</p><a href="remind.html?data='+
|
|
|
|
|
encodeURIComponent(a.format("M\u6708d\u65e5"))+'" class="btn btn_m btn_success">\u9884\u7ea6\u63d0\u9192</a>'),0.75<b.left/window.innerWidth?$("#date_tip").attr("class","tip_small tip_right"):0.15>b.left/window.innerWidth?$("#date_tip").attr("class","tip_small tip_left"):$("#date_tip").attr("class","tip_small"))}};var Util={isImageFile:function(a){a=a.substring(a.lastIndexOf("."),a.length).toLowerCase();return".bmp"==a||".png"==a||".jpg"==a||".gif"==a},isEmpty:function(a,b,c){if(!a[b]){with($("#"+b).addError())0<length&&get(0).focus();c&&$.showTip(c);return!0}return!1},checkNumber:function(a,b,c){a=parseFloat(a);return!isNaN(a)&&(null==b||a>=b)&&(null==c||a<=c)},convertNumberToString:function(a,b){a=""+a;for(var c=[],d=0;d<b-a.length;d++)c.push("0");return c.join("")+a},convertDecimalToString:function(a,b){b=
|
|
|
|
|
$(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)}}});window.onbeforeunload=function(){Client.refreshEnd()};
|
|
|
|
|
window.onunload=function(){Client.refreshEnd()}},user:"",isLogin:!1,checkNum:0,checkLogin:function(a,b,c){Public.checkNum++;cn12306.isUserLogined(function(){Public.isLogin=!0;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;$("body").addClass("nologin");$("#login_tip").show();"function"==typeof b&&b()},function(){Public.isLogin=!1;$("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;a<b;a++)Public.his.queryObjs[Public.his.querys[a][0]]=Public.getQueryData(Public.his.querys[a][1])},toast:function(a,b){if(!a)return!1;var c=$('<div class="public_toast">'+
|
|
|
|
|
a+"</div>");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+='<a href="javascript:;" data-val="'+f+'">'+b[f]+"</a>";d.className="public_layer";c+='<div class="public_pop"><p>'+a+"</p>"+(""==e?'<div class="public_btns"><a href="javascript:;" data-type="sure">\u786e\u5b9a</a></div>':
|
|
|
|
|
'<div class="public_btns">'+e+"</div>")+"</div>";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=$('<div class="loadingBox"><div class="loading"><i class="icon_loading"></i><span>'+
|
|
|
|
|
(a?" "+a:"")+"</span></div></div>");$("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"==typeof b&&"sure"==a&&b()})},getQueryData:function(a){a=a.replace(/^\?+/,"").replace(/&/,"&");a=a.split("&");for(var b=a.length,c={};b--;)if(item=a[b].split("="),item[0]){var d=
|
|
|
|
|
item[1]||"";try{d=decodeURIComponent(d)}catch(e){d=unescape(d)}c[decodeURIComponent(item[0])]=d}return c},objToQueryString:function(a){var b=[],c,d,e;for(c in a)if(d=a[c],d instanceof Array)for(e=d.length;e--;)b.push(c+"[]="+encodeURIComponent(d[e]));else b.push(c+(""===d?"":"="+encodeURIComponent(d)));return b.join("&")},hasArrObjKey:function(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)if(a[e][b]==c){d=e;break}return d},getHisQuery:function(){var a=localStorage.getItem(Public.user+"hisQuery");return!a?
|
|
|
|
|
[]:JSON.parse(a)},setHisQuery:function(a,b){var c=Public.getHisQuery(),d=Public.hasArrObjKey(c,0,a);-1!=d&&c.splice(d,1);c.unshift([a,b]);6<c.length&&6==c.length;localStorage.setItem(Public.user+"hisQuery",JSON.stringify(c))},showInnerPage:function(a){$(".fixed_box").removeClass("fixed_box_show");$("#"+a).addClass("fixed_box_show");$("#wrap").hide()},hideInnerPage:function(){$(".fixed_box").removeClass("fixed_box_show");$("#wrap").show()},formatString:"yyyy\u5e74M\u6708d\u65e5",setDate:function(a){if(0==
|
|
|
|
|
$("#calendar").length)return!1;a=a||(new Date).date;$("#start_date").html(a.format(Public.formatString)+" "+a.day(3));$("#start_date_val").val(a.format("yyyy-MM-dd"));Public.calendar||(Public.calendar=new DateComponent({wrap:$("#calendar"),curDate:a,checkCallback:Public.dateChangeCallback}));$("#check_left,#check_right").on("click",function(){var a;if(a="check_left"==$(this).attr("id")?Public.calendar.dayPrev():Public.calendar.dayNext())$("#start_date").html(a.format(Public.formatString)+" "+a.day(3)),
|
|
|
|
|
$("#start_date_val").val(a.format("yyyy-MM-dd"))});$("#start_date").on("click",function(){Public.showInnerPage("date_box")});$("[name=type]").on("change",function(){var a=$("[name=type]:checked").val();1==a?(Public.calendar.maxDate=Public.calendar._TODAY.addDays(19),Public.calendar.curDate.date.getTime()>Public.calendar.maxDate.date.getTime()&&(Public.calendar.curDate=Public.calendar.maxDate,Public.calendar.checkCallback(Public.calendar.curDate)),Public.calendar.setBasic()):2==a&&(Public.calendar.maxDate=
|
|
|
|
|
Public.calendar._TODAY.addDays(29),Public.calendar.setBasic())})},dateChangeCallback:function(a){var b=a.date.getTime();b>=Public.calendar.minDate.date.getTime()&&b<=Public.calendar.maxDate.date.getTime()?($("#date_tip").hide(),Public.hideInnerPage("date_box"),$("#start_date").html(Public.calendar.curDate.format(Public.formatString)+" "+Public.calendar.curDate.day(3)),$("#start_date_val").val(Public.calendar.curDate.format("yyyy-MM-dd"))):(b=$("a.cur",Public.calendar.wrap).offset(),$("#date_tip").css({left:b.left,
|
|
|
|
|
top:b.top,display:"block"}).html("<p>"+a.format("M\u6708d\u65e5")+'\u4e0d\u5728\u9884\u552e\u671f</p><a href="remind.html?data='+encodeURIComponent(a.format("M\u6708d\u65e5"))+'" class="btn btn_m btn_success">\u9884\u7ea6\u63d0\u9192</a>'),0.75<b.left/window.innerWidth?$("#date_tip").attr("class","tip_small tip_right"):0.15>b.left/window.innerWidth?$("#date_tip").attr("class","tip_small tip_left"):$("#date_tip").attr("class","tip_small"))}};var Util={isImageFile:function(a){a=a.substring(a.lastIndexOf("."),a.length).toLowerCase();return".bmp"==a||".png"==a||".jpg"==a||".gif"==a},isEmpty:function(a,b,c){if(!a[b]){with($("#"+b).addError())0<length&&get(0).focus();c&&$.showTip(c);return!0}return!1},checkNumber:function(a,b,c){a=parseFloat(a);return!isNaN(a)&&(null==b||a>=b)&&(null==c||a<=c)},convertNumberToString:function(a,b){a=""+a;for(var c=[],d=0;d<b-a.length;d++)c.push("0");return c.join("")+a},convertDecimalToString:function(a,b){b=
|
|
|
|
|
b||2;a=""+Math.round(a*(10^b))/(10^b);var c=b,d=a.indexOf(".");-1!=d?c=b-a.length-d-1:a+=".";for(var d=[],e=0;e<c;e++)d.push("0");return a+d.join("")},isEmail:function(a){return/^\w+[\.\-_0-9a-z]+@[0-9a-z]+([\-_\.][0-9a-z]+)*\.(com|net|org|edu|cn)$/i.test(a)},loadJS:function(a,b,c){var d=document.createElement("script");d.onload=d.onreadystatechange=function(){if(!d||!d.readyState||!/^(?!(?:loaded|complete)$)/.test(d.readyState))d.onload=d.onreadystatechange=null,d.src="",d.parentNode.removeChild(d),
|
|
|
|
|
d=null,b&&b()};d.charset=c||document.charset||document.characterSet;d.src=a;try{document.getElementsByTagName("head")[0].appendChild(d)}catch(e){}},toSeatTypeName:function(a){switch(a){case 9:case "9":return"\u5546\u52a1\u5ea7";case "P":return"\u7279\u7b49\u5ea7";case "M":return"\u4e00\u7b49\u5ea7";case "O":return"\u4e8c\u7b49\u5ea7";case 6:case "6":return"\u9ad8\u7ea7\u8f6f\u5ea7";case 4:case "4":return"\u8f6f\u5367";case 3:case "3":return"\u786c\u5367";case 2:case "2":return"\u8f6f\u5ea7";case 1:case "1":return"\u786c\u5ea7";
|
|
|
|
|
case 0:case "0":return"\u65e0\u5ea7";default:return""}},inThatOrder:"OM934612P0".split(""),sortType:function(a){for(var b=[],c=0,d=Util.inThatOrder.length;c<d;c++)"undefined"!=typeof a[Util.inThatOrder[c]]&&b.push(a[Util.inThatOrder[c]]);return b},mapObject:function(a,b){for(var c={},d=0;d<a.length;d++)c[b(a[d])]=a[d];return c},canPassageAddToOrder:function(a){return"C"===a.passenger_id_type_code||"G"===a.passenger_id_type_code||"B"===a.passenger_id_type_code?!0:"2"===a.passenger_id_type_code?!1:
|
|
|
|
@ -126,10 +126,10 @@ a[4]||":"===a[5]?a:function(b){if("sjrand"==a)return"passcodeNew/getPassCodeNew?
|
|
|
|
|
getHeaders:function(a,b){a=cn12306.getFullUri(a);b=cn12306.getFullUri(b);var c={},d=isAndLiebao?"":"Fish-";c[d+"User-Agent"]="Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";c[d+"Origin"]=/(https?:\/\/[^\/]+\/)/.exec(a)[1];c[d+"RawUrl"]=a;c[d+"Referer"]=b;!isAndLiebao&&!isIos&&(c["Fish-RawUrl"]=a);return c},checkRandCode:function(a,b,c,d,e){a=cn12306.getFullUri("passcodeNew/checkRandCodeAnsyn");e=cn12306.getFullUri(e);cn12306.getHeaders(a,e);bootStrap.post("passcodeNew/checkRandCodeAnsyn",
|
|
|
|
|
null,null,e).done(function(a){"function"==typeof c&&c(a)}).fail(function(a,b){"function"==typeof d&&d(a,b)})},isUserLogined:function(a,b,c){bootStrap.post("login/checkUser","json",{_json_att:""},"leftTicket/init").done(function(c){c&&c.data&&c.data.flag?(c.attributes&&(sessionStorage.useratts=c.attributes),cn12306.checking||cn12306.checkeUser(),"function"==typeof a&&a()):"function"==typeof b&&b()}).fail(function(a,b){"function"==typeof c&&c()})},ajax:function(a){var b={type:"POST",dataType:"json"};
|
|
|
|
|
$.extend(b,a||{});b.headers=cn12306.getHeaders(b.url,b.refer);"undefined"!=typeof b.url&&(b.url=cn12306.getAjaxUrl(cn12306.getFullUri(b.url)));"undefined"!=typeof b.refer&&(b.refer=cn12306.getAjaxUrl(b.refer));$.ajax(b)},checking:!1,checkeUser:function(){cn12306.checking=!0;bootStrap.post("login/checkUser","json",null,"login/init").done(function(){setTimeout(cn12306.checkeUser,6E4)}).fail(function(){setTimeout(cn12306.checkeUser,6E4)})},loginOut:function(a,b){bootStrap.post("login/loginOut","html",
|
|
|
|
|
null,"login/init").done(function(){a&&(sessionStorage.clear(),a())}).fail(function(a){b&&b(a)})},queryTicket:function(a,b,c){bootStrap.get(cn12306.queryUri,"json",a,"leftTicket/init").done(function(d){!0==d.status&&(200==d.httpstatus&&0<d.data.length)&&cn12306.listGetTrainNo(d.data);!1==d.status&&d.c_url?(cn12306.queryUri=d.c_url,cn12306.queryTicket(a,b,c)):"function"==typeof b&&b(d)}).fail(function(a,e){"function"==typeof b&&c(a,e)})},byTrainNos:{},setLocalTrainNos:function(a,b){console.log(b);cn12306.byTrainNos[a]||
|
|
|
|
|
null,"login/init").done(function(){a&&(sessionStorage.clear(),a())}).fail(function(a){b&&b(a)})},queryTicket:function(a,b,c){bootStrap.get(cn12306.queryUri,"json",a,"leftTicket/init").done(function(d){!0==d.status&&(200==d.httpstatus&&0<d.data.length)&&cn12306.listGetTrainNo(d.data);!1==d.status&&d.c_url?(cn12306.queryUri=d.c_url,cn12306.queryTicket(a,b,c)):"function"==typeof b&&b(d)}).fail(function(a,e){"function"==typeof b&&c(a,e)})},byTrainNos:{},setLocalTrainNos:function(a,b){cn12306.byTrainNos[a]||
|
|
|
|
|
(cn12306.byTrainNos[a]=b,localStorage.setItem("localTrainNos",JSON.stringify(cn12306.byTrainNos)))},getLocalTrainNos:function(){var a=localStorage.getItem("localTrainNos");a&&(cn12306.byTrainNos=JSON.parse(a))},listGetTrainNo:function(a){if(a&&0<a.length)for(var b=0;b<a.length;b++)cn12306.queryByTrainNos({train_no:a[b].queryLeftNewDTO.train_no,from_station_telecode:a[b].queryLeftNewDTO.from_station_telecode,to_station_telecode:a[b].queryLeftNewDTO.to_station_telecode,depart_date:a[b].queryLeftNewDTO.start_train_date.replace(/(\d{4})(\d{2})(\d{2})/,
|
|
|
|
|
"$1-$2-$3")})},loadingInfo:[],queryByTrainNos:function(a,b,c){console.log(cn12306.byTrainNos[a.train_no]);cn12306.byTrainNos[a.train_no]?"function"==typeof b&&b(cn12306.byTrainNos[a.train_no]):-1==cn12306.loadingInfo.indexOf(a.train_no)&&(cn12306.loadingInfo.push(a.train_no),bootStrap.get("czxx/queryByTrainNo",null,a,"leftTicket/init").done(function(c){var e=cn12306.loadingInfo.indexOf(a.train_no);-1!=e&&cn12306.loadingInfo.splice(e,1);c.status&&cn12306.setLocalTrainNos(a.train_no,c.data);"function"==
|
|
|
|
|
typeof b&&b(c)}).fail(function(a,b){"function"==typeof c&&c(a,b)}))}};(function(a){function b(a){this.date=a||new Date;var b=0,d=0,e=(this.date-f)/864E5;this.daycyl=e+40;this.moncyl=14;for(a=1900;2050>a&&0<e;a++){b=void 0;d=348;for(b=32768;8<b;b>>=1)d+=c[a-1900]&b?1:0;d+=c[a-1900]&15?c[a-1900]&65536?30:29:0;e-=d;this.moncyl+=12}0>e&&(e+=d,a--,this.moncyl-=12);this.year=a;this.yearcyl=a-1864;b=c[a-1900]&15;this.isleap=!1;for(a=1;13>a&&0<e;a++)0<b&&a==b+1&&!1==this.isleap?(--a,this.isleap=!0,d=c[this.year-1900]&15?c[this.year-1900]&65536?30:29:0):d=c[this.year-1900]&
|
|
|
|
|
"$1-$2-$3")})},loadingInfo:[],queryByTrainNos:function(a,b,c){cn12306.byTrainNos[a.train_no]?"function"==typeof b&&b(cn12306.byTrainNos[a.train_no]):-1==cn12306.loadingInfo.indexOf(a.train_no)&&(cn12306.loadingInfo.push(a.train_no),bootStrap.get("czxx/queryByTrainNo",null,a,"leftTicket/init").done(function(c){var e=cn12306.loadingInfo.indexOf(a.train_no);-1!=e&&cn12306.loadingInfo.splice(e,1);c.status&&cn12306.setLocalTrainNos(a.train_no,c.data.data);"function"==typeof b&&b(c)}).fail(function(a,b){"function"==
|
|
|
|
|
typeof c&&c(a,b)}))}};(function(a){function b(a){this.date=a||new Date;var b=0,d=0,e=(this.date-f)/864E5;this.daycyl=e+40;this.moncyl=14;for(a=1900;2050>a&&0<e;a++){b=void 0;d=348;for(b=32768;8<b;b>>=1)d+=c[a-1900]&b?1:0;d+=c[a-1900]&15?c[a-1900]&65536?30:29:0;e-=d;this.moncyl+=12}0>e&&(e+=d,a--,this.moncyl-=12);this.year=a;this.yearcyl=a-1864;b=c[a-1900]&15;this.isleap=!1;for(a=1;13>a&&0<e;a++)0<b&&a==b+1&&!1==this.isleap?(--a,this.isleap=!0,d=c[this.year-1900]&15?c[this.year-1900]&65536?30:29:0):d=c[this.year-1900]&
|
|
|
|
|
65536>>a?30:29,!0==this.isleap&&a==b+1&&(this.isleap=!1),e-=d,!1==this.isleap&&this.moncyl++;0==e&&(0<b&&a==b+1)&&(this.isleap?this.isleap=!1:(this.isleap=!0,--a,--this.moncyl));0>e&&(e+=d,--a,--this.moncyl);this.month=a;this.day=e+1}var c=[19416,19168,42352,21717,53856,55632,91476,22176,39632,21970,19168,42422,42192,53840,119381,46400,54944,44450,38320,84343,18800,42160,46261,27216,27968,109396,11104,38256,21234,18800,25958,54432,59984,28309,23248,11104,100067,37600,116951,51536,54432,120998,46416,
|
|
|
|
|
22176,107956,9680,37584,53938,43344,46423,27808,46416,86869,19872,42448,83315,21200,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46496,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,21952,43872,38613,37600,51552,55636,54432,55888,30034,22176,43959,9680,37584,51893,43344,46240,47780,44368,21977,19360,42416,86390,21168,43312,31060,27296,44368,23378,19296,42726,42208,
|
|
|
|
|
53856,60005,54576,23200,30371,38608,19415,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448],d="\u65e5\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341".split(""),e=["\u521d","\u5341","\u5eff","\u5345","\u3000"],f=new Date(1900,0,31);b.prototype.getLunarMonth=function(){var a="",a=10<this.month?a+("\u5341"+d[this.month-10]):a+d[this.month],a=a+"\u6708";"\u5341\u4e8c\u6708"==a?a="\u814a\u6708":"\u4e00\u6708"==a&&(a="\u6b63\u6708");return a};
|
|
|
|
@ -189,34 +189,36 @@ RunQuery.setFilterCond()},queryTicket:function(){var a=Public.showLoading("\u6b6
|
|
|
|
|
c.from.code==c.start.code&&(b+='<i class="text_label">\u59cb</i>');b+=c.from.name+"</span>";b+="</div>";b+='<div class="line">';ls=c.elapsedTime.total.split(":");b+='<span class="pull_right text_gray">'+(ls[0]?ls[0]+"\u5c0f\u65f6":"")+(ls[1]?ls[1]+"\u5206":"0\u5206")+"</span>";b+='<span class="text_lg link_label">';b+=c.to.time+"</span>";b+='<span class="text_lg">';c.to.code==c.end.code&&(b+='<i class="text_label">\u7ec8</i>');for(var b=b+(c.to.name+"</span>"),b=b+"</div>",e=0;e<c.ticketMapSort.length;e++)if(0!=
|
|
|
|
|
c.ticketMapSort[e].count||RunQuery.trainData.isMaintain)b+='<div class="line"><span class="pull_right">',"\u6709"==c.ticketMapSort[e].count?b+='<span class="text_warning">\u6709</span>':(b+='<span class="text_warning">'+c.ticketMapSort[e].count+"</span>",b+='<span class="text_gray">\u5f20</span>'),b=RunQuery.trainData.isMaintain?b+'<span href="javascript:;" class="btn btn_gray">\u7ef4\u62a4</span>':b+('<a href="javascript:;" class="btn btn_success" data-fn="buy" data-traincode="'+c.id+'" data-seatcode="'+
|
|
|
|
|
c.ticketMapSort[e].code+'">\u62a2\u7968</a>'),b+="</span>",b+='<span class="link_label">'+c.ticketMapSort[e].name+"</span>",b+='<span class="text_gray">'+c.ticketMapSort[e].price/10+"\u5143</span>",b+="</div>";b+="</li>"}$("#train_list").html(b);$(".station_title span").html("\u5171 "+$("#train_list li").length+" \u8d9f\u5217\u8f66");!RunQuery.trainData.isMaintain&&0==Object.keys(RunQuery.trainData.train).length?RunQuery.showRefresh():!RunQuery.trainData.isMaintain&&RunQuery.refresh?(Client.refreshSuccess(),
|
|
|
|
|
RunQuery.refStop(),RunQuery.autoSubmit()):$("#autoTip").hide()},autoSubmit:function(){$('#train_list li [data-fn="buy"]').eq(0).click()},getTicketInfo:function(a){var b=[];a=(-1===a.indexOf("#")?a:/getSelected\(['"](.*?)['"]\)/i.exec(a)[1].split("#")[11]).match(/([A-Z\d])0*?([\*\d]{5})0*?(\d{4})/gi);for(var c in a){var d=/([A-Z\d])0*?([\*\d]{5})0*?(\d{4})/i.exec(a[c]),e=d[1],f="*"==d[2][0]?null:parseInt(d[2],10),d=parseInt(d[3],10),g={code:e,name:Util.toSeatTypeName(e),price:f};3E3>d?(g.count=d,"7"===
|
|
|
|
|
e?b.push({code:"M",name:Util.toSeatTypeName("M"),price:f,count:d}):"8"===e?b.push({code:"O",name:Util.toSeatTypeName("O"),price:f,count:d}):b.push(g)):(g.count=d-3E3,g.code="0",g.name="\u65e0\u5ea7",b.push(g))}return b},trainData:null,formatJson:function(a){if(!Array.isArray(a.data)&&!a.data.length)return null;for(var b=a.data,c,d={raw:a,rawTrainMap:{},trainMap:{},codeMap:{},auto:null,nextTime:null},e=0;e<b.length;e++){t=b[e];a={id:t.queryLeftNewDTO.train_no,code:t.queryLeftNewDTO.station_train_code,
|
|
|
|
|
available:"Y"===t.queryLeftNewDTO.canWebBuy?1:0,start:{code:t.queryLeftNewDTO.start_station_telecode,name:t.queryLeftNewDTO.start_station_name},from:{code:t.queryLeftNewDTO.from_station_telecode,fromStationNo:t.queryLeftNewDTO.from_station_no,name:t.queryLeftNewDTO.from_station_name,endpoint:t.queryLeftNewDTO.from_station_telecode==t.queryLeftNewDTO.start_station_telecode,time:t.queryLeftNewDTO.start_time},to:{code:t.queryLeftNewDTO.to_station_telecode,toStationNo:t.queryLeftNewDTO.to_station_no,
|
|
|
|
|
name:t.queryLeftNewDTO.to_station_name,endpoint:t.queryLeftNewDTO.end_station_telecode==t.queryLeftNewDTO.to_station_telecode,time:t.queryLeftNewDTO.arrive_time},elapsedTime:{days:t.queryLeftNewDTO.day_difference,total:t.queryLeftNewDTO.lishi},end:{code:t.queryLeftNewDTO.end_station_telecode,name:t.queryLeftNewDTO.end_station_name},ypinfo:t.queryLeftNewDTO.yp_info,ypinfo_ex:t.queryLeftNewDTO.yp_ex,locationCode:t.queryLeftNewDTO.location_code,controlDay:t.queryLeftNewDTO.control_day,supportCard:t.queryLeftNewDTO.is_support_card,
|
|
|
|
|
saleTime:t.queryLeftNewDTO.sale_time,secureStr:t.secretStr,selltime:null,date:t.queryLeftNewDTO.start_train_date.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"),form_train_date:RunQuery.curData.start_date,limitSellInfo:t.buttonTextInfo&&-1!=t.buttonTextInfo.indexOf("\u6682\u552e")?t.buttonTextInfo.replace(/<[^>]+>/i,""):null};c=RunQuery.getTicketInfo(t.queryLeftNewDTO.yp_info);a.tickets=c;a.ticketMap=Util.mapObject(c,function(a){return a.code});a.ticketMapSort=Util.sortType(a.ticketMap);if(c=/(0*(\d+)\u67080*(\d+)\u65e5)?(\d+)\s*\u70b9\s*((\d+)\u5206)?\s*\u8d77\u552e/i.exec(t.buttonTextInfo.replace(/<.*?>/g,
|
|
|
|
|
"")))a.available=-1,a.selltime=new Date,a.selltime.setHours(parseInt(c[4])),a.selltime.setMinutes(parseInt(c[6]||"0",10)),a.selltime.setSeconds(0),c[1]&&(a.selltime.setMonth(parseInt(c[2])-1),a.selltime.setDate(parseInt(c[3])),a.selltime.getMonth()<(new Date).getMonth()&&a.selltime.setFullYear(a.selltime.getFullYear()+1));d.rawTrainMap[a.id]=t;d.codeMap[a.code]=t;d.trainMap[a.id]=a}0<b.length&&(d.isMaintain=-1!=b[0].buttonTextInfo.indexOf("\u7cfb\u7edf\u7ef4\u62a4\u65f6\u95f4"));RunQuery.trainData=
|
|
|
|
|
d;if("undefined"!=typeof RunQuery.filterCond.train)for(e=0;e<RunQuery.filterCond.train.length;e++)"undefined"==typeof d.codeMap[RunQuery.filterCond.train[e]]&&(RunQuery.filterCond.train.splice(e,1),e--);RunQuery.filterJson()},filterCond:{},setFilterCond:function(){RunQuery.filterCond={};for(var a=$("#filter_form").serializeArray(),b=0;b<a.length;b++)RunQuery.filterCond[a[b].name]||(RunQuery.filterCond[a[b].name]=[]),RunQuery.filterCond[a[b].name].push(a[b].value);RunQuery.filterCond.train_type&&(RunQuery.filterCond.train_type=
|
|
|
|
|
RunQuery.filterCond.train_type.join("|").split("|"))},hasTrains:function(a){var b={},c=!1,d;for(d in a){for(var c=!1,e=0;e<a[d].ticketMapSort.length;e++)if(0<a[d].ticketMapSort[e].count){c=!0;break}c&&(b[d]=a[d])}return b},trainsFilter:function(a){var b={};if("undefined"==typeof RunQuery.filterCond.train||0==RunQuery.filterCond.train.length)return a;for(var c in a)-1!=RunQuery.filterCond.train.indexOf(a[c].code)&&(b[c]=a[c]);return b},trainsType:function(a){if("undefined"==typeof RunQuery.filterCond.train_type||
|
|
|
|
|
"all"==RunQuery.filterCond.train_type[0])return a;var b={},c;for(c in a)if(-1!=RunQuery.filterCond.train_type.indexOf(a[c].code[0])||!isNaN(a[c].code[0])&&-1!=RunQuery.filterCond.train_type.indexOf("QT"))b[c]=a[c];return b},trainsSeat:function(a){if("undefined"==typeof RunQuery.filterCond.train_seat||"all"==RunQuery.filterCond.train_seat[0])return a;var b={},c=!1,d;for(d in a){for(var c=!1,e=0;e<RunQuery.filterCond.train_seat.length;e++)if("undefined"!=typeof a[d].ticketMap[RunQuery.filterCond.train_seat[e]]&&
|
|
|
|
|
0<a[d].ticketMap[RunQuery.filterCond.train_seat[e]].count){c=!0;break}c&&(b[d]=a[d])}return b},filterJson:function(){RunQuery.trainData.hasTrains=RunQuery.hasTrains(RunQuery.trainData.trainMap);RunQuery.trainData.train=RunQuery.trainsFilter(RunQuery.trainData.hasTrains);RunQuery.trainData.trainsType=RunQuery.trainsType(RunQuery.trainData.train);RunQuery.trainData.trainsSeat=RunQuery.trainsSeat(RunQuery.trainData.trainsType);RunQuery.trainData.train=RunQuery.trainData.trainsSeat},dateChangeCallback:function(a){var b=
|
|
|
|
|
a.date.getTime();b>=Public.calendar.minDate.date.getTime()&&b<=Public.calendar.maxDate.date.getTime()?($("#date_tip").hide(),Public.hideInnerPage("date_box"),$("#start_date").html(Public.calendar.curDate.format(Public.formatString)+" "+Public.calendar.curDate.day(3)),$("#start_date_val").val(Public.calendar.curDate.format("yyyy-MM-dd")),RunQuery.hisUpdata()):(b=$("a.cur",Public.calendar.wrap).offset(),$("#date_tip").css({left:b.left,top:b.top,display:"block"}).html("<p>"+a.format("M\u6708d\u65e5")+
|
|
|
|
|
'\u4e0d\u5728\u9884\u552e\u671f</p><a href="remind.html?data='+encodeURIComponent(a.format("M\u6708d\u65e5"))+'" class="btn btn_m btn_success">\u9884\u7ea6\u63d0\u9192</a>'),0.75<b.left/window.innerWidth?$("#date_tip").attr("class","tip_small tip_right"):0.15>b.left/window.innerWidth?$("#date_tip").attr("class","tip_small tip_left"):$("#date_tip").attr("class","tip_small"))},hisUpdata:function(){Public.setHisQuery($("#startStationCode").val()+"-"+$("#endStationCode").val(),$("#query_form").serialize());
|
|
|
|
|
Public.setHis();RunQuery.getQueryData();RunQuery.queryTicket()},showRefresh:function(){RunQuery.refresh||(Public.isLogin?$("#autoTip p").html("\u6682\u65f6\u65e0\u7968!<br>\u6ca1\u6709\u7b26\u5408\u4f60\u8981\u6c42\u7684\u8f66\u6b21\u548c\u5e2d\u522b"):$("#autoTip p").html("\u6682\u65f6\u65e0\u7968!<br>\u767b\u5f55\u540e\u53ef\u4ee5\u81ea\u52a8\u5237\u7968"),$("#autoTip").show())},refCount:0,startDate:null,refDate:null,refresh:!1,refTimer:null,startRef:function(){RunQuery.refresh||(Client.refreshStart(),
|
|
|
|
|
RunQuery.startDate=(new Date).getTime(),RunQuery.refDate=RunQuery.startDate,RunQuery.refresh=!0,$("#refresh_train").show(),$("#autoTip").hide(),RunQuery.queryTicket(),RunQuery.refCount=1,RunQuery.refGo())},refGo:function(){if(RunQuery.refresh){var a=(new Date).getTime(),b=RunQuery.formatTime(a-RunQuery.startDate),c=((5E3-(a-RunQuery.refDate))/1E3).toFixed(1);0>=c&&(c=0);$("#refresh_train .rf_desc").html("\u5df2\u5237 "+RunQuery.refCount+" \u6b21\uff0c\u7528\u65f6 "+b+"<br>\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==RunQuery.trainData.train.length&&RunQuery.showRefresh()},formatTime:function(a){var b=parseInt(a/6E4);a=parseInt(a%6E4/1E3);return b+"\u5206"+a+"\u79d2"}};var OrderSubmit={init:function(){if(0==$("#ordersubmit_page").length)return!1;OrderSubmit.bindEvent();Public.checkLogin(function(){!sessionStorage.getItem(Public.user+"curBuy")&&!sessionStorage.getItem("curBuy")&&(window.location.href="query.html");OrderSubmit.getTrainInfo();OrderSubmit.getPassenger()},function(){window.location.href="login.html"},function(){window.location.href="login.html"})},getTrainInfo:function(){OrderSubmit.curData=JSON.parse(sessionStorage.getItem(Public.user+"curBuy"));OrderSubmit.curData||
|
|
|
|
|
(OrderSubmit.curData=JSON.parse(sessionStorage.getItem("curBuy")));OrderSubmit.curBuySeat=sessionStorage.getItem(Public.user+"curBuySeat");OrderSubmit.curBuySeat||(OrderSubmit.curBuySeat=sessionStorage.getItem("curBuySeat"));OrderSubmit.curInfo=Public.his.queryObjs[OrderSubmit.curData.from.code+"-"+OrderSubmit.curData.to.code];var a='<div class="info">',b=new Date(OrderSubmit.curData.form_train_date.replace(/\-/g,"/")),a=a+('<div class="info_title"><span class="pull_right">'+OrderSubmit.curData.code+
|
|
|
|
|
"</span><span>"+b.format("yyyy-M-d")+" "+b.day(3)+"</span></div>"),a=a+('<div class="stations_info"><div class="station_info"><strong>'+OrderSubmit.curData.from.name+"</strong>"+OrderSubmit.curData.from.time+"</div>"),a=a+('<div class="station_info"><strong>'+OrderSubmit.curData.to.name+"</strong>"+OrderSubmit.curData.to.time+"</div></div>");$("#trainInfo").html(a+"</div>")},passengerList:null,loadPassCode:function(){if($("#randcodeimg").hasClass("loading_code"))return!1;$("#randcodeimg").addClass("loading_code");
|
|
|
|
|
cn12306.loadRandCode("sjrand",function(a){$("#randcodeimg").attr("src",a);$("#randcodeimg").removeClass("loading_code")},"passcodeNew/getPassCodeNew?module=login&rand=sjrand")},getPassenger:function(){sessionStorage.getItem(Public.user+"_passenger")?(OrderSubmit.passengerList=JSON.parse(sessionStorage.getItem(Public.user+"_passenger")),OrderSubmit.passengerObj=JSON.parse(sessionStorage.getItem(Public.user+"_passengerobj")),OrderSubmit.setPassengerList()):bootStrap.post("confirmPassenger/getPassengerDTOs",
|
|
|
|
|
null,null,"leftTicket/init").done(function(a){a.status&&(Array.isArray(a.data.normal_passengers)&&0<a.data.normal_passengers.length)&&(OrderSubmit.formatPassenger(a.data.normal_passengers),OrderSubmit.setPassengerList())}).fail(function(a,b){console.log(a,b)})},setPassengerList:function(){for(var a="",b=0,c=OrderSubmit.passengerList.length;b<c;b++)a+='<label class="query_checkbox"><input name="train_type" type="checkbox" value="'+OrderSubmit.passengerList[b].key+'">'+OrderSubmit.passengerList[b].passenger_name+
|
|
|
|
|
"</label>";if(OrderSubmit.curInfo)for(var c=OrderSubmit.curInfo.filters.split("&"),d=[],b=0;b<c.length;b++)d=c[b].split("="),d[1]=decodeURIComponent(d[1]),"passenger"==d[0]&&OrderSubmit.passengerObj[d[1]]&&OrderSubmit.passengerAdd(OrderSubmit.passengerObj[d[1]]);$("#passengers").html(a);$("#add_passenger").on("click",function(){Public.showInnerPage("passenger")});$("#passenger_ok").on("click",function(){Public.hideInnerPage("passenger")});$('#passengers [type="checkbox"]').on("change",function(){if(5<
|
|
|
|
|
$('#passengers [type="checkbox"]:checked').length||5<=$("#passenger_list li").length)return Public.alert("\u8054\u7cfb\u4eba\u6700\u591a\u53ea\u80fd\u9009\u62e9\u4e94\u4e2a"),$(this).prop("checked",!1),!1;var a=$(this),b=a.val();a.prop("checked")?OrderSubmit.passengerAdd(OrderSubmit.passengerObj[b]):$('#passenger_list [data-key="'+b+'"]').remove()});0<$("#passenger_list li").length&&$("#ordersubmit").click()},passenger:{},passengerAdd:function(a){var b="",b=Util.getAvailableTicketType(a),c=OrderSubmit.curData.ticketMap[OrderSubmit.curBuySeat],
|
|
|
|
|
b='<li class="clearfix" data-key="'+a.key+'" data-type="'+b[0].id+'" data-seat="'+c.code+'"><span class="pull_left"><strong>'+a.passenger_name+'</strong><span class="ticket">'+b[0].name+"</span><br>"+a.passenger_id_no+'</span><a href="javascript:;" data-fn="edit" class="pull_right"><span class="seat">'+c.name+" "+c.price/10+'\u5143</span> <i class="icon_edit"></i></a></li>';$("#passenger_list").append(b)},addChildren:function(a,b){var c=OrderSubmit.passengerObj[a],d=OrderSubmit.curData.ticketMap[b.attr("data-seat")];
|
|
|
|
|
html='<li class="clearfix" data-children="true" data-key="'+c.passenger_name+"$"+c.passenger_id_type_code+"$"+c.passenger_id_no+'" data-type="2" data-seat="'+b.attr("data-seat")+'">\t\t\t\t<span class="pull_left"><strong>'+c.passenger_name+'</strong><span class="ticket">\u513f\u7ae5\u7968</span><br>'+c.passenger_id_no+'</span>\t\t\t\t<a href="javascript:;" data-fn="edit" class="pull_right">\t\t\t\t<span class="seat">'+d.name+" "+d.price/10+'\u5143</span> <i class="icon_edit"></i></a></li>';
|
|
|
|
|
b.after(html)},formatPassenger:function(a){for(var b=[],c={},d="",e=0;e<a.length;e++)Util.canPassageAddToOrder(a[e])&&(d=a[e].passenger_name+"$"+a[e].passenger_id_type_code+"$"+a[e].passenger_id_no,a[e].key=d,c[d]=a[e],b.push(a[e]));OrderSubmit.passengerList=b;OrderSubmit.passengerObj=c;sessionStorage.setItem("_passenger",JSON.stringify(b));sessionStorage.setItem("_passengerobj",JSON.stringify(c))},editKey:"",editEl:null,showLayer:function(){$("#layer").show()},hideLayer:function(){$("#layer").hide()},
|
|
|
|
|
bindEvent:function(){var a=$("#edit_menu");$('[data-fn="edit"]').live("click",function(b){b=$(this).closest("[data-key]");var c=b.attr("data-key");OrderSubmit.editKey=c;OrderSubmit.editEl=b;$("#passenger_editinfo").html(b.html());$('#passenger_editinfo [data-fn="edit"]').attr("data-fn","edit_close");$("#edit_menu").css({top:b.offset().top});b.attr("data-children")?($('[data-fn="children"]').closest("li").hide(),$('[data-fn="ticket"]').closest("li").hide()):($('[data-fn="children"]').closest("li").show(),
|
|
|
|
|
$('[data-fn="ticket"]').closest("li").show());a.show();OrderSubmit.showLayer()});$("#layer").live("click",function(){a.hide();$("#edit_ticket").hide();$("#edit_seat").hide();OrderSubmit.hideLayer()});a.live("click",function(a){a.stopPropagation();return!1});$('[data-fn="edit_close"]').live("click",function(b){a.hide();OrderSubmit.hideLayer()});$('[data-fn="remove"]').live("click",function(b){"2"==OrderSubmit.editEl.attr("data-type")?OrderSubmit.editEl.remove():($('#passenger_list [data-key="'+OrderSubmit.editKey+
|
|
|
|
|
'"]').remove(),$('#passengers [value="'+OrderSubmit.editKey+'"]').prop("checked",!1));delete OrderSubmit.passenger[OrderSubmit.editKey];a.hide();OrderSubmit.hideLayer()});$('[data-fn="children"]').live("click",function(b){4<$("#passenger_list li").length?Public.alert("\u8054\u7cfb\u4eba\u6700\u591a\u53ea\u80fd\u9009\u62e9\u4e94\u4e2a"):OrderSubmit.addChildren(OrderSubmit.editKey,OrderSubmit.editEl);a.hide();OrderSubmit.hideLayer()});$('[data-fn="seat"]').live("click",function(b){a.hide();OrderSubmit.hideLayer();
|
|
|
|
|
OrderSubmit.setSeat()});$("#edit_seat ul a").live("click",function(){var a=$(this).attr("data-id"),c=OrderSubmit.curData.ticketMap[a];OrderSubmit.editEl.attr("data-seat",a);$(".seat",OrderSubmit.editEl).html(c.name+" "+c.price/10+"\u5143");$("#edit_seat").hide();OrderSubmit.hideLayer()});$('[data-fn="ticket"]').live("click",function(b){a.hide();OrderSubmit.hideLayer();OrderSubmit.setTicket()});$("#edit_ticket a").live("click",function(){var a=$(this).attr("data-id"),c=$(this).html();OrderSubmit.editEl.attr("data-type",
|
|
|
|
|
RunQuery.refStop(),RunQuery.autoSubmit()):$("#autoTip").hide()},autoSubmit:function(){var a=$('#train_list li [data-fn="buy"]').eq(0);a.closest("li");if(bootStrap.isAndroid){a={title:"\u606d\u559c\u60a8\uff0c\u5237\u51fa\u7968\u4e86\uff01",content:"\u4f60\u8ba2\u7684 "+$("[data-id]").html()+" \u6b21\u5217\u8f66\u6709\u3010"+a.closest(".line").find(".link_label").eq(0).html()+"\u3011\u4e86\uff01",confirm:"confirmCallback",cancel:"cancelCallback"};try{__TicketJavaScriptObject__.confirm(JSON.stringify(a))}catch(b){alert(b)}}else a.click()},
|
|
|
|
|
getTicketInfo:function(a){var b=[];a=(-1===a.indexOf("#")?a:/getSelected\(['"](.*?)['"]\)/i.exec(a)[1].split("#")[11]).match(/([A-Z\d])0*?([\*\d]{5})0*?(\d{4})/gi);for(var c in a){var d=/([A-Z\d])0*?([\*\d]{5})0*?(\d{4})/i.exec(a[c]),e=d[1],f="*"==d[2][0]?null:parseInt(d[2],10),d=parseInt(d[3],10),g={code:e,name:Util.toSeatTypeName(e),price:f};3E3>d?(g.count=d,"7"===e?b.push({code:"M",name:Util.toSeatTypeName("M"),price:f,count:d}):"8"===e?b.push({code:"O",name:Util.toSeatTypeName("O"),price:f,count:d}):
|
|
|
|
|
b.push(g)):(g.count=d-3E3,g.code="0",g.name="\u65e0\u5ea7",b.push(g))}return b},trainData:null,formatJson:function(a){if(!Array.isArray(a.data)&&!a.data.length)return null;for(var b=a.data,c,d={raw:a,rawTrainMap:{},trainMap:{},codeMap:{},auto:null,nextTime:null},e=0;e<b.length;e++){t=b[e];a={id:t.queryLeftNewDTO.train_no,code:t.queryLeftNewDTO.station_train_code,available:"Y"===t.queryLeftNewDTO.canWebBuy?1:0,start:{code:t.queryLeftNewDTO.start_station_telecode,name:t.queryLeftNewDTO.start_station_name},
|
|
|
|
|
from:{code:t.queryLeftNewDTO.from_station_telecode,fromStationNo:t.queryLeftNewDTO.from_station_no,name:t.queryLeftNewDTO.from_station_name,endpoint:t.queryLeftNewDTO.from_station_telecode==t.queryLeftNewDTO.start_station_telecode,time:t.queryLeftNewDTO.start_time},to:{code:t.queryLeftNewDTO.to_station_telecode,toStationNo:t.queryLeftNewDTO.to_station_no,name:t.queryLeftNewDTO.to_station_name,endpoint:t.queryLeftNewDTO.end_station_telecode==t.queryLeftNewDTO.to_station_telecode,time:t.queryLeftNewDTO.arrive_time},
|
|
|
|
|
elapsedTime:{days:t.queryLeftNewDTO.day_difference,total:t.queryLeftNewDTO.lishi},end:{code:t.queryLeftNewDTO.end_station_telecode,name:t.queryLeftNewDTO.end_station_name},ypinfo:t.queryLeftNewDTO.yp_info,ypinfo_ex:t.queryLeftNewDTO.yp_ex,locationCode:t.queryLeftNewDTO.location_code,controlDay:t.queryLeftNewDTO.control_day,supportCard:t.queryLeftNewDTO.is_support_card,saleTime:t.queryLeftNewDTO.sale_time,secureStr:t.secretStr,selltime:null,date:t.queryLeftNewDTO.start_train_date.replace(/(\d{4})(\d{2})(\d{2})/,
|
|
|
|
|
"$1-$2-$3"),form_train_date:RunQuery.curData.start_date,limitSellInfo:t.buttonTextInfo&&-1!=t.buttonTextInfo.indexOf("\u6682\u552e")?t.buttonTextInfo.replace(/<[^>]+>/i,""):null};c=RunQuery.getTicketInfo(t.queryLeftNewDTO.yp_info);a.tickets=c;a.ticketMap=Util.mapObject(c,function(a){return a.code});a.ticketMapSort=Util.sortType(a.ticketMap);if(c=/(0*(\d+)\u67080*(\d+)\u65e5)?(\d+)\s*\u70b9\s*((\d+)\u5206)?\s*\u8d77\u552e/i.exec(t.buttonTextInfo.replace(/<.*?>/g,"")))a.available=-1,a.selltime=new Date,
|
|
|
|
|
a.selltime.setHours(parseInt(c[4])),a.selltime.setMinutes(parseInt(c[6]||"0",10)),a.selltime.setSeconds(0),c[1]&&(a.selltime.setMonth(parseInt(c[2])-1),a.selltime.setDate(parseInt(c[3])),a.selltime.getMonth()<(new Date).getMonth()&&a.selltime.setFullYear(a.selltime.getFullYear()+1));d.rawTrainMap[a.id]=t;d.codeMap[a.code]=t;d.trainMap[a.id]=a}0<b.length&&(d.isMaintain=-1!=b[0].buttonTextInfo.indexOf("\u7cfb\u7edf\u7ef4\u62a4\u65f6\u95f4"));RunQuery.trainData=d;if("undefined"!=typeof RunQuery.filterCond.train)for(e=
|
|
|
|
|
0;e<RunQuery.filterCond.train.length;e++)"undefined"==typeof d.codeMap[RunQuery.filterCond.train[e]]&&(RunQuery.filterCond.train.splice(e,1),e--);RunQuery.filterJson()},filterCond:{},setFilterCond:function(){RunQuery.filterCond={};for(var a=$("#filter_form").serializeArray(),b=0;b<a.length;b++)RunQuery.filterCond[a[b].name]||(RunQuery.filterCond[a[b].name]=[]),RunQuery.filterCond[a[b].name].push(a[b].value);RunQuery.filterCond.train_type&&(RunQuery.filterCond.train_type=RunQuery.filterCond.train_type.join("|").split("|"))},
|
|
|
|
|
hasTrains:function(a){var b={},c=!1,d;for(d in a){for(var c=!1,e=0;e<a[d].ticketMapSort.length;e++)if(0<a[d].ticketMapSort[e].count){c=!0;break}c&&(b[d]=a[d])}return b},trainsFilter:function(a){var b={};if("undefined"==typeof RunQuery.filterCond.train||0==RunQuery.filterCond.train.length)return a;for(var c in a)-1!=RunQuery.filterCond.train.indexOf(a[c].code)&&(b[c]=a[c]);return b},trainsType:function(a){if("undefined"==typeof RunQuery.filterCond.train_type||"all"==RunQuery.filterCond.train_type[0])return a;
|
|
|
|
|
var b={},c;for(c in a)if(-1!=RunQuery.filterCond.train_type.indexOf(a[c].code[0])||!isNaN(a[c].code[0])&&-1!=RunQuery.filterCond.train_type.indexOf("QT"))b[c]=a[c];return b},trainsSeat:function(a){if("undefined"==typeof RunQuery.filterCond.train_seat||"all"==RunQuery.filterCond.train_seat[0])return a;var b={},c=!1,d;for(d in a){for(var c=!1,e=0;e<RunQuery.filterCond.train_seat.length;e++)if("undefined"!=typeof a[d].ticketMap[RunQuery.filterCond.train_seat[e]]&&0<a[d].ticketMap[RunQuery.filterCond.train_seat[e]].count){c=
|
|
|
|
|
!0;break}c&&(b[d]=a[d])}return b},filterJson:function(){RunQuery.trainData.hasTrains=RunQuery.hasTrains(RunQuery.trainData.trainMap);RunQuery.trainData.train=RunQuery.trainsFilter(RunQuery.trainData.hasTrains);RunQuery.trainData.trainsType=RunQuery.trainsType(RunQuery.trainData.train);RunQuery.trainData.trainsSeat=RunQuery.trainsSeat(RunQuery.trainData.trainsType);RunQuery.trainData.train=RunQuery.trainData.trainsSeat},dateChangeCallback:function(a){var b=a.date.getTime();b>=Public.calendar.minDate.date.getTime()&&
|
|
|
|
|
b<=Public.calendar.maxDate.date.getTime()?($("#date_tip").hide(),Public.hideInnerPage("date_box"),$("#start_date").html(Public.calendar.curDate.format(Public.formatString)+" "+Public.calendar.curDate.day(3)),$("#start_date_val").val(Public.calendar.curDate.format("yyyy-MM-dd")),RunQuery.hisUpdata()):(b=$("a.cur",Public.calendar.wrap).offset(),$("#date_tip").css({left:b.left,top:b.top,display:"block"}).html("<p>"+a.format("M\u6708d\u65e5")+'\u4e0d\u5728\u9884\u552e\u671f</p><a href="remind.html?data='+
|
|
|
|
|
encodeURIComponent(a.format("M\u6708d\u65e5"))+'" class="btn btn_m btn_success">\u9884\u7ea6\u63d0\u9192</a>'),0.75<b.left/window.innerWidth?$("#date_tip").attr("class","tip_small tip_right"):0.15>b.left/window.innerWidth?$("#date_tip").attr("class","tip_small tip_left"):$("#date_tip").attr("class","tip_small"))},hisUpdata:function(){Public.setHisQuery($("#startStationCode").val()+"-"+$("#endStationCode").val(),$("#query_form").serialize());Public.setHis();RunQuery.getQueryData();RunQuery.queryTicket()},
|
|
|
|
|
showRefresh:function(){RunQuery.refresh||(Public.isLogin?$("#autoTip p").html("\u6682\u65f6\u65e0\u7968!<br>\u6ca1\u6709\u7b26\u5408\u4f60\u8981\u6c42\u7684\u8f66\u6b21\u548c\u5e2d\u522b"):$("#autoTip p").html("\u6682\u65f6\u65e0\u7968!<br>\u767b\u5f55\u540e\u53ef\u4ee5\u81ea\u52a8\u5237\u7968"),$("#autoTip").show())},refCount:0,startDate:null,refDate:null,refresh:!1,refTimer:null,startRef:function(){RunQuery.refresh||(Client.refreshStart(),RunQuery.startDate=(new Date).getTime(),RunQuery.refDate=
|
|
|
|
|
RunQuery.startDate,RunQuery.refresh=!0,$("#refresh_train").show(),$("#autoTip").hide(),RunQuery.queryTicket(),RunQuery.refCount=1,RunQuery.refGo())},refGo:function(){if(RunQuery.refresh){var a=(new Date).getTime(),b=RunQuery.formatTime(a-RunQuery.startDate),c=((5E3-(a-RunQuery.refDate))/1E3).toFixed(1);0>=c&&(c=0);$("#refresh_train .rf_desc").html("\u5df2\u5237 "+RunQuery.refCount+" \u6b21\uff0c\u7528\u65f6 "+b+"<br>\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==RunQuery.trainData.train.length&&RunQuery.showRefresh()},formatTime:function(a){var b=parseInt(a/6E4);a=parseInt(a%6E4/1E3);return b+"\u5206"+a+"\u79d2"},formatRecData: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){console.log(a)},error:function(a,b){}})},t:function(){}};window.confirmCallback=function(){$('#train_list li [data-fn="buy"]').eq(0).click()};window.cancelCallback=function(){};var OrderSubmit={init:function(){if(0==$("#ordersubmit_page").length)return!1;OrderSubmit.bindEvent();Public.checkLogin(function(){!sessionStorage.getItem(Public.user+"curBuy")&&!sessionStorage.getItem("curBuy")&&(window.location.href="query.html");OrderSubmit.getTrainInfo();OrderSubmit.getPassenger()},function(){window.location.href="login.html"},function(){window.location.href="login.html"})},getTrainInfo:function(){OrderSubmit.curData=JSON.parse(sessionStorage.getItem(Public.user+"curBuy"));OrderSubmit.curData||
|
|
|
|
|
(OrderSubmit.curData=JSON.parse(sessionStorage.getItem("curBuy")));OrderSubmit.curBuySeat=sessionStorage.getItem(Public.user+"curBuySeat");OrderSubmit.curBuySeat||(OrderSubmit.curBuySeat=sessionStorage.getItem("curBuySeat"));OrderSubmit.curInfo=Public.his.queryObjs[Public.his.querys[0][0]];var a='<div class="info">',b=new Date(OrderSubmit.curData.form_train_date.replace(/\-/g,"/")),a=a+('<div class="info_title"><span class="pull_right">'+OrderSubmit.curData.code+"</span><span>"+b.format("yyyy-M-d")+
|
|
|
|
|
" "+b.day(3)+"</span></div>"),a=a+('<div class="stations_info"><div class="station_info"><strong>'+OrderSubmit.curData.from.name+"</strong>"+OrderSubmit.curData.from.time+"</div>"),a=a+('<div class="station_info"><strong>'+OrderSubmit.curData.to.name+"</strong>"+OrderSubmit.curData.to.time+"</div></div>");$("#trainInfo").html(a+"</div>")},passengerList:null,loadPassCode:function(){if($("#randcodeimg").hasClass("loading_code"))return!1;$("#randcodeimg").addClass("loading_code");cn12306.loadRandCode("sjrand",
|
|
|
|
|
function(a){$("#randcodeimg").attr("src",a);$("#randcodeimg").removeClass("loading_code")},"passcodeNew/getPassCodeNew?module=login&rand=sjrand")},getPassenger:function(){sessionStorage.getItem(Public.user+"_passenger")?(OrderSubmit.passengerList=JSON.parse(sessionStorage.getItem(Public.user+"_passenger")),OrderSubmit.passengerObj=JSON.parse(sessionStorage.getItem(Public.user+"_passengerobj")),OrderSubmit.setPassengerList()):bootStrap.post("confirmPassenger/getPassengerDTOs",null,null,"leftTicket/init").done(function(a){a.status&&
|
|
|
|
|
(Array.isArray(a.data.normal_passengers)&&0<a.data.normal_passengers.length)&&(OrderSubmit.formatPassenger(a.data.normal_passengers),OrderSubmit.setPassengerList())}).fail(function(a,b){console.log(a,b)})},setPassengerList:function(){for(var a="",b=0,c=OrderSubmit.passengerList.length;b<c;b++)a+='<label class="query_checkbox"><input name="train_type" type="checkbox" value="'+OrderSubmit.passengerList[b].key+'">'+OrderSubmit.passengerList[b].passenger_name+"</label>";if(OrderSubmit.curInfo)for(var c=
|
|
|
|
|
OrderSubmit.curInfo.filters.split("&"),d=[],b=0;b<c.length;b++)d=c[b].split("="),d[1]=decodeURIComponent(d[1]),"passenger"==d[0]&&OrderSubmit.passengerObj[d[1]]&&OrderSubmit.passengerAdd(OrderSubmit.passengerObj[d[1]]);$("#passengers").html(a);$("#add_passenger").on("click",function(){Public.showInnerPage("passenger")});$("#passenger_ok").on("click",function(){Public.hideInnerPage("passenger")});$('#passengers [type="checkbox"]').on("change",function(){if(5<$('#passengers [type="checkbox"]:checked').length||
|
|
|
|
|
5<=$("#passenger_list li").length)return Public.alert("\u8054\u7cfb\u4eba\u6700\u591a\u53ea\u80fd\u9009\u62e9\u4e94\u4e2a"),$(this).prop("checked",!1),!1;var a=$(this),b=a.val();a.prop("checked")?OrderSubmit.passengerAdd(OrderSubmit.passengerObj[b]):$('#passenger_list [data-key="'+b+'"]').remove()});0<$("#passenger_list li").length&&$("#ordersubmit").click()},passenger:{},passengerAdd:function(a){var b="",b=Util.getAvailableTicketType(a),c=OrderSubmit.curData.ticketMap[OrderSubmit.curBuySeat],b='<li class="clearfix" data-key="'+
|
|
|
|
|
a.key+'" data-type="'+b[0].id+'" data-seat="'+c.code+'"><span class="pull_left"><strong>'+a.passenger_name+'</strong><span class="ticket">'+b[0].name+"</span><br>"+a.passenger_id_no+'</span><a href="javascript:;" data-fn="edit" class="pull_right"><span class="seat">'+c.name+" "+c.price/10+'\u5143</span> <i class="icon_edit"></i></a></li>';$("#passenger_list").append(b)},addChildren:function(a,b){var c=OrderSubmit.passengerObj[a],d=OrderSubmit.curData.ticketMap[b.attr("data-seat")];html=
|
|
|
|
|
'<li class="clearfix" data-children="true" data-key="'+c.passenger_name+"$"+c.passenger_id_type_code+"$"+c.passenger_id_no+'" data-type="2" data-seat="'+b.attr("data-seat")+'">\t\t\t\t<span class="pull_left"><strong>'+c.passenger_name+'</strong><span class="ticket">\u513f\u7ae5\u7968</span><br>'+c.passenger_id_no+'</span>\t\t\t\t<a href="javascript:;" data-fn="edit" class="pull_right">\t\t\t\t<span class="seat">'+d.name+" "+d.price/10+'\u5143</span> <i class="icon_edit"></i></a></li>';b.after(html)},
|
|
|
|
|
formatPassenger:function(a){for(var b=[],c={},d="",e=0;e<a.length;e++)Util.canPassageAddToOrder(a[e])&&(d=a[e].passenger_name+"$"+a[e].passenger_id_type_code+"$"+a[e].passenger_id_no,a[e].key=d,c[d]=a[e],b.push(a[e]));OrderSubmit.passengerList=b;OrderSubmit.passengerObj=c;sessionStorage.setItem("_passenger",JSON.stringify(b));sessionStorage.setItem("_passengerobj",JSON.stringify(c))},editKey:"",editEl:null,showLayer:function(){$("#layer").show()},hideLayer:function(){$("#layer").hide()},bindEvent:function(){var a=
|
|
|
|
|
$("#edit_menu");$('[data-fn="edit"]').live("click",function(b){b=$(this).closest("[data-key]");var c=b.attr("data-key");OrderSubmit.editKey=c;OrderSubmit.editEl=b;$("#passenger_editinfo").html(b.html());$('#passenger_editinfo [data-fn="edit"]').attr("data-fn","edit_close");$("#edit_menu").css({top:b.offset().top});b.attr("data-children")?($('[data-fn="children"]').closest("li").hide(),$('[data-fn="ticket"]').closest("li").hide()):($('[data-fn="children"]').closest("li").show(),$('[data-fn="ticket"]').closest("li").show());
|
|
|
|
|
a.show();OrderSubmit.showLayer()});$("#layer").live("click",function(){a.hide();$("#edit_ticket").hide();$("#edit_seat").hide();OrderSubmit.hideLayer()});a.live("click",function(a){a.stopPropagation();return!1});$('[data-fn="edit_close"]').live("click",function(b){a.hide();OrderSubmit.hideLayer()});$('[data-fn="remove"]').live("click",function(b){"2"==OrderSubmit.editEl.attr("data-type")?OrderSubmit.editEl.remove():($('#passenger_list [data-key="'+OrderSubmit.editKey+'"]').remove(),$('#passengers [value="'+
|
|
|
|
|
OrderSubmit.editKey+'"]').prop("checked",!1));delete OrderSubmit.passenger[OrderSubmit.editKey];a.hide();OrderSubmit.hideLayer()});$('[data-fn="children"]').live("click",function(b){4<$("#passenger_list li").length?Public.alert("\u8054\u7cfb\u4eba\u6700\u591a\u53ea\u80fd\u9009\u62e9\u4e94\u4e2a"):OrderSubmit.addChildren(OrderSubmit.editKey,OrderSubmit.editEl);a.hide();OrderSubmit.hideLayer()});$('[data-fn="seat"]').live("click",function(b){a.hide();OrderSubmit.hideLayer();OrderSubmit.setSeat()});
|
|
|
|
|
$("#edit_seat ul a").live("click",function(){var a=$(this).attr("data-id"),c=OrderSubmit.curData.ticketMap[a];OrderSubmit.editEl.attr("data-seat",a);$(".seat",OrderSubmit.editEl).html(c.name+" "+c.price/10+"\u5143");$("#edit_seat").hide();OrderSubmit.hideLayer()});$('[data-fn="ticket"]').live("click",function(b){a.hide();OrderSubmit.hideLayer();OrderSubmit.setTicket()});$("#edit_ticket a").live("click",function(){var a=$(this).attr("data-id"),c=$(this).html();OrderSubmit.editEl.attr("data-type",
|
|
|
|
|
a);$(".ticket",OrderSubmit.editEl).html(c);$("#edit_ticket").hide();OrderSubmit.hideLayer()});$("#ordersubmit").on("click",function(){var a=[];if(0==$("#passenger_list li").length)return Public.alert("\u8bf7\u6dfb\u52a0\u8054\u7cfb\u4eba"),!1;$("#passenger_list li").each(function(c,d){a[c]={};var e=OrderSubmit.passengerObj[$(this).attr("data-key")];a[c].seat=$(this).attr("data-seat");a[c].passenger_type=$(this).attr("data-type");a[c].passenger_id_type_code=e.passenger_id_type_code;a[c].passenger_id_no=
|
|
|
|
|
e.passenger_id_no;a[c].mobile_no=e.mobile_no;a[c].passenger_name=e.passenger_name});OrderSubmit.submit(a,OrderSubmit.curData,!1)});$('#code_layer .public_btns a[data-val="sure"]').live("click",function(){OrderSubmit.submitGo()});$('#code_layer .public_btns a[data-val="cancel"]').live("click",function(){$("#code_layer").hide()})},setSeat:function(){for(var a="",b,c=0,d=OrderSubmit.curData.ticketMapSort.length;c<d;c++)b=OrderSubmit.curData.ticketMapSort[c],a+='<li><a href="javascript:;" data-id="'+
|
|
|
|
|
b.code+'"><span class="pull_right text_gray"><span class="text_warning">'+b.count+'</span> \u5f20</span><span class="form_label">'+b.name+'</span><span class="text_gray">'+b.price/10+"\u5143</span></a></li>";$("#edit_seat ul").html(a);$("#edit_seat").show();OrderSubmit.showLayer()},setTicket:function(){for(var a=Util.getAvailableTicketType(OrderSubmit.passengerObj[OrderSubmit.editKey]),b="",c=0,d=a.length;c<d;c++)b+='<li><a href="javascript:;" data-id="'+a[c].id+'">'+a[c].name+"</a></li>";$("#edit_ticket ul").html(b);
|
|
|
|
@ -233,16 +235,15 @@ train_location:OrderSubmit.submitData.train_location,_json_att:OrderSubmit.submi
|
|
|
|
|
a.data.countT):a.data&&!a.data.submitStatus?Public.alert(a.data.errMsg||"\u672a\u77e5\u9519\u8bef"):(Public.alert("\u8ba2\u7968\u6210\u529f",function(){window.location.href="no_complete_order.html"}),$("#code_layer").hide())}).fail(function(){Public.hideLoading(OrderSubmit.loading);Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")})},errorCallback:function(a){Public.hideLoading(OrderSubmit.loading);-1!=a.indexOf("\u60a8\u8fd8\u6709\u672a\u5904\u7406\u7684\u8ba2\u5355")?
|
|
|
|
|
Public.alert('\u60a8\u8fd8\u6709\u672a\u5904\u7406\u7684\u8ba2\u5355\uff0c\u8bf7\u60a8\u5230<a href="no_complete_order.html">[\u672a\u5b8c\u6210\u8ba2\u5355]</a>\u8fdb\u884c\u5904\u7406!',function(){window.location.href="no_complete_order.html"}):Public.alert(a)}};var NoComplete={token:"",bankId:"",payLoading:null,curNo:"",init:function(){if(0==$("#no_complete_page").length)return!1;Public.checkLogin(NoComplete.getOrder);NoComplete.getToken();$("[data-no]").live("click",function(){NoComplete.curNo=$(this).attr("data-no");NoComplete.selectBank()});$('[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()})},getOrder:function(){bootStrap.get("queryOrder/queryMyOrderNoComplete","json",null,"queryOrder/initNoComplete").done(function(a){a.status&&(a.data&&a.data.orderDBList&&0<a.data.orderDBList.length)&&NoComplete.setHtml(a.data.orderDBList)}).fail(function(a,b){console.log(a,b)})},getToken:function(){bootStrap.post("queryOrder/initNoComplete","html",null,"payOrder/init").done(function(a){a.match(/\S+\s+globalRepeatSubmitToken\s+=\s+\S+/);eval(a.match(/\S+\s+globalRepeatSubmitToken\s+=\s+\S+/)[0]);
|
|
|
|
|
globalRepeatSubmitToken&&(NoComplete.token=globalRepeatSubmitToken)}).fail(function(){Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")})},setHtml:function(a){var b="",c=0;console.log(a);for(var d=0,e=a.length;d<e;d++){for(var b=b+('<div class="orders_title">\u8ba2\u5355\u53f7\uff1a'+a[d].sequence_no+"</div>"),b=b+'<div class="order_tickets">',c=(new Date(a[d].tickets[0].pay_limit_time.replace(/\-/gi,"/"))).getTime(),
|
|
|
|
|
f=0;f<a[d].tickets.length;f++)b+='<div class="ticket">',b+='<div class="ticket_title"><span class="pull_right">K2341</span>'+(new Date(a[d].start_train_date_page.replace(/\-/gi,"/"))).format("yyyy-M-d")+" "+(new Date(a[d].start_train_date_page.replace(/\-/gi,"/"))).day(3)+"</div>",b+='<div class="stations_info">',b+='<div class="station_info"><strong>'+a[d].from_station_name_page[0]+"</strong>"+a[d].start_time_page+"</div>",b+='<div class="station_info"><strong>'+a[d].to_station_name_page[0]+"</strong>"+
|
|
|
|
|
a[d].arrive_time_page+"</div>",b+="</div>",b+='<div class="ticket_passenger">',b+='<strong class="text_lg">'+a[d].tickets[f].passengerDTO.passenger_name+"</strong>",b+='<span class="text_gray">'+a[d].tickets[f].passengerDTO.passenger_id_no+"</span>",b+="</div>",b+='<div class="ticket_info"><span class="pull_right">'+a[d].tickets[f].str_ticket_price_page+"\u5143</span>",b+=a[d].tickets[f].ticket_type_name,b+=" "+a[d].tickets[f].seat_type_name,b+=" "+a[d].tickets[f].coach_name+"\u8f66",b+=a[d].tickets[f].seat_name,
|
|
|
|
|
b+="</div>",b+="</div>";b+="</div>";b+='<div class="order_pay_info">';b+='<p>\u5e2d\u4f4d\u5df2\u6210\u529f\u9501\u5b9a\uff0c\u8bf7\u60a8\u5728<strong class="pay_time" data-limittime="'+c+'" data-orderno="'+a[d].sequence_no+'"></strong>\u5185\u8fdb\u884c\u7f51\u4e0a\u652f\u4ed8\uff0c\u5426\u5219\u5e2d\u4f4d\u5c06\u81ea\u52a8\u91ca\u653e\u7ed9\u5176\u4ed6\u65c5\u5ba2\u3002</p>';b+='<div class="pay_info clearfix"><a href="javascript:;" class="btn btn_success pull_right" data-no="'+a[d].sequence_no+
|
|
|
|
|
'">\u7acb\u5373\u652f\u4ed8</a><span class="pay_money">'+a[d].ticket_total_price_page+"\u5143</span></div>";b+="</div>"}$("#orders").html(b);NoComplete.countdown()},countdown:function(){$("[data-limittime]").each(function(a,b){var c=$(b),d=c.attr("data-orderno"),e=(new Date(parseInt(c.attr("data-limittime")))).getTime()-(new Date).getTime();27E5<e?(c.closest("p").html("\u8ba2\u5355\u5df2\u8fc7\u671f"),$('[data-no="'+d+'"').html("\u8ba2\u5355\u5df2\u8fc7\u671f").addClass("btn_gray")):c.html(NoComplete.gm(e))});
|
|
|
|
|
setTimeout(NoComplete.countdown,1E3)},gm:function(a){var b=parseInt(a/6E4);a=parseInt(a%6E4/1E3);10>b&&(b="0"+b);10>a&&(a="0"+a);return b+":"+a},selectBank:function(){Public.showInnerPage("banks")},pay:function(a,b){var c={sequence_no:NoComplete.curNo,pay_flag:"pay",_json_att:"",REPEAT_SUBMIT_TOKEN:NoComplete.token};$("span",NoComplete.payLoading).html("\u6b63\u5728\u83b7\u53d6\u652f\u4ed8\u4fe1\u606f");bootStrap.post("queryOrder/continuePayNoCompleteMyOrder","json",c,"queryOrder/initNoComplete").done(function(a){a.status&&
|
|
|
|
|
("Y"==a.data.existError?Public.alert(a.data.errorMsg):bootStrap.post("payOrder/paycheck","json",{_json_att:""},"payOrder/init").done(function(a){NoComplete.submitPay(a.data.payForm)}).fail(function(){Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")}))}).fail(function(){Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")})},analyzeFormData:function(a){for(var b=
|
|
|
|
|
{},c=/<input[\s\w\W]*?(name|value)="([\s\w\W]*?)"[\s\w\W]*?(name|value)=['"]([\s\w\W]*?)['"][\s\w\W]*?\/?>/g,d=null;null!=(d=c.exec(a));)"name"==d[1]?b[d[2]]=d[4]:b[d[4]]=d[2];return b},submitPay:function(a){a={_json_att:"",interfaceName:a.interfaceName,interfaceVersion:a.interfaceVersion,tranData:a.tranData,merSignMsg:a.merSignMsg,appId:a.appId,transType:a.transType};$("span",NoComplete.payLoading).html("\u6b63\u5728\u63d0\u4ea4\u652f\u4ed8\u8bf7\u6c42");bootStrap.post("https://epay.12306.cn/pay/payGateway",
|
|
|
|
|
"html",a,"payOrder/init").done(function(a){a=NoComplete.analyzeFormData(a);a.bankId=NoComplete.bankId;bootStrap.post("https://epay.12306.cn/pay/webBusiness","html",a,"https://epay.12306.cn/pay/payGateway").done(function(a){NoComplete.analyzeFormData(a);a=a.replace(/[\n\t\r]/gi,"").replace(/>\s+</gi,"><").match(/<form.*\/form>/gi);0<a.length&&($("span",NoComplete.payLoading).html("\u6b63\u5728\u5411\u94f6\u884c\u63d0\u4ea4\u652f\u4ed8\u8bf7\u6c42"),$("#hideHtml").html(a[0]),setTimeout(function(){$('form[name="myform"]').submit()},
|
|
|
|
|
1E3))}).fail(function(){})}).fail(function(){Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")})}};var Remind={sellTime:null,loading:null,init:function(){if(0==$("#remind_page").length)return!1;Remind.deviceInfo=JSON.parse(bootStrap.device_info);Remind.deviceInfo?(Public.checkLogin(Remind.checkLoginCallback,Remind.checkLoginCallback,Remind.checkLoginCallback),Remind.sellTime=WIN.sellTime,Remind.dataInit(),Remind.staionInt(),$('.query_box [type="checkbox"]').on("change",function(){setTimeout(function(){Remind.checkSubmit()},50)}),$("#remind_form").on("submit",function(){Remind.remindSubmit();return!1})):
|
|
|
|
|
globalRepeatSubmitToken&&(NoComplete.token=globalRepeatSubmitToken)}).fail(function(){Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")})},setHtml:function(a){for(var b="",c=0,d=0,e=a.length;d<e;d++){for(var b=b+('<div class="orders_title">\u8ba2\u5355\u53f7\uff1a'+a[d].sequence_no+"</div>"),b=b+'<div class="order_tickets">',c=(new Date(a[d].tickets[0].pay_limit_time.replace(/\-/gi,"/"))).getTime(),f=0;f<a[d].tickets.length;f++)b+=
|
|
|
|
|
'<div class="ticket">',b+='<div class="ticket_title"><span class="pull_right">K2341</span>'+(new Date(a[d].start_train_date_page.replace(/\-/gi,"/"))).format("yyyy-M-d")+" "+(new Date(a[d].start_train_date_page.replace(/\-/gi,"/"))).day(3)+"</div>",b+='<div class="stations_info">',b+='<div class="station_info"><strong>'+a[d].from_station_name_page[0]+"</strong>"+a[d].start_time_page+"</div>",b+='<div class="station_info"><strong>'+a[d].to_station_name_page[0]+"</strong>"+a[d].arrive_time_page+"</div>",
|
|
|
|
|
b+="</div>",b+='<div class="ticket_passenger">',b+='<strong class="text_lg">'+a[d].tickets[f].passengerDTO.passenger_name+"</strong>",b+='<span class="text_gray">'+a[d].tickets[f].passengerDTO.passenger_id_no+"</span>",b+="</div>",b+='<div class="ticket_info"><span class="pull_right">'+a[d].tickets[f].str_ticket_price_page+"\u5143</span>",b+=a[d].tickets[f].ticket_type_name,b+=" "+a[d].tickets[f].seat_type_name,b+=" "+a[d].tickets[f].coach_name+"\u8f66",b+=a[d].tickets[f].seat_name,b+="</div>",b+=
|
|
|
|
|
"</div>";b+="</div>";b+='<div class="order_pay_info">';b+='<p>\u5e2d\u4f4d\u5df2\u6210\u529f\u9501\u5b9a\uff0c\u8bf7\u60a8\u5728<strong class="pay_time" data-limittime="'+c+'" data-orderno="'+a[d].sequence_no+'"></strong>\u5185\u8fdb\u884c\u7f51\u4e0a\u652f\u4ed8\uff0c\u5426\u5219\u5e2d\u4f4d\u5c06\u81ea\u52a8\u91ca\u653e\u7ed9\u5176\u4ed6\u65c5\u5ba2\u3002</p>';b+='<div class="pay_info clearfix"><a href="javascript:;" class="btn btn_success pull_right" data-no="'+a[d].sequence_no+'">\u7acb\u5373\u652f\u4ed8</a><span class="pay_money">'+
|
|
|
|
|
a[d].ticket_total_price_page+"\u5143</span></div>";b+="</div>"}$("#orders").html(b);NoComplete.countdown()},countdown:function(){$("[data-limittime]").each(function(a,b){var c=$(b),d=c.attr("data-orderno"),e=(new Date(parseInt(c.attr("data-limittime")))).getTime()-(new Date).getTime();27E5<e?(c.closest("p").html("\u8ba2\u5355\u5df2\u8fc7\u671f"),$('[data-no="'+d+'"').html("\u8ba2\u5355\u5df2\u8fc7\u671f").addClass("btn_gray")):c.html(NoComplete.gm(e))});setTimeout(NoComplete.countdown,1E3)},gm:function(a){var b=
|
|
|
|
|
parseInt(a/6E4);a=parseInt(a%6E4/1E3);10>b&&(b="0"+b);10>a&&(a="0"+a);return b+":"+a},selectBank:function(){Public.showInnerPage("banks")},pay:function(a,b){var c={sequence_no:NoComplete.curNo,pay_flag:"pay",_json_att:"",REPEAT_SUBMIT_TOKEN:NoComplete.token};$("span",NoComplete.payLoading).html("\u6b63\u5728\u83b7\u53d6\u652f\u4ed8\u4fe1\u606f");bootStrap.post("queryOrder/continuePayNoCompleteMyOrder","json",c,"queryOrder/initNoComplete").done(function(a){a.status&&("Y"==a.data.existError?Public.alert(a.data.errorMsg):
|
|
|
|
|
bootStrap.post("payOrder/paycheck","json",{_json_att:""},"payOrder/init").done(function(a){NoComplete.submitPay(a.data.payForm)}).fail(function(){Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")}))}).fail(function(){Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")})},analyzeFormData:function(a){for(var b={},c=/<input[\s\w\W]*?(name|value)="([\s\w\W]*?)"[\s\w\W]*?(name|value)=['"]([\s\w\W]*?)['"][\s\w\W]*?\/?>/g,
|
|
|
|
|
d=null;null!=(d=c.exec(a));)"name"==d[1]?b[d[2]]=d[4]:b[d[4]]=d[2];return b},submitPay:function(a){a={_json_att:"",interfaceName:a.interfaceName,interfaceVersion:a.interfaceVersion,tranData:a.tranData,merSignMsg:a.merSignMsg,appId:a.appId,transType:a.transType};$("span",NoComplete.payLoading).html("\u6b63\u5728\u63d0\u4ea4\u652f\u4ed8\u8bf7\u6c42");bootStrap.post("https://epay.12306.cn/pay/payGateway","html",a,"payOrder/init").done(function(a){a=NoComplete.analyzeFormData(a);a.bankId=NoComplete.bankId;
|
|
|
|
|
bootStrap.post("https://epay.12306.cn/pay/webBusiness","html",a,"https://epay.12306.cn/pay/payGateway").done(function(a){NoComplete.analyzeFormData(a);a=a.replace(/[\n\t\r]/gi,"").replace(/>\s+</gi,"><").match(/<form.*\/form>/gi);0<a.length&&($("span",NoComplete.payLoading).html("\u6b63\u5728\u5411\u94f6\u884c\u63d0\u4ea4\u652f\u4ed8\u8bf7\u6c42"),$("#hideHtml").html(a[0]),setTimeout(function(){$('form[name="myform"]').submit()},1E3))}).fail(function(){})}).fail(function(){Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")})}};var Remind={sellTime:null,loading:null,init:function(){if(0==$("#remind_page").length)return!1;Remind.deviceInfo=JSON.parse(bootStrap.device_info);Remind.deviceInfo?(Public.checkLogin(Remind.checkLoginCallback,Remind.checkLoginCallback,Remind.checkLoginCallback),Remind.sellTime=WIN.sellTime,Remind.dataInit(),Remind.staionInt(),$('.query_box [type="checkbox"]').on("change",function(){setTimeout(function(){Remind.checkSubmit()},50)}),$("#remind_form").on("submit",function(){Remind.remindSubmit();return!1})):
|
|
|
|
|
Public.alert("\u8ba2\u9605\u529f\u80fd\u4ec5\u8bf7\u4f7f\u7528\u624b\u673a\u730e\u8c79\u6d4f\u89c8\u5668",function(){window.history.back()})},checkLoginCallback:function(){},dataInit:function(){var a=(new Date).addDays(49);Public.setDate(a);Public.calendar.setSection((new Date).addDays(20),29);Public.calendar.checkCallback=Remind.dateChangeCallback;Public.calendar.setBasic()},dateChangeCallback:function(a){a=a.date.getTime();a>=Public.calendar.minDate.date.getTime()&&a<=Public.calendar.maxDate.date.getTime()&&
|
|
|
|
|
($("#date_tip").hide(),Public.hideInnerPage("date_box"),$("#start_date").html(Public.calendar.curDate.format(Public.formatString)+" "+Public.calendar.curDate.day(3)),$("#start_date_val").val(Public.calendar.curDate.format("yyyy-MM-dd")))},staionInt:function(){CheckStaion.init();$("#startStation").on("click",function(){CheckStaion.callback=Remind.startCallback;CheckStaion.cancelCallback=Remind.cancelCallback;CheckStaion.show();$("#wrap").hide()});$("#endStation").on("click",function(){CheckStaion.callback=
|
|
|
|
|
Remind.endCallback;CheckStaion.cancelCallback=Remind.cancelCallback;CheckStaion.show();$("#wrap").hide()});$("#exchange").on("click",function(){var a=$("#startStationName").val(),b=$("#startStationCode").val(),c=$("#endStationName").val(),d=$("#endStationCode").val();$("#startStationName").val(c);$("#startStationCode").val(d);$("#endStationName").val(a);$("#endStationCode").val(b);a?$("#endStation").html(a):$("#endStation").html("\u5230\u8fbe\u7ad9");c?$("#startStation").html(c):$("#startStation").html("\u51fa\u53d1\u7ad9");
|
|
|
|
|