diff --git a/src/api/app.js b/src/api/app.js index 0437015..d19e421 100644 --- a/src/api/app.js +++ b/src/api/app.js @@ -10,7 +10,7 @@ export const userApi = 'https://www.zhixinchains.com/user'; //用户 export const FILE_URL = 'https://file.zhixinchains.com/'; //图片地址 -export const yyyfApi = 'https://file.zhixinchains.com/yyyfuser'; //用户 +export const yyyfApi = 'httpsz://www.zhixinchains.com/yyyfuser'; //用户 // export const c2cApi = 'https://c2c.flamex.io'; //法币 // export const btcApi = 'https://btc.flamex.io'; //BTC钱包 diff --git a/src/components/balances/banlanes-tabds.vue b/src/components/balances/banlanes-tabds.vue index aeca8d6..4669a4f 100644 --- a/src/components/balances/banlanes-tabds.vue +++ b/src/components/balances/banlanes-tabds.vue @@ -261,13 +261,99 @@ - - + + + - + BTC + + + + + 0 + + + + 0 + + + + - + - {{ $t('balances.table.header_nodata') }} + + + + + ETH + + + + + 0 + + + + 0 + + + + - + + + + + + + EOS + + + + + 0 + + + + 0 + + + + - + + + + + + + + USDT + + + + + 0 + + + + 0 + + + + - + + + + diff --git a/src/components/balances/bibi-balances/bibi-balances-table.vue b/src/components/balances/bibi-balances/bibi-balances-table.vue index abd3deb..6c69a0b 100644 --- a/src/components/balances/bibi-balances/bibi-balances-table.vue +++ b/src/components/balances/bibi-balances/bibi-balances-table.vue @@ -259,13 +259,99 @@ - - + + + + + BTC + + + + + 0 + + - + 0 + + + + - + - {{ $t('balances.table.header_nodata') }} + + + + + ETH + + + + + 0 + + + + 0 + + + + - + + + + + + + EOS + + + + + 0 + + + + 0 + + + + - + + + + + + + + USDT + + + + + 0 + + + + 0 + + + + - + + + + diff --git a/src/components/common/header.vue b/src/components/common/header.vue index c8c20e6..cad8234 100644 --- a/src/components/common/header.vue +++ b/src/components/common/header.vue @@ -4,7 +4,7 @@ - < 返回 + < 返回 @@ -276,7 +276,7 @@ export default { {id: 'security', name: this.$t('personal.leftNav.security')}, {id: 'manner', name: this.$t('personal.leftNav.manner')}, {id: 'prove', name: this.$t('personal.leftNav.prove')}, - {id: 'out', name: this.$t('nav.menu_logOut')}, + /* {id: 'out', name: this.$t('nav.menu_logOut')},*/ ], }, userData: '', @@ -396,74 +396,6 @@ export default { format: function(num, n) { return (Array(n).join(0) + num).slice(-n); }, - submitExam: function() { - let self = this; - //防止重复提交 - if (!self.isSubmit) { - self.isSubmit = true; - } else { - return false; - } - - submit().then(res => { - if (res.data.code === 200) { - this.$message.success({ - message: '提交成功', - onClose: function() { - if (self.reqType == 0) { - self.closeWindow(); - } else { - localStorage.setItem('isSubmit', JSON.stringify(true)); - self.isSubmit = false; - } - }, - }); - } else { - this.$message.warning({ - message: res.data.msg, - onClose: function() { - self.closeWindow(); - }, - }); - } - }); - }, - reStartTest: function() { - let self = this; - //防止重复提交 - if (!self.isSubmit) { - this.isSubmit = true; - } else { - return false; - } - //退出当前用户 - this.exit(1); - reStart().then(res => { - if (res.data.code === 200) { - this.$message.success({ - message: '重新开始成功', - onClose: function() { - let signParams = { - tel: res.data.data.tel, - nickName: res.data.data.nickName, - code: res.data.data.code, - password: res.data.data.password, - internationalCode: null, - invitationCode: '', - }; - self.sign(signParams); - }, - }); - } else { - this.$message.warning({ - message: res.data.msg, - onClose: function() { - self.closeWindow(); - }, - }); - } - }); - }, sign(params) { signUp(params).then(res => { if (res.data.code === 200) { diff --git a/src/pages/entry.vue b/src/pages/entry.vue index c24bf30..ebb89ee 100644 --- a/src/pages/entry.vue +++ b/src/pages/entry.vue @@ -173,6 +173,9 @@ import NavHeader from '@/components/common/header'; import Footer from '@/components/common/footer'; import {getUserTimeMoneyDto} from '@/api/yyyf'; import {getLeftPrice} from '@/api/currency.js'; +import {submit, reStart} from '@/api/yyyf'; +import {logOut} from '@/api/user'; +import {signUp, signIn} from '@/api/user'; export default { name: 'entry', data() { @@ -180,6 +183,12 @@ export default { activeName: 'BTC', userTimeMoneyDto: {}, tatolPrice: 0, + //0 考试 1 练习 2 不计分 + reqType: 2, + //剩余时间 + remainingTime: 0, + //防止重复提交 + isSubmit: false, }; }, components: { @@ -187,9 +196,180 @@ export default { Footer, }, methods: { + getUserTimeMoneyDtoMethod(){ + let ths=this; + getUserTimeMoneyDto().then(res => { + if (res.data.code === 200) { + ths.userTimeMoneyDto = res.data.data; + this.getUSDTPrie(); + } else { + ths.$message.warning({ + message: res.data.msg, + onClose: function() { + ths.closeWindow(); + }, + }); + } + }); + }, + login(params) { + signIn(params).then(res => { + // console.log(res); + if (res.data.code === 200) { + //判断是否保存自动登录 + // if( this.checked === true ){ + // Cookie.set('phoneNum',num) + // Cookie.set('password',pass) + // } + //保存登录的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)); + // console.log(JSON.parse(localStorage.getItem('userData'))); + + // 保存userID的信息到cookie + // Cookie.set('userID', res.data.data.id); + localStorage.setItem('userID', res.data.data.id); + + // 保存邀请码信息 + localStorage.setItem('invitationCode', res.data.data.invitationCode); + this.isSubmit = false; + location.href = '/entry'; + } else { + this.$message.warning(res.data.msg); + this.isSubmit = false; + } + }); + }, + closeWindow: function() { + if ( + navigator.userAgent.indexOf('Firefox') != -1 || + navigator.userAgent.indexOf('Chrome') != -1 + ) { + window.location.href = 'about:blank'; + window.close(); + } else { + window.opener = null; + window.open('', '_self'); + window.close(); + } + }, + sign(params) { + signUp(params).then(res => { + if (res.data.code === 200) { + this.login({ + tel: params.tel, + password: params.password, + }); + } else { + this.$message.warning(res.data.msg); + this.isSubmit = false; + } + }); + }, + exit(params) { + logOut().then(res => { + if (res.data.code === 200 || res.data.code === 202) { + // Cookie.set('userData', ''); + localStorage.setItem('userData', ''); + localStorage.removeItem('userpass'); + localStorage.removeItem('userdate'); + localStorage.removeItem('nowPassNOValue'); + if (params == undefined) { + //window.location.href = '/'; + this.closeWindow(); + } + + // let pathName = window.location.pathname.split('/')[1]; + // console.log(pathName); + //判断是否从个人中心页面退出登录 + // if (pathName === 'personal') { + // window.location.href = '/login'; + // } else { + // window.location.href = this.perUrl; + // } + } else { + this.$message.warning(res.data.msg); + } + }); + }, goIndex() { window.open('/', '_blank'); }, + submitExam: function() { + debugger; + let self = this; + //防止重复提交 + if (!self.isSubmit) { + self.isSubmit = true; + } else { + return false; + } + + submit().then(res => { + if (res.data.code === 200) { + this.$message.success({ + message: '提交成功', + onClose: function() { + if (self.reqType == 0) { + self.closeWindow(); + } else { + localStorage.setItem('isSubmit', JSON.stringify(true)); + self.isSubmit = false; + } + self.getUserTimeMoneyDtoMethod(); + }, + }); + } else { + this.$message.warning({ + message: res.data.msg, + onClose: function() { + self.closeWindow(); + }, + }); + } + }); + }, + reStartTest: function() { + let self = this; + //防止重复提交 + if (!self.isSubmit) { + this.isSubmit = true; + } else { + return false; + } + //退出当前用户 + this.exit(1); + reStart().then(res => { + if (res.data.code === 200) { + this.$message.success({ + message: '重新开始成功', + onClose: function() { + let signParams = { + tel: res.data.data.tel, + nickName: res.data.data.nickName, + code: res.data.data.code, + password: res.data.data.password, + internationalCode: null, + invitationCode: '', + }; + self.sign(signParams); + }, + }); + } else { + this.$message.warning({ + message: res.data.msg, + onClose: function() { + self.closeWindow(); + }, + }); + } + }); + }, getUSDTPrie() { getLeftPrice().then(res => { this.USDTPrie = res.data.data; @@ -250,19 +430,23 @@ export default { }, }, created() { - getUserTimeMoneyDto().then(res => { - if (res.data.code === 200) { - this.userTimeMoneyDto = res.data.data; - this.getUSDTPrie(); - } else { - this.$message.warning({ - message: res.data.msg, - onClose: function() { - this.closeWindow(); - }, - }); - } - }); + let ths=this; + ths.getUserTimeMoneyDtoMethod(); + let yyyfToken = localStorage.getItem('yyyfToken'); + this.isSubmit = localStorage.getItem('isSubmit') == 'true' ? true : false; + if (yyyfToken == '' || yyyfToken == undefined) { + this.$alert('未从以渔有方登录,点击确定关闭浏览器', '提示', { + type: 'error', + showClose: false, + confirmButtonText: '确定', + confirmButtonClass: 'btn-self-style', + callback: () => { + ths.closeWindow(); + }, + }); + } else { + ths.reqType = localStorage.getItem('reqType'); + } }, };