Commit d8e3227d by zhanghui1

大量修改

parent 62483aa9
<template> <template>
<div id="app" :class="gradeClass"> <div id="app" :class="gradeClass">
<transition :name="'vux-pop-' + (direction === '' ? '' : (direction === 'forward' ? 'in' : 'out'))"> <transition :name="'vux-pop-' + (direction === '' ? '' : (direction === 'forward' ? 'in' : 'out'))">
<mr-navigation> <!-- <mr-navigation>
<router-view></router-view>
</mr-navigation> </mr-navigation> -->
<router-view></router-view>
</transition> </transition>
</div> </div>
</template> </template>
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; background: #fff;font-family: "Roboto","Helvetica Neue",Helvetica,"Hiragino Sans GB",STHeitiSC-Light,"Microsoft YaHei","微软雅黑",Arial,sans-serif;width:100%;height:100%;} html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; background: #fff;font-family: "Roboto","Helvetica Neue",Helvetica,"Hiragino Sans GB",STHeitiSC-Light,"Microsoft YaHei","微软雅黑",Arial,sans-serif;width:100%;height:100%;}
.bg-blue {background: #ededf2;} .bg-blue {background: #ededf2;}
.bg-white { background: #fff;}
.line{.pos(r); .line{.pos(r);
&:after {width:100%; height:1px; background:#ccc;.pos(a); left: 0; right: 0; top:0; transform:scale(1,0.33) translateY(-1px);content:'';} &:after {width:100%; height:1px; background:#ccc;.pos(a); left: 0; right: 0; top:0; transform:scale(1,0.33) translateY(-1px);content:'';}
.xt{width:100%; height:1px; background:#ccc;.pos(a); left: 0; right: 0; top:0; transform:scale(1,0.33) translateY(-1px);content:'';} .xt{width:100%; height:1px; background:#ccc;.pos(a); left: 0; right: 0; top:0; transform:scale(1,0.33) translateY(-1px);content:'';}
...@@ -227,6 +228,7 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac ...@@ -227,6 +228,7 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac
.k {color: @gray;font-size: 0.24rem; } .k {color: @gray;font-size: 0.24rem; }
.v { color: #252525;font-size: 0.24rem;} .v { color: #252525;font-size: 0.24rem;}
.c-red {color: @red;} .c-red {color: @red;}
.c-green {color:@fontGreen;}
} }
.list { .list {
h3 { padding:0 0 .18rem .18rem; color: @gray; padding-top: 0.4rem;} h3 { padding:0 0 .18rem .18rem; color: @gray; padding-top: 0.4rem;}
...@@ -250,3 +252,22 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac ...@@ -250,3 +252,22 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac
} }
} }
.no {
.title {font-size: 0.3rem;}
.txt {font-size: 0.26rem; color:#727272;text-align: justify;
p {margin-top: 0.2rem; line-height: 1.5}
}
.tabs { border: 1px solid #eee;
.tab-tit {
li {.txt-ver(0.5rem);.tc; padding: 0 0.3rem;.fl; border-right:1px solid #eee;
&.active {background: @blue; color:#fff;}
}
}
.tab-con {border-top:1px solid #eee; padding:0.3rem;
li { padding: 0.1rem 0;
label { width: 1.5rem;.d-ib;}
input[type=text]{border: 1px solid #eee;background:#fff;padding:0.1rem;}
}
}
}
}
\ No newline at end of file
...@@ -42,16 +42,16 @@ export default { ...@@ -42,16 +42,16 @@ export default {
this.$store.state.tab_bar = n; this.$store.state.tab_bar = n;
switch (n) { switch (n) {
case 0: case 0:
this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/dashboard') this.$router.replace('/frameDashboard/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/dashboard')
break; break;
case 1: case 1:
this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/miners') this.$router.replace('/frameDashboard/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/miners')
break; break;
case 2: case 2:
this.$router.replace('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/payments') this.$router.replace('/frameDashboard/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/payments')
break; break;
case 3: case 3:
this.$router.replace('/settings') this.$router.replace('/frameDashboard/settings')
break; break;
} }
} }
......
<template>
<div class="page">
<router-view></router-view>
<tabbar></tabbar>
</div>
</template>
<script>
import tabbar from '@/components/common/Tabbar'
export default {
name: 'frameDashboard',
data() {
return {
}
},
components: {
tabbar
}
}
</script>
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ 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('setCoinType', cur_coin)
this.coin_type = cur_coin this.coin_type = cur_coin
} }
......
<template> <template>
<div class="page dashboard"> <div class="dashboard">
<div class="page-header" :class="hasZIndex==true?'zIndexAuto':''" flex="main:justify cross:center"> <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="side" @click="getSide"><i class="iconfont icon-mulu"></i></div>
<div class="title" @click="getRegion">{{account_name}} - {{cur_region['text_zh-cn']}}<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>
...@@ -78,7 +78,6 @@ ...@@ -78,7 +78,6 @@
</div> </div>
</div> </div>
</div> </div>
<tabbar></tabbar>
</div> </div>
</template> </template>
<script> <script>
...@@ -88,7 +87,6 @@ import region from "@/components/Dashboard/region"; ...@@ -88,7 +87,6 @@ import region from "@/components/Dashboard/region";
import subaccount from "@/components/Dashboard/subaccount"; import subaccount from "@/components/Dashboard/subaccount";
import animatedNum from "@/components/Common/AnimatedNum"; import animatedNum from "@/components/Common/AnimatedNum";
import dashboardChart from "@/components/Dashboard/dashboardChart.vue"; import dashboardChart from "@/components/Dashboard/dashboardChart.vue";
import tabbar from "@/components/Common/Tabbar.vue";
export default { export default {
name: "dashboard", name: "dashboard",
components: { components: {
...@@ -97,7 +95,6 @@ export default { ...@@ -97,7 +95,6 @@ export default {
subaccount, subaccount,
animatedNum, animatedNum,
dashboardChart, dashboardChart,
tabbar
}, },
data() { data() {
return { return {
...@@ -152,7 +149,8 @@ export default { ...@@ -152,7 +149,8 @@ export default {
fn.getApiBaseUrl(this.region_id, this.coin_type).then(api => { fn.getApiBaseUrl(this.region_id, this.coin_type).then(api => {
if (api == '') { if (api == '') {
//自动到无节点页面 //自动到无节点页面
this.$router.replace('/my/' + this.puid + '/' + this.coin_type) console.log("dashboard/index.vue没有找到apiBaseUrl,所以跳到no.vue")
this.$router.replace('/frameDashboard/' + this.puid + '/' + this.coin_type)
} else { } else {
//请求实时算力 //请求实时算力
fn.getWorkerStats(api, this.puid).then(res => { fn.getWorkerStats(api, this.puid).then(res => {
...@@ -169,7 +167,7 @@ export default { ...@@ -169,7 +167,7 @@ export default {
} else { } else {
this.$message.error("请求支付状态错误!") this.$message.error("请求支付状态错误!")
} }
this.loading = false; this.$indicator.close();
}); });
} }
}) })
......
<template> <template>
<div class="page dashboard"> <div class="dashboard bg-blue no">
<div class="page-header" :class="hasZIndex==true?'zIndexAuto':''" flex="main:justify cross:center"> <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="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="title" @click="getRegion">{{account_name}} - {{region_name}}<i class="iconfont icon-down"></i></div>
...@@ -18,11 +18,62 @@ ...@@ -18,11 +18,62 @@
<mt-popup v-model="showSide" position="left" class="left show-left"> <mt-popup v-model="showSide" position="left" class="left show-left">
<subaccount v-on:childSubAccount="fromSubAccount"></subaccount> <subaccount v-on:childSubAccount="fromSubAccount"></subaccount>
</mt-popup> </mt-popup>
<div> <div class="block-list bg-white">
无节点,无算力页 <div class="cell" flex="box:mean">
<div flex="main:center dir:top box:center cross:center">
<p>
<span class="v">0.00</span>
<span class="k">TH/s</span>
</p>
<h3 class="title f24gray">实时算力</h3>
<p class="small-k-v mt20">
<span class="k">24小时算力:</span><span class="v">0.00 TH/s</span>
</p>
</div>
<div flex="main:center dir:top box:center cross:center">
<p><span class="v c-green">0</span></p>
<h3 class="title f24gray">矿机</h3>
<p class="small-k-v mt20"><span class="k">总数:</span><span class="v c-green">0</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">不活跃:</span><span class="v c-red">0</span></p>
</div>
</div>
</div>
<div class="mt20 p30 bg-white">
<h2 class="title">您需要添加矿机到矿池,然后开始挖矿</h2>
<div class="txt">
<p>连接矿机所在的局域网,登录矿机后台,填写您的子账户(密码建议留空),保存即可,矿机将在一分钟内自动添加到矿池网站页面。</p>
<p>矿机名规则为:子账户+英文句号+编号,例如,您的子账户是{{account_name}}, 可以设置矿机名为{{account_name}}.001、{{account_name}}.002,以此类推,一个矿机名对应一台矿机。</p>
</div>
</div>
<div class="line"><span class="xt"></span></div>
<div class="p30 bg-white">
<h2 class="title">矿机配置示例</h2>
<div class="tabs mt40">
<ul class="tab-tit f-cb">
<li v-for="(demo,idx) in demoData" :key="demo.region_id" @click="demoIdx=idx" :class="demoIdx==idx?'active':''">{{demo["text_zh-cn"]}}</li>
</ul>
<div class="tab-con">
<form action="#" onsubmit="return false;">
<ul>
<li v-for="(stratum_url,urlIdx) in demoData[demoIdx].coin_info.stratum_url" :key="stratum_url.url">
<label for="">url{{urlIdx+1}}</label>
<input type="text" :value="stratum_url.url" :model="message[urlIdx]=stratum_url.url" class="eq-font" disabled="" />
<el-button type="primary" v-clipboard:copy="message[urlIdx]" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
</li>
<li>
<label for="">worker</label>
<input type="text" :value="account_name+'.001'" class="eq-font" disabled="" />
</li>
<li>
<label for="">password</label>
<input type="text" value="123" class="eq-font" disabled="" />
<span style="color: #999;">建议不填</span>
</li>
</ul>
</form>
</div>
</div>
</div> </div>
</div> </div>
<tabbar></tabbar>
</div> </div>
</template> </template>
<script> <script>
...@@ -30,14 +81,12 @@ import fn from "@/utils/function.js"; ...@@ -30,14 +81,12 @@ import fn from "@/utils/function.js";
import coin from "@/components/Dashboard/coin"; import coin from "@/components/Dashboard/coin";
import region from "@/components/Dashboard/region"; import region from "@/components/Dashboard/region";
import subaccount from "@/components/Dashboard/subaccount"; import subaccount from "@/components/Dashboard/subaccount";
import tabbar from "@/components/Common/Tabbar.vue";
export default { export default {
name: "no", name: "no",
components: { components: {
coin, coin,
region, region,
subaccount, subaccount,
tabbar
}, },
data() { data() {
return { return {
...@@ -61,6 +110,8 @@ export default { ...@@ -61,6 +110,8 @@ export default {
region_name: '', //中英文切换对应的text_en/text_zh-cn region_name: '', //中英文切换对应的text_en/text_zh-cn
account_name: '', //当前帐户对应的名字 account_name: '', //当前帐户对应的名字
message: [],
demoIdx: 0,
demoData: [{ demoData: [{
region_id: '', region_id: '',
text_en: "", text_en: "",
...@@ -113,6 +164,7 @@ export default { ...@@ -113,6 +164,7 @@ export default {
//获取支持当前币种的节点信息和当前币种信息 //获取支持当前币种的节点信息和当前币种信息
fn.getStratumUrls(this.coin_type).then(res => { fn.getStratumUrls(this.coin_type).then(res => {
self.demoData = res; self.demoData = res;
this.$indicator.close()
}); });
}, },
getSide() { getSide() {
...@@ -160,7 +212,12 @@ export default { ...@@ -160,7 +212,12 @@ export default {
name: 'dashboard' name: 'dashboard'
}) })
}, },
onCopy: function(e) {
this.$message.alert('已经复制: ' + e.text, '友情提示')
},
onError: function(e) {
this.$message.alert('复制失败!', '友情提示')
}
}, },
watch: { watch: {
'$route' (to, from) { '$route' (to, from) {
......
...@@ -3,20 +3,20 @@ ...@@ -3,20 +3,20 @@
<h3>这个需要根据情况判断跳转到下面可能的页面</h3> <h3>这个需要根据情况判断跳转到下面可能的页面</h3>
<ul> <ul>
<li> <li>
<router-link to="/create">1.跳转到新建子账户页</router-link> <!-- <router-link to="/create">1.跳转到新建子账户页</router-link> -->
</li> </li>
<!-- <li> <!-- <li>
<router-link to="/subaccount">2.跳转到账户列表</router-link> <router-link to="/subaccount">2.跳转到账户列表</router-link>
</li> --> </li> -->
<li> <li>
<router-link to="/welcome">2.跳转到欢迎页,即列表页精简版</router-link> <!-- <router-link to="/welcome">2.跳转到欢迎页,即列表页精简版</router-link> -->
</li> </li>
<li @click="goDashboard" style="cursor:pointer">3.跳转到子账户面板</li> <li @click="goDashboard" style="cursor:pointer">3.跳转到子账户面板</li>
<li> <li>
<router-link to="/my/7/ltc/shenzhen/dashboard">4.跳入用户面板页面</router-link> <!-- <router-link to="/my/7/ltc/shenzhen/dashboard">4.跳入用户面板页面</router-link> -->
</li> </li>
<li> <li>
<router-link to="/settings">设置页</router-link> <!-- <router-link to="/settings">设置页</router-link> -->
</li> </li>
</ul> </ul>
</div> </div>
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
}, },
methods: { methods: {
goDashboard() { goDashboard() {
this.$router.replace("/my/7/" + this.coin_type + "/" + this.region_id + "/dashboard") this.$router.replace("/frameDashboard/"+this.puid+'/'+this.coin_type+'/'+this.region_id+'/dashboard')
} }
} }
} }
......
<template> <template>
<div class="page miners"> <div class="miners">
<div class="page-header" flex="main:justify cross:center"> <div class="page-header" flex="main:justify cross:center">
<div class="edit"><i class="iconfont icon-fanhui"></i></div> <div class="edit"><i class="iconfont icon-fanhui"></i></div>
<div class="title" @click="getGroup">{{messageGroup}}</div> <div class="title" @click="getGroup">{{messageGroup}}</div>
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
<!-- 添加刷新加载位置 --> <!-- 添加刷新加载位置 -->
</div> </div>
</div> </div>
<!-- page-content end -->
<tabbar></tabbar>
</div> </div>
<!-- page end --> <!-- page end -->
</template> </template>
...@@ -59,13 +57,11 @@ ...@@ -59,13 +57,11 @@
import fn from '@/utils/function.js'; import fn from '@/utils/function.js';
import sort from "@/components/Miners/sort"; import sort from "@/components/Miners/sort";
import group from "@/components/Miners/group"; import group from "@/components/Miners/group";
import tabbar from "@/components/Common/Tabbar.vue";
export default { export default {
name: 'miners', name: 'miners',
components: { components: {
sort, sort,
group, group,
tabbar
}, },
data() { data() {
return { return {
...@@ -192,7 +188,7 @@ export default { ...@@ -192,7 +188,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.$indicator.close();
}, },
methods: { methods: {
goMinerShow() { goMinerShow() {
......
<template> <template>
<div class="page payments"> <div class="payments">
<div class="page-header" flex="main:justify cross:center"> <div class="page-header" flex="main:justify cross:center">
<div class="title">收益</div> <div class="title">收益</div>
</div> </div>
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="balance-list p30" flex="dir:left box:mean"> <div class="balance-list p30" flex="dir:left box:mean">
<div> <div>
<i class="iconfont icon-keyongyue"></i>余额 <i class="iconfont icon-keyongyue"></i>余额
...@@ -39,22 +38,16 @@ ...@@ -39,22 +38,16 @@
<s>{{item.balance}}</s> <s>{{item.balance}}</s>
</div> </div>
</div> </div>
</div> </div>
<!-- page-content end -->
<tabbar></tabbar>
</div> </div>
<!-- page end --> <!-- page end -->
</template> </template>
<script> <script>
import fn from '@/utils/function.js'; import fn from '@/utils/function.js';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import tabbar from "@/components/Common/Tabbar.vue";
export default { export default {
name: 'payments', name: 'payments',
components: { components: {},
tabbar
},
data() { data() {
return { return {
yesterday: { yesterday: {
...@@ -97,7 +90,7 @@ export default { ...@@ -97,7 +90,7 @@ export default {
num: '2.79003919', num: '2.79003919',
unit: 'lct', unit: 'lct',
balance: '存入余额' balance: '存入余额'
},{ }, {
time: '2017-10-27', time: '2017-10-27',
module: 'PPS模式', module: 'PPS模式',
num: '3.79003919', num: '3.79003919',
...@@ -125,10 +118,9 @@ export default { ...@@ -125,10 +118,9 @@ export default {
} }
}, },
mounted() { mounted() {
this.$indicator.close();
}, },
methods: {} methods: {}
} }
</script> </script>
...@@ -5,34 +5,56 @@ ...@@ -5,34 +5,56 @@
<div class="title">子账户选择</div> <div class="title">子账户选择</div>
</div> </div>
<div class="page-content"> <div class="page-content">
<h2>请选择子账户</h2> <h2>请选择子账户</h2>
<ul class="list-coin active"> <ul class="list-coin active">
<li v-for="cur_coin in $store.state['cur_coins']" :key="cur_coin" flex="dir:left box:last"> <li v-for="subaccount in subaccountList" :key="subaccount.puid" flex="dir:left box:last" @click="handleChild(subaccount)">
<span>kuangchang</span> <span>{{subaccount.name}}</span>
<span> <span><b :class="subaccount['default_coin_type']">{{subaccount['default_coin_type']|uppercase}}</b><i class="iconfont icon-jiantou"></i></span>
<b :class="cur_coin">{{cur_coin|uppercase}}</b> </li>
<i class="iconfont icon-jiantou"></i> </ul>
</span>
</li>
</ul>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import fn from '@/utils/function'
export default { export default {
name: 'account', name: 'account',
data() { data() {
return { return {
subaccountList: [],
}
},
computed: {
puid() {
return this.$store.state.puid || localStorage.getItem('puid');
},
coin_type() {
return this.$store.state.coin_type || localStorage.getItem('coin_type');
},
region_id() {
return this.$store.state.region_id || localStorage.getItem('region_id');
} }
}, },
mounted() { mounted() {
this.getSubAccount()
}, },
methods: { methods: {
goBack() { goBack() {
this.$router.go(-1) this.$router.go(-1)
},
getSubAccount() {
fn.getSubAccount().then(res => {
if (res.data.err_no == 0) {
this.subaccountList = res.data.data
} else {
alert("接口错误!")
}
})
},
handleChild(account){
this.$store.commit('setPuid',account.puid);
this.$store.commit('setCoinType',account.default_coin_type)
this.goBack();
} }
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</div> </div>
<div class="page-content"> <div class="page-content">
<el-form :model="createForm" :rules="createRules" ref="createForm"> <el-form :model="createForm" :rules="createRules" ref="createForm">
<label for="">选择此子账户优先显示的币种</label> <label for="">选择此子账户优先显示的币种</label>
<el-form-item prop="defaultCoin"> <el-form-item prop="defaultCoin">
<div class="coin-area f-cb"> <div class="coin-area f-cb">
<label class="btn-coin" :class="createForm.defaultCoin==cur_coin?'active':''" v-for="cur_coin in $store.state['cur_coins']" :key="cur_coin"><b :class="cur_coin">{{cur_coin|uppercase}}</b> <label class="btn-coin" :class="createForm.defaultCoin==cur_coin?'active':''" v-for="cur_coin in $store.state['cur_coins']" :key="cur_coin"><b :class="cur_coin">{{cur_coin|uppercase}}</b>
...@@ -16,11 +16,10 @@ ...@@ -16,11 +16,10 @@
</el-form-item> </el-form-item>
<div class="descript">当切换到该子账户时,将默认显示该币种</div> <div class="descript">当切换到该子账户时,将默认显示该币种</div>
<div class='btn-group full pl30 pr30 mt50'> <div class='btn-group full pl30 pr30 mt50'>
<el-button type="primary" round @click="submitForm('createForm')" :disabled="!showBtn">确定</el-button> <el-button type="primary" round @click="submitForm('createForm')" :disabled="!showBtn">确定</el-button>
</div> </div>
</el-form> </el-form>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
...@@ -39,6 +38,15 @@ export default { ...@@ -39,6 +38,15 @@ export default {
computed: { computed: {
showBtn: function() { showBtn: function() {
return this.createForm.defaultCoin; return this.createForm.defaultCoin;
},
puid() {
return this.$store.state.puid || localStorage.getItem('puid');
},
coin_type() {
return this.$store.state.coin_type || localStorage.getItem('coin_type');
},
region_id() {
return this.$store.state.region_id || localStorage.getItem('region_id');
} }
}, },
mounted() {}, mounted() {},
...@@ -47,15 +55,27 @@ export default { ...@@ -47,15 +55,27 @@ export default {
this.$router.go(-1); this.$router.go(-1);
}, },
submitForm(formName) { submitForm(formName) {
this.$indicator.open({ spinnerType: 'fading-circle' })
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
if (valid) { if (valid) {
this.$messagebox.alert("提交成功!", "温馨提示"); this.updateDefaultCoin()
} else { } else {
this.$messagebox.alert("提交错误!", "温馨提示"); this.$messagebox.alert("提交错误!", "温馨提示");
return false; return false;
} }
}); });
} },
updateDefaultCoin() {
this.$store.commit('setCoinType', this.createForm.defaultCoin)
this.$axios.post(this.$store.state.common_url + '/subaccount/' + this.puid + '/update-default-coin', {
coin_type: this.createForm.defaultCoin
})
.then(res => {
// this.$messagebox.alert("默认币种更新成功!", "友情提示");
this.goBack();
this.$indicator.close();
})
},
} }
} }
......
<template> <template>
<div class="page settings"> <div class="settings">
<div class="page-header" flex="main:justify cross:center"> <div class="page-header" flex="main:justify cross:center">
<div class="title">设置页面</div> <div class="title">设置页面</div>
</div> </div>
<div class="page-content bottom"> <div class="page-content bottom bg-blue">
<div class="setting-content"> <div class="setting-content">
<div class="settings-group current-subaccount"> <div class="settings-group current-subaccount">
<mt-cell title="当前子账户" is-link to="/account"> <mt-cell title="当前子账户" is-link to="/account">
<span class="fore-link-text">zhiyuan</span> <span class="fore-link-text">{{account_name}}</span>
<b class="ltc fore-link-img"/> <b class="fore-link-img" :class="account_default_coin_type" />
</mt-cell> </mt-cell>
</div> </div>
<div class="mt40 settings-group subaccount-settings"> <div class="mt40 settings-group subaccount-settings">
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<mt-cell title="LTC收益地址" is-link></mt-cell> <mt-cell title="LTC收益地址" is-link></mt-cell>
<mt-cell title="DOGE补贴地址" is-link></mt-cell> <mt-cell title="DOGE补贴地址" is-link></mt-cell>
<mt-cell title="默认币种设置" is-link to="/defaultCoin"> <mt-cell title="默认币种设置" is-link to="/defaultCoin">
<b class="ltc fore-link-img"/> <b class="fore-link-img" :class="coin_type" />
</mt-cell> </mt-cell>
</div> </div>
<div class="mt40 settings-group notice-content"> <div class="mt40 settings-group notice-content">
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
<mt-cell title="同类内容报警间隔" is-link> <mt-cell title="同类内容报警间隔" is-link>
<span class="fore-link-text">3小时</span> <span class="fore-link-text">3小时</span>
</mt-cell> </mt-cell>
</div> </div>
<div class="mt40 settings-group alarm-contact"> <div class="mt40 settings-group alarm-contact">
<mt-cell title="报警联系人" is-link></mt-cell> <mt-cell title="报警联系人" is-link></mt-cell>
...@@ -45,84 +44,142 @@ ...@@ -45,84 +44,142 @@
<mt-cell title="矿机设置" is-link> <mt-cell title="矿机设置" is-link>
<span class="fore-link-text">矿工必看</span> <span class="fore-link-text">矿工必看</span>
</mt-cell> </mt-cell>
<mt-cell title="语言设置" is-link to="/language"> <mt-cell title="语言设置" is-link to="/language">
<span class="language-img zh-cn"></span> <span class="language-img zh-cn"></span>
</mt-cell> </mt-cell>
</div> </div>
</div> </div>
</div> </div>
<!-- page-content end -->
<tabbar></tabbar>
</div> </div>
<!-- page end -->
</template> </template>
<script> <script>
import tabbar from "@/components/Common/Tabbar.vue"; import fn from '@/utils/function'
export default { export default {
name: 'settings', name: 'settings',
components: { components: {},
tabbar
},
data() { data() {
return { return {
account_name: '',
account_default_coin_type: '',
}
},
computed: {
puid() {
return this.$store.state.puid || localStorage.getItem('puid');
},
coin_type() {
return this.$store.state.coin_type || localStorage.getItem('coin_type');
},
region_id() {
return this.$store.state.region_id || localStorage.getItem('region_id');
} }
}, },
mounted() { mounted() {
this.$indicator.close();
this.pageInit();
}, },
methods: { methods: {
pageInit() {
//获取当前用户信息
fn.getSubAccountById(this.puid).then(res => {
if (res.data.err_no == 0) {
console.log(res.data.data)
this.account_name = res.data.data.name;
this.account_default_coin_type = res.data.data.default_coin_type;
}
})
},
},
watch:{
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
.settings{ .settings {
background: #ededf2; background: #ededf2;
.page-content{ .page-content {
&.bottom{bottom:1rem;} &.bottom {
.setting-content{ bottom: 1rem;
}
.setting-content {
padding-top: 0.28rem; padding-top: 0.28rem;
.current-subaccount{ .current-subaccount {
.fore-link-img{ .fore-link-img {
margin-right: 0.1rem; margin-right: 0.1rem;
} }
} }
.settings-group{ .settings-group {
.line(){ .line() {
&.xb{left: 0; right: 0;height: 1px;width: 100%; background: #ccc;content: '';position: absolute;bottom:0;transform: scaleY(0.33) translateY(1px);} &.xb {
left: 0;
right: 0;
height: 1px;
width: 100%;
background: #ccc;
content: '';
position: absolute;
bottom: 0;
transform: scaleY(0.33) translateY(1px);
}
} }
box-sizing: border-box; box-sizing: border-box;
width: 7.5rem; width: 7.5rem;
.settings-title{ .settings-title {
font-size: 0.28rem; font-size: 0.28rem;
color: #727272; color: #727272;
line-height: 0.28rem; line-height: 0.28rem;
box-sizing: border-box; box-sizing: border-box;
padding:0 0 0.18rem 0.18rem; padding: 0 0 0.18rem 0.18rem;
} }
.mint-cell{ .mint-cell {
font-size: 0.32rem; font-size: 0.32rem;
color: #252525; color: #252525;
overflow: visible; overflow: visible;
.mint-cell-wrapper{ .mint-cell-wrapper {
background-image: none; background-image: none;
} }
.fore-link-text{ .fore-link-text {
font-size: 0.28rem; font-size: 0.28rem;
color: #959595; color: #959595;
} }
.fore-link-img {display: block;width: 0.41rem;height: 0.41rem;vertical-align:middle;padding:0 0.3rem 0 0;background-size:0.41rem 0.41rem; background-repeat: no-repeat; background-position: 0.3rem center; color: #999;} .fore-link-img {
.ltc {background-image:url(../../assets/img/index-tab1-active.png);} display: block;
.eth {background-image:url(../../assets/img/index-tab2-active.png);} width: 0.41rem;
.dash {background-image:url(../../assets/img/index-tab3-active.png);} height: 0.41rem;
.xmr {background-image:url(../../assets/img/index-tab4-active.png);} vertical-align: middle;
.btc {background-image:url(../../assets/img/index-tab5-active.png);} padding: 0 0.3rem 0 0;
.sc {background-image:url(../../assets/img/index-tab6-active.png);} background-size: 0.41rem 0.41rem;
.zcash {background-image:url(../../assets/img/index-tab7-active.png);} background-repeat: no-repeat;
.doge {background-image:url(../../assets/img/index-tab8-active.png);} background-position: 0.3rem center;
.notice-badge{ color: #999;
}
.ltc {
background-image: url(../../assets/img/index-tab1-active.png);
}
.eth {
background-image: url(../../assets/img/index-tab2-active.png);
}
.dash {
background-image: url(../../assets/img/index-tab3-active.png);
}
.xmr {
background-image: url(../../assets/img/index-tab4-active.png);
}
.btc {
background-image: url(../../assets/img/index-tab5-active.png);
}
.sc {
background-image: url(../../assets/img/index-tab6-active.png);
}
.zcash {
background-image: url(../../assets/img/index-tab7-active.png);
}
.doge {
background-image: url(../../assets/img/index-tab8-active.png);
}
.notice-badge {
display: inline-block; display: inline-block;
width: 0.41rem; width: 0.41rem;
height: 0.41rem; height: 0.41rem;
...@@ -132,20 +189,32 @@ export default { ...@@ -132,20 +189,32 @@ export default {
border-radius: 50%; border-radius: 50%;
color: #fff; color: #fff;
} }
.fore-link-lang{ .fore-link-lang {
width: 0.48rem; width: 0.48rem;
height: 0.32rem; height: 0.32rem;
} }
.language-img{ .language-img {
display:inline-block;vertical-align:middle;padding:0rem;background-size:0.48rem 0.32rem; background-repeat: no-repeat; background-position: 0rem center; display: inline-block;
width: 0.48rem;height: 0.32rem; vertical-align: middle;
&.zh-cn {background-image:url(../../assets/img/cn.png);} padding: 0rem;
&.en {background-image:url(../../assets/img/en.png);} background-size: 0.48rem 0.32rem;
background-repeat: no-repeat;
background-position: 0rem center;
width: 0.48rem;
height: 0.32rem;
&.zh-cn {
background-image: url(../../assets/img/cn.png);
}
&.en {
background-image: url(../../assets/img/en.png);
}
margin-top: -0.02rem; margin-top: -0.02rem;
} }
&:after{.line.xb;} &:after {
.line.xb;
}
} }
.mint-cell:last-child{ .mint-cell:last-child {
background-image: none; background-image: none;
} }
} }
......
...@@ -144,10 +144,12 @@ export default { ...@@ -144,10 +144,12 @@ export default {
} }
}, },
created() { created() {
this.pageInitInterval() this.pageInitInterval()
}, },
methods: { methods: {
pageInitInterval() { pageInitInterval() {
this.$indicator.open({ spinnerType: 'fading-circle' })
let self = this; let self = this;
clearInterval(window.dingshiqi) clearInterval(window.dingshiqi)
self.pageInit(); self.pageInit();
...@@ -169,6 +171,7 @@ export default { ...@@ -169,6 +171,7 @@ export default {
}) })
fn.getShareHistory(72, "1h", self.params_coin).then(res => { fn.getShareHistory(72, "1h", self.params_coin).then(res => {
this.$indicator.close();
let hour; let hour;
self.shareHistoryTime = []; self.shareHistoryTime = [];
self.shareHistoryYes = []; self.shareHistoryYes = [];
......
...@@ -48,7 +48,7 @@ axios.interceptors.request.use(config => { ...@@ -48,7 +48,7 @@ axios.interceptors.request.use(config => {
function checkToken() { function checkToken() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE3MjE5NjA2LCJleHAiOjE1MTcyMjY4MDYsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.eci--2LVo2qszdu8o9Enh561WEb-dLygsFFeX5_mvnfeVw8qxiLaNVkyWBHzyYYHLZk2WhRE1PQZ9dtslMwb3Dq6svXhfJhUi4jJizZa4qgNM1ceEGy-IsqexPdg1tIQvXAmg1GDRpt9vyFHRY1C5VYobg_v2LXyoF0RDmMeGAyJQD4ZP2sw0T10uts2dcfG24zlrLfzsbLH04mitYD2Zlj066XPAChIaeUR-fVZxx0bfHHDWAsZurPlkw5SeSRO6oxroPQ07oDN_NXQcfpJevn1gjfMOkLmOma978Aj0axqfqUZAHIzbPF27guUPx15Px9BncEaGCRCYYo_xvXrgA'); resolve('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDVhMzM4MWE2ZjczMzNjNjdkMzMxOWZiYyIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE3MzAwNDc1LCJleHAiOjE1MTczMDc2NzUsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.Fph_SmGioigITf6VN_VXgDfKi_I-7HhpuEaQCIVnUZPzDkAgygsv7QrEAM7CCFnLtCgdTThceLC-oIIr9xMqDHswLQOVpkBIb19ifq8MYbR0n3ivvZDFmWfxaJfqlTudmLxPvLLgHbsrkl5B-qDwcq61cPkYxq7gNY2H2lgCHljp3C8AJpaRkKcqGBdjNO3C3aYepQKAlXWZCBvvi-PIdhI6l2-glS1kqxYafR9tRV_SYRvB__ZudFnCtYbrcOWEEOdqcRz3ZwhCn7cAs3ucpexvKjtHGR80NdtWt-hNVp-vb8figL3LkkebSoFF_tC9KBHoWLLvIP_WRFZl3XzYLA');
}) })
} }
......
...@@ -57,51 +57,60 @@ const router = new Router({ ...@@ -57,51 +57,60 @@ const router = new Router({
meta: { meta: {
title: 'Subaccount.vue' 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: resolve => require(['@/components/Dashboard'], resolve),
meta: {
title: 'Dashboard.vue'
}
}, },
{ {
path: '/my/:puid/:coin_type/:region_id/miners', path: '/frameDashboard',
name: 'miners', name: 'frameDashboard',
component: resolve => require(['@/components/Miners/'], resolve), component: resolve => require(['@/components/Common/frameDashboard.vue'], resolve),
meta: { // redirect: 'my/:puid/:coin_type/:region_id/dashboard',
title: 'Miners.vue' children: [{
} path: ':puid/:coin_type/:region_id/dashboard',
}, { name: 'dashboard',
path: '/my/:puid/:coin_type/:region_id/miners/:worker_id', component: resolve => require(['@/components/Dashboard'], resolve),
name: 'minershow', meta: {
component: resolve => require(['@/components/Miners/detail.vue'], resolve), title: 'Dashboard.vue'
meta: { }
title: 'MinerShow.vue' },{
} path: ':puid/:coin_type',
}, { name: 'no',
path: '/my/:puid/:coin_type/:region_id/payments', component: resolve => require(['@/components/Dashboard/no.vue'], resolve),
name: 'payments', meta: {
component: resolve => require(['@/components/Payments'], resolve), title: 'no.vue'
meta: { }
title: 'Payments.vue' },
} {
path: ':puid/:coin_type/:region_id/miners',
name: 'miners',
component: resolve => require(['@/components/Miners/'], resolve),
meta: {
title: 'Miners.vue'
}
}, {
path: ':puid/:coin_type/:region_id/miners/:worker_id',
name: 'minershow',
component: resolve => require(['@/components/Miners/detail.vue'], resolve),
meta: {
title: 'MinerShow.vue'
}
}, {
path: ':puid/:coin_type/:region_id/payments',
name: 'payments',
component: resolve => require(['@/components/Payments'], resolve),
meta: {
title: 'Payments.vue'
}
},
{
path: 'settings',
name: 'settings',
component: resolve => require(['@/components/Settings/index.vue'], resolve),
meta: {
title: 'Settings.vue'
}
}
]
}, },
{ {
path: '/settings',
name: 'settings',
component: resolve => require(['@/components/Settings/index.vue'], resolve),
meta: {
title: 'Settings.vue'
}
}, {
path: '/defaultCoin', path: '/defaultCoin',
name: 'defaultCoin', name: 'defaultCoin',
component: resolve => require(['@/components/Settings/DefaultCoin'], resolve), component: resolve => require(['@/components/Settings/DefaultCoin'], resolve),
...@@ -148,6 +157,7 @@ const router = new Router({ ...@@ -148,6 +157,7 @@ const router = new Router({
}) })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// Vue.$indicator.open({ spinnerType: 'fading-circle' })
var arr = ['home', 'jump']; var arr = ['home', 'jump'];
if (localStorage.getItem('enter_panel') == null) { if (localStorage.getItem('enter_panel') == null) {
$store.commit('setEnterPannel', $store.state.enter_panel); $store.commit('setEnterPannel', $store.state.enter_panel);
......
...@@ -2,44 +2,44 @@ import Vue from 'vue' ...@@ -2,44 +2,44 @@ import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import $axios from 'axios' import $axios from 'axios'
Vue.filter('date422', function (value) { Vue.filter('date422', function(value) {
if (!value) { return '' } if (!value) { return '' }
value = value.toString() value = value.toString()
return value.slice(0, 4) + '-' + value.slice(4, 6) + '-' + value.slice(6, 8); return value.slice(0, 4) + '-' + value.slice(4, 6) + '-' + value.slice(6, 8);
}) })
Vue.filter('uppercase', function (value) { Vue.filter('uppercase', function(value) {
if (!value) { return '' } if (!value) { return '' }
value = value.toString() value = value.toString()
return value.toUpperCase(); return value.toUpperCase();
}) })
Vue.filter('lowercase', function (value) { Vue.filter('lowercase', function(value) {
if (!value) { return '' } if (!value) { return '' }
value = value.toString() value = value.toString()
return value.toLowerCase(); return value.toLowerCase();
}) })
Vue.filter('formatPercent', function (value) { Vue.filter('formatPercent', function(value) {
if (value == 0) { if (value == 0) {
return '--' return '--'
}; };
return (value * 100).toFixed(2) + "%" return (value * 100).toFixed(2) + "%"
}) })
Vue.filter('formatPercent2', function (value) { Vue.filter('formatPercent2', function(value) {
return (value * 100).toFixed(2) + "%" return (value * 100).toFixed(2) + "%"
}) })
Vue.filter('formatStar', function (str) { Vue.filter('formatStar', function(str) {
return str.slice(0, 3) + "******" + str.slice(str.length - 3, str.length); return str.slice(0, 3) + "******" + str.slice(str.length - 3, str.length);
}) })
Vue.filter('formatDate', function (time) { Vue.filter('formatDate', function(time) {
var date = new Date(time * 1000); var date = new Date(time * 1000);
return formatDate(date, "yyyy-MM-dd hh:mm"); return formatDate(date, "yyyy-MM-dd hh:mm");
}) })
Vue.filter('formatDate2', function (time) { Vue.filter('formatDate2', function(time) {
if (!time) return ''; if (!time) return '';
var date = parseInt((new Date().getTime()) / 1000 - time); var date = parseInt((new Date().getTime()) / 1000 - time);
if (localStorage.getItem('language') == 'zh-cn') { if (localStorage.getItem('language') == 'zh-cn') {
...@@ -78,7 +78,7 @@ Vue.filter('formatDate2', function (time) { ...@@ -78,7 +78,7 @@ Vue.filter('formatDate2', function (time) {
} }
}) })
Vue.filter('formatDate3', function (time) { Vue.filter('formatDate3', function(time) {
var date = new Date(time * 1000); var date = new Date(time * 1000);
return formatDate(date, "yyyy-MM-dd hh:mm:ss"); return formatDate(date, "yyyy-MM-dd hh:mm:ss");
}) })
...@@ -187,17 +187,18 @@ export default { ...@@ -187,17 +187,18 @@ export default {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
getSubAccountById(puid) { getSubAccountById(puid) {
return new Promise(function (relsove, reject) { // return new Promise(function (relsove, reject) {
if (!Vue.$store.state.SubAccount) Vue.$store.state.SubAccount = {}; // if (!Vue.$store.state.SubAccount) Vue.$store.state.SubAccount = {};
if (Vue.$store.state.SubAccount['SubAccount' + puid]) { // if (Vue.$store.state.SubAccount['SubAccount' + puid]) {
relsove(Vue.$store.state.SubAccount['SubAccount' + puid]) // relsove(Vue.$store.state.SubAccount['SubAccount' + puid])
} else { // } else {
$axios(Vue.$store.state.common_url + "/subaccount/" + puid).then(function (res) { // $axios(Vue.$store.state.common_url + "/subaccount/" + puid).then(function (res) {
Vue.$store.state.SubAccount['SubAccount' + puid] = res; // Vue.$store.state.SubAccount['SubAccount' + puid] = res;
relsove(Vue.$store.state.SubAccount['SubAccount' + puid]) // relsove(Vue.$store.state.SubAccount['SubAccount' + puid])
}) // })
} // }
}) // })
return $axios(Vue.$store.state.common_url + "/subaccount/" + puid)
}, },
/** /**
* [createAccount 创建子账户] * [createAccount 创建子账户]
...@@ -251,8 +252,8 @@ export default { ...@@ -251,8 +252,8 @@ export default {
let regions = []; let regions = [];
let obj = {}; let obj = {};
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
_.each(Vue.$store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.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'] }
regions.push(obj) regions.push(obj)
...@@ -273,7 +274,7 @@ export default { ...@@ -273,7 +274,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(Vue.$store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.init_url.regions, function(v, k) {
if (v.region_id == region_id) { if (v.region_id == region_id) {
cur_region = v; cur_region = v;
} }
...@@ -315,8 +316,8 @@ export default { ...@@ -315,8 +316,8 @@ export default {
getZonglanList(url, cointype) { getZonglanList(url, cointype) {
//console.log("getZonglanList") //console.log("getZonglanList")
let list = []; let list = [];
_.each(url.regions, function (v, i) { _.each(url.regions, function(v, i) {
_.each(v.supported_coin_types, function (v1, i1) { _.each(v.supported_coin_types, function(v1, i1) {
if (v1.coin_type == cointype) { if (v1.coin_type == cointype) {
list.push({ 'region_id': v.region_id, 'text_en': v.text_en, 'text_zh-cn': v['text_zh-cn'], 'coin_type': cointype, 'api_base_url': v1.api_base_url, 'coins': url.coins[cointype] }) list.push({ 'region_id': v.region_id, 'text_en': v.text_en, 'text_zh-cn': v['text_zh-cn'], 'coin_type': cointype, 'api_base_url': v1.api_base_url, 'coins': url.coins[cointype] })
} }
...@@ -337,9 +338,9 @@ export default { ...@@ -337,9 +338,9 @@ 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(Vue.$store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.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) {
api_base_url = v1.api_base_url; api_base_url = v1.api_base_url;
} }
...@@ -419,7 +420,7 @@ export default { ...@@ -419,7 +420,7 @@ export default {
getPaymentHistoryReason(tableData) { getPaymentHistoryReason(tableData) {
//console.log("getPaymentHistoryReason") //console.log("getPaymentHistoryReason")
let reason = []; let reason = [];
_.each(tableData, function (v, i) { _.each(tableData, function(v, i) {
if (v.payment_status == 'DELAYED') { if (v.payment_status == 'DELAYED') {
if (v.unpaid_reason.code == 'ERR_EMPTY_ADDRESS') { if (v.unpaid_reason.code == 'ERR_EMPTY_ADDRESS') {
if (localStorage.getItem("language") == "zh-cn") reason.push('未设定收款地址') if (localStorage.getItem("language") == "zh-cn") reason.push('未设定收款地址')
...@@ -574,9 +575,9 @@ export default { ...@@ -574,9 +575,9 @@ export default {
*/ */
getRegionCoins(region_id) { getRegionCoins(region_id) {
let arr_coins = []; let arr_coins = [];
_.map(Vue.$store.state.init_url.regions, function (v, i, o) { _.map(Vue.$store.state.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)
}) })
} }
...@@ -606,9 +607,9 @@ export default { ...@@ -606,9 +607,9 @@ 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(Vue.$store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.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) {
stratum_url = v1.stratum_url; stratum_url = v1.stratum_url;
} }
...@@ -631,8 +632,8 @@ export default { ...@@ -631,8 +632,8 @@ export default {
let data = []; let data = [];
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let stratum_url = ''; let stratum_url = '';
_.each(Vue.$store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.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 })
} }
...@@ -663,8 +664,8 @@ export default { ...@@ -663,8 +664,8 @@ export default {
let regions = []; let regions = [];
let obj = {}; let obj = {};
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
_.each(Vue.$store.state.init_url.regions, function (v, k) { _.each(Vue.$store.state.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'] }
regions.push(obj) regions.push(obj)
...@@ -703,8 +704,8 @@ export default { ...@@ -703,8 +704,8 @@ export default {
*/ */
getCoinsOnly(obj) { getCoinsOnly(obj) {
let arr_coins = []; let arr_coins = [];
_.map(obj.regions, function (v, i, o) { _.map(obj.regions, function(v, i, o) {
_.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)
}) })
}); });
......
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