updata
This commit is contained in:
parent
7dbdef08a3
commit
dabe02c671
|
|
@ -146,6 +146,7 @@ function normalizeBalances(data) {
|
|||
withdrawableBmt: toNumber(data && data.bmt_num),
|
||||
voucher: toNumber(data && data.coin),
|
||||
coupon: toNumber(data && data.diamond_balance),
|
||||
balance: toNumber(data && data.brokerage_price),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -161,6 +162,7 @@ function buildHomeOverview(balanceData, tickerData) {
|
|||
const balances = normalizeBalances(balanceData);
|
||||
const ticker = normalizeTicker(tickerData);
|
||||
const rawQuickAssets = {
|
||||
balance: toRawDisplayValue(balanceData && balanceData.brokerage_price),
|
||||
points: toRawDisplayValue(balanceData && balanceData.point),
|
||||
voucher: toRawDisplayValue(balanceData && balanceData.coin),
|
||||
coupon: toRawDisplayValue(balanceData && balanceData.diamond_balance),
|
||||
|
|
@ -194,10 +196,10 @@ function buildHomeOverview(balanceData, tickerData) {
|
|||
accent: "gold",
|
||||
},
|
||||
{
|
||||
key: "voucher",
|
||||
title: "抵用券",
|
||||
value: rawQuickAssets.voucher,
|
||||
accent: "rose",
|
||||
key: "power",
|
||||
title: "算力",
|
||||
value: rawQuickAssets.power,
|
||||
accent: "violet",
|
||||
},
|
||||
{
|
||||
key: "coupon",
|
||||
|
|
@ -206,11 +208,18 @@ function buildHomeOverview(balanceData, tickerData) {
|
|||
accent: "teal",
|
||||
},
|
||||
{
|
||||
key: "power",
|
||||
title: "算力",
|
||||
value: rawQuickAssets.power,
|
||||
accent: "violet",
|
||||
key: "voucher",
|
||||
title: "抵用券",
|
||||
value: rawQuickAssets.voucher,
|
||||
accent: "rose",
|
||||
},
|
||||
{
|
||||
key: "balance",
|
||||
title: "余额",
|
||||
value: rawQuickAssets.balance,
|
||||
accent: "blue",
|
||||
},
|
||||
|
||||
],
|
||||
features: [
|
||||
{
|
||||
|
|
@ -1854,17 +1863,23 @@ export async function fetchPowerExchangeDetail(requestOptions) {
|
|||
coupon: toFixedNumber(balances.coupon, 2),
|
||||
voucher: toFixedNumber(balances.voucher, 2),
|
||||
power: toFixedNumber(balances.power, 2),
|
||||
brokerage_price: toFixedNumber(balances.balance, 2),
|
||||
},
|
||||
tips: [
|
||||
"算力 = 抵用券或消费券 ÷ BMT实时价格;",
|
||||
"抵用券和消费券总数小于10的倍数不可兑换:",
|
||||
"算力 = 输入数量 ÷ BMT实时价格",
|
||||
"输入兑换数量小于10的倍数不可兑换",
|
||||
"算力用于兑换BMT使用。",
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export async function submitAssetPowerExchange(payload, requestOptions) {
|
||||
const mode = payload && payload.mode === "coupon" ? "coupon" : "voucher";
|
||||
const mode =
|
||||
payload && payload.mode === "coupon"
|
||||
? "coupon"
|
||||
: payload && payload.mode === "balance"
|
||||
? "balance"
|
||||
: "voucher";
|
||||
const amount = toNumber(payload && payload.amount);
|
||||
|
||||
if (!amount) {
|
||||
|
|
@ -1876,7 +1891,7 @@ export async function submitAssetPowerExchange(payload, requestOptions) {
|
|||
url: serviceConfig.ENDPOINTS.powerExchangeSubmit,
|
||||
method: "POST",
|
||||
data: {
|
||||
type: mode === "coupon" ? 1 : 0,
|
||||
type: mode === "coupon" ? 1 : mode === "balance" ? 2 : 0,
|
||||
number: String(amount),
|
||||
},
|
||||
}, requestOptions),
|
||||
|
|
@ -1963,6 +1978,7 @@ export async function fetchWithdrawDetail(requestOptions) {
|
|||
balances: {
|
||||
voucher: balances.voucher,
|
||||
coupon: balances.coupon,
|
||||
brokerage_price: toFixedNumber(balances.balance, 2),
|
||||
},
|
||||
wallets: walletPayload.wallets,
|
||||
defaultWallet: walletPayload.wallets[0] || null,
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
"h5" : {
|
||||
"router" : {
|
||||
"base" : "/bmt/",
|
||||
"mode" : "history"
|
||||
"mode" : "hash"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ export default {
|
|||
{
|
||||
key: "500-plus",
|
||||
label: "500以上",
|
||||
interval: "500,10000",
|
||||
interval: "500,10000000",
|
||||
},
|
||||
];
|
||||
},
|
||||
|
|
|
|||
|
|
@ -22,6 +22,18 @@
|
|||
|
||||
<view class="panel-card info-card">
|
||||
<view class="info-row">
|
||||
<view class="info-row__left">
|
||||
<image
|
||||
class="info-row__icon"
|
||||
:src="pageIcon('yue')"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<text class="info-row__label">我的余额</text>
|
||||
</view>
|
||||
<text class="info-row__value asset-number-font">{{ disbrokerageprice }}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-row">
|
||||
<view class="info-row__left">
|
||||
<image
|
||||
class="info-row__icon"
|
||||
|
|
@ -96,6 +108,7 @@
|
|||
type="number"
|
||||
:placeholder="'请输入' + currentModeLabel + '数量'"
|
||||
placeholder-class="form-input__placeholder"
|
||||
@wheel.prevent="preventAmountWheelChange"
|
||||
/>
|
||||
<text class="form-input__suffix">{{ currentModeLabel }}</text>
|
||||
</view>
|
||||
|
|
@ -161,6 +174,7 @@ export default {
|
|||
modeList: [
|
||||
{ label: "抵用券兑换", value: "voucher" },
|
||||
{ label: "消费券兑换", value: "coupon" },
|
||||
{ label: "余额兑换", value: "balance" },
|
||||
],
|
||||
detail: {
|
||||
ticker: {},
|
||||
|
|
@ -203,13 +217,25 @@ export default {
|
|||
return Number(this.form.amount || 0);
|
||||
},
|
||||
currentModeLabel() {
|
||||
return this.form.mode === "coupon" ? "消费券" : "抵用券";
|
||||
if (this.form.mode === "coupon") {
|
||||
return "消费券";
|
||||
}
|
||||
|
||||
if (this.form.mode === "balance") {
|
||||
return "余额";
|
||||
}
|
||||
|
||||
return "抵用券";
|
||||
},
|
||||
currentModeBalance() {
|
||||
if (this.form.mode === "coupon") {
|
||||
return Number(this.detail.balances.coupon || 0);
|
||||
}
|
||||
|
||||
if (this.form.mode === "balance") {
|
||||
return Number(this.detail.balances.brokerage_price || 0);
|
||||
}
|
||||
|
||||
return Number(this.detail.balances.voucher || 0);
|
||||
},
|
||||
priceNumber() {
|
||||
|
|
@ -238,7 +264,8 @@ export default {
|
|||
|
||||
const totalTickets =
|
||||
Number(this.detail.balances.voucher || 0) +
|
||||
Number(this.detail.balances.coupon || 0);
|
||||
Number(this.detail.balances.coupon || 0) +
|
||||
Number(this.detail.balances.brokerage_price || 0);
|
||||
|
||||
return this.formatAmount(
|
||||
totalTickets / this.priceNumber * this.exchangeMultiplierNumber,
|
||||
|
|
@ -251,6 +278,9 @@ export default {
|
|||
displayVoucher() {
|
||||
return this.formatAmount(this.detail.balances.voucher, 2);
|
||||
},
|
||||
disbrokerageprice() {
|
||||
return this.formatAmount(this.detail.balances.brokerage_price, 2);
|
||||
},
|
||||
displayCoupon() {
|
||||
return this.formatAmount(this.detail.balances.coupon, 2);
|
||||
},
|
||||
|
|
@ -272,6 +302,7 @@ export default {
|
|||
methods: {
|
||||
pageIcon(type) {
|
||||
const iconMap = {
|
||||
yue: 'https://imgs.agrimedia.cn/bm-bmt/qianbao-icon.png',
|
||||
power: "https://imgs.agrimedia.cn/bm-bmt/s.png",
|
||||
bmt: "https://imgs.agrimedia.cn/bm-bmt/b.png",
|
||||
transfer: "https://imgs.agrimedia.cn/bm-bmt/z.png",
|
||||
|
|
@ -300,6 +331,16 @@ export default {
|
|||
.toString()
|
||||
.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
},
|
||||
preventAmountWheelChange(event) {
|
||||
if (event && typeof event.preventDefault === "function") {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
const target = event && event.target;
|
||||
if (target && typeof target.blur === "function") {
|
||||
target.blur();
|
||||
}
|
||||
},
|
||||
async loadPage(showLoading) {
|
||||
try {
|
||||
this.detail = await fetchPowerExchangeDetail(
|
||||
|
|
@ -351,7 +392,7 @@ export default {
|
|||
this.openResultDialog(
|
||||
"error",
|
||||
"兑换失败!",
|
||||
"抵用券和消费券总数小于10的倍数不可兑换",
|
||||
"兑换数量小于10的倍数不可用",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -603,7 +644,7 @@ export default {
|
|||
|
||||
.mode-tabs {
|
||||
display: flex;
|
||||
width: 400rpx;
|
||||
width: 600rpx;
|
||||
margin: 26rpx auto 0;
|
||||
padding: 4rpx;
|
||||
border-radius: 999rpx;
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ export default {
|
|||
);
|
||||
this.walletVisible = false;
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
uni.showToast({
|
||||
title: error.message || "页面加载失败",
|
||||
icon: "none",
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<view class="home-skeleton__section">
|
||||
<view class="home-skeleton__title skeleton-block"></view>
|
||||
<view class="home-skeleton__asset-grid">
|
||||
<view v-for="index in 4" :key="'home-skeleton-asset-' + index" class="home-skeleton__asset-card skeleton-card">
|
||||
<view v-for="index in 5" :key="'home-skeleton-asset-' + index" class="home-skeleton__asset-card skeleton-card">
|
||||
<view class="home-skeleton__line home-skeleton__line--asset-label skeleton-block"></view>
|
||||
<view class="home-skeleton__line home-skeleton__line--asset-value skeleton-block"></view>
|
||||
</view>
|
||||
|
|
@ -225,6 +225,7 @@ export default {
|
|||
},
|
||||
quickAssetBg(key) {
|
||||
const bgMap = {
|
||||
balance: "https://imgs.agrimedia.cn/bm-bmt/brokerage-icon.png",
|
||||
points: "https://imgs.agrimedia.cn/bm-bmt/jifen-bg.png",
|
||||
voucher: "https://imgs.agrimedia.cn/bm-bmt/quan-bg.png",
|
||||
coupon: "https://imgs.agrimedia.cn/bm-bmt/xiaofei-bg.png",
|
||||
|
|
@ -282,6 +283,13 @@ export default {
|
|||
});
|
||||
},
|
||||
openQuickAsset(item) {
|
||||
if (item && item.key === "balance") {
|
||||
this.navigateToExternalUrl(
|
||||
serviceConfig.HTTP_REQUEST_URL + "/JXH5/pages/users/user_spread_money/index?type=2",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item && item.key === "voucher") {
|
||||
this.openVoucherBroker();
|
||||
return;
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,2 +1,2 @@
|
|||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>白马交易所</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/bmt/static/index.883130ca.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/bmt/static/js/chunk-vendors.a58c62f3.js></script><script src=/bmt/static/js/index.9c0fcdbd.js></script></body></html>
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/bmt/static/index.883130ca.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/bmt/static/js/chunk-vendors.a58c62f3.js></script><script src=/bmt/static/js/index.b0a1322e.js></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
unpackage/dist/build/web/static/js/pages-assets-points-convert-list.1c13e0f5.js
vendored
Normal file
1
unpackage/dist/build/web/static/js/pages-assets-points-convert-list.1c13e0f5.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue