feat(listing): 展示保险后预计到手价

This commit is contained in:
yml2213
2026-11-04 21:36:13 +08:00
parent 12e9b6d0b2
commit 6355ca21b0
7 changed files with 222 additions and 3 deletions
@@ -37,7 +37,12 @@ import {
} from '@/features/seller/composables/usePublishDraft'
import type { PublishForm } from '@/shared/types/publish'
import { yuanToCent } from '@/shared/utils/money'
import { dailyLossOptions, formatNumber, roundRatio } from '@/shared/utils/pricing'
import {
calculateInsuranceFeeAmount,
dailyLossOptions,
formatNumber,
roundRatio,
} from '@/shared/utils/pricing'
import { useDistributionSiteStore } from '@/stores/distributionSite'
const draftSaveDelay = 400
@@ -113,6 +118,14 @@ export function usePublishForm(options: UsePublishFormOptions) {
receiveCostDelta,
isQualityOwner,
})
const calculatedInsuranceFee = computed(() =>
form.compensation_plan === 'insurance'
? calculateInsuranceFeeAmount(pricing.calculatedSellerPrice.value, insuranceFeeBps.value)
: 0
)
const calculatedTakeHomePrice = computed(() =>
Math.max(pricing.calculatedSellerPrice.value - calculatedInsuranceFee.value, 0)
)
const qualityOwnerSaleRatioSelected = computed(
() =>
isQualityOwner.value &&
@@ -1033,6 +1046,8 @@ export function usePublishForm(options: UsePublishFormOptions) {
isQualityOwnerExclusiveRatioActive,
insuranceFeeBps,
insuranceFeePercent,
calculatedInsuranceFee,
calculatedTakeHomePrice,
virtualAssetSaleAgreementChecked,
sellerAgreementChecked,
passwordAndDeviceConfirmed,