<!--{include file="<!--{$tplpath}-->block_header.tpl"}-->
<!-------------------------------------- 头部结束 -------------------------------------->
<link rel="stylesheet" href="<!--{$skinpath}-->assets/css/main.css">

<!-------------------------------------- 主体开始 -------------------------------------->
<style>
    .main_l {
        float: left;
        width: 300px;
    }
    .main_r {
        float: left;
        width: 550px;
    }
    .naInfoImgBox {
        padding: 80px 20px 0;
    }
    .na-img-area {
        width: 80px;
        height: 80px;
        border: 2px solid #e3e3e3;
        border-radius: 50%;
        padding: 4px;
        background: #fff;
        position: relative;
        z-index: 4;
        cursor: pointer;
    }
    .na-img-bg-area {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        overflow: hidden;
    }
    .na-img-area img {
        display: block;
        width: 100%;
        height: 100%;
        border-radius: 50%;
    }
    .na-edit {
        position: absolute;
        top: 23px;
        left: 23px;
        display: none;
        width: 43px;
        height: 43px;
        background: url(https://account.xiaomi.com/static/res/7c3e9b0/passport/acc-2014/img/n-ava-edit.png) 0 0 no-repeat;
        _background: url(https://account.xiaomi.com/static/res/7c3e9b0/passport/acc-2014/img/n-ava-edit-ie.png) 0 0 no-repeat;
    }
    .framedatabox {
        padding-top: 15px;
    }
    .fdata {
        padding-left: 20px;
        line-height: 40px;
        overflow: hidden;
    }
    .bind-form label {
        display: inline-block;
        *zoom: 1;
        *display: inline;
        width: 60px;
        font-size: 14px;
        margin-left: 20px;
    }
     .clearfloat {
        width: 32.333%;
        border-right: 1px solid #e1e0da;
    }
    .fl {
        float: left;
        display: inline;
    }
    .bind-form dl dt, .bind-form dl dd {
        color: #666666;
        font-size: 0.5rem;
        line-height: 3rem;
        border-bottom: 1px solid #e1e0da;
        width: 100%;
        text-align: center;
    }

    .bind-form dl dd {
        margin-left: 0px;
    }
</style>
<div class="page-main user-main">
    <div class="container">
        <!--{if !empty($check)}-->
        <div class="row">
            <div class="span4">
                <div class="uc-box uc-sub-box">
                    <div class="uc-nav-box">
                        <div class="box-hd">
                            <h3 class="title">个人中心</h3>
                        </div>
                        <div class="box-bd">
                            <ul class="uc-nav-list J_navList">
                                <li><a class="J_noRandom" href="index.php?c=user">我的个人中心</a></li>
                                <li><a class="J_noRandom" href="./index.php?c=user&a=user_info">个人信息</a></li>
                                <li><a class="J_noRandom" href="./index.php?c=user&a=profit">我的收益</a></li>
                                <li  class="active"><a class="J_noRandom" href="index.php?c=user&a=share">我的推广</a></li>
                                <li><a class="J_noRandom" href="./index.php?c=user&a=user_address">收货地址</a></li>
                                <li><a class="J_noRandom" href="./index.php?c=user&a=user_edit">修改密码</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="uc-nav-box">
                        <div class="box-hd">
                            <h3 class="title">订单中心</h3>
                        </div>
                        <div class="box-bd">
                            <ul class="uc-nav-list J_navList">
                                <li><a class="J_noRandom" href="./index.php?c=user&a=order_list">我的订单</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="span16">
                <div class="uc-box uc-main-box">
                    <div class="uc-content-box order-list-box">
                        <div class="box-hd">
                            <h1 class="title">我的推广</h1>
                        </div>
                        <div class="box-bd">
                            <div class="xm-goods-list-wrap">
                                <div class="uinfo c_b">
                                    <div>
                                        <div class="main_l">

                                                    <!--na-img-bg-area不能插入任何子元素-->
                                                        <!--{if empty(<!--{$data.codeimg}-->)}-->
                                                                      <a class="btn btn-primary code" href="javascript:void(0)"  style="margin-top: 50px;">点我生成我的推广二维码</a>
                                                                                     <img id="codeimg" src="" />
                                                        <!--{else}-->
                                                        <img style="width: 200px;height: 200px; margin-top: 50px;" id="codeimg" src="<!--{$data.codeimg}-->" />
                                                        <!--{/if}-->

                                        </div>
                                        <div class="main_r">
                                            <div class="framedatabox">
                                                <div class="fdata">
                                                    <h3>我的团队</h3>
                                                </div>
                                                <div class="bind-form" style="    width: 100%;
    margin-top: 2%;
    background-color: #faf9f3;">
                                                    <dl class="fl clearfloat">
                                                        <dt>手机号码</dt>
                                                        <!--{foreach $name as $volist}-->
                                                        <dd><!--{$volist.value}--></dd>
                                                        <!--{/foreach}-->

                                                    </dl>
                                                    <dl class="fl clearfloat">
                                                        <dt>注册时间</dt>
                                                        <!--{foreach $time as $volist}-->
                                                        <dd><!--{$volist.value|date_format:"%Y-%m-%d"}--></dd>
                                                        <!--{/foreach}-->
                                                    </dl>
                                                    <dl class="fl clearfloat" >
                                                        <dt>已邀请人数</dt>
                                                        <!--{foreach $xiatotal as $volist}-->
                                                        <dd><!--{$volist.value}--></dd>
                                                        <!--{/foreach}-->
                                                    </dl>
                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--{else}-->
        <a class="btn btn-primary" href="./index.php?c=user&a=login">去登录</a>
        <!--{/if}-->
    </div>
</div>



<script>
    $(function(){
        $(".code").bind("click", function(){ //提交
            // var img =$('$codeimg').val;
            var id = <!--{$data.id}-->;
            $.ajax({
                type: "POST",
                url: "index.php?c=user&a=code",
                cache: false,
                data: {id:id},
                dataType: "json",
                success: function(data) {
                    var json = eval(data);
                    var response = json.response;
                    var result = json.result;
                    var codeimg = json.codeimg;

                    if (response == '1') {
                        $("#codeimg").attr('src',codeimg);
                        $(this).hide();
                    } else {
                        layer.msg(result)
                    }
                },

            });
        });

    });
</script>

<!-------------------------------------- 主体结束 -------------------------------------->
<!-------------------------------------- 尾部开始 -------------------------------------->

<!--{include file="<!--{$tplpath}-->botton.tpl"}-->
<!-------------------------------------- 尾部结束 -------------------------------------->

