Commit 62483aa9 by zhanghui1

代码重构优化

parent 30024249
{
"name": "poolin_app",
"name": "poolin_app_new",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "xin3w <xin3w@126.com>",
......@@ -10,19 +10,23 @@
"build": "node build/build.js"
},
"dependencies": {
"@tweenjs/tween.js": "^17.2.0",
"animate.css": "^3.5.2",
"axios": "^0.17.1",
"better-scroll": "^1.8.0",
"echarts": "^3.8.5",
"echarts": "^4.0.2",
"element-ui": "^2.0.11",
"mint-ui": "^2.2.13",
"vue": "^2.5.2",
"vue-awesome-swiper": "^3.1.0",
"vue-awesome-swiper": "^3.1.2",
"vue-clipboard2": "0.0.8",
"vue-echarts-v3": "^1.0.18",
"vue-echarts-v3": "^1.0.19",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"less": "^2.7.3",
"less-loader": "^4.0.5",
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
......@@ -39,8 +43,6 @@
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
......
<template>
<div id="app" :class="gradeClass">
<transition :name="'vux-pop-' + (direction === '' ? '' : (direction === 'forward' ? 'in' : 'out'))" v-if="left">
<mr-navigation>
<router-view></router-view>
</mr-navigation>
</transition>
<transition v-if="!left">
<transition :name="'vux-pop-' + (direction === '' ? '' : (direction === 'forward' ? 'in' : 'out'))">
<mr-navigation>
<router-view></router-view>
</mr-navigation>
......@@ -17,15 +12,10 @@ import { mapState } from 'vuex'
export default {
name: 'app',
data() {
return {
left: false
}
return {}
},
computed: {
...mapState('translate', ['direction']),
finallyDirection() {
return this.tempDirection || this.direction
}
...mapState('translate', ['direction'])
},
created() {
if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
......@@ -44,10 +34,10 @@ export default {
position: relative;
}
.mobile-android .vux-pop-in-enter-active,
.mobile-android .vux-pop-in-leave-activ,
.mobile-android .vux-pop-out-enter-active,
.mobile-android .vux-pop-out-enter-active {
.vux-pop-in-enter-active,
.vux-pop-in-leave-activ,
.vux-pop-out-enter-active,
.vux-pop-out-enter-active {
transition-duration: .2s;
transition-timing-function: cubic-bezier(.4, .6, .2, 1);
opacity: 1;
......
export default {
txt: {
'zh-cn': {
zhuce: "注册",
denglu: "登录",
slogen1: "去中心化,让世界变得更美好",
slogen2: "超过<span>100,000</span>台矿机平稳运行在我们的平台上",
shouye: "首页",
yonghumianban: "用户面板",
kuangji: "矿机",
shouyi: "收益",
tongji: "统计",
kefu: "客服",
bangzhu: "帮助",
guanyuwomen: "关于我们",
gonggao: "公告",
gaodu: "高度",
shijian: "时间",
qvkuaihaxi: "区块哈希",
baokuaidiqv: "报块地区",
qvkuaijiangli: "区块奖励",
laitebi: "莱特币",
dashibi: "达世币",
sanri: "3日",
qiri: "7日",
sanshiri: "30日",
jiushiri: "90日",
suanlitubiao: "算力图表",
xingyunzhi: "幸运值",
zongsuanli: "总算力",
kuangjishu: "矿机数",
wabishuliang: "挖币数量",
zongqvkuaishu: "总区块数",
guangboqvkuai: "广播区块",
beijing: "北京",
shenzhen: "深圳",
zaixiankuangji: "在线矿机",
shishisuanli: "实时算力",
shishi: "实时",
ershisixiaoshi: "24小时",
huoyue: "活跃",
feihuoyue: "非活跃",
jinriyugu: "今日预估",
zuorishishou: "昨日实收",
yixiaoshi: "1小时",
yitian: "1天",
jvjuelv: "拒绝率",
chenggonglv: "成功率",
wakuangdizhi: "挖矿地址",
yunyingfuwu: "运营服务",
tongzhigonggao: "通知公告",
ershisixiaoshisuanli: "24小时算力",
youxiaokuanggong: "有效矿工",
zuorishouyi: "昨日收益",
quanbu: "全部",
buhuoyue: "不活跃",
shixiao: "失效",
sousuokuangji: "",
sousuo: "搜索",
kuangjiming: "矿机名",
risuanli: "日算力",
jieshoushu: "接受数",
zuijintijiaoshijian: "最近提交时间",
zhuangtai: "状态",
tianjiafenzu: "添加分组",
shanchufenzu: "删除分组",
quanxuan: "全选",
shanchu: "删除",
yidongdao: "移动到",
danjisuanli: "单机算力",
zuijintijiaoip: "最近提交IP",
miaoqian: "秒前",
yunxingzhuangkuang: "运行状态",
leijiyizhifu: "累计已支付",
yue: "余额",
wakuangriqi: "挖矿日期",
shouyishue: "收益数额",
ribiandong: "日变动",
zhifushijian: "支付时间",
zhifudizhi: "支付地址",
zhifuzhuangtai: "支付状态",
yuanyin: "原因",
cunruyue: "存入余额",
yizhifu: "已支付",
zizhanghuguanli: "子账户管理",
chuangjianzizhanghu: "创建子账户",
zhanghushezhi: "账户设置",
tuichudenglu: "退出登录",
shezhi: "设置",
dangqiandengluzhanghu: "当前登录帐户",
xuanzehuozhe: "请先选择一个子账户,或者",
zezhanghulibiao: "子帐户列表",
morenbizhong: "默认币种",
chakan: "查看",
shoukuandizhixiugai: "收款地址修改",
morenbizhongxiugai: "默认币种修改",
dangqianshoukuandizhi: "当前收款地址",
weishezhi: "未设置",
xindizhi: "新地址",
dangqianmorenbizhong: "当前默认币种",
xiugaimorenbizhong: "修改默认币种",
tips1: "当切换到该子账户时,将默认显示该币种",
qvxiao: "取消",
queding: "确定",
shoukuandizixiugaichenggong: "收款地址修改成功",
tijiao: "提交",
tips2: "注意:为了安全原因,修改地址后48小时内不予支付,您的收益将作为余额,在48小时后可以结算。",
xiayibu: "下一步",
zizhanghuming: "子账户名",
tips3: "请选择此子账户优先显示的币种",
chuangjian: "创建",
tips4: '<p>子账户支持多个币种和多个币种挖矿,你可以创建多个子账户管理不同的币种和地区挖矿。</p><p>您最多可设置50个子账户。这一子账户名称加上矿机编号即为矿机设置页的矿机名(worker name),如: "zizhanghu.001","zizhanghu.002"。</p>',
tips5: "4-20个小写字母或数字",
tips6: "全部=活跃+不活跃。<br />不活跃表示超过10分钟失去连接的矿机<br />失效表示超过24小时失去连接的矿机",
gengduo:"更多",
daizhifu:"待支付",
zizhanghumianban:"子账户面板",
dangqiandogebutiedizhi:"当前DOGE补贴地址",
dogobutiedizhixiugai:"DOGE补贴地址修改",
dogobutiedizhizhezhi:"DOGE补贴地址设置",
morenfenzu:"默认分组"
},
'en': {
zhuce: "en注册",
denglu: "en登录",
slogen1: "Decentration,Make the world a better place",
slogen2: "en超过<span>100,000</span>台矿机平稳运行在我们的平台上",
shouye: "Home",
yonghumianban: "Dashboard",
kuangji: "Minners",
shouyi: "Payments",
tongji: "Statistics",
kefu: "Customer Service",
bangzhu: "Help",
guanyuwomen: "About Us",
gonggao: "Notice",
gaodu: "Height",
shijian: "Date",
qvkuaihaxi: "Hash",
baokuaidiqv: "Regin",
qvkuaijiangli: "Block",
laitebi: "Lite coin",
dashibi: "Dash coin",
sanri: "3days",
qiri: "7days",
sanshiri: "30days",
jiushiri: "90days",
suanlitubiao: "suanlitubiao",
xingyunzhi: "Lucky Value",
zongsuanli: "en总算力",
kuangjishu: "kuangjishu",
wabishuliang: "wabishuliang",
zongqvkuaishu: "zongqvkuaishu",
guangboqvkuai: "guangboqvkuai",
beijing: "Beijing",
shenzhen: "Shenzhen",
zaixiankuangji: "zaixiankuangji",
shishisuanli: "en实时算力",
shishi: "en实时",
ershisixiaoshi: "24Hour",
huoyue: "en活跃",
feihuoyue: "en非活跃",
jinriyugu: "en今日预估",
zuorishishou: "en昨日实收",
yixiaoshi: "en1小时",
yitian: "en1天",
jvjuelv: "en拒绝率",
chenggonglv: "en成功率",
wakuangdizhi: "en挖矿地址",
yunyingfuwu: "en运营服务",
tongzhigonggao: "en通知公告",
ershisixiaoshisuanli: "en24小时算力",
youxiaokuanggong: "en有效矿工",
zuorishouyi: "en昨日收益",
quanbu: "en全部",
buhuoyue: "en不活跃",
shixiao: "en失效",
sousuokuangji: "en搜索矿机",
sousuo: "en搜索",
kuangjiming: "en矿机名",
risuanli: "en日算力",
jieshoushu: "en接受数",
zuijintijiaoshijian: "en最近提交时间",
zhuangtai: "en状态",
tianjiafenzu: "en添加分组",
shanchufenzu: "en删除分组",
quanxuan: "en全选",
shanchu: "en删除",
yidongdao: "en移动到",
danjisuanli: "en单机算力",
zuijintijiaoip: "en最近提交IP",
miaoqian: "en秒前",
yunxingzhuangkuang: "en运行状态",
leijiyizhifu: "en累计已支付",
yue: "en余额",
wakuangriqi: "en挖矿日期",
shouyishue: "en收益数额",
ribiandong: "en日变动",
zhifushijian: "en支付时间",
zhifudizhi: "en支付地址",
zhifuzhuangtai: "en支付状态",
yuanyin: "en原因",
cunruyue: "en存入余额",
yizhifu: "en已支付",
zizhanghuguanli: "en子账户管理",
chuangjianzizhanghu: "en创建子账户",
zhanghushezhi: "en账户设置",
tuichudenglu: "en退出登录",
shezhi: "Setting",
dangqiandengluzhanghu: "en当前登录帐户",
xuanzehuozhe: "en请先选择一个子账户,或者",
zezhanghulibiao: "en子帐户列表",
morenbizhong: "en默认币种",
chakan: "en查看",
shoukuandizhixiugai: "en收款地址修改",
morenbizhongxiugai: "en默认币种修改",
dangqianshoukuandizhi: "en当前收款地址",
weishezhi: "en未设置",
xindizhi: "en新地址",
dangqianmorenbizhong: "en当前默认币种",
xiugaimorenbizhong: "en修改默认币种",
tips1: "en当切换到该子账户时,将默认显示该币种",
qvxiao: "en取消",
queding: "en确定",
shoukuandizixiugaichenggong: "en收款地址修改成功",
tijiao: "提交",
tips2: "en注意:为了安全原因,修改地址后48小时内不予支付,您的收益将作为余额,在48小时后可以结算。",
xiayibu: "en下一步",
zizhanghuming: "en子账户名",
tips3: "请选择此子账户优先显示的币种",
chuangjian: "en创建",
tips4: '<p>en子账户支持多个币种和多个币种挖矿,你可以创建多个子账户管理不同的币种和地区挖矿。</p><p>您最多可设置50个子账户。这一子账户名称加上矿机编号即为矿机设置页的矿机名(worker name),如: "zizhanghu.001","zizhanghu.002"。</p>',
tips5: "en4-20个小写字母或数字",
tips6: "en全部=活跃+不活跃。<br />不活跃表示超过10分钟失去连接的矿机<br />失效表示超过24小时失去连接的矿机",
gengduo:"en更多",
daizhifu:"en待支付",
zizhanghumianban:"en子账户面板",
dangqiandogebutiedizhi:"en当前DOGE补贴地址",
dogobutiedizhixiugai:"enDOGE补贴地址修改",
dogobutiedizhizhezhi:"enDOGE补贴地址设置",
morenfenzu:"en默认分组",
}
}
}
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
import dictionaries from '@/assets/js/dictionaries.js'; //字典
const state = {
refresh_time: 10000, //定时刷新
// is_login: $auth.isAuthenticated(), //是否登录
init_url: {}, //全站入口信息
cur_coins: [], //获取支持的币种
txt: dictionaries.txt, //字典
language: 'zh-cn', //en/zh-cn切换语言,从localStorage中取;
coin_type_show: false, //是否显示币种切换
enter_panel:false,//是否从子账户面板进来的
base_url: "http://ltc-bj-dev.c6396418dd7954b228d8b967c8a929103.cn-beijing.alicontainer.com/api/public/v1/url", //初始接口
common_url: "http://ltc-bj-dev.c6396418dd7954b228d8b967c8a929103.cn-beijing.alicontainer.com/api/public/v1", //币种切换对应的baseUrl
// base_url: "BASE_URL", //初始接口
// common_url: "COMMON_URL", //币种切换对应的baseUrl
puid: '', //初始用户id为空,与localStorage同步
coin_type: '', //默认币种类型
region_id: '', //默认节点
refresh:'',
tab_bar:0
}
const mutations = {
setEnterPannel(state,v){
state.enter_panel=v;
localStorage.setItem("enter_panel", v);
},
setRefresh(state){
state.refresh=new Date().getTime();
},
setInitUrl(state, v) {
state.init_url = v;
},
setCurCoins(state, v) {
state.cur_coins = v
},
setCoinType(state, v) {
state.coin_type = v;
localStorage.setItem("coin_type", v);
},
setRegionId(state, v) {
state.region_id = v
localStorage.setItem("region_id", v);
},
setPuid(state, v) {
state.puid = v
localStorage.setItem("puid", v);
},
setLanguage(state,v){
state.language = v
localStorage.setItem("language", v);
}
}
const getters = {
// count: function(state) {
// return state.count += 100;
// }
}
const actions = {
// addAction(context) {
// context.commit('add', 10)
// }
}
export default new Vuex.Store({
state,
mutations,
getters,
actions
})
......@@ -2,8 +2,16 @@
<span>{{ tweeningValue }}</span>
</template>
<script>
// import TWEEN from '@tweenjs/tween.js'
/**
* 这块和index.html引入的是同一个tweenjs可能版本不一样。注释的形式会报.toFixed of undefined错误
* index.html引用的形式显示正常
* 有时间尝试查找一下原因
*/
// import Tween from '@/utils/tween.js'
// var TWEEN = require('@tweenjs/tween.js');
export default {
props:['value','fixed'],
props: ['value', 'fixed'],
data: function() {
return {
tweeningValue: 0
......
<template>
<div class="tab-bar">
<ul flex="main:justify box:mean cross:center">
<li @click="goTo(0)" :class="$store.state.poolinApp.tab_bar==0?'active':''">
<li @click="goTo(0)" :class="$store.state.tab_bar==0?'active':''">
<i class="iconfont icon-tubiaozhexiantu"></i>
<p>用户面板</p>
</li>
<li @click="goTo(1)" :class="$store.state.poolinApp.tab_bar==1?'active':''">
<li @click="goTo(1)" :class="$store.state.tab_bar==1?'active':''">
<i class="iconfont icon-cabinet-settings"></i>
<p>矿机</p>
</li>
<li @click="goTo(2)" :class="$store.state.poolinApp.tab_bar==2?'active':''">
<li @click="goTo(2)" :class="$store.state.tab_bar==2?'active':''">
<i class="iconfont icon-licaishouyi"></i>
<p>收益</p>
</li>
<li @click="goTo(3)" :class="$store.state.poolinApp.tab_bar==3?'active':''">
<li @click="goTo(3)" :class="$store.state.tab_bar==3?'active':''">
<i class="iconfont icon-unie606"></i>
<p>设置</p>
</li>
......@@ -39,8 +39,7 @@ export default {
},
methods: {
goTo(n) {
this.$store.state.poolinApp.tab_bar = n;
this.$store.state.tab_bar = n;
switch (n) {
case 0:
this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/dashboard')
......@@ -51,7 +50,7 @@ export default {
case 2:
this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/payments')
break;
default:
case 3:
this.$router.replace('/settings')
break;
}
......
<template>
<div class="my-popup">
<ul>
<li class="list-coin" v-for="cur_coin in $store.state.poolinApp['cur_coins']" :key="cur_coin" @click="coinAcitve(cur_coin)" :class="cur_coin==coin_type?'active':''">
<b :class="cur_coin">{{cur_coin|uppercase}}{{$store.state.poolinApp.init_url.coins[cur_coin]['text_zh-cn']}}</b>
<li class="list-coin" v-for="cur_coin in $store.state['cur_coins']" :key="cur_coin" @click="coinAcitve(cur_coin)" :class="cur_coin==coin_type?'active':''">
<b :class="cur_coin">{{cur_coin|uppercase}}{{$store.state.init_url.coins[cur_coin]['text_zh-cn']}}</b>
<i class="iconfont icon-dui"></i>
</li>
</ul>
......@@ -22,7 +22,7 @@ export default {
methods: {
coinAcitve(cur_coin) {
this.$emit('childCoin', cur_coin)
this.$store.commit('poolinApp/setCoinType', cur_coin)
this.$store.commit('setCoinType', cur_coin)
this.coin_type = cur_coin
}
}
......
......@@ -12,7 +12,7 @@
<script>
import { mapState } from "vuex";
import IEcharts from "vue-echarts-v3";
import fn from "@/assets/js/function.js";
import fn from "@/utils/function.js";
export default {
components: {
IEcharts
......@@ -29,7 +29,7 @@ export default {
maxOnOff: false
}),
computed: {
...mapState('poolinApp',["txt", "init_url", "cur_coins"]),
...mapState(["txt", "init_url", "cur_coins"]),
line: function() {
let self = this;
return {
......@@ -57,7 +57,9 @@ export default {
);
}
},
legend: {},
legend: {
show:false
},
grid: {
top: "15%",
left: "3%",
......@@ -66,8 +68,7 @@ export default {
containLabel: true,
show: false
},
xAxis: [
{
xAxis: [{
type: "category",
boundaryGap: false,
data: this.shareHistoryTime,
......@@ -89,10 +90,8 @@ export default {
axisTick: {
show: false
}
}
],
yAxis: [
{
}],
yAxis: [{
type: "value",
name: "算力(" + this.unit + "H/s)",
axisLine: {
......@@ -131,8 +130,7 @@ export default {
// },
// }
],
series: [
{
series: [{
name: "算力",
type: "line",
stack: "",
......@@ -145,8 +143,7 @@ export default {
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
colorStops: [{
offset: 0,
color: "rgb(170, 228, 255)" // 100% 处的颜色
},
......@@ -197,15 +194,11 @@ export default {
};
},
refresh() {
return $store.state.refresh;
return this.$store.state.refresh;
}
},
created() {
this.pageInit(
72,
"1h",
parseInt((new Date().getTime() - 86400000 * 3) / 1000)
);
this.pageInit(72, "1h", parseInt((new Date().getTime() - 86400000 * 3) / 1000));
},
methods: {
pageInit(count, dimension, start) {
......@@ -214,16 +207,13 @@ export default {
let coin_type = this.$route.params.coin_type;
let region_id = this.$route.params.region_id;
this.language = localStorage.getItem("language");
//获取子帐户算力图表
fn.getApiBaseUrl(region_id, coin_type).then(api => {
if (api == "") {
$router.replace(
"/my/" + puid + "/" + localStorage.getItem("coin_type")
);
// this.$router.replace("/my/" + puid + "/" + localStorage.getItem("coin_type"));
} else {
fn
.getWorkerShareHistory(api, puid, count, dimension, start)
.then(res => {
//获取子帐户算力图表
fn.getWorkerShareHistory(api, puid, count, dimension, start).then(res => {
//console.log(res)
if (res.data.err_no == 0) {
//console.log("算力图表数据chartData:", res.data.data)
......@@ -248,13 +238,9 @@ export default {
});
} else {
self.$message.error("获取子帐户算力图表错误!");
$router.replace({
name: "my_puid_cointype",
path:
"/my/" +
self.$route.params.puid +
"/" +
self.$route.params.coin_type
this.$router.replace({
name: "no",
path: "/my/" + self.$route.params.puid + "/" + self.$route.params.coin_type
});
}
});
......@@ -263,38 +249,23 @@ export default {
},
getDay: function(idx) {
this.btnIdx = idx;
this.pageInit(
30,
"1d",
parseInt((new Date().getTime() - 86400000 * 30) / 1000)
);
this.pageInit(30, "1d", parseInt((new Date().getTime() - 86400000 * 30) / 1000));
},
getHour: function(idx) {
this.btnIdx = idx;
this.pageInit(
72,
"1h",
parseInt((new Date().getTime() - 86400000 * 3) / 1000)
);
this.pageInit(72, "1h", parseInt((new Date().getTime() - 86400000 * 3) / 1000));
}
},
watch: {
$route(to, from) {
this.btnIdx = 1;
this.pageInit(
72,
"1h",
parseInt((new Date().getTime() - 86400000 * 3) / 1000)
);
this.pageInit(72, "1h", parseInt((new Date().getTime() - 86400000 * 3) / 1000));
},
refresh(v) {
this.btnIdx = 1;
this.pageInit(
72,
"1h",
parseInt((new Date().getTime() - 86400000 * 3) / 1000)
);
this.pageInit(72, "1h", parseInt((new Date().getTime() - 86400000 * 3) / 1000));
}
}
};
</script>
......@@ -37,13 +37,13 @@
</div>
<div flex="main:center dir:top box:center cross:center">
<p>
<span class="v" v-if="$store.state.poolinApp.coin_type=='xmr'" style="font-size:0.28rem;"><animated-num :value="(payment_stats.yesterday_amount)/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v" v-if="$store.state.coin_type=='xmr'" style="font-size:0.28rem;"><animated-num :value="(payment_stats.yesterday_amount)/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v" v-else><animated-num :value="(payment_stats.yesterday_amount)/Math.pow(10,8)" :fixed=8></animated-num></span>
<span class="k">{{$route.params.coin_type|uppercase}}</span>
</p>
<h3 class="title f24gray">昨日收益</h3>
<p class="small-k-v mt20">
<span class="v" v-if="$store.state.poolinApp.coin_type=='xmr'"><animated-num :value="(payment_stats.today_estimate)/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v" v-if="$store.state.coin_type=='xmr'"><animated-num :value="(payment_stats.today_estimate)/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v" v-else><animated-num :value="(payment_stats.today_estimate)/Math.pow(10,8)" :fixed=8></animated-num></span>
<span class="k">{{$route.params.coin_type|uppercase}}</span>
</p>
......@@ -55,14 +55,14 @@
<div class="list">
<h3>账户收益</h3>
<mt-cell title="余额">
<span class="v" v-if="$store.state.poolinApp.coin_type=='xmr'"><animated-num :value="payment_stats.balance/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v" v-if="$store.state.coin_type=='xmr'"><animated-num :value="payment_stats.balance/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v" v-else><animated-num :value="payment_stats.balance/Math.pow(10,8)" :fixed=8></animated-num></span>
<span class="k">{{$store.state.poolinApp.coin_type|uppercase}}</span>
<span class="k">{{$store.state.coin_type|uppercase}}</span>
</mt-cell>
<mt-cell title="已支付">
<span class="v" v-if="$store.state.poolinApp.coin_type=='xmr'"><animated-num :value="payment_stats.total_paid_amount/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v" v-if="$store.state.coin_type=='xmr'"><animated-num :value="payment_stats.total_paid_amount/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v" v-else><animated-num :value="payment_stats.total_paid_amount/Math.pow(10,8)" :fixed=8></animated-num></span>
<span class="k">{{$store.state.poolinApp.coin_type|uppercase}}</span>
<span class="k">{{$store.state.coin_type|uppercase}}</span>
</mt-cell>
<mt-cell title="上一次支付时间"><span class="v">2017-11-02 8:00</span></mt-cell>
<mt-cell title="待确认支付"><span class="v">119.71423071</span> <span class="k">BTC</span></mt-cell>
......@@ -82,7 +82,7 @@
</div>
</template>
<script>
import fn from "@/assets/js/function.js";
import fn from "@/utils/function.js";
import coin from "@/components/Dashboard/coin";
import region from "@/components/Dashboard/region";
import subaccount from "@/components/Dashboard/subaccount";
......@@ -140,7 +140,7 @@ export default {
self.pageInit();
window.dingshiqi = setInterval(function() {
self.pageInit();
}, $store.state.poolinApp.refresh_time)
}, this.$store.state.refresh_time)
},
pageInit() {
let self = this;
......@@ -148,11 +148,11 @@ export default {
this.coin_type = this.$route.params.coin_type || localStorage.getItem('coin_type');
this.region_id = this.$route.params.region_id || localStorage.getItem('region_id');
this.language = localStorage.getItem('language');
this.language = localStorage.getItem('language');
fn.getApiBaseUrl(this.region_id, this.coin_type).then(api => {
if (api == '') {
//自动到无节点页面
this.$router.replace('/my/' + this.puid + '/' + this.coin_type)
} else {
//请求实时算力
fn.getWorkerStats(api, this.puid).then(res => {
......@@ -217,8 +217,8 @@ export default {
this.showSide = false;
},
fromSubAccount(obj) {
this.$store.commit('poolinApp/setPuid', obj.puid)
this.$store.commit('poolinApp/setCoinType', obj.default_coin_type)
this.$store.commit('setPuid', obj.puid)
this.$store.commit('setCoinType', obj.default_coin_type)
this.showSide = false;
this.$route.params.puid = obj.puid;
this.$route.params.coin_type = obj.default_coin_type;
......@@ -228,7 +228,7 @@ export default {
})
},
fromRegion(msg) {
this.$store.commit('poolinApp/setRegionId', msg)
this.$store.commit('setRegionId', msg)
this.showRegion = false;
this.$route.params.region_id = msg;
this.$router.replace({
......@@ -236,7 +236,7 @@ export default {
})
},
fromCoin(msg) {
this.$store.commit('poolinApp/setCoinType', msg)
this.$store.commit('setCoinType', msg)
this.showCoin = false;
this.$route.params.coin_type = msg;
this.getRegionInfo();
......@@ -248,7 +248,6 @@ export default {
},
watch: {
'$route' (to, from) {
console.log("index.vue watch")
this.pageInitInterval();
},
}
......
......@@ -26,12 +26,10 @@
</div>
</template>
<script>
import fn from "@/assets/js/function.js";
import fn from "@/utils/function.js";
import coin from "@/components/Dashboard/coin";
import region from "@/components/Dashboard/region";
import subaccount from "@/components/Dashboard/subaccount";
import animatedNum from "@/components/Common/AnimatedNum";
import dashboardChart from "@/components/Dashboard/dashboardChart.vue";
import tabbar from "@/components/Common/Tabbar.vue";
export default {
name: "no",
......@@ -39,8 +37,6 @@ export default {
coin,
region,
subaccount,
animatedNum,
dashboardChart,
tabbar
},
data() {
......@@ -90,7 +86,7 @@ export default {
self.pageInit();
window.dingshiqi = setInterval(function() {
self.pageInit();
}, $store.state.poolinApp.refresh_time)
}, $store.state.refresh_time)
},
pageInit() {
let self = this;
......@@ -99,7 +95,6 @@ export default {
this.region_id = this.$route.params.region_id || localStorage.getItem('region_id');
this.language = localStorage.getItem('language');
//获取userName
fn.getSubAccountById(this.puid).then(res => {
if (res.data.err_no == 0) {
......@@ -139,8 +134,8 @@ export default {
this.showSide = false;
},
fromSubAccount(obj) {
this.$store.commit('poolinApp/setPuid', obj.puid)
this.$store.commit('poolinApp/setCoinType', obj.default_coin_type)
this.$store.commit('setPuid', obj.puid)
this.$store.commit('setCoinType', obj.default_coin_type)
this.showSide = false;
this.$route.params.puid = obj.puid;
this.$route.params.coin_type = obj.default_coin_type;
......@@ -150,7 +145,7 @@ export default {
})
},
fromRegion(msg) {
this.$store.commit('poolinApp/setRegionId', msg)
this.$store.commit('setRegionId', msg)
this.showRegion = false;
this.$route.params.region_id = msg;
this.$router.replace({
......@@ -158,7 +153,7 @@ export default {
})
},
fromCoin(msg) {
this.$store.commit('poolinApp/setCoinType', msg)
this.$store.commit('setCoinType', msg)
this.showCoin = false;
this.$route.params.coin_type = msg;
this.$router.replace({
......
......@@ -9,7 +9,7 @@
</div>
</template>
<script>
import fn from '@/assets/js/function.js'
import fn from '@/utils/function.js'
export default {
name: 'region',
data() {
......@@ -39,7 +39,6 @@ export default {
},
watch: {
'$route' (to, from) {
console.log("region.vue watch")
this.getAllRegionByCoin()
}
}
......
......@@ -18,7 +18,7 @@
</div>
</template>
<script>
import fn from '@/assets/js/function.js'
import fn from '@/utils/function.js'
export default {
name: 'subaccount',
data() {
......@@ -30,7 +30,7 @@ export default {
region_id: this.$route.params.region_id,
language: localStorage.getItem('language'),
subaccountList: [],
cur_account_info:{},
cur_account_info: {},
}
},
mounted() {
......@@ -54,11 +54,11 @@ export default {
}
})
},
getSubAccountById(){
fn.getSubAccountById(this.puid).then(res=>{
if(res.data.err_no==0){
this.cur_account_info=res.data.data
}else{
getSubAccountById() {
fn.getSubAccountById(this.puid).then(res => {
if (res.data.err_no == 0) {
this.cur_account_info = res.data.data
} else {
alert("错误")
}
})
......
......@@ -4,7 +4,7 @@
<div class="swiper">
<swiper :options="swiperOption" ref="mySwiper">
<!-- slides -->
<swiper-slide flex="main:center cross:center" v-for="(coin,coinIdx) in $store.state.poolinApp.cur_coins" :key="coin"><span :class="coinIdx==active?coin+' active':coin+''" @click="changeCoin(coin,coinIdx)">{{coin|uppercase}}</span></swiper-slide>
<swiper-slide flex="main:center cross:center" v-for="(coin,coinIdx) in $store.state.cur_coins" :key="coin"><span :class="coinIdx==active?coin+' active':coin+''" @click="changeCoin(coin,coinIdx)">{{coin|uppercase}}</span></swiper-slide>
<!-- Optional controls -->
<div class="swiper-button-prev" slot="button-prev"></div>
<div class="swiper-button-next" slot="button-next"></div>
......@@ -18,7 +18,7 @@
</div>
</template>
<script>
import fn from '@/assets/js/function.js'
import fn from '@/utils/function.js'
import { mapState } from 'vuex'
import homeChart from "@/components/homeChart.vue"
import { swiper, swiperSlide } from 'vue-awesome-swiper'
......@@ -45,12 +45,12 @@ export default {
debugger: true,
slidesPerView: 3,
},
coin: $store.state.poolinApp.cur_coins[0],
coin: this.$store.state.cur_coins[0],
active: 0
}
},
computed: {
...mapState('poolinApp',["txt", "init_url", "cur_coins"]),
...mapState(["txt", "init_url", "cur_coins"]),
swiper() {
return this.$refs.mySwiper.swiper
}
......
<template>
<div class="">
{{msg}}
<h3>这个需要根据情况判断跳转到下面可能的页面</h3>
<ul>
<li>
......@@ -16,27 +15,40 @@
<li>
<router-link to="/my/7/ltc/shenzhen/dashboard">4.跳入用户面板页面</router-link>
</li>
<li>
<router-link to="/settings">设置页</router-link>
</li>
</ul>
</div>
</template>
<script>
export default {
export default {
name: 'jump',
data() {
return {
msg: '判断跳转中...',
puid: '',
coin_type: '',
region_id: '',
language: '',
}
},
mounted() {},
mounted() {
this.puid = this.$route.params.puid || localStorage.getItem('puid'); //相关路由参数
this.coin_type = this.$route.params.coin_type || localStorage.getItem('coin_type');
this.region_id = this.$route.params.region_id || localStorage.getItem('region_id');
this.language = localStorage.getItem('language');
},
methods: {
goDashboard() {
this.$router.replace("/my/7/" + localStorage.getItem('coin_type') + "/" + localStorage.getItem('region_id') + "/dashboard")
}
this.$router.replace("/my/7/" + this.coin_type + "/" + this.region_id + "/dashboard")
}
}
}
</script>
<style scoped>
li {
li {
margin-top: 20px;
}
}
</style>
......@@ -33,7 +33,6 @@ export default {
name: 'login',
data() {
return {
msg: '用户登录页',
loginForm: {
email: '',
password: ''
......
......@@ -56,7 +56,7 @@
<script>
import fn from '@/assets/js/function.js';
import fn from '@/utils/function.js';
import sort from "@/components/Miners/sort";
import group from "@/components/Miners/group";
import tabbar from "@/components/Common/Tabbar.vue";
......
......@@ -47,7 +47,7 @@
<!-- page end -->
</template>
<script>
import fn from '@/assets/js/function.js';
import fn from '@/utils/function.js';
import { mapState } from 'vuex';
import tabbar from "@/components/Common/Tabbar.vue";
export default {
......
......@@ -17,7 +17,7 @@
</div>
</template>
<script>
import fn from '@/assets/js/function.js';
import fn from '@/utils/function.js';
import { mapState } from 'vuex';
import IEcharts from 'vue-echarts-v3';
import animatedNum from "@/components/Common/AnimatedNum.vue";
......@@ -40,7 +40,7 @@ export default {
}),
props: ["params_coin"],
computed: {
...mapState("poolinApp",["txt", "init_url", "cur_coins"]),
...mapState(["txt", "init_url", "cur_coins"]),
line: function() {
let self = this;
return {
......@@ -57,10 +57,12 @@ export default {
params[0].seriesName + ' : ' + (params[0].value).toFixed(3) + ' ' + self.unit + 'H/s'
}
},
legend: {},
legend: {
show:false
},
grid: {
top: '15%',
left: '3%',
left: '5%',
right: '5%',
bottom: '5%',
containLabel: true,
......@@ -151,7 +153,7 @@ export default {
self.pageInit();
window.dingshiqi = setInterval(function() {
self.pageInit();
}, $store.state.poolinApp.refresh_time)
}, this.$store.state.refresh_time)
},
pageInit() {
let self = this;
......
import Vue from 'vue'
import App from './App'
import router from './router'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import VueClipboard from 'vue-clipboard2'
import MintUI from 'mint-ui'
import ElementUI from 'element-ui'
import axios from 'axios'
// import TWEEN from '@tweenjs/tween.js'
import '@/assets/js/rem.js'
import store from './store/'
// import store from '@/assets/js/store.js'
import '@/utils/rem.js'
import store from '@/store/'
import CacheNavigation from './maxrocky/cacheNavigation'
import scrollKeeper from './maxrocky/scrollKeeper'
import routeTranslate from './maxrocky/routeTranslate'
import BetterScroll from './maxrocky/betterScroll'
import App from '@/App'
import router from '@/router'
import CacheNavigation from '@/maxrocky/cacheNavigation'
import scrollKeeper from '@/maxrocky/scrollKeeper'
import routeTranslate from '@/maxrocky/routeTranslate'
import BetterScroll from '@/maxrocky/betterScroll'
Vue.use(CacheNavigation, { router })
Vue.use(scrollKeeper)
Vue.use(routeTranslate, { router, store })
Vue.use(BetterScroll)
window.$store=Vue.$store = Vue.prototype.$store= store;
Vue.use(VueAwesomeSwiper)
Vue.use(VueClipboard)
Vue.use(MintUI)
......@@ -40,7 +39,7 @@ axios.defaults.withCredentials = false;
axios.defaults.timeout = 50000;
axios.interceptors.request.use(config => {
return checkToken().then(function(res) {
config.headers['Authorization'] = "Bearer " + res;
config.headers['Authorization'] = 'Bearer ' + res;
return config;
}, function(eMsg) { console.log('添加token失败了') });
}, err => {
......@@ -49,17 +48,16 @@ axios.interceptors.request.use(config => {
function checkToken() {
return new Promise((resolve, reject) => {
resolve("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE3MTEyNjkzLCJleHAiOjE1MTcxMTk4OTMsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.GFgTnVQnQp1TcycKZP9shxTOPh0k6uLyeQQs00AcqT7-UZ6NDJwGghwfLBhc-LSVMYIwzOuIbiNlwaCzJ2m7OrOiXVJ2PXdDjhfbFOlw7WvXQ1TV_cgLWzOqSGHAtrCQkXFm5Op5gGRsnbpmUOf4IzY2CfyLAhfP0UOmnYn7UgC9iBCNb67C43IAH_CUbLySYXxggNUKhuDGVT99wBdO8RcR6SypaP6e_Rxegb5fI_cR_FZYUQjlKB2dkUsjEN2bmg8ffYpI6s_bWNN06BYnswgMGfF2GRGPz1AJb7SHyqTBXKVaY3qd0eSmbCl3tEFZNEg9uIG74Mu6F47P_KKv2A");
resolve('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE3MjE5NjA2LCJleHAiOjE1MTcyMjY4MDYsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.eci--2LVo2qszdu8o9Enh561WEb-dLygsFFeX5_mvnfeVw8qxiLaNVkyWBHzyYYHLZk2WhRE1PQZ9dtslMwb3Dq6svXhfJhUi4jJizZa4qgNM1ceEGy-IsqexPdg1tIQvXAmg1GDRpt9vyFHRY1C5VYobg_v2LXyoF0RDmMeGAyJQD4ZP2sw0T10uts2dcfG24zlrLfzsbLH04mitYD2Zlj066XPAChIaeUR-fVZxx0bfHHDWAsZurPlkw5SeSRO6oxroPQ07oDN_NXQcfpJevn1gjfMOkLmOma978Aj0axqfqUZAHIzbPF27guUPx15Px9BncEaGCRCYYo_xvXrgA');
})
}
window.$axios = Vue.prototype.$axios = axios;
window.$router = router.$router = router
window.$axios = Vue.$axios = Vue.prototype.$axios = axios;
window.$store = Vue.$store = Vue.prototype.$store = store;
Vue.config.productionTip = false
new Vue({
window.$vm = new Vue({
el: '#app',
store,
router,
......
import Vue from 'vue'
import Router from 'vue-router'
import fn from '@/assets/js/function.js'
Vue.use(Router)
import Home from '@/components/Home'
import Jump from '@/components/Jump'
import Login from '@/components/Login/'
import Reg from '@/components/Reg/'
import no from '@/components/Dashboard/no'
import Dashboard from '@/components/Dashboard/'
import Miners from '@/components/Miners/'
import MinerShow from '@/components/Miners/detail'
import Payments from '@/components/Payments/'
import Settings from '@/components/Settings/'
import DefaultCoin from '@/components/Settings/DefaultCoin'
import Language from '@/components/Settings/Language'
import Account from '@/components/Settings/Account'
import $axios from 'axios'
import fn from '@/utils/function.js'
import store from '@/store/'
import Create from '@/components/Users/Create'
import Subaccount from '@/components/Users/Subaccount'
import Welcome from '@/components/Users/Welcome'
import Notice from '@/components/Notice/'
import NoticeList from '@/components/Notice/list'
import NoticeShow from '@/components/Notice/detail'
var $store = store
Vue.use(Router)
const router = new Router({
routes: [{
path: '/',
name: 'home',
component: Home,
component: resolve => require(['@/components/Home.vue'], resolve),
meta: {
title: 'Home.vue'
title: 'home.vue'
}
}, {
path: '/login',
name: 'login',
component: Login,
path: '/jump',
name: 'jump',
component: resolve => require(['@/components/Jump.vue'], resolve),
meta: {
title: 'Login.vue'
title: 'Jump.vue'
}
}, {
path: '/reg',
name: 'reg',
component: Reg,
component: resolve => require(['@/components/Reg'], resolve),
meta: {
title: 'Reg.vue'
}
}, {
path: '/jump',
name: 'jump',
component: Jump,
path: '/login',
name: 'login',
component: resolve => require(['@/components/Login'], resolve),
meta: {
title: 'Jump.vue'
title: 'Login.vue'
}
}, {
path: '/create',
name: 'create',
component: Create,
component: resolve => require(['@/components/Users/Create.vue'], resolve),
meta: {
title: 'Create.vue'
}
}, {
path: '/welcome',
name: 'welcome',
component: Welcome,
component: resolve => require(['@/components/Users/Welcome.vue'], resolve),
meta: {
title: 'Welcome.vue'
}
}, {
path: '/subaccount',
name: 'subaccount',
component: Subaccount,
component: resolve => require(['@/components/Users/Subaccount.vue'], resolve),
meta: {
title: 'Subaccount.vue'
}
}, {
path: '/my/:puid/:coin_type',
name: 'no',
component: no,
component: resolve => require(['@/components/Dashboard/no.vue'], resolve),
meta: {
title: 'no.vue'
}
}, {
path: '/my/:puid/:coin_type/:region_id/dashboard',
name: 'dashboard',
component: Dashboard,
component: resolve => require(['@/components/Dashboard'], resolve),
meta: {
title: 'Dashboard.vue'
}
}, {
},
{
path: '/my/:puid/:coin_type/:region_id/miners',
name: 'miners',
component: Miners,
component: resolve => require(['@/components/Miners/'], resolve),
meta: {
title: 'Miners.vue'
}
}, {
path: '/my/:puid/:coin_type/:region_id/miners/:worker_id',
name: 'minershow',
component: MinerShow,
component: resolve => require(['@/components/Miners/detail.vue'], resolve),
meta: {
title: 'MinerShow.vue'
}
}, {
path: '/my/:puid/:coin_type/:region_id/payments',
name: 'payments',
component: Payments,
component: resolve => require(['@/components/Payments'], resolve),
meta: {
title: 'Payments.vue'
}
}, {
},
{
path: '/settings',
name: 'settings',
component: Settings,
component: resolve => require(['@/components/Settings/index.vue'], resolve),
meta: {
title: 'Settings.vue'
}
}, {
path: '/defaultCoin',
name: 'defaultCoin',
component: DefaultCoin,
component: resolve => require(['@/components/Settings/DefaultCoin'], resolve),
meta: {
title: 'DefaultCoin.vue'
}
}, {
path: '/language',
name: 'language',
component: Language,
component: resolve => require(['@/components/Settings/Language'], resolve),
meta: {
title: 'Language.vue'
}
}, {
path: '/account',
name: 'account',
component: Account,
component: resolve => require(['@/components/Settings/Account'], resolve),
meta: {
title: 'Account.vue'
}
}, {
path: '/notice',
name: 'notice',
component: Notice,
component: resolve => require(['@/components/Notice'], resolve),
meta: {
title: 'Notice.vue'
}
}, {
path: '/noticeList',
name: 'noticeList',
component: NoticeList,
component: resolve => require(['@/components/Notice/list'], resolve),
meta: {
title: 'NoticeList.vue'
}
}, {
path: '/noticeShow',
name: 'noticeShow',
component: NoticeShow,
component: resolve => require(['@/components/Notice/detail'], resolve),
meta: {
title: 'NoticeShow.vue'
}
}, ]
}
]
})
router.beforeEach((to, from, next) => {
var arr = ['home', 'jump'];
if (localStorage.getItem('enter_panel') == null) {
Vue.$store.commit('poolinApp/setEnterPannel', Vue.$store.state.poolinApp.enter_panel);
$store.commit('setEnterPannel', $store.state.enter_panel);
}
if (localStorage.getItem('puid') == null) {
Vue.$store.commit('poolinApp/setPuid', '');
$store.commit('setPuid', '');
} else {
Vue.$store.commit('poolinApp/setPuid', localStorage.getItem('puid'))
$store.commit('setPuid', localStorage.getItem('puid'))
}
if (localStorage.getItem('enter_panel') == "true") {
Vue.$store.commit('poolinApp/setEnterPannel', true);
$store.commit('setEnterPannel', true);
}
if (localStorage.getItem('language') == null) {
Vue.$store.commit('poolinApp/setLanguage', Vue.$store.state.poolinApp.language)
$store.commit('setLanguage', $store.state.language)
}
// 最先执行的初始数据
if (Vue.$store.state.poolinApp.cur_coins.length == 0) {
$axios(Vue.$store.state.poolinApp.base_url).then(res => {
Vue.$store.commit('poolinApp/setInitUrl', res.data);
Vue.$store.commit('poolinApp/setCurCoins', fn.getCoinsOnly(res.data));
if ($store.state.cur_coins.length == 0) {
$axios($store.state.base_url).then(res => {
$store.commit('setInitUrl', res.data);
$store.commit('setCurCoins', fn.getCoinsOnly(res.data));
if (localStorage.getItem('coin_type') == null) {
Vue.$store.commit('poolinApp/setCoinType', Vue.$store.state.poolinApp.cur_coins[0]);
$store.commit('setCoinType', $store.state.cur_coins[0]);
} else {
if (to.params.coin_type) {
Vue.$store.commit('poolinApp/setCoinType', to.params.coin_type);
$store.commit('setCoinType', to.params.coin_type);
} else {
Vue.$store.commit('poolinApp/setCoinType', localStorage.getItem('coin_type'));
$store.commit('setCoinType', localStorage.getItem('coin_type'));
}
}
if (localStorage.getItem("region_id") == null) {
Vue.$store.commit('poolinApp/setRegionId', res.data.regions[0].region_id);
$store.commit('setRegionId', res.data.regions[0].region_id);
} else {
if (to.params.region_id) {
Vue.$store.commit('poolinApp/setRegionId', to.params.region_id);
$store.commit('setRegionId', to.params.region_id);
} else {
Vue.$store.commit('poolinApp/setRegionId', localStorage.getItem('region_id'));
$store.commit('setRegionId', localStorage.getItem('region_id'));
}
}
modeSwitch(to, from, next)
......@@ -222,8 +202,6 @@ router.afterEach((to, from) => {
document.title = to.meta.title;
})
export default router
function modeSwitch(to, from, next) {
if (to.query.read_token != undefined || to.query.read_token != null) {
// alert("进入观察者模式")
......@@ -251,7 +229,7 @@ function modeSwitch(to, from, next) {
} else {
// alert("进入正常模式")
localStorage.removeItem('read_token');
Vue.$store.state.poolinApp.read_token = '';
$store.state.read_token = '';
next();
// var arr = ['index', 'stats', 'callback', 'jump'];
// if ($auth.isAuthenticated() || arr.indexOf(to.name) > -1) {
......@@ -264,3 +242,5 @@ function modeSwitch(to, from, next) {
// }
}
}
export default router
/**
* Created by Administrator on 2017/6/5.
*/
import Vue from 'vue'
import Vuex from 'vuex'
import mutations from './mutations'
import newsPush from './modules/newsPush.js'
import home from './modules/home.js'
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
import poolinApp from './modules/poolinApp.js'
import dictionaries from '@/utils/dictionaries.js'; //字典
Vue.use(Vuex)
const state = {
refresh_time: 10000, //定时刷新
// is_login: $auth.isAuthenticated(), //是否登录
init_url: {}, //全站入口信息
cur_coins: [], //获取支持的币种
txt: dictionaries.txt, //字典
language: 'zh-cn', //en/zh-cn切换语言,从localStorage中取;
coin_type_show: false, //是否显示币种切换
enter_panel:false,//是否从子账户面板进来的
base_url: "http://ltc-bj-dev.c6396418dd7954b228d8b967c8a929103.cn-beijing.alicontainer.com/api/public/v1/url", //初始接口
common_url: "http://ltc-bj-dev.c6396418dd7954b228d8b967c8a929103.cn-beijing.alicontainer.com/api/public/v1", //币种切换对应的baseUrl
// base_url: "BASE_URL", //初始接口
// common_url: "COMMON_URL", //币种切换对应的baseUrl
puid: '', //初始用户id为空,与localStorage同步
coin_type: '', //默认币种类型
region_id: '', //默认节点
refresh:'',
tab_bar:0
}
const mutations = {
setEnterPannel(state,v){
state.enter_panel=v;
localStorage.setItem("enter_panel", v);
},
setRefresh(state){
state.refresh=new Date().getTime();
},
setInitUrl(state, v) {
state.init_url = v;
},
setCurCoins(state, v) {
state.cur_coins = v
},
setCoinType(state, v) {
state.coin_type = v;
localStorage.setItem("coin_type", v);
},
setRegionId(state, v) {
state.region_id = v
localStorage.setItem("region_id", v);
},
setPuid(state, v) {
state.puid = v
localStorage.setItem("puid", v);
},
setLanguage(state,v){
state.language = v
localStorage.setItem("language", v);
}
}
const getters = {
// count: function(state) {
// return state.count += 100;
// }
}
const actions = {
// addAction(context) {
// context.commit('add', 10)
// }
}
export default new Vuex.Store({
modules: {
state,
mutations,
newsPush,
home,
poolinApp
}
getters,
actions
})
export default {
namespaced: true,
state: {
homeNavChanged: false
},
mutations: {
changed (state) {
state.homeNavChanged = true
},
reset (state) {
state.homeNavChanged = false
}
}
}
export default {
namespaced: true,
state: {
selectItemList: [],
history: []
},
mutations: {
reset (state) {
state.selectItemList = []
state.history = []
},
resetHistory (state) {
state.history = []
},
pushLevel (state, item) {
state.history.push(item)
},
popLevel () {
history.pop()
},
removeItem (state, removeItem) {
let index = -1
state.selectItemList.forEach((item, i) => {
if (item.mdmCode === removeItem.mdmCode) {
index = i
}
})
if (index !== -1) {
state.selectItemList.splice(index, 1)
}
},
addItem (state, item) {
state.selectItemList.push(item)
},
checkLevel (state, mdmCode) {
if (state.history[state.history.length - 1].mdmCode !== mdmCode) {
let index = -1
state.history.forEach((item, i) => {
if (item.mdmCode === mdmCode) {
index = i
}
})
if (index !== -1) {
state.history.splice(index + 1)
}
}
}
},
getters: {
selectPersonCount (state, getters) {
// TODO: 去除包含关系
let count = 0
state.selectItemList.forEach((item) => {
if (item.type === 'dept') count += item.userNums
if (item.type === 'user') count++
})
return count
}
}
}
import dictionaries from '@/assets/js/dictionaries.js'; //字典
export default {
namespaced: true,
state: {
refresh_time: 60000, //定时刷新
// is_login: $auth.isAuthenticated(), //是否登录
init_url: {},
cur_coins: [],
txt: dictionaries.txt,
language: 'zh-cn',
coin_type_show: false,
enter_panel: false,
base_url: "http://ltc-bj-dev.c6396418dd7954b228d8b967c8a929103.cn-beijing.alicontainer.com/api/public/v1/url", //初始接口
common_url: "http://ltc-bj-dev.c6396418dd7954b228d8b967c8a929103.cn-beijing.alicontainer.com/api/public/v1", //币种切换对应的baseUrl
// base_url: "BASE_URL", //初始接口
// common_url: "COMMON_URL", //币种切换对应的baseUrl
puid: '',
coin_type: '',
region_id: '',
refresh: '',
tab_bar: 0
},
mutations: {
setEnterPannel(state, v) {
state.enter_panel = v;
localStorage.setItem("enter_panel", v);
},
setRefresh(state) {
state.refresh = new Date().getTime();
},
setInitUrl(state, v) {
state.init_url = v;
},
setCurCoins(state, v) {
state.cur_coins = v
},
setCoinType(state, v) {
state.coin_type = v;
localStorage.setItem("coin_type", v);
},
setRegionId(state, v) {
state.region_id = v
localStorage.setItem("region_id", v);
},
setPuid(state, v) {
state.puid = v
localStorage.setItem("puid", v);
},
setLanguage(state, v) {
state.language = v
localStorage.setItem("language", v);
}
}
}
/**
* Created by Administrator on 2017/6/5.
*/
const state = {
type: '',
id: '',
messageUserId: '0',
sendInfo: [],
nameArr: [],
pointList: [],
count: 0,
pageNum: -1,
linkUrl: '',
pdfUrl: '',
isBackIndex: true,
getNextNavs: function () {
},
getIndexNews: function () {
},
changeTab: function () {
},
firstNextId: 0,
currentId: 0
}
const mutations = {
}
export default {
state,
mutations
}
export default {
txt: {
'zh-cn': {
zhuce: '注册',
denglu: '登录',
slogen1: '去中心化,让世界变得更美好',
slogen2: '超过<span>100,000</span>台矿机平稳运行在我们的平台上',
shouye: '首页',
yonghumianban: '用户面板',
kuangji: '矿机',
shouyi: '收益',
tongji: '统计',
kefu: '客服',
bangzhu: '帮助',
guanyuwomen: '关于我们',
gonggao: '公告',
gaodu: '高度',
shijian: '时间',
qvkuaihaxi: '区块哈希',
baokuaidiqv: '报块地区',
qvkuaijiangli: '区块奖励',
laitebi: '莱特币',
dashibi: '达世币',
sanri: '3日',
qiri: '7日',
sanshiri: '30日',
jiushiri: '90日',
suanlitubiao: '算力图表',
xingyunzhi: '幸运值',
zongsuanli: '总算力',
kuangjishu: '矿机数',
wabishuliang: '挖币数量',
zongqvkuaishu: '总区块数',
guangboqvkuai: '广播区块',
beijing: '北京',
shenzhen: '深圳',
zaixiankuangji: '在线矿机',
shishisuanli: '实时算力',
shishi: '实时',
ershisixiaoshi: '24小时',
huoyue: '活跃',
feihuoyue: '非活跃',
jinriyugu: '今日预估',
zuorishishou: '昨日实收',
yixiaoshi: '1小时',
yitian: '1天',
jvjuelv: '拒绝率',
chenggonglv: '成功率',
wakuangdizhi: '挖矿地址',
yunyingfuwu: '运营服务',
tongzhigonggao: '通知公告',
ershisixiaoshisuanli: '24小时算力',
youxiaokuanggong: '有效矿工',
zuorishouyi: '昨日收益',
quanbu: '全部',
buhuoyue: '不活跃',
shixiao: '失效',
sousuokuangji: '',
sousuo: '搜索',
kuangjiming: '矿机名',
risuanli: '日算力',
jieshoushu: '接受数',
zuijintijiaoshijian: '最近提交时间',
zhuangtai: '状态',
tianjiafenzu: '添加分组',
shanchufenzu: '删除分组',
quanxuan: '全选',
shanchu: '删除',
yidongdao: '移动到',
danjisuanli: '单机算力',
zuijintijiaoip: '最近提交IP',
miaoqian: '秒前',
yunxingzhuangkuang: '运行状态',
leijiyizhifu: '累计已支付',
yue: '余额',
wakuangriqi: '挖矿日期',
shouyishue: '收益数额',
ribiandong: '日变动',
zhifushijian: '支付时间',
zhifudizhi: '支付地址',
zhifuzhuangtai: '支付状态',
yuanyin: '原因',
cunruyue: '存入余额',
yizhifu: '已支付',
zizhanghuguanli: '子账户管理',
chuangjianzizhanghu: '创建子账户',
zhanghushezhi: '账户设置',
tuichudenglu: '退出登录',
shezhi: '设置',
dangqiandengluzhanghu: '当前登录帐户',
xuanzehuozhe: '请先选择一个子账户,或者',
zezhanghulibiao: '子帐户列表',
morenbizhong: '默认币种',
chakan: '查看',
shoukuandizhixiugai: '收款地址修改',
morenbizhongxiugai: '默认币种修改',
dangqianshoukuandizhi: '当前收款地址',
weishezhi: '未设置',
xindizhi: '新地址',
dangqianmorenbizhong: '当前默认币种',
xiugaimorenbizhong: '修改默认币种',
tips1: '当切换到该子账户时,将默认显示该币种',
qvxiao: '取消',
queding: '确定',
shoukuandizixiugaichenggong: '收款地址修改成功',
tijiao: '提交',
tips2: '注意:为了安全原因,修改地址后48小时内不予支付,您的收益将作为余额,在48小时后可以结算。',
xiayibu: '下一步',
zizhanghuming: '子账户名',
tips3: '请选择此子账户优先显示的币种',
chuangjian: '创建',
tips4: '<p>en子账户支持多个币种和多个币种挖矿,你可以创建多个子账户管理不同的币种和地区挖矿。</p><p>您最多可设置50个子账户。这一子账户名称加上矿机编号即为矿机设置页的矿机名(worker name),如: "zizhanghu .001","zizhanghu .002 "。</p>',
tips5: '4-20个小写字母或数字',
tips6: '全部=活跃+不活跃。<br />不活跃表示超过10分钟失去连接的矿机<br />失效表示超过24小时失去连接的矿机',
gengduo: '更多',
daizhifu: '待支付',
zizhanghumianban: '子账户面板',
dangqiandogebutiedizhi: '当前DOGE补贴地址',
dogobutiedizhixiugai: 'DOGE补贴地址修改',
dogobutiedizhizhezhi: 'DOGE补贴地址设置',
morenfenzu: '默认分组'
},
'en': {
zhuce: 'en注册',
denglu: 'en登录',
slogen1: 'Decentration,Make the world a better place',
slogen2: 'en超过<span>100,000</span>台矿机平稳运行在我们的平台上',
shouye: 'Home',
yonghumianban: 'Dashboard',
kuangji: 'Minners',
shouyi: 'Payments',
tongji: 'Statistics',
kefu: 'Customer Service',
bangzhu: 'Help',
guanyuwomen: 'About Us',
gonggao: 'Notice',
gaodu: 'Height',
shijian: 'Date',
qvkuaihaxi: 'Hash',
baokuaidiqv: 'Regin',
qvkuaijiangli: 'Block',
laitebi: 'Lite coin',
dashibi: 'Dash coin',
sanri: '3days',
qiri: '7days',
sanshiri: '30days',
jiushiri: '90days',
suanlitubiao: 'suanlitubiao',
xingyunzhi: 'Lucky Value',
zongsuanli: 'en总算力',
kuangjishu: 'kuangjishu',
wabishuliang: 'wabishuliang',
zongqvkuaishu: 'zongqvkuaishu',
guangboqvkuai: 'guangboqvkuai',
beijing: 'Beijing',
shenzhen: 'Shenzhen',
zaixiankuangji: 'zaixiankuangji',
shishisuanli: 'en实时算力',
shishi: 'en实时',
ershisixiaoshi: '24Hour',
huoyue: 'en活跃',
feihuoyue: 'en非活跃',
jinriyugu: 'en今日预估',
zuorishishou: 'en昨日实收',
yixiaoshi: 'en1小时',
yitian: 'en1天',
jvjuelv: 'en拒绝率',
chenggonglv: 'en成功率',
wakuangdizhi: 'en挖矿地址',
yunyingfuwu: 'en运营服务',
tongzhigonggao: 'en通知公告',
ershisixiaoshisuanli: 'en24小时算力',
youxiaokuanggong: 'en有效矿工',
zuorishouyi: 'en昨日收益',
quanbu: 'en全部',
buhuoyue: 'en不活跃',
shixiao: 'en失效',
sousuokuangji: 'en搜索矿机',
sousuo: 'en搜索',
kuangjiming: 'en矿机名',
risuanli: 'en日算力',
jieshoushu: 'en接受数',
zuijintijiaoshijian: 'en最近提交时间',
zhuangtai: 'en状态',
tianjiafenzu: 'en添加分组',
shanchufenzu: 'en删除分组',
quanxuan: 'en全选',
shanchu: 'en删除',
yidongdao: 'en移动到',
danjisuanli: 'en单机算力',
zuijintijiaoip: 'en最近提交IP',
miaoqian: 'en秒前',
yunxingzhuangkuang: 'en运行状态',
leijiyizhifu: 'en累计已支付',
yue: 'en余额',
wakuangriqi: 'en挖矿日期',
shouyishue: 'en收益数额',
ribiandong: 'en日变动',
zhifushijian: 'en支付时间',
zhifudizhi: 'en支付地址',
zhifuzhuangtai: 'en支付状态',
yuanyin: 'en原因',
cunruyue: 'en存入余额',
yizhifu: 'en已支付',
zizhanghuguanli: 'en子账户管理',
chuangjianzizhanghu: 'en创建子账户',
zhanghushezhi: 'en账户设置',
tuichudenglu: 'en退出登录',
shezhi: 'Setting',
dangqiandengluzhanghu: 'en当前登录帐户',
xuanzehuozhe: 'en请先选择一个子账户,或者',
zezhanghulibiao: 'en子帐户列表',
morenbizhong: 'en默认币种',
chakan: 'en查看',
shoukuandizhixiugai: 'en收款地址修改',
morenbizhongxiugai: 'en默认币种修改',
dangqianshoukuandizhi: 'en当前收款地址',
weishezhi: 'en未设置',
xindizhi: 'en新地址',
dangqianmorenbizhong: 'en当前默认币种',
xiugaimorenbizhong: 'en修改默认币种',
tips1: 'en当切换到该子账户时,将默认显示该币种',
qvxiao: 'en取消',
queding: 'en确定',
shoukuandizixiugaichenggong: 'en收款地址修改成功',
tijiao: '提交',
tips2: 'en注意:为了安全原因,修改地址后48小时内不予支付,您的收益将作为余额,在48小时后可以结算。',
xiayibu: 'en下一步',
zizhanghuming: 'en子账户名',
tips3: '请选择此子账户优先显示的币种',
chuangjian: 'en创建',
tips4: '<p>en子账户支持多个币种和多个币种挖矿,你可以创建多个子账户管理不同的币种和地区挖矿。</p><p>您最多可设置50个子账户。这一子账户名称加上矿机编号即为矿机设置页的矿机名(worker name),如: "zizhanghu .001","zizhanghu .002 "。</p>',
tips5: 'en4-20个小写字母或数字',
tips6: 'en全部=活跃+不活跃。<br />不活跃表示超过10分钟失去连接的矿机<br />失效表示超过24小时失去连接的矿机',
gengduo: 'en更多',
daizhifu: 'en待支付',
zizhanghumianban: 'en子账户面板',
dangqiandogebutiedizhi: 'en当前DOGE补贴地址',
dogobutiedizhixiugai: 'enDOGE补贴地址修改',
dogobutiedizhizhezhi: 'enDOGE补贴地址设置',
morenfenzu: 'en默认分组',
}
}
}
import Vue from 'vue';
import Vuex from 'vuex';
import Vue from 'vue'
import Vuex from 'vuex'
import $axios from 'axios'
Vue.filter('date422', function (value) {
if (!value) { return '' }
......@@ -135,7 +136,7 @@ export default {
* @return {[type]} [description]
*/
getLucky(coin_type) {
return $axios(Vue.$store.state.poolinApp.common_url + "/pool/lucky?coin_type=" + coin_type)
return $axios(Vue.$store.state.common_url + "/pool/lucky?coin_type=" + coin_type)
},
/**
* [getBlocks 获取矿池出块数据]
......@@ -145,7 +146,7 @@ export default {
* @return {[type]} [description]
*/
getBlocks(coin_type) {
return $axios(Vue.$store.state.poolinApp.common_url + "/pool/blocks/merge?coin_type=" + coin_type)
return $axios(Vue.$store.state.common_url + "/pool/blocks/merge?coin_type=" + coin_type)
},
/**
* [getStats 获取矿池实时算力-合并]
......@@ -155,7 +156,7 @@ export default {
* @return {[type]} [description]
*/
getStats(coin_type) {
return $axios(Vue.$store.state.poolinApp.common_url + "/pool/stats/merge?coin_type=" + coin_type)
return $axios(Vue.$store.state.common_url + "/pool/stats/merge?coin_type=" + coin_type)
},
/**
* [getShareHistory 获取矿池算力历史-合并]
......@@ -167,7 +168,7 @@ export default {
* @return {[type]} [description]
*/
getShareHistory(count, dimension, coin_type) {
return $axios(Vue.$store.state.poolinApp.common_url + "/pool/share-history/merge?count=" + count + "&dimension=" + dimension + "&coin_type=" + coin_type)
return $axios(Vue.$store.state.common_url + "/pool/share-history/merge?count=" + count + "&dimension=" + dimension + "&coin_type=" + coin_type)
},
/**
* [getSubAccount 获取子账户列表]
......@@ -176,7 +177,7 @@ export default {
* @return {[type]} [description]
*/
getSubAccount() {
return $axios(Vue.$store.state.poolinApp.common_url + "/subaccount")
return $axios(Vue.$store.state.common_url + "/subaccount")
},
/**
* [getSubAccountById 获取子账户详情]
......@@ -187,13 +188,13 @@ export default {
*/
getSubAccountById(puid) {
return new Promise(function (relsove, reject) {
if (!Vue.$store.state.poolinApp.SubAccount) Vue.$store.state.poolinApp.SubAccount = {};
if (Vue.$store.state.poolinApp.SubAccount['SubAccount' + puid]) {
relsove(Vue.$store.state.poolinApp.SubAccount['SubAccount' + puid])
if (!Vue.$store.state.SubAccount) Vue.$store.state.SubAccount = {};
if (Vue.$store.state.SubAccount['SubAccount' + puid]) {
relsove(Vue.$store.state.SubAccount['SubAccount' + puid])
} else {
$axios(Vue.$store.state.poolinApp.common_url + "/subaccount/" + puid).then(function (res) {
Vue.$store.state.poolinApp.SubAccount['SubAccount' + puid] = res;
relsove(Vue.$store.state.poolinApp.SubAccount['SubAccount' + puid])
$axios(Vue.$store.state.common_url + "/subaccount/" + puid).then(function (res) {
Vue.$store.state.SubAccount['SubAccount' + puid] = res;
relsove(Vue.$store.state.SubAccount['SubAccount' + puid])
})
}
})
......@@ -206,7 +207,7 @@ export default {
* @return {[type]} [description]
*/
createAccount(params) {
return $axios.post(Vue.$store.state.poolinApp.common_url + "/subaccount/create", params)
return $axios.post(Vue.$store.state.common_url + "/subaccount/create", params)
},
/**
* [getUrl 获取初始接口]
......@@ -217,7 +218,7 @@ export default {
*/
getUrl() {
//console.log("getUrl")
return $axios(Vue.$store.state.poolinApp.base_url)
return $axios(Vue.$store.state.base_url)
// .then(res => { return mock.getUrl })
},
/**
......@@ -230,9 +231,9 @@ export default {
getCoins() {
//console.log("getCoins")
new Promise((resolve, reject) => {
resolve(Vue.$store.state.poolinApp.init_url.coins)
resolve(Vue.$store.state.init_url.coins)
})
// return $axios(Vue.$store.state.poolinApp.base_url).then(res => { return res.data.coins })
// return $axios(Vue.$store.state.base_url).then(res => { return res.data.coins })
},
/**
* [getAllRegions 获取初始接口的所有节点]
......@@ -244,13 +245,13 @@ export default {
getAllRegions() {
//console.log("getAllRegions")
// return new Promise((resolve, reject) => {
// resolve(Vue.$store.state.poolinApp.init_url.regions)
// resolve(Vue.$store.state.init_url.regions)
// })
let coin_type = localStorage.getItem('coin_type');
let regions = [];
let obj = {};
return new Promise((resolve, reject) => {
_.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
_.each(Vue.$store.state.init_url.regions, function (v, k) {
_.each(v.supported_coin_types, function (v1, k1) {
if (v1.coin_type == coin_type) {
obj = { region_id: v.region_id, text_en: v.text_en, 'text_zh-cn': v['text_zh-cn'] }
......@@ -272,7 +273,7 @@ export default {
//console.log("getRegionInfo")
return new Promise((resolve, reject) => {
let cur_region;
_.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
_.each(Vue.$store.state.init_url.regions, function (v, k) {
if (v.region_id == region_id) {
cur_region = v;
}
......@@ -289,7 +290,7 @@ export default {
*/
getUserList() {
//console.log("getUserList")
return $axios(Vue.$store.state.poolinApp.common_url + '/subaccount');
return $axios(Vue.$store.state.common_url + '/subaccount');
},
/**
* [getUser 获取当前帐户信息]
......@@ -301,7 +302,7 @@ export default {
*/
getUser(puid) {
//console.log("getUser")
return $axios(Vue.$store.state.poolinApp.common_url + '/subaccount/' + puid)
return $axios(Vue.$store.state.common_url + '/subaccount/' + puid)
},
/**
* [getZonglanList 获取单个币种多个节点数据]
......@@ -336,7 +337,7 @@ export default {
// console.log("getApiBaseUrl")
return new Promise((resolve, reject) => {
let api_base_url = '';
_.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
_.each(Vue.$store.state.init_url.regions, function (v, k) {
if (v.region_id == region_id) {
_.each(v.supported_coin_types, function (v1, k1) {
if (v1.coin_type == cointype) {
......@@ -573,7 +574,7 @@ export default {
*/
getRegionCoins(region_id) {
let arr_coins = [];
_.map(Vue.$store.state.poolinApp.init_url.regions, function (v, i, o) {
_.map(Vue.$store.state.init_url.regions, function (v, i, o) {
if (v.region_id == region_id) {
_.map(v.supported_coin_types, function (v1, i1, o1) {
arr_coins.push(v1.coin_type)
......@@ -605,7 +606,7 @@ export default {
getStratumUrl(region_id, coin_type) {
return new Promise((resolve, reject) => {
let stratum_url = '';
_.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
_.each(Vue.$store.state.init_url.regions, function (v, k) {
if (v.region_id == region_id) {
_.each(v.supported_coin_types, function (v1, k1) {
if (v1.coin_type == coin_type) {
......@@ -626,11 +627,11 @@ export default {
*/
getStratumUrls(coin_type) {
//mock.getUrl.data
//Vue.$store.state.poolinApp.init_url
//Vue.$store.state.init_url
let data = [];
return new Promise((resolve, reject) => {
let stratum_url = '';
_.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
_.each(Vue.$store.state.init_url.regions, function (v, k) {
_.each(v.supported_coin_types, function (v1, k1) {
if (v1.coin_type == coin_type) {
data.push({ region_id: v.region_id, text_en: v.text_en, 'text_zh-cn': v['text_zh-cn'], coin_info: v1 })
......@@ -649,7 +650,7 @@ export default {
* @return {[type]} [description]
*/
getSummary(puid, coin_type) {
return $axios(Vue.$store.state.poolinApp.common_url + "/subaccount/summary?puid=" + puid + "&coin_type=" + coin_type)
return $axios(Vue.$store.state.common_url + "/subaccount/summary?puid=" + puid + "&coin_type=" + coin_type)
},
/**
* [getAllRegionByCoin 根据币种获取到所有节点所支持的所有节点]
......@@ -662,7 +663,7 @@ export default {
let regions = [];
let obj = {};
return new Promise((resolve, reject) => {
_.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
_.each(Vue.$store.state.init_url.regions, function (v, k) {
_.each(v.supported_coin_types, function (v1, k1) {
if (v1.coin_type == coin_type) {
obj = { region_id: v.region_id, text_en: v.text_en, 'text_zh-cn': v['text_zh-cn'] }
......@@ -677,25 +678,25 @@ export default {
* 创建 token
*/
createToken(puid, params) {
return $axios.post(Vue.$store.state.poolinApp.common_url + '/watcher/token/create?puid=' + puid, params)
return $axios.post(Vue.$store.state.common_url + '/watcher/token/create?puid=' + puid, params)
},
/**
* 列出 token
*/
listToken(puid, coin) {
return $axios(Vue.$store.state.poolinApp.common_url + '/watcher/token?puid=' + puid + '&coin_type=' + coin)
return $axios(Vue.$store.state.common_url + '/watcher/token?puid=' + puid + '&coin_type=' + coin)
},
/**
* 获取 token 详情
*/
getTokenInfo(token) {
return $axios(Vue.$store.state.poolinApp.common_url + '/watcher/token/info?token=' + token)
return $axios(Vue.$store.state.common_url + '/watcher/token/info?token=' + token)
},
/**
* 移除 token
*/
delToken(puid, params) {
return $axios.post(Vue.$store.state.poolinApp.common_url + '/watcher/token/delete?puid=' + puid, params)
return $axios.post(Vue.$store.state.common_url + '/watcher/token/delete?puid=' + puid, params)
},
/**
* 获取所支持币种
......
/**tween.js@16.3.4
* Minified by jsDelivr using UglifyJS v3.0.24.
* Original file: /npm/tween.js@16.3.4/src/Tween.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
!function(){if("performance"in window==!1&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==!1){var n=window.performance.timing&&window.performance.timing.navigationStart?window.performance.timing.navigationStart:Date.now();window.performance.now=function(){return Date.now()-n}}}();var TWEEN=TWEEN||function(){var n=[];return{getAll:function(){return n},removeAll:function(){n=[]},add:function(t){n.push(t)},remove:function(t){var r=n.indexOf(t);-1!==r&&n.splice(r,1)},update:function(t){if(0===n.length)return!1;var r=0;for(t=void 0!==t?t:window.performance.now();r<n.length;)n[r].update(t)?r++:n.splice(r,1);return!0}}}();TWEEN.Tween=function(n){var t=n,r={},i={},o={},u=1e3,e=0,a=!1,f=!1,c=!1,s=0,h=null,l=TWEEN.Easing.Linear.None,p=TWEEN.Interpolation.Linear,E=[],w=null,v=!1,d=null,I=null,M=null;for(var m in n)r[m]=parseFloat(n[m],10);this.to=function(n,t){return void 0!==t&&(u=t),i=n,this},this.start=function(n){TWEEN.add(this),f=!0,v=!1,h=void 0!==n?n:window.performance.now(),h+=s;for(var u in i){if(i[u]instanceof Array){if(0===i[u].length)continue;i[u]=[t[u]].concat(i[u])}void 0!==r[u]&&(r[u]=t[u],r[u]instanceof Array==!1&&(r[u]*=1),o[u]=r[u]||0)}return this},this.stop=function(){return f?(TWEEN.remove(this),f=!1,null!==M&&M.call(t),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var n=0,t=E.length;n<t;n++)E[n].stop()},this.delay=function(n){return s=n,this},this.repeat=function(n){return e=n,this},this.yoyo=function(n){return a=n,this},this.easing=function(n){return l=n,this},this.interpolation=function(n){return p=n,this},this.chain=function(){return E=arguments,this},this.onStart=function(n){return w=n,this},this.onUpdate=function(n){return d=n,this},this.onComplete=function(n){return I=n,this},this.onStop=function(n){return M=n,this},this.update=function(n){var f,M,m;if(n<h)return!0;!1===v&&(null!==w&&w.call(t),v=!0),m=l(M=(M=(n-h)/u)>1?1:M);for(f in i)if(void 0!==r[f]){var T=r[f]||0,g=i[f];g instanceof Array?t[f]=p(g,m):("string"==typeof g&&(g=g.startsWith("+")||g.startsWith("-")?T+parseFloat(g,10):parseFloat(g,10)),"number"==typeof g&&(t[f]=T+(g-T)*m))}if(null!==d&&d.call(t,m),1===M){if(e>0){isFinite(e)&&e--;for(f in o){if("string"==typeof i[f]&&(o[f]=o[f]+parseFloat(i[f],10)),a){var O=o[f];o[f]=i[f],i[f]=O}r[f]=o[f]}return a&&(c=!c),h=n+s,!0}null!==I&&I.call(t);for(var N=0,W=E.length;N<W;N++)E[N].start(h+u);return!1}return!0}},TWEEN.Easing={Linear:{None:function(n){return n}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.cos(n*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return.5*(1-Math.cos(Math.PI*n))}},Exponential:{In:function(n){return 0===n?0:Math.pow(1024,n-1)},Out:function(n){return 1===n?1:1-Math.pow(2,-10*n)},InOut:function(n){return 0===n?0:1===n?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(2-Math.pow(2,-10*(n-1)))}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){var t,r=.1;return 0===n?0:1===n?1:(!r||r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),-r*Math.pow(2,10*(n-=1))*Math.sin((n-t)*(2*Math.PI)/.4))},Out:function(n){var t,r=.1;return 0===n?0:1===n?1:(!r||r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*n)*Math.sin((n-t)*(2*Math.PI)/.4)+1)},InOut:function(n){var t,r=.1;return 0===n?0:1===n?1:(!r||r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),(n*=2)<1?r*Math.pow(2,10*(n-=1))*Math.sin((n-t)*(2*Math.PI)/.4)*-.5:r*Math.pow(2,-10*(n-=1))*Math.sin((n-t)*(2*Math.PI)/.4)*.5+1)}},Back:{In:function(n){var t=1.70158;return n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return--n*n*((t+1)*n+t)+1},InOut:function(n){var t=2.5949095;return(n*=2)<1?n*n*((t+1)*n-t)*.5:.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-TWEEN.Easing.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?.5*TWEEN.Easing.Bounce.In(2*n):.5*TWEEN.Easing.Bounce.Out(2*n-1)+.5}}},TWEEN.Interpolation={Linear:function(n,t){var r=n.length-1,i=r*t,o=Math.floor(i),u=TWEEN.Interpolation.Utils.Linear;return t<0?u(n[0],n[1],i):t>1?u(n[r],n[r-1],r-i):u(n[o],n[o+1>r?r:o+1],i-o)},Bezier:function(n,t){for(var r=0,i=n.length-1,o=Math.pow,u=TWEEN.Interpolation.Utils.Bernstein,e=0;e<=i;e++)r+=o(1-t,i-e)*o(t,e)*n[e]*u(i,e);return r},CatmullRom:function(n,t){var r=n.length-1,i=r*t,o=Math.floor(i),u=TWEEN.Interpolation.Utils.CatmullRom;return n[0]===n[r]?(t<0&&(o=Math.floor(i=r*(1+t))),u(n[(o-1+r)%r],n[o],n[(o+1)%r],n[(o+2)%r],i-o)):t<0?n[0]-(u(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[r]-(u(n[r],n[r],n[r-1],n[r-1],i-r)-n[r]):u(n[o?o-1:0],n[o],n[r<o+1?r:o+1],n[r<o+2?r:o+2],i-o)},Utils:{Linear:function(n,t,r){return(t-n)*r+n},Bernstein:function(n,t){var r=TWEEN.Interpolation.Utils.Factorial;return r(n)/r(t)/r(n-t)},Factorial:function(){var n=[1];return function(t){var r=1;if(n[t])return n[t];for(var i=t;i>1;i--)r*=i;return n[t]=r,r}}(),CatmullRom:function(n,t,r,i,o){var u=.5*(r-n),e=.5*(i-t),a=o*o;return(2*t-2*r+u+e)*(o*a)+(-3*t+3*r-2*u-e)*a+u*o+t}}},function(n){"function"==typeof define&&define.amd?define([],function(){return TWEEN}):"undefined"!=typeof module&&"object"==typeof exports?module.exports=TWEEN:void 0!==n&&(n.TWEEN=TWEEN)}(this);
//# sourceMappingURL=/sm/ea47e87bea877dcb22432f4faa06bb23183a1cefe5b1ece3ebcf347e48058abd.map
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment