$(function(){
    $('input[name=payment]').on('change',function(){
        $('.pay_logo img').toggleClass('active')
    })
   
    //检测表单
    let issubmit =false
    $(".pay_btn").on("click", function () {
        issubmit =false
        let money=$('input[name=amount]').val()
      
        money =Math.round(money * 100) / 100;
        if(money==''){
            layer.open({
                content:'请输入充值金额',
                time:1,
                skin: 'msg'
            })
        }else if(money<0.01){
            layer.open({
                content:'充值金额错误（请输入大于0.01的金额）',
                time:1,
                skin: 'msg'
            })
        }else{
            issubmit =true
        }
        if(issubmit){
            $('form').submit()
        }     
    })
})