<!--pages/member/extension/extension.wxml-->
<block wx:if="{{firstshow&&!loginshow}}">
  <!-- 优化  template === '01' start -->
  <view wx:if="{{template === '01'}}" id="extension-box" style="--color: {{background_color}};">
    <view class="background-box">
      <view class="extension-head">
        <image class="extension-head-avatar" src="{{userInfo.avatar}}" mode='widthFix'></image>
        <view class="extension-name-box">
          <view class="extension-name text-ellipsis">{{ userInfo.nickname }}</view>
          <view class="extension-id" wx:if="{{show_member_id != 1}}">ID：{{ userInfo.member_id }}</view>
        </view>
        <view class="extension-share" catchtap="gomyIncome" wx:if="{{share_page}}">
          <icon class="iconfont icon-bc_share_card"></icon>
        </view>
      </view>

      <!-- 会员等级 -->
      <view class="extension-nickname-box" style="height: {{ !moreIdentity && income_page.identity.length > 5 ? '156rpx' : ''}};" wx:if="{{income_page.identity && income_page.identity.length > 0}}">
        <view class="extension-nickname-bg"></view>
        <view class="nickname-warp">
          <text class="nickname-warp-item" wx:for="{{income_page.identity}}" wx:for-item="identity" wx:key="index">{{identity}}</text>
        </view>
        <icon class="iconfont icon-member-top moreIdentity" wx:if="{{!moreIdentity && income_page.identity.length > 5}}" catchtap="showMoreIdentity"></icon>
        <icon class="iconfont icon-member-bottom moreIdentity" wx:if="{{moreIdentity}}" catchtap="showMoreIdentity"></icon>
      </view>

      <!-- 收入明细 -->
      <view class="extension-money-box">
        <view class="extension-money-box-head">
          <view class="time-box">
            <text class="tab {{income.type===income_statistic_type ? 'active': ''}}" catchtap="tabChange"
                  data-type="{{'income_statistic_type'}}" data-data_type="{{income.type}}"
                  wx:for="{{income_statistic_type_box}}" wx:for-item="income" wx:key="index">{{income.title}}
            </text>
          </view>
          <view class="asset-line"></view>
          <view class="asset-right-box" wx:if="{{!userInfo.auto_withdraw&&withdraw_date&&!withdraw_date.disable}}" catchtap="gotoIncomeBtn">
            <icon class="iconfont icon-fontclass-shouru"></icon>
            <text>{{name_of_withdrawal}}</text>
          </view>
          <view class="asset-right-box" wx:if="{{userInfo.auto_withdraw&&withdraw_date&&!withdraw_date.disable}}">
            <icon class="iconfont icon-fontclass-shouru"></icon>
            <text>{{ userInfo.auto_withdraw }}号自动{{name_of_withdrawal}}</text>
          </view>
          <view class="asset-right-box" wx:if="{{withdraw_date&&withdraw_date.disable}}" catchtap="toToast">
            <icon class="iconfont icon-fontclass-shouru"></icon>
            <text>{{withdraw_date.day}}号可{{name_of_withdrawal}}</text>
          </view>
        </view>
        <view class="extension-money-box-body">
          <view class="body-head">
            <view class="head-line"></view>
            <view class="head-circle"></view>
            <view class="head-line head-line-right"></view>
          </view>
          <view class="body-money">
            <view class="body-money-item" wx:for="{{income_statistic}}" wx:key="index"
                  catchtap="gotoBtn" data-item="{{item}}">
              <text class="money-top">{{item.value}}</text>
              <text>{{item.title}}</text>
            </view>
          </view>
        </view>
        <view class="tips">本页收入统计仅包含已经结算部分，不含未结算部分~</view>
        <view class="tips">已提现收入，未提现收入，提现中收入，团队粉丝不随周期变化</view>
      </view>
    </view>

    <view class="eChats-box1">
      <van-tabs nav-class="tab-head" tab-active-class="tab-active" bind:change="tabChange" data-type="{{'charts_type'}}">
        <van-tab title="收入动态"></van-tab>
        <van-tab title="收入占比"></van-tab>
      </van-tabs>
      <view style="text-align: center;margin: 10px auto;" wx:if="{{!showLineChats}}">
        请移动到屏幕中间显示
      </view>
      <view style="height:220px;width: 680rpx;display:{{showPopup ? 'none' : 'block'}};" wx:if="{{charts_type != 1 && showLineChats}}" hidden="{{isshow}}">
        <ec-canvas id="echats-income" canvas-id="echats-income" ec="{{ecIncome}}" style="height:220px;width: 680rpx;"></ec-canvas>
      </view>
      <view style="height:220px;width: 680rpx;{{showPopup ? 'none' : 'block'}};" wx:if="{{charts_type == 1 && showLineChats}}" hidden="{{isshow}}">
        <ec-canvas id="echats-income-pie" canvas-id="echats-income-pie" ec="{{ecIncome}}" style="height:220px;width: 680rpx;display:"></ec-canvas>
      </view>
    </view>

    <view class="income-box">
      <view class="income-item" wx:for="{{income_page.button}}" wx:for-item="btn" wx:key="index" catchtap="gotoBtn"
            data-item="{{btn}}">
        <icon class="iconfont {{btn.icon}}"></icon>
        <view>{{btn.title}}</view>
      </view>
    </view>

    <view class="available-box">
      <van-tabs active="{{ available_type }}" bind:change="tabChange" data-type="{{'available_type'}}" custom-class="tab-bg-part" nav-class="tab-head" tab-active-class="tab-active">
        <van-tab title="我的权限"></van-tab>
        <van-tab title="未开通权限" wx:if="{{is_show_unable == 1}}"></van-tab>
      </van-tabs>
      <view class="available-body">
        <block wx:if="{{available_type != 1}}">
          <view class="available-item" wx:for="{{extension}}" wx:key="index" catchtap="gotoPage" data-item="{{item}}">
            <icon class="iconfont {{item.icon}}"></icon>
            <view class="available-money">
              <view class="text-ellipsis">{{ item.title }}</view>
              <view class="red-money">
                <text>{{language['money']}}</text>
                {{ item.value }}
              </view>
            </view>
            <icon class="fa fa-angle-right"></icon>
          </view>
        </block>
        <block wx:if="{{available_type == 1}}">
          <view class="available-item" wx:for="{{unextension}}" wx:key="index" catchtap="gotoPage" data-item="{{item}}">
            <icon class="iconfont {{item.icon}}"></icon>
            <view class="available-money">
              <view class="text-ellipsis">{{ item.title }}</view>
              <view class="red-money">
                <text>{{language['money']}}</text>
                {{ item.value }}
              </view>
            </view>
            <icon class="fa fa-angle-right"></icon>
          </view>
        </block>
      </view>
    </view>

    <view class="eChats-box2">
      <van-tabs nav-class="tab-head" tab-active-class="tab-active" bind:change="tabChange" data-type="{{'fans_type'}}">
        <van-tab title="粉丝裂变"></van-tab>
        <van-tab title="粉丝转化"></van-tab>
      </van-tabs>
      <view style="text-align: center;margin: 10px auto;" wx:if="{{!showChats}}">
        请移动到屏幕中间显示
      </view>
      <view style="height:220px;width: 680rpx;{{showPopup ? 'none' : 'block'}};" wx:if="{{fans_type != 1 && showChats}}" hidden="{{isshow}}">
        <ec-canvas id="echats-fans" canvas-id="echats-fans" ec="{{ecFans}}" style="height:220px;width: 680rpx;"></ec-canvas>
      </view>
      <view style="height:220px;width: 680rpx;{{showPopup ? 'none' : 'block'}};" wx:if="{{fans_type == 1 && showChats}}" hidden="{{isshow}}">
        <ec-canvas id="echats-fans-line" canvas-id="echats-fans-line" ec="{{ecFans}}" style="height:220px;width: 680rpx;"></ec-canvas>
      </view>
      <!--第二种方案转成图片-->
      <!--<view wx:if="{{!showChats}}">-->
        <!--<image style="height:220px;width: 680rpx;" src="{{showImg}}"></image>-->
      <!--</view>-->
      <view class="fans-box">
        <view class="fans-item" wx:for="{{fans_fission.data}}" wx:for-item="fans" wx:key="index">
          <view class="fans-item-text">{{fans.value}}</view>
          <view class="fans-item-text">{{fans.title}}</view>
        </view>
      </view>
    </view>

    <view class="plugin-items-box">
      <view class="plugin-items-icon" wx:for="{{income_page.plugin_data}}" wx:for-item="icon" wx:key="index" wx:if="{{icon.mini_url || icon.name ===  'm-erweima'}}"
            catchtap="pluginGoto" data-item="{{icon}}">
        <icon class="iconfont {{icon.class}}"></icon>
        <text>{{icon.title}}</text>
      </view>
    </view>

    <view class="order-box">
      <van-tabs nav-class="tab-head" tab-active-class="tab-active" bind:change="tabChange" data-type="{{'extension_type'}}">
        <van-tab title="推广订单"></van-tab>
        <van-tab title="推广粉丝"></van-tab>
      </van-tabs>
      <view class="order-list" wx:if="{{extension_type != 1}}">
        <view class="order-item" wx:for="{{extension_order.data}}" wx:for-item="order" wx:key="index">
          <view class="order-top">
            <view class="order-sn">{{order.order_sn}}</view>
            <view class="status">{{order.status_name}}</view>
          </view>
          <view class="order-bottom">
            <view class="time">{{order.create_time}}</view>
            <view class="money">
              <text class="old-price">{{ language['money']}}{{order.goods_price}}</text>
              <text>实付:{{language['money']}}{{order.price}}</text>
            </view>
          </view>
        </view>
      </view>
      <view class="fans-list" wx:if="{{extension_type == 1}}">
        <view class="fans-item" wx:for="{{extension_order.data}}" wx:for-item="order" wx:key="index">
          <image class="img" src="{{order.avatar}}" mode='widthFix'></image>
          <view class="fans-item-right">
            <view class="fans-item-top">
              <view class="fans-name">
                <text>{{order.nickname}}</text>
                <text class="id">{{order.child_id}}</text>
              </view>
              <view class="pay-box">支付订单数:
                <text class="num">{{order.order_price}}</text>
              </view>
            </view>
            <view class="fans-item-bottom">
              <text class="time">{{order.created_at}}</text>
              <view class="pay-box">支付订单总额:
                <text class="num">{{language['money']}}{{order.order_count}}</text>
              </view>
            </view>
          </view>
        </view>
      </view>
      <view style="text-align: center;margin-top: 10px" wx:if="{{extension_order.data && extension_order.data.length <= 0}}">暂无数据</view>
    </view>

    <backup wx:if="{{btnFlag}}" datas="{{btnData}}"  component_id="{{1}}"></backup>
    <icon wx:if="{{service}}" class="iconfont icon-member_kefu service-box" style="left: {{(clientWidth-54)}}px" catchtap="openService"></icon>

    <connect-customer-service show="{{ showPopup }}" bind:closed="closePopup" tel="{{ service.service_mobile }}" qrcode="{{ service.service_QRcode }}"></connect-customer-service>

    <!--海报-->
    <qrcode isshow="{{isshow}}" showcarrfootBol="{{showcarrfootBol}}" iPnoneBottomBol="{{iPnoneBottomBol}}" bind:closeMethod='closeCallblack'></qrcode>

  </view>
  <!-- template === '01' end -->

  <view class="extension-box_1" wx:if="{{template === '02'}}">
    <view class="header">
      <view class="top">
        <view class="img">
          <image src="{{userInfo.avatar}}" mode='widthFix'/>
        </view>
        <view class="header-info">
          <view class="li header-name">{{ userInfo.nickname }}</view>
          <view class="li" wx:if="{{show_member_id != 1}}">
            <view class="span">[{{language.extension['会员']}}ID：{{ userInfo.member_id }}]</view>
          </view>
        </view>
        <view class="share" catchtap="gomyIncome" wx:if="{{share_page}}">
          <icon class="iconfont icon-extension_code"></icon>
          <view class="span">{{income_name_text?income_name_text:'收入'}}{{language.extension['分享']}}</view>
        </view>
      </view>
      <view class="income">
        <view class="ul">
          <view class="li header-top">{{language.extension['累计']}}{{income_name_text?income_name_text:'收入'}}</view>
          <view class="li">
            <text class="small">{{language['money']}}</text>
            {{ userInfo.grand_total }}
          </view>
        </view>
        <view class="ul right">
          <view class="li header-top">
            {{language.extension['可']}}{{name_of_withdrawal?name_of_withdrawal:'提现'}}{{income_name_text?income_name_text:'收入'}}
          </view>
          <view class="li">
            <text class="samll">{{language['money']}}</text>
            {{ userInfo.usable_total }}
          </view>
        </view>
        <view class="btn" catchtap="gotoIncomeBtn"
              wx:if="{{userInfo.auto_withdraw == 0&&withdraw_date&&!withdraw_date.disable}}">
          <view class="button">
            {{language.extension['去']}}{{name_of_withdrawal?name_of_withdrawal:'提现'}}
            <van-icon name="arrow" color="#fff" size="36rpx"/>
          </view>
        </view>
        <view class="btn" wx:if="{{userInfo.auto_withdraw!=0&&withdraw_date&&!withdraw_date.disable}}">
          <view class="button">
            <view class="left">
              {{ userInfo.auto_withdraw }}号自动{{name_of_withdrawal?name_of_withdrawal:'提现'}}
            </view>
            <van-icon name="arrow" size="36rpx"/>
          </view>
        </view>
        <view class="btn" wx:if="{{withdraw_date&&withdraw_date.disable}}" style="position: relative;width:24%;"
              bindtap="toToast">
          <view class="button" style="background-color:#ccc;width:100%;">
            <view class="left">
              {{withdraw_date.day}}号可提现
            </view>
            <van-icon name="arrow" size="36rpx"/>
          </view>
        </view>
      </view>
    </view>
    <view class="ul detail">
      <view class="li" catchtap="myEarnings" wx:if="{{showEarning}}">
        <view class="left">
          <icon class="iconfont icon-extension_receive"></icon>
          <view class="span">{{language.extension['领取收益']}}</view>
        </view>
        <view class="right">
          <van-icon name="arrow" size="36rpx"/>
        </view>
      </view>
      <view class="li" catchtap="gotoDetail">
        <view class="left">
          <icon class="iconfont icon-member_integral1"></icon>
          <view class="span">{{income_name_text?income_name_text:'收入'}}{{language.extension['明细']}}</view>
        </view>
        <view class="right">
          <van-icon name="arrow" size="36rpx"/>
        </view>
      </view>
      <view class="li" catchtap="gotoRecharge">
        <view class="left">
          <icon class="iconfont icon-member-withdrawals1"></icon>
          <view class="span">{{name_of_withdrawal?name_of_withdrawal:'提现'}}{{language.extension['明细']}}</view>
        </view>
        <view class="right">
          <van-icon name="arrow" size="36rpx"/>
        </view>
      </view>
      <view class="li" catchtap="gotoPerformance" wx:if="{{is_show_performance}}">
        <view class="left">
          <icon class="iconfont icon-extension_collect"></icon>
          <view class="span">{{language.extension['营业额']}}</view>
        </view>
        <view class="right">
          <van-icon name="arrow" size="36rpx"/>
        </view>
      </view>
      <view class="li" wx:if="{{is_show_limit}}">
        <view class="left">
          <icon class="iconfont icon-cord_erdutixian"></icon>
          <view class="span">当前提现额度{{amount_num}}</view>
        </view>
      </view>
    </view>
    <view class="power">
      <view class="title">
        <view class="spare"></view>
        <view class="h1">{{language.extension['权限']}}</view>
      </view>
      <view class="plugg" wx:if="{{template === '02'}}">
        <view wx:key="index" class="plug-list" wx:for="{{extension}}" catchtap="gotoPage" data-item="{{item}}"
              wx:if="{{item.mini_url}}">
          <icon class="iconfont {{item.icon}}"></icon>
          <view class="ul left">
            <view class="li left_a">{{ item.title }}</view>
            <view class="li left_b"
                  wx:if="{{item.level == null ||item.level == '' ||item.level == undefined? false: true}}">
              {{ item.level }}
            </view>
            <view class="li left_b"
                  wx:if="{{ item.level == null ||item.level == '' ||item.level == undefined? true: false}}"></view>
            <view class="li left_c">
              <text class="span">{{language['money']}}</text>
              {{ item.value }}
            </view>
          </view>
        </view>
      </view>
    </view>
    <view class="more-power" wx:if="{{is_show_unable == 1}}">
      <view class="title">
        <view class="spare"></view>
        <view class="h1">{{language.extension['更多权限']}}</view>
      </view>
      <view class="plugg" wx:if="{{template === '02'}}">
        <view wx:key="index" class="plug-list" wx:for="{{unextension}}" catchtap="gotoPage" data-item="{{item}}"
              wx:if="{{item.mini_url}}">
          <icon class="iconfont {{item.icon}}"></icon>
          <view class="ul left">
            <view class="li left_a">{{ item.title }}</view>
            <view class="li left_b"></view>
            <view class="li left_c">
              <text class="span">{{language['money']}}</text>
              {{ item.value }}
            </view>
          </view>
        </view>
      </view>
    </view>

  </view>

</block>
<view class="zangbudenglu" wx:if="{{loginshow}}">
  <view class="p">
    你还没登录,请登录后查看推广
  </view>
  <view class="buttonContent">
    <view class="button" catchtap="gotologin">
      登录
    </view>
  </view>
</view>
<shopfoot></shopfoot>
