修复定价错误

This commit is contained in:
yml2213
2026-05-23 22:31:27 +08:00
parent 78257097f1
commit e082921fa6
6 changed files with 273 additions and 78 deletions
@@ -36,7 +36,16 @@ async function offline(id: number) {
}
function listingPrice(row: Listing) {
return `¥${Number(row.price_daily || row.price_hourly || 0).toFixed(2)}`
return `¥${readSellerPrice(row).toFixed(2)}`
}
function readSellerPrice(row: Listing) {
const breakdown = row.asset_summary?.price_breakdown
if (typeof breakdown === 'object' && breakdown !== null) {
const price = Number((breakdown as Record<string, unknown>).seller_total_price)
if (Number.isFinite(price) && price > 0) return price
}
return Number(row.price_daily || row.price_hourly || 0)
}
</script>