<!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 id="li-tab-2" class="active"><a data-toggle="tab" href="#tab-2" aria-expanded="false">演出详情</a>
                    </li>
                    <li id="li-tab-1"><a data-toggle="tab" href="#tab-1" aria-expanded="true" id="tab-nav-1"> 演出数据</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 id="li-tab-6"><a data-toggle="tab" href="#tab-6" aria-expanded="false" onclick="refundConfigInfo()">退款管理</a>
                    </li>
                    <li id="li-tab-3"><a data-toggle="tab" href="#tab-3" aria-expanded="false" onclick="memberInfo()">会员信息配置</a>
                    </li>
                    <li id="li-tab-4"><a data-toggle="tab" href="#tab-4" aria-expanded="false" onclick="agentInfo()">代理配置</a>
                    </li>
                    <li id="li-tab-5"><a data-toggle="tab" href="#tab-5" aria-expanded="false" onclick="damaiInfo()">大麦配置</a>
                    </li>
                    <li id="li-tab-7"><a data-toggle="tab" href="#tab-7" aria-expanded="false" onclick="transferInfo()">转赠配置</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div id="tab-1" class="tab-pane">
                        <div class="panel-body">
                            <div id="tab-1" class="tab-pane">
                                <!--                                <th:block th:include="../templates/zhengzai/kylin/performances/performancesStatic :: performancesStatic"/>-->
                                <iframe id="tab_iframe_1" name="tab_iframe_1" marginwidth=0 marginheight=0 width=100%
                                        height=800px frameborder=0></iframe>
                            </div>
                        </div>
                    </div>
                    <div id="tab-2" class="tab-pane active">
                        <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 th:if="*{type==101}">音乐节</span>
                                    <span th:if="*{type==102}">小型演出</span>
                                    <span th:if="*{type==103}">巡演</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">
                                    <span>购票须知：</span>
                                    <div th:each="dict : ${kylinPerformanceMisVo.noticeImageList}">
                                        <span th:text="${dict.title}"></span>
                                        <img th:src="${dict.imgUrl}"/>
                                        <span th:text="${dict.message}"></span>
                                    </div>
                                </div>

                                <div th:each="dict : ${kylinPerformanceMisVo.ticketTimes}">
                                    <div th:each="dict2 : ${dict.ticket}">
                                        <br/>
                                        <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.describes}"></span>
                                        </div>
                                        <div th:if="${dict2.isElectronic==1}">
                                            <span>电子票说明：</span>
                                            <span th:text="${dict2.describeElectronic}"></span>
                                        </div>
                                        <div th:if="${dict2.isExpress==1}">
                                            <span>快递票说明：</span>
                                            <span th:text="${dict2.describeExpress}"></span>
                                        </div>
                                        <div th:if="${dict2.limitCount == 0}">
                                            <span>限购：</span>
                                            <span>不限购</span>
                                        </div>
                                        <div th:if="${dict2.limitCount != 0}">
                                            <span>限购：</span>
                                            <span th:text="${dict2.limitCount}">不限购</span>
                                        </div>
                                        <div>
                                            <span>库存总量：</span>
                                            <span th:text="${dict2.totalGeneral}"></span>
                                        </div>
                                        <!--                                        <div>-->
                                        <!--                                            <span>售票状态：</span>-->
                                        <!--                                            <span th:if="${dict2.status == 1}">审核中</span>-->
                                        <!--                                            <span th:if="${dict2.status == 3}">审核通过</span>-->
                                        <!--                                            <span th:if="${dict2.status == 4}">未通过</span>-->
                                        <!--                                            <span th:if="${dict2.status == 6}">在售</span>-->
                                        <!--                                            <span th:if="${dict2.status == 7}">下架</span>-->
                                        <!--                                            <span th:if="${dict2.status == 8}">售罄</span>-->
                                        <!--                                            <span th:if="${dict2.status == 9}">未开始</span>-->
                                        <!--                                            <span th:if="${dict2.status == 10}">已结束</span>-->
                                        <!--                                        </div>-->
                                        <div>
                                            <span>开始售票时间：</span>
                                            <span th:text="${dict2.timeStart}"></span>
                                        </div>
                                        <div>
                                            <span>是否学生票：</span>
                                            <span th:if="${dict2.isStudent==1}">是</span>
                                            <span th:if="${dict2.isStudent==0}">否</span>
                                        </div>
                                        <div>
                                            <span>是否显示二维码：</span>
                                            <span th:if="${dict2.isShowCode==1}">是</span>
                                            <span th:if="${dict2.isShowCode==0}">否</span>
                                        </div>
                                        <div th:if="${dict2.isShowCode==1}">
                                            <span>二维码显示时间：</span>
                                            <span th:text="${dict2.qrCodeShowTime}"></span>
                                        </div>
                                        <div>
                                            <span>取票方式：</span>
                                            <span th:if="${dict2.isElectronic==1}">电子票</span>
                                            <span th:if="${dict2.isExpress==1}">快递票</span>
                                        </div>
                                        <div th:if="${dict2.isExpress==1}">
                                            <span>快递票停售时间：</span>
                                            <span th:text="${dict2.timeEndExpress}"></span>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="panel-body" th:width="max" style="margin-top: 10px" name="auditBtn">
                            <div class="radio check-box">
                                <input type="radio" value="1" name="auditCheck"> 同意</label>
                            </div>
                            <div class="radio check-box">
                                <input type="radio" value="0" name="auditCheck"> 拒绝</label>
                            </div>
                            <input name="rejectTxt" class="form-control" type="text"/>
                            <button type="button" class="btn btn-w-m btn-success"
                                    style="margin-top: 10px"
                                    onclick="aduitHandler()">审核
                            </button>
                        </div>
                    </div>
                    <div id="tab-3" class="tab-pane">
                        <div class="panel-body">
                            <iframe id="content_iframe" name="content_iframe" marginwidth=0 marginheight=0 width=100%
                                    height=800px frameborder=0></iframe>
                        </div>
                    </div>
                    <div id="tab-4" class="tab-pane">
                        <div class="panel-body">
                            <iframe id="agent_iframe" name="agent_iframe" marginwidth=0 marginheight=0 width=100%
                                    height=800px frameborder=0></iframe>
                        </div>
                    </div>
                    <div id="tab-5" class="tab-pane">
                        <div class="panel-body">
                            <iframe id="damai_iframe" name="damai_iframe" marginwidth=0 marginheight=0 width=100%
                                    height=800px frameborder=0></iframe>
                        </div>
                    </div>
                    <div id="tab-6" class="tab-pane">
                        <div class="panel-body">
                            <iframe id="refundConfig_iframe" name="refundConfig_iframe" marginwidth=0 marginheight=0 width=100%
                                    height=800px frameborder=0></iframe>
                        </div>
                    </div>
                    <div id="tab-7" class="tab-pane">
                        <div class="panel-body">
                            <iframe id="transfer_iframe" name="transfer_iframe" marginwidth=0 marginheight=0 width=100%
                                    height=800px frameborder=0></iframe>
                        </div>
                    </div>
                </div>


            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "kylin/performances"
    const isShow = '[[${kylinPerformanceMisVo.isShow}]]';
    const auditStatus = '[[${kylinPerformanceMisVo.auditStatus}]]';

    var agentFlag = [[${@permission.hasPermi('kylin:performances:agent')}]];
    if(agentFlag=="hidden"){
        document.getElementById("li-tab-4").style.display = "none";
    }

    var otherFlag = [[${@permission.hasPermi('kylin:performances:audit')}]];
    if(otherFlag=="hidden"){
        document.getElementById("li-tab-2").style.display = "none";
        document.getElementById("tab-2").style.display = "none";
    }

    var refundFlag = [[${@permission.hasPermi('kylin:performances:refund')}]];
    if(refundFlag=="hidden"){
        document.getElementById("li-tab-6").style.display = "none";
    }

    var memberFlag = [[${@permission.hasPermi('kylin:performances:member')}]];
    if(memberFlag=="hidden"){
        document.getElementById("li-tab-3").style.display = "none";
    }

    var damaiFlag = [[${@permission.hasPermi('kylin:performances:damai')}]];
    if(damaiFlag=="hidden"){
        document.getElementById("li-tab-5").style.display = "none";
    }

    var dataFlag = [[${@permission.hasPermi('kylin:performances:data')}]];
    if(dataFlag=="hidden"){
        document.getElementById("li-tab-1").style.display = "none";
    }

    var transferFlag = [[${@permission.hasPermi('kylin:performances:transfer')}]];
    if(transferFlag=="hidden"){
        document.getElementById("li-tab-7").style.display = "none";
    }

    if (auditStatus != 0) {
        document.getElementsByName("auditBtn")[0].style.display = "none";
    }

    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) {
        });
    }

    //演出审核
    function aduitHandler() {
        const auditStatus = document.getElementsByName("auditCheck")[0].checked ? 3 : 4;
        var auditRejectTxt = ""
        if (4 === auditStatus) {
            auditRejectTxt = document.getElementsByName("rejectTxt")[0].value;
        }

        if (4 === auditStatus && auditRejectTxt === "") {
            alert("请填写拒绝理由");
        } else {
            var param = {
                "status": auditStatus,
                "performancesId": '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", ""),
                "rejectTxt": auditRejectTxt
            };
            $.operate.post(prefix + "/audit", param, function (res) {
                // $.modal.close();
                // $.table.refresh();
                location.reload();
            });
        }
    }

    // 演出详情 购票须知
    var subText = document.getElementById("subText")
    subText.innerHTML = "演出详情：" + '[[${kylinPerformanceMisVo.details}]]'.replaceAll("\"", "");

    //会员详情
    function memberInfo() {
        document.getElementById("content_iframe").src = "../memberInfo/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "");
    }

    //代理详情
    function agentInfo() {
        document.getElementById("agent_iframe").src = "../agent/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "");
    }

    //大麦详情
    function damaiInfo() {
        document.getElementById("damai_iframe").src = "../damai/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "");
    }

    //退款管理
    function refundConfigInfo() {
        document.getElementById("refundConfig_iframe").src = "../refundConfig/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "");
    }

    //转赠配置
    function transferInfo(){
        document.getElementById("transfer_iframe").src = "../transferConfig/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "");
    }

    $("#tab-nav-1").bind("click", function () {
        $("#tab_iframe_1").attr("src", prefix + "/performanceStatic/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", ""));
    });
</script>
</body>
</html>
