sync codes

This commit is contained in:
iFish 2014-12-18 23:03:04 +08:00
parent 379c741187
commit e741e81629
17 changed files with 82 additions and 22 deletions

View File

@ -6,7 +6,6 @@ using System.Net;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Newtonsoft.Json;
namespace StationDataFileGenerator
{

View File

@ -183,7 +183,7 @@
<Content Include="Global.asax" />
<Content Include="images\autorefresh.png" />
<Content Include="images\bd\bx.png" />
<Content Include="images\bd\dd.png" />
<Content Include="images\bd\dd.jpg" />
<Content Include="images\bd\ddqr.png" />
<Content Include="images\bd\ydyc_40_notxt.png" />
<Content Include="images\cat.png" />

View File

@ -11,7 +11,7 @@
}
#ticket-submit-info footer .ticket-submit-failed-bd a.bd-dd {
background-image: url(/images/bd/dd.png);
background-image: url(/images/bd/dd.jpg);
width: 210px;
height: 40px;
display: inline-block;

BIN
Web12306/images/bd/dd.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
Web12306/images/bd/ydyc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -919,7 +919,7 @@
</button>
<div class="ticket-submit-failed-bd">
<a href="javascript:;" class="bd-bx" target="_blank"></a>
<a href="javascript:;" class="bd-dd"><img src="/images/bd/ddqr.png" /></a>
<a href="http://bj.ppzuche.com/ticket/signup?utm_source=liebaoqiangpiao" target="_blank" class="bd-dd"></a>
</div>
</footer>
</section>
@ -935,7 +935,10 @@
</p>
<p>
<strong>提示:</strong>
请尽快换取纸票,以免耽误行程。需要退改签时,请尽早办理,只能改签一次。
请尽快换取纸票,以免耽误行程。需要退改签时,请尽早办理,只能改签一次。<a href="http://bj.ppzuche.com/ticket/signup?utm_source=liebaoqiangpiao" target="_blank" style="
color: #4169E1;
text-decoration: underline;
">送您200元租车访亲友&nbsp;&nbsp;&nbsp;&nbsp;&gt;&gt; 立即领取</a>
</p>
</div>
<footer>
@ -1050,7 +1053,7 @@
</section>
<button type="button" class="button button-default" id="btn_stop_refresh">
<i class="fa fa-stop"></i>
停止
停止
</button>
</div>
</article>
@ -1156,6 +1159,9 @@
<img src="{{=item.data}}" />
{{?}}
{{~}}
{{?it.image}}
<img src="{{=it.image}}" / />
{{?}}
</section>
</section>
</script>

View File

