替换游戏名修改属性

This commit is contained in:
yml2213
2026-08-16 18:55:26 +08:00
parent d2429618f4
commit 786d20e9cd
8 changed files with 26 additions and 20 deletions
@@ -98,7 +98,7 @@ const primaryRows = computed(() => {
{ label: '方便上号时段', value: formatOnlineTime(a.online_time) },
{ label: '常用登录地', value: regions.length ? regions.join('、') : '--' },
{ label: '人脸归属', value: formatScalar(a.face_owner) },
{ label: '是否解锁赛季', value: formatScalar(a.unlock_said) },
{ label: '是否可以修改游戏名', value: formatScalar(a.can_change_game_name) },
{
label: '封禁记录',
value: formatScalar(a.ban_record) === '--' ? '无' : formatScalar(a.ban_record),
@@ -141,6 +141,7 @@ const extraRows = computed(() => {
'skin_groups',
'screenshot_groups',
'online_time',
'can_change_game_name',
'unlock_said',
'ban_record',
'common_regions',
@@ -17,7 +17,7 @@ export function defaultPublishForm(): PublishForm {
login_method: '',
online_start: '',
online_end: '',
unlock_said: '',
can_change_game_name: '',
all_hero: '',
ban_record: '',
common_regions: [],
@@ -308,7 +308,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
login_method: listing.login_platform || '',
online_start: stringValue(onlineTime.start),
online_end: stringValue(onlineTime.end),
unlock_said: stringValue(summary.unlock_said),
can_change_game_name: stringValue(summary.can_change_game_name),
all_hero: stringValue(summary.all_hero),
ban_record: stringValue(summary.ban_record),
common_regions: stringArray(summary.common_regions),
@@ -717,7 +717,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
}
}
if (pricing.banRecordOptions.value.length && !form.ban_record) return '请选择封禁记录'
if (!form.unlock_said) return '请选择是否解锁赛伊德'
if (!form.can_change_game_name) return '请选择是否可以修改游戏名'
if (!form.all_hero) return '请选择是否有全英雄'
if (form.depositAmountYuan === '' || Number(form.depositAmountYuan) < 0) return '请填写押金'
if (!Number.isFinite(Number(form.depositAmountYuan))) return '押金格式不正确'
@@ -818,7 +818,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
start: form.online_start,
end: form.online_end,
},
unlock_said: form.unlock_said,
can_change_game_name: form.can_change_game_name,
all_hero: form.all_hero,
ban_record: form.ban_record,
common_regions: form.common_regions,
@@ -119,7 +119,7 @@ function selectRadio<T extends string>(value: T, setter: (value: T) => void) {
setter(value)
}
const unlockSaidOptions = ['是', '否']
const canChangeGameNameOptions = ['是', '否']
const allHeroOptions = ['是', '否']
// 在线时间:通栏自定义块 + 底部时间选择,避免 van-field 窄列截断原生 time
@@ -405,16 +405,16 @@ const screenshotGuides: Record<string, string> = {
}}
</p>
<van-field label="解锁赛伊德" required class="publish-field">
<van-field label="是否可以修改游戏名" required class="publish-field">
<template #input>
<div class="radio-group">
<button
v-for="opt in unlockSaidOptions"
v-for="opt in canChangeGameNameOptions"
:key="opt"
type="button"
class="radio-btn"
:class="{ active: form.unlock_said === opt }"
@click="selectRadio(opt, value => (form.unlock_said = value))"
:class="{ active: form.can_change_game_name === opt }"
@click="selectRadio(opt, value => (form.can_change_game_name = value))"
>
{{ opt }}
</button>
@@ -102,6 +102,10 @@
color: var(--color-danger);
}
.can-change-game-name-row > label {
white-space: nowrap;
}
.field-hint {
grid-column: 2;
margin: 0;
@@ -118,7 +118,7 @@ const activeAgreement = ref<AgreementContent | null>(null)
const activeAgreementTitle = computed(() => activeAgreement.value?.title || '协议内容')
const activeAgreementContent = computed(() => activeAgreement.value?.content || '')
const unlockSaidOptions = ['是', '否']
const canChangeGameNameOptions = ['是', '否']
const allHeroOptions = ['是', '否']
// 截图槽位的指导示例图(仅展示、点击放大,不占用上传数量)
@@ -337,12 +337,12 @@ function selectDailyLoss(value: string | number) {
</p>
</div>
<div class="field-row panel-field-row">
<label>解锁赛伊德<span>*</span></label>
<div class="field-row panel-field-row can-change-game-name-row">
<label>是否可以修改游戏名<span>*</span></label>
<OptionChips
:options="unlockSaidOptions"
:model-value="form.unlock_said"
@select="form.unlock_said = String($event)"
:options="canChangeGameNameOptions"
:model-value="form.can_change_game_name"
@select="form.can_change_game_name = String($event)"
/>
</div>
+2 -1
View File
@@ -15,7 +15,8 @@ export type PublishForm = {
login_method: string
online_start: string
online_end: string
unlock_said: string
/** 是否可以修改游戏名(是/否) */
can_change_game_name: string
/** 是否有全英雄(是/否) */
all_hero: string
ban_record: string
+3 -3
View File
@@ -150,9 +150,9 @@ export function getListingChips(item: Listing): ListingDisplayChip[] {
if (online) {
chips.push({ label: '方便上号', value: online })
}
// 解锁赛伊德为必选项,仅在号主勾选「是」时展示
if (readAssetString(item, 'unlock_said') === '是') {
chips.push({ label: '解锁赛伊德', value: '是' })
// 仅在号主确认可修改游戏名时展示
if (readAssetString(item, 'can_change_game_name') === '是') {
chips.push({ label: '可修改游戏名', value: '是' })
}
// 全英雄为必选项,仅在号主勾选「是」时展示
if (readAssetString(item, 'all_hero') === '是') {