2014-12-10 21:01:34 +08:00
|
|
|
|
define(function (require, exports, module) {
|
|
|
|
|
var ordersubmit = require("../ui/ui-submit-order.js");
|
|
|
|
|
var sessMgr = require("../account/sessionMgr.js");
|
|
|
|
|
var data = require("../data.js");
|
|
|
|
|
|
|
|
|
|
var getCityPy = function (code) {
|
|
|
|
|
var city = data.cities[code];
|
|
|
|
|
return city && city.p;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ordersubmit.on("orderFailed", function (e, orderdata) {
|
|
|
|
|
var profile = orderdata.profile;
|
|
|
|
|
|
2014-12-12 23:28:35 +08:00
|
|
|
|
var frompy = encodeURIComponent(profile.fromText); //getCityPy(profile.fromCode);
|
|
|
|
|
var topy = encodeURIComponent(profile.toText); // getCityPy(profile.toCode);
|
2014-12-10 21:01:34 +08:00
|
|
|
|
|
|
|
|
|
$(".ticket-submit-failed-bd .bd-bx").attr("href", "http://www.baixing.com/huijia/liebao/?from=" + frompy + "&to=" + topy);
|
|
|
|
|
});
|
2014-12-12 23:28:35 +08:00
|
|
|
|
|
|
|
|
|
var autoRefresh = require("../ui/ui-autorefresh.js");
|
|
|
|
|
autoRefresh.on("requestAutoRefresh", function() {
|
|
|
|
|
var profile = sessMgr.currentProfile;
|
|
|
|
|
if (!profile)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var frompy = encodeURIComponent(profile.fromText); //getCityPy(profile.fromCode);
|
|
|
|
|
var topy = encodeURIComponent(profile.toText); // getCityPy(profile.toCode);
|
|
|
|
|
|
|
|
|
|
$("a.lnk-bd-bx").attr("href", "http://www.baixing.com/huijia/liebao/?from=" + frompy + "&to=" + topy).show();
|
|
|
|
|
});
|
2014-12-10 21:01:34 +08:00
|
|
|
|
});
|