Commit 727459d6 authored by wxk's avatar wxk

验证码倒计时优化

parent ec50e61c
...@@ -7,6 +7,7 @@ const Api = { ...@@ -7,6 +7,7 @@ const Api = {
GetMatchRobots: "/accountlist",//获取符合条件的机器人 GetMatchRobots: "/accountlist",//获取符合条件的机器人
GetRobotStatus: "/robotStatus",//机器人预警状态查询 GetRobotStatus: "/robotStatus",//机器人预警状态查询
GetPlatformInfo: "/platform",//交易所及匹配的交易对、目标币信息查询 GetPlatformInfo: "/platform",//交易所及匹配的交易对、目标币信息查询
GetRobotBank: "/accountlist",//查询机器人银行账户
} }
export default Api; export default Api;
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<i class="iicon pwd"></i> <i class="iicon pwd"></i>
<input type="text" placeholder="请输入验证码" class="usercomyzm" v-model="regist_yzm"> <input type="text" placeholder="请输入验证码" class="usercomyzm" v-model="regist_yzm">
<el-button type="primary" class="getyzm" @click="getYZM('regist')" :disabled='!show'> <el-button type="primary" class="getyzm" @click="getYZM('regist')" :disabled='!show'>
<span v-show = "show">获取验证码</span> <span v-show = "how">获取验证码</span>
<span v-show = "!show" class="count">已发送{{count}} s</span> <span v-show = "!show" class="count">已发送{{count}} s</span>
</el-button> </el-button>
</div> </div>
...@@ -149,28 +149,27 @@ export default { ...@@ -149,28 +149,27 @@ export default {
}); });
return; return;
} }
//获取验证码倒计时60s
this.count = TIME_COUNT;
this.show = false;
this.timer = setInterval(() => {
if(this.count > 0 && this.count <= TIME_COUNT){
this.count--;
}else{
this.show = true;
clearInterval(this.timer);
this.timer = null;
}
}, 1000)
axios.post(ApiConfig.SendEmailVcode,{"user":Email}).then(res => { axios.post(ApiConfig.SendEmailVcode,{"user":Email}).then(res => {
// console.log(res) // console.log(res)
if(res.status == 200&& res.data == "emailsend success"){//发送成功并且注册成功 if(res.status == 200&& res.data == "emailsend success"){//发送成功并且注册成功
//获取验证码倒计时60s
this.count = TIME_COUNT;
this.show = false;
this.timer = setInterval(() => {
if(this.count > 0 && this.count <= TIME_COUNT){
this.count--;
}else{
this.show = true;
clearInterval(this.timer);
this.timer = null;
}
}, 1000)
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: "验证码发送成功,请查收", message: "验证码发送成功,请查收",
type: 'success', type: 'success',
duration:'2000', duration:'2000',
}); });
}else{//不存在的33.cn的邮箱 }else{//不存在的33.cn的邮箱
this.$notify({ this.$notify({
title: '提示', title: '提示',
......
...@@ -113,6 +113,8 @@ ...@@ -113,6 +113,8 @@
<script> <script>
import Bus from '../assets/js/bus' import Bus from '../assets/js/bus'
import axios from 'axios';
import ApiConfig from "../config/api-config";
export default { export default {
data(){ data(){
return{ return{
...@@ -120,10 +122,13 @@ ...@@ -120,10 +122,13 @@
} }
}, },
props: ['robotDetailInfo'], props: ['robotDetailInfo'],
created() {
},
methods: { methods: {
closeDetails() { closeDetails() {
Bus.$emit('hideDetails') Bus.$emit('hideDetails')
} },
} }
} }
</script> </script>
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
}, },
created() { created() {
this.getPlatInfo(); this.getPlatInfo();
this.getRobotBank();
if (!sessionStorage.getItem("isLogin")) { if (!sessionStorage.getItem("isLogin")) {
this.$router.push({ this.$router.push({
path: '/' path: '/'
...@@ -60,7 +61,21 @@ ...@@ -60,7 +61,21 @@
this.platInfo = res.data.data; this.platInfo = res.data.data;
// console.log(this.platInfo) // console.log(this.platInfo)
}) })
} },
getRobotBank() {
const params = {
"class":"bank", //账户级别 有robot bank admin三个返回数据也不同
"coin":[], //目标币种,用于首页里的筛选和币种监控 可选参数
"symbol":[], //币种对,用于网站监控里的筛选 可选参数
"status":"", //机器人运行状态 可选参数
"abnormal":"", //有profit,coin,base这三种异常类别 可选参数
"platform":[] //交易所种类 可选参数
}
axios.post(ApiConfig.GetRobotBank,params).then( res => {
console.log(res.data)
})
},
} }
} }
</script> </script>
......
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 to comment