You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

203 lines
4.2 KiB

<template>
<view>
<view class="login">
<view class="verify_tips">
To verify your email,we've send a verification code to {{username}}
</view>
<input type="text" class="login_input" placeholder="Enter code" v-model="resetcode" @input="verificationLogin">
<view class="tips" v-show="isErr">The code is incorrect.</view>
<button class="login_submit" @click="goPage">CONTINUE</button>
<view class="verify_text" @click="sendresetcode,isShow = true">Resend code</view>
</view>
<view class="mask" v-show="isShow" @click="isShow=false"></view>
<view class="verify_popup" v-show="isShow">
<view class="verify_popup_close">
<image src="../../static/img/close.png" mode="" @click="isShow=false"></image>
</view>
<view class="verify_popup_title">Send!</view>
<view class="verify_popup_msg">we send a new verification code to {{query.username}}</view>
<view class="verify_popup_btn">
<button @click="isShow=false">OKAY</button>
</view>
</view>
</view>
</template>
<script>
import {defaultRequest,defaultRequest2} from '../../api/index.js'
export default {
data() {
return {
isShow:false,
isErr:false,
isLogin:true,
username:'',
type:'',
resetcode:'',
query:{
_action:'sendresetcode',
username:'',
// password:'',
}
}
},
methods:{
goPage(){
console.info(this.username)
if(!this.resetcode){
uni.showToast({
icon:'none',
title:'Please fill in the verification code',
duration: 2000
})
}
else{
uni.navigateTo({
url:'changePwd?resetcode='+this.resetcode+'&username='+this.username
})
}
},
sendresetcode(){
console.log(this.query)
defaultRequest(this.query).then(res=>{
console.log(res)
uni.showToast({
title:res.message,
icon:'none',
duration: 2000
})
})
},
// 验证是否填写登录信息
verificationLogin(){
if(this.resetcode){
this.isLogin=false
}else{
this.isLogin=true
}
},
// getcode(){
// this.isShow = false
// let data ={
// _action:'sendresetcode',
// username:this.username
// }
// defaultRequest2(data).then(res =>{
// console.log(res,'ppppp')
// })
// }
},
onLoad(e) {
let that = this;
let s = 0;
let time = setInterval(() => {
uni.getNetworkType({
success: (res) => {
console.log(res.networkType, s);
if (res.networkType == 'none') {
uni.showToast({
icon: 'none',
title: 'Please connect to the network',
duration: 3000,
})
} else if (res.networkType !== 'none') {
that.typee = 2;
clearInterval(time);
}
}
})
s++;
}, 1000);
console.info(e)
this.type=e.type
if(e.type!=0){
// this.query.password=e.password
this.query.username=e.email
}else{
}
this.username=e.email
this.sendresetcode()
}
}
</script>
<style lang="scss">
page{
border-top: 13.33rpx #F7F7F7 solid;
padding-top: 49.33rpx;
}
</style>
<style lang="scss" scoped>
.verify_tips{
font-size: 28rpx;
font-weight: bold;
margin-bottom: 52rpx;
}
.tips{
margin: 44rpx 0;
}
.login_submit{
margin-bottom: 33.33rpx;
}
.verify_text{
font-size: 24rpx;
text-align: center;
font-weight: bold;
}
.verify_popup{
width: 540rpx;
height: 366.67rpx;
position: fixed;
left: 50%;
margin-left: -270rpx;
top: 50%;
margin-top: -190rpx;
background-color: white;
border-radius: 20rpx;
z-index: 999;
box-sizing: border-box;
padding:15rpx 22rpx;
.verify_popup_close{
text-align: right;
image{
width: 40rpx;
height: 40rpx;
}
}
.verify_popup_title{
font-size: 40rpx;
font-weight: 600;
text-align: center;
margin-bottom: 40rpx;
}
.verify_popup_msg{
font-size: 26.67rpx;
font-weight: 400;
margin-bottom: 40rpx;
text-align: center;
}
.verify_popup_btn{
text-align: center;
button{
width: 321.33rpx;
height: 56rpx;
border-radius: 28rpx;
background-color: black;
color: white;
border: none;
font-size: 26.67rpx;
font-weight: bold;
line-height: 56rpx;
}
}
}
</style>