feat: contract account tab, full i18n, male avatar, PC home stretch
- Asset page: add Contract account row + tab, show num_lh balance - Total Assets = Spot + Contract + Fiat - All Chinese text eliminated (z-paging, loadmore, colorui, pages) - Password/payword pages use image captcha instead of OTP - Home page PC: full-width stretch layout - Register captcha input type fix, invite code lock
This commit is contained in:
+58
-27
@@ -99,11 +99,11 @@
|
||||
zhuanghu: [],
|
||||
leftObj: {
|
||||
id: 1,
|
||||
name: '现货账户'
|
||||
name: 'Spot'
|
||||
},
|
||||
rightObj: {
|
||||
id: 1,
|
||||
name: '现货账户'
|
||||
id: 3,
|
||||
name: 'Contract'
|
||||
},
|
||||
|
||||
currList: [],
|
||||
@@ -126,34 +126,34 @@
|
||||
if(e.id){
|
||||
if(e.id==1||e.id==0){
|
||||
this.leftObj.id = 1
|
||||
this.leftObj.name = this.i18n.assets.transfer.xh
|
||||
this.rightObj.id = 2
|
||||
this.rightObj.name = this.i18n.assets.transfer.fb
|
||||
this.leftObj.name = 'Spot'
|
||||
this.rightObj.id = 3
|
||||
this.rightObj.name = 'Contract'
|
||||
}
|
||||
if(e.id==2){
|
||||
this.leftObj.id = e.id
|
||||
this.leftObj.name = this.i18n.assets.transfer.fb
|
||||
this.leftObj.name = 'Fiat'
|
||||
this.rightObj.id = 1
|
||||
this.rightObj.name = this.i18n.assets.transfer.xh
|
||||
this.rightObj.name = 'Spot'
|
||||
}
|
||||
if(e.id==3){
|
||||
this.leftObj.id = e.id
|
||||
this.leftObj.name = this.i18n.assets.transfer.lh
|
||||
this.leftObj.name = 'Contract'
|
||||
this.rightObj.id = 1
|
||||
this.rightObj.name = this.i18n.assets.transfer.xh
|
||||
this.rightObj.name = 'Spot'
|
||||
}
|
||||
if(e.id==4){
|
||||
this.leftObj.id = e.id
|
||||
this.leftObj.name = this.i18n.assets.transfer.qq
|
||||
this.leftObj.name = 'Quantitative'
|
||||
this.rightObj.id = 1
|
||||
this.rightObj.name = this.i18n.assets.transfer.xh
|
||||
this.rightObj.name = 'Spot'
|
||||
}
|
||||
}
|
||||
if(e.rightid){
|
||||
this.leftObj.id = 1
|
||||
this.leftObj.name = this.i18n.assets.transfer.xh
|
||||
this.rightObj.id = e.rightid
|
||||
this.rightObj.name = this.i18n.assets.transfer.qq
|
||||
this.leftObj.name = 'Spot'
|
||||
this.rightObj.id = Number(e.rightid)
|
||||
this.rightObj.name = this.getAccountName(Number(e.rightid))
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
@@ -207,19 +207,33 @@
|
||||
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 (合约)'
|
||||
// Spot→Contract:输入BTC/ETH数量,显示USDT等值
|
||||
return (this.inputNum * rate).toFixed(2) + ' USDT (Contract)'
|
||||
} else {
|
||||
// 合约→现货:输入USDT数量,显示BTC/ETH等值
|
||||
return (this.inputNum / rate).toFixed(8) + ' ' + this.selectCurr.name + ' (现货)'
|
||||
// Contract→Spot:输入USDT数量,显示BTC/ETH等值
|
||||
return (this.inputNum / rate).toFixed(8) + ' ' + this.selectCurr.name + ' (Spot)'
|
||||
}
|
||||
},
|
||||
// 根据来源账户过滤可选货币
|
||||
filteredCurrList() {
|
||||
if (!this.currList || this.currList.length === 0) return []
|
||||
if (this.leftObj.id == 3) {
|
||||
// 合约账户转出 → 只显示USDT
|
||||
return this.currList.filter(c => {
|
||||
return c.curr_id == 1 || (c.name || '').toUpperCase() === 'USDT'
|
||||
})
|
||||
}
|
||||
// 现货账户转出 → 只显示 BTC / ETH / USDT
|
||||
return this.currList.filter(c => {
|
||||
return ['BTC', 'ETH', 'USDT'].includes((c.name || '').toUpperCase())
|
||||
})
|
||||
},
|
||||
count_obj() {
|
||||
let obj = [];
|
||||
var that = this
|
||||
switch (this.showPoup) {
|
||||
case 'currency':
|
||||
obj = that.currList
|
||||
obj = that.filteredCurrList
|
||||
break;
|
||||
case 'accountL':
|
||||
obj = that.zhuanghu.filter((item) => {
|
||||
@@ -232,13 +246,18 @@
|
||||
})
|
||||
break;
|
||||
default:
|
||||
obj = that.currList
|
||||
obj = that.filteredCurrList
|
||||
break;
|
||||
}
|
||||
return obj
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 账户ID → 英文名称映射
|
||||
getAccountName(id) {
|
||||
const map = {1:'Spot', 2:'Fiat', 3:'Contract', 4:'Quantitative'}
|
||||
return map[id] || 'Account'
|
||||
},
|
||||
get_transfer() {
|
||||
this.post('/wallet/get_transfer').then((res) => {
|
||||
console.log('划转内容', res)
|
||||
@@ -247,14 +266,19 @@
|
||||
// 确保 BTC 和 ETH 始终出现在币种列表中
|
||||
let names = currData.map(c => (c.name || '').toUpperCase())
|
||||
if (!names.includes('BTC')) {
|
||||
currData.push({ curr_id: 'btc_static', name: 'BTC', num: 0, num_fb: 0, num_lh: 0, num_qq: 0 })
|
||||
currData.push({ curr_id: 3, name: 'BTC', num: 0, num_fb: 0, num_lh: 0, num_qq: 0 })
|
||||
}
|
||||
if (!names.includes('ETH')) {
|
||||
currData.push({ curr_id: 'eth_static', name: 'ETH', num: 0, num_fb: 0, num_lh: 0, num_qq: 0 })
|
||||
currData.push({ curr_id: 4, name: 'ETH', num: 0, num_fb: 0, num_lh: 0, num_qq: 0 })
|
||||
}
|
||||
this.currList = currData
|
||||
this.transfer_text = res.data.transfer_text
|
||||
this.zhuanghu = res.data.zhuanghu
|
||||
// 统一将账户名称英文化
|
||||
const nameMap = {1:'Spot', 2:'Fiat', 3:'Contract', 4:'Quantitative'}
|
||||
this.zhuanghu = (res.data.zhuanghu || []).map(item => ({
|
||||
...item,
|
||||
name: nameMap[item.id] || item.name
|
||||
}))
|
||||
if (this.selectIndex) {
|
||||
this.selectCurr = this.currList[this.selectIndex]
|
||||
}
|
||||
@@ -328,16 +352,23 @@
|
||||
},
|
||||
select(index) {
|
||||
if (this.showPoup == 'accountL') {
|
||||
this.leftObj = this.count_obj[index]
|
||||
let item = this.count_obj[index]
|
||||
this.leftObj = { id: item.id, name: this.getAccountName(item.id) }
|
||||
// 切换来源账户后清空已选币种
|
||||
this.selectCurr = ''
|
||||
this.selectIndex = ''
|
||||
this.inputNum = ''
|
||||
console.log(this.leftObj.name)
|
||||
}
|
||||
if (this.showPoup == 'accountR') {
|
||||
this.rightObj = this.count_obj[index]
|
||||
let item = this.count_obj[index]
|
||||
this.rightObj = { id: item.id, name: this.getAccountName(item.id) }
|
||||
this.inputNum = ''
|
||||
console.log(this.rightObj.name)
|
||||
}
|
||||
if (this.showPoup == 'currency') {
|
||||
this.selectIndex = index
|
||||
this.selectCurr = this.currList[index]
|
||||
this.selectCurr = this.filteredCurrList[index]
|
||||
this.inputNum = ''
|
||||
console.log(this.selectCurr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user