Light12306/Web12306/js/ui/index.js

54 lines
1.5 KiB
JavaScript
Raw Normal View History

2014-05-05 19:34:47 +08:00
define(function(require) {
var param = require("../data.js");
var ajax = require("../platform/webRequest.js");
var storage = require('../platform/storage.js');
var widget = require("./widget.js");
2014-05-29 19:41:38 +08:00
var sessMgr = require("../account/sessionMgr.js");
2014-06-12 21:36:05 +08:00
var mp = require("./widget_message_popup.js");
2014-05-05 19:34:47 +08:00
//初始化UI
(function() {
$("#passenger-selector-id").focus(function () {
$(this).parent().parent().addClass("hover");
}).blur(function () {
$(this).parent().parent().removeClass("hover");
});
$("#travel-theme-select").focus(function () {
$(this).parent().parent().addClass("hover");
}).blur(function () {
$(this).parent().parent().removeClass("hover");
});
$("#btn-save-travel-theme").click(function() {
widget.showFloatDialog($("#save-travel-method"));
});
})();
//初始化日期
require("./widget_datedropdown.js").init("input.ui-date");
require("./widget_cityselector.js").init("input.ui-cityselector");
2014-06-12 21:36:05 +08:00
require("./widget_verifycode.js").init();
2014-05-05 19:34:47 +08:00
2014-05-16 20:10:45 +08:00
//加载各模块
var ui_login = require("./ui-login.js");
2014-06-12 21:36:05 +08:00
//界面交互初始化
(function() {
$("#index-tip-body").click(function() {
$(this).next().fadeIn();
});
$("section.search-tips-container i.fa-times").click(function() {
$(this).closest("section.search-tips-container").fadeOut();
});
//登录失效
sessMgr.on("userForcedOut", function() {
mp.showMessagePopup("error", "您的登录出现了问题,请重新登录");
});
})();
2014-05-27 19:40:21 +08:00
//初始化
$("#J-search-form").submit(function() {
return false;
});
2014-05-05 19:34:47 +08:00
});