Commit 18379d96 authored by huangwenjie's avatar huangwenjie

1

parent dc05c071
......@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>圣诞礼献全城</title>
<title>9宠养成</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -44,10 +44,7 @@
</head>
<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"
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"
......@@ -89,7 +86,7 @@
// var dev = true;
var resPath = '';
// svga路径
var svgaPath = "//duiba.oss-cn-hangzhou.aliyuncs.com/db_games/activity/ChristmasGifts/svgas/"
var svgaPath = "//yun.duiba.com.cn/db_games/activity/Thanksgivingballons/svgas/"
// http://duiba.oss-cn-hangzhou.aliyuncs.com/db_games/activity/Thanksgivingballons/svgas/playTurkey.svga
function resolve(a) {
var b = eval(a);
......@@ -143,54 +140,7 @@
shareIosLinkActivity: ''
};
</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>
</body>
......
......@@ -6,8 +6,8 @@
<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:Image id="bg" source="msgBg_png" horizontalCenter="0" y="2.9999999999999716" x="0" scaleX="1" scaleY="1"/>
<e:Button id="closeBtn" label="" x="604" 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"/>
......@@ -15,7 +15,7 @@
</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:Button id="earnBtn" label="" anchorOffsetX="171.5" anchorOffsetY="43.5" horizontalCenter="0.5" y="577.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"/>
......@@ -23,8 +23,7 @@
</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: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="218.20000000000002" x="173" scaleX="1" scaleY="1" textColor="0xFFFFFF"/>
<e:Label id="tips" touchEnabled="false" size="36" width="556.85" anchorOffsetY="0" height="190.91" textAlign="center" anchorOffsetX="0" verticalAlign="middle" y="319.05" fontFamily="Microsoft YaHei" scaleX="1" scaleY="1" horizontalCenter="0.5" textColor="0xFFFFFF" text="抱歉,您当前的积分不足"/>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -7,8 +7,8 @@
<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:Image id="bg" source="msgBg_png" horizontalCenter="0" y="2.9999999999999716" x="0" scaleX="1" scaleY="1"/>
<e:Button id="closeBtn" label="" x="604" 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"/>
......@@ -16,7 +16,7 @@
</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:Button id="loginBtn" label="" anchorOffsetX="171.5" anchorOffsetY="43.5" horizontalCenter="0.5" y="577.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"/>
......@@ -25,8 +25,8 @@
</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: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="218.20000000000002" x="173" scaleX="1" scaleY="1" textColor="0xffffff"/>
<e:Label id="msgTxt" touchEnabled="false" size="36" width="556.85" anchorOffsetY="0" height="190.91" textAlign="center" anchorOffsetX="0" verticalAlign="middle" y="319.05" fontFamily="Microsoft YaHei" scaleX="1" scaleY="1" horizontalCenter="0.5" textColor="0xffffff" text="抱歉,请先登录"/>
</e:Group>
......
......@@ -7,8 +7,8 @@
<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="closeBtn0" label="" x="584" y="144.89">
<e:Image id="bg" source="msgBg_png" horizontalCenter="0" y="2.9999999999999716" x="0" scaleX="1" scaleY="1"/>
<e:Button id="closeBtn0" label="" x="604" 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"/>
......@@ -16,7 +16,7 @@
</e:Skin>
</e:skinName>
</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="closeBtn" label="" anchorOffsetX="171.5" anchorOffsetY="43.5" horizontalCenter="0.5" y="577.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"/>
......@@ -24,9 +24,8 @@
</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" 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:Image source="warningtitle_png" y="300" horizontalCenter="0"/>
<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="218.20000000000002" x="173" scaleX="1" scaleY="1" textColor="0xffffff"/>
<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="319.05" fontFamily="Microsoft YaHei" scaleX="1" scaleY="1" horizontalCenter="0.5" textColor="0xffffff" lineSpacing="15"/>
</e:Group>
......
......@@ -11,18 +11,26 @@
<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:Image horizontalCenter="0" source="msgBg_png" scale9Grid="115,216,517,402" anchorOffsetY="0" height="1000" verticalCenter="0" x="0" y="0" scaleX="1" scaleY="1"/>
<e:Button id="closeBtn0" label="" x="604" 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:Scroller id="scroller" width="506" height="482" y="320" 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:Label id="labContent" width="100%" text="" lineSpacing="10" size="30" multiline="true" anchorOffsetY="-8" fontFamily="Microsoft YaHei" textColor="0xffffff"/>
<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:Button id="closeBtn" label="" icon="knowBtn_png" y="871.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="232.00000000000006" horizontalCenter="0" x="270" scaleX="1" scaleY="1"/>
</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:Image id="bg" source="startBg_jpg" x="0" y="0"/>
<e:Group id="ballon" width="369" height="504" y="860.72" anchorOffsetY="487" anchorOffsetX="179" x="376">
<e:Image source="start_ballon_png" y="0" horizontalCenter="0"/>
<e:Image source="start_ballon_face1_png" x="241" y="126"/>
<e:Image source="start_ballon_face0_png" x="38" y="114"/>
</e:Group>
<e:Image source="infoBg_png" x="212.5" y="1054.24"/>
<e:Image source="countBg_png" y="731.72" horizontalCenter="0.5"/>
<e:Button id="recordBtn" label="" skinName="ui.IconButtonSkin" icon="recordBtn_png" width="137" height="43" anchorOffsetY="21.5" anchorOffsetX="68.5" left="30" top="30"/>
<e:Button id="ruleBtn" label="" skinName="ui.IconButtonSkin" icon="ruleBtn_png" width="137" height="43" anchorOffsetY="21.5" anchorOffsetX="68.5" right="30" top="30"/>
<e:Label id="costTxt" text="10积分/次" x="269.5" y="740.72" anchorOffsetX="0" width="216" anchorOffsetY="0" height="44.5" textAlign="center" verticalAlign="middle" textColor="0xf25757" fontFamily="Microsoft YaHei" size="20"/>
<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:Label id="creditsTxt" text="剩余积分:10" y="1058.24" anchorOffsetX="0" width="301" size="22" fontFamily="Microsoft YaHei" horizontalCenter="1.5" anchorOffsetY="0" height="36" textAlign="center" verticalAlign="middle"/>
<e:Group id="startBtn" width="200" height="200" y="822.72" horizontalCenter="0"/>
</e:Skin>
\ No newline at end of file
......@@ -20,8 +20,6 @@ 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 {
......@@ -32,8 +30,6 @@ class Main extends MainBase {
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.RULE_PANEL, RulePanel);
......@@ -67,7 +63,6 @@ class Main extends MainBase {
GDispatcher.addEvent('PreloadLoaded', () => {
Waiting.instance.show()
// this.createGameScene()
}, this);
GDispatcher.addEvent('PlayLoaded', () => {
// Waiting.instance.hide()
......@@ -79,17 +74,18 @@ class Main extends MainBase {
return new Promise(async (r) => {
await Promise.all([
SVGACtrl.instance.load("collect", "collect.svga"),
SVGACtrl.instance.load("fall", "fall.svga"),
SVGACtrl.instance.load("impact_stone", "impact_stone.svga"),
SVGACtrl.instance.load("impact_user", "impact_user.svga"),
SVGACtrl.instance.load("user", "user.svga"),
SVGACtrl.instance.load("startBtn", "startBtn.svga")
SVGACtrl.instance.load("startTurkey", "startTurkey.svga"),
SVGACtrl.instance.load("playTurkey", "playTurkey.svga"),
SVGACtrl.instance.load("eyes", "eyes.svga"),
SVGACtrl.instance.load("startBtn", "startBtn.svga"),
SVGACtrl.instance.load("explode", "explode.svga")
])
.then(() => {
r();
})
.catch(() => {
.catch((e) => {
console.error(e);
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, { msg: "网络异常,请稍后再试~", title: "很遗憾", type: "reload" })
})
......@@ -113,25 +109,26 @@ class Main extends MainBase {
} else if (i == ResGroupNameArr.length - 1) {
this.trace(`${ResGroupNameArr[i]}组加载完成`);
GameConst.stage = this.stage;
window['allLoaded'] = true
setTimeout(() => {
console.log(GameConst.stage.width, GameConst.stage.height)
}, 100);
console.log("开始加载svga");
this.loadSvga()
.then(() => {
console.log("svga加载完成");
window['allLoaded'] = true
RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this);
RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
this.createGameScene()
})
.catch(e => {
console.error(e);
})
setTimeout(() => {
console.log(GameConst.stage.width, GameConst.stage.height)
}, 100);
RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this);
RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
}
}
}
......
......@@ -21,6 +21,7 @@ export default class GetCreditsPanel extends Panel {
initEvents() {
super.initEvents();
this.onTap(this.earnBtn, this.onTap_earnBtn);
this.onTap(this.closeBtn, this.onTouchTap);
}
onTap_earnBtn() {
......@@ -35,6 +36,7 @@ export default class GetCreditsPanel extends Panel {
removeEvents() {
super.removeEvents();
this.clearTap(this.earnBtn, this.onTap_earnBtn);
this.clearTap(this.closeBtn, this.onTouchTap);
}
}
\ No newline at end of file
......@@ -4,6 +4,13 @@ import Panel from "../../views/Panel";
import SceneCtrl from '../../ctrls/sceneCtrl';
export default class Msg extends Panel {
public bg: eui.Image;
public closeBtn0: eui.Button;
public closeBtn: eui.Button;
public msgTitle: eui.Label;
public msgTxt: eui.Label;
set message(val) {
......@@ -33,9 +40,9 @@ export default class Msg extends Panel {
return [this['closeBtn']]
}
public closeBtn: eui.Button;
initEvents() {
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_closeBtn, this);
this.onTap(this.closeBtn0, this.onTap_closeBtn)
this.onTap(this.closeBtn, this.onTap_closeBtn)
}
private onTap_closeBtn(e: egret.TouchEvent) {
......@@ -70,5 +77,11 @@ export default class Msg extends Panel {
}
}
removeEvents() {
super.removeEvents()
this.clearTap(this.closeBtn0, this.onTap_closeBtn)
this.clearTap(this.closeBtn, this.onTap_closeBtn)
}
protected get skinKey() { return 'Msg' }
}
\ No newline at end of file
......@@ -12,27 +12,35 @@ export default class NoPrizePanel extends Panel {
protected get skinKey() { return 'NoPrize' }
public bg: eui.Image;
public img: eui.Image;
public failTxt: eui.Label;
public sureBtn: eui.Button;
public againBtn: eui.Button;
public closeBtn: eui.Button;
public noPrizeTitle: eui.Image;
public scoreTxt: eui.Label;
public maxScoreTxt: eui.Label;
get score() { return DataManager.ins.getData("ngameSubmit").data.score }
get maxScore() { return DataManager.ins.getData("ngameSubmit").data.maxScore }
public failTitle: eui.Image;
public emoji: eui.Image;
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`
switch (data.type) {
case noPrizeTypes.FAIL:
this.noPrizeTitle.visible = false
this.failTitle.visible = true
this.failTxt.text = `哎呀,就差那么一丢丢了`
break;
case noPrizeTypes.NOPRIZE:
this.noPrizeTitle.visible = true
this.failTitle.visible = false
this.failTxt.text = `感恩大礼与你失之交臂`
break;
case noPrizeTypes.THANKS:
this.noPrizeTitle.visible = true
this.failTitle.visible = false
this.failTxt.text = `感恩大礼与你失之交臂`
break;
default:
break;
}
}
......@@ -42,6 +50,7 @@ export default class NoPrizePanel extends Panel {
this.onTap(this.againBtn, this.onTap_CloseBtn)
this.onTap(this.closeBtn, this.onTap_CloseBtn)
this.onTap(this.sureBtn, this.onTap_CloseBtn)
}
private onTap_CloseBtn(e: egret.TouchEvent) {
......
......@@ -69,7 +69,7 @@ export default class PrizePanel extends Panel {
initEvents() {
super.initEvents();
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)
}
......
......@@ -6,8 +6,12 @@ import Panel from "../../views/Panel";
import ToastCtrl from '../../ctrls/toastCtrl';
export default class RulePanel extends Panel {
public labContent: eui.Label;
public closeBtn0: eui.Button;
public scroller: eui.Scroller;
public group: eui.Group;
public labContent: eui.Label;
public closeBtn: eui.Button;
start() {
if (window['ruleTxt']) {
this.labContent.textFlow = (new HtmlTextParser).parser(window['ruleTxt']);
......@@ -28,11 +32,20 @@ export default class RulePanel extends Panel {
}
}
group: eui.Group;
private addRule() {
const text = DataManager.ins.getData("gameAjaxElement").data.rule;
this.labContent.textFlow = (new HtmlTextParser).parser(text);
}
initEvents() {
super.initEvents()
this.onTap(this.closeBtn0, this.onTouchTap)
}
removeEvents() {
super.removeEvents()
this.clearTap(this.closeBtn0, this.onTouchTap)
}
get skinKey() { return 'Rule' }
}
\ No newline at end of file
......@@ -135,7 +135,7 @@ export default class StartScene extends Scene {
if (DataManager.ins.getData('gameAjaxElement').data.element.status == 3) {
ToastCtrl.instance.show(`游戏次数已用完`);
} else if (DataManager.ins.getData('gameAjaxElement').data.element.status == 4) {
ToastCtrl.instance.show(`今日次数已用完,请明日再来吧~`);
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, { msg: "抱歉,今日次数已用完,\n明日再来吧~", title: "次数不足", type: "tips" })
} else if (DataManager.ins.getData('gameAjaxElement').data.element.status == 5 && DataManager.ins.getData('gameAjaxElement').data.element.freeLimit > 0) {
this.doStart();
} else if (DataManager.ins.getData('gameAjaxElement').data.element.status == 2 || DataManager.ins.getData('gameAjaxElement').data.element.needCreditsLong > DataManager.ins.getData('gameAjaxElement').data.element.myCreditsLong) {
......
This diff is collapsed.
......@@ -59,14 +59,14 @@
"type": "hdtool",
"element": {
"isCreditsTypeOpen": false,
"myCreditsLong": 1000,
"freeLimit": 1,
"myCreditsLong": 100,
"freeLimit": 0,
"success": false,
"myCredits": "999999632167",
"needCredits": "100",
"freeEmpty": true,
"needCreditsLong": 100,
"status": 5
"status": 0
}
},
"success": true,
......
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