Browse Source

Merge branch 'master' of http://git.bocai108.com:10180/Ethan/Home-Data

Ethan 6 năm trước cách đây
mục cha
commit
900d7b28bb

+ 33 - 0
application/user/controller/Accountsafe.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace app\user\controller;
+
+use think\Controller;
+use think\Lang;
+use think\Validate;
+
+class Accountsafe extends UserControl
+{
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/login.lang.php');
+    }
+
+    /**
+     * 账户安全
+     * @return mixed
+     */
+    public function index()
+    {
+        $user_info = $this->getAdminInfo();
+        $user = db('user')->where('user_id',$user_info['user_id'])->find();
+        $this->assign('user', $user);
+        return $this->fetch();
+    }
+
+}
+
+
+?>

+ 1 - 1
application/user/controller/Admin.php

@@ -5,7 +5,7 @@ namespace app\user\controller;
 use think\Lang;
 
 
-class Admin extends AdminControl
+class Admin extends UserControl
 {
     public function _initialize()
     {

+ 31 - 145
application/user/controller/Member.php

@@ -5,7 +5,7 @@ namespace app\user\controller;
 use think\Validate;
 use think\Lang;
 
-class Member extends AdminControl
+class Member extends UserControl
 {
 
     public function _initialize()
@@ -15,162 +15,48 @@ class Member extends AdminControl
     }
 
     /**
-     * 用户列表
+     * 用户
      * @return mixed
      */
     public function index()
     {
-        $model_member = Model('member');
-        $title = input('post.title');
-        $time = input('post.timeRang');
-        if(!empty($time)){
-            $gap = explode(' - ', $time);
-            $begin = strtotime($gap[0]);
-            $end = strtotime($gap[1]);
-        }
-        $condition = array();
-        if($title){
-            $condition['member_contacts|member_mobile|member_name'] = $title;
-        }
-        if($time && $begin && $end){
-            $condition['member_add_time'] = array('between', array($begin, $end));
-        }
-        $member_list = $model_member->getMemberList($condition, '*', 10);
-        $allpower = $this->qxhans();
-        $this->assign('allpower',$allpower);
-        $this->assign('member_list', $member_list);
-        $this->assign('show_page', $model_member->page_info->render());
-        $this->setAdminCurItem('index');
-        return $this->fetch();
-    }
-
-    /**
-     * 添加用户
-     * @return mixed
-     */
-    public function add()
-    {
+        $user_info = $this->getAdminInfo();
         if (request()->isPost()) {
-            $model_member = Model('member');
-            //判断用户名是否存在
-            $usetime = input('post.member_usetime');
-            $validitytime = $model_member->validity($usetime);
-            $data = array(
-                'member_name' => input('post.member_name'),
-                'member_url' =>input('post.member_url'),
-                'member_mobile' => input('post.member_mobile'),
-                'member_contacts' =>input('post.member_contacts'),
-                'member_mailbox' => input('post.member_mailbox'),
-                'member_usetime' => $usetime,
-                'member_validitytime' => $validitytime,
-                'member_status' => input('post.member_status') ? input('post.member_status') : 1,
-                'member_add_time' => TIMESTAMP
+            $user_name = input('post.user_name');
+            $company = input('post.company');
+            $trade = input('post.trade');
+            $address = input('post.address');
+
+            $update_info = array(
+                'user_name' => $user_name,
+                'company' => $company,
+                'trade' => $trade,
+                'address' => $address
             );
-            //添加到数据库
-            $result = $model_member->addMember($data);
-
-            if ($result) {
-                $cjglz =array('wlcome','wlcome.index','config','config.index','config.add','config.edit','config.del','admin','admin.index','admin.add','admin.edit','admin.del','admingroup','admingroup.index','admingroup.add','admingroup.edit','admingroup.del','product','product.index','product.add','product.edit','product.del','news','news.index','news.add','news.edit','news.del','message','message.index','message.reply','message.del','Visitkf','Visitkf.index','glservice','glservice.index');
-                $limit_str = '';
-                if (is_array($cjglz)) {
-                    $limit_str = implode('|', $cjglz);
-                }
-                $sgda = array(
-                    'group_name' => '超级管理员',
-                    'group_limits' => ds_encrypt($limit_str, MD5_KEY . md5('超级管理员')),
-                    'lang' => 'zh-cn',
-                    'suosgs' => $result,
-                    'addtime' => TIMESTAMP
-                );
-                $groupid = Model('Admingroup')->addAdminGroup($sgda);
-                if($groupid){
-                    //创建一个客服帐号
-                    $erda = array(
-                        'service_name' => input('post.member_mailbox'),
-                        'service_password' => md5('123456'),
-                        'service_group_id' => $groupid,
-                        'service_is_super' => 1,
-                        'service_pid' => $result,
-                        'service_add_time' => TIMESTAMP
-                    );
-                    Model('service')->addservice($erda);
-                    dsLayerOpenSuccess(lang('member_add_succ'));
-                }
-            } else {
-                $this->error(lang('member_add_fail'));
+            //print_r($update_info);
+            $res = db('user')->where('user_id', $user_info['user_id'])->update($update_info);
+            if($res == 1){
+                return $this->redirect('User/Member/index');
             }
-        } else {
-            $member_array = array(
-                'member_status' => 0,
-                'add' => 1,
-            );
-            $this->assign('member', $member_array);
-            $this->setAdminCurItem('add');
-            return $this->fetch('form');
-        }
-    }
 
-    public function edit()
-    {
-        $member_id = input('param.member_id');
-        if (empty($member_id)) {
-            $this->error(lang('param_error'));
-        }
-        $model_member = Model('member');
-        $usetime = input('post.member_usetime');
-        $validitytime = $model_member->validity($usetime);
-        if (!request()->isPost()) {
-            $condition['member_id'] = $member_id;
-            $member_array = $model_member->getMemberInfo($condition);
-            $member_array['add'] = 0;
-            $this->assign('member', $member_array);
-            $this->setAdminCurItem('edit');
-            return $this->fetch('form');
-        } else {
-            $data = array(
-                'member_name' => input('post.member_name'),
-                'member_url' => input('post.member_url'),
-                'member_mobile' => input('post.member_mobile'),
-                'member_contacts' => input('post.member_contacts'),
-                'member_mailbox' => input('post.member_mailbox'),
-                'member_usetime' => $usetime,
-                'member_validitytime' => $validitytime,
-                'member_status' => input('post.member_status'),
-            );
-            //验证数据  END
-            $result = $model_member->editMember(array('member_id' => intval($member_id)), $data);
-            if ($result) {
-                dsLayerOpenSuccess(lang('member_edit_succ'));
-            } else {
-                $this->error(lang('member_edit_fail'));
+        }else{
+            $user = db('user')->where('user_email',$user_info['user_email'])->find();
+            if($user['user_status'] ==1){
+                $user['user_status_cn'] = '已实名认证';
+            }else{
+                $user['user_status_cn'] = '未实名认证';
             }
-        }
-    }
 
-    public function del()
-    {
-        $member_id = input('param.member_id');
-        if (empty($member_id)) {
-            $this->error(lang('param_error'));
-        }
-        $result = db('member')->delete($member_id);
-        if ($result) {
-            ds_json_encode(10000, lang('member_del_succ'));
-        } else {
-            ds_json_encode(10001, lang('member_del_fail'));
+            if($user['user_type'] ==1){
+                $user['user_type_cn'] = '个人用户';
+            }
+            if($user['user_type'] ==2){
+                $user['user_type_cn'] = '企业用户';
+            }
+            $this->assign('user', $user);
+            return $this->fetch();
         }
     }
 
-    protected function getAdminItemList()
-    {
-        $menu_array = array(
-            array(
-                'name' => 'index', 'text' => lang('ds_manage'), 'url' => url('Member/index')
-            ), array(
-                'name' => 'add', 'text' => lang('ds_add'), 'url' => "javascript:dsLayerOpen('".url('Member/add')."','".lang('ds_add')."')"
-            ),
-        );
-        return $menu_array;
-    }
 
 }

+ 82 - 0
application/user/controller/Updatepwd.php

@@ -0,0 +1,82 @@
+<?php
+
+namespace app\user\controller;
+
+use think\Controller;
+use think\Lang;
+use think\Validate;
+
+class Updatepwd extends UserControl
+{
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/login.lang.php');
+    }
+
+    /**
+     * 修改密码
+     * @return mixed
+     */
+    public function index()
+    {
+        $user_info = $this->getAdminInfo();
+        $user = db('user')->where('user_id',$user_info['user_id'])->find();
+        if (request()->isPost()) {
+            $password = input('post.password');
+            $new_password = input('post.new_password');
+            $confirm_password = input('post.confirm_password');
+
+            // 原密码 验证
+            if(md5($password) != $user['user_password']){
+                //验证失败
+                $this->error('原密码输入不正确');
+            }
+
+            // 新密码 验证
+            if($new_password != $confirm_password){
+                //验证失败
+                $this->error('新密码不一致');
+            }
+
+            $update_info = array(
+                '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');
+            }
+
+        }else{
+            $user_info = $this->getAdminInfo();
+            $user = db('user')->where('user_id',$user_info['user_id'])->find();
+            return $this->fetch();
+        }
+    }
+
+    /**
+     * 修改用户名
+     * @return mixed
+     */
+    public function username()
+    {
+        return $this->fetch();
+    }
+
+    /**
+     * 修改电话
+     * @return mixed
+     */
+    public function phone()
+    {
+        $user_info = $this->getAdminInfo();
+        $user = db('user')->where('user_id',$user_info['user_id'])->find();
+        $this->assign('user', $user);
+        return $this->fetch();
+    }
+
+}
+
+
+?>

+ 1 - 1
application/user/controller/UserControl.php

@@ -134,7 +134,7 @@ class UserControl extends Controller
                     ),
                     'personnel_security' => array(
                         'text' => lang('ds_personnel_security'),
-                        'url' => url('Admin/index'),
+                        'url' => url('Accountsafe/index'),
                     ),
                     'real_name_authentication' => array(
                         'text' => lang('ds_real_name_authentication'),

+ 141 - 0
application/user/view/accountsafe/index.html

@@ -0,0 +1,141 @@
+{extend name="layout:home" /}
+{block name="container"}
+<style>
+    table{
+        margin:20px 50px;
+        font-size: 13px;
+    }
+    /*.accountinfo_title table{*/
+    /*margin-left: 150px;*/
+    /*}*/
+    table td{
+        height: 50px;
+        line-height: 50px;
+    }
+    .td_name{
+        width: 120px;
+    }
+    .td_info{
+        width: 450px;
+    }
+    .td_update{
+        width: 100px;
+        color: dodgerblue;
+    }
+    .tanchu{
+        top:30px;
+        left: 20%;
+        width: 400px;
+        height: 320px;
+        position: absolute;
+        border: 1px grey solid;
+        border-radius: 3px;
+        background-color: white;
+        display: none;
+    }
+    .tanchu div{
+        margin:30px auto;
+        text-align: center;
+        border-radius: 2px;
+        line-height: 30px;
+    }
+
+</style>
+<div class="layui-tab layui-tab-card">
+    <div class="tanchu" id="update_email">
+        <div style="margin-top: 20px;">遇到问题</div>
+        <div style="font-size: 11px;">您正在为{$Think.session.user_email}修改登陆邮箱,请选择一种身份验证方式</div>
+        <div style="border: 1px grey solid;width:240px;height: 30px;">
+            <span>通过邮验证</span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<span><a href="">立即验证</a></span>
+        </div>
+        <div style="border: 1px grey solid;width:240px;height: 30px;">
+            <span>通手机验证</span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<span><a href="">立即验证</a></span>
+        </div>
+        <div style="width:60px;height: 30px;line-height:30px;background-color: dodgerblue;color: white;border-radius: 2px;" id="email_off">关闭</div>
+    </div>
+    <div class="tanchu" id="update_pwd">
+        <div style="margin-top: 20px;">遇到问题</div>
+        <div style="font-size: 11px;">您正在为{$Think.session.user_email}修改登陆密码,请选择一种身份验证方式</div>
+        <div style="border: 1px grey solid;width:240px;height: 30px;">
+            <span>通过邮验证</span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<span><a href="">立即验证</a></span>
+        </div>
+        <div style="border: 1px grey solid;width:240px;height: 30px;">
+            <span>通手机验证</span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<span><a href="">立即验证</a></span>
+        </div>
+        <div style="width:60px;height: 30px;line-height:30px;background-color: dodgerblue;color: white;border-radius: 2px;" id="pwd_off">关闭</div>
+    </div>
+    <div class="tanchu" id="update_phone">
+        <div style="margin-top: 20px;">遇到问题</div>
+        <div style="font-size: 11px;">您正在为{$Think.session.user_email}修改电话号码,请选择一种身份验证方式</div>
+        <div style="border: 1px grey solid;width:240px;height: 30px;">
+            <span>通过邮验证</span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<span><a href="">立即验证</a></span>
+        </div>
+        <div style="border: 1px grey solid;width:240px;height: 30px;">
+            <span>通手机验证</span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<span><a href="">立即验证</a></span>
+        </div>
+        <div style="width:60px;height: 30px;line-height:30px;background-color: dodgerblue;color: white;border-radius: 2px;" id="phone_off">关闭</div>
+    </div>
+    <div class="updatepwd">
+        <form method="post">
+            <div>
+                <table>
+                    <tr>
+                        <td class="td_name">登陆邮箱</td>
+                        <td class="td_info">您的登陆邮箱:{$Think.session.user_email}</td>
+                        <td class="td_update" id="email">更改</td>
+                    </tr>
+                    <tr>
+                        <td class="td_name">登陆密码</td>
+                        <td class="td_info">互联网账户存在被盗风险,建议您定期更改密码,以确保账户安全。</td>
+                        <td class="td_update" id="pwd">更改</td>
+                    </tr>
+                    <tr>
+                        <td class="td_name">电话号码</td>
+                        <td class="td_info">您已绑定手机:+ (86)&nbsp&nbsp{$user['user_phone']}</td>
+                        <td class="td_update" id="phone">更改</td>
+                    </tr>
+                </table>
+
+            </div>
+        </form>
+    </div>
+</div>
+<script>
+    $("#email").click(function(){
+        document.getElementById("update_email").style.display = "block";
+    });
+    $("#email_off").click(function(){
+        document.getElementById("update_email").style.display = "none";
+    });
+    $("#pwd").click(function(){
+        document.getElementById("update_pwd").style.display = "block";
+    });
+    $("#pwd_off").click(function(){
+        document.getElementById("update_pwd").style.display = "none";
+    });
+    $("#phone").click(function(){
+        document.getElementById("update_phone").style.display = "block";
+    });
+    $("#phone_off").click(function(){
+        document.getElementById("update_phone").style.display = "none";
+    });
+</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}

+ 90 - 67
application/user/view/member/index.html

@@ -1,74 +1,97 @@
 {extend name="layout:home" /}
 {block name="container"}
+<style>
+    .accountinfo_title>div{
+        margin-left:80px;
+        margin-top:20px;
+        font-size: 13px;
+        color: dodgerblue;
+    }
+    .accountinfo_title table{
+        margin-left: 150px;
+    }
+    .userinfo{
+        margin-top:20px;
+    }
+    .userinfo_title div{
+        margin-left:80px;
+        margin-top:50px;
+        font-size: 13px;
+        color: dodgerblue;
+    }
+    .userinfo_title table{
+        margin-left: 150px;
+    }
+    .userinfo_title table input{
+        border: 1px #aaa solid;
+        border-radius: 2px;
+        height: 30px;
+        width: 280px;
+        line-height:30px ;
+    }
+    .td_info{
+        width: 150px;
+        height: 60px;
+        line-height: 60px;
+    }
+    .td_user_info{
+        width: 220px;
+        height: 60px;
+        line-height: 60px;
+    }
+</style>
 <div class="layui-tab layui-tab-card">
-    {include file="layout/admin_items" /}
-    <div class="layui-tab-content page-tab-content">
-        <!-- 搜索框开始 -->
-        <div class="search-form">
-        <form class="" method="post">
-            <div class="layui-form-item">
-                <div class="layui-inline">
-                    <input type="text" name="title"  placeholder="输入名称或联系人或电话" autocomplete="off" class="layui-input">
-                </div>
-                <div class="layui-inline">
-                    <input type="text" class="layui-input" name="timeRang" id="timeRang" placeholder="选择时间段" style="width: 170px;">
-                </div>
-                <div class="layui-inline">
-                    <button type="submit" class="layui-btn search-subBtn">搜索</button>
-                </div>
-            </div>
-        </form>
+    <div class="accountinfo">
+        <div class="accountinfo_title">
+            <div>账户信息</div>
+            <table>
+                <tr>
+                    <td class="td_info">登陆账号</td>
+                    <td class="td_user_info">{$Think.session.user_email}&nbsp&nbsp&nbsp{$user['user_status_cn']}</td>
+                    <td class="td_update"><a href="/user/Updatepwd/username.html">修改用户名</a>|<a href="/user/Updatepwd/index.html">修改密码</a></td>
+                </tr>
+                <tr>
+                    <td class="td_info">手机号码</td>
+                    <td class="td_user_info">+ (86)&nbsp&nbsp{$user['user_phone']}</td>
+                    <td class="td_update"><a href="/user/Updatepwd/phone.html">修改手机号码</a></td>
+                </tr>
+            </table>
+
+        </div>
+    </div>
+    <div class="userinfo">
+        <div class="userinfo_title">
+            <form method="post">
+                <div>用户信息</div>
+                <table>
+                    <tr>
+                        <td class="td_info">会员类型</td>
+                        <td class="td_user_info">{$user['user_type_cn']}</td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">称呼</td>
+                        <td class="td_user_info"><input type="text" name="user_name" placeholder="请输入称呼" value="{$user['user_name']}"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">公司名称</td>
+                        <td class="td_user_info"><input type="text" name="company" placeholder="请输入公司名称" value="{$user['company']}"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">所属行业</td>
+                        <td class="td_user_info"><input type="text" name="trade" placeholder="请输入所属行业" value="{$user['trade']}"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">公司地址</td>
+                        <td class="td_user_info"><input type="text" name="address" placeholder="请输入公司地址" value="{$user['address']}"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info"></td>
+                        <td class="td_user_info" style="text-align: center;"><input type="submit" value="保存修改" style="width: 70px;"></td>
+                    </tr>
+
+                </table>
+            </form>
         </div>
-        <!-- 搜索框结束 -->
-        <table class="layui-table lay-even">
-            <colgroup>
-                <col width="150">
-                <col width="200">
-                <col>
-            </colgroup>
-            <thead>
-            <tr>
-                <th>{$Think.lang.member_name}</th>
-                <th>{$Think.lang.member_url}</th>
-                <th>{$Think.lang.member_mobile}</th>
-                <th>邮箱</th>
-                <th>{$Think.lang.member_contacts}</th>
-                <th>{$Think.lang.member_add_time}</th>
-                <th>{$Think.lang.member_usetime}</th>
-                <th>{$Think.lang.member_validitytime}</th>
-                <th>{$Think.lang.member_status}</th>
-                <th>操作</th>
-            </tr>
-            </thead>
-            <tbody>
-            {if $member_list}
-            {volist name="member_list" id="member"}
-            <tr>
-                <td>{$member.member_name}</td>
-                <td>{$member.member_url}</td>
-                <td>{$member.member_mobile}</td>
-                <td>{$member.member_mailbox}</td>
-                <td>{$member.member_contacts}</td>
-                <td>{$member.member_add_time|date='Y-m-d H:i:s',###}</td>
-                <td>{$member.member_usetime}</td>
-                <td>{$member.member_validitytime|date='Y-m-d H:i:s',###}</td>
-                <td>{if $member['member_status']==1}通过{else}拒绝{/if}</td>
-                <td>
-                    {if array_intersect(explode(" ",str_replace("/", ".","member/edit")),$allpower)}
-                        <a href="javascript:dsLayerOpen('{:url('Member/edit',['member_id'=>$member.member_id])}','{$Think.lang.ds_edit}-{$member.member_name}')" class="layui-btn layui-btn-xs"><i class="layui-icon layui-icon-edit"></i>{$Think.lang.ds_edit}</a>
-                    {/if}
-                    {if array_intersect(explode(" ",str_replace("/", ".","member/del")),$allpower)}
-                        <a href="javascript:dsLayerConfirm('{:url('Member/del',['member_id'=>$member.member_id])}','{$Think.lang.member_confirm_del}')" class="layui-btn layui-btn-xs layui-btn-danger"><i class="layui-icon layui-icon-delete"></i>{$Think.lang.ds_del}</a>
-                    {/if}
-                </td>
-            </tr>
-            {/volist}
-            {else}
-            <td>无数据</td>
-            {/if}
-            </tbody>
-        </table>
-        {$show_page}
     </div>
 </div>
 <script type="text/javascript">

+ 12 - 3
application/user/view/register/index.html

@@ -108,11 +108,15 @@
 //                addhtml.innerHTML = addhtml.innerText+'<span id="tishi" style="color:red;font-size: 12px;"><br>密码不合法</span>';
 //            }
             document.getElementById("user_password").style.borderColor = "red";
+            document.getElementById("layui-btn").type = "button";
         }else{
             //console.log(2);
 //            var remove = document.getElementById("tishi");
 //            remove.parentNode.removeChild(remove);
             document.getElementById("user_password").style.borderColor = "#e6e6e6";
+            if(document.getElementById("confirm_password").style.borderColor != "red" && document.getElementById("user_phone").style.borderColor != "red"){
+                document.getElementById("layui-btn").type = "submit";
+            }
         }
     });
     $("#confirm_password").blur(function(){
@@ -126,11 +130,14 @@
 //                addhtml.innerHTML = addhtml.innerText+'<span id="tishi_pwd" style="color:red;font-size: 12px;"><br>密码不合法</span>';
 //            }
             document.getElementById("confirm_password").style.borderColor = "red";
+            document.getElementById("layui-btn").type = "button";
         }else{
-            //console.log(2);
 //            var remove = document.getElementById("tishi_pwd");
 //            remove.parentNode.removeChild(remove);
             document.getElementById("confirm_password").style.borderColor = "#e6e6e6";
+            if(document.getElementById("user_password").style.borderColor != "red" && document.getElementById("user_phone").style.borderColor != "red"){
+                document.getElementById("layui-btn").type = "submit";
+            }
         }
     });
     //电话校验
