admin
2025-02-20 f537abe9f3646c739beaf15076246a2f71a347e9
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
<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>