<!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('店铺列表')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
    <style>
        .layui-layer-btn0 {
            padding: 0;
        }
        .paddings {
            padding: 0 !important;
        }
        #addClassify {
            display: none;
            width: 540px;
            padding: 20px;
        }
        #addClassify .selectClassify {
            display: flex;
            align-items: center;
        }
        #addClassify .selectClassify label {
            display: flex;
            margin-right: 20px;
            align-items: center;
        }
        #addClassify .selectClassify label input {
            margin: 0;
            margin-right: 2px;
        }
        .shadeCss,.layui-layer-shade {
            background-color: rgb(0, 0, 0, 0.5) !important;
        }
        .select-list ul {
            display: flex;
            justify-content: space-between;
        }
        .selectClassifyOne {
            display: flex;
            align-items: center;
            margin: 12px 0;
        }
        .selectClassifyOne span {
            width: 45px;
        }
        .tagStore .fixed-table-toolbar {
            display: flex;
        }
        .tagStore .fixed-table-toolbar .bs-bars {
            flex: 1;
        }
        .tagStore .fixed-table-toolbar .bs-bars .btn-group-sm {
            display: flex;
            justify-content: space-between;
        }
        .leftSearchBox {
            display: flex;
            align-items: center;
        }
        .leftSearchBox input, .leftSearchBox select {
            width: 200px;
            height: 34px;
            margin-right: 12px;
        }
        .ibox-content {
            border-style: none;
            padding: 0;
        }
        .kv-hidden {
            display: none !important;
        }
    </style>
</head>
<body class="tagStore">
    <div class="container-div">
        <div class="row">
            <div class="btn-group-sm" id="toolbar">
                <div>
                    <a class="btn btn-warning" id="button-open-11">
                        <i class="fa fa-download"></i> 导出Excel
                    </a>
                </div>
            </div>
            <div class="col-sm-12 search-collapse">
                <form id="coupon-form">
                    <div class="select-list">
                        <ul>
                            <div class="leftSearchBox">
                                <input class="form-control" type="text" placeholder="请输入店铺名字">
                            </div>
                            <div>
                            </div>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer"/>
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script th:inline="javascript">
        var dicCouponBusiType = [[${@dict.getType('zhengzai_coupon_busi_type')}]];
        var dicCouponBindType = [[${@dict.getType('zhengzai_coupon_bind_type')}]];
        var platformUrl = [[${platformUrl}]];
        var prefix = ctx + "candy/coupon/mgt";
        var prefix2 = ctx + "local";
        var viewMgtCouponFlag = [[${@permission.hasPermi('candy:coupon:mgt:detail')}]];
        var cancelMgtCouponFlag = [[${@permission.hasPermi('candy:coupon:mgt:cancel')}]];
        var couType = [[${couType}]];
        $(function () {
            $("#fileinput").fileinput({
                'theme': 'explorer-fas',
                'uploadUrl':  platformUrl + "/platform/basicServices/alOss/upload",
                "uploadExtraData": {
                    "pathName" : "banner",
                    "buckType" : 1
                },
                autoReplace: true,
                showCaption: false,
                showPreview: false,
                showRemove: false,
                showUpload: false,
                showCancel: false,
                showClose: false,
                autoReplace: true,
                dropZoneTitle: "请上传文件",
                maxFileCount: 1
            }).on("filebatchselected", function (event, files) {         //默认上传
                $(this).fileinput("upload");
            })
            .on("fileuploaded", function (event, data) {       //上传回调事件
                showPicture = 'https://img.zhengzai.tv/' + data.response.data.ossPath;
                $("#viewImg").attr('src', showPicture)
            })
            var options = {
                url: prefix + "/list",
                createUrl: prefix2 + "/addNewActivity",
                detailUrl: prefix2 + "/storeDetail?id={id}",
                removeUrl: prefix + "/cancel/{id}",
                updateUrl: prefix + "/edit/{id}",
                // exportUrl: prefix + "/export",
                onCheck: onCheck,
                sortName: "createdAt",
                sortOrder: "desc",
                modalName: "活动",
                showSearch: false,
                showRefresh: true,
                showColumns: false,
                showToggle: false,
                columns: [
                    {
                        checkbox: true
                    },
                    {
                        field: 'valFace',
                        title: '店铺'
                    },
                    {
                        field: 'bindType',
                        title: '活动商品数量',
                        formatter: function(value, row, index) {
                            // $('.pull-right').hide()
                            return $.table.selectDictLabel(dicCouponBindType, value);
                        }
                    },
                    {
                        title: '操作',
                        align: 'center',
                        formatter: function (value, row, index) {
                            return `<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="$.operate.detailTab('${row.itemId}', 7, '确定下架此商品吗？')">查看详情</a>`
                        }
                    }]
            };
            $.table.init(options);
        });
        function onCheck (row, $element) {
            console.log(row, $element)
        }
        $("#button-open-11").click(function(){
            $("button[name=refresh]").click()
	    })
        layui.use('laydate', function(){
            var laydate = layui.laydate;
            //执行一个laydate实例
            laydate.render({
                elem: '#test1', //指定元素
                type: 'datetime'
            });
        });
    </script>
</body>
</html>