|
@@ -0,0 +1,214 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="en">
|
|
|
+
|
|
|
+<head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta name="viewport"
|
|
|
+ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
|
+ <meta name='apple-touch-fullscreen' content='yes'>
|
|
|
+ <meta name="apple-mobile-web-app-capable" content="yes" />
|
|
|
+ <meta content="fullscreen=yes,preventMove=no" name="ML-Config">
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
+ <meta name="renderer" content="webkit">
|
|
|
+ <meta name="apple-mobile-web-app-capable" content="yes" />
|
|
|
+ <meta name="keywords" content="电子烟,关键字" />
|
|
|
+ <meta name="Description" content="网站描述" />
|
|
|
+ <title>找回密码</title>
|
|
|
+ <link rel="stylesheet" href="/assets/index/css/common.css?t=10100">
|
|
|
+ <link rel="stylesheet" href="/assets/index/css/retrievePassword.css">
|
|
|
+</head>
|
|
|
+
|
|
|
+<body>
|
|
|
+ <main id="main">
|
|
|
+ <div class="pageContainer">
|
|
|
+ <div class="pageLogo">
|
|
|
+ <img src="/assets/index/asstes/icon/logo.png" alt="">
|
|
|
+ </div>
|
|
|
+ <section class="pageSection">
|
|
|
+ <!-- 登录模块 -->
|
|
|
+ <div id="loginModel">
|
|
|
+ <h1 class="modelTitle">Retrieve password</h1>
|
|
|
+ <div class="modelContainer">
|
|
|
+ <!-- 电子邮箱 -->
|
|
|
+ <div class="modelItem">
|
|
|
+ <p class="miTitle">电子邮箱</p>
|
|
|
+ <input class="input" type="text" name="" id="email">
|
|
|
+ </div>
|
|
|
+ <!-- 验证码 -->
|
|
|
+ <div class="modelItem">
|
|
|
+ <p class="miTitle">验证码</p>
|
|
|
+ <input class="input" type="text" name="" id="vcode">
|
|
|
+ <div class="modelItemButon" id="getCode">Get code</div>
|
|
|
+ </div>
|
|
|
+ <!-- 新密码 -->
|
|
|
+ <div class="modelItem">
|
|
|
+ <p class="miTitle">新密码</p>
|
|
|
+ <input class="input" type="password" name="" id="password">
|
|
|
+ </div>
|
|
|
+ <!-- 确认新密码 -->
|
|
|
+ <div class="modelItem">
|
|
|
+ <p class="miTitle">确认密码</p>
|
|
|
+ <input class="input" type="password" name="" id="confirmPassword">
|
|
|
+ </div>
|
|
|
+ <!-- 找回密码 -->
|
|
|
+ <div class="pageButton" id="retrieve">找回密码</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+ <!-- 吐司提示 -->
|
|
|
+ <div id="toastContainer"></div>
|
|
|
+</body>
|
|
|
+<script src="/assets/index/js/jquery-1.12.0.js"></script>
|
|
|
+<script src="/assets/index/js/flexible.js"></script>
|
|
|
+<script src="/assets/index/js/public.js"></script>
|
|
|
+<script src="/assets/index/js/login.js?y=10"></script>
|
|
|
+<script>
|
|
|
+ $(document).ready(function () {
|
|
|
+ //用户存储token名
|
|
|
+ const VAPES_TOKEN = "vapes_token"
|
|
|
+ //触屏事件 || 点击事件
|
|
|
+ const tap = "ontouchstart" in window ? "touchstart" : "click";
|
|
|
+ //倒计时秒数
|
|
|
+ let countdown = 60;
|
|
|
+ //定时器
|
|
|
+ let countdownTimer;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 吐司提示
|
|
|
+ * @param message 消息
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+ function showToast(message) {
|
|
|
+ var toastElement = $('#toastContainer');
|
|
|
+ toastElement.text(message);
|
|
|
+ toastElement.stop(true, true).fadeIn(200).delay(2000).fadeOut(200);
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取验证码
|
|
|
+ $("#getCode").on(tap, function (event) {
|
|
|
+ event.preventDefault();
|
|
|
+ // 如果倒计时已经在进行中,则忽略点击事件
|
|
|
+ console.log(countdownTimer)
|
|
|
+ if (countdownTimer) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const emailEle = $("#email");
|
|
|
+ if (!emailEle) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //邮箱
|
|
|
+ const email = emailEle.val()
|
|
|
+ if (!email || email == "") {
|
|
|
+ emailEle.focus();
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log("邮箱", email)
|
|
|
+
|
|
|
+ // 点击后立即执行一次倒计时
|
|
|
+ countdown = 60
|
|
|
+ $(this).text(countdown + 's');
|
|
|
+ countdown--;
|
|
|
+
|
|
|
+ // 开始倒计时
|
|
|
+ countdownTimer = setInterval(() => {
|
|
|
+ if (countdown <= 0) {
|
|
|
+ clearInterval(countdownTimer);
|
|
|
+ countdownTimer = null;
|
|
|
+ // 倒计时结束后恢复按钮状态
|
|
|
+ $(this).text('Get code');
|
|
|
+ } else {
|
|
|
+ $(this).text(countdown + 's');
|
|
|
+ countdown--;
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ });
|
|
|
+
|
|
|
+ //找回密码
|
|
|
+ $("#retrieve").on(tap, function (event) {
|
|
|
+ event.preventDefault();
|
|
|
+ const emailEle = $("#email");
|
|
|
+ const vcodeEle = $("#vcode");
|
|
|
+ const passwordEle = $("#password");
|
|
|
+ const confirmPasswordEle = $("#confirmPassword");
|
|
|
+
|
|
|
+ //输入框不存在
|
|
|
+ if (!emailEle || !vcodeEle || !passwordEle || !confirmPasswordEle) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //邮箱
|
|
|
+ const email = emailEle.val()
|
|
|
+ //验证码
|
|
|
+ const vcode = vcodeEle.val()
|
|
|
+ //密码
|
|
|
+ const password = passwordEle.val()
|
|
|
+ //确认密码
|
|
|
+ const confirmPassword = confirmPasswordEle.val()
|
|
|
+
|
|
|
+ if (!email || email == "") {
|
|
|
+ emailEle.focus();
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!vcode || vcode == "") {
|
|
|
+ vcodeEle.focus();
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!password || password == "") {
|
|
|
+ passwordEle.focus();
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!confirmPassword || confirmPassword == "") {
|
|
|
+ confirmPasswordEle.focus();
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log("邮箱", email)
|
|
|
+ console.log("验证码", vcode)
|
|
|
+ console.log("密码", password)
|
|
|
+ console.log("确认密码", confirmPassword)
|
|
|
+ if (password !== confirmPassword) {
|
|
|
+ showToast("两次密码不一致")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var dp = {
|
|
|
+ form: {
|
|
|
+ mobile: email,
|
|
|
+ smsCode: vcode,
|
|
|
+ password: password,
|
|
|
+ password1: confirmPassword,
|
|
|
+ isParty: false,
|
|
|
+ partyData: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: "/index/passport/retrievePassword",
|
|
|
+ headers: {platform: 'H5'},
|
|
|
+ dataType: 'json',
|
|
|
+ data: JSON.stringify(dp),
|
|
|
+ type: "POST",
|
|
|
+ contentType: 'application/json',
|
|
|
+ success: function (obj) {
|
|
|
+ console.log(obj);
|
|
|
+ //return false;
|
|
|
+ //注册成功后进入
|
|
|
+ if (obj.status === 200 || obj.status === '200') {
|
|
|
+ showToast(obj.message)
|
|
|
+ setTimeout(function (){
|
|
|
+ window.location.replace('/index/passport/logIn.html');
|
|
|
+ },3000)
|
|
|
+ //localStorage.setItem(VAPES_TOKEN, obj.data.token)
|
|
|
+ }else {
|
|
|
+ showToast(obj.message)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ });
|
|
|
+ })
|
|
|
+</script>
|
|
|
+
|
|
|
+</html>
|