<wxs src="../../utils/format.wxs" module="fmt" />
<!-- service-record-card 组件 —— 60天内服务记录单条卡片 -->
<view class="svc-card {{type === 'recharge' ? 'svc-card--recharge' : ''}}" hover-class="svc-card--hover">
  <!-- 第一行：左=时间，右=课程+台桌+小时数 -->
  <view class="svc-row svc-row1">
    <text class="svc-time">{{fmt.safe(time)}}</text>
    <view class="svc-right1">
      <text class="svc-course-tag svc-course-{{typeClass}}">{{type === 'recharge' ? '充值' : fmt.safe(courseLabel)}}</text>
      <text class="svc-table-label" wx:if="{{tableNo && type !== 'recharge'}}">{{tableNo}}</text>
      <text class="svc-hours" wx:if="{{hours && type !== 'recharge'}}">{{fmt.hoursH(hours)}}</text>
      <!-- CHANGE 2026-03-27 | 任务B: 折前时长仅在 hoursRaw 有值且与 hours 不同时显示 -->
      <text class="svc-hours-raw" wx:if="{{hoursRaw && hoursRaw !== hours && type !== 'recharge'}}">折前{{fmt.hoursH(hoursRaw)}}</text>
    </view>
  </view>
  <!-- 第二行：左=商品，右=金额（含预估/提成） -->
  <view class="svc-row svc-row2">
    <text class="svc-drinks" wx:if="{{drinks}}">🍹 {{fmt.safe(drinks)}}</text>
    <view class="svc-income-wrap">
      <text class="svc-income-est" wx:if="{{isEstimate && type !== 'recharge'}}">预估</text>
      <text class="svc-income-label">{{type === 'recharge' ? '提成' : '到手'}}</text>
      <text class="svc-income {{type === 'recharge' ? 'svc-income--recharge' : ''}}">{{fmt.money(income)}}</text>
    </view>
  </view>
</view>
