admin
2021-01-23 0a18a8cb0a7a57bf1f82df425251334c57f8c39a
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<%@page import="com.yeshi.buwan.util.VideoTypeUtil"%>
<%@page import="com.yeshi.buwan.domain.web.HotTypeAdmin"%>
<%@page import="com.yeshi.buwan.domain.web.BanquanVideoAdmin"%>
<%@page import="com.yeshi.buwan.domain.DetailSystem"%>
<%@page import="com.yeshi.buwan.domain.web.DetailSystemSelect"%>
<%@page import="com.yeshi.buwan.domain.web.BanquanKeyAdmin"%>
<%@page import="com.yeshi.buwan.domain.VideoIntersection"%>
<%@page import="com.yeshi.buwan.domain.HomeType"%>
<%@page import="com.yeshi.buwan.util.TimeUtil"%>
<%@page import="java.util.concurrent.TimeUnit"%>
<%@page import="com.yeshi.buwan.web.tag.PageEntity"%>
<%@page import="com.yeshi.buwan.util.StringUtil"%>
<%@page import="com.yeshi.buwan.domain.VideoInfo"%>
<%@page import="com.yeshi.buwan.domain.SystemInfo"%>
<%@ page language="java" import="java.util.*"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page pageEncoding="UTF-8"%><%@ taglib prefix="page" uri="/pagelib"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>首页分类添加</title>
<link rel="stylesheet" href="/BuWan/css/gongyong.css" type="text/css" />
<link rel="stylesheet" href="/BuWan/css/sspb.css"
    type="text/css" />
<LINK rel=stylesheet href="/BuWan/js/jquery-ui-1.11.4/jquery-ui.css" />
<script type="text/javascript" src="/BuWan/js/jquery.min.js"></script>
<script type="text/javascript" src="/BuWan/js/check.js"></script>
<script type="text/javascript" src="/BuWan/js/jquery.js"></script>
<script type="text/javascript"
    src="/BuWan/js/jquery-ui-1.11.4/jquery-ui.js"></script>
