|
<!DOCTYPE>
<html>
<head>
<!--<meta name="viewport" content="width=device-width, initial-scale=1.0">
-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>科袖-账号设置(个人信息)</title>
<link rel="stylesheet" href="css/reset.css" />
<link type="text/css" href="css/index.css" rel="stylesheet">
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
<!-- <script type="text/javascript" src="js/form.js"></script> -->
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
<!-- <script type="text/javascript" src="js/account-set.js"></script> -->
<script type="text/javascript" >
$(function(){
//loginStatus();
var servPath = "http://121.42.53.174:81";
var userid = $.cookie("userid");
if(userid){
$(".head-portrait").css("background","url("+servPath+"/images/head/"+userid+"_m.jpg)");
$(".head-portrait").show();
$(".unlogin").hide();
}
valUser();
$("#hsearch").on("click",function (){
var searchContent = $("#hsearchContent").val();
location.href = "search.html?searchContent="+searchContent;
})
/*专家信息左导航背景点击切换*/
$(".leftsidebar").click(function(){
var index = $(this).index()-1;
$(this).addClass("bgcolor").siblings().removeClass("bgcolor");
$(".content-set").eq(index).show().siblings().hide();
});
/*编辑标签变色*/
$("#container .edit").hover(function(){
$(this).addClass("edit-position-left")
},function(){
$(this).removeClass("edit-position-left")
});
$(".times").click(function(){
$(".cover").hide();
$(".cover2").hide();
})
$(".back-btn").click(function(){
$(".cover").hide();
$(".cover2").hide();
})
$(".replace2").click(function(){
$(".cover2").show();
})
$(".replace1").click(function(){
$(".cover").show();
})
$(".replace5").click(function(){
$(".cover").show();
})
$(".replace6").click(function(){
$(".cover2").show();
})
var emailCookie = $.cookie("userEmail");
var phoneCookie = $.cookie("userMobilePhone");
if(emailCookie != "" && emailCookie != null && emailCookie != "null" ){
$("#emailShow").text(emailCookie);
$(".replace1").hide();
$(".replace3").show();
}else{
$(".replace1").show();
$(".replace3").hide();
}
if(phoneCookie != "" && phoneCookie != null && phoneCookie != "null" ){
$("#phoneShow").text(phoneCookie.substring(0, 3) + "****" + phoneCookie.substring(7, 11));
$(".replace2").hide();
$(".replace4").show();
}else{
$(".replace2").show();
$(".replace4").hide();
}
})
var oldPass = false;
var isPass = false;
var isPass2 = false;
function valOld(){
var oldPassword = $("#oldPassword").val();
if(oldPassword.length==0){
$(".msg1").text("请输入密码");
oldPass = false;
}else if(oldPassword.length < 6){
$(".msg1").text("密码不少于6位,请输入正确的密码");
}else{
$(".msg1").text("");
oldPass = true;
}
}
function valNew(){
var newPassword = $("#newPassword").val();
var oldPassword = $("#oldPassword").val();
if(newPassword.length==0){
$(".msg2").text("密码不能为空");
}else if(newPassword.length<6){
$(".msg2").text("密码长度过短,至少六位");
}else if(newPassword2 == newPassword){
$(".msg2").text("新旧密码不能一致");
} else{
isPass = true;
$(".msg2").text("");
}
}
function valNew2(){
var newPassword = $("#newPassword").val();
var newPassword2 = $("#newPassword2").val();
if(newPassword2.length==0){
$(".msg3").text("密码不能为空");
}else if(newPassword2 != newPassword){
$(".msg3").text("两次输入密码不一致");
}else{
isPass2 = true;
$(".msg3").text("");
}
}
function restPassword(){
valOld();
valNew();
valNew2();
if(oldPass == true && isPass == true && isPass2 == true){
$.ajax("/ajax/cp",{
type:"POST",
async: false,
success:function(data){
if(data.success){
if(data.data == true){
alert("设置成功,请重新登录");
location.href="login.html";
}else{
$(".msg4").text("设置失败,请检查密码是否正确!");
}
}else{
$(".msg4").text("系统异常!");
// alert("系统异常!");
}
},
error:function(){alert('fail')},
data:{"id":$.cookie("userid"),"npw":$("#newPassword2").val(),"onw":$("#oldPassword").val()},
dataType: 'json'
});
}else{
/*alert("请校验密码");*/
}
}
var emailPass = false;
//页面需要验证展示的位置,先用alert替代
function valEmail(){
var email = $("#email").val();
var gunf=/^\w+@\w+\.((cn)|(com)|(com\.cn))$/;
if(gunf.test(email.trim())){
$(".msg11 span").text("");
emailPass = true;
}else{
/*alert("请输入正确是邮箱地址");*/
$(".msg11").text("请输入正确是邮箱地址");
emailPass = false;
}
}
var phonePass = false;
function valPhone(){
var phoneVal = $("#phone").val();
if(phoneVal.length==0){
/*alert("请输入您的手机号码");*/
$(".msg12").text("请输入您的手机号码");
}else{
var hunPhone=/^1[3|4|5|7|8]\d{9}$/;
if(hunPhone.test(phoneVal.trim())){
$(".msg12").text("");
phonePass = true;
}else{
phonePass = false;
/*alert("手机格式正确,请输入正确的手机号码");*/
$(".msg12").text("手机格式正确,请输入正确的手机号码");
}
}
}
function bindEmail(){
valEmail();
if(emailPass == true){
$.ajax("/ajax/reqBindMail",{
type:"GET",
async: false,
success:function(data){
if(data.success){
if(data.data == true){
/*alert("请检查邮件,设置成功后请重新登录!");*/
location.href="login.html";
}else{
/*alert("邮箱设置失败");*/
$(".msg4").text("设置错误!");
}
}else{
$(".msg4").text("系统异常!");
// alert("系统异常!");
}
},
error:function(){alert('fail')},
data:{"userid":$.cookie("userid"),"mail":$("#email").val()},
dataType: 'json'
});
}else{
/*alert("请输入正确是邮箱地址");*/
}
}
var phoneState;
function sendPhoneCode(){
valPhone();
if(phonePass == true){
$.ajax("/ajax/vcWithBind",{
type:"GET",
async: false,
success:function(data){
if(data.success){
if(data.data == null){
$(".msg13").text("验证码发送失败,请确认手机号码正确!");
/*alert("验证码发送失败,请确认手机号码正确!");*/
}else{
$(".msg13").text("发送成功,请检查手机验证码");
/*alert("发送成功,请检查手机验证码");*/
phoneState = data.data;
$(".msg4").text("设置错误!");
}
}else{
$(".msg4").text("系统异常!");
// alert("系统异常!");
}
},
error:function(){alert('fail')},
data:{"userid":$.cookie("userid"),"mobilePhone":$("#phone").val()},
dataType: 'json'
});
}else{
/*alert("请输入正确是手机号码");*/
}
}
var codePass = false;
function valCode(){
var phoneCode = $("#phoneCode").val();
if(phoneCode.length==0){
/*alert("请输入验证码");*/
$(".msg1").text("请输入验证码");
}else{
if(!isNaN(phoneCode)){
codePass = true;
}else{
codePass=false;
$(".msg1").text("请填写数字");
/*alert("请填写数字");*/
}
}
}
function bindPhone(){
valCode();
if(codePass == true){
/*alert($.cookie("userid"));
alert($("#phone").val());
alert(phoneState);
alert($("#phoneCode").val());*/
$.ajax("/ajax/bindMobilePhone",{
type:"POST",
async: false,
success:function(data){
if(data.success){
alert(2);
if(data.data == true){
alert("绑定成功请重新登录!");
location.href="login.html";
}else{
alert("绑定失败,请检查验证码是否正确");
}
}else{
$(".msg4").text("系统异常!");
// alert("系统异常!");
}
},
error:function(){alert('fail')},
data:{"userid":$.cookie("userid"),"mobilePhone":$("#phone").val(),"validateCode":$("#phoneCode").val(),"state": phoneState},
dataType: 'json'
});
}else{
/*alert("请输入验证码是否正确");*/
}
}
</script>
</head>
<body>
<!--浮动窗口-->
<div class="cover">
<div class="floatbox">
<div class="float-title">
邮箱绑定
<span class="times">×</span>
</div>
<form class="bdfrm" action="" name="bdemail">
<p>验证您的邮箱地址,完成邮箱账号绑定</p>
<input type="text" placeholder="请输入您的邮箱地址" class="yz" id="email" onBlur="valEmail()" >
<div class="msg-yz msg11"><span></span></div>
<p>绑定邮箱验证已发送至您的邮箱<br>请您在10分钟内登录邮箱激活链接验证</p>
<input type="button" value="登录邮箱激活" class=" activate act act-color" onClick="bindEmail()">
<input type="button" value="返回" class="activate back-btn" >
</form>
</div>
</div>
<div class="cover2">
<div class="floatbox">
<div class="float-title">
手机绑定
<span class="times" >×</span>
</div>
<form class="bdfrm" action="" name="bdphone">
<p>验证您的手机号,完成手机账号绑定</p>
<input type="text" placeholder="请输入您的手机号" class="yz" id="phone" onBlur="valPhone()">
<div class="msg-yz msg12"></div>
<input type="text" placeholder="请输入短信验证码" class="psd input-code" maxlength="4" id="phoneCode" onBlur="valCode()">
<input type="button" value="获取短信验证码" class="infor-code" onClick="sendPhoneCode()">
<div class="msg-yz msg13"></div>
<input type="button" value="完成绑定" class="activate act act-color" onClick="bindPhone()">
<input type="button" value="返回" class="activate back-btn" >
</form>
</div>
</div>
<!---->
<div id="header">
<a href="index.html" alt="科袖" class="logo"></a>
<div class="searchblock" style="display:block;">
<input type="text" placeholder="搜索专家、研究方向或科研机构" class="search-txt" id="hsearchContent">
<div class="search-btn" id="hsearch"><span class="search-icon"></span></div>
</div>
<!--未登录-->
<a href="login-invite-code.html"><div class="unlogin">特邀专家登录</div></a>
<!--已登录-->
<div class="head-portrait">
<div class="personal-infor">
<div class="triangleB"></div>
<div class="personal-box">
<!-- <a href="#"><span class="icon icon1"></span>我的主页</a> -->
<a href="information.html"><span class="icon icon2"></span>修改资料</a>
<a href="account-set.html"><span class="icon icon3"></span>账户设置</a>
<a href="#" onClick="exit()"><span class="icon icon4"></span>退出登录</a>
</div>
</div>
</div>
</div>
<div id="container">
<div class="account">
<div class="account-set">
<div class="account-title">账号设置</div>
<!--<a href="#" class="leftsidebar bgcolor">个人信息</a>-->
<a href="#" class="leftsidebar bgcolor">修改密码</a>
<a href="#" class="leftsidebar">账号绑定</a>
</div>
<div class="contentbox">
<!--<div class="content-set" style="display:block">
<div class="content-title">个人信息</div>
<div class="note">此信息用于站内沟通、社区等功能</div>
<div class="account-photo"><img src="images/pic1.jpg"></div>
<div class="account-name">
<div class="name-txt">姓 名:</div>
<div class="text"><span class="text-txt">程学群</span><a href="information.html"><span class="edit"></span>修改资料</a></div>
</div>
<div class="account-sax">
<div class="name-txt">性 别:</div>
<input type="radio" name="sex" id="a" value="X" class="radio"><label for="a" class="radio">男</label>
<input type="radio" name="sex" id="b" value="M" class="radio"><label for="b" class="radio" >女</label>
</div>
<input type="submit" value="保存" class="save">
</div>-->
<div class="content-set" style="display:block">
<div class="content-title">修改密码</div>
<div class="marginT"></div>
<form name="f1" >
<div class="password"><span class="lable">当前密码</span><input type="password"class="psd" id="oldPassword" onBlur="valOld()" /> <div class="msgs"><a href="login-email-find01.html" class="forget">忘记密码?</a></div>
</div>
<div class="msg msg1" ></div>
<div class="password"><span class="lable">新密码</span><input type="password" class="psd" id="newPassword" onBlur="valNew()" /></div>
<div class="msg msg2" ></div>
<div class="password"><span class="lable">确认密码</span><input type="password" class="psd" id="newPassword2" onBlur="valNew2()" /></div>
<div class="msg msg3" ></div>
</form>
<input type="submit" value="保存" class="save" onClick="restPassword()"/>
<div class="msg msg4" ></div>
</div>
<div class="content-set">
<div class="content-title">账号绑定</div>
<div class="note">绑定后,您可以同时使用以下方式登录科袖网</div>
<div class="unbinding">
<div class="replace1"><span class="email-icon "></span>绑定邮箱账号</div>
<div class="replace2"><span class="phone-icon "></span>绑定手机账号</div>
<div class="replace3"><span class="email-icon"></span>您已绑定邮箱 <span id="emailShow"></span><input type="button" value="更换" class="replace replace5"><br>
</div>
<div class="replace4"><span class="phone-icon "></span>您已绑定手机 <span id="phoneShow">183****5606</span><input type="button" value="更换" class="replace replace6" >
</div>
</div>
<!--<div class="binding">
<span class="email-icon"></span>您已绑定邮箱 183****5606@163.com<input type="button" value="更换" class="replace replace1"><br>
<span class="phone-icon "></span>您已绑定手机 183****5606<input type="button" value="更换" class="replace replace2" >
</div>-->
</div>
</div>
</div>
</div>
<div id="footer">
<div class="footer-top">
<div class="footerL">
<div class="footer-logo"></div>
<div class="link">
<a href="#">入驻科袖</a>|
<a href="#">申请认证</a>|
<a href="#">常见问题</a>|
<a href="#">意见反馈</a>|
<a href="#">关于我们</a>|
<a href="#">加入我们</a>
</div>
<p class="customer">客服电话:<span>400-xxx-xxxx</span></p>
<p class="customer">工作时间:<span>周一至周五09:00-17:00</span></p>
</div>
<div class="footerR">
<div class="code"><img src="images/code.jpg"></div>
<p>欢迎扫码关注微信公众平台</p>
<a href="#" class="foot-icon foot-icon1"></a>
<a href="#" class="foot-icon foot-icon2"></a>
<a href="#" class="foot-icon foot-icon3"></a>
<a href="#" class="foot-icon foot-icon4"></a>
</div>
</div>
<div class="footer-btm">本站由 阿里云 提供计算与安全服务 Copyright © 2016~2017 科袖 | 京ICP备12345678号 | 京ICP证123456号 | 京公网安备11010800011111号 | 网站联盟安全认证</div>
</div>
</body>
</html>
|