122 lines
2.4 KiB
JavaScript
122 lines
2.4 KiB
JavaScript
![]() |
var password="";
|
||
|
$(document).ready(function(){
|
||
|
var msg={"id":userid};
|
||
|
|
||
|
clearErrorTips("tip","errorTips");
|
||
|
sendClientMsg(root+"User/userInfor",msg,"");
|
||
|
|
||
|
$("body").click(function(event){
|
||
|
var _id=$(event.target).attr("id");
|
||
|
var arr=String(_id).split("_");
|
||
|
|
||
|
if (arr[0]=="editInfor")
|
||
|
{
|
||
|
clearErrorTips("tip","errorTips");
|
||
|
|
||
|
var password1=$.trim($("[name=password1]").val());
|
||
|
var pw1=false;
|
||
|
|
||
|
var password2=$.trim($("[name=password2]").val());
|
||
|
var pw2=false;
|
||
|
|
||
|
var password3=$.trim($("[name=password3]").val());
|
||
|
var pw3=false;
|
||
|
|
||
|
var telephone=$.trim($("[name=tel]").val());
|
||
|
|
||
|
if (password1==""&&password2==""&&password3=="")
|
||
|
{
|
||
|
setErrorTips("password1_tip","errorTips",message[4]);
|
||
|
}
|
||
|
else if (password1!=""&&password2==""&&password3=="")
|
||
|
{
|
||
|
if (password1!=password)
|
||
|
{
|
||
|
setErrorTips("password1_tip","errorTips",message[4]);
|
||
|
}else
|
||
|
{
|
||
|
var msg={
|
||
|
"id":userid,
|
||
|
"password":password,
|
||
|
"telephone":telephone
|
||
|
};
|
||
|
|
||
|
sendClientMsg(root+"User/editInfor",msg,"");
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
if (password1=="")
|
||
|
{
|
||
|
setErrorTips("password1_tip","errorTips",message[4]);
|
||
|
}else
|
||
|
{
|
||
|
if (password1!=password)
|
||
|
{
|
||
|
setErrorTips("password1_tip","errorTips",message[4]);
|
||
|
}else
|
||
|
{
|
||
|
pw1=true;
|
||
|
}
|
||
|
}
|
||
|
if (password2=="")
|
||
|
{
|
||
|
setErrorTips("password2_tip","errorTips",message[4]);
|
||
|
}else
|
||
|
{
|
||
|
var len=password2.length;
|
||
|
if (len<minlen || len>maxlen)
|
||
|
{
|
||
|
setErrorTips("password2_tip","errorTips",message[9]);
|
||
|
}else
|
||
|
{
|
||
|
pw2=true;
|
||
|
}
|
||
|
}
|
||
|
if (password3=="")
|
||
|
{
|
||
|
setErrorTips("password3_tip","errorTips",message[4]);
|
||
|
}else
|
||
|
{
|
||
|
var len=password3.length;
|
||
|
if (len<minlen || len>maxlen)
|
||
|
{
|
||
|
setErrorTips("password3_tip","errorTips",message[9]);
|
||
|
return false;
|
||
|
}else
|
||
|
{
|
||
|
if (password2!=password3)
|
||
|
{
|
||
|
setErrorTips("password3_tip","errorTips",message[5]);
|
||
|
}else
|
||
|
{
|
||
|
pw3=true;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (pw1&&pw2&&pw3)
|
||
|
{
|
||
|
var msg={
|
||
|
"id":userid,
|
||
|
"password":password3,
|
||
|
"telephone":telephone
|
||
|
};
|
||
|
|
||
|
sendClientMsg(root+"User/editInfor",msg,"");
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
})
|
||
|
|
||
|
});
|
||
|
|
||
|
function infor(msg)
|
||
|
{
|
||
|
$(".name").html(msg["name"]);
|
||
|
$(".type").html(msg["type"]);
|
||
|
$("[name=tel]").val(msg["telephone"]);
|
||
|
$("[name=password1]").val(msg["password"]);
|
||
|
|
||
|
password=msg["password"];
|
||
|
}
|