{include file="Application/Home/View/Public/header.blade.php"}
{include file="Application/Home/View/Public/userLeft.blade.php"}
<link rel="stylesheet" href="/Public/laydate/skins/yahui/laydate.css"/>
{literal}
<div class="member-content  ">
    <h3 class="memberTitle">账号明细</h3>
    <div class="asd">
        <p class="memberMinTitle">
            <span class="pad-left-20">用户ID</span>
            <span class="balance">余额：
							<span class="t-red" id="cx" v-text="vald.cash"></span>
						</span>
            <a href="#" class="btnInputCe" id="shuaxin">刷新</a>
            <a href="/Home/Recharge/Index" class="btnInputCe">充值</a>
            <a href="/Home-Account/AccountGetCash" class="btnInputCe">提现</a>
        </p>
        <table class="infor_h" border="0" cellspacing="0"  cellpadding="0" >
            <thead>
            <tr class="t_h">
                <th>可用金额</th>
                <th>总提现</th>
                <th>总充值</th>
                <th>总投注</th>
            </tr>
            </thead>
            <tbody>
            <tr class="t_h">
                <th v-text="vald.cash"></th>
                <th v-text="vald.rechargeMoney"></th>
                <th v-text="vald.withdrawalsMoney"></th>
                <th v-text="vald.betMoney"></th>
            </tr>

            </tbody>
        </table>
    </div>
    <div class="box-bor">
        <ul class="Tab-Control">
            <li >
                <a href="Index">交易记录</a>
            </li>
            <li>
                <a href="recharge">充值记录</a>
            </li>
            <li>
                <a href="withdrawals">提现记录</a>
            </li>
            <li class="active">
                <a href="ReturnMoneys">返水记录</a>
            </li>
            <li>
                <a href="BettingRecord">有效投注</a>
            </li>
        </ul>
    </div>
    <div class="Tab-Content">
        <div class="find">
            <form action="" method="post">
                <table border="0" cellspacing="5" cellpadding="2">
                    <tr>
                        <th>交易端ID</th>
                        <th style="padding-left:20px;">交易ID</th>
                        <th>交易时间</th>
                    </tr>
                    <tr>
                        <td>
                            <input type="text"  id="val" placeholder="" />
                        </td>

                        <td style="padding-left:20px;">
                            <input class="selected" type="number"/>
                            <span>至</span>
                            <input class="selecteds" type="number"/>
                        </td>
                        <td>
                            <input class="laydate-icon" id="time1" placeholder="请输入时间">
                        </td>
                        <td><input type="button" onclick="lookup()" value="查找" class="btnInputCe"/></td>
                    </tr>
                </table>
            </form>
            <div class="abs">
            <table border="0" cellspacing="0"  cellpadding="0" class="dataList">
                <thead>
                <tr>
                    <th>交易ID</th>
                    <th>发起时间</th>
                    <th>状态</th>
                    <th>交易类型 </th>
                    <th>交易前余额 </th>
                    <th>交易金额</th>
                    <th>交易后余额 </th>
                </tr>
                </thead>
                <tbody id="a">
                <tr  v-for="v in val">
                    <td v-text="v.id"></td>
                    <td v-text="v.money_time"></td>
                    <td v-text="v.status"></td>
                    <td v-text="v.trade_type"></td>
                    <td v-text="v.old_money"></td>
                    <td v-text="v.money"></td>
                    <td v-text="v.money_cash"></td>
                </tr>

                </tbody>
            </table>

            <!--分页--->

            <div class="page-number">
                <a href="#" id="first"></a>        <!--首页-->
                <a href='#' v-text="value.count_page" id="upper"></a>     <!--上一页-->
                <a style="border: 0;" href='' v-if="value" v-text="value" >  </a>        <!--显示页面数据页数--->
                <a style="border: 0;" v-else href=''>0</a>        <!--显示页面数据页数--->
                <a href='#' v-text="value.count_page" id="next"></a>    <!--下一页-->
                <a href='#' id="last"></a>   <!--尾页-->
                <input type="hidden" id="totalpage" value="">

                <form action="" method="get">
                    <span>到</span>
                    <input class="id" type="text" name="" id="" value=""/>
                    <span>页</span>
                    <input type="button" value="GO" class="btnInputCe tiaohzan"/>
                </form>
            </div>
            </div>
            <!---分页查询  js-->


        </div>
    </div>
