<template>
  <view class="order-page">

    <view class="header-title">我的购票</view>
    <!-- 订单卡片列表 -->
    <view class="order-list">
      <!-- 已购票 -->
      <view class="order-card purchased">
        <view class="order-card-header">
          <view class="status purchased"><span class="status-text">已购票</span></view>
          <view class="date">2024-01-15</view>
        </view>
        <view class="order-info">
          <view class="flight">苏航666(ZJ12345)</view>
          <view class="desc">↑ 南向北 | 下午批次</view>
        </view>
        <view class="order-actions">
          <button class="detail-btn">查看详情</button>
          <button class="buy-btn">去购票</button>
        </view>
      </view>
      <!-- 待确认 -->
      <view class="order-card pending">
        <view class="order-card-header">
          <view class="status pending"><span class="status-text">待确认</span></view>
          <view class="date">2024-01-15</view>
        </view>
        <view class="order-info">
          <view class="flight">苏航666(ZJ12345)</view>
          <view class="desc">↓ 北向南 | 上午批次</view>
        </view>
        <view class="order-actions">
          <button class="cancel-btn" disabled>取消预约</button>
          <button class="detail-btn">查看详情</button>
        </view>
      </view>
      <!-- 已确认 -->
      <view class="order-card confirmed">
        <view class="order-card-header">
          <view class="status confirmed"><span class="status-text">已确认</span></view>
          <view class="date">2024-01-15</view>
        </view>
        <view class="order-info">
          <view class="flight">苏航666(ZJ12345)</view>
          <view class="desc">↓ 北向南 | 上午批次</view>
        </view>
        <view class="order-actions single-btn">
          <button class="detail-btn">查看详情</button>
        </view>
      </view>
      <!-- 已取消 -->
      <view class="order-card cancelled">
        <view class="order-card-header">
          <view class="status cancelled"><span class="status-text">已取消</span></view>
          <view class="date">2024-01-15</view>
        </view>
        <view class="order-info">
          <view class="flight">苏航666(ZJ12345)</view>
          <view class="desc">↓ 北向南 | 上午批次</view>
        </view>
        <view class="order-actions">
          <button class="detail-btn">查看详情</button>
          <button class="rebook-btn">重新预约</button>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'OrderPage'
}
</script>

<style scoped>
.order-page {
  background: linear-gradient(180deg, #cbe6ff 0%, #f6faff 100%);
  min-height: 100vh;
  padding-bottom: 20px;
  font-family: 'SourceHanSansCN', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.header-title {
  text-align: center;
  font-size: 36rpx;
  font-weight: bold;
  padding-top: 7vh;
  letter-spacing: 2rpx;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 10px 16px;
  background: linear-gradient(180deg, #cbe6ff 0%, #f6faff 100%);
}
.back-btn, .more-btn {
  font-size: 24px;
  color: #333;
}
.title {
  font-size: 22px;
  font-weight: bold;
  color: #222;
}
.order-list {
  padding: 10px 0 0 0;
  margin-top: 44rpx;
}
.order-card {
  background: #fff;
  border-radius: 10px;
  margin: 0 16px 16px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 18px 18px 12px 18px;
  height: 340rpx;
}
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.status {
  font-size: 12px;
  border-radius: 8rpx;
  padding: 2px 8px;
  color: #fff;
  font-weight: 500;
  display: inline-block;
  transform: skewX(-20deg);
  border: none;
}
.status-text {
  display: inline-block;
  transform: skewX(20deg);
}
.status.purchased { background: #22c58b; }
.status.pending { background: #ff9800; }
.status.confirmed { background: #217aff; }
.status.cancelled { background: #bdbdbd; }
.date { color: #173766; font-size: 15px; }
.order-info {
  margin-bottom: 24px;
}
.flight {
  font-size: 16px;
  font-weight: 500;
  margin-top: 12px;
}
.desc {
  color: #888;
  font-size: 14px;
  margin-top: 10px;
}
.order-actions {
  display: flex;
  gap: 12px;
}
button {
  flex: 1;
  border-radius: 4px;
  padding: 8px 0;
  font-size: 16px;
  margin: 0;
}
.detail-btn {
  background: #e4f3fe;
  color: #217aff;
  height: 69rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-left: auto;
}
.order-actions.single-btn {
  justify-content: flex-end;
}
.order-actions.single-btn .detail-btn {
  flex: 0 0 auto;
  width: 153px;
}
.buy-btn, .rebook-btn {
  background: linear-gradient(90deg, #3b7cff 0%, #5bb6ff 100%);
  color: #fff;

  height: 69rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.cancel-btn {
  background: #ededed;
  color: #bdbdbd;

  height: 69rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.cancel-btn[disabled] {
  opacity: 1;
}
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: #fff;
  display: flex;
  border-top: 1px solid #eaeaea;
  z-index: 10;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
}
.tab-item.active {
  color: #217aff;
}
.icon {
  font-size: 22px;
  margin-bottom: 2px;
}
</style> 