Commit 8422ba1b authored by haiyoucuv's avatar haiyoucuv

换了点皮,换了下接口

parent a995fc3a
This diff is collapsed.
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"data": { "data": {
"rule": "测试活动规则测试活动规则测试活动规则测试活动规则测试活动规则测试活动规则测试", "rule": "测试活动规则测试活动规则测试活动规则测试活动规则测试活动规则测试活动规则测试",
"currentLevel": 120, "currentLevel": 120,
"power": 100, "power": 0,
"tools": { "tools": {
"steps": 100, "steps": 100,
"booms": 100, "booms": 100,
......
{ {
"groups": [ "groups": [
{
"keys": "增加体力背景.png,无字按钮底.png",
"name": "BuyPowerPanel"
},
{
"keys": "积分不足背景.png,赚取积分.png",
"name": "CreditsOutPanel"
},
{
"keys": "兑换成功背景.png,知道啦.png",
"name": "ExchangeSucPanel"
},
{ {
"keys": "失败Bg.png,失败重新闯关.png", "keys": "失败Bg.png,失败重新闯关.png",
"name": "FailedPanel" "name": "FailedPanel"
...@@ -28,42 +16,26 @@ ...@@ -28,42 +16,26 @@
"keys": "体力不足Bg.png,体力不足按钮.png", "keys": "体力不足Bg.png,体力不足按钮.png",
"name": "NoEnergyPanel" "name": "NoEnergyPanel"
}, },
{
"keys": "noPrizeBg.png,知道了.png",
"name": "NoPrizePanel"
},
{ {
"keys": "步数耗尽Bg.png,步数耗尽复活.png,步数耗尽结束按钮.png", "keys": "步数耗尽Bg.png,步数耗尽复活.png,步数耗尽结束按钮.png",
"name": "NoStepPanel" "name": "NoStepPanel"
}, },
{
"keys": "prizePanel.png,prizePanelBtn.png",
"name": "PrizePanel"
},
{ {
"keys": "活动规则背景.png", "keys": "活动规则背景.png",
"name": "RulePanel" "name": "RulePanel"
}, },
{
"keys": "开始闯关Bg.png",
"name": "StartPanel"
},
{ {
"keys": "关卡弹窗Bg.png", "keys": "关卡弹窗Bg.png",
"name": "StartPanelPrize" "name": "StartPanelPrize"
}, },
{ {
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png", "keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,查看奖品.png,继续闯关红.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png",
"name": "SuccessPanel" "name": "SuccessPanel"
}, },
{ {
"keys": "任务背景.png,去完成.png,去完成灰.png,待领取.png", "keys": "任务背景.png,去完成.png,去完成灰.png,待领取.png",
"name": "TaskPanel" "name": "TaskPanel"
}, },
{
"keys": "道具不足背景.png",
"name": "ToolsOutPanel"
},
{ {
"keys": "使用道具背景.png", "keys": "使用道具背景.png",
"name": "UseToolPanel" "name": "UseToolPanel"
......
export const ResJson = { export const ResJson = {
"groups": [ "groups": [
{
"keys": "增加体力背景.png,无字按钮底.png",
"name": "BuyPowerPanel"
},
{
"keys": "积分不足背景.png,赚取积分.png",
"name": "CreditsOutPanel"
},
{
"keys": "兑换成功背景.png,知道啦.png",
"name": "ExchangeSucPanel"
},
{ {
"keys": "失败Bg.png,失败重新闯关.png", "keys": "失败Bg.png,失败重新闯关.png",
"name": "FailedPanel" "name": "FailedPanel"
...@@ -28,42 +16,26 @@ export const ResJson = { ...@@ -28,42 +16,26 @@ export const ResJson = {
"keys": "体力不足Bg.png,体力不足按钮.png", "keys": "体力不足Bg.png,体力不足按钮.png",
"name": "NoEnergyPanel" "name": "NoEnergyPanel"
}, },
{
"keys": "noPrizeBg.png,知道了.png",
"name": "NoPrizePanel"
},
{ {
"keys": "步数耗尽Bg.png,步数耗尽复活.png,步数耗尽结束按钮.png", "keys": "步数耗尽Bg.png,步数耗尽复活.png,步数耗尽结束按钮.png",
"name": "NoStepPanel" "name": "NoStepPanel"
}, },
{
"keys": "prizePanel.png,prizePanelBtn.png",
"name": "PrizePanel"
},
{ {
"keys": "活动规则背景.png", "keys": "活动规则背景.png",
"name": "RulePanel" "name": "RulePanel"
}, },
{
"keys": "开始闯关Bg.png",
"name": "StartPanel"
},
{ {
"keys": "关卡弹窗Bg.png", "keys": "关卡弹窗Bg.png",
"name": "StartPanelPrize" "name": "StartPanelPrize"
}, },
{ {
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png", "keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,查看奖品.png,继续闯关红.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png",
"name": "SuccessPanel" "name": "SuccessPanel"
}, },
{ {
"keys": "任务背景.png,去完成.png,去完成灰.png,待领取.png", "keys": "任务背景.png,去完成.png,去完成灰.png,待领取.png",
"name": "TaskPanel" "name": "TaskPanel"
}, },
{
"keys": "道具不足背景.png",
"name": "ToolsOutPanel"
},
{ {
"keys": "使用道具背景.png", "keys": "使用道具背景.png",
"name": "UseToolPanel" "name": "UseToolPanel"
......
...@@ -87,46 +87,13 @@ export const SkinJson = { ...@@ -87,46 +87,13 @@ export const SkinJson = {
{ {
"name": "闯关成功", "name": "闯关成功",
"x": 53, "x": 53,
"y": 190, "y": 209,
"alpha": 1, "alpha": 1,
"type": "sprite", "type": "sprite",
"props": { "props": {
"source": "闯关成功.png" "source": "闯关成功.png"
} }
}, },
{
"name": "继续闯关大",
"x": 163,
"y": 1109,
"alpha": 1,
"type": "button",
"props": {
"tUp": "继续闯关大.png"
},
"id": "noPrizeAgainBtn"
},
{
"name": "继续闯关小",
"x": 93,
"y": 1109,
"alpha": 1,
"type": "button",
"props": {
"tUp": "继续闯关小.png"
},
"id": "againBtn"
},
{
"name": "去抽奖",
"x": 383,
"y": 1109,
"alpha": 1,
"type": "button",
"props": {
"tUp": "去抽奖.png"
},
"id": "goPrizeBtn"
},
{ {
"name": "提示文案", "name": "提示文案",
"x": 182, "x": 182,
...@@ -137,7 +104,6 @@ export const SkinJson = { ...@@ -137,7 +104,6 @@ export const SkinJson = {
"text": "太厉害了!获得抽奖资格!", "text": "太厉害了!获得抽奖资格!",
"size": 34, "size": 34,
"fillColor": "#df5942", "fillColor": "#df5942",
"textAlpha": 1,
"bold": true "bold": true
}, },
"id": "tipsTex" "id": "tipsTex"
...@@ -145,7 +111,7 @@ export const SkinJson = { ...@@ -145,7 +111,7 @@ export const SkinJson = {
{ {
"name": "红包奖励", "name": "红包奖励",
"x": 130, "x": 130,
"y": 850, "y": 862,
"alpha": 1, "alpha": 1,
"type": "sprite", "type": "sprite",
"props": { "props": {
...@@ -153,10 +119,24 @@ export const SkinJson = { ...@@ -153,10 +119,24 @@ export const SkinJson = {
}, },
"id": "prizeImg" "id": "prizeImg"
}, },
{
"name": "提示文案",
"x": 182,
"y": 1095,
"alpha": 1,
"type": "text",
"props": {
"text": "奖品可以在“我的奖品”页面查看",
"size": 24,
"fillColor": "#df5942",
"bold": true
},
"id": "tipsTex2"
},
{ {
"name": "关闭按钮", "name": "关闭按钮",
"x": 631, "x": 625,
"y": 421, "y": 431,
"alpha": 1, "alpha": 1,
"type": "button", "type": "button",
"props": { "props": {
......
...@@ -2,14 +2,12 @@ import { RES } from "../module/RES"; ...@@ -2,14 +2,12 @@ import { RES } from "../module/RES";
import { layers } from "../module/views/layers"; import { layers } from "../module/views/layers";
import Tween = FYGE.Tween; import Tween = FYGE.Tween;
import Ease = FYGE.Ease; import Ease = FYGE.Ease;
import { sendTbNet, TbNetName, getTbData } from "./TaoBaoNet"; import { sendTbNet, TbNetName } from "./TaoBaoNet";
import { PropType } from "./something/enum/PropType"; import { PropType } from "./something/enum/PropType";
import { showToast } from "../module/ctrls";
import { showPanel } from "../module/ctrls"; import { showPanel } from "../module/ctrls";
import { FailedPanel } from "./panels/FailedPanel"; import { FailedPanel } from "./panels/FailedPanel";
import { SuccessPrizePanel } from "./panels/SuccessPrizePanel"; import { SuccessPrizePanel } from "./panels/SuccessPrizePanel";
import { SuccessNoPrizePanel } from "./panels/SuccessNoPrizePanel"; import { SuccessNoPrizePanel } from "./panels/SuccessNoPrizePanel";
import { CreditsOutPanel } from "./panels/CreditsOutPanel";
/** /**
* 定制,记录一些全局量和方法 * 定制,记录一些全局量和方法
...@@ -117,12 +115,10 @@ export class Tools { ...@@ -117,12 +115,10 @@ export class Tools {
public static gameOver(data) { public static gameOver(data) {
if (!data.isVisitSuccess) { // 闯关失败 if (!data.isVisitSuccess) { // 闯关失败
showPanel(FailedPanel, data); showPanel(FailedPanel, data);
} else if ((data.prize && data.prize.image) || (data.tool && data.tool.type) || data.level == 120) { // 闯关成功,奖励关卡 } else if (
//120关,如果没有奖品图片,伪造一个 (data.prize && data.prize.image)
if (data.level == 120 && (!data.prize || !data.prize.image)) { || (data.tool && data.tool.type)
data.prize = data.prize || {}; ) { // 闯关成功,奖励关卡
data.prize.image = Tools.baseInfo.levelPrize['level_120'];
}
showPanel(SuccessPrizePanel, data); showPanel(SuccessPrizePanel, data);
} else { // 闯关成功,不是奖励关卡 } else { // 闯关成功,不是奖励关卡
showPanel(SuccessNoPrizePanel, data); showPanel(SuccessNoPrizePanel, data);
......
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import MouseEvent = FYGE.MouseEvent; import MouseEvent = FYGE.MouseEvent;
import { showPanel } from "../../module/ctrls"; import { showPanel } from "../../module/ctrls";
import { TaskPanel } from "./TaskPanel";
export class NoEnergyPanel extends Panel { export class NoEnergyPanel extends Panel {
get groupNames() { get groupNames() {
...@@ -25,6 +26,7 @@ export class NoEnergyPanel extends Panel { ...@@ -25,6 +26,7 @@ export class NoEnergyPanel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.okBtn.addEventListener(MouseEvent.CLICK, () => { this.okBtn.addEventListener(MouseEvent.CLICK, () => {
showPanel(TaskPanel);
this.hidePanel(); this.hidePanel();
}, this); }, this);
} }
......
...@@ -78,8 +78,9 @@ export class StartPanelPrize extends Panel { ...@@ -78,8 +78,9 @@ export class StartPanelPrize extends Panel {
const {level, isPlayed} = this.data; const {level, isPlayed} = this.data;
this.enableMouseEvt(false); this.enableMouseEvt(false);
if (!isPlayed && Tools.propInfo.power <= 0) {// 体力不足 if (!isPlayed && Tools.propInfo.power <= 0) {// 体力不足
showPanel(NoEnergyPanel);
this.enableMouseEvt(true); this.enableMouseEvt(true);
showPanel(NoEnergyPanel);
this.hidePanel();
return; return;
} }
sendTbNet(TbNetName.dojoin, {level: level}, sendTbNet(TbNetName.dojoin, {level: level},
...@@ -87,9 +88,6 @@ export class StartPanelPrize extends Panel { ...@@ -87,9 +88,6 @@ export class StartPanelPrize extends Panel {
this.enableMouseEvt(true); this.enableMouseEvt(true);
if (!success) return; if (!success) return;
// 访问页面埋点
sendTbNet(TbNetName.reportAnalytics, {logkey: 'join'});
Tools.propInfo.power = res.data.power; Tools.propInfo.power = res.data.power;
changeScene(PlayScene, {chapter: level}); changeScene(PlayScene, {chapter: level});
this.hidePanel(); this.hidePanel();
......
...@@ -4,12 +4,19 @@ import { SuccessStarGroup } from "./SuccessNoPrizePanel"; ...@@ -4,12 +4,19 @@ import { SuccessStarGroup } from "./SuccessNoPrizePanel";
import Tween = FYGE.Tween; import Tween = FYGE.Tween;
import Ease = FYGE.Ease; import Ease = FYGE.Ease;
import Sprite = FYGE.Sprite; import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
import { PropType } from "../something/enum/PropType"; import { PropType } from "../something/enum/PropType";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import { changeScene } from "../../module/ctrls"; import { changeScene } from "../../module/ctrls";
import { MapScene } from "../scene/map/MapScene"; import { MapScene } from "../scene/map/MapScene";
import MouseEvent = FYGE.MouseEvent; import MouseEvent = FYGE.MouseEvent;
import Button = FYGE.Button;
import Texture = FYGE.Texture;
const propImg = {
[PropType.BOOMS]: 'boomBtn.png',
[PropType.HAMMERS]: 'hammerBtn.png',
[PropType.STEPS]: 'stepBtn.png'
}
export class SuccessPrizePanel extends Panel { export class SuccessPrizePanel extends Panel {
get groupNames() { get groupNames() {
...@@ -34,57 +41,62 @@ export class SuccessPrizePanel extends Panel { ...@@ -34,57 +41,62 @@ export class SuccessPrizePanel extends Panel {
closeBtn: FYGE.Button; closeBtn: FYGE.Button;
tipsTex: FYGE.TextField; tipsTex: FYGE.TextField;
againBtn: FYGE.Button; tipsTex2: FYGE.TextField;
noPrizeAgainBtn: FYGE.Button;
goPrizeBtn: FYGE.Button;
prizeImg: Sprite; prizeImg: Sprite;
private starGroup: SuccessStarGroup = null; private starGroup: SuccessStarGroup = null;
initUi() { initUi() {
const {level, stars, tool, prize} = this.data;
this.tipsTex.textWidth = 750; this.tipsTex.textWidth = 750;
this.tipsTex.x = 0; this.tipsTex.x = 0;
this.tipsTex.textAlign = TEXT_ALIGN.CENTER; this.tipsTex.textAlign = TEXT_ALIGN.CENTER;
this.tipsTex2.textWidth = 750;
this.tipsTex2.x = 0;
this.tipsTex2.textAlign = TEXT_ALIGN.CENTER;
this.starGroup = this.addChild(new SuccessStarGroup()); this.starGroup = this.addChild(new SuccessStarGroup());
this.starGroup.position.set(375, 648); this.starGroup.position.set(375, 663);
this.prizeImg.anchorTexture.x = 0.5; this.prizeImg.anchorTexture.x = 0.5;
this.prizeImg.x = 375; this.prizeImg.x = 375;
this.starGroup.play(this.data.stars); this.starGroup.play(stars);
if (this.data.tool && this.data.tool.type) { if (tool && tool.type) {
this.againBtn.visible = false; this.tipsTex.text = '\t闯关成功!获得奖励:';
this.goPrizeBtn.visible = false; this.prizeImg.scale.set(1.8, 1.8);
this.tipsTex.text = '闯关成功!获得奖励:'; this.prizeImg.texture = RES.getRes(propImg[tool.type]);
this.prizeImg.scale.set(1.4, 1.4); if (stars == 3) {
switch (this.data.tool.type) { this.tipsTex2.visible = false;
case PropType.BOOMS: this.prizeImg.y = 879;
this.prizeImg.texture = RES.getRes('boomBtn.png'); this.addChild(new Button(RES.getRes('继续闯关大.png')))
break; .addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(163, 1109);
case PropType.HAMMERS:
this.prizeImg.texture = RES.getRes('hammerBtn.png');
break;
case PropType.STEPS:
this.prizeImg.texture = RES.getRes('stepBtn.png');
break;
}
} else if (this.data.prize && this.data.prize.image) {
if (this.data.level == 120) {//120关不显示闯关按钮,换图
this.againBtn.visible = false;
this.goPrizeBtn.visible = false;
this.noPrizeAgainBtn.changeTexture(RES.getRes("开奖按钮120.png"))
} else { } else {
this.noPrizeAgainBtn.visible = false; this.tipsTex2.text = '满星通关可抽取更大奖励哦';
this.addChild(new Button(RES.getRes('继续闯关小.png')))
.addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(388, 1145);
this.addChild(new Button(RES.getRes('闯关成功不满星按钮.png')))
.addEventListener(MouseEvent.CLICK, this.again, this)
.position.set(100, 1145);
} }
} else if (prize && prize.image) {
this.prizeImg.texture = Texture.fromUrl(prize.image);
this.tipsTex2.text = '奖品可以在“我的奖品”页面查看';
this.addChild(new Button(RES.getRes('继续闯关红.png')))
.addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(388, 1145);
this.prizeImg.texture = Texture.fromUrl(this.data.prize.image); this.addChild(new Button(RES.getRes('查看奖品.png')))
// this.tipsTex.text = '\t\t闯关成功!获得抽大奖机会!'; .addEventListener(MouseEvent.CLICK, this.lookPrize, this)
this.tipsTex.text = '\t闯关成功!有机会抽取如下奖品'; .position.set(100, 1145);
} }
} }
...@@ -92,6 +104,16 @@ export class SuccessPrizePanel extends Panel { ...@@ -92,6 +104,16 @@ export class SuccessPrizePanel extends Panel {
super.start(); super.start();
} }
/**
* 查看奖品
*/
private lookPrize() {
/// TODO 查看奖品
console.log('查看奖品');
changeScene(MapScene);
super.hidePanel();
}
/** /**
* 挑战满星 * 挑战满星
*/ */
...@@ -112,13 +134,6 @@ export class SuccessPrizePanel extends Panel { ...@@ -112,13 +134,6 @@ export class SuccessPrizePanel extends Panel {
super.hidePanel(); super.hidePanel();
} }
public goPrize() {
// 去抽奖
super.hidePanel();
}
public hidePanel() { public hidePanel() {
changeScene(MapScene); changeScene(MapScene);
super.hidePanel(); super.hidePanel();
...@@ -126,9 +141,6 @@ export class SuccessPrizePanel extends Panel { ...@@ -126,9 +141,6 @@ export class SuccessPrizePanel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.againBtn.addEventListener(MouseEvent.CLICK, this.continue, this);
this.noPrizeAgainBtn.addEventListener(MouseEvent.CLICK, this.continue, this);
this.goPrizeBtn.addEventListener(MouseEvent.CLICK, this.goPrize, this);
} }
removeEvents() { removeEvents() {
......
...@@ -223,7 +223,7 @@ export class MapScene extends Scene { ...@@ -223,7 +223,7 @@ export class MapScene extends Scene {
// Tools.gameOver({ // Tools.gameOver({
// level: 1, // level: 1,
// score: 666, // score: 666,
// stars: 3, // stars: 2,
// isVisitSuccess: true, // isVisitSuccess: true,
// isPrizeLevel: false, // isPrizeLevel: false,
// // tool: { // // tool: {
......
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