更新。。

This commit is contained in:
iFish 2015-03-16 19:13:36 +08:00
parent 5c56e76157
commit 52d12e891d
16 changed files with 3367 additions and 69 deletions

3184
Web12306/Scripts/typings/jquery.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -238,6 +238,7 @@
<Content Include="images\search-box-bg.png" />
<Content Include="images\ticket-submit-info-arrow-w.png" />
<Content Include="images\ticket-submit-info-arrow.png" />
<Content Include="images\vc-marker.png" />
<Content Include="images\wxqr.png" />
<Content Include="index.html" />
<Content Include="js\account\keepalive.js" />
@ -303,6 +304,7 @@
<Content Include="js\ui\widget_sell_notification.js" />
<Content Include="js\ui\widget_verifycode.js" />
<Content Include="js\vc\touchvc.js" />
<Content Include="js\vc\touchvc1.js" />
<Content Include="packages.config" />
<None Include="Scripts\_references.js" />
<Content Include="js\utility.js" />
@ -325,6 +327,7 @@
</ItemGroup>
<ItemGroup>
<TypeScriptCompile Include="Scripts\typings\chrome.d.ts" />
<TypeScriptCompile Include="Scripts\typings\jquery.d.ts" />
<TypeScriptCompile Include="Scripts\typings\underscore.d.ts" />
</ItemGroup>
<ItemGroup>

View File

@ -119,3 +119,14 @@
right: -45px;
bottom: -24px;
}
/*验证码*/
.vc-touchclick-marker {
position: absolute;
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAflBMVEX/AAD/////////////////////////////////////////////////////////////////////////////////////////////////Zmb/AAD/o6P/1NT/6ur/9fX/////d3f/U1P/sLD/vLz/IyP/39//PT3/hob/lZX/yMhzeP54AAAAGXRSTlMAEBcgJzA3QEdQV2BncHeAh5CWoLDA0ODw9H53rAAAAUxJREFUeF6909tugzAMBmCga+l6GCsQqHPmTN//BedkEbE6adVuZqkXVT7s3yIk/EUlPPm1/gLSNII8z9NncND6gmBX1MwYKaX/R0G1dOqUlEpY8OG65gkYzoHlcks/3inICoZgbgsRwLyoTwIyLcA1tsNkAVYhdVsdaMjtQS7Gub0VfgUK3h8BjCvnkjUGC3uQDOXUi5nz/i5wPHTfKXRGtthfGYaQleCxREHXPDjQLUtc0077CN5KtR1JI3GYudfHmOFNr9xXh+Mf/RraR3AL51Yj6p2E9oOC2oZYDujRLzHQNY+6FwoQSARGg9dLFUGSXgvmwEBfiMzpmnsP8AiYB4sVahdBVk5yRAAbMHWxIyNCVzG70R7oeOUIGNzvjCAEICN054ACd9POw0+QXJoB4FFqd1dT1OgI8HVm7JSkeeq1aS4vP5x/BS/qC3YfObrN3LM7AAAAAElFTkSuQmCC') /*../images/vc-marker.png*/;
width: 32px;
height: 32px;
z-index: 10;
opacity: 0.5;
cursor: pointer;
}

View File

@ -67,18 +67,19 @@
margin: 0 45px 20px 45px;
padding: 0;
overflow: hidden;
position: relative;
}
#user-login-dialog .verify-code input {
/*#user-login-dialog .verify-code input {
float: left;
padding: 12px;
line-height: 14px;
border: 1px solid #bfbfbf;
width: 90px;
margin: 0;
}
}*/
#user-login-dialog .verify-code span {
/*#user-login-dialog .verify-code span {
border: 1px solid #bebebe;
background-color: #fff;
width: 86px;
@ -91,17 +92,24 @@
background-position: 50% 50%;
background-size: auto;
cursor: pointer;
}*/
#user-login-dialog .verify-code span {
cursor: pointer;
}
#user-login-dialog .verify-code a {
display: block;
width: auto;
line-height: 16px;
margin-top: 24px;
/*margin-top: 24px;
float: left;
margin-left: 10px;
margin-left: 10px;*/
color: #2c90ed;
text-decoration: underline;
position: absolute;
right: 0;
top: 0;
}
#user-login-dialog .verify-code a:hover {

View File

