Commit f6890a49 by zhanghui1

完善地址、新账号无节点和算力的判断

parent 0409e66d
......@@ -7,7 +7,7 @@
<meta content="telephone=no" name="format-detection" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_538501_lcbajj2vb7ta9k9.css" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_538501_uyym2frga9ejyvi.css" />
<script src="https://cdn.bootcss.com/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tween.js@16.3.4"></script>
<title>poolin_app</title>
......
......@@ -112,6 +112,13 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac
p {.pos(a);.d-b;.tc; font-size:0.16rem;left: 0; right:0; bottom:0;.txt-ver(14px);.font-wn;}
}
.r {width: 100px; height: 44px; .pos(a); right:0; bottom:0; text-align: right;}
.sch-bar {.pos(a); right:0; left:44px;text-align: right; padding:5px 15px;
input { border: 1px solid #ccc; .txt-ver(20px); padding: 4px 10px; text-indent: 30px; background-image: url(../img/search-icon.png); background-size: 20px 20px; background-repeat: no-repeat; background-position: 10px center; background-color: rgba(255,255,255,0.6); transition: 0.3s all; border-radius: 6px;width:4rem; color:#fff;
&:focus {background-color:rgba(255,255,255,1); background-image: url(../img/search-icon2.png);color:#333;}
&::-webkit-input-placeholder {color:#fff;}
}
button {.txt-ver(30px); padding:0 10px; border: none; color:#fff; background: transparent;.fr; }
}
//风格设定bg
.icon-back {width:44px;height:44px; vertical-align: middle;.tc;.d-b;
i {font-size:20px;.txt-ver(44px);}
......@@ -208,6 +215,11 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac
}
}
.reg {.login;}
.address{
label {font-size: 0.28rem;color: @gray; padding:0.2rem 0.3rem;.d-b;}
.mock-input {background: #fff; padding: 0.2rem 0.3rem;font-size: 0.32rem;}
.c-red{padding: 0.2rem 0.3rem;}
}
.create {
.el-form-item {background: #fff; padding: 0rem 0.3rem;
.el-input {padding:0.1rem 0;}
......@@ -252,8 +264,6 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac
.zcash {background-image:url(../img/index-tab7-active.png);}
.doge {background-image:url(../img/index-tab8-active.png);}
}
}
.v {font-size: 0.4rem; color: #252525}
.k {font-size:0.26rem; color: #252525; margin-left: 0.1rem;}
......@@ -293,7 +303,6 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac
.mint-cell-wrapper{background-image: none;}
}
}
}
.miners {
.page-content{
......@@ -318,6 +327,10 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac
}
}
}
.no-result { height: 100%;
p {.tc;}
i {font-size: 1rem;}
}
.mobile-ios {
.page-header {padding-top: 20px;}
.page-content {top:64px;
......
......@@ -40,6 +40,7 @@ export default {
},
methods: {
goDashboard() {
this.$store.state.tab_bar=0;
this.$router.replace("/my/"+this.puid+'/'+this.coin_type+'/'+this.region_id+'/dashboard')
}
}
......
......@@ -43,6 +43,10 @@ export default {
//获取分组
let self = this;
fn.getApiBaseUrl(self.region_id, self.coin_type).then(api => {
if (api == '') {
this.$store.state.tab_bar = 0
this.$router.replace('/my/' + this.puid + '/' + this.coin_type)
} else {
this.api = api;
fn.getGroup(api, self.puid).then(res => {
if (res.err_no == 0) {
......@@ -52,6 +56,8 @@ export default {
}
// self.getWorker();
});
}
});
},
sideClick(sideIndex, group_id, group_name) {
......
......@@ -6,7 +6,7 @@
<h3>{{messageGroup}} <i class="iconfont icon-down"></i></h3>
<p>总算力: 20.87 PH/s</p>
</div>
<div class="r"><span class="icon-sch abs-right"><i class="iconfont icon-sousuo"></i></span></div>
<div class="r" @click="goSearch"><span class="icon-sch abs-right"><i class="iconfont icon-sousuo"></i></span></div>
</div>
<div class="page-content bottom">
<!-- 默认分组 -->
......@@ -237,10 +237,18 @@ export default {
goMinerShow(obj) {
this.$router.push('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/miners/' + obj.worker_id)
},
goSearch() {
this.$router.push('/search')
},
getWorker() {
//默认排序下的获取矿机列表
let self = this;
fn.getApiBaseUrl(self.region_id, self.coin_type).then(api => {
if (api == '') {
this.$toast("当前币种所在的节点不支持!");
this.$store.state.tab_bar = 0;
this.$router.replace("/my/" + this.puid + "/" + this.coin_type)
} else {
this.api = api;
fn.getWorker(api, self.puid, self.group_id, self.status, self.page_size, self.page).then(res => {
if (res.data.err_no == 0) {
......@@ -266,16 +274,16 @@ export default {
this.$toast("获取矿机数据错误!");
$router.replace({
name: "no",
path: "/my/" + self.$route.params.puid + "/" + self.$route.params.coin_type
path: "/my/" + this.puid + "/" + this.coin_type
});
}
this.$indicator.close()
});
}
})
},
sortWorker() {
//排序方法
fn.sortWorker(this.api, this.puid, this.group_id, this.status, this.order_by, this.sort, this.page, this.page_size).then(res => {
if (res.data.err_no == 0) {
if (res.data.data.data.length > 0) {
......@@ -293,8 +301,6 @@ export default {
pullingUp() {
this.getTableData(this.page + 1)
},
......@@ -305,7 +311,6 @@ export default {
} else {
this.getWorker()
}
},
},
}
......
<template>
<div class="page search">
<div class="page-header">
<div class="l" @click="goBack"><span class="icon-back"><i class="iconfont icon-fanhui"></i></span></div>
<div class="sch-bar">
<button @click="cancelKeyword">取消</button>
<input type="text" placeholder="搜索" v-model="keyword" @keyup.enter="searchWorker(1)">
</div>
</div>
<div class="page-content">
<div v-show="showResult===1" class="miners">
<div class="title list-row">
<div class="s1">矿机名</div>
<div class="s2">实时算力</div>
<div class="s3">日算力</div>
<div class="s4">拒绝</div>
<div class="s5"></div>
</div>
<mr-better-scroll ref="scroll" class="search-scroll" :pullUpLoad="true" @pullingUp="pullingUp">
<div class="list list-row list-click" @click="goMinerShow(items)" v-for="items in tableData" :class="{'redBg':items.status=='INACTIVE','greyBg':items.status=='DEAD'} ">
<div class="s1">{{items.worker_name}}
<em v-if="items.status=='INACTIVE'" class="red">不活跃</em>
<em v-else-if="items.status=='DEAD'" class="grey">失效</em>
</div>
<div class="s2">{{items.shares_15m}}<span><b>{{items.unit}}h/</b>s</span></div>
<div class="s3">{{items.shares_24h}}<span><b>{{items.unit}}h/</b>s</span></div>
<div class="s4">{{items.reject_rate| formatPercent2}}</div>
<div class="s5"><i class="iconfont icon-jiantou"></i></div>
</div>
</mr-better-scroll>
<div class="line xb"></div>
</div>
<div class="no-result" v-show="showResult===0" flex="cross:center main:center dir:top">
<p><i class="iconfont icon-404"></i></p>
<p>没有查到"{{no_keyword}}"相关的结果!</p>
</div>
</div>
</div>
</template>
<script>
import fn from '@/utils/function.js'
import { mapState } from 'vuex'
export default {
name: 'search',
data() {
return {
keyword: '',
no_keyword: '',
api: '',
tableData: [],
page: 1,
showResult: -1,
}
},
computed: {
...mapState(["txt", "init_url", "cur_coins"]),
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');
},
language() {
return this.$store.state.language || localStorage.getItem('language');
},
scroll() {
return this.$refs.scroll
}
},
mounted() {},
methods: {
goMinerShow(obj) {
this.$router.push('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/miners/' + obj.worker_id)
},
goBack() {
this.$router.go(-1);
},
cancelKeyword() {
this.keyword = '';
this.showResult = -1;
this.tableData = [];
},
pullingUp() {
if (this.keyword != '') {
this.searchWorker(this.page + 1);
} else {
this.$toast("请输入搜索词!")
}
},
searchWorker(page) {
if (this.keyword == '') {
this.$toast("请输入搜索词!")
return false;
}
// this.showResult = -1;
if (page === 1) this.tableData = [];
this.$indicator.open({ spinnerType: 'fading-circle' })
let self = this;
fn.getApiBaseUrl(this.region_id, this.coin_type).then(api => {
fn.searchWorker(api, this.puid, 0, this.keyword, 30, page).then(schData => {
if (schData.data.err_no == 0) {
if (schData.data.data.data.length > 0) {
this.page = page;
_.each(schData.data.data.data, function(v, k) {
self.tableData.push(v)
})
this.showResult = 1
this.scroll.forceUpdate(true);
} else {
if (this.tableData.length == 0) {
this.no_keyword = this.keyword;
this.showResult = 0;
}
this.scroll.forceUpdate(false);
}
} else {
this.$toast("接口错误!")
}
this.$indicator.close()
})
})
}
}
}
</script>
<style lang="less">
.miners {
.list-wrapper.search-scroll {
top: 0.6rem!important;
bottom: 0rem!important;
}
}
</style>
......@@ -144,7 +144,8 @@ export default {
fn.getApiBaseUrl(this.region_id, this.coin_type).then(api => {
if (api == '') {
this.$toast("当前币种所在的节点不支持!");
this.$router.replace("/my/" + puid + "/" + localStorage.getItem('coin_type'))
this.$store.state.tab_bar=0;
this.$router.replace("/my/" + this.puid + "/" + this.coin_type)
} else {
this.api = api;
fn.getPaymentStats(api, this.puid).then(res => {
......
<template>
<div class="page address">
<div class="page">
<div class="page-header">
<div class="l" @click="goBack"><span class="icon-back"><i class="iconfont icon-fanhui"></i></span></div>
<div class="c">修改收益地址</div>
<div class="c">{{query_coin_type|uppercase}}收益地址</div>
</div>
<div class="page-content bg-blue">
<!-- {{puid}} {{query_type}} {{query_coin_type}} -->
<div class="address">
<label>当前收益地址</label>
<div class="mock-input">{{address}}</div>
<p class="c-red">如果修改该地址,请访问网页版矿池,点击右上角“设置”并修改</p>
</div>
<div class="page-content">
123123132
</div>
</div>
</template>
<script>
import fn from '@/utils/function.js'
export default {
name: 'address',
data() {
return {
ttt: {},
address: '',
}
},
computed: {
puid() {
return this.$store.state.puid || localStorage.getItem('puid');
},
query_type() {
return this.$route.query.type
},
query_coin_type() {
return this.$route.query.coin_type
}
},
methods:{
goBack(){
methods: {
goBack() {
this.$router.go(-1)
},
getUser() {
fn.getUser(this.puid).then(res => {
if (res.data.err_no == 0) {
this.ttt = res.data.data
if (res.data.data.coins.hasOwnProperty(this.query_coin_type)) {
this.address = res.data.data.coins[this.query_coin_type].address
} else {
this.address = '未设置'
}
}
})
}
},
mounted() {
this.getUser()
}
}
......
......@@ -13,8 +13,8 @@
</div>
<div class="mt40 settings-group subaccount-settings">
<div class="settings-title">子账户设置</div>
<mt-cell title="LTC收益地址" is-link to="/address"></mt-cell>
<mt-cell title="DOGE补贴地址" is-link v-show="account_default_coin_type==='ltc'"></mt-cell>
<mt-cell :title="account_default_coin_type_uppercase+'收益地址'" is-link :to="'/address?type=0&coin_type='+account_default_coin_type"></mt-cell>
<mt-cell title="DOGE补贴地址" is-link v-show="account_default_coin_type==='ltc'" :to="'/address?type=1&coin_type=doge'"></mt-cell>
<mt-cell title="默认币种设置" is-link to="/defaultCoin">
<b class="fore-link-img" :class="coin_type" />
</mt-cell>
......@@ -61,6 +61,7 @@ export default {
return {
account_name: '',
account_default_coin_type: '',
account_default_coin_type_uppercase: '',
}
},
computed: {
......@@ -90,6 +91,7 @@ export default {
if (res.data.err_no == 0) {
this.account_name = res.data.data.name;
this.account_default_coin_type = res.data.data.default_coin_type;
this.account_default_coin_type_uppercase = res.data.data.default_coin_type.toUpperCase();
this.$indicator.close();
}
})
......
......@@ -34,11 +34,12 @@
<div class="box header">
<div class="page-header">
<div class="l"><span class="icon-back"><i class="iconfont icon-fanhui"></i></span></div>
<div class="sch">
<div class="sch-bar">
<input type="text">
<button>取消</button>
</div>
</div>
<br />
<div class="page-header">
<div class="l"><span class="icon-back"><i class="iconfont icon-fanhui"></i></span></div>
<div class="c">DOGE补贴地址</div>
......
......@@ -48,7 +48,7 @@ axios.interceptors.request.use(config => {
function checkToken() {
return new Promise((resolve, reject) => {
resolve('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh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9WjWIm7GMmT6k86YK3-JB9Zy1LG85NgQV6N88OGIWVvahYyg_tNvlmFOR24XHb1p2BuE7XSQvTr37QZgYp1kdm7Tn0rTv40M3EAPGexHCEJWxDGG4kFfyYxjz9G__bUxGhBt-8EKBc-d5A21AohbdES5REfdf2SODkeWXO6xU8ufxPErvTcBcAPFcH6SgN_cHgwniWi9pIPbOePuR4h8F15-1XRYl4AljWqJz7wgXjDVDGLxmCuL9R8Xt0budca_JLnNIESKDRMosFhEX70hbQ');
})
}
......
......@@ -120,6 +120,13 @@ const router = new Router({
title: 'Address.vue'
}
},{
path: '/search',
name: 'search',
component: resolve => require(['@/components/Miners/search.vue'], resolve),
meta: {
title: 'search.vue'
}
},{
path: '/defaultCoin',
name: 'defaultCoin',
component: resolve => require(['@/components/Settings/DefaultCoin'], resolve),
......
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