完善活动运营域与联调标准化
This commit is contained in:
@@ -11,6 +11,8 @@ type EventPageData = {
|
||||
statusText: string
|
||||
variantModeText: string
|
||||
variantSummaryText: string
|
||||
presentationText: string
|
||||
contentBundleText: string
|
||||
}
|
||||
|
||||
function formatAssignmentMode(mode?: string | null): string {
|
||||
@@ -38,6 +40,30 @@ function formatVariantSummary(result: BackendEventPlayResult): string {
|
||||
return `${variants.length} 条赛道,可选 ${selectable.length} 条:${preview}${suffix}`
|
||||
}
|
||||
|
||||
function formatPresentationSummary(result: BackendEventPlayResult): string {
|
||||
const currentPresentation = result.currentPresentation
|
||||
if (!currentPresentation) {
|
||||
return '当前未声明展示版本'
|
||||
}
|
||||
|
||||
const presentationId = currentPresentation.presentationId || '--'
|
||||
const templateKey = currentPresentation.templateKey || '--'
|
||||
const version = currentPresentation.version || '--'
|
||||
return `${presentationId} / ${templateKey} / ${version}`
|
||||
}
|
||||
|
||||
function formatContentBundleSummary(result: BackendEventPlayResult): string {
|
||||
const currentContentBundle = result.currentContentBundle
|
||||
if (!currentContentBundle) {
|
||||
return '当前未声明内容包版本'
|
||||
}
|
||||
|
||||
const bundleId = currentContentBundle.bundleId || '--'
|
||||
const bundleType = currentContentBundle.bundleType || '--'
|
||||
const version = currentContentBundle.version || '--'
|
||||
return `${bundleId} / ${bundleType} / ${version}`
|
||||
}
|
||||
|
||||
function getAccessToken(): string | null {
|
||||
const app = getApp<IAppOption>()
|
||||
const tokens = app.globalData && app.globalData.backendAuthTokens
|
||||
@@ -57,6 +83,8 @@ Page({
|
||||
statusText: '待加载',
|
||||
variantModeText: '--',
|
||||
variantSummaryText: '--',
|
||||
presentationText: '--',
|
||||
contentBundleText: '--',
|
||||
} as EventPageData,
|
||||
|
||||
onLoad(query: { eventId?: string }) {
|
||||
@@ -112,6 +140,8 @@ Page({
|
||||
statusText: result.play.canLaunch ? '可启动' : '当前不可启动',
|
||||
variantModeText: formatAssignmentMode(result.play.assignmentMode),
|
||||
variantSummaryText: formatVariantSummary(result),
|
||||
presentationText: formatPresentationSummary(result),
|
||||
contentBundleText: formatContentBundleSummary(result),
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
<view class="summary">状态:{{statusText}}</view>
|
||||
<view class="summary">赛道模式:{{variantModeText}}</view>
|
||||
<view class="summary">赛道摘要:{{variantSummaryText}}</view>
|
||||
<view class="summary">展示版本:{{presentationText}}</view>
|
||||
<view class="summary">内容包版本:{{contentBundleText}}</view>
|
||||
<view class="actions">
|
||||
<button class="btn btn--secondary" bindtap="handleRefresh">刷新</button>
|
||||
<button class="btn btn--primary" bindtap="handleLaunch">前往准备页</button>
|
||||
|
||||
Reference in New Issue
Block a user