diff --git a/html/wallet/html/assets.html b/html/wallet/html/assets.html index 696c2ce..6095aea 100644 --- a/html/wallet/html/assets.html +++ b/html/wallet/html/assets.html @@ -1,368 +1,376 @@ - - - - - - 资产 - - - - - - - - - - - - -
-
- -

{{coin.walletType | filetWalletType}} — {{coin.tokenSymbol}} {{langue.capital}}

-
-
- - -
-
-
- {{coin.tokenSymbol}} -
-
-
    -
  • - {{langue.amount}} - {{coin.balance}} -
  • -
  • - {{langue.freeBalance}} - {{coin.freeBalance}} -
  • -
  • - {{langue.freezeBalance}} - {{coin.freezeBalance}} -
  • - -
-
-
- - -
-

{{langue.record}}

-
-
-
{{langue.amount}}
-
{{langue.state}}
-
{{langue.dateTime}}
-
-
-
-
-
    -
  • -
    -
    {{row.amount | filtAmount}}
    -
    {{row.status | filtStatus}}
    -
    {{row.createTime || row.timestamp | filtDate}}
    -
    -
  • -
-
-
-
-
-
{{langue.addCredit}}
-
- -
-
{{langue.transfer}}
-
-
-
-
- -
-
-
- - - - + + + + + + 资产 + + + + + + + + + + + + +
+
+ +

{{coin.walletType | filetWalletType}} — {{coin.tokenSymbol}} {{langue.capital}}

+
+
+ + +
+
+
+ {{coin.tokenSymbol}} +
+
+
    +
  • + {{langue.amount}} + {{coin.balance}} +
  • +
  • + {{langue.freeBalance}} + {{coin.freeBalance}} +
  • +
  • + {{langue.freezeBalance}} + {{coin.freezeBalance}} +
  • + +
+
+
+ + +
+

{{langue.record}}

+
+
+
{{langue.amount}}
+
{{langue.state}}
+
{{langue.dateTime}}
+
+
+
+
+
    +
  • +
    +
    {{row.amount | filtAmount}}
    +
    {{row.status | filtStatus}}
    +
    {{row.createTime || row.timestamp | filtDate}}
    +
    +
  • +
+
+
+
+
+
{{langue.addCredit}}
+
+
+
{{langue.withdrawCoin}}
+
+
+
{{langue.transfer}}
+
+
+
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/html/wallet/html/wallet.html b/html/wallet/html/wallet.html index eb00aa1..c094517 100644 --- a/html/wallet/html/wallet.html +++ b/html/wallet/html/wallet.html @@ -1,310 +1,313 @@ - - - - - - 钱包 - - - - - - - - - - - - - - - - -
-
-

{{langue.title}}

-
-
-
-
-
-
-
- - {{langue.valuation}}({{valuation[row].baseCoin}}) - {{valuation[row].countCoin}} - ≈{{valuation[row].countAmount}} {{valuation[row].moneyKey}} -
-
-
-
-
-
-
    - -
  • -
    -
    - {{coin.tokenSymbol}} -
    -
    - {{langue.free}}:{{coin.freeBalance}} - {{langue.freeze}}:{{coin.freezeBalance}} -
    -
  • - -
  • -
    -
    - {{coin.tokenSymbol}} -
    -
    - {{langue.free}}:{{coin.freeBalance}} - {{langue.freeze}}:{{coin.freezeBalance}} -
    -
  • -
-
-
-
- - - - + + + + + + 钱包 + + + + + + + + + + + + + + + + +
+
+

{{langue.title}}