@ -10,7 +10,7 @@
float: left;
background-color: #fbfbfb;
position: relative;
height: 250px;
height: 400px;
color: #000;
border-radius: 10px 10px 11px 11px;
}
@ -108,7 +108,7 @@
#ticket-submit-rings {
position: absolute;
left: 390px;
height: 250px;
height: 400px;
z-index: 2;
}
@ -120,19 +120,19 @@
border-radius: 5px;
border: 1px solid #c9c8c6;
background: linear-gradient(to bottom, #fff, #f1f0f1);
top: 35px;
top: 130px;
box-shadow: 0 0 5px rgba(100,100,100,0.3);
}
#ticket-submit-rings span:nth-child(1) {
top: 192px;
top: 300px;
}
#ticket-submit-info {
width: 490px;
float: right;
background-color: #fff8e1;
height: 250px;
height: 400px;
border-radius: 10px;
}
@ -187,6 +187,7 @@
width: 300px;
margin: 20px auto 20px auto;
overflow: hidden;
position: relative;
}
#ticket-submit-info .ticket-submit-vc input {
@ -200,7 +201,7 @@
float: left;
}
#ticket-submit-info .ticket-submit-vc span {
/*#ticket-submit-info .ticket-submit-vc span {
margin-left: 15px;
width: 85px;
height: 36px;
@ -211,15 +212,18 @@
background-position: 50% 50%;
background-color: #fff;
cursor: pointer;
}
}*/
#ticket-submit-info .ticket-submit-vc a {
vertical-align: bottom;
/*vertical-align: bottom;
display: block;
float: left;
margin-left: 15px;
line-height: 20px;
margin-top: 16px;
margin-top: 16px;*/
position: absolute;
right: 0;
top: 0;
font-size: 14px;
color: #8d5000;
text-decoration: underline;

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

View File

@ -827,10 +827,15 @@
<input type="password" value="" id="" placeholder="请输入登录密码" />
<a href="https://kyfw.12306.cn/otn/forgetPassword/initforgetMyPassword" target="_blank" class="help-link">忘记密码</a>
</div>
<div class="verify-code" data-target="login">
<!--<div class="verify-code" data-target="login">
<input type="text" value="" id="" placeholder="验证码" />
<span></span>
<a href="javascript:;" class="refresh-vc">看不清?换一张</a>
</div>-->
<div class="verify-code" data-target="login">
<input type="hidden" value="" id="" placeholder="验证码" />
<img src="/images/loading.gif" class="vc-touchclick" />
<a href="javascript:;" class="refresh-vc">换一张</a>
</div>
<footer data-col="2">
<a class="button button-default" href="https://kyfw.12306.cn/otn/regist/init" target="_blank">
@ -880,8 +885,8 @@
<i class="fa fa-times cancel-button"></i>
</header>
<p class="ticket-submit-vc verify-code" data-target="order">
<input type="text" value="" maxlength="4" id="" placeholder="验证码" />
<span></span>
<input type="hidden" value="" id="" placeholder="验证码" />
<img src="/images/loading.gif" class="vc-touchclick" />
<a href="javascript:;" class="refresh-vc">换一张</a>
</p>
<p class="ticket-submit-status">
@ -921,10 +926,10 @@
<i class="fa fa-ban"></i>
取消订票
</button>
<div class="ticket-submit-failed-bd">
<!--<div class="ticket-submit-failed-bd">
<a href="javascript:;" class="bd-bx" target="_blank"></a>
<a href="http://bj.ppzuche.com/ticket/signup?utm_source=liebaoqiangpiao" target="_blank" class="bd-dd"></a>
</div>
</div>-->
</footer>
</section>
<section class="ticket-submit-info-status-ok">

View File

