Commit 8ddb3f40 by gaolei

解决冲突

parents c0eb1e77 78b54381
......@@ -1147,6 +1147,14 @@
"tweetnacl": "0.14.5"
}
},
"better-scroll": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/better-scroll/-/better-scroll-1.8.0.tgz",
"integrity": "sha1-Jmk5sjo7SXMwl1wS8z09SDnHc+4=",
"requires": {
"babel-runtime": "6.26.0"
}
},
"big.js": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz",
......@@ -8489,6 +8497,15 @@
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
"dev": true
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"dev": true,
"requires": {
"safe-buffer": "5.1.1"
}
},
"string-length": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz",
......@@ -8531,15 +8548,6 @@
}
}
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"dev": true,
"requires": {
"safe-buffer": "5.1.1"
}
},
"stringstream": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
......
{
"name": "poolin_app",
"name": "poolin_app_new",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "xin3w <xin3w@126.com>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 172.16.10.57",
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"@tweenjs/tween.js": "^17.2.0",
"animate.css": "^3.5.2",
"axios": "^0.17.1",
"echarts": "^3.8.5",
"better-scroll": "^1.8.0",
"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",
......@@ -38,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="fade" mode="out-in">
<router-view/>
</transition> -->
<router-view/>
<transition :name="'vux-pop-' + (direction === '' ? '' : (direction === 'forward' ? 'in' : 'out'))">
<mr-navigation>
<router-view></router-view>
</mr-navigation>
</transition>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'app',
data() {
return {
}
return {}
},
computed: {
...mapState('translate', ['direction'])
},
created() {
if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
......@@ -31,4 +34,77 @@ export default {
position: relative;
}
.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;
}
.vux-pop-in-enter {
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
opacity: 1;
z-index: 2
}
.vux-pop-in-enter-active {
box-shadow: 0 0 10px rgba(0, 0, 0, .15)
}
.vux-pop-in-enter-to {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
z-index: 2
}
.vux-pop-in-leave {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: .8;
z-index: 1
}
.vux-pop-in-leave-to {
-webkit-transform: translate3d(-33%, 0, 0);
transform: translate3d(-33%, 0, 0);
opacity: 0;
z-index: 1
}
.vux-pop-out-enter {
-webkit-transform: translate3d(-33%, 0, 0);
transform: translate3d(-33%, 0, 0);
opacity: .8;
z-index: 1
}
.vux-pop-out-enter-to {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
z-index: 1
}
.vux-pop-out-leave {
-webkit-transform: translateZ(0);
transform: translateZ(0);
opacity: 1;
z-index: 2
}
.vux-pop-out-leave-active {
box-shadow: 0 0 10px rgba(0, 0, 0, .15)
}
.vux-pop-out-leave-to {
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
opacity: 1;
z-index: 2
}
</style>
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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
......
......@@ -21,45 +21,73 @@
</div>
</template>
<script>
export default {
export default {
name: 'tabbar',
data() {
return {
puid: '',
coin_type: '',
region_id: '',
}
},
mounted() {
let self = this;
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: {
goTo(n) {
this.$store.state.tab_bar=n;
this.$store.state.tab_bar = n;
switch (n) {
case 0:
this.$router.replace('/my/7/ltc/shenzhen/dashboard')
this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/dashboard')
break;
case 1:
this.$router.replace('/my/7/ltc/shenzhen/miners')
this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/miners')
break;
case 2:
this.$router.replace('/my/7/ltc/shenzhen/payments')
this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/payments')
break;
default:
case 3:
this.$router.replace('/settings')
break;
}
}
}
}
}
</script>
<style lang="less">
.tab-bar {position: fixed; left: 0; right: 0; bottom: 0; background: #fff; height:1rem;padding: .10rem 0;box-shadow: 0 -2px 10px #e5eaf0;box-sizing: border-box;
li {text-align: center;
.iconfont {color: #b8b8b8;font-size: .40rem;}
p {color: #727272;font-size: .20rem;margin-top: .02rem;}
.tab-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: #fff;
height: 1rem;
padding: .10rem 0;
box-shadow: 0 -2px 10px #e5eaf0;
box-sizing: border-box;
li {
text-align: center;
.iconfont {
color: #b8b8b8;
font-size: .40rem;
}
p {
color: #727272;
font-size: .20rem;
margin-top: .02rem;
}
&.active {
p, .iconfont {color: #1c5fa9; }
p,
.iconfont {
color: #1c5fa9;
}
}
}
}
</style>
<template>
<div class="my-popup">
<ul>
<li class="list-coin" v-for="(cur_coin,index) in $store.state['cur_coins']" :key="cur_coin" @click="coinAcitve(cur_coin,index)" :class="{active:coin==cur_coin}">
<b :class="cur_coin">{{cur_coin|uppercase}}</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>
</div>
</template>
<script>
export default {
name:'coin',
props: ['coin'],
data(){
export default {
name: 'coin',
data() {
return {
puid: this.$route.params.puid,
coin_type: this.$route.params.coin_type,
region_id: this.$route.params.region_id,
language: localStorage.getItem('language'),
}
},
methods: {
coinAcitve(info,index){
this.$emit('childCoin',info)
},
coinAcitve(cur_coin) {
this.$emit('childCoin', cur_coin)
this.$store.commit('setCoinType', cur_coin)
this.coin_type = cur_coin
}
}
}
</script>
......@@ -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
......@@ -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>
......@@ -2,21 +2,21 @@
<div class="page dashboard">
<div class="page-header" :class="hasZIndex==true?'zIndexAuto':''" flex="main:justify cross:center">
<div class="side" @click="getSide"><i class="iconfont icon-mulu"></i></div>
<div class="title" @click="getRegion">{{cur_account.data.name}} - {{region_name}}<i class="iconfont icon-down"></i></div>
<div class="btn-choose-coin" @click="getCoin"><span :class="this.$route.params.coin_type"></span><i class="iconfont icon-down"></i></div>
<div class="title" @click="getRegion">{{account_name}} - {{cur_region['text_zh-cn']}}<i class="iconfont icon-down"></i></div>
<div class="btn-choose-coin" @click="getCoin"><span :class="coin_type"></span><i class="iconfont icon-down"></i></div>
</div>
<div class="page-content">
<!-- 切换币种 -->
<mt-popup v-model="showCoin" position="top" class='top show-top'>
<coin :coin="messageCoin" v-on:childCoin="fromCoin"></coin>
<coin v-on:childCoin="fromCoin"></coin>
</mt-popup>
<!-- 切换区域 -->
<mt-popup v-model="showRegion" position="top" class='top show-top'>
<region :region="region_name" v-on:childRegion="fromRegion"></region>
<region v-on:childRegion="fromRegion"></region>
</mt-popup>
<!-- 切换子账户 -->
<mt-popup v-model="showSide" position="left" class="left show-left">
<subaccount></subaccount>
<subaccount v-on:childSubAccount="fromSubAccount"></subaccount>
</mt-popup>
<div class="block-list">
<div class="cell" flex="box:mean">
......@@ -37,7 +37,7 @@
</div>
<div flex="main:center dir:top box:center cross:center">
<p>
<span class="v" v-if="$store.state.coin_type=='xmr'"><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>
......@@ -82,14 +82,14 @@
</div>
</template>
<script>
import fn from "@/assets/js/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 {
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: "dashboard",
components: {
coin,
......@@ -101,30 +101,33 @@
},
data() {
return {
hasZIndex: false,
puid: '',
coin_type: '',
region_id: '',
language: '',
hasZIndex: false, //侧栏滑出的zindex调整
showCoin: false,
showRegion: false,
showSide: false,
regions: [],
regions: [], //当前币种对应的支持节点(子组件下拉区域)
cur_region: {
"region_id": "",
"text_en": "",
"text_zh-cn": "",
},
cur_account: {
data: {
name: ''
}
},
region_name: '', //中英文切换对应的text_en/text_zh-cn
account_name: '', //当前帐户对应的名字
suanli: {},
payment_stats: {
yesterday_amount: 0,
today_estimate: 0
},
region_name: '',
language: localStorage.getItem('language'),
loading: true,
stratum_url: []
today_estimate: 0,
balance: 0,
total_paid_amount: 0
}
};
},
mounted() {
......@@ -137,77 +140,61 @@
self.pageInit();
window.dingshiqi = setInterval(function() {
self.pageInit();
}, $store.state.refresh_time)
}, this.$store.state.refresh_time)
},
pageInit() {
let self = this;
let puid = this.$route.params.puid;
let coin_type = this.$route.params.coin_type;
let region_id = this.$route.params.region_id;
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');
//获取stratum_url
fn.getStratumUrl(region_id, coin_type)
.then(res => {
self.stratum_url = res;
})
//获取userName
fn.getSubAccountById(puid)
.then(res => {
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 => {
if (res.data.err_no == 0) {
this.cur_account = res.data;
this.suanli = res.data.data;
} else {
this.$message.error("当前子账户错误,请重新选择!")
$router.replace({
path: '/my'
})
this.$message.error("请求实时算力错误!")
}
});
//获取所有节点
fn.getAllRegions().then(res => {
this.regions = res;
});
//获取当前节点信息
fn.getRegionInfo(region_id).then(res => {
if (self.language == 'zh-cn') {
this.region_name = res['text_zh-cn'];
}
if (self.language == 'en') {
this.region_name = res['text_en'];
}
})
//请求实时算力
fn.getApiBaseUrl(region_id, coin_type)
.then(api => {
if (api == "") {
this.$message.error("当前币种所在的节点不支持!");
$router.replace("/my/" + puid + "/" + localStorage.getItem('coin_type'))
return false;
} else {
fn.getWorkerStats(api, puid)
.then(res => {
//获取收益
fn.getPaymentStats(api, this.puid).then(res => {
if (res.data.err_no == 0) {
self.suanli = res.data.data;
this.payment_stats = res.data.data
} else {
this.$message.error("请求实时算力错误!")
this.$message.error("请求支付状态错误!")
}
this.loading = false;
});
}
})
//获取收益
fn.getApiBaseUrl(region_id, coin_type)
.then(api => {
if (api == "") {
return false;
} else {
fn.getPaymentStats(api, puid)
//获取userName
fn.getSubAccountById(this.puid)
.then(res => {
if (res.data.err_no == 0) {
self.payment_stats = res.data.data
} else {
this.$message.error("请求支付状态错误!")
this.account_name = res.data.data.name;
}
self.loading = false;
});
//获取当前节点信息
this.getRegionInfo();
},
getRegionInfo() {
fn.getRegionInfo(this.region_id).then(res => {
this.cur_region = res;
if (this.language == 'zh-cn') {
this.region_name = this.cur_region['text_zh-cn'];
}
if (this.language == 'en') {
this.region_name = this.cur_region['text_en'];
}
})
},
......@@ -217,26 +204,52 @@
this.showRegion = false;
this.showCoin = false;
},
getRegion() {
this.hasZIndex = false;
this.showRegion = !this.showRegion;
this.showCoin = false;
this.showSide = false;
},
getCoin() {
this.hasZIndex = false;
this.showCoin = !this.showCoin;
this.showRegion = false;
this.showSide = false;
},
getRegion() {
this.hasZIndex = false;
this.showRegion = !this.showRegion;
this.showCoin = false;
fromSubAccount(obj) {
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;
this.$route.params.region_id = localStorage.getItem('region_id');
this.$router.replace({
name: 'dashboard'
})
},
fromRegion(msg){
this.region_name = msg;
fromRegion(msg) {
this.$store.commit('setRegionId', msg)
this.showRegion = false;
this.$route.params.region_id = msg;
this.$router.replace({
name: 'dashboard'
})
},
fromCoin(msg){
this.messageCoin = msg;
fromCoin(msg) {
this.$store.commit('setCoinType', msg)
this.showCoin = false;
this.$route.params.coin_type = msg;
this.getRegionInfo();
this.$router.replace({
name: 'dashboard'
})
},
},
watch: {
'$route' (to, from) {
this.pageInitInterval();
},
}
}
};
};
</script>
<template>
<div class="page dashboard">
<div class="page-header" :class="hasZIndex==true?'zIndexAuto':''" flex="main:justify cross:center">
<div class="side" @click="getSide"><i class="iconfont icon-mulu"></i></div>
<div class="title" @click="getRegion">{{account_name}} - {{region_name}}<i class="iconfont icon-down"></i></div>
<div class="btn-choose-coin" @click="getCoin"><span :class="coin_type"></span><i class="iconfont icon-down"></i></div>
</div>
<div class="page-content">
<!-- 切换币种 -->
<mt-popup v-model="showCoin" position="top" class='top show-top'>
<coin v-on:childCoin="fromCoin"></coin>
</mt-popup>
<!-- 切换区域 -->
<mt-popup v-model="showRegion" position="top" class='top show-top'>
<region v-on:childRegion="fromRegion"></region>
</mt-popup>
<!-- 切换子账户 -->
<mt-popup v-model="showSide" position="left" class="left show-left">
<subaccount v-on:childSubAccount="fromSubAccount"></subaccount>
</mt-popup>
<div>
无节点,无算力页
</div>
</div>
<tabbar></tabbar>
</div>
</template>
<script>
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 tabbar from "@/components/Common/Tabbar.vue";
export default {
name: "no",
components: {
coin,
region,
subaccount,
tabbar
},
data() {
return {
puid: '',
coin_type: '',
region_id: '',
language: '',
hasZIndex: false, //侧栏滑出的zindex调整
showCoin: false,
showRegion: false,
showSide: false,
regions: [], //当前币种对应的支持节点(子组件下拉区域)
cur_region: {
"region_id": "",
"text_en": "",
"text_zh-cn": "",
},
region_name: '', //中英文切换对应的text_en/text_zh-cn
account_name: '', //当前帐户对应的名字
demoData: [{
region_id: '',
text_en: "",
"text_zh-cn": "",
coin_info: {
"coin_type": "",
"stratum_url": [],
"api_base_url": "",
"merge_mining_coins": [{
"coin_type": ""
}]
}
}],
};
},
mounted() {
this.pageInit();
},
methods: {
pageInitInterval() {
let self = this;
clearInterval(window.dingshiqi)
self.pageInit();
window.dingshiqi = setInterval(function() {
self.pageInit();
}, $store.state.refresh_time)
},
pageInit() {
let self = this;
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');
//获取userName
fn.getSubAccountById(this.puid).then(res => {
if (res.data.err_no == 0) {
this.account_name = res.data.data.name;
}
});
//获取当前节点信息
fn.getRegionInfo(this.region_id).then(res => {
if (this.language == 'zh-cn') {
this.region_name = res['text_zh-cn'];
}
if (this.language == 'en') {
this.region_name = res['text_en'];
}
});
//获取支持当前币种的节点信息和当前币种信息
fn.getStratumUrls(this.coin_type).then(res => {
self.demoData = res;
});
},
getSide() {
this.hasZIndex = true;
this.showSide = !this.showSide;
this.showRegion = false;
this.showCoin = false;
},
getRegion() {
this.hasZIndex = false;
this.showRegion = !this.showRegion;
this.showCoin = false;
this.showSide = false;
},
getCoin() {
this.hasZIndex = false;
this.showCoin = !this.showCoin;
this.showRegion = false;
this.showSide = false;
},
fromSubAccount(obj) {
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;
this.$route.params.region_id = localStorage.getItem('region_id');
this.$router.replace({
name: 'dashboard'
})
},
fromRegion(msg) {
this.$store.commit('setRegionId', msg)
this.showRegion = false;
this.$route.params.region_id = msg;
this.$router.replace({
name: 'dashboard'
})
},
fromCoin(msg) {
this.$store.commit('setCoinType', msg)
this.showCoin = false;
this.$route.params.coin_type = msg;
this.$router.replace({
name: 'dashboard'
})
},
},
watch: {
'$route' (to, from) {
this.pageInit();
},
}
};
</script>
<template>
<div class="my-popup">
<ul>
<li v-for="(items, index) in regionDate" :key="items.text" :class="{active:region==items.text}" v-on:click="regionAcitve(items, index)" >
<span>{{items.text}}</span>
<li v-for="(region, index) in regions" :key="region.region_id" :class="region_id==region.region_id?'active':''" v-on:click="regionAcitve(region, index)">
<span>{{region['text_zh-cn']}}</span>
<i class="iconfont icon-dui"></i>
</li>
</ul>
</div>
</template>
<script>
import fn from '@/utils/function.js'
export default {
name: 'region',
props: ['region'],
data() {
return {
regionDate: [{
text: '深圳'
}, {
text: '北方联通'
}, {
text: '美国旧金山'
}, {
text: '德国法兰克福'
}],
puid: this.$route.params.puid,
coin_type: this.$route.params.coin_type,
region_id: this.$route.params.region_id,
language: localStorage.getItem('language'),
regions: []
}
},
mounted() {
this.getAllRegionByCoin()
},
methods: {
regionAcitve(items, index) {
this.$emit('childRegion', items.text)
getAllRegionByCoin() {
let coin_type=this.$route.params.coin_type;
fn.getAllRegionByCoin(coin_type).then(res => {
this.regions = res;
})
},
regionAcitve(regionObj, index) {
this.$emit('childRegion', regionObj.region_id);
this.region_id=regionObj.region_id;
}
},
watch: {
'$route' (to, from) {
this.getAllRegionByCoin()
}
}
}
......
......@@ -7,9 +7,9 @@
<h2>选择子账户</h2>
</div>
<div class="list-item">
<div class="list" v-for="(items, index) in subaccountDate" :key="items" @click="subaccountActive(items, index)" :class="index==i?'active':''">
<span>{{items}}</span>
<i v-show="index == i" class="iconfont icon-dui"></i>
<div class="list" v-for="subaccount in subaccountList" :key="subaccount.puid" @click="subaccountActive(subaccount)" :class="subaccount.puid==puid?'active':''">
<span>{{subaccount.name}}</span>
<i v-show="puid == subaccount.puid" class="iconfont icon-dui"></i>
</div>
<div class="subAdd" @click="goCreate">
<b class="iconfont icon-jiantou"></b>创建子账户
......@@ -17,56 +17,158 @@
</div>
</div>
</template>
<script>
import fn from '@/utils/function.js'
export default {
name: 'subaccount',
data() {
return {
infoUser: 'xuzhiyuan@163.com',
subaccountDate: ['wakuang1', 'wakuang2', 'wakuang3', 'wakuang4'],
i: 0
puid: this.$route.params.puid,
coin_type: this.$route.params.coin_type,
region_id: this.$route.params.region_id,
language: localStorage.getItem('language'),
subaccountList: [],
cur_account_info: {},
}
},
mounted() {
this.getSubAccount();
this.getSubAccountById();
},
methods: {
subaccountActive(items, index) {
this.i = index
console.log(items)
subaccountActive(obj) {
this.puid = obj.puid
this.$emit('childSubAccount', obj)
},
goCreate(){
goCreate() {
this.$router.replace('/create')
},
getSubAccount() {
fn.getSubAccount().then(res => {
if (res.data.err_no == 0) {
this.subaccountList = res.data.data
} else {
alert("接口错误!")
}
})
},
getSubAccountById() {
fn.getSubAccountById(this.puid).then(res => {
if (res.data.err_no == 0) {
this.cur_account_info = res.data.data
} else {
alert("错误")
}
})
}
}
}
</script>
<style lang="less">
//仿原生线
.line(){
&.xb{left: 0; right: 0;height: 1px;width: 100%; background: #ccc;content: '';position: absolute;bottom:0;transform: scaleY(0.33) translateY(1px);}
.line() {
&.xb {
left: 0;
right: 0;
height: 1px;
width: 100%;
background: #ccc;
content: '';
position: absolute;
bottom: 0;
transform: scaleY(0.33) translateY(1px);
}
}
.show-left,
.subaccount {
width: 5.9rem;
background-color: #fff;
}
.show-left,.subaccount{width:5.9rem;background-color: #fff;}
.show-left{height: 100%;}
.subaccount{height: 100%;
.subtop{position: fixed;margin:auto;top: 0;left: 0;right: 0;height: .88rem;z-index: 999;}
.logo{height: 2rem;padding:1.1rem .30rem 0;line-height: .9rem;background-color: #103f73;color: #Fff;box-sizing: border-box;font-size: .32rem;
i{font-size: .50rem;color: #Fff;float: right;}
}
h2{padding:.20rem .30rem 0;font-size: .28rem;color: #727272;line-height: .68rem;background: #ededf2;}
.list-item{padding-top:2.88rem;box-sizing: border-box;height: 100%;overflow: auto;
.list{line-height: .90rem;height: .90rem;position: relative;padding: 0 .30rem;
&:after{.line.xb;}
i{font-size: .50rem;color: #1c5fa9;float: right;}
&.active{color: #1c5fa9;}
&:active{background-color: #e6e6e6;}
}
}
.subAdd{text-align: center;font-size: .32rem;color:#1c5fa9;line-height: .90rem;height: .90rem;position: relative;
b{font-size: .40rem;font-weight: 400;}
&:after{.line.xb;}
&:active{background-color: #e6e6e6;}
.show-left {
height: 100%;
}
.subaccount {
height: 100%;
.subtop {
position: fixed;
margin: auto;
top: 0;
left: 0;
right: 0;
height: .88rem;
z-index: 999;
}
.logo {
height: 2rem;
padding: 1.1rem .30rem 0;
line-height: .9rem;
background-color: #103f73;
color: #Fff;
box-sizing: border-box;
font-size: .32rem;
i {
font-size: .50rem;
color: #Fff;
float: right;
}
}
h2 {
padding: .20rem .30rem 0;
font-size: .28rem;
color: #727272;
line-height: .68rem;
background: #ededf2;
}
.list-item {
padding-top: 2.88rem;
box-sizing: border-box;
height: 100%;
overflow: auto;
.list {
line-height: .90rem;
height: .90rem;
position: relative;
padding: 0 .30rem;
&:after {
.line.xb;
}
i {
font-size: .50rem;
color: #1c5fa9;
float: right;
}
&.active {
color: #1c5fa9;
}
&:active {
background-color: #e6e6e6;
}
}
}
.subAdd {
text-align: center;
font-size: .32rem;
color: #1c5fa9;
line-height: .90rem;
height: .90rem;
position: relative;
b {
font-size: .40rem;
font-weight: 400;
}
&:after {
.line.xb;
}
&:active {
background-color: #e6e6e6;
}
}
}
</style>
</style>
......@@ -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,7 +45,7 @@ export default {
debugger: true,
slidesPerView: 3,
},
coin: $store.state.cur_coins[0],
coin: this.$store.state.cur_coins[0],
active: 0
}
},
......
<template>
<div class="">
{{msg}}
<h3>这个需要根据情况判断跳转到下面可能的页面</h3>
<ul>
<li>
......@@ -17,7 +16,7 @@
<router-link to="/my/7/ltc/shenzhen/dashboard">4.跳入用户面板页面</router-link>
</li>
<li>
<router-link to="/setEmail">5.设置邮箱</router-link>
<router-link to="/settings">设置页</router-link>
</li>
</ul>
</div>
......@@ -27,19 +26,29 @@ 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/puid/coin_type/region_id/dashboard")
this.$router.replace("/my/7/" + this.coin_type + "/" + this.region_id + "/dashboard")
}
}
}
</script>
<style>
<style scoped>
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";
......
......@@ -70,7 +70,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";
import animatedNum from "@/components/Common/AnimatedNum";
......
......@@ -59,7 +59,7 @@
<script>
import tabbar from "@/components/Common/Tabbar.vue";
export default {
name: 'dashboard',
name: 'settings',
components: {
tabbar
},
......
......@@ -114,7 +114,7 @@ export default {
language: '',
}),
computed: {
...mapState(["txt", "init_url", "cur_coins"]),
...mapState('poolinApp',["txt", "init_url", "cur_coins"]),
line: function() {
let self = this;
return {
......
......@@ -40,7 +40,7 @@ export default {
unit: ''
}),
computed: {
...mapState(["txt", "init_url", "cur_coins"]),
...mapState('poolinApp',["txt", "init_url", "cur_coins"]),
line: function() {
let self = this;
return {
......
......@@ -57,7 +57,7 @@ export default {
maxOnOff:false,
}),
computed: {
...mapState(["txt", "init_url", "cur_coins"]),
...mapState('poolinApp',["txt", "init_url", "cur_coins"]),
line: function() {
let self = this;
return {
......
......@@ -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";
......@@ -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,
......@@ -137,7 +139,7 @@ export default {
},
},
watch: {
params_coin(){
params_coin() {
this.pageInitInterval()
}
},
......@@ -151,13 +153,12 @@ export default {
self.pageInit();
window.dingshiqi = setInterval(function() {
self.pageInit();
}, $store.state.refresh_time)
}, this.$store.state.refresh_time)
},
pageInit() {
let self = this;
this.language = localStorage.getItem('language');
fn.getStats(self.params_coin)
.then(res => {
fn.getStats(self.params_coin).then(res => {
if (res.data.err_no == 0) {
self.shares_1h = res.data.data.shares.shares_1h
self.shares_unit = res.data.data.shares.shares_unit
......@@ -167,8 +168,7 @@ export default {
}
})
fn.getShareHistory(72, "1h", self.params_coin)
.then(res => {
fn.getShareHistory(72, "1h", self.params_coin).then(res => {
let hour;
self.shareHistoryTime = [];
self.shareHistoryYes = [];
......
import Vue from 'vue'
import App from './App'
import router from './router'
import '@/assets/js/rem.js'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.min.css'
Vue.use(VueAwesomeSwiper)
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
import MintUI from 'mint-ui'
import ElementUI from 'element-ui'
import axios from 'axios'
// import TWEEN from '@tweenjs/tween.js'
import store from '@/assets/js/store.js'
window.$store = store;
import '@/utils/rem.js'
import store from '@/store/'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
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)
Vue.use(VueAwesomeSwiper)
Vue.use(VueClipboard)
Vue.use(MintUI)
Vue.use(ElementUI)
import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
import 'swiper/dist/css/swiper.min.css'
import 'mint-ui/lib/style.css'
import '@/assets/css/element-ui/index.css'
Vue.use(ElementUI)
import axios from 'axios';
import '@/assets/less/style.less'
import '@/assets/less/style2.less'
import '@/assets/less/style3.less'
import '@/assets/less/style4.less'
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 => {
......@@ -37,21 +48,16 @@ axios.interceptors.request.use(config => {
function checkToken() {
return new Promise((resolve, reject) => {
resolve("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE2OTUxOTAwLCJleHAiOjE1MTY5NTkxMDAsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.wjOk-ynJlMg2SDXT3djpRl0-topq-GQWVoa3QsdBwueg8ZuxXHpO0P5uQPTXoEuzgalm2XcBk1pVrMLWQ4Nqgod0agKtE7YJfh59tY4SKsvCdo0nKdB2yw4e8WLemtVM_wqQDNs0PeHs5XmSZ4PEfP4u7B5AZHUBA4GHtIvNKNB_CQw3pSp3D4us1yeupHb7rRQTeYMs1CXEhN_m2hEJ7oL4xBWuQReRR2UIg5bevhGUQEC0h4WEP21XEDmpFOjbUJpKUGM9gwgy3723gdhVbqzcTk1iQmwQSc4mWKONCeYDhemu_IX5VuKvAV_hvNXqO1uxPv2NCCGgNN5A-J2hnA");
resolve('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE3MjE5NjA2LCJleHAiOjE1MTcyMjY4MDYsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.eci--2LVo2qszdu8o9Enh561WEb-dLygsFFeX5_mvnfeVw8qxiLaNVkyWBHzyYYHLZk2WhRE1PQZ9dtslMwb3Dq6svXhfJhUi4jJizZa4qgNM1ceEGy-IsqexPdg1tIQvXAmg1GDRpt9vyFHRY1C5VYobg_v2LXyoF0RDmMeGAyJQD4ZP2sw0T10uts2dcfG24zlrLfzsbLH04mitYD2Zlj066XPAChIaeUR-fVZxx0bfHHDWAsZurPlkw5SeSRO6oxroPQ07oDN_NXQcfpJevn1gjfMOkLmOma978Aj0axqfqUZAHIzbPF27guUPx15Px9BncEaGCRCYYo_xvXrgA');
})
}
window.$axios = Vue.prototype.$axios = axios;
window.$router = router.$router = router
import '@/assets/less/style.less'
import '@/assets/less/style2.less'
import '@/assets/less/style3.less'
import '@/assets/less/style4.less'
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,
......
<template>
<canvas ref="bubble" :width="width" :height="height" :style="style"></canvas>
</template>
<script>
export default {
props: {
y: {
type: Number,
default: 0
}
},
data () {
return {
width: 50,
height: 80
}
},
computed: {
distance () {
return Math.max(0, Math.min(this.y * this.ratio, this.maxDistance))
},
style () {
return `width:${this.width / this.ratio}px;height:${this.height / this.ratio}px`
}
},
created () {
this.ratio = window.devicePixelRatio
this.width *= this.ratio
this.height *= this.ratio
this.initRadius = 18 * this.ratio
this.minHeadRadius = 12 * this.ratio
this.minTailRadius = 5 * this.ratio
this.initArrowRadius = 10 * this.ratio
this.minArrowRadius = 6 * this.ratio
this.arrowWidth = 3 * this.ratio
this.maxDistance = 40 * this.ratio
this.initCenterX = 25 * this.ratio
this.initCenterY = 25 * this.ratio
this.headCenter = {
x: this.initCenterX,
y: this.initCenterY
}
},
mounted () {
this._draw()
},
methods: {
_draw () {
const bubble = this.$refs.bubble
let ctx = bubble.getContext('2d')
ctx.clearRect(0, 0, bubble.width, bubble.height)
this._drawBubble(ctx)
this._drawArrow(ctx)
},
_drawBubble (ctx) {
ctx.save()
ctx.beginPath()
const rate = this.distance / this.maxDistance
const headRadius = this.initRadius - (this.initRadius - this.minHeadRadius) * rate
this.headCenter.y = this.initCenterY - (this.initRadius - this.minHeadRadius) * rate
// 画上半弧线
ctx.arc(this.headCenter.x, this.headCenter.y, headRadius, 0, Math.PI, true)
// 画左侧贝塞尔
const tailRadius = this.initRadius - (this.initRadius - this.minTailRadius) * rate
const tailCenter = {
x: this.headCenter.x,
y: this.headCenter.y + this.distance
}
const tailPointL = {
x: tailCenter.x - tailRadius,
y: tailCenter.y
}
const controlPointL = {
x: tailPointL.x,
y: tailPointL.y - this.distance / 2
}
ctx.quadraticCurveTo(controlPointL.x, controlPointL.y, tailPointL.x, tailPointL.y)
// 画下半弧线
ctx.arc(tailCenter.x, tailCenter.y, tailRadius, Math.PI, 0, true)
// 画右侧贝塞尔
const headPointR = {
x: this.headCenter.x + headRadius,
y: this.headCenter.y
}
const controlPointR = {
x: tailCenter.x + tailRadius,
y: headPointR.y + this.distance / 2
}
ctx.quadraticCurveTo(controlPointR.x, controlPointR.y, headPointR.x, headPointR.y)
ctx.fillStyle = 'rgb(170,170,170)'
ctx.fill()
ctx.strokeStyle = 'rgb(153,153,153)'
ctx.stroke()
ctx.restore()
},
_drawArrow (ctx) {
ctx.save()
ctx.beginPath()
const rate = this.distance / this.maxDistance
const arrowRadius = this.initArrowRadius - (this.initArrowRadius - this.minArrowRadius) * rate
// 画内圆
ctx.arc(this.headCenter.x, this.headCenter.y, arrowRadius - (this.arrowWidth - rate), -Math.PI / 2, 0, true)
// 画外圆
ctx.arc(this.headCenter.x, this.headCenter.y, arrowRadius, 0, Math.PI * 3 / 2, false)
ctx.lineTo(this.headCenter.x, this.headCenter.y - arrowRadius - this.arrowWidth / 2 + rate)
ctx.lineTo(this.headCenter.x + this.arrowWidth * 2 - rate * 2, this.headCenter.y - arrowRadius + this.arrowWidth / 2)
ctx.lineTo(this.headCenter.x, this.headCenter.y - arrowRadius + this.arrowWidth * 3 / 2 - rate)
ctx.fillStyle = 'rgb(255,255,255)'
ctx.fill()
ctx.strokeStyle = 'rgb(170,170,170)'
ctx.stroke()
ctx.restore()
}
},
watch: {
y () {
this._draw()
}
}
}
</script>
\ No newline at end of file
export function hasClass (el, className) {
let reg = new RegExp('(^|\\s)' + className + '(\\s|$)')
return reg.test(el.className)
}
export function addClass (el, className) {
if (hasClass(el, className)) {
return
}
let newClass = el.className.split(' ')
newClass.push(className)
el.className = newClass.join(' ')
}
export function removeClass (el, className) {
if (!hasClass(el, className)) {
return
}
let reg = new RegExp('(^|\\s)' + className + '(\\s|$)', 'g')
el.className = el.className.replace(reg, ' ')
}
export function getData (el, name, val) {
let prefix = 'data-'
if (val) {
return el.setAttribute(prefix + name, val)
}
return el.getAttribute(prefix + name)
}
export function getRect (el) {
if (el instanceof window.SVGElement) {
let rect = el.getBoundingClientRect()
return {
top: rect.top,
left: rect.left,
width: rect.width,
height: rect.height
}
} else {
return {
top: el.offsetTop,
left: el.offsetLeft,
width: el.offsetWidth,
height: el.offsetHeight
}
}
}
import mrBetterScroll from './mrBetterScroll.vue'
export default {
install: (Vue) => {
Vue.component('mrBetterScroll', mrBetterScroll)
}
}
<template>
<div class="mf-loading-container">
<img src="./loading.gif">
</div>
</template>
<script>
export default {
name: 'loading'
}
</script>
<style scoped lang="less">
.mf-loading-container{
img{
width: 20px;
height: 20px;
display: block;
}
}
</style>
\ No newline at end of file
<template>
<div ref="wrapper" class="list-wrapper">
<div class="scroll-content">
<div ref="listWrapper" class="listWrapper">
<slot>
<ul class="list-content">
<li @click="clickItem($event,item)" class="list-item" v-for="item in data">{{item}}</li>
</ul>
</slot>
</div>
<slot name="pullupContainer"
:pullUpLoad="pullUpLoad"
:isPullUpLoad="isPullUpLoad"
>
<div class="pullup-wrapper" v-if="pullUpLoad">
<div class="before-trigger" v-if="!isPullUpLoad">
<span>{{pullUpTxt}}</span>
</div>
<div class="after-trigger" v-else>
<loading></loading>
</div>
</div>
</slot>
</div>
<slot name="pulldownContainer"
:pullDownRefresh="pullDownRefresh"
:pullDownStyle="pullDownStyle"
:beforePullDown="beforePullDown"
:isPullingDown="isPullingDown"
:bubbleY="bubbleY"
>
<div ref="pulldown" class="pulldown-wrapper" :style="pullDownStyle" v-if="pullDownRefresh">
<div class="before-trigger" v-if="beforePullDown">
<bubble :y="bubbleY"></bubble>
</div>
<div class="after-trigger" v-else>
<div v-if="isPullingDown" class="loading">
<loading></loading>
</div>
<div v-else><span>{{refreshTxt}}</span></div>
</div>
</div>
</slot>
</div>
</template>
<script>
import BScroll from 'better-scroll'
import Loading from './loading.vue'
import Bubble from './bubble.vue'
import { getRect } from './dom.js'
const COMPONENT_NAME = 'mr-better-scroll'
const DIRECTION_H = 'horizontal'
const DIRECTION_V = 'vertical'
export default {
name: COMPONENT_NAME,
props: {
data: {
type: Array,
default: function () {
return []
}
},
probeType: {
type: Number,
default: 1
},
click: {
type: Boolean,
default: true
},
listenScroll: {
type: Boolean,
default: false
},
listenBeforeScroll: {
type: Boolean,
default: false
},
direction: {
type: String,
default: DIRECTION_V
},
scrollbar: {
type: null,
default: false
},
pullDownRefresh: {
type: null,
default: false
},
pullUpLoad: {
type: null,
default: false
},
startY: {
type: Number,
default: 0
},
refreshDelay: {
type: Number,
default: 20
},
freeScroll: {
type: Boolean,
default: false
},
bounce: {
type: Boolean,
default: true
}
},
data () {
return {
beforePullDown: true,
isRebounding: false,
isPullingDown: false,
isPullUpLoad: false,
pullUpDirty: true,
pullDownStyle: '',
bubbleY: 0
}
},
computed: {
pullUpTxt () {
const moreTxt = (this.pullUpLoad && this.pullUpLoad.txt && this.pullUpLoad.txt.more) || '加载更多'
const noMoreTxt = (this.pullUpLoad && this.pullUpLoad.txt && this.pullUpLoad.txt.noMore) || '没有更多数据了'
return this.pullUpDirty ? moreTxt : noMoreTxt
},
refreshTxt () {
return (this.pullDownRefresh && this.pullDownRefresh.txt) || '刷新成功'
}
},
created () {
this.pullDownInitTop = -50
},
mounted () {
setTimeout(() => {
this.initScroll()
}, 20)
},
methods: {
initScroll () {
if (!this.$refs.wrapper) {
return
}
if (this.$refs.listWrapper && (this.pullDownRefresh || this.pullUpLoad)) {
this.$refs.listWrapper.style.minHeight = `${getRect(this.$refs.wrapper).height + 1}px`
}
let options = {
probeType: this.probeType,
click: this.click,
scrollY: this.freeScroll || this.direction === DIRECTION_V,
scrollX: this.freeScroll || this.direction === DIRECTION_H,
scrollbar: this.scrollbar,
pullDownRefresh: this.pullDownRefresh,
pullUpLoad: this.pullUpLoad,
startY: this.startY,
bounce: this.bounce,
freeScroll: this.freeScroll
}
this.scroll = new BScroll(this.$refs.wrapper, options)
if (this.listenScroll) {
this.scroll.on('scroll', (pos) => {
this.$emit('scroll', pos)
})
}
if (this.listenBeforeScroll) {
this.scroll.on('beforeScrollStart', () => {
this.$emit('beforeScrollStart')
})
}
if (this.pullDownRefresh) {
this._initPullDownRefresh()
}
if (this.pullUpLoad) {
this._initPullUpLoad()
}
},
disable () {
this.scroll && this.scroll.disable()
},
enable () {
this.scroll && this.scroll.enable()
},
refresh () {
this.scroll && this.scroll.refresh()
},
scrollTo () {
this.scroll && this.scroll.scrollTo.apply(this.scroll, arguments)
},
scrollToElement () {
this.scroll && this.scroll.scrollToElement.apply(this.scroll, arguments)
},
clickItem (e, item) {
console.log(e)
this.$emit('click', item)
},
destroy () {
this.scroll.destroy()
},
forceUpdate (dirty) {
if (this.pullDownRefresh && this.isPullingDown) {
this.isPullingDown = false
this._reboundPullDown().then(() => {
this._afterPullDown()
})
} else if (this.pullUpLoad && this.isPullUpLoad) {
this.isPullUpLoad = false
this.scroll.finishPullUp()
this.pullUpDirty = dirty
this.refresh()
} else {
this.refresh()
}
},
_initPullDownRefresh () {
this.scroll.on('pullingDown', () => {
this.beforePullDown = false
this.isPullingDown = true
this.$emit('pullingDown')
})
this.scroll.on('scroll', (pos) => {
if (this.beforePullDown) {
this.bubbleY = Math.max(0, pos.y + this.pullDownInitTop)
this.pullDownStyle = `top:${Math.min(pos.y + this.pullDownInitTop, 10)}px`
} else {
this.bubbleY = 0
}
if (this.isRebounding) {
this.pullDownStyle = `top:${10 - ((this.pullDownRefresh.stop || 40) - pos.y)}px`
}
})
},
_initPullUpLoad () {
this.scroll.on('pullingUp', () => {
this.isPullUpLoad = true
this.$emit('pullingUp')
})
},
_reboundPullDown () {
const {stopTime = 600} = this.pullDownRefresh
return new Promise((resolve) => {
setTimeout(() => {
this.isRebounding = true
this.scroll.finishPullDown()
resolve()
}, stopTime)
})
},
_afterPullDown () {
setTimeout(() => {
this.pullDownStyle = `top:${this.pullDownInitTop}px`
this.beforePullDown = true
this.isRebounding = false
this.refresh()
}, this.scroll.options.bounceTime)
}
},
watch: {
data () {
setTimeout(() => {
this.forceUpdate(true)
}, this.refreshDelay)
}
},
components: {
Loading,
Bubble
}
}
</script>
<style scoped lang="less">
.list-wrapper{
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
overflow: hidden;
background: #fff;
.scroll-content{
position: relative;
z-index: 1;
}
.list-content{
position: relative;
z-index: 10;
background: #fff;
.list-item{
height: 60px;
line-height: 60px;
font-size: 18px;
padding-left: 20px;
border-bottom: 1px solid #e5e5e5;
}
}
}
.pulldown-wrapper{
position: absolute;
width: 100%;
left: 0;
display: flex;
justify-content: center;
align-items: center;
transition: all;
.after-trigger{
margin-top: 10px;
}
}
.pullup-wrapper{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 16px 0;
}
</style>
let cache = []
function getNewLevel () {
return {}
}
function addLevel () {
cache.push(getNewLevel())
}
function back (step) {
if (step >= 0) {
throw new Error('step参数错误')
}
for (let i = 0; i > step; i--) {
clearCache(cache.pop())
}
}
function clearCache (cacheLevel) {
cacheLevel && Object.keys(cacheLevel).forEach((navigationKey) => {
cacheLevel[navigationKey] && Object.keys(cacheLevel[navigationKey]).forEach((componentKey) => {
cacheLevel[navigationKey][componentKey] && cacheLevel[navigationKey][componentKey].componentInstance && cacheLevel[navigationKey][componentKey].componentInstance.$destroy()
})
})
}
export default {
push () {
addLevel()
},
go (step) {
back(step)
},
reset () {
this.go(-cache.length)
this.push()
},
currentLevelCache () {
return cache[cache.length - 1]
},
currentCache (key) {
let currentLevel = this.currentLevelCache()
currentLevel[key] || (currentLevel[key] = {})
return currentLevel[key]
}
}
import cacheContainer from './cacheContainer.js'
import MrNavigation from './mrNavigation.js'
let routeDirection = 'UNINIT'
let backStep = 0
let history = []
function historyBack (step, toPath) {
if (history.length <= -step) {
// reset
cacheContainer.reset()
history = [toPath]
} else {
cacheContainer.go(step)
history.splice(step)
}
}
function historyReplace (toPath) {
history[history.length - 1] = toPath
}
function historyPush (toPath) {
history.push(toPath)
cacheContainer.push()
}
function getIndexOfHistory (toPath) {
return history.indexOf(toPath)
}
export default {
install: (Vue, {router}) => {
if (!router) {
console.error('navigation need router')
return
}
let replace = router.replace
router.replace = function (location, onComplete, onAbort) {
routeDirection = 'REPLACE'
replace.apply(router, [location, onComplete, onAbort])
}
let go = router.go
router.go = function (step, onComplete, onAbort) {
if (step > 0) {
throw new Error('暂不支持前进操作')
}
if (step === 0) {
throw new Error('参数错误')
}
// 防止退冒,最多退到首页,不能退至浏览器历史
if (-step >= history.length) {
step = 1 - history.length
if (step === 0) {
console.error('已是首页无法回退')
return
}
}
routeDirection = 'GOBACK'
backStep = step
go.apply(router, [step, onComplete, onAbort])
}
router.reset = function (onComplete, onAbort) {
let step = 1 - history.length
if (step === 0) {
console.log('当前处于根级,无需reset')
return
}
historyBack(-1000)
router.go(step, onComplete, onAbort)
}
let push = router.push
router.push = function (location, onComplete, onAbort) {
routeDirection = 'PUSH'
push.apply(router, [location, onComplete, onAbort])
}
// handle router change
router.afterEach((to, from) => {
if (from.path === '/' && routeDirection === 'UNINIT') {
historyPush(to.path)
routeDirection = 'INITED'
return
}
if (routeDirection === 'REPLACE') {
historyReplace(to.path)
// 复位标识
routeDirection = 'INITED'
backStep = 0
return
}
if (routeDirection === 'INITED') {
// 未通过调用router函数进行跳转,通过浏览器回退
let index = getIndexOfHistory(to.path)
if (index >= 0) {
console.log('通过浏览器回退,历史有记录,正常回退')
} else {
console.error('通过浏览器回退,且历史未记录,将重置历史')
}
historyBack(index - history.length + 1, to.path)
}
if (routeDirection === 'PUSH') {
// 前进
historyPush(to.path)
// 复位标识
routeDirection = 'INITED'
backStep = 0
}
if (routeDirection === 'GOBACK') {
// 后退
historyBack(backStep, to.path)
// 复位标识
routeDirection = 'INITED'
backStep = 0
}
})
Vue.prototype.$cacheContainer = cacheContainer
Vue.component('mrNavigation', MrNavigation)
}
}
function isAsyncPlaceholder (node) {
return node.isComment && node.asyncFactory
}
function getFirstComponentChild (children) {
if (Array.isArray(children)) {
for (let i = 0; i < children.length; i++) {
const c = children[i]
if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
return c
}
}
}
}
function isDef (v) {
return v !== undefined && v !== null
}
export default {
name: 'mrNavigation',
abstract: true,
render () {
const vnode = getFirstComponentChild(this.$slots.default)
const componentOptions = vnode && vnode.componentOptions
if (componentOptions) {
const cache = this.$cacheContainer.currentCache(this._uid)
const key = vnode.key == null
? componentOptions.Ctor.cid + (componentOptions.tag ? `::${componentOptions.tag}` : '')
: vnode.key
if (cache[key]) {
vnode.componentInstance = cache[key].componentInstance
} else {
cache[key] = vnode
}
vnode.data.keepAlive = true
}
return vnode
}
}
import translateStore from './store/translateStore.js'
let routeDirection = 'UNINIT'
export default {
install: (Vue, {router, store}) => {
if (!router) {
console.error('translate need router')
return
}
if (!store) {
console.error('translate need store')
return
}
store.registerModule('translate', translateStore)
let replace = router.replace
router.replace = function (location, onComplete, onAbort) {
routeDirection = 'REPLACE'
replace.apply(router, [location, onComplete, onAbort])
}
let go = router.go
router.go = function (step, onComplete, onAbort) {
if (step > 0) {
throw new Error('暂不支持前进操作')
}
if (step === 0) {
throw new Error('参数错误')
}
routeDirection = 'GOBACK'
go.apply(router, [step, onComplete, onAbort])
}
let push = router.push
router.push = function (location, onComplete, onAbort) {
routeDirection = 'PUSH'
push.apply(router, [location, onComplete, onAbort])
}
router.afterEach((to, from) => {
if (from.path === '/' && routeDirection === 'UNINIT') {
store.commit('translate/directionUpdated', '')
routeDirection = 'INITED'
return
}
if (routeDirection === 'REPLACE') {
// 复位标识
routeDirection = 'INITED'
return
}
if (routeDirection === 'INITED') {
// 未通过调用router函数进行跳转,通过浏览器回退
store.commit('translate/directionUpdated', 'reverse')
}
if (routeDirection === 'PUSH') {
// 前进
store.commit('translate/directionUpdated', 'forward')
// 复位标识
routeDirection = 'INITED'
}
if (routeDirection === 'GOBACK') {
// 后退
store.commit('translate/directionUpdated', 'reverse')
// 复位标识
routeDirection = 'INITED'
}
})
}
}
export default {
namespaced: true,
state: {
direction: ''
},
mutations: {
directionUpdated (state, direction) {
state.direction = direction
}
}
}
import mrScrollKeeper from './mrScrollKeeper.js'
export default {
install: (Vue) => {
Vue.component('mrScrollKeeper', mrScrollKeeper)
}
}
function getFirstComponentChild (children) {
if (Array.isArray(children)) {
for (let i = 0; i < children.length; i++) {
const c = children[i]
return c
}
}
}
export default {
name: 'mrScrollKeeper',
props: ['scrollerSelector'],
activated () {
let self = this
if (self.$slots.default &&
self.$slots.default[0] &&
self.$slots.default[0].componentInstance &&
self.$slots.default[0].componentInstance.getPosition &&
self.cachedPosition) {
// 内部为vue-scroll
setTimeout(() => {
let cachedPosition = self.cachedPosition
self.$slots.default[0].componentInstance.scrollTo(cachedPosition.left, cachedPosition.top, false)
}, 0)
}
// else {
// var element = getElement(this.$el, this.scrollerSelector)
// element && setPosition(element, this.cachedPosition)
// }
this.guardRemoveHandler = this.$router.beforeEach((to, from, next) => {
if (self.$slots.default &&
self.$slots.default[0] &&
self.$slots.default[0].componentInstance &&
self.$slots.default[0].componentInstance.getPosition) {
// 内部为vue-scroll
self.cachedPosition = self.$slots.default[0].componentInstance.getPosition()
}
// else {
// var element = getElement(self.$el, self.scrollerSelector)
// self.cachedPosition = element && getPosition(element)
// }
next()
})
},
render () {
return getFirstComponentChild(this.$slots.default)
},
deactivated () {
this.guardRemoveHandler()
}
}
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
import Home from '@/components/Home'
import Jump from '@/components/Jump'
import Login from '@/components/Login/'
import Reg from '@/components/Reg/'
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 Create from '@/components/Users/Create'
import Subaccount from '@/components/Users/Subaccount'
import Welcome from '@/components/Users/Welcome'
import SetEmail from '@/components/Users/Manager/SetEmail'
import Admin from '@/components/Users/Manager/Admin'
import $axios from 'axios'
import fn from '@/utils/function.js'
import store from '@/store/'
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: 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'
}
},{
path: '/setEmail',
name: 'setEmail',
component: SetEmail,
meta: {
title: 'SetEmail.vue'
}
},{
path: '/admin',
name: 'admin',
component: Admin,
meta: {
title: 'Admin.vue'
}
}
]
})
router.beforeEach((to, from, next) => {
// if (localStorage.getItem('enter_panel') == "true") {
// $store.commit('setEnterPannel', true);
// }
function getCoins(obj) {
let arr_coins = [];
_.map(obj.regions, function (v, i, o) {
_.map(v.supported_coin_types, function (v1, i1, o1) {
arr_coins.push(v1.coin_type)
})
});
return _.uniq(arr_coins)
var arr = ['home', 'jump'];
if (localStorage.getItem('enter_panel') == null) {
$store.commit('setEnterPannel', $store.state.enter_panel);
}
if (localStorage.getItem('puid') == null) {
$store.commit('setPuid', '');
} else {
$store.commit('setPuid', localStorage.getItem('puid'))
}
if (localStorage.getItem('enter_panel') == "true") {
$store.commit('setEnterPannel', true);
}
var arr = ['home', 'jump'];
if (localStorage.getItem('language') == null) {
$store.commit('setLanguage', $store.state.language)
}
// 最先执行的初始数据
if ($store.state.cur_coins.length == 0) {
$axios($store.state.base_url)
.then(res => {
$axios($store.state.base_url).then(res => {
$store.commit('setInitUrl', res.data);
$store.commit('setCurCoins', getCoins(res.data));
if (localStorage.coin_type) {
$store.commit('setCoinType', localStorage.coin_type);
} else {
$store.commit('setCurCoins', fn.getCoinsOnly(res.data));
if (localStorage.getItem('coin_type') == null) {
$store.commit('setCoinType', $store.state.cur_coins[0]);
}
if (localStorage.region_id) {
$store.commit('setRegionId', localStorage.region_id)
} else {
$store.commit('setRegionId', res.data.regions[0].region_id);
if (to.params.coin_type) {
$store.commit('setCoinType', to.params.coin_type);
} else {
$store.commit('setCoinType', localStorage.getItem('coin_type'));
}
if (!localStorage.puid) {
$store.commit('setPuid', '')
}
if (!localStorage.language) {
$store.commit('setLanguage', $store.state.language)
if (localStorage.getItem("region_id") == null) {
$store.commit('setRegionId', res.data.regions[0].region_id);
} else {
if (to.params.region_id) {
$store.commit('setRegionId', to.params.region_id);
} else {
$store.commit('setRegionId', localStorage.getItem('region_id'));
}
next();
}
modeSwitch(to, from, next)
})
} else {
next();
modeSwitch(to, from, next)
}
})
router.afterEach((to, from) => {
......@@ -226,4 +202,45 @@ router.afterEach((to, from) => {
document.title = to.meta.title;
})
function modeSwitch(to, from, next) {
if (to.query.read_token != undefined || to.query.read_token != null) {
// alert("进入观察者模式")
let token = to.query.read_token;
localStorage.setItem('read_token', token);
$store.state.is_login = false;
fn.getTokenInfo(token).then(res => {
if (res.data.err_no == 0) {
if (res.data.data != null) {
let data = res.data.data;
localStorage.setItem('read_expires_at', data.expired_at * 1000)
localStorage.setItem('read_name', data.name);
localStorage.setItem('read_subaccount_name', data.subaccount_name);
localStorage.setItem('puid', data.puid);
$store.state.read_token = token;
next();
} else {
alert("参数错误!")
$router.replace('/index')
}
} else {
alert("字段类型错误或为空");
}
})
} else {
// alert("进入正常模式")
localStorage.removeItem('read_token');
$store.state.read_token = '';
next();
// var arr = ['index', 'stats', 'callback', 'jump'];
// if ($auth.isAuthenticated() || arr.indexOf(to.name) > -1) {
// next()
// } else {
// localStorage.removeItem('access_token')
// localStorage.removeItem('id_token')
// localStorage.removeItem('expires_at')
// $auth.login();
// }
}
}
export default router
......@@ -2,7 +2,7 @@ import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
import dictionaries from '@/assets/js/dictionaries.js'; //字典
import dictionaries from '@/utils/dictionaries.js'; //字典
const state = {
refresh_time: 10000, //定时刷新
......
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默认分组',
}
}
}
/**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