<!--nova-tourism/pages/my/my-order/index.wxml-->
<nav type="back" background-color="#ffffff" frontColor="#000000" title="我的订单" />
<view class="all">
  <view class="tab-bar">
    <view style="margin-left: 56rpx;" class="tab-item {{currentTab == 0? 'active' : ''}}" bindtap="switchTab" data-index="0">
      处理中
    </view>
    <view style="margin-left: 60rpx;" class="tab-item {{currentTab == 1? 'active' : ''}}" bindtap="switchTab" data-index="1">
      进行中
    </view>
    <view style="margin-left: 60rpx;" class="tab-item {{currentTab == 2? 'active' : ''}}" bindtap="switchTab" data-index="2">
      已完成
    </view>
  </view>

  <view>
    <block wx:for="{{order}}" wx:key="index">
      <!-- 民宿 -->
      <block wx:if="{{item.ot=='room'}}">
        <view class="cardbox">
          <view class="title">
            {{item.table||''}}
            <text wx:if="{{statusMap[item.status]}}"> - {{statusMap[item.status]}}</text>
          </view>
          <view class="roombox">
            <image src="{{item.image||'https://file-cloud.fmode.cn/EbxZUK5lBI/20250228/j4pbsl030249178.jpg?imageView2/1/w/200/h/200'}}"></image>
            <view class="room">
              <view class="room-name">{{item.name||''}}</view>
              <view class="room-tag">
                <block wx:for="{{item.tags}}" wx:for-item="tag" wx:key="index">
                  {{tag}}
                </block>
              </view>
              <view class="room-text">{{item.fromto||''}}</view>
            </view>
          </view>
          <van-divider customStyle="margin: 20rpx;border-color:'#B1B1B1' " />
          <view class="pricebox">
            <view class="price">实付款￥{{item.totalPrice||0}}</view>
          </view>
          <view class="sumbitbox">
            <view wx:if="{{item.status=='100'}}" class="sumbit" bindtap="ONShow" data-oid="{{item.objectId}}">申请退款</view>
            <view wx:if="{{currentTab==0||currentTab==2}}" class="sumbit" style="margin-left: 15rpx;" bindtap="tourl" data-url="{{'/nova-tourism/pages/my/my-order/order-detail/index?value=民宿&objectId='+item.objectId}}">订单详情</view>
            <view wx:if="{{currentTab==1}}" class="sumbit" style="margin-left: 15rpx;" bindtap="tourl" data-url="{{'/nova-tourism/pages/my/my-order/order-detail/index?value=民宿&objectId='+item.objectId}}">变更订单</view>
          </view>
          <van-dialog message='仅支持线下退款，确认退房并提交退款申请吗？' data-oid="{{item.objectId}}" show="{{ showid==item.objectId&&show }}" show-cancel-button bind:cancel="onClose" bind:confirm="checkout100">
          </van-dialog>
        </view>
      </block>
      <!-- 礼物 -->
      <block wx:else>
        <view class="cardbox">
          <view class="title">
            {{item.table||'望仙礼遇'}}
            <text wx:if="{{statusMap_shop[item.status]}}"> - {{statusMap_shop[item.status]}}</text>
          </view>
          <view class="roombox">
            <image src="{{item.image||'https://file-cloud.fmode.cn//tmp/mqHkA2qV3Q8nca3dc59bad49de6e5ae57afa81d78ae8.jpeg?imageView2/1/w/200/h/200'}}"></image>
            <view class="room">
              <view class="room-name">{{item.name||''}}</view>
              <view class="room-text2">
                {{item.spec||''}}
                <block wx:for="{{item.list}}" wx:for-item="spec" wx:key="spec"><text>{{spec.spec}} </text></block>
              </view>
            </view>
          </view>
          <van-divider customStyle="margin: 20rpx;border-color:'#B1B1B1' " />
          <view class="pricebox">
            <block wx:for="{{item.tags}}" wx:for-item="tag" wx:key="index">
              <view class="ciri">{{tag}}</view>
            </block>
            <view class="price">实付款￥{{item.totalPrice}}</view>
          </view>
          <view class="sumbitbox">
            <view wx:if="{{currentTab==0||currentTab==2}}" class="sumbit" bindtap="tourl" data-url="{{'/nova-tourism/pages/my/my-order/order-detail-good/index?objectId='+item.objectId}}">订单详情</view>
            <view wx:if="{{item.status=='200'||item.status=='300'||item.status=='602'}}" class="sumbit" data-oid="{{item.objectId}}" bind:tap="receiving" >确认收货</view>
            <view wx:if="{{item.status=='601'}}" class="sumbit" bindtap="tourl" data-url="{{'/nova-tourism/pages/my/my-order/my-refund/refund-good/refund-express/index?oid='+item.objectId}}" >退款详情</view>
            <view wx:if="{{currentTab==1}}" class="sumbit" bindtap="tourl" data-url="{{'/nova-tourism/pages/my/my-order/order-detail-good/index?objectId='+item.objectId}}">查看物流</view>
          </view>
        </view>
      </block>
    </block>
    <van-empty wx:if="{{order.length<=0}}" description="暂无订单" />
  </view>
</view>