<scroll-view class="page" scroll-y>
  <view class="shell">
    <view class="hero">
      <view class="hero__eyebrow">Entry Home</view>
      <view class="hero__title">{{userNameText}}</view>
      <view class="hero__desc">{{tenantText}}</view>
      <view class="hero__desc">{{channelText}}</view>
    </view>

    <view class="panel">
      <view class="panel__title">当前状态</view>
      <view class="summary">{{statusText}}</view>
      <view class="summary">进行中：{{ongoingSessionText}}</view>
      <view class="summary">进行中运行对象：{{ongoingRuntimeText}}</view>
      <view class="summary">最近一局：{{recentSessionText}}</view>
      <view class="summary">最近一局运行对象：{{recentRuntimeText}}</view>
      <view class="actions">
        <button class="btn btn--secondary" bindtap="handleRefresh">刷新首页</button>
        <button class="btn btn--ghost" bindtap="handleOpenRecentResult">查看结果</button>
        <button class="btn btn--ghost" bindtap="handleLogout">退出登录</button>
      </view>
    </view>

    <view class="panel">
      <view class="panel__title">活动入口</view>
      <view wx:if="{{!cards.length}}" class="summary">当前没有首页卡片</view>
      <view wx:for="{{cards}}" wx:key="id" class="card" bindtap="handleOpenCard" data-event-id="{{item.event && item.event.id ? item.event.id : ''}}">
        <view class="card__title">{{item.title}}</view>
        <view class="card__subtitle">{{item.subtitle || (item.event && item.event.displayName ? item.event.displayName : '暂无副标题')}}</view>
        <view class="card__meta">{{item.type}} / {{item.displaySlot}}</view>
      </view>
    </view>
  </view>
</scroll-view>
