<!--packageH/orderImport/orderImportIndex/orderImportIndex.wxml-->

<view class="header">
  <view class="header-container">
    <view class="header-face">
      <image src="{{details.avatar_image}}"></image>
    </view>
    <view class="header-info">
      <view class="header-info-desc">
        <view class="name">{{details.nickname}}</view>
        <view class="level" wx:if="{{details.alias}}">
          <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/orderImport_icon_crown.png"></image>
          <text class="text">{{details.alias}}</text>
        </view>
      </view>
      <view class="header-info-id">
        ID:{{details.uid}}
      </view>
    </view>
  </view>
</view>




<view class="wrapper-padding">
  <view class="specific">
    <view class="specific-items">
      <view class="specific-item">
        <view class="text {{shop_type==0 ? 'specific-item-active' : ''}}" bindtap="setShopType" data-index="0">全部</view>
      </view>
      <view class="specific-item">
        <view class="text {{shop_type==1 ? 'specific-item-active' : ''}}" bindtap="setShopType" data-index="1">本土店</view>
      </view>
      <view class="specific-item">
        <view class="text {{shop_type==2 ? 'specific-item-active' : ''}}" bindtap="setShopType" data-index="2">跨境店</view>
      </view>
    </view>
    <view class="split-line"></view>
    <view class="specific-items">
      <view class="specific-item">
        <view class="num">{{details.today_count || 0}}</view>
        <view class="text">今日订单数</view>
      </view>
      <text class="hr"></text>
      <view class="specific-item">
        <view class="num">{{details.today_amount || 0}}</view>
        <view class="text">今日采购金额</view>
      </view>
      <text class="hr"></text>
      <view class="specific-item">
        <view class="num">{{details.today_profit || 0}}</view>
        <view class="text">今日利润</view>
      </view>
    </view>
    <view class="specific-items">
      <view class="specific-item">
        <view class="num">{{details.month_count || 0}}</view>
        <view class="text">本月订单数</view>
      </view>
      <text class="hr"></text>
      <view class="specific-item">
        <view class="num">{{details.month_amount || 0}}</view>
        <view class="text">本月采购金额</view>
      </view>
      <text class="hr"></text>
      <view class="specific-item">
        <view class="num">{{details.month_profit || 0}}</view>
        <view class="text">本月利润</view>
      </view>
    </view>
    <view class="specific-items">
      <view class="specific-item">
        <view class="num">{{details.count || 0}}</view>
        <view class="text">累计订单总数</view>
      </view>
      <text class="hr"></text>
      <view class="specific-item">
        <view class="num">{{details.amount || 0}}</view>
        <view class="text">累计采购总金额</view>
      </view>
      <text class="hr"></text>
      <view class="specific-item">
        <view class="num">{{details.profit || 0}}</view>
        <view class="text">累计总利润</view>
      </view>
    </view>
  </view>

  <view class="pending_order">
    <view class="pending_order_text">待扣款订单总数：{{details.wait_count}}</view>
    <view class="pending_order_text">待扣款总金额：{{details.wait_amount}}</view>
    <view class="pending_order_text">待结算总金额：{{details.wait_settle}}</view>
  </view>

  <view class="record-title">
    记录明细
  </view>

  <view class="tabs">
    <view class="tabs-item {{index==tabIndex ? 'active' : ''}}" wx:for="{{tabArray}}" wx:key="{{index}}"
      bindtap="setTabIndex" data-index="{{index}}">{{item.name}}</view>
  </view>

  <view class="listItem">
    <view class="date-wrapper">
      <view class="time-wrapper">
        <picker mode="date" bindchange="bindDateChange" data-type="start">
          <view class="time-desc">选择开始时间</view>
          <view class="time-text">{{startTimeText}}</view>
        </picker>

      </view>
      <view class="time-iconfont">
        <i class="iconfont icon-fontclass-jiantou"></i>
      </view>
      <view class="time-wrapper">
        <picker mode="date" bindchange="bindDateChange" data-type="end">
          <view class="time-desc">选择结束时间</view>
          <view class="time-text">{{endTimeText}}</view>
        </picker>
      </view>
    </view>
    <view wx:if="{{!networkLoading}}" class="loadingimg">
      <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/video-loading.gif" mode='aspectFill' />
    </view>
    <block wx:if="{{networkLoading && listData.length > 0}}">
      <view class="list-item" wx:for="{{listData}}" data-id="{{item.id}}" bindtap="handRecord">
        <view class="c1 cc">
          <view class="order_sn">订单编号：{{item.order_sn}}</view>
        </view>
        <view class="cc c2">
          <view class="deduction">{{item.settle==0 ? '待扣款' : '已扣款'}}</view>
          <view class="price">{{ item.order_amount }}</view>
        </view>
        <view class="c2 cc">
          <div class="settlement_time">结算时间：{{ item.settle_at }}</div>
          <view class="status" wx:if="{{item.status==1}}">待结算</view>
          <view class="status" wx:elif="{{item.status==2}}">已结算</view>
          <view class="status" wx:elif="{{item.status==-1}}">失效</view>
        </view>
        <view class="c2 cc">
          <view class="time">时间：{{ item.created_at }}</view>
        </view>
        <view class="details" wx:if="{{sid == item.id}}" catchtap>
          <view class="name">{{item.goods_name}}</view>
          <view class="c3 cc">
            <view class="spec">{{item.goods_spec}} x{{item.goods_total}}</view>
            <view class="time">订单日期：{{item.real_at}}</view>
          </view>
          <view class="c4 cc">
            <view class="text">采购单价：{{item.goods_price}}</view>
            <view class="text">运费：{{item.order_freight}}</view>
            <view class="text">采购款：{{item.goods_amount}}</view>
          </view>
          <view class="c4 cc">
            <view class="text">采购成本合计：<text class="price">{{item.order_price}}</text></view>
            <view class="text">订单结算合计：<text class="price">{{item.order_amount}}</text> </view>
          </view>
          <view class="c4 cc">
            <view class="store_cateroty">
              店铺类别：{{item.shop_type}}
            </view>
          </view>
        </view>
      </view>
    </block>
    <view wx:if="{{ networkLoading && listData.length==0}}" class="blank">
      <image src='https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/blank.png' mode='widthFix' />
    </view>


  </view>
</view>