Jimy 6 years ago
parent
commit
596a38a83f
1 changed files with 208 additions and 0 deletions
  1. 208 0
      resources/views/admin/sportsfoot/outcome.blade.php

+ 208 - 0
resources/views/admin/sportsfoot/outcome.blade.php

@@ -21,6 +21,105 @@
             width: auto;
         }
     </style>
+	
+	 <!-- 样式 -->
+	<style type="text/css">
+		/* 弹窗 (background) */
+		.modal {
+			display: none; /* 默认隐藏 */
+			/*生成绝对定位的元素,相对于浏览器窗口进行定位。*/
+			position: fixed; 
+			z-index: 1; 
+			left: 0;
+			top: 0;
+			/*设置弹窗位置*/
+			padding-top: 200px;
+			padding-bottom: 300px;
+			/*浮在全屏上*/
+			width: 100%; 
+			height:  100%; 
+			/*overflow:auto;如果内容被修剪,则浏览器会显示滚动条,以便查看其余内容。*/
+			overflow: auto; 
+			background-color: rgb(0,0,0); 
+			background-color: rgba(0,0,0,0.4);
+			text-align: right;
+		}
+
+		/* 弹窗内容 */
+		.modal-content {
+			/*position: relative;*/
+			/*弹窗背景色设置*/
+			background-color: #fefefe;
+			margin: auto;
+			padding: 260px auto;
+			width: 500px;
+			box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
+			-webkit-animation-name: animatetop;
+			-webkit-animation-duration: 0.4s;
+			animation-name: animatetop;
+			animation-duration: 0.4s;
+			border-radius: 10px;
+		   }
+
+		/* 添加动画 */
+		@-webkit-keyframes animatetop {
+			from {top:-200px; opacity:0} 
+			to {top:0; opacity:1}
+		}
+
+		@keyframes animatetop {
+			from {top:-200px; opacity:0}
+			to {top:0; opacity:1}
+		}
+
+		/* 关闭按钮 */
+		.close {
+			color: white;
+			float: right;
+			font-size: 28px;
+			font-weight: bold;
+		}
+
+		.close:hover, .close:focus {
+			color: #000;
+			text-decoration: none;
+			cursor: pointer;
+		}
+
+		.modal-header {
+			display: block;
+			line-height: 30px;
+			padding: 2px 10px;
+			background-color: #AEAEAE;
+			color: white;
+			text-align: left;
+			border-radius: 5px 5px 0 0;
+		}
+
+		.modal-body {
+			padding: 2px 16px;
+			font-size: 18px;
+			height: 200px;
+		}
+
+		.modal-footer {
+			display: flex;
+			justify-content: space-around;
+			align-items: center;
+			width: 420px;
+			padding: 0 40px;
+			height: 50px;
+		   border-radius:0 0 5px 5px;
+			/*display: block;*/
+			line-height: 39px;
+			background-color: #AEAEAE;
+			color: white;
+		}
+		.ok,.no{
+			width: 100px;
+			height: 40px;
+		}
+	</style>
 
     <script type="text/html" id="newtime">
       @{{#if(d.match_id!=null){ }}
@@ -42,6 +141,7 @@
     </script>
 
     <script type="text/html" id="status">
+		<button onclick="addResult(@{{d.match_id}})" class="layui-btn layui-btn-sm layui-btn-green set">赛事结果</button>
         @{{#if(d.status==2 || d.status==3){ }}
             @{{#if(d.status==2){ }}
                 <span><li class="layui-btn layui-btn-sm layui-btn-green set" onclick="settlement(@{{d.match_id}},1)">结算</li></span>
@@ -171,6 +271,37 @@
             </form>
         </div>
     </div>
+	
+	<!-- 弹窗隐藏区域 -->
+    <div id="myModal" class="modal">
+            <input type="hidden" id="match_id" name="match_id" value="@{{d.match_id}}">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <span class="close">&times;</span>
+                    <h2>赛事结果添加</h2>
+                </div>
+                <div class="modal-body">
+                    <p>请认真填写赛事结果,将会按照改结果结算</p><br>
+                    <div style="float:left">
+                        <p>最先进球球队:</p>
+                        <p>最后进球球队:</p>
+                        <p>获 胜 球 队:</p>
+                        <p>上主队进球数:</p>
+                        <p>上客队进球数:</p>
+                    </div>
+                    <div>
+                        <input type="text" id="firstscore" name="firstscore" value=""><br>
+                        <input type="text" id="lastscore" name="lastscore" value=""><br>
+                        <input type="text" id="matchwiner" name="matchwiner" value=""><br>
+                        <input type="text" id="uhomescore" name="uhomescore" value=""><br>
+                        <input type="text" id="uguestscore" name="uguestscore" value=""><br>
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <button class="ok" onchange="buttonClick()"><h3>确定</h3></button>&nbsp;<button class="no"><h3>取消</h3></button>
+                </div>
+            </div>
+    </div>
 
     <script type="text/javascript">
         $(function () {
@@ -188,6 +319,83 @@
             	}
             })
         })
+		
+		function addResult($match_id){
+            var match_id = $match_id;
+            document.getElementById("match_id").value=$match_id;//赋值个弹窗
+
+            $.ajax({
+                type: 'POST',
+                dataType: 'json',
+                url: '/admin/Sportsfoot/sairesult',
+                data: {match_id:match_id},
+                success: function(data) {
+                    document.getElementById("firstscore").value=data.first_score;
+                    document.getElementById("lastscore").value=data.last_score;
+                    document.getElementById("matchwiner").value=data.match_winer;
+                    document.getElementById("uhomescore").value=data.u_home_score;
+                    document.getElementById("uguestscore").value=data.u_guest_score;
+                }
+            })
+
+            //获取弹窗得div
+            var modal = document.getElementById('myModal');
+            // 获取 <span> 元素,用于关闭弹窗 (X)
+            var span = document.getElementsByClassName("close")[0];
+            //获取弹窗中得确定按钮
+            var ok=document.getElementsByClassName("ok")[0];
+            //获取弹窗中得取消按钮
+            var no=document.getElementsByClassName("no")[0];
+            //窗体弹出
+            modal.style.display = "block";
+            //点击窗体ok
+            ok.onclick=function(){
+                //执行弹出窗体得确定后得操作
+                alert("执行确定按钮点击得操作");
+                //关闭窗口
+                modal.style.display = "none";
+                buttonClick();
+            }
+            //点击窗体取消按钮
+            no.onclick=function(){
+                //直接关闭窗口
+                modal.style.display = "none";
+            }
+            // 点击 <span> (x), 关闭弹窗
+            span.onclick = function() {
+                //直接关闭窗口
+                modal.style.display = "none";
+            }
+            // 在用户点击其他地方时,关闭弹窗
+            window.onclick = function(event) {
+                //点击窗口外内容,关闭窗口
+                if (event.target == modal) modal.style.display = "none";
+            }
+        }
+
+        function buttonClick(){
+            var match_id = $("#match_id").val();
+            var firstscore = $("#firstscore").val();
+            var lastscore = $("#lastscore").val();
+            var matchwiner = $("#matchwiner").val();
+            var uhomescore = $("#uhomescore").val();
+            var uguestscore = $("#uguestscore").val();
+
+            $.ajax({
+                type: 'POST',
+                dataType: 'json',
+                url: '/admin/Sportsfoot/addend',
+                data: {match_id:match_id,firstscore:firstscore,lastscore:lastscore,matchwiner:matchwiner,uhomescore:uhomescore,uguestscore:uguestscore},
+                success: function(data) {
+                    
+                    if(data.status==1){
+                        layer.msg(data.msg);
+                        location. reload()//刷新当前页面
+                    }
+                }
+            })
+        }
+
 
         //刷新赛事数据
         function refreshall(game_code){