</div>

{/literal}

{literal}
<script type="text/javascript" src="/Public/laydate/laydate.js"></script>
<script>
    !function () {
        laydate({
            elem: '#time'
        });
        laydate({
            elem: '#time1'
        })
    }();
    // 刷新
    $('#shuaxin').on('click',function () {
        apiAjax("/Api-userDetails/PCNewMoney", {},function (data) {
            var val = data.data;

            var html = "";
            if (val != " ") {
                html += "<span class='t-red' id='cx'>"+val['cash']+"</span>";
            }
            $("#cx").html(html);
        }, "json");
    })


    var tabld=new Vue({
        el:'.asd',
        data:{
            vald:[],
        }
    });

    apiAjax("/Api-userDetails/PCNewMoney",{
    },function (data) {
        // console.log(data);
        tabld.vald=data.data;
        // console.log(tabld.val);
    });





    var table=new Vue({
        el:'.abs',
        data:{
            val:[],
            value:[],
        }
    });
    //首页页
    $('#first').on('click',function () {
        changePage(4);
    });
    //末页
    $('#last').on('click',function () {
        changePage(5);
    });
    //上一页
    $('#upper').on('click',function () {
        changePage(2);
    });
    //下一页
    $('#next').on('click',function () {
        changePage(1);
    });
    //跳转页数
    $(".tiaohzan").on('click',function () {
        var as=$(".id").val();
        if(as==''||as==null){
            alert('请填入页面');
        }
        changePage(3,as);
    });

    var upper = $("#upper").val();
    var next=$("#next").val();
    var tolpage='';
    var page='';

    apiAjax("/Api-userDetails/PCMoneyList",{
        page:'1',
        trade_type:'7'
    },function (data) {
        table.val=data.data.data;
        table.value=data.data.page;
        page=table.value;//当前页
        tolpage=data.data.count_page;//总页数
    });
    //改变页码
    var  now ='';
    function changePage(type,now) {
        var $selected = $(".selected").val();
        var $selecteds = $(".selecteds").val();
        var $vals = $("#val").val();
        var time=$("#time1").val();

        if(type==1 && page<tolpage){
            //下一页
            page=parseInt(page)+1;
        }else if(type==2 && page > 1){
            //上一页
            page=page-1;
        }else if(type==3 && now<tolpage){
            //跳转
            page=now;
        }else if(type==4){
            page=1;
        }else if(type==5){
            page=tolpage;
        }else {
            alert('请输入正确页面');
        }
        apiAjax("/Api-userDetails/PCMoneyList",{
            page:page,
            trade_type:'7',
            num1: $selected,
            num2: $selecteds,
            id: $vals,
            time:time,
        },function (data) {
            table.val=data.data.data;//内容
            table.value=data.data.page;//当前页
            page=table.value;//当前页
            tolpage=data.data.count_page;//总页数
        });
    }




    function lookup() {
        var page = 1;
        var $selected = $(".selected").val();
        var $selecteds = $(".selecteds").val();
        var $vals = $("#val").val();
        var time=$("#time1").val();
        //console.log($vals);
        apiAjax("/Api-userDetails/PCMoneyList", {
                num1: $selected,
                num2: $selecteds,
                id: $vals,
                time:time,
                page:page,
                trade_type:'7'
            },
            function (data) {
                // console.log(data);
                table.val=data.data.data;
                page=table.value;//当前页
                tolpage=data.data.count_page;//总页数
            });


    }


</script>
{/literal}
