index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <style type="text/css">.layui-form-switch{margin-top:0!important;margin-right: 10px;}</style>
  45. </head>
  46. <body layadmin-themealias="default">
  47. <div class="layui-fluid">
  48. <div class="layui-card">
  49. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">直播间管理</span></div>
  50. <div class="layui-row" style="margin: 0 15px">
  51. <div class="layui-card">
  52. <div class="layui-card-header">小程序直播运营操作说明:</div>
  53. <div class="layui-card-body">
  54. <p>1、登录微信小程序后台,在左侧功能栏“直播”<a href="https://mp.weixin.qq.com/" class="text-primary" target="_blank">点击创建直播间</a>。</p>
  55. <p>2、在小程序后台成功创建直播间后,点击列表中的”同步直播间“按钮。同步直播间后直播列表页面中会显示。</p>
  56. <p style="color:red;">3、切勿重复点击”同步直播间“按钮。小程序每天有请求次数限制。</p>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="layui-card-body" style="padding:15px;">
  61. <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
  62. <input type="hidden" name="c" value="wxlive" />
  63. <input type="hidden" name="a" value="index" />
  64. <div class="layui-form-item">
  65. <div class="layui-inline">
  66. <div class="layui-input-inline">
  67. <input type="text" class="layui-input" name='keywords' value="{$keyword}" placeholder="请输入关键词">
  68. </div>
  69. <div class="layui-input-inline">
  70. <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
  71. </div>
  72. </div>
  73. <span class="pull-right">
  74. <a href="javascript:;" class="btn btn-success" style="margin-right: 10px;" id="refresh" data-href="{:U('wxlive/sync')}">
  75. <i class="fa fa-refresh"></i> 同步直播间
  76. </a>
  77. <a href="https://mp.weixin.qq.com/" class="btn btn-primary" target="_blank"><i class="fa fa-plus"></i> 添加新直播间</a>
  78. </span>
  79. </div>
  80. </form>
  81. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data">
  82. <div class="row">
  83. <div class="col-md-12">
  84. <?php if(count($list)>0){ ?>
  85. <table class="table table-responsive">
  86. <thead>
  87. <tr>
  88. <th style="width: 120px;">直播间ID</th>
  89. <th>直播标题</th>
  90. <th style="width: 150px;">主播昵称</th>
  91. <th style="width: 100px;">直播间背景</th>
  92. <th style="width: 100px;">分享封面</th>
  93. <th style="width: 100px;">开播时间</th>
  94. <th style="width: 100px;">结束直播</th>
  95. <th style="width: 150px;">操作</th>
  96. </tr>
  97. </thead>
  98. <tbody>
  99. <?php foreach( $list as $item ){ ?>
  100. <tr>
  101. <td>{$item['roomid']}</td>
  102. <td>{$item['name']}</td>
  103. <td>{$item['anchor_name']}</td>
  104. <td>
  105. <img src="{:tomedia($item['cover_img'])}" style="width:40px;height:40px;padding:1px;border:1px solid #ccc;"/>
  106. </td>
  107. <td>
  108. <img src="{:tomedia($item['share_img'])}" style="width:40px;height:40px;padding:1px;border:1px solid #ccc;"/>
  109. </td>
  110. <td>{:date('Y-m-d H:i:s', $item['start_time'])}</td>
  111. <td>{:date('Y-m-d H:i:s', $item['end_time'])}</td>
  112. <td style="text-align:left;">
  113. <input type="checkbox" name="" lay-filter="statewsitch" data-href="{:U('wxlive/change',array('type'=>'is_show','id'=>$item['id']))}" <?php if( $item['is_show']==1){ ?>checked<?php }else{ ?><?php } ?> lay-skin="switch" lay-text="显示|隐藏">
  114. <a class="btn btn-danger btn-xs" href="{:U('wxlive/replay', array('id'=>$item['id'],'roomid'=>$item['roomid']))}">
  115. <i class="fa fa-video-camera"></i> 回放
  116. </a>
  117. <!-- <a class="btn btn-op btn-operation js-clip" data-href="/lionfish_comshop/moduleB/__plugin__/wx2b03c6e691cd7370/pages/live-player-plugin?room_id={$item['roomid']}">
  118. <span data-toggle="tooltip" data-placement="top" data-original-title="复制直播间地址">
  119. 复制直播间地址
  120. </span>
  121. </a> -->
  122. </td>
  123. </tr>
  124. <?php } ?>
  125. <tr>
  126. <td colspan='8'>
  127. <div class='pagers' style='float:right;'>
  128. {$pager}
  129. </div>
  130. </td>
  131. </tr>
  132. </tbody>
  133. </table>
  134. <?php }else{ ?>
  135. <div class='panel panel-default'>
  136. <div class='panel-body' style='text-align: center;padding:30px;'>
  137. 暂时没有任何直播间!
  138. </div>
  139. </div>
  140. <?php } ?>
  141. </div>
  142. </div>
  143. </form>
  144. </div>
  145. </div>
  146. </div>
  147. <script src="/layuiadmin/layui/layui.js"></script>
  148. <script>
  149. layui.config({
  150. base: '/layuiadmin/' //静态资源所在路径
  151. }).extend({
  152. index: 'lib/index' //主入口模块
  153. }).use('index');
  154. </script>
  155. <script>
  156. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  157. var layer = layui.layer;
  158. var $;
  159. layui.use(['jquery', 'layer','form'], function(){
  160. $ = layui.$;
  161. var form = layui.form;
  162. $("#refresh").click(function(){
  163. var s_url = $(this).data('href');
  164. var loading = layer.load(0, { shade: false });
  165. $.ajax({
  166. url:s_url,
  167. type:'post',
  168. dataType:'json',
  169. data: '',
  170. success:function(info){
  171. layer.close(loading);
  172. if(info.status == 0)
  173. {
  174. layer.msg(info.result.message,{icon: 1,time: 2000});
  175. }else if(info.status == 1){
  176. var go_url = location.href;
  177. if( info.result.hasOwnProperty("url") )
  178. {
  179. go_url = info.result.url;
  180. }
  181. layer.msg('操作成功',{time: 1000,
  182. end:function(){
  183. location.href = go_url;
  184. }
  185. });
  186. }
  187. }
  188. })
  189. });
  190. form.on('switch(statewsitch)', function(data){
  191. var s_url = $(this).attr('data-href')
  192. var s_value = 1;
  193. if(data.elem.checked)
  194. {
  195. s_value = 1;
  196. }else{
  197. s_value = 0;
  198. }
  199. $.ajax({
  200. url:s_url,
  201. type:'post',
  202. dataType:'json',
  203. data:{value:s_value},
  204. success: function(info){
  205. if(info.status == 0)
  206. {
  207. layer.msg(info.result.message,{icon: 1,time: 2000});
  208. }else if(info.status == 1){
  209. var go_url = location.href;
  210. if( info.result.hasOwnProperty("url") )
  211. {
  212. go_url = info.result.url;
  213. }
  214. layer.msg('操作成功',{time: 1000,
  215. end:function(){
  216. location.href = info.result.url;
  217. }
  218. });
  219. }
  220. }
  221. })
  222. });
  223. })
  224. </script>
  225. </body>
  226. </html>