Commit 30024249 by zhanghui1

还是搞不明白

parent c71f3f79
<template> <template>
<div id="app" :class="gradeClass"> <div id="app" :class="gradeClass">
<!-- <transition name="fade" mode="out-in"> <transition :name="'vux-pop-' + (direction === '' ? '' : (direction === 'forward' ? 'in' : 'out'))" v-if="left">
<router-view/>
</transition> -->
<router-view/>
<transition :name="'vux-pop-' + (direction === '' ? '' : (direction === 'forward' ? 'in' : 'out'))" v-if="left">
<mr-navigation> <mr-navigation>
<router-view></router-view> <router-view></router-view>
</mr-navigation> </mr-navigation>
...@@ -15,7 +10,6 @@ ...@@ -15,7 +10,6 @@
<router-view></router-view> <router-view></router-view>
</mr-navigation> </mr-navigation>
</transition> </transition>
</div> </div>
</template> </template>
<script> <script>
...@@ -24,12 +18,12 @@ export default { ...@@ -24,12 +18,12 @@ export default {
name: 'app', name: 'app',
data() { data() {
return { return {
left: false left: false
} }
}, },
computed: { computed: {
...mapState('translate', ['direction']), ...mapState('translate', ['direction']),
finallyDirection () { finallyDirection() {
return this.tempDirection || this.direction return this.tempDirection || this.direction
} }
}, },
...@@ -49,26 +43,78 @@ export default { ...@@ -49,26 +43,78 @@ export default {
height: 100%; height: 100%;
position: relative; 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{
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} .mobile-android .vux-pop-in-enter-active,
.vux-pop-in-enter-active{box-shadow:0 0 10px rgba(0,0,0,.15)} .mobile-android .vux-pop-in-leave-activ,
.vux-pop-in-enter-to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1;z-index:2} .mobile-android .vux-pop-out-enter-active,
.vux-pop-in-leave{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:.8;z-index:1} .mobile-android .vux-pop-out-enter-active {
.vux-pop-in-leave-to{-webkit-transform:translate3d(-33%,0,0);transform:translate3d(-33%,0,0);opacity:0;z-index:1} 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 {
.vux-pop-out-enter-to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1;z-index:1} -webkit-transform: translate3d(-33%, 0, 0);
.vux-pop-out-leave{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1;z-index:2} transform: translate3d(-33%, 0, 0);
.vux-pop-out-leave-active{box-shadow:0 0 10px rgba(0,0,0,.15)} opacity: .8;
.vux-pop-out-leave-to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:1;z-index:2} 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> </style>
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
getLucky(coin_type) { getLucky(coin_type) {
return $axios($store.state.common_url + "/pool/lucky?coin_type=" + coin_type) return $axios(Vue.$store.state.poolinApp.common_url + "/pool/lucky?coin_type=" + coin_type)
}, },
/** /**
* [getBlocks 获取矿池出块数据] * [getBlocks 获取矿池出块数据]
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
getBlocks(coin_type) { getBlocks(coin_type) {
return $axios($store.state.common_url + "/pool/blocks/merge?coin_type=" + coin_type) return $axios(Vue.$store.state.poolinApp.common_url + "/pool/blocks/merge?coin_type=" + coin_type)
}, },
/** /**
* [getStats 获取矿池实时算力-合并] * [getStats 获取矿池实时算力-合并]
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,7 @@ export default {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
getStats(coin_type) { getStats(coin_type) {
return $axios($store.state.common_url + "/pool/stats/merge?coin_type=" + coin_type) return $axios(Vue.$store.state.poolinApp.common_url + "/pool/stats/merge?coin_type=" + coin_type)
}, },
/** /**
* [getShareHistory 获取矿池算力历史-合并] * [getShareHistory 获取矿池算力历史-合并]
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
getShareHistory(count, dimension, coin_type) { getShareHistory(count, dimension, coin_type) {
return $axios($store.state.common_url + "/pool/share-history/merge?count=" + count + "&dimension=" + dimension + "&coin_type=" + coin_type) return $axios(Vue.$store.state.poolinApp.common_url + "/pool/share-history/merge?count=" + count + "&dimension=" + dimension + "&coin_type=" + coin_type)
}, },
/** /**
* [getSubAccount 获取子账户列表] * [getSubAccount 获取子账户列表]
...@@ -176,7 +176,7 @@ export default { ...@@ -176,7 +176,7 @@ export default {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
getSubAccount() { getSubAccount() {
return $axios($store.state.common_url + "/subaccount") return $axios(Vue.$store.state.poolinApp.common_url + "/subaccount")
}, },
/** /**
* [getSubAccountById 获取子账户详情] * [getSubAccountById 获取子账户详情]
...@@ -187,13 +187,13 @@ export default { ...@@ -187,13 +187,13 @@ export default {
*/ */
getSubAccountById(puid) { getSubAccountById(puid) {
return new Promise(function (relsove, reject) { return new Promise(function (relsove, reject) {
if (!$store.state.SubAccount) $store.state.SubAccount = {}; if (!Vue.$store.state.poolinApp.SubAccount) Vue.$store.state.poolinApp.SubAccount = {};
if ($store.state.SubAccount['SubAccount' + puid]) { if (Vue.$store.state.poolinApp.SubAccount['SubAccount' + puid]) {
relsove($store.state.SubAccount['SubAccount' + puid]) relsove(Vue.$store.state.poolinApp.SubAccount['SubAccount' + puid])
} else { } else {
$axios($store.state.common_url + "/subaccount/" + puid).then(function (res) { $axios(Vue.$store.state.poolinApp.common_url + "/subaccount/" + puid).then(function (res) {
$store.state.SubAccount['SubAccount' + puid] = res; Vue.$store.state.poolinApp.SubAccount['SubAccount' + puid] = res;
relsove($store.state.SubAccount['SubAccount' + puid]) relsove(Vue.$store.state.poolinApp.SubAccount['SubAccount' + puid])
}) })
} }
}) })
...@@ -206,7 +206,7 @@ export default { ...@@ -206,7 +206,7 @@ export default {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
createAccount(params) { createAccount(params) {
return $axios.post($store.state.common_url + "/subaccount/create", params) return $axios.post(Vue.$store.state.poolinApp.common_url + "/subaccount/create", params)
}, },
/** /**
* [getUrl 获取初始接口] * [getUrl 获取初始接口]
...@@ -217,7 +217,7 @@ export default { ...@@ -217,7 +217,7 @@ export default {
*/ */
getUrl() { getUrl() {
//console.log("getUrl") //console.log("getUrl")
return $axios($store.state.base_url) return $axios(Vue.$store.state.poolinApp.base_url)
// .then(res => { return mock.getUrl }) // .then(res => { return mock.getUrl })
}, },
/** /**
...@@ -230,9 +230,9 @@ export default { ...@@ -230,9 +230,9 @@ export default {
getCoins() { getCoins() {
//console.log("getCoins") //console.log("getCoins")
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
resolve($store.state.init_url.coins) resolve(Vue.$store.state.poolinApp.init_url.coins)
}) })
// return $axios($store.state.base_url).then(res => { return res.data.coins }) // return $axios(Vue.$store.state.poolinApp.base_url).then(res => { return res.data.coins })
}, },
/** /**
* [getAllRegions 获取初始接口的所有节点] * [getAllRegions 获取初始接口的所有节点]
...@@ -244,13 +244,13 @@ export default { ...@@ -244,13 +244,13 @@ export default {
getAllRegions() { getAllRegions() {
//console.log("getAllRegions") //console.log("getAllRegions")
// return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
// resolve($store.state.init_url.regions) // resolve(Vue.$store.state.poolinApp.init_url.regions)
// }) // })
let coin_type = localStorage.getItem('coin_type'); let coin_type = localStorage.getItem('coin_type');
let regions = []; let regions = [];
let obj = {}; let obj = {};
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
_.each($store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
_.each(v.supported_coin_types, function (v1, k1) { _.each(v.supported_coin_types, function (v1, k1) {
if (v1.coin_type == coin_type) { if (v1.coin_type == coin_type) {
obj = { region_id: v.region_id, text_en: v.text_en, 'text_zh-cn': v['text_zh-cn'] } obj = { region_id: v.region_id, text_en: v.text_en, 'text_zh-cn': v['text_zh-cn'] }
...@@ -272,7 +272,7 @@ export default { ...@@ -272,7 +272,7 @@ export default {
//console.log("getRegionInfo") //console.log("getRegionInfo")
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let cur_region; let cur_region;
_.each($store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
if (v.region_id == region_id) { if (v.region_id == region_id) {
cur_region = v; cur_region = v;
} }
...@@ -289,7 +289,7 @@ export default { ...@@ -289,7 +289,7 @@ export default {
*/ */
getUserList() { getUserList() {
//console.log("getUserList") //console.log("getUserList")
return $axios($store.state.common_url + '/subaccount'); return $axios(Vue.$store.state.poolinApp.common_url + '/subaccount');
}, },
/** /**
* [getUser 获取当前帐户信息] * [getUser 获取当前帐户信息]
...@@ -301,7 +301,7 @@ export default { ...@@ -301,7 +301,7 @@ export default {
*/ */
getUser(puid) { getUser(puid) {
//console.log("getUser") //console.log("getUser")
return $axios($store.state.common_url + '/subaccount/' + puid) return $axios(Vue.$store.state.poolinApp.common_url + '/subaccount/' + puid)
}, },
/** /**
* [getZonglanList 获取单个币种多个节点数据] * [getZonglanList 获取单个币种多个节点数据]
...@@ -336,7 +336,7 @@ export default { ...@@ -336,7 +336,7 @@ export default {
// console.log("getApiBaseUrl") // console.log("getApiBaseUrl")
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let api_base_url = ''; let api_base_url = '';
_.each($store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
if (v.region_id == region_id) { if (v.region_id == region_id) {
_.each(v.supported_coin_types, function (v1, k1) { _.each(v.supported_coin_types, function (v1, k1) {
if (v1.coin_type == cointype) { if (v1.coin_type == cointype) {
...@@ -573,7 +573,7 @@ export default { ...@@ -573,7 +573,7 @@ export default {
*/ */
getRegionCoins(region_id) { getRegionCoins(region_id) {
let arr_coins = []; let arr_coins = [];
_.map($store.state.init_url.regions, function (v, i, o) { _.map(Vue.$store.state.poolinApp.init_url.regions, function (v, i, o) {
if (v.region_id == region_id) { if (v.region_id == region_id) {
_.map(v.supported_coin_types, function (v1, i1, o1) { _.map(v.supported_coin_types, function (v1, i1, o1) {
arr_coins.push(v1.coin_type) arr_coins.push(v1.coin_type)
...@@ -605,7 +605,7 @@ export default { ...@@ -605,7 +605,7 @@ export default {
getStratumUrl(region_id, coin_type) { getStratumUrl(region_id, coin_type) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let stratum_url = ''; let stratum_url = '';
_.each($store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
if (v.region_id == region_id) { if (v.region_id == region_id) {
_.each(v.supported_coin_types, function (v1, k1) { _.each(v.supported_coin_types, function (v1, k1) {
if (v1.coin_type == coin_type) { if (v1.coin_type == coin_type) {
...@@ -626,11 +626,11 @@ export default { ...@@ -626,11 +626,11 @@ export default {
*/ */
getStratumUrls(coin_type) { getStratumUrls(coin_type) {
//mock.getUrl.data //mock.getUrl.data
//$store.state.init_url //Vue.$store.state.poolinApp.init_url
let data = []; let data = [];
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let stratum_url = ''; let stratum_url = '';
_.each($store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
_.each(v.supported_coin_types, function (v1, k1) { _.each(v.supported_coin_types, function (v1, k1) {
if (v1.coin_type == coin_type) { 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 }) data.push({ region_id: v.region_id, text_en: v.text_en, 'text_zh-cn': v['text_zh-cn'], coin_info: v1 })
...@@ -649,7 +649,7 @@ export default { ...@@ -649,7 +649,7 @@ export default {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
getSummary(puid, coin_type) { getSummary(puid, coin_type) {
return $axios($store.state.common_url + "/subaccount/summary?puid=" + puid + "&coin_type=" + coin_type) return $axios(Vue.$store.state.poolinApp.common_url + "/subaccount/summary?puid=" + puid + "&coin_type=" + coin_type)
}, },
/** /**
* [getAllRegionByCoin 根据币种获取到所有节点所支持的所有节点] * [getAllRegionByCoin 根据币种获取到所有节点所支持的所有节点]
...@@ -662,7 +662,7 @@ export default { ...@@ -662,7 +662,7 @@ export default {
let regions = []; let regions = [];
let obj = {}; let obj = {};
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
_.each($store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.poolinApp.init_url.regions, function (v, k) {
_.each(v.supported_coin_types, function (v1, k1) { _.each(v.supported_coin_types, function (v1, k1) {
if (v1.coin_type == coin_type) { if (v1.coin_type == coin_type) {
obj = { region_id: v.region_id, text_en: v.text_en, 'text_zh-cn': v['text_zh-cn'] } obj = { region_id: v.region_id, text_en: v.text_en, 'text_zh-cn': v['text_zh-cn'] }
...@@ -677,25 +677,25 @@ export default { ...@@ -677,25 +677,25 @@ export default {
* 创建 token * 创建 token
*/ */
createToken(puid, params) { createToken(puid, params) {
return $axios.post($store.state.common_url + '/watcher/token/create?puid=' + puid, params) return $axios.post(Vue.$store.state.poolinApp.common_url + '/watcher/token/create?puid=' + puid, params)
}, },
/** /**
* 列出 token * 列出 token
*/ */
listToken(puid, coin) { listToken(puid, coin) {
return $axios($store.state.common_url + '/watcher/token?puid=' + puid + '&coin_type=' + coin) return $axios(Vue.$store.state.poolinApp.common_url + '/watcher/token?puid=' + puid + '&coin_type=' + coin)
}, },
/** /**
* 获取 token 详情 * 获取 token 详情
*/ */
getTokenInfo(token) { getTokenInfo(token) {
return $axios($store.state.common_url + '/watcher/token/info?token=' + token) return $axios(Vue.$store.state.poolinApp.common_url + '/watcher/token/info?token=' + token)
}, },
/** /**
* 移除 token * 移除 token
*/ */
delToken(puid, params) { delToken(puid, params) {
return $axios.post($store.state.common_url + '/watcher/token/delete?puid=' + puid, params) return $axios.post(Vue.$store.state.poolinApp.common_url + '/watcher/token/delete?puid=' + puid, params)
}, },
/** /**
* 获取所支持币种 * 获取所支持币种
......
<template> <template>
<div class="tab-bar"> <div class="tab-bar">
<ul flex="main:justify box:mean cross:center"> <ul flex="main:justify box:mean cross:center">
<li @click="goTo(0)" :class="$store.state.tab_bar==0?'active':''"> <li @click="goTo(0)" :class="$store.state.poolinApp.tab_bar==0?'active':''">
<i class="iconfont icon-tubiaozhexiantu"></i> <i class="iconfont icon-tubiaozhexiantu"></i>
<p>用户面板</p> <p>用户面板</p>
</li> </li>
<li @click="goTo(1)" :class="$store.state.tab_bar==1?'active':''"> <li @click="goTo(1)" :class="$store.state.poolinApp.tab_bar==1?'active':''">
<i class="iconfont icon-cabinet-settings"></i> <i class="iconfont icon-cabinet-settings"></i>
<p>矿机</p> <p>矿机</p>
</li> </li>
<li @click="goTo(2)" :class="$store.state.tab_bar==2?'active':''"> <li @click="goTo(2)" :class="$store.state.poolinApp.tab_bar==2?'active':''">
<i class="iconfont icon-licaishouyi"></i> <i class="iconfont icon-licaishouyi"></i>
<p>收益</p> <p>收益</p>
</li> </li>
<li @click="goTo(3)" :class="$store.state.tab_bar==3?'active':''"> <li @click="goTo(3)" :class="$store.state.poolinApp.tab_bar==3?'active':''">
<i class="iconfont icon-unie606"></i> <i class="iconfont icon-unie606"></i>
<p>设置</p> <p>设置</p>
</li> </li>
...@@ -21,45 +21,74 @@ ...@@ -21,45 +21,74 @@
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'tabbar', name: 'tabbar',
data() { data() {
return { return {
puid: '',
} coin_type: '',
}, region_id: '',
mounted() { }
},
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.poolinApp.tab_bar = n;
}, switch (n) {
methods: { case 0:
goTo(n) { this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/dashboard')
this.$store.state.tab_bar=n; break;
switch (n) { case 1:
case 0: this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/miners')
this.$router.replace('/my/7/ltc/shenzhen/dashboard') break;
break; case 2:
case 1: this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/payments')
this.$router.replace('/my/7/ltc/shenzhen/miners') break;
break; default:
case 2: this.$router.replace('/settings')
this.$router.replace('/my/7/ltc/shenzhen/payments') break;
break;
default:
this.$router.replace('/settings')
break;
}
} }
} }
} }
}
</script> </script>
<style lang="less"> <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; .tab-bar {
li {text-align: center; position: fixed;
.iconfont {color: #b8b8b8;font-size: .40rem;} left: 0;
p {color: #727272;font-size: .20rem;margin-top: .02rem;} 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 { &.active {
p, .iconfont {color: #1c5fa9; } p,
.iconfont {
color: #1c5fa9;
}
} }
} }
} }
</style> </style>
<template> <template>
<div class="my-popup"> <div class="my-popup">
<ul> <ul>
<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':''"> <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.init_url.coins[cur_coin]['text_zh-cn']}}</b> <b :class="cur_coin">{{cur_coin|uppercase}}{{$store.state.poolinApp.init_url.coins[cur_coin]['text_zh-cn']}}</b>
<i class="iconfont icon-dui"></i> <i class="iconfont icon-dui"></i>
</li> </li>
</ul> </ul>
...@@ -22,8 +22,8 @@ export default { ...@@ -22,8 +22,8 @@ export default {
methods: { methods: {
coinAcitve(cur_coin) { coinAcitve(cur_coin) {
this.$emit('childCoin', cur_coin) this.$emit('childCoin', cur_coin)
this.$store.commit('setCoinType', cur_coin) this.$store.commit('poolinApp/setCoinType', cur_coin)
this.coin_type=cur_coin this.coin_type = cur_coin
} }
} }
} }
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
maxOnOff: false maxOnOff: false
}), }),
computed: { computed: {
...mapState(["txt", "init_url", "cur_coins"]), ...mapState('poolinApp',["txt", "init_url", "cur_coins"]),
line: function() { line: function() {
let self = this; let self = this;
return { return {
......
...@@ -37,13 +37,13 @@ ...@@ -37,13 +37,13 @@
</div> </div>
<div flex="main:center dir:top box:center cross:center"> <div flex="main:center dir:top box:center cross:center">
<p> <p>
<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-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-else><animated-num :value="(payment_stats.yesterday_amount)/Math.pow(10,8)" :fixed=8></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> <span class="k">{{$route.params.coin_type|uppercase}}</span>
</p> </p>
<h3 class="title f24gray">昨日收益</h3> <h3 class="title f24gray">昨日收益</h3>
<p class="small-k-v mt20"> <p class="small-k-v mt20">
<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-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-else><animated-num :value="(payment_stats.today_estimate)/Math.pow(10,8)" :fixed=8></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> <span class="k">{{$route.params.coin_type|uppercase}}</span>
</p> </p>
...@@ -55,14 +55,14 @@ ...@@ -55,14 +55,14 @@
<div class="list"> <div class="list">
<h3>账户收益</h3> <h3>账户收益</h3>
<mt-cell title="余额"> <mt-cell title="余额">
<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-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-else><animated-num :value="payment_stats.balance/Math.pow(10,8)" :fixed=8></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.coin_type|uppercase}}</span> <span class="k">{{$store.state.poolinApp.coin_type|uppercase}}</span>
</mt-cell> </mt-cell>
<mt-cell title="已支付"> <mt-cell title="已支付">
<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-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-else><animated-num :value="payment_stats.total_paid_amount/Math.pow(10,8)" :fixed=8></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.coin_type|uppercase}}</span> <span class="k">{{$store.state.poolinApp.coin_type|uppercase}}</span>
</mt-cell> </mt-cell>
<mt-cell title="上一次支付时间"><span class="v">2017-11-02 8:00</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> <mt-cell title="待确认支付"><span class="v">119.71423071</span> <span class="k">BTC</span></mt-cell>
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
self.pageInit(); self.pageInit();
window.dingshiqi = setInterval(function() { window.dingshiqi = setInterval(function() {
self.pageInit(); self.pageInit();
}, $store.state.refresh_time) }, $store.state.poolinApp.refresh_time)
}, },
pageInit() { pageInit() {
let self = this; let self = this;
...@@ -217,8 +217,8 @@ export default { ...@@ -217,8 +217,8 @@ export default {
this.showSide = false; this.showSide = false;
}, },
fromSubAccount(obj) { fromSubAccount(obj) {
this.$store.commit('setPuid', obj.puid) this.$store.commit('poolinApp/setPuid', obj.puid)
this.$store.commit('setCoinType', obj.default_coin_type) this.$store.commit('poolinApp/setCoinType', obj.default_coin_type)
this.showSide = false; this.showSide = false;
this.$route.params.puid = obj.puid; this.$route.params.puid = obj.puid;
this.$route.params.coin_type = obj.default_coin_type; this.$route.params.coin_type = obj.default_coin_type;
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
}) })
}, },
fromRegion(msg) { fromRegion(msg) {
this.$store.commit('setRegionId', msg) this.$store.commit('poolinApp/setRegionId', msg)
this.showRegion = false; this.showRegion = false;
this.$route.params.region_id = msg; this.$route.params.region_id = msg;
this.$router.replace({ this.$router.replace({
...@@ -236,7 +236,7 @@ export default { ...@@ -236,7 +236,7 @@ export default {
}) })
}, },
fromCoin(msg) { fromCoin(msg) {
this.$store.commit('setCoinType', msg) this.$store.commit('poolinApp/setCoinType', msg)
this.showCoin = false; this.showCoin = false;
this.$route.params.coin_type = msg; this.$route.params.coin_type = msg;
this.getRegionInfo(); this.getRegionInfo();
......
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
self.pageInit(); self.pageInit();
window.dingshiqi = setInterval(function() { window.dingshiqi = setInterval(function() {
self.pageInit(); self.pageInit();
}, $store.state.refresh_time) }, $store.state.poolinApp.refresh_time)
}, },
pageInit() { pageInit() {
let self = this; let self = this;
...@@ -139,8 +139,8 @@ export default { ...@@ -139,8 +139,8 @@ export default {
this.showSide = false; this.showSide = false;
}, },
fromSubAccount(obj) { fromSubAccount(obj) {
this.$store.commit('setPuid', obj.puid) this.$store.commit('poolinApp/setPuid', obj.puid)
this.$store.commit('setCoinType', obj.default_coin_type) this.$store.commit('poolinApp/setCoinType', obj.default_coin_type)
this.showSide = false; this.showSide = false;
this.$route.params.puid = obj.puid; this.$route.params.puid = obj.puid;
this.$route.params.coin_type = obj.default_coin_type; this.$route.params.coin_type = obj.default_coin_type;
...@@ -150,7 +150,7 @@ export default { ...@@ -150,7 +150,7 @@ export default {
}) })
}, },
fromRegion(msg) { fromRegion(msg) {
this.$store.commit('setRegionId', msg) this.$store.commit('poolinApp/setRegionId', msg)
this.showRegion = false; this.showRegion = false;
this.$route.params.region_id = msg; this.$route.params.region_id = msg;
this.$router.replace({ this.$router.replace({
...@@ -158,7 +158,7 @@ export default { ...@@ -158,7 +158,7 @@ export default {
}) })
}, },
fromCoin(msg) { fromCoin(msg) {
this.$store.commit('setCoinType', msg) this.$store.commit('poolinApp/setCoinType', msg)
this.showCoin = false; this.showCoin = false;
this.$route.params.coin_type = msg; this.$route.params.coin_type = msg;
this.$router.replace({ this.$router.replace({
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="swiper"> <div class="swiper">
<swiper :options="swiperOption" ref="mySwiper"> <swiper :options="swiperOption" ref="mySwiper">
<!-- slides --> <!-- slides -->
<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> <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>
<!-- Optional controls --> <!-- Optional controls -->
<div class="swiper-button-prev" slot="button-prev"></div> <div class="swiper-button-prev" slot="button-prev"></div>
<div class="swiper-button-next" slot="button-next"></div> <div class="swiper-button-next" slot="button-next"></div>
...@@ -45,12 +45,12 @@ export default { ...@@ -45,12 +45,12 @@ export default {
debugger: true, debugger: true,
slidesPerView: 3, slidesPerView: 3,
}, },
coin: $store.state.cur_coins[0], coin: $store.state.poolinApp.cur_coins[0],
active: 0 active: 0
} }
}, },
computed: { computed: {
...mapState(["txt", "init_url", "cur_coins"]), ...mapState('poolinApp',["txt", "init_url", "cur_coins"]),
swiper() { swiper() {
return this.$refs.mySwiper.swiper return this.$refs.mySwiper.swiper
} }
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<script> <script>
import tabbar from "@/components/Common/Tabbar.vue"; import tabbar from "@/components/Common/Tabbar.vue";
export default { export default {
name: 'dashboard', name: 'settings',
components: { components: {
tabbar tabbar
}, },
......
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
language: '', language: '',
}), }),
computed: { computed: {
...mapState(["txt", "init_url", "cur_coins"]), ...mapState('poolinApp',["txt", "init_url", "cur_coins"]),
line: function() { line: function() {
let self = this; let self = this;
return { return {
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
unit: '' unit: ''
}), }),
computed: { computed: {
...mapState(["txt", "init_url", "cur_coins"]), ...mapState('poolinApp',["txt", "init_url", "cur_coins"]),
line: function() { line: function() {
let self = this; let self = this;
return { return {
......
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
maxOnOff:false, maxOnOff:false,
}), }),
computed: { computed: {
...mapState(["txt", "init_url", "cur_coins"]), ...mapState('poolinApp',["txt", "init_url", "cur_coins"]),
line: function() { line: function() {
let self = this; let self = this;
return { return {
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
}), }),
props: ["params_coin"], props: ["params_coin"],
computed: { computed: {
...mapState(["txt", "init_url", "cur_coins"]), ...mapState("poolinApp",["txt", "init_url", "cur_coins"]),
line: function() { line: function() {
let self = this; let self = this;
return { return {
...@@ -137,7 +137,7 @@ export default { ...@@ -137,7 +137,7 @@ export default {
}, },
}, },
watch: { watch: {
params_coin(){ params_coin() {
this.pageInitInterval() this.pageInitInterval()
} }
}, },
...@@ -151,39 +151,37 @@ export default { ...@@ -151,39 +151,37 @@ export default {
self.pageInit(); self.pageInit();
window.dingshiqi = setInterval(function() { window.dingshiqi = setInterval(function() {
self.pageInit(); self.pageInit();
}, $store.state.refresh_time) }, $store.state.poolinApp.refresh_time)
}, },
pageInit() { pageInit() {
let self = this; let self = this;
this.language = localStorage.getItem('language'); this.language = localStorage.getItem('language');
fn.getStats(self.params_coin) fn.getStats(self.params_coin).then(res => {
.then(res => { if (res.data.err_no == 0) {
if (res.data.err_no == 0) { self.shares_1h = res.data.data.shares.shares_1h
self.shares_1h = res.data.data.shares.shares_1h self.shares_unit = res.data.data.shares.shares_unit
self.shares_unit = res.data.data.shares.shares_unit self.workers = res.data.data.workers
self.workers = res.data.data.workers } else {
} else { this.$message.error("获取矿池合并实时算力错误!")
this.$message.error("获取矿池合并实时算力错误!") }
} })
})
fn.getShareHistory(72, "1h", self.params_coin) fn.getShareHistory(72, "1h", self.params_coin).then(res => {
.then(res => { let hour;
let hour; self.shareHistoryTime = [];
self.shareHistoryTime = []; self.shareHistoryYes = [];
self.shareHistoryYes = []; self.shareHistoryNo = [];
self.shareHistoryNo = []; if (res.data.err_no == 0) {
if (res.data.err_no == 0) { self.unit = res.data.data.unit;
self.unit = res.data.data.unit; _.each(res.data.data.tickers, function(v, i) {
_.each(res.data.data.tickers, function(v, i) { self.shareHistoryTime.push(fn.getYMDHM(v[0] * 1000))
self.shareHistoryTime.push(fn.getYMDHM(v[0] * 1000)) self.shareHistoryYes.push(v[1]);
self.shareHistoryYes.push(v[1]); self.shareHistoryNo.push(v[2]);
self.shareHistoryNo.push(v[2]); });
}); } else {
} else { this.$message.error("获取矿池合并算力历史错误!")
this.$message.error("获取矿池合并算力历史错误!") }
} })
})
} }
} }
} }
......
...@@ -16,12 +16,12 @@ import scrollKeeper from './maxrocky/scrollKeeper' ...@@ -16,12 +16,12 @@ import scrollKeeper from './maxrocky/scrollKeeper'
import routeTranslate from './maxrocky/routeTranslate' import routeTranslate from './maxrocky/routeTranslate'
import BetterScroll from './maxrocky/betterScroll' import BetterScroll from './maxrocky/betterScroll'
Vue.use(CacheNavigation, {router}) Vue.use(CacheNavigation, { router })
Vue.use(scrollKeeper) Vue.use(scrollKeeper)
Vue.use(routeTranslate, {router, store}) Vue.use(routeTranslate, { router, store })
Vue.use(BetterScroll) Vue.use(BetterScroll)
window.$store = store; window.$store=Vue.$store = Vue.prototype.$store= store;
Vue.use(VueAwesomeSwiper) Vue.use(VueAwesomeSwiper)
Vue.use(VueClipboard) Vue.use(VueClipboard)
Vue.use(MintUI) Vue.use(MintUI)
...@@ -49,7 +49,7 @@ axios.interceptors.request.use(config => { ...@@ -49,7 +49,7 @@ axios.interceptors.request.use(config => {
function checkToken() { function checkToken() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE3MDIzMTQyLCJleHAiOjE1MTcwMzAzNDIsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.rhEE0XwPWhXU-bxDbEeZFmpGzs-jzbM5z9Zd0U7B6YN5mJpHDTRXkMmUvda5rDDxe8sTPw6yKkYvGYdvZeNenlZjsQDe_j1m6OxqrCGT9_3NqXQWS-26aY0vHdbjPINIltzmikJ8QmFWjl9-I-9onp7lOW9N-mB9lCc-Ff6jDMMpVtJGe-mgsE_Ywp57qzkB-TmipHq-gq6BtQ644WqwzJmSWszOrvX7FYxhpOscPTo9O4oYypym4Inc-71NQ-caxwtuTAAbRgR_-enfJ0BYwu0CogWJflew8qbrz2DjZeU6tvUAGoCHDj83aHRygCw3eZPx6jYTEOscfZLjNce_5g"); resolve("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE3MTEyNjkzLCJleHAiOjE1MTcxMTk4OTMsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.GFgTnVQnQp1TcycKZP9shxTOPh0k6uLyeQQs00AcqT7-UZ6NDJwGghwfLBhc-LSVMYIwzOuIbiNlwaCzJ2m7OrOiXVJ2PXdDjhfbFOlw7WvXQ1TV_cgLWzOqSGHAtrCQkXFm5Op5gGRsnbpmUOf4IzY2CfyLAhfP0UOmnYn7UgC9iBCNb67C43IAH_CUbLySYXxggNUKhuDGVT99wBdO8RcR6SypaP6e_Rxegb5fI_cR_FZYUQjlKB2dkUsjEN2bmg8ffYpI6s_bWNN06BYnswgMGfF2GRGPz1AJb7SHyqTBXKVaY3qd0eSmbCl3tEFZNEg9uIG74Mu6F47P_KKv2A");
}) })
} }
window.$axios = Vue.prototype.$axios = axios; window.$axios = Vue.prototype.$axios = axios;
...@@ -57,7 +57,6 @@ window.$axios = Vue.prototype.$axios = axios; ...@@ -57,7 +57,6 @@ window.$axios = Vue.prototype.$axios = axios;
window.$router = router.$router = router window.$router = router.$router = router
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({
...@@ -66,4 +65,4 @@ new Vue({ ...@@ -66,4 +65,4 @@ new Vue({
router, router,
template: '<App/>', template: '<App/>',
components: { App } components: { App }
}) })
\ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import fn from '@/assets/js/function.js' import fn from '@/assets/js/function.js'
// import $store from '@/store/modules/poolinApp.js'
Vue.use(Router) Vue.use(Router)
import Home from '@/components/Home' import Home from '@/components/Home'
...@@ -34,202 +33,194 @@ import NoticeShow from '@/components/Notice/detail' ...@@ -34,202 +33,194 @@ import NoticeShow from '@/components/Notice/detail'
const router = new Router({ const router = new Router({
routes: [{ routes: [{
path: '/', path: '/',
name: 'home', name: 'home',
component: Home, component: Home,
meta: { meta: {
title: 'Home.vue' title: 'Home.vue'
} }
}, { }, {
path: '/login', path: '/login',
name: 'login', name: 'login',
component: Login, component: Login,
meta: { meta: {
title: 'Login.vue' title: 'Login.vue'
} }
}, { }, {
path: '/reg', path: '/reg',
name: 'reg', name: 'reg',
component: Reg, component: Reg,
meta: { meta: {
title: 'Reg.vue' title: 'Reg.vue'
} }
}, { }, {
path: '/jump', path: '/jump',
name: 'jump', name: 'jump',
component: Jump, component: Jump,
meta: { meta: {
title: 'Jump.vue' title: 'Jump.vue'
} }
}, { }, {
path: '/create', path: '/create',
name: 'create', name: 'create',
component: Create, component: Create,
meta: { meta: {
title: 'Create.vue' title: 'Create.vue'
} }
}, { }, {
path: '/welcome', path: '/welcome',
name: 'welcome', name: 'welcome',
component: Welcome, component: Welcome,
meta: { meta: {
title: 'Welcome.vue' title: 'Welcome.vue'
} }
}, { }, {
path: '/subaccount', path: '/subaccount',
name: 'subaccount', name: 'subaccount',
component: Subaccount, component: Subaccount,
meta: { meta: {
title: 'Subaccount.vue' title: 'Subaccount.vue'
} }
}, { }, {
path: '/my/:puid/:coin_type', path: '/my/:puid/:coin_type',
name: 'no', name: 'no',
component: no, component: no,
meta: { meta: {
title: 'no.vue' title: 'no.vue'
} }
}, { }, {
path: '/my/:puid/:coin_type/:region_id/dashboard', path: '/my/:puid/:coin_type/:region_id/dashboard',
name: 'dashboard', name: 'dashboard',
component: Dashboard, component: Dashboard,
meta: { meta: {
title: 'Dashboard.vue' title: 'Dashboard.vue'
} }
}, { }, {
path: '/my/:puid/:coin_type/:region_id/miners', path: '/my/:puid/:coin_type/:region_id/miners',
name: 'miners', name: 'miners',
component: Miners, component: Miners,
meta: { meta: {
title: 'Miners.vue' title: 'Miners.vue'
} }
}, { }, {
path: '/my/:puid/:coin_type/:region_id/miners/:worker_id', path: '/my/:puid/:coin_type/:region_id/miners/:worker_id',
name: 'minershow', name: 'minershow',
component: MinerShow, component: MinerShow,
meta: { meta: {
title: 'MinerShow.vue' title: 'MinerShow.vue'
} }
}, { }, {
path: '/my/:puid/:coin_type/:region_id/payments', path: '/my/:puid/:coin_type/:region_id/payments',
name: 'payments', name: 'payments',
component: Payments, component: Payments,
meta: { meta: {
title: 'Payments.vue' title: 'Payments.vue'
} }
}, { }, {
path: '/settings', path: '/settings',
name: 'settings', name: 'settings',
component: Settings, component: Settings,
meta: { meta: {
title: 'Settings.vue' title: 'Settings.vue'
} }
}, { }, {
path: '/defaultCoin', path: '/defaultCoin',
name: 'defaultCoin', name: 'defaultCoin',
component: DefaultCoin, component: DefaultCoin,
meta: { meta: {
title: 'DefaultCoin.vue' title: 'DefaultCoin.vue'
} }
}, { }, {
path: '/language', path: '/language',
name: 'language', name: 'language',
component: Language, component: Language,
meta: { meta: {
title: 'Language.vue' title: 'Language.vue'
} }
}, { }, {
path: '/account', path: '/account',
name: 'account', name: 'account',
component: Account, component: Account,
meta: { meta: {
title: 'Account.vue' title: 'Account.vue'
} }
}, { }, {
path: '/notice', path: '/notice',
name: 'notice', name: 'notice',
component: Notice, component: Notice,
meta: { meta: {
title: 'Notice.vue' title: 'Notice.vue'
} }
}, { }, {
path: '/noticeList', path: '/noticeList',
name: 'noticeList', name: 'noticeList',
component: NoticeList, component: NoticeList,
meta: { meta: {
title: 'NoticeList.vue' title: 'NoticeList.vue'
} }
}, { }, {
path: '/noticeShow', path: '/noticeShow',
name: 'noticeShow', name: 'noticeShow',
component: NoticeShow, component: NoticeShow,
meta: { meta: {
title: 'NoticeShow.vue' title: 'NoticeShow.vue'
} }
}, }, ]
]
}) })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
//console.log(to)
var arr = ['home', 'jump']; var arr = ['home', 'jump'];
if (localStorage.getItem('enter_panel') == null) {
Vue.$store.commit('poolinApp/setEnterPannel', Vue.$store.state.poolinApp.enter_panel);
}
if (localStorage.getItem('puid') == null) {
Vue.$store.commit('poolinApp/setPuid', '');
} else {
Vue.$store.commit('poolinApp/setPuid', localStorage.getItem('puid'))
}
if (localStorage.getItem('enter_panel') == "true") {
Vue.$store.commit('poolinApp/setEnterPannel', true);
}
// if (localStorage.getItem('enter_panel') == null) { if (localStorage.getItem('language') == null) {
// $store.commit('poolinApp/setEnterPannel', $store.state.poolinApp.enter_panel); Vue.$store.commit('poolinApp/setLanguage', Vue.$store.state.poolinApp.language)
// } }
// next()
// if (localStorage.getItem('puid') == null) {
// $store.commit('poolinApp/setPuid', '');
// } else {
// if (to.params.puid) {
// $store.commit('poolinApp/setPuid', to.params.puid)
// }
// }
// if (localStorage.getItem('enter_panel') == "true") {
// $store.commit('poolinApp/setEnterPannel', true);
// }
// if (localStorage.getItem('language') == null) {
// $store.commit('poolinApp/setLanguage', $store.state.language)
// }
//最先执行的初始数据
// if ($store.state.cur_coins.length == 0) {
// $axios($store.state.base_url).then(res => {
// $store.commit('poolinApp/setInitUrl', res.data);
// $store.commit('poolinApp/setCurCoins', fn.getCoinsOnly(res.data));
// if (localStorage.getItem('coin_type') == null) { // 最先执行的初始数据
// $store.commit('poolinApp/setCoinType', $store.state.cur_coins[0]); if (Vue.$store.state.poolinApp.cur_coins.length == 0) {
// } else { $axios(Vue.$store.state.poolinApp.base_url).then(res => {
// if (to.params.coin_type) { Vue.$store.commit('poolinApp/setInitUrl', res.data);
// $store.commit('poolinApp/setCoinType', to.params.coin_type); Vue.$store.commit('poolinApp/setCurCoins', fn.getCoinsOnly(res.data));
// } else {
// $store.commit('poolinApp/setCoinType', localStorage.getItem('coin_type'));
// }
// }
// if (localStorage.getItem("region_id") == null) { if (localStorage.getItem('coin_type') == null) {
// $store.commit('poolinApp/setRegionId', res.data.regions[0].region_id); Vue.$store.commit('poolinApp/setCoinType', Vue.$store.state.poolinApp.cur_coins[0]);
// } else { } else {
// if (to.params.region_id) { if (to.params.coin_type) {
// $store.commit('poolinApp/setRegionId', to.params.region_id); Vue.$store.commit('poolinApp/setCoinType', to.params.coin_type);
// } else { } else {
// $store.commit('poolinApp/setRegionId', localStorage.getItem('region_id')); Vue.$store.commit('poolinApp/setCoinType', localStorage.getItem('coin_type'));
// } }
// } }
// modeSwitch(to, from, next)
// })
// } else {
// modeSwitch(to, from, next)
// }
if (localStorage.getItem("region_id") == null) {
Vue.$store.commit('poolinApp/setRegionId', res.data.regions[0].region_id);
} else {
if (to.params.region_id) {
Vue.$store.commit('poolinApp/setRegionId', to.params.region_id);
} else {
Vue.$store.commit('poolinApp/setRegionId', localStorage.getItem('region_id'));
}
}
modeSwitch(to, from, next)
})
} else {
modeSwitch(to, from, next)
}
}) })
// router.afterEach((to, from) => { router.afterEach((to, from) => {
// clearInterval(window.dingshiqi); clearInterval(window.dingshiqi);
// document.title = to.meta.title; document.title = to.meta.title;
// }) })
export default router export default router
...@@ -260,7 +251,7 @@ function modeSwitch(to, from, next) { ...@@ -260,7 +251,7 @@ function modeSwitch(to, from, next) {
} else { } else {
// alert("进入正常模式") // alert("进入正常模式")
localStorage.removeItem('read_token'); localStorage.removeItem('read_token');
$store.state.read_token = ''; Vue.$store.state.poolinApp.read_token = '';
next(); next();
// var arr = ['index', 'stats', 'callback', 'jump']; // var arr = ['index', 'stats', 'callback', 'jump'];
// if ($auth.isAuthenticated() || arr.indexOf(to.name) > -1) { // if ($auth.isAuthenticated() || arr.indexOf(to.name) > -1) {
......
import dictionaries from '@/assets/js/dictionaries.js'; //字典 import dictionaries from '@/assets/js/dictionaries.js'; //字典
export default { export default {
namespaced: true,
state: { state: {
refresh_time: 10000, //定时刷新 refresh_time: 60000, //定时刷新
// is_login: $auth.isAuthenticated(), //是否登录 // is_login: $auth.isAuthenticated(), //是否登录
init_url: {}, init_url: {},
cur_coins: [], cur_coins: [],
......
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