Jonlin %!s(int64=6) %!d(string=hai) anos
pai
achega
976361a66f

+ 6 - 1
application/user/controller/Member.php

@@ -35,7 +35,12 @@ class Member extends UserControl
             );
             //print_r($update_info);
             $res = db('user')->where('user_id', $user_info['user_id'])->update($update_info);
-            return $this->redirect('User/Member/index');
+            if($res == 1){
+                $this->success('用户信息修改成功');
+            }else{
+                $this->success('用户信息修改失败');
+            }
+            //return $this->redirect('User/Member/index');
 
         }else{
             $user = db('user')->where('user_email',$user_info['user_email'])->find();

+ 68 - 6
application/user/controller/Updatepwd.php

@@ -44,9 +44,12 @@ class Updatepwd extends UserControl
                 'user_password' => md5($new_password)
             );
             $res = db('user')->where('user_id', $user_info['user_id'])->update($update_info);
-            if($res == 1){
-                return $this->redirect('User/Member/index');
-            }
+//            if($res == 1){
+//                $this->success('密码修改成功');
+//            }else{
+//                $this->success('密码修改失败');
+//            }
+            return $this->redirect('User/Accountsafe/index');
 
         }else{
             $user_info = $this->getAdminInfo();
@@ -61,7 +64,41 @@ class Updatepwd extends UserControl
      */
     public function username()
     {
-        return $this->fetch();
+        $user_info = $this->getAdminInfo();
+        $user = db('user')->where('user_id',$user_info['user_id'])->find();
+        if (request()->isPost()) {
+            $new_user_email = input('post.new_user_email');
+            $confirm_user_email = input('post.confirm_user_email');
+
+            // 新用户名 验证
+            if($new_user_email != $confirm_user_email){
+                //验证失败
+                $this->error('新用户名不一致');
+            }
+
+            $useremail = db('user')->where('user_email',$new_user_email)->find();
+            if(!empty($useremail)){
+                //验证失败
+                $this->error('用户名已存在');
+            }
+
+            $update_info = array(
+                'user_email' => $new_user_email
+            );
+            $res = db('user')->where('user_id', $user_info['user_id'])->update($update_info);
+//            if($res == 1){
+//                $this->success('用户名修改成功');
+//            }else{
+//                $this->success('用户名修改失败');
+//            }
+            return $this->redirect('User/Accountsafe/index');
+
+        }else{
+            $user_info = $this->getAdminInfo();
+            $user = db('user')->where('user_id',$user_info['user_id'])->find();
+            $this->assign('user', $user);
+            return $this->fetch();
+        }
     }
 
     /**
@@ -72,8 +109,33 @@ class Updatepwd extends UserControl
     {
         $user_info = $this->getAdminInfo();
         $user = db('user')->where('user_id',$user_info['user_id'])->find();
-        $this->assign('user', $user);
-        return $this->fetch();
+        if (request()->isPost()) {
+            $new_phone = input('post.new_phone');
+            $confirm_phone = input('post.confirm_phone');
+
+            // 新电话号码 验证
+            if($new_phone != $confirm_phone){
+                //验证失败
+                $this->error('新电话号码不一致');
+            }
+
+            $update_info = array(
+                'user_phone' => $new_phone
+            );
+            $res = db('user')->where('user_id', $user_info['user_id'])->update($update_info);
+//            if($res == 1){
+//                $this->success('电话号码修改成功');
+//            }else{
+//                $this->success('电话号码修改失败');
+//            }
+            return $this->redirect('User/Accountsafe/index');
+
+        }else{
+            $user_info = $this->getAdminInfo();
+            $user = db('user')->where('user_id',$user_info['user_id'])->find();
+            $this->assign('user', $user);
+            return $this->fetch();
+        }
     }
 
 }

+ 2 - 2
application/user/view/updatepwd/index.html

@@ -50,8 +50,8 @@
                         <td class="td_user_info"><input type="text" name="password" id="password" placeholder="当前密码"></td>
                     </tr>
                     <tr>
-                        <td class="td_info">修改密码</td>
-                        <td class="td_user_info"><input type="text" name="new_password" id="new_password" placeholder="重置密码"><div id="pwd" style="font-size: 10px;color:#aaa;margin-top: -30px;">密码必须包含有字母,数字,符号,密码长度为6-20个字符</div></td>
+                        <td class="td_info" style="height: 80px;">修改密码</td>
+                        <td class="td_user_info" style="height: 80px;"><input type="text" name="new_password" id="new_password" placeholder="重置密码"><div id="pwd" style="font-size: 10px;color:#aaa;margin-top: -30px;">密码必须包含有字母,数字,符号,密码长度为6-20个字符</div></td>
                     </tr>
                     <tr>
                         <td class="td_info">确认密码</td>

+ 43 - 74
application/user/view/updatepwd/phone.html

@@ -1,47 +1,17 @@
 {extend name="layout:home" /}
 {block name="container"}
 <style>
-    .yanzheng{
-        margin:0px auto;
-        height: 100px;
-        width: 600px;
-    }
-    ul{
+    .accountinfo_title{
+        width: 150px;
         margin:50px auto;
-        width: 536px;
-        /*border: 1px red solid;*/
-        text-align: center;
-        position: relative;
-    }
-
-    ul li{
-        /*border: 1px #aaa solid;*/
-        border-radius: 2px;
-        height: 30px;
-        width: 30px;
-        line-height:30px ;
-        float: left;
-        margin-left: 220px;
-    }
-    li .num{
-        border: 1px #aaa solid;
-        height: 30px;
-        width: 30px;
-        line-height:30px ;
-        text-align: center;
-        border-radius: 100%;
-        background-color: white;
-    }
-    li .tishi{
-        width: 100px;
         text-align: center;
-        /*border: 1px #aaa solid;*/
-        margin-left: -35px;
+        font-size: 13px;
         color: dodgerblue;
     }
     table{
-        margin:0 auto;
+        margin:-30px auto;
         font-size: 13px;
+        margin-bottom: 100px;
     }
     /*.accountinfo_title table{*/
     /*margin-left: 150px;*/
@@ -51,52 +21,51 @@
         height: 60px;
         line-height: 60px;
     }
+    .td_info{
+        width: 80px;
+        height: 60px;
+        line-height: 60px;
+    }
+    .td_user_info{
+        width: 220px;
+        height: 60px;
+        line-height: 60px;
+    }
     table input{
         border: 1px #aaa solid;
         border-radius: 2px;
         height: 30px;
-        width: 220px;
+        width: 280px;
         line-height:30px ;
     }
 </style>
 <div class="layui-tab layui-tab-card">
     <div class="updatepwd">
         <form method="post">
-            <div class="yanzheng">
-                <ul>
-                    <div style="border: 1px #aaa solid; width: 530px;margin-top: 15px;position: absolute;z-index: -1;" ></div>
-                    <li style="margin-left: 0px;">
-                        <div class="num">1</div>
-                        <div class="tishi">身份验证</div>
-                    </li>
-                    <li>
-                        <div class="num">2</div>
-                        <div class="tishi">新电话号码验证</div>
-                    </li>
-                    <li>
-                        <div class="num">3</div>
-                        <div class="tishi">下一步</div>
-                    </li>
-                </ul>
-            </div>
-            <div style="height: 280px;">
+            <div>
+                <div class="accountinfo_title" style="font-size: 16px;">修改电话号码</div>
                 <table>
                     <tr>
-                        <td class="td_info">您的电话号码</td>
-                        <td style="position: relative;">+ (86)&nbsp&nbsp{$user['user_phone']}<input type="button" value="获取验证码" style="width: 80px;accept:right;position: absolute;right: 0px;top:15px;"></td>
+                        <td class="td_info">当前电话号码</td>
+                        <td class="td_user_info"><input type="text" name="phone" id="phone" value="{$user['user_phone']}" readonly="readonly"></td>
                     </tr>
                     <tr>
-                        <td class="td_info">输入验证码</td>
-                        <td class="td_user_info"><input type="text" name="captcha" id="captcha" placeholder="请输入验证码"></td>
+                        <td class="td_info">修改电话号码</td>
+                        <td class="td_user_info"><input type="text" name="new_phone" id="new_phone" placeholder="请输入修改电话号码"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">确认电话号码</td>
+                        <td class="td_user_info"><input type="text" name="confirm_phone" id="confirm_phone" placeholder="请再次输入修改电话号码"></td>
                     </tr>
                     <tr>
                         <td class="td_info"></td>
