index.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <include file="public@header" />
  2. </head>
  3. <body>
  4. <div class="wrap">
  5. <ul class="nav nav-tabs">
  6. <li class="active"><a >直播列表</a></li>
  7. <li><a href="{:url('Liveing/add')}">{:lang('ADD')}</a></li>
  8. </ul>
  9. <form class="well form-inline margin-top-20" method="post" action="{:url('Liveing/index')}">
  10. 时间:
  11. <input class="form-control js-bootstrap-date" name="start_time" id="start_time" value="{:input('request.start_time')}" aria-invalid="false" style="width: 110px;"> -
  12. <input class="form-control js-bootstrap-date" name="end_time" id="end_time" value="{:input('request.end_time')}" aria-invalid="false" style="width: 110px;">
  13. 关键字:
  14. <input class="form-control" type="text" name="uid" style="width: 200px;" value="{:input('request.uid')}"
  15. placeholder="请输入会员ID">
  16. <input type="submit" class="btn btn-primary" value="搜索">
  17. </form>
  18. <form method="post" class="js-ajax-form" >
  19. <table class="table table-hover table-bordered">
  20. <thead>
  21. <tr>
  22. <th>会员ID</th>
  23. <th>会员昵称</th>
  24. <th>直播ID</th>
  25. <th>直播开始时间</th>
  26. <th>直播分类</th>
  27. <th>房间类型</th>
  28. <th>密码/价格</th>
  29. <th>视频类型</th>
  30. <th>在线人数</th>
  31. <th>本场收益</th>
  32. <th>打赏人数</th>
  33. <th>人均打赏</th>
  34. <th>TaskId</th>
  35. <th>播流地址</th>
  36. <th>推流地址</th>
  37. <th>设备信息</th>
  38. <th>操作</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. <foreach name="lists" item="vo">
  43. <tr>
  44. <td>{$vo.uid}</td>
  45. <td>{$vo['userinfo']['user_nicename']} </td>
  46. <td>{$vo['showid']}</td>
  47. <td>{:date('Y-m-d H:i',$vo['starttime'])}</td>
  48. <td>{$liveclass[$vo['liveclassid']]}</td>
  49. <td>{$type[$vo['type']]}</td>
  50. <td>{$vo['type_val']}</td>
  51. <td><if condition="$vo['anyway'] eq 0">竖屏<else/>横屏</if></td>
  52. <td>{$vo['nums']}</td>
  53. <td>{$vo['totalcoin']}</td>
  54. <td>{$vo['total_nums']}</td>
  55. <td>{$vo['total_average']}</td>
  56. <td class="taskid-display-{$vo['TaskId']}">{$vo['TaskId']}</td>
  57. <td>{$vo['pull']}</td>
  58. <td>{$vo['push']}</td>
  59. <td>{$vo['deviceinfo']}</td>
  60. <td>
  61. <if condition="$vo['isvideo']==1">
  62. <a class="btn btn-xs btn-primary" href='{:url("Liveing/edit",array("uid"=>$vo["uid"]))}'>{:lang('EDIT')}</a>
  63. <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Liveing/del',array('uid'=>$vo['uid']))}">{:lang('DELETE')}</a>
  64. <a class="btn btn-xs btn-danger xiabo-btn" href="#" data-TaskId="{$vo['TaskId']}" data-uid="{$vo['uid']}" >下播</a>
  65. </if>
  66. </td>
  67. </tr>
  68. </foreach>
  69. </tbody>
  70. </table>
  71. <div class="pagination">{$page}</div>
  72. </form>
  73. </div>
  74. <script src="__STATIC__/js/admin.js"></script>
  75. <script>
  76. (function(){
  77. // 给所有具有 .xiabo-btn 类的 <a> 标签添加点击事件监听器
  78. $('.xiabo-btn').on('click', function(event) {
  79. event.preventDefault(); // 阻止默认行为(例如链接跳转)
  80. // 获取当前点击的 <a> 标签的 data-TaskId 和 data-uid 的值
  81. var TaskId = $(this).attr('data-TaskId');
  82. var uid = $(this).attr('data-uid');
  83. // 检查值是否为空或者非数字
  84. if (TaskId === '' || isNaN(TaskId)) {
  85. alert('请输入正确的 TaskId(数字)');
  86. } else {
  87. $.ajax({
  88. url: '/admin/liveing/xiabo.html',
  89. type: 'POST',
  90. data: {
  91. uid: uid,
  92. TaskId: TaskId,
  93. },
  94. dataType: 'json',
  95. success: function (data) {
  96. location.reload();
  97. // $('.taskid-display-'+TaskId).val( '已下播-'+TaskId);
  98. console.log('请求成功:', data);
  99. },
  100. error: function (error) {
  101. console.error('请求失败:', error);
  102. }
  103. });
  104. }
  105. });
  106. // 下播
  107. /*$("#xiabo").on('click', function () {
  108. // 获取元素的 data-TaskId 属性的值
  109. var TaskId = $('#xiabo').attr('data-TaskId');
  110. var uid = $('#xiabo').attr('data-uid');
  111. // 检查值是否为空或者非数字
  112. if (TaskId === '' || isNaN(TaskId)) {
  113. alert('请输入正确的 TaskId(数字)');
  114. } else {
  115. $.ajax({
  116. url: '/admin/liveing/xiabo.html',
  117. type: 'POST',
  118. data: {
  119. uid: uid,
  120. TaskId: TaskId,
  121. },
  122. dataType: 'json',
  123. success: function (data) {
  124. $('#taskid-display-'+TaskId).val( '已下播-'+TaskId);
  125. console.log('请求成功:', data);
  126. },
  127. error: function (error) {
  128. console.error('请求失败:', error);
  129. }
  130. });
  131. }
  132. })*/
  133. })()
  134. </script>
  135. </body>
  136. </html>