完善钱包充值

master
joeyoyo 6 years ago
parent 573433d5b9
commit 5f146b11e9
  1. 3
      html/wallet/html/assets.html
  2. 19
      html/wallet/js/wallet.api.js

@ -283,7 +283,8 @@
walletApi.getRecharge({ walletApi.getRecharge({
walletType: dataInfo.coin.walletType, walletType: dataInfo.coin.walletType,
moduleType: dataInfo.coin.moduleType, moduleType: dataInfo.coin.moduleType,
addr: dataInfo.coin.addr addr: dataInfo.coin.addr,
tokenId:dataInfo.coin.tokenSymbol
}, },
function(data) { function(data) {
app.toast(data.msg) app.toast(data.msg)

@ -122,7 +122,7 @@ define(['mui', 'app', 'ajaxUtil', 'jsencrypt'], function(mui, app, ajaxUtil, jse
eos: { eos: {
//请求充值金額 //请求充值金額
WALLET_RECHARGE: { WALLET_RECHARGE: {
getUrl: btcUrl + "wallet/resetWallet", getUrl: eosUrl + "wallet/resetWallet",
getType: type.POST getType: type.POST
}, },
//请求所有钱包信息 //请求所有钱包信息
@ -291,22 +291,27 @@ define(['mui', 'app', 'ajaxUtil', 'jsencrypt'], function(mui, app, ajaxUtil, jse
fun(moduleType(obj.moduleType, data.data)); fun(moduleType(obj.moduleType, data.data));
}); });
}, },
//充值重置
getRecharge: function(obj, fun) { getRecharge: function(obj, fun) {
console.log(JSON.stringify(obj)); console.log(JSON.stringify(obj));
var params = { var params = {
eth: { eth: {
addr: obj.addr addr: obj.addr,
walletType:obj.walletType,
tokenId:obj.tokenId
}, },
eos: { eos: {
addr: obj.addr addr: obj.addr,
walletType:obj.walletType,
tokenId:obj.tokenId
}, },
btc: { btc: {
addr: obj.addr addr: obj.addr,
walletType:obj.walletType,
tokenId:obj.tokenId
} }
}; };
params[obj.moduleType].walletType = obj.walletType;
params[obj.moduleType].tokenId = obj.moduleType;
ajaxUtil.send(walletApi[obj.moduleType].WALLET_RECHARGE, params[obj.moduleType]).then(function(data) { ajaxUtil.send(walletApi[obj.moduleType].WALLET_RECHARGE, params[obj.moduleType]).then(function(data) {
console.log(JSON.stringify(data)); console.log(JSON.stringify(data));
fun(data); fun(data);

Loading…
Cancel
Save