feat:精度丢失

This commit is contained in:
2025-08-16 18:14:11 +08:00
parent 3e01694e82
commit bed9fef247
2 changed files with 93 additions and 85 deletions
+85 -84
View File
@@ -1,84 +1,85 @@
{ {
"id": "tb", "id": "tb",
"name": "tb", "name": "tb",
"displayName": "tb", "displayName": "tb",
"version": "1.0.2", "version": "1.0.2",
"description": "信任桥", "description": "信任桥",
"keywords": [ "keywords": [
"tb", "tb",
"信任桥" "信任桥"
], ],
"dcloudext": { "dcloudext": {
"category": [], "category": [],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
}, },
"sourcecode": { "sourcecode": {
"price": "0.00" "price": "0.00"
} }
}, },
"contact": { "contact": {
"qq": "" "qq": ""
}, },
"declaration": { "declaration": {
"ads": "无", "ads": "无",
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "" "npmurl": ""
}, },
"repository": "", "repository": "",
"uni_modules": { "uni_modules": {
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y"
}, },
"client": { "client": {
"App": { "App": {
"app-vue": "u", "app-vue": "u",
"app-nvue": "u" "app-nvue": "u"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "u", "Safari": "u",
"Android Browser": "u", "Android Browser": "u",
"微信浏览器(Android)": "u", "微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u" "QQ浏览器(Android)": "u"
}, },
"H5-pc": { "H5-pc": {
"Chrome": "u", "Chrome": "u",
"IE": "u", "IE": "u",
"Edge": "u", "Edge": "u",
"Firefox": "u", "Firefox": "u",
"Safari": "u" "Safari": "u"
}, },
"小程序": { "小程序": {
"微信": "u", "微信": "u",
"阿里": "u", "阿里": "u",
"百度": "u", "百度": "u",
"字节跳动": "u", "字节跳动": "u",
"QQ": "u", "QQ": "u",
"京东": "u" "京东": "u"
}, },
"快应用": { "快应用": {
"华为": "u", "华为": "u",
"联盟": "u" "联盟": "u"
}, },
"Vue": { "Vue": {
"vue2": "u", "vue2": "u",
"vue3": "u" "vue3": "u"
} }
} }
} }
}, },
"dependencies": { "dependencies": {
"axios": "0.27.2", "axios": "0.27.2",
"axios-adapter-uniapp": "^0.1.4", "axios-adapter-uniapp": "^0.1.4",
"axios-miniprogram-adapter": "^0.3.4", "axios-miniprogram-adapter": "^0.3.4",
"crypto-js": "^4.2.0", "bignumber.js": "^9.3.1",
"echarts": "^5.1.2", "crypto-js": "^4.2.0",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"qs": "^6.14.0" "echarts": "^5.1.2",
} "qs": "^6.14.0"
} }
}
@@ -66,6 +66,8 @@ import Header from '@/components/header.vue';
import { getAcctFlow, getAcctMiningStat, getAcctContribution, getAcctFlowList, getBonusStat, getAcctBalance } from '@/api/finance.js'; import { getAcctFlow, getAcctMiningStat, getAcctContribution, getAcctFlowList, getBonusStat, getAcctBalance } from '@/api/finance.js';
import { getValue, BALANCE_TYPE } from '@/utils/enumUtils.js'; import { getValue, BALANCE_TYPE } from '@/utils/enumUtils.js';
import { formatDate, handleAmount } from '@/utils/index.js'; import { formatDate, handleAmount } from '@/utils/index.js';
import BigNumber from 'bignumber.js';
export default { export default {
computed: { computed: {
@@ -233,6 +235,10 @@ export default {
{ {
name: "锁定次数", name: "锁定次数",
key: "lockAmount" key: "lockAmount"
},
{
name: "预发放次数",
key: "preAmount"
} }
]; ];
} }
@@ -293,7 +299,8 @@ export default {
console.log("流水贡献值", resp); console.log("流水贡献值", resp);
if (resp && resp.bizcode === 100) { if (resp && resp.bizcode === 100) {
if (resp.data.ratio) { if (resp.data.ratio) {
resp.data.ratio = resp.data.ratio * 100 + '%'; const ratio = new Decimal(resp.data.ratio);
resp.data.ratio = ratio.times(100).toNumber() + '%';
} }
this.headerData = resp.data || {}; this.headerData = resp.data || {};