feat(distribution): 分站可下调收号比例且不超过主站上限
让分销站能按自身能力下调收号比例扩大利润,同时把主站回收比例作为硬边界,避免分站把比例加得比主站更高。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -34,6 +34,7 @@ import {
|
||||
import type { PublishForm } from '@/shared/types/publish'
|
||||
import { yuanToCent } from '@/shared/utils/money'
|
||||
import { dailyLossOptions, formatNumber, roundRatio } from '@/shared/utils/pricing'
|
||||
import { useDistributionSiteStore } from '@/stores/distributionSite'
|
||||
|
||||
const draftSaveDelay = 400
|
||||
const multiScreenshotLimit = 3
|
||||
@@ -54,6 +55,9 @@ interface UsePublishFormOptions {
|
||||
export function usePublishForm(options: UsePublishFormOptions) {
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const siteStore = useDistributionSiteStore()
|
||||
const isDistribution = computed(() => siteStore.isDistribution)
|
||||
const receiveRatioDelta = computed(() => Number(siteStore.receiveRatioDelta || 0))
|
||||
const loading = ref(false)
|
||||
const uploading = ref(false)
|
||||
const suppressDraftSave = ref(false)
|
||||
@@ -89,6 +93,8 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
quantityModes,
|
||||
screenshotFiles,
|
||||
selectedSkins,
|
||||
isDistribution,
|
||||
receiveRatioDelta,
|
||||
})
|
||||
|
||||
// ========== 上号方式互斥 ==========
|
||||
@@ -911,6 +917,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
|
||||
return {
|
||||
...pricing,
|
||||
isDistribution,
|
||||
dailyLossOptions,
|
||||
formatNumber,
|
||||
router,
|
||||
|
||||
Reference in New Issue
Block a user