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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
{yun:}include file="$wapstyle/header_cont.htm"{/yun}
 
<div class="clear"></div>
 
<div class="wxbind_cont">
    <div class="qqconnect_box">
        <div class="qqconnect_box_pic"><img width="100px;" height="100px;" src="{yun:}$smarty.session.sina.pic{/yun}"></div>
        <div class="qqconnect_box_p">{yun:}$smarty.session.sina.nickname{/yun}</div>
        <div class="qqconnect_box_p" style="padding-top:5px;">尊敬的新浪微博用户</div>
    </div>
 
    <div class="qqconnect_box_p" style="padding:1px 30px;color:#999">绑定已有账号{yun:}if $config.reg_real_name_check != 1{/yun}{yun:}if $config.sy_reg_type==1{/yun},或直接<a href="javascript:void(0);" onclick="creatacount();" style="color: #276bf2">创建新账号</a>{yun:}else{/yun},<a href="{yun:}url m=wap c=register bind=3{/yun}" style="color: #276bf2">如您没有账号,请注册并绑定</a>{yun:}/if{/yun}{yun:}/if{/yun}</div>
 
    <form method="post" action="{yun:}$config_wapdomain{/yun}/index.php?c=sinaconnect&a=sinabind" onsubmit="return checkwxbind(this);" autocomplete="off">
 
        <input type="hidden" id="provider" value="sinaweibo"/>
 
        <div id="login_normal_box">
            <div class="forminputitem">
                <div class="wxbind_text">
                    <input name="username" type="text" id="username" value="{yun:}$smarty.get.username{/yun}" placeholder="邮箱/手机号/用户名" class="wxbind_text_input "/>
                </div>
            </div>
            <div>
                <div class="wxbind_text">
                    <input name="password" type="password" id="password" class="wxbind_text_input" placeholder="输入密码"/>
                </div>
            </div>
        </div>
 
        {yun:}if $config.sy_msg_login==1{/yun}
        <div id="login_sj_box" style="display: none;">
            <div class="wxbind_text">
                <input name="moblie" id="moblie" type="number" class="wxbind_text_input" value="" placeholder="手机号" data-input-clear="3" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" />
                <span class="mui-icon mui-icon-clear mui-hidden"></span>
            </div>
            <div class="logoin_msg none" id="show_mobile">
                <div class="logoin_msg_tx">请填写正确的手机号</div>
            </div>
        </div>
        {yun:}/if{/yun}
 
        {yun:}if strpos($config.code_web,"前台登录")!==false{/yun}
        {yun:}if $config.code_kind >2{/yun}
        <div class="gtdx-captcha">
            <div id="bind-captcha" data-id='send_msg_tip' data-type='click'></div>
            <input type='hidden' id="verify_token" name="verify_token" value="">
            <input type='hidden' id="popup-submit">
            <input type='hidden' id="bind-submit">
            <input type='hidden' id="noblur" value="1"/>
        </div>
        {yun:}else{/yun}
        <div class="wxbind_text wxbind_textpd">
            <input class="wxbind_text_input" placeholder="验证码" name="authcode" id="checkcode" type="text" maxlength="6">
            <div class="wxbind_img">
                <img id="vcode_img" class=" " src="{yun:}$config.sy_wapdomain{/yun}/authcode.inc.php" onclick="checkCode('vcode_img');">
            </div>
        </div>
        {yun:}/if{/yun}
        {yun:}/if{/yun}
 
        {yun:}if $config.sy_msg_login==1{/yun}
        <div id="login_sjyz_box" style="display: none;">
            <div class="wxbind_text wxbind_textpd">
                <input name="moblie_code" type="text" maxlength="6" class="wxbind_text_input" id="moblie_code" value="" placeholder="短信验证码">
                <div class="logoin_msg none" id="show_dynamiccode">
                    <div class="logoin_msg_tx">请填写发送的验证码</div>
                    <div class="logoin_msg_icon"></div>
                </div>
                <a href="javascript:void(0);" class="wxbind_text_send" id="send_msg_tip" onclick="send_msg('{yun:}$config_wapdomain{/yun}/index.php?c=sinaconnect&a=sendmsg');"><span id="time">获取验证码</span></a>
            </div>
        </div>
        {yun:}/if{/yun}
 
        <div class="wxbind_login_bthbox">
            <a href="javascript:void(0);" class="wxbind_login_bth" id="sublogin" onclick="bindacount();">绑定账号</a>
            <input class="wxbind_login_bth" id="submlogin" value="绑定账号" type="submit" style="display: none;" />
        </div>
    </form>
 
    <!-- 验证码 -->
    <div class="login_otherfs">
        {yun:}if $config.sy_msg_isopen==1 && $config.sy_msg_login==1{/yun}
        <div class="verification_code_word" id="mobile_login">短信登录</div>
        {yun:}/if{/yun}
        <div class="verification_code_word" id="acount_login" style="display: none"> 用户名登录</div>
    </div>
 
