From e745d172ffa84931b68ff6b9eb645889cc20b105 Mon Sep 17 00:00:00 2001 From: tsui110 Date: Sat, 3 Jan 2026 22:41:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=A7=AF=E5=88=86=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages-shop/shop/detail.vue | 4 ++-- pages-user/points/index.vue | 4 ++-- pages/mine/index.vue | 4 ++-- pages/shop/index.vue | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pages-shop/shop/detail.vue b/pages-shop/shop/detail.vue index ce1b93e..1f1a004 100644 --- a/pages-shop/shop/detail.vue +++ b/pages-shop/shop/detail.vue @@ -8,7 +8,7 @@ {{ detail.title || detail.name || '-' }} - {{ (detail.points_required ? Math.floor(detail.points_required / 100) : 0) || (detail.price ? Math.floor(detail.price / 100) : 0) }} + {{ (detail.points_required ? (detail.points_required / 100).toFixed(1) : '0.0') || (detail.price ? (detail.price / 100).toFixed(1) : '0.0') }} 积分 @@ -74,7 +74,7 @@ async function onRedeem() { return } - const points = (detail.value.points_required ? Math.floor(detail.value.points_required / 100) : 0) || (detail.value.price ? Math.floor(detail.value.price / 100) : 0) + const points = (detail.value.points_required ? (detail.value.points_required / 100).toFixed(1) : '0.0') || (detail.value.price ? (detail.value.price / 100).toFixed(1) : '0.0') uni.showModal({ title: '确认兑换', content: `是否消耗 ${points} 积分兑换 ${p.title || p.name}?`, diff --git a/pages-user/points/index.vue b/pages-user/points/index.vue index b4dc970..fd80cbb 100644 --- a/pages-user/points/index.vue +++ b/pages-user/points/index.vue @@ -67,9 +67,9 @@ const pageSize = ref(20) const hasMore = ref(true) function formatPoints(v) { const n = Number(v) || 0 - if (n === 0) return '0' + if (n === 0) return '0.0' const f = n / 100 - return Number.isInteger(f) ? String(f) : f.toFixed(2).replace(/\.?0+$/, '') + return f.toFixed(1) } function formatTime(t) { diff --git a/pages/mine/index.vue b/pages/mine/index.vue index f0b6a9a..38df546 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -738,9 +738,9 @@ export default { }, formatPoints(v) { const n = Number(v) || 0 - if (n === 0) return '0' + if (n === 0) return '0.0' const f = n / 100 - return Number.isInteger(f) ? String(f) : f.toFixed(2).replace(/\.?0+$/, '') + return f.toFixed(1) }, copyInviteCode() { const code = this.getInviteCode() diff --git a/pages/shop/index.vue b/pages/shop/index.vue index efe1a6f..843826f 100644 --- a/pages/shop/index.vue +++ b/pages/shop/index.vue @@ -246,7 +246,7 @@ function normalizeItems(list, kind) { image: cleanUrl(i.main_image || i.image || ''), title: i.name || i.title || '', price: i.price || i.discount_value || 0, - points: i.points_required ? Math.floor(i.points_required / 100) : (i.price ? Math.floor(i.price / 100) : (i.discount_value ? Math.floor(i.discount_value / 100) : 0)), + points: i.points_required ? (i.points_required / 100).toFixed(1) : (i.price ? (i.price / 100).toFixed(1) : (i.discount_value ? (i.discount_value / 100).toFixed(1) : '0.0')), stock: i.in_stock ? 99 : 0, // Simplified stock check if returned as bool discount_value: i.discount_value || 0, min_spend: i.min_spend || 0,