<!--pages/my-order/my-order.wxml-->
<wxs src="my-order.wxs" module="tool" />
<wxs src="../../app.wxs" module="getPriceForm" />

<view class="container safe-area-bottom">
  <view class="header">
    <view class="header-item {{status === 0?'item-activated':''}}" data-index="0" bindtap="changeSelect">
      <text>待签署</text>
      <view>{{listNumber}}</view>
    </view>
    <view class="header-item {{status === 2?'item-activated':''}}" data-index="2" bindtap="changeSelect">
      <text>进行中</text>
    </view>
    <view class="header-item {{status === 1?'item-activated':''}}" data-index="1" bindtap="changeSelect">
      <text>已完成</text>
    </view>
  </view>
  <block wx:if="{{!offline}}">
    <block wx:if="{{list.length}}">
      <view class="cell-group">
        <view wx:for='{{list}}' wx:key="index" class="cell" data-id="{{item.id}}" data-status="{{item.status}}"
          bindtap="toDetail">
          <view class="content">
            <view class="content-header">
              <text>{{item.hwRequirement.name}}</text>
              <text class="price">{{item.hwRequirement.price}}元</text>
            </view>
            <view class="content-company">{{item.companyName || ''}}</view>
            <view class="content-info">
              <view class="address">
                <image src="../../imgs/address.png" class="address-image"></image>
                <text>{{item.hwRequirement.provinceCityCountry || '暂无地址信息'}}</text>
              </view>
              <view class="number">
                <image src="../../imgs/number.png" class="number-image"></image>
                <text>报名数: {{item.hwRequirement.number || '若干'}}</text>
              </view>
            </view>
          </view>
          <view class="order-info">
            <text>订单号: {{item.orderNumber}}</text>
            <view class="button-confirm" wx:if="{{status === 0}}" data-id="{{item.id}}" data-otherAgreement="{{item.otherAgreement}}" data-parentIndex="{{key}}"
              data-index="{{index}}" data-workContractType="{{item.workContractType}}" catchtap="confirm">确认签署</view>
            <text class="doing" wx:if="{{status === 2}}">进行中</text>
            <text class="done" wx:if="{{status === 1}}">已完成</text>
          </view>
        </view>
      </view>
      <view class="tar-bar"></view>
    </block>
    <empty message='您还没有相关订单内容可查看' wx:else></empty>
  </block>
  <view class="offline" wx:else>
    <image src="../../imgs/offline.png" class="offline-image"></image>
    <view class="offline-text">无法连接到网络</view>
    <view class="offline-message">网络故障，请检查您的网络状态</view>
    <view class="offline-reload" bindtap="reload">重新加载</view>
  </view>
</view>
<protocolConfirmationView class="protocolConfirmationView"></protocolConfirmationView>
