Browse Source

用户资料

Jonlin 6 years ago
parent
commit
2456b2fe28

+ 9 - 22
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,32 +15,19 @@ 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));
+        $user_info = $this->getAdminInfo();
+        $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'] = '未实名认证';
         }
-        $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');
+        $this->assign('user', $user);
         return $this->fetch();
     }
 

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

@@ -0,0 +1,30 @@
+<?php
+
+namespace app\user\controller;
+
+use think\Controller;
+use think\Lang;
+use think\Validate;
+
+class Updatepwd extends Controller
+{
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/login.lang.php');
+    }
+
+    /**
+     * 修改密码
+     * @return mixed
+     */
+    public function index()
+    {
+            return $this->fetch();
+    }
+
+}
+
+
+?>

+ 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: 280px;
+        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="">修改用户名</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="">修改手机号码</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">个人用户</td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">称呼</td>
+                        <td class="td_user_info"><input type="text" placeholder="请输入称呼"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">公司名称</td>
+                        <td class="td_user_info"><input type="text" placeholder="请输入公司名称"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">所属行业</td>
+                        <td class="td_user_info"><input type="text" placeholder="请输入所属行业"></td>
+                    </tr>
+                    <tr>
+                        <td class="td_info">公司地址</td>
+                        <td class="td_user_info"><input type="text" placeholder="请输入公司地址"></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">

+ 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}