event-prepare.wxml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <scroll-view class="page" scroll-y>
  2. <view class="shell">
  3. <view class="hero">
  4. <view class="hero__eyebrow">Prepare</view>
  5. <view class="hero__title">{{titleText}}</view>
  6. <view class="hero__desc">{{summaryText}}</view>
  7. </view>
  8. <view class="panel">
  9. <view class="panel__title">活动与发布</view>
  10. <view class="summary">Release:{{releaseText}}</view>
  11. <view class="summary">主动作:{{actionText}}</view>
  12. <view class="summary">状态:{{statusText}}</view>
  13. <view class="summary">赛道模式:{{variantModeText}}</view>
  14. <view class="summary">赛道摘要:{{variantSummaryText}}</view>
  15. <view class="summary">当前选择:{{selectedVariantText}}</view>
  16. </view>
  17. <view class="panel" wx:if="{{assignmentMode === 'manual' && selectableVariants.length}}">
  18. <view class="panel__title">赛道选择</view>
  19. <view class="summary">当前活动要求手动指定赛道。这里的选择会随 launch 一起带给后端,最终绑定以后端返回为准。</view>
  20. <view class="variant-list">
  21. <view wx:for="{{selectableVariants}}" wx:key="id" class="variant-card {{item.selected ? 'variant-card--active' : ''}}" data-variant-id="{{item.id}}" bindtap="handleSelectVariant">
  22. <view class="variant-card__main">
  23. <view class="variant-card__title-row">
  24. <text class="variant-card__name">{{item.name}}</text>
  25. <text class="variant-card__badge" wx:if="{{item.selected}}">已选中</text>
  26. </view>
  27. <text class="variant-card__meta">{{item.routeCodeText}}</text>
  28. <text class="variant-card__meta">{{item.descriptionText}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="panel">
  34. <view class="panel__title">设备准备</view>
  35. <view class="summary">这一页现在负责局前设备准备。定位权限先在这里确认,心率带支持先连后进图,地图内仍保留局中快速重连入口。</view>
  36. <view class="row">
  37. <view class="row__label">定位状态</view>
  38. <view class="row__value">{{locationStatusText}}</view>
  39. </view>
  40. <view class="summary" wx:if="{{locationPermissionGranted && !locationBackgroundPermissionGranted}}">已完成前台定位授权;如果后续需要后台持续定位,请在系统设置中补齐后台权限。</view>
  41. <view class="actions">
  42. <button class="btn btn--secondary" bindtap="handleRequestLocationPermission">申请定位权限</button>
  43. <button class="btn btn--ghost" bindtap="handleOpenLocationSettings">打开系统设置</button>
  44. </view>
  45. <view class="row">
  46. <view class="row__label">心率带</view>
  47. <view class="row__value">{{heartRateStatusText}}</view>
  48. </view>
  49. <view class="row">
  50. <view class="row__label">当前设备</view>
  51. <view class="row__value">{{heartRateDeviceText}}</view>
  52. </view>
  53. <view class="row">
  54. <view class="row__label">扫描状态</view>
  55. <view class="row__value">{{heartRateScanText}}</view>
  56. </view>
  57. <view class="row">
  58. <view class="row__label">模拟源</view>
  59. <view class="row__value">{{mockSourceStatusText}}</view>
  60. </view>
  61. <view class="actions">
  62. <button class="btn btn--secondary" bindtap="handleOpenHeartRateDevicePicker">选择设备</button>
  63. <button class="btn btn--ghost" bindtap="handlePrepareHeartRateConnect">重新扫描</button>
  64. <button class="btn btn--ghost" bindtap="handlePrepareHeartRateDisconnect">断开连接</button>
  65. <button class="btn btn--ghost" bindtap="handlePrepareHeartRateClearPreferred">清除首选</button>
  66. </view>
  67. </view>
  68. <view class="panel">
  69. <view class="panel__title">开始比赛</view>
  70. <view class="summary">这一页先承担局前准备壳子,后面会继续接定位权限、心率带局前连接和设备检查。</view>
  71. <view class="actions">
  72. <button class="btn btn--secondary" bindtap="handleBack">返回活动页</button>
  73. <button class="btn btn--ghost" bindtap="handleRefresh">刷新</button>
  74. <button class="btn btn--primary" bindtap="handleLaunch">进入地图</button>
  75. </view>
  76. </view>
  77. </view>
  78. <view wx:if="{{showHeartRateDevicePicker}}" class="picker-mask" bindtap="handleCloseHeartRateDevicePicker"></view>
  79. <view wx:if="{{showHeartRateDevicePicker}}" class="picker-sheet">
  80. <view class="picker-sheet__header">
  81. <view class="picker-sheet__title">选择心率带设备</view>
  82. <button class="picker-sheet__close" bindtap="handleCloseHeartRateDevicePicker">关闭</button>
  83. </view>
  84. <view class="summary">扫描状态:{{heartRateScanText}}</view>
  85. <view wx:if="{{!heartRateDiscoveredDevices.length}}" class="summary">当前还没有发现设备,可先点“重新扫描”。</view>
  86. <view wx:if="{{heartRateDiscoveredDevices.length}}" class="device-list">
  87. <view wx:for="{{heartRateDiscoveredDevices}}" wx:key="deviceId" class="device-card">
  88. <view class="device-card__main">
  89. <view class="device-card__title-row">
  90. <text class="device-card__name">{{item.name}}</text>
  91. <text class="device-card__badge" wx:if="{{item.preferred}}">首选</text>
  92. <text class="device-card__badge device-card__badge--active" wx:if="{{item.connected}}">已连接</text>
  93. </view>
  94. <text class="device-card__meta">{{item.rssiText}}</text>
  95. </view>
  96. <button class="btn {{item.connected ? 'btn--ghost' : 'btn--secondary'}} device-card__action" data-device-id="{{item.deviceId}}" bindtap="handlePrepareHeartRateDeviceConnect">{{item.connected ? '已连接' : '连接'}}</button>
  97. </view>
  98. </view>
  99. </view>
  100. </scroll-view>