下赛季通行证选项 增加开关
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.next_season_pass_enabled"
|
||||
active-text="启用"
|
||||
inactive-text="关闭"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="最低烽火等级">
|
||||
<el-input-number
|
||||
v-model="publishOptionsDraft.fire_level_min"
|
||||
|
||||
@@ -99,6 +99,7 @@ export interface ListingPublishAgreements {
|
||||
}
|
||||
|
||||
export interface ListingPublishOptions {
|
||||
next_season_pass_enabled: boolean
|
||||
server_options: string[]
|
||||
face_options: string[]
|
||||
rank_options: string[]
|
||||
@@ -118,6 +119,7 @@ export interface ListingPublishOptions {
|
||||
}
|
||||
|
||||
export const emptyListingPublishOptions: ListingPublishOptions = {
|
||||
next_season_pass_enabled: false,
|
||||
server_options: [],
|
||||
face_options: [],
|
||||
rank_options: [],
|
||||
@@ -206,6 +208,7 @@ export function mergeListingPublishOptions(
|
||||
options?: Partial<ListingPublishOptions>
|
||||
): ListingPublishOptions {
|
||||
return {
|
||||
next_season_pass_enabled: options?.next_season_pass_enabled === true,
|
||||
server_options: normalizeStringList(options?.server_options),
|
||||
face_options: normalizeStringList(options?.face_options),
|
||||
rank_options: normalizeStringList(options?.rank_options),
|
||||
|
||||
@@ -79,6 +79,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
const submitButtonText = computed(() => (isEditMode.value ? '提交修改' : '立即发布'))
|
||||
const submitLoadingText = computed(() => (isEditMode.value ? '提交中...' : '发布中...'))
|
||||
const showBanRecordRiskHint = false
|
||||
const nextSeasonPassEnabled = computed(() => publishOptions.value.next_season_pass_enabled)
|
||||
|
||||
const pricing = usePricingCalculator({
|
||||
form,
|
||||
@@ -724,7 +725,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.next_season_pass) return '请选择下赛季是否购买通行证'
|
||||
if (nextSeasonPassEnabled.value && !form.next_season_pass) {
|
||||
return '请选择下赛季是否购买通行证'
|
||||
}
|
||||
if (form.depositAmountYuan === '' || Number(form.depositAmountYuan) < 0) return '请填写押金'
|
||||
if (!Number.isFinite(Number(form.depositAmountYuan))) return '押金格式不正确'
|
||||
if (
|
||||
@@ -919,6 +922,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
passwordAndDeviceConfirmed,
|
||||
canPublishAfterAgreements,
|
||||
showBanRecordRiskHint,
|
||||
nextSeasonPassEnabled,
|
||||
isScanOnlyServer,
|
||||
effectiveLoginMethodOptions,
|
||||
fileInput,
|
||||
|
||||
@@ -27,6 +27,7 @@ const {
|
||||
passwordAndDeviceConfirmed,
|
||||
canPublishAfterAgreements,
|
||||
showBanRecordRiskHint,
|
||||
nextSeasonPassEnabled,
|
||||
fileInput,
|
||||
activeUploadKey,
|
||||
form,
|
||||
@@ -441,7 +442,12 @@ const screenshotGuides: Record<string, string> = {
|
||||
</template>
|
||||
</van-field>
|
||||
|
||||
<van-field label="下赛季是否购买通行证" required class="publish-field">
|
||||
<van-field
|
||||
v-if="nextSeasonPassEnabled"
|
||||
label="下赛季是否购买通行证"
|
||||
required
|
||||
class="publish-field"
|
||||
>
|
||||
<template #input>
|
||||
<div class="radio-group">
|
||||
<button
|
||||
|
||||
@@ -28,6 +28,7 @@ const {
|
||||
passwordAndDeviceConfirmed,
|
||||
canPublishAfterAgreements,
|
||||
showBanRecordRiskHint,
|
||||
nextSeasonPassEnabled,
|
||||
fileInput,
|
||||
activeUploadKey,
|
||||
form,
|
||||
@@ -357,7 +358,7 @@ function selectDailyLoss(value: string | number) {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="field-row panel-field-row">
|
||||
<div v-if="nextSeasonPassEnabled" class="field-row panel-field-row">
|
||||
<label>下赛季是否购买通行证<span>*</span></label>
|
||||
<OptionChips
|
||||
:options="nextSeasonPassOptions"
|
||||
|
||||
Reference in New Issue
Block a user