<?php if (!defined('ROOT')){ echo 'Deny ...'; exit; } extract($data); ?>
<ons-navigator var="userNavigator">
<ons-page ng-controller="UserController">
    <input type="hidden" id="payPage" value="<?php echo $pay;?>" />
    <ons-row class="profile-wrapper">
        <ons-col width="100px" class="profile-image-wrapper">
            <img src="<?php echo $user->headimgurl;?>" class="profile-image">
        </ons-col>

        <ons-col>
            <div class="profile-name">
                <span id="userNickname"><?php echo $user->nickname;?></span>
                <a href="javascript:;" style="font-size: 12px;" ng-click="show('EditMyNickname', 0, 0, 0);">[修改]</a>
            </div>
            <div class="profile-desc">所在城市: <?php echo $user->province.$user->city;?></div>
            <div class="profile-desc">用户等级: <?php $arr = array('0' => '普通会员', '1' => 'VIP会员', '2' => '合伙人'); echo $arr[$user->type];?></div>
            <?php if ($user->type == 0){?>
            <div class="profile-desc">到期时间: <a href="javascript:;" onclick="userNavigator.pushPage('<?php echo $base->url(array('c' => 'welcome', 'm' => 'buy'));?>');">升级为VIP会员</a></div>
            <?php }elseif($user->type == 2){?>
            <div class="profile-desc">到期时间: 永久有效</div>
            <?php }else{?>
            <div class="profile-desc">到期时间: <?php echo date('Y-m-d H:i', $user->endtime);?> <a href="javascript:;" onclick="userNavigator.pushPage('<?php echo $base->url(array('c' => 'welcome', 'm' => 'buy'));?>');">续费</a></div>
            <?php }?>
        </ons-col>
        
    </ons-row>
    
    <ons-list style="margin-top:12px;">
        <ons-list-item>
            <ons-row>
                <ons-col class="info-col">
                    <div class="info-num"><?php echo $total = $oneCount + $twoCount + $threeCount;?></div>
                    <div class="info-unit">我的人脉</div>
                </ons-col>
                <ons-col class="info-col">
                    <div class="info-num"><?php echo $todayCount;?></div>
                    <div class="info-unit">今日人脉</div>
                </ons-col>
                <ons-col class="info-col">
                    <div class="info-num"><?php echo $sum = array_sum($moneys);?></div>
                    <div class="info-unit">佣金总额</div>
                </ons-col>
                
                <ons-col class="info-col">
                    <div class="info-num"><?php echo $user->jifen;?></div>
                    <div class="info-unit">积分</div>
                </ons-col>

            </ons-row>
        </ons-list-item>
    </ons-list>

    <ons-list class="settings-list" modifier="inset">
        <ons-list-item modifier="chevron" onclick="modal.show();userNavigator.pushPage('<?php echo $base->url(array('c' => 'welcome', 'm' => 'myInvite'));?>');">我的邀请<span class="list-item-note lucent"><?php echo $threeCount;?> 人</span></ons-list-item>
        <ons-list-item modifier="chevron" ng-click="show('MyContacts', <?php echo $threeCount;?>, <?php echo $twoCount;?>, <?php echo $oneCount;?>)">我的人脉<span class="list-item-note lucent"><?php echo $total;?> 人</span></ons-list-item>
        <ons-list-item modifier="chevron" ng-click="show('MyCommissions', <?php echo $moneys[2];?>, <?php echo $moneys[1];?>, <?php echo $moneys[0];?>)">我的佣金<span class="list-item-note lucent">¥ <?php echo $sum;?> 元</span></ons-list-item>
        <ons-list-item modifier="chevron" onclick="modal.show();userNavigator.pushPage('<?php echo $base->url(array('c' => 'welcome', 'm' => 'myOrder'));?>');">我的订单<span class="list-item-note lucent"><?php echo $orderCount;?> 单</span></ons-list-item>
        <ons-list-item modifier="chevron" onclick="modal.show();userNavigator.pushPage('<?php echo $base->url(array('c' => 'welcome', 'm' => 'myCash'));?>');">我的提现<span class="list-item-note lucent"><?php echo $cash;?> 元</span></ons-list-item>
        <?php if ($isAdmin){?>
        <ons-list-item modifier="chevron" onclick="modal.show();userNavigator.pushPage('<?php echo $base->url(array('c' => 'welcome', 'm' => 'myAdmin'));?>');">提现管理</ons-list-item>
        <?php }?>
    </ons-list>
    
    <ons-list class="settings-list" modifier="inset">
        <ons-list-item modifier="chevron" onclick="modal.show();userNavigator.pushPage('<?php echo $base->url(array('c' => 'welcome', 'm' => 'myQun'));?>');">我的微信群</ons-list-item>
        <ons-list-item modifier="chevron" ng-click="myQrcode();">我的二维码</ons-list-item>
    </ons-list>
    
    <ons-list class="settings-list" modifier="inset">
        <ons-list-item modifier="chevron" onclick="modal.show();userNavigator.pushPage('<?php echo $base->url(array('c' => 'welcome', 'm' => 'jiFen'));?>');">积分商城</ons-list-item>
        <ons-list-item modifier="chevron" onclick="modal.show();userNavigator.pushPage('<?php echo $base->url(array('c' => 'welcome', 'm' => 'jiFenList'));?>');">兑换历史</ons-list-item>
    </ons-list>

</ons-page>
</ons-navigator>