withdraw_information.html 3.1 KB
<!DOCTYPE html>
<html lang="en">

{include file="public/head"/}
<link rel="stylesheet" href="__CDN__/assets/advertising/css/input.css">

<body>
    <div class="perfect_input">
        <div class="input_single layout align_center flex_row">
            <div class="input_l">姓名</div>
            <input type="text" id="name" placeholder="请输入姓名" value="{$user.name}">
        </div>
        <div class="input_single layout align_center flex_row">
            <div class="input_l">身份证号</div>
            <input type="text" id="card" placeholder="请输入身份证号" value="{$user.card}">
        </div>
        <div class="input_single layout align_center flex_row" style="border:none">
            <div class="input_l">手机号</div>
            <input type="text" id="mobile" placeholder="请输入手机号" value="{$user.mobile}">
        </div>
    </div>
    <!-- 提示 -->
    <div class="personal_msg_tips layout align_center  flex_row">
        <div class="personal_tips_icon">
            <img src="__CDN__/assets/advertising/img/sun_34@2x.png" alt="">
        </div>
        <div>
            请如实填写提现信息,填写有误将提现失败
        </div>
    </div>
    <div class="sure_submit">
        <input type="hidden" id="user_id" value="{$user.id}"/>
        <div class="btn">确认</div>
    </div>

    {include file="public/js" /}
</body>
<script>
    $(function(){
        $('.btn').click(function(){
            var user_id = $('#user_id').val();
            var name = $('#name').val().replace(/\s+/g, "");
            var card = $('#card').val().replace(/\s+/g, "");
            var card_regular = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
            var mobile = $('#mobile').val().replace(/\s+/g, "");
            var mobile_regular = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
            if(name == ''){
                toast('请输入姓名');
                return false;
            }else if(card == ''){
                toast('请输入身份证吗');
                return false;
            }else if(!card_regular.test(card)){
                toast('请输入正确的身份证号');
                return false;
            }else if(mobile == ''){
                toast('请输入手机号');
                return false;
            }else if(!mobile_regular.test(mobile)){
                toast('请输入正确手机号');
                return false;
            }
            $.ajax({
                url:"{:url('update_withdraw_information')}",
                type:"POST",
                data:{'user_id':user_id,'name':name,'card':card,'mobile':mobile},
                success:function(res){
                    if(res.code == 1){
                        toast('更新成功');
                        setTimeout(function(){
                            window.location.href = "{:url('member/my_withdraw')}";
                        },2000);
                    }else{
                        toast(res.msg);
                    }
                },
                error:function(res){
                    toast("与服务器断开连接");
                }
            })
        });
    })
</script>
</html>