no message
This commit is contained in:
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<TopSafe></TopSafe>
|
||||
<Header title="忘记密码" />
|
||||
<view class="contract-view">
|
||||
<view class="input-view">
|
||||
<up-input placeholder="请输入手机号" border="surround" v-model="form.mobile" :customStyle="inputCss"></up-input>
|
||||
</view>
|
||||
<view class="input-view">
|
||||
<up-input placeholder="请输入验证码" border="surround" v-model="form.smsCode" :customStyle="inputCss">
|
||||
<template #suffix style="margin-right: 10rpx;">
|
||||
<view v-if="countdown" class="code-warp">
|
||||
<up-count-down :time="60 * 1000" format="ss" @finish="countdown = false"></up-count-down>
|
||||
<text style="margin-left: 10rpx;">s</text>
|
||||
</view>
|
||||
<view v-else @click="getMobileCode" class="code_msg">
|
||||
获取验证码
|
||||
</view>
|
||||
</template>
|
||||
</up-input>
|
||||
</view>
|
||||
<view class="input-view">
|
||||
<up-input placeholder="请输入登录密码" border="surround" v-model="form.pass" :customStyle="inputCss"
|
||||
:type="loginPasswordIsShow ? 'text' : 'password'">
|
||||
<template #suffix style="margin-right: 10rpx;">
|
||||
<up-image v-if="loginPasswordIsShow" src="/static/login/show.png" width="20" height="20" bgColor="#f1f6ff00"
|
||||
@click="loginPasswordIsShow = false;"></up-image>
|
||||
<up-image v-else src="/static/login/hidden.png" width="20" height="20" bgColor="#f1f6ff00"
|
||||
@click="loginPasswordIsShow = true;"></up-image>
|
||||
</template>
|
||||
</up-input>
|
||||
</view>
|
||||
<view class="input-view">
|
||||
<up-input placeholder="请输入登录密码" border="surround" v-model="form.passOne" :customStyle="inputCss"
|
||||
:type="loginPassword2IsShow ? 'text' : 'password'">
|
||||
<template #suffix style="margin-right: 10rpx;">
|
||||
<up-image v-if="loginPassword2IsShow" src="/static/login/show.png" width="20" height="20" bgColor="#f1f6ff00"
|
||||
@click="loginPassword2IsShow = false;"></up-image>
|
||||
<up-image v-else src="/static/login/hidden.png" width="20" height="20" bgColor="#f1f6ff00"
|
||||
@click="loginPassword2IsShow = true;"></up-image>
|
||||
</template>
|
||||
</up-input>
|
||||
</view>
|
||||
<view class="login_comm_but login_comm_but_yes" style="margin-top:48rpx" @click="registerFun" >
|
||||
确认修改
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserList } from '@/api/common.js';
|
||||
import { forgotPassword } from '@/api/auth.js';
|
||||
import Header from '@/components/common/header.vue';
|
||||
import TopSafe from '@/components/common/top-safe.nvue'
|
||||
import CryptoJS from 'crypto-js';
|
||||
|
||||
export default {
|
||||
components: { Header, TopSafe },
|
||||
data() {
|
||||
return {
|
||||
form:{
|
||||
mobile:'',
|
||||
smsCode:'',
|
||||
pass:'',
|
||||
passOne:''
|
||||
|
||||
},
|
||||
loginPasswordIsShow:false,
|
||||
loginPassword2IsShow:false,
|
||||
countdown: false,// 清空倒计时
|
||||
inputCss: {
|
||||
"height": '80rpx',
|
||||
"background": "#F3F3F3FF",
|
||||
"border-radius": "30rpx",
|
||||
"border": "0rpx",
|
||||
"padding-left": "16px",
|
||||
},
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {
|
||||
async getMobileCode() {
|
||||
const form = this.form;
|
||||
if (!form.mobile) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: "请输入手机号码",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.countdown = true;
|
||||
|
||||
const params = {
|
||||
mobile: form.mobile,
|
||||
type: 'passwd',
|
||||
}
|
||||
const response = await getUserList(params);
|
||||
if (response && response.bizcode === 100) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'success',
|
||||
message: response.msg,
|
||||
});
|
||||
} else {
|
||||
this.countdown = false;
|
||||
}
|
||||
},
|
||||
registerFun(){
|
||||
if (!this.form.mobile) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: "请输入手机号码",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.form.smsCode) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: "请输入验证码",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.form.pass || !this.form.passOne) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: "请输入密码",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.form.pass !== this.form.passOne) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'error',
|
||||
message: "两次输入的登录密码不一致",
|
||||
});
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
verificationCode:this.form.smsCode,
|
||||
newPassword:CryptoJS.MD5(this.form.pass).toString()
|
||||
}
|
||||
forgotPassword(params).then(res=>{
|
||||
console.log('params',res)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contract-view {
|
||||
width: 100%;
|
||||
height: calc(100% - 88rpx - var(--status-bar-height));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
overflow-y: auto;
|
||||
padding: 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
.input-view{
|
||||
width:100%;
|
||||
height:100rpx;
|
||||
background-color: #f3f3f3;
|
||||
border-radius: 16rpx;
|
||||
margin-top:48rpx;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user