Browse Source

滑动验证补遗

master
453530270@qq.com 2 years ago
parent
commit
4accb7bc17
  1. 11
      api/member.js
  2. 62
      layout/vCode.vue
  3. 6
      pages/reg/index.vue

11
api/member.js

@ -132,6 +132,17 @@ class Member {
static serviceDetail(data) {
return server.get(`/article/serviceDetail`, data);
}
/**
* 获取图形验证码
* @param data {email,token}
*/
static Graph_che() {
return server.get(`/register/Graph_che`);
}
// 提币获取邮箱验证码
static getWdcode(data){
return server.get(`/user/wdcode`, data);
}
}
export default Member;

62
layout/vCode.vue

@ -12,6 +12,7 @@
<script>
import vButton from './vButton.vue'
import serve from "@/api/serve";
import Member from "@/api/member";
export default {
name: "vCode",
props: {
@ -44,7 +45,26 @@ export default {
type: String,
require: false,
},
sendAAA: {
type: Boolean
}
},
watch: {
sendAAA(n,o){
if(n){
console.log(n, '-------');
// setTimeout(()=>{
// this.inSend = false;
// this.load = true;
// this.countDown();
// this.$toast(this.$t('common.sendSuccess'));
// this.$emit('changeSendAAA', false)
// }, 500)
// return;
this.send();
}
}
},
components:{
vButton
},
@ -64,6 +84,7 @@ export default {
methods: {
//
send() {
console.log(this.sendAAA, '-------this.sendAAA');
if(this.data.phone==''){
this.$toast(this.$t('reg.a3'))
return
@ -74,24 +95,29 @@ export default {
}
if (this.load) return;
this.inSend = true;
serve.post(this.url, this.data)
.then((res) => {
// ss
if(res.code=='4001'){
this.inSend = false
this.$toast(res.message);
}else{
this.inSend = false;
this.load = true;
this.countDown();
this.$toast(this.$t('common.sendSuccess'));
}
})
.catch(() => {
this.inSend = false;
});
if(this.url==="/register/sendEmailCode" && !this.sendAAA){
this.$emit('changeSLider', true);
}else{
// serve.post(this.url, this.data)
Member.sendEmailCode(this.data)
.then((res) => {
if(res.code=='4001'){
this.inSend = false
this.$toast(res.message);
}else{
this.inSend = false;
this.load = true;
this.countDown();
this.$toast(this.$t('common.sendSuccess'));
this.$emit('changeSendAAA', false)
}
})
.catch(() => {
this.inSend = false;
});
}
},
countDown() {
clearInterval(this.Interval);

6
pages/reg/index.vue

@ -72,8 +72,8 @@
</view>
<!--图形验证码-->
<view class="form-item border-b m-b-md p-b-xs" v-if="0">
<view class="label m-b-xs">Captcha</view>
<v-input class="color-light" v-model="form.gr_code" placeholder='Please enter graphic results'>
<view class="label m-b-xs">{{$t('homeNewText.ee6')}}</view>
<v-input class="color-light" v-model="form.gr_code" :placeholder="$t('homeNewText.ee6')">
<template #right>
<!-- 邮箱 -->
<!--<img :src="'api/app/register/Graph_che?'+Math.random()" @click="refreshCaptcha">-->
@ -193,7 +193,7 @@ export default {
check: false,
agreement: {},
country_code:'',
showInvite_code: true,
showVerify:false,
imgs:[{
src:'/static/verify/0.jpeg',

Loading…
Cancel
Save