特惠标签ok
This commit is contained in:
@@ -20,6 +20,7 @@ export interface Listing {
|
||||
price_daily: number
|
||||
price_weekly: number
|
||||
deposit_amount: number
|
||||
is_accelerated_sale?: boolean
|
||||
status: string
|
||||
review_status: string
|
||||
review_reason: string
|
||||
|
||||
@@ -401,10 +401,17 @@
|
||||
object-position: center;
|
||||
}
|
||||
|
||||
.card-cover em {
|
||||
.card-cover-labels {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
right: 7px;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.card-cover-labels em {
|
||||
border-radius: 999px;
|
||||
background: #ffd21e;
|
||||
color: #1f2937;
|
||||
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
getResourceQuantity,
|
||||
getServerRegion,
|
||||
getSkinGroup,
|
||||
hasAcceleratedSaleRatio,
|
||||
hasGiftResources,
|
||||
readAssetNumber,
|
||||
readAssetString,
|
||||
@@ -450,7 +451,13 @@ function uniqueOptions(values: string[]) {
|
||||
:alt="getListingTitle(item)"
|
||||
/>
|
||||
<span v-else>图</span>
|
||||
<em v-if="hasGiftResources(item)">有赠送</em>
|
||||
<div
|
||||
v-if="hasGiftResources(item) || hasAcceleratedSaleRatio(item)"
|
||||
class="card-cover-labels"
|
||||
>
|
||||
<em v-if="hasGiftResources(item)">有赠送</em>
|
||||
<em v-if="hasAcceleratedSaleRatio(item)">特惠</em>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-main">
|
||||
<div class="card-title-row">
|
||||
|
||||
@@ -122,6 +122,21 @@ export function hasGiftResources(item: Listing) {
|
||||
return getListingResources(item).some((resource) => resource.mode === "赠送");
|
||||
}
|
||||
|
||||
export function hasAcceleratedSaleRatio(item: Listing) {
|
||||
if (item.is_accelerated_sale) return true;
|
||||
|
||||
const priceBreakdown = item.asset_summary?.price_breakdown;
|
||||
if (typeof priceBreakdown !== "object" || priceBreakdown === null) return false;
|
||||
|
||||
const row = priceBreakdown as Record<string, unknown>;
|
||||
const referenceRatio = readUnknownNumber(row.seller_reference_ratio);
|
||||
const sellerRatio = readUnknownNumber(row.seller_ratio);
|
||||
const acceleratedRatio = readUnknownNumber(row.accelerated_sale_ratio);
|
||||
|
||||
if (referenceRatio <= 0) return false;
|
||||
return sellerRatio > referenceRatio || acceleratedRatio > referenceRatio;
|
||||
}
|
||||
|
||||
export function getSkinGroup(item: Listing, groupKey: string) {
|
||||
const skinGroups = item.asset_summary?.skin_groups;
|
||||
if (
|
||||
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
getListingTitle,
|
||||
getLoginMethod,
|
||||
getServerRegion,
|
||||
hasAcceleratedSaleRatio,
|
||||
hasGiftResources,
|
||||
} from "@/views/mobile/listingDisplay";
|
||||
|
||||
@@ -322,7 +323,13 @@ function uniqueOptions(values: string[]) {
|
||||
:alt="getListingTitle(item)"
|
||||
/>
|
||||
<span v-else>HFB</span>
|
||||
<em v-if="hasGiftResources(item)">有赠送</em>
|
||||
<div
|
||||
v-if="hasGiftResources(item) || hasAcceleratedSaleRatio(item)"
|
||||
class="desktop-cover-labels"
|
||||
>
|
||||
<em v-if="hasGiftResources(item)">有赠送</em>
|
||||
<em v-if="hasAcceleratedSaleRatio(item)">特惠</em>
|
||||
</div>
|
||||
</div>
|
||||
<div class="desktop-info">
|
||||
<div class="desktop-title">
|
||||
@@ -720,10 +727,17 @@ function uniqueOptions(values: string[]) {
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.desktop-cover em {
|
||||
.desktop-cover-labels {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.desktop-cover-labels em {
|
||||
border-radius: 999px;
|
||||
background: #ff6a00;
|
||||
color: #ffffff;
|
||||
|
||||
Reference in New Issue
Block a user