addwarn.blade.php 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. @extends('vip.layouts')
  2. @section('content')
  3. <style type="text/css">
  4. /* 弹窗 (background) */
  5. .modal {
  6. display: none; /* 默认隐藏 */
  7. /*生成绝对定位的元素,相对于浏览器窗口进行定位。*/
  8. position: fixed;
  9. z-index: 1;
  10. left: 0;
  11. top: 0;
  12. /*设置弹窗位置*/
  13. padding-top: 100px;
  14. padding-bottom: 200px;
  15. /*浮在全屏上*/
  16. width: 100%;
  17. height: 100%;
  18. /*overflow:auto;如果内容被修剪,则浏览器会显示滚动条,以便查看其余内容。*/
  19. overflow: auto;
  20. background-color: rgb(0,0,0);
  21. background-color: rgba(0,0,0,0.4);
  22. text-align: right;
  23. }
  24. /* 弹窗内容 */
  25. .modal-content {
  26. /*position: relative;*/
  27. /*弹窗背景色设置*/
  28. background-color: #fefefe;
  29. margin: auto;
  30. padding: 260px auto;
  31. width: 600px;
  32. box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
  33. -webkit-animation-name: animatetop;
  34. -webkit-animation-duration: 0.4s;
  35. animation-name: animatetop;
  36. animation-duration: 0.4s;
  37. border-radius: 10px;
  38. }
  39. /* 添加动画 */
  40. @-webkit-keyframes animatetop {
  41. from {top:-200px; opacity:0}
  42. to {top:0; opacity:1}
  43. }
  44. @keyframes animatetop {
  45. from {top:-200px; opacity:0}
  46. to {top:0; opacity:1}
  47. }
  48. /* 关闭按钮 */
  49. .close {
  50. color: white;
  51. float: right;
  52. font-size: 28px;
  53. font-weight: bold;
  54. }
  55. .close:hover, .close:focus {
  56. color: #000;
  57. text-decoration: none;
  58. cursor: pointer;
  59. }
  60. .modal-header {
  61. display: block;
  62. line-height: 30px;
  63. padding: 2px 10px;
  64. background-color: #AEAEAE;
  65. color: white;
  66. text-align: left;
  67. border-radius: 5px 5px 0 0;
  68. }
  69. .modal-body {
  70. padding: 2px 16px;
  71. font-size: 18px;
  72. /*height: 200px;*/
  73. }
  74. .modal-footer {
  75. display: flex;
  76. justify-content: space-around;
  77. align-items: center;
  78. width: 520px;
  79. padding: 0 40px;
  80. height: 50px;
  81. border-radius:0 0 5px 5px;
  82. display: block;
  83. line-height: 39px;
  84. background-color: #AEAEAE;
  85. color: white;
  86. }
  87. .ok,.no{
  88. width: 100px;
  89. height: 40px;
  90. }
  91. </style>
  92. <div class="layui-row">
  93. <div class="layui-col-xs12">
  94. <div class="layui-form-item">
  95. <div class="layui-inline">
  96. <!-- <label class="layui-form-label">搜&nbsp;&nbsp;索 </label>
  97. <input type="hidden" id="match_id" name="match_id" value="{{$match_id}}">
  98. <div class="layui-input-inline">
  99. <input type="text" name="sousuo" id="sousuo" lay-verify="" autocomplete="off" class="layui-input" value="">
  100. </div>
  101. <div class="layui-inline">
  102. <button class="layui-btn layui-btn-sm lay-btn-diy" data-type="reload" style="opacity: 1; pointer-events: auto;" onclick="soulist()">提交</button>
  103. </div> -->
  104. <div class="layui-inline" style="margin-left:20px;"><button onclick="addResult({{$match_id}},'',10000)" class="layui-btn layui-btn-sm layui-btn-green set">添加</button></div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <table lay-filter="parse-table-demo">
  110. <tr class="layui-form-item">
  111. <td class="layui-form-label" style="width:150px;left:10px;">时 间</td>
  112. <td class="layui-form-label" style="width:100px;left:10px;">类 型</td>
  113. <td class="layui-form-label" style="width:100px;left:10px;">操 作</td>
  114. </tr>
  115. @foreach ($warnmore as $k=>$val)
  116. <tr class="layui-form-item">
  117. <td class="layui-form-label" style="width:150px;left:10px;">{{$warnmore[$k]['timei']}}</td>
  118. <td class="layui-form-label" style="width:100px;left:10px;">{{$warnmore[$k]['rtype']}}</td>
  119. <td class="layui-form-label" style="width:100px;left:10px;">
  120. <button onclick="addResult({{$match_id}},{{$k}},2)" class="layui-btn layui-btn-sm layui-btn-green set">编辑</button>
  121. </td>
  122. </tr>
  123. @endforeach
  124. </table>
  125. <!-- 弹窗 -->
  126. <div id="myModal" class="modal">
  127. <input type="hidden" id="matchid" name="matchid" value="">
  128. <input type="hidden" id="wid" name="wid" value="">
  129. <input type="hidden" id="typenum" name="typenum" value="">
  130. <div class="modal-content">
  131. <div class="modal-header">
  132. <span class="close">&times;</span>
  133. <h2>危险球添加</h2>
  134. </div>
  135. <div class="modal-body">
  136. <p style="text-align:left;color:#5f7788;">请认真填写危险球结果,将会按照改结果结算</p><br>
  137. <div style="text-align:left;">
  138. <div style="display: flex;">
  139. <li>危险球时间:</li><input type="text" id="timei" name="timei" value="0" autocomplete="off">
  140. </div>
  141. <div style="display: flex;">
  142. <li>危险球类型:</li>
  143. <select name="warntype" id="warntype">
  144. </select>
  145. </div><br>
  146. </div>
  147. </div>
  148. <div class="modal-footer">
  149. <button class="ok" onchange="buttonClick()"><h3>确定</h3></button>&nbsp;<button class="no"><h3>取消</h3></button>
  150. </div>
  151. </div>
  152. </div>
  153. <script>
  154. function addResult(match_id,wid,typenum){
  155. $(":input",$("#myModal")).each(function(i){ $(this).val('');});
  156. var wid = wid?wid:0;
  157. document.getElementById("matchid").value=match_id;//赋值个弹窗
  158. document.getElementById("wid").value=wid;//赋值个弹窗
  159. document.getElementById("typenum").value=typenum;//赋值个弹窗
  160. $.ajax({
  161. type: 'POST',
  162. dataType: 'json',
  163. url: '/admin/Sportsfoot/warnresult',
  164. data: {match_id:match_id,wid:wid},
  165. success: function(data) {
  166. document.getElementById("timei").value=data[wid].timei;
  167. warntype = "<option value='"+data[wid].rtype+"' selected=''>";
  168. if (data[wid].rtype!=0){
  169. warntype += data[wid].rtype;
  170. }else{
  171. warntype += '请选择危险球';
  172. }
  173. warntype += "</option><option value='角球'>角球</option><option value='12码罚球'>12码罚球</option><option value='自由球'>自由球</option><option value='掷入球'>掷入球</option>";
  174. $("#warntype").html(warntype);
  175. }
  176. })
  177. //获取弹窗得div
  178. var modal = document.getElementById('myModal');
  179. // 获取 <span> 元素,用于关闭弹窗 (X)
  180. var span = document.getElementsByClassName("close")[0];
  181. //获取弹窗中得确定按钮
  182. var ok=document.getElementsByClassName("ok")[0];
  183. //获取弹窗中得取消按钮
  184. var no=document.getElementsByClassName("no")[0];
  185. //窗体弹出
  186. modal.style.display = "block";
  187. //点击窗体ok
  188. ok.onclick=function(){
  189. //执行弹出窗体得确定后得操作
  190. alert("执行确定按钮点击得操作");
  191. //关闭窗口
  192. modal.style.display = "none";
  193. buttonClick();
  194. }
  195. //点击窗体取消按钮
  196. no.onclick=function(){
  197. //直接关闭窗口
  198. modal.style.display = "none";
  199. }
  200. // 点击 <span> (x), 关闭弹窗
  201. span.onclick = function() {
  202. //直接关闭窗口
  203. modal.style.display = "none";
  204. }
  205. // 在用户点击其他地方时,关闭弹窗
  206. window.onclick = function(event) {
  207. //点击窗口外内容,关闭窗口
  208. if (event.target == modal) modal.style.display = "none";
  209. }
  210. }
  211. function buttonClick(){
  212. var matchid = $("#matchid").val();
  213. var timei = $("#timei").val();
  214. var warntype = $("#warntype").val();
  215. var wid = $("#wid").val();
  216. var typenum = $("#typenum").val();
  217. $.ajax({
  218. type: 'POST',
  219. dataType: 'json',
  220. url: '/admin/Sportsfoot/addwarnonly',
  221. data: {matchid:matchid,timei:timei,warntype:warntype,wid:wid,typenum:typenum},
  222. success: function(data) {
  223. if(data.status==1){
  224. layer.msg(data.msg);
  225. location. reload()//刷新当前页面
  226. }else{
  227. layer.msg(data.msg);return;
  228. }
  229. }
  230. })
  231. }
  232. //搜索
  233. // function soulist(){
  234. // var sousuo = $("#sousuo").val();
  235. // var match_id = $("#match_id").val();
  236. // $.ajax({
  237. // type: 'POST',
  238. // dataType: 'json',
  239. // url: '/admin/Sportsfoot/addwarn',
  240. // data: {match_id:match_id,sousuo:sousuo},
  241. // success: function(data) {
  242. // location. reload()//刷新当前页面
  243. // }
  244. // })
  245. // }
  246. </script>
  247. @endsection