@@ -139,17 +146,19 @@
         //console.log(password);
         var patrn=/^1[3456789]\d{9}$/;
         if (!patrn.exec(password)){
-            //console.log(1);
 //            var addhtml = document.getElementById("phone");
 //            if(document.getElementById("tishi_phone") == null){
 //                addhtml.innerHTML = addhtml.innerText+'<span id="tishi_phone" style="color:red;font-size: 12px;"><br>电话号码不合法</span>';
 //            }
             document.getElementById("user_phone").style.borderColor = "red";
+            document.getElementById("layui-btn").type = "button";
         }else{
-            //console.log(2);
 //            var remove = document.getElementById("tishi_phone");
 //            remove.parentNode.removeChild(remove);
             document.getElementById("user_phone").style.borderColor = "#e6e6e6";
+            if(document.getElementById("user_password").style.borderColor != "red" && document.getElementById("confirm_password").style.borderColor != "red"){
+                document.getElementById("layui-btn").type = "submit";
+            }
         }
     });
     // 协议 校验

+ 116 - 0
application/user/view/updatepwd/index.html

@@ -0,0 +1,116 @@
+{extend name="layout:home" /}
+{block name="container"}
+<style>
+    .accountinfo_title{
+        width: 150px;
+        margin:50px auto;
+        text-align: center;
+        font-size: 13px;
+        color: dodgerblue;
+    }
+    table{
+        margin:0 auto;
+        font-size: 13px;
+    }
+    /*.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: 280px;
+        line-height:30px ;
+    }
+</style>
+<div class="layui-tab layui-tab-card">
+    <div class="updatepwd">
+        <form method="post">
+            <div>
+                <div class="accountinfo_title">重置密码</div>
+                <table>
+                    <tr>
+                        <td class="td_info">当前密码</td>
+                        <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>
+                    </tr>
+                    <tr>
+                        <td class="td_info">确认密码</td>
+                        <td class="td_user_info"><input type="text" name="confirm_password" id="confirm_password" placeholder="确认密码"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info"></td>
+                        <td style="text-align: center;"><input type="submit" id="layui-btn" value="保存修改" style="width: 70px;"></td>
+                    </tr>
+                </table>
+
+            </div>
+        </form>
+    </div>
+</div>
+<script>
+    //密码 校验
+    $("#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}

+ 148 - 0
application/user/view/updatepwd/phone.html

@@ -0,0 +1,148 @@
+{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: 80px;border-color: dodgerblue;color: dodgerblue;background-color: white;"></td>
+                    </tr>
+                </table>
+            </div>
+        </form>
+    </div>
+</div>
+<script>
+    //密码 校验
+    $("#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}

+ 148 - 0
application/user/view/updatepwd/username.html

@@ -0,0 +1,148 @@
+{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;">{$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: 80px;border-color: dodgerblue;color: dodgerblue;background-color: white;"></td>
+                    </tr>
+                </table>
+            </div>
+        </form>
+    </div>
+</div>
+<script>
+    //密码 校验
+    $("#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}