var Test = function() {
var id = OssUtil.getParams('id');
/**
* 初始化
*/
var handleInit = function() {
// es6箭头函数执行 指向函数定义生效时所在的对象
$('.auth-submit').unbind().bind('click', () => {
handleSubmit();
});
$('#aa').unbind().bind('change', function() {
var cardNo = $(this).val().trim();
$.proxy(getBankNameByCardNo(cardNo), this);
});
/**
* 通过银行卡号获取银行名称
*/
var getBankNameByCardNo = function(cardNo, callBack) {
$.ajax({
url : '/rest/bank/' + cardNo,
type : "get",
dataType : "json",
success : function(bankData) {
if (bankData.ret == 0) {
if (typeof callBack === 'function') {
callBack(bankData.data);
}
}
}
});
}
var handleSubmit = function() {
console.info('handleSubmit ');
}
return {
init : function() {
handleInit();
}
}
}();
$(document).ready(function() {
Test.init();
});