<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>求真酒业</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<div id="info">

</div>
    <script>
        
        function getQueryString(name) {
            let reg = `(^|&)${name}=([^&]*)(&|$)`
            let r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]);
            return null;
        }
        function getCookie(name)
        {
            var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
            if(arr=document.cookie.match(reg))
                return unescape(arr[2]);
            else
                return null;
        }
        $(document).ready(function() {
            var consumer_id = getQueryString('consumer_id');
            var parent_id = getCookie('parent_id');


            $.ajax({
                //url: 'https://davis.china315net.com/wx/activity_bonus/binding/?parent='+parent_id+'&consumer_id='+consumer_id,
                url:'https://davis.china315net.com/wx/activity_bonus/binding/?parent={{parent_id}}&consumer_id={{consumer_id}}',
                success: function(res) {
                    console.log(res);
                    if(res.data.e==''){
                        alert('绑定成功')
                        $('#info').text('绑定成功');
                    }else {
                        alert(res.data.e)
                        $('#info').text(res.data.e);
                    }
                }
            })
        })
    </script>
</body>
</html>
