123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <!DOCTYPE html>
- <html class="h100p">
- <head>
- <meta charset="utf-8">
- <title>忘记密码-创业帮</title>
- <meta name="keywords" content="忘记密码-创业帮">
- <meta name="description" content="忘记密码-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="忘记密码-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="h100p nopb">
- <div id="app" v-cloak>
- <div class="forgetpassword">
- <van-nav-bar title="忘记/修改密码" v-if="toptitleisshow" @click-left="goback" left-arrow>
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <div class="forgettitle c333 tc"> </div>
- <div class="login-box abs tc">
- <div class="f17 c333">为了您的账号安全,请验证身份</div>
- <van-field class="mb12" v-model="reg.Mobile" @input="checkValue" type="number" placeholder="请输入手机号"></van-field>
- <van-field class="user-phone mb12" center clearable placeholder="短信验证码" v-model="reg.MobileCode" @input="checkValue">
- <template #button>
- <van-button class="fl" plain color="#FD824D" @click="getsmscode" v-if="codeisclick">获取验证码</van-button>
- <van-button class="fl" plain color="#FD824D" disabled v-else>{{countdown}}s</van-button>
- </template>
- </van-field>
- <van-field class="mb12" v-model="reg.LoginPwd" @input="checkValue" :type="isShowPwd ? 'text' : 'password'" placeholder="填写新密码">
- <template #button>
- <van-button class="fr" @click="showPwd()"><img class="fr" :src="isShowPwd ? './static/images/show-icon@3x.png' : './static/images/noshow-icon@3x.png'" alt=""></van-button>
- </template>
- </van-field>
- <van-field v-model="surepassword" @input="checkValue" :type="isShowPwd ? 'text' : 'password'" placeholder="确认新密码"></van-field>
- <div class="pt16" v-cloak>
- <van-button type="primary" block round :disabled="canRegist ? false : true" color="#FD824D" @click="changepwd">确认</van-button>
- </div>
- </div>
- </div>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- toptitleisshow:false,
- active: 0,
- surepassword: '',
- isShowPwd: false,
- reg:{
- Mobile: '',
- MobileCode: '',
- LoginPwd:''
- },
- agreement: false,
- canRegist: false,
- codeisclick:true,
- countdown:60
- };
- },
- created(){
- this.toptitleisshow = toptitleisshow;
- },
- methods: {
- //- 显示密码
- showPwd(){
- this.isShowPwd = !this.isShowPwd;
- },
- //- 确定按钮是否能够使用
- checkValue(){
- this.canRegist = (this.reg.Mobile !== '' && this.reg.MobileCode !== '' && this.reg.LoginPwd !== '' && this.surepassword !== '') ? true : false;
- },
- //- 获取验证码
- async getsmscode(){
- if(verification(this.reg.Mobile)) return;
- this.codeisclick = false;
- setTimeout(()=>{
- this.codeisclick = true;
- },60000);
- const timer = setInterval(()=>{
- this.countdown--;
- if(this.countdown === 0) {
- this.countdown = 60;
- clearInterval(timer)
- };
- },1000);
- const res = await postRequest('/api/v1/mobilecodecheck/sendsms',JSON.stringify({Mobile:this.reg.Mobile}));
- if(res.status !== '1') tips(res.info);
- tips('验证码发送成功,请注意查收!');
- },
- //- 修改密码
- async changepwd(){
- if(verificationpassword(this.reg.LoginPwd)) return;
- if(verificationmobilecode(this.reg.MobileCode)) return;
- if(verification(this.reg.Mobile)) return;
- if(this.reg.LoginPwd !== this.surepassword){
- return tips('两次密码不一致,请重新输入!');
- };
- const res = await postRequest('/api/v1/merchantinfo/forgetpwd?t='+Math.random(6),JSON.stringify(this.reg));
- if(res.status !== '1') return tips(res.info);
- tips('修改密码成功,请返回登录');
- setTimeout(()=>{
- this.goback();
- },2000);
- },
- goback(){
- PublicLib.GoBack({Level:1});
- }
- }
- });
- </script>
- </body>
- </html>
|