python学习
This commit is contained in:
51
web/static/js/account/index.js
Normal file
51
web/static/js/account/index.js
Normal file
@@ -0,0 +1,51 @@
|
||||
;
|
||||
var account_index_ops = {
|
||||
init:function(){
|
||||
this.eventBind();
|
||||
},
|
||||
eventBind:function(){
|
||||
var that = this;
|
||||
$(".wrap_search .search").click(function(){
|
||||
$(".wrap_search").submit();
|
||||
});
|
||||
|
||||
$(".remove").click( function(){
|
||||
that.ops( "remove",$(this).attr("data") );
|
||||
} );
|
||||
|
||||
$(".recover").click( function(){
|
||||
that.ops( "recover",$(this).attr("data") );
|
||||
} );
|
||||
},
|
||||
ops:function( act,id ){
|
||||
var callback = {
|
||||
'ok':function(){
|
||||
$.ajax({
|
||||
url:common_ops.buildUrl( "/account/ops" ),
|
||||
type:'POST',
|
||||
data:{
|
||||
act:act,
|
||||
id:id
|
||||
},
|
||||
dataType:'json',
|
||||
success:function( res ){
|
||||
var callback = null;
|
||||
if( res.code == 200 ){
|
||||
callback = function(){
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
}
|
||||
common_ops.alert( res.msg,callback );
|
||||
}
|
||||
});
|
||||
},
|
||||
'cancel':null
|
||||
};
|
||||
common_ops.confirm( ( act == "remove" ? "确定删除?":"确定恢复?" ), callback );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$(document).ready( function(){
|
||||
account_index_ops.init();
|
||||
} );
|
||||
89
web/static/js/account/set.js
Normal file
89
web/static/js/account/set.js
Normal file
@@ -0,0 +1,89 @@
|
||||
;
|
||||
var account_set_ops = {
|
||||
init:function(){
|
||||
this.eventBind();
|
||||
},
|
||||
eventBind:function(){
|
||||
$(".wrap_account_set .save").click(function(){
|
||||
var btn_target = $(this);
|
||||
if( btn_target.hasClass("disabled") ){
|
||||
common_ops.alert("正在处理!!请不要重复提交~~");
|
||||
return;
|
||||
}
|
||||
|
||||
var nickname_target = $(".wrap_account_set input[name=nickname]");
|
||||
var nickname = nickname_target.val();
|
||||
|
||||
var mobile_target = $(".wrap_account_set input[name=mobile]");
|
||||
var mobile = mobile_target.val();
|
||||
|
||||
var email_target = $(".wrap_account_set input[name=email]");
|
||||
var email = email_target.val();
|
||||
|
||||
var login_name_target = $(".wrap_account_set input[name=login_name]");
|
||||
var login_name = login_name_target.val();
|
||||
|
||||
var login_pwd_target = $(".wrap_account_set input[name=login_pwd]");
|
||||
var login_pwd = login_pwd_target.val();
|
||||
|
||||
if( nickname.length < 1 ){
|
||||
common_ops.tip( "请输入符合规范的姓名~~",nickname_target );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( mobile.length < 1 ){
|
||||
common_ops.tip( "请输入符合规范的手机号码~~",mobile_target );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( email.length < 1 ){
|
||||
common_ops.tip( "请输入符合规范的邮箱~~",email_target );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( login_name.length < 1 ){
|
||||
common_ops.tip( "请输入符合规范的登录用户名~~",login_name_target );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( login_pwd.length < 6 ){
|
||||
common_ops.tip( "请输入符合规范的登录密码~~",login_pwd_target );
|
||||
return false;
|
||||
}
|
||||
|
||||
btn_target.addClass("disabled");
|
||||
|
||||
var data = {
|
||||
nickname: nickname,
|
||||
mobile: mobile,
|
||||
email: email,
|
||||
login_name:login_name,
|
||||
login_pwd:login_pwd,
|
||||
id:$(".wrap_account_set input[name=id]").val()
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url:common_ops.buildUrl( "/account/set" ),
|
||||
type:'POST',
|
||||
data:data,
|
||||
dataType:'json',
|
||||
success:function( res ){
|
||||
btn_target.removeClass("disabled");
|
||||
var callback = null;
|
||||
if( res.code == 200 ){
|
||||
callback = function(){
|
||||
window.location.href = common_ops.buildUrl("/account/index");
|
||||
}
|
||||
}
|
||||
common_ops.alert( res.msg,callback );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready( function(){
|
||||
account_set_ops.init();
|
||||
} );
|
||||
Reference in New Issue
Block a user