<%@page import="com.yeshi.buwan.domain.DetailSystem"%>
|
<%@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>首页banner</title>
|
<link rel="stylesheet" href="/BuWan/css/gongyong.css"
|
type="text/css" />
|
<link rel="stylesheet" href="/BuWan/css/video_push.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 p_del() {
|
var msg = "您真的确定要删除吗?";
|
if (confirm(msg) == true) {
|
return true;
|
} else {
|
return false;
|
}
|
}
|
|
$(function(){
|
|
|
function push(title, content, pushtype, versions, apps, extra) {
|
window.location="pushContent.action?title=" + title
|
+ "&content=" + content + "&pushtype=" + pushtype
|
+ "&versions=" + versions + "&apps=" + apps+extra;
|
}
|
|
var textDialog = $("#divText").dialog(
|
{
|
autoOpen : false,
|
modal : true,
|
height : 300,
|
width : 500,
|
buttons : {
|
"确定推送" : function() {
|
if (confirm("确定要推送?")) {
|
push($('.title')[0].innerHTML,
|
$('.content')[0].innerHTML, 1,
|
$('.version')[0].innerHTML, $(
|
'#videoid').val(), "");
|
}
|
},
|
"取消" : function() {
|
textDialog.dialog("close");
|
}
|
}
|
});
|
|
var videoDialog = $("#divVideo").dialog(
|
{
|
autoOpen : false,
|
modal : true,
|
height : 500,
|
width : 800,
|
buttons : {
|
"推送" : function() {
|
var result = $(
|
"input[name='rbsearchresult']:checked")
|
.attr("value");
|
var resultObject = $.parseJSON(result);
|
if (confirm("确定要推送《" + resultObject.Name + "》?")) {
|
push($('.title')[1].innerHTML,
|
$('.content')[1].innerHTML, 2,
|
$('.version')[1].innerHTML, $(
|
'#videoid').val(),
|
"&videoid="+resultObject.Id);
|
} else {
|
alert("取消推送");
|
}
|
videoDialog.dialog("close");
|
},
|
"取消" : function() {
|
videoDialog.dialog("close");
|
}
|
}
|
});
|
|
var webDialog = $("#divWeb").dialog(
|
{
|
autoOpen : false,
|
modal : true,
|
height : 500,
|
width : 750,
|
buttons : {
|
"推送" : function() {
|
var url = $('#weburl').val();
|
if (url == null || url == "") {
|
alert("推送链接不能为空");
|
return;
|
}
|
if (confirm("确定要推送?")) {
|
push($('.title')[2].innerHTML,
|
$('.content')[2].innerHTML, 3,
|
$('.version')[2].innerHTML, $(
|
'#videoid').val(), "&url="+url);
|
}
|
webDialog.dialog("close");
|
},
|
"取消" : function() {
|
$("#videoid").val("");
|
webDialog.dialog("close");
|
}
|
}
|
});
|
|
var intersectionDialog = $("#divIntersection").dialog(
|
{
|
autoOpen : false,
|
modal : true,
|
height : 500,
|
width : 750,
|
buttons : {
|
"推送" : function() {
|
var intersection = $("input[name='i']:checked")
|
.attr("value");
|
|
if (intersection != null && intersection != "") {
|
if (confirm("确定要推送?")) {
|
push($('.title')[3].innerHTML,
|
$('.content')[3].innerHTML, 4,
|
$('.version')[3].innerHTML, $(
|
'#videoid').val(),
|
"&intersectionid="+intersection);
|
}
|
} else
|
alert("请选择推送的合集");
|
},
|
"取消" : function() {
|
$("#videoid").val("");
|
intersectionDialog.dialog("close");
|
}
|
}
|
});
|
|
$("#pushText").button().on("click", function() {
|
$(".title")[0].innerHTML = $('#title').val();
|
$(".content")[0].innerHTML = $('#content').val();
|
var v = $(".oversion");
|
var i = 0;
|
var version = "";
|
for (i = 0; i < v.length; i++) {
|
if ($(".oversion")[i].checked)//选中.is(":checked")
|
{
|
version += $('.oversion')[i].value + ",";
|
}
|
}
|
if (version.length > 0)
|
version = version.substring(0, version.length - 1);
|
else {
|
alert("请选择版本");
|
return;
|
}
|
$('.version')[0].innerHTML = version;
|
var apps = "";
|
var appsname = "";
|
var alen = $('.oapps').length;
|
for (i = 0; i < alen; i++) {
|
if ($('.oapps')[i].checked)//选中
|
{
|
apps += $('.oapps')[i].value + ",";
|
appsname += $('.oapps')[i].getAttribute("name") + ",";
|
//$('.apps')[0].append($('.oapps')[i].value + ",");
|
}
|
}
|
if (apps.length > 0) {
|
apps = apps.substring(0, apps.length - 1);
|
appsname = appsname.substring(0, appsname.length - 1);
|
$('.apps')[0].innerHTML = appsname;
|
$('#videoid').val(apps);
|
} else {
|
alert("请选择APP");
|
return;
|
}
|
|
textDialog.dialog("open");
|
});
|
|
$("#pushVideo").button().on("click", function() {
|
$(".title")[1].innerHTML = $('#title').val();
|
$(".content")[1].innerHTML = $('#content').val();
|
var v = $(".oversion");
|
var i = 0;
|
var version = "";
|
for (i = 0; i < v.length; i++) {
|
if ($(".oversion")[i].checked)//选中.is(":checked")
|
{
|
version += $('.oversion')[i].value + ",";
|
}
|
}
|
if (version.length > 0)
|
version = version.substring(0, version.length - 1);
|
else {
|
alert("请选择版本");
|
return;
|
}
|
$('.version')[1].innerHTML = version;
|
var apps = "";
|
var appsname = "";
|
var alen = $('.oapps').length;
|
for (i = 0; i < alen; i++) {
|
if ($('.oapps')[i].checked)//选中
|
{
|
apps += $('.oapps')[i].value + ",";
|
appsname += $('.oapps')[i].getAttribute("name") + ",";
|
//$('.apps')[0].append($('.oapps')[i].value + ",");
|
}
|
}
|
if (apps.length > 0) {
|
apps = apps.substring(0, apps.length - 1);
|
appsname = appsname.substring(0, appsname.length - 1);
|
$('.apps')[1].innerHTML = appsname;
|
$('#videoid').val(apps);
|
} else {
|
alert("请选择APP");
|
return;
|
}
|
//$("input:radio[name='linktype']").eq(0).attr("checked", 'checked');
|
videoDialog.dialog("open");
|
});
|
|
$("#pushWeb").button().on("click", function() {
|
$(".title")[2].innerHTML = $('#title').val();
|
$(".content")[2].innerHTML = $('#content').val();
|
var v = $(".oversion");
|
var i = 0;
|
var version = "";
|
for (i = 0; i < v.length; i++) {
|
if ($(".oversion")[i].checked)//选中.is(":checked")
|
{
|
version += $('.oversion')[i].value + ",";
|
}
|
}
|
if (version.length > 0)
|
version = version.substring(0, version.length - 1);
|
else {
|
alert("请选择版本");
|
return;
|
}
|
$('.version')[2].innerHTML = version;
|
var apps = "";
|
var appsname = "";
|
var alen = $('.oapps').length;
|
for (i = 0; i < alen; i++) {
|
if ($('.oapps')[i].checked)//选中
|
{
|
apps += $('.oapps')[i].value + ",";
|
appsname += $('.oapps')[i].getAttribute("name") + ",";
|
//$('.apps')[0].append($('.oapps')[i].value + ",");
|
}
|
}
|
if (apps.length > 0) {
|
apps = apps.substring(0, apps.length - 1);
|
appsname = appsname.substring(0, appsname.length - 1);
|
$('.apps')[2].innerHTML = appsname;
|
$('#videoid').val(apps);
|
} else {
|
alert("请选择APP");
|
return;
|
}
|
webDialog.dialog("open");
|
});
|
|
$("#pushIntersection").button().on("click", function() {
|
$(".title")[3].innerHTML = $('#title').val();
|
$(".content")[3].innerHTML = $('#content').val();
|
var v = $(".oversion");
|
var i = 0;
|
var version = "";
|
for (i = 0; i < v.length; i++) {
|
if ($(".oversion")[i].checked)//选中.is(":checked")
|
{
|
version += $('.oversion')[i].value + ",";
|
}
|
}
|
if (version.length > 0)
|
version = version.substring(0, version.length - 1);
|
else {
|
alert("请选择版本");
|
return;
|
}
|
$('.version')[3].innerHTML = version;
|
var apps = "";
|
var appsname = "";
|
var alen = $('.oapps').length;
|
for (i = 0; i < alen; i++) {
|
if ($('.oapps')[i].checked)//选中
|
{
|
apps += $('.oapps')[i].value + ",";
|
appsname += $('.oapps')[i].getAttribute("name") + ",";
|
//$('.apps')[0].append($('.oapps')[i].value + ",");
|
}
|
}
|
if (apps.length > 0) {
|
apps = apps.substring(0, apps.length - 1);
|
appsname = appsname.substring(0, appsname.length - 1);
|
$('.apps')[3].innerHTML = appsname;
|
$('#videoid').val(apps);
|
} else {
|
alert("请选择APP");
|
return;
|
}
|
intersectionDialog.dialog("open");
|
});
|
|
var searchdialog = $("#searchdialog").dialog(
|
{
|
autoOpen : false,
|
modal : true,
|
height : 750,
|
width : 500,
|
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");
|
}
|
}
|
});
|
|
//搜索接口
|
|
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\" class='radio' type=\"radio\" value="
|
+ trans
|
+ "></td></tr>");
|
});
|
}
|
});
|
}
|
|
$("#search").click(
|
function() {
|
if ($("#searchcontent").val() == undefined
|
|| $("#searchcontent").val() == ""
|
|| $("#searchcontent").val() == null) {
|
} else {
|
search($("#searchcontent").val());
|
}
|
});
|
});
|
|
</script>
|
</head>
|
<%
|
List<String> versionList = (List<String>) request
|
.getAttribute("versionList");
|
List<DetailSystem> detailSystemList = (List<DetailSystem>) request
|
.getAttribute("detailSystemList");
|
List<VideoIntersection> ilist = (List<VideoIntersection>) request
|
.getAttribute("intersectionList");
|
%>
|
|
<body>
|
<!-- 添加对话框 -->
|
<div id="divText" title="文本推送" style="display: none;">
|
<b>标题:</b><span class="title"></span> <br /> <b>内容:</b><span
|
class="content"></span><br /> <b>版本:</b><span class="version"></span><br />
|
<b>应用:</b><span class="apps"></span><br />
|
</div>
|
<div id="divVideo" title="视频推送" style="display: none;">
|
<b>标题:</b><span class="title" style="padding: 20px;"></span> <br /> <b>内容:</b><span
|
class="content"></span><br /> <b>版本:</b><span class="version"></span><br />
|
<b>应用:</b><span class="apps"></span><br />
|
|
<center>
|
<input type="text" name="searchcontent" id="searchcontent" size="20">
|
<input type="button" name="search" id="search" value="搜索">
|
</center>
|
<div>
|
<table id="searchresult"></table>
|
</div>
|
</div>
|
<div id="divWeb" title="网页推送" style="display: none;">
|
<b>标题:</b><span class="title"></span> <br /> <b>内容:</b><span
|
class="content"></span><br /> <b>版本:</b><span class="version"></span><br />
|
<b>应用:</b><span class="apps"></span><br /> <b>打开链接:</b><input
|
type="text" name="weburl" id="weburl" size="50">
|
</div>
|
|
<input type="hidden" id="videoid">
|
<div id="divIntersection" title="合集推送" style="display: none;">
|
<b>标题:</b><span class="title"></span> <br /> <b>内容:</b><span
|
class="content"></span><br /> <b>版本:</b><span class="version"></span><br />
|
<b>应用:</b><span class="apps"></span><br /> <b>合集</b><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 radio' 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>
|
|
</div>
|
|
|
|
<div class="div_bj">
|
<div class="div_ban">添加推送</div>
|
<div class="div_rdtg"></div>
|
|
<div class="nr0">
|
<div class="div_002">
|
<div class="text_001">标题:</div>
|
<div>
|
<input type="text" class="text_t1" name="title" id="title" />
|
</div>
|
</div>
|
|
<div class="div_d1">
|
<div class="text_d1">内容:</div>
|
<div>
|
<textarea class="text_t5" name="content" id="content"></textarea>
|
</div>
|
</div>
|
|
<div class="div_y">
|
<div class="text_d3">版本:</div>
|
<div class="text_t7">
|
<div class="yy">
|
<ul>
|
|
<%
|
for (String version : versionList) {
|
%>
|
|
<li><div class="ck_4">
|
<input type="checkbox" id="xf" class="ck_4_1 oversion"
|
value="<%=version%>" /><label for="xf"><p><%=version%></p>
|
</label>
|
</div></li>
|
<%
|
}
|
%>
|
|
</ul>
|
</div>
|
</div>
|
|
</div>
|
|
|
<div class="div_y">
|
<div class="text_d3">应用:</div>
|
<div class="text_t7">
|
<div class="yy">
|
<ul>
|
<%
|
for (DetailSystem ds : detailSystemList) {
|
%>
|
|
<li><div class="ck_4">
|
<input type="checkbox" id="xf" class="ck_4_1 oapps"
|
value="<%=ds.getId()%>" name="<%=ds.getAppName()%>" /><label
|
for="xf"><p><%=ds.getAppName()%></p> </label>
|
</div></li>
|
|
<%
|
}
|
%>
|
|
|
</ul>
|
</div>
|
</div>
|
</div>
|
|
<div class="div_tt">
|
<div class="text_d4">推送类型:</div>
|
<div class="ts">
|
<ul>
|
<li><input type="button" id="pushText" class="sub_3"
|
value="文本"></li>
|
<li><input type="button" id="pushVideo" class="sub_3"
|
value="视频">
|
</li>
|
<li><input type="button" id="pushWeb" class="sub_3"
|
value="网页">
|
</li>
|
<li><input type="button" id="pushIntersection" class="sub_3"
|
value="合集"></li>
|
</ul>
|
</div>
|
</div>
|
</div>
|
|
|
</div>
|
</body>
|
<%
|
if (!StringUtil.isNullOrEmpty(request.getAttribute("result") + "")) {
|
%>
|
<script type="text/javascript">
|
alert("<%=request.getAttribute("result") + ""%>");
|
</script>
|
|
<%
|
}
|
%>
|
|
<script type="text/javascript" src="/BuWan/js/countheight.js">
|
|
</script>
|
|
</html>
|