完善多赛道联调与全局产品架构

This commit is contained in:
2026-04-02 18:11:43 +08:00
parent 6964e26ec9
commit 0e28f70bad
45 changed files with 4819 additions and 282 deletions

View File

@@ -15,6 +15,17 @@ type HomePageData = {
cards: BackendCardResult[]
}
function formatSessionSummary(session?: BackendEntryHomeResult['ongoingSession'] | null): string {
if (!session) {
return '无'
}
const title = session.eventName || session.eventDisplayName || session.eventId || session.id || session.sessionId
const status = session.status || session.sessionStatus || '--'
const route = session.routeCode || session.variantName || '默认赛道'
return `${title} / ${status} / ${route}`
}
function requireAuthToken(): string | null {
const app = getApp<IAppOption>()
const tokens = app.globalData && app.globalData.backendAuthTokens
@@ -79,12 +90,8 @@ Page({
userNameText: result.user.nickname || result.user.publicId || result.user.id,
tenantText: `${result.tenant.name} (${result.tenant.code})`,
channelText: `${result.channel.displayName} / ${result.channel.code}`,
ongoingSessionText: result.ongoingSession
? `${result.ongoingSession.eventName || result.ongoingSession.eventDisplayName || result.ongoingSession.eventId || result.ongoingSession.id || result.ongoingSession.sessionId} / ${result.ongoingSession.status || result.ongoingSession.sessionStatus}`
: '无',
recentSessionText: result.recentSession
? `${result.recentSession.eventName || result.recentSession.eventDisplayName || result.recentSession.eventId || result.recentSession.id || result.recentSession.sessionId} / ${result.recentSession.status || result.recentSession.sessionStatus}`
: '无',
ongoingSessionText: formatSessionSummary(result.ongoingSession),
recentSessionText: formatSessionSummary(result.recentSession),
cards: result.cards || [],
})
},
@@ -110,7 +117,7 @@ Page({
handleOpenRecentResult() {
wx.navigateTo({
url: '/pages/result/result',
url: '/pages/results/results',
})
},