完善活动运营域与联调标准化
This commit is contained in:
@@ -10,6 +10,7 @@ type ResultsPageData = {
|
||||
statusText: string
|
||||
scoreText: string
|
||||
routeText: string
|
||||
runtimeText: string
|
||||
}>
|
||||
}
|
||||
|
||||
@@ -35,6 +36,18 @@ function formatRouteSummary(result: BackendSessionResultView): string {
|
||||
return '默认赛道'
|
||||
}
|
||||
|
||||
function formatRuntimeSummary(result: BackendSessionResultView): string {
|
||||
const runtime = result.session.runtime
|
||||
if (!runtime) {
|
||||
return '运行对象 --'
|
||||
}
|
||||
|
||||
const placeText = runtime.placeName || runtime.placeId || '--'
|
||||
const mapText = runtime.mapName || runtime.mapId || '--'
|
||||
const variantText = runtime.courseVariantId || result.session.variantName || result.session.variantId || '--'
|
||||
return `地点 ${placeText} / 地图 ${mapText} / 赛道 ${variantText}`
|
||||
}
|
||||
|
||||
function buildResultCardView(result: BackendSessionResultView) {
|
||||
return {
|
||||
sessionId: result.session.id,
|
||||
@@ -42,6 +55,7 @@ function buildResultCardView(result: BackendSessionResultView) {
|
||||
statusText: `${result.result.status} / ${result.session.status}`,
|
||||
scoreText: `得分 ${result.result.finalScore || '--'} / 用时 ${result.result.finalDurationSec || '--'}s`,
|
||||
routeText: `赛道 ${formatRouteSummary(result)}`,
|
||||
runtimeText: formatRuntimeSummary(result),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user