Browse Source

金币充值金额精度问题修复

milestone-20250815-金币优化
ZhangYong 2 weeks ago
parent
commit
9d173b39cb
  1. 7
      package-lock.json
  2. 1
      package.json
  3. 3
      src/views/recharge/gold/addCoinRecharge.vue

7
package-lock.json

@ -17,6 +17,7 @@
"axios": "^1.7.8",
"dayjs": "^1.11.13",
"dayjs-plugin-utc": "^0.1.2",
"decimal.js": "^10.6.0",
"echarts": "^5.5.1",
"element-plus": "^2.8.8",
"js-cookie": "^3.0.5",
@ -3551,9 +3552,9 @@
}
},
"node_modules/decimal.js": {
"version": "10.4.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/decimal.js/-/decimal.js-10.4.3.tgz",
"integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==",
"version": "10.6.0",
"resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.6.0.tgz",
"integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==",
"license": "MIT"
},
"node_modules/define-lazy-prop": {

1
package.json

@ -21,6 +21,7 @@
"axios": "^1.7.8",
"dayjs": "^1.11.13",
"dayjs-plugin-utc": "^0.1.2",
"decimal.js": "^10.6.0",
"echarts": "^5.5.1",
"element-plus": "^2.8.8",
"js-cookie": "^3.0.5",

3
src/views/recharge/gold/addCoinRecharge.vue

@ -6,6 +6,7 @@ import axios from 'axios'
import API from '@/util/http.js'
import moment from 'moment'
import Cookies from 'js-cookie';
import Decimal from 'decimal.js';
// fixedAdminId
// const fixedAdminId = 1;
@ -93,7 +94,7 @@ const add = async function () {
formattedRecharge.freeGold = Number(formattedRecharge.freeGold) * 100;
}
if (formattedRecharge.money) {
formattedRecharge.money = Number(formattedRecharge.money) * 100;
formattedRecharge.money = new Decimal(formattedRecharge.money).mul(100).toNumber();
}
if (formattedRecharge.payTime) {

Loading…
Cancel
Save