<!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('选项卡 & 面板')"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeIn">
    <div class="row">
        <div class="col-sm-12">
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 演出数据</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">演出详情</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">校园分销</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">社会分销</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">状态管理</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">库存预警</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">会员信息配置</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">关联直播数量配置</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">云南摩登权限</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div id="tab-1" class="tab-pane active">
                        <div class="panel-body">
                            <strong>HTML5 文档类型</strong>
                            <p>Bootstrap 使用到的某些 HTML 元素和 CSS 属性需要将页面设置为 HTML5 文档类型。在你项目中的每个页面都要参照下面的格式进行设置。</p>
                        </div>
                    </div>
                    <div id="tab-2" class="tab-pane">
                        <div class="panel-body" id="performance_config">
                            <strong>相关配置</strong>
                            <div th:width="max" style="margin-top: 10px">
                                <strong>是否显示当前演出</strong>
                                <div class="radio check-box">
                                    <input type="radio" value="1" name="isShowCheck"> 显示</label>
                                </div>
                                <div class="radio check-box">
                                    <input type="radio" value="0" name="isShowCheck"> 不显示</label>
                                </div>
                                <button type="button" class="btn btn-w-m btn-success" name="isShowBtn"
                                        onclick="submitHandler()">保存配置
                                </button>
                            </div>
                        </div>
                        <div class="panel-body" th:width="max" style="margin-top: 10px">
                            <form class="form-horizontal m" id="form-performances-edit"
                                  th:object="${kylinPerformanceMisVo}">
                                <div>
                                    <p>演出封面：</p>
                                    <img name="img" th:src="*{imgPoster}">
                                </div>
                                <div>
                                    <label>演出名称：</label>
                                    <span th:text="*{title}"></span>
                                </div>
                                <div>
                                    <label>时间：</label>
                                    <span th:text="*{timeStart}"></span>
                                    <span> - </span>
                                    <span th:text="*{timeEnd}"></span>
                                </div>
                                <div>
                                    <label>演出类型：</label>
                                    <span id="type"></span>
                                </div>
                                <div>
                                    <label>场地：</label>
                                    <span th:text="*{fieldName}"></span>
                                </div>
                                <div>
                                    <label>价格：</label>
                                    <span th:text="*{price}"></span>
                                </div>
                                <div>
                                    <label>停售时间：</label>
                                    <span th:text="*{stopSellTime}"></span>
                                </div>
                                <div>
                                    <label>主办方：</label>
                                    <span th:text="*{sponsor}"></span>
                                </div>
                                <div>
                                    <label>联系人：</label>
                                    <span th:text="*{contacts}"></span>
                                </div>
                                <div>
                                    <label>联系电话：</label>
                                    <span th:text="*{mobile}"></span>
                                </div>
                                <div>
                                    <p>演出批文：</p>
                                    <img name="img" th:src="*{approvalUrl}">
                                </div>

                                <div class="ibox-content" id="eg">
                                    <div class="click2edit wrapper" id="subText">
                                    </div>
                                </div>

                                <div id="noticeImg">

                                </div>

                                <div th:each="dict : ${kylinPerformanceMisVo.ticketTimes}">
                                    <div th:each="dict2 : ${dict.ticket}">
                                        <div>
                                            <span>票种名称：</span>
                                            <span th:text="${dict2.title}"></span>
                                        </div>
                                        <div>
                                            <span>使用日期：</span>
                                            <span th:text="${dict2.useStart}"></span>
                                            <span> - </span>
                                            <span th:text="${dict2.useEnd}"></span>
                                        </div>
                                        <div>
                                            <span>价格：</span>
                                            <span th:text="${dict2.price}"></span>
                                        </div>
                                        <div>
                                            <span>票种说明：</span>
                                            <span th:text="${dict2.title}"></span>
                                        </div>
                                        <div>
                                            <span>电子票说明：</span>
                                            <span th:text="${dict2.title}"></span>
                                        </div>
                                        <div>
                                            <span>学生票说明说明：</span>
                                            <span th:text="${dict2.title}"></span>
                                        </div>
                                        <div>
                                            <span>限购：</span>
                                            <span th:text="${dict2.limitCount}"></span>
                                        </div>
                                        <div>
                                            <span>库存总量：</span>
                                            <span th:text="${dict2.totalGeneral}"></span>
                                        </div>
                                        <div>
                                            <span>售票状态：</span>
                                            <span th:text="${dict2.status}"></span>
                                        </div>
                                        <div>
                                            <span>开始售票时间：</span>
                                            <span th:text="${dict2.timeStart}"></span>
                                        </div>
                                        <div>
                                            <span>是否学生票：</span>
                                            <span th:text="${dict2.isStudent}"></span>
                                        </div>
                                        <div>
                                            <span>取票方式：</span>
                                            <span th:text="${dict2.title}"></span>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>

                    <button type="button" class="btn btn-w-m btn-success" name="isShowBtn"
                            onclick="">审核
                    </button>
                </div>


            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "kylin/performances"


    const isShow = '[[${kylinPerformanceMisVo.isShow}]]';
    if (isShow == 1) {
        document.getElementsByName("isShowCheck")[0].checked = true;
    } else {
        document.getElementsByName("isShowCheck")[1].checked = true;
    }

    function submitHandler() {
        var param = {
            "isShow": document.getElementsByName("isShowCheck")[0].checked ? 1 : 0,
            "performancesId": '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "")
        };
        $.operate.post(prefix + "/isShow", param, function (res) {
        });
    }

    //演出信息
    const type = document.getElementById("type");
    var typeInt = '[[${kylinPerformanceMisVo.type}]]';
    if (typeInt == 101) {
        type.textContent = '音乐节'
    } else if (typeInt == 102) {
        type.textContent = '小型演出'
    } else if (typeInt == 103 || typeInt == 3) {
        type.textContent = '巡演'
    }
    // 演出详情 购票须知
    var subText = document.getElementById("subText")
    subText.innerHTML = "演出详情：" + '[[${kylinPerformanceMisVo.details}]]'.replaceAll("\"", "");
    var noticeImg = document.getElementById("noticeImg")
    noticeImg.innerHTML = "购票须知：" + '[[${kylinPerformanceMisVo.noticeImage}]]'.replaceAll("\"", "");
</script>
</body>
</html>
