-
+
-
- 余额:1
- 余额:20
- 余额:30
- 余额:40
+
+ 余额:{{ userTimeMoneyDto.btc }}
+ 余额:{{ userTimeMoneyDto.usdt }}
+ 余额:{{ userTimeMoneyDto.eos }}
+ 余额:{{ userTimeMoneyDto.eth }}
@@ -32,18 +51,33 @@
diff --git a/src/pages/yyyflogin.vue b/src/pages/yyyflogin.vue
index d154540..02d131c 100644
--- a/src/pages/yyyflogin.vue
+++ b/src/pages/yyyflogin.vue
@@ -19,6 +19,8 @@ export default {
loading: null,
tel: null,
pass: null,
+ //0 考试 1 练习 2 不计分
+ reqType: null,
};
},
@@ -26,6 +28,7 @@ export default {
created() {
this.startLoading();
let params = this.parseUrl();
+ this.reqType = params.reqType;
//判断是否来自以渔有方
if (
!$.isEmptyObject(params) &&
@@ -112,7 +115,8 @@ export default {
//保存登录的token到cookie
// Cookie.set('token', res.data.data.token);
localStorage.setItem('token', res.data.data.token);
-
+ //重复提交标识
+ localStorage.setItem('isSubmit', JSON.stringify(false));
//保存登录的用户信息到cookie
// Cookie.set('userData', res.data.data);
localStorage.setItem('userData', JSON.stringify(res.data.data));
@@ -125,43 +129,40 @@ export default {
// 保存邀请码信息
localStorage.setItem('invitationCode', res.data.data.invitationCode);
this.endLoading();
- location.href = '/';
+ location.href = '/entry';
} else {
this.$message.warning(res.data.msg);
}
});
},
loginFromYyyf: function(params) {
+ let self = this;
signInYyyf(params).then(res => {
if (res.data.code === 200) {
let status = res.data.data.status;
+ localStorage.setItem('yyyfToken', res.data.data.yyyfUserToken);
+
+ //0 考试 1 练习 2 不计分
+ localStorage.setItem('reqType', self.reqType);
+ if (self.reqType == 0) {
+ //考试 保留考试剩余
+ localStorage.setItem('remainingTime', res.data.data.remainingTime);
+ }
+
if (status == 1) {
//保存登录的token到cookie
// Cookie.set('token', res.data.data.token);
- localStorage.setItem('yyyfToken', res.data.data.yyyfUserToken);
- let code = res.data.data.code;
- this.tel = res.data.data.tel;
- this.pass = res.data.data.password;
- //注册
- if (code != undefined && code != '') {
- let signParams = {
- tel: this.tel,
- nickName: res.data.data.nickName,
- code: res.data.data.code,
- password: this.pass,
- internationalCode: null,
- invitationCode: '',
- };
- this.sign(signParams);
- } else {
- this.login();
- }
+ self.dealLogin(res);
} else {
this.$message.warning({
message: res.data.data.msg,
onClose: function() {
- this.closeWindow();
+ if (status == 3) {
+ self.dealLogin(res);
+ } else {
+ self.closeWindow();
+ }
},
});
}
@@ -169,12 +170,31 @@ export default {
this.$message.warning({
message: res.data.msg,
onClose: function() {
- this.closeWindow();
+ self.closeWindow();
},
});
}
});
},
+ dealLogin: function(res) {
+ let code = res.data.data.code;
+ this.tel = res.data.data.tel;
+ this.pass = res.data.data.password;
+ //注册
+ if (code != undefined && code != '') {
+ let signParams = {
+ tel: this.tel,
+ nickName: res.data.data.nickName,
+ code: res.data.data.code,
+ password: this.pass,
+ internationalCode: null,
+ invitationCode: '',
+ };
+ this.sign(signParams);
+ } else {
+ this.login();
+ }
+ },
closeWindow: function() {
if (
navigator.userAgent.indexOf('Firefox') != -1 ||
From 7d87d35f9241b01da0f6cf016c7cc65ef183e8fc Mon Sep 17 00:00:00 2001
From: unclekh <5177787+unclekh@user.noreply.gitee.com>
Date: Mon, 13 Jul 2020 23:14:20 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E5=85=A8=E6=99=AF=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E6=80=BB=E9=A2=9D=E3=80=81=E5=9C=B0=E5=9D=80=E3=80=81=E4=BB=A5?=
=?UTF-8?q?=E5=8F=8A=E5=8E=BB=E6=8E=89=E6=B3=95=E5=B8=81=E4=BA=A4=E6=98=93?=
=?UTF-8?q?=E7=9A=84=E5=85=85=E5=80=BC=E3=80=81=E6=8F=90=E5=B8=81=EF=BC=8C?=
=?UTF-8?q?=E5=B8=81=E5=B8=81=E4=BA=A4=E6=98=93=E7=9A=84=E5=85=85=E5=80=BC?=
=?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=85=85=E5=B8=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/balances/banlanes-tabds.vue | 25 +++----
src/components/common/header.vue | 2 +-
src/locales/lang/balances.zh-CN.js | 2 +-
src/locales/lang/balances.zh-HK.js | 2 +-
src/pages/entry.vue | 79 +++++++++++++++++++---
5 files changed, 85 insertions(+), 25 deletions(-)
diff --git a/src/components/balances/banlanes-tabds.vue b/src/components/balances/banlanes-tabds.vue
index 2f9dc92..aeca8d6 100644
--- a/src/components/balances/banlanes-tabds.vue
+++ b/src/components/balances/banlanes-tabds.vue
@@ -78,19 +78,19 @@
o.oooooo
@@ -52,22 +52,81 @@
import NavHeader from '@/components/common/header';
import Footer from '@/components/common/footer';
import {getUserTimeMoneyDto} from '@/api/yyyf';
+import {getLeftPrice} from '@/api/currency.js';
export default {
name: 'entry',
data() {
return {
activeName: 'BTC',
userTimeMoneyDto: {},
+ tatolPrice:0
};
},
components: {
NavHeader,
Footer,
},
+ methods:{
+ getUSDTPrie() {
+ getLeftPrice().then(res => {
+ this.USDTPrie = res.data.data;
+ // console.log(this.USDTPrie);
+
+ // 获取币种汇率
+ let cnyAmount = this.USDTPrie[0].cnyAmount;
+ let btcCount=0;
+ let usdtCount=this.userTimeMoneyDto.usdt;
+ let eosCount=0;
+ let ethCount=0;
+
+ for (let i = 0; i < this.USDTPrie.length; i++) {
+ // 获取btc转usdt资产
+ if (this.USDTPrie[i].currencyPair == 'BTC-USDT') {
+ // console.log(this.USDTPrie[i].amount);
+ //
+ btcCount = this.userTimeMoneyDto.btc * this.USDTPrie[i].amount;
+ // console.log('btc'+this.btcPrice);
+ }
+ // return this.btcPrice;
+ }
+ for (let i = 0; i < this.USDTPrie.length; i++) {
+ // 获取btc转usdt资产
+ if (this.USDTPrie[i].currencyPair == 'EOS-USDT') {
+ // console.log(this.USDTPrie[i].amount);
+ //
+ eosCount = this.userTimeMoneyDto.eos * this.USDTPrie[i].amount;
+ // console.log('btc'+this.btcPrice);
+ }
+ // return this.btcPrice;
+ }
+
+ for (let i = 0; i < this.USDTPrie.length; i++) {
+ // 获取btc转usdt资产
+ if (this.USDTPrie[i].currencyPair == 'ETH-USDT') {
+ // console.log(this.USDTPrie[i].amount);
+ //
+ ethCount = this.userTimeMoneyDto.eth * this.USDTPrie[i].amount;
+ // console.log('btc'+this.btcPrice);
+ }
+ // return this.btcPrice;
+ }
+
+ let digitWallet= (btcCount+usdtCount+eosCount+ethCount)*cnyAmount;
+
+ let total=digitWallet+this.userTimeMoneyDto.aliPay+this.userTimeMoneyDto.wxPay+this.userTimeMoneyDto.bankCard;
+ // 获取总资产
+ this.tatolPrice =Math.floor(total*10) / 10;
+
+ // console.log(this.tatolPrice);
+ });
+ }
+ },
created() {
getUserTimeMoneyDto().then(res => {
if (res.data.code === 200) {
this.userTimeMoneyDto = res.data.data;
+ this.getUSDTPrie();
+
} else {
this.$message.warning({
message: res.data.msg,