<script type="text/javascript">
    $(function() {
        var dialog = $("#dialog")
                .dialog(
                        {
                            autoOpen : false,
                            modal : true,
                            height : 500,
                            width : 800,
                            buttons : {
                                "确定" : function() {
                                    var linktype = $(
                                            "input[name='linktype']:checked")
                                            .val();
                                    switch (linktype) {
                                    case ("1"):
                                        if ($("#searchcontent").val() != ""
                                                && $("#searchcontent").val() != null) {//如果选中的值
                                            $("#olinktype0").attr("checked",
                                                    "checked");
                                            $("#ovideoid").val(
                                                    $("#videoid").val());
                                            $("#span_url").empty();
                                            $("#span_video").empty();
                                            $("#span_intersection").empty();
                                            $("#span_video").append(
                                                    $("#searchcontent").val());
                                        }
                                        break;
                                    case ("2"):
                                        var val = $("#typeurl").val();//网页跳转的值
                                        if (val != "" && val != null) {
                                            $("#olinktype1").attr("checked",
                                                    "checked");
                                            $("input[name=olinktype]:eq(1)")
                                                    .attr("checked", 'checked');
                                            $("#ourl").val(val);
                                            $("#span_url").empty();
                                            $("#span_video").empty();
                                            $("#span_intersection").empty();
                                            $("#span_url").append(val);
                                        }
                                        break;
                                    case ("3"):
                                        var intersection = $(
                                                "input[name='i']:checked")
                                                .attr("value");
 
                                        if (intersection != null
                                                && intersection != "") {//有选中的值
                                            $("#olinktype2").attr("checked",
                                                    "checked");
                                            $("#span_url").empty();
                                            $("#span_video").empty();
                                            $("#span_intersection").empty();
                                            $("#ointersection").val(
                                                    intersection);
                                            $("#span_intersection").append(
                                                    intersection);
                                        }
                                        break;
 
                                    }
                                    dialog.dialog("close");
                                },
                                "取消" : function() {
                                    $("#videoid").val("");
                                    dialog.dialog("close");
                                }
                            }
                        });
 
        $("#open").button().on("click", function() {
            $("input:radio[name='linktype']").eq(0).attr("checked", 'checked');
            dialog.dialog("open");
        });
 
        var searchdialog = $("#searchdialog").dialog(
                {
                    autoOpen : false,
                    modal : true,
                    height : 750,
                    width : 600,
                    buttons : {
                        "确定" : function() {
                            var result = $(
                                    "input[name='rbsearchresult']:checked")
                                    .attr("value");
 
                            var resultObject = $.parseJSON(result);
                            $("#searchcontent").val(resultObject.Name);
                            $("#videoid").val(resultObject.Id);
                            searchdialog.dialog("close");
                        },
                        "取消" : function() {
                            searchdialog.dialog("close");
                        }
                    }
                });
 
        $("#cb_type_video").click(function() {
 
            $("#cb_type_video").attr("checked", true);
            $("#cb_type_url").attr("checked", false);
            $("#cb_type_intersection").attr("checked", false);
            $(".cbintersection").attr("checked", false);
        });
        $("#cb_type_url").click(function() {
            $("#cb_type_video").attr("checked", false);
            $("#cb_type_url").attr("checked", true);
            $("#cb_type_intersection").attr("checked", false);
            $(".cbintersection").attr("checked", false);
        });
        $("#cb_type_intersection").click(function() {
            $("#cb_type_video").attr("checked", false);
            $("#cb_type_url").attr("checked", false);
            $("#cb_type_intersection").attr("checked", true);
        });
        //合集选择
        $(".cbintersection").click(function() {
            if (!$("#cb_type_intersection").attr("checked")) {
                $(".cbintersection").attr("checked", false);
            }
        });
 
        //搜索接口
 
        function search(content) {
            $("#search").val("获取结果中...");
            $
                    .ajax({
                        url : encodeURI("/BuWan/VideoServlet?type=searchVideo&name="
                                + content),//encodeURI
                        cache : false,
                        success : function(data) {
                            // $(this).addClass("done");
                            $("#search").val("搜索");
                            $("#searchresult").empty();
                            $("#searchresult")
                                    .append(
                                            "<tr><td>ID</td><td>图片</td><td>名称</td><td>创建时间</td></tr>");
                            var jsonData = eval(data);
                            $
                                    .each(
                                            jsonData,
                                            function(index, objVal) { //遍历对象数组,index是数组的索引号,objVal是遍历的一个对象。  
                                                //val["属性"]可取到对应的属性值。  
                                                //组装json去空格
                                                var trans = jQuery
                                                        .trim(
                                                                "{\"Id\":\""
                                                                        + objVal["Id"]
                                                                        + "\",\"Name\":\""
                                                                        + objVal["Name"]
                                                                        + "\"}")
                                                        .replace(/\s+/g, "");
                                                $("#searchresult")
                                                        .append(
                                                                "<tr><td>"
                                                                        + objVal["Id"]
                                                                        + "</td><td><img src="+objVal["Picture"]+" style=\"width:100px\"></td>"
                                                                        + "<td>"
                                                                        + objVal["Name"]
                                                                        + "</td><td>"
                                                                        + objVal["Createtime"]
                                                                        + "</td><td><input name=\"rbsearchresult\" type=\"radio\" value="
                                                                        + trans
                                                                        + "></td></tr>");
                                            });
                            searchdialog.dialog("open");
                        }
                    });
        }
 
        $("#search").click(
                function() {
                    if ($("#searchcontent").val() == undefined
                            || $("#searchcontent").val() == ""
                            || $("#searchcontent").val() == null) {
                    } else {
                        search($("#searchcontent").val());
                    }
 
                });
 
    });
</script>
<!-- 输入框 -->
<script type="text/javascript">
    function submitAdd() {
        var url = "";
        for (var i = 0; i < $(".detailsystemcheck").length; i++) {
            var el = $(".detailsystemcheck")[i];
            if ((el.checked == true)) {
                url += (el.value + ",");
            }
        }
        alert(url);
        $("#detailsystems").val(url);
        return false;
    }
</script>
 
</head>
 
<%
    List<DetailSystem> detailSystemList = (List<DetailSystem>) request.getAttribute("detailSystemList");
    List<SystemInfo> list = (List<SystemInfo>) request.getAttribute("systemList");
    List<VideoIntersection> ilist = (List<VideoIntersection>) request.getAttribute("intersectionList");
%>
 
