<!-- pages/logisticsInfo/logisticsInfo.wxml -->
<!-- 物流信息 -->
<view class="logistics-page">
  <view class="logistics-box" wx:if="{{package.length}}">
    <!-- nav -->
    <view class="package-list {{package.length>=5?'package-overlength':'package-list-flex'}}" scroll-into-view="{{intoView}}" wx-if='{{package.length>1}}'>
      <block wx:for="{{package}}" wx:key="{{index}}">
        <view class="package-item" data-sts="{{index}}" bindtap="navChange">
          <view class="nav-txt {{isCurrent == index?'active':''}}">包裹{{index+1}}</view>
        </view>
      </block>
    </view>
    <!-- 包裹信息 -->
    <view class="package-info {{package.length>1 ? 'mt100' : ''}}">
      <view class="package-prod">
        <!-- 单个包裹 -->
        <view class="single-package" wx:if="{{package[isCurrent].orderItems.length == 1}}">
          <view class="prod-pic">
            <image src="{{package[isCurrent].orderItems[0].pic ? package[isCurrent].orderItems[0].pic : '../../../images/icon/package-icon.png' }}" class="prod-pic"></image>
            <view class="quantity">×{{package[isCurrent].orderItems[0].prodCount}}</view>
          </view>
          <view class="prod-con">
            <!-- 物流状态 1已揽收 2运输途中 3已签收 4问题件 201达到目的城市 -1删除 -->
            <view class="prod-status" wx:if="{{package[isCurrent].status != -1}}">
              {{['','已揽收','运输途中','已签收','问题件','达到目的城市'][package[isCurrent].status]}}
            </view>
            <view class="prod-status" wx:if="{{package[isCurrent].status == -1}}">删除</view>
            <view class="prod-carrier">承运来源：{{package[isCurrent].deliveryDto.companyName}}</view>
            <view class="carrier">
              <text class="waybill-num">运单编号：{{package[isCurrent].deliveryDto.originId}}</text>
              <text class="copy-btn" bindtap="copyBtn">复制</text>
            </view>
          </view>
        </view>
        <!-- 多个包裹 -->
        <view class="multiple-package" wx:if="{{package[isCurrent].orderItems.length > 1}}">
          <view class="prod-con">
            <view class="prod-status" wx:if="{{package[isCurrent].status != -1}}">
              {{['','已揽收','运输途中','已签收','问题件','达到目的城市'][package[isCurrent].status]}}
            </view>
            <view class="prod-status" wx:if="{{package[isCurrent].status == -1}}">删除</view>
            <view class="prod-carrier">承运来源： {{package[isCurrent].deliveryDto.companyName}}</view>
            <view class="carrier">
              <text class="waybill-num">运单编号：{{package[isCurrent].deliveryDto.dvyFlowId}}</text>
              <text class="copy-btn" bindtap="copyBtn">复制</text>
            </view>
          </view>
          <view class="prod-item">
            <block wx:for="{{package[isCurrent].orderItems}}" wx:for-item="prod">
              <view class="prod-item-pic">
                <image src="{{prod.pic ? prod.pic : '../../../images/icon/package-icon.png' }}" class="prod-pic"></image>
                <view class="quantity">×{{prod.prodCount}}</view>
              </view>
            </block>
          </view>
        </view>
      </view>
      <!-- 物流信息 -->
      <view class="logistics-info">
        <view class="logistics-box" wx:if="{{package[isCurrent].deliveryDto.traces.length}}">
          <view class="logistics">
            <block wx:for="{{package[isCurrent].deliveryDto.traces}}" wx:for-item="tracesItem" wx:key="index">
              <view class="item">
                <view class="time">{{tracesItem.acceptTime}}</view>
                <view class="des">{{tracesItem.acceptStation}}</view>
              </view>
            </block>
          </view>
        </view>
        <!-- 物流信息为空 -->
        <view class="logistics-info-empty" wx:if="{{!package[isCurrent].deliveryDto.traces.length}}">
          暂无配送信息
        </view>
      </view>
    </view>
  </view>
  <!-- 包裹信息为空 -->
  <view class="expresses-empty" wx:if="{{!package.length}}">暂无包裹信息</view>
</view>