mirror of
https://github.com/samsonjs/spirit-tracker.git
synced 2026-04-27 15:07:43 +00:00
feat: V10 store page
This commit is contained in:
parent
2902151c46
commit
6be8e87733
1 changed files with 6 additions and 8 deletions
|
|
@ -334,9 +334,8 @@ export async function renderStore($app, storeLabelRaw) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDollars(p) {
|
function formatDollars(p) {
|
||||||
return `$${p}`;
|
if (!Number.isFinite(p)) return "";
|
||||||
// if (!Number.isFinite(p)) return "";
|
return `$${Math.round(p)}`;
|
||||||
// return `$${Math.round(p)}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let selectedMaxPrice = clampAndRound(
|
let selectedMaxPrice = clampAndRound(
|
||||||
|
|
@ -377,12 +376,11 @@ export async function renderStore($app, storeLabelRaw) {
|
||||||
updateMaxPriceLabel();
|
updateMaxPriceLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- Round listing display price to nearest $1 ----
|
// ---- Listing display price: keep cents (no rounding) ----
|
||||||
function roundedListingPriceStr(it) {
|
function listingPriceStr(it) {
|
||||||
const p = it && Number.isFinite(it._storePrice) ? it._storePrice : null;
|
const p = it && Number.isFinite(it._storePrice) ? it._storePrice : null;
|
||||||
if (p === null) return it.cheapestPriceStr ? it.cheapestPriceStr : "(no price)";
|
if (p === null) return it.cheapestPriceStr ? it.cheapestPriceStr : "(no price)";
|
||||||
const dollars = Math.round(p);
|
return `$${p.toFixed(2)}`;
|
||||||
return `$${dollars}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function priceBadgeHtml(it) {
|
function priceBadgeHtml(it) {
|
||||||
|
|
@ -404,7 +402,7 @@ export async function renderStore($app, storeLabelRaw) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderCard(it) {
|
function renderCard(it) {
|
||||||
const price = roundedListingPriceStr(it);
|
const price = listingPriceStr(it);
|
||||||
const href = String(it.sampleUrl || "").trim();
|
const href = String(it.sampleUrl || "").trim();
|
||||||
|
|
||||||
const specialBadge = it._lastStock
|
const specialBadge = it._lastStock
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue