{include file="public/heard"}
    <body>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
								<div class="layui-inline layui-show-xs-block">
                                    <button class="layui-btn layui-btn-danger" > 总充值:￥{$money} </button>
										<button class="layui-btn layui-btn-danger" id="delAll"><i class="layui-icon"></i>批量删除</button>
                                </div>
                        </div>
						 
                        <div class="layui-card-body ">
                            <table class="layui-table" id="mlist" lay-filter="mlist">
                                <thead>
                                    <tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
	<script type="text/html" id="active">
	 {{#  if(d.status == 1){ }}
      <p class="layui-bg-red">支付成功</p>
     {{#  } else if(d.status == 2){ }}
     <p class="layui-bg-orange">已过期</p>
     {{#  } else { }}
     <p class="layui-bg-black">未支付</p>
     {{#  } }}
    </script>
    <script>
	layui.use(['table','form','laydate'], function() {
        var table = layui.table,form = layui.form, $ = layui.jquery,laydate = layui.laydate;
        tableIn = table.render({
            elem: '#mlist',
            url: "{:U('simple/member/memberMoneyLog',['id'=>$id])}",
            method: 'post',
			page:true,
			totalRow:true,
            cols: [[
			    {type: 'checkbox',width:60,minWidth:30,totalRowText: '合计：'},
				{field:'id',title:"ID", align: 'center', sort: true,width:80},
			    {field:'out_trade_no',title: '订单号',align: 'center',width:200},
				{field:'type',title: '充值类型',align: 'center',width:100},
				{field:'money',title: '充值金额',align: 'center',width:100},
				{field:'price',title: '到账金额',align: 'center',totalRow: true,width:120},
				{field:'umoney',title: '账户余额',align: 'center',width:100},
				{field:'ysk_jiaoyi',title: '微信单号',align: 'center',width:200},
                {field:'status', title: '状态' ,align: 'center',toolbar: '#active',width:100} ,
				{field:'addtime', align: 'center',title:'时间'}
            ]],
			limit:15,
			limits:[10,20,50,60]
        });		
		
		
		$("#delAll").click(function(){
            layer.confirm('确认要删除选中信息吗？', {icon: 3}, function(index) {
                layer.close(index);
                var checkStatus = table.checkStatus('mlist'); //test即为参数id设定的值
				console.log(checkStatus,table);
                var ids = [];
                $(checkStatus.data).each(function (i, o) {
                    ids.push(o.id);
                });
                var loading = layer.load(1, {shade: [0.1, '#fff']});
                $.post("{:U('simple/member/moneyDel')}", {ids: ids}, function (data) {
                    layer.close(loading);
                    if (data.code === 1) {
                        layer.msg(data.msg, {time: 1000, icon: 1});
                        tableIn.reload();
                    } else {
                        layer.msg(data.msg, {time: 1000, icon: 2});
                    }
                });
            });
        });
		
      });
    </script>
</html>