<view class="page-container">
  <view class="tab-bar">
    <view class="tab-bar__placeholder" />
    <t-tabs t-class="tab-bar__inner" t-class-active="tab-bar__active" t-class-track="t-tabs-track" bind:change="onTabChange" value="{{status}}" style="position: fixed; top: 0; left: 0; z-index: 100">
      <t-tab-panel wx:for="{{tabs}}" wx:for-index="index" wx:for-item="item" wx:key="index" label="{{item.text}}" value="{{item.key}}" />
    </t-tabs>
  </view>
  <t-pull-down-refresh loading-props="{{loadingProps}}" value="{{pullDownRefreshing}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="pullRefresh">
    <order-card wx:for="{{orderList}}" wx:key="id" wx:for-item="order" wx:for-index="oIndex" order="{{order}}" defaultShowNum="{{3}}" data-order="{{order}}" bindcardtap="onOrderCardTap">
      <view slot="top-left" class="order-number">
        <text decode>订单号&nbsp;</text>
        {{order._id}}
      </view>
      <view class="order-card-inside-container">
        <view class="goods-item" wx:for="{{order.orderItems}}" wx:key="id" wx:for-item="goods" wx:for-index="gIndex">
          <image class="goods-img" src="{{goods.goodsImage || '/images/default-product.png'}}" mode="aspectFill" />
          <view class="goods-info">
            <text class="goods-name">{{goods.name}}</text>
            <view class="goods-price">
              <text>¥{{goods.price || goods.currentPrice || '0.00'}}</text>
            </view>
          </view>
        </view>
      </view>
      <view slot="more">
        <view class="price-total">
          <text class="bold-price" decode="{{true}}">总价&nbsp;</text>
          <price fill class="real-pay" price="{{order.totalPrice * 100 + ''}}" decimalSmaller />
        </view>
        <!-- 订单按钮栏 -->
        <order-button-bar bindoperation="onOperation" order="{{order}}" bindrefresh="onRefresh" data-order="{{order}}" />
      </view>
    </order-card>
    <!-- 列表加载中/已全部加载 -->
    <load-more list-is-empty="{{!orderList.length}}" status="{{listLoading}}" bindretry="onReTryLoad">
      <!-- 空态 -->
      <view slot="empty" class="empty-wrapper">
        <t-empty t-class="t-empty-text" src="{{emptyImg}}">暂无相关订单</t-empty>
      </view>
    </load-more>
  </t-pull-down-refresh>
</view>
<t-toast id="t-toast" />
<t-dialog id="t-dialog" />