From 3cc7d6d9a07d24828b7c7bee52adcf09d7140d82 Mon Sep 17 00:00:00 2001
From: whitechiina <1293616053@qq.com>
Date: Thu, 21 May 2026 10:24:19 +0800
Subject: [PATCH] updata
---
api/assets.js | 96 ++-
config/service.js | 5 +-
manifest.json | 2 +-
pages.json | 7 +
pages/assets/bmt-flash.vue | 774 ++++++++++++++++++
pages/assets/ledger.vue | 2 +
pages/index/index.vue | 13 +-
unpackage/dist/build/web/index.html | 2 +-
.../build/web/static/js/index.4ab6475b.js | 1 +
.../build/web/static/js/index.b0a1322e.js | 1 -
...ts-points-convert~pag~9f271acb.fbbc0f21.js | 1 +
...t~pages-assets-power~2c16de13.5aa0335f.js} | 2 +-
...-assets-points-conver~d5b52e90.1e14d8f8.js | 1 -
.../js/pages-assets-bmt-flash.72b08b94.js | 1 +
.../static/js/pages-assets-ledger.65809665.js | 1 -
.../static/js/pages-assets-ledger.c2248206.js | 1 +
.../static/js/pages-index-index.310755a0.js | 1 -
.../static/js/pages-index-index.5121ce07.js | 1 +
18 files changed, 897 insertions(+), 15 deletions(-)
create mode 100644 pages/assets/bmt-flash.vue
create mode 100644 unpackage/dist/build/web/static/js/index.4ab6475b.js
delete mode 100644 unpackage/dist/build/web/static/js/index.b0a1322e.js
create mode 100644 unpackage/dist/build/web/static/js/pages-assets-bmt-exchange~pages-assets-bmt-flash~pages-assets-ledger~pages-assets-points-convert~pag~9f271acb.fbbc0f21.js
rename unpackage/dist/build/web/static/js/{pages-assets-bmt-exchange~pages-assets-points-convert-list~pages-assets-power-exchange~pages-assets-~f488b67f.c7c49310.js => pages-assets-bmt-exchange~pages-assets-bmt-flash~pages-assets-points-convert-list~pages-assets-power~2c16de13.5aa0335f.js} (98%)
delete mode 100644 unpackage/dist/build/web/static/js/pages-assets-bmt-exchange~pages-assets-ledger~pages-assets-points-convert~pages-assets-points-conver~d5b52e90.1e14d8f8.js
create mode 100644 unpackage/dist/build/web/static/js/pages-assets-bmt-flash.72b08b94.js
delete mode 100644 unpackage/dist/build/web/static/js/pages-assets-ledger.65809665.js
create mode 100644 unpackage/dist/build/web/static/js/pages-assets-ledger.c2248206.js
delete mode 100644 unpackage/dist/build/web/static/js/pages-index-index.310755a0.js
create mode 100644 unpackage/dist/build/web/static/js/pages-index-index.5121ce07.js
diff --git a/api/assets.js b/api/assets.js
index 4e8bf0d..27425ca 100644
--- a/api/assets.js
+++ b/api/assets.js
@@ -234,6 +234,12 @@ function buildHomeOverview(balanceData, tickerData) {
desc: "抵用券与消费券兑换算力",
accent: "amber",
},
+ {
+ key: "bmt-flash",
+ title: "BMT闪兑",
+ desc: "BMT闪兑",
+ accent: "indigo",
+ },
{
key: "transfer",
title: "转赠中心",
@@ -788,14 +794,16 @@ function mapRedeemRecords(list, meta) {
"surplus",
"remain",
]);
+ const titleText = String(
+ pickFirstValue(item, ["title", "name", "type_name"]) ||
+ meta.title ||
+ "兑换记录",
+ );
const noteText = buildRedeemConsumeText(item, meta);
return {
id: buildRecordId(item, meta.key || "redeem"),
- title:
- pickFirstValue(item, ["title", "name", "type_name"]) ||
- meta.title ||
- "兑换记录",
+ title: titleText,
subtitle: orderSn ? "单号 " + orderSn : noteText,
time: pickFirstValue(item, [
"add_time",
@@ -815,6 +823,12 @@ function mapRedeemRecords(list, meta) {
: "本次到账" + meta.unit,
assetLabel: meta.unit,
feeText: noteText,
+ feeDisplayText:
+ meta.key === "bmt-flash"
+ ? "BMT闪兑"
+ : meta.key === "bmt"
+ ? "BMT兑换"
+ : "",
directionLabel: "兑换",
actionSymbol: "+",
orderSn: orderSn,
@@ -1903,6 +1917,62 @@ export async function submitAssetPowerExchange(payload, requestOptions) {
};
}
+export async function fetchBmtFlashExchangeDetail(requestOptions) {
+ const result = await Promise.all([
+ fetchPriceData(requestOptions),
+ fetchHomeBalanceData(requestOptions),
+ ]);
+ const ticker = normalizeTicker(result[0]);
+ const balances = normalizeBalances(result[1]);
+
+ setHomeTickerCache(ticker);
+
+ return {
+ ticker: ticker,
+ balances: {
+ bmt: toFixedNumber(balances.bmt, 2),
+ coupon: toFixedNumber(balances.coupon, 2),
+ voucher: toFixedNumber(balances.voucher, 2),
+ brokerage_price: toFixedNumber(balances.balance, 2),
+ },
+ tips: [
+ "BMT闪兑 = 输入数量 ÷ BMT实时价格",
+ "输入闪兑数量小于10的倍数不可闪兑",
+ "闪兑成功后数量将直接结算到可用BMT。",
+ ],
+ };
+}
+
+export async function submitAssetBmtFlashExchange(payload, requestOptions) {
+ const mode =
+ payload && payload.mode === "coupon"
+ ? "coupon"
+ : payload && payload.mode === "balance"
+ ? "balance"
+ : "voucher";
+ const amount = toNumber(payload && payload.amount);
+
+ if (!amount) {
+ throw createError("请输入闪兑数量");
+ }
+
+ await fetchPayload(
+ createRequestOptions({
+ url: serviceConfig.ENDPOINTS.bmtFlashExchangeSubmit,
+ method: "POST",
+ data: {
+ type: mode === "coupon" ? 1 : mode === "balance" ? 2 : 0,
+ number: String(amount),
+ },
+ }, requestOptions),
+ "BMT闪兑失败",
+ );
+
+ return {
+ success: true,
+ };
+}
+
// BMT兑换
export async function fetchBmtExchangeDetail(requestOptions) {
@@ -2114,6 +2184,24 @@ export async function fetchLedgerDetail(
};
}
+ if (type === "bmt-flash") {
+ const data = await fetchRedeemRecordListData(1, pagination, mergedRequestOptions);
+ return {
+ type: type,
+ title: "闪兑记录",
+ subtitle: "BMT闪兑记录",
+ records: mapRedeemRecords(data, {
+ key: "bmt-flash",
+ type: 1,
+ unit: "BMT",
+ title: "闪兑BMT",
+ subtitle: "BMT闪兑",
+ amountKeys: ["bmt", "bmt_num", "redeem_bmt", "num", "number"],
+ }),
+ pagination: buildPaginationMeta(data, pagination),
+ };
+ }
+
if (type === "withdraw") {
const data = await fetchWalletFlowListData(2, pagination, mergedRequestOptions);
return {
diff --git a/config/service.js b/config/service.js
index c2cff75..a938e3f 100644
--- a/config/service.js
+++ b/config/service.js
@@ -1,5 +1,5 @@
-const HOST_URL = "https://tpoint.agrimedia.cn";
-// const HOST_URL = window.location.protocol + "//" + window.location.host;
+// const HOST_URL = "https://tpoint.agrimedia.cn";
+const HOST_URL = window.location.protocol + "//" + window.location.host;
const serviceConfig = {
@@ -12,6 +12,7 @@ const serviceConfig = {
price: "/api/hn/getPrice",
homeBalance: "/api/hn/getAllBalance",
powerExchangeSubmit: "/api/hn/redeem/power",
+ bmtFlashExchangeSubmit: "/api/hn/redeem/justRedeem",
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 4f56513..ff5e05f 100644
--- a/manifest.json
+++ b/manifest.json
@@ -72,7 +72,7 @@
"h5" : {
"router" : {
"base" : "/bmt/",
- "mode" : "hash"
+ "mode" : "history"
}
}
}
diff --git a/pages.json b/pages.json
index 615be90..3f8bdcf 100644
--- a/pages.json
+++ b/pages.json
@@ -29,6 +29,13 @@
"backgroundColor": "#191E32"
}
},
+ {
+ "path": "pages/assets/bmt-flash",
+ "style": {
+ "navigationStyle": "custom",
+ "backgroundColor": "#191E32"
+ }
+ },
{
"path": "pages/assets/withdraw",
"style": {
diff --git a/pages/assets/bmt-flash.vue b/pages/assets/bmt-flash.vue
new file mode 100644
index 0000000..34d0911
--- /dev/null
+++ b/pages/assets/bmt-flash.vue
@@ -0,0 +1,774 @@
+
+
+
+
+
+
+
+
+
+
+
+ BMT
+
+ 可用BMT数量:
+ {{ displayBmt }}
+
+
+
+
+
+
+
+ 我的余额
+
+ {{ displayBalance }}
+
+
+
+
+
+ 我的抵用券
+
+ {{ displayVoucher }}
+
+
+
+
+
+ 我的消费券
+
+ {{ displayCoupon }}
+
+
+
+
+
+ BMT实时价格
+
+
+ {{ displayPrice }}
+ BMT/CNY
+
+
+
+
+ 全部闪兑预估可得
+ {{ allEstimateBmt }}
+ BMT
+
+
+
+
+
+
+ BMT闪兑
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+ {{ currentModeLabel }}
+
+
+
+
+
+ 预估闪兑BMT
+
+ {{ estimateBmt }}
+
+
+
+
+ 闪兑说明:
+
+ {{ index + 1 }}.
+ {{ tip }}
+
+
+
+
+
+ 确认闪兑
+ 闪兑记录
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/assets/ledger.vue b/pages/assets/ledger.vue
index 417a666..179fbb9 100644
--- a/pages/assets/ledger.vue
+++ b/pages/assets/ledger.vue
@@ -189,6 +189,7 @@ export default {
"power-flow",
"power",
"bmt",
+ "bmt-flash",
"withdraw",
"voucher",
"coupon",
@@ -222,6 +223,7 @@ export default {
transfer: "⇄",
power: "⚡",
bmt: "D",
+ "bmt-flash": "D",
withdraw: "B",
coupon: "券",
voucher: "抵",
diff --git a/pages/index/index.vue b/pages/index/index.vue
index d586167..4087468 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -39,7 +39,7 @@
-
+
@@ -90,7 +90,10 @@
v-for="item in overview.quickAssets"
:key="item.key"
class="asset-mini-card"
- :class="'asset-mini-card--' + item.accent"
+ :class="[
+ 'asset-mini-card--' + item.accent,
+ item.key === 'balance' ? 'asset-mini-card--full' : '',
+ ]"
@click="openQuickAsset(item)"
>
白马交易所
\ No newline at end of file
+ document.write('')