admin
2020-10-26 89e370bfdda29ac8a8f7080a18dc09a6ddc75c09
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
<%@page import="com.yeshi.buwan.domain.VideoResource"%>
<%@page import="com.yeshi.buwan.domain.VideoUrl"%>
<%@page import="com.yeshi.buwan.domain.VideoDetailInfo"%>
<%@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"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>首页banner</title>
<link rel="stylesheet" href="/BuWan/css/base.css" type="text/css" />
<script type="text/javascript" src="/BuWan/js/jquery.min.js"></script>
<script type="text/javascript" src="/BuWan/js/jquery.js"></script>
<%
    List<VideoResource> resourceList = (List<VideoResource>) request
    .getAttribute("resourceList");
    String videoId=(String)request.getAttribute("videoId");
    System.out.println("VideoId:"+videoId);
%>
 
<script type="text/javascript">
    //jquery代码段
 
    function getNextVideoTypeList(typeId) {
        $.ajax({
            url : "/BuWan/VideoTypeServlet?type=getNextVideoTypeList&id="
                    + typeId,
            cache : false,
            success : function(data) {
                if (data != null && data != "[]") {
                    $(this).parent().nextAll().remove();
                    var printR = "<select class='select'>";
                    printR += "<option value="+typeId+">--请选择--</option>";
                    $.each(eval(data), function(i, item) {
                        printR += "<option value="+item.Id+">" + item.Name
                                + "</option>";
                    });
                    printR += "</select>";
 
                    $("#vt").append(printR);
                    $(".select").unbind();
                    $(".select").change(function() {
                        $(this).nextAll().remove();
                        $("#videoType").val($(this).val());
                        if ($(this).val() != $(this).prev().val())
                            getNextVideoTypeList($(this).val());
                    });
 
                }
            }
        });
    }
    
    function deleteDetail(detailid,view)
    {
    
     if(detailid>0)
     { 
     if(confirm("确定要删除该剧集吗?")==true)
         {    
           $.ajax({
            url : "/BuWan/VideoServlet?type=deleteDetail&id="
                    + detailid,
            cache : false,
            success : function(data) {
                  view.remove();
                  alert("删除成功");
            }
          });    
        }
        }
      else
        {
         alert("没有id删除");
         view.remove();
        }
    }
 
    $(function() {
        $(".deleteurl").click(function() {
            $(this).parent().parent().remove();
        });
 
        $(".deletedetail").click(function() {
             deleteDetail($(this).attr("detailid"),$(this).parent().parent());
        });
        
        $("#addDetail").click(function(){
        var htmlStr="<div class='detail' style='border: solid;border-width: 1px;border-color:gray; width: 500px;margin-top: 20px;'>"+
 
            "<form action='updateVideoDetail.action?id=0&videoId=<%=videoId%>'><div class='row'>"
 
            +"<span class='texttitle'>名称:<input type='text' class='text' name='name' > </span> <br />"
            +"</div><div class='row'><span class='texttitle'>小标题:<input type='text' class='text' name='tag' > </span> <br />"
            +"</div><div class='row'>"
 
            +"<span class='texttitle'>简介:<input type='text' class='text' name='introduction'></span> <br />"
            +"</div><div class='row'>"
 
            +"<span class='texttitle'>备注:<input type='text' class='text' name='beizhu'> </span> <br />"
            +"</div><div class='videourl' style='margin-left: 100px;'>"
                    
            +"<input type='button'  value='添加链接' class='submit_blue addurl' style='margin-left: 100px;margin-top: 20px;margin-bottom: 20px;'>"
 
            +"</div><input type='submit' id='updateDetail' value='保存修改' class='submit_blue' style='margin-left: 100px;margin-top: 20px;margin-bottom: 20px;'>"
            +"<input type='hidden' value='"+<%=videoId%>+"' name='videoId'> <input type='hidden' value='0' name='id'> "
 
            +"<input type='button' id='deleteDetail' value='删除' detailid='0' class='submit_blue deletedetail' style='margin-left: 100px;margin-top: 20px;margin-bottom: 20px;'>"
            +"</form>"
            +"</div>";
            $("#addDetail").before(htmlStr);
            $(".deleteurl").unbind();
            $(".addurl").unbind();
            $(".deletedetail").unbind();
            $(".deleteurl").click(function() {
                  $(this).parent().parent().remove();
             });
 
            $(".deletedetail").click(function() {
              deleteDetail($(this).attr("detailid"),$(this).parent().parent());
            });
            bindAddUrl();
            
        });
        
        
 
    });
</script>
 
 
<script type="text/javascript">
 
function bindAddUrl()
{
$(".addurl").click(function() {
        var htmlStr="<div style=\"border-color: #BBBBBB;border-width: 1px;border-style: solid;margin-top: 20px;margin-right: 20px;\">"+
                        "<div class=\"row\">"+"<span class=\"texttitle\">链接:<input type=\"text\" class=\"text\" name=\"urls\" > </span>"+
                        "</div><div class=\"row\"><span class=\"texttitle\">来源:<select name=\"resources\" >";
                                    <%for (VideoResource vr : resourceList) {%>
                                                        htmlStr+="<option value="
                                                                + <%=vr.getId()%> + ">" + '<%=vr.getName()%>' + "</option>";
<%}%>
    htmlStr += "</select> </span> <br />";
 
                            htmlStr += "</div><div class=\"row\"><span class=\"texttitle\">是否有效:<input type=\"checkbox\" class=\"text\"";
                        htmlStr+= " checked='checked'";
                        htmlStr+=" name=\"invalids\">";
 
                            htmlStr += "</span> <br /></div><div><input type=\"button\" value=\"删除链接\" class=\"submit_blue deleteurl\" style=\"margin-left: 100px;margin-top: 20px;margin-bottom: 20px;\"></div></div>";
                            $(this).before(htmlStr);
 
                            $(".deleteurl").unbind();
                            $(".deleteurl").click(function() {
                                $(this).parent().parent().remove();
                            });
 
                        });
        //计算高度                
        var main = $(window.parent.document).find("#content");
        var thisheight = $(document).height() + 30;
        main.height(thisheight);
    }
 
    $(function() {
 
        bindAddUrl();
 
    });
</script>
</head>
<!-- 详情页面 -->
<body>
    <div style="margin-left: 200px;padding: 50px;" id="detail">
        <input type="button" id="addDetail" value="添加集数" class="submit_blue"
            style="margin-left: 100px;">
    </div>
</body>
 
<script type="text/javascript" src="/BuWan/js/countheight.js">
    
</script>
</html>