123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/webpage/include/taglibf.jsp"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>${fns:getConfig("productName")}</title>
- <link rel="stylesheet" href="${ctxStaticWeb}/css/base.css" />
- <link rel="stylesheet" href="${ctxStaticWeb}/css/second.css" />
- <script src="${ctx}/static/web/js/jquery-2.1.4.js"></script>
- <script src="${ctx}/static/plugin/jquery-validation/1.14.0/jquery.validate.js" type="text/javascript"></script>
- <script src="${ctx}/static/plugin/jquery-validation/1.14.0/localization/messages_zh.min.js" type="text/javascript"></script>
- <script src="${ctxStatic}/plugin/layui/layer/layer.js"></script>
- <script src="${ctxStatic}/plugin/layui/laytpl/laytpl.js"></script>
- <script>
- $().ready(function() {
- //增加手机号验证规则
- $.validator.addMethod("isMobile", function(value, element) {
- var length = value.length;
- var mobile = /^(13[0-9]{9})|(18[0-9]{9})|(14[0-9]{9})|(17[0-9]{9})|(15[0-9]{9})$/;
- return this.optional(element) || (length == 11 && mobile.test(value));
- }, "请正确填写您的手机号码");
- $("#userForm").validate({
- debug: false,
- focusInvalid: true, //当为false时,验证无效时,没有焦点响应
- onkeyup: false,
- rules: {
- name: {
- required: true,
- minlength: 2
- },
- email: {
- required: false,
- email:true
- },
- mobile: {
- required: true,
- isMobile: true
- }
- },
- messages: {
- name: {
- required: "请输入真实姓名",
- minlength: "真实姓名长度不能小于2位"
- },
- email: {
- email: "请输入正确的Email"
- },
- mobile: {
- required: "请输入手机号",
- isMobile: "请输入正确的手机号"
- }
- },
- submitHandler:function(form){//这是关键的语句,配置这个参数后表单不会自动提交,验证通过之后会去调用的方法
- layer.confirm('确认要进行修改吗?', {icon: 3, title:'提示'}, function(index){
- $.ajax({
- url:"${ctx}/updateUser",
- type:"POST",
- cache: false,
- data:$(form).serialize(),
- dataType:"json",
- beforeSend: function(XMLHttpRequest){
- //do something before submit...
- },
- success: function(data){
- if(data.success){
- layer.msg(data.msg, {icon:1});
- setTimeout(function () {
- window.location.href = "${ctxF}/info";
- }, 1000);
- }else{
- layer.msg(data.msg, {icon:2,time: 2000});
- }
- },
- complete: function(XMLHttpRequest, textStatus){
- //do something in the end...
- }
- });
- });
- }
- })
- });
- function personInfo() {
- $("#hrefperson").addClass("do");
- }
- </script>
- <style>
- .information ul li input{width:248px;line-height:40px;padding:0px 10px;color:#999;border:1px solid #999;}
- #userForm label.error{
- color:#cc5965;
- font-size:14px;
- padding: 10px;
- }
- </style>
- </head>
- <body>
- <%@ include file="/webpage/modules/web/top.jsp"%>
-
- <div class="new w clearfix">
- <div class="personal">
- <div class="personal_l fl">
- <h2>个人中心</h2>
- <ul>
- <li><a href="${ctxF}/info" class="do" id="hrefperson">个人资料</a></li>
- <li><a href="${ctxF}/personalpwd" id="hrefpwd">修改密码</a></li>
- <li><a href="${ctxF}/count" id="hrefCount">学习统计</a></li>
- <li><a href="${ctxF}/history" id="hrefhistory">答题测试</a></li>
- <li><a href="${ctxF}/exam/wait" id="hrefexam">在线考试</a></li>
- <li><a href="${ctxF}/plan" id="hrefplan">培训计划</a></li>
- <li><a href="#" onclick="exit()">退出登录</a></li>
- </ul>
- </div>
- <div class="personal_r fr">
- <div class="position">当前位置:<a href="${ctx}/">网站首页</a> > 个人中心 > 个人资料</div>
- <form id = "userForm" method="post">
- <div class="information" id="grxx" >
- <ul>
- <li><span>登录名:</span>${applicationScope.talentPerson.loginName}</li>
- <li><span>最后登录IP:</span>${applicationScope.talentPerson.loginIp}</li>
- <li><span>最后登录时间:</span><fmt:formatDate value="${applicationScope.talentPerson.loginDate}" type="both" dateStyle="full"/></li>
- <li><span>真实姓名:</span><input type="text" value="${applicationScope.talentPerson.name}" name="name"/></li>
- <li><span>邮 箱:</span><input type="text" value="${applicationScope.talentPerson.email}" name="email"/></li>
- <li><span>手 机:</span><input type="text" value="${applicationScope.talentPerson.mobile}" name="mobile"/></li>
- </ul>
- <div style="width:530px; margin: 0 auto;">
- <input type="submit" value="保 存" style="cursor: pointer;height:44px;border-radius: 4px;font-size:16px;color:#fff; background-color: #C7301E; width: 150px;border:none">
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- <div class="footer">
- <%@ include file="/webpage/modules/web/footer.jsp"%>
- </div>
- </body>
- </html>
|