diff --git a/pages/asset/transfer.vue b/pages/asset/transfer.vue
index 5221626..0d6764e 100644
--- a/pages/asset/transfer.vue
+++ b/pages/asset/transfer.vue
@@ -65,7 +65,11 @@
{{i18n.assets.transfer.usable}}
- {{selectCurr.name}}
+ {{showConvertUnit}}
+
+
+
+ ≈ {{convertedDisplay}}
@@ -164,19 +168,52 @@
i18n() {
return this.$t('message');
},
+ // 是否涉及合约账户且非USDT(需要汇率转换)
+ needConversion() {
+ if (!this.selectCurr || !this.selectCurr.name) return false
+ const isContract = this.leftObj.id == 3 || this.rightObj.id == 3
+ const isUSDT = this.selectCurr.curr_id == 1 || (this.selectCurr.name || '').toUpperCase() === 'USDT'
+ return isContract && !isUSDT
+ },
+ // 可用余额 — 合约→现货时显示合约USDT余额
available_num() {
+ if (this.needConversion && this.leftObj.id == 3) {
+ // 从合约转出:显示合约USDT余额
+ let usdtItem = this.currList.find(c => c.curr_id == 1 || (c.name || '').toUpperCase() === 'USDT')
+ return usdtItem ? (usdtItem.num_lh || 0) : 0
+ }
if(this.leftObj.id==1){
- return this.selectCurr.num || 0 //现货数量
+ return this.selectCurr.num || 0
}else if(this.leftObj.id==2){
- return this.selectCurr.num_fb || 0 //现货数量
+ return this.selectCurr.num_fb || 0
}else if(this.leftObj.id==3){
- return this.selectCurr.num_lh || 0 //现货数量
+ return this.selectCurr.num_lh || 0
}else if(this.leftObj.id==4){
- return this.selectCurr.num_qq || 0 //现货数量
+ return this.selectCurr.num_qq || 0
}else{
return 0;
}
},
+ // 显示可用余额的单位
+ showConvertUnit() {
+ if (this.needConversion && this.leftObj.id == 3) {
+ return 'USDT'
+ }
+ return this.selectCurr.name || ''
+ },
+ // 转换后显示
+ convertedDisplay() {
+ if (!this.needConversion || !this.inputNum || this.inputNum <= 0) return ''
+ let rate = parseFloat(this.selectCurr.exchange) || 0
+ if (rate <= 0) return ''
+ if (this.rightObj.id == 3) {
+ // 现货→合约:输入BTC/ETH数量,显示USDT等值
+ return (this.inputNum * rate).toFixed(2) + ' USDT (合约)'
+ } else {
+ // 合约→现货:输入USDT数量,显示BTC/ETH等值
+ return (this.inputNum / rate).toFixed(8) + ' ' + this.selectCurr.name + ' (现货)'
+ }
+ },
count_obj() {
let obj = [];
var that = this
diff --git a/static/locales/en-US.js b/static/locales/en-US.js
index 48feca5..66d94ad 100644
--- a/static/locales/en-US.js
+++ b/static/locales/en-US.js
@@ -789,7 +789,7 @@ module.exports = {
loading:'Loading',
xh:'Spot',
fb:'Fiat',
- lh:'FTKbot',
+ lh:'Contract',
confirm:'Confirm',
cancel:'Cancel',
},