预定页
This commit is contained in:
parent
37ad0c7717
commit
28cc8316a9
@ -13,7 +13,7 @@ display: none;
|
||||
body, td, h3 { -webkit-user-select: none }
|
||||
.clearfix:after { content: ''; display: block; overflow: hidden; visibility: hidden; clear: both }
|
||||
.block { display: block }
|
||||
|
||||
html,body{height:100%;}
|
||||
body { background:#efefef; color:#787878; position:relative;}
|
||||
body.nologin{padding-bottom:60px;}
|
||||
a{color:#fa8c13;}
|
||||
@ -45,7 +45,7 @@ input[type=radio]:checked:after{content:''; display:block; width:12px; height:12
|
||||
.pull_right{float:right;}
|
||||
|
||||
.text_warning{color:#fa8c13;}
|
||||
.text_error{color:#F00;}
|
||||
.text_error{color:#da0000;}
|
||||
.text_gray{color:#b7b7b7;}
|
||||
.text_lg{ font-size:1.25em;}
|
||||
.text_underline{ text-decoration:underline;}
|
||||
@ -110,6 +110,7 @@ input[type=radio]:checked:after{content:''; display:block; width:12px; height:12
|
||||
.btn_lg{height:45px; line-height:45px;}
|
||||
.btn_m{height:30px; line-height:30px; font-size:0.75rem;}
|
||||
.btn_success{background:#fa8c13;}
|
||||
.btn_gray{background:#ccc;}
|
||||
|
||||
.box{padding:10px 15px;}
|
||||
.towbtn{white-space:nowrap;}
|
||||
@ -215,7 +216,7 @@ input[type=radio]:checked:after{content:''; display:block; width:12px; height:12
|
||||
.link_list li{border-bottom:#cacaca solid 1px;}
|
||||
.link_list li:last-child{border-bottom:0;}
|
||||
.link_list a{display:block; text-align:center; font-size:1.0625rem; color:#787878; line-height:2.647058823529412em;}
|
||||
|
||||
.link_list a.text_error{color:#da0000;}
|
||||
/**/
|
||||
.tip_small{ position:absolute; display:none; -webkit-transform:translate3d(-50%,-100%,0); background:rgba(0,0,0,.8); color:#FFF; font-size:.75rem; padding:10px; text-align:center; border-radius:3px; margin:-7px 0 0 18px;}
|
||||
/*.tip_left{ -webkit-transform:translate3d(-100%,-50%,0); margin:18px 0 0 -7px;}
|
||||
@ -294,19 +295,22 @@ input[type=radio]:checked:after{content:''; display:block; width:12px; height:12
|
||||
.station_info:first-child:after{ position:absolute; content:''; width:10px; height:10px; top:50%; right:0; margin:-5px -6px 0 0; border:#ddd solid; border-width:0 1px 1px 0; background:#FFF; -webkit-transform:rotate(-45deg);}
|
||||
.station_info strong{display:block; font-size:1.5625rem; color:#fa8c13; margin-bottom:8px;}
|
||||
|
||||
.passenger{border:#ddd solid; border-width:1px 0; padding:0 15px; background:#FFF; margin-bottom:15px;}
|
||||
.passenger{border:#ddd solid; border-width:1px 0; margin-bottom:15px;}
|
||||
.passenger_list{ padding:0 15px; background:#FFF;}
|
||||
.passenger_list li{ border-bottom:#ddd solid 1px; padding:5px 0; font-size:0.75rem;}
|
||||
.passenger_list li#passenger_editinfo{border-bottom:none;}
|
||||
.passenger_list li .pull_left{line-height:1.5em; color:#b7b7b7;}
|
||||
.passenger_list li .pull_left strong{font-size:0.9375rem; margin-right:5px; color:#787878;}
|
||||
.passenger_list li .pull_right{line-height:3em;}
|
||||
|
||||
.add_block{display:block; text-align:center; height:50px; line-height:50px;font-size:0.9375rem; color:#787878}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.add_block{display:block; text-align:center; height:50px; line-height:50px;font-size:0.9375rem; color:#787878; background:#FFF;}
|
||||
|
||||
.layer{position: fixed; top:0; left:0; width:100%; bottom:0; background:rgba(0,0,0,.5); display:none;}
|
||||
#edit_menu{position:absolute; width:100%; margin-top:-1px; display:none;}
|
||||
.seat{color:#787878;}
|
||||
#edit_seat,#edit_ticket{position:fixed; bottom:0; width:100%; left:0; display:none;}
|
||||
#edit_seat .link_list:before,#edit_ticket .link_list:before{display:none;}
|
||||
#edit_seat .link_list li a{text-align:left;}
|
||||
|
||||
|
||||
|
||||
|
@ -7,7 +7,15 @@ var cn12306 = {
|
||||
getFullUri: function(url) {
|
||||
return url[4] === ":" || url[5] === ":" ? url : cn12306.baseUri + url;
|
||||
},
|
||||
recode: function() {
|
||||
|
||||
$('#randcodeimg').attr('src', $('#randcodeimg').attr('data-loading'));
|
||||
$('#randcode').val('').focus();
|
||||
|
||||
cn12306.loadRandCode('sjrand', function(data) {
|
||||
$('#randcodeimg').attr('src', data);
|
||||
}, "login/init");
|
||||
},
|
||||
/**
|
||||
* 获取验证码
|
||||
* @param {String} flag 验证码类型(sjrand|randp)
|
||||
@ -36,7 +44,6 @@ var cn12306 = {
|
||||
* @return {String} ajax url
|
||||
*/
|
||||
getAjaxUrl: function(url) {
|
||||
console.log(url)
|
||||
// return (isAndLiebao || isIos || isWebApp) ? cn12306.getFullUri(url) : baseProxyUrl;
|
||||
return (isAndLiebao || isIos) ? cn12306.getFullUri(url) : baseProxyUrl;
|
||||
},
|
||||
@ -78,27 +85,36 @@ var cn12306 = {
|
||||
refer = cn12306.getFullUri(refer),
|
||||
headers = cn12306.getHeaders(url, refer);
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: cn12306.getAjaxUrl(url),
|
||||
data: {
|
||||
"randCode": code,
|
||||
"rand": type
|
||||
},
|
||||
dataType: 'json',
|
||||
refer: refer,
|
||||
headers: headers,
|
||||
success: function(data) {
|
||||
if (typeof success == 'function') {
|
||||
success(data);
|
||||
}
|
||||
},
|
||||
error: function(xhr, type) {
|
||||
if (typeof error == 'function') {
|
||||
error(xhr, type);
|
||||
}
|
||||
bootStrap.post("passcodeNew/checkRandCodeAnsyn", null, null, refer).done(function(data) {
|
||||
if (typeof success == 'function') {
|
||||
success(data);
|
||||
}
|
||||
}).fail(function(xhr, type) {
|
||||
if (typeof error == 'function') {
|
||||
error(xhr, type);
|
||||
}
|
||||
});
|
||||
// $.ajax({
|
||||
// type: 'POST',
|
||||
// url: cn12306.getAjaxUrl(url),
|
||||
// data: {
|
||||
// "randCode": code,
|
||||
// "rand": type
|
||||
// },
|
||||
// dataType: 'json',
|
||||
// refer: refer,
|
||||
// headers: headers,
|
||||
// success: function(data) {
|
||||
// if (typeof success == 'function') {
|
||||
// success(data);
|
||||
// }
|
||||
// },
|
||||
// error: function(xhr, type) {
|
||||
// if (typeof error == 'function') {
|
||||
// error(xhr, type);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
},
|
||||
|
||||
/**
|
||||
@ -111,61 +127,83 @@ var cn12306 = {
|
||||
var url = "login/checkUser",
|
||||
refer = 'leftTicket/init';
|
||||
|
||||
cn12306.ajax({
|
||||
url: "login/checkUser",
|
||||
data: {
|
||||
"_json_att": ""
|
||||
},
|
||||
refer: "leftTicket/init",
|
||||
success: function(json) {
|
||||
if (json && json.data && json.data.flag) {
|
||||
if (json.attributes) {
|
||||
sessionStorage["useratts"] = json.attributes;
|
||||
};
|
||||
if(!cn12306.checking){
|
||||
cn12306.checkeUser();
|
||||
};
|
||||
(typeof loginedCallback == "function") && loginedCallback();
|
||||
} else {
|
||||
(typeof unloginCallback == "function") && unloginCallback();
|
||||
}
|
||||
},
|
||||
error: function(xhr, type) {
|
||||
(typeof errorCallback == "function") && errorCallback();
|
||||
bootStrap.post("login/checkUser", "json", {
|
||||
"_json_att": ""
|
||||
}, "leftTicket/init").done(function(json) {
|
||||
if (json && json.data && json.data.flag) {
|
||||
if (json.attributes) {
|
||||
sessionStorage["useratts"] = json.attributes;
|
||||
};
|
||||
if (!cn12306.checking) {
|
||||
cn12306.checkeUser();
|
||||
};
|
||||
(typeof loginedCallback == "function") && loginedCallback();
|
||||
} else {
|
||||
(typeof unloginCallback == "function") && unloginCallback();
|
||||
}
|
||||
}).fail(function(xhr, type) {
|
||||
(typeof errorCallback == "function") && errorCallback();
|
||||
});
|
||||
// cn12306.ajax({
|
||||
// url: "login/checkUser",
|
||||
// data: {
|
||||
// "_json_att": ""
|
||||
// },
|
||||
// refer: "leftTicket/init",
|
||||
// success: function(json) {
|
||||
// if (json && json.data && json.data.flag) {
|
||||
// if (json.attributes) {
|
||||
// sessionStorage["useratts"] = json.attributes;
|
||||
// };
|
||||
// if(!cn12306.checking){
|
||||
// cn12306.checkeUser();
|
||||
// };
|
||||
// (typeof loginedCallback == "function") && loginedCallback();
|
||||
// } else {
|
||||
// (typeof unloginCallback == "function") && unloginCallback();
|
||||
// }
|
||||
// },
|
||||
// error: function(xhr, type) {
|
||||
// (typeof errorCallback == "function") && errorCallback();
|
||||
// }
|
||||
// });
|
||||
},
|
||||
|
||||
ajax:function(o){
|
||||
ajax: function(o) {
|
||||
var obj = {
|
||||
"type" : 'POST',
|
||||
"dataType" : 'json'
|
||||
"type": 'POST',
|
||||
"dataType": 'json'
|
||||
}
|
||||
|
||||
$.extend(obj,o||{});
|
||||
$.extend(obj, o || {});
|
||||
|
||||
obj["headers"] = cn12306.getHeaders(obj["url"], obj["refer"]);
|
||||
|
||||
if(typeof obj["url"] != 'undefined'){
|
||||
obj["url"] = cn12306.getAjaxUrl(cn12306.getFullUri(obj["url"]));
|
||||
}
|
||||
if(typeof obj["refer"] != 'undefined'){
|
||||
obj["refer"] = cn12306.getAjaxUrl(obj["refer"]);
|
||||
}
|
||||
if (typeof obj["url"] != 'undefined') {
|
||||
obj["url"] = cn12306.getAjaxUrl(cn12306.getFullUri(obj["url"]));
|
||||
}
|
||||
if (typeof obj["refer"] != 'undefined') {
|
||||
obj["refer"] = cn12306.getAjaxUrl(obj["refer"]);
|
||||
}
|
||||
$.ajax(obj);
|
||||
},
|
||||
checking :false,
|
||||
checkeUser:function(){
|
||||
checking: false,
|
||||
checkeUser: function() {
|
||||
cn12306.checking = true;
|
||||
cn12306.ajax({
|
||||
url:'login/checkUser',
|
||||
refer:'login/init',
|
||||
success:function(){
|
||||
setTimeout(cn12306.checkeUser,60000);
|
||||
},
|
||||
error:function(){
|
||||
setTimeout(cn12306.checkeUser,60000);
|
||||
}
|
||||
bootStrap.post('login/checkUser', 'json', null, 'login/init').done(function() {
|
||||
setTimeout(cn12306.checkeUser, 60000);
|
||||
}).fail(function() {
|
||||
setTimeout(cn12306.checkeUser, 60000);
|
||||
});
|
||||
// cn12306.ajax({
|
||||
// url: 'login/checkUser',
|
||||
// refer: 'login/init',
|
||||
// success: function() {
|
||||
// setTimeout(cn12306.checkeUser, 60000);
|
||||
// },
|
||||
// error: function() {
|
||||
// setTimeout(cn12306.checkeUser, 60000);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
@ -272,7 +272,11 @@ var bootStrap = (function () {
|
||||
if (refer) {
|
||||
headers = $.extend({}, headers, { Referer: refer });
|
||||
}
|
||||
|
||||
var nheaders={};
|
||||
$.each(headers, function (k, v) {
|
||||
nheaders["Fish-" + k]=v;
|
||||
});
|
||||
headers=nheaders;
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: postdata,
|
||||
@ -281,14 +285,14 @@ var bootStrap = (function () {
|
||||
dataType: returnType,
|
||||
refer: refer,
|
||||
headers: headers
|
||||
}).done(function (result, xhr) {
|
||||
}).done(function (result, status, xhr) {
|
||||
ad.resolve(result, {
|
||||
headers: xhr.getAllResponseHeaders(),
|
||||
statusCode: xhr.statusCode,
|
||||
statusDescription: xhr.statusText,
|
||||
id: 0
|
||||
});
|
||||
}).fail(function () {
|
||||
}).fail(function (xhr) {
|
||||
ad.reject(result, {
|
||||
headers: xhr.getAllResponseHeaders(),
|
||||
statusCode: xhr.statusCode,
|
||||
@ -508,7 +512,7 @@ var bootStrap = (function () {
|
||||
id: 0
|
||||
});
|
||||
}).fail(function () {
|
||||
ad.reject(result, {
|
||||
ad.reject(xhr.responseText, {
|
||||
headers: xhr.getAllResponseHeaders(),
|
||||
statusCode: xhr.statusCode,
|
||||
statusDescription: xhr.statusText,
|
||||
@ -639,5 +643,5 @@ bootStrap.done(function () {
|
||||
Login.init();
|
||||
Query.init();
|
||||
RunQuery.init();
|
||||
Perfect.init();
|
||||
OrderSubmit.init();
|
||||
});
|
@ -1,5 +1,5 @@
|
||||
var Login = {
|
||||
init: function () {
|
||||
init: function() {
|
||||
if ($('#login_page').length == 0) {
|
||||
return;
|
||||
}
|
||||
@ -7,23 +7,19 @@ var Login = {
|
||||
|
||||
$('#interval').html(today.format('M月dd日') + '-' + today.addDays(19).format('M月d日'))
|
||||
|
||||
Login.recode();
|
||||
cn12306.recode();
|
||||
|
||||
// 刷新验证码
|
||||
$('#randcodeimg').click(function (e) {
|
||||
Login.recode();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
//验证码输入
|
||||
$("#randcode").keyup(function () {
|
||||
$("#randcode").keyup(function() {
|
||||
this.value = this.value.replace(/[^0-9a-zA-Z]/g, "");
|
||||
// if (!document.getElementById("autosubmit").checked || this.value.length != 4) return;
|
||||
// $("#loginForm").submit();
|
||||
});
|
||||
|
||||
// 表单提交
|
||||
$('#loginForm').submit(function (e) {
|
||||
$('#loginForm').submit(function(e) {
|
||||
var data = {
|
||||
"username": $('[name=username]', this).val(),
|
||||
"password": $('[name=password]', this).val(),
|
||||
@ -52,12 +48,12 @@ var Login = {
|
||||
$('#loginForm [name=username]').val(Login.formData['username']),
|
||||
$('#loginForm [name=password]').val(Login.formData['password']),
|
||||
// Login.checkJsonAttr();
|
||||
cn12306.isUserLogined(function () {
|
||||
cn12306.isUserLogined(function() {
|
||||
sessionStorage.setItem("user", Login.formData['username']);
|
||||
|
||||
Public.toast("登录成功,正在进入订票页面,请稍等 ❤");
|
||||
|
||||
setTimeout(function () {
|
||||
setTimeout(function() {
|
||||
// 登录成功 跳转
|
||||
location.href = 'query.html';
|
||||
}, 1000);
|
||||
@ -65,102 +61,77 @@ var Login = {
|
||||
});
|
||||
}
|
||||
},
|
||||
recode: function () {
|
||||
|
||||
$('#randcodeimg').attr('src', $('#randcodeimg').attr('data-loading'));
|
||||
$('#randcode').html('').focus();
|
||||
|
||||
cn12306.loadRandCode('sjrand', function (data) {
|
||||
$('#randcodeimg').attr('src', data);
|
||||
}, "login/init");
|
||||
},
|
||||
getRandCode: function () {
|
||||
getRandCode: function() {
|
||||
var data = Login.formData;
|
||||
cn12306.checkRandCode('sjrand', data.randcode, function (data) {
|
||||
cn12306.checkRandCode('sjrand', data.randcode, function(data) {
|
||||
if (data.data !== 'Y') {
|
||||
Login.recode();
|
||||
cn12306.recode();
|
||||
Public.toast("验证码不正确!");
|
||||
} else {
|
||||
Login.submitLogin(data);
|
||||
}
|
||||
|
||||
}, function (xhr, type) {
|
||||
Login.recode();
|
||||
}, function(xhr, type) {
|
||||
cn12306.recode();
|
||||
Public.toast("校验验证码失败");
|
||||
}, "login/init")
|
||||
},
|
||||
formData: null,
|
||||
submitLogin: function () {
|
||||
submitLogin: function() {
|
||||
var loginData = {
|
||||
'loginUserDTO.user_name': Login.formData['username'],
|
||||
'userDTO.password': Login.formData['password'],
|
||||
'randCode': Login.formData['randcode']
|
||||
};
|
||||
// url, returnType, postdata, refer, headers
|
||||
bootStrap.post("login/loginAysnSuggest", null, loginData, "login/init").done(function(json) {
|
||||
if (json && json.data && json.data.loginCheck === 'Y') {
|
||||
Login.userPostLogin();
|
||||
return;
|
||||
}
|
||||
|
||||
cn12306.ajax({
|
||||
url: "login/loginAysnSuggest",
|
||||
data: loginData,
|
||||
refer: "login/init",
|
||||
success: function (json) {
|
||||
if (json && json.data && json.data.loginCheck === 'Y') {
|
||||
Login.userPostLogin();
|
||||
return;
|
||||
}
|
||||
var msg = (json.messages || ["未知错误"]).join(";");
|
||||
|
||||
var msg = (json.messages || ["未知错误"]).join(";");
|
||||
cn12306.recode();
|
||||
|
||||
Login.recode();
|
||||
|
||||
if (msg.indexOf("登录名") != -1) {
|
||||
$("#username").focus();
|
||||
Public.toast("用户名输入错误。");
|
||||
} else if (msg.indexOf("验证码") != -1) {
|
||||
$("#randcode").focus();
|
||||
Public.toast("验证码不正确。");
|
||||
} else if (msg.indexOf("邮箱") != -1) {
|
||||
$("#username").focus();
|
||||
Public.toast("邮箱输入错误。");
|
||||
} else if (msg.indexOf('密码') > -1) {
|
||||
$("#password").val("").focus();
|
||||
Public.toast("密码不正确,请重新输入。", 2000);
|
||||
} else if (msg.indexOf('锁定') > -1) {
|
||||
ui.postMessage(false, "您的账户已经被锁定,请稍后再试。", "login");
|
||||
} else if (msg.indexOf("系统维护") !== -1) {
|
||||
Public.toast("系统维护中");
|
||||
} else {
|
||||
Public.toast('未知错误');
|
||||
}
|
||||
},
|
||||
error: function (xhr, type) {
|
||||
if (xhr.status == 403) {
|
||||
Public.alert("警告!您的IP已经被封锁,请重试");
|
||||
} else {
|
||||
Public.alert("登录时网络错误");
|
||||
}
|
||||
if (msg.indexOf("登录名") != -1) {
|
||||
$("#username").focus();
|
||||
Public.toast("用户名输入错误。");
|
||||
} else if (msg.indexOf("验证码") != -1) {
|
||||
$("#randcode").focus();
|
||||
Public.toast("验证码不正确。");
|
||||
} else if (msg.indexOf("邮箱") != -1) {
|
||||
$("#username").focus();
|
||||
Public.toast("邮箱输入错误。");
|
||||
} else if (msg.indexOf('密码') > -1) {
|
||||
$("#password").val("").focus();
|
||||
Public.toast("密码不正确,请重新输入。", 2000);
|
||||
} else if (msg.indexOf('锁定') > -1) {
|
||||
ui.postMessage(false, "您的账户已经被锁定,请稍后再试。", "login");
|
||||
} else if (msg.indexOf("系统维护") !== -1) {
|
||||
Public.toast("系统维护中");
|
||||
} else {
|
||||
Public.toast('未知错误');
|
||||
}
|
||||
}).fail(function(xhr, type) {
|
||||
if (xhr.status == 403) {
|
||||
Public.alert("警告!您的IP已经被封锁,请重试");
|
||||
} else {
|
||||
Public.alert("登录时网络错误");
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
userPostLogin: function () {
|
||||
var url = "login/userLogin",
|
||||
refer = "login/init",
|
||||
headers = cn12306.getHeaders(url, refer);
|
||||
|
||||
cn12306.ajax({
|
||||
url: "login/userLogin",
|
||||
dataType: 'text',
|
||||
refer: "login/init",
|
||||
success: function () {
|
||||
Login.checkJsonAttr();
|
||||
},
|
||||
error: function (xhr, type) {
|
||||
Login.checkJsonAttr();
|
||||
}
|
||||
userPostLogin: function() {
|
||||
bootStrap.post("login/userLogin", 'text', null, "login/init").done(function() {
|
||||
Login.checkJsonAttr();
|
||||
}).fail(function() {
|
||||
Login.checkJsonAttr();
|
||||
});
|
||||
},
|
||||
checkJsonAttr: function (data) {
|
||||
checkJsonAttr: function(data) {
|
||||
var data = Login.formData;
|
||||
cn12306.isUserLogined(function () {
|
||||
cn12306.isUserLogined(function() {
|
||||
|
||||
sessionStorage.setItem("user", data.username);
|
||||
|
||||
@ -169,14 +140,14 @@ var Login = {
|
||||
|
||||
Public.toast("登录成功,正在进入订票页面,请稍等 ❤");
|
||||
|
||||
setTimeout(function () {
|
||||
setTimeout(function() {
|
||||
// 登录成功 跳转
|
||||
location.href = 'query.html';
|
||||
}, 1000);
|
||||
|
||||
}, function () {
|
||||
}, function() {
|
||||
Public.toast("未能成功登录,请重试。");
|
||||
}, function () {
|
||||
}, function() {
|
||||
Public.toast("登录时网络错误");
|
||||
});
|
||||
}
|
||||
|
@ -1,52 +0,0 @@
|
||||
var Perfect = {
|
||||
init : function(){
|
||||
if($('#perfect_page').length == 0){
|
||||
return false;
|
||||
}
|
||||
Perfect.checkLogin();
|
||||
},
|
||||
getPassenger:function(){
|
||||
cn12306.ajax({
|
||||
url:'confirmPassenger/getPassengerDTOs',
|
||||
refer:'leftTicket/init',
|
||||
success:function(data){
|
||||
if(data['status'] && Array.isArray(data["data"]["normal_passengers"]) && data["data"]["normal_passengers"].length > 0){
|
||||
Perfect.formatPassenger(data["data"]["normal_passengers"]);
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
},
|
||||
formatPassenger:function(lists){
|
||||
for (var i = 0; i < lists.length; i++) {
|
||||
if(Util.canPassageAddToOrder(lists[i])){
|
||||
lists[i]['key'] = lists[i]['passenger_type'] + "$" + lists[i]['passenger_name'] + "$" + lists[i]['passenger_id_type_code'] + "$" + lists[i]['passenger_id_no'];
|
||||
}
|
||||
};
|
||||
console.log(lists);
|
||||
},
|
||||
isLogin:false,
|
||||
checkNum: 0,
|
||||
checkLogin: function() {
|
||||
Perfect.checkNum++;
|
||||
cn12306.isUserLogined(Perfect.hasLogin, Perfect.noLogin, function() {
|
||||
Perfect.noLogin();
|
||||
if (Perfect.checkNum < 2) {
|
||||
Perfect.checkLogin();
|
||||
}
|
||||
});
|
||||
},
|
||||
hasLogin: function() {
|
||||
Perfect.isLogin = true;
|
||||
$('body').removeClass('nologin');
|
||||
$('#login_tip').hide();
|
||||
Perfect.getPassenger();
|
||||
},
|
||||
noLogin: function() {
|
||||
Perfect.isLogin = false;
|
||||
$('body').addClass('nologin');
|
||||
$('#login_tip').show();
|
||||
}
|
||||
}
|
@ -14,6 +14,11 @@ DOC.addEventListener("mobileSupportInitialized", function() {
|
||||
|
||||
var Public = {
|
||||
init: function() {
|
||||
// 刷新验证码
|
||||
$('#randcodeimg').live('click',function(e) {
|
||||
cn12306.recode();
|
||||
return false;
|
||||
});
|
||||
$('.query_box .query_bigcheck').live('click', function() {
|
||||
$('.query_bigcheck', $(this).parent('.query_box')).removeClass('query_bigcheck_checked');
|
||||
// $('.query_bigcheck input[type=radio]',$(this).parent('.query_box')).removeAttr('checked');
|
||||
|
@ -1,6 +1,6 @@
|
||||
var RunQuery = {
|
||||
init: function() {
|
||||
if($('#runquery_page').length == 0){
|
||||
if ($('#runquery_page').length == 0) {
|
||||
return false;
|
||||
}
|
||||
var maxDay = (new Date()).addDays(19);
|
||||
@ -9,11 +9,11 @@ var RunQuery = {
|
||||
Public.calendar.checkCallback = RunQuery.dateChangeCallback;
|
||||
|
||||
RunQuery.getQueryData();
|
||||
if(!RunQuery.curData){
|
||||
if (!RunQuery.curData) {
|
||||
window.location.href = 'query.html';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$('#filter_ok').on('click', function() {
|
||||
Public.hideInnerPage('filter');
|
||||
$('#query_form [name=filters]').val($('#filter_form').serialize());
|
||||
@ -35,25 +35,35 @@ var RunQuery = {
|
||||
|
||||
RunQuery.setFilter();
|
||||
|
||||
$('#filter_btn').on('click',function(){
|
||||
$('#filter_btn').on('click', function() {
|
||||
Public.showInnerPage('filter');
|
||||
});
|
||||
|
||||
$('#filter_cancel').on('click',function(){
|
||||
$('#filter_cancel').on('click', function() {
|
||||
Public.hideInnerPage();
|
||||
});
|
||||
|
||||
RunQuery.queryTicket();
|
||||
|
||||
$('[data-fn="buy"]').live('click',function(){
|
||||
var train = $(this).attr('data-traincode'),
|
||||
seat = $(this).attr('data-seatcode');
|
||||
console.log(RunQuery.trainData.trainMap[train])
|
||||
sessionStorage.setItem('curBuy',JSON.stringify(RunQuery.trainData.trainMap[train]));
|
||||
sessionStorage.setItem('curBuySeat',seat);
|
||||
|
||||
window.location.href = 'perfect.html';
|
||||
});
|
||||
},
|
||||
curData:null,
|
||||
getQueryData:function(){
|
||||
if(!!Public.his.queryObjs[Public.his.querys[0][0]]){
|
||||
curData: null,
|
||||
getQueryData: function() {
|
||||
if (!!Public.his.queryObjs[Public.his.querys[0][0]]) {
|
||||
RunQuery.curData = Public.his.queryObjs[Public.his.querys[0][0]];
|
||||
}
|
||||
},
|
||||
setFilter:function(){
|
||||
setFilter: function() {
|
||||
Query.setFilter(RunQuery.curData['filters'].split('&'));
|
||||
$('.station_title strong').html(RunQuery.curData['startname'] +'→'+RunQuery.curData['endname']);
|
||||
$('.station_title strong').html(RunQuery.curData['startname'] + '→' + 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']);
|
||||
@ -61,11 +71,12 @@ var RunQuery = {
|
||||
$('#query_form [name=type]').val(RunQuery.curData['type']);
|
||||
$('#query_form [name=filters]').val(RunQuery.curData['filters']);
|
||||
|
||||
var date = new Date(RunQuery.curData['start_date'].replace(/\-/g,'/'));
|
||||
var date = new Date(RunQuery.curData['start_date'].replace(/\-/g, '/'));
|
||||
$('#start_date').html(date.format('M月d日') + ' ' + date.day(3));
|
||||
$('#start_date_val').val(date.format('yyyy-MM-dd'));
|
||||
Public.calendar.setCurDate(date);
|
||||
},
|
||||
isLogin:false,
|
||||
isLogin: false,
|
||||
checkNum: 0,
|
||||
checkLogin: function() {
|
||||
RunQuery.checkNum++;
|
||||
@ -88,114 +99,95 @@ var RunQuery = {
|
||||
$('#login_tip').show();
|
||||
},
|
||||
|
||||
queryTicket : function(){
|
||||
// cn12306.get("leftTicket/query", setting, "json", function (text) {
|
||||
// var trains = htmlParser.analyzeTicketQueryData(text);
|
||||
|
||||
// if (showDlg) {
|
||||
// if (!trains.length) {
|
||||
// dlg.setState("block", "未能查询到任何车次,请修改条件或稍后重试。");
|
||||
// dlg.autoCloseDialog();
|
||||
// } else {
|
||||
// dlg.closeDialog();
|
||||
// }
|
||||
// }
|
||||
// callback.call(this, trains);
|
||||
// }, function (text) {
|
||||
// if (showDlg)
|
||||
// dlg.delayExecute(3, runquery, "操作出现网络错误");
|
||||
// }, "", "leftTicket/init");
|
||||
var loading = Public.showLoading('正在查票');
|
||||
|
||||
cn12306.ajax({
|
||||
type:"GET",
|
||||
url: "leftTicket/query",
|
||||
data: {
|
||||
queryTicket: function() {
|
||||
var loading = Public.showLoading('正在查票'),
|
||||
data = {
|
||||
"leftTicketDTO.train_date": RunQuery.curData.start_date,
|
||||
"leftTicketDTO.from_station": RunQuery.curData.startcode,
|
||||
"leftTicketDTO.to_station": RunQuery.curData.endcode,
|
||||
"purpose_codes": RunQuery.curData.type == "2" ? "0X00" : "ADULT"
|
||||
},
|
||||
refer: "leftTicket/init",
|
||||
success: function(json) {
|
||||
// console.log(JSON.stringify(json));
|
||||
if(json["status"] == true && json["httpstatus"] == 200){
|
||||
if(json['data'].length > 0){
|
||||
RunQuery.formatJson(json);
|
||||
RunQuery.formatList();
|
||||
}
|
||||
};
|
||||
// (url, returnType, postdata, refer, headers)
|
||||
bootStrap.get("leftTicket/query", "json", data, "leftTicket/init").done(function(json) {
|
||||
if (json["status"] == true && json["httpstatus"] == 200) {
|
||||
if (json['data'].length > 0) {
|
||||
RunQuery.formatJson(json);
|
||||
RunQuery.formatList();
|
||||
}
|
||||
Public.hideLoading(loading);
|
||||
},
|
||||
error: function(xhr, type) {
|
||||
console.log(xhr,type);
|
||||
Public.hideLoading(loading);
|
||||
}
|
||||
Public.hideLoading(loading);
|
||||
}).fail(function(xhr, type) {
|
||||
console.log(xhr, type);
|
||||
Public.hideLoading(loading);
|
||||
});
|
||||
},
|
||||
formatList:function(){
|
||||
formatList: function() {
|
||||
var lists = RunQuery.trainData.trainMap,
|
||||
html = '',
|
||||
obj={};
|
||||
obj = {};
|
||||
for (var k in lists) {
|
||||
if(!lists[k]['available']){
|
||||
continue;
|
||||
}
|
||||
// if (!lists[k]['available']) {
|
||||
// continue;
|
||||
// }
|
||||
obj = lists[k];
|
||||
html += '<li>';
|
||||
/*第1行*/
|
||||
html += '<div class="line no_border">';
|
||||
html += '<strong class="pull_right text_underline text_lg" data-id="'+obj["id"]+'">'+obj["code"]+'</strong>';
|
||||
html += '<strong class="text_warning text_lg link_label">'+obj["from"]["time"]+'</strong>';
|
||||
html += '<span class="text_lg">';
|
||||
if(obj["from"]["code"] == obj["start"]["code"]){
|
||||
html+='<i class="text_label">始</i>';
|
||||
}
|
||||
html += obj["from"]["name"]+'</span>';
|
||||
html += '</div>';
|
||||
html += '<strong class="pull_right text_underline text_lg" data-id="' + obj["id"] + '">' + obj["code"] + '</strong>';
|
||||
html += '<strong class="text_warning text_lg link_label">' + obj["from"]["time"] + '</strong>';
|
||||
html += '<span class="text_lg">';
|
||||
if (obj["from"]["code"] == obj["start"]["code"]) {
|
||||
html += '<i class="text_label">始</i>';
|
||||
}
|
||||
html += obj["from"]["name"] + '</span>';
|
||||
html += '</div>';
|
||||
|
||||
/*第2行*/
|
||||
html += '<div class="line">';
|
||||
/*第2行*/
|
||||
html += '<div class="line">';
|
||||
|
||||
ls = obj["elapsedTime"]['total'].split(':');
|
||||
html += '<span class="pull_right text_gray">'+ (!!ls[0]?ls[0]+'小时':'')+(!!ls[1]?ls[1]+'分':'0分')+'</span>';
|
||||
html += '<span class="text_lg link_label">';
|
||||
html += obj["to"]["time"]+'</span>';
|
||||
html += '<span class="text_lg">'
|
||||
if(obj["to"]["code"] == obj["end"]["code"]){
|
||||
html+='<i class="text_label">终</i>';
|
||||
}
|
||||
html += obj["to"]["name"]+'</span>';
|
||||
html += '</div>';
|
||||
ls = obj["elapsedTime"]['total'].split(':');
|
||||
html += '<span class="pull_right text_gray">' + (!!ls[0] ? ls[0] + '小时' : '') + (!!ls[1] ? ls[1] + '分' : '0分') + '</span>';
|
||||
html += '<span class="text_lg link_label">';
|
||||
html += obj["to"]["time"] + '</span>';
|
||||
html += '<span class="text_lg">'
|
||||
if (obj["to"]["code"] == obj["end"]["code"]) {
|
||||
html += '<i class="text_label">终</i>';
|
||||
}
|
||||
html += obj["to"]["name"] + '</span>';
|
||||
html += '</div>';
|
||||
|
||||
/*输出席别*/
|
||||
/*商务坐*/
|
||||
for (var i = 0; i < obj['ticketMapSort'].length; i++) {
|
||||
obj['ticketMapSort'][i];
|
||||
if(obj['ticketMapSort'][i]["count"] == 0){
|
||||
if (obj['ticketMapSort'][i]["count"] == 0) {
|
||||
continue;
|
||||
}
|
||||
html += '<div class="line"><span class="pull_right">';
|
||||
if(obj['ticketMapSort'][i]["count"]=='有'){
|
||||
html+='<span class="text_warning">有</span>';
|
||||
}else{
|
||||
html+='<span class="text_warning">'+obj['ticketMapSort'][i]["count"]+'</span>';
|
||||
html+='<span class="text_gray">张</span>';
|
||||
}
|
||||
html+='<a href="javascript:;" class="btn btn_success" data-traincode="'+obj["id"]+'" data-seatcode="'+obj['ticketMapSort'][i]["code"]+'">抢票</a>';
|
||||
html+='</span>';
|
||||
html+='<span class="link_label">'+obj['ticketMapSort'][i]['name']+'</span>';
|
||||
html+='<span class="text_gray">'+(obj['ticketMapSort'][i]['price']/10)+'元</span>';
|
||||
html+='</div>';
|
||||
html += '<div class="line"><span class="pull_right">';
|
||||
if (obj['ticketMapSort'][i]["count"] == '有') {
|
||||
html += '<span class="text_warning">有</span>';
|
||||
} else {
|
||||
html += '<span class="text_warning">' + obj['ticketMapSort'][i]["count"] + '</span>';
|
||||
html += '<span class="text_gray">张</span>';
|
||||
}
|
||||
if(!obj['isMaintain']){
|
||||
html += '<a href="javascript:;" class="btn btn_success" data-fn="buy" data-traincode="' + obj["id"] + '" data-seatcode="' + obj['ticketMapSort'][i]["code"] + '">抢票</a>';
|
||||
}else{
|
||||
html += '<span href="javascript:;" class="btn btn_gray">维护</span>';
|
||||
}
|
||||
html += '</span>';
|
||||
html += '<span class="link_label">' + obj['ticketMapSort'][i]['name'] + '</span>';
|
||||
html += '<span class="text_gray">' + (obj['ticketMapSort'][i]['price'] / 10) + '元</span>';
|
||||
html += '</div>';
|
||||
};
|
||||
|
||||
html+='</li>';
|
||||
html += '</li>';
|
||||
};
|
||||
$('#train_list').html(html);
|
||||
$('.station_title span').html('共 '+ $('#train_list li').length +' 趟列车');
|
||||
$('.station_title span').html('共 ' + $('#train_list li').length + ' 趟列车');
|
||||
},
|
||||
getTicketInfo:function (v) {
|
||||
var data = [], info = v.indexOf("#") === -1 ? v : /getSelected\(['"](.*?)['"]\)/i.exec(v)[1].split('#')[11],
|
||||
getTicketInfo: function(v) {
|
||||
var data = [],
|
||||
info = v.indexOf("#") === -1 ? v : /getSelected\(['"](.*?)['"]\)/i.exec(v)[1].split('#')[11],
|
||||
match = info.match(/([A-Z\d])0*?([\*\d]{5})0*?(\d{4})/gi);
|
||||
|
||||
for (var j in match) {
|
||||
@ -203,17 +195,30 @@ var RunQuery = {
|
||||
var sc = m[1];
|
||||
var sp = m[2][0] == '*' ? null : parseInt(m[2], 10);
|
||||
var st = parseInt(m[3], 10);
|
||||
var seat = { code: sc, name: Util.toSeatTypeName(sc), price: sp };
|
||||
var seat = {
|
||||
code: sc,
|
||||
name: Util.toSeatTypeName(sc),
|
||||
price: sp
|
||||
};
|
||||
if (st < 3000) {
|
||||
seat.count = st;
|
||||
|
||||
//TODO 二等软座提交是否和二等座一样都用的MO?
|
||||
//一等软座 7, 二等软座 8
|
||||
if (sc === "7") {
|
||||
data.push({ code: 'M', name: Util.toSeatTypeName('M'), price: sp, count: st });
|
||||
}
|
||||
else if (sc === "8") {
|
||||
data.push({ code: 'O', name: Util.toSeatTypeName('O'), price: sp, count: st });
|
||||
data.push({
|
||||
code: 'M',
|
||||
name: Util.toSeatTypeName('M'),
|
||||
price: sp,
|
||||
count: st
|
||||
});
|
||||
} else if (sc === "8") {
|
||||
data.push({
|
||||
code: 'O',
|
||||
name: Util.toSeatTypeName('O'),
|
||||
price: sp,
|
||||
count: st
|
||||
});
|
||||
} else {
|
||||
data.push(seat);
|
||||
}
|
||||
@ -226,12 +231,19 @@ var RunQuery = {
|
||||
};
|
||||
return data;
|
||||
},
|
||||
trainData:null,
|
||||
formatJson : function(data){
|
||||
if(!Array.isArray(data['data']) && !data['data'].length){
|
||||
trainData: null,
|
||||
formatJson: function(data) {
|
||||
if (!Array.isArray(data['data']) && !data['data'].length) {
|
||||
return null;
|
||||
}
|
||||
var lists = data['data'],train,kp,selltimem,trainData={ raw: data, rawTrainMap: {}, trainMap: {}, auto: null, nextTime: null };
|
||||
var lists = data['data'],
|
||||
train, kp, selltimem, trainData = {
|
||||
raw: data,
|
||||
rawTrainMap: {},
|
||||
trainMap: {},
|
||||
auto: null,
|
||||
nextTime: null
|
||||
};
|
||||
for (var i = 0; i < lists.length; i++) {
|
||||
t = lists[i];
|
||||
train = {
|
||||
@ -273,21 +285,24 @@ var RunQuery = {
|
||||
"secureStr": t['secretStr'],
|
||||
"selltime": null,
|
||||
"date": t["queryLeftNewDTO"]['start_train_date'].replace(/(\d{4})(\d{2})(\d{2})/, "$1-$2-$3"),
|
||||
"limitSellInfo": t['buttonTextInfo'] && t['buttonTextInfo'].indexOf("暂售") != -1 ? t['buttonTextInfo'].replace(/<[^>]+>/i, "") : null
|
||||
"form_train_date":RunQuery.curData.start_date,
|
||||
"limitSellInfo": t['buttonTextInfo'] && t['buttonTextInfo'].indexOf("暂售") != -1 ? t['buttonTextInfo'].replace(/<[^>]+>/i, "") : null,
|
||||
"isMaintain":t['buttonTextInfo'].indexOf("系统维护时间") != -1
|
||||
};
|
||||
kp = RunQuery.getTicketInfo(t["queryLeftNewDTO"]['yp_info']);
|
||||
train.tickets = kp;
|
||||
train.ticketMap = Util.mapObject(kp, function (e) { return e.code; });
|
||||
train.ticketMap = Util.mapObject(kp, function(e) {
|
||||
return e.code;
|
||||
});
|
||||
|
||||
train.ticketMapSort = Util.sortType(train.ticketMap);
|
||||
console.log(train.ticketMapSort);
|
||||
// for (var i = 0; i < train.ticketMapSort.length; i++) {
|
||||
// if(train.ticketMapSort[i]['count'] == 0){
|
||||
// train.ticketMapSort.splice(i,1);
|
||||
// i--;
|
||||
// }
|
||||
// };
|
||||
// //起售时间
|
||||
// //起售时间
|
||||
selltimem = /(0*(\d+)月0*(\d+)日)?(\d+)\s*点\s*((\d+)分)?\s*起售/i.exec(t.buttonTextInfo.replace(/<.*?>/g, ''));
|
||||
if (selltimem) {
|
||||
train.available = -1;
|
||||
@ -335,7 +350,7 @@ var RunQuery = {
|
||||
}
|
||||
}
|
||||
},
|
||||
hisUpdata:function(){
|
||||
hisUpdata: function() {
|
||||
Public.setHisQuery($('#startStationCode').val() + '-' + $('#endStationCode').val(), $('#query_form').serialize());
|
||||
Public.setHis();
|
||||
RunQuery.getQueryData();
|
||||
@ -343,108 +358,3 @@ var RunQuery = {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// var transferData = function (data, noProcess) {
|
||||
// var result = data;
|
||||
// if (!Array.isArray(result.data) || !result.data.length || !result.data[0].queryLeftNewDTO) {
|
||||
// exports.events.fireEvent("requestFailed");
|
||||
// };
|
||||
|
||||
// var trainData = { raw: result, rawTrainMap: {}, trainMap: {}, auto: null, nextTime: null };
|
||||
|
||||
// _.each(result.data, function (t) {
|
||||
// var train = {
|
||||
// id: t.queryLeftNewDTO.train_no,
|
||||
// code: t.queryLeftNewDTO.station_train_code,
|
||||
// available: t.queryLeftNewDTO.canWebBuy === 'Y' ? 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"),
|
||||
// limitSellInfo: t.buttonTextInfo && t.buttonTextInfo.indexOf("暂售") != -1 ? t.buttonTextInfo.replace(/<[^>]+>/i, "") : null
|
||||
// };
|
||||
// var kp = getTicketInfo(t.queryLeftNewDTO.yp_info);
|
||||
// train.tickets = kp;
|
||||
// train.ticketMap = _.mapObject(kp, function (e) { return e.code; });
|
||||
|
||||
// //起售时间
|
||||
// var selltimem = /(0*(\d+)月0*(\d+)日)?(\d+)\s*点\s*((\d+)分)?\s*起售/i.exec(t.buttonTextInfo.replace(/<.*?>/g, ''));
|
||||
// if (selltimem) {
|
||||
// train.available = -1;
|
||||
// train.selltime = new Date();
|
||||
// train.selltime.setHours(parseInt(selltimem[4]));
|
||||
// train.selltime.setMinutes(parseInt(selltimem[6] || "0", 10));
|
||||
// train.selltime.setSeconds(0);
|
||||
// if (selltimem[1]) {
|
||||
// //带日期
|
||||
// train.selltime.setMonth(parseInt(selltimem[2]) - 1);
|
||||
// train.selltime.setDate(parseInt(selltimem[3]));
|
||||
// if (train.selltime.getMonth() < new Date().getMonth()) {
|
||||
// train.selltime.setFullYear(train.selltime.getFullYear() + 1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// trainData.rawTrainMap[train.id] = t;
|
||||
// trainData.trainMap[train.id] = train;
|
||||
// });
|
||||
// trainData.original = _.values(trainData.trainMap);
|
||||
// trainData.available = trainData.original;
|
||||
// trainData.trainCodes = _.pluck(trainData.original, "code");
|
||||
// trainData.filtered = [];
|
||||
// trainData.include = trainData.available;
|
||||
|
||||
// // if (!noProcess) {
|
||||
// // //执行车次预过滤。过滤内容:出发地,目标地,时间
|
||||
// // exports.events.fireEvent("filterTrains", trainData);
|
||||
// // //处理车次
|
||||
// // exports.events.fireEvent("processTrains", trainData);
|
||||
|
||||
// // //过滤数据
|
||||
// // if (trainData.filtered && trainData.filtered.length) {
|
||||
// // //从原始数据中删除
|
||||
// // var orgMap = _.mapObject(result.data, function (e) {
|
||||
// // return e.queryLeftNewDTO.train_no;
|
||||
// // });
|
||||
// // var filtered = _.map(trainData.filtered, function (t) {
|
||||
// // return orgMap[t.id];
|
||||
// // });
|
||||
// // trainData.rawDataFiltered = _.without.apply(null, [result.data].concat(filtered));
|
||||
// // result.data = trainData.rawDataFiltered;
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// return trainData;
|
||||
// };
|
@ -174,6 +174,24 @@ var Util = {
|
||||
return false;
|
||||
|
||||
return p['total_times'] === "93" || p['total_times'] === "95" || p['total_times'] === "97" || p['total_times'] === "99";
|
||||
},
|
||||
getAvailableTicketType : function (p, stu) {
|
||||
var a = [];
|
||||
var pt = p.passenger_type;
|
||||
|
||||
if (pt === "3" && stu) {
|
||||
a.push({ id: 3, name: "学生票" });
|
||||
} else {
|
||||
a.push({ id: 1, name: "成人票" });
|
||||
a.push({ id: 2, name: "儿童票" });
|
||||
if (pt === "3"){
|
||||
a.push({ id: 3, name: "学生票" });
|
||||
}
|
||||
}
|
||||
if (pt === "4") {
|
||||
a.push({ id: 4, name: "残军票" });
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
var base64 = {
|
||||
|
@ -46,25 +46,26 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="towbtn"><a href="#" class="btn"><i class="icon_label">New</i>预售提醒</a><a href="#" class="btn">余票查询</a></div>
|
||||
<div class="towbtn"><a href="#" class="btn"><i class="icon_label">New</i>预售提醒</a><a href="query.html" class="btn">余票查询</a></div>
|
||||
<div class="footer_tip"><div class="pull_right">官方订票电话: <a href="tel:95105105" class="text_warning">95105105</a></div>购票时间: 7:00-23:00</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="date"></div>
|
||||
|
||||
<script src="js/fastclick.js"></script>
|
||||
<script src="js/zepto.js"></script>
|
||||
<script src="js/public.js"></script>
|
||||
<script src="js/util.js"></script>
|
||||
<script src="js/12306.js"></script>
|
||||
<script src="js/LunarCalendar.js"></script>
|
||||
<script src="js/date.js"></script>
|
||||
<script src="js/check_station.js"></script>
|
||||
<script src="js/login.js"></script>
|
||||
<script src="js/fastclick.js"></script>
|
||||
<script src="js/zepto.js"></script>
|
||||
<script src="js/public.js"></script>
|
||||
<script src="js/util.js"></script>
|
||||
<script src="js/12306.js"></script>
|
||||
<script src="js/LunarCalendar.js"></script>
|
||||
<script src="js/date.js"></script>
|
||||
<script src="js/check_station.js"></script>
|
||||
<script src="js/login.js"></script>
|
||||
<script src="js/query.js"></script>
|
||||
<script src="js/run_query.js"></script>
|
||||
<script src="js/init.js"></script>
|
||||
<script src="js/prdersubmit.js"></script>
|
||||
<script src="js/init.js"></script>
|
||||
<!--<script src="js/js.min.js"></script>-->
|
||||
</body>
|
||||
</html>
|
||||
|
@ -11,24 +11,20 @@
|
||||
<link rel="stylesheet" type="text/css" href="css/css.css">
|
||||
</head>
|
||||
|
||||
<body id="perfect_page">
|
||||
<body id="ordersubmit_page">
|
||||
<div class="wrap" id="wrap">
|
||||
<header class="header">
|
||||
<div class="h_l"><a href="javascript:;" data-fn="back"><i class="icon_back"></i></a></div>
|
||||
<span class="h_t">预定车票</span>
|
||||
</header>
|
||||
<div class="main">
|
||||
<div class="box"><div class="info">
|
||||
<div class="info_title"><span class="pull_right">K2341</span><span>2014-8-6 星期三</span></div>
|
||||
<div class="stations_info"><div class="station_info"><strong>北京</strong>00:47</div>
|
||||
<div class="station_info"><strong>呼和浩特</strong>10:47</div></div>
|
||||
</div></div>
|
||||
<div class="box"><div class="info" id="trainInfo"></div></div>
|
||||
<div class="passenger">
|
||||
<ul class="passenger_list">
|
||||
<li class="clearfix"><span class="pull_left"><strong>房祖名</strong>成人票<br>
|
||||
421223198506217292</span><span class="pull_right">软卧312元 <a href="#"><i class="icon_edit"></i></a></span></li>
|
||||
<ul class="passenger_list" id="passenger_list">
|
||||
<!--<li class="clearfix"><span class="pull_left"><strong>房祖名</strong>成人票<br>
|
||||
421223198506217292</span><span class="pull_right">软卧312元 <a href="#"><i class="icon_edit"></i></a></span></li>-->
|
||||
</ul>
|
||||
<a href="#" class="add_block">添加乘车人</a> </div>
|
||||
<a href="javascript:;" class="add_block" id="add_passenger">添加乘车人</a> </div>
|
||||
<div class="box_insert">
|
||||
<div class="form"><div class="form_line">
|
||||
<label class="form_label">验证码</label>
|
||||
@ -42,120 +38,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fixed_box" id="filter">
|
||||
<div class="fixed_box" id="passenger">
|
||||
<header class="header">
|
||||
<div class="h_l"><a href="javascript:;" id="filter_cancel">取消</a></div>
|
||||
<span class="h_t">选择条件</span>
|
||||
<div class="h_r"><a href="javascript:;" id="filter_ok">确定</a></div>
|
||||
<span class="h_t">选择乘车人</span>
|
||||
<div class="h_r"><a href="javascript:;" id="passenger_ok">确定</a></div>
|
||||
</header>
|
||||
<form id="filter_form" action="">
|
||||
<div class="form_title">选择类型</div>
|
||||
<div class="box_insert query_box checks">
|
||||
<label class="query_checkbox">
|
||||
<input name="train_type" type="checkbox" checked value="all">
|
||||
全选 </label>
|
||||
<label class="query_checkbox query_checkbox2">
|
||||
<input name="train_type" type="checkbox" checked value="G|C">
|
||||
GC-高铁/城际 </label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_type" type="checkbox" checked value="D">
|
||||
D-动车 </label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_type" type="checkbox" checked value="Z">
|
||||
Z-直达 </label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_type" type="checkbox" checked value="T">
|
||||
T-特快 </label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_type" type="checkbox" checked value="K">
|
||||
K-快速 </label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_type" type="checkbox" checked value="L">
|
||||
L-临客 </label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_type" type="checkbox" checked value="QT">
|
||||
其它 </label>
|
||||
</div>
|
||||
<div class="form_title">选择席别</div>
|
||||
<div class="box_insert query_box checks">
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="all">
|
||||
全选</label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="9">
|
||||
商务座</label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="P">
|
||||
特等座</label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="M">
|
||||
一等座</label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="O">
|
||||
二等座</label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="6">
|
||||
高等软卧</label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="4">
|
||||
软卧</label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="3">
|
||||
硬卧</label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="2">
|
||||
软座</label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="1">
|
||||
硬座</label>
|
||||
<label class="query_checkbox">
|
||||
<input name="train_seat" type="checkbox" checked value="0">
|
||||
无座</label>
|
||||
</div>
|
||||
<div class="form_title">选择时间段</div>
|
||||
<div class="box_insert query_box">
|
||||
<label class="query_bigcheck query_bigcheck_checked">
|
||||
<input type="radio" name="timeslot" checked value="0">
|
||||
<span class="bfont">全选</span></label>
|
||||
<label class="query_bigcheck">
|
||||
<input type="radio" name="timeslot" value="1">
|
||||
<span>00:00<br>
|
||||
~<br>
|
||||
06:00</span></label>
|
||||
<label class="query_bigcheck">
|
||||
<input type="radio" name="timeslot" value="2">
|
||||
<span>06:00<br>
|
||||
~<br>
|
||||
12:00</span></label>
|
||||
<label class="query_bigcheck">
|
||||
<input type="radio" name="timeslot" value="3">
|
||||
<span>12:00<br>
|
||||
~<br>
|
||||
18:00</span></label>
|
||||
<label class="query_bigcheck">
|
||||
<input type="radio" name="timeslot" value="4">
|
||||
<span>18:00<br>
|
||||
~<br>
|
||||
24:00</span></label>
|
||||
</div>
|
||||
<div class="form_title">预定车次</div>
|
||||
<form id="passenger_form" action="">
|
||||
<div class="box_insert query_box checks" id="passengers"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="fixed_box" id="date_box">
|
||||
<header class="header"><span class="h_t">选择日期</span><!--<div class="h_r"><a href="javascript:;" id="date_sure"><i class="icon_sure"></i></a></div>--></header>
|
||||
<div id="calendar"></div>
|
||||
<div class="box">
|
||||
<div><span class="label_sale">在售</span><span class="label_remind">可预约</span></div>
|
||||
<div class="footer_tip">部分车次预售期特殊,请以售票时显示时间为准.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="top_menu" id="user_menu">
|
||||
<ul class="link_list">
|
||||
<li><a href="#">预售提醒</a></li>
|
||||
<li><a href="#">我的订单</a></li>
|
||||
<li><a href="/12306/login.html" data-fn="login" id="login">登录</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="bottom_tip" id="login_tip"><a href="/12306/login.html">登录可以提高抢票成功率!</a></div>
|
||||
<div class="tip_small" id="date_tip"></div>
|
||||
<!--<div class="fixed_box fixed_box_show" id="search_station">
|
||||
@ -197,6 +88,77 @@
|
||||
<li><a href="javascript:;">郑州</a></li>
|
||||
</ul></div>
|
||||
</div>-->
|
||||
|
||||
<div class="layer" id="layer">
|
||||
</div>
|
||||
<div class="passenger" id="edit_menu">
|
||||
<ul class="passenger_list">
|
||||
<li class="clearfix" id="passenger_editinfo"></li></ul>
|
||||
<ul class="link_list">
|
||||
<li><a href="javascript:;" data-fn="children">用此成人证件买儿童票</a></li>
|
||||
<li><a href="javascript:;" data-fn="seat">重选席别</a></li>
|
||||
<li><a href="javascript:;" data-fn="ticket">重选票别</a></li>
|
||||
<li><a href="javascript:;" data-fn="remove" class="text_error">移除此乘车人</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="edit_seat"><div class="form_title text_center">选择席别</div><ul class="link_list"></ul></div>
|
||||
<div id="edit_ticket"><div class="form_title text_center">选择票别</div><ul class="link_list"></ul></div>
|
||||
|
||||
<!--<form id="pay" action="https://epay.12306.cn/pay/webBusiness" method="post" name="myform">
|
||||
<input type="hidden" value="PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iR0JLIj8+CjxQYXlSZXE+PGludGVyZmFjZU5h
|
||||
bWU+UEFZX1NFUlZMRVQ8L2ludGVyZmFjZU5hbWU+PGludGVyZmFjZVZlcnNpb24+MS4wPC9pbnRl
|
||||
cmZhY2VWZXJzaW9uPjxvcmRlckRhdGU+MjAxNDA4MjIxNTMzMjM8L29yZGVyRGF0ZT48b3JkZXJU
|
||||
aW1lb3V0RGF0ZT4yMDE0MDgyMjE1NDcwMDwvb3JkZXJUaW1lb3V0RGF0ZT48b3JkZXJJZD4xRTQ0
|
||||
MTMwOTI4NzAwMTAwMTE1MzMyMzY3Mzwvb3JkZXJJZD48YW1vdW50PjEwMDwvYW1vdW50PjxhcHBJ
|
||||
ZD4wMDAxPC9hcHBJZD48Y3VyVHlwZT4xNTY8L2N1clR5cGU+PG9yZGVyUmVtYXJrLz48bWVyVVJM
|
||||
Pmh0dHBzOi8va3lmdy4xMjMwNi5jbi9vcG4vZW5vdGlmeS9lcGF5U3RhdHVzP3VzZXJfbmFtZT1i
|
||||
SGt5TnpZeE1EWTFORGs9JmFtcDtzZXF1ZW5jZV9ubz1SVFEwTVRNd09USTROdz09JmFtcDtwYXlP
|
||||
cmRlcklEPU1VVTBOREV6TURreU9EY3dNREV3TURFeE5UTXpNak0yTnpNPSZhbXA7cmVkaXJlY3RV
|
||||
Ukw9YUhSMGNITTZMeTlyZVdaM0xqRXlNekEyTG1OdUwyOTBiaTh2YjNKa1pYSXZaVTV2ZEdsbWVV
|
||||
RmpkR2x2Ymk1a2J6OXRaWFJvYjJROQ0KY1hWbGNubE5lVTl5WkdWeVUzUmhkR2xqSm5ObGNYVmxi
|
||||
bU5sWDI1dlBVVTBOREV6TURreU9EYz0mYW1wO3BheVN0YXJ0PU1RPT0mYW1wO2JhdGNoX25vPU1T
|
||||
TT0mYW1wO2xvZ2luX2lkPU9VbzFNM0EwYVZsc01sTjFNRll3ZVhBMWNUWm5NVE5FUlRKS2VsZ3cm
|
||||
YW1wO3RvdXJfZmxhZz1aR009JmFtcDtyZXR1cm5fdG90YWw9JmFtcDtyZXR1cm5fY29zdD0mYW1w
|
||||
O29sZF90aWNrZXRfcHJpY2U9JmFtcDtwYXlfbW9kZT0mYW1wO2NoYW5uZWw9UlE9PTwvbWVyVVJM
|
||||
PjxhcHBVUkw+aHR0cHM6Ly8xMC4xLjIxMy4yMzk6NDQzL29wbi9lbm90aWZ5L2VwYXlOb3RpZnk8
|
||||
L2FwcFVSTD48aW5uZXJVUkw+aHR0cDovLzEwLjEuMTk5LjEwNjo4MjAwL290c3dzL3BheUNhbGxC
|
||||
YWNrPC9pbm5lclVSTD48bWVyVkFSPmJIa3lOell4TURZMU5EazZPVW8xTTNBMGFWbHNNbE4xTUZZ
|
||||
d2VYQTFjVFpuTVRORVJUSktlbGd3T2tVME5ERXpNRGt5T0RjNk1TTTYNCk1Ub3hNemN4T0RrNU5q
|
||||
UXdNRG82T2pvNk9qbzZaR002UlRveE9rND08L21lclZBUj48dHJhbnNUeXBlPjAxPC90cmFuc1R5
|
||||
cGU+PC9QYXlSZXE+" name="tranData">
|
||||
<input type="hidden" value="01" name="transType">
|
||||
<input type="hidden" value="1" name="channelId">
|
||||
<input type="hidden" value="0001" name="appId">
|
||||
<input type="hidden" value="fQ0EfSLFV95bZQgGBPLO3Mq0dCY1ZEJXPOG1dnMZNJ+a2S7SFVw6DPWwYo1RxQnQjzWRvJB1qElp
|
||||
AEkCD4xrn+8Rsj6SGoPKuGvApbogAa+bq7iYtr379QHtwYNjADdTKV8AtyRheTRiRIReEoHJNl2W
|
||||
hH6cxvf4YuNH79uYjfM=" name="merSignMsg">
|
||||
<input type="hidden" value="220.181.42.195" name="merCustomIp">
|
||||
<input type="hidden" value="20140822154700" name="orderTimeoutDate">
|
||||
<input type="hidden" name="bankId" value="03080000">
|
||||
<input type="submit" value="tijiao">
|
||||
</form>
|
||||
|
||||
<form action="https://netpay.cmbchina.com/netpayment/BaseHttp.dll?PrePayC2" method="post" name="myform" id="pay2">
|
||||
https://netpay.cmbchina.com/netpayment/BaseHttp.dll?MB_Pay_FromPC
|
||||
|
||||
<input type="hidden" name="Amount" value="1.00">
|
||||
|
||||
<input type="hidden" name="MerchantCode" value="|QOpY/THy*ax2PeKEiGZdGLdI7xqZ/ZzvDImPAQDhForDNvy9|b22fa3550cce304bf14f9dfaee4d1fd8831633af">
|
||||
|
||||
<input type="hidden" name="BillNo" value="W2014082255046829">
|
||||
|
||||
<input type="hidden" name="Date" value="20140822">
|
||||
|
||||
<input type="hidden" name="MerchantUrl" value="http://epay.12306.cn/pay/payResponse">
|
||||
|
||||
<input type="hidden" name="CoNo" value="006958">
|
||||
|
||||
<input type="hidden" name="BranchID" value="0010">
|
||||
|
||||
<input type="hidden" name="MerchantPara" value="TRANS_ID=W2014082255046829|bankId=03080000|ExpireTime=20140822154700">
|
||||
<input type="submit" value="tijiao2">
|
||||
|
||||
</form>-->
|
||||
<script src="js/fastclick.js"></script>
|
||||
<script src="js/zepto.js"></script>
|
||||
<script src="js/public.js"></script>
|
||||
@ -208,8 +170,29 @@
|
||||
<script src="js/login.js"></script>
|
||||
<script src="js/query.js"></script>
|
||||
<script src="js/run_query.js"></script>
|
||||
<script src="js/perfect.js"></script>
|
||||
<script src="js/prdersubmit.js"></script>
|
||||
<script src="js/init.js"></script>
|
||||
<!--<script>
|
||||
function postaa(){
|
||||
var data = $('#pay').serialize();
|
||||
bootStrap.post('https://epay.12306.cn/pay/webBusiness', 'text', data, 'https://epay.12306.cn/pay/payGateway').done(function(data) {
|
||||
|
||||
}).fail(function() {
|
||||
|
||||
});
|
||||
}
|
||||
function postb(){
|
||||
var data = $('#pay2').serialize();
|
||||
bootStrap.post('https://netpay.cmbchina.com/netpayment/BaseHttp.dll?PrePayC2', 'text', data, 'https://epay.12306.cn/pay/webBusiness').done(function(data) {
|
||||
|
||||
}).fail(function() {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>-->
|
||||
<!--<script src="js/js.min.js"></script>-->
|
||||
</body>
|
||||
</html>
|
||||
|
@ -123,18 +123,19 @@
|
||||
<li><a href="javascript:;">郑州</a></li>
|
||||
</ul></div>
|
||||
</div>-->
|
||||
<script src="js/fastclick.js"></script>
|
||||
<script src="js/zepto.js"></script>
|
||||
<script src="js/public.js"></script>
|
||||
<script src="js/util.js"></script>
|
||||
<script src="js/12306.js"></script>
|
||||
<script src="js/LunarCalendar.js"></script>
|
||||
<script src="js/date.js"></script>
|
||||
<script src="js/check_station.js"></script>
|
||||
<script src="js/login.js"></script>
|
||||
<script src="js/fastclick.js"></script>
|
||||
<script src="js/zepto.js"></script>
|
||||
<script src="js/public.js"></script>
|
||||
<script src="js/util.js"></script>
|
||||
<script src="js/12306.js"></script>
|
||||
<script src="js/LunarCalendar.js"></script>
|
||||
<script src="js/date.js"></script>
|
||||
<script src="js/check_station.js"></script>
|
||||
<script src="js/login.js"></script>
|
||||
<script src="js/query.js"></script>
|
||||
<script src="js/run_query.js"></script>
|
||||
<script src="js/init.js"></script>
|
||||
<script src="js/prdersubmit.js"></script>
|
||||
<script src="js/init.js"></script>
|
||||
<!--<script src="js/js.min.js"></script>-->
|
||||
</body>
|
||||
</html>
|
||||
|
@ -84,18 +84,19 @@
|
||||
</div>
|
||||
<div class="bottom_tip" id="login_tip"><a href="/12306/login.html">登录可以提高抢票成功率!</a></div>
|
||||
<div class="tip_small" id="date_tip"></div>
|
||||
<script src="js/fastclick.js"></script>
|
||||
<script src="js/zepto.js"></script>
|
||||
<script src="js/public.js"></script>
|
||||
<script src="js/util.js"></script>
|
||||
<script src="js/12306.js"></script>
|
||||
<script src="js/LunarCalendar.js"></script>
|
||||
<script src="js/date.js"></script>
|
||||
<script src="js/check_station.js"></script>
|
||||
<script src="js/login.js"></script>
|
||||
<script src="js/fastclick.js"></script>
|
||||
<script src="js/zepto.js"></script>
|
||||
<script src="js/public.js"></script>
|
||||
<script src="js/util.js"></script>
|
||||
<script src="js/12306.js"></script>
|
||||
<script src="js/LunarCalendar.js"></script>
|
||||
<script src="js/date.js"></script>
|
||||
<script src="js/check_station.js"></script>
|
||||
<script src="js/login.js"></script>
|
||||
<script src="js/query.js"></script>
|
||||
<script src="js/run_query.js"></script>
|
||||
<script src="js/init.js"></script>
|
||||
<script src="js/prdersubmit.js"></script>
|
||||
<script src="js/init.js"></script>
|
||||
<!--<script src="js/js.min.js"></script>-->
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user