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
{yun:}include file="$wapstyle/member/cheader.htm"{/yun}
<script src="{yun:}$wap_style{/yun}/js/binding.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script>
    var weburl="{yun:}$config.sy_weburl{/yun}";
    var usertype="{yun:}$usertype{/yun}";
</script>
 
<section class="wap_member_box">
    <div id="yunvue">
        {yun:}if $smarty.get.type=="email"{/yun}
        <ul class="security mt15">
            <li>
                <span class="security_anme">邮&nbsp;&nbsp; 箱 </span>
                <div class="security_text">
                    <input type="text" class="security_text_t" name="email" id="emailval" v-model="email" placeholder="请输入邮箱">
                </div>
            </li>
            <li>
                <span class="security_anme">图片验证</span>
                <div class="security_text  Image_authentication">
                    <input v-model="authcode" type="text" name="authcode" class="security_text_t" placeholder="输入图片内容">
                    <div class="security_text_authentication">
                        <img id="vcode_img" :src="authcodeUrl" class="yunset_sj_boxyzm" onclick="checkCode('vcode_img');" width="100%">
                    </div>
                </div>
            </li>
        </ul>
        <div class="security_bth">
            <input type="button" value="发送到邮箱验证" class="security_bth_but" @click="formSubmit()">
        </div>
        {yun:}/if{/yun}
 
        {yun:}if $smarty.get.type=="moblie"{/yun}
        <ul class="security">
            <li>
                <span class="security_anme">手机号码 </span>
                <div class="security_text">
                    <input type="text" class="security_text_t" name="moblie" id="moblieval" v-model="moblie" placeholder="输入手机号">
                </div>
            </li>
 
            <li>
                <span class="security_anme">图片验证</span>
                <div class="security_text">
                    <div class="security_text">
                        <input type="text" name="authcode" v-model="authcode" class="security_text_t" placeholder="输入图片内容">
                    </div>
                    <div class="security_text_authentication">
                        <img id="vcode_img" :src="authcodeUrl"  class="yunset_sj_boxyzm" onclick="checkCode('vcode_img');">
                    </div>
 
                </div>
            </li>
            <li>
                <span class="security_anme">短信验证码</span>
                <div class="security_text">
                    <div class="security_text">
                        <input type="text" v-model="code" class="security_text_t" maxlength="6"  placeholder="输入短信验证码" id="moblie_code">
                    </div>
                    <a href="javascript:void(0);" onclick="sendmoblie('vcode_img');" class="security_hq" id="time">获取验证码</a>
                </div>
            </li>
        </ul>
        <div class="security_bth">
            <input type="button" value="提交" class="security_bth_but" @click="formSubmit()">
        </div>
        {yun:}/if{/yun}
    </div>
</section>
<input type="hidden" id="send" value="0" />
 
<script>
    var yunvue = new Vue({
        el: '#yunvue',
        data() {
            return {
                bind: '',
                moblie: '',
                code: '',
                authcode: '',
                email: '',
                codeview: true,
                flag: 120,
                authcodeUrl: '{yun:}$config.sy_wapdomain{/yun}/authcode.inc.php'
            };
        },
        created() {
            let type = getUrlKey('type');
            this.bind = type == 'moblie' ? 'tel' : 'email';
            this.getInfo();
        },
        methods: {
            getInfo: function(){
                var that = this;
                var param    =    {rand: Math.random()};
                showLoading();
                $.post('{yun:}url d=wxapp h=com m=info c=getinfo{/yun}', param, function (data) {
                    hideLoading();
                    if(data){
                        that.moblie = data.data.linktel ? data.data.linktel : '';
                        that.email = data.data.linkmail ? data.data.linkmail : '';
                    }
                }, 'json')
            },
            formSubmit: function() {
                var that = this;
                var formData = {};
 
                if (that.bind == 'tel') {
                    if (that.moblie == '') {
                        return showModal('请填写手机号');
                    } else if (!isjsMobile(that.moblie)) {
                        return showModal('请填写正确的手机');
                    }
 
                    if(that.authcode==""){
                        return showModal('请输入图片验证码');
                    }
 
                    formData.moblie = that.moblie;
 
                    if (that.code == '') {
                        return showModal('请填写短信验证码');
                    }
                    var url = '{yun:}url d=wxapp h=com m=set c=bindingbox{/yun}';
                    formData.code = that.code;
                } else if (that.bind == 'email') {
                    var emailReg = /^([a-zA-Z0-9\-]+[_|\_|\.]?)*[a-zA-Z0-9\-]+@([a-zA-Z0-9\-]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
 
                    if (that.email == '') {
                        return showModal('请填写邮箱');
                    } else if (!emailReg.test(that.email)) {
                        return showModal('邮箱格式错误');
                    }
 
                    if(that.authcode==""){
                        return showModal('请输入图片验证码');
                    }
                    var url    = '{yun:}url m=wap c=ajax a=emailcert{/yun}';
                    formData.email = that.email;
                    formData.authcode = that.authcode;
                }
 
                var bind = that.bind;
                formData.id = bind;
                formData.source = 'wap';
 
                showLoading();
                $.post(url, formData, function (data) {
                    hideLoading();
                    if (data.error == 0) {
                        if (bind == 'tel') {
                            showModal('绑定成功', function() {
                                history.go(-1)
                            });
                        } else if (bind == 'email') {
                            showModal('邮件发送成功', function() {
                                history.go(-1)
                            });
                        }
                    } else {
                        showModal(data.msg);
                    }
                }, 'json')
            }
        }
    });
</script>
 
</body>
</html>