完善钱包和修改logo

master
joeyoyo 5 years ago
parent 06f7b4493a
commit 573433d5b9
  1. 742
      html/wallet/html/assets.html
  2. 621
      html/wallet/html/wallet.html
  3. 896
      html/wallet/js/wallet.api.js
  4. 1134
      mine/html/my/my_about_us.html
  5. 268
      mine/html/my/share_app.html
  6. 1231
      mine/html/wallet_my.html
  7. 819
      mine/html/wallet_pass_login.html
  8. BIN
      mine/img/logo.png
  9. BIN
      mine/img/shareLogo.jpg
  10. BIN
      mine/img/yanhuo_logo.jpg

@ -1,368 +1,376 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>资产</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
<link href="../../../lib/css/mui.min.css" rel="stylesheet" />
<!--引入公共样式-->
<link href="../../../lib/css/basic.css" rel="stylesheet" />
<link href="../css/assets.css" rel="stylesheet" />
<script src="../../../lib/js/rem-layout.js"></script>
<script src="../../../lib/js/require2.1.11.js"></script>
<script type="text/javascript" src="../js/base.config.js"></script>
</head>
<body>
<div id="js-data-info">
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">{{coin.walletType | filetWalletType}} — {{coin.tokenSymbol}} {{langue.capital}}</h1>
</header>
<div class="mui-content">
<!--代币信息-->
<div class="coin">
<div class="coin-kind">
<div class="coin-kind-img"><img :src="coin.src" /></div>
<span class="coin-kind-txt">{{coin.tokenSymbol}}</span>
</div>
<div class="coin-item">
<ul>
<li class="coin-item-list">
<span class="coin-item-list-txt">{{langue.amount}}</span>
<span class="coin-item-list-num">{{coin.balance}}</span>
</li>
<li class="coin-item-list">
<span class="coin-item-list-txt">{{langue.freeBalance}}</span>
<span class="coin-item-list-num">{{coin.freeBalance}}</span>
</li>
<li class="coin-item-list">
<span class="coin-item-list-txt">{{langue.freezeBalance}}</span>
<span class="coin-item-list-num">{{coin.freezeBalance}}</span>
</li>
<!--<li class="coin-item-list">
<span class="coin-item-list-txt">{{langue.valuation}}({{marketData ? marketData.basecoin : 'USDT'}})</span>
<span class="coin-item-list-num">{{valuation.countCoin}}</span>
</li>
<li class="coin-item-list">
<span class="coin-item-list-txt">{{langue.valuation}}({{valuation.moneyKey}})</span>
<span class="coin-item-list-num">{{valuation.countAmount}}</span>
</li>-->
</ul>
</div>
</div>
<!--去交易-->
<div class="transaction">
<h3>{{langue.record}}</h3>
<div class="transaction-data">
<div class="mui-row transaction-data-title">
<div class="mui-col-sm-4 mui-col-xs-4">{{langue.amount}}</div>
<div class="mui-col-sm-4 mui-col-xs-4">{{langue.state}}</div>
<div class="mui-col-sm-4 mui-col-xs-4 mui-text-right">{{langue.dateTime}}</div>
</div>
<div class="record-contorol">
<div class="mui-scroll-wrapper">
<div id="js-scroll" class=" mui-scroll">
<ul class="mui-table-view transaction-data-record">
<li class="mui-table-view-cell mui-row js-coin-record" v-for="(row,index) in coinRecord" :data-index="index">
<div class="mui-row">
<div class="mui-col-sm-4 mui-col-xs-4 mui-ellipsis">{{row.amount | filtAmount}}</div>
<div class="mui-col-sm-4 mui-col-xs-4">{{row.status | filtStatus}}</div>
<div class="mui-col-sm-4 mui-col-xs-4 mui-text-right">{{row.createTime || row.timestamp | filtDate}}</div>
</div>
</li>
</ul>
</div>
</div>
<div class="btn mui-row" v-if="coin.tokenSymbol != 'DIA' && coin.tokenSymbol != 'TIN' ">
<div class="mui-col-sm-6 mui-col-xs-6">
<div class="btn-recharge" id="btn-recharge">{{langue.addCredit}}</div>
</div>
<!--<div class="mui-col-sm-4 mui-col-xs-4">
<div class="btn-withdraw" id="btn-withdraw">{{langue.withdrawCoin}}</div>
</div>-->
<div class="mui-col-sm-6 mui-col-xs-6">
<div class="btn-transfer" id="btn-transfer">{{langue.transfer}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript">
define('langues', {
zh_CN: {
capital: "资产",
title: "钱包",
totalBalance: "总额",
valuation: "估值",
addCredit: "充值",
withdrawCoin: "提现",
transfer: '划转',
freeBalance: "可用余额",
freezeBalance: "冻结余额",
succeed: "成功",
error: "失败",
coinWallet: "币币钱包",
currencyWallet: "法币钱包",
dateTime: "时间",
amount: "数量",
state: "状态",
await: "打包中",
pendingon: "待处理",
record: "财务记录",
statusObj: {
0: "失败",
1: "成功",
2: "待处理",
3: "待处理",
4: "待处理",
5: "打包中",
6: "失败",
7: "失败",
}
},
zh_HK: {
capital: "資產",
title: "錢包",
totalBalance: "總額",
valuation: "估值",
addCredit: "充值",
withdrawCoin: "提現",
transfer: '劃轉',
freeBalance: "可用余額",
freezeBalance: "凍結余額",
succeed: "成功",
error: "失敗",
coinWallet: "幣幣錢包",
currencyWallet: "法幣錢包",
dateTime: "時間",
amount: "數量",
state: "狀態",
await: "打包中",
pendingon: "待處理",
record: "財務記錄",
statusObj: {
0: "失敗",
1: "成功",
2: "待處理",
3: "待處理",
4: "待處理",
5: "打包中",
6: "失敗",
7: "失敗",
}
},
en_US: {
capital: "Capital",
title: "Wallet",
totalBalance: "Total Balance",
valuation: "Valuation",
addCredit: "Recharge",
withdrawCoin: "Withdraw",
transfer: 'Transfer',
freeBalance: "Free Balance",
freezeBalance: "Freeze Balance",
succeed: "Success",
error: "ERROR",
coinWallet: "CCT",
currencyWallet: "OTC",
dateTime: "Date",
amount: "Amount",
state: "State",
await: "Await",
pendingon: "Pendingon",
record: "Financial record",
statusObj: {
0: "ERROR",
1: "Success",
2: "Pendingon",
3: "Pendingon",
4: "Pendingon",
5: "Await",
6: "ERROR",
7: "ERROR",
}
}
})
</script>
<script type="text/javascript">
require(['mui', 'app', 'Vue', 'walletApi', 'langues', 'muiPullToRefresh', 'muiPullToRefreshMaterial'], function(mui, app, Vue, walletApi, langues) {
var langue = langues[app.getLanguageLocalStorage()];
var dataInfo = new Vue({
el: "#js-data-info",
data: {
langue: langue,
coin: {}, // 币种信息
coinRecord: [], // 币种记录
marketData: {}, // 行情数据
valuation: {
countCoin: "0.000000", // 估值
countAmount: "0.000000", //估值多少币种
moneyKey: app.getExchangeRateLocalStorage()
}
},
filters: {
filtAmount: function(amount) {
return app.formatValue(amount);
},
filtDate: function(date) {
return date.substring(0, 10);
},
filtStatus: function(val) {
return dataInfo.langue.statusObj[val];
},
filetWalletType: function(val) {
if(Object.is("CCT", val)) {
return langue.coinWallet;
}
if(Object.is("C2C", val)) {
return langue.currencyWallet;
}
}
}
})
dataInfo.$nextTick(function() {
mui.plusReady(function() {
var currentWin = plus.webview.currentWebview()
dataInfo.coin = currentWin.coin; // 获取币种信息
dataInfo.marketData = currentWin.marketData; // 获取行情数据
valuationFun(dataInfo.marketData);
var deceleration = mui.os.ios ? 0.003 : 0.0009; // 阻尼系数
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: false, //是否显示滚动条
deceleration: deceleration
});
mui('.mui-content').pullToRefresh({
down: {
callback: function() {
var self = this;
record();
walletApi.getWallet({
walletType: dataInfo.coin.walletType,
moduleType: dataInfo.coin.moduleType,
tokenAddr: dataInfo.coin.tokenAddr
},
function(data) {
dataInfo.coin = data;
valuationFun(dataInfo.marketData);
})
setTimeout(function() {
// 关闭下拉加载圈
self.endPullDownToRefresh();
}, 2000);
}
}
});
record();
function record() {
walletApi.getWalletRecord({
walletType: dataInfo.coin.walletType,
moduleType: dataInfo.coin.moduleType,
tokenAddr: dataInfo.coin.tokenAddr,
pageNum: 0,
pageSize: 9999
},
function(data) {
dataInfo.coinRecord = data;
});
}
// 记录页面监听
mui(".transaction-data-record").on("tap", "li", function() {
var index = this.getAttribute('data-index');
app.openWin('recharge_record.html', 'recharge_record.html', {}, {
coinRecord: dataInfo.coinRecord[index],
addr: dataInfo.coin.addr || ""
});
});
// 提币划转事件
document.getElementById('btn-transfer').addEventListener('tap', function() {
// if(dataInfo.coin.tokenSymbol == 'PC') {
// mui.toast("敬请期待");
// } else {
app.openWin('extract_coin_to_token.html', 'extract_coin_to_token.html', '', {
index: dataInfo.coin.coinIndex,
coin: dataInfo.coin
});
// }
});
// 提币点击事件
// document.getElementById('btn-withdraw').addEventListener('tap', function() {
// app.openWin('withdraw.html', 'withdraw.html', '', {
// index: dataInfo.coin.coinIndex,
// coin: dataInfo.coin
// });
//
// });
// 充值点击事件
document.getElementById('btn-recharge').addEventListener('tap', function() {
// if(dataInfo.coin.tokenSymbol == 'PC') {
// mui.toast("敬请期待");
// } else {
app.openWin('recharge.html', 'recharge.html', '', {
index: dataInfo.coin.coinIndex,
coin: dataInfo.coin
});
// }
});
// 国际化统一方法
window.addEventListener('switchLangueData', function(e) {
dataInfo.langue = langues[e.detail];
});
// 钱包数据更新的监听
window.addEventListener('walletSaveEvent', function(e) {
console.log(11);
record();
walletApi.getWallet({
walletType: dataInfo.coin.walletType,
moduleType: dataInfo.coin.moduleType,
tokenAddr: dataInfo.coin.tokenAddr
},
function(data) {
dataInfo.coin = data;
valuationFun(dataInfo.marketData);
})
});
})
/**
* 估值方法
* @param {Object} data 行情数据
*/
function valuationFun(data) {
if(data == null) return;
var coinKey = data.baseCoin; // 当前兑换币种
var money = app.getExchangeRateLocalStorage();
var moneyKey = app.getExchangeRateLocalStorage().toLowerCase() + "Amount"; // 获取系统币种Key值;
var coinName = dataInfo.coin.tokenSymbol;
var countCoin = 0;
var countAmount = 0;
var moneyExchange = 0; // 汇率
moneyExchange = parseFloat(data.marketObj[moneyKey]);
countCoin += parseFloat(dataInfo.coin.balance) * parseFloat(data.marketObj.amount);
countAmount = app.formatValue(parseFloat(countCoin) * moneyExchange);
dataInfo.valuation.countAmount = app.formatValue(countAmount);
dataInfo.valuation.countCoin = app.formatValue(countCoin);
dataInfo.valuation.moneyKey = app.getExchangeRateLocalStorage();
}
})
})
</script>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>资产</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
<link href="../../../lib/css/mui.min.css" rel="stylesheet" />
<!--引入公共样式-->
<link href="../../../lib/css/basic.css" rel="stylesheet" />
<link href="../css/assets.css" rel="stylesheet" />
<script src="../../../lib/js/rem-layout.js"></script>
<script src="../../../lib/js/require2.1.11.js"></script>
<script type="text/javascript" src="../js/base.config.js"></script>
</head>
<body>
<div id="js-data-info">
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">{{coin.walletType | filetWalletType}} — {{coin.tokenSymbol}} {{langue.capital}}</h1>
</header>
<div class="mui-content">
<!--代币信息-->
<div class="coin">
<div class="coin-kind">
<div class="coin-kind-img"><img :src="coin.src" /></div>
<span class="coin-kind-txt">{{coin.tokenSymbol}}</span>
</div>
<div class="coin-item">
<ul>
<li class="coin-item-list">
<span class="coin-item-list-txt">{{langue.amount}}</span>
<span class="coin-item-list-num">{{coin.balance}}</span>
</li>
<li class="coin-item-list">
<span class="coin-item-list-txt">{{langue.freeBalance}}</span>
<span class="coin-item-list-num">{{coin.freeBalance}}</span>
</li>
<li class="coin-item-list">
<span class="coin-item-list-txt">{{langue.freezeBalance}}</span>
<span class="coin-item-list-num">{{coin.freezeBalance}}</span>
</li>
<!--<li class="coin-item-list">
<span class="coin-item-list-txt">{{langue.valuation}}({{marketData ? marketData.basecoin : 'USDT'}})</span>
<span class="coin-item-list-num">{{valuation.countCoin}}</span>
</li>
<li class="coin-item-list">
<span class="coin-item-list-txt">{{langue.valuation}}({{valuation.moneyKey}})</span>
<span class="coin-item-list-num">{{valuation.countAmount}}</span>
</li>-->
</ul>
</div>
</div>
<!--去交易-->
<div class="transaction">
<h3>{{langue.record}}</h3>
<div class="transaction-data">
<div class="mui-row transaction-data-title">
<div class="mui-col-sm-4 mui-col-xs-4">{{langue.amount}}</div>
<div class="mui-col-sm-4 mui-col-xs-4">{{langue.state}}</div>
<div class="mui-col-sm-4 mui-col-xs-4 mui-text-right">{{langue.dateTime}}</div>
</div>
<div class="record-contorol">
<div class="mui-scroll-wrapper">
<div id="js-scroll" class=" mui-scroll">
<ul class="mui-table-view transaction-data-record">
<li class="mui-table-view-cell mui-row js-coin-record" v-for="(row,index) in coinRecord" :data-index="index">
<div class="mui-row">
<div class="mui-col-sm-4 mui-col-xs-4 mui-ellipsis">{{row.amount | filtAmount}}</div>
<div class="mui-col-sm-4 mui-col-xs-4">{{row.status | filtStatus}}</div>
<div class="mui-col-sm-4 mui-col-xs-4 mui-text-right">{{row.createTime || row.timestamp | filtDate}}</div>
</div>
</li>
</ul>
</div>
</div>
<div class="btn mui-row" v-if="coin.tokenSymbol != 'DIA' && coin.tokenSymbol != 'TIN' ">
<div class="mui-col-sm-4 mui-col-xs-4">
<div class="btn-recharge" id="btn-recharge">{{langue.addCredit}}</div>
</div>
<div class="mui-col-sm-4 mui-col-xs-4">
<div class="btn-withdraw" id="btn-withdraw">{{langue.withdrawCoin}}</div>
</div>
<div class="mui-col-sm-4 mui-col-xs-4">
<div class="btn-transfer" id="btn-transfer">{{langue.transfer}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript">
define('langues', {
zh_CN: {
capital: "资产",
title: "钱包",
totalBalance: "总额",
valuation: "估值",
addCredit: "充值",
withdrawCoin: "提现",
transfer: '划转',
freeBalance: "可用余额",
freezeBalance: "冻结余额",
succeed: "成功",
error: "失败",
coinWallet: "币币钱包",
currencyWallet: "法币钱包",
dateTime: "时间",
amount: "数量",
state: "状态",
await: "打包中",
pendingon: "待处理",
record: "财务记录",
statusObj: {
0: "失败",
1: "成功",
2: "待处理",
3: "待处理",
4: "待处理",
5: "打包中",
6: "失败",
7: "失败",
}
},
zh_HK: {
capital: "資產",
title: "錢包",
totalBalance: "總額",
valuation: "估值",
addCredit: "充值",
withdrawCoin: "提現",
transfer: '劃轉',
freeBalance: "可用余額",
freezeBalance: "凍結余額",
succeed: "成功",
error: "失敗",
coinWallet: "幣幣錢包",
currencyWallet: "法幣錢包",
dateTime: "時間",
amount: "數量",
state: "狀態",
await: "打包中",
pendingon: "待處理",
record: "財務記錄",
statusObj: {
0: "失敗",
1: "成功",
2: "待處理",
3: "待處理",
4: "待處理",
5: "打包中",
6: "失敗",
7: "失敗",
}
},
en_US: {
capital: "Capital",
title: "Wallet",
totalBalance: "Total Balance",
valuation: "Valuation",
addCredit: "Recharge",
withdrawCoin: "Withdraw",
transfer: 'Transfer',
freeBalance: "Free Balance",
freezeBalance: "Freeze Balance",
succeed: "Success",
error: "ERROR",
coinWallet: "CCT",
currencyWallet: "OTC",
dateTime: "Date",
amount: "Amount",
state: "State",
await: "Await",
pendingon: "Pendingon",
record: "Financial record",
statusObj: {
0: "ERROR",
1: "Success",
2: "Pendingon",
3: "Pendingon",
4: "Pendingon",
5: "Await",
6: "ERROR",
7: "ERROR",
}
}
})
</script>
<script type="text/javascript">
require(['mui', 'app', 'Vue', 'walletApi', 'langues', 'muiPullToRefresh', 'muiPullToRefreshMaterial'], function(mui, app, Vue, walletApi, langues) {
var langue = langues[app.getLanguageLocalStorage()];
var dataInfo = new Vue({
el: "#js-data-info",
data: {
langue: langue,
coin: {}, // 币种信息
coinRecord: [], // 币种记录
marketData: {}, // 行情数据
valuation: {
countCoin: "0.000000", // 估值
countAmount: "0.000000", //估值多少币种
moneyKey: app.getExchangeRateLocalStorage()
}
},
filters: {
filtAmount: function(amount) {
return app.formatValue(amount);
},
filtDate: function(date) {
return date.substring(0, 10);
},
filtStatus: function(val) {
return dataInfo.langue.statusObj[val];
},
filetWalletType: function(val) {
if(Object.is("CCT", val)) {
return langue.coinWallet;
}
if(Object.is("C2C", val)) {
return langue.currencyWallet;
}
}
}
})
dataInfo.$nextTick(function() {
mui.plusReady(function() {
var currentWin = plus.webview.currentWebview()
dataInfo.coin = currentWin.coin; // 获取币种信息
dataInfo.marketData = currentWin.marketData; // 获取行情数据
valuationFun(dataInfo.marketData);
var deceleration = mui.os.ios ? 0.003 : 0.0009; // 阻尼系数
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: false, //是否显示滚动条
deceleration: deceleration
});
mui('.mui-content').pullToRefresh({
down: {
callback: function() {
var self = this;
record();
walletApi.getWallet({
walletType: dataInfo.coin.walletType,
moduleType: dataInfo.coin.moduleType,
tokenAddr: dataInfo.coin.tokenAddr
},
function(data) {
dataInfo.coin = data;
valuationFun(dataInfo.marketData);
})
setTimeout(function() {
// 关闭下拉加载圈
self.endPullDownToRefresh();
}, 2000);
}
}
});
record();
function record() {
walletApi.getWalletRecord({
walletType: dataInfo.coin.walletType,
moduleType: dataInfo.coin.moduleType,
tokenAddr: dataInfo.coin.tokenAddr,
pageNum: 0,
pageSize: 9999
},
function(data) {
dataInfo.coinRecord = data;
});
}
function recharge() {
walletApi.getRecharge({
walletType: dataInfo.coin.walletType,
moduleType: dataInfo.coin.moduleType,
addr: dataInfo.coin.addr
},
function(data) {
app.toast(data.msg)
console.log(data.msg)
});
}
// 记录页面监听
mui(".transaction-data-record").on("tap", "li", function() {
var index = this.getAttribute('data-index');
app.openWin('recharge_record.html', 'recharge_record.html', {}, {
coinRecord: dataInfo.coinRecord[index],
addr: dataInfo.coin.addr || ""
});
});
// 提币划转事件
document.getElementById('btn-transfer').addEventListener('tap', function() {
app.openWin('extract_coin_to_token.html', 'extract_coin_to_token.html', '', {
index: dataInfo.coin.coinIndex,
coin: dataInfo.coin
});
});
// 提币点击事件
document.getElementById('btn-withdraw').addEventListener('tap', function() {
app.openWin('withdraw.html', 'withdraw.html', '', {
index: dataInfo.coin.coinIndex,
coin: dataInfo.coin
});
});
// 充值点击事件
document.getElementById('btn-recharge').addEventListener('tap', function() {
console.log()
console.log(JSON.stringify(dataInfo.coin));
recharge();
// app.openWin('recharge.html', 'recharge.html', '', {
// index: dataInfo.coin.coinIndex,
// coin: dataInfo.coin
// });
});
// 国际化统一方法
window.addEventListener('switchLangueData', function(e) {
dataInfo.langue = langues[e.detail];
});
// 钱包数据更新的监听
window.addEventListener('walletSaveEvent', function(e) {
console.log(11);
record();
walletApi.getWallet({
walletType: dataInfo.coin.walletType,
moduleType: dataInfo.coin.moduleType,
tokenAddr: dataInfo.coin.tokenAddr
},
function(data) {
dataInfo.coin = data;
valuationFun(dataInfo.marketData);
})
});
})
/**
* 估值方法
* @param {Object} data 行情数据
*/
function valuationFun(data) {
if(data == null) return;
var coinKey = data.baseCoin; // 当前兑换币种
var money = app.getExchangeRateLocalStorage();
var moneyKey = app.getExchangeRateLocalStorage().toLowerCase() + "Amount"; // 获取系统币种Key值;
var coinName = dataInfo.coin.tokenSymbol;
var countCoin = 0;
var countAmount = 0;
var moneyExchange = 0; // 汇率
moneyExchange = parseFloat(data.marketObj[moneyKey]);
countCoin += parseFloat(dataInfo.coin.balance) * parseFloat(data.marketObj.amount);
countAmount = app.formatValue(parseFloat(countCoin) * moneyExchange);
dataInfo.valuation.countAmount = app.formatValue(countAmount);
dataInfo.valuation.countCoin = app.formatValue(countCoin);
dataInfo.valuation.moneyKey = app.getExchangeRateLocalStorage();
}
})
})
</script>
</html>

