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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
{yun:}include file="$wapstyle/member/header.htm"{/yun}
<div class="none" id="yunvue">
    <div class="m_cardbox">
        <div class="m_cardbg">
    <div class="transfer_ts">提示:账户分离后数据无法恢复,该账号下所有与当前身份相关的数据都将迁入新账户
    </div>
    <div v-if="info.userStatue || info.userStat || info.userSta">
    <form id="transfer_form" onsubmit="return false;">    
    <div class="transfer_stepbox">
        <ul class="transfer_stepbox_list">
            <li class="transfer_stepcur"><span class="transfer_stepbox_n">1</span><em class="transfer_stepbox_name">核对信息</em><i class="transfer_stepbox_line"></i></li>
            <li><span class="transfer_stepbox_n">2</span><em class="transfer_stepbox_name">账号验证 </em><i class="transfer_stepbox_line"></i></li>
            <li><span class="transfer_stepbox_n">ok<i class="transfer_stepbox_cgicon"></i></span><em class="transfer_stepbox_name">迁移成功</em></li>
        </ul>
    </div>
    <div class="clear"></div>
 
    <div class="transfer_textlistbox">
        <div class="transfer_lxbox mt10">
            <div class="transfer_textxz">
                <div class="transfer_lx" v-for="(item, bdkey) in bdtypeAll" :key="bdkey" >
                    <div :class="item.type==1 ? 'transfer_lx_cur':''" @click="bindbdtypeChang" :data-index="bdkey">{{item.name}}<text
                         class="choice_mode_icon"></text></div>
                </div>
                <input class="ask_input" name="bdtype" :value="bdtype?bdtype:''" hidden="true" />
            </div>
        </div>
        <div class="transfer_textlist mt10">
            <span class="transfer_textlist_n"> 当前账号密码 <font color="#f00">*</font> </span>
            <input type="password" name="oldpass" value="" class="transfer_text" placeholder="请输入当前账户密码">
         </div>
        <div class="transfer_textlist">
            <span class="transfer_textlist_n"> 新账户用户名 <font color="#f00">*</font> </span>
            <input type="text" name="username" value="" class="transfer_text"  placeholder="请输入新账户用户名">
        </div>
        <div class="tr_tip">{{regnameplaceholder}}</div>
        <div class="transfer_textlist">
            <span class="transfer_textlist_n">新账户密码 <font color="#f00">*</font> </span>
            <input type="password" name="password" value="" class="transfer_text"  placeholder="请输入密码">
        </div>
        <div  class="tr_tip">{{regpwplaceholder}}</div>
        <div class="transfer_tip">数据迁移后,可登录新账户,绑定手机、微信等</div>
    </div>
 
    <div class="mui-collapse-content">
        <div class="yunset_bth_box">
            <button class="mui-btn mui-btn-primary" type="button" @click="savetrsform">确认</button>&nbsp;&nbsp;
        </div>
    </div>
    </form>    
    </div>
    <div class="wap_member_no" v-else>
        <p>亲爱的用户</p>
        <p>目前你的账号只有个人身份,无需账户分离</p>
    </div>
    
</div></div></div>
<script>
    new Vue({
        el: '#yunvue',
        data: {
            bdtypeAll: {
                'moblie': {
                    'type': 0,
                    'name': '解绑手机'
                },
                'email': {
                    'type': 0,
                    'name': '解绑邮箱'
                },
                'wxid': {
                    'type': 0,
                    'name': '解绑微信'
                },
                'qqid': {
                    'type': 0,
                    'name': '解绑QQ'
                },
                'sinaid': {
                    'type': 0,
                    'name': '解绑微博'
                }
            },
            bdtypes: [],
            bdtype: '',
            info: {},
            regnameplaceholder:'',
            regpwplaceholder:'',
        },
        created() {
            this.getInfo();
        },
        methods:{
            savetrsform:function(){
                var self = this;
                var formData = {};
                var v = getFormValue('transfer_form');
                var oldpass = v.oldpass;
                var username = v.username;
 
                var pass = v.password;
 
                var bdtype = v.bdtype;
                if (!oldpass) {
                    return showModal('请输入当前账户密码!');
                }
 
                if (!username) {
                    return showModal('请输入用户名!');
                }
                if (pass.length < 6 || pass.length > 20) {
                    return showModal('密码长度应该为6-20位!');
                }
                formData.oldpass = oldpass;
                formData.password = pass;
                formData.username = username;
                formData.bdtypes = bdtype;
                showLoading('数据迁移中...');
                $.post('{yun:}url d=wxapp h=user m=set c=transfer{/yun}',formData,function(data){
                    hideLoading();
                    if (data.error == 1) {
                        showModal('账户分离成功,请使用新账户重新登录', function() {
                            window.localStorage.setItem("socketState", "2");
                            window.location.href = '{yun:}url m=wap{/yun}';
                        });
                    } else {
                        showModal(data.msg);
                    }
                },'json');
            },
            getInfo:function(){
                showLoading();
                var that = this;
                $.post('{yun:}url d=wxapp h=user m=set c=transferInfo{/yun}',{rand: Math.random()},function(data){
                    hideLoading();
                    $("#yunvue").css('display', 'block');
                    if(data){
                        that.info = data.data;
                        var con = data.data.config;
                        
                        var reg_namemaxlen     = con.reg_namemaxlen,
                            reg_nameminlen     = con.reg_nameminlen,
                            reg_name_sp     = con.reg_name_sp,
                            reg_name_zm     = con.reg_name_zm,
                            reg_name_num     = con.reg_name_num,
                            reg_name_han     = con.reg_name_han,
                            reg_pw_sp         = con.reg_pw_sp,
                            reg_pw_zm         = con.reg_pw_zm,
                            reg_pw_num         = con.reg_pw_num;
                            
                        var regnameplaceholder = '用户名长度'+reg_nameminlen+'-'+reg_namemaxlen+'位';
                        if(reg_name_han=='1' || reg_name_sp=='1' || reg_name_num=='1' || reg_name_zm=='1'){
                            regnameplaceholder +='须包含';
                            if (reg_name_han=='1'){
                                regnameplaceholder +='汉字 ';
                            }
                            if (reg_name_num=='1'){
                                regnameplaceholder +='数字 ';
                            }
                            if (reg_name_zm=='1'){
                                regnameplaceholder +='字母 ';
                            }
                            if (reg_name_sp=='1'){
                                regnameplaceholder +='字符!@#.$-_';
                            }
                            
                        }
                        that.regnameplaceholder = regnameplaceholder;
                        
                        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;
                    }   
                   
                },'json');
            },
            bindbdtypeChang: function(e) {
                let that = this,
                    windex = '',
                    index = e.currentTarget.dataset.index,
                    bdtypeAll = that.bdtypeAll,
                    bdtypes = that.bdtypes;
 
                if (bdtypeAll[index]['type'] != 1) {
                    bdtypeAll[index]['type'] = 1;
                    bdtypes.push(index);
                } else {
                    bdtypeAll[index]['type'] = 0;
 
                    windex = bdtypes.indexOf(index);
                    if (windex > -1) {
                        bdtypes.splice(windex, 1);
                    }
                }
 
                that.bdtype = bdtypes.join(',');
                that.bdtypes = bdtypes;
                that.bdtypeAll = bdtypeAll;
            },
        }
    })
</script>
</body>
</html>