-                        <td class="next">
-                            <input type="button" value="下一步" style="width: 70px;border-color: dodgerblue;color: dodgerblue;background-color: white;">
-                            <input type="button" id="btn" value="取消" style="width: 70px;border-color: dodgerblue;color: dodgerblue;background-color: white;margin-left: 30px;">
+                        <td>
+                            <input type="submit" id="layui-btn" value="保存修改" style="width: 70px;margin-left: 30px;">
+                            <input type="button" id="btn" value="取消" style="width: 70px;margin-left: 50px;">
                         </td>
                     </tr>
                 </table>
+
             </div>
         </form>
     </div>
@@ -105,29 +74,29 @@
     $("#btn").click(function(){
         window.history.back(-1);
     });
-    //码 校验
-    $("#new_password").blur(function(){
-        var password = document.getElementById("new_password").value;
-        var patrn=/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,20}$/;
+    //电话号码 校验
+    $("#new_phone").blur(function(){
+        var password = document.getElementById("new_phone").value;
+        var patrn=/^1[3456789]\d{9}$/;
         if (!patrn.exec(password)){
-            document.getElementById("new_password").style.borderColor = "red";
+            document.getElementById("new_phone").style.borderColor = "red";
             document.getElementById("layui-btn").type = "button";
         }else{
-            document.getElementById("new_password").style.borderColor = "#e6e6e6";
-            if(document.getElementById("confirm_password").style.borderColor != "red"){
+            document.getElementById("new_phone").style.borderColor = "#e6e6e6";
+            if(document.getElementById("confirm_phone").style.borderColor != "red"){
                 document.getElementById("layui-btn").type = "submit";
             }
         }
     });
-    $("#confirm_password").blur(function(){
-        var password = document.getElementById("confirm_password").value;
-        var patrn=/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,20}$/;
+    $("#confirm_phone").blur(function(){
+        var password = document.getElementById("confirm_phone").value;
+        var patrn=/^1[3456789]\d{9}$/;
         if (!patrn.exec(password)){
-            document.getElementById("confirm_password").style.borderColor = "red";
+            document.getElementById("confirm_phone").style.borderColor = "red";
             document.getElementById("layui-btn").type = "button";
         }else{
-            document.getElementById("confirm_password").style.borderColor = "#e6e6e6";
-            if(document.getElementById("new_password").style.borderColor != "red"){
+            document.getElementById("confirm_phone").style.borderColor = "#e6e6e6";
+            if(document.getElementById("new_phone").style.borderColor != "red"){
                 document.getElementById("layui-btn").type = "submit";
             }
         }

+ 154 - 0
application/user/view/updatepwd/phone1.html

@@ -0,0 +1,154 @@
+{extend name="layout:home" /}
+{block name="container"}
+<style>
+    .yanzheng{
+        margin:0px auto;
+        height: 100px;
+        width: 600px;
+    }
+    ul{
+        margin:50px auto;
+        width: 536px;
+        /*border: 1px red solid;*/
+        text-align: center;
+        position: relative;
+    }
+
+    ul li{
+        /*border: 1px #aaa solid;*/
+        border-radius: 2px;
+        height: 30px;
+        width: 30px;
+        line-height:30px ;
+        float: left;
+        margin-left: 220px;
+    }
+    li .num{
+        border: 1px #aaa solid;
+        height: 30px;
+        width: 30px;
+        line-height:30px ;
+        text-align: center;
+        border-radius: 100%;
+        background-color: white;
+    }
+    li .tishi{
+        width: 100px;
+        text-align: center;
+        /*border: 1px #aaa solid;*/
+        margin-left: -35px;
+        color: dodgerblue;
+    }
+    table{
+        margin:0 auto;
+        font-size: 13px;
+    }
+    /*.accountinfo_title table{*/
+    /*margin-left: 150px;*/
+    /*}*/
+    table td{
+        width: 100px;
+        height: 60px;
+        line-height: 60px;
+    }
+    table input{
+        border: 1px #aaa solid;
+        border-radius: 2px;
+        height: 30px;
+        width: 220px;
+        line-height:30px ;
+    }
+</style>
+<div class="layui-tab layui-tab-card">
+    <div class="updatepwd">
+        <form method="post">
+            <div class="yanzheng">
+                <ul>
+                    <div style="border: 1px #aaa solid; width: 530px;margin-top: 15px;position: absolute;z-index: -1;" ></div>
+                    <li style="margin-left: 0px;">
+                        <div class="num">1</div>
+                        <div class="tishi">身份验证</div>
+                    </li>
+                    <li>
+                        <div class="num">2</div>
+                        <div class="tishi">新电话号码验证</div>
+                    </li>
+                    <li>
+                        <div class="num">3</div>
+                        <div class="tishi">下一步</div>
+                    </li>
+                </ul>
+            </div>
+            <div style="height: 280px;">
+                <table>
+                    <tr>
+                        <td class="td_info">您的电话号码</td>
+                        <td style="position: relative;">+ (86)&nbsp&nbsp{$user['user_phone']}<input type="button" value="获取验证码" style="width: 80px;accept:right;position: absolute;right: 0px;top:15px;"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">输入验证码</td>
+                        <td class="td_user_info"><input type="text" name="captcha" id="captcha" placeholder="请输入验证码"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info"></td>
+                        <td class="next">
+                            <input type="button" value="下一步" style="width: 70px;border-color: dodgerblue;color: dodgerblue;background-color: white;">
+                            <input type="button" id="btn" value="取消" style="width: 70px;border-color: dodgerblue;color: dodgerblue;background-color: white;margin-left: 30px;">
+                        </td>
+                    </tr>
+                </table>
+            </div>
+        </form>
+    </div>
+</div>
+<script>
+    $("#btn").click(function(){
+        window.history.back(-1);
+    });
+    //密码 校验
+    $("#new_password").blur(function(){
+        var password = document.getElementById("new_password").value;
+        var patrn=/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,20}$/;
+        if (!patrn.exec(password)){
+            document.getElementById("new_password").style.borderColor = "red";
+            document.getElementById("layui-btn").type = "button";
+        }else{
+            document.getElementById("new_password").style.borderColor = "#e6e6e6";
+            if(document.getElementById("confirm_password").style.borderColor != "red"){
+                document.getElementById("layui-btn").type = "submit";
+            }
+        }
+    });
+    $("#confirm_password").blur(function(){
+        var password = document.getElementById("confirm_password").value;
+        var patrn=/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,20}$/;
+        if (!patrn.exec(password)){
+            document.getElementById("confirm_password").style.borderColor = "red";
+            document.getElementById("layui-btn").type = "button";
+        }else{
+            document.getElementById("confirm_password").style.borderColor = "#e6e6e6";
+            if(document.getElementById("new_password").style.borderColor != "red"){
+                document.getElementById("layui-btn").type = "submit";
+            }
+        }
+    });
+</script>
+<script type="text/javascript">
+    layui.use('laydate', function(){
+        var laydate = layui.laydate;
+
+        //执行一个laydate实例
+        laydate.render({
+            elem: '#creatTime' //指定元素
+        });
+        laydate.render({
+            elem:'#timeRang',
+            range:true,
+            format: 'yyyy/MM/dd',
+            done: function(value, date){
+                /* 时间选择完成后的回调 */
+            }
+        })
+    });
+</script>
+{/block}

+ 33 - 87
application/user/view/updatepwd/username.html

@@ -1,98 +1,71 @@
 {extend name="layout:home" /}
 {block name="container"}
 <style>
-    .yanzheng{
-        margin:0px auto;
-        height: 100px;
-        width: 600px;
-    }
-    ul{
+    .accountinfo_title{
+        width: 150px;
         margin:50px auto;
-        width: 536px;
-        /*border: 1px red solid;*/
-        text-align: center;
-        position: relative;
-    }
-
-    ul li{
-        /*border: 1px #aaa solid;*/
-        border-radius: 2px;
-        height: 30px;
-        width: 30px;
-        line-height:30px ;
-        float: left;
-        margin-left: 220px;
-    }
-    li .num{
-        border: 1px #aaa solid;
-        height: 30px;
-        width: 30px;
-        line-height:30px ;
-        text-align: center;
-        border-radius: 100%;
-        background-color: white;
-    }
-    li .tishi{
-        width: 100px;
         text-align: center;
-        margin-left: -35px;
+        font-size: 13px;
         color: dodgerblue;
     }
     table{
-        margin:0 auto;
+        margin:-30px auto;
         font-size: 13px;
+        margin-bottom: 100px;
     }
+    /*.accountinfo_title table{*/
+    /*margin-left: 150px;*/
+    /*}*/
     table td{
         width: 100px;
         height: 60px;
         line-height: 60px;
     }
+    .td_info{
+        width: 80px;
+        height: 60px;
+        line-height: 60px;
+    }
+    .td_user_info{
+        width: 220px;
+        height: 60px;
+        line-height: 60px;
+    }
     table input{
         border: 1px #aaa solid;
         border-radius: 2px;
         height: 30px;
-        width: 220px;
+        width: 280px;
         line-height:30px ;
     }
 </style>
 <div class="layui-tab layui-tab-card">
     <div class="updatepwd">
         <form method="post">
-            <div class="yanzheng">
-                <ul>
-                    <div style="border: 1px #aaa solid; width: 530px;margin-top: 15px;position: absolute;z-index: -1;" ></div>
-                    <li style="margin-left: 0px;">
-                        <div class="num">1</div>
-                        <div class="tishi">身份验证</div>
-                    </li>
-                    <li>
-                        <div class="num">2</div>
-                        <div class="tishi">新登陆邮箱验证</div>
-                    </li>
-                    <li>
-                        <div class="num">3</div>
-                        <div class="tishi">下一步</div>
-                    </li>
-                </ul>
-            </div>
-            <div style="height: 280px;">
+            <div>
+                <div class="accountinfo_title" style="font-size: 16px;">修改用户名</div>
                 <table>
                     <tr>
-                        <td class="td_info">您的用户名</td>
-                        <td style="position: relative;">{$Think.session.user_email}<input type="button" value="获取验证码" style="width: 80px;accept:right;position: absolute;right: 0px;top:15px;"></td>
+                        <td class="td_info">当前用户名</td>
+                        <td class="td_user_info"><input type="text" name="user_email" id="user_email" value="{$user['user_email']}" readonly="readonly"></td>
                     </tr>
                     <tr>
-                        <td class="td_info">输入验证码</td>
-                        <td class="td_user_info"><input type="text" name="captcha" id="captcha" placeholder="请输入验证码"></td>
+                        <td class="td_info">修改用户名</td>
+                        <td class="td_user_info"><input type="text" name="new_user_email" id="new_user_email" placeholder="请输入修改用户名"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">确认用户名</td>
+                        <td class="td_user_info"><input type="text" name="confirm_user_email" id="confirm_user_email" placeholder="请再次输入修改用户名"></td>
                     </tr>
                     <tr>
                         <td class="td_info"></td>
-                        <td class="next">
-                            <input type="button" value="下一步" style="width: 70px;border-color: dodgerblue;color: dodgerblue;background-color: white;">
-                            <input type="button" id="btn" value="取消" style="width: 70px;border-color: dodgerblue;color: dodgerblue;background-color: white;margin-left: 30px;">
+                        <td>
+                            <input type="submit" id="layui-btn" value="保存修改" style="width: 70px;margin-left: 30px;">
+                            <input type="button" id="btn" value="取消" style="width: 70px;margin-left: 50px;">
                         </td>
                     </tr>
                 </table>
+
             </div>
         </form>
     </div>
@@ -101,33 +74,6 @@
     $("#btn").click(function(){
         window.history.back(-1);
     });
-    //密码 校验
-    $("#new_password").blur(function(){
-        var password = document.getElementById("new_password").value;
-        var patrn=/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,20}$/;
-        if (!patrn.exec(password)){
-            document.getElementById("new_password").style.borderColor = "red";
-            document.getElementById("layui-btn").type = "button";
-        }else{
-            document.getElementById("new_password").style.borderColor = "#e6e6e6";
-            if(document.getElementById("confirm_password").style.borderColor != "red"){
-                document.getElementById("layui-btn").type = "submit";
-            }
-        }
-    });
-    $("#confirm_password").blur(function(){
-        var password = document.getElementById("confirm_password").value;
-        var patrn=/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,20}$/;
-        if (!patrn.exec(password)){
-            document.getElementById("confirm_password").style.borderColor = "red";
-            document.getElementById("layui-btn").type = "button";
-        }else{
-            document.getElementById("confirm_password").style.borderColor = "#e6e6e6";
-            if(document.getElementById("new_password").style.borderColor != "red"){
-                document.getElementById("layui-btn").type = "submit";
-            }
-        }
-    });
 </script>
 <script type="text/javascript">
     layui.use('laydate', function(){

+ 150 - 0
application/user/view/updatepwd/username1.html

@@ -0,0 +1,150 @@
+{extend name="layout:home" /}
+{block name="container"}
+<style>
+    .yanzheng{
+        margin:0px auto;
+        height: 100px;
+        width: 600px;
+    }
+    ul{
+        margin:50px auto;
+        width: 536px;
+        /*border: 1px red solid;*/
+        text-align: center;
+        position: relative;
+    }
+
+    ul li{
+        /*border: 1px #aaa solid;*/
+        border-radius: 2px;
+        height: 30px;
+        width: 30px;
+        line-height:30px ;
+        float: left;
+        margin-left: 220px;
+    }
+    li .num{
+        border: 1px #aaa solid;
+        height: 30px;
+        width: 30px;
+        line-height:30px ;
+        text-align: center;
+        border-radius: 100%;
+        background-color: white;
+    }
+    li .tishi{
+        width: 100px;
+        text-align: center;
+        margin-left: -35px;
+        color: dodgerblue;
+    }
+    table{
+        margin:0 auto;
+        font-size: 13px;
+    }
+    table td{
+        width: 100px;
+        height: 60px;
+        line-height: 60px;
+    }
+    table input{
+        border: 1px #aaa solid;
+        border-radius: 2px;
+        height: 30px;
+        width: 220px;
+        line-height:30px ;
+    }
+</style>
+<div class="layui-tab layui-tab-card">
+    <div class="updatepwd">
+        <form method="post">
+            <div class="yanzheng">
+                <ul>
+                    <div style="border: 1px #aaa solid; width: 530px;margin-top: 15px;position: absolute;z-index: -1;" ></div>
+                    <li style="margin-left: 0px;">
+                        <div class="num">1</div>
+                        <div class="tishi">身份验证</div>
+                    </li>
+                    <li>
+                        <div class="num">2</div>
+                        <div class="tishi">新登陆邮箱验证</div>
+                    </li>
+                    <li>
+                        <div class="num">3</div>
+                        <div class="tishi">下一步</div>
+                    </li>
+                </ul>
+            </div>
+            <div style="height: 280px;">
+                <table>
+                    <tr>
+                        <td class="td_info">您的用户名</td>
+                        <td style="position: relative;">{$Think.session.user_email}<input type="button" value="获取验证码" style="width: 80px;accept:right;position: absolute;right: 0px;top:15px;"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">输入验证码</td>
+                        <td class="td_user_info"><input type="text" name="captcha" id="captcha" placeholder="请输入验证码"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info"></td>
+                        <td class="next">
+                            <input type="button" value="下一步" style="width: 70px;border-color: dodgerblue;color: dodgerblue;background-color: white;">
+                            <input type="button" id="btn" value="取消" style="width: 70px;border-color: dodgerblue;color: dodgerblue;background-color: white;margin-left: 30px;">
+                        </td>
+                    </tr>
+                </table>
+            </div>
+        </form>
+    </div>
+</div>
+<script>
+    $("#btn").click(function(){
+        window.history.back(-1);
+    });
+    //密码 校验
+    $("#new_password").blur(function(){
+        var password = document.getElementById("new_password").value;
+        var patrn=/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,20}$/;
+        if (!patrn.exec(password)){
+            document.getElementById("new_password").style.borderColor = "red";
+            document.getElementById("layui-btn").type = "button";
+        }else{
+            document.getElementById("new_password").style.borderColor = "#e6e6e6";
+            if(document.getElementById("confirm_password").style.borderColor != "red"){
+                document.getElementById("layui-btn").type = "submit";
+            }
+        }
+    });
+    $("#confirm_password").blur(function(){
+        var password = document.getElementById("confirm_password").value;
+        var patrn=/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,20}$/;
+        if (!patrn.exec(password)){
+            document.getElementById("confirm_password").style.borderColor = "red";
+            document.getElementById("layui-btn").type = "button";
+        }else{
+            document.getElementById("confirm_password").style.borderColor = "#e6e6e6";
+            if(document.getElementById("new_password").style.borderColor != "red"){
+                document.getElementById("layui-btn").type = "submit";
+            }
+        }
+    });
+</script>
+<script type="text/javascript">
+    layui.use('laydate', function(){
+        var laydate = layui.laydate;
+
+        //执行一个laydate实例
+        laydate.render({
+            elem: '#creatTime' //指定元素
+        });
+        laydate.render({
+            elem:'#timeRang',
+            range:true,
+            format: 'yyyy/MM/dd',
+            done: function(value, date){
+                /* 时间选择完成后的回调 */
+            }
+        })
+    });
+</script>
+{/block}