{yun:}include file="$wapstyle/member/header.htm"{/yun}
|
<style type="text/css">
|
body{font-size: 14px !important;}
|
</style>
|
<div id="yunvue" class="none">
|
<form id="password_form">
|
<div class="verification_form">
|
<div class="verification_formname">原密码</div>
|
<div class="verification_form_code">
|
<input type="password" name="oldpwd" value="" placeholder="填写原密码"/>
|
</div>
|
|
<div class="verification_formname">新密码</div>
|
<div class="verification_form_code">
|
<input type="password" name="newpwd" value="" :placeholder="regpwplaceholder"/>
|
</div>
|
<div class="verification_formname">重复密码</div>
|
<div class="verification_form_code">
|
<input type="password" name="confirmpwd" value="" :placeholder="regpwplaceholder"/>
|
</div>
|
<div class="verification_form_btn" @click="savePassword">确认</div>
|
</div>
|
</form>
|
</div>
|
|
<script>
|
|
var yunvue = new Vue({
|
el: '#yunvue',
|
data: {
|
regpwplaceholder:''
|
},
|
created() {
|
this.getCon();
|
},
|
methods:{
|
getCon:function(){
|
showLoading();
|
var that = this;
|
$.post('{yun:}url d=wxapp m=register c=getCon{/yun}',{rander: Math.random()},function(data){
|
hideLoading();
|
var con = data.data;
|
|
var reg_pw_sp = con.reg_pw_sp,
|
reg_pw_zm = con.reg_pw_zm,
|
reg_pw_num = con.reg_pw_num;
|
|
var regpwplaceholder = '填写新密码';
|
if(reg_pw_sp=='1' || reg_pw_num=='1' || reg_pw_zm=='1'){
|
regpwplaceholder +='须包含';
|
|
if (reg_pw_num=='1'){
|
regpwplaceholder +='数字 ';
|
}
|
if (reg_pw_zm=='1'){
|
regpwplaceholder +='字母 ';
|
}
|
if (reg_pw_sp=='1'){
|
regpwplaceholder +='其它字符(!@#.$-_)';
|
}
|
}
|
that.regpwplaceholder = regpwplaceholder;
|
$("#yunvue").css('display', 'block');
|
},'json');
|
},
|
savePassword:function(){
|
var that = this;
|
var self = this;
|
var formData = {};
|
var v = getFormValue('password_form');
|
if (v.oldpwd == '') {
|
return showToast('请填写原密码');
|
}
|
|
formData.password = v.oldpwd;
|
|
if (v.newpwd == '') {
|
return showToast('请填写新密码');
|
}else if(v.newpwd.length < 6 || v.newpwd.length > 20) {
|
return showToast("密码长度应在6-20位!");
|
|
}
|
|
formData.passwordnew = v.newpwd;
|
|
if (v.confirmpwd == '') {
|
return showToast('请填写确认密码');
|
}
|
|
if (v.oldpwd == v.newpwd) {
|
return showToast('新密码与原密码相同,无需修改');
|
}
|
|
if (v.confirmpwd != v.newpwd) {
|
return showToast('新密码与确认密码不同');
|
}
|
formData.passwordconfirm = v.confirmpwd;
|
|
showLoading('提交中...');
|
$.post(wapurl+"?c=ajax&a=setpwd",formData,function(data){
|
hideLoading();
|
var res = JSON.parse(data);
|
if (res.type == 9) {
|
window.localStorage.setItem("socketState", "2");
|
window.location.href = 'index.php';
|
} else {
|
showToast(res.msg);
|
}
|
});
|
|
|
},
|
pageTo:function(url){
|
window.location.href = url;
|
}
|
}
|
});
|
|
</script>
|
</head>
|
</body>
|