openList.blade.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. @extends('vip.layouts')
  2. @section('content')
  3. <style>
  4. .layui-laydate-range {
  5. width: auto;
  6. }
  7. .layui-table-body {
  8. position: relative;
  9. overflow: auto;
  10. margin-right: -1px;
  11. }
  12. /*.text{*/
  13. /*width: 88%;*/
  14. /*}*/
  15. </style>
  16. @push('dataTableJS')
  17. //获取表头
  18. var tit=function (game){
  19. var header=[];
  20. $.ajax({
  21. type: 'post',
  22. url: '/admin/Sixlottery/index?data=1&game='+ game,
  23. data: {},
  24. dataType: 'json',
  25. async: false,
  26. success: function (json) {
  27. header=json.data.dataCols
  28. }
  29. });
  30. return header;
  31. }
  32. var active = {
  33. reload: function(){
  34. //执行重载
  35. table.reload('{{ $dataId }}', {
  36. page: {
  37. curr: 1 //重新从第 1 页开始
  38. }
  39. ,where: {
  40. game_no:$('#game_no').val(),
  41. star_time:$('#star_time').val(),
  42. end_time:$('#end_time').val(),
  43. }
  44. });
  45. }
  46. };
  47. $('.lay-btn-diy').on('click', function(){
  48. var type = $(this).data('type');
  49. active[type] ? active[type].call(this) : '';
  50. });
  51. //重置表单
  52. $('.reset').on('click',function(){
  53. $('input').val('');
  54. $('#trade_type').val('');
  55. var type = $(this).data('type');
  56. active[type] ? active[type].call(this) : '';
  57. });
  58. //刷新表单
  59. $('.set').on('click',function(){
  60. var type = $(this).data('type');
  61. active[type] ? active[type].call(this) : '';
  62. });
  63. @endpush
  64. <script type="text/html" id="open_act">
  65. <!-- 这里的 checked 的状态只是演示 -->
  66. @{{#if(d.status=='未开奖'){ }}
  67. <a href="javascript:deleteList(@{{d.id}})" class="layui-btn layui-btn-sm">{{trans('sixlottery.delete')}}</a>
  68. <a href="javascript:opengame(@{{d.id}})" id="isfirst" data-id="1" class="layui-btn layui-btn-sm site-demo-active">{{trans('sixlottery.opengame')}}</a>
  69. @{{#}else{ }}
  70. <a href="/Admin/{{$dgame}}Res/Edit?identity=@{{d.id}}&game={{$game}}" id="isfirst" data-id="1" class="layui-btn layui-btn-sm">{{trans('sixlottery.update_res')}}</a>
  71. @{{#} }}
  72. </script>
  73. <script type="text/html" id="write_time">
  74. @{{d.time}}
  75. </script>
  76. <script type="text/html" id="prizes_code">
  77. @{{d.codes}}
  78. </script>
  79. <div id="parper" data-id="1" class="hide" style="display: none;text-align: center;line-height: 150px;">已完成<span class="percent">0</span>%</div>
  80. <div id="settimes" data-id="1" class="hide" style="display: none;text-align: center;line-height: 150px;">
  81. <form>
  82. <label>单次开奖条数设置</label>
  83. <input type="number" name="ptimes" id="ptimes" value="{{$times}}" />
  84. <input type="hidden" id="infono" value="{{$no}}" />
  85. <input type="hidden" id="game" value="{{$game}}" />
  86. <input type="button" id="sureset" value="确定"/>
  87. </form>
  88. </div>
  89. <div class="layui-inline">
  90. <a class="layui-btn layui-btn-sm lay-btn-diy" onClick="setPrizetimes()" style="opacity: 1; pointer-events: auto;">设置单次开奖条数</a>
  91. </div><br>
  92. @include('vip.datatable')
  93. <script>
  94. //Demo
  95. layui.use(['form'], function(){
  96. var form = layui.form;
  97. //监听提交
  98. form.on('submit(submitForm)', function(data){
  99. return true;
  100. });
  101. });
  102. function cbFormSuccess(data){
  103. layer.msg(data.msg);
  104. setTimeout(function(){
  105. parent.window.location.reload();
  106. },2500);
  107. }
  108. function deleteList(id){
  109. var game = $('#game').val();
  110. var url = '/admin/SixlotteryRes/DeleteOpenList?identity='+id + '&game=' + game;
  111. $.ajax({
  112. type: "GET",
  113. url: url,
  114. dataType: "json",
  115. success: function(data){
  116. layer.msg(data.msg);
  117. setTimeout(function(){
  118. window.location.reload();
  119. },2500);
  120. }
  121. });
  122. }
  123. var index = 0;
  124. var sindex = 0;
  125. //设置开奖次数
  126. function setPrizetimes(){
  127. sindex = layer.open({
  128. type: 1,
  129. title: '单次开奖条数',
  130. closeBtn: 1,
  131. area: ['400px','400px'],
  132. skin: 'layui-layer-demo', //没有背景色
  133. shadeClose: false,
  134. content: $('#settimes')
  135. });
  136. }
  137. $('#sureset').click(function(){
  138. var stimes = $('#ptimes').val();
  139. var no = $('#infono').val();
  140. var game = $('#game').val();
  141. $.ajax({
  142. url:'/admin/SixlotteryRes/SetPtimes',
  143. type:"post",
  144. dataType:"json",
  145. data:{stimes:stimes,game:game},
  146. success:function(data){
  147. if(data.status==1){
  148. layer.msg(data.msg,function(){
  149. layer.close(sindex);
  150. });
  151. }else{
  152. layer.alert(data.msg);
  153. }
  154. },
  155. });
  156. });
  157. function opengame(id){
  158. $('.parper').show();
  159. $('.percent').text(0);
  160. layer.prompt({
  161. title: '二级密码',
  162. formType: 1,
  163. },function(value, index, elem){
  164. var ispwcheck = $('#parper').attr('data-id');
  165. $('.layui-layer-btn0').attr('disable','true');
  166. $('.layui-layer-btn0').css('background-color','#dedede');
  167. /*layer.open({
  168. type: 1,
  169. title: '开奖进度',
  170. closeBtn: 0,
  171. area: ['200px','200px'],
  172. skin: 'layui-layer-demo', //没有背景色
  173. shadeClose: true,
  174. content: $('#parper')
  175. });*/
  176. index = layer.load(1, {shade: [0.71,'#eee']});
  177. prize(id,value,ispwcheck);
  178. })
  179. }
  180. function prize(id,value,ispwcheck){
  181. var game = $('#game').val();
  182. var url = '/admin/SfsixlotteryRes/OpenPrize';
  183. if(game=='sixlottery'){
  184. url = '/admin/SixlotteryRes/OpenPrize';
  185. }
  186. var isfirst = $('#isfirst').attr('data-id');
  187. $('#isfirst').attr('data-id','2');
  188. $.ajax({
  189. url:url + '?identity='+id + '&game=' + game,
  190. type:"post",
  191. dataType:"json",
  192. data:{password:value,isfirst:isfirst},
  193. success:function(data){
  194. layer.close(index);
  195. if(data.status==2){
  196. layer.alert('开奖成功',function(){
  197. window.location.reload();
  198. });
  199. }else if(data.status==1 && isfirst==1){
  200. layer.alert('系统正在开奖,请等待2~3分钟');
  201. setTimeout(function(){
  202. prize(id,value,2);
  203. },5000);
  204. }else if(data.status==1){
  205. setTimeout(function(){
  206. prize(id,value,2);
  207. },5000);
  208. }else{
  209. layer.alert(data.msg,function(){
  210. window.location.reload();
  211. });
  212. }
  213. /*if(data.status==2){
  214. if(ispwcheck==1){
  215. layer.close(index);
  216. layer.open({
  217. type: 1,
  218. title: '开奖进度',
  219. closeBtn: 0,
  220. area: ['200px','200px'],
  221. skin: 'layui-layer-demo', //没有背景色
  222. shadeClose: false,
  223. content: $('#parper')
  224. });
  225. }
  226. $('#parper .percent').text(100);
  227. layer.msg('成功');
  228. setTimeout(function(){
  229. window.location.reload();
  230. },2500);
  231. }else if(data.status==1){
  232. if(ispwcheck==1){
  233. layer.close(index);
  234. layer.open({
  235. type: 1,
  236. title: '开奖进度',
  237. closeBtn: 0,
  238. area: ['200px','200px'],
  239. skin: 'layui-layer-demo', //没有背景色
  240. shadeClose: false,
  241. content: $('#parper')
  242. });
  243. }
  244. console.log(data.data.percent);
  245. $('#parper .percent').text(data.data.percent);
  246. prize(id,value,2);
  247. }else{
  248. layer.alert(data.msg);
  249. }*/
  250. },
  251. })
  252. }
  253. </script>
  254. @endsection