quyueting 5 년 전
부모
커밋
69cfc830ac
3개의 변경된 파일16개의 추가작업 그리고 10개의 파일을 삭제
  1. 4 1
      minigame/WebContent/index.html
  2. 6 3
      minigame/WebContent/js/main.js
  3. 6 6
      minigame/WebContent/lottery.html

+ 4 - 1
minigame/WebContent/index.html

@@ -20,7 +20,7 @@
     <link rel="stylesheet" type="text/css" href="./css/music.css?v=2">
     <link rel="stylesheet" type="text/css" href="./css/main.css?v=2">
     <script src="https://cdn.bootcss.com/SoundJS/1.0.2/soundjs.min.js"></script>
-    <script src="http://tjs.sjs.sinajs.cn/open/thirdpart/js/jsapi/mobile.js" charset="utf-8"></script>
+    <script src="https://tjs.sjs.sinajs.cn/open/thirdpart/js/jsapi/mobile.js" charset="utf-8"></script>
     <!--<script src="https://www.w3cways.com/demo/vconsole/vconsole.min.js?v=2.2.0"></script>-->
     <script>
         window.ifDebug = false;
@@ -262,6 +262,9 @@
 			        });
 					WeiboJS.on("menuItemSelected", function(params){
 						if (!params.hasOwnProperty("error")) {
+							if (params.selected_code == 1001) {
+								WeiboJS.invoke("invokeMenuItem", {code:1001}, function(params){});
+							}
 							window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
 						}
 					});

+ 6 - 3
minigame/WebContent/js/main.js

@@ -841,11 +841,12 @@ function handleComplete(evt, comp) {
 
 function getInfo() {
     var ua = navigator.userAgent.toLowerCase();
-    var isMobile = false;
+    var isAvatorSupport = false;
     if (!!navigator.userAgent.match(/AppleWebKit.*Mobile.*/)) {
-        isMobile = true;
+        
         if (ua.match(/MicroMessenger/i) == "micromessenger") {
             type = 0;
+            isAvatorSupport = true;
             url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
                 +"appid=wx749c84daac654e1e&"
                 +"redirect_uri=https://wx.ttkuaiban.com/minigame&"
@@ -856,6 +857,7 @@ function getInfo() {
 
         if (ua.match(/WeiBo/i) == "weibo") {
             type = 1;
+            isAvatorSupport = true;
             url = "https://api.weibo.com/oauth2/authorize?"
                 +"client_id=2141531565&"
                 +"response_type=code&"
@@ -865,6 +867,7 @@ function getInfo() {
         var ua = navigator.userAgent.toLowerCase();
         if (ua.match(/MicroMessenger/i) == "micromessenger") {
             type = 0;
+            isAvatorSupport = true;
             url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
                 +"appid=wx749c84daac654e1e&"
                 +"redirect_uri=https://wx.ttkuaiban.com/minigame&"
@@ -933,7 +936,7 @@ function getInfo() {
         $('.secret-btn').show();
 
         init();
-        if (isMobile && !window.ifDebug) {
+        if (isAvatorSupport && !window.ifDebug) {
             getMsg();
         }
 

+ 6 - 6
minigame/WebContent/lottery.html

@@ -8,7 +8,7 @@
     <title>抽奖</title>
     <script src="js/jquery.min.js"></script>
     <script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
-    <script src="http://tjs.sjs.sinajs.cn/open/thirdpart/js/jsapi/mobile.js" charset="utf-8"></script>
+    <script src="https://tjs.sjs.sinajs.cn/open/thirdpart/js/jsapi/mobile.js" charset="utf-8"></script>
     <script src="js/wechat.js"></script>
     <link rel="stylesheet" href="css/lottery2.css?v=2" type="text/css" />
     <script type="text/javascript">
@@ -24,11 +24,6 @@
         var recordId = null;
         $(function () {
         	//先在这里查看是否有id
-            if(id == null || id == undefined || id == ""){
-            	//window.location.href = "https://wx.ttkuaiban.com/minigame";
-				id=1;/*debug*/
-            }
-
             var shareTitle = "一秒变大厨,为远方的朋友做道菜吧!";
             var shareImg = "https://wx.ttkuaiban.com/minigame/images/share_picture.png";
             var shareLink = "https://wx.ttkuaiban.com/minigame/lottery.html";
@@ -120,6 +115,11 @@
         		    					limit--;
         		    				}
         		    			});
+    							if (!e.hasOwnProperty("error")) {
+    								if (e.selected_code == 1001) {
+        								WeiboJS.invoke("invokeMenuItem", {code:1001}, function(params){});
+        							}
+    							}
 // 				                alert("菜单选择结果:" + JSON.stringify(e))
 				            });