chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{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>