2014-09-01 18:04:39 +08:00
/*! liebao-debug-luolei 2014-09-01-5 */
function FastClick ( a ) { "use strict" ; var b , c = this ; if ( this . trackingClick = ! 1 , this . trackingClickStart = 0 , this . targetElement = null , this . touchStartX = 0 , this . touchStartY = 0 , this . lastTouchIdentifier = 0 , this . touchBoundary = 10 , this . layer = a , ! a || ! a . nodeType ) throw new TypeError ( "Layer must be a document node" ) ; this . onClick = function ( ) { return FastClick . prototype . onClick . apply ( c , arguments ) } , this . onMouse = function ( ) { return FastClick . prototype . onMouse . apply ( c , arguments ) } , this . onTouchStart = function ( ) { return FastClick . prototype . onTouchStart . apply ( c , arguments ) } , this . onTouchEnd = function ( ) { return FastClick . prototype . onTouchEnd . apply ( c , arguments ) } , this . onTouchCancel = function ( ) { return FastClick . prototype . onTouchCancel . apply ( c , arguments ) } , FastClick . notNeeded ( a ) || ( this . deviceIsAndroid && ( a . addEventListener ( "mouseover" , this . onMouse , ! 0 ) , a . addEventListener ( "mousedown" , this . onMouse , ! 0 ) , a . addEventListener ( "mouseup" , this . onMouse , ! 0 ) ) , a . addEventListener ( "click" , this . onClick , ! 0 ) , a . addEventListener ( "touchstart" , this . onTouchStart , ! 1 ) , a . addEventListener ( "touchend" , this . onTouchEnd , ! 1 ) , a . addEventListener ( "touchcancel" , this . onTouchCancel , ! 1 ) , Event . prototype . stopImmediatePropagation || ( a . removeEventListener = function ( b , c , d ) { var e = Node . prototype . removeEventListener ; "click" === b ? e . call ( a , b , c . hijacked || c , d ) : e . call ( a , b , c , d ) } , a . addEventListener = function ( b , c , d ) { var e = Node . prototype . addEventListener ; "click" === b ? e . call ( a , b , c . hijacked || ( c . hijacked = function ( a ) { a . propagationStopped || c ( a ) } ) , d ) : e . call ( a , b , c , d ) } ) , "function" == typeof a . onclick && ( b = a . onclick , a . addEventListener ( "click" , function ( a ) { b ( a ) } , ! 1 ) , a . onclick = null ) ) } function DateDifference ( a ) { return this . TicksCount = a , this . getSeconds = function ( ) { return this . TicksCount / 1e3 } , this . getMinutes = function ( ) { return this . getSeconds ( ) / 60 } , this . getHours = function ( ) { return this . getMinutes ( ) / 60 } , this . getDays = function ( ) { return this . getHours ( ) / 24 } , this . getYears = function ( ) { return this . getDays ( ) / 365 } , this } function asDate ( a ) { return /\/Date\((\d+)\)\//i . exec ( a ) ? new Date ( parseInt ( RegExp . $1 ) ) : /(\d+)-0*(\d+)-0*(\d+)T0*(\d+):0*(\d+):0*(\d+)/i . exec ( a ) ? new Date ( parseInt ( RegExp . $1 ) , parseInt ( RegExp . $2 ) - 1 , parseInt ( RegExp . $3 ) , parseInt ( RegExp . $4 ) , parseInt ( RegExp . $5 ) , parseInt ( RegExp . $6 ) ) : /(\d{4})-0?(\d{1,2})-0?(\d{1,2})/ . exec ( a ) ? new Date ( RegExp . $1 , RegExp . $2 - 1 , RegExp . $3 ) : new Date ( a ) } function DateComponent ( a ) { var b = { _TODAY : ( new Date ) . date , wrap : $ ( "#date" ) , tdHtml : '<td><a href="javascript:;" class="$class$$isCheckClass$" data-time="$time$">$day$<span class="lunar">$lunar$</span></a></td>' , curDate : ( new Date ) . date , startDate : ( new Date ) . date , minDate : ( new Date ) . date , maxDate : ( new Date ) . date . addDays ( 19 ) , arr : [ ] } ; $ . extend ( this , b ) , "object" == typeof a && $ . extend ( this , a ) , this . fd = this . curDate . format ( "yyyy年 MM月" ) , this . pageCurDate = new Date ( this . curDate . getFullYear ( ) , this . curDate . getMonth ( ) , 1 , 0 , 0 , 0 ) , this . pageCurMonth = this . curDate . getMonth ( ) , this . generateArray ( ) , this . setHtml ( ) } FastClick . prototype . deviceIsAndroid = navigator . userAgent . indexOf ( "Android" ) > 0 , FastClick . prototype . deviceIsIOS = /iP(ad|hone|od)/ . test ( navigator . userAgent ) , FastClick . prototype . deviceIsIOS4 = FastClick . prototype . deviceIsIOS && /OS 4_\d(_\d)?/ . test ( navigator . userAgent ) , FastClick . prototype . deviceIsIOSWithBadTarget = FastClick . prototype . deviceIsIOS && /OS ([6-9]|\d{2})_\d/ . test ( navigator . userAgent ) , FastClick . prototype . needsClick = function ( a ) { "use strict" ; switch ( a . nodeName . toLowerCase ( ) ) { case "button" : case "select" : case "textarea" : if ( a . disabled ) return ! 0 ; break ; case "input" : if ( this . deviceIsIOS && "file" === a . type || a . disabled ) return ! 0 ; break ; case "label" : case "video" : return ! 0 } return /\bneedsclick\b/ . test ( a . className ) } , FastClick . prototype . needsFocus = function ( a ) { "use strict" ; switch ( a . nodeName . toLowerCase ( ) ) { case "textarea" : case "select" : return ! 0 ; case "input" : switch ( a . type ) { case "button" : case "checkbox" : case "file" : case "image" : case "radio" : case "submit" : return ! 1 } return ! a . disabled && ! a . readOnly ; default : return /\bneedsfocus\b/ . test ( a . className ) } } , FastClick . prototype . sendClick = function ( a , b ) { "use strict" ; var c , d ; document . activeElement && document . activeElement !== a && document . activeElement . blur ( ) , d = b . changedTouches [ 0 ] , c = document . createEvent ( "MouseEvents" ) , c . initMouse
} , a . Deferred = b } ( Zepto ) , function ( a ) { function b ( a ) { var b = this . os = { } , c = this . browser = { } , d = a . match ( /Web[kK]it[\/]{0,1}([\d.]+)/ ) , e = a . match ( /(Android);?[\s\/]+([\d.]+)?/ ) , f = ! ! a . match ( /\(Macintosh\; Intel / ) , g = a . match ( /(iPad).*OS\s([\d_]+)/ ) , h = a . match ( /(iPod)(.*OS\s([\d_]+))?/ ) , i = ! g && a . match ( /(iPhone\sOS)\s([\d_]+)/ ) , j = a . match ( /(webOS|hpwOS)[\s\/]([\d.]+)/ ) , k = a . match ( /Windows Phone ([\d.]+)/ ) , l = j && a . match ( /TouchPad/ ) , m = a . match ( /Kindle\/([\d.]+)/ ) , n = a . match ( /Silk\/([\d._]+)/ ) , o = a . match ( /(BlackBerry).*Version\/([\d.]+)/ ) , p = a . match ( /(BB10).*Version\/([\d.]+)/ ) , q = a . match ( /(RIM\sTablet\sOS)\s([\d.]+)/ ) , r = a . match ( /PlayBook/ ) , s = a . match ( /Chrome\/([\d.]+)/ ) || a . match ( /CriOS\/([\d.]+)/ ) , t = a . match ( /Firefox\/([\d.]+)/ ) , u = a . match ( /MSIE\s([\d.]+)/ ) || a . match ( /Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/ ) , v = ! s && a . match ( /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/ ) , w = v || a . match ( /Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/ ) ; ( c . webkit = ! ! d ) && ( c . version = d [ 1 ] ) , e && ( b . android = ! 0 , b . version = e [ 2 ] ) , i && ! h && ( b . ios = b . iphone = ! 0 , b . version = i [ 2 ] . replace ( /_/g , "." ) ) , g && ( b . ios = b . ipad = ! 0 , b . version = g [ 2 ] . replace ( /_/g , "." ) ) , h && ( b . ios = b . ipod = ! 0 , b . version = h [ 3 ] ? h [ 3 ] . replace ( /_/g , "." ) : null ) , k && ( b . wp = ! 0 , b . version = k [ 1 ] ) , j && ( b . webos = ! 0 , b . version = j [ 2 ] ) , l && ( b . touchpad = ! 0 ) , o && ( b . blackberry = ! 0 , b . version = o [ 2 ] ) , p && ( b . bb10 = ! 0 , b . version = p [ 2 ] ) , q && ( b . rimtabletos = ! 0 , b . version = q [ 2 ] ) , r && ( c . playbook = ! 0 ) , m && ( b . kindle = ! 0 , b . version = m [ 1 ] ) , n && ( c . silk = ! 0 , c . version = n [ 1 ] ) , ! n && b . android && a . match ( /Kindle Fire/ ) && ( c . silk = ! 0 ) , s && ( c . chrome = ! 0 , c . version = s [ 1 ] ) , t && ( c . firefox = ! 0 , c . version = t [ 1 ] ) , u && ( c . ie = ! 0 , c . version = u [ 1 ] ) , w && ( f || b . ios ) && ( c . safari = ! 0 , f && ( c . version = w [ 1 ] ) ) , v && ( c . webview = ! 0 ) , b . tablet = ! ! ( g || r || e && ! a . match ( /Mobile/ ) || t && a . match ( /Tablet/ ) || u && ! a . match ( /Phone/ ) && a . match ( /Touch/ ) ) , b . phone = ! ( b . tablet || b . ipod || ! ( e || i || j || o || p || s && a . match ( /Android/ ) || s && a . match ( /CriOS\/([\d.]+)/ ) || t && a . match ( /Mobile/ ) || u && 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 , f , g ) { if ( c = d ( c ) , c . ns ) var h = e ( c . ns ) ; return ( q [ b ( a ) ] || [ ] ) . filter ( function ( a ) { return ! ( ! a || c . e && a . e != c . e || c . ns && ! h . test ( a . ns ) || f && b ( a . fn ) !== b ( f ) || g && a . sel != g ) } ) } function d ( a ) { var b = ( "" + a ) . split ( "." ) ; return { e : b [ 0 ] , ns : b . slice ( 1 ) . sort ( ) . join ( " " ) } } function e ( a ) { return new RegExp ( "(?:^| )" + a . replace ( " " , " .* ?" ) + "(?: |$)" ) } function f ( a , b ) { return a . del && ! s && a . e in t || ! ! b } function g ( a ) { return u [ a ] || s && t [ a ] || a } function h ( c , e , h , i , k , m , n ) { var o = b ( c ) , p = q [ o ] || ( q [ o ] = [ ] ) ; e . split ( /\s/ ) . forEach ( function ( b ) { if ( "ready" == b ) return a ( document ) . ready ( h ) ; var e = d ( b ) ; e . fn = h , e . sel = k , e . e in u && ( h = function ( b ) { var c = b . relatedTarget ; return ! c || c !== this && ! a . contains ( this , c ) ? e . fn . apply ( this , arguments ) : void 0 } ) , e . del = m ; var o = m || h ; e . proxy = function ( a ) { if ( a = j ( a ) , ! a . isImmediatePropagationStopped ( ) ) { a . data = i ; var b = o . apply ( c , a . _args == l ? [ a ] : [ a ] . concat ( a . _args ) ) ; return b === ! 1 && ( a . preventDefault ( ) , a . stopPropagation ( ) ) , b } } , e . i = p . length , p . push ( e ) , "addEventListener" in c && c . addEventListener ( g ( e . e ) , e . proxy , f ( e , n ) ) } ) } function i ( a , d , e , h , i ) { var j = b ( a ) ; ( d || "" ) . split ( /\s/ ) . forEach ( function ( b ) { c ( a , b , e , h ) . forEach ( function ( b ) { delete q [ j ] [ b . i ] , "removeEventListener" in a && a . removeEventListener ( g ( b . e ) , b . proxy , f ( b , i ) ) } ) } ) } function j ( b , c ) { return ( c || ! b . isDefaultPrevented ) && ( c || ( c = b ) , a . each ( y , function ( a , d ) { var e = c [ a ] ; b [ a ] = function ( ) { return this [ d ] = v , e && e . apply ( c , arguments ) } , b [ d ] = w } ) , ( c . defaultPrevented !== l ? c . defaultPrevented : "returnValue" in c ? c . returnValue === ! 1 : c . getPreventDefault && c . getPreventDefault ( ) ) && ( b . isDefaultPrevented = v ) ) , b } function k ( a ) { var b , c = { originalEvent : a } ; for ( b in a ) x . test ( b ) || a [ b ] === l || ( c [ b ] = a [ b ] ) ; return j ( c , a ) } var l , m = 1 , n = Array . prototype . slice , o = a . isFunction , p = function ( a ) { return "string" == typeof a } , q = { } , r = { } , s = "onfocusin" in window , t = { focus : "focusin" , blur : "focusout" } , u = { mouseenter : "mouseover" , mouseleave : "mouseout" } ; r . click = r . mousedown = r . mouseup = r . mousemove = "MouseEvents" , a . event = { add : h , remove : i } , a . proxy = function ( c , d ) { var e = 2 in arguments && n . call ( arguments , 2 ) ; if ( o ( c ) ) { var f = function ( ) { return c . apply ( d , e ? e . concat ( n . call ( arguments ) ) : arguments ) } ; return f . _zid = b ( c ) , f } if ( p ( d ) ) return e ? ( e . unshift ( c [ d ] , c ) , a . proxy .
2014-09-04 17:24:35 +08:00
- 1 != d && cn12306 . loadingInfo . splice ( d , 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 ) { var b , d = 348 ; for ( b = 32768 ; b > 8 ; b >>= 1 ) d += g [ a - 1900 ] & b ? 1 : 0 ; return d + c ( a ) } function c ( a ) { return d ( a ) ? 65536 & g [ a - 1900 ] ? 30 : 29 : 0 } function d ( a ) { return 15 & g [ a - 1900 ] } function e ( a , b ) { return g [ a - 1900 ] & 65536 >> b ? 30 : 29 } function f ( a ) { this . date = a || new Date ; var f , g = 0 , h = 0 , i = ( this . date - j ) / 864e5 ; for ( this . daycyl = i + 40 , this . moncyl = 14 , f = 1900 ; 2050 > f && i > 0 ; f ++ ) h = b ( f ) , i -= h , this . moncyl += 12 ; for ( 0 > i && ( i += h , f -- , this . moncyl -= 12 ) , this . year = f , this . yearcyl = f - 1864 , g = d ( f ) , this . isleap = ! 1 , f = 1 ; 13 > f && i > 0 ; f ++ ) g > 0 && f == g + 1 && 0 == this . isleap ? ( -- f , this . isleap = ! 0 , h = c ( this . year ) ) : h = e ( this . year , f ) , 1 == this . isleap && f == g + 1 && ( this . isleap = ! 1 ) , i -= h , 0 == this . isleap && this . moncyl ++ ; 0 == i && g > 0 && f == g + 1 && ( this . isleap ? this . isleap = ! 1 : ( this . isleap = ! 0 , -- f , -- this . moncyl ) ) , 0 > i && ( i += h , -- f , -- this . moncyl ) , this . month = f , this . day = i + 1 } var g = new Array ( 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 ) , h = new Array ( "日" , "一" , "二" , "三" , "四" , "五" , "六" , "七" , "八" , "九" , "十" ) , i = new Array ( "初" , "十" , "廿" , "卅" , " " ) , j = new Date ( 1900 , 0 , 31 ) ; f . prototype . getLunarMonth = function ( ) { var a = "" ; return a += this . month > 10 ? "十" + h [ this . month - 10 ] : h [ this . month ] , a += "月" , "十二月" == a ? a = "腊月" : "一月" == a && ( a = "正月" ) , a } , f . prototype . getLunarDay = function ( ) { var a = "" ; switch ( this . day ) { case 10 : a += "初十" ; break ; case 20 : a += "二十" ; break ; case 30 : a += "三十" ; break ; default : a += i [ Math . floor ( this . day / 10 ) ] , a += h [ Math . floor ( this . day % 10 ) ] } return a } , f . prototype . getLunar = function ( ) { return this . getLunarMonth ( ) + this . getLunarDay ( ) } , f . prototype . getMOD = function ( ) { var a = this . getLunarDay ( ) ; return "初一" == a && ( a = this . getLunarMonth ( ) ) , a } , a . LunarCalendar = f } ) ( window ) ; DateComponent . prototype . generateArray = function ( ) { var a = this . pageCurMonth , b = this . pageCurDate , c = b . getDay ( ) , d = b . date . getTime ( ) , e = [ ] , f = this . minDate . date . getTime ( ) , g = this . maxDate . date . getTime ( ) ; do e . push ( { year : b . getFullYear ( ) , month : b . getMonth ( ) + 1 , day : b . getDate ( ) , format : b . format ( "yyyy/MM/dd" ) , time : b . date . getTime ( ) , "class" : b . isToday ? " today" + ( this . curDate . date . getTime ( ) == b . date . getTime ( ) ? " cur" : "" ) : this . curDate . date . getTime ( ) == b . date . getTime ( ) ? " cur" : "" , isCheckClass : f > d ? " disable" : d > g ? " remind" : "" , lunar : new LunarCalendar ( b ) . getMOD ( ) } ) , b = new Date ( b . getTime ( ) + 864e5 ) , d = b . date . getTime ( ) ; while ( a == b . getMonth ( ) ) ; for ( var h = b . getDay ( ) ; 7 > h && 0 != h ; h ++ ) e . push ( { year : b . getFullYear ( ) , month : b . getMonth ( ) + 1 , day : b . getDate ( ) , format : b . format ( "yyyy/MM/dd" ) , time : b . date . getTime ( ) , "class" : b . isToday ? " today" + ( this . curDate . date . getTime ( ) == b . date . getTime ( ) ? " cur" : "" ) : this . curDate . date . getTime ( ) == b . date . getTime ( ) ? " cur" : "" , isCheckClass : f > d ? " disable" : d > g ? " remind" : "" , lunar : new LunarCalendar ( b ) . getMOD ( ) } ) , b = new Date ( b . getTime ( ) + 864e5 ) , d = b . date . getTime ( ) ; for ( h = c , b = new Date ( new Date ( this . pageCurDate . getFullYear ( ) , this . pageCurDate . getMonth ( ) , 1 , 0 , 0 , 0 ) . getTime ( ) - 864e5 ) , d = b . date . getTime ( ) ; h > 0 ; h -- ) e . unshift ( { year : b . getFullYear ( ) , month : b . getMonth ( ) + 1 , day : b . getDate ( ) , format : b . format ( "yyyy/MM/dd" ) , time : b . date . getTime ( ) , "class" : b . isToday ? " today" + ( this . curDate . date . getTime ( ) == b . date . getTime ( ) ? " cur" : "" ) : this . curDate . date . getTime ( ) == b . date . getTime ( ) ? " cur" : "" , isCheckClass : f > d ? " disable" : d > g
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 = { } ; for ( var c in a ) ( - 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 ; for ( var d in a ) { c = ! 1 ; for ( var e = 0 ; e < RunQuery . filterCond . train _seat . length ; e ++ ) if ( "undefined" != typeof a [ d ] . ticketMap [ RunQuery . filterCond . train _seat [ e ] ] && a [ d ] . ticketMap [ RunQuery . filterCond . train _seat [ e ] ] . count > 0 ) { 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 ( ) ; if ( 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 ( ) ; else { var c = $ ( "a.cur" , Public . calendar . wrap ) . offset ( ) ; $ ( "#date_tip" ) . css ( { left : c . left , top : c . top , display : "block" } ) . html ( "<p>" + a . format ( "M月d日" ) + '不在预售期</p><a href="remind.html?data=' + encodeURIComponent ( a . format ( "M月d日" ) ) + '" class="btn btn_m btn_success">预约提醒</a>' ) , c . left / window . innerWidth > . 75 ? $ ( "#date_tip" ) . attr ( "class" , "tip_small tip_right" ) : c . left / window . innerWidth < . 15 ? $ ( "#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 || ( $ ( "#autoTip p" ) . html ( Public . isLogin ? "暂时无票!<br>没有符合你要求的车次和席别" : "暂时无票!<br>登录后可以自动刷票" ) , $ ( "#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 ( "已刷 " + RunQuery . refCount + " 次,用时 " + b + "<br>距下次刷票还有 " + c + " 秒 ..." ) , 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 ) , c = parseInt ( a % 6e4 / 1e3 ) ; return b + "分" + c + "秒" } } , OrderSubmit = { init : function ( ) { return 0 == $ ( "#ordersubmit_page" ) . length ? ! 1 : ( OrderSubmit . bindEvent ( ) , void Public . checkLogin ( function ( ) { sessionStorage . getItem ( Public . user + "curBuy" ) || sessionStorage . getItem ( "curBuy" ) || ( window . location . href = "index.html" ) , OrderSubmit . getTrainInfo ( ) , OrderSubmit . getPassenger ( ) } , function ( ) { window . location . href = "login.html" } , function ( ) { window . location . href = "login.html" } ) ) } , getTrainInfo : function ( ) { OrderSubmit . curData = JSON . parse ( sessionStora
2014-09-01 18:04:39 +08:00
} } , device _info : { get : function ( ) { return e ? e . get _device _info ( ) : null } } } ) , a . open _url = function ( a ) { e ? e . open _url ( a ) : window . open ( a ) } , a . refresh _start = function ( ) { [ ] . slice . call ( arguments ) ; e && e . refresh _start ( ) } , a . refresh _end = function ( ) { [ ] . slice . call ( arguments ) ; e && e . refresh _end ( ) } , a . refresh _success = function ( ) { [ ] . slice . call ( arguments ) ; e ? e . refresh _success ( ) : window . liebaoExtentions && window . liebaoExtentions . vibrate ? window . liebaoExtentions . vibrate ( 5e3 ) : window . _ _gChrome && window . _ _gChrome . hasTicket && window . _ _gChrome . hasTicket ( "刷票成功,请尽快订票" , "" ) } ; var g = { } , h = 0 , i = function ( ) { var a = "https://kyfw.12306.cn/otn/" ; return { getUrl : function ( b ) { return ":" === b [ 4 ] || ":" === b [ 5 ] ? b : a + b } , getHeaders : function ( a , b ) { if ( b = b || { } , b . Origin = /(https?:\/\/[^\/]+\/)/i . exec ( a ) [ 1 ] , c ) { var d = { } ; $ . each ( b , function ( a , b ) { d [ "Fish-" + a ] = b } ) , b = d } return b } } } ( ) , j = function ( ) { window . fishXhrLoadCallback = function ( a ) { "string" == typeof a && ( a = JSON . parse ( a ) ) ; var b = g [ a . id ] ; if ( b ) { if ( "json" === b . rawResultType ) try { a . result = JSON . parse ( a . result ) } catch ( c ) { a . success = ! 1 } else "image" === b . rawResultType && ( a . result = base64 . toObjectUrl ( a . result , "png" ) ) ; delete g [ a . id ] , a . success ? b . resolve ( a . result , { headers : a . headers , statusCode : a . statusCode , statusDescription : a . statusDescription , id : a . id } ) : b . reject ( a . result , { headers : a . headers , statusCode : a . statusCode , statusDescription : a . statusDescription , id : a . id } ) } } ; var a = function ( a , b , c , d , f , i ) { var j = new $ . Deferred ; return d = d || "" , "string" != typeof d && ( d = $ . param ( d ) ) , "GET" == a && "image" != ( c || "json" ) && ( b = b + "?" + d ) , i = i || { } , f && ( i = $ . extend ( { } , i , { Referer : f } ) ) , j . rawResultType = c || "json" , j . context = { id : ++ h , url : b , method : a , postdata : d , refer : f , headers : i || { } , callback : "fishXhrLoadCallback" , requestCharset : "UTF-8" , returnType : "image" === j . rawResultType ? "image" : "text" } , g [ j . context . id ] = j , e . sendRequest ( JSON . stringify ( j . context ) ) , j . promise ( ) } ; return { ajax : a , get : function ( ) { var b = [ ] . slice . call ( arguments ) ; return b . unshift ( "GET" ) , a . apply ( this , b ) } , post : function ( ) { var b = [ ] . slice . call ( arguments ) ; return b . unshift ( "POST" ) , a . apply ( this , b ) } , getImage : function ( b , c ) { return a ( "GET" , b , "image" , null , c ) } } } ( ) , k = function ( ) { var a = function ( a , b , c , d , e , f ) { var g = new $ . Deferred ; f = f || { } , e && ( f = $ . extend ( { } , f , { Referer : e } ) ) ; var h = { } ; return $ . each ( f , function ( a , b ) { h [ "Fish-" + a ] = b } ) , f = h , $ . ajax ( { url : b , data : d , timeout : 12e4 , type : a , dataType : c , refer : e , headers : f } ) . done ( function ( a , b , c ) { g . resolve ( a , { headers : c . getAllResponseHeaders ( ) , statusCode : c . statusCode , statusDescription : c . statusText , id : 0 } ) } ) . fail ( function ( a ) { g . reject ( result , { headers : a . getAllResponseHeaders ( ) , statusCode : a . statusCode , statusDescription : a . statusText , id : 0 } ) } ) , g } , b = function ( a , b , c , d , e ) { var f = new $ . Deferred , g = new window . XMLHttpRequest ; e = e || { } , g . open ( a , b , ! 0 ) , $ . each ( e , function ( a , b ) { g . setRequestHeader ( "Fish-" + a , b ) } ) , g . onreadystatechange = function ( ) { 4 === g . readyState && ( 200 !== g . status ? f . reject ( "加载验证码失败,请点击验证码刷新" , { headers : g . getAllResponseHeaders ( ) , statusCode : g . statusCode , statusDescription : g . statusText , id : 0 } ) : f . resolve ( base64 . toObjectUrl ( base64 . encodeArrayBuffer ( g . response ) , "image/jpeg" ) , { headers : g . getAllResponseHeaders ( ) , statusCode : g . statusCode , statusDescription : g . statusText , id : 0 } ) ) } ; var h = "Fish-" ; return g . responseType = "arraybuffer" , g . setRequestHeader ( h + "Referer" , d || "" ) , g . setRequestHeader ( h + "User-Agent" , "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" ) , g . setRequestHeader ( h + "Origin" , /(https?:\/\/[^\/]+\/)/ . exec ( b ) [ 1 ] ) , g . send ( c ) , f } ; return { ajax : a , get : function ( ) { var b = [ ] . slice . call ( arguments ) ; return b . unshift ( "GET" ) , a . apply ( this , b ) } , post : function ( ) { var b = [ ] . slice . call ( arguments ) ; return b . unshift ( "POST" ) , a . apply ( this , b ) } , getImage : function ( a , c ) { return b ( "GET" , a , null , c ) } } } ( ) , l = function ( ) { var b = function ( b , c , d , e , f , i ) { var j = new $ . Deferred ; i = i || { } , f && ( i = $ . extend ( { } , i , { Referer : f } ) ) ; var k = { url : c , data : e , timeout : 12e4 , type : b , dataType : d , refer : f , headers : i } , l = new CustomEvent ( "ajaxproxy" , { detail : { data : k , index : ++ h } , cancelable : ! 0 } ) ; return document . dispatchEvent ( l ) ? ( document . dispatchEvent ( new CustomEvent ( "requestSupportError" ) ) , a . reject ( "平台错误" ) ) : g [ l . detail . index ] = { done : function ( a ) { j . resolve ( a , { headers : this . headers , statusCode : this . status , statusDescription :