<view class="order-detail">
  <!-- 订单基本信息 -->
  <view class="order-info">
    <view class="info-title">订单信息</view>
    <view class="info-item">
      <text class="info-label">行程路线：</text>
      <text class="info-value">{{order.schedule.fromLoc}} → {{order.schedule.toLoc}}</text>
    </view>
    <view class="info-item">
      <text class="info-label">出发时间：</text>
      <text class="info-value">{{order.schedule.time}}</text>
    </view>
    <view class="info-item">
      <text class="info-label">车辆型号：</text>
      <text class="info-value">{{order.schedule.model}}</text>
    </view>
    <view class="info-item">
      <text class="info-label">乘车人数：</text>
      <text class="info-value">{{order.passengers.length}}人</text>
    </view>
    <view class="info-item">
      <text class="info-label">订单状态：</text>
      <text class="info-value status-{{order.statusCode}}">{{order.status}}</text>
    </view>
    <view class="info-item">
      <text class="info-label">订单金额：</text>
      <text class="info-value price">¥{{order.totalPrice}}</text>
    </view>
    <view class="info-item">
      <text class="info-label">下单时间：</text>
      <text class="info-value">{{order.createTime}}</text>
    </view>
  </view>

  <!-- 司机信息 -->
  <view wx:if="{{driver}}" class="driver-section">
    <view class="section-title">司机信息</view>
    <view class="driver-info">
      <view class="info-item">
        <text class="info-label">司机车牌：</text>
        <text class="info-value car-plate">{{driver.plate}}</text>
      </view>
      <view class="info-item">
        <text class="info-label">司机电话：</text>
        <button class="phone-btn" open-type="makePhoneCall" phone-number="{{driver.phone}}" bindtap="onCallDriver">
          {{driver.phone}}
        </button>
      </view>
    </view>
    
    <view class="location-section">
      <view class="location-title">司机当前位置</view>
      <map longitude="{{driver.lng}}" latitude="{{driver.lat}}" scale="15" class="driver-map"/>
      <view class="driver-warn">司机驾驶中不便接听电话，如未接通请耐心等待，可短信或联系客服</view>
    </view>
  </view>

  <!-- 底部操作按钮 -->
  <view class="bottom-actions">
    <button wx:if="{{order.statusCode === 1}}" 
            class="cancel-order-btn" 
            bindtap="cancelOrder">
      取消订单
    </button>
  </view>
</view>