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; var frompy = encodeURIComponent(profile.fromText); //getCityPy(profile.fromCode); var topy = encodeURIComponent(profile.toText); // getCityPy(profile.toCode); $(".ticket-submit-failed-bd .bd-bx").attr("href", "http://www.baixing.com/huijia/liebao/?from=" + frompy + "&to=" + topy); }); 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(); }); });