//初始化个人信息页面 $(document).ready(function () { var rolekey = localStorage.getItem("rolekey"); var curMname = localStorage.getItem("curMname"); var curPath = localStorage.getItem("curPath"); $.ajax({ type:"post", url:"http://www.mrobay.com/me/home/index.do", data:{'treeflag':'true','curMname':curMname,'curPath':curPath,'rolekey':rolekey}, success:function(data){ var JsonObjs = eval("(" + data + ")"); $("#tree").html(JsonObjs[0].treeHtml); } , dateType:"json" }); $.ajax({ type:"post", url:"http://www.mrobay.com/bsplatform/bsp/menber/userinfo/info.do?htmlflag=true", data:{}, success:function(data){ var JsonObjs = eval("(" + data + ")"); var username = JsonObjs[0].username; var mobile = JsonObjs[0].mobile; $("#czyname").val(username); $("#czysjh").val(mobile); }, dateType:"json" }); }) function chongzhi(){ $("#czyname").val(""); $("#czysjh").val(""); } function doSave(){ var username = $("#czyname").val(); var mobile = $("#czysjh").val(); if($("#czyname").val().length == 0){ alert("请输入操作员名称"); return false; } if($("#czysjh").val().length == 0){ alert("请输入手机号"); return false; } var sjhzz = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/; if($("#czysjh").val().length >0 ){ if(sjhzz.test($("#czysjh").val()) != true){ alert("手机号格式不正确"); return false; } } $.ajax({ type: "post", url: "http://www.mrobay.com/bsplatform/bsp/menber/findpwd/updatePwd.do", data: {mobile:mobile}, dataType: "json", success: function(obj2){ if(obj2[0].result==true){ alert("该手机号已被其他人绑定"); return; }else{ $.ajax({ type:"post", url:"http://www.mrobay.com/bsplatform/bsp/menber/userinfo/updateInfo.do?htmlflag=true", data:{"username":username,"mobile":mobile}, success:function(data){ var JsonObjs = eval("(" + data + ")"); if(JsonObjs[0].msg == 1){ alert("保存信息成功"); } if(JsonObjs[0].msg == 0){ alert(JsonObjs[0].e.msg); } }, dateType:"json" }); } } }); }