sunyadv 5 年之前
父节点
当前提交
292200a104

+ 6 - 0
minigame/WebContent/css/main.css

@@ -784,6 +784,12 @@ img {
         width: 1.25rem; }
       .poster-mode .leads-box .user-info p {
         font-size: 0.3125rem;
+        width: 1.25rem;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        display: -webkit-box;
+        -webkit-line-clamp: 2;
+        -webkit-box-orient: vertical;
         color: #743d2f;
         margin-top: 0.15625rem; }
     .poster-mode .leads-box .submit {

二进制
minigame/WebContent/img/poster/headOil.png


二进制
minigame/WebContent/img/poster/hsr.png


二进制
minigame/WebContent/img/share_btn.png


+ 27 - 0
minigame/WebContent/index.html

@@ -121,5 +121,32 @@
     <script src="./js/wechat.js"></script>
     <script src="./assets.js"></script>
     <script src="./js/main.js"></script>
+    <script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
+    <script>
+        // 判断微信分享
+        document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
+            // 发送给好友
+            WeixinJSBridge.on('menu:share:appmessage', function(argv){
+                // alert('发送给好友')
+                setTimeout(function(){
+                    window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
+                }, 6000);
+
+            });
+            // 分享到朋友圈
+            WeixinJSBridge.on('menu:share:timeline', function(argv){
+                // alert('分享到朋友圈')
+                setTimeout(function(){
+                    window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
+                }, 6000);
+
+            });
+        }, false);
+
+        // 判断微博分享
+        document.addEventListener('WeiboJSBridgeReady', function onBridgeReady() {
+
+        }, false);
+    </script>
 </body>
 </html>

+ 43 - 53
minigame/WebContent/js/main.js

@@ -694,39 +694,46 @@ function getInfo() {
 // 获取登陆信息
 function getMsg(){
     if(URLParams['uid'] || localStorage.userId){
-        var uid = URLParams['uid'];
+        
 		if(localStorage.userId) {
-			uid = localStorage.userId;
+			window.user_info.uid = localStorage.userId;
+			window.user_info.logo = localStorage.userPic;
+			window.user_info.nickname = localStorage.userName;
+			$('.headimg-box img').attr("src", localStorage.userPic);
+			$('.user-info p').html(localStorage.userName);
+		} else {
+			var uid = URLParams['uid'];
+			var xhr=null;
+			try{
+				xhr=new XMLHttpRequest();
+			}catch(e){
+				xhr=new ActiveXObject("Microsoft.XMLHTTP");
+			}
+			xhr.open("post","news/show",true);
+			xhr.setRequestHeader('content-type','application/x-www-form-urlencoded');
+			xhr.send("id="+uid);
+			xhr.onreadystatechange=function(){
+				if(xhr.readyState==4){
+					if(xhr.status==200){
+						var msg = JSON.parse(xhr.response);
+						if(msg.code == "ok") {
+							window.user_info.uid = msg.data.id;
+							window.user_info.logo = msg.data.headerPic;
+							window.user_info.nickname = msg.data.nickName;
+							window.user_info.namemsg = msg.data.message;
+							window.user_info.textmsg = msg.data.message;
+							$('.headimg-box img').attr("src", msg.data.headerPic);
+							$('.user-info p').html(msg.data.nickName);
+							$('#nameText').html(msg.data.receiver);
+							$('#text').html(msg.data.message);
+						}
+					}else{
+						console.log("错误"+xhr.status)
+					}
+				}
+			}
 		}
-        var xhr=null;
-        try{
-            xhr=new XMLHttpRequest();
-        }catch(e){
-            xhr=new ActiveXObject("Microsoft.XMLHTTP");
-        }
-        xhr.open("post","news/show",true);
-        xhr.setRequestHeader('content-type','application/x-www-form-urlencoded');
-        xhr.send("id="+uid);
-        xhr.onreadystatechange=function(){
-            if(xhr.readyState==4){
-                if(xhr.status==200){
-                    var msg = JSON.parse(xhr.response);
-                    if(msg.code == "ok") {
-                        window.user_info.uid = msg.data.id;
-                        window.user_info.logo = msg.data.headerPic;
-                        window.user_info.nickname = msg.data.nickName;
-                        window.user_info.namemsg = msg.data.message;
-                        window.user_info.textmsg = msg.data.message;
-                        $('.headimg-box img').attr("src", msg.data.headerPic);
-                        $('.user-info p').html(msg.data.nickName);
-                        $('#nameText').html(msg.data.receiver);
-                        $('#text').html(msg.data.message);
-                    }
-                }else{
-                    console.log("错误"+xhr.status)
-                }
-            }
-        }
+        
     }else {
         if(URLParams['code']){
             var code = URLParams['code'];
@@ -746,6 +753,8 @@ function getMsg(){
                         if(msg.code == "ok") {
                             window.user_info.uid = msg.data.id;
 							localStorage.userId = msg.data.id;
+							localStorage.userPic = msg.data.headerPic;
+							localStorage.userName = msg.data.nickName;
                             window.user_info.logo = msg.data.headerPic;
                             window.user_info.nickname = msg.data.nickName;
                             $('.headimg-box img').attr("src", msg.data.headerPic);
@@ -802,11 +811,11 @@ function saveText() {
                 }
 				
 				$("#cover").show();
-                if(type == 1) {
+                //if(type == 1) {
                     setTimeout(function(){
-                        window.location.href = url
+                        window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
                     }, 6000);
-                }
+                //}
             }else{
                 console.log("错误"+xhr.status)
             }
@@ -823,25 +832,6 @@ function hiddenCover() {
     $("#cover").hide();
 }
 
-// 判断微信分享
-document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
-    // 发送给好友
-    WeixinJSBridge.on('menu:share:appmessage', function(argv){
-        // alert('发送给好友')
-        window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
-    });
-    // 分享到朋友圈
-    WeixinJSBridge.on('menu:share:timeline', function(argv){
-        // alert('分享到朋友圈')
-        window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
-    });
-}, false);
-
-// 判断微博分享
-document.addEventListener('WeiboJSBridgeReady', function onBridgeReady() {
-
-}, false);
-
 // 自适应
 var stageWidth, stageHeight, stageScale;
 

+ 3 - 3
minigame/WebContent/lottery.html

@@ -9,7 +9,7 @@
     <script src="js/jquery.min.js"></script>
     <link rel="stylesheet" href="css/lottery.css" type="text/css" />
     <script type="text/javascript">
-    	var id = 3;
+    	var id = localStorage.userId;
         var current = 0;
         var last = 0;
         var threshold = 0;
@@ -24,8 +24,8 @@
             });
             //在这里查看是否有id
             if(id == null){
-            	alert("请先登录");
-            	window.location.href = "index.html";
+            	//alert("请先登录");
+            	window.location.href = "http://wx.ttkuaiban.com/minigame";
             }