Commit 830c9b66 by 陈超

T

parent f65f0e84
......@@ -34,6 +34,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.6/lib/index.css" />
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vant@2.6/lib/vant.min.js"></script>
<script src="__THEMEW3G__/js/extension.js" charset="utf-8"></script>
<script>
//全局变量
......
......@@ -53,7 +53,7 @@
<div class="login_input_frame layout_v">
<van-field class="login_input" left-icon="__THEME__/img/account_icon.png" v-model="phone" type="tel" placeholder="请输入手机号"></van-field>
<van-field class="login_input" left-icon="__THEME__/img/pwd_icon.png" v-model="password" type="password" placeholder="请输入6~18位密码"></van-field>
<van-field class="login_input" left-icon="__THEME__/img/pwd_icon.png" v-model="password" type="password" maxlength="18" placeholder="请输入6~18位密码"></van-field>
<div class="van-hairline--bottom" style="transform: scaleY(.5);"></div>
</div>
<div class="layout_h_b login_action_bar">
......@@ -74,14 +74,6 @@
$("#preloader").hide()
});
String.prototype.isMobile = function() {
return (/^1[3|4|5|6|7|8|9]\d{9}$/.test(this));
}
String.prototype.isPwd = function() {
return this.length >= 6 && this.length <= 18
}
new Vue({
el: '#app',
data: function() {
......
......@@ -107,7 +107,7 @@
</div>
</template>
</van-field>
<van-field v-model="password" label="密码" type="password" maxlength="16" placeholder="请输入6~18位密码"></van-field>
<van-field v-model="password" label="密码" type="password" maxlength="18" placeholder="请输入6~18位密码"></van-field>
<div @click="onConfirm" :class="isOk ? 'confirm_button' : 'confirm_button_disable'" style="margin-top: 6.625rem;">
<span>注册并登录</span>
</div>
......@@ -120,18 +120,6 @@
$("#preloader").hide();
})
String.prototype.isMobile = function() {
return (/^1[3|4|5|6|7|8|9]\d{9}$/.test(this));
}
String.prototype.isCode = function() {
return this.length == 4 || this.length == 6
}
String.prototype.isPwd = function() {
return this.length >= 6 && this.length <= 18
}
new Vue({
el: '#app',
data: function() {
......
<include file="__THEME__/_header_w3g" />
<script>
var REPOHNE_VAR="{:U('home/Repwd/getVrifi')}";
var REPWDHANDLE="{:U('home/Repwd/repwdhandle')}";
var REPWDEMAIL="{:U('basic/Passport/doFindPasswordByEmail')}";
var OKEMAILADD="{:U('basic/Passport/okemailadd')}";
</script>
<div class="content">
<!-- <div class="content">
<div class="loginbox">
<a class="icon-colse" href="/"></a>
<ul class="logintype">
......@@ -109,185 +108,260 @@
</div>
</div>
</div> -->
<div id="app">
<div class="layout_v">
<div class="layout_v" style="margin-top: 0.625rem;">
<van-field v-model="phone" label="手机号" type="number" placeholder="请输入手机号"></van-field>
<van-field v-model="code" label="验证码" type="digit" maxlength="6" placeholder="请输入验证码">
<template #button>
<div @click="onSendCode" class="layout_center" :class="valid ? 'button_green' : 'button_disable'">
<span class="self_center">{{codeText}}</span>
</div>
</template>
</van-field>
<van-field v-model="password" label="新密码" type="password" maxlength="18" placeholder="请输入6~18位密码"></van-field>
<van-field v-model="password" label="请确认密码" type="repassword" maxlength="18" placeholder="请输入6~18位密码"></van-field>
<div @click="onConfirm" :class="isOk ? 'confirm_button' : 'confirm_button_disable'" style="margin-top: 3.5rem;">
<span>修改密码</span>
</div>
</div>
</div>
</div>
<script>
$(function(){
$("#preloader").hide();
$("#showEmail").click(function(){
$(".phone").hide();
$(".email").show();
});
$("#showPhone").click(function(){
$(".email").hide();
$(".phone").show();
});
var codeSrc = "{:captcha_src('resetPwd',['imageW'=>108,'imageH'=>42])}&!"+Math.random();
$(".resetcode").attr('src',codeSrc).load(function(){
$("#verifyimg_loading").remove();
$(this).parent().show();
});
/** 刷新验证码 */
$('.resetcode').click(function(){
$(".resetcode").attr('src',function(){
var index = this.src.indexOf('&!');
if(index !== -1){
return this.src.substr(0,index)+'&!'+Math.random();
}
return this.src+'&!'+Math.random();
});
});
// 每60s 刷新一次验证码
setInterval(function(){
$(".resetcode").click();
},120*1000);
});
/**
* 邮箱找回密码
*/
function repEmailNext(cate){
$("#preloader").hide()
})
new Vue({
el: '#app',
data: function() {
return {
counting: false,
count: 60,
phone: "",
code: "",
password: "",
repassword: ""
}
},
computed: {
valid: function() {
return !this.counting
},
codeText: function() {
return this.counting ? (this.count + 's') : '发验证码'
},
isOk: function() {
return this.phone.isMobile() && this.code.isCode() && this.password.isPwd() && (this.password == this.repassword)
}
},
methods: {
onConfirm: function() {
let that = this
let phone = this.phone
let code = this.code
let pwd = this.password
$.ajax({
type: "POST",
url: "{:U('home/Repwd/repwdhandle')}",
data: "phone=" + phone + "&code=" + code + "&pwd=" + pwd + "&repwd=" + pwd,
dataType: "json",
success: function (data) {
var data = getResponseData(data)
if (data.status == '1') {
window.location.href = "{:U('basic/Passport/login')}"
} else {
ui.error(data.info)
return
}
}
})
},
onSendCode: function() {
let that = this
let phone = that.phone
if(!phone.isMobile()) {
return
}
$.ajax({
type: "POST",
url:REPOHNE_VAR,
data:"phone="+phone,
dataType:"json",
success:function(data){
if(data.status=='0'){
ui.error(data.info)
return
}else{
ui.success(data.info)
if(!that.counting) {
that.counting = true
that.onTick()
}
return
}
}
})
},
onTick: function() {
if(this.count > 0) {
this.count -= 1
setTimeout(this.onTick, 1000)
} else {
this.count = 60
this.counting = false
}
}
}
})
// /**
// * 邮箱找回密码
// */
// function repEmailNext(cate){
var email=$.trim($("#repemail").val());//获取用户手机号
var code=$.trim($("#repcode").val());//获取用户手机号
if(!email.match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)){
//setRepMsg("repmsgemail","email不正确!");
ui.error("邮箱不正确");
return;
}
// var email=$.trim($("#repemail").val());//获取用户手机号
// var code=$.trim($("#repcode").val());//获取用户手机号
// if(!email.match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)){
// //setRepMsg("repmsgemail","email不正确!");
// ui.error("邮箱不正确");
// return;
// }
$(cate).attr("disabled","disabled");
$(cate).val("提交中....");
//修改密码
$.ajax({
type: "POST",
url:REPWDEMAIL,
data:"email="+email+"&everify="+code,
dataType:"json",
success:function(data){
if(data.status=='0'){
$(cate).removeAttr('disabled');
$(cate).val("下一步");
ui.success(data.info);
return;
}else{
$("p").text("");
window.location.href=OKEMAILADD;
}
}
});
}
// $(cate).attr("disabled","disabled");
// $(cate).val("提交中....");
// //修改密码
// $.ajax({
// type: "POST",
// url:REPWDEMAIL,
// data:"email="+email+"&everify="+code,
// dataType:"json",
// success:function(data){
// if(data.status=='0'){
// $(cate).removeAttr('disabled');
// $(cate).val("下一步");
// ui.success(data.info);
// return;
// }else{
// $("p").text("");
// window.location.href=OKEMAILADD;
// }
// }
// });
// }
//临时处理方法
var timerc;
function dctime(){
if(timerc > 1){
timerc=timerc-1;
$("#dctime").text(timerc);
setTimeout("dctime()", 1000); //设置1000毫秒以后执行一次本函数
}else{
$('.width97').css("display","none");
$('.width80').removeAttr("style");
}
}
// //临时处理方法
// var timerc;
// function dctime(){
// if(timerc > 1){
// timerc=timerc-1;
// $("#dctime").text(timerc);
// setTimeout("dctime()", 1000); //设置1000毫秒以后执行一次本函数
// }else{
// $('.width97').css("display","none");
// $('.width80').removeAttr("style");
// }
// }
/**
* 找回密码发送手机验证码
*/
function getRepPhoneVerify(){
phone=$.trim($("#rephoneval").val());//获取用户手机号
//检查手机号格式
if(!phone.match( PHONE_MATCH )){
ui.error('请填写正确的手机号');
return;
}
//获取手机验证码
$.ajax({
type: "POST",
url:REPOHNE_VAR,
data:"phone="+phone,
dataType:"json",
success:function(data){
if(data.status=='0'){
ui.error(data.info);
return;
}else{
ui.success(data.info);
$('.width80').css("display","none");
$('.width97').removeAttr("style");
timerc = 60;
dctime();
return;
}
}
});
}
// /**
// * 找回密码发送手机验证码
// */
// function getRepPhoneVerify(){
// phone=$.trim($("#rephoneval").val());//获取用户手机号
// //检查手机号格式
// if(!phone.match( PHONE_MATCH )){
// ui.error('请填写正确的手机号');
// return;
// }
// //获取手机验证码
// $.ajax({
// type: "POST",
// url:REPOHNE_VAR,
// data:"phone="+phone,
// dataType:"json",
// success:function(data){
// if(data.status=='0'){
// ui.error(data.info);
// return;
// }else{
// ui.success(data.info);
// $('.width80').css("display","none");
// $('.width97').removeAttr("style");
// timerc = 60;
// dctime();
// return;
// }
// }
// });
// }
function okPhonecode(){
phone = $('#rephoneval').val();
code = $('#repverval').val();
$.ajax({
type: "POST",
url:"{:U('home/Repwd/repwdhandle')}",
data:"phone="+phone+"&code="+code,
dataType:"json",
success:function(data){
var data = getResponseData(data);
if(data.status =='1')
{
$(".s").removeClass("on");
$(".second").addClass("on");
$(".verify").css("display", "none");
$(".reset").css("display", "block");
$("#phonecode").val(code);
}
else {
ui.error(data.info);
}
}
// function okPhonecode(){
// phone = $('#rephoneval').val();
// code = $('#repverval').val();
// $.ajax({
// type: "POST",
// url:"{:U('home/Repwd/repwdhandle')}",
// data:"phone="+phone+"&code="+code,
// dataType:"json",
// success:function(data){
// var data = getResponseData(data);
// if(data.status =='1')
// {
// $(".s").removeClass("on");
// $(".second").addClass("on");
// $(".verify").css("display", "none");
// $(".reset").css("display", "block");
// $("#phonecode").val(code);
// }
// else {
// ui.error(data.info);
// }
// }
});
}
// });
// }
function okPhonepwd() {
phone = $('#rephoneval').val();
code = $('#repverval').val();
pwd = $('#ppwd').val();
pwds = $('#ppwds').val();
// function okPhonepwd() {
// phone = $('#rephoneval').val();
// code = $('#repverval').val();
// pwd = $('#ppwd').val();
// pwds = $('#ppwds').val();
if (!pwd) {
ui.error("请输入新密码");
return;
}
if (!pwds) {
ui.error("请输入确认密码");
return;
}
// if (!pwd) {
// ui.error("请输入新密码");
// return;
// }
// if (!pwds) {
// ui.error("请输入确认密码");
// return;
// }
if (pwd != pwds) {
ui.error("新密码与确认密码请保持一致");
return;
}
$.ajax({
type: "POST",
url: "{:U('home/Repwd/repwdhandle')}",
data: "phone=" + phone + "&code=" + code + "&pwd=" + pwd + "&repwd=" + pwds,
dataType: "json",
success: function (data) {
var data = getResponseData(data);
if (data.status == '1') {
$(".s").removeClass("on");
$(".third").addClass("on");
$(".reset").css("display", "none");
$(".completebox").css("display", "block");
} else {
ui.error(data.info);
return;
}
}
// if (pwd != pwds) {
// ui.error("新密码与确认密码请保持一致");
// return;
// }
// $.ajax({
// type: "POST",
// url: "{:U('home/Repwd/repwdhandle')}",
// data: "phone=" + phone + "&code=" + code + "&pwd=" + pwd + "&repwd=" + pwds,
// dataType: "json",
// success: function (data) {
// var data = getResponseData(data);
// if (data.status == '1') {
// $(".s").removeClass("on");
// $(".third").addClass("on");
// $(".reset").css("display", "none");
// $(".completebox").css("display", "block");
// } else {
// ui.error(data.info);
// return;
// }
// }
});
}
// });
// }
</script>
\ No newline at end of file
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 to comment