用户中心_GJ-UI前端组件

发布时间::2018-06-03 11:36:30 已收录 阅读:377次

将将将下列html代码、javascript代码复制粘贴在html文件的相应位置即可(可参考组件附带index.html文件中相应的注释说明位置);

用户中心[gj-user]:

HTML代码:

<div class="gj-wk">
    <div class="gj-bt">
        <h3><i class="fa fa-user-circle-o" aria-hidden="true"></i> 组件标题</h3>
    </div>
    <div class="gj-body gj-user">
        <form action="" method="post">
            <input type="hidden" name="referer" value="">
            <table cellpadding="0" cellspciong="1">
                <div class="gli1">
                    <i class="fa fa-user" aria-hidden="true"></i>
                    <input type="text" required name="username" value="" placeholder="请输入用户名">
                    <i class="fa fa-lock" aria-hidden="true"></i>
                    <input type="password" required name="password" value='' placeholder="请输入密码">
                </div>
                <div class="gli2">
                    <img src="javascript:(0)" onclick="this.src=this.src+'?'" title="看不清,换一张">
                    <input type="text" name="code" class="" value='' placeholder="验证码">
                    <button type="submit" name="dosubmit" value="登 录" class="">立即登录</button>
                </div>
                <div class="gli3">
                    <a href="javascript:(0)" class="btn btn-qq" target="_blank"><i class="fa fa-qq" aria-hidden="true"></i> QQ登录</a>
                    <a href="javascript:(0)" class="btn btn-zc" role="button" target="_blank">免费注册</a>
                    <a href="javascript:(0)" class="btn btn-mm" role="button" target="_blank">忘记密码?</a>
                </div>
            </table>
        </form>
        <div class="gli4">
            <div class="mid">
                <img src="/common/static/images/tx.jpg" alt="" width="80">
                <h5>欢迎:用户昵称</h5>
                <p>[ 会员等级 ]</p>
            </div>
            <div class="link">
                <a href="javascript:(0)"><i class="fa fa-home" aria-hidden="true"></i> 个人主页</a>
                <a href="javascript:(0)"><i class="fa fa-plus" aria-hidden="true"></i> 在线投稿</a>
                <a href="javascript:(0)"><i class="fa fa-file-text" aria-hidden="true"></i> 我的文章</a>
                <a href="javascript:(0)"><i class="fa fa-tachometer" aria-hidden="true"></i> 控制面板</a>
            </div>
            <a href="javascrpit:(0)" class="out"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销登陆</a>
        </div>
    </div>
</div>

YzmCMS代码:

<div class="gj-wk">
    <div class="gj-bt">
        <h3><i class="fa fa-user-circle-o" aria-hidden="true"></i> 组件标题</h3>
    </div>
    <div class="gj-body gj-user">
        {if intval(get_cookie('_userid'))==0}
        <form action="{U('member/index/login')}" method="post">
            <input type="hidden" name="referer" value="{urlencode(get_url())}">
            <table cellpadding="0" cellspciong="1">
                <div class="gli1">
                    <i class="fa fa-user" aria-hidden="true"></i>
                    <input type="text" required name="username" value="" placeholder="请输入用户名">
                    <i class="fa fa-lock" aria-hidden="true"></i>
                    <input type="password" required name="password" value='' placeholder="请输入密码">
                </div>
                <div class="gli2">
                    <img src="{U('api/index/code')}" onclick="this.src=this.src+'?'" title="看不清,换一张">
                    <input type="text" name="code" class="" value='' placeholder="验证码">
                    <button type="submit" name="dosubmit" value="登 录" class="">立即登录</button>
                </div>
                <div class="gli3">
                    <a href="{U('member/other/qq_login')}" class="btn btn-qq" target="_blank"><i class="fa fa-qq" aria-hidden="true"></i> QQ登录</a>
                    <a href="{U('member/index/register')}" class="btn btn-zc" role="button" target="_blank">免费注册</a>
                    <a href="{U('member/reset/init')}" class="btn btn-mm" role="button" target="_blank">忘记密码?</a>
                </div>
            </table>
        </form>
        {else}
		{php $userid = intval(get_cookie('_userid'));}
		{php $userinfo = get_memberinfo($userid, true);}
		{php extract($userinfo);}
        <div class="gli4">
            <div class="mid">
                <img src="{if $userpic}{$userpic}{else}{STATIC_URL}images/default.gif{/if}" alt="" width="80" height="80">
                <h5>欢迎:{$username}</h5>
                <p>[ {get_groupname($groupid)} ]</p>
            </div>
            <div class="link">
                <a href="{U('member/myhome/init', array('userid'=>$userid))}"><i class="fa fa-home" aria-hidden="true"></i> 个人主页</a>
                <a href="{U('member/member_content/init')}"><i class="fa fa-plus" aria-hidden="true"></i> 在线投稿</a>
                <a href="{U('member/member_content/pass')}"><i class="fa fa-file-text" aria-hidden="true"></i> 我的文章</a>
                <a href="{U('member/index/init')}"><i class="fa fa-tachometer" aria-hidden="true"></i> 控制面板</a>
            </div>
            <a href="{U('member/index/logout')}" class="out"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销登陆</a>
        </div>
        {/if}
    </div>
</div>