Commit a98ac94a authored by wjf's avatar wjf

Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev

parents 30648b97 9d475ad7
......@@ -82,6 +82,7 @@ export enum NetName {
SCRATCH_TAKEPRIZE,
SCRATCH_GET_SHARECODE,
SCRATCH_DOHELP,
HBRAIN_BASEINFO,
}
\ No newline at end of file
......@@ -2187,4 +2187,43 @@ export class NetManager extends ABNetManager {
};
this.send(net);
}
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////////// 消消乐红包雨 /////////////////////////////////////
/**
* 红包雨 - 基础信息查询
* @param callback
*/
public hbRainBaseInfo(callback: Function): void {
const net: INetData = {
name: NetName.HBRAIN_BASEINFO,
uri: window['duiba'] +'/customActivity/happyclear/redRain/baseInfo',
type: 'get',
dataType: 'json',
hideMsg: true,
param: {
activityId: DataManager.ins.customCfgData.actId,
},
callback: callback
};
this.send(net);
}
public hbRainDoJoin(callback: Function, session, score): void {
const net: INetData = {
name: NetName.HBRAIN_BASEINFO,
uri: window['duiba'] +'/customActivity/happyclear/redRain/doJoin',
type: 'get',
dataType: 'json',
hideMsg: true,
param: {
activityId: DataManager.ins.customCfgData.actId,
session: session,
score: score,
detect: window['detect'],
deviceSessionId: window['_device_session_id']
},
callback: callback
};
this.send(net);
}
///////////////////////////////////////////////////////////////////////////////////
}
\ No newline at end of file
......@@ -177,7 +177,7 @@
"name": "turntableprize"
},
{
"keys": "hbCutTimeFont_fnt,hbCutTimeFont_png,hbCutTime_bg_png,hbCutTime_btn_disable_png,hbCutTime_btn_enable_png,hbCutTime_cutLine_disable_png,hbCutTime_cutLine_enable_png",
"keys": "hbCutTimeFont_fnt,hbCutTimeFont_png,hbCutTime_bg_png,hbCutTime_btn_disable_png,hbCutTime_btn_enable_png,hbCutTime_cutLine_disable_png,hbCutTime_cutLine_enable_png,hbCutTime_rule_btn_png",
"name": "hbcuttime"
},
{
......@@ -189,7 +189,7 @@
"name": "hbnoprize"
},
{
"keys": "hbGameCutTimeFont_fnt,hbGameCutTimeFont_png,hbGame_CutTime_bg_png,hbGame_CutTime_progress_png,hbGame_num_bg_png,hbGame_tips_png,hbGame_1_png,hbGame_2_png,hbGame_3_png,hbGame_+1_png,hbGame_bird_touch_png,hbGame_bird_png,hbGame_cattle_png,hbGame_cattle_touch_png,hbGame_hongbao_touch_png,hbGame_+2_png,hbGame_hongbao_png,hbGame_lion_png,hbGame_lion_touch_png,hbGame_pig_touch_png,hbGame_pig_png,hbGame_rabbit_touch_png,hbGame_rabbit_png,hbGameScoreFont_fnt,hbGameScoreFont_png",
"keys": "hbGameCutTimeFont_fnt,hbGameCutTimeFont_png,hbGame_CutTime_bg_png,hbGame_CutTime_progress_png,hbGame_num_bg_png,hbGame_tips_png,hbGame_1_png,hbGame_2_png,hbGame_3_png,hbGame_+1_png,hbGame_bird_touch_png,hbGame_bird_png,hbGame_cattle_png,hbGame_cattle_touch_png,hbGame_hongbao_touch_png,hbGame_+2_png,hbGame_hongbao_png,hbGame_lion_png,hbGame_lion_touch_png,hbGame_pig_touch_png,hbGame_pig_png,hbGame_rabbit_touch_png,hbGame_rabbit_png,hbGameScoreFont_fnt,hbGameScoreFont_png,hbGame_CutTime_btn_png",
"name": "hbgame"
},
{
......@@ -3242,6 +3242,16 @@
"url": "assets/hbGame/hbGameScoreFont.png",
"type": "image",
"name": "hbGameScoreFont_png"
},
{
"url": "assets/hbCutTime/hbCutTime_rule_btn.png",
"type": "image",
"name": "hbCutTime_rule_btn_png"
},
{
"url": "assets/hbGame/hbGame_CutTime_btn.png",
"type": "image",
"name": "hbGame_CutTime_btn_png"
}
]
}
\ No newline at end of file
......@@ -13,7 +13,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="ok_btn" label="" y="692" anchorOffsetX="150" anchorOffsetY="48" horizontalCenter="0">
<e:Button id="ok_btn" label="" y="668" anchorOffsetX="150" anchorOffsetY="48" horizontalCenter="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="hbCutTime_btn_enable_png" source.down="hbCutTime_btn_enable_png" source.disabled="hbCutTime_btn_disable_png"/>
......@@ -21,4 +21,12 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="rule_btn" label="" y="740" horizontalCenter="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="hbCutTime_rule_btn_png" source.down="hbCutTime_rule_btn_png" source.disabled="hbCutTime_rule_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Skin>
\ No newline at end of file
......@@ -6,13 +6,17 @@
<e:Image y="0" source="hbGame_num_bg_png" horizontalCenter="0"/>
<e:BitmapLabel id="scoreLabel" y="33" text="0" horizontalCenter="0" font="hbGameScoreFont_fnt"/>
</e:Group>
<e:Group y="45" horizontalCenter="0">
<e:Image y="0" horizontalCenter="0" source="hbGame_CutTime_bg_png"/>
<e:Image y="30" source="hbGame_CutTime_progress_png" horizontalCenter="-0.5"/>
<e:BitmapLabel id="cutTimeLabel" y="65" text="60" font="hbGameCutTimeFont_fnt" horizontalCenter="0"/>
<e:Group y="45" horizontalCenter="0" height="154">
<e:Image id="timeBtn" y="0" horizontalCenter="0" x="10" source="hbGame_CutTime_btn_png"/>
<e:Image y="25" horizontalCenter="0" source="hbGame_CutTime_bg_png"/>
<e:Image y="32" source="hbGame_CutTime_progress_png" horizontalCenter="-0.5"/>
<e:BitmapLabel id="cutTimeLabel" y="67" text="60" font="hbGameCutTimeFont_fnt" horizontalCenter="0.5"/>
</e:Group>
<e:Group id="readyGroup" y="310.5" horizontalCenter="0" width="560" height="500">
<e:Image id="readyTips" y="0" horizontalCenter="0" source="hbGame_tips_png"/>
<e:Image id="readyCutTime" y="118" horizontalCenter="0" x="10" source="hbGame_1_png"/>
<e:Group id="readyGroup" y="310.5" horizontalCenter="0" width="560" height="710" anchorOffsetY="0">
<e:Label id="tipLabel" text="抢到15个红包才有奖励哦~" y="480" fontFamily="FZY3JW" horizontalCenter="0"/>
<e:Label text="点击所有动物均可累积双份红包" y="520" fontFamily="FZY3JW" horizontalCenter="0"/>
<e:Image y="566" source="hbGame_lion_touch_png" horizontalCenter="-37.5"/>
<e:Image y="597" source="hbGame_+2_png" horizontalCenter="82"/>
<e:Image id="readyCutTime" y="95" horizontalCenter="0" x="10" source="hbGame_1_png"/>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -34,7 +34,6 @@ export default class MapRpeatPart extends ComponentBase {
MapScene.starHash[levelOrder] = star;
icon.addChild(star);
icon['visibleY'] = this._topHeight + this.height * this._index + icon.y;
console.log(icon['visibleY'] );
}
this['animal1'].visible = this._index % 2;
......
......@@ -91,7 +91,7 @@ export default class MapScene extends Scene {
this.sendInvite();
// PanelCtrl.instance.show("HbGame");
PanelCtrl.instance.show("HbCutTime");
this.updateMyInfo();
this.updateAdData();
......
......@@ -23,7 +23,6 @@ export default class MapTopPart extends ComponentBase {
icon['mappart']=this;
icon.show = ()=>{this.addChild(icon)};
icon['visibleY'] = icon.y;
console.log(icon['visibleY']);
}
}
......
import Panel from "../../../libs/new_wx/components/Panel";
import CutTimer from "../../CutTimer";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
/**
* 红包雨倒计时
*/
export default class HbCutTime extends Panel {
public cutTimeLabel: eui.BitmapLabel;
public cutTime: eui.Image;
public closeBtn: eui.Button;
public ok_btn: eui.Button;
public cutTimeLabel:eui.BitmapLabel;
public cutTime:eui.Image;
public closeBtn:eui.Button;
public ok_btn:eui.Button;
public rule_btn:eui.Button;
private cutTimer: CutTimer = null;
......@@ -37,12 +39,18 @@ export default class HbCutTime extends Panel {
super.initEvents();
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
this.rule_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.tapRuleBtn, this);
}
private tapRuleBtn(){
}
removeEvents() {
super.removeEvents();
this.closeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
this.rule_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.tapRuleBtn, this);
}
onTouchTap_closeBtn() {
......@@ -50,7 +58,7 @@ export default class HbCutTime extends Panel {
}
onTouchOK() {
PanelCtrl.instance.show('HbGame');
}
protected get closeBtns(): eui.Button[] {
......
......@@ -2,6 +2,7 @@ import Panel from "../../../libs/new_wx/components/Panel";
import RainMgr from "./RainMgr";
import CutTimer from "../../CutTimer";
import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import { HtmlTextParser } from "../../../libs/new_wx/HtmlTextParser";
/**
* 红包雨主游戏
......@@ -10,9 +11,10 @@ export default class HbGame extends Panel {
public rainGroup: eui.Group;
public scoreGroup: eui.Group;
public scoreLabel: eui.BitmapLabel;
public timeBtn: eui.Image;
public cutTimeLabel: eui.BitmapLabel;
public readyGroup: eui.Group;
public readyTips: eui.Image;
public tipLabel: eui.Label;
public readyCutTime: eui.Image;
private rainMgr: RainMgr = null;
......@@ -35,8 +37,10 @@ export default class HbGame extends Panel {
initUI() {
this.rainGroup.height = this.width / window.innerWidth * window.innerHeight;
this.tipLabel.textFlow = (new HtmlTextParser).parser(`抢到<b>${15}</b>个红包才有奖励哦~`);
this.time = 60;
this.cutTimeLabel.text =`${this.time}`
this.cutTimeLabel.text = `${this.time}`
}
// 加分
......@@ -50,7 +54,7 @@ export default class HbGame extends Panel {
private gameOver() {
this.cutTime.stop();
this.cutTime.removeEventListener(egret.TimerEvent.TIMER,this.timeCallFun, this);
this.cutTime.removeEventListener(egret.TimerEvent.TIMER, this.timeCallFun, this);
GDispatcher.dispatchEvent('hbRainGameOver');
}
......@@ -64,9 +68,9 @@ export default class HbGame extends Panel {
this.cutTime.start();
}
private timeCallFun(){
private timeCallFun() {
this.cutTimeLabel.text = `${--this.time}`;
if(this.time <= 0){
if(this.time <= 0) {
this.gameOver();
}
}
......@@ -91,6 +95,9 @@ export default class HbGame extends Panel {
egret.Tween.get(obj).to({scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1}, t2).call(() => {
this.readyGroup.visible = false;
this.startGame();
egret.Tween.get(this.timeBtn).to({y: 8}, 100).call(() => {
egret.Tween.get(this.timeBtn).to({y: 0}, 100);
});
})
});
})
......@@ -100,8 +107,8 @@ export default class HbGame extends Panel {
}
private readyTipsEffect() {
this.readyTips.alpha = 0;
egret.Tween.get(this.readyTips).to({alpha: 1}, 300).call(() => this.readyTimeEffect());
this.readyGroup.alpha = 0;
egret.Tween.get(this.readyGroup).to({alpha: 1}, 300).call(() => this.readyTimeEffect());
}
protected onSkinComplete() {
......
......@@ -35,11 +35,12 @@ export default class RainMgr {
GDispatcher.addEvent('hbRainGameOver', this.gameOver, this);
this.timer = new egret.Timer(1500, 0);
this.timer = new egret.Timer(1400, 0);
this.timer.addEventListener(egret.TimerEvent.TIMER, this.addRain, this);
this.timer.start();
}
// 添加掉落物品
private addRain() {
let num = Utils.RandomInt(3, 6);
for(let i = 0; i < num; i++) {
......@@ -53,7 +54,7 @@ export default class RainMgr {
}
setTimeout(()=>{
newRainObj.addStage((this.rainGroup.width) / num * i + 100, Utils.RandomInt(7, 10) / 10);
}, Utils.RandomInt(0, 6) * 100);
}, Utils.RandomInt(0, 7) * 100);
}
}
......
......@@ -17,7 +17,6 @@ export default class RainObj {
public addStage(x, scale) {
this.module.x = x;
console.log(x);
this.module.y = -200;
this.module.scaleX = this.module.scaleY = scale;
this.module.visible = true;
......@@ -34,18 +33,47 @@ export default class RainObj {
}
private touchTap() {
GDispatcher.dispatchEvent('hbGameAddScore', RainData.data[this.data.key].score);
this.module.source = `hbGame_${this.data.key}_touch_png`;
egret.Tween.removeTweens(this.module);
this.moduleEffect(); // 模型特效
GDispatcher.dispatchEvent('hbGameAddScore', RainData.data[this.data.key].score); // 加分
this.addScoreEffect(); // 添加分数特效
this.destroy();
}
// 模型特效
private moduleEffect() {
let _scaleX = this.module.scaleX;
let _scaleY = this.module.scaleY;
egret.Tween.get(this.module).to({scaleX: _scaleX + 0.2, scaleY: _scaleY + 0.2}, 100).call(() => {
this.module.source = `hbGame_${this.data.key}_touch_png`;
egret.Tween.get(this.module).to({scaleX: _scaleX, scaleY: _scaleY}, 100);
});
}
// 添加分数特效
private addScoreEffect() {
setTimeout(() => {
let score = new eui.Image(`hbGame_+${RainData.data[this.data.key].score}_png`);
let _x = score.x = this.module.x - 20;
let _y = score.y = this.module.y;
score.scaleY = score.scaleX = 0.3;
score.alpha = 0;
this.rainGroup.addChild(score);
egret.Tween.get(score).to({y: _y - 60, scaleX: 1, scaleY: 1, alpha: 1}, 400).call(() => {
egret.Tween.get(score).to({y: _y - 120, alpha: 0}, 400).call(() => {
score.visible = false
});
});
}, 500);
}
private destroy() {
egret.Tween.removeTweens(this.module);
this.module.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.touchTap, this);
this.module.touchEnabled = false;
setTimeout(() => {
this.rainGroup.removeChild(this.module);
this.data.pool.push(this);
}, 1000);
}, 600);
}
}
\ No newline at end of file
......@@ -162,6 +162,13 @@ const config = {
'/customActivity/happyclear/scratchCard/doHelp':{
data: './happyclear/scratchDoHelp.json'
},
//////////////////// 消消乐红包雨 ////////////////////
'/customActivity/happyclear/redRain/baseInfo':{
data: './happyclear/hbRainBaseInfo.json'
},
'/customActivity/happyclear/redRain/doJoin':{
data: './happyclear/hbRainDoJoin.json'
},
}
for (let item in config) {
......
{
"code": "0000000000",
"data": {
"canJoin": true,
"currentRemainTimes": 1,
"currentSession": {
"endTime": 1572921059355,
"sessionIndex": 1,
"startTime": 1572921059355
},
"nextSession": {
"endTime": 1572921059355,
"sessionIndex": 1,
"startTime": 1572921059355
}
},
"desc": "OK",
"success": true,
"timestamp": 1572921059357
}
\ No newline at end of file
{
"code": "0000000000",
"data": {
"option": {
"appItemId": 2322,
"categoryType": 1,
"coinType": 1,
"img": "1",
"maxValue": 2,
"minValue": 1,
"name": "测试商品",
"num": 3,
"propType": 2,
"rate": "概率",
"title": "商品信息",
"value": "虚拟商品标识符"
},
"orderNum": "1234232546"
},
"desc": "OK",
"success": true,
"timestamp": 1572921692831
}
\ No newline at end of file
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