Commit dccf7f43 authored by huangwenjie's avatar huangwenjie

屈臣氏刮刮卡

parent dc05c071
...@@ -44,10 +44,7 @@ ...@@ -44,10 +44,7 @@
</head> </head>
<body> <body>
<audio style="display:none;
height: 0" id="bg0-music" preload="auto"
src="https://yun.duiba.com.cn/db_games/activity/dwslz_wn/bg0Music.mp3" loop="loop">
</audio>
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main" <div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main"
data-orientation="auto" data-scale-mode="fixedWidth" data-frame-rate="60" data-content-width="750" data-orientation="auto" data-scale-mode="fixedWidth" data-frame-rate="60" data-content-width="750"
data-content-height="1624" data-multi-fingered="2" data-show-fps="false" data-show-log="false" data-content-height="1624" data-multi-fingered="2" data-show-fps="false" data-show-log="false"
...@@ -143,54 +140,6 @@ ...@@ -143,54 +140,6 @@
shareIosLinkActivity: '' shareIosLinkActivity: ''
}; };
</script> </script>
<script>
//音乐自动播放
$(document).ready(function () {
autoPlayMusic();
audioAutoPlay();
});
function audioAutoPlay() {
var audio = null;
console.log('bg0mus')
audio = document.getElementById('bg0-music');
audio.play();
document.addEventListener("WeixinJSBridgeReady", function () {
audio.play();
}, false);
}
// 音乐播放
function autoPlayMusic() {
// 自动播放音乐效果,解决浏览器或者APP自动播放问题
function musicInBrowserHandler() {
musicPlay(true);
document.body.removeEventListener('touchstart', musicInBrowserHandler);
}
document.body.addEventListener('touchstart', musicInBrowserHandler);
// 自动播放音乐效果,解决微信自动播放问题
function musicInWeixinHandler() {
musicPlay(true);
document.addEventListener("WeixinJSBridgeReady", function () {
musicPlay(true);
}, false);
document.removeEventListener('DOMContentLoaded', musicInWeixinHandler);
}
document.addEventListener('DOMContentLoaded', musicInWeixinHandler);
}
function playBg0Music(isPlay) {
var media = document.querySelector('#bg0-music');
if (isPlay && media.paused) {
media.play();
}
if (!isPlay && !media.paused) {
media.pause();
}
}
</script>
<script src="output.js"></script> <script src="output.js"></script>
</body> </body>
......
egret/resource/assets/pops/sureBtn.png

26.2 KB | W: | H:

egret/resource/assets/pops/sureBtn.png

43.1 KB | W: | H:

egret/resource/assets/pops/sureBtn.png
egret/resource/assets/pops/sureBtn.png
egret/resource/assets/pops/sureBtn.png
egret/resource/assets/pops/sureBtn.png
  • 2-up
  • Swipe
  • Onion skin
egret/resource/assets/pops/useBtn.png

10.5 KB | W: | H:

egret/resource/assets/pops/useBtn.png

43.3 KB | W: | H:

