|
|
|
@ -51,7 +51,7 @@ html:u,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0};a.aj
|
|
|
|
|
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;
|
|
|
|
|
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,f=b.split(/\s/),g;b=l(b,c,d);var h=b.success;1<f.length&&(b.url=f[0],g=f[1]);b.success=function(b){e.html(g?a("<div>").html(b.replace(r,"")).find(g):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},
|
|
|
|
|
remove:function(){m&&a.each(arguments,function(b,c){for(var d;-1<(d=a.inArray(c,m,d));)m.splice(d,1),e&&(d<=g&&--g,d<=n&&--n)});return this},has:function(b){return!(!m||!(b?-1<a.inArray(b,m):m.length))},empty:function(){g=m.length=0;return this},disable:function(){m=k=c=void 0;return this},disabled:function(){return!m},lock:function(){k=void 0;c||l.disable();return this},locked:function(){return!k},fireWith:function(a,b){if(m&&(!d||k))b=b||[],b=[a,b.slice?b.slice():b],e?k.push(b):z(b);return this},
|
|
|
|
@ -72,31 +72,31 @@ function n(a){var b,c={originalEvent:a};for(b in a)!D.test(b)&&a[b]!==k&&(c[b]=a
|
|
|
|
|
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]=
|
|
|
|
|
c;return this.each(function(){"dispatchEvent"in this?this.dispatchEvent(b):a(this).triggerHandler(b,c)})};a.fn.triggerHandler=function(b,d){var e,f;this.each(function(g,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){f=b.proxy(e);if(e.isImmediatePropagationStopped())return!1})});return f};"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(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,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 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"!==
|
|
|
|
|
(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,f){if(e.style[a+"TransitionProperty"]!==b)return c="-"+a.toLowerCase()+"-",d=f,!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,f,g){a.isFunction(d)&&(f=d,d=e=b);a.isFunction(e)&&(f=e,e=b);a.isPlainObject(d)&&(e=d.easing,f=d.complete,g=d.delay,d=d.duration);d&&(d=("number"==typeof d?d:a.fx.speeds[d]||a.fx.speeds._default)/1E3);g&&(g=parseFloat(g)/1E3);return this.anim(c,
|
|
|
|
|
d,e,f,g)};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===
|
|
|
|
|
(function(a,b){function c(c,d,e,f,g){"function"==typeof d&&!g&&(g=d,d=b);e={opacity:e};f&&(e.scale=f,c.css(a.fx.cssPrefix+"transform-origin","0 0"));return c.animate(e,d,null,g)}function d(b,d,e,g){return c(b,d,0,e,function(){f.call(a(this));g&&g.call(this)})}var e=a.fn.show,f=a.fn.hide,g=a.fn.toggle;a.fn.show=function(a,d){e.call(this);a===b?a=0:this.css("opacity",0);return c(this,a,1,"1,1",d)};a.fn.hide=function(a,c){return a===b?f.call(this):d(this,a,"0,0",c)};a.fn.toggle=function(c,d){return c===
|
|
|
|
|
b||"boolean"==typeof c?g.call(this,c):this.each(function(){var b=a(this);b["none"==b.css("display")?"show":"hide"](c,d)})};a.fn.fadeTo=function(a,b,d){return c(this,a,b,null,d)};a.fn.fadeIn=function(a,b){var c=this.css("opacity");0<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);
|
|
|
|
|
(function(a){if(a.os.ios){var b={};a(document).bind("gesturestart",function(a){var d=Date.now();b.target="tagName"in a.target?a.target:a.target.parentNode;b.e1=a.scale;b.last=d}).bind("gesturechange",function(a){b.e2=a.scale}).bind("gestureend",function(c){0<b.e2?(0!=Math.abs(b.e1-b.e2)&&a(b.target).trigger("pinch")&&a(b.target).trigger("pinch"+(0<b.e1-b.e2?"In":"Out")),b.e1=b.e2=b.last=0):"last"in b&&(b={})});["pinch","pinchIn","pinchOut"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,
|
|
|
|
|
a)}})}})(Zepto);(function(a){"__proto__"in{}||a.extend(a.zepto,{Z:function(b,c){b=b||[];a.extend(b,a.fn);b.selector=c||"";b.__Z=!0;return b},isZ:function(b){return"array"===a.type(b)&&"__Z"in b}});try{getComputedStyle(void 0)}catch(b){var c=getComputedStyle;window.getComputedStyle=function(a){try{return c(a)}catch(b){return null}}}})(Zepto);
|
|
|
|
|
(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,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);
|
|
|
|
|
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,f){return c(f,function(c,g,s){try{var q;!c&&g?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",
|
|
|
|
|
f),r;}finally{q&&q.removeClass(k)}return!g?n:d.uniq(a.map(n,function(a,b){return g.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;(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)}}});window.onbeforeunload=function(){Client.refreshEnd()};
|
|
|
|
|
var Public={init:function(){Public.setHis();cn12306.getLocalTrainNos();CheckStaion.formatStation();$("#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)}}});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>':
|
|
|
|
@ -147,8 +147,8 @@ DateComponent.prototype.monthPrev=function(){var a=this.pageCurMonth-1,b;0>a?(a=
|
|
|
|
|
DateComponent.prototype.monthNext=function(){this.pageCurMonth++;11<this.pageCurMonth?(this.pageCurMonth=0,this.pageCurDate=new Date(this.pageCurDate.getFullYear()+1,this.pageCurMonth,1,0,0,0)):this.pageCurDate=new Date(this.pageCurDate.getFullYear(),this.pageCurMonth,1,0,0,0);this.setBasic()};
|
|
|
|
|
DateComponent.prototype.dayPrev=function(){var a=new Date(this.curDate.getTime()-864E5);if(a.date.getTime()<this._TODAY.date.getTime())return this.curDate;this.curDate=a;this.pageCurDate=new Date(this.curDate.getFullYear(),this.curDate.getMonth(),1,0,0,0);this.pageCurMonth=this.pageCurDate.getMonth();this.setBasic();return this.curDate};
|
|
|
|
|
DateComponent.prototype.dayNext=function(){var a=new Date(this.curDate.getTime()+864E5);if(a.date.getTime()>this.maxDate.date.getTime())return this.curDate;this.curDate=a;this.pageCurDate=new Date(this.curDate.getFullYear(),this.curDate.getMonth(),1,0,0,0);this.pageCurMonth=this.pageCurDate.getMonth();this.setBasic();return this.curDate};DateComponent.prototype.setSection=function(a,b){this.minDate=a;this.maxDate=this.minDate.addDays(b)};
|
|
|
|
|
DateComponent.prototype.setMinDay=function(a){this.minDate=a};DateComponent.prototype.setMaxDay=function(a){this.maxDate=a};var CheckStaion={runing:!1,objs:{a:[],b:[],c:[],d:[],e:[],f:[],g:[],h:[],i:[],j:[],k:[],l:[],m:[],n:[],o:[],p:[],q:[],r:[],s:[],t:[],u:[],v:[],w:[],x:[],y:[],z:[]},objsZh:{},hotList:[],callback:null,init:function(){if(CheckStaion.runing)return!1;CheckStaion.runing=!0;CheckStaion.formatStation();CheckStaion.setHtml();CheckStaion.bindEvent()},formatStation:function(){CheckStaion.names=WIN.station_names.substr(1);CheckStaion.stationList=CheckStaion.names.split("@");for(var a="",b=[],c=0;c<CheckStaion.stationList.length;c++)a=
|
|
|
|
|
CheckStaion.stationList[c][0].toLowerCase(),CheckStaion.objs[a]||(CheckStaion.objs[a]=[]),b=CheckStaion.stationList[c].split("|"),CheckStaion.objs[a].push(b),a=b[1][0],CheckStaion.objsZh[a]||(CheckStaion.objsZh[a]=[]),CheckStaion.objsZh[a].push(b);CheckStaion.hotList=WIN.favorite_names.substr(1).split("@")},setHtml:function(){var a='<div class="fixed_box" id="search_station"><header class="header"><div class="search_box"><a href="javascript:;" class="search_cancel" id="station_cancel">\u53d6\u6d88</a><div class="search_ipt"><input type="search" name="" placeholder="\u641c\u7d22\u8f66\u7ad9" id="station_search" class="search_input" autocomplete="off"><i class="icon_remove_s"></i></div></div></header>';
|
|
|
|
|
DateComponent.prototype.setMinDay=function(a){this.minDate=a};DateComponent.prototype.setMaxDay=function(a){this.maxDate=a};var CheckStaion={runing:!1,objs:{a:[],b:[],c:[],d:[],e:[],f:[],g:[],h:[],i:[],j:[],k:[],l:[],m:[],n:[],o:[],p:[],q:[],r:[],s:[],t:[],u:[],v:[],w:[],x:[],y:[],z:[]},objsZh:{},hotList:[],zhObj:{},callback:null,init:function(){if(CheckStaion.runing)return!1;CheckStaion.runing=!0;CheckStaion.formatStation();CheckStaion.setHtml();CheckStaion.bindEvent()},formated:!1,formatStation:function(){if(!CheckStaion.formated){CheckStaion.formated=!0;CheckStaion.names=WIN.station_names.substr(1);CheckStaion.stationList=
|
|
|
|
|
CheckStaion.names.split("@");for(var a="",b=[],c=0;c<CheckStaion.stationList.length;c++)a=CheckStaion.stationList[c][0].toLowerCase(),CheckStaion.objs[a]||(CheckStaion.objs[a]=[]),b=CheckStaion.stationList[c].split("|"),CheckStaion.objs[a].push(b),a=b[1][0],CheckStaion.objsZh[a]||(CheckStaion.objsZh[a]=[]),CheckStaion.objsZh[a].push(b),CheckStaion.zhObj[b[1]]=b;CheckStaion.hotList=WIN.favorite_names.substr(1).split("@")}},setHtml:function(){var a='<div class="fixed_box" id="search_station"><header class="header"><div class="search_box"><a href="javascript:;" class="search_cancel" id="station_cancel">\u53d6\u6d88</a><div class="search_ipt"><input type="search" name="" placeholder="\u641c\u7d22\u8f66\u7ad9" id="station_search" class="search_input" autocomplete="off"><i class="icon_remove_s"></i></div></div></header>';
|
|
|
|
|
if(0<CheckStaion.hotList.length){for(var b=[],a=a+'<div class="form_title">\u70ed\u95e8</div><div class="box"><ul class="station_list">',c=0,d=CheckStaion.hotList.length;c<d;c++)b=CheckStaion.hotList[c].split("|"),a+='<li><a href="javascript:;" title="'+b[1]+'" data-code="'+b[2]+'">'+b[1]+"</a></li>";a+='</ul></div><div class="suggest" id="station_suggest"><ul></ul></div></div>'}$("body").append(a)},show:function(){$("#search_station").addClass("fixed_box_show")},hide:function(){$("#search_station").removeClass("fixed_box_show")},
|
|
|
|
|
bindEvent:function(){$("#station_cancel").on("click",function(){CheckStaion.hide();CheckStaion.cancelCallback&&CheckStaion.cancelCallback()});$("#station_search").on("input",function(){var a=$(this).val();$.trim(a)?CheckStaion.showSuggest(CheckStaion.searchKey($.trim(a).toLowerCase())):($("#station_suggest ul").html(""),$("#station_suggest").hide())});$("#search_station [data-code]").live("click",function(a,b){var c=$(this).attr("title"),d=$(this).attr("data-code");CheckStaion.callback&&CheckStaion.callback(c,
|
|
|
|
|
d);$("#station_suggest ul").html("");$("#station_suggest").hide();$("#station_search").val("")})},showSuggest:function(a){if(!a||0==a.length)$("#station_suggest ul").html(""),$("#station_suggest").hide();else{for(var b="",c=0,d=a.length;c<d;c++)b+='<li><a href="javascript:;" title="'+a[c][1]+'" data-code="'+a[c][2]+'">'+a[c][1]+"</a></li>";$("#station_suggest ul").html(b);$("#station_suggest").show()}},getSuggestList:function(a){return!a?[]:/^[\u4E00-\u9FA5]+$/.test(a[0])?CheckStaion.searchKeyZh(a):
|
|
|
|
@ -184,28 +184,31 @@ $("#filter_cancel").on("click",function(){Public.hideInnerPage("filter");var a=$
|
|
|
|
|
"curBuy",JSON.stringify(RunQuery.trainData.trainMap[a]));sessionStorage.setItem(Public.user+"curBuySeat",c);Public.isLogin?location.href="perfect.html":Public.alert("\u8fd8\u672a\u767b\u5f55\uff0c\u8bf7\u767b\u9646\u540e\u8d2d\u7968",function(){location.href="login.html?t=submitorder"})});$("#autoTipBtn").live("click",function(){Public.isLogin?RunQuery.startRef():window.location.href="login.html"});$("#refresh_end").live("click",function(){RunQuery.refStop()})},run:function(){Query.getPassenger();
|
|
|
|
|
RunQuery.getQueryData();if(!RunQuery.curData)return window.location.href="query.html",!1;RunQuery.setFilter();RunQuery.queryTicket();Query.filterBind()},curData:null,getQueryData:function(){Public.his.queryObjs[Public.his.querys[0][0]]&&(RunQuery.curData=Public.his.queryObjs[Public.his.querys[0][0]])},setFilter:function(){Query.setFilter(RunQuery.curData.filters.split("&"));$(".station_title strong").html(RunQuery.curData.startname+"\u2192"+RunQuery.curData.endname);$("#query_form [name=startname]").val(RunQuery.curData.startname);
|
|
|
|
|
$("#query_form [name=startcode]").val(RunQuery.curData.startcode);$("#query_form [name=endname]").val(RunQuery.curData.endname);$("#query_form [name=endcode]").val(RunQuery.curData.endcode);$("#query_form [name=type]").val(RunQuery.curData.type);$("#query_form [name=filters]").val(RunQuery.curData.filters);var a=new Date(RunQuery.curData.start_date.replace(/\-/g,"/"));$("#start_date").html(a.format("M\u6708d\u65e5")+" "+a.day(3));$("#start_date_val").val(a.format("yyyy-MM-dd"));Public.calendar.setCurDate(a);
|
|
|
|
|
RunQuery.setFilterCond()},queryTicket:function(){var a=Public.showLoading("\u6b63\u5728\u67e5\u7968");cn12306.queryTicket({"leftTicketDTO.train_date":RunQuery.curData.start_date,"leftTicketDTO.from_station":RunQuery.curData.startcode,"leftTicketDTO.to_station":RunQuery.curData.endcode,purpose_codes:"2"==RunQuery.curData.type?"0X00":"ADULT"},function(b){Public.hideLoading(a);!0==b.status&&200==b.httpstatus?0<b.data.length&&(RunQuery.formatJson(b),RunQuery.formatList()):!b.status&&b.messages?Public.alert(b.messages[0]||
|
|
|
|
|
"\u672a\u77e5\u9519\u8bef"):Public.alert("\u672a\u77e5\u9519\u8bef")},function(b,c){console.log(b,c);Public.hideLoading(a)})},formatList:function(){var a=RunQuery.trainData.train,b="",c={};RunQuery.trainData.isMaintain&&(a=RunQuery.trainData.trainMap);for(var d in a){c=a[d];b+="<li>";b+='<div class="line no_border">';b+='<strong class="pull_right text_underline text_lg" data-id="'+c.id+'">'+c.code+"</strong>";b+='<strong class="text_warning text_lg link_label">'+c.from.time+"</strong>";b+='<span class="text_lg">';
|
|
|
|
|
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(){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;
|
|
|
|
|
RunQuery.setFilterCond()},queryTicket:function(){var a=Public.showLoading("\u6b63\u5728\u67e5\u7968");cn12306.queryTicket({"leftTicketDTO.train_date":RunQuery.curData.start_date,"leftTicketDTO.from_station":RunQuery.curData.startcode,"leftTicketDTO.to_station":RunQuery.curData.endcode,purpose_codes:"2"==RunQuery.curData.type?"0X00":"ADULT"},function(b){Public.hideLoading(a);if(!0==b.status&&200==b.httpstatus){if(0<b.data.length){RunQuery.trainData=RunQuery.formatJson(b);if("undefined"!=typeof RunQuery.filterCond.train)for(b=
|
|
|
|
|
0;b<RunQuery.filterCond.train.length;b++)"undefined"==typeof RunQuery.trainData.codeMap[RunQuery.filterCond.train[b]]&&(RunQuery.filterCond.train.splice(b,1),b--);RunQuery.filterJson();RunQuery.formatList()}}else!b.status&&b.messages?Public.alert(b.messages[0]||"\u672a\u77e5\u9519\u8bef"):Public.alert("\u672a\u77e5\u9519\u8bef")},function(b,c){console.log(b,c);Public.hideLoading(a)})},formatList:function(){var a=RunQuery.trainData.train,b="",c={};RunQuery.trainData.isMaintain&&(a=RunQuery.trainData.trainMap);
|
|
|
|
|
for(var d in a){c=a[d];b+="<li>";b+='<div class="line no_border">';b+='<strong class="pull_right text_underline text_lg" data-id="'+c.id+'">'+c.code+"</strong>";b+='<strong class="text_warning text_lg link_label">'+c.from.time+"</strong>";b+='<span class="text_lg">';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(){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"));return d},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,b){var c={};b=b||RunQuery.filterCond.train;if("undefined"==typeof b||0==b.length)return a;for(var d in a)-1!=b.indexOf(a[d].code)&&(c[d]=a[d]);return c},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||
|
|
|
|
|
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"},getRec:function(){var a={},b=RunQuery.trainData.trainMap;a.key="stupid360";a.from=$("#startStationCode").val();a.to=$("#endStationCode").val();
|
|
|
|
|
a.date=$("#start_date_val").val();a.stops={};for(var c in b)a.stops[b[c].code]={},a.stops[b[c].code].info=b[c],a.stops[b[c].code].stops=cn12306.byTrainNos[c];a=JSON.stringify(a);(0,eval)("this").v=a;$.ajax({type:"POST",url:"http://12306.fishlee.net/ts?key=stupid360&r="+Math.random(),data:{data:a},success:function(a){a.groups&&0<a.groups.length&&RunQuery.setRec(a.groups);console.log(a)},error:function(a,b){}})},setRec:function(a){if(a&&0!=a.length){var b=[];$("#start_date_val").val();var c="2"==RunQuery.curData.type?
|
|
|
|
|
"0X00":"ADULT",d="",e;console.log(a);for(var f=0;f<a.length;f++)if(CheckStaion.zhObj[a[f].fromText]&&CheckStaion.zhObj[a[f].toText]){e={};for(var g=0;g<a[f].lines.length;g++)d=a[f].date,a[f][g].isCrossDate&&(d=a[f].lines.j.form.date.split("T")[0]),e[d]||(e[d]={},e[d].filterTicket=[],e[d].queryData={"leftTicketDTO.from_station":CheckStaion.zhObj[a[f].fromText],"leftTicketDTO.to_station":CheckStaion.zhObj[a[f].toText],"leftTicketDTO.train_date":d,purpose_codes:c}),e[d].filterTicket.push(a[f].j.trainCode);
|
|
|
|
|
b.push(e)}console.log(b)}},queryRec:function(){cn12306.queryTicket({"leftTicketDTO.train_date":RunQuery.curData.start_date,"leftTicketDTO.from_station":RunQuery.curData.startcode,"leftTicketDTO.to_station":RunQuery.curData.endcode,purpose_codes:"2"==RunQuery.curData.type?"0X00":"ADULT"},function(a){Public.hideLoading(loading);if(!0==a.status&&200==a.httpstatus&&0<a.data.length){RunQuery.trainData=RunQuery.formatJson(a);if("undefined"!=typeof RunQuery.filterCond.train)for(a=0;a<RunQuery.filterCond.train.length;a++)"undefined"==
|
|
|
|
|
typeof RunQuery.trainData.codeMap[RunQuery.filterCond.train[a]]&&(RunQuery.filterCond.train.splice(a,1),a--);RunQuery.filterJson();RunQuery.formatList()}},function(a,b){console.log(a,b)})}};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&&
|
|
|
|
@ -233,17 +236,18 @@ _json_att:OrderSubmit.submitData._json_att},"leftTicket/init").done(function(a){
|
|
|
|
|
cn12306.recode(),$("#code_layer").show())}).fail(function(){Public.hideLoading(OrderSubmit.loading);Public.alert({msg:"12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5.."})})},submitGo:function(){var a={passengerTicketStr:OrderSubmit.submitData.passengerTicketStr,oldPassengerStr:OrderSubmit.submitData.oldPassengerStr,purpose_codes:OrderSubmit.submitData.purpose_codes,key_check_isChange:OrderSubmit.submitData.key_check_isChange,leftTicketStr:OrderSubmit.submitData.leftTicketStr,
|
|
|
|
|
train_location:OrderSubmit.submitData.train_location,_json_att:OrderSubmit.submitData._json_att,randCode:$("#randcode").val()};bootStrap.post("confirmPassenger/confirmSingleForQueueAsys",null,a,"leftTicket/init").done(function(a){Public.hideLoading(OrderSubmit.loading);!a||!a.status||!a.data?Public.alert(a.messages[0]||"\u672a\u77e5\u9519\u8bef"):a.data.isRelogin?Public.alert("\u767b\u5f55\u72b6\u6001\u5f02\u5e38\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55\u3002"):"true"===a.data.op_2?Public.alert("\u6392\u961f\u4eba\u6570\u8fc7\u591a\uff0c\u4e0d\u5141\u8bb8\u63d0\u4ea4\u8ba2\u5355\u3002\u6392\u961f\u4eba\u6570="+
|
|
|
|
|
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");
|
|
|
|
|
Public.alert('\u60a8\u8fd8\u6709\u672a\u5904\u7406\u7684\u8ba2\u5355\uff0c\u8bf7\u60a8\u5230<br/><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){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})):
|
|
|
|
|
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)),$(".pay_tip_info .text_warning").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");
|
|
|
|
|