| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() + path+"/";
- request.setAttribute("contextPath", basePath);
-
- String redirectUrl= request.getParameter("redirectUrl");
- request.setAttribute("redirectUrl", redirectUrl);
- %>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <base href="<%=basePath%>">
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <meta name="format-detection" content="telephone=no">
- <title>手机绑定</title>
- <c:set var="path" value="${pageContext.request.contextPath}" />
- <script src="${contextPath }app/lib/flexible.js"></script>
- <script type="text/javascript" src="${contextPath }res/js/jquery.min.js"></script>
- <script type="text/javascript" src="${contextPath }res/js/layer/layer.min.js"></script>
- <link rel="stylesheet" href="${contextPath }app/lib/flexible.css">
- <link rel="stylesheet" href="${contextPath }app/css/basem.css">
- <link rel="stylesheet" href="${contextPath }app/css/logome.css">
- <script type="text/javascript">
-
- var timeid, remainTime;
- function calcTime() {
- remainTime--;
- if (remainTime > 0) {
- $('#loginForm p[data-action="getcode"]').text("(" + remainTime + "秒)");
- } else {
- window.clearInterval(timeid);
- $('#loginForm p[data-action="getcode"]').text("获取验证码");
- $('#loginForm p[data-action="getcode"]').removeAttr("disabled");
- }
- }
- $(function(){
-
- var $loginForm = $('#loginForm');
-
- $('#loginForm p[data-action="getcode"]').click(function() {
- var phone=$loginForm.find("input[name='phone']").val();
- if(phone=='' || phone=='请输入11位手机号码')
- {
- layer.msg("请输入正确的手机号!");
- return false;
- }
- if(!checkMobile(phone)){
- return;
- }
-
- if($('#loginForm p[data-action="getcode"]').attr("disabled")){
- return;
- }
- $('#loginForm p[data-action="getcode"]').attr("disabled","true");
- //$('input[name="phone"]').val()
- var parm='{"phone":"'+phone+'" ,"type":"3"}'
- $.post('${contextPath}rest/mgmUser/getCode.cs',{
- "data":parm
- }, function(data) {1
- if (data.ret == 1) {
- remainTime = 60;
- timeid = window.setInterval("calcTime()", 1000);
- } else {
- layer.msg(data.msg);
- $('#loginForm p[data-action="getcode"]').removeAttr("disabled");
- }
- }, "json");
- });
-
- $('#button').click(function(){
- var phone=$("input[name='phone']").val();
- var code=$("input[name='code']").val();
- var password=$("input[name='password']").val();
- var password2=$("input[name='password2']").val();
- if(phone==''){
- layer.msg("请输入手机号!");
- return ;
- }
- if(code=="" || code==null){
- layer.msg("请输入验证码!");
- return ;
- }
- if(password==""){
- layer.msg("请输入新密码!");
- return ;
- }
- if(password2==""){
- layer.msg("请再次输入新密码!");
- return ;
- }else{
- if(password!=password2){
- layer.msg("两次输入密码不一致!");
- return ;
- }
- }
- var parm='{"phone":"'+phone+'" ,"code":"'+code+'","pwd":"'+password+'","userId":"${USER_ID}"}'
-
- //手机绑定
- $.post('${contextPath}web/mgmUserCtl/phoneBinding.cs', {
- "data" : parm
- }, function(data) {
- var datas=eval(data.data);
- if (data.ret == 1) {
- layer.msg('绑定成功!', {
- time: 1000
- }, function(){
- window.location.href = '${contextPath }web/mgmUserCtl/index.cs?userId='+datas.id;
- });
- } else {
- layer.msg(data.msg);
- }
- }, "json");
- });
-
- function checkMobile(sMobile){
- //手机号正则
- var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;
- //电话
- var phone = $.trim(sMobile);
- if (!phoneReg.test(phone)) {
- alert('请输入有效的手机号码!');
- return false;
- }
- return true;
- }
- });
-
- </script>
- </head>
- <body>
- <div class="titbox">
- <a class="titreturn left" href="${contextPath }app/login/login.jsp"><img src="${contextPath }app/img/return1@2x.png" alt=""></a>
- <h1>手机绑定</h1>
- </div>
- <div class="forgetbox top50">
- <div class="safe">
- <form action="#" name="loginForm" id="loginForm" method="post">
- <ul class="logul">
- <li>
- <div><img class="logicon" src="${contextPath }app/img/iphone@2x.png" alt=""><span>手机</span></div>
- <input type="text" name="phone" placeholder="请输入您的手机号">
- </li>
- <li>
- <div><img class="logicon" src="${contextPath }app/img/yanz@2x.png" alt=""><span>验证码</span></div>
- <div class="logclean">
- <input class="left" type="text" name="code" placeholder="请输入验证码">
- <p data-action="getcode" class="right">获取验证码</p>
- </div>
- </li>
- <li>
- <div><img class="logicon" src="${contextPath }app/img/pw@2x.png" alt=""><span>密码</span></div>
- <input type="password" name="password" placeholder="请重新设置您的登录密码">
- </li>
- <li>
- <div><img class="logicon" src="${contextPath }app/img/pw@2x.png" alt=""><span>确认密码</span></div>
- <input type="password" name="password2" placeholder="请重新设置您的登录密码">
- </li>
- </ul>
- <a class="redbtn" href="javascript:void(0);" id="button">完成</a>
- </form>
- </div>
- </div>
- </body>
- </html>
|