<html lang="zh-cn">
|
<head>
|
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="referrer" content="never">
|
<title>消息推送</title>
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
<link href="css/maincontent.css" rel="stylesheet">
|
<link href="css/tablestyle.css" rel="stylesheet">
|
<!--[if lt IE 9]>
|
<script src="js/html5shiv.js"></script>
|
<script src="js/respond.min.js"></script>
|
<![endif]-->
|
</head>
|
<body>
|
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
|
</nav>
|
<div id="mainbody">
|
<div id="sidebar">
|
<dl>
|
</dl>
|
</div>
|
<div id="neirong">
|
<div class="erjidh">
|
<table class="table">
|
<tbody>
|
<tr>
|
<td width="37%"><ul class="nav nav-pills" role="tablist">
|
<li role="presentation"><a href="#">文本</a></li>
|
<li role="presentation" class="active"><a href="#">视频</a></li>
|
<li role="presentation"><a href="#">合辑</a></li>
|
</ul></td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
<div class="tuisong">
|
<form class="form-horizontal" role="form">
|
<div class="form-group">
|
<label for="input4" class="changdu1 control-label">跳转详情</label>
|
<div class="col-sm-7">
|
<label id="jump-detail"></label>
|
<input type="hidden" id="linkType" />
|
<input type="hidden" id="linkValue" />
|
<a href="javascript:void(0)" class="btn btn-info" id="choose-link">选择</a>
|
</div>
|
</div>
|
<div class="form-group">
|
<label for="input" class="col-sm-1 control-label">标题</label>
|
<div class="col-sm-10">
|
<input type="text" class="form-control title" placeholder="标题">
|
</div>
|
</div>
|
<div class="form-group">
|
<label for="inputPassword3" class="col-sm-1 control-label">内容</label>
|
<div class="col-sm-10">
|
<textarea class="form-control content" rows="7"></textarea>
|
</div>
|
</div>
|
<div class="form-group">
|
<div class="col-sm-offset-1 col-sm-10">
|
<button type="button" class="btn btn-primary pushBtn">推送</button>
|
</div>
|
</div>
|
</form>
|
</div>
|
</div>
|
</div>
|
<div id="dialog-chooselink" style="display: none;">
|
<div class="row" style="height: 690px;">
|
<div class="col-lg-3 col-md-3" style="display: inline;">
|
<select class="form-control">
|
<option value="1">视频</option>
|
</select>
|
</div>
|
<div class="col-lg-9 col-md-9" style="display: inline;">
|
<!--视频选择 -->
|
<div id="container-video">
|
<div class="search">
|
<input type="text" class="form-control" placeholder="请输入关键字" style="width: 200px;display: inline;" />
|
<button class="btn btn-info">搜索</button>
|
</div>
|
<!-- 搜索结果展示区域-->
|
<div class="search-result">
|
<table class="table">
|
<thead>
|
<th>编号</th>
|
<th>名称</th>
|
<th>封面</th>
|
<th>是否显示</th>
|
<th>选择</th>
|
</thead>
|
<tbody>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<div style="float: right;">
|
<button class="btn btn-info sure">确定</button>
|
<button class="btn btn-default cancel">取消</button>
|
</div>
|
|
</div>
|
|
<script src="js/jquery.min.js"></script>
|
<script src="js/nav.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
<script src="layer/layer.js"></script>
|
<script>
|
$(function(){
|
|
$(".pushBtn").bind("click",function(){
|
var vid = $("#linkValue").val();
|
if(vid == null || vid==""){
|
layer.msg("请选择视频!");
|
return;
|
}
|
var title=$(".title").val();
|
var content=$(".content").val();
|
$.post("api/push/pushVideo",{"title":title,"content":content,"vid":vid},function(data){
|
if(data.code==0){
|
layer.alert(data.data);
|
}else{
|
layer.alert(data.msg);
|
}
|
},'json')
|
});
|
|
});
|
|
</script>
|
<script>
|
$("#container-video .search button").click(function() {
|
var key = $("#container-video .search input").val();
|
var index = layer.load(0, {
|
'shade': false
|
});
|
$.post('api/common/searchvideo', {
|
'key': key
|
}, function(data) {
|
layer.close(index);
|
if(data.code == 0) {
|
$(".search-result table tbody").empty();
|
var html = "";
|
data.data.forEach(function(video) {
|
html += "<tr><td>" + video.id;
|
html += "</td><td>" + video.name + "</td><td><img style='width: 80px;' src=" + video.picture + "> </td><td>" + (video.show == 1 ? '显示' : '不显示') + "</td>";
|
html += "<td><input type='radio' name='choose-video' value=" + video.id + "></td></tr>";
|
});
|
$(".search-result table tbody").html(html);
|
}
|
|
}, 'json');
|
});
|
|
$("#dialog-chooselink .sure").click(function() {
|
var type = $("#dialog-chooselink select").eq(0).val();
|
var value;
|
if(type == 1) {
|
var videoid = $('#dialog-chooselink .search-result input[name="choose-video"]:checked').val();
|
console.log(videoid);
|
if(videoid == undefined || videoid == null) {
|
layer.msg("请选择视频");
|
return;
|
}
|
value = videoid;
|
$("#jump-detail").html("视频:" + videoid);
|
|
}
|
$("#linkType").val(type);
|
$("#linkValue").val(value);
|
layer.close(index);
|
});
|
|
$("#dialog-chooselink .cancel").click(function() {
|
layer.close(index);
|
});
|
|
$("#choose-link").click(function() {
|
index = layer.open({
|
type: 1,
|
title: '链接选择',
|
shadeClose: true,
|
shade: 0.8,
|
area: ['1000px', '800px'],
|
content: $("#dialog-chooselink")
|
});
|
|
});
|
|
</script>
|
</body>
|
</html>
|