<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>预约须知</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="icon" th:href="@{image/sgl.png}" sizes="32x32">
    <script th:src="@{/layui/layui.js}"></script>
    <script th:src="@{/layui/jquery-3.4.1.min.js}"></script>
    <script th:src="@{/js/common.js}"></script>
    <script th:src="@{/js/rules.js}"></script>
	<script th:src="@{/ueditor/ueditor.config.js}"></script>
	<script th:src="@{/ueditor/ueditor.all.min.js}"></script>
	<script th:src="@{/ueditor/lang/zh-cn/zh-cn.js}"></script>
    <link rel="stylesheet" th:href="@{/css/common.css}">
</head>
<body style="width:100;height:100%">
	<div>
	    <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>
	</div>
	    <button style="margin-left:500px" class="layui-btn" onclick="updateOrderNotice()"><i class="layui-icon"></i>保存</button>

<script type="text/javascript">
	var ue = UE.getEditor('editor');
	var element ,
	    table,
	    laydate,
	    layer,
	    form,
	    tree,
		upload;
	var tHeight = $(".toolbar").height()+6;
    layui.use(['element','table','laydate','layer','form','tree','upload'], function(){
		element = layui.element;
	    table = layui.table;
	    laydate = layui.laydate;
	    layer = layui.layer;
	    form = layui.form;
	    tree = layui.tree;
	    upload = layui.upload;
	    
	    
	    findOrderNotice();
	    //查询预约须知
	    function findOrderNotice(){
	        var param={};
	        var url='/order/findOrderNotice';
	        AjaxPostJson(url,param,function(data){
	        	
	        	ue.setContent(data.CONTENT);
	        });
	    }
	});
	
    //更新预约须知
    function updateOrderNotice(){
        var param={};
        param.content = UE.getEditor('editor').getContent();
        var url='/order/updateOrderNotice';
        AjaxPostJson(url,param,function(data){
            if (data.errCode == "0") {
                layer.msg('更新成功', {
                    time : 1000
                });
            } else {
                layer.msg(data.errMsg, {time : 1000});
            }
        });
    }
</script>
</body>
</html>