feat(listing): 展示保险后预计到手价
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user