|
@@ -121,8 +121,8 @@ function handleComplete(evt, comp) {
|
|
//location.reload()
|
|
//location.reload()
|
|
})
|
|
})
|
|
// $(".secret-btn").on("click",function(){
|
|
// $(".secret-btn").on("click",function(){
|
|
- //saveText();
|
|
|
|
- //$(".secret-box").fadeIn();
|
|
|
|
|
|
+ //saveText();
|
|
|
|
+ //$(".secret-box").fadeIn();
|
|
// })
|
|
// })
|
|
$(".secret-box").on("click",function(){
|
|
$(".secret-box").on("click",function(){
|
|
$(".secret-box").fadeOut();
|
|
$(".secret-box").fadeOut();
|
|
@@ -179,13 +179,13 @@ function handleComplete(evt, comp) {
|
|
}
|
|
}
|
|
function oilIconAnim() {
|
|
function oilIconAnim() {
|
|
oilAnim();
|
|
oilAnim();
|
|
-
|
|
|
|
- if(dishIndex == 0){
|
|
|
|
- createjs.Sound.play("hsr");//播放
|
|
|
|
|
|
+
|
|
|
|
+ if(dishIndex == 0){
|
|
|
|
+ createjs.Sound.play("hsr");//播放
|
|
}else if(dishIndex == 1){
|
|
}else if(dishIndex == 1){
|
|
- createjs.Sound.play("qcdf");//播放
|
|
|
|
|
|
+ createjs.Sound.play("qcdf");//播放
|
|
}else if(dishIndex == 2){
|
|
}else if(dishIndex == 2){
|
|
- createjs.Sound.play("swy");//播放
|
|
|
|
|
|
+ createjs.Sound.play("swy");//播放
|
|
}else{
|
|
}else{
|
|
createjs.Sound.play("ymc");//播放
|
|
createjs.Sound.play("ymc");//播放
|
|
}
|
|
}
|
|
@@ -465,7 +465,7 @@ function handleComplete(evt, comp) {
|
|
|
|
|
|
oilIconAnim();
|
|
oilIconAnim();
|
|
proAnim(function() {
|
|
proAnim(function() {
|
|
-
|
|
|
|
|
|
+
|
|
exportRoot.btn2.alpha = 1;
|
|
exportRoot.btn2.alpha = 1;
|
|
btnAnim(exportRoot.btn2);
|
|
btnAnim(exportRoot.btn2);
|
|
if(dishIndex == 0){
|
|
if(dishIndex == 0){
|
|
@@ -484,14 +484,14 @@ function handleComplete(evt, comp) {
|
|
materialEnterAnim(exportRoot.blackboard.material1,0.2);
|
|
materialEnterAnim(exportRoot.blackboard.material1,0.2);
|
|
materialEnterAnim(exportRoot.blackboard.material2,0.4);
|
|
materialEnterAnim(exportRoot.blackboard.material2,0.4);
|
|
materialEnterAnim(exportRoot.blackboard.material3,0.6);
|
|
materialEnterAnim(exportRoot.blackboard.material3,0.6);
|
|
-
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
|
|
|
|
exportRoot.blackboard.material1.addEventListener("mousedown", function() {
|
|
exportRoot.blackboard.material1.addEventListener("mousedown", function() {
|
|
exportRoot.blackboard.material1.removeAllEventListeners();
|
|
exportRoot.blackboard.material1.removeAllEventListeners();
|
|
exportRoot.blackboard.material2.removeAllEventListeners();
|
|
exportRoot.blackboard.material2.removeAllEventListeners();
|
|
exportRoot.blackboard.material3.removeAllEventListeners();
|
|
exportRoot.blackboard.material3.removeAllEventListeners();
|
|
- exportRoot.ball1.alpha = 1;
|
|
|
|
|
|
+ exportRoot.ball1.alpha = 1;
|
|
ballAnim(exportRoot.ball1);
|
|
ballAnim(exportRoot.ball1);
|
|
chooseType = 3;
|
|
chooseType = 3;
|
|
$(".poster-mode").addClass("poster-bg3");
|
|
$(".poster-mode").addClass("poster-bg3");
|
|
@@ -506,7 +506,7 @@ function handleComplete(evt, comp) {
|
|
exportRoot.blackboard.material1.removeAllEventListeners();
|
|
exportRoot.blackboard.material1.removeAllEventListeners();
|
|
exportRoot.blackboard.material2.removeAllEventListeners();
|
|
exportRoot.blackboard.material2.removeAllEventListeners();
|
|
exportRoot.blackboard.material3.removeAllEventListeners();
|
|
exportRoot.blackboard.material3.removeAllEventListeners();
|
|
- exportRoot.ball2.alpha = 1;
|
|
|
|
|
|
+ exportRoot.ball2.alpha = 1;
|
|
ballAnim(exportRoot.ball2);
|
|
ballAnim(exportRoot.ball2);
|
|
chooseType = 2;
|
|
chooseType = 2;
|
|
$(".poster-mode").addClass("poster-bg2");
|
|
$(".poster-mode").addClass("poster-bg2");
|
|
@@ -521,8 +521,8 @@ function handleComplete(evt, comp) {
|
|
exportRoot.blackboard.material1.removeAllEventListeners();
|
|
exportRoot.blackboard.material1.removeAllEventListeners();
|
|
exportRoot.blackboard.material2.removeAllEventListeners();
|
|
exportRoot.blackboard.material2.removeAllEventListeners();
|
|
exportRoot.blackboard.material3.removeAllEventListeners();
|
|
exportRoot.blackboard.material3.removeAllEventListeners();
|
|
- console.log(exportRoot.ball3)
|
|
|
|
- exportRoot.ball3.alpha = 1;
|
|
|
|
|
|
+ console.log(exportRoot.ball3)
|
|
|
|
+ exportRoot.ball3.alpha = 1;
|
|
ballAnim(exportRoot.ball3);
|
|
ballAnim(exportRoot.ball3);
|
|
chooseType = 1;
|
|
chooseType = 1;
|
|
$(".poster-mode").addClass("poster-bg1");
|
|
$(".poster-mode").addClass("poster-bg1");
|
|
@@ -548,7 +548,7 @@ function handleComplete(evt, comp) {
|
|
|
|
|
|
|
|
|
|
bowlAnim(function() {
|
|
bowlAnim(function() {
|
|
- if(dishIndex == 0){
|
|
|
|
|
|
+ if(dishIndex == 0){
|
|
dishMove(exportRoot.plate.hsr_icon1,0,0);
|
|
dishMove(exportRoot.plate.hsr_icon1,0,0);
|
|
dishMove(exportRoot.plate.hsr_icon2,0,0);
|
|
dishMove(exportRoot.plate.hsr_icon2,0,0);
|
|
dishMove(exportRoot.plate.hsr_icon3,0,0);
|
|
dishMove(exportRoot.plate.hsr_icon3,0,0);
|
|
@@ -580,7 +580,7 @@ function handleComplete(evt, comp) {
|
|
} else {
|
|
} else {
|
|
alert('您的手机不支持摇一摇功能!');
|
|
alert('您的手机不支持摇一摇功能!');
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
//获取加速度信息
|
|
//获取加速度信息
|
|
//通过监听上一步获取到的x, y, z 值在一定时间范围内的变化率,进行设备是否有进行晃动的判断。
|
|
//通过监听上一步获取到的x, y, z 值在一定时间范围内的变化率,进行设备是否有进行晃动的判断。
|
|
@@ -613,8 +613,12 @@ function handleComplete(evt, comp) {
|
|
$(".poster-mode").fadeIn();
|
|
$(".poster-mode").fadeIn();
|
|
})
|
|
})
|
|
|
|
|
|
- var href = document.location.href + (document.location.href.indexOf('?') > -1?'&':'?') + "type=" + chooseType + "&food=" + dishIndex;
|
|
|
|
- history.pushState("", "Title", href);
|
|
|
|
|
|
+
|
|
|
|
+ if(document.location.href.indexOf('type') > -1){
|
|
|
|
+ var href = document.location.href + (document.location.href.indexOf('?') > -1?'&':'?') + "type=" + chooseType + "&food=" + dishIndex;
|
|
|
|
+ history.pushState("", "Title", href);
|
|
|
|
+ }
|
|
|
|
+
|
|
if(dishIndex == 0){
|
|
if(dishIndex == 0){
|
|
exportRoot.pot.hsr.gotoAndStop(1);
|
|
exportRoot.pot.hsr.gotoAndStop(1);
|
|
}else if(dishIndex == 1){
|
|
}else if(dishIndex == 1){
|
|
@@ -667,7 +671,6 @@ function getInfo() {
|
|
+"response_type=code&"
|
|
+"response_type=code&"
|
|
+"scope=snsapi_userinfo&"//snsapi_userinfo
|
|
+"scope=snsapi_userinfo&"//snsapi_userinfo
|
|
+"state=1#wechat_redirect";
|
|
+"state=1#wechat_redirect";
|
|
- getMsg();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (ua.match(/WeiBo/i) == "weibo") {
|
|
if (ua.match(/WeiBo/i) == "weibo") {
|
|
@@ -676,7 +679,6 @@ function getInfo() {
|
|
+"client_id=2141531565&"
|
|
+"client_id=2141531565&"
|
|
+"response_type=code&"
|
|
+"response_type=code&"
|
|
+"redirect_uri=http://wx.ttkuaiban.com/minigame/index.html"
|
|
+"redirect_uri=http://wx.ttkuaiban.com/minigame/index.html"
|
|
- getMsg();
|
|
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
@@ -688,7 +690,6 @@ function getInfo() {
|
|
+"response_type=code&"
|
|
+"response_type=code&"
|
|
+"scope=snsapi_userinfo&"//snsapi_userinfo
|
|
+"scope=snsapi_userinfo&"//snsapi_userinfo
|
|
+"state=1#wechat_redirect";
|
|
+"state=1#wechat_redirect";
|
|
- getMsg();
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -716,51 +717,52 @@ function getInfo() {
|
|
$('#textInput').show();
|
|
$('#textInput').show();
|
|
$('#text').hide();
|
|
$('#text').hide();
|
|
init();
|
|
init();
|
|
|
|
+ getMsg();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// 获取登陆信息
|
|
// 获取登陆信息
|
|
function getMsg(){
|
|
function getMsg(){
|
|
if(URLParams['uid'] || localStorage.userId){
|
|
if(URLParams['uid'] || localStorage.userId){
|
|
- if(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)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ if(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)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}else {
|
|
}else {
|
|
if(URLParams['code']){
|
|
if(URLParams['code']){
|
|
var code = URLParams['code'];
|
|
var code = URLParams['code'];
|
|
@@ -779,9 +781,9 @@ function getMsg(){
|
|
var msg = JSON.parse(xhr.response);
|
|
var msg = JSON.parse(xhr.response);
|
|
if(msg.code == "ok") {
|
|
if(msg.code == "ok") {
|
|
window.user_info.uid = msg.data.id;
|
|
window.user_info.uid = msg.data.id;
|
|
- localStorage.userId = msg.data.id;
|
|
|
|
- localStorage.userPic = msg.data.headerPic;
|
|
|
|
- localStorage.userName = msg.data.nickName;
|
|
|
|
|
|
+ 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.logo = msg.data.headerPic;
|
|
window.user_info.nickname = msg.data.nickName;
|
|
window.user_info.nickname = msg.data.nickName;
|
|
$('.headimg-box img').attr("src", msg.data.headerPic);
|
|
$('.headimg-box img').attr("src", msg.data.headerPic);
|
|
@@ -801,12 +803,12 @@ function getMsg(){
|
|
function saveText() {
|
|
function saveText() {
|
|
var value = $('#textInput').val(),
|
|
var value = $('#textInput').val(),
|
|
receiver = $('#nameInput').val();
|
|
receiver = $('#nameInput').val();
|
|
-
|
|
|
|
- if(value == '' || receiver == '') {
|
|
|
|
- alert('请填写寄语');
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ if(value == '' || receiver == '') {
|
|
|
|
+ alert('请填写寄语');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
var xhr=null;
|
|
var xhr=null;
|
|
try{
|
|
try{
|
|
xhr=new XMLHttpRequest();
|
|
xhr=new XMLHttpRequest();
|
|
@@ -830,23 +832,23 @@ function saveText() {
|
|
$('.user-info p').html(msg.data.nickName);
|
|
$('.user-info p').html(msg.data.nickName);
|
|
$('#nameInput').val(msg.data.receiver);
|
|
$('#nameInput').val(msg.data.receiver);
|
|
$('#textInput').val(msg.data.message);
|
|
$('#textInput').val(msg.data.message);
|
|
-// if(document.location.href.indexOf('?') > -1){
|
|
|
|
-// href = document.location.href + "&uid=" + msg.data.id;
|
|
|
|
-// } else {
|
|
|
|
-// href = document.location.href + "?uid=" + msg.data.id;
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
|
|
+ if(document.location.href.indexOf('?') > -1){
|
|
|
|
+ href = document.location.href + "&uid=" + msg.data.id;
|
|
|
|
+ } else {
|
|
|
|
+ href = document.location.href + "?uid=" + msg.data.id;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
-// if(href != document.location.href){
|
|
|
|
-// history.pushState("", "Title", href);
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
- $("#cover").show();
|
|
|
|
|
|
+ if(href != document.location.href){
|
|
|
|
+ history.pushState("", "Title", href);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $("#cover").show();
|
|
//if(type == 1) {
|
|
//if(type == 1) {
|
|
- setTimeout(function(){
|
|
|
|
- window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
|
|
|
|
- }, 6000);
|
|
|
|
|
|
+ setTimeout(function(){
|
|
|
|
+ window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
|
|
|
|
+ }, 10000);
|
|
//}
|
|
//}
|
|
}else{
|
|
}else{
|
|
console.log("错误"+xhr.status)
|
|
console.log("错误"+xhr.status)
|