You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

342 lines
14 KiB
Plaintext

1 year ago
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="forgetPassword.aspx.cs" Inherits="web.Web.Site.forgetPassword" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
<title>忘记密码</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- CSS -->
<link rel="stylesheet" href="css/owl.carousel.css" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/font-awesome.min.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/ionicons.min.css" />
<link rel="stylesheet" href="css/animate.css" />
<link rel="stylesheet" href="css/responsive.css" />
<link href="//cdn.bootcss.com/bootstrap-validator/0.5.3/css/bootstrapValidator.min.css" rel="stylesheet" />
<!-- Js -->
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
<script src="js/vendor/jquery-1.10.2.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
<script src="js/bootstrap.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/min/waypoints.min.js"></script>
<script src="js/jquery.counterup.js"></script>
<script src="//cdn.bootcss.com/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
<script src="js/main.js"></script>
<script>
$(function () {
$("#fbtnSubmit").click(function () {
var phone = $("#ftxtPhone").val();
var pwd = $("#ftxtPwd").val();
var pwd2 = $("#ftxtPwd2").val();
var vcode = $("#ftxtVCode").val();
var username = $("#fusername").val();
var formData = new FormData();
formData.append('action', 'forgot');
formData.append('phone', phone);
formData.append('pwd', pwd);
formData.append('pwd2', pwd2);
formData.append('vcode', vcode);
formData.append('username', username);
$.ajax({
url: 'index.aspx',
type: 'post',
data: formData,
processData: false,
contentType: false,
async: true,
success: function (data) {
if (data == '更改成功') {
$("#loginusername").val(username);
$("#loginpwd").val(pwd);
alert("更改成功,请重新登陆!");
$("#ftxtPhone").val('');
$("#ftxtPwd").val('');
$("#ftxtPwd2").val('');
$("#ftxtVCode").val('');
$("#username").val('');
$('#forgotModal').modal('hide');
} else {
alert(data);
}
},
error: function () {
alert("操作失败!");
}
})
})
$("#form2").bootstrapValidator({
message: 'This value is not valid',
// 定义未通过验证的状态图标
feedbackIcons: {/*输入框不同状态,显示图片的样式*/
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
// 字段验证
fields: {
// 手机号码
phone: {
validators: {
notEmpty: {
message: '手机号码不能为空'
},
stringlength: {
min: 11,
max: 11,
message: '请输入11位手机号码'
},
regexp: {
regexp: /^1[3|4|5|6|7|8|9]{1}[0-9]{9}$/,
message: '请输入正确的手机号码'
}
}
},
// 密码
pwd: {
message: '密码非法',
validators: {
notEmpty: {
message: '密码不能为空'
},
// 限制字符串长度
stringLength: {
min: 3,
max: 20,
message: '密码长度必须位于3到20之间'
},
// 相同性检测
identical: {
// 需要验证的field
field: 'pwd2',
message: '两次密码输入不一致'
},
// 基于正则表达是的验证
regexp: {
regexp: /^[a-zA-Z0-9_\.]+$/,
message: '密码由数字字母下划线和.组成'
}
}
},
// 确认密码
pwd2: {
message: '密码非法',
validators: {
notEmpty: {
message: '密码不能为空'
},
// 限制字符串长度
stringLength: {
min: 3,
max: 20,
message: '密码长度必须位于3到20之间'
},
// 相同性检测
identical: {
// 需要验证的field
field: 'pwd',
message: '两次密码输入不一致'
},
// 基于正则表达是的验证
regexp: {
regexp: /^[a-zA-Z0-9_\.]+$/,
message: '密码由数字字母下划线和.组成'
}
}
},
//用户名
username: {
validators: {
notEmpty: {
message: '用户名不能为空'
}, stringLength: {
min: 4,
max: 10,
message: '用户名长度必须位于4到10之间'
}
},
// 基于正则表达是的验证
regexp: {
regexp: /^[a-zA-Z0-9]+$/,
message: '用户名由数字字母下划线和.组成'
}
}
}
})
})
//倒计时
var countdown = 60;
function getCode(val) {
$("#form1").bootstrapValidator('validate');//提交验证
if ($("#form1").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
var formData = new FormData();
var phone = $("#txtPhone").val();
formData.append('action', 'code');
formData.append('phone', phone);
$.ajax({
url: 'index.aspx',
type: 'post',
data: formData,
processData: false,
contentType: false,
async: true,
success: function (data) {
alert(data);
},
error: function () {
alert("操作失败!");
}
})
settime(val);
} else {
//alert("请填写完整信息");
}
}
function getCodef(val) {
$("#form2").bootstrapValidator('validate');//提交验证
if ($("#form2").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
var formData = new FormData();
var phone = $("#ftxtPhone").val();
formData.append('action', 'code');
formData.append('phone', phone);
$.ajax({
url: 'index.aspx',
type: 'post',
data: formData,
processData: false,
contentType: false,
async: true,
success: function (data) {
alert(data);
},
error: function () {
alert("操作失败!");
}
})
settime(val);
} else {
//alert("请填写完整信息");
}
}
function settime(val) {
if (countdown == 0) {
val.removeAttribute("disabled");
val.innerHTML = "获取验证码";
countdown = 60;
return false;
} else {
val.setAttribute("disabled", true);
val.innerHTML = "重新发送(" + countdown + ")";
countdown--;
}
setTimeout(function () {
settime(val);
}, 1000);
}
function open_win(t) {
if (t == '0') {
window.open("http://www.myshipping.net/Web/Site/plugin.html", "_blank", "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400")
} else if (t == '1') {
window.open("http://www.myshipping.net/Web/Site/doc.html", "_blank", "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400")
}
}
///获取QuertString
function getQueryString(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
}
</script>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>忘记密码</h1>
</div>
<form id="form2" class="form-horizontal">
<div class="form-group">
<label for="username" class="col-sm-2 control-label">用户名</label>
<div class="col-sm-10">
<input type="text" id="fusername" style="width: 95%" class="form-control" name="username"
placeholder="用户名" />
</div>
</div>
<div class="form-group">
<label for="phone" class="col-sm-2 control-label">手机号</label>
<div class="col-sm-10">
<input type="text" id="ftxtPhone" style="width: 95%" class="form-control" name="phone"
placeholder="手机号" />
</div>
</div>
<div class="form-group">
<label for="pwd" class="col-sm-2 control-label">新密码</label>
<div class="col-sm-10">
<input type="password" id="ftxtPwd" name="pwd" style="width: 95%" class="form-control"
placeholder="请输密码" />
</div>
</div>
<div class="form-group">
<label for="pwd2" class="col-sm-2 control-label">确认密码</label>
<div class="col-sm-10">
<input type="password" id="ftxtPwd2" name="pwd2" style="width: 95%" class="form-control"
placeholder="请输密码" />
</div>
</div>
<div class=" form-group">
<label for="vcode" class="col-sm-2 control-label">手机验证码</label>
<div class="col-sm-4">
<input type="text" name="vcode" style="width: 90%" id="ftxtVCode" class="form-control"
placeholder="验证码" />
</div>
<div class="col-sm-4">
<button type="button" onclick="getCodef(this);" class="btn btn-default">获取验证码</button>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-4">
<button type="button" id="fbtnSubmit" name="submit" class="btn btn-primary">修改密码</button>
</div>
</div>
</form>
</div>
</body>
</html>