feat(admin-listing): 商品管理列表在租金/押金左侧展示号主纯币价格
- listingDisplay 新增 getListingSellerCoinPrice,读取价格快照 seller_coin_base_price (号主收号价中的纯币部分,不含额外消耗品) - 商品管理表格新增「纯币价格」列并置于「租金/押金」左侧,悬停显示完整说明 - 快照缺失(旧数据/无定价快照)时展示 -,与相邻列风格一致 - PNG 导出列定义同步新增该列,保持导出与页面一致 - 补 listingDisplay 单测:纯币价读取、消耗品单独计价时与号主总价区分、缺快照兜底
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
formatRatio,
|
||||
getCoinWan,
|
||||
getDailyLoss,
|
||||
getListingSellerCoinPrice,
|
||||
getResourceQuantity,
|
||||
getSkinGroup,
|
||||
} from '@/shared/utils/listingDisplay'
|
||||
@@ -135,6 +136,7 @@ const screenshotColumns = [
|
||||
read: (row: Listing) => characterAndWeaponSkinText(row),
|
||||
},
|
||||
{ label: '号主备注', width: 160, read: (row: Listing) => ownerRemarkText(row) },
|
||||
{ label: '纯币价格', width: 90, read: (row: Listing) => ownerPureCoinPriceText(row) },
|
||||
{ label: '租金/押金', width: 96, read: (row: Listing) => rentAndDepositText(row) },
|
||||
{ label: '比例', width: 64, read: (row: Listing) => formatRatio(row) },
|
||||
{
|
||||
@@ -599,6 +601,13 @@ function rentAndDepositText(row: Listing) {
|
||||
return `${listingPrice(row)}/${formatCentWithSymbol(row.deposit_amount_cent)}`
|
||||
}
|
||||
|
||||
// 号主纯币价格:号主收号价里的纯币部分(不含额外消耗品),取自发布时固化的价格快照。
|
||||
function ownerPureCoinPriceText(row: Listing) {
|
||||
const price = getListingSellerCoinPrice(row)
|
||||
if (price <= 0) return '-'
|
||||
return formatCentWithSymbol(Math.round(price * 100))
|
||||
}
|
||||
|
||||
function estimateTitle(row: Listing) {
|
||||
const dailyLoss = getDailyLoss(row)
|
||||
return dailyLoss ? `按哈夫币 ${listingCoinM(row)}、日耗 ${dailyLoss} 估算` : '未配置日耗'
|
||||
@@ -965,6 +974,14 @@ function formatQuantity(value: number) {
|
||||
<el-table-column label="号主备注" min-width="150">
|
||||
<template #default="{ row }">{{ ownerRemarkText(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="纯币价格" width="90">
|
||||
<template #default="{ row }">
|
||||
<span :title="`号主纯币价格(不含消耗品)${ownerPureCoinPriceText(row)}`">
|
||||
{{ ownerPureCoinPriceText(row) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="租金/押金" width="90">
|
||||
<template #default="{ row }">{{ rentAndDepositText(row) }}</template>
|
||||
</el-table-column>
|
||||
|
||||
Reference in New Issue
Block a user