+
+
+
+
+
+
+
+ + {{langue.valuation}}({{valuation[row].baseCoin}}) + {{valuation[row].countCoin}} + ≈{{valuation[row].countAmount}} {{valuation[row].moneyKey}} +
+
+
+
+
+
+
    + +
  • +
    +
    + {{coin.tokenSymbol}} +
    +
    + {{langue.free}}:{{coin.freeBalance}} + {{langue.freeze}}:{{coin.freezeBalance}} +
    +
  • + +
  • +
    +
    + {{coin.tokenSymbol}} +
    +
    + {{langue.free}}:{{coin.freeBalance}} + {{langue.freeze}}:{{coin.freezeBalance}} +
    +
  • +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/wallet/js/wallet.api.js b/html/wallet/js/wallet.api.js index f7f5347..380d7d9 100644 --- a/html/wallet/js/wallet.api.js +++ b/html/wallet/js/wallet.api.js @@ -1,431 +1,467 @@ -/** - * @NAME YH - * @DATE 2019年2月24日10:41:28 - * @INFO 钱包接口JS - */ -define(['mui', 'app', 'ajaxUtil', 'jsencrypt'], function(mui, app, ajaxUtil, jsencrypt) { - var ethUrl = app.ethBaseUrl; // ETH模块请求连接 - var btcUrl = app.btcBaseUrl; // BTC模块请求连接 - var eosUrl = app.eosBaseUrl; // EOS模块请求连接 - var userUrl = app.walletBaseUrl; // 用户模块 - // 请求方式 - var type = { - GET: "GET", - POST: "POST" - } - // 钱包类型 - var walletType = { - CCT: "CCT", - C2C: "C2C" - } - // 钱包公用API - var baseApi = { - // 获取公钥请求信息 - AJAX_PULICKEY: { - getUrl: ethUrl + "wallet/getPublicKey", - getType: type.GET - }, - // 修改钱包资金密码接口 - AJAX_SAVEPASS: { - getUrl: ethUrl + "wallet/saveWalletPass", - getType: type.POST - }, - // 查询是否绑定资金密码 - AJAX_WALLETPASS: { - getUrl: ethUrl + "wallet/existsPass", - getType: type.GET - }, - // 获取修改资金密码的验证码 - AJAX_SENDCODE: { - getUrl: userUrl + "user/sendMoneyPasswordSmsg", - getType: type.GET - } - } - // 钱包API - var walletApi = { - eth: { - //请求所有钱包信息 - WALLET_INFOS: { - getUrl: ethUrl + "wallet/getWallets", - getType: type.GET - }, - //请求某种钱包币种信息 - WALLET_INFO: { - getUrl: ethUrl + "wallet/getWallet", - getType: type.GET - }, - // 获取币种财务记录记录 - WALLET_RECORD: { - getUrl: ethUrl + "walletTransfer/getTransfer", - getType: type.GET - }, - // 提现申请 - WALLET_WITHDRAWDEPOSIT: { - getUrl: ethUrl + "wallet/withdrawDeposit", - getType: type.POST - }, - // 划转 - WALLET_HANDLETRANSFER: { - getUrl: ethUrl + "wallet/transfer", - getType: type.POST - }, - // 提现申请手续费信息 - WALLET_WITHDRAW_GAS: { - getUrl: ethUrl + "walletParam/getGasConfig", - getType: type.GET - }, - - }, - btc: { - //请求所有钱包信息 - WALLET_INFOS: { - getUrl: btcUrl + "wallet/getWallets", - getType: type.GET - }, - //请求某种钱包币种信息 - WALLET_INFO: { - getUrl: btcUrl + "wallet/getWallet", - getType: type.GET - }, - // 获取币种财务记录记录 - WALLET_RECORD: { - getUrl: btcUrl + "walletTransfer/getTransfer", - getType: type.GET - }, - // 提现申请 - WALLET_WITHDRAWDEPOSIT: { - getUrl: btcUrl + "walletTransfer/withdraw", - getType: type.POST - }, - // 划转 - WALLET_HANDLETRANSFER: { - getUrl: btcUrl + "wallet/transfer", - getType: type.POST - }, - // 提现申请手续费信息 - WALLET_WITHDRAW_GAS: { - getUrl: btcUrl + "walletParam/getGasConfig", - getType: type.GET - }, - - }, - eos: { - //请求所有钱包信息 - WALLET_INFOS: { - getUrl: eosUrl + "wallet/selectWalletByWalletType", - getType: type.GET - }, - //请求某种钱包币种信息 - WALLET_INFO: { - getUrl: eosUrl + "wallet/selectWalletByTokenName", - getType: type.GET - }, - // 获取币种财务记录记录 - WALLET_RECORD: { - getUrl: eosUrl + "walletTransfer/getTransfer", - getType: type.GET - }, - // 获取EOS充值账号 - WALLET_IN_USERNAME: { - getUrl: eosUrl + "walletIn/listWalletInAccount", - getType: type.POST - }, - // 提现申请 - WALLET_WITHDRAWDEPOSIT: { - getUrl: eosUrl + "wallet/withdrawDeposit", - getType: type.POST - }, - // 划转 - WALLET_HANDLETRANSFER: { - getUrl: eosUrl + "wallet/transfer", - getType: type.POST - }, - // 提现申请手续费信息 - WALLET_WITHDRAW_GAS: { - getUrl: eosUrl + "configWalletParam/selectConfigWalletParam", - getType: type.GET - }, - }, - } - /** - * 设置多个币种属于什么模块 - * @param {Object} type - * @param {Object} coins - */ - function moduleTypes(type, coins) { - coins || (coins = []); - for(var i = 0; i < coins.length; i++) { - moduleType(type, coins[i]); - } - return coins; - } - /** - * 设置币种属于什么模块 - * @param {Object} type - * @param {Object} coins - */ - function moduleType(type, coin) { - coin.moduleType = type; - coin.balance = app.formatValue(coin.balance); - coin.freeBalance = app.formatValue(coin.freeBalance); - coin.freezeBalance = app.formatValue(coin.freezeBalance); - coin.src = '../img/coin/' + coin.tokenSymbol + '.png'; - if('tokenId' in coin) { - coin.tokenAddr = coin.tokenId; - } - if('tokenName' in coin) { - coin.tokenAddr = coin.tokenName; - } - if(!('addr' in coin)) { - coin.addr = ''; - } - return coin; - } - - function baseGetWallet(type, fun) { - // #请求数据 - var obj = { - btc: [], - eth: [], - eos: [] - }; - var count = 0; - ajaxUtil.send(walletApi.eth.WALLET_INFOS, { - walletType: type - }).then(function(data) { - obj.eth = moduleTypes('eth', data.data); - count++; - }, function() { - count++; - }); - ajaxUtil.send(walletApi.btc.WALLET_INFOS, { - walletType: type - }).then(function(data) { - obj.btc = moduleTypes('btc', data.data); - count++; - }, function() { - count++; - }); - // EOS币种信息查询 - ajaxUtil.send(walletApi.eos.WALLET_INFOS, { - walletType: type - }).then(function(data) { - obj.eos = moduleTypes('eos', data.data); - count++; - }, function() { - count++; - }); - // #数据同步处理,放进缓存 - var time = 1000; - setTimeout(function() { - if(count >= Object.keys(obj).length) { - var coins = obj.btc.concat(obj.eth).concat(obj.eos); - for(var j = 0; j < coins.length; j++) { - coins[j].coinIndex = j; - } - if(Object.is(type, walletType.CCT)) { - app.setCoinWalletInfoLocalStorage(coins); - } - if(Object.is(type, walletType.C2C)) { - app.setC2CCoinWalletInfoLocalStorage(coins); - } - fun(coins); - } else { - setTimeout(arguments.callee, time) - } - }, time); - } - return { - SUCCESS_CODE: 200, - walletType: walletType, - /** - * 获取CCT所有币种信息 - * @param {Function} fun 回调方法 - */ - getCCTWallets: function(fun) { - baseGetWallet(walletType.CCT, fun) - }, - /** - * 获取C2C所有币种信息 - * @param {Function} fun 回调方法 - */ - getC2CWallets: function(fun) { - baseGetWallet(walletType.C2C, fun) - }, - /** - * 获取CCT某种币种信息 - * @param {Object} (moduleType 所属模块,tokenAddr 币种地址) - * @param {Function} 回调方法 - */ - getWallet: function(obj, fun) { - console.log(JSON.stringify(obj)); - var params = { - eth: { - tokenAddr: obj.tokenAddr - }, - eos: { - tokenName: obj.tokenAddr - }, - btc: { - tokenId: obj.tokenAddr - } - }; - params[obj.moduleType].walletType = obj.walletType; - ajaxUtil.send(walletApi[obj.moduleType].WALLET_INFO, params[obj.moduleType]).then(function(data) { - console.log(JSON.stringify(data)); - fun(moduleType(obj.moduleType, data.data)); - }); - }, - /** - * 获取CCT某种币种的财务记录 - * @param {Object} obj - * @param {Object} fun - */ - getWalletRecord: function(obj, fun) { - var params = { - eth: { - tokenAddr: obj.tokenAddr - }, - eos: { - tokenName: obj.tokenAddr - }, - btc: { - tokenId: obj.tokenAddr - } - }; - params[obj.moduleType].walletType = obj.walletType; - params[obj.moduleType].pageNum = obj.pageNum; - params[obj.moduleType].pageSize = obj.pageSize; - ajaxUtil.send(walletApi[obj.moduleType].WALLET_RECORD, params[obj.moduleType]).then(function(data) { - fun(data.data); - }); - }, - - /** - * 获取CCT,EOS - * @param {String} tokenName eos币种名称 - * @param {Function} fun - */ - getCCTEosInUserName: function(obj, fun) { - ajaxUtil.send(walletApi.eos.WALLET_IN_USERNAME, obj).then(function(data) { - fun(data.data); - }); - }, - /** - * CCT应用钱包的提现申请 - * @param {Object} obj - */ - withdrawDeposit: function(obj) { - var params = { - eth: { - tokenAddr: obj.tokenAddr - }, - eos: { - tokenName: obj.tokenAddr - }, - btc: { - tokenId: obj.tokenAddr - } - }; - params[obj.moduleType].walletType = obj.walletType; - params[obj.moduleType].amount = obj.amount; // 提现余额 - params[obj.moduleType].toAddr = obj.toAddr; // 接收地址 - params[obj.moduleType].password = obj.password; // 密码 - return ajaxUtil.send(walletApi[obj.moduleType].WALLET_WITHDRAWDEPOSIT, params[obj.moduleType]); - }, - - /** - * CCT提现手续费详情 - * @param {String} tokenSymbol 名称 - * @param {Function} fun - */ - getCoinGasInfo: function(obj, fun) { - ajaxUtil.send(walletApi[obj.moduleType].WALLET_WITHDRAW_GAS, { - tokenSymbol: obj.tokenSymbol - }).then(function(data) { - fun(data.data); - }); - }, - /** - * 加密密码 - * @param {String} pass 密码 - * @param {Function} fun 回调方法 - */ - getPublicKey: function(pass, fun) { - ajaxUtil.send(baseApi.AJAX_PULICKEY).then(function(data) { - var pulicData = data.data; - var crypt = new JSEncrypt({ - default_key_size: 1024 - }); - crypt.setPublicKey(pulicData); - fun(crypt.encrypt(pass)); - }); - }, - /** - * 更新钱包密码 - * @param {Object} obj - * @param {Object} fun - */ - saveWalletPass: function(obj, fun) { - var curObj = this; - //加密钱包密码 - curObj.getPublicKey(obj.password, function(pass) { - obj.password = pass; - ajaxUtil.send(baseApi.AJAX_SAVEPASS, obj).then(function(data) { - if(curObj.SUCCESS_CODE == data.code) { - app.setIsWalletPassLocalStorage(true); - } - fun(data); - }); - }) - }, - /** - * 查询是否设置资金密码 - * - */ - voidServieWalletPass: function(fun) { - var curObj = this; - ajaxUtil.send(baseApi.AJAX_WALLETPASS).then(function(data) { - if(curObj.SUCCESS_CODE == data.code) { - app.setIsWalletPassLocalStorage(data.data); - if(fun != null) { - fun(); - } - } - }); - }, - /** - * 发送资金密码的验证码 - */ - getSendCode: function() { - ajaxUtil.send(baseApi.AJAX_SENDCODE).then(function(data) { - console.log(JSON.stringify(data)); - }); - }, - /** - * 划转 - * @param {Object} data - */ - handleTransfer: function(data, fun) { - - ajaxUtil.send(walletApi[data.moduleType].WALLET_HANDLETRANSFER, data).then(function(data) { - fun(data); - }); - }, - /** - * 格式化 - */ - formatValue: function(value, d) { - if(value == "") return ""; - if(parseFloat(value) == 0) return value; - if(/^\.\.+/.test(value) || !/^\d.*/.test(value)) { - return ""; - } - value = value.replace(/[^\d\.]/g, ""); //清除“数字”和“.”以外的字符 - if(/\d+\.\d+/.test(value)){ - return parseInt(parseFloat(value) * Math.pow(10,d)) / Math.pow(10,d); - } - return value ; - } - } +/** + * @NAME YH + * @DATE 2019年2月24日10:41:28 + * @INFO 钱包接口JS + */ +define(['mui', 'app', 'ajaxUtil', 'jsencrypt'], function(mui, app, ajaxUtil, jsencrypt) { + var ethUrl = app.ethBaseUrl; // ETH模块请求连接 + var btcUrl = app.btcBaseUrl; // BTC模块请求连接 + var eosUrl = app.eosBaseUrl; // EOS模块请求连接 + var userUrl = app.walletBaseUrl; // 用户模块 + // 请求方式 + var type = { + GET: "GET", + POST: "POST" + } + // 钱包类型 + var walletType = { + CCT: "CCT", + C2C: "C2C" + } + // 钱包公用API + var baseApi = { + // 获取公钥请求信息 + AJAX_PULICKEY: { + getUrl: ethUrl + "wallet/getPublicKey", + getType: type.GET + }, + // 修改钱包资金密码接口 + AJAX_SAVEPASS: { + getUrl: ethUrl + "wallet/saveWalletPass", + getType: type.POST + }, + // 查询是否绑定资金密码 + AJAX_WALLETPASS: { + getUrl: ethUrl + "wallet/existsPass", + getType: type.GET + }, + // 获取修改资金密码的验证码 + AJAX_SENDCODE: { + getUrl: userUrl + "user/sendMoneyPasswordSmsg", + getType: type.GET + } + } + // 钱包API + var walletApi = { + eth: { + //请求充值金額 + WALLET_RECHARGE: { + getUrl: ethUrl + "wallet/resetWallet", + getType: type.POST + }, + //请求所有钱包信息 + WALLET_INFOS: { + getUrl: ethUrl + "wallet/getWallets", + getType: type.GET + }, + //请求某种钱包币种信息 + WALLET_INFO: { + getUrl: ethUrl + "wallet/getWallet", + getType: type.GET + }, + // 获取币种财务记录记录 + WALLET_RECORD: { + getUrl: ethUrl + "walletTransfer/getTransfer", + getType: type.GET + }, + // 提现申请 + WALLET_WITHDRAWDEPOSIT: { + getUrl: ethUrl + "wallet/withdrawDeposit", + getType: type.POST + }, + // 划转 + WALLET_HANDLETRANSFER: { + getUrl: ethUrl + "wallet/transfer", + getType: type.POST + }, + // 提现申请手续费信息 + WALLET_WITHDRAW_GAS: { + getUrl: ethUrl + "walletParam/getGasConfig", + getType: type.GET + }, + + }, + btc: { + //请求充值金額 + WALLET_RECHARGE: { + getUrl: btcUrl + "wallet/resetWallet", + getType: type.POST + }, + //请求所有钱包信息 + WALLET_INFOS: { + getUrl: btcUrl + "wallet/getWallets", + getType: type.GET + }, + //请求某种钱包币种信息 + WALLET_INFO: { + getUrl: btcUrl + "wallet/getWallet", + getType: type.GET + }, + // 获取币种财务记录记录 + WALLET_RECORD: { + getUrl: btcUrl + "walletTransfer/getTransfer", + getType: type.GET + }, + // 提现申请 + WALLET_WITHDRAWDEPOSIT: { + getUrl: btcUrl + "walletTransfer/withdraw", + getType: type.POST + }, + // 划转 + WALLET_HANDLETRANSFER: { + getUrl: btcUrl + "wallet/transfer", + getType: type.POST + }, + // 提现申请手续费信息 + WALLET_WITHDRAW_GAS: { + getUrl: btcUrl + "walletParam/getGasConfig", + getType: type.GET + }, + + }, + eos: { + //请求充值金額 + WALLET_RECHARGE: { + getUrl: btcUrl + "wallet/resetWallet", + getType: type.POST + }, + //请求所有钱包信息 + WALLET_INFOS: { + getUrl: eosUrl + "wallet/selectWalletByWalletType", + getType: type.GET + }, + //请求某种钱包币种信息 + WALLET_INFO: { + getUrl: eosUrl + "wallet/selectWalletByTokenName", + getType: type.GET + }, + // 获取币种财务记录记录 + WALLET_RECORD: { + getUrl: eosUrl + "walletTransfer/getTransfer", + getType: type.GET + }, + // 获取EOS充值账号 + WALLET_IN_USERNAME: { + getUrl: eosUrl + "walletIn/listWalletInAccount", + getType: type.POST + }, + // 提现申请 + WALLET_WITHDRAWDEPOSIT: { + getUrl: eosUrl + "wallet/withdrawDeposit", + getType: type.POST + }, + // 划转 + WALLET_HANDLETRANSFER: { + getUrl: eosUrl + "wallet/transfer", + getType: type.POST + }, + // 提现申请手续费信息 + WALLET_WITHDRAW_GAS: { + getUrl: eosUrl + "configWalletParam/selectConfigWalletParam", + getType: type.GET + }, + }, + } + /** + * 设置多个币种属于什么模块 + * @param {Object} type + * @param {Object} coins + */ + function moduleTypes(type, coins) { + coins || (coins = []); + for(var i = 0; i < coins.length; i++) { + moduleType(type, coins[i]); + } + return coins; + } + /** + * 设置币种属于什么模块 + * @param {Object} type + * @param {Object} coins + */ + function moduleType(type, coin) { + coin.moduleType = type; + coin.balance = app.formatValue(coin.balance); + coin.freeBalance = app.formatValue(coin.freeBalance); + coin.freezeBalance = app.formatValue(coin.freezeBalance); + coin.src = '../img/coin/' + coin.tokenSymbol + '.png'; + if('tokenId' in coin) { + coin.tokenAddr = coin.tokenId; + } + if('tokenName' in coin) { + coin.tokenAddr = coin.tokenName; + } + if(!('addr' in coin)) { + coin.addr = ''; + } + return coin; + } + + function baseGetWallet(type, fun) { + // #请求数据 + var obj = { + btc: [], + eth: [], + eos: [] + }; + var count = 0; + ajaxUtil.send(walletApi.eth.WALLET_INFOS, { + walletType: type + }).then(function(data) { + obj.eth = moduleTypes('eth', data.data); + count++; + }, function() { + count++; + }); + ajaxUtil.send(walletApi.btc.WALLET_INFOS, { + walletType: type + }).then(function(data) { + obj.btc = moduleTypes('btc', data.data); + count++; + }, function() { + count++; + }); + // EOS币种信息查询 + ajaxUtil.send(walletApi.eos.WALLET_INFOS, { + walletType: type + }).then(function(data) { + obj.eos = moduleTypes('eos', data.data); + count++; + }, function() { + count++; + }); + // #数据同步处理,放进缓存 + var time = 1000; + setTimeout(function() { + if(count >= Object.keys(obj).length) { + var coins = obj.btc.concat(obj.eth).concat(obj.eos); + for(var j = 0; j < coins.length; j++) { + coins[j].coinIndex = j; + } + if(Object.is(type, walletType.CCT)) { + app.setCoinWalletInfoLocalStorage(coins); + } + if(Object.is(type, walletType.C2C)) { + app.setC2CCoinWalletInfoLocalStorage(coins); + } + fun(coins); + } else { + setTimeout(arguments.callee, time) + } + }, time); + } + return { + SUCCESS_CODE: 200, + walletType: walletType, + /** + * 获取CCT所有币种信息 + * @param {Function} fun 回调方法 + */ + getCCTWallets: function(fun) { + baseGetWallet(walletType.CCT, fun) + }, + /** + * 获取C2C所有币种信息 + * @param {Function} fun 回调方法 + */ + getC2CWallets: function(fun) { + baseGetWallet(walletType.C2C, fun) + }, + /** + * 获取CCT某种币种信息 + * @param {Object} (moduleType 所属模块,tokenAddr 币种地址) + * @param {Function} 回调方法 + */ + getWallet: function(obj, fun) { + console.log(JSON.stringify(obj)); + var params = { + eth: { + tokenAddr: obj.tokenAddr + }, + eos: { + tokenName: obj.tokenAddr + }, + btc: { + tokenId: obj.tokenAddr + } + }; + params[obj.moduleType].walletType = obj.walletType; + ajaxUtil.send(walletApi[obj.moduleType].WALLET_INFO, params[obj.moduleType]).then(function(data) { + console.log(JSON.stringify(data)); + fun(moduleType(obj.moduleType, data.data)); + }); + }, + + getRecharge: function(obj, fun) { + console.log(JSON.stringify(obj)); + var params = { + eth: { + addr: obj.addr + }, + eos: { + addr: obj.addr + }, + btc: { + addr: obj.addr + } + }; + 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) { + console.log(JSON.stringify(data)); + fun(data); + }); + }, + /** + * 获取CCT某种币种的财务记录 + * @param {Object} obj + * @param {Object} fun + */ + getWalletRecord: function(obj, fun) { + var params = { + eth: { + tokenAddr: obj.tokenAddr + }, + eos: { + tokenName: obj.tokenAddr + }, + btc: { + tokenId: obj.tokenAddr + } + }; + params[obj.moduleType].walletType = obj.walletType; + params[obj.moduleType].pageNum = obj.pageNum; + params[obj.moduleType].pageSize = obj.pageSize; + ajaxUtil.send(walletApi[obj.moduleType].WALLET_RECORD, params[obj.moduleType]).then(function(data) { + fun(data.data); + }); + }, + + /** + * 获取CCT,EOS + * @param {String} tokenName eos币种名称 + * @param {Function} fun + */ + getCCTEosInUserName: function(obj, fun) { + ajaxUtil.send(walletApi.eos.WALLET_IN_USERNAME, obj).then(function(data) { + fun(data.data); + }); + }, + /** + * CCT应用钱包的提现申请 + * @param {Object} obj + */ + withdrawDeposit: function(obj) { + var params = { + eth: { + tokenAddr: obj.tokenAddr + }, + eos: { + tokenName: obj.tokenAddr + }, + btc: { + tokenId: obj.tokenAddr + } + }; + params[obj.moduleType].walletType = obj.walletType; + params[obj.moduleType].amount = obj.amount; // 提现余额 + params[obj.moduleType].toAddr = obj.toAddr; // 接收地址 + params[obj.moduleType].password = obj.password; // 密码 + return ajaxUtil.send(walletApi[obj.moduleType].WALLET_WITHDRAWDEPOSIT, params[obj.moduleType]); + }, + + /** + * CCT提现手续费详情 + * @param {String} tokenSymbol 名称 + * @param {Function} fun + */ + getCoinGasInfo: function(obj, fun) { + ajaxUtil.send(walletApi[obj.moduleType].WALLET_WITHDRAW_GAS, { + tokenSymbol: obj.tokenSymbol + }).then(function(data) { + fun(data.data); + }); + }, + /** + * 加密密码 + * @param {String} pass 密码 + * @param {Function} fun 回调方法 + */ + getPublicKey: function(pass, fun) { + ajaxUtil.send(baseApi.AJAX_PULICKEY).then(function(data) { + var pulicData = data.data; + var crypt = new JSEncrypt({ + default_key_size: 1024 + }); + crypt.setPublicKey(pulicData); + fun(crypt.encrypt(pass)); + }); + }, + /** + * 更新钱包密码 + * @param {Object} obj + * @param {Object} fun + */ + saveWalletPass: function(obj, fun) { + var curObj = this; + //加密钱包密码 + curObj.getPublicKey(obj.password, function(pass) { + obj.password = pass; + ajaxUtil.send(baseApi.AJAX_SAVEPASS, obj).then(function(data) { + if(curObj.SUCCESS_CODE == data.code) { + app.setIsWalletPassLocalStorage(true); + } + fun(data); + }); + }) + }, + /** + * 查询是否设置资金密码 + * + */ + voidServieWalletPass: function(fun) { + var curObj = this; + ajaxUtil.send(baseApi.AJAX_WALLETPASS).then(function(data) { + if(curObj.SUCCESS_CODE == data.code) { + app.setIsWalletPassLocalStorage(data.data); + if(fun != null) { + fun(); + } + } + }); + }, + /** + * 发送资金密码的验证码 + */ + getSendCode: function() { + ajaxUtil.send(baseApi.AJAX_SENDCODE).then(function(data) { + console.log(JSON.stringify(data)); + }); + }, + /** + * 划转 + * @param {Object} data + */ + handleTransfer: function(data, fun) { + + ajaxUtil.send(walletApi[data.moduleType].WALLET_HANDLETRANSFER, data).then(function(data) { + fun(data); + }); + }, + /** + * 格式化 + */ + formatValue: function(value, d) { + if(value == "") return ""; + if(parseFloat(value) == 0) return value; + if(/^\.\.+/.test(value) || !/^\d.*/.test(value)) { + return ""; + } + value = value.replace(/[^\d\.]/g, ""); //清除“数字”和“.”以外的字符 + if(/\d+\.\d+/.test(value)) { + return parseInt(parseFloat(value) * Math.pow(10, d)) / Math.pow(10, d); + } + return value; + } + } }) \ No newline at end of file diff --git a/mine/html/my/my_about_us.html b/mine/html/my/my_about_us.html index 1d7db57..49a3b5e 100644 --- a/mine/html/my/my_about_us.html +++ b/mine/html/my/my_about_us.html @@ -1,568 +1,568 @@ - - - - - - - 关于我们 - - - - - - - - - - - - - - -
-
- -

{{langue.about}}

-
-
-
- -
-

{{langue.name}}

-

Version {{version}}

- -
-
- -

- {{langue.name}}
- Copyright © 2019 FLAMEX.IO Corporation.
- All Rights Reserved. -

-
- - -
-
- - - - - + + + + + + + + + +
+
+ +

{{langue.about}}

+
+
+
+ +
+

{{langue.name}}

+

Version {{version}}

+ +
+
+ +

+ {{langue.name}}
+ Copyright © 2019 Zhixin.IO Corporation.
+ All Rights Reserved. +

+
+ + +
+
+ + + + + \ No newline at end of file diff --git a/mine/html/my/share_app.html b/mine/html/my/share_app.html index 773de7c..69d234e 100644 --- a/mine/html/my/share_app.html +++ b/mine/html/my/share_app.html @@ -1,135 +1,135 @@ - - - - - - - 分享APP - - - - - - - - - - - - - - -
-
- -

{{langue.about}}

-
-
-
- -
-

{{langue.name}}

-
- -

{{langue.note}}

-
-
-
-

- {{langue.name}}
- Copyright © 2019 flame.io Corporation.
- All Rights Reserved. -

-
-
- - - - - + + + + + + + + + +
+
+ +

{{langue.about}}

+
+
+
+ +
+

{{langue.name}}

+
+ +

{{langue.note}}

+
+
+
+

+ {{langue.name}}
+ Copyright © 2019 flame.io Corporation.
+ All Rights Reserved. +

+
+
+ + + + + \ No newline at end of file diff --git a/mine/html/wallet_my.html b/mine/html/wallet_my.html index 547ed82..937cbb2 100644 --- a/mine/html/wallet_my.html +++ b/mine/html/wallet_my.html @@ -1,615 +1,618 @@ - - - - - - - 钱包首页 - - - - - - - - - - - - - - - - - - - -
-
-

{{langue.title}}

- {{langue.cancelMarket}} -
-
-
-
- {{getUserImg}} -
-
- {{langue.notLogin}} - {{langue.notLoginText}} -
-
- {{userLocalStorage.nickName}} -

{{langue.username}}:{{userLocalStorage.mobilePhone}}

-
- -
- -
-
- - - - - - - + + + + + + + + + + + + + + +
+
+

{{langue.title}}

+ {{langue.cancelMarket}} +
+
+
+
+ {{getUserImg}} +
+
+ {{langue.notLogin}} + {{langue.notLoginText}} +
+
+ {{userLocalStorage.nickName}} +

{{langue.username}}:{{userLocalStorage.mobilePhone}}

+
+ +
+ +
+
+ + + + + + + diff --git a/mine/html/wallet_pass_login.html b/mine/html/wallet_pass_login.html index 44e97e7..78dc6f7 100644 --- a/mine/html/wallet_pass_login.html +++ b/mine/html/wallet_pass_login.html @@ -1,411 +1,410 @@ - - - - - - - 我的登录 - - - - - - - - - - - - - - - - - - -
-
- -

{{langue.title}}

- {{langue.Codelogin}} -
-
-
- - - - - -
- - - -
-
- - -
-
-

- {{langue.register}} -

-

- {{langue.ForgetThePassword}} -

-
-
- -
-
- - - - - + + + + + + + + + + + + + +
+
+ +

{{langue.title}}

+ {{langue.Codelogin}} +
+
+
+ + + + + +
+ + + +
+
+ + +
+
+

+ {{langue.register}} +

+

+ {{langue.ForgetThePassword}} +

+
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/mine/img/logo.png b/mine/img/logo.png index 06f8cda..1dae9c7 100644 Binary files a/mine/img/logo.png and b/mine/img/logo.png differ diff --git a/mine/img/shareLogo.jpg b/mine/img/shareLogo.jpg deleted file mode 100644 index 0e988a8..0000000 Binary files a/mine/img/shareLogo.jpg and /dev/null differ diff --git a/mine/img/yanhuo_logo.jpg b/mine/img/yanhuo_logo.jpg deleted file mode 100644 index 729daf2..0000000 Binary files a/mine/img/yanhuo_logo.jpg and /dev/null differ