Commit c0eb1e77 by gaolei

链接接口

parents c52f4ab4 051e329e
......@@ -5,7 +5,7 @@ Vue.use(Vuex);
import dictionaries from '@/assets/js/dictionaries.js'; //字典
const state = {
refresh_time: 100000, //定时刷新
refresh_time: 10000, //定时刷新
// is_login: $auth.isAuthenticated(), //是否登录
init_url: {}, //全站入口信息
cur_coins: [], //获取支持的币种
......
......@@ -14,12 +14,12 @@
h1,h3,b{font-weight: 400; }
b {text-transform: uppercase;font-size: .20rem;margin-left: .08rem;display: inline-block;}
.pay-list {position: fixed;z-index: 9; left: 0; right: 0; height: 3.15rem; background-color: #103f73; color: #fff; box-sizing: border-box;
h1 {font-size: .90rem;
b {font-size: .48rem; }
}
span{color: #fff}
.v1{font-size: .90rem}
.k1{font-size: .48rem}
.v2{font-size: .30rem;}
.k2{width: 2.8rem;}
h3 {font-size: .24rem;color: #c3cfdc;}
p{font-size: .30rem;}
.d2{width: 2.8rem;}
i{font-size: .22rem;color: #dbe2ea;display: inline-block; vertical-align: top;margin-left: .05rem;}
}
.balance-list {margin: 3.35rem 0 .05rem 0;font-size: .34rem;background: #fff;
......
......@@ -2,8 +2,8 @@
<div class="page dashboard">
<div class="page-header" :class="hasZIndex==true?'zIndexAuto':''" flex="main:justify cross:center">
<div class="side" @click="getSide"><i class="iconfont icon-mulu"></i></div>
<div class="title" @click="getRegion">YZCF - {{messageRegion}}<i class="iconfont icon-down"></i></div>
<div class="btn-choose-coin" @click="getCoin"><span :class="messageCoin"></span><i class="iconfont icon-down"></i></div>
<div class="title" @click="getRegion">{{cur_account.data.name}} - {{region_name}}<i class="iconfont icon-down"></i></div>
<div class="btn-choose-coin" @click="getCoin"><span :class="this.$route.params.coin_type"></span><i class="iconfont icon-down"></i></div>
</div>
<div class="page-content">
<!-- 切换币种 -->
......@@ -12,7 +12,7 @@
</mt-popup>
<!-- 切换区域 -->
<mt-popup v-model="showRegion" position="top" class='top show-top'>
<region :region="messageRegion" v-on:childRegion="fromRegion"></region>
<region :region="region_name" v-on:childRegion="fromRegion"></region>
</mt-popup>
<!-- 切换子账户 -->
<mt-popup v-model="showSide" position="left" class="left show-left">
......@@ -39,10 +39,14 @@
<p>
<span class="v" v-if="$store.state.coin_type=='xmr'"><animated-num :value="(payment_stats.yesterday_amount)/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v" v-else><animated-num :value="(payment_stats.yesterday_amount)/Math.pow(10,8)" :fixed=8></animated-num></span>
<span class="k">BTC</span>
<span class="k">{{$route.params.coin_type|uppercase}}</span>
</p>
<h3 class="title f24gray">昨日收益</h3>
<p class="small-k-v mt20"><span class="k">今日预估:</span><span class="v">0.00173601 BTC</span></p>
<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-else><animated-num :value="(payment_stats.today_estimate)/Math.pow(10,8)" :fixed=8></animated-num></span>
<span class="k">{{$route.params.coin_type|uppercase}}</span>
</p>
</div>
</div>
</div>
......@@ -50,8 +54,16 @@
<div class="bg-blue pb40">
<div class="list">
<h3>账户收益</h3>
<mt-cell title="余额"><span class="v">120.95086277</span> <span class="k">BTC</span></mt-cell>
<mt-cell title="已支付"><span class="v">0.00000000</span> <span class="k">BTC</span></mt-cell>
<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-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>
</mt-cell>
<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-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>
</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>
</div>
......@@ -93,13 +105,26 @@
showCoin: false,
showRegion: false,
showSide: false,
regions: [],
cur_region: {
"region_id": "",
"text_en": "",
"text_zh-cn": "",
},
cur_account: {
data: {
name: ''
}
},
suanli: {},
payment_stats: {
yesterday_amount: 0,
today_estimate: 0
},
messageRegion: '北方联通',
messageCoin:'dash'
region_name: '',
language: localStorage.getItem('language'),
loading: true,
stratum_url: []
};
},
mounted() {
......@@ -205,7 +230,7 @@
this.showSide = false;
},
fromRegion(msg){
this.messageRegion = msg;
this.region_name = msg;
this.showRegion = false;
},
fromCoin(msg){
......
......@@ -15,7 +15,7 @@ export default {
data() {
return {
regionDate: [{
text: '南方电信'
text: '深圳'
}, {
text: '北方联通'
}, {
......
......@@ -6,40 +6,63 @@
<div class="page-content bottom">
<div class="pay-list pl30 pr30 pt20">
<div>
<h3>昨日收益<i class="iconfont icon-gantanhao"></i></h3>
<h1>{{yesterday.num}}<b class="ml15">{{yesterday.unit}}</b></h1>
<h3>{{txt[language].zuorishouyi}}<i @click="promptZuori" class="iconfont icon-gantanhao"></i></h3>
<p>
<span class="v1" v-if="$store.state.coin_type=='xmr'"><animated-num :value="PaymentStats.yesterday_amount/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v1" v-else><animated-num :value="PaymentStats.yesterday_amount/Math.pow(10,8)" :fixed=8></animated-num></span>
<span class="k1">{{init_url.coins[$store.state.coin_type]['symbol']}}</span>
</p>
</div>
<div class="mt55" flex="dir:left box:last">
<div class="mt50" flex="dir:left box:last">
<div class="d1">
<h3 class="mb5">今日已挖(预估)<i class="iconfont icon-gantanhao"></i></h3>
<p>{{today.num}}<b>{{today.unit}}</b></p>
<h3 class="mb10">今日已挖(预估)<i class="iconfont icon-gantanhao"></i></h3>
<p>
<span class="v2" v-if="$store.state.coin_type=='xmr'"><animated-num :value="PaymentStats.today_estimate/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v2" v-else><animated-num :value="PaymentStats.today_estimate/Math.pow(10,8)" :fixed=8></animated-num></span>
<span class="k2">{{init_url.coins[$store.state.coin_type]['symbol']}}</span>
</p>
</div>
<div class="d2">
<h3 class="mb5">已支付</h3>
<p>{{already.num}}<b>{{already.unit}}</b></p>
<h3 class="mb10">{{txt[language].yizhifu}}</h3>
<p>
<span class="v2" v-if="$store.state.coin_type=='XMR'"><animated-num :value="PaymentStats.total_paid_amount/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v2" v-else><animated-num :value="PaymentStats.total_paid_amount/Math.pow(10,8)" :fixed=8></animated-num></span>
<span class="k2">{{init_url.coins[$store.state.coin_type]['symbol']}}</span></p>
</p>
</div>
</div>
</div>
<div class="balance-list p30" flex="dir:left box:mean">
<div>
<i class="iconfont icon-keyongyue"></i>余额
</div>
<div class="f-tar">
{{balanceList.num}}<b>{{balanceList.unit}}</b>
<span class="v" v-if="$store.state.coin_type=='XMR'"><animated-num :value="PaymentStats.balance/Math.pow(10,12)" :fixed=12></animated-num></span>
<span class="v" v-else><animated-num :value="PaymentStats.balance/Math.pow(10,8)" :fixed=8></animated-num></span>
<span class="k">{{init_url.coins[$store.state.coin_type]['symbol']}}</span>
</div>
</div>
<div class="ments-list p30" v-for='item in mentsList' flex="dir:left box:mean">
<div class="ments-list p30" v-for="items in PaymentHistory.data" flex="dir:left box:mean">
<div>
<span>{{item.time}}</span>
<s>{{item.module}}</s>
<span>{{items.date|date422}}</span>
<s>PPS模式</s>
</div>
<div class="ments-list-right f-tar">
<span>{{item.num}}<b>{{item.unit}}</b></span>
<s>{{item.balance}}</s>
<span>{{(items.amount/Math.pow(10,8)).toFixed(8)}}<b>
{{init_url.coins[$store.state.coin_type]['symbol']}}</b></span>
<s v-if="items.payment_status=='PAID'">
<el-button type="text" size="mini" style="color:#666;cursor:default;">{{txt[language].yizhifu}}</el-button>
</s>
<s v-if="items.payment_status=='PENDING'">
<el-button type="text" size="mini" style="color:#666;cursor:default;">{{txt[language].daizhifu}}</el-button>
</s>
<s v-if="items.payment_status=='DELAYED'">
<el-button type="text" size="mini" style="color:#fa5943;cursor:default;">{{txt[language].cunruyue}}</el-button><i style="font-family:simsun;color:#ccc; padding-left: 5px; padding-right: 5px;">|</i>
<el-button type="text" size="mini" @:click="cunruyue">{{txt[language].yuanyin}}</el-button>
</el-tooltip>
</s>
</div>
</div>
</div>
<!-- page-content end -->
<tabbar></tabbar>
......@@ -50,85 +73,141 @@
import fn from '@/assets/js/function.js';
import { mapState } from 'vuex';
import tabbar from "@/components/Common/Tabbar.vue";
import animatedNum from "@/components/Common/AnimatedNum";
export default {
name: 'payments',
components: {
tabbar
tabbar,
animatedNum
},
data() {
return {
yesterday: {
num: '1.21270311',
unit: 'lct'
},
today: {
num: '3.79003919',
unit: 'lct'
},
already: {
num: '3.79003919',
unit: 'lct'
reason: "",
regions: [],
language: localStorage.getItem('language'),
PaymentStats: {
total_paid_amount: 0,
balance: 0,
today_estimate: 0,
yesterday_amount: 0
},
balanceList: {
num: '3.79003919',
unit: 'lct'
},
mentsList: [{
time: '2017-10-27',
module: 'PPS模式',
num: '3.79003919',
unit: 'lct',
balance: '存入余额'
}, {
time: '2017-10-26',
module: 'PPS模式',
num: '1.43003919',
unit: 'lct',
balance: '存入余额'
}, {
time: '2017-10-25',
module: 'PPS模式',
num: '4.99003919',
unit: 'lct',
balance: '存入余额'
}, {
time: '2017-10-24',
module: 'PPS模式',
num: '2.79003919',
unit: 'lct',
balance: '存入余额'
},{
time: '2017-10-27',
module: 'PPS模式',
num: '3.79003919',
unit: 'lct',
balance: '存入余额'
}, {
time: '2017-10-26',
module: 'PPS模式',
num: '1.43003919',
unit: 'lct',
balance: '存入余额'
}, {
time: '2017-10-25',
module: 'PPS模式',
num: '4.99003919',
unit: 'lct',
balance: '存入余额'
}, {
time: '2017-10-24',
module: 'PPS模式',
num: '2.79003919',
unit: 'lct',
balance: '存入余额'
}]
PaymentHistory: {},
}
},
mounted() {
methods: {
handleCurrentChange(v) {
self = this;
let puid = this.$route.params.puid;
let coin_type = this.$route.params.coin_type;
let region_id = this.$route.params.region_id;
//获取支付历史
fn.getApiBaseUrl(region_id, coin_type)
.then(api => fn.getPaymentHistory(api, puid, v))
.then(res => {
self.PaymentHistory = res.data.data;
//console.log("当前币种所在节点的子帐户支付历史PaymentHistory:", res.data)
self.reason = fn.getPaymentHistoryReason(res.data.data.data);
})
},
pageInitInterval() {
let self = this;
clearInterval(window.dingshiqi)
self.pageInit();
window.dingshiqi = setInterval(function() {
self.pageInit();
}, $store.state.refresh_time)
},
pageInit() {
let self = this;
let puid = this.$route.params.puid;
let coin_type = this.$route.params.coin_type;
let region_id = this.$route.params.region_id;
this.language = localStorage.getItem('language');
//获取stratum_url
fn.getStratumUrl(region_id, coin_type)
.then(res => {
self.stratum_url = res;
})
//获取所有节点
fn.getAllRegions().then(res => {
this.regions = res;
});
// //获取当前节点信息
fn.getRegionInfo(region_id).then(res => {
if (self.language == 'zh-cn') {
this.region_name = res['text_zh-cn'];
}
if (self.language == 'en') {
this.region_name = res['text_en'];
}
});
//获取支付状态
fn.getApiBaseUrl(region_id, coin_type)
.then(api => {
if (api == '') {
this.$toast("当前币种所在的节点不支持!");
$router.replace("/my/" + puid + "/" + localStorage.getItem('coin_type'))
} else {
fn.getPaymentStats(api, puid)
.then(res => {
if (res.data.err_no == 0) {
//console.log("当前币种所在节点的子帐户支付状态PaymentStats:", res.data.data);
this.PaymentStats = res.data.data;
} else {
this.$toast("当前币种所在节点的子帐户支付状态错误!")
$router.replace({
name: 'my_puid_cointype',
path: '/my/' + self.$route.params.puid + '/' + self.$route.params.coin_type
})
}
self.loading = false;
});
}
})
//获取支付历史
fn.getApiBaseUrl(region_id, coin_type)
.then(api => {
if (api == "") {
$router.replace({
name: 'my_puid_cointype',
path: '/my/' + self.$route.params.puid + '/' + self.$route.params.coin_type
})
} else {
fn.getPaymentHistory(api, puid, 1)
.then(res => {
self.PaymentHistory = res.data.data;
//console.log("当前币种所在节点的子帐户支付历史PaymentHistory:", res.data)
self.reason = fn.getPaymentHistoryReason(res.data.data.data);
self.loading = false;
})
}
})
},
promptZuori() {
this.$toast('昨日收益为国际标准时间昨日0:00-24:00(北京时间昨日8:00到今日8:00)之间的收益。');
},
cunruyue(){
this.$toast(reason[items.$index])
}
},
methods: {}
computed: {
...mapState(["txt", "init_url", "cur_coins"]),
refresh(v) {
return $store.state.refresh;
}
},
watch: {
'$route' (to, from) {
this.pageInitInterval();
},
refresh(v) {
this.pageInitInterval()
}
},
mounted() {
this.pageInitInterval();
}
}
</script>
......@@ -37,7 +37,7 @@ axios.interceptors.request.use(config => {
function checkToken() {
return new Promise((resolve, reject) => {
resolve("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE2NjcxOTI4LCJleHAiOjE1MTY2NzkxMjgsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.UPdJbluTv3Xmcfs_9VI-Wih_SlfQL0QbEh2Rmbu2967lB0_5RXD4sqn3yWTf_VyMYjJqlqTRTkb8yPtUPcsQCA4oXz9fwUqkvmJYhVqCbeRBax-GtZ596um080IZjfc_rsHsemu49UcjCGBtBN4Z1EfyStMnP888_i7XN1Jg3fQxhj87DBn8QLIkj0DIolj0rHvie-cNRCGk14WDd5zP-KAWmvKW4nLwnrEEOLHcmaeH46z0ZCNTpJ7sFr0UHxBQTVVE5fU2zBlym7f0jpofR5M7BCa98UWV7KCJxioeljCkvu-dvCr0IO-oxWsQ0_WwoKkRj1jiDAwp_sgVMq0Yvg");
resolve("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE2OTUxOTAwLCJleHAiOjE1MTY5NTkxMDAsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.wjOk-ynJlMg2SDXT3djpRl0-topq-GQWVoa3QsdBwueg8ZuxXHpO0P5uQPTXoEuzgalm2XcBk1pVrMLWQ4Nqgod0agKtE7YJfh59tY4SKsvCdo0nKdB2yw4e8WLemtVM_wqQDNs0PeHs5XmSZ4PEfP4u7B5AZHUBA4GHtIvNKNB_CQw3pSp3D4us1yeupHb7rRQTeYMs1CXEhN_m2hEJ7oL4xBWuQReRR2UIg5bevhGUQEC0h4WEP21XEDmpFOjbUJpKUGM9gwgy3723gdhVbqzcTk1iQmwQSc4mWKONCeYDhemu_IX5VuKvAV_hvNXqO1uxPv2NCCGgNN5A-J2hnA");
})
}
window.$axios = Vue.prototype.$axios = axios;
......
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