完善多赛道联调与全局产品架构
This commit is contained in:
@@ -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',
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user