@ -1,310 +1,313 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>钱包</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
<link href="../../../lib/css/mui.min.css" rel="stylesheet" />
<!--引入公共样式-->
<link href="../../../lib/css/basic.css" rel="stylesheet" />
<link href="../../../lib/css/swiper.min.css" rel="stylesheet" />
<link href="../css/wallet.css" rel="stylesheet" />
<script type="text/javascript" src="../../../lib/js/vue.min.js"></script>
<script src="../../../lib/js/rem-layout.js"></script>
<script type="text/javascript" src="../../../lib/js/mui.min.js"></script>
<script type="text/javascript" src="../../../lib/js/app.js"></script>
<script src="../../../lib/js/require2.1.11.js"></script>
<script type="text/javascript" src="../js/base.config.js"></script>
</head>
<style>
[v-cloak] {
display: none;
}
</style>
<body>
<div id="js-data-info" v-cloak>
<header class="mui-bar mui-bar-nav">
<h1 class="mui-title">{{langue.title}}</h1>
</header>
<div class="mui-content">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="(row,index) in wallets" :id="'item' + index">
<div class="top-bg">
<div class="valuation">
<div class="account">{{row | filetWalletType}}</div>
<span class="valuation-txt">{{langue.valuation}}({{valuation[row].baseCoin}})</span>
<span class="valuation-price">{{valuation[row].countCoin}}</span>
<span class="valuation-rate">≈{{valuation[row].countAmount}} {{valuation[row].moneyKey}}</span>
</div>
</div>
</div>
</div>
</div>
<div class="coin">
<ul class="coin-ul">
<!--币币账户-->
<li class="coin-item-list" v-for="(coin,index) in coins[wallets[0]]" v-if="coinStatus" :data-index="index" :data-type="wallets[0]">
<div class="coin-kind">
<div class="coin-kind-img"><img :src="coin.src" /></div>
<span class="coin-kind-txt">{{coin.tokenSymbol}}</span>
</div>
<div class="coin-situation">
<span class="coin-remain">{{langue.free}}:{{coin.freeBalance}}</span>
<span class="coin-reeze">{{langue.freeze}}:{{coin.freezeBalance}}</span>
</div>
</li>
<!--法币账户-->
<li class="coin-item-list" v-for="(coin,index) in coins[wallets[1]]" v-if="!coinStatus" :data-index="index" :data-type="wallets[1]">
<div class="coin-kind">
<div class="coin-kind-img"><img :src="coin.src" /></div>
<span class="coin-kind-txt">{{coin.tokenSymbol}}</span>
</div>
<div class="coin-situation">
<span class="coin-remain">{{langue.free}}:{{coin.freeBalance}}</span>
<span class="coin-reeze">{{langue.freeze}}:{{coin.freezeBalance}}</span>
</div>
</li>
</ul>
</div>
</div>
</div>
</body>
<script type="text/javascript">
define('langues', {
zh_CN: {
title: "钱包",
valuation: "估值",
addCredit: "充值",
withdrawCoin: "提现",
free: "可用",
freeze: "冻结",
walletTypeC2C: "法币交易",
walletTypeCCT: "币币交易",
coinWallet: "币币钱包",
currencyWallet: "法币钱包"
},
zh_HK: {
title: "錢包",
valuation: "估值",
addCredit: "充值",
withdrawCoin: "提現",
free: "可用",
freeze: "凍結",
coinWallet: "幣幣錢包",
currencyWallet: "法幣錢包",
},
en_US: {
title: "Wallet",
valuation: "Valuation",
addCredit: "Recharge",
withdrawCoin: "Withdraw",
free: "Free",
freeze: "Freeze",
coinWallet: "CCT",
currencyWallet: "OTC"
}
})
</script>
<script type="text/javascript">
mui.init({
swipeBack: false
});
var dataInfo = new Vue({
el: "#js-data-info",
data: {
langue: {},
wallets: ["CCT", "C2C"],
currentWallets: "CCT",
coinStatus: true, //切换账户的状态
coins: {
CCT: app.getCoinWalletInfoLocalStorage(),
C2C: app.getC2CCoinWalletInfoLocalStorage()
},
valuation: {
CCT: {
countCoin: "0.00000000", // 估值
countAmount: "0.00", //估值多少币种
moneyKey: app.getExchangeRateLocalStorage(),
baseCoin: "USDT"
},
C2C: {
countCoin: "0.00000000", // 估值
countAmount: "0.00", //估值多少币种
moneyKey: app.getExchangeRateLocalStorage(),
baseCoin: "USDT"
}
},
marketData: {},
marketList: {}
},
filters: {
filetWalletType:function(val) {
if(Object.is("CCT", val)) {
return dataInfo.langue.coinWallet;
}
if(Object.is("C2C", val)) {
return dataInfo.langue.currencyWallet;
}
}
}
})
require(['walletApi', 'langues', 'Swiper', 'muiPullToRefresh', 'muiPullToRefreshMaterial'], function(walletApi, langues, Swiper) {
dataInfo.langue = langues[app.getLanguageLocalStorage()];
dataInfo.$nextTick(function() {
mui.init();
var swiper = new Swiper('.swiper-container', {
grabCursor: true,
centeredSlides: true,
slidesPerView: 'auto',
on: {
transitionEnd: function() {
//根据切换卡片的activeIndex索引来显示不同账户的币种
if(this.activeIndex === 0) {
dataInfo.coinStatus = true;
} else {
dataInfo.coinStatus = false;
}
}
},
});
var deceleration = mui.os.ios ? 0.003 : 0.0009; // 阻尼系数
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
deceleration: deceleration
});
mui('.mui-content').pullToRefresh({
down: {
callback: function() {
var self = this;
walletApi.voidServieWalletPass();
// 发送用户信息查询请求
saveWallet();
setTimeout(function() {
// 关闭下拉加载圈
self.endPullDownToRefresh();
}, 3000);
}
}
});
//代币资产页面监听
mui(".coin-ul").on("tap", "li", function() {
var index = this.getAttribute('data-index');
var type = this.getAttribute('data-type');
app.openWin('assets.html', 'assets.html', {}, {
coin: dataInfo.coins[type][index],
type: type
});
});
saveWallet();
function saveWallet() {
walletApi.getCCTWallets(function(data) {
dataInfo.coins.CCT = data;
coinsEvenPush(data);
valuationFun(dataInfo.marketList, walletApi.walletType.CCT);
})
walletApi.getC2CWallets(function(data) {
dataInfo.coins.C2C = data;
valuationFun(dataInfo.marketList, walletApi.walletType.C2C);
})
}
walletApi.voidServieWalletPass();
// 国际化统一方法
window.addEventListener('switchLangueData', function(e) {
dataInfo.langue = langues[e.detail];
});
/**
* 监听获取行情列表
*/
window.addEventListener("marketList", function(event) {
var marketList = event.detail;
valuationFun(marketList, walletApi.walletType.CCT);
valuationFun(marketList, walletApi.walletType.C2C);
});
// 钱包数据更新的监听
window.addEventListener('walletSaveEvent', function(e) {
walletApi.voidServieWalletPass();
walletApi.getCCTWallets(function(data) {
dataInfo.coins.CCT = data;
coinsEvenPush(data);
valuationFun(dataInfo.marketList, walletApi.walletType.CCT);
})
walletApi.getC2CWallets(function(data) {
dataInfo.coins.C2C = data;
otcCoinsEvenPush(data);
valuationFun(dataInfo.marketList, walletApi.walletType.C2C);
})
});
function valuationFun(data, type) {
if(data == null) return;
var coinKey = dataInfo.valuation[type].baseCoin; // 当前兑换币种
var money = app.getExchangeRateLocalStorage();
var moneyKey = app.getExchangeRateLocalStorage().toLowerCase() + "Amount"; // 获取系统币种Key值;
var marketData = data[coinKey]; // 获取行情数据
if(marketData == null) return;
var coins = dataInfo.coins[type];
var countCoin = 0;
var countAmount = 0;
var moneyExchange = 0; // 汇率
var isMoneyV = true;
for(var i = 0; i < coins.length; i++) {
var coinName = coins[i].tokenSymbol;
if(coinName in marketData) {
if(isMoneyV) {
marketData[coinKey] = {};
marketData[coinKey].basecoin = marketData[coinName].basecoin;
marketData[coinKey].marketObj = JSON.parse(JSON.stringify(marketData[coinName].marketObj));
marketData[coinKey].marketObj.amount = 1;
moneyExchange = parseFloat(marketData[coinName].marketObj[moneyKey]);
isMoneyV = false;
}
countCoin += parseFloat(coins[i].balance) * parseFloat(marketData[coinName].marketObj.amount);
} else if(coinKey == coinName) {
countCoin += parseFloat(coins[i].balance);
}
}
countAmount = app.formatValue(parseFloat(countCoin) * moneyExchange);
dataInfo.valuation[type].countAmount = countAmount;
dataInfo.valuation[type].countCoin = app.formatValue(countCoin);
dataInfo.valuation[type].moneyKey = app.getExchangeRateLocalStorage();
dataInfo.marketData = marketData;
dataInfo.marketList = data;
}
/**
* 币币币种信息推送
* @param {Array} coins
*/
function coinsEvenPush(coins) {
if(coins == null || coins.length == 0) return;
var coinMap = {};
for(var i = 0; i < coins.length; i++) {
coinMap[coins[i].tokenSymbol] = coins[i];
}
mui.fire(plus.webview.getWebviewById("html/cct/html/cct_index.html"), "saveCoinsEven", coinMap);
}
/**
* 法币币种信息推送
* @param {Array} coins
*/
function otcCoinsEvenPush(coins) {
if(coins == null || coins.length == 0) return;
var coinMap = {};
for(var i = 0; i < coins.length; i++) {
coinMap[coins[i].tokenSymbol] = coins[i];
}
mui.fire(plus.webview.getWebviewById("merchant.html"), "saveCoinsEven", coinMap);
}
})
})
</script>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>钱包</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
<link href="../../../lib/css/mui.min.css" rel="stylesheet" />
<!--引入公共样式-->
<link href="../../../lib/css/basic.css" rel="stylesheet" />
<link href="../../../lib/css/swiper.min.css" rel="stylesheet" />
<link href="../css/wallet.css" rel="stylesheet" />
<script type="text/javascript" src="../../../lib/js/vue.min.js"></script>
<script src="../../../lib/js/rem-layout.js"></script>
<script type="text/javascript" src="../../../lib/js/mui.min.js"></script>
<script type="text/javascript" src="../../../lib/js/app.js"></script>
<script src="../../../lib/js/require2.1.11.js"></script>
<script type="text/javascript" src="../js/base.config.js"></script>
</head>
<style>
[v-cloak] {
display: none;
}
</style>
<body>
<div id="js-data-info" v-cloak>
<header class="mui-bar mui-bar-nav">
<h1 class="mui-title">{{langue.title}}</h1>
</header>
<div class="mui-content">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="(row,index) in wallets" :id="'item' + index">
<div class="top-bg">
<div class="valuation">
<div class="account">{{row | filetWalletType}}</div>
<span class="valuation-txt">{{langue.valuation}}({{valuation[row].baseCoin}})</span>
<span class="valuation-price">{{valuation[row].countCoin}}</span>
<span class="valuation-rate">≈{{valuation[row].countAmount}} {{valuation[row].moneyKey}}</span>
</div>
</div>
</div>
</div>
</div>
<div class="coin">
<ul class="coin-ul">
<!--币币账户-->
<li class="coin-item-list" v-for="(coin,index) in coins[wallets[0]]" v-if="coinStatus && coin.tokenSymbol != 'PC'" :data-index="index" :data-type="wallets[0]">
<div class="coin-kind" >
<div class="coin-kind-img"><img :src="coin.src" /></div>
<span class="coin-kind-txt">{{coin.tokenSymbol}}</span>
</div>
<div class="coin-situation">
<span class="coin-remain">{{langue.free}}:{{coin.freeBalance}}</span>
<span class="coin-reeze">{{langue.freeze}}:{{coin.freezeBalance}}</span>
</div>
</li>
<!--法币账户-->
<li class="coin-item-list" v-for="(coin,index) in coins[wallets[1]]" v-if="!coinStatus && coin.tokenSymbol != 'PC'" :data-index="index" :data-type="wallets[1]">
<div class="coin-kind">
<div class="coin-kind-img"><img :src="coin.src" /></div>
<span class="coin-kind-txt">{{coin.tokenSymbol}}</span>
</div>
<div class="coin-situation">
<span class="coin-remain">{{langue.free}}:{{coin.freeBalance}}</span>
<span class="coin-reeze">{{langue.freeze}}:{{coin.freezeBalance}}</span>
</div>
</li>
</ul>
</div>
</div>
</div>
</body>
<script type="text/javascript">
define('langues', {
zh_CN: {
title: "钱包",
valuation: "估值",
addCredit: "充值",
withdrawCoin: "提现",
free: "可用",
freeze: "冻结",
walletTypeC2C: "法币交易",
walletTypeCCT: "币币交易",
coinWallet: "币币钱包",
currencyWallet: "法币钱包"
},
zh_HK: {
title: "錢包",
valuation: "估值",
addCredit: "充值",
withdrawCoin: "提現",
free: "可用",
freeze: "凍結",
coinWallet: "幣幣錢包",
currencyWallet: "法幣錢包",
},
en_US: {
title: "Wallet",
valuation: "Valuation",
addCredit: "Recharge",
withdrawCoin: "Withdraw",
free: "Free",
freeze: "Freeze",
coinWallet: "CCT",
currencyWallet: "OTC"
}
})
</script>
<script type="text/javascript">
mui.init({
swipeBack: false
});
var dataInfo = new Vue({
el: "#js-data-info",
data: {
langue: {},
wallets: ["CCT", "C2C"],
currentWallets: "CCT",
coinStatus: true, //切换账户的状态
coins: {
CCT: app.getCoinWalletInfoLocalStorage(),
C2C: app.getC2CCoinWalletInfoLocalStorage()
},
valuation: {
CCT: {
countCoin: "0.00000000", // 估值
countAmount: "0.00", //估值多少币种
moneyKey: app.getExchangeRateLocalStorage(),
baseCoin: "USDT"
},
C2C: {
countCoin: "0.00000000", // 估值
countAmount: "0.00", //估值多少币种
moneyKey: app.getExchangeRateLocalStorage(),
baseCoin: "USDT"
}
},
marketData: {},
marketList: {}
},
filters: {
filetWalletType:function(val) {
if(Object.is("CCT", val)) {
return dataInfo.langue.coinWallet;
}
if(Object.is("C2C", val)) {
return dataInfo.langue.currencyWallet;
}
}
}
})
require(['walletApi', 'langues', 'Swiper', 'muiPullToRefresh', 'muiPullToRefreshMaterial'], function(walletApi, langues, Swiper) {
dataInfo.langue = langues[app.getLanguageLocalStorage()];
dataInfo.$nextTick(function() {
mui.init();
var swiper = new Swiper('.swiper-container', {
grabCursor: true,
centeredSlides: true,
slidesPerView: 'auto',
on: {
transitionEnd: function() {
//根据切换卡片的activeIndex索引来显示不同账户的币种
if(this.activeIndex === 0) {
dataInfo.coinStatus = true;
} else {
dataInfo.coinStatus = false;
}
}
},
});
var deceleration = mui.os.ios ? 0.003 : 0.0009; // 阻尼系数
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
deceleration: deceleration
});
mui('.mui-content').pullToRefresh({
down: {
callback: function() {
var self = this;
walletApi.voidServieWalletPass();
// 发送用户信息查询请求
saveWallet();
setTimeout(function() {
// 关闭下拉加载圈
self.endPullDownToRefresh();
}, 3000);
}
}
});
//代币资产页面监听
mui(".coin-ul").on("tap", "li", function() {
var index = this.getAttribute('data-index');
var type = this.getAttribute('data-type');
app.openWin('assets.html', 'assets.html', {}, {
coin: dataInfo.coins[type][index],
type: type
});
});
saveWallet();
function saveWallet() {
walletApi.getCCTWallets(function(data) {
console.log(data);
dataInfo.coins.CCT = data;
coinsEvenPush(data);
valuationFun(dataInfo.marketList, walletApi.walletType.CCT);
})
walletApi.getC2CWallets(function(data) {
console.log(data);
dataInfo.coins.C2C = data;
valuationFun(dataInfo.marketList, walletApi.walletType.C2C);
})
}
walletApi.voidServieWalletPass();
// 国际化统一方法
window.addEventListener('switchLangueData', function(e) {
dataInfo.langue = langues[e.detail];
});
/**
* 监听获取行情列表
*/
window.addEventListener("marketList", function(event) {
var marketList = event.detail;
valuationFun(marketList, walletApi.walletType.CCT);
valuationFun(marketList, walletApi.walletType.C2C);
});
// 钱包数据更新的监听
window.addEventListener('walletSaveEvent', function(e) {
walletApi.voidServieWalletPass();
walletApi.getCCTWallets(function(data) {
dataInfo.coins.CCT = data;
coinsEvenPush(data);
valuationFun(dataInfo.marketList, walletApi.walletType.CCT);
})
walletApi.getC2CWallets(function(data) {
dataInfo.coins.C2C = data;
otcCoinsEvenPush(data);
valuationFun(dataInfo.marketList, walletApi.walletType.C2C);
})
});
function valuationFun(data, type) {
if(data == null) return;
var coinKey = dataInfo.valuation[type].baseCoin; // 当前兑换币种
var money = app.getExchangeRateLocalStorage();
var moneyKey = app.getExchangeRateLocalStorage().toLowerCase() + "Amount"; // 获取系统币种Key值;
var marketData = data[coinKey]; // 获取行情数据
if(marketData == null) return;
var coins = dataInfo.coins[type];
var countCoin = 0;
var countAmount = 0;
var moneyExchange = 0; // 汇率
var isMoneyV = true;
for(var i = 0; i < coins.length; i++) {
var coinName = coins[i].tokenSymbol;
if(coinName in marketData) {
if(isMoneyV) {
marketData[coinKey] = {};
marketData[coinKey].basecoin = marketData[coinName].basecoin;
marketData[coinKey].marketObj = JSON.parse(JSON.stringify(marketData[coinName].marketObj));
marketData[coinKey].marketObj.amount = 1;
moneyExchange = parseFloat(marketData[coinName].marketObj[moneyKey]);
isMoneyV = false;
}
countCoin += parseFloat(coins[i].balance) * parseFloat(marketData[coinName].marketObj.amount);
} else if(coinKey == coinName) {
countCoin += parseFloat(coins[i].balance);
}
}
countAmount = app.formatValue(parseFloat(countCoin) * moneyExchange);
dataInfo.valuation[type].countAmount = countAmount;
dataInfo.valuation[type].countCoin = app.formatValue(countCoin);
dataInfo.valuation[type].moneyKey = app.getExchangeRateLocalStorage();
dataInfo.marketData = marketData;
dataInfo.marketList = data;
}
/**
* 币币币种信息推送
* @param {Array} coins
*/
function coinsEvenPush(coins) {
if(coins == null || coins.length == 0) return;
var coinMap = {};
for(var i = 0; i < coins.length; i++) {
coinMap[coins[i].tokenSymbol] = coins[i];
}
mui.fire(plus.webview.getWebviewById("html/cct/html/cct_index.html"), "saveCoinsEven", coinMap);
}
/**
* 法币币种信息推送
* @param {Array} coins
*/
function otcCoinsEvenPush(coins) {
if(coins == null || coins.length == 0) return;
var coinMap = {};
for(var i = 0; i < coins.length; i++) {
coinMap[coins[i].tokenSymbol] = coins[i];
}
mui.fire(plus.webview.getWebviewById("merchant.html"), "saveCoinsEven", coinMap);
}
})
})
</script>
</html>

