总价分开展示,展示纯币价格+额外消耗价格

This commit is contained in:
yml2213
2026-05-23 18:59:07 +08:00
parent d661a22b8a
commit 9cec71ab1a
3 changed files with 43 additions and 5 deletions
@@ -498,6 +498,17 @@
font-weight: 800;
}
.total-price-field :deep(.van-field__control) {
font-size: 16px;
}
.price-breakdown-hint {
margin: -2px 0 10px;
color: #858c96;
font-size: 11px;
line-height: 1.5;
}
.publish-actions {
display: grid;
grid-template-columns: 92px minmax(0, 1fr);
@@ -128,10 +128,13 @@ const screenshotUrls = computed(() =>
const coinMAmount = computed(() => Number(form.haf_coin_amount || 0));
const coinWanAmount = computed(() => coinMAmount.value * 100);
const calculatedRatio = computed(() => calculatePublishRatio());
const calculatedCoinBasePrice = computed(() =>
calculatedRatio.value > 0 ? roundMoney(coinWanAmount.value / calculatedRatio.value) : 0
);
const calculatedConsumablePrice = computed(() => calculateConsumablePrice());
const calculatedFinalPrice = computed(() =>
calculatedRatio.value > 0
? roundMoney(coinWanAmount.value / calculatedRatio.value + calculatedConsumablePrice.value)
? roundMoney(calculatedCoinBasePrice.value + calculatedConsumablePrice.value)
: 0
);
const calculatedRatioText = computed(() =>
@@ -439,12 +442,19 @@ function buildAssetSummary() {
secret_kd: form.secret_kd,
fire_level: Number(form.fire_level),
publish_ratio: calculatedRatio.value,
price_breakdown: {
coin_base_price: calculatedCoinBasePrice.value,
consumable_price: calculatedConsumablePrice.value,
final_price: calculatedFinalPrice.value,
ratio: calculatedRatio.value,
},
season_insurance: form.season_insurance,
stamina_level: form.stamina_level,
load_level: form.load_level,
resources: quantityItems.value.map((item) => ({
key: item.key,
label: item.label,
price: item.price,
quantity: Number(quantityValues[item.key] || 0),
mode: quantityModes[item.key] || "收费",
})),
@@ -921,18 +931,35 @@ function readError(error: unknown, fallback: string) {
</template>
</van-field>
<van-field
:model-value="calculatedFinalPrice ? `¥${calculatedFinalPrice}` : ''"
label="价"
:model-value="calculatedCoinBasePrice ? `¥${calculatedCoinBasePrice}` : ''"
label="纯币基础价"
readonly
required
:placeholder="priceConfig.price_placeholder"
class="publish-field result-field"
>
<template #label>
<span class="hint-label" :data-hint="priceConfig.price_placeholder" tabindex="0"></span>
<span class="hint-label" :data-hint="priceConfig.price_placeholder" tabindex="0">纯币基础</span>
</template>
</van-field>
<van-field
:model-value="`¥${calculatedConsumablePrice}`"
label="额外消耗品"
readonly
class="publish-field result-field"
/>
<van-field
:model-value="calculatedFinalPrice ? `¥${calculatedFinalPrice}` : ''"
label="发布总价"
readonly
required
:placeholder="priceConfig.price_placeholder"
class="publish-field result-field total-price-field"
/>
</div>
<p class="price-breakdown-hint">
发布总价 = 纯币基础价 + 额外消耗品只有标记为收费的消耗品会计入价格
</p>
<van-field
v-model="form.remark"