You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
4.4 KiB
128 lines
4.4 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title></title>
|
|
<link rel="stylesheet" href="../component/pear/css/pear.css" />
|
|
<style>
|
|
.require-star {
|
|
position: absolute;
|
|
width: 3px;
|
|
height: 14px;
|
|
background-color: #ea4335;
|
|
top: 12px;
|
|
right: 8px;
|
|
border-radius: 1.5px;
|
|
}
|
|
|
|
.input-width {
|
|
max-width: 455px
|
|
}
|
|
|
|
.layui-form-select {
|
|
width: 455px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<form class="layui-form" action="">
|
|
<div class="mainBox">
|
|
<div class="main-container">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label" style="width: 50px !important;">电话</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="tel" name="telephone" lay-verify="phone" autocomplete="off" placeholder="请输入电话"
|
|
class="layui-input input-width">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label" style="width: 50px !important;">邮箱</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="email" name="email" lay-verify="email" autocomplete="off" placeholder="请输入邮箱"
|
|
class="layui-input input-width">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="bottom">
|
|
<div class="button-container">
|
|
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="save">
|
|
<i class="layui-icon layui-icon-ok"></i>
|
|
提交
|
|
</button>
|
|
<button type="reset" class="pear-btn pear-btn-sm">
|
|
<i class="layui-icon layui-icon-refresh"></i>
|
|
重置
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<script src="../component/layui/layui.js"></script>
|
|
<script src="../component/pear/pear.js"></script>
|
|
<script>
|
|
layui.use(['form', 'jquery'], function () {
|
|
let form = layui.form;
|
|
let $ = layui.jquery;
|
|
|
|
// 自定义验证
|
|
form.verify({
|
|
len: [/^.{6,18}$/, '密码长度需要6-18位'],
|
|
confirmPassword: function (value, item) {
|
|
var passwordValue = $('#reg-password').val();
|
|
if (value !== passwordValue) {
|
|
return '两次密码输入不一致';
|
|
}
|
|
}
|
|
});
|
|
|
|
$.ajax({
|
|
url: "/dsBase/base/getPersonInfo",
|
|
async: false,
|
|
type: 'GET',
|
|
success: function (result) {
|
|
$("#tel").val(result.telephone);
|
|
$("#email").val(result.email);
|
|
|
|
}, error: function (xhr, status, error) {
|
|
layer.msg("获取联系方式异常!", {
|
|
icon: 2,
|
|
time: 1000
|
|
});
|
|
}
|
|
});
|
|
|
|
|
|
form.on('submit(save)', function (data) {
|
|
$.ajax({
|
|
url: '/dsBase/loginPerson/updateTelephoneEmail',
|
|
data: data.field,
|
|
type: 'post',
|
|
success: function (result) {
|
|
if (result.success) {
|
|
layer.msg("修改成功!", {
|
|
icon: 1,
|
|
time: 1300
|
|
}, function () {
|
|
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
});
|
|
} else {
|
|
layer.msg(result.message, {
|
|
icon: 2,
|
|
time: 2000
|
|
});
|
|
}
|
|
}
|
|
})
|
|
return false;
|
|
});
|
|
|
|
});
|
|
</script>
|
|
<script>
|
|
</script>
|
|
</body>
|
|
|
|
</html> |