diff --git a/api/assets.js b/api/assets.js
index 4b1d209..5e7d1cf 100644
--- a/api/assets.js
+++ b/api/assets.js
@@ -1853,7 +1853,7 @@ export async function fetchPowerExchangeDetail(requestOptions) {
balances: {
coupon: toFixedNumber(balances.coupon, 2),
voucher: toFixedNumber(balances.voucher, 2),
- power: toFixedNumber(balances.power, 0),
+ power: toFixedNumber(balances.power, 2),
},
tips: [
"算力 = 抵用券或消费券 ÷ BMT实时价格 × 兑换倍率;",
diff --git a/pages/assets/bmt-exchange.vue b/pages/assets/bmt-exchange.vue
index 3ec2133..136ac22 100644
--- a/pages/assets/bmt-exchange.vue
+++ b/pages/assets/bmt-exchange.vue
@@ -454,7 +454,7 @@ export default {
.hero-card__value {
margin-top: 8rpx;
- font-size: 32rpx;
+ font-size: 48rpx;
font-weight: 800;
color: #ffffff;
line-height: 1.1;
diff --git a/pages/assets/points-convert.vue b/pages/assets/points-convert.vue
index 22fc40b..6e985c4 100644
--- a/pages/assets/points-convert.vue
+++ b/pages/assets/points-convert.vue
@@ -423,7 +423,7 @@ export default {
.hero-card__value {
max-width: 360rpx;
- font-size: 58rpx;
+ font-size: 48rpx;
font-weight: 800;
line-height: 1.05;
color: #ffffff;
diff --git a/pages/assets/power-exchange.vue b/pages/assets/power-exchange.vue
index 48cb0dc..1a970af 100644
--- a/pages/assets/power-exchange.vue
+++ b/pages/assets/power-exchange.vue
@@ -497,7 +497,7 @@ export default {
.hero-card__value {
margin-top: 8rpx;
- font-size: 32rpx;
+ font-size: 48rpx;
font-weight: 800;
line-height: 1.1;
font-family: var(--asset-number-font-family);
diff --git a/pages/assets/withdraw.vue b/pages/assets/withdraw.vue
index dcadbde..3a44ad0 100644
--- a/pages/assets/withdraw.vue
+++ b/pages/assets/withdraw.vue
@@ -35,11 +35,13 @@
全部提取
@@ -197,7 +199,7 @@ export default {
return Number(this.form.amount || 0);
},
amountDisplay() {
- return this.formatAmount(this.amountValue, 2);
+ return this.formatAmount(this.amountValue, 0);
},
feeText() {
const fee = (this.amountValue * this.withdrawRateNumber) / 100;
@@ -291,6 +293,88 @@ export default {
return number.toFixed(4).replace(/\.?0+$/, "");
},
+ getInputValue(event) {
+ return event && event.detail ? event.detail.value : event && event.target
+ ? event.target.value
+ : "";
+ },
+ normalizeIntegerString(value) {
+ const text = String(value === undefined || value === null ? "" : value).trim();
+
+ if (!text) {
+ return "";
+ }
+
+ if (!/^\d+$/.test(text)) {
+ return "";
+ }
+
+ const integerValue = Number(text);
+ if (!Number.isFinite(integerValue) || integerValue < 0) {
+ return "";
+ }
+
+ return String(Math.floor(integerValue));
+ },
+ floorIntegerString(value) {
+ const number = Number(value || 0);
+
+ if (!Number.isFinite(number) || number <= 0) {
+ return "";
+ }
+
+ return String(Math.floor(number));
+ },
+ validateIntegerAmount(value) {
+ const text = String(value === undefined || value === null ? "" : value).trim();
+
+ if (!text) {
+ return {
+ valid: false,
+ normalized: "",
+ isEmpty: true,
+ };
+ }
+
+ const normalized = this.normalizeIntegerString(text);
+ if (!normalized) {
+ return {
+ valid: false,
+ normalized: "",
+ isEmpty: false,
+ };
+ }
+
+ return {
+ valid: true,
+ normalized,
+ isEmpty: false,
+ };
+ },
+ handleAmountInput(event) {
+ this.form.amount = this.getInputValue(event);
+ },
+ handleAmountBlur(event) {
+ const { valid, normalized, isEmpty } = this.validateIntegerAmount(
+ this.getInputValue(event),
+ );
+
+ if (isEmpty) {
+ this.form.amount = "";
+ return;
+ }
+
+ if (!valid) {
+ this.form.amount = "";
+ uni.showToast({
+ title: "提取数量只能输入整数",
+ icon: "none",
+ });
+ return;
+ }
+
+ this.form.amount = normalized;
+ },
async loadPage(showLoading) {
try {
this.detail = await fetchWithdrawDetail(
@@ -310,7 +394,7 @@ export default {
}
},
fillAll() {
- this.form.amount = this.detail.withdrawableBmt || "0";
+ this.form.amount = this.floorIntegerString(this.detail.withdrawableBmt);
},
toggleWalletVisible() {
this.walletVisible = !this.walletVisible;
@@ -332,17 +416,21 @@ export default {
});
},
openConfirm() {
- if (!this.detail.defaultWallet) {
+ const amountCheck = this.validateIntegerAmount(this.form.amount);
+ if (!amountCheck.valid) {
+ this.form.amount = "";
uni.showToast({
- title: "请先添加钱包地址",
+ title: amountCheck.isEmpty ? "请输入提取数量" : "提取数量只能输入整数",
icon: "none",
});
return;
}
- if (!this.amountValue) {
+ this.form.amount = amountCheck.normalized;
+
+ if (!this.detail.defaultWallet) {
uni.showToast({
- title: "请输入提取数量",
+ title: "请先添加钱包地址",
icon: "none",
});
return;
@@ -363,17 +451,21 @@ export default {
return;
}
- if (!this.detail.defaultWallet) {
+ const amountCheck = this.validateIntegerAmount(this.form.amount);
+ if (!amountCheck.valid) {
+ this.form.amount = "";
uni.showToast({
- title: "请先添加钱包地址",
+ title: amountCheck.isEmpty ? "请输入提取数量" : "提取数量只能输入整数",
icon: "none",
});
return;
}
- if (!this.amountValue) {
+ this.form.amount = amountCheck.normalized;
+
+ if (!this.detail.defaultWallet) {
uni.showToast({
- title: "请输入提取数量",
+ title: "请先添加钱包地址",
icon: "none",
});
return;
@@ -491,7 +583,7 @@ export default {
.hero-card__value {
margin-top: 8rpx;
- font-size: 42rpx;
+ font-size: 48rpx;
font-weight: 800;
line-height: 1.1;
color: #ffffff;
diff --git a/unpackage/dist/build/.DS_Store b/unpackage/dist/build/.DS_Store
index 6750c11..0d5040e 100644
Binary files a/unpackage/dist/build/.DS_Store and b/unpackage/dist/build/.DS_Store differ
diff --git a/unpackage/dist/build/web/index.html b/unpackage/dist/build/web/index.html
index a9c7078..487bc89 100644
--- a/unpackage/dist/build/web/index.html
+++ b/unpackage/dist/build/web/index.html
@@ -1,2 +1,2 @@
白马交易所
\ No newline at end of file
+ document.write('')