
<view class="order-detail">
  <map 
  wx:if="{{(type==3&&sendInfo&&status==40)||(type == 1&&shopInfo.lat&&status!=0&&status!=60)}}"
  id="orderMap"
  longitude="{{type==3?sendInfo.longitude:shopInfo.lon}}"  
  latitude="{{type==3?sendInfo.latitude:shopInfo.lat}}"   
  scale="16"                 
  markers="{{markers}}"
  include-points="{{includePoints}}"    
  polyline="{{polyline}}"   
  style="width: 100%; height: 300px;"  
  bindmarkertap="clickMarker"
  bindcallouttap="clickMarker"
>
<cover-view slot="callout">
    <cover-view class="callout-box" marker-id="{{1}}">
      <cover-view  class="title" wx:if="{{type==3}}">骑手正在送货</cover-view >
      <cover-view  class="title" wx:else>{{statusObject[status] + '>'}}  </cover-view >
      <!-- <view class="desc"></view> -->
    </cover-view>
  </cover-view>
  </map>
  <view wx:else> 
    <view class="order-sts">{{statusObject[status]}}</view>
    <view class="order-desc" wx:if="{{cancelReason&&status==60}}">取消原因：{{cancelReason}}</view>
  </view>

    <view class="pay-box" wx:if="{{status == 0&&time}}">
      <view class="notice-box">
          <view class="text">请在</view>
          <!-- <view class="red">14分59秒</view> -->
          <van-count-down use-slot time="{{ time }}" bind:change="onChange">
            <text class="red">{{ timeData.minutes }}分</text>
            <text class="red">{{ timeData.seconds }}秒</text>
          </van-count-down>
          <view class="text">内支付</view>
      </view>
      <view class="pay-btn-box">
        <view class="cancel-btn" bindtap="onCancelOrder">取消订单</view>
        <view class="pay-btn" bindtap="onPayAgain">立即支付￥{{actualTotal}}</view>
      </view>
    </view>

  <view class="oprate-box box">
  <view class="time-box" wx:if="{{estimatedTimeStr&&type == 3&&(status == 40||status==70||tatus==80)}}">
    <view class="title">预计送达时间</view>
    <view class="time">{{estimatedTimeStr}}{{estimatedTime}}</view>
  </view>
  <view class="time-box" wx:if="{{type == 1&&(status == 40||status==70||tatus==80)&&dvyName&&dvyFlowId}}">
    <view class="title">{{dvyName}}</view>
    <view class="time">{{dvyFlowId}}</view>
  </view>
    <view class="flex-box">
      <view class="item" wx:if="{{status == 60}}" bindtap="delOrderList" data-ordernum="{{orderNumber}}">
        <image class="icon" src="../../images/icon/del-icon.png" mode=""/>
        <view class="label">
          删除订单
        </view>
      </view>
      <button class='item' open-type="contact" wx:if="{{status >= 20&&status != 60}}">
        <image class="icon" src="../../images/icon/chat-icon.png" mode=""/>
        <view class="label">
          联系商家
        </view>
     </button>
     <view class="item" wx:if="{{sendInfo}}" bind:tap="callSender">
        <image class="icon" src="../../images/icon/sender-icon.png" mode=""/>
        <view class="label">
          联系骑手
        </view>
      </view>
     <view class="item" wx:if="{{status !=0 &&canRefund}}" bind:tap="applyRefund">
        <image class="icon" src="../../images/icon/apply.png" mode=""/>
        <view class="label">
          申请售后
        </view>
      </view>
      <!-- <view class="item" bind:tap="goWrite"> -->
      <view class="item" wx:if="{{status == 80&&commSts == 0}}" bind:tap="goWrite">
        <image class="icon" src="../../images/icon/write.png" mode=""/>
        <view class="label">
          评价晒单
        </view>
      </view>
      <view class="item" wx:if="{{status == 70}}">
        <image class="icon" src="../../images/icon/buy-icon.png" mode=""/>
        <view class="label">
          确认收货
        </view>
      </view>
      <!-- <view class="item" wx:if="{{status != 0}}">
        <image class="icon" src="../../images/icon/buy-icon.png" mode=""/>
        <view class="label">
          再次购买
        </view>
      </view> -->
  </view>
      
    </view>

    <view class='delivery-addr box'>
      <view class='user-info'>
        <text class='item'>{{userAddrDto.receiver}}</text>
        <text class='item'>{{userAddrDto.mobile}}</text>
      </view>
      <view class='addr'>{{userAddrDto.address}}{{userAddrDto.addressName}}{{userAddrDto.addrDetail}}</view>
    </view>
   

    <view class="refund-goods box">
      <view class="shop-box">
            <view class="shop-icon">
              <image src="../../images/icon/shop.png"></image>
            </view>
            <view class="shop-name">{{shopName}}</view>
          </view>
      <view class="good-list">
        <view class="good-item" wx:for="{{orderItemDtos}}" wx:key='prodId'>
          <image src="{{item.pic}}" mode="" class="img"/>
          <view class="info">
            <view class="good-name">{{item.prodName}}</view>
            <!-- <view class="desc">规格：5kg，盒</view> -->
            <view class="price">单价：￥{{item.price}}</view>
          </view>
          <view class="price-box">
            <view class="price">￥{{calc.preciseMultiply(item.prodCount,item.price)}}</view>
            <view class="num">x{{item.prodCount}}</view>
          </view>
        </view>

      </view>
        <!-- <view class="open-btn">
          展开（共7件） <image class="arrow" src="../../images/icon/black-down-arrow.png" mode=""/>
        </view> -->
    </view>

    <view class="goods-info box">
      <view class="item">
        <view class="label">商品金额</view>
        <view class="value">￥{{productTotalAmount}}</view>
      </view>
      <view class="item">
        <view class="label">{{dvyType}}：</view>
        <view class="value">￥{{transfee}}</view>
      </view>
      <view class="item">
        <view class="label"> 积分（{{totalUsableScore}}）：</view>
        <view class="value">-￥{{reduceAmount}}</view>
      </view>
      <view class="total">
        <view class="label">总计：</view>
        <view class="value" wx:if="{{actualTotal}}">￥{{actualTotal}}</view>
        <view class="value" wx:else="">{{totalUsableScore}}积分</view>
      </view>
    </view>

    <view class="order-info box">
      <view class="title">订单信息</view>
      <view class="item">
        <view class="label">订单编号：</view>
        <view class="value-box">
          <view class="value">{{orderNumber}}</view>
          <image bind:tap="copyBtn" data-value="{{orderNumber}}" class="icon" src="../../images/icon/copy.png" mode=""/>
        </view>
      </view>
     
      <view class="item">
        <view class="label">下单时间：</view>
        <view class="value">{{createTime}}</view>
      </view>
      <view class="item">
        <view class="label">支付方式：</view>
        <view class="value">微信支付</view>
      </view>
      <view class="item">
        <view class="label">订单备注：</view>
        <view class="value">{{remarks?remarks:''}}</view>
      </view>
    </view>
</view>
<wxs module="calc" src="../../wxs/calc.wxs" />