Browse Source

滑动验证补遗

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

11
api/member.js

@ -132,6 +132,17 @@ class Member {
static serviceDetail(data) { static serviceDetail(data) {
return server.get(`/article/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; export default Member;

58
layout/vCode.vue

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

6
pages/reg/index.vue

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

Loading…
Cancel
Save