<?php /*a:3:{s:58:"D:\phpstudy_pro\WWW\cxy\bts\php\view\admin\order\push.html";i:1591579556;s:61:"D:\phpstudy_pro\WWW\cxy\bts\php\view\admin\common\header.html";i:1591579556;s:61:"D:\phpstudy_pro\WWW\cxy\bts\php\view\admin\common\footer.html";i:1591579556;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title><?php echo config('admin.sys_name'); ?>后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/static/admin/css/main.css?v=<?php echo time(); ?>" media="all">
    <link rel="stylesheet" href="/static/plugins/font-awesome-4.7.0/css/font-awesome.min.css" media="all">

    <style id="LM-bg-color">
    </style>

</head>
<style>
    .upload-wrap {
        position: relative;
        display: inline-block;
        overflow: hidden;
        border: 1px solid #2d78f4;
        border-radius: 3px;
    }

    .upload-wrap .file-ele {
        position: absolute;
        top: 0;
        right: 0;
        opacity: 0;
        height: 100%;
        width: 100%;
        cursor: pointer;

    }

    .upload-wrap .file-open {
        width: 90px;
        height: 30px;
        line-height: 30px;
        text-align: center;
        color: #fff;
        background: #3385ff;
    }

</style>
<div class="LM-container">
    <div class="LM-main">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>交易订单列表</legend>
            <blockquote class="layui-elem-quote">
                <div class="LM-table">

                </div>

            </blockquote>

        </fieldset>

        <table class="layui-table" id="list" lay-filter="list">

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

<script type="text/html" id="image">

    {{# layui.each(d.image, function(index, item){ }}
    <img src="/static/admin/images/image.gif"   onmouseover="layer.tips('<img src={{item}}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();">
    {{# });
    }}
</script>
<script type="text/html" id="barDemo">
<!--    <input type="button" class="layui-btn layui-btn-xs" lay-event="del" value="删除">-->
    <!--<a href="addhlep?id={{d.id}}" class="layui-btn layui-btn-xs" >编辑</a>-->
</script>
<script src="/static/plugins/layui/layui.js" charset="utf-8"></script>
<script src="/static/plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script src="/static/plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script>

    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;

        var tableIn = table.render({
            elem: '#list',
            url: '<?php echo url("push"); ?>',
            method: 'post',
            title: '反馈意见',
            loading: true,
            toolbar: '#toolbar', //开启头部工具栏,并为其绑定左侧模板

            defaultToolbar: ['filter', 'exports', 'print', "excel", { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
                title: '提示'
                , layEvent: 'LAYTABLE_TIPS'
                , icon: 'layui-icon-tips'
            }],
            cols: [[
                // {checkbox: true, fixed: true},
                {field: 'id', title: 'ID', width: 20, fixed: true, sort: true},
                {field: 'buy_user', title: '购买用户id', width: 80, sort: true},
                {field: 'push_user', title: '卖出用户id', width: 80, sort: true},
                // {field: 'user_name', title: '用户', width: 120, sort: true},
                {field: 'number', title: '发布数量', width: 80, sort: true},
                {field: 'enlarge_quota', title: '放大额度', width: 80, sort: true},
                {field: 'order', title: '订单编号', width: 100, sort: true},
                {field: 'add_time', title: '添加时间', width: 150, sort: true},
                {field: 'stat_time', title: '未支付结束时间', width: 150, sort: true},
                {field: 'end_time', title: '完成时间', width: 150, sort: true},
                {field: 'msg', title: '失败原因', width: 150, sort: true},
                {field: 'image', title: '凭证', width: 150, templet: '#image'},
                {field: 'status', title: '订单状态', width: 150, sort: true},
                {title: '操作', width: 150, align: "center", toolbar: "#barDemo"},
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 10,
            page: true
        });


        table.on('tool(list)', function (obj) {
            var data = obj.data;
            let event = obj.event;
            switch (event) {
                case "check":
                    layer.confirm('确定要进行这样的操作码', function (index) {
                        loading = layer.load(1, {shade: [0.1, '#fff']});
                        $.post("<?php echo url('status'); ?>", {id: data.id}, function (res) {
                            layer.close(loading);
                            layer.close(index);
                            if (res.code == 1) {
                                layer.msg(res.msg, {time: 1000, icon: 1});
                                tableIn.reload();
                            } else {
                                layer.msg(res.msg, {time: 1000, icon: 2});
                            }
                        }, "json")
                    })
                    break;
            }


        });

        form.on('switch(status)', function (data) {

        });

        $('#search').click(function () {
            var $keys = $('#name').val();
            if (!$keys) {
                return layer.msg('请输入关键词');
            }

            tableIn.reload({page: {page: 1}, where: {name: $keys}});

        })
        // setInterval(function () {
        //     tableIn.reload();
        // }, 50000)





    });

</script>