From 6918f6ca90aeb4f894d1b1432106ec5dd88e4242 Mon Sep 17 00:00:00 2001
From: whitechiina <1293616053@qq.com>
Date: Thu, 13 Aug 2026 11:17:54 +0800
Subject: [PATCH] =?UTF-8?q?=E9=97=AA=E5=85=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/assets.js | 51 ++++-
config/service.js | 1 +
manifest.json | 2 +-
pages/assets/bmt-exchange.vue | 2 +-
pages/assets/bmt-flash.vue | 184 +++++++++++++++---
unpackage/dist/build/web/index.html | 2 +-
.../{index.c4c7e156.js => index.ba479755.js} | 2 +-
...ges-assets-bmtr~pages~f90d3c1d.75f853f9.js | 1 +
...ges-assets-bmtr~pages~f90d3c1d.d08a9d6b.js | 1 -
.../js/pages-assets-bmt-exchange.1d9c110f.js | 1 +
.../js/pages-assets-bmt-exchange.6807e004.js | 1 -
.../js/pages-assets-bmt-flash.829ea659.js | 1 -
.../js/pages-assets-bmt-flash.ac195563.js | 1 +
13 files changed, 207 insertions(+), 43 deletions(-)
rename unpackage/dist/build/web/static/js/{index.c4c7e156.js => index.ba479755.js} (99%)
create mode 100644 unpackage/dist/build/web/static/js/pages-assets-balance-center~pages-assets-bmt-exchange~pages-assets-bmt-flash~pages-assets-bmtr~pages~f90d3c1d.75f853f9.js
delete mode 100644 unpackage/dist/build/web/static/js/pages-assets-balance-center~pages-assets-bmt-exchange~pages-assets-bmt-flash~pages-assets-bmtr~pages~f90d3c1d.d08a9d6b.js
create mode 100644 unpackage/dist/build/web/static/js/pages-assets-bmt-exchange.1d9c110f.js
delete mode 100644 unpackage/dist/build/web/static/js/pages-assets-bmt-exchange.6807e004.js
delete mode 100644 unpackage/dist/build/web/static/js/pages-assets-bmt-flash.829ea659.js
create mode 100644 unpackage/dist/build/web/static/js/pages-assets-bmt-flash.ac195563.js
diff --git a/api/assets.js b/api/assets.js
index 73b6854..d447c09 100644
--- a/api/assets.js
+++ b/api/assets.js
@@ -1859,6 +1859,18 @@ async function fetchTransferBmtrBalanceData(requestOptions) {
);
}
+async function fetchBmtrExchangePercentData(requestOptions) {
+ return fetchPayload(
+ createRequestOptions(
+ {
+ url: serviceConfig.ENDPOINTS.bmtrExchangePercent,
+ },
+ requestOptions,
+ ),
+ "BMTR兑换手续费比例加载失败",
+ );
+}
+
async function fetchWithdrawRateData(requestOptions) {
return fetchPayload(
createRequestOptions(
@@ -1881,6 +1893,7 @@ function resolvePercentRate(data) {
"feeRate",
"withdraw_rate",
"withdrawRate",
+ "percent",
"prop",
"value",
"num",
@@ -2509,9 +2522,18 @@ export async function fetchBmtFlashExchangeDetail(requestOptions) {
const result = await Promise.all([
fetchPriceData(requestOptions),
fetchHomeBalanceData(requestOptions),
+ fetchUserData(requestOptions).catch(function () {
+ return null;
+ }),
+ fetchBmtrExchangePercentData(requestOptions).catch(function () {
+ return null;
+ }),
]);
const ticker = normalizeTicker(result[0]);
const balances = normalizeBalances(result[1]);
+ const bmtr = pickFirstValue(result[2], ["bmtr"]);
+ const bmtrPercent = result[3] ? resolvePercentRate(result[3]) : "";
+ const bmtrRatio = result[3] ? pickFirstValue(result[3], ["bl"]) : "";
setHomeTickerCache(ticker);
@@ -2522,7 +2544,10 @@ export async function fetchBmtFlashExchangeDetail(requestOptions) {
coupon: toFixedNumber(balances.coupon, 2),
voucher: toFixedNumber(balances.voucher, 2),
brokerage_price: toFixedNumber(balances.balance, 2),
+ bmtr: toFixedNumber(bmtr, 4),
},
+ bmtrPercent: bmtrPercent || "",
+ bmtrRatio: bmtrRatio === "" ? "" : String(bmtrRatio),
tips: [
"BMT闪兑 = 输入数量 ÷ BMT实时价格",
"BMT闪兑时所需的抵用券、消费券、余额。必须大于10的倍数。",
@@ -2532,25 +2557,39 @@ export async function fetchBmtFlashExchangeDetail(requestOptions) {
}
export async function submitAssetBmtFlashExchange(payload, requestOptions) {
+ const rawMode = payload && payload.mode;
const mode =
- payload && payload.mode === "coupon"
- ? "coupon"
- : payload && payload.mode === "balance"
- ? "balance"
- : "voucher";
+ rawMode === "bmtr"
+ ? "bmtr"
+ : rawMode === "coupon"
+ ? "coupon"
+ : rawMode === "balance"
+ ? "balance"
+ : "voucher";
const amount = toNumber(payload && payload.amount);
if (!amount) {
throw createError("请输入闪兑数量");
}
+ if (mode === "bmtr" && amount < 0.01) {
+ throw createError("BMTR闪兑最小数量为0.01");
+ }
+
await fetchPayload(
createRequestOptions(
{
url: serviceConfig.ENDPOINTS.bmtFlashExchangeSubmit,
method: "POST",
data: {
- type: mode === "coupon" ? 1 : mode === "balance" ? 2 : 0,
+ type:
+ mode === "coupon"
+ ? 1
+ : mode === "balance"
+ ? 2
+ : mode === "bmtr"
+ ? 3
+ : 0,
number: String(amount),
},
},
diff --git a/config/service.js b/config/service.js
index d063f9b..e9e3139 100644
--- a/config/service.js
+++ b/config/service.js
@@ -18,6 +18,7 @@ const serviceConfig = {
spreadCommission: "/api/spread/commission",
powerExchangeSubmit: "/api/hn/redeem/power",
bmtFlashExchangeSubmit: "/api/hn/redeem/justRedeem",
+ bmtrExchangePercent: "/api/hn/redeem/getBmtrPercent",
powerExchangeMuit: "/api/hn/redeem/getMuit",
bmtRedeemPowerRate: "/api/hn/redeem/getRedeemPowerRate",
bmtExchangeSubmit: "/api/hn/redeem/redeem_bmt",
diff --git a/manifest.json b/manifest.json
index 7a6a00a..b9c6ccd 100644
--- a/manifest.json
+++ b/manifest.json
@@ -77,7 +77,7 @@
"devServer" : {
"proxy" : {
"/api" : {
- "target" : "https__UNI__B250220",
+ "target" : "https://tpoint.agrimedia.cn",
"changeOrigin" : true,
"secure" : false
}
diff --git a/pages/assets/bmt-exchange.vue b/pages/assets/bmt-exchange.vue
index 6477427..4384eac 100644
--- a/pages/assets/bmt-exchange.vue
+++ b/pages/assets/bmt-exchange.vue
@@ -15,7 +15,7 @@
BMT
- 可用1BMT:
+ 可用BMT:
{{ displayBmt }}
diff --git a/pages/assets/bmt-flash.vue b/pages/assets/bmt-flash.vue
index 27a8a31..5582a5c 100644
--- a/pages/assets/bmt-flash.vue
+++ b/pages/assets/bmt-flash.vue
@@ -18,6 +18,13 @@
可用BMT数量:
{{ displayBmt }}
+
+ BMT实时价格
+
+ {{ displayPrice }}
+ BMT/CNY
+
+
@@ -61,18 +68,15 @@
- BMT实时价格
-
-
- {{ displayPrice }}
- BMT/CNY
+ BMTR数量
+ {{ displayBmtr }}
-
+
全部闪兑预估可得
{{ allEstimateBmt }}
BMT
@@ -175,10 +179,13 @@ export default {
{ label: "抵用券闪兑", value: "voucher" },
{ label: "消费券闪兑", value: "coupon" },
{ label: "余额闪兑", value: "balance" },
+ { label: "BMTR闪兑", value: "bmtr" },
],
detail: {
ticker: {},
balances: {},
+ bmtrPercent: "",
+ bmtrRatio: "",
tips: [],
},
hasShown: false,
@@ -216,6 +223,10 @@ export default {
return Number(this.form.amount || 0);
},
currentModeLabel() {
+ if (this.form.mode === "bmtr") {
+ return "BMTR";
+ }
+
if (this.form.mode === "coupon") {
return "消费券";
}
@@ -227,6 +238,10 @@ export default {
return "抵用券";
},
currentModeBalance() {
+ if (this.form.mode === "bmtr") {
+ return Number(this.detail.balances.bmtr || 0);
+ }
+
if (this.form.mode === "coupon") {
return Number(this.detail.balances.coupon || 0);
}
@@ -240,14 +255,68 @@ export default {
priceNumber() {
return Number(this.detail.ticker.close || this.detail.ticker.cnyPrice || 0);
},
+ isBmtrMode() {
+ return this.form.mode === "bmtr";
+ },
+ bmtrPercentNumber() {
+ const percent = Number(this.detail.bmtrPercent);
+ return Number.isFinite(percent) && percent > 0 ? percent : 0;
+ },
+ hasBmtrPercent() {
+ return this.bmtrPercentNumber > 0;
+ },
+ bmtrRatioNumber() {
+ const ratio = Number(this.detail.bmtrRatio);
+ return Number.isFinite(ratio) && ratio > 0 ? ratio : 0;
+ },
+ hasBmtrRatio() {
+ return this.bmtrRatioNumber > 0;
+ },
+ bmtrExchangeRate() {
+ return Math.max(0, (100 - this.bmtrPercentNumber) / 100);
+ },
+ displayBmtrRatio() {
+ if (!this.hasBmtrRatio) {
+ return "--";
+ }
+
+ return String(this.detail.bmtrRatio);
+ },
+ displayBmtrPercent() {
+ if (!this.hasBmtrPercent) {
+ return "--";
+ }
+
+ const value = this.bmtrPercentNumber;
+ return Number.isInteger(value) ? String(value) : String(value);
+ },
estimateBmt() {
- if (!this.amountValue || !this.priceNumber) {
+ if (!this.amountValue) {
+ return "0";
+ }
+
+ if (this.isBmtrMode) {
+ if (!this.hasBmtrPercent || !this.hasBmtrRatio) {
+ return "--";
+ }
+
+ return this.formatAmount(
+ this.amountValue * this.bmtrRatioNumber * this.bmtrExchangeRate,
+ 2,
+ );
+ }
+
+ if (!this.priceNumber) {
return "0";
}
return this.formatAmount(this.amountValue / this.priceNumber, 2);
},
allEstimateBmt() {
+ if (this.isBmtrMode) {
+ return "0";
+ }
+
if (!this.priceNumber) {
return "0";
}
@@ -271,19 +340,36 @@ export default {
displayCoupon() {
return this.formatAmount(this.detail.balances.coupon, 2);
},
+ displayBmtr() {
+ return this.formatAmount(this.detail.balances.bmtr, 4);
+ },
displayPrice() {
return this.priceNumber ? this.priceNumber : "0.00";
},
+ displayInputAmount() {
+ return this.formatAmount(this.amountValue, this.isBmtrMode ? 2 : 0);
+ },
normalizedTips() {
- if (this.detail.tips && this.detail.tips.length) {
- return this.detail.tips;
+ const tips =
+ this.detail.tips && this.detail.tips.length
+ ? this.detail.tips
+ : [
+ "BMT闪兑 = 输入数量 ÷ BMT实时价格",
+ "BMT闪兑时所需的抵用券、消费券、余额。必须大于10的倍数。",
+ "闪兑成功后数量将直接结算到可用BMT。",
+ ];
+
+ if (!this.isBmtrMode) {
+ return tips;
}
- return [
- "BMT闪兑 = 输入数量 ÷ BMT实时价格",
- "BMT闪兑时所需的抵用券、消费券、余额。必须大于10的倍数。",
- "闪兑成功后数量将直接结算到可用BMT。",
- ];
+ return tips.concat([
+ "BMTR兑换BMT1:" +
+ this.displayBmtrRatio +
+ "兑换,按兑换数量扣除" +
+ this.displayBmtrPercent +
+ "%手续费,兑换最小数量必须是10的倍数",
+ ]);
},
},
methods: {
@@ -297,6 +383,7 @@ export default {
voucher: "https://imgs.agrimedia.cn/bm-bmt/quan-icon-g%20%281%29.png",
points: "https://imgs.agrimedia.cn/bm-bmt/j.png",
coupon: "https://imgs.agrimedia.cn/bm-bmt/xiaofei-icon-o.png",
+ bmtr: "https://imgs.agrimedia.cn/webimg/202607171808386371853.svg",
};
return iconMap[type] || "";
@@ -375,7 +462,16 @@ export default {
return;
}
- if (this.amountValue < 10) {
+ if (this.isBmtrMode && this.amountValue < 0.01) {
+ this.openResultDialog(
+ "error",
+ "闪兑失败!",
+ "BMTR闪兑最小数量为0.01。",
+ );
+ return;
+ }
+
+ if (!this.isBmtrMode && this.amountValue < 10) {
this.openResultDialog(
"error",
"闪兑失败!",
@@ -397,7 +493,7 @@ export default {
title: "确认闪兑",
message:
"确认使用" +
- this.formatAmount(this.amountValue, 0) +
+ this.displayInputAmount +
this.currentModeLabel +
"闪兑BMT?",
description: "预估可得 " + this.estimateBmt + " BMT",
@@ -491,6 +587,7 @@ export default {
z-index: 1;
display: flex;
flex-direction: column;
+ max-width: 360rpx;
}
.hero-card__coin-row {
@@ -532,6 +629,43 @@ export default {
font-weight: 800;
line-height: 1.1;
color: #ffffff;
+ word-break: break-all;
+}
+
+.hero-card__price {
+ position: absolute;
+ right: 36rpx;
+ top: 104rpx;
+ z-index: 2;
+ min-width: 220rpx;
+ padding: 18rpx 22rpx;
+ border-radius: 10rpx;
+ background: rgba(28, 35, 61, 0.82);
+ box-shadow: 0 14rpx 30rpx rgba(6, 10, 24, 0.24);
+}
+
+.hero-card__price-label {
+ display: block;
+ font-size: 26rpx;
+ color: rgba(225, 232, 255, 0.86);
+}
+
+.hero-card__price-row {
+ display: flex;
+ align-items: baseline;
+ margin-top: 12rpx;
+}
+
+.hero-card__price-value {
+ font-size: 34rpx;
+ font-weight: 800;
+ color: #ffffff;
+}
+
+.hero-card__price-unit {
+ margin-left: 10rpx;
+ font-size: 20rpx;
+ color: rgba(225, 232, 255, 0.72);
}
.panel-card {
@@ -581,17 +715,6 @@ export default {
color: #ffffff;
}
-.info-row__price {
- display: flex;
- align-items: baseline;
-}
-
-.info-row__unit {
- margin-left: 10rpx;
- font-size: 22rpx;
- color: rgba(184, 193, 218, 0.88);
-}
-
.info-card__estimate {
display: flex;
align-items: baseline;
@@ -633,7 +756,7 @@ export default {
.mode-tabs {
display: flex;
- width: 600rpx;
+ width: 100%;
margin: 26rpx auto 0;
padding: 4rpx;
border-radius: 999rpx;
@@ -648,8 +771,9 @@ export default {
flex: 1;
height: 60rpx;
border-radius: 999rpx;
- font-size: 28rpx;
+ font-size: 24rpx;
font-weight: 600;
+ white-space: nowrap;
color: rgba(210, 219, 242, 0.72);
}
diff --git a/unpackage/dist/build/web/index.html b/unpackage/dist/build/web/index.html
index 5f7e990..75c99ba 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('')