From 2872bdc4e100e7a0cf452c192ff559cccf34869c Mon Sep 17 00:00:00 2001 From: li Date: Tue, 31 Mar 2026 10:53:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AD=98=E6=AC=BE=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E9=93=BE=E7=B1=BB=E5=9E=8B=E8=BF=87=E6=BB=A4=20+=20=E5=8D=A1?= =?UTF-8?q?=E9=A1=BF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. BTC选择时不显示ERC-20/TRC-20链选择器 2. ETH选择时过滤掉TRC-20,只保留ERC-20 3. USDT保留全部链选项 4. 静态币种(btc_static/eth_static)不调API,构造占位数据防卡顿 5. "Select Coin"改为i18n国际化 6. 银行卡存款按钮间距修复 --- pages/index/recharge.vue | 60 +++++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 7 deletions(-) diff --git a/pages/index/recharge.vue b/pages/index/recharge.vue index c740759..3381e2b 100644 --- a/pages/index/recharge.vue +++ b/pages/index/recharge.vue @@ -49,7 +49,7 @@ - Select Coin + {{i18n.recharge.text1}} {{item.name}} @@ -57,13 +57,13 @@ - - + {{i18n.recharge.text2}} - {{item.lian}} @@ -152,7 +152,7 @@ {{i18n.appeal.text1}} - {{i18n.appeal.text1}} + {{i18n.appeal.text1}} @@ -243,6 +243,28 @@ computed: { i18n() { return this.$t('message'); + }, + // 根据当前选中币种过滤链列表 + // BTC: 只保留名称含 "BTC" 的链(或空) + // ETH: 过滤掉 TRC-20,只保留 ERC-20 + // USDT: 保留全部 + filteredDetail() { + if (!this.detail || this.detail.length === 0) return [] + const name = (this.curr || '').toUpperCase() + if (name === 'BTC') { + // BTC 不需要链选择,只取第一条直接显示地址 + return this.detail.slice(0, 1) + } + if (name === 'ETH') { + // ETH 只保留 ERC-20,过滤掉 TRC-20 + const erc = this.detail.filter(item => { + const lian = (item.lian || '').toUpperCase() + return !lian.includes('TRC') + }) + return erc.length > 0 ? erc : this.detail.slice(0, 1) + } + // USDT 及其他:保留全部 + return this.detail } }, onLoad(e) { @@ -321,8 +343,17 @@ this.bankList = res.data.bank this.detail = res.data.curr this.lian = 0 - this.image = res.data.curr[0].qrcode - this.zhuan_address = res.data.curr[0].address + // 根据当前币种过滤后取第一条链的地址显示 + const name = (this.curr || '').toUpperCase() + let firstChain = res.data.curr[0] + if (name === 'ETH' && res.data.curr.length > 0) { + const erc = res.data.curr.filter(item => { + return !(item.lian || '').toUpperCase().includes('TRC') + }) + if (erc.length > 0) firstChain = erc[0] + } + this.image = firstChain ? firstChain.qrcode : '' + this.zhuan_address = firstChain ? firstChain.address : '' } }) }, @@ -354,6 +385,21 @@ this.currid = item.id this.voucher_image = '' this.voucher_image_up = '' + this.lian = 0 + // 静态条目(btc_static / eth_static)没有真实 API id + // 不调用 getdetails,改为构造占位链数据 + if (item.id === 'btc_static') { + this.detail = [{ lian: 'BTC', qrcode: '', address: '' }] + this.image = '' + this.zhuan_address = '' + return + } + if (item.id === 'eth_static') { + this.detail = [{ lian: 'ERC-20', qrcode: '', address: '' }] + this.image = '' + this.zhuan_address = '' + return + } this.getdetails(this.currid) }, changecurr(item) {