<scroll-view class="page" scroll-y>
  <view class="shell">
    <view class="hero">
      <view class="hero__eyebrow">Results</view>
      <view class="hero__title">历史结果</view>
      <view class="hero__desc">查看最近联调与正式对局结果</view>
    </view>

    <view class="panel">
      <view class="panel__title">当前状态</view>
      <view class="summary">{{statusText}}</view>
      <view class="summary">你可以回看最近完成的对局，也可以回到对应活动继续查看详情。</view>
    </view>

    <view class="panel">
      <view class="panel__title">结果列表</view>
      <view wx:if="{{!results.length}}" class="summary">当前没有结果记录</view>
      <view wx:for="{{results}}" wx:key="sessionId" class="result-card" bindtap="handleOpenResult" data-session-id="{{item.sessionId}}">
        <view class="result-card__title">{{item.titleText}}</view>
        <view class="result-card__meta">{{item.statusText}}</view>
        <view class="result-card__meta">{{item.scoreText}}</view>
        <view class="result-card__meta">{{item.routeText}}</view>
        <view class="result-card__meta">{{item.runtimeText}}</view>
        <view class="actions">
          <button class="btn btn--secondary" data-session-id="{{item.sessionId}}" catchtap="handleOpenResult">查看单局结果</button>
          <button class="btn btn--ghost" wx:if="{{item.eventId}}" data-event-id="{{item.eventId}}" catchtap="handleOpenEvent">返回活动</button>
        </view>
      </view>
    </view>
  </view>
</scroll-view>