</div>
<style>
    body {
        background: #fff
    }
</style>
{yun:}include file="$wapstyle/publichtm/public_js.htm"{/yun}
<script src="{yun:}$wap_style{/yun}/js/prefixfree.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/reg_ajax.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
{yun:}include file="$wapstyle/verify_js.htm"{/yun}
 
<script>
    var wapurl = "{yun:}url m=wap{/yun}",
        weburl = "{yun:}$config.sy_weburl{/yun}",
        code_web = '{yun:}$config.code_web{/yun}',
        code_kind = '{yun:}$config.code_kind{/yun}';
 
    $(document).ready(function () {
        //账号登录和手机登录tab选择
        $('#acount_login').click(function (data) {
            $('#acount_login').css("display", "none");
            $('#mobile_login').css("display", "block");
            $('#sublogin').css("display", "block");
            $('#submlogin').css("display", "none");
            $('#login_normal_box').css("display", "block");
            $('#login_sj_box').css("display", "none");
            $('#login_sjyz_box').css("display", "none");
            $('#bind-captcha').attr('data-id', 'login_bth');
            $('#bind-captcha').attr('data-type', 'click');
        });
        $('#mobile_login').click(function (data) {
            $('#mobile_login').css("display", "none");
            $('#acount_login').css("display", "block");
            $('#sublogin').css("display", "none");
            $('#submlogin').css("display", "block");
            $('#login_sj_box').css("display", "block");
            $('#login_sjyz_box').css("display", "block");
            $('#login_normal_box').css("display", "none");
            $('#bind-captcha').attr('data-id', 'send_msg_tip');
            $('#bind-captcha').attr('data-type', 'click');
        });
    });
 
    var Timer;
    var smsTimer_time = 90; //倒数 90
    var smsTimer_flag = 90; //倒数 90
    var smsTime_speed = 1000; //速度 1秒钟
 
    //发送手机短信
    function send_msg(url) {
        var moblie = $('#moblie').val();
        var code;
 
        var verify_token;
        if (moblie == "" || moblie == "请输入手机号码") {
 
            showToast("请输入手机号码!");
            return false;
        } else {
            if (!isjsMobile(moblie)) {
                showToast('手机格式错误!');
                return false;
            }
        }
        var codesear = new RegExp('前台登录');
        if (codesear.test(code_web)) {
            if (code_kind == 1) {
                code = $.trim($("#checkcode").val());
                if (!code) {
                    showToast('请填写图片验证码!');
                    return false;
                }
            } else if (code_kind > 2) {
                // 验证类型改成短信
                $('#bind-captcha').attr('data-id', 'send_msg_tip');
                $('#bind-captcha').attr('data-type', 'click');
                verify_token = $('input[name="verify_token"]').val();
                if (verify_token == '') {
                    $("#bind-submit").trigger("click");
                    return false;
                }
            }
        }
 
        if (smsTimer_time == smsTimer_flag) {
            Timer = setInterval("smsTimer($('#send_msg_tip'))", smsTime_speed);
            showLoading();
            $.post(url, {
                moblie: moblie,
                authcode: code,
                verify_token: verify_token
            }, function (data) {
                hideLoading();
                if (data) {
                    var res = JSON.parse(data);
                    if (res.error != 1) {
                        clearInterval(Timer);
                    }
                    showToast(res.msg, 2, function () {
                        if (res.error != 1) {
                            if (code_kind == 1) {
 
                                checkCode('vcode_img');
                            } else if (code_kind > 2) {
 
                                $("#popup-submit").trigger("click");
                            }
                        }
                    });
                }
            })
        } else {
            showToast('请勿重复发送!', 2);
            return false;
        }
    }
 
    //倒计时
    function smsTimer(obj) {
        if (smsTimer_flag > 0) {
            $(obj).html('重新发送(' + smsTimer_flag + 's)');
            $(obj).attr({
                'style': 'background: ;'
            });
            smsTimer_flag--;
        } else {
            $(obj).html('重新发送');
            $(obj).attr({
                'style': 'background: ;'
            });
            smsTimer_flag = smsTimer_time;
            clearInterval(Timer);
        }
    }
 
    function changeCaptcha() {
        // 验证类型改成提交
        $('#bind-captcha').attr('data-id', 'login_bth');
        $('#bind-captcha').attr('data-type', 'click');
    }
 
    // 判断安卓物理返回键,从wxoauth来的,返回首页;其他的正常返回
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    if (isAndroid) {
        $(function () {
            var wxoauth = $('#wxoauth').val();
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function (event) {
                history.pushState(null, null, location.href);
                if (wxoauth == '1') {
                    location.href = wapurl;
                } else {
                    window.history.go(-1);
                }
            });
        })
    }
</script>
</body>
</html>