@extends('vip.layouts')
@section('content')
    <style>
        .layui-laydate-range {
            width: auto;
        }
    </style>
    <script type="text/html" id="opt">
        <div style="float: left; width: 150px;" id="@{{ d.game_type }}">@{{ d.money }}</div>
        <a class="layui-btn   layui-btn-sm  layui-btn-normol" onclick="getAgentMoney('@{{ d.game_type }}')" data-type="reload"
            style="margin-left: 5px;opacity: 1; pointer-events: auto;">刷新</a>
    </script>
    <!---注单管理-->
    <div class="layui-row">
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
            <form class="layui-form rewrite" eventType="eventForm" action="">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">游戏类型</label>
                        <div class="layui-input-inline" style="width: 200px">
                        <select name="game_type"  id="form_gametype"  lay-verify="" autocomplete="off" class="layui-input"  eventType=event-query>
                            <option value="all" @if($game_type=='all') selected @endif  eventType=event-query>全部平台</option>
                            <option value="oggame" @if($game_type=='oggame') selected @endif  eventType=event-query>OG视讯</option>
                            <option value="kygame" @if($game_type=='kygame') selected @endif  eventType=event-query>开元棋牌</option>
                            <option value="aggame" @if($game_type=='aggame') selected @endif  eventType=event-query>AG视讯</option>
                            <option value="lcqpgame" @if($game_type=='lcqpgame') selected @endif  eventType=event-query>龙城棋牌</option>
                            <option value="lygame" @if($game_type=='lygame') selected @endif  eventType=event-query>乐游棋牌</option>
                            <option value="hjgame" @if($game_type=='hjgame') selected @endif  eventType=event-query>皇家视讯</option>
                        </select>
                    </div>
                    </div>
                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-sm lay-btn-diy" data-type="reload"  eventType=event-query-submit
                           style="opacity: 1; pointer-events: auto;">提交</a>
                        <a class="layui-btn   layui-btn-sm  layui-btn-normal reset" data-type="reload"
                           style="opacity: 1; pointer-events: auto;">重置</a>
                        <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload"
                           style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>
                    </div>
                </div>
            </form>
        </div>
        @push('dataTableJS')
        @endpush
        @include('vip.datatable')
        <link rel="stylesheet" href="{{ asset('/css/untablelist.css') }}"  />
    </div>
    </div>
    <script>
        /**
         * 获取游戏代理商余额
         * @param gametype
         */
        function getAgentMoney(gametype)
        {
            $('#'+gametype+'').text('获取中...');

            $.ajax({
                url: '/admin/RgameCash/getAgentMoney',
                dataType: 'json',
                data: {game_type:gametype},
                type: 'post',
                success:function(data){
                    if(data.status == 1)
                    {
                        $('#'+gametype+'').text(data.data.money);
                    }
                    else
                    {
                        $('#'+gametype+'').text('查询失败，请刷新页面重试');
                    }
                }
            });
        }

        getAgentMoney('kygame'); //获取开元棋牌代理商余额
        getAgentMoney('lcqpgame'); //获取龙城棋牌代理商余额
        getAgentMoney('lygame'); //获取龙城棋牌代理商余额
        getAgentMoney('Hjgame'); //获取皇家视讯代理商余额
    </script>
@endsection

