BMT兑换下限恢复100;积分转赠下限改1并接入DecimalInput;首页资产数值0时显示0.00
This commit is contained in:
parent
b91481ce9d
commit
ee88485316
|
|
@ -274,7 +274,7 @@ function buildTransferTips(feePercent) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
points: [
|
points: [
|
||||||
"只能转赠100的整数倍",
|
"只能转赠1的整数倍",
|
||||||
"凌晨00:00至02:00为系统维护时段不可赠送",
|
"凌晨00:00至02:00为系统维护时段不可赠送",
|
||||||
"转赠系统会扣除" + percentText + "%的手续费",
|
"转赠系统会扣除" + percentText + "%的手续费",
|
||||||
],
|
],
|
||||||
|
|
@ -2104,7 +2104,7 @@ export async function fetchBmtExchangeDetail(requestOptions) {
|
||||||
tips: [
|
tips: [
|
||||||
"预估 BMT数= 输入可用积分数÷BMT 实时价格。",
|
"预估 BMT数= 输入可用积分数÷BMT 实时价格。",
|
||||||
`兑换会同步消耗算力, 1 点可用积分,需同步消耗${powerRate}点算力。`,
|
`兑换会同步消耗算力, 1 点可用积分,需同步消耗${powerRate}点算力。`,
|
||||||
"不足 1 的可用积分无法发起兑换。",
|
"仅支持 100 的正整数倍, 不足 100的可用积分无法发起兑换。",
|
||||||
"凌晨00:00至02:00为积分维护时段,期间暂停兑换服务,请避开该时间段操作。",
|
"凌晨00:00至02:00为积分维护时段,期间暂停兑换服务,请避开该时间段操作。",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,7 @@ export default {
|
||||||
|
|
||||||
return [
|
return [
|
||||||
"1.BMT=积分-BMT实时价格;",
|
"1.BMT=积分-BMT实时价格;",
|
||||||
"2.小于1积分不可兑换;",
|
"2.只能兑换100的整数倍,小于100积分不可兑换;",
|
||||||
"3.凌晨0点-凌晨1点积分系统维护不可兑换;",
|
"3.凌晨0点-凌晨1点积分系统维护不可兑换;",
|
||||||
"4.可用积分不足,可以将释放中的积分转换成可用积分0。",
|
"4.可用积分不足,可以将释放中的积分转换成可用积分0。",
|
||||||
];
|
];
|
||||||
|
|
@ -320,9 +320,17 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.pointsValue < 1) {
|
if (this.pointsValue < 100) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "小于1积分不可兑换",
|
title: "小于100积分不可兑换",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.pointsValue % 100 !== 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "只能兑换100的整数倍",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,12 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="input-bar">
|
<view class="input-bar">
|
||||||
<input
|
<decimal-input
|
||||||
v-model="form.amount"
|
v-model="form.amount"
|
||||||
class="input-bar__field asset-number-font"
|
class="input-bar__field asset-number-font"
|
||||||
type="number"
|
:digit="0"
|
||||||
:placeholder="amountPlaceholder"
|
:placeholder="amountPlaceholder"
|
||||||
placeholder-class="input-bar__placeholder"
|
placeholder-style="color: rgba(170, 179, 204, 0.66);"
|
||||||
/>
|
/>
|
||||||
<text class="input-bar__action" @click="fillAll">全部赠送</text>
|
<text class="input-bar__action" @click="fillAll">全部赠送</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -182,6 +182,7 @@
|
||||||
<script>
|
<script>
|
||||||
import AssetConfirmPopup from "../../components/asset-confirm-popup.vue";
|
import AssetConfirmPopup from "../../components/asset-confirm-popup.vue";
|
||||||
import AssetPageShell from "../../components/asset-page-shell.vue";
|
import AssetPageShell from "../../components/asset-page-shell.vue";
|
||||||
|
import DecimalInput from "../../components/DecimalInput/DecimalInput.vue";
|
||||||
import {
|
import {
|
||||||
fetchTransferDetail,
|
fetchTransferDetail,
|
||||||
searchTransferUser,
|
searchTransferUser,
|
||||||
|
|
@ -192,6 +193,7 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
AssetConfirmPopup,
|
AssetConfirmPopup,
|
||||||
AssetPageShell,
|
AssetPageShell,
|
||||||
|
DecimalInput,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -255,7 +257,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
"只能转赠100的整数倍",
|
"只能转赠1的整数倍",
|
||||||
"凌晨0点-凌晨01点系统维护不可赠送",
|
"凌晨0点-凌晨01点系统维护不可赠送",
|
||||||
"转赠系统会扣除" + this.feePercent + "%的手续费",
|
"转赠系统会扣除" + this.feePercent + "%的手续费",
|
||||||
];
|
];
|
||||||
|
|
@ -276,9 +278,7 @@ export default {
|
||||||
return this.formatAmount(received, 2);
|
return this.formatAmount(received, 2);
|
||||||
},
|
},
|
||||||
amountPlaceholder() {
|
amountPlaceholder() {
|
||||||
return this.activeTab === "power"
|
return "请输入1的整数倍";
|
||||||
? "请输入1的整数倍"
|
|
||||||
: "请输入100的整数倍";
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -394,9 +394,9 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.activeTab === "points" && this.amountValue % 100 !== 0) {
|
if (this.activeTab === "points" && !Number.isInteger(this.amountValue)) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "积分只能转赠100的整数倍",
|
title: "积分只能转赠1的整数倍",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
<view class="asset-mini-card__head">
|
<view class="asset-mini-card__head">
|
||||||
<text class="asset-mini-card__label">{{ item.title }}</text>
|
<text class="asset-mini-card__label">{{ item.title }}</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="asset-mini-card__value asset-number-font">{{ item.value }}</text>
|
<text class="asset-mini-card__value asset-number-font">{{ formatAssetValue(item.value) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -131,6 +131,7 @@ import {
|
||||||
fetchVoucherBrokerLinkData,
|
fetchVoucherBrokerLinkData,
|
||||||
} from "../../api/assets";
|
} from "../../api/assets";
|
||||||
import serviceConfig from "../../config/service";
|
import serviceConfig from "../../config/service";
|
||||||
|
import { truncateToTwo } from "../../utils/index.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -161,6 +162,9 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatAssetValue(value) {
|
||||||
|
return truncateToTwo(value);
|
||||||
|
},
|
||||||
async loadPage(options = {}) {
|
async loadPage(options = {}) {
|
||||||
if (this.isFetchingHome) {
|
if (this.isFetchingHome) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -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)'))
|
<!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.149e085d.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/bmt/static/js/chunk-vendors.e13b4a2c.js></script><script src=/bmt/static/js/index.68f4d562.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.149e085d.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/bmt/static/js/chunk-vendors.e13b4a2c.js></script><script src=/bmt/static/js/index.5ae5da78.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
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
|
|
@ -54,3 +54,32 @@ export function limitDecimal(val, digit = 2, allowNegative = false) {
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数值展示格式化:为 0 时返回 "0.00",非 0 时原样展示
|
||||||
|
* @param {number|string} num - 原始数值,支持正负值
|
||||||
|
* @returns {string}
|
||||||
|
*
|
||||||
|
* 规则:
|
||||||
|
* 1. 传入值为 0(或空值、非法值)时,返回 "0.00"
|
||||||
|
* 2. 传入值不为 0(无论正负)时,原样返回该值的字符串形式,不做任何截取
|
||||||
|
*
|
||||||
|
* 示例:
|
||||||
|
* truncateToTwo(0) // '0.00'
|
||||||
|
* truncateToTwo('0.0000') // '0.00'
|
||||||
|
* truncateToTwo(null) // '0.00'
|
||||||
|
* truncateToTwo('11.0000') // '11.0000'
|
||||||
|
* truncateToTwo(11.2942) // '11.2942'
|
||||||
|
* truncateToTwo(-1.239) // '-1.239'
|
||||||
|
*/
|
||||||
|
export function truncateToTwo(num) {
|
||||||
|
const value = Number(num);
|
||||||
|
|
||||||
|
// 0、空值、非法值统一返回 0.00
|
||||||
|
if (!Number.isFinite(value) || value === 0) {
|
||||||
|
return "0.00";
|
||||||
|
}
|
||||||
|
|
||||||
|
return String(num);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue