new

parents edcedc70 9438afcb
...@@ -232,7 +232,7 @@ body { overflow-x: hidden; } ...@@ -232,7 +232,7 @@ body { overflow-x: hidden; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .inp.w180 { width: 180px; } .lx-findpwd-content .lx-findpwd-wrap .step-box .inp.w180 { width: 180px; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .inp.w120 { width: 120px; } .lx-findpwd-content .lx-findpwd-wrap .step-box .inp.w120 { width: 120px; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .inp.w210 { width: 210px; } .lx-findpwd-content .lx-findpwd-wrap .step-box .inp.w210 { width: 210px; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action { padding: 80px 0; width: 614px; margin: 0 auto; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action { position: relative; padding: 80px 0; width: 614px; margin: 0 auto; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap { position: relative; margin-bottom: 20px; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap { position: relative; margin-bottom: 20px; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .tag { width: 138px; text-align: right; font-size: 14px; color: #333333; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .tag { width: 138px; text-align: right; font-size: 14px; color: #333333; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .tag em { font-size: 14px; color: #e10607; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .tag em { font-size: 14px; color: #e10607; }
...@@ -240,9 +240,9 @@ body { overflow-x: hidden; } ...@@ -240,9 +240,9 @@ body { overflow-x: hidden; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .code .pic { width: 98px; height: 38px; background-color: #ffffff; border: solid 1px #e5e5e5; cursor: pointer; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .code .pic { width: 98px; height: 38px; background-color: #ffffff; border: solid 1px #e5e5e5; cursor: pointer; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .code .pic img { width: 100%; height: 100%; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .code .pic img { width: 100%; height: 100%; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .code a { margin-left: 18px; color: #333333; font-size: 12px; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .code a { margin-left: 18px; color: #333333; font-size: 12px; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .error { font-size: 12px; color: #e10607; position: absolute; left: 498px; top: 12px; text-align: left; width: 121px; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .send-code { width: 118px; height: 38px; line-height: 38px; text-align: center; background-color: #ffffff; border: solid 1px #e5e5e5; font-size: 12px; color: #333333; margin-left: 10px; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .send-code { width: 118px; height: 38px; line-height: 38px; text-align: center; background-color: #ffffff; border: solid 1px #e5e5e5; font-size: 12px; color: #333333; margin-left: 10px; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .txt { font-size: 14px; color: #333333; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .inp-wrap .txt { font-size: 14px; color: #333333; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .error { font-size: 12px; color: #e10607; position: absolute; left: 150px; bottom: 139px; text-align: left; width: 190px; display: none; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .bnt-wrap { margin-top: 60px; text-align: center; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .bnt-wrap { margin-top: 60px; text-align: center; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .bnt-wrap.mt1 { margin-left: -118px; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .bnt-wrap.mt1 { margin-left: -118px; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .bnt-wrap .btn { width: 200px; height: 35px; background-color: #1080d0; border-radius: 3px; border: solid 1px #1080d0; line-height: 35px; text-align: center; font-size: 16px; } .lx-findpwd-content .lx-findpwd-wrap .step-box .form-action .bnt-wrap .btn { width: 200px; height: 35px; background-color: #1080d0; border-radius: 3px; border: solid 1px #1080d0; line-height: 35px; text-align: center; font-size: 16px; }
......
...@@ -872,6 +872,7 @@ ...@@ -872,6 +872,7 @@
} }
} }
.form-action { .form-action {
position: relative;
padding: 80px 0; padding: 80px 0;
width: 614px; width: 614px;
margin: 0 auto; margin: 0 auto;
...@@ -907,15 +908,6 @@ ...@@ -907,15 +908,6 @@
font-size: 12px; font-size: 12px;
} }
} }
.error {
font-size: 12px;
color: #e10607;
position: absolute;
left: 498px;
top: 12px;
text-align: left;
width: 121px;
}
.send-code { .send-code {
width: 118px; width: 118px;
height: 38px; height: 38px;
...@@ -932,6 +924,16 @@ ...@@ -932,6 +924,16 @@
color: #333333; color: #333333;
} }
} }
.error {
font-size: 12px;
color: #e10607;
position: absolute;
left: 150px;
bottom: 139px;
text-align: left;
width: 190px;
display: none;
}
.bnt-wrap { .bnt-wrap {
margin-top: 60px; margin-top: 60px;
text-align: center; text-align: center;
......
;!function () {
window.ForgetPassword = {
'code': "#code",//验证码
'submitStep1': "#submitStep1",//第一步
init: function () {
this.handleBind(this);
},
getMobile: function () {
var val = $("input[name='mobile']").val();
if (val) {
return val;
}
return false;
},
getCodes: function () {
var val = $("input[name='codes']").val();
if (val) {
return val;
}
return false;
},
getCode: function () {
var val = $("input[name='code']").val();
if (val) {
return val;
}
return false;
},
getData: function (params, callback, type) {
var url;
switch (type) {
case 'moblieCode':
url = ' /helper/moblieCode';
break;
case 'ApiRestPassword':
url = '/api/ApiRestPassword';
break;
}
$.ajax({
url: _URL_ + url,
type: 'post',
data: params,
async: false,
dataType: 'json',
timeout: 10000,
success: function (res) {
if (res.code == 0) {
typeof callback == 'function' && callback(res);
} else {
layer.msg(res.msg);
}
},
error: function (res) {
layer.msg('网络出现问题,请重试!')
}
})
},
calcForm: function (opt, type) {
if (type == 'step1') {
if (!opt.getMobile()) {
$(".error").show().text('请输入手机号');
return false;
}
if (!opt.getCodes()) {
$(".error").show().text('请填写验证码');
return false;
}
}
$(".error").hide().text('');
return true;
},
handleBind: function (opt) {
//验证码
$(opt.code).on('click', function () {
$(this).prev().find('img').attr('src', '/helper/captcha?' + new Date().getTime())
});
//第一步提交
$(opt.submitStep1).on('click', function () {
if (opt.calcForm(opt, 'step1')) {
$(".step-list").find('li').eq(1).addClass('curr');
$(".step-1").hide();
$(".step-2").show();
}
});
return this;
},
}, $(function () {
ForgetPassword.init();
})
}();
\ No newline at end of file
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
this.handleBind(this); this.handleBind(this);
}, },
getUserName: function () { getUserName: function () {
var val = $("input[name='username']").val(); var val = $("input[name='account_name']").val();
if (val) { if (val) {
return val; return val;
} }
return false; return false;
}, },
getPasswd: function () { getPasswd: function () {
var val = $("input[name='pwd']").val(); var val = $("input[name='password']").val();
if (val) { if (val) {
return val; return val;
} }
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (res) { success: function (res) {
if (resp.code > 0) { if (res.code == 0) {
layer.msg(resp.msg);
} else {
typeof callback == 'function' && callback(res); typeof callback == 'function' && callback(res);
} else {
layer.msg(res.msg);
} }
}, },
error: function (res) { error: function (res) {
...@@ -74,18 +74,23 @@ ...@@ -74,18 +74,23 @@
//提交 //提交
$(opt.submit).on('click', function () { $(opt.submit).on('click', function () {
if (opt.calcForm(opt)) { if (opt.calcForm(opt)) {
opt.getData(function (res) { var params = {
setCookie('yunxin_token', resp.data) 'account_name': $("input[name='account_name']").val(),
'password': $.md5($("input[name='password']").val()),
'code': $("input[name='code']").val()
}
opt.getData(params, function (res) {
Util.setCookie('yunxin_token', res.data,1,cookieHostname)
window.location.href = "/web/orderList" window.location.href = "/web/orderList"
}); });
} }
}); });
$("input[name='username']").on('blur', function () { $("input[name='account_name']").on('blur', function () {
opt.calcForm(opt); opt.calcForm(opt);
}); });
$("input[name='pwd']").on('blur', function () { $("input[name='password']").on('blur', function () {
opt.calcForm(opt); opt.calcForm(opt);
}); });
......
...@@ -101,5 +101,5 @@ ...@@ -101,5 +101,5 @@
window.Util = Util; window.Util = Util;
} }
})(window); })(window);
var cookieHostname = window.location.hostname.split(".")[1] + "." + window.location.hostname.split(".")[2];
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
<link rel="stylesheet" type="text/css" href="/pc/js/layui/css/layui.css?v={{ $time }}"> <link rel="stylesheet" type="text/css" href="/pc/js/layui/css/layui.css?v={{ $time }}">
<link rel="stylesheet" type="text/css" href="/pc/css/style.min.css?v={{ $time }}"> <link rel="stylesheet" type="text/css" href="/pc/css/style.min.css?v={{ $time }}">
<script> <script>
//存放公共变量 //存放公共变量
var _URL_ = "<?php echo $_URL_; ?>"; var _URL_ = "<?php echo $_URL_; ?>";
var _DOMAIN_ = "<?php echo $_DOMAIN_; ?>"; var _DOMAIN_ = "<?php echo $_DOMAIN_; ?>";
</script> </script>
</head> </head>
<body> <body>
...@@ -65,12 +65,12 @@ ...@@ -65,12 +65,12 @@
<p class="tit">找回密码</p> <p class="tit">找回密码</p>
<div class="step-box"> <div class="step-box">
<ul class="step-list clr"> <ul class="step-list clr">
<li class="curr disabled"> <li class="curr">
<b class="line"></b> <b class="line"></b>
<em>1</em> <em>1</em>
<p>填写用户手机号</p> <p>填写用户手机号</p>
</li> </li>
<li class="curr"> <li>
<b class="line"></b> <b class="line"></b>
<em>2</em> <em>2</em>
<p>验证手机号</p> <p>验证手机号</p>
...@@ -86,25 +86,26 @@ ...@@ -86,25 +86,26 @@
<p>完成</p> <p>完成</p>
</li> </li>
</ul> </ul>
<div class="step-1" style="display: none"> <div class="step-1">
<div class="form-action"> <div class="form-action">
<div class="inp-wrap"> <form action="step1">
<label class="tag lineBlock va-m"><em>*</em>手机号码:</label> <div class="inp-wrap">
<input type="password" placeholder="请输入手机号" class="inp va-m w338"> <label class="tag lineBlock va-m"><em>*</em>手机号码:</label>
<em class="error">手机格式不对</em> <input type="password" placeholder="请输入手机号" class="inp va-m w338" name="mobile">
</div> </div>
<div class="inp-wrap"> <div class="inp-wrap">
<label class="tag lineBlock va-m"><em>*</em>验证码:</label> <label class="tag lineBlock va-m"><em>*</em>验证码:</label>
<input type="text" placeholder="请输入验证码" class="inp va-m w158"> <input type="text" placeholder="请输入验证码" class="inp va-m w158" name="codes">
<div class="lineBlock va-m code"> <div class="lineBlock va-m code">
<div class="pic lineBlock va-m"><img src="./images/verify.png" alt=""></div> <div class="pic lineBlock va-m"><img src="/helper/captcha" alt=""></div>
<a href="javascript:;" class="va-m">换一张</a> <a href="javascript:;" class="va-m" id="code">换一张</a>
</div>
</div>
<div class="bnt-wrap mt1">
<a href="javascript:;" class="ok btn lineBlock" id="submitStep1">下一步</a>
</div> </div>
<em class="error">验证码错误</em> <em class="error">验证码错误</em>
</div> </form>
<div class="bnt-wrap mt1">
<a href="javascript:;" class="ok btn lineBlock">下一步</a>
</div>
</div> </div>
</div> </div>
<div class="step-2" style="display: none"> <div class="step-2" style="display: none">
...@@ -115,7 +116,7 @@ ...@@ -115,7 +116,7 @@
</div> </div>
<div class="inp-wrap"> <div class="inp-wrap">
<label class="tag lineBlock va-m"><em>*</em>验证码:</label> <label class="tag lineBlock va-m"><em>*</em>验证码:</label>
<input type="text" placeholder="请输入验证码" class="inp va-m w210"> <input type="text" placeholder="请输入验证码" class="inp va-m w210" name="code">
<a href="javascript:;" class="lineBlock va-m send-code">发送验证码</a> <a href="javascript:;" class="lineBlock va-m send-code">发送验证码</a>
<em class="error">验证码错误</em> <em class="error">验证码错误</em>
</div> </div>
...@@ -141,7 +142,7 @@ ...@@ -141,7 +142,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="step-4"> <div class="step-4" style="display: none">
<div class="done"> <div class="done">
<i class="iconfont icon-chenggong-"></i> <i class="iconfont icon-chenggong-"></i>
<p class="t1">新密码重置成功!</p> <p class="t1">新密码重置成功!</p>
...@@ -153,6 +154,9 @@ ...@@ -153,6 +154,9 @@
</div> </div>
<!--content end--> <!--content end-->
<script type="text/javascript" src="/pc/js/jquery.min.js"></script> <script type="text/javascript" src="/pc/js/jquery.min.js"></script>
<script type="text/javascript" src="/pc/js/layui/layui.js"></script> <script type="text/javascript" src="/pc/js/global.js"></script>
<script type="text/javascript" src="/pc/js/layui/layui.all.js"></script>
<script type="text/javascript" src="/pc/js/controller/ForgetPassword.js"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
<i class="icn i-1"></i> <i class="icn i-1"></i>
<b class="lineBlock emptys"></b> <b class="lineBlock emptys"></b>
</div> </div>
<input type="text" placeholder="请输入手机号/邮箱/企业用户名" name="username"> <input type="text" placeholder="请输入手机号/邮箱/企业用户名" name="account_name">
</div> </div>
<div class="inp-wrap"> <div class="inp-wrap">
<div class="arr"> <div class="arr">
<i class="icn i-2"></i> <i class="icn i-2"></i>
<b class="lineBlock emptys"></b> <b class="lineBlock emptys"></b>
</div> </div>
<input type="text" placeholder="请输入登录密码" name="pwd"> <input type="text" placeholder="请输入登录密码" name="password">
</div> </div>
<div class="code clr"> <div class="code clr">
<div class="code-inp fl"> <div class="code-inp fl">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment