Server : Apache
System : Linux iZ6xhqomji47p1Z 5.10.134-15.al8.x86_64 #1 SMP Thu Jul 20 00:44:04 CST 2023 x86_64
User : www ( 1000)
PHP Version : 8.1.30
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Directory :  /www/wwwroot/fsjlkj.cn/template/pc/users/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : /www/wwwroot/fsjlkj.cn/template/pc/users/bind_mobile.htm
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>绑定手机-{eyou:global name='web_name' /}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    {eyou:static file="users/skin/css/basic.css" /}
    {eyou:static file="users/skin/css/eyoucms.css" /}
    <!-- 新样式 2020-11-25 -->
    {eyou:static file="users/skin/css/element/index.css" /}
    {eyou:static file="users/skin/css/e-user.css" /}
    {eyou:include file="users/skin/css/diy_css.htm" /}
    
    {eyou:static file="/public/static/common/js/jquery.min.js"/}
    {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
    {eyou:static file="/public/static/common/js/tag_global.js"/}

</head>
<body class="bind_mobile">
<div class="el-row">
    <form name='theForm' id="theForm" method="post">
        <div class="ey-popup">
            <div class="el-form-item">
                <div class="el-input">
                    <input type="text" name="mobile" id="mobile" {eyou:eq name='$users.is_mobile' value='0'} value="{$users.mobile}" {/eyou:eq} required class="el-input__inner" autocomplete="off" placeholder="新的手机号码" maxlength="11">
                    
                </div>
            </div>
            <div class="el-form-item">
                <div class="el-input el-input-group">
                    <input type="text" name="vertify" id="vertify" autocomplete="off" class="el-input__inner" placeholder="图片验证码" />
                    <img src="{eyou:url link='api/Ajax/vertify' vars='type=bind' /}" class="chicuele" id="imgVerifys" onClick="fleshVerify();">
                </div>
            </div>
            <div class="el-form-item">
                <div class="el-input el-input-group ">
                     <input type="text" class="el-input__inner" id="mobile_code" name="mobile_code" autocomplete="off" placeholder="手机验证码">
                     <div class="el-input-group__append">
                          <input type="button" id="mobile_button" onclick="get_mobile_code();" class="el-button el-button--default" value="获取验证码" />
                     </div>  
                </div>
            </div>
            <div class="el-form-item mb0">
                <button type="button" class="el-button el-button--primary f14" style="width: 100%;" onclick="SubmitData();">确定</button>
            </div>
        </div>
      
    </form>
</div>

<script type="text/javascript">
    function fleshVerify(){
        var src = "{eyou:url link='api/Ajax/vertify' vars='type=bind' /}";
        if (src.indexOf('?') > -1) {
            src += '&';
        } else {
            src += '?';
        }
        src += 'r='+ Math.floor(Math.random()*100);
        $('#imgVerifys').attr('src', src);
    }

    function get_mobile_code() {
        var mobile = $("#mobile").val();
        // 手机号是否为空
        if (!mobile) {
            $("#mobile").focus();
            layer.msg('请输入新的手机号码!', {time: 1500});
            return false;
        }
        
        // 手机格式不正确
        var reg = /^1[0-9]{10}$/i;
        if (!reg.test(mobile)) {
            $("#mobile").focus();
            layer.msg('请输入正确的新的手机号码!', {time: 1500});
            return false;
        }

        // 图形验证码
        var vertify = $("#vertify").val();
        if (!vertify) {
            $("#vertify").focus();
            layer.msg('请输入图形验证码!', {time: 1500});
            return false;
        }

        // 设置为不可点击
        $("#mobile_button").val('获取中…').attr('disabled', 'disabled');
        layer_loading('正在处理');
        $.ajax({
            url: '{$RootDir}/index.php?m=api&c=Ajax&a=SendMobileCode&_ajax=1',
            data: {mobile: mobile, is_mobile: true, source: 1, vertify:vertify, type:'bind'},
            type:'post',
            dataType:'json',
            success:function(res){
                layer.closeAll();
                if (res.code == 1) {
                    countdown();
                    layer.msg(res.msg, {time: 1500});
                } else {
                    $("#mobile_button").val('获取验证码').removeAttr("disabled");
                    showErrorAlert(res.msg);
                }
            },
            error : function(e) {
                layer.closeAll();
                $("#mobile_button").val('获取验证码').removeAttr("disabled");
                showErrorAlert(e.responseText);
            }
        });
    }

    function countdown() {
        // 倒计时
        var setTime;
        var time = 120;
        setTime = setInterval(function() {
            if(0 >= time){
                clearInterval(setTime);
                return;
            }
            time--;
            $("#mobile_button").val(time+'秒').attr('disabled', 'disabled');
            if(time == 0) $("#mobile_button").val('获取验证码').removeAttr("disabled");
        }, 1000);
    };

    function SubmitData() {
        var mobile = $("#mobile").val();
        var reg = /^1[0-9]{10}$/i;
        // 邮箱格式不正确
        if(!reg.test(mobile)) {
            layer.msg('请正确输入手机号码!', {time: 2000});
            return false;
        }

        var mobile_code = $("#mobile_code").val();
        if(!mobile_code) {
            layer.msg('手机验证码不能为空!', {time: 2000});
            return false;
        }

        var _parent = parent;
        var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引

        layer_loading('正在处理');
        $.ajax({
            url: '{$RootDir}/index.php?m=user&c=Users&a=bind_mobile&_ajax=1',
            data: $('#theForm').serialize(),
            type:'post',
            dataType:'json',
            success:function(res){
                layer.closeAll();
                if (res.code == 1) {
                    parent.layer.close(parentObj);
                    parent.layer.msg(res.msg, {time: 1500}, function() {
                        _parent.window.location.reload();
                    });
                } else {
                    showErrorAlert(res.msg);
                }
            },
            error : function(e) {
                layer.closeAll();
                showErrorAlert(e.responseText);
            }
        });
    };
</script>

</body>
</html>