<import src="../../wxParse/wxParse.wxml" />
<view class="container">
  <view class='userinfo {{IFagent==1?"agent":""}}'>
    <view class="userinfo-avatar" bindtap="gouserinfo">
      <image src='{{avatarUrl==""?"../../images/logo.png":avatarUrl}}'></image>
    </view>
    <view class="userinfo-box" bindtap="gouserinfo">
      <text class="userinfo-nickname">{{NCName}}{{NCName!="您还没有登录，请先登录！"?"("+uLevel + ")":""}}</text>
      <view class="userinfo-uLevel" wx:if='{{NCName!="您还没有登录，请先登录！"}}'>
        <text>账号：{{UserName}}</text>
      </view>
    </view>
    <view class="userinfo-icon" bindtap="gouserinfo">
      <image src="../../images/icon-arrowdown0.png"></image>
    </view>
  </view>


  <view class="balance-box0" style="z-index: 1; margin-top:-2.8em;">
    <view class="balance-box0-to">
      <view class="balance-title">我的资产</view>
      <view class="balance-item" style="padding-bottom: 0.8em;">
        <view class="item-left">
          <view class="item-left-item">
            <view>
                <view class="item-image image-color0" bindtap="onbalance" data-id="1">
                  <image src="../../images/jifen_ico0.png"></image>
                </view>
                <view class="item-font" bindtap="onbalance" data-id="1">
                  <view class="title">余额</view>
                  <view class="money" style="margin-left: 0.5em;">{{xjjye}}</view>
                </view>
            </view>

            <view>
                <view class="item-image image-color0" bindtap="onSignInList" data-id="27">
                  <image src="../../images/jifen_ico1.png"></image>
                </view>
                <view class="item-font" bindtap="onSignInList">
                  <view class="title">兑换券</view>
                  <view class="money" style="margin-left: 0.2em;">{{voucherNum}}</view>
                </view>
            </view>

            <view>
                <button wx:if='{{NCName!="您还没有登录，请先登录！"}}' class="signin-btn" bindtap="onSignIn">{{isSignToday ? "已签到":"立即签到"}}</button>
            </view>

          </view>
        </view>

        <view class="item-right" wx:if="{{ifshowzzjf==1}}">
        </view>
      </view>
      <!-- <view class="balance-item" style="padding-top: 0.4em;padding-bottom: 0.8em;"  wx:if="{{tgyuLevel==0}}">
          <view class="item-left" bindtap="onbalance" data-id="21">
            <view class="item-left-item">
                       <view class="item-image image-color3"><image src="../../images/jifen_ico0.png"></image></view>
                       <view class="item-font">
                             <view class="title">激活码</view>
                             <view class="money">{{jhmye}}</view> 
                        </view> 
                </view>
              </view>
                <view class="item-right">
                     <view class="button" bindtap="onkttgy">
                        激活商家
                       </view>
                </view>
       </view>-->
      <!--<view class="balance-item" style="padding-top: 0.4em;">
          <view class="item-left" bindtap="onbalance" data-id="4">
            <view class="item-left-item">
                       <view class="item-image image-color1"><image src="../../images/jifen_ico0.png"></image></view>
                       <view class="item-font">
                             <view class="title">佣金</view>
                             <view class="money">{{xjye}}</view> 
                        </view> 
                </view>
              </view>
                <view class="item-right" bindtap="onbalance" data-id="18">
                       <view class="item-image  image-color1"><image src="../../images/jifen_ico0.png"></image></view>
                       <view class="item-font">
                             <view class="title">广告值</view>
                             <view class="money">{{ggzye}}</view>
                        </view>
                </view>
       </view>-->
    </view>
  </view>
  <div class="clear"></div>
  <view class="balance-box0" style="z-index: 1; margin-top:0.8em;" wx:if="{{dluLevel>2}}">

    <view class="balance-box0-to">
      <view class="balance-title">代理管理（{{uLevel1}}）</view>
      <view class="balance-item" style="padding-bottom: 0.8em;">
        <view class="item-left">
          <view class="item-left-item">
            <view class="item-image image-color0" bindtap="onbalance" data-id="2">
              <image src="../../images/jifen_ico0.png"></image>
            </view>
            <view class="item-font" bindtap="onbalance" data-id="22">
              <view class="title">推广名额</view>
              <view class="money">{{tgmeye}}</view>
            </view>
          </view>
        </view>
        <view class="item-right">

          <view class="button" bindtap="onkttgy" data-id="0">
            开通城市合伙人
          </view>
        </view>

      </view>
    </view>
  </view>
  <div class="clear"></div>
  <view class="balance-box0" style="z-index: 1; margin-top:0.8em;" wx:if="{{tgyuLevel>1}}">

    <view class="balance-box0-to">
      <view class="balance-title">城市合伙人</view>
      <view class="balance-item" style="padding-bottom: 0.8em;">
        <view class="item-left">
          <view class="item-left-item">
            <view class="item-image image-color0" bindtap="onbalance" data-id="2">
              <image src="../../images/jifen_ico0.png"></image>
            </view>
            <view class="item-font" bindtap="onkttgy" data-id="1">
              <view class="title">已激活商家</view>
              <view class="money">{{yjhsjnum}}</view>
            </view>
          </view>
        </view>
        <view class="item-right">

          <view class="button" bindtap="onkttgy" data-id="1">
            激活商家
          </view>
        </view>

      </view>
    </view>
  </view>
  <div class="clear"></div>
  <view class="balance-box0">
    <view class="pintuan-box">
      <view class="pintuan-title"><text>订单管理</text>
        <view class="more" bindtap="onorder" data-id="0" data-index="0">全部</view>
      </view>
      <view class="pintuan-box-to">
        <view class="pintuan-item" bindtap="onorder" data-id="1" data-index="0">
          <view class="item-image">
            <image src="../../images/order_ico6.png" />
          </view>
          <view class="item-title">待付款</view>
        </view>
        <view class="pintuan-item" bindtap="onorder" data-id="2" data-index="0">
          <view class="item-image">
            <image src="../../images/order_ico0.png" />
          </view>
          <view class="item-title">待发货</view>
        </view>
        <view class="pintuan-item" bindtap="onorder" data-id="3" data-index="0">
          <view class="item-image">
            <image src="../../images/order_ico1.png" />
          </view>
          <view class="item-title">待收货</view>
        </view>
        <view class="pintuan-item" bindtap="onorder" data-id="4" data-index="0">
          <view class="item-image">
            <image src="../../images/order_ico2.png" />
          </view>
          <view class="item-title">已完成</view>
        </view>


      </view>
    </view>

  </view>
  <div class="clear"></div>
  <view class="balance-title" wx:if="{{IFagent==0}}">其它</view>
  <div class="clear"></div>
  <view class="info_list">
    <block wx:for="{{userListInfo}}" wx:for-index="index">
      <view class="weui_cell" bindtap="gotourl" data-id="{{index}}">
        <view class="weui_cell_hd">
          <image src="{{item.icon}}"></image>
        </view>
        <view class="weui_cell_bd">
          <view class="weui_cell_bd_p"> {{item.text}} </view>
        </view>
        <view wx:if="{{item.isunread}}" class='badge{{item.unreadNum<10?" badge0":""}}'>{{item.unreadNum}}</view>
        <view class="with_arrow"></view>
      </view>
    </block>
  </view>
  <div class="clear"></div>
  <view class="logoutbutton">
    <button bindtap="logout">{{logout}}</button>
  </view>

</view>
<view class="Hidden_box" hidden="{{serverHidden}}" bindtap="closeserver">
  <view class="Hidden_box_to" catchtap="inserver">
    <view class="close" bindtap="closeserver">
      <image src="../../images/close.png" />
    </view>
    <view class="body">
      <template is="wxParse" data="{{wxParseData:servermsg.nodes}}" />
    </view>
  </view>
</view>
<view class="Hidden_box" hidden="{{authorizeHidden}}" bindtap="closeauth">
  <view class="Hidden_box_to" catchtap="inauth">
    <view class="title">微信授权</view>
    <view class="close" bindtap="closeauth">
      <image src="../../images/close.png" />
    </view>
    <view class="body">
      <view>为了给您提供更好的服务，需要获取您的微信头像和昵称</view>
      <button id="getUserInfo" open-type="getUserInfo" bindgetuserinfo="onauthorize">{{authorizetitle}}</button>
    </view>
  </view>
</view>
<view class="Hidden_box" hidden="{{myagentHidden}}" bindtap="closemyagent">
  <view class="Hidden_box_to gotoagent" catchtap="inauth">
    <view class="title">温馨提醒</view>
    <view class="close" bindtap="closemyagent">
      <image src="../../images/close.png" />
    </view>
    <view class="body">
      <view>您还不是代理，是否现在去申请成为代理？</view>
      <button class="closebtn" bindtap="closemyagent">否</button>
      <button bindtap="ongotoagent">是</button>
    </view>
  </view>
</view>
<loading hidden="{{loadingHidden}}">
  加载中...
</loading>