history.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <script src="{{static_url('yunshop/js')}}/video.min.js"></script>
  2. @extends('layouts.base')
  3. @section('content')
  4. @section('title', trans('历史直播列表'))
  5. @include('layouts.tabs')
  6. <link href="{{static_url('yunshop/css')}}/video-js.min.css" rel="stylesheet">
  7. <div class="right-titpos">
  8. <ul class="add-snav">
  9. <li class="active"><a href="#">历史直播列表</a></li>
  10. </ul>
  11. </div>
  12. <div class='panel panel-default'>
  13. <form action="" method="post" class="form-horizontal" id="form1">
  14. <div class="panel panel-info">
  15. <div class="panel-body">
  16. <div class="form-group col-xs-12 col-sm-2">
  17. <!--<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">会员信息</label>-->
  18. <!--<div class="col-xs-12 col-sm-8 col-lg-9">-->
  19. <input class="form-control" name="search[room_title]" id="" type="text"
  20. value="{{$search['room_title']}}" placeholder="直播间标题">
  21. <!--</div>-->
  22. </div>
  23. <div class="form-group col-xs-12 col-sm-2">
  24. <!--<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">会员信息</label>-->
  25. <!--<div class="col-xs-12 col-sm-8 col-lg-9">-->
  26. <input class="form-control" name="search[room_id]" id="" type="text"
  27. value="{{$search['room_id']}}" placeholder="直播间ID">
  28. <!--</div>-->
  29. </div>
  30. <div class="form-group col-xs-12 col-sm-2">
  31. <!--<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">会员信息</label>-->
  32. <!--<div class="col-xs-12 col-sm-8 col-lg-9">-->
  33. <input class="form-control" name="search[member_id]" id="" type="text"
  34. value="{{$search['member_id']}}" placeholder="直播会员ID">
  35. <!--</div>-->
  36. </div>
  37. <div class="form-group col-xs-12 col-sm-2">
  38. <!--<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">会员信息</label>-->
  39. <!--<div class="col-xs-12 col-sm-8 col-lg-9">-->
  40. <input class="form-control" name="search[member]" id="" type="text"
  41. value="{{$search['member']}}" placeholder="主播昵称/姓名/手机">
  42. <!--</div>-->
  43. </div>
  44. <div class="form-group col-xs-12 col-sm-3">
  45. <select name='search[is_show]' class='form-control'>
  46. <option value=''>显示状态</option>
  47. <option value='1' @if($search['is_show'] == '1') selected @endif>显示</option>
  48. <option value='2' @if($search['is_show'] == '2') selected @endif>不显示</option>
  49. </select>
  50. </div>
  51. <div class="form-group col-xs-12 col-sm-3">
  52. <select name='search[recommend]' class='form-control'>
  53. <option value=''>推荐状态</option>
  54. <option value='1' @if($search['recommend'] == '1') selected @endif>推荐</option>
  55. <option value='2' @if($search['recommend'] == '2') selected @endif>不推荐</option>
  56. </select>
  57. </div>
  58. <div class="form-group col-xs-12 col-sm-8">
  59. <div class="col-sm-3">
  60. <label class='radio-inline'>
  61. <input type='checkbox' value='1' name='search[is_time]'
  62. @if($search['is_time'] == '1') checked @endif>搜索
  63. </label>
  64. </div>
  65. {!! app\common\helpers\DateRange::tplFormFieldDateRange(
  66. 'search[time]',
  67. [
  68. 'starttime'=>$search['time']['start'],
  69. 'endtime'=>$search['time']['end'],
  70. 'start'=>$search['time']['start'],
  71. 'end'=>$search['time']['end']
  72. ],
  73. true
  74. ) !!}
  75. </div>
  76. <div class="form-group col-xs-12 col-sm-7 col-lg-4">
  77. <div class="">
  78. <input type="hidden" id="route" name="route" value="plugin.room.admin.history.index"/>
  79. <button class="btn btn-success "><i class="fa fa-search"></i> 搜索</button>
  80. <input type="button" class="btn btn-success" id="export" value="导出">
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </form>
  86. </div>
  87. <div class='panel panel-default'>
  88. <div class='panel-heading'>
  89. <div>
  90. <div>
  91. 总数:{{$list->total()}}
  92. </div>
  93. </div>
  94. <div class='panel-body'>
  95. <table class="table table-hover" style="overflow:visible;">
  96. <thead>
  97. <tr>
  98. <th style='width:6%;'>ID</th>
  99. <th style='width:15%;'>时间</th>
  100. <th style='width:8%;'>直播间ID</th>
  101. <th style='width:10%;'>直播间标题</th>
  102. <th style='width:10%;'>主播</th>
  103. <th style='width:10%;'>姓名<br>手机号</th>
  104. <th style='width:10%;'>过期时间</th>
  105. <th style='width:10%;'>直播回放</th>
  106. <th style='width:10%;'>显示</th>
  107. <th style='width:10%;'>推荐</th>
  108. <th style='width:10%;'>操作</th>
  109. </tr>
  110. </thead>
  111. <tbody>
  112. @foreach($list as $row)
  113. <tr>
  114. <td>{{$row['id']}}</td>
  115. <td>{{$row['created_at']}}</td>
  116. <td>{{$row['room_id']}}</td>
  117. <td>{{$row['hasOneRoom']['title']}}</td>
  118. <td>
  119. <a target="_blank"
  120. href="{{yzWebUrl('member.member.detail',['id'=>$row['hasOneMember']['uid']])}}">
  121. <img src="{{tomedia($row['hasOneMember']['avatar'])}}"
  122. style="width: 30px; height: 30px;border:1px solid #ccc;padding:1px;">
  123. </br>
  124. {{$row['hasOneMember']['nickname']}}
  125. </a>
  126. </td>
  127. <td>
  128. {{$row['hasOneMember']['realname']}}<br>
  129. {{$row['hasOneMember']['mobile']}}
  130. </td>
  131. <td>
  132. @if($row['expire_time'] == 0)
  133. 永久保存
  134. @else
  135. {{date('Y-m-d',$row['expire_time'])}}
  136. @endif
  137. </td>
  138. <td style="width: 100px;height: 100px">
  139. <a data-toggle="modal" data-target="#modal-confirmsend{{$row['id']}}" onclick="openVideo({{$row['id']}})">
  140. <img src="{{tomedia($row['hasOneRoom']['cover'])}}" style="width: 100%;height: 100%"/>
  141. </a>
  142. </td>
  143. <td style="overflow:visible;">
  144. <div class="col-sm-2 col-xs-6">
  145. <input class="mui-switch " id="is_show{{$row['id']}}" type="checkbox"
  146. @if($row['is_show'] == 1))
  147. checked
  148. @endif
  149. onclick="show({{$row['id']}})"/>
  150. </div>
  151. </td>
  152. <td style="overflow:visible;">
  153. <div class="col-sm-2 col-xs-6">
  154. <input class="mui-switch " id="recommend{{$row['id']}}" type="checkbox" style="overflow: auto"
  155. @if($row['recommend'] == 1))
  156. checked
  157. @endif
  158. onclick="recommend({{$row['id']}})"/>
  159. </div>
  160. </td>
  161. <td style="position:relative; overflow:visible;">
  162. <a href="{{yzWebUrl('plugin.room.admin.history.delete',['id'=>$row['id']])}}"
  163. onclick="return confirm('是否确认删除?');
  164. return false;" class="btn btn-default btn-sm"
  165. title="删除"><i
  166. class="fa fa-trash"></i></a>
  167. </td>
  168. </tr>
  169. @endforeach
  170. </tbody>
  171. </table>
  172. {!! $pager !!}
  173. </div>
  174. @foreach($list as $row)
  175. <div id="modal-confirmsend{{$row['id']}}" class="modal fade" role="dialog" style="">
  176. <div class="form-horizontal form">
  177. <div class="modal-dialog">
  178. <div class="modal-content">
  179. <div class="modal-header">
  180. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">X</button>
  181. <h5 style="">直播回放</h5>
  182. </div>
  183. @if($row['file_format'] == 'hls')
  184. <video id="example_video{{$row['id']}}" class="video-js vjs-default-skin" controls preload="none">
  185.     <source src="{{str_replace('http://','https://',$row['video_url'])}}" type="application/x-mpegURL">
  186. </video>
  187. @elseif($row['file_format'] == 'mp4')
  188. <video id="example_video{{$row['id']}}" class="video-js vjs-default-skin" controls preload="none">
  189.     <source src="{{str_replace('http://','https://',$row['video_url'])}}" type="video/mp4">
  190. </video>
  191. @endif
  192. <div class="modal-footer">
  193. <span>时长{{intval($row['duration']/60)}}分钟 大小{{intval($row['file_size']/1024/1024)}}M</span>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. @endforeach
  200. </div>
  201. <div style="width:100%;height:150px;"></div>
  202. <script language='javascript'>
  203. function openVideo(id) {
  204. var video_id = "example_video"+id;
  205. var player = videojs(video_id, {
  206. muted: true,
  207. controls: true,
  208. height: 400,
  209. width: 600,
  210. loop: true,
  211. // 更多配置.....
  212. });
  213. }
  214. function show(id) {
  215. var url_open = "{!! yzWebUrl('plugin.room.admin.history.show') !!}"
  216. var url_close = "{!! yzWebUrl('plugin.room.admin.history.close-show') !!}"
  217. var postdata = {
  218. id: id,
  219. };
  220. var show = "#is_show" + id;
  221. if ($(show).is(':checked')) {
  222. //开
  223. $.post(url_open,postdata,function(data){
  224. if (data.result == 1) {
  225. $(show).attr("checked",true);
  226. showPopover($(show),"开启成功")
  227. } else {
  228. showPopover($(show),"开启失败")
  229. $(show).attr("checked",false);
  230. }
  231. }, "json");
  232. } else {
  233. //关
  234. $.post(url_close,postdata,function(data){
  235. showPopover($(show),"关闭成功")
  236. }, "json");
  237. }
  238. }
  239. function recommend(id) {
  240. var url_open = "{!! yzWebUrl('plugin.room.admin.history.recommend') !!}"
  241. var url_close = "{!! yzWebUrl('plugin.room.admin.history.close-recommend') !!}"
  242. var postdata = {
  243. id: id,
  244. };
  245. var recommend = "#recommend" + id;
  246. if ($(recommend).is(':checked')) {
  247. //开
  248. $.post(url_open,postdata,function(data){
  249. if (data.result == 1) {
  250. $(recommend).attr("checked",true);
  251. showPopover($(recommend),"开启成功")
  252. } else {
  253. showPopover($(recommend),"开启失败")
  254. $(recommend).attr("checked",false);
  255. }
  256. }, "json");
  257. } else {
  258. //关
  259. $.post(url_close,postdata,function(data){
  260. showPopover($(recommend),"关闭成功")
  261. }, "json");
  262. }
  263. }
  264. function showPopover(target, msg) {
  265. target.attr("data-original-title", msg);
  266. $('[data-toggle="tooltip"]').tooltip();
  267. target.tooltip('show');
  268. target.focus();
  269. //2秒后消失提示框
  270. setTimeout(function () {
  271. target.attr("data-original-title", "");
  272. target.tooltip('hide');
  273. }, 2000
  274. );
  275. }
  276. $(function () {
  277. $('#export').click(function () {
  278. $('#route').val("plugin.room.admin.history.export");
  279. $('#form1').submit();
  280. $('#route').val("plugin.room.admin.history.index");
  281. });
  282. });
  283. </script>
  284. @endsection