168 lines
5.1 KiB
Plaintext
168 lines
5.1 KiB
Plaintext
<template>
|
|
<view class="container">
|
|
<view>
|
|
<view>
|
|
<view class="border_level_bottom_f1 pdlft20 pdRit20" style="border-radius: 8rpx;margin-top: 50rpx;">
|
|
<view class="fs-30 col333 bold">手机号</view>
|
|
<input v-model="phone" maxlength="11" type="number" class="fs-28 col333" style="width: 500rpx;height: 80rpx;" placeholder-class="fs-28 col999" placeholder="请输入手机号"/>
|
|
</view>
|
|
<view class="border_level_bottom_f1 pdlft20 pdRit20 relative" style="border-radius: 8rpx;margin-top: 50rpx;">
|
|
<view class="fs-30 bold col333 ">验证码</view>
|
|
<input v-model="code" maxlength="11" type="number" class="fs-28 col333" style="width: 500rpx;height: 80rpx;" placeholder-class="fs-28 col999" placeholder="请输入验证码"/>
|
|
<view @click="verificationes()" class="get_corasd tct fs24 colfff">
|
|
{{verifications?`倒计时${times}s` : '获取验证码' }}
|
|
</view>
|
|
</view>
|
|
<view class="border_level_bottom_f1 pdlft20 pdRit20" style="border-radius: 8rpx;margin-top: 50rpx;">
|
|
<view class="fs-30 col333 bold">输入新密码</view>
|
|
<input v-model="password" type="text" class="fs-28 col333" style="width: 500rpx;height: 80rpx;" placeholder-class="fs-28 col999" placeholder="请输入密码"/>
|
|
</view>
|
|
<view class="border_level_bottom_f1 pdlft20 pdRit20" style="border-radius: 8rpx;margin-top: 50rpx;">
|
|
<view class="fs-30 col333 bold">确认新密码</view>
|
|
<input v-model="passwords" type="text" class="fs-28 col333" style="width: 500rpx;height: 80rpx;" placeholder-class="fs-28 col999" placeholder="请输入确认密码"/>
|
|
</view>
|
|
<view @click="isSubmit" class="logis_dsfg colfff fs34 tct">立即找回</view>
|
|
<view class="tct fs-24 col999 pt-67">
|
|
<text class="mr-10">还未注册? </text>
|
|
<text @tap="goBack()" class="col">立即注册</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
timerInsad:null,//定时器
|
|
phone:'',//手机号
|
|
password:'',//密码
|
|
passwords:'',//确认密码
|
|
code:'',//验证码
|
|
times:199,//倒计时的时间
|
|
verifications:false,//显示的那个倒计时
|
|
}
|
|
},
|
|
onReady() {
|
|
this.heigha = uni.getSystemInfoSync().windowHeight;//获取设备高
|
|
},
|
|
onShow() {
|
|
|
|
},
|
|
methods: {
|
|
goXieYi() {//软件许可协议
|
|
this.$tools.goNext(`/pageTwo/my/setAll/permitApp`);
|
|
},
|
|
verificationes() {// 获取验证码的事件
|
|
if(this.verifications) {
|
|
this.$tools.showtt('您已获取验证码')
|
|
} else {
|
|
if(!(/^1[3456789]\d{9}$/.test(this.phone))) {
|
|
this.$tools.showtt('手机号格式不正确','none')
|
|
return false
|
|
} else {
|
|
let obj = {
|
|
mobile:this.phone,//手机号
|
|
flag:'1',
|
|
}
|
|
this.$tools.axios('POST','sms/send',obj).then(zifan => {
|
|
if(zifan.code == 0) {
|
|
this.$tools.showtt(zifan.msg+'')
|
|
this.verifications = true
|
|
this.timerInsad = setInterval( res => {
|
|
if(this.times <= 0) {
|
|
this.verifications = false
|
|
this.times = 199
|
|
this.code = ''
|
|
clearInterval(this.timerInsad)
|
|
} else {
|
|
this.times--
|
|
}
|
|
},1000)
|
|
} else {
|
|
this.$tools.showtt(zifan.msg+'')
|
|
}
|
|
})
|
|
}
|
|
}
|
|
},
|
|
loginOne() {//按钮
|
|
let obj = {
|
|
mobile:this.phone,//手机号
|
|
password:this.password,//密码
|
|
newpassword: this.passwords,//确认密码
|
|
code:this.code,//验证码
|
|
}
|
|
this.$tools.axios('POST','user/resetpwd',obj,'修改中').then(one => {
|
|
clearInterval(this.timerInsad)
|
|
this.$tools.showtt(one.msg)
|
|
this.verifications = false
|
|
this.times = 199
|
|
|
|
if(one.code == 1) {
|
|
setTimeout(two => {
|
|
this.$tools.goBack(1)
|
|
},600)
|
|
} else {
|
|
this.password = '';
|
|
this.passwords = '';
|
|
this.phone = '';
|
|
this.code = '';
|
|
|
|
}
|
|
})
|
|
},
|
|
isSubmit() {//做的飞空验证
|
|
if (!(/^1[3456789]\d{9}$/.test(this.phone))) {
|
|
this.$tools.showtt('手机号格式不正确')
|
|
return false
|
|
}
|
|
if(!this.password) {
|
|
this.$tools.showtt('请输入密码')
|
|
return false
|
|
}
|
|
if(this.password != this.passwords) {
|
|
this.$tools.showtt('两次密码输入不一致')
|
|
return false
|
|
}
|
|
if(!this.code) {
|
|
this.$tools.showtt('请输入验证码')
|
|
return false
|
|
}
|
|
this.loginOne();//注册
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.container {
|
|
width: 750rpx;
|
|
padding-left: 50rpx;
|
|
padding-right: 50rpx;
|
|
}
|
|
.logis_dsfg {
|
|
height: 100rpx;
|
|
line-height: 100rpx;
|
|
background-image: linear-gradient(#ff5c5b,#fa3427);
|
|
border-radius: 100rpx;
|
|
margin-top: 100rpx;
|
|
}
|
|
.get_corasd {
|
|
position: absolute;
|
|
bottom: 15rpx;
|
|
right: 0rpx;
|
|
width: 180rpx;
|
|
height: 60rpx;
|
|
color: #fa3326;
|
|
border: 2rpx solid #fa3326;
|
|
font-size: 24rpx;
|
|
border-radius: 100rpx;
|
|
line-height: 56rpx;
|
|
}
|
|
.border_level_bottom_f1 {
|
|
border-bottom: 2rpx solid #f1f1f1;
|
|
}
|
|
</style>
|