<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('积分明细')" />
    <style>
        body .layui-layer-btn {
                display: none !important;
            }
    </style>
</head>

<body class="gray-bg">
    <div class="container-div">
        <div class="row">
            <!-- <div class="col-sm-12 search-collapse">
                <form id="coupon-form">
                    <div class="select-list">
                        <ul>
                            <input type="hidden" name="couType" th:value="${couType}"/>
                            <li>
                                <input type="text" name="mobile" placeholder="请输入手机号码"/>
                            </li>
                            <li>
                                状态：
                                <select name="status" id="">
                                    <option value="0">全部</option>
                                    <option value="1">正常</option>
                                    <option value="2">冻结</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div> -->

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-primary" onclick="exportSelected()" shiro:hasPermission="monitor:job:export">
		           创建活动
		        </a>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer"/>
    <script th:inline="javascript">
        // var dicCouponBusiType = [[${@dict.getType('zhengzai_coupon_busi_type')}]];
        // var dicCouponBindType = [[${@dict.getType('zhengzai_coupon_bind_type')}]];
        var prefix = ctx + "stone/logs";
        var prefix2 = ctx + "local";

        // var viewMgtCouponFlag = [[${@permission.hasPermi('candy:coupon:mgt:detail')}]];
        // var cancelMgtCouponFlag = [[${@permission.hasPermi('candy:coupon:mgt:cancel')}]];

        var couType = [[${couType}]];

        $(function () {
            var options = {
                url: '/kylin-acitve/pageActive',
                pagination: true,
                modalName: "积分",
                columns: [
                    {
                        checkbox: false
                    },
                    {
                        field: 'activeName',
                        title: '活动名称'
                    },
                    {
                        field: 'number',
                        title: '券数量'
                    },
                    {
                        title: '操作',
                        // align: 'center',
                        formatter: function (value, row, index) {
                            let dataArr = [];
                            dataArr.push(`<span class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="opendTicketList('${row.activeId}')"><i class="fa fa-search"></i>查看券列表</span>`)
                            return dataArr.join('  ')
                        }
                    }]
            };
            $.table.init(options);
        });
        function opendTicketList (id) {
            console.log(id, '121212121212activityTicketList')
            var url = prefix2+'/activityTicketList?id=' + id;
            $.modal.openTab("活动券列表", url);
        }
        function openModal(uid, status, title) {
            $.modal.confirm(title, function() {
                let data = {
                    status,
                    uid
                }
                $.ajax({
                    type: 'put',
                    url: prefix + '/change/status',
                    data,
                    success:function(e) {
                        $("button[name=refresh]").click();
                    }
                })
            });
        }
        // 导出数据
        function exportSelected() {
            // console.log(userIds.toString(), 'dataParam')
        	$.modal.open('创建活动', prefix2 + "/createActivityModal", 500, 260, cancel)
        }
        function cancel () {
            console.log('确定按钮？')
        }
    </script>
</body>
</html>