sunyadv 5 gadi atpakaļ
vecāks
revīzija
458c06a926

+ 48 - 1
minigame/WebContent/assets.js

@@ -19,7 +19,15 @@ lib.ssMetadata = [
 	this.gotoAndStop(0);
 }).prototype = p = new cjs.Sprite();
 
+(lib.ball2 = function() {
+	this.spriteSheet = ss["assets_atlas_P_4"];
+	this.gotoAndStop(0);
+}).prototype = p = new cjs.Sprite();
 
+(lib.ball3 = function() {
+	this.spriteSheet = ss["assets_atlas_P_4"];
+	this.gotoAndStop(0);
+}).prototype = p = new cjs.Sprite();
 
 (lib.blackboard = function() {
 	this.spriteSheet = ss["assets_atlas_P_2"];
@@ -666,6 +674,27 @@ p.nominalBounds = new cjs.Rectangle(0,0,353,269);
 
 }).prototype = getMCSymbolPrototype(lib.ball1_1, new cjs.Rectangle(0,0,203,139), null);
 
+(lib.ball2_1 = function(mode,startPosition,loop) {
+	this.initialize(mode,startPosition,loop,{});
+
+	// 图层 1
+	this.instance = new lib.ball2();
+	this.instance.parent = this;
+
+	this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
+
+}).prototype = getMCSymbolPrototype(lib.ball2_1, new cjs.Rectangle(0,0,203,139), null);
+
+(lib.ball3_1 = function(mode,startPosition,loop) {
+	this.initialize(mode,startPosition,loop,{});
+
+	// 图层 1
+	this.instance = new lib.ball3();
+	this.instance.parent = this;
+
+	this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
+
+}).prototype = getMCSymbolPrototype(lib.ball3_1, new cjs.Rectangle(0,0,203,139), null);
 
 (lib.ymc_icon1_2 = function(mode,startPosition,loop) {
 	this.initialize(mode,startPosition,loop,{});
@@ -1215,7 +1244,25 @@ p.nominalBounds = new cjs.Rectangle(0,0,202,129);
 	this.ball1.alpha = 0;
 
 	this.timeline.addTween(cjs.Tween.get(this.ball1).wait(1));
-
+	
+	// ball2
+	this.ball2 = new lib.ball2_1();
+	this.ball2.name = "ball2";
+	this.ball2.parent = this;
+	this.ball2.setTransform(132.9,529.7,1,1,0,0,0,101.5,69.5);
+	this.ball2.alpha = 0;
+
+	this.timeline.addTween(cjs.Tween.get(this.ball2).wait(1));
+	
+	// ball3
+	this.ball3 = new lib.ball3_1();
+	this.ball3.name = "ball3";
+	this.ball3.parent = this;
+	this.ball3.setTransform(132.9,529.7,1,1,0,0,0,101.5,69.5);
+	this.ball3.alpha = 0;
+
+	this.timeline.addTween(cjs.Tween.get(this.ball3).wait(1));
+	
 	// blackboard
 	this.blackboard = new lib.blackboard_1();
 	this.blackboard.name = "blackboard";

BIN
minigame/WebContent/images/lottery_background.png


BIN
minigame/WebContent/images/reward_book.png


BIN
minigame/WebContent/images/reward_book2.png


BIN
minigame/WebContent/images/reward_oil10.png


BIN
minigame/WebContent/images/reward_oil10_2.png


BIN
minigame/WebContent/images/reward_oil5.png


BIN
minigame/WebContent/images/reward_oil5_2.png


BIN
minigame/WebContent/images/reward_oil60.png


BIN
minigame/WebContent/images/reward_oil60_2.png


BIN
minigame/WebContent/images/reward_soap.png


BIN
minigame/WebContent/images/reward_soap2.png


BIN
minigame/WebContent/img/ball2.png


BIN
minigame/WebContent/img/ball3.png


+ 25 - 5
minigame/WebContent/js/main.js

@@ -8,7 +8,10 @@ var canvas = document.getElementById("canvas");
 var stage = new createjs.Stage(canvas);
 
 createjs.Sound.alternateExtensions = ["mp3"];
-createjs.Sound.registerSound("sound/six.mp3", "six");
+createjs.Sound.registerSound("sound/start/hsr.mp3", "hsr");
+createjs.Sound.registerSound("sound/start/ymc.mp3", "ymc");
+createjs.Sound.registerSound("sound/start/swy.mp3", "swy");
+createjs.Sound.registerSound("sound/start/qcdf.mp3", "qcdf");
 
 window.user_info = {
     uid: 0,
@@ -176,7 +179,16 @@ function handleComplete(evt, comp) {
     }
     function oilIconAnim() {
         oilAnim();
-		createjs.Sound.play("six");//播放
+				
+		if(dishIndex == 0){
+			createjs.Sound.play("hsr");//播放
+        }else if(dishIndex == 1){
+			createjs.Sound.play("qcdf");//播放
+        }else if(dishIndex == 2){
+			createjs.Sound.play("swy");//播放
+        }else{
+            createjs.Sound.play("ymc");//播放
+        }
         var anim = new TimelineMax({ repeat:10,delay:1});
         anim.to(exportRoot.pro.oil_icon2, 0.3, {y:"+=100",alpha:0})
         return anim;
@@ -480,7 +492,6 @@ function handleComplete(evt, comp) {
             exportRoot.blackboard.material2.removeAllEventListeners();
             exportRoot.blackboard.material3.removeAllEventListeners();
 			exportRoot.ball1.alpha = 1;
-
             ballAnim(exportRoot.ball1);
             chooseType = 3;
             $(".poster-mode").addClass("poster-bg3");
@@ -495,6 +506,8 @@ function handleComplete(evt, comp) {
             exportRoot.blackboard.material1.removeAllEventListeners();
             exportRoot.blackboard.material2.removeAllEventListeners();
             exportRoot.blackboard.material3.removeAllEventListeners();
+			exportRoot.ball2.alpha = 1;
+            ballAnim(exportRoot.ball2);
             chooseType = 2;
             $(".poster-mode").addClass("poster-bg2");
             materialAnim(exportRoot.blackboard.material2, 120, 180, function() {
@@ -508,6 +521,9 @@ function handleComplete(evt, comp) {
             exportRoot.blackboard.material1.removeAllEventListeners();
             exportRoot.blackboard.material2.removeAllEventListeners();
             exportRoot.blackboard.material3.removeAllEventListeners();
+			console.log(exportRoot.ball3)
+			exportRoot.ball3.alpha = 1;
+            ballAnim(exportRoot.ball3);
             chooseType = 1;
             $(".poster-mode").addClass("poster-bg1");
             materialAnim(exportRoot.blackboard.material3, -30, 180, function() {
@@ -704,7 +720,6 @@ function getInfo() {
 // 获取登陆信息
 function getMsg(){
     if(URLParams['uid'] || localStorage.userId){
-        
 		if(localStorage.userId) {
 			window.user_info.uid = localStorage.userId;
 			window.user_info.logo = localStorage.userPic;
@@ -813,7 +828,12 @@ function saveText() {
                     $('.user-info p').html(msg.data.nickName);
                     $('#nameInput').val(msg.data.receiver);
                     $('#textInput').val(msg.data.message);
-                    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){

+ 7 - 9
minigame/WebContent/lottery.html

@@ -10,7 +10,7 @@
     <link rel="stylesheet" href="css/lottery.css" type="text/css" />
     <script type="text/javascript">
     	//从localstorage中取得ID
-    	var id = localStorage.getItem("userId");
+    	var id = localStorage.userId;
         var current = 0;
         var last = 0;
         var threshold = 0;
@@ -27,13 +27,11 @@
             localStorage.setItem("userId", id);
             //在这里查看是否有id
             if(id == null){
-            	alert("请先登录");
-            	window.location.href = "index.html";
+            	window.location.href = "http://wx.ttkuaiban.com/minigame";
             }
             
-            
             //获取
-            $.post("../prize/luckDrawList", {}, function(resp) {
+            $.post("./prize/luckDrawList", {}, function(resp) {
 				if (resp.code == 'error') {
 					console.log(resp.code);
 				}else{
@@ -52,7 +50,7 @@
             $(".button").click(function () {
                 if(enable == true){
 					//获取抽奖结果
-                    $.post("../prize/luckDraw", {userId: id}, function(resp) {
+                    $.post("./prize/luckDraw", {userId: id}, function(resp) {
         				if (resp.code == 'error') {
         					alert(resp.msg);
         				}else{
@@ -104,7 +102,7 @@
                 if(name == "" || phone == ""){
                 	alert("请填写完整信息");
                 }else{
-                	$.post("../prize/luckDrawAddInfo", {
+                	$.post("./prize/luckDrawAddInfo", {
                 		id: id,
                 		phone: phone,
                 		username: name
@@ -185,7 +183,7 @@
         document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
     		//发送给好友
     		WeixinJSBridge.on('menu:share:appmessage', function(argv){
-    			$.post("../prize/luckDrawAddShare", {uid: id}, function(resp) {
+    			$.post("./prize/luckDrawAddShare", {uid: id}, function(resp) {
     				if (resp.code == 'error') {
     					console.log(resp.code);
     				}else{
@@ -195,7 +193,7 @@
     		});
     		//分享到朋友圈
     		WeixinJSBridge.on('menu:share:timeline', function(argv){
-    			$.post("../prize/luckDrawAddShare", {uid: id}, function(resp) {
+    			$.post("./prize/luckDrawAddShare", {uid: id}, function(resp) {
     				if (resp.code == 'error') {
     					console.log(resp.code);
     				}else{

BIN
minigame/WebContent/sound/start/hsr.mp3


BIN
minigame/WebContent/sound/start/qcdf.mp3


BIN
minigame/WebContent/sound/start/swy.mp3


BIN
minigame/WebContent/sound/start/ymc.mp3