@ -51,7 +51,7 @@
.done(function (text) {
var checkReg = /['"].*?dynamicJs\/(.+?)['"]/g;
var pingurl = checkReg.exec(text) && RegExp.$1;
var code = /key\s*=\s*'(.*?)'/.exec(text) && RegExp.$1;
var code = /gc\(\)\s*{.*?['"]([^"']+)['"]/i.exec(text) && RegExp.$1;
if (!code || !pingurl) {
def.resolve(null);

View File

@ -205,7 +205,7 @@
var checkVc = function () {
def.notify({ msg: "正在检查验证码..." });
var xdef = vc.checkLoginVc(randcode);
var xdef = vc.checkLoginVc(randcode, "leftTicket/init", "randp");
xdef.done(function () {
submitOrder();
}).fail(function (msg) {

View File

@ -2,14 +2,16 @@
var ajax = require("../platform/webRequest.js");
var utility = require("../utility.js");
exports.checkLoginVc = function (code) {
exports.checkLoginVc = function (code, refer, type) {
var def = new $.Deferred();
type = type || "sjrand";
refer = refer || "login/init";
ajax.sendPost("passcodeNew/checkRandCodeAnsyn", "login/init", {
rand: "sjrand",
ajax.sendPost("passcodeNew/checkRandCodeAnsyn", refer, {
rand: type,
randCode: code,
myversion: "undefined",
randCode_validate: utility.getVcValidate(code)
myversion: "undefined"//,
//randCode_validate: utility.getVcValidate(code)
}, "json", function () {
if (!this.model.data || this.model.data.result != 1)
def.reject("验证码错误");

File diff suppressed because one or more lines are too long

View File

@ -308,20 +308,23 @@
require("./ui-dnsspeeding.js");
//暂时屏蔽
$.showModalDialog("由于12306的验证码调整请暂时使用官网购票。助手会回来的感谢您的关注。这是12306的进步请为12306点赞 :-)", {
image: "/images/cat.png",
buttons: [
{
text: "访问12306官网",
type: "primary",
callback: function () {
window.open("https://kyfw.12306.cn/otn/leftTicket/init");
return false;
}
}
],
closeOnAction: false
});
//$.showModalDialog("由于12306的验证码调整请暂时使用官网购票。助手会回来的感谢您的关注。这是12306的进步请为12306点赞 :-)", {
// image: "/images/cat.png",
// buttons: [
// {
// text: "访问12306官网",
// type: "primary",
// callback: function () {
// window.open("https://kyfw.12306.cn/otn/leftTicket/init");
// return false;
// }
// }
// ],
// closeOnAction: false
//});
//新版验证
require("../vc/touchvc1.js");
//自动查询

View File

@ -27,7 +27,7 @@
$("#user-login-dialog input:password").val(info.pwd);
$("#user-login-dialog input:text:first").val(info.name);
}
$("#user-login-dialog input:text:last").val("");
$("#user-login-dialog input[type='hidden']").val("");
widget.showFloatDialog(dlg);
@ -62,7 +62,7 @@
return def.promise();
};
this.loginAsync = function (preventError) {
var inputs = $("#user-login-dialog input:text");
var inputs = $("#user-login-dialog input:text, #user-login-dialog input:hidden");
var un = inputs[0].value;
var pwd = $("#user-login-dialog input:password").val();
var randcode = inputs[1].value;
@ -101,7 +101,7 @@
"loginUserDTO.user_name": un,
"userDTO.password": pwd,
"randCode": randcode,
"randCode_validate": utility.getVcValidate(randcode),
//"randCode_validate": utility.getVcValidate(randcode),
myversion: "undefined"
};
if (dynKey)
@ -200,10 +200,10 @@
$("#user-login-dialog button.button-primary").click(function () {
that.loginAsync();
});
$("#user-login-dialog input:text:last").keyup(function () {
if (this.value.length === 4)
that.loginAsync(true);
});
//$("#user-login-dialog input:text:last").keyup(function () {
// if (this.value.length === 4)
// that.loginAsync(true);
//});
$("#acc_logout").click(function () {
mp.confirm("退出?", "确定要退出登录吗?", function () {
that.logout();

View File

@ -25,10 +25,10 @@
var resubmitBtn = $("#ticket-submit-info .ticket-submit-info-status-failed button.button-primary");
var init = function () {
$("#ticket-submit-info .ticket-submit-vc input:text").keyup(function () {
if (this.value.length === 4)
that.submitOrder();
});
//$("#ticket-submit-info .ticket-submit-vc input:text").keyup(function () {
// if (this.value.length === 4)
// that.submitOrder();
//});
submitBtn.click(that.submitOrder);
//重新提交
@ -61,15 +61,15 @@
if (!$("#ticket-submit-container:visible").length) {
widget.showFloatDialog($("#ticket-submit-container"));
}
$("#ticket-submit-info").find(">section").hide().first().show().find(":text").val("")[0].select();
$("#ticket-submit-info").find(">section").hide().first().show().find(":hidden").val("");
submitProgress.hide();
$("#ticket-submit-info .ticket-submit-vc").attr("data-target", profile.resign ? "order" : "login");
$("#ticket-submit-info .ticket-submit-vc").attr("data-target", profile.resign ? "order" : "fastSubmit");
if (!vc_inited) {
vc_inited = true;
vc.load($("#ticket-submit-info .ticket-submit-vc"));
} else {
$("#ticket-submit-info .ticket-submit-vc span").click();
$("#ticket-submit-info .ticket-submit-vc a").click();
}
};
this.hide = function () {
@ -80,9 +80,9 @@
this.submitOrder = function () {
media.stop();
var randCode = $("#ticket-submit-info .ticket-submit-vc input:text").val();
if (randCode.length !== 4) {
mp.showMessagePopup("error", "请输入验证码...");
var randCode = $("#ticket-submit-info .ticket-submit-vc input:hidden").val();
if (!randCode.length) {
mp.showMessagePopup("error", "请完成验证...");
return;
}
if (submitBtn[0].disabled || submitDef)

View File

@ -7,8 +7,12 @@
refer: "login/init"
},
order: {
url: "passcodeNew/getPassCodeNew?module=passenger&rand=randp&_=" + Math.random(),
url: "passcodeNew/getPassCodeNew?module=passenger&rand=randp&" + Math.random(),
refer: "confirmPassenger/initDc"
},
fastSubmit: {
url: "passcodeNew/getPassCodeNew?module=passenger&rand=randp&" + Math.random(),
refer: "leftTicket/init"
}
};
exports.autoLoad = function (target) {
@ -21,22 +25,27 @@
exports.load = function (target) {
var type = target.attr("data-target");
var config = exports.data[type];
var imageEle = target.find("span");
var imageEle = target.find("img");
//var imageEle = target.find("span");
imageEle.css({ "background-image": "url(/images/loading.gif)", "background-size": "auto" });
//imageEle.css({ "background-image": "url(/images/loading.gif)", "background-size": "auto" });
imageEle.attr({ "src": "/images/loading.gif" });
ajax.loadImage(config.url, config.refer, function (e) {
if (this.url.indexOf("base64,eyJ2YWxpZGF0ZU1lc3") !== -1) {
//网络繁忙
//重试
setTimeout(function() {
setTimeout(function () {
exports.load(target);
}, 1000);
} else {
imageEle.css({ "background-image": "url(" + this.url + ")", "background-size": "100% 100%" });
(target.is(".verify-code") ? target.closest("div, p, td") : target).find(":text").val("").each(function () { this.focus(); });
//imageEle.css({ "background-image": "url(" + this.url + ")", "background-size": "100% 100%" });
imageEle.attr({ "src": this.url });
imageEle.trigger("verifyCodeLoaded");
(target.is(".verify-code") ? target.closest("div, p, td") : target).find(":text, :hidden").val("");//.each(function () { this.focus(); });
}
}, function () {
imageEle.css({ "background-image": "url(/images/loading.gif)", "background-size": "auto" });
//imageEle.css({ "background-image": "url(/images/loading.gif)", "background-size": "auto" });
imageEle.attr({ "src": "/images/loading.gif" });
document.dispatchEvent(new CustomEvent("verifyCodeLoadFailed"));
});
};
@ -49,14 +58,15 @@
}
}
if (delay) {
target.find("span").css({ "background-image": "url(/images/loading.gif)", "background-size": "auto" });
target.find("img").attr({ "src": "/images/loading.gif" });
//target.find("span").css({ "background-image": "url(/images/loading.gif)", "background-size": "auto" });
setTimeout(reloadCode, 2000);
} else {
reloadCode();
}
};
exports.init = function () {
$(document).on("click", ".verify-code span, .verify-code .refresh-vc", function () {
$(document).on("click", ".verify-code .refresh-vc", function () {
exports.load($(this).closest(".verify-code"));
});
};

View File

@ -0,0 +1,68 @@
define(function (require, exports, module) {
var init = function () {
$(document).on("verifyCodeLoaded", "img.vc-touchclick", initEle)
.on("click", "img.vc-touchclick", touchClick)
.on("click", "span.vc-touchclick-marker", removeClickMarker);
}
var initEle = function () {
var img = $(this);
img.removeData("poslist");
img.data("poslist", []);
img.parent().find(".vc-touchclick-marker").remove();
};
var removeClickMarker = function() {
var marker = $(this);
var parent = marker.parent();
var img = parent.find("img");
var poslist = img.data("poslist");
for (var i = 0; i < poslist.length; i++) {
if (poslist[i] === marker.data("pos"))
poslist.splice(i, 1);
}
marker.remove();
parent.find(":hidden").val(_.map(poslist, function (e) { return e.x + "," + e.y; }).join(","));
};
var touchClick = function (e) {
var img = $(this);
var parent = img.parent();
var pos = { x: e.offsetX, y: e.offsetY };
var imgPos = img.position();
var poslist = img.data("poslist");
//var strlist = img.data("strlist");
//查找是否已经点击过了
//var currentMarks = $.makeArray(parent.find(".vc-touchclick-marker"));
//var current = _.find(currentMarks, function (e) {
// var p = $(e).data("pos");
// return p && p.x >= pos.x - 16 && p.x <= pos.x + 16 && p.y >= pos.y - 16 && p.y <= pos.y + 16;
//});
//if (current) {
// for (var i = 0; i < poslist.length; i++) {
// if (poslist[i] === current.data("pos"))
// poslist.splice(i, 1);
// }
// current.remove();
// return;
//}
poslist.push(pos);
//add marker
var marker = $("<span class='vc-touchclick-marker' style='top:" + (pos.y + imgPos.top - 16) + "px; left:" + (pos.x + imgPos.left - 16) + "px;'></span>");
marker.data("pos", pos);
parent.append(marker);
//set input
parent.find(":hidden").val(_.map(poslist, function (x) { return x.x + "," + x.y; }).join(","));
};
init();
});