reward-list.blade.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('打赏列表'))
  4. <div class="w1200 ">
  5. <div class=" rightlist ">
  6. <div class="right-titpos">
  7. <ul class="add-snav">
  8. {{--<li class="active"><a href="#">区域代理</a></li>--}}
  9. <a class='btn btn-primary' href="{{yzWebUrl('plugin.room.admin.reward-set.add')}}"
  10. style="margin-bottom:5px;"><i class='fa fa-plus'></i> 添加打赏</a>
  11. </ul>
  12. </div>
  13. <form action="" method="post" class="form-horizontal" id="form1">
  14. <div class="right-addbox">
  15. <div class="panel panel-info">
  16. </div>
  17. </div>
  18. </form>
  19. <div class="clearfix">
  20. <div class='panel panel-default'>
  21. <div class='panel-body table-responsive'>
  22. <table class="table table-hover" style="overflow:visible;">
  23. <thead>
  24. <tr>
  25. <th style='width:8%;'>ID</th>
  26. <th style='width:5%;'>排序</th>
  27. <th style='width:10%;'>名称</th>
  28. <th style='width:8%;'>图标</th>
  29. <th style='width:8%;'>特效状态</th>
  30. <th style='width:15%;'>打赏数量</th>
  31. <th style='width:10%;'>添加时间</th>
  32. <th style='width:8%;'>操作</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. @foreach($list as $row)
  37. <tr>
  38. <td>{{$row['id']}}</td>
  39. <td>{{$row['sort']}}</td>
  40. <td>{{$row['name']}}</td>
  41. <td>
  42. <img src="{{tomedia($row['icon'])}}"
  43. style="width: 30px; height: 30px;border:1px solid #ccc;padding:1px;">
  44. </br>
  45. </td>
  46. <td style="overflow:visible;">
  47. <div class="col-sm-2 col-xs-6">
  48. <input class="mui-switch " id="recommend{{$row['id']}}" type="checkbox" style="overflow: auto"
  49. @if($row['show_effect'] == 1))
  50. checked
  51. @endif
  52. onclick="recommend({{$row['id']}})"/>
  53. </div>
  54. </td>
  55. <td>
  56. {{$row['number']}}
  57. </td>
  58. <td>
  59. {{$row['created_at']}}
  60. </td>
  61. <td style="position:relative; overflow:visible;">
  62. <a href="{{yzWebUrl('plugin.room.admin.reward-set.edit',['id'=>$row['id']])}}"
  63. class="btn btn-default btn-sm" title="编辑"><i class="fa fa-edit"></i></a>
  64. <a href="{{yzWebUrl('plugin.room.admin.reward-set.delete',['id'=>$row['id']])}}"
  65. onclick="return confirm('是否确认删除?');
  66. return false;" class="btn btn-default btn-sm"
  67. title="删除"><i
  68. class="fa fa-trash"></i></a>
  69. </td>
  70. </tr>
  71. @endforeach
  72. </tbody>
  73. </table>
  74. {!! $pager !!}
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <script type="text/javascript" src="{{static_url('js/area/cascade_street.js')}}"></script>
  81. <script language='javascript'>
  82. $('.tdedit').mouseover(function () {
  83. $(this).find('.fa-pencil').show();
  84. }).mouseout(function () {
  85. $(this).find('.fa-pencil').hide();
  86. });
  87. $('.fa-edit-item').click(function () {
  88. var areaData = $(this).closest('span').find('span').html();
  89. var agentid = $(this).data('agentid');
  90. popwin = $('#modal-module-menus-notice').modal();
  91. $('.area-text').text(areaData);
  92. $('.area-agent-id').val(agentid);
  93. cascdeInit();
  94. });
  95. function recommend(id) {
  96. var url_open = "{!! yzWebUrl('plugin.room.admin.reward-set.effect') !!}";
  97. var url_close = "{!! yzWebUrl('plugin.room.admin.reward-set.close-effect') !!}"
  98. var postdata = {
  99. id: id,
  100. };
  101. var recommend = "#recommend" + id;
  102. if ($(recommend).is(':checked')) {
  103. //开
  104. $.post(url_open,postdata,function(data){
  105. if (data.result == 1) {
  106. $(recommend).attr("checked",true);
  107. showPopover($(recommend),"开启成功")
  108. } else {
  109. showPopover($(recommend),"开启失败")
  110. $(recommend).attr("checked",false);
  111. }
  112. }, "json");
  113. } else {
  114. //关
  115. $.post(url_close,postdata,function(data){
  116. showPopover($(recommend),"关闭成功")
  117. }, "json");
  118. }
  119. }
  120. function showPopover(target, msg) {
  121. target.attr("data-original-title", msg);
  122. $('[data-toggle="tooltip"]').tooltip();
  123. target.tooltip('show');
  124. target.focus();
  125. //2秒后消失提示框
  126. setTimeout(function () {
  127. target.attr("data-original-title", "");
  128. target.tooltip('hide');
  129. }, 2000
  130. );
  131. }
  132. $('#submit').click(function () {
  133. var agentid = $('.area-agent-id').val();
  134. var provanceId = $('#sel-provance').val();
  135. var cityId = $('#sel-city').val();
  136. var districtId = $('#sel-area').val();
  137. var streetId = $('#sel-street').val();
  138. var obg = {
  139. province_id: provanceId,
  140. city_id: cityId,
  141. district_id: districtId,
  142. street_id: streetId
  143. };
  144. fastChange(agentid, obg);
  145. });
  146. function fastChange(id, value) {
  147. $.ajax({
  148. url: "{!! yzWebUrl('plugin.area-dividend.admin.agent.change') !!}",
  149. type: "post",
  150. data: {id: id, value: value},
  151. cache: false,
  152. success: function ($data) {
  153. //console.log($data);return;
  154. if ($data.result == 0) {
  155. confirm($data.msg);
  156. }
  157. location.reload();
  158. }
  159. })
  160. }
  161. $(function () {
  162. $('#export').click(function () {
  163. $('#form1').attr('action', '{!! yzWebUrl('plugin.area-dividend.admin.agent.export') !!}');
  164. $('#form1').submit();
  165. });
  166. $('#search').click(function () {
  167. $('#form1').attr('action', '{!! yzWebUrl('plugin.area-dividend.admin.agent') !!}');
  168. $('#form1').submit();
  169. });
  170. });
  171. </script>
  172. @endsection