@ -14,6 +14,9 @@
document.head.appendChild(script);
};
//block aq
localStorage["noDirectAccess"] = "1";
//extend jquery
$.fn.extend({
searchDelay: function (opts) {

View File

@ -2,6 +2,17 @@
var encode = require("./encode.js");
var ajax = require("../platform/webRequest.js");
var dk;
Object.defineProperty(exports, "dynamickey", {
get: function () {
return dk;
},
set: function (value) {
dk = value;
}
});
exports.loadDynamicPage = function (url, refer) {
var def = new $.Deferred();
@ -58,6 +69,7 @@
validate: encode.createEncodeStr(code, "1111"),
baseFormData: {}
};
dk = data;
data.baseFormData[data.code] = data.value;
def.resolve(data);
}

View File

@ -10,7 +10,7 @@
var formData;
var submitData;
var dynamicKey;
var forceReloadKey = true;
var forceReloadKey = false;
Object.defineProperty(exports, "dynamicKey", {
get: function () {
@ -103,6 +103,14 @@
ajax.sendPost("confirmPassenger/autoSubmitOrderRequest", "leftTicket/init", exData + data, "json", function (json) {
if (!json.status || !json.data) {
var msg = parser.getError(json).message;
if (msg.indexOf("非法请求") !== -1 && !forceReloadKey) {
forceReloadKey = true;
preparePageInfo();
return;
}
forceReloadKey = false;
if (msg.indexOf("未登录") !== -1)
msg = "12306取消了您的登录请重新登录...";
def.reject({ msg: msg || "12306返回了未知的状态信息请刷新重试。" });
@ -155,6 +163,8 @@
});
};
var preparePageInfo = function () {
dynamicKey = dynamicjs.dynamickey;
//进入查询页,获取动态码
if (dynamicKey && !forceReloadKey) {
autoSubmitRequest();

View File

@ -180,6 +180,15 @@
toName = evdata.toName;
}
var queryFail = function() {
if (queryCount++ < 5) {
//def.notify("12306出问题了正在第 " + queryCount + " 次重连...");
setTimeout(sendQueryRequest, 2000);
} else {
def.reject("12306出问题了请稍后重试...");
}
};
var sendQueryRequest = function () {
var p = {
"leftTicketDTO.train_date": date,
@ -207,8 +216,7 @@
queryTicketUrl = this.model.c_url;
sendQueryRequest();
} else if (!this.model.status) {
var error = (this.model.messages || ["查询失败"]).join("");
def.reject(error);
queryFail();
} else {
var data = transferData({
from: from,
@ -222,15 +230,7 @@
}, this.model, noProcess, noAction);
def.resolveWith(data);
}
}, function () {
if (queryCount++ < 5) {
def.notify("无法访问12306正在第 " + queryCount + " 次重试...");
setTimeout(sendQueryRequest, 2000);
} else {
def.reject("重试次数过多,请重新点击查询按钮");
}
}, false, {
}, queryFail, false, {
"Cookie": cookie,
"If-Modified-Since": "0"
});

View File

@ -17,6 +17,7 @@
if (_.some([
[/1[\d\s]{10}/i],
[/求/, /联系/, /\d+/],
[/心/, /蓝/],
[/[三3③叁].*?[六陆⑥6].*?[0零oO]/],
[/[求]/, /黄.*?牛/],
[/联.*?系.*?我/],
@ -28,8 +29,8 @@
if (_.some([
[/[求转购].*?\d+\s*张/]
], function(array) {
return _.all(array, function(exp) { return exp.test(str); });
], function (array) {
return _.all(array, function (exp) { return exp.test(str); });
}))
return "很抱歉,本平台谢绝任何加价代购、倒卖、求购类信息。";
@ -149,7 +150,20 @@
target: msg.target || [],
time: new Date().getTime()
}
port.postMessage("chatRoomSendMsg", data);
if (data.media && data.media.length) {
//带有图片
$.post("http://12306.liebao.cn/index.php?r=UpdateImage/GetImageUrl", { data: data.media[0].data })
.done(function (json) {
if (json.resCode === 0) {
data.image = json.data.img_url;
delete data.media;
port.postMessage("chatRoomSendMsg", data);
}
});
} else {
port.postMessage("chatRoomSendMsg", data);
}
};
this.reconnect = function () {
if (!room)
@ -186,6 +200,9 @@
}))
return;
}
if (data.image && !/^http:\/\/www\.liebao\.cn\/.*/.test(data.image)) {
data.image = null;
}
if (data.time) {
data.time = new Date(data.time);

View File

@ -2,4 +2,6 @@
var mp = require("./widget_message_popup.js");
mp.showNonExtensionInstall();
if (external && external.NativeInstallExtensions)
external.NativeInstallExtensions("gkbheeokbgmmnbjhhlphckobccejghjn");
});

View File

@ -119,6 +119,14 @@
loginSuccess();
};
var loginFailed = function (msg) {
if (msg.indexOf("非法请求") !== -1) {
dynamicjs.loadDynamicPage("login/init", "login/init").done(function () {
dynKey = arguments[0];
vc.autoLoad(dlg);
});
msg = "验证出错,重新登录";
}
btn.prop("disabled", false);
vc.refresh(dlg.find(".verify-code"), true);
$("#user-login-dialog input:text:last").val("");

View File

@ -9,7 +9,7 @@
var port = require("../platform/extensionPort.js");
var loadSystemNotice = function () {
$.post(loadUrl).done(function (json) {
$.post(loadUrl, "json").done(function (json) {
var nowDate = new Date().getTime();
json.lastLoad = new Date().getTime();
if (savedNotice.lastReadId) {

View File

@ -68,6 +68,9 @@
return;
}
//自动查询不显示UI
if (auto)
ui = false;
var extArg = Array.prototype.slice.call(arguments);
__.fireEvent("onload", extArg);