日期等等bug
This commit is contained in:
parent
c87f10b941
commit
5425ce63cf
@ -125,6 +125,7 @@ DateComponent.prototype.bindDomEvent = function() {
|
||||
var max = _self.maxDate.date.getTime();
|
||||
|
||||
if($(this).hasClass('disable')){
|
||||
$('#date_tip').hide();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -159,6 +160,7 @@ DateComponent.prototype.bindDomEvent = function() {
|
||||
} else {
|
||||
_self.monthNext();
|
||||
}
|
||||
$('#date_tip').hide();
|
||||
});
|
||||
};
|
||||
|
||||
@ -199,6 +201,7 @@ DateComponent.prototype.monthPrev = function() {
|
||||
this.pageCurDate = y;
|
||||
|
||||
this.setBasic();
|
||||
return true;
|
||||
}
|
||||
|
||||
DateComponent.prototype.monthNext = function() {
|
||||
@ -210,11 +213,13 @@ DateComponent.prototype.monthNext = function() {
|
||||
this.pageCurDate = new Date(this.pageCurDate.getFullYear(), this.pageCurMonth, 1, 0, 0, 0);
|
||||
}
|
||||
this.setBasic();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DateComponent.prototype.dayPrev = function() {
|
||||
var date = new Date(this.curDate.getTime() - 86400000);
|
||||
if (date.date.getTime() < this._TODAY.date.getTime()) {
|
||||
if (date.date.getTime() < this.minDate.date.getTime()) {
|
||||
return this.curDate;
|
||||
}
|
||||
this.curDate = date;
|
||||
|
26
Mobile12306New/js/js.min.js
vendored
26
Mobile12306New/js/js.min.js
vendored
@ -128,12 +128,12 @@ b.date.getTime()?" cur":"",isCheckClass:m,lunar:(new LunarCalendar(b)).getMOD()}
|
||||
b.date.getTime()?" cur":"",isCheckClass:m,lunar:(new LunarCalendar(b)).getMOD()}),b=new Date(b.getTime()+864E5),d=b.date.getTime();a=c;b=new Date((new Date(this.pageCurDate.getFullYear(),this.pageCurDate.getMonth(),1,0,0,0)).getTime()-864E5);for(d=b.date.getTime();0<a;a--)l=(new Date(g)).addDays(30).getTime(),m=d<f?" disable":d>g?" remind":"",d>l&&(m=" disable"),e.unshift({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),format:b.format("yyyy/MM/dd"),time:b.date.getTime(),"class":b.isToday?
|
||||
" today"+(this.curDate.date.getTime()==b.date.getTime()?" cur":""):this.curDate.date.getTime()==b.date.getTime()?" cur":"",isCheckClass:m,lunar:(new LunarCalendar(b)).getMOD()}),b=new Date(b.getTime()-864E5),d=b.date.getTime();this.arr=e};
|
||||
DateComponent.prototype.setHtml=function(){for(var a='<div class="date_title"><span class="date_prev"><i class="icon icon_left"></i></span>'+this.fd+'<span class="date_next"><i class="icon icon_right"></i></span></div><table class="date_component"><tr><th>\u65e5</th><th>\u4e00</th><th>\u4e8c</th><th>\u4e09</th><th>\u56db</th><th>\u4e94</th><th>\u516d</th></tr><tr>',b=0,c=this.arr.length;b<c;b++)0!=b&&0==b%7&&(a+="</tr><tr>"),a+=this.tdHtml.temp(this.arr[b]);this.wrap.html(a+"</tr></table>");this.bindDomEvent()};
|
||||
DateComponent.prototype.bindDomEvent=function(){var a=this;$("table a",a.wrap).on("click",function(b){b=new Date(parseInt($(this).attr("data-time")));a.minDate.date.getTime();a.maxDate.date.getTime();if($(this).hasClass("disable"))return!1;if(!$(this).hasClass("cur")){if(b.getTime()<a._TODAY.date.getTime())return!1;a.pageCurMonth==b.getMonth()?($("table a",a.wrap).removeClass("cur"),$(this).addClass("cur"),a.curDate=b):(a.curDate=b,a.startDate=b,a.pageCurDate=new Date(a.curDate.getFullYear(),a.curDate.getMonth(),
|
||||
1,0,0,0),a.pageCurMonth=a.curDate.getMonth(),a.fd=a.curDate.format("yyyy\u5e74 MM\u6708"),a.generateArray(),a.setHtml())}a.checkCallback&&a.checkCallback(b)});$(".date_prev,.date_next",a.wrap).on("click",function(b){$(this).hasClass("date_prev")?a.monthPrev():a.monthNext()})};DateComponent.prototype.setBasic=function(){this.fd=this.pageCurDate.format("yyyy\u5e74 MM\u6708");this.generateArray();this.setHtml()};
|
||||
DateComponent.prototype.bindDomEvent=function(){var a=this;$("table a",a.wrap).on("click",function(b){b=new Date(parseInt($(this).attr("data-time")));a.minDate.date.getTime();a.maxDate.date.getTime();if($(this).hasClass("disable"))return $("#date_tip").hide(),!1;if(!$(this).hasClass("cur")){if(b.getTime()<a._TODAY.date.getTime())return!1;a.pageCurMonth==b.getMonth()?($("table a",a.wrap).removeClass("cur"),$(this).addClass("cur"),a.curDate=b):(a.curDate=b,a.startDate=b,a.pageCurDate=new Date(a.curDate.getFullYear(),
|
||||
a.curDate.getMonth(),1,0,0,0),a.pageCurMonth=a.curDate.getMonth(),a.fd=a.curDate.format("yyyy\u5e74 MM\u6708"),a.generateArray(),a.setHtml())}a.checkCallback&&a.checkCallback(b)});$(".date_prev,.date_next",a.wrap).on("click",function(b){$(this).hasClass("date_prev")?a.monthPrev():a.monthNext();$("#date_tip").hide()})};DateComponent.prototype.setBasic=function(){this.fd=this.pageCurDate.format("yyyy\u5e74 MM\u6708");this.generateArray();this.setHtml()};
|
||||
DateComponent.prototype.setCurDate=function(a){if(a.date.getTime()<this._TODAY.date.getTime()||a.date.getTime()>this.maxDate.date.getTime())return this.curDate;this.curDate=a;this.pageCurMonth=a.getMonth();this.pageCurDate=new Date(a.getFullYear(),this.pageCurMonth,1,0,0,0);this.setBasic()};
|
||||
DateComponent.prototype.monthPrev=function(){var a=this.pageCurMonth-1,b;0>a?(a=11,b=new Date(this.pageCurDate.getFullYear()-1,a,1,0,0,0)):b=new Date(this.pageCurDate.getFullYear(),a,1,0,0,0);if(b.getTime()<(new Date(this._TODAY.getFullYear(),this._TODAY.getMonth(),1,0,0,0)).getTime())return!1;this.pageCurMonth=a;this.pageCurDate=b;this.setBasic()};
|
||||
DateComponent.prototype.monthNext=function(){this.pageCurMonth++;11<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.dayPrev=function(){var a=new Date(this.curDate.getTime()-864E5);if(a.date.getTime()<this.minDate.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:[],zhObj:{},CodeObj:{},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.CodeObj[b[2]]=b;CheckStaion.hotList=WIN.favorite_names.substr(1).split("@")}},getHisHmtl:function(){var a=JSON.parse(localStorage.getItem("stationHis")),
|
||||
@ -145,12 +145,12 @@ localStorage.removeItem("stationHis")})},showSuggest:function(a){if(!a||0==a.len
|
||||
var b=CheckStaion.objs[a[0]],c=[],c=[],d=[],e=[];if(0==a.length)return b;for(var f=0,g=b.length;f<g;f++)-1!=b[f][4].indexOf(a)?b[f][4]==a?c.unshift(b[f]):c.push(b[f]):-1!=b[f][3].indexOf(a)?b[f][3]==a?d.unshift(b[f]):d.push(b[f]):-1!=b[f][0].indexOf(a)&&(b[f][0]==a?e.unshift(b[f]):e.push(b[f]));return c=c.sort(CheckStaion.sort).concat(d.sort(CheckStaion.sort),e.sort(CheckStaion.sort))},searchKeyZh:function(a){if(!CheckStaion.objsZh[a[0]])return[];var b=CheckStaion.objsZh[a[0]],c=[];if(1==a.length)return b;
|
||||
for(var d=0,e=b.length;d<e;d++)-1!=b[d][1].indexOf(a)&&c.push(b[d]);return c.sort(CheckStaion.sort)},sort:function(a,b){return parseInt(a[5])>parseInt(b[5])?1:-1}};var Login={init:function(){if(0!=$("#login_page").length){var a=new Date;$("#interval").html(a.format("M\u6708dd\u65e5")+"-"+a.addDays(19).format("M\u6708d\u65e5"));cn12306.recode();$("#randcode").keyup(function(){this.value=this.value.replace(/[^0-9a-zA-Z]/g,"")});$("#loginForm").submit(function(a){var c={username:$("[name=username]",this).val(),password:$("[name=password]",this).val(),randcode:$("[name=randcode]",this).val()};if(c.username)if(c.password){if(!c.randcode)return Public.toast("\u8bf7\u8f93\u5165\u9a8c\u8bc1\u7801"),
|
||||
!1}else return Public.toast("\u8bf7\u8f93\u5165\u767b\u5f55\u5bc6\u7801"),!1;else return Public.toast("\u8bf7\u8f93\u5165\u7528\u6237\u540d"),!1;Login.formData=c;SKIPVC?Login.submitLogin():Login.getRandCode();a.preventDefault();return!1});localStorage.getItem("useraccount")?(Login.formData=JSON.parse(localStorage.getItem("useraccount")),$("#loginForm [name=username]").val(Login.formData.username),$("#loginForm [name=password]").val(Login.formData.password),cn12306.isUserLogined(function(){sessionStorage.setItem("user",
|
||||
Login.formData.username);Public.toast("\u767b\u5f55\u6210\u529f!");setTimeout(function(){Login.loginRoute()},1E3)})):sessionStorage.clear()}},getRandCode:function(){cn12306.checkRandCode("sjrand",Login.formData.randcode,function(a){"Y"!==a.data?(cn12306.recode(),Public.toast("\u9a8c\u8bc1\u7801\u4e0d\u6b63\u786e")):Login.submitLogin(a)},function(a,b){cn12306.recode();Public.toast("\u6821\u9a8c\u9a8c\u8bc1\u7801\u5931\u8d25")},"login/init")},formData:null,submitLogin:function(){bootStrap.post("login/loginAysnSuggest",
|
||||
null,{"loginUserDTO.user_name":Login.formData.username,"userDTO.password":Login.formData.password,randCode:Login.formData.randcode},"login/init").done(function(a){a&&a.data&&"Y"===a.data.loginCheck?Login.userPostLogin():(a=(a.messages||["\u672a\u77e5\u9519\u8bef"]).join(";"),cn12306.recode(),-1!=a.indexOf("\u767b\u5f55\u540d")?($("#username").focus(),Public.toast("\u7528\u6237\u540d\u8f93\u5165\u9519\u8bef")):-1!=a.indexOf("\u9a8c\u8bc1\u7801")?($("#randcode").focus(),Public.toast("\u9a8c\u8bc1\u7801\u4e0d\u6b63\u786e")):
|
||||
-1!=a.indexOf("\u90ae\u7bb1")?($("#username").focus(),Public.toast("\u90ae\u7bb1\u8f93\u5165\u9519\u8bef")):-1<a.indexOf("\u5bc6\u7801")?($("#password").val("").focus(),Public.toast("\u5bc6\u7801\u4e0d\u6b63\u786e\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165",2E3)):-1<a.indexOf("\u9501\u5b9a")?ui.postMessage(!1,"\u60a8\u7684\u8d26\u6237\u5df2\u7ecf\u88ab\u9501\u5b9a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002","login"):-1!==a.indexOf("\u7cfb\u7edf\u7ef4\u62a4")?Public.toast("\u7cfb\u7edf\u7ef4\u62a4\u4e2d"):
|
||||
Public.toast("\u672a\u77e5\u9519\u8bef"))}).fail(function(a,b){403==a.status?Public.alert("\u8b66\u544a\uff01\u60a8\u7684IP\u5df2\u7ecf\u88ab\u5c01\u9501\uff0c\u8bf7\u91cd\u8bd5"):Public.alert("\u767b\u5f55\u65f6\u7f51\u7edc\u9519\u8bef")})},userPostLogin:function(){bootStrap.post("login/userLogin","text",null,"login/init").done(function(){Login.checkJsonAttr()}).fail(function(){Login.checkJsonAttr()})},checkJsonAttr:function(){var a=Login.formData;cn12306.isUserLogined(function(){sessionStorage.setItem("user",
|
||||
a.username);localStorage.setItem("useraccount",JSON.stringify(a));Public.toast("\u767b\u5f55\u6210\u529f!");Login.loginRoute()},function(){Public.toast("\u672a\u80fd\u6210\u529f\u767b\u5f55\uff0c\u8bf7\u91cd\u8bd5\u3002")},function(){Public.toast("\u767b\u5f55\u65f6\u7f51\u7edc\u9519\u8bef")})},loginRoute:function(){var a=Public.getQueryData(window.location.search);if(a.t)switch(a.t){case "submitorder":location.href="perfect.html?t="+a.t;break;case "autorefer":localStorage.getItem("hisQuery")&&localStorage.setItem(sessionStorage.getItem("user")+
|
||||
"hisQuery",localStorage.getItem("hisQuery"));location.href="run_query.html?t="+a.t;break;case "order_list":location.href="order_list.html";break;case "no_commplete":location.href="no_complete_order.html";break;case "run_query":location.href="run_query.html"}else location.href="index.html"}};var Query={calendar:null,init:function(){if(0!=$("#query_page").length){Public.checkLogin(Query.hasLogin,Query.noLogin,Query.noLogin);var a=(new Date).addDays(19);Public.setDate(a);$("#menu_btn").on("click",function(){$("#user_menu").toggle();$("#user_menu").height(document.documentElement.clientHeight-45)});$("#user_menu").on("click",function(a){"user_menu"==$(a.target).attr("id")&&$("#user_menu").hide()});$("#open_filter").on("click",function(){Public.showInnerPage("filter")});$("#filter_cancel").on("click",
|
||||
Login.formData.username)})):sessionStorage.clear()}},getRandCode:function(){cn12306.checkRandCode("sjrand",Login.formData.randcode,function(a){"Y"!==a.data?(cn12306.recode(),Public.toast("\u9a8c\u8bc1\u7801\u4e0d\u6b63\u786e")):Login.submitLogin(a)},function(a,b){cn12306.recode();Public.toast("\u6821\u9a8c\u9a8c\u8bc1\u7801\u5931\u8d25")},"login/init")},formData:null,submitLogin:function(){bootStrap.post("login/loginAysnSuggest",null,{"loginUserDTO.user_name":Login.formData.username,"userDTO.password":Login.formData.password,
|
||||
randCode:Login.formData.randcode},"login/init").done(function(a){a&&a.data&&"Y"===a.data.loginCheck?Login.userPostLogin():(a=(a.messages||["\u672a\u77e5\u9519\u8bef"]).join(";"),cn12306.recode(),-1!=a.indexOf("\u767b\u5f55\u540d")?($("#username").focus(),Public.toast("\u7528\u6237\u540d\u8f93\u5165\u9519\u8bef")):-1!=a.indexOf("\u9a8c\u8bc1\u7801")?($("#randcode").focus(),Public.toast("\u9a8c\u8bc1\u7801\u4e0d\u6b63\u786e")):-1!=a.indexOf("\u90ae\u7bb1")?($("#username").focus(),Public.toast("\u90ae\u7bb1\u8f93\u5165\u9519\u8bef")):
|
||||
-1<a.indexOf("\u5bc6\u7801")?($("#password").val("").focus(),Public.toast("\u5bc6\u7801\u4e0d\u6b63\u786e\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165",2E3)):-1<a.indexOf("\u9501\u5b9a")?ui.postMessage(!1,"\u60a8\u7684\u8d26\u6237\u5df2\u7ecf\u88ab\u9501\u5b9a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002","login"):-1!==a.indexOf("\u7cfb\u7edf\u7ef4\u62a4")?Public.toast("\u7cfb\u7edf\u7ef4\u62a4\u4e2d"):Public.toast("\u672a\u77e5\u9519\u8bef"))}).fail(function(a,b){403==a.status?Public.alert("\u8b66\u544a\uff01\u60a8\u7684IP\u5df2\u7ecf\u88ab\u5c01\u9501\uff0c\u8bf7\u91cd\u8bd5"):
|
||||
Public.alert("\u767b\u5f55\u65f6\u7f51\u7edc\u9519\u8bef")})},userPostLogin:function(){bootStrap.post("login/userLogin","text",null,"login/init").done(function(){Login.checkJsonAttr()}).fail(function(){Login.checkJsonAttr()})},checkJsonAttr:function(){var a=Login.formData;cn12306.isUserLogined(function(){sessionStorage.setItem("user",a.username);localStorage.setItem("useraccount",JSON.stringify(a));Public.toast("\u767b\u5f55\u6210\u529f!");Login.loginRoute()},function(){Public.toast("\u672a\u80fd\u6210\u529f\u767b\u5f55\uff0c\u8bf7\u91cd\u8bd5\u3002")},
|
||||
function(){Public.toast("\u767b\u5f55\u65f6\u7f51\u7edc\u9519\u8bef")})},loginRoute:function(){var a=Public.getQueryData(window.location.search);if(a.t)switch(a.t){case "submitorder":location.href="perfect.html?t="+a.t;break;case "autorefer":localStorage.getItem("hisQuery")&&localStorage.setItem(sessionStorage.getItem("user")+"hisQuery",localStorage.getItem("hisQuery"));location.href="run_query.html?t="+a.t;break;case "order_list":location.href="order_list.html";break;case "no_commplete":location.href=
|
||||
"no_complete_order.html";break;case "run_query":location.href="run_query.html"}else location.href="index.html"}};var Query={calendar:null,init:function(){if(0!=$("#query_page").length){Public.checkLogin(Query.hasLogin,Query.noLogin,Query.noLogin);var a=(new Date).addDays(19);Public.setDate(a);$("#menu_btn").on("click",function(){$("#user_menu").toggle();$("#user_menu").height(document.documentElement.clientHeight-45)});$("#user_menu").on("click",function(a){"user_menu"==$(a.target).attr("id")&&$("#user_menu").hide()});$("#open_filter").on("click",function(){Public.showInnerPage("filter")});$("#filter_cancel").on("click",
|
||||
function(){Public.hideInnerPage("filter");var a=$("#query_form [name=filters]").val().split("&");Query.setFilter(a)});$("#filter_ok").on("click",function(){Public.hideInnerPage("filter");$("#query_form [name=filters]").val($("#filter_form").serialize())});$("#query_form [name=filters]").val($("#filter_form").serialize());$("#query_form").on("submit",function(){var a=$("#startStationCode").val(),c=$("#endStationCode").val();if(""==a)return Public.alert("\u8bf7\u9009\u62e9\u51fa\u53d1\u7ad9"),!1;if(""==
|
||||
c)return Public.alert("\u8bf7\u9009\u62e9\u5230\u8fbe\u7ad9"),!1;if(a==c)return Public.alert("\u51fa\u53d1\u5730\u548c\u76ee\u7684\u5730\u4e0d\u80fd\u76f8\u540c"),!1;var d=$("#query_form").serialize();Public.setHisQuery(a+"-"+c,d);window.location.href="run_query.html";return!1});$("#login").on("click",function(){"loginout"==$(this).attr("data-fn")&&cn12306.loginOut(function(){Public.toast("\u9000\u51fa\u6210\u529f\uff0c\u6b63\u5728\u8df3\u8f6c");setTimeout(function(){window.location.href="login.html"},
|
||||
1E3)},function(){Public.toast("\u9000\u51fa\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u3002")})});CheckStaion.init();Query.stationInt();Query.setHisQuery();Query.filterBind();$("#remind_btn").on("click",function(a){a="remind.html?";var c=$("#startStationCode").val(),d=$("#endStationCode").val();$("#start_date_val").val();c&&(a+="&from="+c);d&&(a+="&to="+d);location.href=a})}},setHisQuery:function(){var a=Public.his.querys,b,c;if(0==Public.his.querys.length)return!1;b='<div class="his_title">\u6700\u8fd1\u67e5\u627e</div><ul class="list his_list">';
|
||||
@ -232,15 +232,15 @@ _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(){Public.showLoading("\u6b63\u5728\u63d0\u4ea4");var a={passengerTicketStr:OrderSubmit.submitData.passengerTicketStr,oldPassengerStr:OrderSubmit.submitData.oldPassengerStr,randCode:$("#randcode").val(),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};bootStrap.post("confirmPassenger/confirmSingleForQueueAsys",null,a,"leftTicket/init").done(function(a){Public.hideLoading();!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"):
|
||||
a.data&&!a.data.submitStatus?Public.alert(a.data.errMsg||"\u672a\u77e5\u9519\u8bef"):($("#code_layer").hide(),Public.showLoading("\u8ba2\u7968\u6210\u529f\uff01\u6b63\u5728\u8df3\u8f6c..."),setTimeout(function(){Public.hideLoading();window.location.href="no_complete_order.html"},1500))}).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<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:"",loading:null,init:function(){if(0==$("#no_complete_page").length)return!1;$("#menu_btn").on("click",function(){$("#user_menu").toggle();$("#user_menu").height(document.documentElement.clientHeight-45)});$("#user_menu").on("click",function(a){"user_menu"==$(a.target).attr("id")&&$("#user_menu").hide()});$("#remind_btn").on("click",function(a){a="remind.html?";var b=$("#startStationCode").val(),c=$("#endStationCode").val();$("#start_date_val").val();
|
||||
-1!=a.indexOf("\u60a8\u8fd8\u6709\u672a\u5904\u7406\u7684\u8ba2\u5355")?Public.confirm('\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:"",loading:null,init:function(){if(0==$("#no_complete_page").length)return!1;$("#menu_btn").on("click",function(){$("#user_menu").toggle();$("#user_menu").height(document.documentElement.clientHeight-45)});$("#user_menu").on("click",function(a){"user_menu"==$(a.target).attr("id")&&$("#user_menu").hide()});$("#remind_btn").on("click",function(a){a="remind.html?";var b=$("#startStationCode").val(),c=$("#endStationCode").val();$("#start_date_val").val();
|
||||
b&&(a+="&from="+b);c&&(a+="&to="+c);location.href=a});NoComplete.loading=Public.showLoading("\u6b63\u5728\u83b7\u53d6\u8ba2\u5355\u4fe1\u606f");Public.checkLogin(NoComplete.getToken,NoComplete.noLogin,NoComplete.noLogin);$("[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()})},noLogin:function(){Public.hideLoading();Public.alert("\u8bf7\u5148\u767b\u5f55",function(){location.href="login.html?no_commplete"})},loadNum:0,getOrder:function(){NoComplete.loadNum++;bootStrap.get("queryOrder/queryMyOrderNoComplete","json",null,"queryOrder/initNoComplete").done(function(a){Public.hideLoading();if(a.status&&a.data)if(a.data.orderDBList&&0<a.data.orderDBList.length)NoComplete.setHtml(a.data.orderDBList);else{if(a.data.orderCacheDTO){var b;
|
||||
b='<ul class="order_list"><li><div class="order_info"><div class="order_ticket text_error">\u54ce\u5440\uff0c\u51fa\u7968\u5931\u8d25\u4e86\uff01</div>';b+="<p>"+a.data.orderCacheDTO.message.message+"</p>";b+="</div></li></ul>";$("#orders").html(b)}}else 0<$("#no_complete_page").length&&(2>NoComplete.loadNum?(Public.showLoading("\u6b63\u5728\u83b7\u53d6\u8ba2\u5355\u4fe1\u606f"),setTimeout(function(){NoComplete.getOrder()},5E3)):Public.alert("\u6682\u65e0\u8ba2\u5355\uff0c\u8bf7\u5230\u6211\u7684\u8ba2\u5355\u67e5\u770b\u5df2\u5b8c\u6210\u8ba2\u5355",
|
||||
function(){location.href="order_list.html"}))}).fail(function(a,b){0<$("#no_complete_page").length&&(Public.hideLoading(),Public.alert("\u67e5\u8be2\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u3002",function(){location.href=location.href}))})},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);
|
||||
NoComplete.getOrder()}).fail(function(){Public.hideLoading();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++){b+='<div class="orders_title">\u8ba2\u5355\u53f7\uff1a'+a[d].sequence_no+"</div>";b+='<div class="order_tickets">';c=(new Date(a[d].tickets[0].pay_limit_time.replace(/\-/gi,"/"))).getTime();isNaN(c)||(c=(new Date(a[d].order_date.replace(/\-/gi,
|
||||
"/"))).getTime()+27E5);for(var 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="'+
|
||||
"/"))).getTime()+27E5);for(var f=0;f<a[d].tickets.length;f++)b+='<div class="ticket">',b+='<div class="ticket_title"><span class="pull_right">'+a[d].train_code_page+"</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();0>=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..")})},
|
||||
|
@ -49,12 +49,12 @@ var Login = {
|
||||
cn12306.isUserLogined(function() {
|
||||
sessionStorage.setItem("user", Login.formData['username']);
|
||||
|
||||
Public.toast("登录成功!");
|
||||
// Public.toast("登录成功!");
|
||||
|
||||
setTimeout(function() {
|
||||
// 登录成功 跳转
|
||||
Login.loginRoute();
|
||||
}, 1000);
|
||||
// setTimeout(function() {
|
||||
// // 登录成功 跳转
|
||||
// Login.loginRoute();
|
||||
// }, 1000);
|
||||
|
||||
});
|
||||
} else {
|
||||
|
@ -136,7 +136,7 @@ var NoComplete = {
|
||||
}
|
||||
for (var j = 0; j < list[i]['tickets'].length; j++) {
|
||||
html += '<div class="ticket">';
|
||||
html += '<div class="ticket_title"><span class="pull_right">K2341</span>' + (new Date(list[i]['start_train_date_page'].replace(/\-/gi, '/'))).format('yyyy-M-d') + ' ' + (new Date(list[i]['start_train_date_page'].replace(/\-/gi, '/'))).day(3) + '</div>';
|
||||
html += '<div class="ticket_title"><span class="pull_right">' + list[i]['train_code_page'] + '</span>' + (new Date(list[i]['start_train_date_page'].replace(/\-/gi, '/'))).format('yyyy-M-d') + ' ' + (new Date(list[i]['start_train_date_page'].replace(/\-/gi, '/'))).day(3) + '</div>';
|
||||
html += '<div class="stations_info">';
|
||||
html += '<div class="station_info"><strong>' + list[i]['from_station_name_page'][0] + '</strong>' + list[i]['start_time_page'] + '</div>';
|
||||
html += '<div class="station_info"><strong>' + list[i]['to_station_name_page'][0] + '</strong>' + list[i]['arrive_time_page'] + '</div>';
|
||||
|
@ -559,7 +559,7 @@ var OrderSubmit = {
|
||||
errorCallback: function(tipText) {
|
||||
Public.hideLoading(OrderSubmit.loading);
|
||||
if (tipText.indexOf('您还有未处理的订单') != -1) {
|
||||
Public.alert('您还有未处理的订单,请您到<br/><a href="no_complete_order.html">[未完成订单]</a>进行处理!', function() {
|
||||
Public.confirm('您还有未处理的订单,请您到<br/><a href="no_complete_order.html">[未完成订单]</a>进行处理!', function() {
|
||||
window.location.href = 'no_complete_order.html';
|
||||
});
|
||||
} else {
|
||||
|
@ -16,7 +16,7 @@ var Remind = {
|
||||
window.history.back();
|
||||
});
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
$('#menu_btn').on('click', function() {
|
||||
$('#user_menu').toggle();
|
||||
|
Loading…
Reference in New Issue
Block a user