<!--packageI/allowanceIndex/allowanceReward/allowanceReward.wxml-->
<view id="allowanceReward">
    <van-tabs active="{{ active }}" bind:change="tabChange">
        <van-tab title="全部" name="0"></van-tab>
        <van-tab title="已结算" name="1"></van-tab>
        <van-tab title="未结算" name="2"></van-tab>
    </van-tabs>
    <view class="yearBox">
        <view>按年</view>
        <view class="yearRight">
            <picker mode="date" fields='year' bindchange="pickChange" value='{{nowYears}}-01-01'>
                <text>{{nowYears}}</text>
                <icon class="iconfont icon-member-bottom"></icon>
            </picker>
        </view>
    </view>
    <view class="list">
        <view wx:for="{{list}}" wx:key="index" class="forListC">
            <view class="list_li" wx:if="{{item.amounts > 0}}" catchtap="tapGetList" data-item='{{item}}' data-index="{{index}}">
                <view class="list_li_left">
                    {{ item.year }}-{{ item.month }}: <span class="price">￥{{ item.amounts }}</span>
                </view>
                <i class="iconfont icon-advertise-next"></i>
            </view>
            <block wx:for-item="itemk" wx:for="{{item.info}}" wx:key="{{ind}}" wx:for-index="ind">
                <view class="hideList" wx:if="{{item.show}}">
                    <view class="list_lis" catchtap="showGoods" data-ind="{{ind}}" data-itemk="{{itemk}}" data-index="{{index}}">
                        <view class="list_lis_top">
                            <view class="order">{{ itemk.order_sn }}</view>
                            <view class="price">+{{ itemk.award_amounts }}</view>
                        </view>
                        <view class="list_lis_bottom">
                            <view class="date">{{ itemk.created_at }}</view>
                            <view class="status">
                                {{ itemk.status_name }}
                                <block wx:if="{{tapind == 1 || tapind == 0}}">
                                    <view class="resver" wx:if="{{!itemk.show && itemk.order_goods.length > 0}}">
                                        <i class="iconfont icon-member-bottom"></i>
                                    </view>
                                    <view wx:if="{{itemk.show && itemk.order_goods.length > 0}}">
                                        <i class="iconfont icon-member-bottom"></i>
                                    </view>
                                </block>
                            </view>
                        </view>
                    </view>
                    <!-- && item.last_page && item.page < item.last_page -->
                    <block wx:if="{{tapind == 1 || tapind == 0}}">
                        <view class="goodsBox {{!itemk.moreShow ? 'goodsBoxHeight' : ''}}" wx:if="{{itemk.show && itemk.order_goods.length > 0}}">
                            <view class="shopList" wx:for="{{itemk.order_goods}}" wx:for-item="order" wx:key="{{oInd}}" wx:for-index="oInd">
                                <view class="img">
                                    <image src="{{order.thumb}}" ></image>
                                </view>
                                <view class="goodsDetail">
                                    <view class="goodsDetailTxt">{{ order.title }}</view>
                                    <view class="goodsDetailPrice"><span>订单金额：</span>{{ order.payment_amount }}</view>
                                </view>
                            </view>
                            <view class="moreGoods" catchtap="moreShowTap" data-ind="{{ind}}" data-item="{{item}}" data-index="{{index}}" wx:if="{{!itemk.moreShow && itemk.order_goods.length > 3}}">
                                查看更多
                                <i class="iconfont icon-member-bottom"></i>
                            </view>
                        </view>
                    </block>
                </view>
            </block>
            <view class="getMore" catchtap="getMore" data-item="{{item}}" data-index="{{index}}" wx:if="{{item.page < item.last_page && item.show}}">加载更多</view>

        </view>
    </view>
</view>