<!-- module/order/pages/logistics-detail/logistics-detail.wxml -->
<t-navbar title="物流详情" left-arrow />
<scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
  <view class="logistics-page">
    <view class="map-header">
      <block wx:if="{{hasMapPosition}}">
        <map class="map-header__map" latitude="{{latitude}}" longitude="{{longitude}}" scale="{{mapScale}}" markers="{{markers}}" polyline="{{polyline}}" include-points="{{includePoints}}" enable-scroll="{{true}}" enable-zoom="{{true}}" />
      </block>
      <block wx:else>
        <view class="map-header__inner">
          <text class="map-header__city">暂无物流轨迹地图</text>
        </view>
      </block>
    </view>

    <view class="logistics-card">
      <view class="carrier-row">
        <!-- <i class="iconfont {{carrierIcon || 'icon-zhongtong'}}" style="font-size:15px"></i> -->
        <view class="carrier-row__info">
          <text class="carrier-row__name">{{carrierName}}</text>
          <text class="carrier-row__no">{{trackingNo}}</text>
        </view>
        <view class="carrier-row__actions">
          <text class="carrier-row__action" bindtap="onCopyTracking">复制</text>
          <!-- <view class="carrier-row__divider" />
          <text class="carrier-row__action" bindtap="onCallCourier">打电话</text> -->
        </view>
      </view>

      <view class="trace-list">
        <view class="trace-list__axis" />

        <view class="trace-item trace-item--current">
          <view class="trace-item__dot trace-item__dot--active" />
          <view class="trace-item__body">
            <view class="trace-item__title-row">
              <text class="trace-item__status trace-item__status--accent">{{latestTrace.status}}</text>
              <text class="trace-item__time trace-item__time--accent">{{latestTrace.time}}</text>
            </view>
            <text class="trace-item__desc trace-item__desc--muted">{{latestTrace.desc}}</text>
          </view>
        </view>

        <block wx:if="{{showAllTrace}}">
          <view class="trace-item" wx:for="{{traceHistory}}" wx:key="timeKey">
            <view class="trace-item__dot trace-item__dot--grey" />
            <view class="trace-item__body">
              <view class="trace-item__title-row">
                <text class="trace-item__status">{{item.status}}</text>
                <text class="trace-item__time">{{item.time}}</text>
              </view>
              <text class="trace-item__desc">{{item.desc}}</text>
            </view>
          </view>
        </block>

        <view class="trace-item trace-item--expand" bindtap="toggleTraceExpand">
          <view class="trace-item__dot trace-item__dot--hollow" />
          <view class="trace-item__body trace-item__body--inline">
            <text class="trace-expand__text">{{showAllTrace ? '收起物流明细' : '查看更多物流明细'}}</text>
            <t-icon name="{{showAllTrace ? 'chevron-up' : 'chevron-down'}}" size="36rpx" color="#999" />
          </view>
        </view>
      </view>

      <view class="logistics-divider" />

      <view class="addr-block">
        <t-icon name="location" size="30rpx" color="#333" class="addr-block__icon" />
        <view class="addr-block__main">
          <text class="addr-block__address">{{deliveryAddress}}</text>
          <view class="addr-block__contact">
            <text class="address-name">{{recipientName}}</text>
            <text class="address-phone">{{recipientPhone}}</text>
            <!-- <t-tag size="small" variant="outline" theme="default" class="addr-block__tag">号码保护中</t-tag>
            <view class="addr-block__virtual" bindtap="onVirtualNumberTip">
              <t-tag size="small" variant="outline" theme="warning" class="addr-block__tag addr-block__tag--orange">
                取件出示虚拟号
              </t-tag>
            </view> -->
          </view>
        </view>
      </view>
    </view>

    <view class="goods-section">
      <view class="goods-item">
        <t-image src="{{goosInfo.image}}" width="144rpx" height="144rpx" shape="round" mode="aspectFill" class="goods-item__img" />
        <view class="goods-item__main">
          <text class="goods-item__title">{{goosInfo.name}}</text>
          <text class="goods-item__spec">{{goosInfo.description}}</text>
        </view>
        <view class="goods-item__price-col">
          <text class="goods-item__price">¥{{goosInfo.price}}</text>
          <text class="goods-item__qty">x{{goosInfo.quantity}}</text>
        </view>
      </view>
    </view>
  </view>
</scroll-view>