<view class="container p-bottom" wx:if="{{order.orderId}}">
  <scroll-view scroll-y="true">

    <!-- 收货地址 -->
    <view class="b-f">
      <view class="flow-checkout-header b-f dis-flex">
        <view class="flow-header-left padding-box">
          <view class="flow-checkout-admin f-26 col-3">{{order.deliveryAddress.userName}}
            <text class="f-26 col-m">{{order.deliveryAddress.phone}}</text>
          </view>
          <view class="flow-checkout-address">
            {{order.deliveryAddress.province}} {{order.deliveryAddress.city}} {{order.deliveryAddress.district}}
            {{order.deliveryAddress.address}}
          </view>
        </view>
      </view>
    </view>

    <!-- 物流信息 -->
    <view class="flow-all-money b-f padding-box m-top20" wx:if="{{order.delivery_status.value == 20}}">
      <view class="dis-flex flow-all-list-cont">
        <text class="col-7">快递公司: {{order.express_company}}</text>
      </view>
      <view class="dis-flex flow-all-list-cont">
        <text class="col-7" selectable="{{true}}">快递单号: {{order.express_no}}</text>
      </view>
    </view>

    <!-- 商品列表 -->
    <view class="order-cont b-f m-top20">
      <view class="padding-box b-f">
        <view class="order-header dis-flex">
          <view class="flex-box t-l">
            <text class="title">商品列表</text>
          </view>
          <view class="flex-box t-r">
            <text class="col-m" wx:if="{{order.payStatus=='NO'}}">待付款</text>
            <text class="col-m"
              wx:if="{{order.payStatus=='YES'&&order.deliveryStatus=='NO'&&order.status!='REFUNDING'&&order.status!='REJECT'}}">待发货</text>
            <text class="col-m" wx:if="{{order.payStatus=='YES'&&order.deliveryStatus=='YES' && order.receiveStatus=='NO'}}">待收货</text>
            <text class="col-m" wx:if="{{order.status=='COMPLETE'}}">已完成</text>
            <text class="col-m"
              wx:if="{{order.payStatus=='YES'&&order.deliveryStatus=='NO'&&order.status=='REFUNDING'}}">待退款</text>
            <text class="col-m"
              wx:if="{{order.payStatus=='YES'&&order.deliveryStatus=='NO'&&order.status=='REJECT'}}">退款驳回</text>
          </view>
        </view>
      </view>
      <view class="padding-box b-f">
        <view class="order-cont dis-flex">
          <view class="order-num">
            <text selectable="{{true}}">订单号：{{order.sn}}</text>
          </view>
          <view class="order-time">
            <text>{{order.createTime}}</text>
          </view>
        </view>
      </view>
    </view>

    <view class="padding-box b-f">
      <view bindtap="goodsDetail" class="dis-flex flow-shopList b-f" data-id="{{item.productId}}"
        wx:for="{{order.ordersItemList}}" wx:key="this">
        <view class="flow-list-left">
          <image mode="scaleToFill" src="{{IMG_NAME+item.product.productImages[0].name}}"></image>
        </view>
        <view class="flow-list-right">
          <text class="h4 twolist-hidden">{{item.product.productName}}</text>
          <text class="p f-22 col-7">{{item.product.goods_attr}}</text>
          <view class="flow-list-cont">
            <text class="flow-cont">￥{{item.product.productPrice}}</text>
            <text class="small">×{{item.quantity}}</text>
          </view>
          <view class="flex-box"
            wx:if="{{order.deliveryStatus=='NO' && order.payStatus=='YES' && order.status=='CREATED'}}">
            <view catchtap="refund" class="btn-main">申请退款</view>
          </view>
        </view>
      </view>
    </view>

    <view class="select b-f">
      <view class="flow-num-box b-f">共{{order.ordersItemList.length}}件商品，合计：
        <text class="flow-money" style="color: #ff495e;">{{order.amount}}</text>
      </view>
    </view>


    <!-- 订单金额 -->
    <!-- <view class="flow-all-money b-f padding-box m-top20">
      <view class="dis-flex flow-all-list">
        <text class="flex-five">订单金额</text>
      </view>
      <view class="dis-flex flow-all-list-cont">
        <text class="flex-five col-7">商品金额:</text>
        <text class="flex-five col-m t-r">￥{{order.total_price}}</text>
      </view>
      <view class="dis-flex flow-all-list-cont">
        <text class="flex-five col-7">配送费用:</text>
        <text class="flex-five col-m t-r">+￥{{order.express_price}}</text>
      </view>
      <view class="dis-flex flow-all-list-cont">
        <text class="flex-five col-7">应付金额:</text>
        <text class="flex-five col-m t-r">￥{{order.pay_price}}</text>
      </view>
    </view> -->

  </scroll-view>

  <view class="flow-fixed-footer b-f">
    <view class="dis-flex chackout-box" wx:if="{{order.payStatus=='NO'}}">
      <view bindtap="cancelOrder" class="flex-box chackout-left-detail t-c">
        取消订单
      </view>
      <view class="flex-box chackout-right-detail">
        <text bindtap="payOrder" class="flow-btn" wx:if="{{order.payStatus=='NO'}}">去付款</text>
      </view>
    </view>
    <view class="flow-btn h3" wx:if="{{order.payStatus=='YES'&&order.deliveryStatus=='YES' && order.receiveStatus=='NO'}}">
      <view bindtap="receipt">确认收货</view>
    </view>
  </view>

</view>