소스 검색

解决bug

Limengbo 5 년 전
부모
커밋
118aed1df6
3개의 변경된 파일18개의 추가작업 그리고 11개의 파일을 삭제
  1. 3 3
      css/question.css
  2. 1 1
      index.html
  3. 14 7
      view/question.html

+ 3 - 3
css/question.css

@@ -152,7 +152,7 @@ body {
 .popup-content .bg {
     position: absolute;
     left: 15%;
-    top: 10%;
+    top: .6rem;
     width: 70%;
 }
 
@@ -165,7 +165,7 @@ canvas {
 .baocun {
     position: absolute;
     left: 50%;
-    bottom: 15%;
+    bottom: 1.6rem;
     transform: translateX(-50%);
     color: #fff;
     font-size: .28rem;
@@ -176,7 +176,7 @@ canvas {
     left: 0;
     bottom: 0;
     width: 100%;
-    height: 1.6rem;
+    height: 1.4rem;
     background: #fff;
     display: flex;
     align-items: center;

+ 1 - 1
index.html

@@ -4,7 +4,7 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
-    <title>Document</title>
+    <title>无限潜能</title>
     <link rel="stylesheet" href="./css/index.css">
     <script src="./utils/size.js"></script>
 </head>

+ 14 - 7
view/question.html

@@ -4,7 +4,7 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
-    <title>Document</title>
+    <title>无限潜能</title>
     <link rel="stylesheet" href="../css/question.css">
     <script src="../utils/size.js"></script>
 </head>
@@ -50,10 +50,9 @@
             <canvas id="myCanvas" width="750px" height="1334px">
                 您的浏览器不支持canvas标签。
             </canvas>
-            <img class="bg" src="" alt=""  crossorigin="anonymous">
+            <img class="bg" src="../image/question/2.jpg" alt=""  crossorigin="anonymous">
             <div class="baocun">长按保存,并分享至朋友圈</div>
             <div class="code">
-                <!--测试二维码 上线需要改-->
                 <img src="../image/question/code.jpg" alt="">
                 <div class="text">
                     <span>长按识别二维码</span>
@@ -69,8 +68,16 @@
 </body>
 <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
 <script> 
+//console.log(localStorage.getItem('userData') == 'undefined')
+window.onload=function(){
+    if(localStorage.getItem('userData') == 'undefined') {
+        alert('请重新扫码登陆')
+        window.location.href = '../index.html'
+        return false;
+    }
+
     var user = JSON.parse(localStorage.getItem('userData'));
-    var uid = user.uid ? user.id : '7';
+    var uid = user.uid;
     var avatar = user.avatar ? user.avatar : '';
     var name = user.wechatName ? user.wechatName : '小朋友';
     //获取Canvas对象(画布)
@@ -83,7 +90,7 @@
     }
     var ind = 0;
     function recursion() {
-        ajaxData("https://readertest.lingjiao.cn/activity/activity/xq", 7, data, function(result){
+        ajaxData("https://readertest.lingjiao.cn/activity/activity/xq", uid, data, function(result){
             var length = result.data.questionNum;
             if( ind >= length && result.data.isEnd === 0) {
                 $('#audio').attr('src', "")
@@ -209,9 +216,9 @@
     play = function(){
             audio.load();
        audio.play();
-            window.removeEventListener("touchstart",play, false);
     };
-        window.addEventListener("touchstart",play, false);
+        $('.audiobtn').on("click",play);
     }
+}
 </script>
 </html>