egret/resource/assets/pops/useBtn.png
egret/resource/assets/pops/useBtn.png
egret/resource/assets/pops/useBtn.png
egret/resource/assets/pops/useBtn.png
  • 2-up
  • Swipe
  • Onion skin
{ {
"groups": [ "groups": [
{ {
"keys": "progress_png,bg_png,sureBtn_png,ruleTitle_png,restartBtn_png,prizePanelBg_png,noPrizeTitle_png,msgSureBtn_png,msgBg_png,loginBtn_png,knowBtn_png,closeBtn_png,noPrizePanelBg_png,ruleBg_png,restartBtn3_png,restartBtn2_png,warningtitle_png,useBtn_png", "keys": "progress_png,bg_png,sureBtn_png,prizePanelBg_png,msgSureBtn_png,closeBtn_png,noPrizePanelBg_png,useBtn_png",
"name": "Preload" "name": "Preload"
}, },
{ {
"keys": "finger_png", "keys": "title_png,startBtnBg_png,startBtn_png,startBg_jpg,star_png,smallSnow_png,prizeMinTitle_png,plate_png,emptyStar_png,snow_png,startBtn_d_png",
"name": "Guide" "name": "Main"
},
{
"keys": "recordBtn_png,ruleBtn_png,startBg_jpg,startBtn_png,hand_png,giveStar_png,star_png,smallSnow_png,sled_png,title_png",
"name": "Start"
},
{
"keys": "playBg_jpg,bell_png,giftBox_png,hole_png,stone_png,socks_png,snowBall_png,scoreBg_png",
"name": "Play"
},
{
"keys": "ready_mp3,impact_stone_mp3,impact_snow_mp3,gameSuc_mp3,gameFail_mp3,fall_mp3,collect_mp3,bgMusic_mp3",
"name": "Music"
}, },
{ {
"name": "preload", "name": "preload",
"keys": "musicOn_png,musicOff_png,guideDir_png,step1Tips_png,step2Tips_png,step3Tips_png" "keys": "startDrawBg_png"
} }
], ],
"resources": [ "resources": [
...@@ -36,26 +24,6 @@ ...@@ -36,26 +24,6 @@
"type": "image", "type": "image",
"name": "progress_png" "name": "progress_png"
}, },
{
"url": "assets/guide/finger.png",
"type": "image",
"name": "finger_png"
},
{
"url": "assets/pops/knowBtn.png",
"type": "image",
"name": "knowBtn_png"
},
{
"url": "assets/pops/loginBtn.png",
"type": "image",
"name": "loginBtn_png"
},
{
"url": "assets/pops/msgBg.png",
"type": "image",
"name": "msgBg_png"
},
{ {
"url": "assets/pops/msgSureBtn.png", "url": "assets/pops/msgSureBtn.png",
"type": "image", "type": "image",
...@@ -66,220 +34,90 @@ ...@@ -66,220 +34,90 @@
"type": "image", "type": "image",
"name": "prizePanelBg_png" "name": "prizePanelBg_png"
}, },
{
"url": "assets/pops/restartBtn.png",
"type": "image",
"name": "restartBtn_png"
},
{ {
"url": "assets/pops/sureBtn.png", "url": "assets/pops/sureBtn.png",
"type": "image", "type": "image",
"name": "sureBtn_png" "name": "sureBtn_png"
}, },
{ {
"url": "assets/play/playBg.jpg", "url": "assets/pops/noPrizePanelBg.png",
"type": "image",
"name": "playBg_jpg"
},
{
"url": "assets/start/recordBtn.png",
"type": "image",
"name": "recordBtn_png"
},
{
"url": "assets/start/startBg.jpg",
"type": "image",
"name": "startBg_jpg"
},
{
"url": "assets/start/startBtn.png",
"type": "image",
"name": "startBtn_png"
},
{
"url": "assets/start/ruleBtn.png",
"type": "image",
"name": "ruleBtn_png"
},
{
"url": "assets/pops/noPrizeTitle.png",
"type": "image",
"name": "noPrizeTitle_png"
},
{
"url": "assets/pops/ruleTitle.png",
"type": "image",
"name": "ruleTitle_png"
},
{
"url": "assets/play/bell.png",
"type": "image",
"name": "bell_png"
},
{
"url": "assets/play/giftBox.png",
"type": "image",
"name": "giftBox_png"
},
{
"url": "assets/play/hole.png",
"type": "image",
"name": "hole_png"
},
{
"url": "assets/play/scoreBg.png",
"type": "image", "type": "image",
"name": "scoreBg_png" "name": "noPrizePanelBg_png"
}, },
{ {
"url": "assets/play/snowBall.png", "url": "assets/pops/useBtn.png",
"type": "image", "type": "image",
"name": "snowBall_png" "name": "useBtn_png"
}, },
{ {
"url": "assets/play/socks.png", "url": "assets/common/closeBtn.png",
"type": "image", "type": "image",
"name": "socks_png" "name": "closeBtn_png"
}, },
{ {
"url": "assets/play/stone.png", "url": "assets/main/emptyStar.png",
"type": "image", "type": "image",
"name": "stone_png" "name": "emptyStar_png"
}, },
{ {
"url": "assets/start/sled.png", "url": "assets/main/plate.png",
"type": "image", "type": "image",
"name": "sled_png" "name": "plate_png"
}, },
{ {
"url": "assets/start/title.png", "url": "assets/main/prizeMinTitle.png",
"type": "image", "type": "image",
"name": "title_png" "name": "prizeMinTitle_png"
}, },
{ {
"url": "assets/start/smallSnow.png", "url": "assets/main/smallSnow.png",
"type": "image", "type": "image",
"name": "smallSnow_png" "name": "smallSnow_png"
}, },
{ {
"url": "assets/start/star.png", "url": "assets/main/star.png",
"type": "image", "type": "image",
"name": "star_png" "name": "star_png"
}, },
{ {
"url": "assets/start/giveStar.png", "url": "assets/main/startBg.jpg",
"type": "image",
"name": "giveStar_png"
},
{
"url": "assets/start/hand.png",
"type": "image",
"name": "hand_png"
},
{
"url": "assets/pops/noPrizePanelBg.png",
"type": "image", "type": "image",
"name": "noPrizePanelBg_png" "name": "startBg_jpg"
},
{
"url": "assets/pops/restartBtn2.png",
"type": "image",
"name": "restartBtn2_png"
},
{
"url": "assets/pops/restartBtn3.png",
"type": "image",
"name": "restartBtn3_png"
},
{
"url": "assets/pops/ruleBg.png",
"type": "image",
"name": "ruleBg_png"
},
{
"url": "assets/pops/useBtn.png",
"type": "image",
"name": "useBtn_png"
},
{
"url": "assets/pops/warningtitle.png",
"type": "image",
"name": "warningtitle_png"
}, },
{ {
"url": "assets/common/closeBtn.png", "url": "assets/main/startBtn.png",
"type": "image", "type": "image",
"name": "closeBtn_png" "name": "startBtn_png"
},
{
"url": "assets/music/bgMusic.mp3",
"type": "sound",
"name": "bgMusic_mp3"
},
{
"url": "assets/music/fall.mp3",
"type": "sound",
"name": "fall_mp3"
},
{
"url": "assets/music/collect.mp3",
"type": "sound",
"name": "collect_mp3"
},
{
"url": "assets/music/gameSuc.mp3",
"type": "sound",
"name": "gameSuc_mp3"
},
{
"url": "assets/music/gameFail.mp3",
"type": "sound",
"name": "gameFail_mp3"
},
{
"url": "assets/music/ready.mp3",
"type": "sound",
"name": "ready_mp3"
},
{
"url": "assets/music/impact_snow.mp3",
"type": "sound",
"name": "impact_snow_mp3"
},
{
"url": "assets/music/impact_stone.mp3",
"type": "sound",
"name": "impact_stone_mp3"
}, },
{ {
"name": "musicOn_png", "url": "assets/main/startBtnBg.png",
"type": "image", "type": "image",
"url": "assets/common/musicOn.png" "name": "startBtnBg_png"
}, },
{ {
"name": "musicOff_png", "url": "assets/main/title.png",
"type": "image", "type": "image",
"url": "assets/common/musicOff.png" "name": "title_png"
}, },
{ {
"name": "guideDir_png", "url": "assets/main/snow.png",
"type": "image", "type": "image",
"url": "assets/guide/guideDir.png" "name": "snow_png"
}, },
{ {
"name": "step1Tips_png", "url": "assets/main/logo.png",
"type": "image", "type": "image",
"url": "assets/guide/step1Tips.png" "name": "logo_png"
}, },
{ {
"name": "step2Tips_png", "url": "assets/main/startBtn_d.png",
"type": "image", "type": "image",
"url": "assets/guide/step2Tips.png" "name": "startBtn_d_png"
}, },
{ {
"name": "step3Tips_png", "name": "startDrawBg_png",
"type": "image", "type": "image",
"url": "assets/guide/step3Tips.png" "url": "assets/main/startDrawBg.png"
} }
] ]
} }
\ No newline at end of file
...@@ -3,16 +3,9 @@ ...@@ -3,16 +3,9 @@
"autoGenerateExmlsList": true, "autoGenerateExmlsList": true,
"exmls": [ "exmls": [
"resource/skins/ToastSkin.exml", "resource/skins/ToastSkin.exml",
"resource/skins/BallonSkin.exml", "resource/skins/PrizeItemSkin.exml",
"resource/skins/GetCreditsSkin.exml",
"resource/skins/LoginSkin.exml",
"resource/skins/MsgSkin.exml", "resource/skins/MsgSkin.exml",
"resource/skins/WarningSkin.exml", "resource/skins/MainSkin.exml",
"resource/skins/ReadySkin.exml",
"resource/skins/RuleSkin.exml",
"resource/skins/StartSkin.exml",
"resource/skins/PlaySkin.exml",
"resource/skins/GameFailSkin.exml",
"resource/skins/NoPrizeSkin.exml", "resource/skins/NoPrizeSkin.exml",
"resource/skins/PrizeSkin.exml", "resource/skins/PrizeSkin.exml",
"resource/skins/VScrollBarSkin.exml", "resource/skins/VScrollBarSkin.exml",
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="BallonSkin" width="343" height="393" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="ballon" source="ballon_y_png" x="0" y="0"/>
<e:Image id="suitEmoji" source="suitEmoji_y_png" x="50.5" y="57" alpha="0"/>
<e:Image id="smallEmoji" source="smallEmoji_y_png" x="10.5" y="85" anchorOffsetX="0" width="306.03" anchorOffsetY="0" height="169" alpha="0"/>
<e:Image id="bigEmoji" source="bigEmoji_y_png" x="19" y="48" alpha="0"/>
<e:Image id="explodeMark" source="explodeMark_y_png" x="133.5" y="-66.5" alpha="0"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="MsgSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16680af117d"/>
<e:Group width="750" height="800" horizontalCenter="0" verticalCenter="0">
<e:Image id="bg" source="msgBg_png" horizontalCenter="0" y="129" x="0" scaleX="1" scaleY="1"/>
<e:Button id="closeBtn" label="" x="584" y="144.89">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeBtn_png" source.down="closeBtn_png" source.disabled="closeBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="againBtn" label="" y="558.2" scaleX="1" scaleY="1" horizontalCenter="0" width="212" anchorOffsetX="106" height="89" anchorOffsetY="44.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="restartBtn3_png" source.down="restartBtn3_png" source.disabled="restartBtn3_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="msgTitle" touchEnabled="false" size="45" width="403.85" anchorOffsetY="0" height="100" textAlign="center" bold="true" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="网络异常" horizontalCenter="0" y="262.2" x="173" scaleX="1" scaleY="1" textColor="0x000000" visible="false"/>
<e:Label id="msgTxt" touchEnabled="false" size="30" width="556.85" anchorOffsetY="0" height="190.91" textAlign="center" anchorOffsetX="0" verticalAlign="middle" y="345.05" fontFamily="Microsoft YaHei" scaleX="1" scaleY="1" horizontalCenter="0.5" textColor="0x000000" text="哎呀,一不小心被砸晕了~"/>
<e:Image y="300" horizontalCenter="0" source="noPrizeTitle_png"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Group width="750" height="800" horizontalCenter="0" verticalCenter="0">
<e:Image id="bg" source="msgBg_png" horizontalCenter="0" y="93" x="0" scaleX="1" scaleY="1"/>
<e:Button id="closeBtn" label="" x="584" y="108.89">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeBtn_png" source.down="closeBtn_png" source.disabled="closeBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="earnBtn" label="" anchorOffsetX="171.5" anchorOffsetY="43.5" horizontalCenter="0.5" y="536.7" x="135" scaleX="1" scaleY="1" width="343" height="87">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="msgSureBtn_png" source.down="msgSureBtn_png" source.disabled="msgSureBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="msgTitle" touchEnabled="false" size="50" width="403.85" anchorOffsetY="0" height="100" textAlign="center" bold="true" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="积分不足" horizontalCenter="0" y="228.2" x="173" scaleX="1" scaleY="1" textColor="0x000000" visible="false"/>
<e:Label id="tips" touchEnabled="false" size="36" width="556.85" anchorOffsetY="0" height="190.91" textAlign="center" anchorOffsetX="0" verticalAlign="middle" y="309.05" fontFamily="Microsoft YaHei" scaleX="1" scaleY="1" horizontalCenter="0.5" text="抱歉,您当前的积分不足" textColor="0x000000"/>
<e:Image source="noPrizeTitle_png" y="256" horizontalCenter="0"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="MsgSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16680af117d"/>
<e:Group width="750" height="800" horizontalCenter="0" verticalCenter="0">
<e:Image id="bg" source="msgBg_png" horizontalCenter="-2" y="135" x="0" scaleX="1" scaleY="1"/>
<e:Button id="closeBtn" label="" x="576.85" y="141">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeBtn_png" source.down="closeBtn_png" source.disabled="closeBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="loginBtn" label="" anchorOffsetX="171.5" anchorOffsetY="43.5" horizontalCenter="0.5" y="587.7" x="135" scaleX="1" scaleY="1" width="343" height="87">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="loginBtn_png" source.down="loginBtn_png" source.disabled="loginBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="msgTitle" touchEnabled="false" size="50" width="403.85" anchorOffsetY="0" height="100" textAlign="center" bold="true" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="未登录" horizontalCenter="0" y="268.2" x="173" scaleX="1" scaleY="1" textColor="0x000000"/>
<e:Label id="msgTxt" touchEnabled="false" size="36" width="556.85" anchorOffsetY="0" height="190.91" textAlign="center" anchorOffsetX="0" verticalAlign="middle" y="349.05" fontFamily="Microsoft YaHei" scaleX="1" scaleY="1" horizontalCenter="0.5" text="抱歉,请先登录" textColor="0x000000"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="bg" source="startBg_jpg" x="0" y="0"/>
<e:Image id="prizeMinTitle" source="prizeMinTitle_png" y="911" horizontalCenter="0.5"/>
<e:Image id="title" source="title_png" y="76" horizontalCenter="0"/>
<e:Image id="logo" source="logo_png" x="44" y="72"/>
<e:Image id="plate" source="plate_png" y="1108" horizontalCenter="0"/>
<e:Image source="snow_png" x="596" y="194.5"/>
<e:Image source="snow_png" x="-35.51" y="387" anchorOffsetX="0" width="120.33" anchorOffsetY="0" height="106"/>
<e:Image source="star_png" x="612" y="-8"/>
<e:Image source="emptyStar_png" x="110" y="188"/>
<e:Image source="star_png" x="82" y="812.5" anchorOffsetX="0" width="80" anchorOffsetY="0" height="165.88"/>
<e:Group id="winnerList" width="750" height="50" x="0" y="0" scaleX="1" scaleY="1">
<e:Rect width="750" height="50" x="0" y="0" anchorOffsetX="0" anchorOffsetY="0" fillAlpha="0.6" scaleX="1" scaleY="1"/>
<e:Group id="msgList" width="700" height="34" anchorOffsetX="0" anchorOffsetY="0" y="8" x="25"/>
<e:Rect id="msgListMask" width="700" height="34" y="8" x="25"/>
</e:Group>
<e:Scroller id="prizeList" width="660" height="183.67" y="997" anchorOffsetX="0" anchorOffsetY="0" scrollPolicyV="off" bounces="false" horizontalCenter="0">
<e:Group id="prizeListGroup" anchorOffsetY="0" height="190.67" x="0" y="11"/>
</e:Scroller>
<e:Group id="main" width="750" height="512" y="396" anchorOffsetY="0" horizontalCenter="0">
<e:Image id="startBtnBg" source="startBtnBg_png" y="13" horizontalCenter="0" x="70" scaleX="1" scaleY="1"/>
<e:Label id="costTxt" text="剩余抽奖次数:100" x="264" y="355.66" anchorOffsetX="0" width="222.67" anchorOffsetY="0" height="34.66" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="22" textColor="0xf9e3b5"/>
<e:Image id="startDrawBg" source="startDrawBg_png" x="125" y="178" visible="false"/>
<e:Group id="thanks" width="492" height="259" x="128" y="182" anchorOffsetX="0" anchorOffsetY="0" visible="false">
<e:Rect id="thanksBg" width="494" height="258" x="-0.3400000000000034" y="-0.3300000000000409" anchorOffsetX="0" anchorOffsetY="0" ellipseWidth="30" ellipseHeight="30" fillColor="0x422f00" fillAlpha="0.3" scaleX="1" scaleY="1"/>
<e:Label text="谢谢参与" x="5.680000000000007" y="6.789999999999964" anchorOffsetX="0" width="482.67" anchorOffsetY="0" height="243.33" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="92" scaleX="1" scaleY="1" textColor="0xf4decb"/>
</e:Group>
<e:Image id="prizeImg" width="494" height="258" x="127.66" y="180.67" visible="false"/>
</e:Group>
<e:Button id="startBtn" label="" y="670.5" skinName="ui.IconButtonSkin" icon="startBtn_png" width="452" anchorOffsetX="226" height="113" anchorOffsetY="56.5" touchEnabled="true" touchChildren="true" horizontalCenter="0"/>
</e:Skin>
\ No newline at end of file
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<e:Group width="750" height="800" horizontalCenter="0" verticalCenter="0"> <e:Group width="750" height="1000" horizontalCenter="0" verticalCenter="0">
<e:Image id="bg" source="msgBg_png" horizontalCenter="0" y="129" x="0" scaleX="1" scaleY="1"/> <e:Image id="bg" horizontalCenter="0" y="279" x="0" scaleX="1" scaleY="1" source="noPrizePanelBg_png"/>
<e:Button id="closeBtn0" label="" x="584" y="144.89"> <e:Button id="closeBtn" label="" x="651" y="183">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeBtn_png" source.down="closeBtn_png" source.disabled="closeBtn_png"/> <e:Image width="100%" height="100%" source="closeBtn_png" source.down="closeBtn_png" source.disabled="closeBtn_png"/>
...@@ -16,17 +16,18 @@ ...@@ -16,17 +16,18 @@
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Button id="sureBtn" label="" anchorOffsetX="171.5" anchorOffsetY="43.5" horizontalCenter="0.5" y="572.7" x="135" scaleX="1" scaleY="1" width="343" height="87"> <e:Button id="sureBtn" label="" anchorOffsetX="171.5" anchorOffsetY="43.5" horizontalCenter="0.5" y="672.7" x="135" scaleX="1" scaleY="1" width="343" height="87">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="msgSureBtn_png" source.down="msgSureBtn_png" source.disabled="msgSureBtn_png"/> <e:Image width="100%" height="100%" source="sureBtn_png" source.down="sureBtn_png" source.disabled="sureBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/> <e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Label id="msgTitle" touchEnabled="false" size="45" width="403.85" anchorOffsetY="0" height="100" textAlign="center" bold="true" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="网络异常" horizontalCenter="0" y="262.2" x="173" scaleX="1" scaleY="1" textColor="0x000000" visible="false"/> <e:Label id="msgTitle" touchEnabled="false" size="26" width="403.85" anchorOffsetY="0" height="34" textAlign="center" bold="true" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="网络异常" horizontalCenter="0" y="496.2" x="173" scaleX="1" scaleY="1" textColor="0xf4ce92"/>
<e:Label id="msgTxt" touchEnabled="false" text="{data.message}" size="30" width="556.85" anchorOffsetY="0" height="190.91" textAlign="center" bold="true" anchorOffsetX="0" verticalAlign="middle" y="345.05" fontFamily="Microsoft YaHei" scaleX="1" scaleY="1" horizontalCenter="0.5" textColor="0x000000"/> <e:Label id="msgTxt" touchEnabled="false" text="{data.message}" size="20" width="401.85" anchorOffsetY="0" height="72.91" textAlign="center" anchorOffsetX="0" verticalAlign="middle" y="520.05" fontFamily="Microsoft YaHei" scaleX="1" scaleY="1" horizontalCenter="1" textColor="0xf4ce92"/>
<e:Image source="warningtitle_png" y="300" horizontalCenter="0"/>
</e:Group> </e:Group>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="NoPrizeSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="NoPrizeSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="168f00841d7" scale9Grid="75,56,450,340" anchorOffsetY="0" height="500.48"/> <w:Config id="168f00841d7" scale9Grid="75,56,450,340" anchorOffsetY="0" height="500.48"/>
<e:Group width="750" height="1000" horizontalCenter="0" verticalCenter="-100"> <e:Group width="750" height="1000" x="0" y="212">
<e:Image id="bg" y="39" horizontalCenter="0" x="0" scaleX="1" scaleY="1" source="noPrizePanelBg_png"/> <e:Image id="bg" y="241" horizontalCenter="0" x="0" scaleX="1" scaleY="1" source="noPrizePanelBg_png"/>
<e:Button id="againBtn" label="" skinName="ui.IconButtonSkin" icon="sureBtn_png" y="632" anchorOffsetX="215" height="87" anchorOffsetY="43.5" scaleX="1" scaleY="1" x="375" width="430"/>
<e:Button id="closeBtn" label="Button" skinName="ui.IconButtonSkin" icon="closeBtn_png" width="49" height="49" horizontalCenter="300.5" anchorOffsetX="24.5" anchorOffsetY="24.5" y="183" x="651" scaleX="1" scaleY="1"/>
<e:Label text="很遗憾\n您与奖品擦肩而过~" y="455" anchorOffsetX="0" width="268" anchorOffsetY="0" height="78" horizontalCenter="0" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" textColor="0xf4ce92" lineSpacing="15"/>
<e:Button id="againBtn" label="" skinName="ui.IconButtonSkin" icon="restartBtn2_png" y="632" anchorOffsetX="215" height="87" anchorOffsetY="43.5" scaleX="1" scaleY="1" x="375" width="430"/>
<e:Button id="closeBtn" label="Button" skinName="ui.IconButtonSkin" icon="closeBtn_png" width="49" height="49" horizontalCenter="300.5" anchorOffsetX="24.5" anchorOffsetY="24.5" y="119" x="651" scaleX="1" scaleY="1"/>
<e:Label id="scoreTxt" text="0" x="124" y="478.02" anchorOffsetX="0" width="250" anchorOffsetY="0" height="50" textColor="0x000000" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="25"/>
<e:Label id="maxScoreTxt" text="0" x="380" y="478.02" anchorOffsetX="0" width="250" anchorOffsetY="0" height="50" textColor="0x000000" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="25"/>
<e:Label text="本次得分" x="124" y="438.68" anchorOffsetX="0" width="250" anchorOffsetY="0" height="50" textColor="0x000000" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="25"/>
<e:Label text="最高记录" x="380" y="438.68" anchorOffsetX="0" width="250" anchorOffsetY="0" height="50" textColor="0x000000" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="25"/>
</e:Group> </e:Group>
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Group id="gameLayer" width="750" height="1624" x="0" y="0">
<e:Group id="user" width="120" height="150" x="374" anchorOffsetX="60" anchorOffsetY="75" y="1102"/>
</e:Group>
<e:Group id="topLayer" width="750" height="1624" x="0" y="0" touchEnabled="false" touchThrough="true">
<e:Image source="scoreBg_png" y="0" horizontalCenter="0" scale9Grid="16,5,251,11" height="200" x="232" scaleX="1" scaleY="1"/>
<e:Label id="scoreTxt" text="0" y="140" fontFamily="Microsoft YaHei" anchorOffsetX="0" width="281.67" anchorOffsetY="0" height="48" verticalAlign="middle" textAlign="center" horizontalCenter="0" size="40" x="234" scaleX="1" scaleY="1"/>
<e:Label id="countDownTxt" text="时间:30S" y="83" anchorOffsetX="0" width="230" anchorOffsetY="0" height="42" verticalAlign="middle" textAlign="center" fontFamily="Microsoft YaHei" horizontalCenter="0" x="260" scaleX="1" scaleY="1"/>
</e:Group>
<e:Image source="musicOn_png" anchorOffsetX="34.5" anchorOffsetY="34.5" height="69" width="69" id="musicOn" scaleX="1" scaleY="1" x="685.5" y="64.5"/>
<e:Image source="musicOff_png" id="musicOff" width="69" height="69" anchorOffsetY="34.5" anchorOffsetX="34.5" scaleX="1" scaleY="1" x="685.5" y="64.5" visible="false"/>
<e:Group id="guideLayer" width="750" height="1624" x="0" y="0" visible="false">
<e:Group id="step1" width="750" height="1624" x="0" y="0" scaleX="1" scaleY="1"/>
<e:Group width="750" height="1624" x="0" y="0" id="step2" scaleX="1" scaleY="1" visible="false"/>
<e:Group width="750" height="1624" x="0" y="0" id="step3" scaleX="1" scaleY="1" visible="false"/>
<e:Group width="750" height="1624" x="0" y="0" id="step4" scaleX="1" scaleY="1" visible="false"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="PrizeItemSkin" width="230" height="160" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="prizeImg" width="152" height="109" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0" top="0"/>
<e:Label id="prizeName" text="Label" anchorOffsetX="0" width="206" horizontalCenter="0" bottom="0" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" textColor="0xfbd89f" size="26"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="PrizeSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="PrizeSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Group width="750" height="1000" horizontalCenter="0" verticalCenter="-100"> <e:Group width="750" height="1000" horizontalCenter="0" verticalCenter="0">
<e:Image y="39" source="prizePanelBg_png" horizontalCenter="0" x="0" scaleX="1" scaleY="1"/> <e:Image y="-36.12" source="prizePanelBg_png" horizontalCenter="18.5" x="0" scaleX="1" scaleY="1"/>
<e:Label id="prizeName" y="590.54" width="508" textAlign="center" size="26" fontFamily="Microsoft YaHei" text="六字奖品文案" horizontalCenter="0" x="121" scaleX="1" scaleY="1" textColor="0xf4ce92"/>
<e:Button id="sureBtn" label="" skinName="ui.IconButtonSkin" icon="useBtn_png" y="716.88" width="343" anchorOffsetX="171.5" height="87" anchorOffsetY="43.5" scaleX="1" scaleY="1" horizontalCenter="0.5"/>
<e:Image id="prizeImg" width="240" height="240" horizontalCenter="0" y="339.54" scaleX="1" scaleY="1" x="119"/>
<e:Button id="closeBtn" label="Button" skinName="ui.IconButtonSkin" icon="closeBtn_png" width="49" height="49" horizontalCenter="300.5" anchorOffsetX="24.5" anchorOffsetY="24.5" y="107.88" x="651" scaleX="1" scaleY="1"/>
<e:Label id="prizeName" y="782" width="508" textAlign="center" size="30" fontFamily="Microsoft YaHei" text="六字奖品文案" textColor="0x661414" horizontalCenter="0" x="121" scaleX="1" scaleY="1"/>
<e:Button id="sureBtn" label="" skinName="ui.IconButtonSkin" icon="msgSureBtn_png" y="877" width="343" anchorOffsetX="171.5" height="87" anchorOffsetY="43.5" scaleX="1" scaleY="1" horizontalCenter="0.5"/>
<e:Image id="prizeImg" width="512" height="240" horizontalCenter="0" y="527" scaleX="1" scaleY="1" x="119"/>
<e:Button id="closeBtn" label="Button" skinName="ui.IconButtonSkin" icon="closeBtn_png" width="49" height="49" horizontalCenter="300.5" anchorOffsetX="24.5" anchorOffsetY="24.5" y="119" x="651" scaleX="1" scaleY="1"/>
<e:Label id="scoreTxt" text="0" x="124" y="476.68" anchorOffsetX="0" width="250" anchorOffsetY="0" height="50" textColor="0x000000" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="25"/>
<e:Label id="maxScoreTxt" text="0" x="380" y="476.68" anchorOffsetX="0" width="250" anchorOffsetY="0" height="50" textColor="0x000000" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="25"/>
<e:Label text="本次得分" x="124" y="438.68" anchorOffsetX="0" width="250" anchorOffsetY="0" height="50" textColor="0x000000" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="25"/>
<e:Label text="最高记录" x="380" y="438.68" anchorOffsetX="0" width="250" anchorOffsetY="0" height="50" textColor="0x000000" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="25"/>
</e:Group> </e:Group>
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="ReadySkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16ea119b721"/>
<e:Rect id="darkBg" width="750" height="1624" x="0" y="0" fillAlpha="0.7" fillColor="0x000000"/>
<e:Image id="num3" x="373.25" y="602.83" anchorOffsetX="164.3" anchorOffsetY="160.26" alpha="0" scaleX="2" scaleY="2" source="n3tips_png" rotation="360"/>
<e:Image id="num2" y="603.87" anchorOffsetX="156.55" anchorOffsetY="171.04" alpha="0" scaleX="2" scaleY="2" x="373.7" source="n2tips_png" rotation="360"/>
<e:Image id="num1" y="603.43" anchorOffsetX="160.25" anchorOffsetY="165.43" alpha="0" scaleX="2" scaleY="2" source="n1tips_png" x="373.95"/>
<e:Image id="ready" source="readyTips_png" y="604.06" x="372.2" alpha="0" anchorOffsetX="237.12" anchorOffsetY="170.45" scaleX="2" scaleY="2"/>
<e:Image id="go" y="602.9" alpha="0" scaleX="2" scaleY="2" source="goTips_png" anchorOffsetX="228.34" anchorOffsetY="178.06" x="374.32"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="RuleSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="168654fb707" x="-86" y="-98"/>
<e:Group width="750" height="1000" horizontalCenter="0" verticalCenter="-50">
<e:Image horizontalCenter="0" source="msgBg_png" anchorOffsetY="0" height="859" verticalCenter="-70.5" x="0" y="0" scaleX="1" scaleY="1" scale9Grid="60,380,284,95"/>
<e:Scroller id="scroller" width="469" height="482" y="234" anchorOffsetY="0" anchorOffsetX="0" horizontalCenter="0" x="122.00000000000001" scaleX="1" scaleY="1">
<e:Group id="group" width="100%" anchorOffsetY="0" x="0" y="-252" height="479">
<e:Rect width="100%" height="10" x="206" y="59" fillAlpha="0"/>
<e:Label id="labContent" width="100%" text="" lineSpacing="10" size="30" multiline="true" anchorOffsetY="-8" fontFamily="Microsoft YaHei" textColor="0x000000"/>
<e:layout>
<e:VerticalLayout/>
</e:layout>
</e:Group>
</e:Scroller>
<e:Button id="closeBtn" label="" icon="knowBtn_png" y="779.58" skinName="ui.IconButtonSkin" width="343" anchorOffsetX="171.5" height="87" anchorOffsetY="43.5" horizontalCenter="0" x="203.99999999999997" scaleX="1" scaleY="1"/>
<e:Image source="ruleTitle_png" y="164" horizontalCenter="0" x="270" scaleX="1" scaleY="1"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Group id="main" width="750" height="1206" horizontalCenter="0" verticalCenter="0">
<e:Image id="bg" source="startBg_jpg" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0"/>
<e:Group id="sled" width="800" height="933" x="65" y="60" anchorOffsetX="0" anchorOffsetY="0" visible="false">
<e:Group id="hand" width="205.36" height="89" x="350.67" y="458.24" anchorOffsetX="166.67" anchorOffsetY="24.24" rotation="-45">
<e:Image source="hand_png" x="31" anchorOffsetX="0" anchorOffsetY="0" y="0" scaleX="1" scaleY="1"/>
<e:Image source="giveStar_png" x="-14.63" y="-8.55"/>
</e:Group>
<e:Image source="sled_png" x="0" y="0"/>
</e:Group>
<e:Button id="recordBtn" label="" skinName="ui.IconButtonSkin" icon="recordBtn_png" anchorOffsetY="26.5" anchorOffsetX="62" left="0" top="90" width="124" height="53" x="0" y="90" scaleX="1" scaleY="1"/>
<e:Button id="ruleBtn" label="" skinName="ui.IconButtonSkin" icon="ruleBtn_png" height="53" anchorOffsetY="26.5" anchorOffsetX="62" top="30" left="0" width="124" x="0" y="29.999999999999996" scaleX="1" scaleY="1"/>
<e:Label id="costTxt" text="10积分/次" y="1117.39" anchorOffsetX="0" width="313" anchorOffsetY="0" height="44.5" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" textColor="0x393f71" scaleX="1" scaleY="1" size="26" horizontalCenter="0"/>
<e:Label id="creditsTxt" text="剩余积分:10" y="1085.6" anchorOffsetX="0" width="301" size="26" fontFamily="Microsoft YaHei" horizontalCenter="1.5" anchorOffsetY="0" height="36" textAlign="center" verticalAlign="middle" x="226" scaleX="1" scaleY="1" textColor="0x393f71"/>
<e:Group id="title" width="556" height="300" top="56" horizontalCenter="0" anchorOffsetX="278" anchorOffsetY="150" scaleX="0">
<e:Image source="title_png" y="0" x="0" scaleX="1" scaleY="1"/>
<e:Image id="star0" source="star_png" x="47.96" y="218.24" anchorOffsetX="30.8" anchorOffsetY="0" scaleX="0.8" scaleY="0.8"/>
<e:Image id="star1" source="star_png" x="145.16" y="219.04" anchorOffsetX="30.8" anchorOffsetY="0"/>
<e:Image id="star2" source="star_png" x="407.15" y="221.05" anchorOffsetX="30.8" anchorOffsetY="0" scaleX="0.6" scaleY="0.6"/>
<e:Image id="star3" source="star_png" x="509.8" y="219.99" anchorOffsetX="30.8" anchorOffsetY="0" scaleX="0.5" scaleY="0.5"/>
</e:Group>
<e:Group id="startBtn" width="352" height="98" y="1015" anchorOffsetX="176" anchorOffsetY="49" horizontalCenter="0">
</e:Group>
<e:Image id="musicOn" source="musicOn_png" anchorOffsetX="34.5" anchorOffsetY="34.5" height="69" width="69" x="685.5" y="64.5"/>
<e:Image id="musicOff" source="musicOff_png" width="69" height="69" anchorOffsetY="34.5" anchorOffsetX="34.5" x="685.5" y="64.5" visible="false"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="ToastSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="ToastSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Rect id="bg" width="500" height="60" horizontalCenter="-1" verticalCenter="0" fillAlpha="0.7" ellipseHeight="100" ellipseWidth="100"/> <e:Rect id="bg" width="500" height="100" horizontalCenter="-1" verticalCenter="0" fillAlpha="0.7" ellipseHeight="100" ellipseWidth="100"/>
<e:Label id="msgTxt" text="网络出现问题请稍后再试~" horizontalCenter="0" verticalCenter="0" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="30" textColor="0xffffff"/> <e:Label id="msgTxt" text="网络出现问题请稍后再试~" horizontalCenter="0" verticalCenter="-2.5" textAlign="center" verticalAlign="middle" fontFamily="Microsoft YaHei" size="26" textColor="0xffffff" anchorOffsetY="0" height="105" anchorOffsetX="0" width="458" lineSpacing="10"/>
</e:Skin> </e:Skin>
\ No newline at end of file
import GetCreditsPanel from './pops/getCredits/GetCreditsPanel';
import { LoginPanel } from './pops/login/LoginPanel';
import { DataManager } from './../libs/tw/manager/DataManager'; import { DataManager } from './../libs/tw/manager/DataManager';
import { ResGroupNameArr } from './consts/ResConst'; import { ResGroupNameArr } from './consts/ResConst';
import { NetPromise } from './promises/NetPromise'; import { NetPromise } from './promises/NetPromise';
...@@ -16,12 +15,9 @@ import GameConst from './consts/GameConst'; ...@@ -16,12 +15,9 @@ import GameConst from './consts/GameConst';
import Waiting from './waiting/Waiting'; import Waiting from './waiting/Waiting';
import SVGACtrl from './ctrls/svgaCtrl'; import SVGACtrl from './ctrls/svgaCtrl';
import PrizePanel from './pops/prizePanel/PrizePanel'; import PrizePanel from './pops/prizePanel/PrizePanel';
import MainScene from './scenes/MainScene';
import ToastCtrl from './ctrls/toastCtrl';
import NoPrizePanel from './pops/prizePanel/NoPrizePanel'; import NoPrizePanel from './pops/prizePanel/NoPrizePanel';
import RulePanel from './pops/rule/RulePanel';
import StartScene from './scenes/StartScene';
import PlayScene from './scenes/playScene/PlayScene';
import GameFailPanel from './pops/prizePanel/gameFailPanel';
import warningPanel from './pops/warning/Warning';
class Main extends MainBase { class Main extends MainBase {
...@@ -30,16 +26,10 @@ class Main extends MainBase { ...@@ -30,16 +26,10 @@ class Main extends MainBase {
// 注册所有Panel // 注册所有Panel
PanelCtrl.instance.registerClass(ModuleTypes.MSG_PANEL, Msg); PanelCtrl.instance.registerClass(ModuleTypes.MSG_PANEL, Msg);
PanelCtrl.instance.registerClass(ModuleTypes.LOGIN_PANEL, LoginPanel);
PanelCtrl.instance.registerClass(ModuleTypes.GETCREDITS_PANEL, GetCreditsPanel);
PanelCtrl.instance.registerClass(ModuleTypes.WARNING_PANEL, warningPanel);
PanelCtrl.instance.registerClass(ModuleTypes.GAMEFAIL_PANEL, GameFailPanel);
PanelCtrl.instance.registerClass(ModuleTypes.NOPRIZE_PANEL, NoPrizePanel);
PanelCtrl.instance.registerClass(ModuleTypes.PRIZE_PANEL, PrizePanel); PanelCtrl.instance.registerClass(ModuleTypes.PRIZE_PANEL, PrizePanel);
PanelCtrl.instance.registerClass(ModuleTypes.RULE_PANEL, RulePanel); PanelCtrl.instance.registerClass(ModuleTypes.NOPRIZE_PANEL, NoPrizePanel);
// 注册所有Scene // 注册所有Scene
SceneCtrl.instance.registerClass(ModuleTypes.PLAY_SCENE, PlayScene); SceneCtrl.instance.registerClass(ModuleTypes.MAIN_SCENE, MainScene);
SceneCtrl.instance.registerClass(ModuleTypes.START_SCENE, StartScene);
// NetManager.ins.onNotSuccess = (msg) => { // NetManager.ins.onNotSuccess = (msg) => {
// showAlertPanel(msg) // showAlertPanel(msg)
...@@ -78,20 +68,14 @@ class Main extends MainBase { ...@@ -78,20 +68,14 @@ class Main extends MainBase {
loadSvga() { loadSvga() {
return new Promise(async (r) => { return new Promise(async (r) => {
await Promise.all([ // await Promise.all([
SVGACtrl.instance.load("collect", "collect.svga"), // ])
SVGACtrl.instance.load("fall", "fall.svga"), // .then(() => {
SVGACtrl.instance.load("impact_stone", "impact_stone.svga"), r();
SVGACtrl.instance.load("impact_user", "impact_user.svga"), // })
SVGACtrl.instance.load("user", "user.svga"), // .catch(() => {
SVGACtrl.instance.load("startBtn", "startBtn.svga") // PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, { msg: "网络异常,请稍后再试~", title: "很遗憾", type: "reload" })
]) // })
.then(() => {
r();
})
.catch(() => {
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, { msg: "网络异常,请稍后再试~", title: "很遗憾", type: "reload" })
})
}) })
...@@ -153,17 +137,24 @@ class Main extends MainBase { ...@@ -153,17 +137,24 @@ class Main extends MainBase {
// 开始计时停留时长 // 开始计时停留时长
// initstatistics(); // initstatistics();
await NetPromise.ajaxElement() NetPromise.getRemainTimes()
.then(() => {
return NetPromise.getPrizeInfo()
})
.then(() => {
return NetPromise.queryAllUserRecords([1])
})
.then(() => {
Waiting.instance.hide()
SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE);
})
.catch((e) => { .catch((e) => {
console.error(e); console.error(e);
Waiting.instance.hide() Waiting.instance.hide()
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, { msg: "网络异常,请重试~", type: "reload", title: "很遗憾" }) PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, { msg: "网络异常,请刷新重试~", type: "reload" })
}) })
Waiting.instance.hide()
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
} }
/** /**
......
export const ResGroupNameArr = ["Preload", "Guide", "Start", "Play", "Music"] export const ResGroupNameArr = ["Preload", "Main"]
import { NetManager } from './../../libs/tw/manager/NetManager';
import { DataManager } from './../../libs/tw/manager/DataManager';
import { INetData } from './../../libs/tc/interface/INetData';
export default class qcsNet {
/**
* 获取剩余次数
* @param callback 回调
* @param projectxId 项目id
*/
public static getRemainTimes(callback, projectxId = window["projectxId"]) {
const net: INetData = {
name: 'getRemainTimes',
uri: `/projectx/${projectxId}/join_1/getRemainTime.do`,
type: 'get',
dataType: 'json',
param: {},
callback: callback
};
NetManager.ins.send(net);
}
/**
* 参与刮奖
* @param callback 回调
* @param projectxId 项目id
*/
public static doJoin(callback, projectxId = window["projectxId"]) {
const net: INetData = {
name: 'doJoin',
uri: `/projectx/${projectxId}/join_1/join.do`,
type: 'get',
dataType: 'json',
param: {},
callback: callback
};
NetManager.ins.send(net);
}
/**
* 查询奖品信息
* @param callback 回调
* @param ids 奖品ID集合 英文逗号,隔开, 为空查询项目所有奖品
* @param projectxId
*/
public static getPrizeInfo(callback, ids?, projectxId = window["projectxId"]) {
let param: any = {}
if (ids) {
param.ids = ids
}
const net: INetData = {
name: 'getPrizeInfo',
uri: `/projectx/${projectxId}/prize.query`,
type: 'get',
dataType: 'json',
param: param,
callback: callback
};
NetManager.ins.send(net);
}
/**
* 查询用户中奖记录,一般用于展示中奖清单或轮播中奖
* @param callback 回调
* @param playwayId 玩法id数组
* @param projectxId 项目id
*/
public static queryAllUserRecords(callback: Function, playwayId, projectxId = window['projectxId']): void {
const param: any = {
playwayId: playwayId
};
const net: INetData = {
name: 'queryAllUserRecords',
uri: `/projectx/${projectxId}/queryAllUserRecords`,
type: 'post',
dataType: 'json',
param: param,
hideMsg: true,
callback: callback
};
NetManager.ins.getToken(net);
}
}
\ No newline at end of file
import { DataManager } from './../../../libs/tw/manager/DataManager';
import Panel from "../../views/Panel";
export default class GetCreditsPanel extends Panel {
get skinKey() { return "GetCredits" }
public closeBtn: eui.Button;
public bg: eui.Image;
public earnBtn: eui.Button;
public msgTitle: eui.Label;
public tips: eui.Label;
start() {
this.msgTitle.text = `${DataManager.ins.customCfgData.unitName}不足`;
this.tips.text = `抱歉,您当前的${DataManager.ins.customCfgData.unitName}不足`;
}
initEvents() {
super.initEvents();
this.onTap(this.earnBtn, this.onTap_earnBtn);
}
onTap_earnBtn() {
// 赚积分链接
if (window["CFG"] && window["CFG"].getCreditsLink && window["CFG"].getCreditsLink !== "") {
window.location.href = window["CFG"].getCreditsLink;
} else {
this.hidePanel();
}
}
removeEvents() {
super.removeEvents();
this.clearTap(this.earnBtn, this.onTap_earnBtn);
}
}
\ No newline at end of file
import Panel from "../../views/Panel";
export class LoginPanel extends Panel {
get skinKey() {
return "Login"
}
public bg: eui.Image;
public loginBtn: eui.Button;
public msgTitle: eui.Label;
public msgTxt: eui.Label;
initEvents() {
super.initEvents();
this.onTap(this.loginBtn, this.onTap_loginBtn);
}
onTap_loginBtn() {
// 赚积分链接
if (window['requirelogin']) {
window['requirelogin']()
} else {
this.hidePanel();
}
}
removeEvents() {
super.removeEvents();
this.clearTap(this.loginBtn, this.onTap_loginBtn);
}
}
\ No newline at end of file
...@@ -12,6 +12,12 @@ export default class Msg extends Panel { ...@@ -12,6 +12,12 @@ export default class Msg extends Panel {
} }
public bg: eui.Image;
public closeBtn: eui.Button;
public sureBtn: eui.Button;
public msgTitle: eui.Label;
public msgTxt: eui.Label;
start(data?) { start(data?) {
this.data.message = data ? (data.msg ? data.msg : '网络异常,请稍后再试~') : '网络异常,请稍后再试~'; this.data.message = data ? (data.msg ? data.msg : '网络异常,请稍后再试~') : '网络异常,请稍后再试~';
...@@ -33,9 +39,9 @@ export default class Msg extends Panel { ...@@ -33,9 +39,9 @@ export default class Msg extends Panel {
return [this['closeBtn']] return [this['closeBtn']]
} }
public closeBtn: eui.Button;
initEvents() { initEvents() {
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_closeBtn, this); this.onTap(this.sureBtn, this.onTap_closeBtn)
this.onTap(this.closeBtn, this.onTap_closeBtn)
} }
private onTap_closeBtn(e: egret.TouchEvent) { private onTap_closeBtn(e: egret.TouchEvent) {
...@@ -70,5 +76,10 @@ export default class Msg extends Panel { ...@@ -70,5 +76,10 @@ export default class Msg extends Panel {
} }
} }
removeEvents() {
this.clearTap(this.closeBtn, this.onTap_closeBtn)
this.clearTap(this.sureBtn, this.onTap_closeBtn)
}
protected get skinKey() { return 'Msg' } protected get skinKey() { return 'Msg' }
} }
\ No newline at end of file
import { noPrizeTypes } from './../../scenes/playScene/PlayScene';
import { DataManager } from './../../../libs/tw/manager/DataManager'; import { DataManager } from './../../../libs/tw/manager/DataManager';
import { NetManager } from './../../../libs/tw/manager/NetManager'; import { NetManager } from './../../../libs/tw/manager/NetManager';
import { ModuleTypes } from './../../types/ModuleTypes'; import { ModuleTypes } from './../../types/ModuleTypes';
...@@ -19,21 +19,8 @@ export default class NoPrizePanel extends Panel { ...@@ -19,21 +19,8 @@ export default class NoPrizePanel extends Panel {
public maxScoreTxt: eui.Label; public maxScoreTxt: eui.Label;
get score() { return DataManager.ins.getData("ngameSubmit").data.score }
get maxScore() { return DataManager.ins.getData("ngameSubmit").data.maxScore }
start(data) { start(data) {
if (this.score) {
this.scoreTxt.text = `${this.score}`
} else {
this.scoreTxt.text = `0`
}
if (this.score) {
this.maxScoreTxt.text = `${this.maxScore}`
} else {
this.maxScoreTxt.text = `0`
}
} }
...@@ -46,11 +33,11 @@ export default class NoPrizePanel extends Panel { ...@@ -46,11 +33,11 @@ export default class NoPrizePanel extends Panel {
private onTap_CloseBtn(e: egret.TouchEvent) { private onTap_CloseBtn(e: egret.TouchEvent) {
Waiting.instance.show() Waiting.instance.show()
NetPromise.ajaxElement() NetPromise.getRemainTimes()
.then(() => { .then(() => {
this.hidePanel(); this.hidePanel();
Waiting.instance.hide() Waiting.instance.hide()
SceneCtrl.instance.change(ModuleTypes.START_SCENE) SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE)
}) })
.catch((e) => { .catch((e) => {
console.error(e); console.error(e);
......
...@@ -10,6 +10,7 @@ import { ModuleTypes } from '../../types/ModuleTypes'; ...@@ -10,6 +10,7 @@ import { ModuleTypes } from '../../types/ModuleTypes';
import ToastCtrl from '../../ctrls/toastCtrl'; import ToastCtrl from '../../ctrls/toastCtrl';
import getOptionImgSize from './data/getOptionImgSize'; import getOptionImgSize from './data/getOptionImgSize';
import ImgSizeType from './data/ImgSizeType'; import ImgSizeType from './data/ImgSizeType';
import Waiting from '../../waiting/Waiting';
export default class PrizePanel extends Panel { export default class PrizePanel extends Panel {
...@@ -24,9 +25,18 @@ export default class PrizePanel extends Panel { ...@@ -24,9 +25,18 @@ export default class PrizePanel extends Panel {
get lottery() { return DataManager.ins.getData("getOrderStatus").data.lottery; } get lottery() {
get score() { return DataManager.ins.getData("ngameSubmit").data.score } let p;
get maxScore() { return DataManager.ins.getData("ngameSubmit").data.maxScore } this.allPrize.forEach(prize => {
if (prize.id == this.prize.prizeId) {
p = prize
}
});
return p
}
get prize() { return DataManager.ins.getData("doJoin") && DataManager.ins.getData("doJoin").data }
get allPrize() { return DataManager.ins.getData("getPrizeInfo") && DataManager.ins.getData("getPrizeInfo").data }
get picWidth() { return 250 }; get picWidth() { return 250 };
get picBigWidth() { return 500 }; get picBigWidth() { return 500 };
get bigPicRatio() { return 640 / 300 } get bigPicRatio() { return 640 / 300 }
...@@ -35,33 +45,11 @@ export default class PrizePanel extends Panel { ...@@ -35,33 +45,11 @@ export default class PrizePanel extends Panel {
// 开始 // 开始
start() { start() {
if (this.lottery) { if (this.prize) {
const sizeType = getOptionImgSize(this.lottery); this.prizeImg.source = this.lottery.icon;
if (ImgSizeType.BIG === sizeType) { this.prizeName.text = this.lottery.name + ""
this.prizeImg.width = this.picBigWidth;
this.prizeImg.height = this.picBigWidth / this.bigPicRatio;
} else {
this.prizeImg.width = this.prizeImg.height = this.picWidth;
}
this.prizeName.text = this.lottery.title;
this.prizeImg.source = this.lottery.imgUrl;
this.prizeImg.y = 645;
this.prizeImg.anchorOffsetX = 250 / 2;
this.prizeImg.anchorOffsetY = 250 / 2;
}
if (this.score) {
this.scoreTxt.text = `${this.score}`
} else {
this.scoreTxt.text = `0`
} }
if (this.score) {
this.maxScoreTxt.text = `${this.maxScore}`
} else {
this.maxScoreTxt.text = `0`
}
} }
...@@ -69,40 +57,27 @@ export default class PrizePanel extends Panel { ...@@ -69,40 +57,27 @@ export default class PrizePanel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.onTap(this.closeBtn, this.onTap_CloseBtn) this.onTap(this.closeBtn, this.onTap_CloseBtn)
this.onTap(this.sureBtn, this.onTap_CloseBtn) this.onTap(this.sureBtn, this.onTap_GetPrize)
this.onTap(this.prizeImg, this.onTap_GetPrize) this.onTap(this.prizeImg, this.onTap_GetPrize)
} }
onTap_GetPrize() { onTap_GetPrize() {
if (this.lottery.type == LotteryType.LUCKY) { window.location.href = this.prize.url
window["downloadAppConfig"] =
{
openUrl: this.lottery.openUrl,
iosDownloadUrl: this.lottery.iosDownloadUrl,
androidDownloadUrl: this.lottery.androidDownloadUrl,
confirm: this.lottery.confirm ? this.lottery.confirm : false
};
window["downloadApp"]();
if (this.lottery.type == "lucky") {
NetManager.ins.spmclick(DataManager.ins.getData("getOrderStatus").exposure);
}
} else {
window.location.href = DataManager.ins.getData("getOrderStatus").data.lottery.link;
}
} }
onTap_CloseBtn(e: egret.TouchEvent) { onTap_CloseBtn(e: egret.TouchEvent) {
NetPromise.ajaxElement() Waiting.instance.show()
NetPromise.getRemainTimes()
.then(() => { .then(() => {
this.hidePanel() this.hidePanel()
SceneCtrl.instance.change(ModuleTypes.START_SCENE) Waiting.instance.hide()
SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE)
}) })
.catch(e => { .catch(e => {
console.error(e); console.error(e);
this.hidePanel() this.hidePanel()
SceneCtrl.instance.change(ModuleTypes.START_SCENE) Waiting.instance.hide()
SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE)
ToastCtrl.instance.show("网络错误,请稍后重试~") ToastCtrl.instance.show("网络错误,请稍后重试~")
}) })
} }
......
import { BarrierType } from './../../scenes/playScene/Barrier';
import { NetPromise } from '../../promises/NetPromise';
import Panel from "../../views/Panel";
import SceneCtrl from "../../ctrls/sceneCtrl";
import { ModuleTypes } from "../../types/ModuleTypes";
import PanelCtrl from '../../ctrls/panelCtrl';
export default class GameFailPanel extends Panel {
get skinKey() {
return "GameFail"
}
public bg: eui.Image;
public closeBtn: eui.Button;
public againBtn: eui.Button;
public msgTitle: eui.Label;
public msgTxt: eui.Label;
constructor(data) {
super()
switch (data.type) {
case BarrierType.SNOWBALL:
this.msgTxt.text = `哎呀,一不小心被砸晕了~`;
break;
case BarrierType.HOLE:
this.msgTxt.text = `哎呀,圣诞老人消失了~`;
break;
case BarrierType.STONE:
this.msgTxt.text = `哎呀,一不小心被砸晕了~`;
break;
}
}
initEvents() {
super.initEvents()
this.onTap(this.againBtn, this.onTap_againBtn)
this.onTap(this.closeBtn, this.onTap_againBtn)
}
onTap_againBtn() {
NetPromise.ajaxElement()
.then(() => {
this.hidePanel()
SceneCtrl.instance.change(ModuleTypes.START_SCENE)
})
.catch(e => {
console.error(e);
this.hidePanel()
SceneCtrl.instance.change(ModuleTypes.START_SCENE)
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, { msg: "网络异常,请稍后重试~", type: "reload" })
})
}
removeEvents() {
super.removeEvents()
this.clearTap(this.againBtn, this.onTap_againBtn)
this.clearTap(this.closeBtn, this.onTap_againBtn)
}
}
\ No newline at end of file
/**
* Convert the text in html format to the object that can be assigned to the egret.TextField#textFlow property
* @see http://edn.egret.com/cn/docs/page/146 Text mixed in a variety of style
* @version Egret 2.4
* @platform Web,Native
* @includeExample egret/text/HtmlTextParser.ts
* @language en_US
*/
/**
* 将html格式文本转换为可赋值给 egret.TextField#textFlow 属性的对象
* @see http://edn.egret.com/cn/docs/page/146 多种样式文本混合
* @version Egret 2.4
* @platform Web,Native
* @includeExample egret/text/HtmlTextParser.ts
* @language zh_CN
*/
export class HtmlTextParser {
/**
* @version Egret 2.4
* @platform Web,Native
*/
constructor() {
this.initReplaceArr();
this.initPreReplaceArr();
}
private replaceArr: any[] = [];
private initReplaceArr(): void {
const arr = this.replaceArr = [];
arr.push([/&lt;/g, "<"]);
arr.push([/&gt;/g, ">"]);
arr.push([/&amp;/g, "&"]);
arr.push([/&quot;/g, "\""]);
arr.push([/&apos;/g, "\'"]);
}
private preReplaceArr: any[] = [];
private initPreReplaceArr() {
const arr = this.preReplaceArr = [];
arr.push([/\\\"/g, "\""]);
arr.push([/<br>/g, "\n"]);
}
/**
* @private
*
* @param value
* @returns
*/
private replaceSpecial(value: string): string {
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < this.replaceArr.length; i++) {
const k = this.replaceArr[i][0];
const v = this.replaceArr[i][1];
value = value.replace(k, v);
}
return value;
}
/**
* @private
*/
private resutlArr: Array<egret.ITextElement> = [];
/**
* Convert the text in html format to the object that can be assigned to the egret.TextField#textFlow property
* @param htmltext {string} Text in html
* @returns {Array<egret.ITextElement>} 可赋值给 egret.TextField#textFlow Object that can be assigned to the egret.TextField#textFlow property
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* 将html格式文本转换为可赋值给 egret.TextField#textFlow 属性的对象
* @param htmltext {string} html文本
* @returns {Array<egret.ITextElement>} 可赋值给 egret.TextField#textFlow 属性的对象
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
public parse(htmltext: string): egret.ITextElement[] {
this.preReplaceArr.forEach(p => {
htmltext = htmltext.replace(p[0], p[1]);
});
this.stackArray = [];
this.resutlArr = [];
let firstIdx = 0;//文本段开始位置
const length: number = htmltext.length;
while (firstIdx < length) {
const starIdx: number = htmltext.indexOf("<", firstIdx);
if (starIdx < 0) {
this.addToResultArr(htmltext.substring(firstIdx));
firstIdx = length;
}
else {
this.addToResultArr(htmltext.substring(firstIdx, starIdx));
let fontEnd = htmltext.indexOf(">", starIdx);
if (fontEnd == -1) {
egret.$error(1038);
fontEnd = starIdx;
}
else if (htmltext.charAt(starIdx + 1) == "\/") {//关闭
this.stackArray.pop();
}
else {
this.addToArray(htmltext.substring(starIdx + 1, fontEnd));
}
firstIdx = fontEnd + 1;
}
}
return this.resutlArr;
}
public parser(htmltext: string): Array<egret.ITextElement> {
return this.parse(htmltext);
}
/**
* @private
*
* @param value
*/
private addToResultArr(value: string): void {
if (value == "") {
return;
}
value = this.replaceSpecial(value);
if (this.stackArray.length > 0) {
this.resutlArr.push({ text: value, style: this.stackArray[this.stackArray.length - 1] })
}
else {
this.resutlArr.push(<egret.ITextElement>{ text: value });
}
}
//将字符数据转成Json数据
private changeStringToObject(str: string): egret.ITextStyle {
str = this.replaceSpecial(str.trim());
const info: any = {};
let header = [];
if (str.charAt(0) == "i" || str.charAt(0) == "b" || str.charAt(0) == "u") {
this.addProperty(info, str, "true");
}
// tslint:disable-next-line:no-conditional-assignment
else if (header = str.match(/^(font|a)\s/)) {
str = str.substring(header[0].length).trim();
let next = 0;
let titles;
// tslint:disable-next-line:no-conditional-assignment
while (titles = str.match(this.getHeadReg())) {
const title = titles[0];
let value = "";
str = str.substring(title.length).trim();
if (str.charAt(0) == "\"") {
next = str.indexOf("\"", 1);
value = str.substring(1, next);
next += 1;
}
else if (str.charAt(0) == "\'") {
next = str.indexOf("\'", 1);
value = str.substring(1, next);
next += 1;
}
else {
value = str.match(/(\S)+/)[0];
next = value.length;
}
this.addProperty(info, title.substring(0, title.length - 1).trim(), value.trim());
str = str.substring(next).trim();
}
}
return info;
}
/**
* @private
*
* @returns
*/
private getHeadReg(): RegExp {
return /^(color|textcolor|strokecolor|stroke|b|bold|i|italic|u|size|fontfamily|href|target)(\s)*=/;
}
/**
* @private
*
* @param info
* @param head
* @param value
*/
private addProperty(info: egret.ITextStyle, head: string, value: string): void {
switch (head.toLowerCase()) {
case "color":
case "textcolor":
value = value.replace(/#/, "0x");
info.textColor = parseInt(value);
break;
case "strokecolor":
value = value.replace(/#/, "0x");
info.strokeColor = parseInt(value);
break;
case "stroke":
info.stroke = parseInt(value);
break;
case "b":
case "bold":
info.bold = value == "true";
break;
case "u":
info.underline = value == "true";
break;
case "i":
case "italic":
info.italic = value == "true";
break;
case "size":
info.size = parseInt(value);
break;
case "fontfamily":
info.fontFamily = value;
break;
case "href":
info.href = this.replaceSpecial(value);
break;
case "target":
info.target = this.replaceSpecial(value);
break;
}
}
/**
* @private
*/
private stackArray: Array<egret.ITextStyle>;
/**
* @private
*
* @param infoStr
*/
private addToArray(infoStr: string): void {
const info: egret.ITextStyle = this.changeStringToObject(infoStr);
if (this.stackArray.length == 0) {
this.stackArray.push(info);
}
else {
const lastInfo: Object = this.stackArray[this.stackArray.length - 1];
for (const key in lastInfo) {
if (info[key] == null) {
info[key] = lastInfo[key];
}
}
this.stackArray.push(info);
}
}
}
const parser = new HtmlTextParser();
export const parseHtmlText = (content) => {
return parser.parse(content);
}
import { NetPromise } from './../../promises/NetPromise';
import { NetManager } from '../../../libs/tw/manager/NetManager';
import { DataManager } from '../../../libs/tw/manager/DataManager';
import { HtmlTextParser } from "./HtmlTextParser";
import Panel from "../../views/Panel";
import ToastCtrl from '../../ctrls/toastCtrl';
export default class RulePanel extends Panel {
public labContent: eui.Label;
public scroller: eui.Scroller;
start() {
if (window['ruleTxt']) {
this.labContent.textFlow = (new HtmlTextParser).parser(window['ruleTxt']);
} else {
if (!DataManager.ins.getData("gameAjaxElement")) {
NetPromise.ajaxElement()
.then(() => {
this.addRule();
})
.catch((e) => {
console.error(e);
ToastCtrl.instance.show("获取规则失败,请稍后重试~")
})
}
else {
this.addRule();
}
}
}
group: eui.Group;
private addRule() {
const text = DataManager.ins.getData("gameAjaxElement").data.rule;
this.labContent.textFlow = (new HtmlTextParser).parser(text);
}
get skinKey() { return 'Rule' }
}
\ No newline at end of file
import { DataManager } from './../../../libs/tw/manager/DataManager';
import { ModuleTypes } from './../../types/ModuleTypes';
import { NetPromise } from './../../promises/NetPromise';
import Panel from "../../views/Panel";
import Waiting from "../../waiting/Waiting";
import SceneCtrl from '../../ctrls/sceneCtrl';
import ToastCtrl from '../../ctrls/toastCtrl';
export default class warningPanel extends Panel {
get skinKey() {
return "Warning"
}
public bg: eui.Image;
public closeBtn: eui.Button;
public sureBtn: eui.Button;
public warningTips: eui.Label;
public title: eui.Image;
get unitName() { return window['CFG'].unitName }
get cost() { return DataManager.ins.getData("gameAjaxElement").data.element.needCreditsLong }
constructor() {
super()
this.warningTips.text = `确认消耗${this.cost}${this.unitName}参与游戏吗?`
}
initEvents() {
super.initEvents()
this.onTap(this.sureBtn, this.doStart)
}
removeEvents() {
super.removeEvents()
this.clearTap(this.sureBtn, this.doStart)
}
doStart() {
Waiting.instance.show()
NetPromise.doJoin()
.then(() => {
return NetPromise.getStartStatus()
})
.then(() => {
Waiting.instance.hide()
this.hidePanel()
SceneCtrl.instance.change(ModuleTypes.PLAY_SCENE)
})
.catch((e) => {
console.error(e);
Waiting.instance.hide()
ToastCtrl.instance.show("网络异常,请稍后再试~")
})
}
}
\ No newline at end of file
import { DataManager } from './../../libs/tw/manager/DataManager'; import { DataManager } from './../../libs/tw/manager/DataManager';
import NetConst from './../consts/NetConst'; import NetConst from './../consts/NetConst';
import qcsNet from '../consts/qcsNet';
export class NetPromise { export class NetPromise {
// 获取活动基础信息 // 获取活动基础信息
static ajaxElement() { static getRemainTimes() {
return new Promise((r, j) => { return new Promise((r, j) => {
NetConst.ajaxElement((s) => { qcsNet.getRemainTimes((s) => {
if (!s) { if (!s) {
j(s) j(s)
return
} }
r() r()
}); });
...@@ -16,58 +18,46 @@ export class NetPromise { ...@@ -16,58 +18,46 @@ export class NetPromise {
} }
/** /**
* 参与游戏 * 参与刮奖
*/ */
static doJoin() { static doJoin() {
return new Promise((r, j) => { return new Promise((r, j) => {
NetConst.doJoin((s) => { qcsNet.doJoin((s) => {
if (!s) { if (!s) {
j(s) j(s)
return
} }
r() r()
}); });
}) })
} }
static getStartStatus() { static getPrizeInfo() {
return new Promise((r, j) => { return new Promise((r, j) => {
NetConst.getNgameStartStatus((s) => { qcsNet.getPrizeInfo((s) => {
if (!s) { if (!s) {
j(s) j(s)
return
} }
r() r()
}, })
DataManager.ins.getData("doJoin").data,
() => {
return DataManager.ins.getData("getNgameStartStatus").code == "C000000001"
});
}) })
} }
static submit(orderId, score, submitToken) { /**
* 查询用户中奖记录,一般用于展示中奖清单或轮播中奖
* @param playwayId 玩法id数组
*/
static queryAllUserRecords(playwayId) {
return new Promise((r, j) => { return new Promise((r, j) => {
NetConst.ngameSubmit((s) => { qcsNet.queryAllUserRecords((s) => {
if (!s) { if (!s) {
j(s) j(s)
return
} }
r() r()
}, orderId, score, '[]', '[]', submitToken); }, playwayId)
})
}
static getOrderStatus() {
return new Promise((r, j) => {
NetConst.getOrderStatus((s) => {
if (!s) {
j(s)
}
r()
},
DataManager.ins.getData("doJoin").data,
() => {
return DataManager.ins.getData("getOrderStatus").code == "C000000001"
});
}) })
} }
} }
\ No newline at end of file
This diff is collapsed.
export default class PrizeItem extends eui.Component {
constructor() {
super()
this.skinName = `PrizeItemSKin`
this.width = 230;
this.height = 180;
this.prizeImg = new eui.Image()
this.prizeImg.horizontalCenter = 0
this.prizeImg.width = 120
this.prizeImg.height = 120;
this.prizeImg.top = 0;
this.addChild(this.prizeImg)
this.prizeName = new eui.Label()
this.prizeName.textColor = 0xF9E3B5
this.prizeName.horizontalCenter = 0
this.prizeName.bottom = 0;
this.addChild(this.prizeName)
}
public prizeImg: eui.Image;
public prizeName: eui.Label;
}
\ No newline at end of file
This diff is collapsed.
export default class Barrier extends eui.Image {
public score: number = 10;
public barrierType: BarrierType;
constructor(type: BarrierType) {
super()
this.barrierType = type
}
}
export enum BarrierType {
BELL,
HOLE,
SNOWBALL,
SOCKS,
STONE,
GIFTBOX
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment