优化发布确认与订单资金拆分

This commit is contained in:
yml2213
2026-06-24 01:57:03 +08:00
parent 86a136e663
commit c30914b538
4 changed files with 83 additions and 27 deletions
@@ -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,
@@ -23,7 +23,9 @@ const {
publishAgreements,
virtualAssetSaleAgreementChecked,
sellerAgreementChecked,
passwordAndDeviceConfirmed,
canPublishAfterAgreements,
showBanRecordRiskHint,
fileInput,
activeUploadKey,
form,
@@ -474,6 +476,9 @@ const screenshotGuides: Record<string, string> = {
</div>
</template>
</van-field>
<p v-if="showBanRecordRiskHint && banRecordOptions.length" class="field-hint">
刚出租结算完的账号需冷号七天才可再次出租IP频繁变动会导致封号
</p>
<div class="region-panel">
<div class="region-title">
@@ -744,6 +749,9 @@ const screenshotGuides: Record<string, string> = {
</button>
</span>
</van-checkbox>
<van-checkbox v-model="passwordAndDeviceConfirmed" icon-size="18px">
<span class="agreement-check-label">我已知晓打完需改密并清除登录设备</span>
</van-checkbox>
</div>
<div class="publish-actions">
@@ -26,7 +26,9 @@ const {
publishAgreements,
virtualAssetSaleAgreementChecked,
sellerAgreementChecked,
passwordAndDeviceConfirmed,
canPublishAfterAgreements,
showBanRecordRiskHint,
fileInput,
activeUploadKey,
form,
@@ -414,6 +416,9 @@ function selectDailyLoss(value: string | number) {
@select="form.ban_record = String($event)"
/>
</div>
<p v-if="showBanRecordRiskHint && banRecordOptions.length" class="field-hint">
刚出租结算完的账号需冷号七天才可再次出租IP频繁变动会导致封号
</p>
<div v-if="regionOptions.length" class="region-panel login-region-panel">
<div class="region-title">
@@ -702,6 +707,9 @@ function selectDailyLoss(value: string | number) {
</button>
</span>
</el-checkbox>
<el-checkbox v-model="passwordAndDeviceConfirmed">
<span class="agreement-check-label">我已知晓打完需改密并清除登录设备</span>
</el-checkbox>
</div>
<div class="summary-actions">
<el-button