<body>
 
    <div id="searchdialog" title="搜索结果" style="display: none;">
        <table id="searchresult"></table>
    </div>
    <!-- Dialog -->
    <div id="dialog" title="广告链接" style="display: none;">
        <form>
            <table>
                <tr>
                    <td><b>单个视频</b><input type="radio" name="linktype" value="1"
                        id="cb_type_video"></td>
                    <td><br /> <br />
                        <table>
                            <tr>
                                <td><input type="text" id="searchcontent"
                                    style="width: 200px"></td>
                                <td><input type="button" id="search" value="搜索"><input
                                    type="hidden" name="videoid" id="videoid"></td>
                            </tr>
                        </table></td>
                </tr>
                <tr>
                    <td><b>跳转网页</b><input type="radio" value="2" name="linktype"
                        id="cb_type_url"></td>
                    <td><br /> <br /> <input type="text" id="typeurl"
                        style="width: 400px"></td>
                </tr>
 
                <tr>
                    <td><b>合集跳转</b><input type="radio" value="3" name="linktype"
                        id="cb_type_intersection"></td>
                    <td><br /> <br />
                        <table>
                            <%
                                for (int i = 0; i < (ilist.size() % 4 == 0 ? ilist.size() / 4 : ilist.size() / 4 + 1); i++) {
                                    out.print("<tr>");
                                    for (int j = 0; j < 4; j++) {
                                        out.print("<td>");
                                        if (i * 4 + j < ilist.size()) {
                                            out.print("<input class='cbintersection' type=\"radio\" id=i" + ilist.get(i * 4 + j).getId()
                                                    + " name=i value=" + ilist.get(i * 4 + j).getId() + ">"
                                                    + ilist.get(i * 4 + j).getName());
                                        }
                                        out.print("</td>");
                                    }
                                    out.print("</tr>");
                                }
                            %>
                        </table></td>
                </tr>
            </table>
        </form>
    </div>
 
    <form action="addHomeAd.action">
 
 
        <div class="div_bj">
            <div class="div_ban">用户Banner修改</div>
            <div class="div_rdtg"></div>
 
 
            <div class="nr0">
 
                <div class="div_002">
                    <div class="text_001">图片:</div>
                    <div>
                        <div class="bs-docs-example">
                            <input type="text" name="picture" class="wbk">
                        </div>
                    </div>
                </div>
 
                <div class="div_002">
                    <div class="text_001">系统:</div>
                    <div>
                        <div class="bs-docs-example">
                            <select name="system">
                                <%
                                    for (SystemInfo info : list) {
                                %>
                                <option value="<%=info.getId()%>"><%=info.getName()%></option>
                                <%
                                    }
                                %>
                            </select>
                        </div>
                    </div>
                </div>
 
                <div class="div_002">
                    <div class="text_001">简要介绍:</div>
                    <div>
                        <div class="bs-docs-example">
                            <input type="text" name="introduction" class="wbk">
                        </div>
                    </div>
                </div>
 
                <div class="div_002">
                    <div class="text_001">排序值:</div>
                    <div>
                        <div class="bs-docs-example">
                            <input type="text" name="orderby" class="wbk">
                        </div>
                    </div>
                </div>
 
                <div class="div_002">
                    <div class="text_001">简要介绍:</div>
                    <div>
                        <div class="bs-docs-example">
                            <%
                                out.print(
                                        "<input type='radio' name='olinktype' checked='checked' id='olinktype0' value='1'> 视频跳转:<span id='span_video'></span>");
                                out.print(
                                        "<input type='radio' name='olinktype' id='olinktype1' value='2'> 网页跳转:<span id='span_url'></span>");
                                out.print(
                                        "<input type='radio' name='olinktype' id='olinktype2' value='3'> 合集跳转:<span id='span_intersection'></span>");
 
                                out.print("<input type='hidden' name='ovideoid' id='ovideoid'>");
                                out.print("<input type='hidden' name='ourl' id='ourl'>");
                                out.print("<input type='hidden' name='ointersection' id='ointersection'>");
                            %>
                            <input value="更改" type="button" id="open" />
 
                        </div>
                    </div>
                </div>
 
                <div class="div_002">
                    <div class="text_001">备注:</div>
                    <div>
                        <div class="bs-docs-example">
                            <textarea rows="5" cols="50" name="beizhu"></textarea>
                        </div>
                    </div>
                </div>
 
                <div class="div_002">
                    <div class="text_001">APP:</div>
                    <div>
                        <div class="div_td0">
                            <div class="div_te">
                                <ul>
                                    <%
                                        for (DetailSystem dss : detailSystemList) {
                                    %>
                                    <li><input class="detailsystemcheck" type="checkbox"
                                        value="<%=dss.getId()%>" /><%=dss.getAppName() + ("(" + (dss.getPlatform() == 1 ? "A" : "I") + ")")%></li>
                                    <%
                                        }
                                    %>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <input type="hidden" name="detailsystems" id="detailsystems">
 
 
                <div class="div_002">
                    <div>
                        <input type="submit" class="submit_blue" value="确定"
                            onclick="submitAdd()" /> <input type="button"
                            class="submit_blue" value="取消" />
                    </div>
                </div>
            </div>
        </div>
    </form>
</body>
<script type="text/javascript" src="/BuWan/js/countheight.js">
    
</script>
 
</html>