From 0e92fbc5afa90a09955bf1980f44bf2d811d8ab9 Mon Sep 17 00:00:00 2001 From: zhangrenyuan <18990852002@163.com> Date: Wed, 7 Jan 2026 11:36:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=87=91=E5=B8=81=E6=B6=88=E8=80=97):=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=87=91=E5=B8=81=E6=B6=88=E8=80=97=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=EF=BC=8C=E4=BC=98=E5=85=88=E6=B6=88=E8=80=97=E5=85=8D?= =?UTF-8?q?=E8=B4=B9=E9=87=91=E5=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/consume/gold/addCoinConsume.vue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/views/consume/gold/addCoinConsume.vue b/src/views/consume/gold/addCoinConsume.vue index 7e184bd..56385fe 100644 --- a/src/views/consume/gold/addCoinConsume.vue +++ b/src/views/consume/gold/addCoinConsume.vue @@ -234,25 +234,25 @@ function calculateCoins(sumGold) { let remaining = parsedSumGold; let freeUsed = 0, permanentUsed = 0, taskUsed = 0; - // 先消耗任务金币 - if (remaining > 0 && nowTaskGold > 0) { - const availableTaskGold = parseFloat(nowTaskGold.toFixed(4)); - taskUsed = Math.min(availableTaskGold, remaining); - remaining = parseFloat((remaining - taskUsed).toFixed(4)); - } - - // 再消耗免费金币 + // 先消耗免费金币 if (remaining > 0 && nowFreeGold > 0) { freeUsed = Math.min(parseFloat(nowFreeGold.toFixed(4)), remaining); remaining = parseFloat((remaining - freeUsed).toFixed(4)); } - // 最后消耗永久金币 + // 再消耗永久金币 if (remaining > 0 && nowPermanentGold > 0) { permanentUsed = Math.min(parseFloat(nowPermanentGold.toFixed(4)), remaining); remaining = parseFloat((remaining - permanentUsed).toFixed(4)); } + // 最后消耗任务金币 + if (remaining > 0 && nowTaskGold > 0) { + const availableTaskGold = parseFloat(nowTaskGold.toFixed(4)); + taskUsed = Math.min(availableTaskGold, remaining); + remaining = parseFloat((remaining - taskUsed).toFixed(4)); + } + // 更新金币值 addConsume.value.freeGold = freeUsed; addConsume.value.permanentGold = permanentUsed;