<wxs src="../../../utils/filter.wxs" module="filters" />

<view class="container">
    <view class="statistics">
        <view class="col">
            <view class="row">
                <view class="label">累计收益（元）</view>
                <view class="money">{{filters.twoDecimal(allIncome.income)}}</view>
            </view>
            <view class="row">
                <view class="label">累计销售（元）</view>
                <view class="money">{{filters.twoDecimal(allIncome.saleCount)}}</view>
            </view>
            <view class="row">
                <view class="label">累计订单（笔）</view>
                <view class="money">{{allIncome.orderCount}}</view>
            </view>
        </view>
        <view class="col col2">
            <view class="row">
                <view class="label">可提现（元）</view>
                <view class="money">{{filters.twoDecimal(allIncome.withdraw)}}</view>
            </view>
            <view class="row">
                <view class="label">待结算（元）</view>
                <view class="money">{{filters.twoDecimal(allIncome.waitSettlement)}}</view>
            </view>
            <view class="row">
                <view class="label">累计邀请（人）</view>
                <view class="money">{{allIncome.inviteCount}}</view>
            </view>
        </view>
    </view>
    <view class="detailsBox">
        <view class="title">展示明细</view>
        <view class="categoryBox">
            <view class="category {{currentIndex==item.id?'currentClass':''}}" wx:for="{{categoryList}}" wx:key="id"
                data-index="{{item.id}}" data-title='{{item.title}}' bindtap="setClass">
                {{item.title}}
            </view>
        </view>
        <view class="detailsList">
            <view class="group" wx:for="{{orderListKey}}" wx:key="index">
                <view class="header">
                    <view>
                        {{item}}
                    </view>
                    <view>
                        结余（元）
                    </view>
                </view>
                <view class="body">
                    <view class="row" wx:for="{{orderList[item]}}" wx:key="id" wx:for-item="row">
                        <view class="col">{{filters.formatDate(row.gmtCreated,6)}}日</view>
                        <view class="col">
                            <view class="num {{row.type=='1'?'add':'reduce'}}">
                                {{row.type=='1'?'+':'-'}}{{filters.twoDecimal(row.amount)}}</view>
                            {{row.title}}
                        </view>
                        <view class="col">{{filters.twoDecimal(row.balance)}}</view>
                    </view>
                </view>
            </view>
        </view>
    </view>
    <emptyBg wx:if="{{orderListKey.length==0}}" message="暂无订单" />
</view>