|
@@ -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;
|
|
|
|