优化发布确认与订单资金拆分
This commit is contained in:
@@ -67,6 +67,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
const publishAgreements = ref<ListingPublishAgreements>(emptyListingPublishAgreements)
|
||||
const virtualAssetSaleAgreementChecked = ref(false)
|
||||
const sellerAgreementChecked = ref(false)
|
||||
const passwordAndDeviceConfirmed = ref(false)
|
||||
const fileInput = ref<HTMLInputElement | null>(null)
|
||||
const activeUploadKey = ref<ScreenshotKey>('coin')
|
||||
const form = reactive<PublishForm>(defaultPublishForm())
|
||||
@@ -81,6 +82,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
const pageTitle = computed(() => (isEditMode.value ? '编辑账号' : '发布账号'))
|
||||
const submitButtonText = computed(() => (isEditMode.value ? '提交修改' : '立即发布'))
|
||||
const submitLoadingText = computed(() => (isEditMode.value ? '提交中...' : '发布中...'))
|
||||
const showBanRecordRiskHint = false
|
||||
|
||||
const pricing = usePricingCalculator({
|
||||
form,
|
||||
@@ -96,7 +98,10 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
)
|
||||
const requiredScreenshotCount = ref(0)
|
||||
const canPublishAfterAgreements = computed(
|
||||
() => virtualAssetSaleAgreementChecked.value && sellerAgreementChecked.value
|
||||
() =>
|
||||
virtualAssetSaleAgreementChecked.value &&
|
||||
sellerAgreementChecked.value &&
|
||||
passwordAndDeviceConfirmed.value
|
||||
)
|
||||
const disabledOnlineStartOptions = computed(() =>
|
||||
commonOnlineTimes.filter(time => !canUseOnlineStart(time))
|
||||
@@ -316,6 +321,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
selectedSkins.value = Object.values(skinGroups).flatMap(value => stringArray(value))
|
||||
virtualAssetSaleAgreementChecked.value = true
|
||||
sellerAgreementChecked.value = true
|
||||
passwordAndDeviceConfirmed.value = true
|
||||
hydrateScreenshotPreviews()
|
||||
}
|
||||
|
||||
@@ -328,6 +334,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
selectedSkins.value = []
|
||||
virtualAssetSaleAgreementChecked.value = false
|
||||
sellerAgreementChecked.value = false
|
||||
passwordAndDeviceConfirmed.value = false
|
||||
activeUploadKey.value = 'coin'
|
||||
|
||||
// Also re-initialize quantityValues to 0
|
||||
@@ -767,7 +774,10 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
if (!pricing.calculatedFinalPrice.value) return '请完善币数、保险、体力和负重后再发布'
|
||||
if (!Number.isFinite(pricing.calculatedFinalPrice.value))
|
||||
return '发布价格计算异常,请检查填写内容'
|
||||
if (!canPublishAfterAgreements.value) return '请先阅读并勾选两份发布协议'
|
||||
if (!virtualAssetSaleAgreementChecked.value || !sellerAgreementChecked.value) {
|
||||
return '请先阅读并勾选两份发布协议'
|
||||
}
|
||||
if (!passwordAndDeviceConfirmed.value) return '请确认已知晓打完需改密并清除登录设备'
|
||||
for (const item of pricing.screenshotSlots.value) {
|
||||
if (isScreenshotRequired(item) && getScreenshotCount(item.key) === 0)
|
||||
return `请上传${item.label}`
|
||||
@@ -931,7 +941,9 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
publishAgreements,
|
||||
virtualAssetSaleAgreementChecked,
|
||||
sellerAgreementChecked,
|
||||
passwordAndDeviceConfirmed,
|
||||
canPublishAfterAgreements,
|
||||
showBanRecordRiskHint,
|
||||
fileInput,
|
||||
activeUploadKey,
|
||||
form,
|
||||
|
||||
Reference in New Issue
Block a user