mzx16822 hace 6 años
padre
commit
706eb2fc00
Se han modificado 2 ficheros con 48 adiciones y 36 borrados
  1. 6 1
      resources/views/home/login.blade.php
  2. 42 35
      resources/views/home/user.blade.php

+ 6 - 1
resources/views/home/login.blade.php

@@ -23,7 +23,7 @@
   <div class="layui-form-item" >
     <!-- <label class="layui-form-label">输入名字</label> -->
     <div class="layui-input-block">
-      <input type="text" name="username"   required  lay-verify="required" placeholder="输入名字" autocomplete="off" class="layui-input">
+      <input type="text" name="username"   required  lay-verify="required" placeholder="输入名字" autocomplete="off" class="layui-input" id="loginName">
     </div>
   </div>
   <div class="layui-form-item">
@@ -58,6 +58,11 @@ $.ajaxSetup({
     },'json');
     return false;
   });
+  try{
+    $("#loginName").val(Authentication.CTCGetConfig("UserID"));
+  }catch(e){
+    
+  }
 });
 </script>
 </body>

+ 42 - 35
resources/views/home/user.blade.php

@@ -254,7 +254,7 @@ function daoshu(argument) {
                 var py2_score = parseInt($("#py2_score").html());
                 if(data.is_end == 1){
                   //结算
-                 // main.reSetClass("btn-3",0);
+                  if(main) main.reSetClass("btn-3",0);
                   clearInterval(ts)
                   setTimeout(function (argument) {
                     
@@ -310,7 +310,7 @@ function daoshu(argument) {
           case "question":
           setTimeout(function(argument) {
            loadQuestion(data);
-           //main.reSetClass("btn-2",0);
+           if(main)main.reSetClass("btn-2",0);
           },1000);
             
           default :
@@ -418,42 +418,49 @@ var rules={
     line:1 
   }
 };
+try{
+Authentication.CTCGetConfig("UserID");
 
- // var btnConfig={
- //          className: "btn-1",
- //          currentClass:"on",
- //          history:false,
- //            rules:rules,
- //            currentIndex:0,
- //                onEnterPress:function () {
- //                  // body...
- //                  if(this.className=="btn-1"){
- //                    start();
- //                  }
- //                  if(this.className=="btn-2"){
- //                    var ischeck=true
- //                    for (var i = 0; i < this.hotbtn.length; i++) {
- //                      if(this.hotbtn[i].classList.contains("cur_answer")){
- //                        ischeck=false;
- //                      }
- //                    }
- //                    if(ischeck){
- //                      var answerId=this.current.getAttribute("data-id");
- //                      this.current.classList.add("cur_answer");
- //                      answer(answerId);
- //                    }
+ var btnConfig={
+          className: "btn-1",
+          currentClass:"on",
+          history:false,
+            rules:rules,
+            currentIndex:0,
+                onEnterPress:function () {
+                  // body...
+                  if(this.className=="btn-1"){
+                    start();
+                  }
+                  if(this.className=="btn-2"){
+                    var ischeck=true
+                    for (var i = 0; i < this.hotbtn.length; i++) {
+                      if(this.hotbtn[i].classList.contains("cur_answer")){
+                        ischeck=false;
+                      }
+                    }
+                    if(ischeck){
+                      var answerId=this.current.getAttribute("data-id");
+                      this.current.classList.add("cur_answer");
+                      answer(answerId);
+                    }
                     
- //                  }
- //                  if(this.className=="btn-3"){
- //                   var href= this.current.getAttribute("data-href");
- //                    window.location.href=href;
- //                  }
+                  }
+                  if(this.className=="btn-3"){
+                   var href= this.current.getAttribute("data-href");
+                    window.location.href=href;
+                  }
                   
- //                },
- //                onPress:function () {
- //                  // body...
- //                }}
- //    window.main = new tvSysBtnBind(btnConfig);
+                },
+                onPress:function () {
+                  // body...
+                }}
+    window.main = new tvSysBtnBind(btnConfig);
+}catch(e){
+  console.log("机顶盒!")
+}
+ 
+ 
 });