mybalance.html 2.0 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_750594_itt4qc4xfcg.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/css/personcenter.css">
    <title>我的余额</title>
    <script type="text/javascript" src="__TMPL__/public/assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="__TMPL__/public/assets/js/base.js" charset="utf-8"></script>
</head>
<body>
<div class="container">
    <div class="remain">
        <p class="money">请输入提现金额</p>
    </div>
    <div class="cash">
        <p class="moneysign"></p>
        <input type="text" placeholder="0.00" class="remainmoney" onkeyup="num(this)">
    </div>
    <p class="amountmoney">提现到微信零钱</p>
</div>
</body>
<!--begin:提示弹层-->
<div class="pop_fn"></div>
<script>
    function num(obj){
        obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
        obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
        obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
        obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
        obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
    }
    $('.amountmoney').click(function () {
        $.ajax({
            type: 'POST',
            url: "{:url('Member/chooseGet')}",
            data: {
                'money':$('.remainmoney').val()
            },
            success: function (res) {
                popup(res.message);
                if(res.code == 1){

                }
                console.log(res);
            },
            error: function (res) {
                console.log(res);
            }
         });
    })
</script>
</html>