@ -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);
});
},
/**
* 获取CCTEOS
* @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);
});
},
/**
* 获取CCTEOS
* @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;
}
}
})

File diff suppressed because it is too large Load Diff

@ -1,135 +1,135 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>分享APP</title>
<!--REM自适应布局JS-->
<link rel="stylesheet" type="text/css" href="../../../lib/css/mui.min.css">
<link rel="stylesheet" type="text/css" href="../../../lib/css/basic.css" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
<script src="../../../lib/js/mui.min.js"></script>
<script src="../../../lib/js/vue.js"></script>
<script src="../../../lib/js/app.js"></script>
<script src="../../js/base/rem-layout.js"></script>
<script src="../../js/language/wallet_language.js"></script>
<script type="text/javascript" src="../../js/my/my_ajax.js"></script>
</head>
<style>
.protocol-box {
position: fixed;
bottom: 0.25rem;
font-size: 0.28rem;
text-align: center;
width: 100%;
color: #666 !important;
}
#logo-content {
width: 100%;
height: 2.5rem;
position: relative;
}
#logo-content #logo {
position: absolute;
width: 80px;
top: .6rem;
left: calc(50% - 40px);
height: auto;
}
.app-name {
font-size: 0.3rem;
text-align: center;
margin-bottom: .2rem;
}
.version {
width: 100%;
font-size: 0.25rem;
text-align: center;
margin-bottom: .5rem;
margin: 0 auto;
}
.version img {
margin-top: 2.5rem;
width: 2rem;
height: 2rem;
}
.version p {
width: 100%;
text-align: center;
margin-top: .2rem;
}
</style>
<body>
<div id="data-info">
<header class="mui-bar mui-bar-nav app-header app-header-darkly">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title" data-text="WalletMyAboutUsTitle">{{langue.about}}</h1>
</header>
<div class="mui-content">
<div id="logo-content">
<img id="logo" src="../../img/yanhuo_logo.jpg" />
</div>
<p class="app-name">{{langue.name}}</p>
<div class="version">
<img src="../../img/flame_code.png" alt="" />
<p>{{langue.note}}</p>
</div>
</div>
<div class="protocol-box">
<p>
{{langue.name}}</br>
Copyright © 2019 flame.io Corporation.</br>
All Rights Reserved.
</p>
</div>
</div>
</body>
</html>
<script>
//1、每个页面写自己的国际化语言变量,例子:
var langues = {
zh_CN: {
cancel: '取消',
about: '分享App',
name: '焰火网',
note: '扫描二维码即分享',
},
zh_HK: {
cancel: '取消',
about: '分享App',
name: '焰火網',
note: '掃描二維碼即分享',
},
en_US: {
cancel: 'Cancel',
about: 'Share',
name: 'Flame.io',
note: 'Scan QR code to share',
}
};
//2、页面上所有需要国际化的文字,包括提示,都通过Vue去引用,例子:
var langueKey = app.getLanguageLocalStorage(); //获取国际化语种
var langue = langues[langueKey]; // 获取国际化语种数据
var dataInfo = new Vue({
el: "#data-info",
data: {
langue: langue,
}
});
//3、每个页面都需要加上以下的方法:
window.addEventListener('switchLangueData', function(e) {
//dataInfo为Vue对象的名称
dataInfo.langue = langues[e.detail];
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>分享APP</title>
<!--REM自适应布局JS-->
<link rel="stylesheet" type="text/css" href="../../../lib/css/mui.min.css">
<link rel="stylesheet" type="text/css" href="../../../lib/css/basic.css" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
<script src="../../../lib/js/mui.min.js"></script>
<script src="../../../lib/js/vue.js"></script>
<script src="../../../lib/js/app.js"></script>
<script src="../../js/base/rem-layout.js"></script>
<script src="../../js/language/wallet_language.js"></script>
<script type="text/javascript" src="../../js/my/my_ajax.js"></script>
</head>
<style>
.protocol-box {
position: fixed;
bottom: 0.25rem;
font-size: 0.28rem;
text-align: center;
width: 100%;
color: #666 !important;
}
#logo-content {
width: 100%;
height: 2.5rem;
position: relative;
}
#logo-content #logo {
position: absolute;
width: 80px;
top: .6rem;
left: calc(50% - 40px);
height: auto;
}
.app-name {
font-size: 0.3rem;
text-align: center;
margin-bottom: .2rem;
}
.version {
width: 100%;
font-size: 0.25rem;
text-align: center;
margin-bottom: .5rem;
margin: 0 auto;
}
.version img {
margin-top: 2.5rem;
width: 2rem;
height: 2rem;
}
.version p {
width: 100%;
text-align: center;
margin-top: .2rem;
}
</style>
<body>
<div id="data-info">
<header class="mui-bar mui-bar-nav app-header app-header-darkly">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title" data-text="WalletMyAboutUsTitle">{{langue.about}}</h1>
</header>
<div class="mui-content">
<div id="logo-content">
<img id="logo" src="../../img/logo.png" />
</div>
<p class="app-name">{{langue.name}}</p>
<div class="version">
<img src="../../img/flame_code.png" alt="" />
<p>{{langue.note}}</p>
</div>
</div>
<div class="protocol-box">
<p>
{{langue.name}}</br>
Copyright © 2019 flame.io Corporation.</br>
All Rights Reserved.
</p>
</div>
</div>
</body>
</html>
<script>
//1、每个页面写自己的国际化语言变量,例子:
var langues = {
zh_CN: {
cancel: '取消',
about: '分享App',
name: '智信链',
note: '扫描二维码即分享',
},
zh_HK: {
cancel: '取消',
about: '分享App',
name: '智信鏈',
note: '掃描二維碼即分享',
},
en_US: {
cancel: 'Cancel',
about: 'Share',
name: 'Zhixin',
note: 'Scan QR code to share',
}
};
//2、页面上所有需要国际化的文字,包括提示,都通过Vue去引用,例子:
var langueKey = app.getLanguageLocalStorage(); //获取国际化语种
var langue = langues[langueKey]; // 获取国际化语种数据
var dataInfo = new Vue({
el: "#data-info",
data: {
langue: langue,
}
});
//3、每个页面都需要加上以下的方法:
window.addEventListener('switchLangueData', function(e) {
//dataInfo为Vue对象的名称
dataInfo.langue = langues[e.detail];
});
</script>

File diff suppressed because it is too large Load Diff

@ -1,411 +1,410 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>我的登录</title>
<!--REM自适应布局JS-->
<link rel="stylesheet" type="text/css" href="../../lib/css/mui.min.css">
<link href="../../lib/css/basic.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../css/base.css" />
<script src="../../lib/js/mui.min.js"></script>
<script src="../../lib/js/vue.js"></script>
<script src="../../lib/js/app.js"></script>
<script src="../../lib/js/jsdeferred.nodoc.js"></script>
<script type="text/javascript" src="../js/base/rem-layout.js"></script>
<script type="text/javascript" src="../js/login/login_ajax.js"></script>
<script src="../../html/wakuang/js/eth/ajax/eth.ajaxApi.js"></script>
<script src="../../lib/js/require2.1.11.js"></script>
<script src="../../lib/js/internationalCode.js"></script>
<script src="../js/base/getClientInfo.js"></script>
</head>
<style>
#user-login {
margin: 0.25rem 0.25rem;
}
#user-login label {
width: 1.25rem;
}
#user-login .app-input {
width: 60%;
}
#user-login #mobile-phone .app-input {
flex-grow: 7;
}
#user-login #password-input .app-input {
flex-grow: 7;
}
#user-login .app-group-right-text {
width: 40%;
border: 0px solid white;
}
#user-login .app-input-row-list {
border-radius: 0.2rem;
margin: 0.2rem 0;
overflow: hidden;
border: 1px solid #DDDDDD !important;
}
#login-text-info {
margin: 0.3rem 0 0 0;
}
.mui-slider-item {
border: none !important;
}
.login-slider {
top: 90px !important;
}
.login-slider-title {
padding: 0 0.68rem 0 0.68rem !important;
}
#sliderSegmentedControl {
margin: 0 0 0 0.25rem !important;
}
#forget-password {
margin: 0.4rem;
font-size: 0.25rem;
line-height: 1.5em;
}
</style>
<body>
<div id="data-info">
<header class="mui-bar mui-bar-nav app-header app-header-darkly">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">{{langue.title}}</h1>
<a id="js-code-login" class="mui-pull-right" style="position: absolute; right: 12px;bottom: .28rem;">{{langue.Codelogin}}</a>
</header>
<div class="mui-content" style="margin-top: 0.5rem;">
<div id="user-login" class="app-input-group app-input-group-darkly">
<!--<div id="international-div" class="app-input-row-list">-->
<!--<label class="mui-text-center">{{langue.countriesAndRegions}}</label>-->
<!--<label>请选择国家</label>-->
<!--<input id="international_code" class="app-input" type="text" readonly="readonly" :value="langue.Hongkong" />
<input id="internationalCode" type="hidden" value="86" />-->
<!--</div>-->
<div id="mobile-phone" class="app-input-row-list">
<!--<label id="mobilePhoneLabel" class="mui-text-center">+86</label>-->
<label class="mui-text-center">{{langue.phone}}</label>
<input id="mobilePhone" class="app-input" type="text" v-model="dataParameter.mobilePhone" :placeholder="langue.placeholder01" />
</div>
<div id="mobile-phone" class="app-input-row-list">
<label class="mui-text-center">{{langue.Code}}</label>
<input id="password" class="app-input" type="password" v-model="dataParameter.password" :placeholder="langue.placeholder02" />
</div>
<div>
<p class="mui-text-right" style="padding: 0.2rem; float: right;" id="js-openview-signup">
<a>{{langue.register}}</a>
</p>
<p class="mui-text-left" style="padding: 0.2rem; float: left;" id="js-openview-forget">
<a>{{langue.ForgetThePassword}}</a>
</p>
</div>
</div>
<div class="login-btn">
<button id="login-btn" class="app-btn app-btn-darkly" style="margin-top: 0.5rem;width: 90%; margin-left: 5%;">{{langue.login}}</button>
<p id="login-text-info" class="mui-text-center">{{langue.loginText}}
<a id="protocol">{{langue.loginHref}}</a>
</p>
</div>
</div>
</div>
</body>
</html>
<script>
// 国际化
var langues = {
zh_CN: {
title: "密码登录",
Code: "密码",
phone: "账号",
placeholder01: "请输入手机号/邮箱",
placeholder02: "请输入密码",
register: "新用户注册",
login: "登录",
loginText: "点击'登录'代表你已阅读并同意",
loginHref: "《服务协议》",
alert01: "账号不能为空",
alert02: "密码不能为空",
Codelogin: "验证码登录",
ForgetThePassword: "忘记密码",
WalletLoginSuccessMsg: "登录成功!",
WalletLoginMobilePhoneNullMsg: "手机号不能为空!",
countriesAndRegions: "国家地区",
// China: "中国"
Hongkong: "中国"
},
zh_HK: {
title: "密碼登錄",
Code: "密碼",
phone: "賬號",
placeholder01: "請輸入手機號/郵箱",
placeholder02: "請輸入密碼",
register: "新用戶註冊",
login: "登錄",
loginText: "點擊'登錄'代表妳已閱讀並同意",
loginHref: "《服務協議》",
alert01: "賬號不能為空",
alert02: "密碼不能為空",
Codelogin: "驗證碼登錄",
ForgetThePassword: "忘記密碼",
WalletLoginSuccessMsg: "登錄成功!",
WalletLoginMobilePhoneNullMsg: "手機號不能為空!",
countriesAndRegions: "國家地區",
// China: "中國"
Hongkong: "中国"
},
en_US: {
title: "Password login",
Code: "Password",
phone: "Account",
placeholder01: "Input phone number/mailbox",
placeholder02: "Input password",
register: "Register",
login: "Login",
loginText: "Click 'login' to read and agree",
loginHref: " Service Agreement ",
alert01: "The account cannot be empty",
alert02: "The password cannot be empty",
Codelogin: "Switch",
ForgetThePassword: "Forgot Password",
WalletLoginSuccessMsg: "Login succeeded!",
WalletLoginMobilePhoneNullMsg: "The phone number cannot be empty!",
countriesAndRegions: "Country Areas",
// China: "China"
Hongkong: "China"
}
}
</script>
<script>
var dataInfo = new Vue({
el: "#data-info",
data: {
langue: langues[app.getLanguageLocalStorage()],
dataBase: {}, // 页面渲染
dataParameter: {
mobilePhone: "", // 手机号验证
password: "",
internationalCode: "86"
}
}
});
mui.init({
gestureConfig: {
longtap: true, //默认为false
release: true
}
});
mui.plusReady(function() {
//登录
document.getElementById("login-btn").addEventListener("tap", function() {
var ajaxData = {
username: dataInfo.dataParameter.mobilePhone,
password: dataInfo.dataParameter.password
};
if(!valueIsNotNull(ajaxData.username)) {
mui.toast(dataInfo.langue.WalletLoginMobilePhoneNullMsg);
} else if(!isPoneAvailable(ajaxData.username)) {
mui.toast(dataInfo.langue.alert01)
} else if(!valueIsNotNull(ajaxData.password)) {
mui.toast(dataInfo.langue.alert02);
} else {
plus.nativeUI.showWaiting(dataInfo.langue.ShowWaiting);
ajaxData.tel = ajaxData.username;
ajaxData.password = ajaxData.password;
//该值请从 mine/js/base/getClientInfo.js 中查看
ajaxData.clientId = plusClientId;
login(loginAjaxJs.AJAX_PASS_LOGIN, ajaxData);
}
});
document.getElementById('protocol').addEventListener('tap', function() {
mui.openWindow({
id: "mine/html/wallet_terms_of_service.html",
url: "wallet_terms_of_service.html"
});
})
// 跳转到注册页面
document.getElementById('js-openview-signup').addEventListener('tap', function() {
app.openWin("wallet_sign_up.html", "mine/html/wallet_sign_up.html");
})
// 跳转到忘記密碼页面
document.getElementById('js-openview-forget').addEventListener('tap', function() {
app.openWin("user/not_login_user_forget-password.html", "not_login_user_forget-password.html");
})
//验证码登录
document.getElementById('js-code-login').addEventListener('tap', function() {
colseWin();
app.openWin("wallet_login.html", "mine/html/wallet_login.html");
})
/**
* 国际代码回掉监听
*/
// window.addEventListener("internationalCode", function(event) {
// document.getElementById("internationalCode").value = event.detail.code;
// document.getElementById('international_code').value = event.detail.name;
// document.getElementById("mobilePhoneLabel").innerText = "+" + event.detail.code;
// dataInfo.langue.Hongkong = event.detail.name;
// dataInfo.dataParameter.internationalCode = event.detail.code;
// });
//选择国际点击事件
// document.getElementById('international_code').addEventListener('tap', function() {
// app.openWin('indexed-list.html', 'indexed-list.html', null, null);
// });
});
/**
* 空判断
* @param {Object} value 参数
*/
function valueIsNotNull(value) {
if(null != value && value.replace(/\s+/g, "") != "") {
return true;
}
return false;
}
/**
* 判断是否为有效手机号
* @param {Object} str
*/
/*function isPoneAvailable(str) {
var myreg = /^1[3-9][0-9]{9}$/;
if(!myreg.test(str)) {
return false;
} else {
return true;
}
}*/
/**
* 空判断
* @param {Object} value 参数
*/
function isPoneAvailable(value) {
if(null != value && value.replace(/\s+/g, "") != "") {
return true;
}
return false;
}
//登录
function login(ajaxObj, ajaxData) {
mui.ajax(ajaxObj.getUrl, {
headers: {
// "X-Requested-Token": app.getTokenStorage(), // token头部
"locale": app.getLanguageLocalStorage() // 语种头部
},
type: ajaxObj.getType, //HTTP请求类型
data: ajaxData,
dataType: 'json', //服务器返回json格式数据
timeout: 10000, //超时时间设置为10秒;
success: function(data) {
if("200" == data.code) {
JSON.stringify(data);
//用户数据加入缓存
saveLocalStorage(data);
synchrodataFun();
// getEthWallet();
// sleep(2000);
plus.nativeUI.closeWaiting();
mui.back();
// plus.webview.currentWebview().close();
// mui.toast(dataInfo.langue.WalletLoginSuccessMsg);
} else {
plus.nativeUI.closeWaiting();
app.toast(data.msg);
}
},
error: function(xhr, type, errorThrown) {
plus.nativeUI.closeWaiting();
// app.toast(langue.AjaxError);
}
})
}
function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while(true) {
now = new Date();
if(now.getTime() > exitTime)
return;
}
}
/**
* 数据同步
*/
function synchrodataFun() {
//“我的”首页
var walletMyView = plus.webview.getWebviewById("mine/html/wallet_my.html");
walletMyView.evalJS("saveUserInfoData();");
// 钱包页面
var walletView = plus.webview.getWebviewById("html/wallet/html/wallet.html");
mui.fire(walletView, "walletSaveEvent");
// 币币页面
var CCTView = plus.webview.getWebviewById("html/cct/html/cct_index.html");
mui.fire(CCTView, "login");
}
/**
* 更新缓存
*/
function saveLocalStorage(data) {
app.setUserLocalStorage(data.data);
app.setTokenStorage(data.data.token);
}
/*function initJoinChatRoom() {
//“聊天室”
let chatRoomView = plus.webview.getWebviewById("wallet_chat_room.html");
// chatRoomView.evalJS("flushView();");
}*/
/*function getEthWallet() {
mui.ajax(ethAjaxApi.SELECT_ETHWALLET.getUrl, {
headers: {
"X-Requested-Token": app.getTokenStorage(), // token头部
"locale": app.getLanguageLocalStorage() // 语种头部
},
dataType: 'json', //服务器返回json格式数据
type: ethAjaxApi.SELECT_ETHWALLET.getType, //HTTP请求类型
timeout: 10000, //超时时间设置为10秒
success: function(data) {
app.setEthWalletInfoLocalStorage(data.data);
console.log(JSON.stringify(app.getEthWalletInfoLocalStorage()));
synchrodataFun(); //数据同步
}
});
}*/
function colseWin() {
var view = plus.webview.currentWebview();
setTimeout(function() {
view.hide();
view.close();
}, 500)
}
// 国际化统一方法
window.addEventListener('switchLangueData', function(e) {
dataInfo.langue = langues[e.detail];
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>我的登录</title>
<!--REM自适应布局JS-->
<link rel="stylesheet" type="text/css" href="../../lib/css/mui.min.css">
<link href="../../lib/css/basic.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../css/base.css" />
<script src="../../lib/js/mui.min.js"></script>
<script src="../../lib/js/vue.js"></script>
<script src="../../lib/js/app.js"></script>
<script src="../../lib/js/jsdeferred.nodoc.js"></script>
<script type="text/javascript" src="../js/base/rem-layout.js"></script>
<script type="text/javascript" src="../js/login/login_ajax.js"></script>
<script src="../../html/wakuang/js/eth/ajax/eth.ajaxApi.js"></script>
<script src="../../lib/js/require2.1.11.js"></script>
<script src="../../lib/js/internationalCode.js"></script>
<script src="../js/base/getClientInfo.js"></script>
</head>
<style>
#user-login {
margin: 0.25rem 0.25rem;
}
#user-login label {
width: 1.25rem;
}
#user-login .app-input {
width: 60%;
}
#user-login #mobile-phone .app-input {
flex-grow: 7;
}
#user-login #password-input .app-input {
flex-grow: 7;
}
#user-login .app-group-right-text {
width: 40%;
border: 0px solid white;
}
#user-login .app-input-row-list {
border-radius: 0.2rem;
margin: 0.2rem 0;
overflow: hidden;
border: 1px solid #DDDDDD !important;
}
#login-text-info {
margin: 0.3rem 0 0 0;
}
.mui-slider-item {
border: none !important;
}
.login-slider {
top: 90px !important;
}
.login-slider-title {
padding: 0 0.68rem 0 0.68rem !important;
}
#sliderSegmentedControl {
margin: 0 0 0 0.25rem !important;
}
#forget-password {
margin: 0.4rem;
font-size: 0.25rem;
line-height: 1.5em;
}
</style>
<body>
<div id="data-info">
<header class="mui-bar mui-bar-nav app-header app-header-darkly">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">{{langue.title}}</h1>
<a id="js-code-login" class="mui-pull-right" style="position: absolute; right: 12px;bottom: .28rem;">{{langue.Codelogin}}</a>
</header>
<div class="mui-content" style="margin-top: 0.5rem;">
<div id="user-login" class="app-input-group app-input-group-darkly">
<!--<div id="international-div" class="app-input-row-list">-->
<!--<label class="mui-text-center">{{langue.countriesAndRegions}}</label>-->
<!--<label>请选择国家</label>-->
<!--<input id="international_code" class="app-input" type="text" readonly="readonly" :value="langue.Hongkong" />
<input id="internationalCode" type="hidden" value="86" />-->
<!--</div>-->
<div id="mobile-phone" class="app-input-row-list">
<!--<label id="mobilePhoneLabel" class="mui-text-center">+86</label>-->
<label class="mui-text-center">{{langue.phone}}</label>
<input id="mobilePhone" class="app-input" type="text" v-model="dataParameter.mobilePhone" :placeholder="langue.placeholder01" />
</div>
<div id="mobile-phone" class="app-input-row-list">
<label class="mui-text-center">{{langue.Code}}</label>
<input id="password" class="app-input" type="password" v-model="dataParameter.password" :placeholder="langue.placeholder02" />
</div>
<div>
<p class="mui-text-right" style="padding: 0.2rem; float: right;" id="js-openview-signup">
<a>{{langue.register}}</a>
</p>
<p class="mui-text-left" style="padding: 0.2rem; float: left;" id="js-openview-forget">
<a>{{langue.ForgetThePassword}}</a>
</p>
</div>
</div>
<div class="login-btn">
<button id="login-btn" class="app-btn app-btn-darkly" style="margin-top: 0.5rem;width: 90%; margin-left: 5%;">{{langue.login}}</button>
<p id="login-text-info" class="mui-text-center">{{langue.loginText}}
<a id="protocol">{{langue.loginHref}}</a>
</p>
</div>
</div>
</div>
</body>
</html>
<script>
// 国际化
var langues = {
zh_CN: {
title: "密码登录",
Code: "密码",
phone: "账号",
placeholder01: "请输入手机号/邮箱",
placeholder02: "请输入密码",
register: "新用户注册",
login: "登录",
loginText: "点击'登录'代表你已阅读并同意",
loginHref: "《服务协议》",
alert01: "账号不能为空",
alert02: "密码不能为空",
Codelogin: "验证码登录",
ForgetThePassword: "忘记密码",
WalletLoginSuccessMsg: "登录成功!",
WalletLoginMobilePhoneNullMsg: "手机号不能为空!",
countriesAndRegions: "国家地区",
// China: "中国"
Hongkong: "中国"
},
zh_HK: {
title: "密碼登錄",
Code: "密碼",
phone: "賬號",
placeholder01: "請輸入手機號/郵箱",
placeholder02: "請輸入密碼",
register: "新用戶註冊",
login: "登錄",
loginText: "點擊'登錄'代表妳已閱讀並同意",
loginHref: "《服務協議》",
alert01: "賬號不能為空",
alert02: "密碼不能為空",
Codelogin: "驗證碼登錄",
ForgetThePassword: "忘記密碼",
WalletLoginSuccessMsg: "登錄成功!",
WalletLoginMobilePhoneNullMsg: "手機號不能為空!",
countriesAndRegions: "國家地區",
// China: "中國"
Hongkong: "中国"
},
en_US: {
title: "Password login",
Code: "Password",
phone: "Account",
placeholder01: "Input phone number/mailbox",
placeholder02: "Input password",
register: "Register",
login: "Login",
loginText: "Click 'login' to read and agree",
loginHref: " Service Agreement ",
alert01: "The account cannot be empty",
alert02: "The password cannot be empty",
Codelogin: "Switch",
ForgetThePassword: "Forgot Password",
WalletLoginSuccessMsg: "Login succeeded!",
WalletLoginMobilePhoneNullMsg: "The phone number cannot be empty!",
countriesAndRegions: "Country Areas",
// China: "China"
Hongkong: "China"
}
}
</script>
<script>
var dataInfo = new Vue({
el: "#data-info",
data: {
langue: langues[app.getLanguageLocalStorage()],
dataBase: {}, // 页面渲染
dataParameter: {
mobilePhone: "", // 手机号验证
password: "",
internationalCode: "86"
}
}
});
mui.init({
gestureConfig: {
longtap: true, //默认为false
release: true
}
});
mui.plusReady(function() {
//登录
document.getElementById("login-btn").addEventListener("tap", function() {
var ajaxData = {
username: dataInfo.dataParameter.mobilePhone,
password: dataInfo.dataParameter.password
};
if(!valueIsNotNull(ajaxData.username)) {
mui.toast(dataInfo.langue.WalletLoginMobilePhoneNullMsg);
} else if(!isPoneAvailable(ajaxData.username)) {
mui.toast(dataInfo.langue.alert01)
} else if(!valueIsNotNull(ajaxData.password)) {
mui.toast(dataInfo.langue.alert02);
} else {
plus.nativeUI.showWaiting(dataInfo.langue.ShowWaiting);
ajaxData.tel = ajaxData.username;
ajaxData.password = ajaxData.password;
//该值请从 mine/js/base/getClientInfo.js 中查看
ajaxData.clientId = plusClientId;
login(loginAjaxJs.AJAX_PASS_LOGIN, ajaxData);
}
});
document.getElementById('protocol').addEventListener('tap', function() {
mui.openWindow({
id: "mine/html/wallet_terms_of_service.html",
url: "wallet_terms_of_service.html"
});
})
// 跳转到注册页面
document.getElementById('js-openview-signup').addEventListener('tap', function() {
app.openWin("wallet_sign_up.html", "mine/html/wallet_sign_up.html");
})
// 跳转到忘記密碼页面
document.getElementById('js-openview-forget').addEventListener('tap', function() {
app.openWin("user/not_login_user_forget-password.html", "not_login_user_forget-password.html");
})
//验证码登录
document.getElementById('js-code-login').addEventListener('tap', function() {
colseWin();
app.openWin("wallet_login.html", "mine/html/wallet_login.html");
})
/**
* 国际代码回掉监听
*/
// window.addEventListener("internationalCode", function(event) {
// document.getElementById("internationalCode").value = event.detail.code;
// document.getElementById('international_code').value = event.detail.name;
// document.getElementById("mobilePhoneLabel").innerText = "+" + event.detail.code;
// dataInfo.langue.Hongkong = event.detail.name;
// dataInfo.dataParameter.internationalCode = event.detail.code;
// });
//选择国际点击事件
// document.getElementById('international_code').addEventListener('tap', function() {
// app.openWin('indexed-list.html', 'indexed-list.html', null, null);
// });
});
/**
* 空判断
* @param {Object} value 参数
*/
function valueIsNotNull(value) {
if(null != value && value.replace(/\s+/g, "") != "") {
return true;
}
return false;
}
/**
* 判断是否为有效手机号
* @param {Object} str
*/
/*function isPoneAvailable(str) {
var myreg = /^1[3-9][0-9]{9}$/;
if(!myreg.test(str)) {
return false;
} else {
return true;
}
}*/
/**
* 空判断
* @param {Object} value 参数
*/
function isPoneAvailable(value) {
if(null != value && value.replace(/\s+/g, "") != "") {
return true;
}
return false;
}
//登录
function login(ajaxObj, ajaxData) {
mui.ajax(ajaxObj.getUrl, {
headers: {
// "X-Requested-Token": app.getTokenStorage(), // token头部
"locale": app.getLanguageLocalStorage() // 语种头部
},
type: ajaxObj.getType, //HTTP请求类型
data: ajaxData,
dataType: 'json', //服务器返回json格式数据
timeout: 10000, //超时时间设置为10秒;
success: function(data) {
if("200" == data.code) {
JSON.stringify(data);
//用户数据加入缓存
saveLocalStorage(data);
synchrodataFun();
// getEthWallet();
// sleep(2000);
plus.nativeUI.closeWaiting();
mui.back();
// plus.webview.currentWebview().close();
// mui.toast(dataInfo.langue.WalletLoginSuccessMsg);
} else {
plus.nativeUI.closeWaiting();
app.toast(data.msg);
}
},
error: function(xhr, type, errorThrown) {
plus.nativeUI.closeWaiting();
}
})
}
function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while(true) {
now = new Date();
if(now.getTime() > exitTime)
return;
}
}
/**
* 数据同步
*/
function synchrodataFun() {
//“我的”首页
var walletMyView = plus.webview.getWebviewById("mine/html/wallet_my.html");
walletMyView.evalJS("saveUserInfoData();");
// 钱包页面
var walletView = plus.webview.getWebviewById("html/wallet/html/wallet.html");
mui.fire(walletView, "walletSaveEvent");
// 币币页面
var CCTView = plus.webview.getWebviewById("html/cct/html/cct_index.html");
mui.fire(CCTView, "login");
}
/**
* 更新缓存
*/
function saveLocalStorage(data) {
app.setUserLocalStorage(data.data);
app.setTokenStorage(data.data.token);
}
/*function initJoinChatRoom() {
//“聊天室”
let chatRoomView = plus.webview.getWebviewById("wallet_chat_room.html");
// chatRoomView.evalJS("flushView();");
}*/
/*function getEthWallet() {
mui.ajax(ethAjaxApi.SELECT_ETHWALLET.getUrl, {
headers: {
"X-Requested-Token": app.getTokenStorage(), // token头部
"locale": app.getLanguageLocalStorage() // 语种头部
},
dataType: 'json', //服务器返回json格式数据
type: ethAjaxApi.SELECT_ETHWALLET.getType, //HTTP请求类型
timeout: 10000, //超时时间设置为10秒
success: function(data) {
app.setEthWalletInfoLocalStorage(data.data);
console.log(JSON.stringify(app.getEthWalletInfoLocalStorage()));
synchrodataFun(); //数据同步
}
});
}*/
function colseWin() {
var view = plus.webview.currentWebview();
setTimeout(function() {
view.hide();
view.close();
}, 500)
}
// 国际化统一方法
window.addEventListener('switchLangueData', function(e) {
dataInfo.langue = langues[e.detail];
});
</script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

Loading…
Cancel
Save