feat(publish): 德穆兰选项支持后台开关并默认打开下赛季通行证
This commit is contained in:
@@ -294,6 +294,13 @@ async function handleSave() {
|
||||
<div class="editor-block-title">
|
||||
<strong>发布规则</strong>
|
||||
</div>
|
||||
<el-form-item label="是否解锁德穆兰选项">
|
||||
<el-switch
|
||||
v-model="publishOptionsDraft.unlock_demulan_enabled"
|
||||
active-text="启用"
|
||||
inactive-text="关闭"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="下赛季通行证选项">
|
||||
<el-switch
|
||||
v-model="publishOptionsDraft.next_season_pass_enabled"
|
||||
|
||||
@@ -99,6 +99,8 @@ export interface ListingPublishAgreements {
|
||||
}
|
||||
|
||||
export interface ListingPublishOptions {
|
||||
/** 发布页是否展示「是否解锁德穆兰」选项 */
|
||||
unlock_demulan_enabled: boolean
|
||||
next_season_pass_enabled: boolean
|
||||
server_options: string[]
|
||||
face_options: string[]
|
||||
@@ -119,6 +121,7 @@ export interface ListingPublishOptions {
|
||||
}
|
||||
|
||||
export const emptyListingPublishOptions: ListingPublishOptions = {
|
||||
unlock_demulan_enabled: false,
|
||||
next_season_pass_enabled: false,
|
||||
server_options: [],
|
||||
face_options: [],
|
||||
@@ -208,6 +211,7 @@ export function mergeListingPublishOptions(
|
||||
options?: Partial<ListingPublishOptions>
|
||||
): ListingPublishOptions {
|
||||
return {
|
||||
unlock_demulan_enabled: options?.unlock_demulan_enabled === true,
|
||||
next_season_pass_enabled: options?.next_season_pass_enabled === true,
|
||||
server_options: normalizeStringList(options?.server_options),
|
||||
face_options: normalizeStringList(options?.face_options),
|
||||
|
||||
@@ -84,6 +84,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
const submitButtonText = computed(() => (isEditMode.value ? '提交修改' : '立即发布'))
|
||||
const submitLoadingText = computed(() => (isEditMode.value ? '提交中...' : '发布中...'))
|
||||
const showBanRecordRiskHint = false
|
||||
const unlockDemulanEnabled = computed(() => publishOptions.value.unlock_demulan_enabled)
|
||||
const nextSeasonPassEnabled = computed(() => publishOptions.value.next_season_pass_enabled)
|
||||
|
||||
const pricing = usePricingCalculator({
|
||||
@@ -734,7 +735,9 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
if (pricing.banRecordOptions.value.length && !form.ban_record) return '请选择封禁记录'
|
||||
if (!form.can_change_game_name) return '请选择是否可以修改游戏名'
|
||||
if (!form.all_hero) return '请选择是否有全英雄'
|
||||
if (!form.unlock_demulan) return '请选择是否解锁德穆兰'
|
||||
if (unlockDemulanEnabled.value && !form.unlock_demulan) {
|
||||
return '请选择是否解锁德穆兰'
|
||||
}
|
||||
if (nextSeasonPassEnabled.value && !form.next_season_pass) {
|
||||
return '请选择下赛季是否购买通行证'
|
||||
}
|
||||
@@ -934,6 +937,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
passwordAndDeviceConfirmed,
|
||||
canPublishAfterAgreements,
|
||||
showBanRecordRiskHint,
|
||||
unlockDemulanEnabled,
|
||||
nextSeasonPassEnabled,
|
||||
isScanOnlyServer,
|
||||
effectiveLoginMethodOptions,
|
||||
|
||||
@@ -27,6 +27,7 @@ const {
|
||||
passwordAndDeviceConfirmed,
|
||||
canPublishAfterAgreements,
|
||||
showBanRecordRiskHint,
|
||||
unlockDemulanEnabled,
|
||||
nextSeasonPassEnabled,
|
||||
fileInput,
|
||||
activeUploadKey,
|
||||
@@ -444,7 +445,12 @@ const screenshotGuides: Record<string, string> = {
|
||||
</template>
|
||||
</van-field>
|
||||
|
||||
<van-field label="是否解锁德穆兰" required class="publish-field">
|
||||
<van-field
|
||||
v-if="unlockDemulanEnabled"
|
||||
label="是否解锁德穆兰"
|
||||
required
|
||||
class="publish-field"
|
||||
>
|
||||
<template #input>
|
||||
<div class="radio-group">
|
||||
<button
|
||||
|
||||
@@ -28,6 +28,7 @@ const {
|
||||
passwordAndDeviceConfirmed,
|
||||
canPublishAfterAgreements,
|
||||
showBanRecordRiskHint,
|
||||
unlockDemulanEnabled,
|
||||
nextSeasonPassEnabled,
|
||||
fileInput,
|
||||
activeUploadKey,
|
||||
@@ -360,7 +361,7 @@ function selectDailyLoss(value: string | number) {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="field-row panel-field-row">
|
||||
<div v-if="unlockDemulanEnabled" class="field-row panel-field-row">
|
||||
<label>是否解锁德穆兰<span>*</span></label>
|
||||
<OptionChips
|
||||
:options="demulanUnlockOptions"
|
||||
|
||||
Reference in New Issue
Block a user