feat(seller): 发布账号新增是否有全英雄必填字段,详情页展示

This commit is contained in:
yml2213
2026-08-15 13:32:01 +08:00
parent 429ce74eff
commit 096121a8cd
6 changed files with 38 additions and 0 deletions
@@ -18,6 +18,7 @@ export function defaultPublishForm(): PublishForm {
online_start: '', online_start: '',
online_end: '', online_end: '',
unlock_said: '', unlock_said: '',
all_hero: '',
ban_record: '', ban_record: '',
common_regions: [], common_regions: [],
depositAmountYuan: '', depositAmountYuan: '',
@@ -309,6 +309,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
online_start: stringValue(onlineTime.start), online_start: stringValue(onlineTime.start),
online_end: stringValue(onlineTime.end), online_end: stringValue(onlineTime.end),
unlock_said: stringValue(summary.unlock_said), unlock_said: stringValue(summary.unlock_said),
all_hero: stringValue(summary.all_hero),
ban_record: stringValue(summary.ban_record), ban_record: stringValue(summary.ban_record),
common_regions: stringArray(summary.common_regions), common_regions: stringArray(summary.common_regions),
depositAmountYuan: listing.deposit_amount_cent > 0 ? listing.deposit_amount_cent / 100 : '', depositAmountYuan: listing.deposit_amount_cent > 0 ? listing.deposit_amount_cent / 100 : '',
@@ -717,6 +718,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
} }
if (pricing.banRecordOptions.value.length && !form.ban_record) return '请选择封禁记录' if (pricing.banRecordOptions.value.length && !form.ban_record) return '请选择封禁记录'
if (!form.unlock_said) return '请选择是否解锁赛伊德' if (!form.unlock_said) return '请选择是否解锁赛伊德'
if (!form.all_hero) return '请选择是否有全英雄'
if (form.depositAmountYuan === '' || Number(form.depositAmountYuan) < 0) return '请填写押金' if (form.depositAmountYuan === '' || Number(form.depositAmountYuan) < 0) return '请填写押金'
if (!Number.isFinite(Number(form.depositAmountYuan))) return '押金格式不正确' if (!Number.isFinite(Number(form.depositAmountYuan))) return '押金格式不正确'
if ( if (
@@ -817,6 +819,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
end: form.online_end, end: form.online_end,
}, },
unlock_said: form.unlock_said, unlock_said: form.unlock_said,
all_hero: form.all_hero,
ban_record: form.ban_record, ban_record: form.ban_record,
common_regions: form.common_regions, common_regions: form.common_regions,
remark: form.remark, remark: form.remark,
@@ -120,6 +120,7 @@ function selectRadio<T extends string>(value: T, setter: (value: T) => void) {
} }
const unlockSaidOptions = ['是', '否'] const unlockSaidOptions = ['是', '否']
const allHeroOptions = ['是', '否']
// 在线时间:通栏自定义块 + 底部时间选择,避免 van-field 窄列截断原生 time // 在线时间:通栏自定义块 + 底部时间选择,避免 van-field 窄列截断原生 time
const onlineTimePickerVisible = ref(false) const onlineTimePickerVisible = ref(false)
@@ -421,6 +422,23 @@ const screenshotGuides: Record<string, string> = {
</template> </template>
</van-field> </van-field>
<van-field label="是否有全英雄" required class="publish-field">
<template #input>
<div class="radio-group">
<button
v-for="opt in allHeroOptions"
:key="opt"
type="button"
class="radio-btn"
:class="{ active: form.all_hero === opt }"
@click="selectRadio(opt, value => (form.all_hero = value))"
>
{{ opt }}
</button>
</div>
</template>
</van-field>
<div class="online-time-block"> <div class="online-time-block">
<div class="online-time-head"> <div class="online-time-head">
<div class="online-time-title"> <div class="online-time-title">
@@ -119,6 +119,7 @@ const activeAgreementTitle = computed(() => activeAgreement.value?.title || '协
const activeAgreementContent = computed(() => activeAgreement.value?.content || '') const activeAgreementContent = computed(() => activeAgreement.value?.content || '')
const unlockSaidOptions = ['是', '否'] const unlockSaidOptions = ['是', '否']
const allHeroOptions = ['是', '否']
// 截图槽位的指导示例图(仅展示、点击放大,不占用上传数量) // 截图槽位的指导示例图(仅展示、点击放大,不占用上传数量)
const screenshotGuides: Record<string, string> = { const screenshotGuides: Record<string, string> = {
@@ -345,6 +346,15 @@ function selectDailyLoss(value: string | number) {
/> />
</div> </div>
<div class="field-row panel-field-row">
<label>是否有全英雄<span>*</span></label>
<OptionChips
:options="allHeroOptions"
:model-value="form.all_hero"
@select="form.all_hero = String($event)"
/>
</div>
<div class="field-row panel-field-row online-time-row"> <div class="field-row panel-field-row online-time-row">
<label>在线时间<span>*</span></label> <label>在线时间<span>*</span></label>
<div class="online-time-body"> <div class="online-time-body">
+2
View File
@@ -16,6 +16,8 @@ export type PublishForm = {
online_start: string online_start: string
online_end: string online_end: string
unlock_said: string unlock_said: string
/** 是否有全英雄(是/否) */
all_hero: string
ban_record: string ban_record: string
common_regions: string[] common_regions: string[]
depositAmountYuan: number | '' depositAmountYuan: number | ''
@@ -154,6 +154,10 @@ export function getListingChips(item: Listing): ListingDisplayChip[] {
if (readAssetString(item, 'unlock_said') === '是') { if (readAssetString(item, 'unlock_said') === '是') {
chips.push({ label: '解锁赛伊德', value: '是' }) chips.push({ label: '解锁赛伊德', value: '是' })
} }
// 全英雄为必选项,仅在号主勾选「是」时展示
if (readAssetString(item, 'all_hero') === '是') {
chips.push({ label: '全英雄', value: '是' })
}
return chips.filter(chip => chip.value) return chips.filter(chip => chip.value)
} }