From 2177527775d8323285f62082f0a8711afc0d1ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E6=B5=B7=E6=AC=A3?= Date: Thu, 7 Nov 2019 12:01:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=85=E5=80=BC=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/app.js | 1 - src/api/btc.js | 13 +++++- src/api/eos.js | 14 ++++++- src/api/eth.js | 15 ++++++- src/components/balances/banlanes-tabds.vue | 47 +++++++++++++++++++--- src/locales/lang/balances.en.js | 12 ++++-- src/locales/lang/balances.zh-CN.js | 5 ++- src/locales/lang/balances.zh-HK.js | 5 ++- 8 files changed, 93 insertions(+), 19 deletions(-) diff --git a/src/api/app.js b/src/api/app.js index 4a8d678..cd3db2f 100644 --- a/src/api/app.js +++ b/src/api/app.js @@ -10,7 +10,6 @@ export const userApi = 'http://www.zhixinchains.com/user'; //用户 export const FILE_URL = 'http://www.zhixinchains.com/files/'; //图片地址 - // export const c2cApi = 'https://c2c.flamex.io'; //法币 // export const btcApi = 'https://btc.flamex.io'; //BTC钱包 // export const eosApi = 'https://eos.flamex.io'; //EOS钱包 diff --git a/src/api/btc.js b/src/api/btc.js index 6e67318..53c79d2 100644 --- a/src/api/btc.js +++ b/src/api/btc.js @@ -98,7 +98,18 @@ export function sureOTCTiBtc({toAddr, password, amount, tokenId, walletType}) { }); } +// 点击充值 +export function addBtc({addr, tokenId, walletType}) { + return request({ + url: btcApi + '/wallet/resetWallet', + method: 'post', + params: { + addr, + tokenId, + walletType, + }, + }); +} // OTC钱包请求结束 // 请求函数结束 - diff --git a/src/api/eos.js b/src/api/eos.js index 8235bc8..5c075b8 100644 --- a/src/api/eos.js +++ b/src/api/eos.js @@ -1,7 +1,6 @@ import request from '@/utils/request'; import {eosApi} from './app'; - // 请求函数开始 获取EOS钱包信息,财务记录,充值地址,提币 // 获取钱包EOS币种信息 @@ -95,7 +94,18 @@ export function sureOTCTiEos({ params: {password, toAddr, amount, tokenName, walletType}, }); } - +// 点击充值 +export function addEos({addr, tokenId, walletType}) { + return request({ + url: eosApi + '/wallet/resetWallet', + method: 'post', + params: { + addr, + tokenId, + walletType, + }, + }); +} // OTC钱包请求结束 // 请求函数结束 diff --git a/src/api/eth.js b/src/api/eth.js index 2f2e14e..3c91657 100644 --- a/src/api/eth.js +++ b/src/api/eth.js @@ -32,7 +32,7 @@ export function chargeEth({tokenSymbol}) { // 获取钱包密码公钥 btc,eos,eth共有公钥 export function getKey() { return request({ - url: ethApi + '/wallet/getPublicKey?rd=' + Math.random(),//防止某些浏览器从缓存拿数据 + url: ethApi + '/wallet/getPublicKey?rd=' + Math.random(), //防止某些浏览器从缓存拿数据 method: 'get', }); } @@ -88,7 +88,18 @@ export function sureOTCTiEth({ params: {walletType, tokenAddr, password, toAddr, amount}, }); } - +// 点击充值 +export function addEth({addr, tokenId, walletType}) { + return request({ + url: ethApi + '/wallet/resetWallet', + method: 'post', + params: { + addr, + tokenId, + walletType, + }, + }); +} // OTC钱包请求结束 // 请求函数结束 diff --git a/src/components/balances/banlanes-tabds.vue b/src/components/balances/banlanes-tabds.vue index 907b739..2409ed3 100644 --- a/src/components/balances/banlanes-tabds.vue +++ b/src/components/balances/banlanes-tabds.vue @@ -358,11 +358,11 @@ import BalancesWithdrawalWidget from '@/components/balances/balances-withdrawal- import {getExchangeRateCookie} from '@/utils/auth'; // 获取请求 -import {getBtc, chargeBtc, chargeUsdt, transferBtc} from '@/api/btc.js'; +import {getBtc, chargeBtc, chargeUsdt, transferBtc, addBtc} from '@/api/btc.js'; -import {getEth, chargeEth, transferEth} from '@/api/eth.js'; +import {getEth, chargeEth, transferEth, addEth} from '@/api/eth.js'; -import {getEos, upEosAddr, chargeEos, transferEos} from '@/api/eos.js'; +import {getEos, upEosAddr, chargeEos, transferEos, addEos} from '@/api/eos.js'; import {getLeftPrice} from '@/api/currency.js'; @@ -469,9 +469,46 @@ export default { // this.$message.warning('敬请期待!'); // return; // } - this.ctrl.depositDialogVisible = true; + // this.ctrl.depositDialogVisible = true; this.tatoo = name; - // console.log(this.tatoo); + if (name.tokenSymbol == 'EOS') { + addEos({ + addr: name.addr, + tokenId: name.tokenSymbol, + walletType: 'CCT', + }).then(res => { + if (res.data.code === 200) { + // 充值成功! + this.$message.success(this.$t('balances.table.add')); + } else { + this.$message.error(res.data.msg); + } + }); + } else if (name.tokenSymbol == 'BTC' || name.tokenSymbol == 'USDT') { + addBtc({ + addr: name.addr, + tokenId: name.tokenSymbol, + walletType: 'CCT', + }).then(res => { + if (res.data.code === 200) { + this.$message.success(this.$t('balances.table.add')); + } else { + this.$message.error(res.data.msg); + } + }); + } else { + addEth({ + addr: name.addr, + tokenId: name.tokenSymbol, + walletType: 'CCT', + }).then(res => { + if (res.data.code === 200) { + this.$message.success(this.$t('balances.table.add')); + } else { + this.$message.error(res.data.msg); + } + }); + } break; case 'withdrawal': diff --git a/src/locales/lang/balances.en.js b/src/locales/lang/balances.en.js index e97073d..8c90859 100644 --- a/src/locales/lang/balances.en.js +++ b/src/locales/lang/balances.en.js @@ -13,12 +13,14 @@ export default { header_nodata: 'No Data', header_wan: 'Coin Wallet', header_otc: 'Legal Wallet', - header_last_hua:'Transfer', + header_last_hua: 'Transfer', header_sweep: 'Scan code recharge', header_amout: 'Amount of money raised', header_between: 'Asset rotation', - header_betweenBibi: 'Please transfer the withdrawal to the currency trading account', - header_betweenOtc: 'Please transfer it to the French currency trading account', + header_betweenBibi: + 'Please transfer the withdrawal to the currency trading account', + header_betweenOtc: + 'Please transfer it to the French currency trading account', header_cong: 'From', header_zhuan: 'Turn to', header_many: 'Amount of money', @@ -31,7 +33,9 @@ export default { header_fuzhi: 'Already copied', header_shibai: 'Replication failed, please manually replicate', header_hou: 'Return', - asset_warin:'The amount shall not be 0 or greater than the available balance', + asset_warin: + 'The amount shall not be 0 or greater than the available balance', + add: 'The recharge was successful!', }, }, }; diff --git a/src/locales/lang/balances.zh-CN.js b/src/locales/lang/balances.zh-CN.js index 8edbfc9..784616a 100644 --- a/src/locales/lang/balances.zh-CN.js +++ b/src/locales/lang/balances.zh-CN.js @@ -13,7 +13,7 @@ export default { header_nodata: '暂无数据', header_wan: '币币钱包', header_otc: '法币钱包', - header_last_hua:'划转', + header_last_hua: '划转', header_sweep: '扫码充值', header_amout: '提币数量', header_between: '资产互转', @@ -31,7 +31,8 @@ export default { header_fuzhi: '已复制', header_shibai: '复制失败,请手动复制', header_hou: '返回', - asset_warin:'金额不能为0或者大于可用余额', + asset_warin: '金额不能为0或者大于可用余额', + add: '充值成功!', }, }, }; diff --git a/src/locales/lang/balances.zh-HK.js b/src/locales/lang/balances.zh-HK.js index 284f67d..4cf8eeb 100644 --- a/src/locales/lang/balances.zh-HK.js +++ b/src/locales/lang/balances.zh-HK.js @@ -13,7 +13,7 @@ export default { header_nodata: '暫無數據', header_wan: '幣幣錢包', header_otc: '法幣錢包', - header_last_hua:'劃轉', + header_last_hua: '劃轉', header_sweep: '掃碼充值', header_amout: '提幣數量', header_between: '資產互轉', @@ -31,7 +31,8 @@ export default { header_fuzhi: '已復制', header_shibai: '復制失敗,請手動復制', header_hou: '返回', - asset_warin:'金額不能為0或者大於可用余額', + asset_warin: '金額不能為0或者大於可用余額', + add: '充值成功!', }, }, };