puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@layout("/common/_container.html"){
<style>
    .newWidth, .single-line{
        max-width:350px !important;display: initial !important;
    }
</style>
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <div class="row row-lg">
                    <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-3" aria-expanded="false">运动安全告知书</a></li>
                                <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">注销账号说明</a></li>
                            </ul>
                            <div class="tab-content">
                                <div id="tab-1" class="tab-pane active">
                                    <div class="panel-body">
                                        <textarea id="editor_1" type="text/plain" style="width:1200px;height:400px;">${one.content}</textarea>
                                        <div class="row btn-group-m-t">
                                            <div class="col-sm-10 col-sm-offset-5">
                                                <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="update_1(${one.id});"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div id="tab-2" class="tab-pane">
                                    <div class="panel-body">
                                        <textarea type="text/plain" id="editor_2" style="width:1200px;height:400px;">${two.content}</textarea>
                                        <div class="row btn-group-m-t">
                                            <div class="col-sm-10 col-sm-offset-5">
                                                <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="update_2(${two.id});"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div id="tab-3" class="tab-pane">
                                    <div class="panel-body">
                                        <textarea type="text/plain" id="editor_3" style="width:1200px;height:400px;">${three.content}</textarea>
                                        <div class="row btn-group-m-t">
                                            <div class="col-sm-10 col-sm-offset-5">
                                                <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="update_3(${three.id});"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
 
                                <div id="tab-4" class="tab-pane">
                                    <div class="panel-body">
                                        <textarea type="text/plain" id="editor_4" style="width:1200px;height:400px;">${four.content}</textarea>
                                        <div class="row btn-group-m-t">
                                            <div class="col-sm-10 col-sm-offset-5">
                                                <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="update_4(${four.id});"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
 
<script type="text/javascript">
    var editor_1 = null;
    var editor_2 = null;
    var editor_3 = null;
    var editor_4 = null;
    $(function () {
        //初始化编辑器
        editor_1 = UE.getEditor('editor_1');
        editor_2 = UE.getEditor('editor_2');
        editor_3 = UE.getEditor('editor_3');
        editor_4 = UE.getEditor('editor_4');
    });
 
    function update_1(id){
        if (editor_1.getContentTxt() == ""){
            Feng.error("内容不能为空!");
            return;
        }
        submitData(editor_1.getContent(),id);
    }
    function update_2(id){
        if (editor_2.getContentTxt() == ""){
            Feng.error("内容不能为空!");
            return;
        }
        submitData(editor_2.getContent(),id);
    }
    function update_3(id){
        if (editor_3.getContentTxt() == ""){
            Feng.error("内容不能为空!");
            return;
        }
        submitData(editor_3.getContent(),id);
    }
    function update_4(id){
        if (editor_4.getContentTxt() == ""){
            Feng.error("内容不能为空!");
            return;
        }
        submitData(editor_4.getContent(),id);
    }
 
    function submitData(content,id) {
        //提交信息
        var ajax = new $ax(Feng.ctxPath + "/tAgree/updateAppParam", function(data){
            Feng.success("编辑成功!");
        },function(data){
            Feng.error("编辑失败!" + data.responseJSON.message + "!");
        });
        ajax.set("context", content);
        ajax.set("id", id);
        ajax.start();
    }
</script>
@}