Commit 2b4ba458 authored by wildfirecode's avatar wildfirecode

1

parents 89be9c43 bd6bb07f
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
<script src="libs/fileSave.js"></script> <script src="libs/fileSave.js"></script>
<img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;"/> <img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;"/>
<script> <script>
window['hbRainTime'] = 30;
window['plugs'] = [1, 2, 3] window['plugs'] = [1, 2, 3]
// localStorage.clear(); // localStorage.clear();
window['isInvitePage'] = 0; window['isInvitePage'] = 0;
......
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
"name": "turntableprize" "name": "turntableprize"
}, },
{ {
"keys": "hbCutTime_bg_png,hbCutTime_btn_disable_png,hbCutTime_btn_enable_png,hbCutTime_cutLine_disable_png,hbCutTime_cutLine_enable_png,hbCutTime_rule_btn_png,hbCutTime_btn_null_png", "keys": "hbCutTime_bg_png,hbCutTime_btn_disable_png,hbCutTime_btn_enable_png,hbCutTime_cutLine_disable_png,hbCutTime_cutLine_enable_png,hbCutTime_rule_btn_png,hbCutTime_btn_null_png,hbCutTime_btn_soon_png",
"name": "hbcuttime" "name": "hbcuttime"
}, },
{ {
...@@ -199,6 +199,13 @@ ...@@ -199,6 +199,13 @@
{ {
"keys": "redbagtips_ele_png,redbagtips_ele1_png,redbagtips_ele2_png,redbagtips_ele3_png,redbagtips_light_png,redbagtips按钮_png,redbagtips活动规则_png,redbagtipsbg_png,redbagtips_ele7_png", "keys": "redbagtips_ele_png,redbagtips_ele1_png,redbagtips_ele2_png,redbagtips_ele3_png,redbagtips_light_png,redbagtips按钮_png,redbagtips活动规则_png,redbagtipsbg_png,redbagtips_ele7_png",
"name": "redbombtips" "name": "redbombtips"
<<<<<<< HEAD
=======
},
{
"keys": "maplight2_png",
"name": "preload"
>>>>>>> bd6bb07f34bd63dfe98b4deac04c19fb31c46a3a
} }
], ],
"resources": [ "resources": [
...@@ -3533,6 +3540,11 @@ ...@@ -3533,6 +3540,11 @@
"url": "assets/map/maplight2.png", "url": "assets/map/maplight2.png",
"type": "image", "type": "image",
"name": "maplight2_png" "name": "maplight2_png"
},
{
"url": "assets/hbCutTime/hbCutTime_btn_soon.png",
"type": "image",
"name": "hbCutTime_btn_soon_png"
} }
] ]
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ import IconBase from "./IconBase"; ...@@ -2,6 +2,7 @@ import IconBase from "./IconBase";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { GDispatcher } from "../../../libs/tc/util/GDispatcher"; import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import { NetManager } from "../../../libs/tw/manager/NetManager"; import { NetManager } from "../../../libs/tw/manager/NetManager";
import CutTimer from "../../CutTimer";
export default class HbRainIcon extends IconBase { export default class HbRainIcon extends IconBase {
...@@ -18,11 +19,17 @@ export default class HbRainIcon extends IconBase { ...@@ -18,11 +19,17 @@ export default class HbRainIcon extends IconBase {
private updateIcon() { private updateIcon() {
NetManager.ins.hbRainBaseInfo((success, res) => { NetManager.ins.hbRainBaseInfo((success, res) => {
if(!success) { if(!success) {
if(res.code == "600054" || res.code == "600055"){ if(res.code == "600054" || res.code == "600055") {
this.visible = false; this.visible = false;
} }
return; return;
} }
const data = res.data;
if(!data.currentSession && !data.nextSession) {
this.visible = false;
return;
}
this.visible = true;
}) })
} }
...@@ -33,16 +40,20 @@ export default class HbRainIcon extends IconBase { ...@@ -33,16 +40,20 @@ export default class HbRainIcon extends IconBase {
protected onTouchBtn(e: egret.TouchEvent) { protected onTouchBtn(e: egret.TouchEvent) {
super.onTouchBtn(e); super.onTouchBtn(e);
PanelCtrl.instance.show("HbCutTime"); NetManager.ins.hbRainBaseInfo((success, res) => {
PanelCtrl.instance.show("HbCutTime", {res: res});
});
GDispatcher.dispatchEvent('closeActBtn'); GDispatcher.dispatchEvent('closeActBtn');
} }
protected initEvents() { protected initEvents() {
super.initEvents(); super.initEvents();
GDispatcher.addEvent('updateHbRainIcon', this.updateIcon, this);
} }
protected removeEvents() { protected removeEvents() {
super.removeEvents(); super.removeEvents();
GDispatcher.removeEvent('updateHbRainIcon', this.updateIcon, this);
} }
protected destory() { protected destory() {
......
...@@ -31,16 +31,18 @@ export default class HbCutTime extends Panel { ...@@ -31,16 +31,18 @@ export default class HbCutTime extends Panel {
} }
private hbRainBaseInfo() { private hbRainBaseInfo() {
NetManager.ins.hbRainBaseInfo((success, res) => { const success = this.data.res.success;
const res = this.data.res;
const data = this.data.res.data;
if(!success) { if(!success) {
this.ok_btn.source = 'hbCutTime_btn_null_png'; this.ok_btn.source = 'hbCutTime_btn_soon_png';
this.tipImage.source = 'hbCutTime_cutLine_disable_png'; this.tipImage.source = 'hbCutTime_cutLine_disable_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this); this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
return; return;
} }
let data = res.data;
this.cutTimer = new CutTimer(this.cutTimeLabel, 'hh时mm分ss秒', () => this.hidePanel()); this.cutTimer = new CutTimer(this.cutTimeLabel, 'hh时mm分ss秒', () => this.hidePanel());
let sysTime = res.timestamp; // 当前系统事件 let sysTime = res.timestamp; // 当前系统时间
let time; let time;
if(data.currentSession) { if(data.currentSession) {
time = data.currentSession.endTime - sysTime + 3000; time = data.currentSession.endTime - sysTime + 3000;
...@@ -58,7 +60,7 @@ export default class HbCutTime extends Panel { ...@@ -58,7 +60,7 @@ export default class HbCutTime extends Panel {
} }
} else if(data.nextSession) { } else if(data.nextSession) {
time = data.nextSession.startTime - sysTime + 3000; time = data.nextSession.startTime - sysTime + 3000;
this.ok_btn.source = 'hbCutTime_btn_disable_png'; this.ok_btn.source = 'hbCutTime_btn_soon_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this); this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
this.tipImage.source = 'hbCutTime_cutLine_disable_png'; this.tipImage.source = 'hbCutTime_cutLine_disable_png';
if(!this.cutTimer.start(time)) { if(!this.cutTimer.start(time)) {
...@@ -70,11 +72,10 @@ export default class HbCutTime extends Panel { ...@@ -70,11 +72,10 @@ export default class HbCutTime extends Panel {
this.tipImage.source = 'hbCutTime_cutLine_disable_png'; this.tipImage.source = 'hbCutTime_cutLine_disable_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this); this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
} }
})
} }
destroy() { destroy() {
if(this.cutTimer){ if(this.cutTimer) {
this.cutTimer.stop(); this.cutTimer.stop();
} }
super.destroy(); super.destroy();
...@@ -112,7 +113,7 @@ export default class HbCutTime extends Panel { ...@@ -112,7 +113,7 @@ export default class HbCutTime extends Panel {
} }
onTouchOK() { onTouchOK() {
PanelCtrl.instance.show('HbGame'); PanelCtrl.instance.show('HbGame', {needScore: this.data.res.data.currentSession.limitScore});
} }
protected get closeBtns(): eui.Button[] { protected get closeBtns(): eui.Button[] {
......
...@@ -25,7 +25,7 @@ export default class HbGame extends Panel { ...@@ -25,7 +25,7 @@ export default class HbGame extends Panel {
private rainMgr: RainMgr = null; private rainMgr: RainMgr = null;
private cutTime: egret.Timer = null; private cutTime: egret.Timer = null;
private time: number = 15; private time: number = window['hbRainTime'];
private score = 0; private score = 0;
private scoreLabelStr = 0; private scoreLabelStr = 0;
...@@ -44,7 +44,7 @@ export default class HbGame extends Panel { ...@@ -44,7 +44,7 @@ export default class HbGame extends Panel {
initUI() { initUI() {
this.rainGroup.height = this.width / window.innerWidth * window.innerHeight; this.rainGroup.height = this.width / window.innerWidth * window.innerHeight;
this.tipLabel.textFlow = (new HtmlTextParser).parser(`抢到<b>${15}</b>个红包才有奖励哦~`); this.tipLabel.textFlow = (new HtmlTextParser).parser(`抢到<b>${this.data.needScore}</b>个红包才有奖励哦~`);
this.cutTimeLabel.text = `${this.time}` this.cutTimeLabel.text = `${this.time}`
} }
...@@ -61,7 +61,7 @@ export default class HbGame extends Panel { ...@@ -61,7 +61,7 @@ export default class HbGame extends Panel {
private gameOver() { private gameOver() {
this.cutTime.stop(); this.cutTime.stop();
this.cutTime.removeEventListener(egret.TimerEvent.TIMER, this.timeCallFun, this); this.cutTime.removeEventListener(egret.TimerEvent.TIMER, this.timeCallFun, this);
GDispatcher.dispatchEvent('hbRainGameOver'); this.rainMgr.gameOver();
this.hbDoJoin(); this.hbDoJoin();
} }
......
import Panel from "../../../libs/new_wx/components/Panel"; import Panel from "../../../libs/new_wx/components/Panel";
import { DataManager } from "../../../libs/tw/manager/DataManager";
import { HtmlTextParser } from "../../../libs/new_wx/HtmlTextParser"; import { HtmlTextParser } from "../../../libs/new_wx/HtmlTextParser";
import getSkinPath from "../../../libs/new_wx/utils/getSkinPath"; import getSkinPath from "../../../libs/new_wx/utils/getSkinPath";
...@@ -32,18 +31,20 @@ export default class HbRule extends Panel { ...@@ -32,18 +31,20 @@ export default class HbRule extends Panel {
private addRule() { private addRule() {
const text = const text =
`<br>1、用户每天邀请指定数量的新玩家参与闯关,可获得指定的现金券奖励。 `<br>1、红包雨活动在当天多个时间段开启;每个时间段,所有用户均有1次参与机会,奖励先到先得。
2、用户发起邀请后,需在24小时内完成邀请任务;超过24小时,邀请任务失败,无法获得奖励,需重新发起邀请。 2、在倒计时结束后,收集红包达到目标数量可获得奖励;未达到目标数量,则无法获得奖励。
3、新用户仅包含未参与过狮狮连萌活动的用户。 3、游戏过程中,点击1个红包记为1个红包,点击1个动物元素记为2个红包。
4、用户不可为自己助力,或重复为好友助力。 4、发放的奖励请在规定的有效时间内尽快领取或使用,逾期未领取或使用的会失效哦。
5、完成邀请任务后,玩家可点击首页“邀请得现金券”图标领取现金券。 5、活动过程中,凡以不正当手段(包括但不限于作弊、恶意套现、扰乱系统、网络攻击等违规行为)参与本次活动的用户,苏宁易购有权终止其参加活动,并取消其获得奖励的资格。
6、发放的奖励请在规定的有效时间内尽快领取或使用,逾期未领取或使用的会失效哦。 6、极少数特殊情况下,若用户在完成活动的任务中被系统判定异常账户或风控账户,则可能导致奖励发放异常。
7、活动过程中,凡以不正当手段(包括但不限于作弊、恶意套现、扰乱系统、网络攻击等违规行为)参与本次活动的用户,苏宁易购有权终止其参加活动,并取消其获得奖励的资格。 7、如遇不可抗力(包括但不限于重大自然灾害事件、活动受政府机关指令需要停止举办或调整的、活动遭受严重网络攻击不能正常进行的),苏宁易购有权取消、修改或暂停活动`
8、极少数特殊情况下,若用户在完成活动的任务中被系统判定异常账户或风控账户,则可能导致奖励发放异常。
9、如遇不可抗力(包括但不限于重大自然灾害事件、活动受政府机关指令需要停止举办或调整的、活动遭受严重网络攻击不能正常进行的),苏宁易购有权取消、修改或暂停活动。`
this.labContent.textFlow = (new HtmlTextParser).parser(text); this.labContent.textFlow = (new HtmlTextParser).parser(text);
} }
protected onSkinComplete() {
}
get skinKey() { get skinKey() {
return 'HbRule' return 'HbRule'
} }
......
...@@ -21,7 +21,7 @@ export default class RainMgr { ...@@ -21,7 +21,7 @@ export default class RainMgr {
this.start(); this.start();
} }
private gameOver() { public gameOver() {
this.timer.stop(); // 停止计时器 this.timer.stop(); // 停止计时器
// 隐藏全部掉落物品 // 隐藏全部掉落物品
...@@ -61,7 +61,11 @@ export default class RainMgr { ...@@ -61,7 +61,11 @@ export default class RainMgr {
private addPool() { private addPool() {
this.rainPool = new Pooling(); this.rainPool = new Pooling();
for(let v of RainData.key) { for(let v of RainData.key) {
for(let i = 0; i < 10; i++) { let num = 1;
if(v == 'hongbao'){
num = 45;
}
for(let i = 0; i < num; i++) {
let newObj = new RainObj({ let newObj = new RainObj({
key: v, key: v,
rainGroup: this.rainGroup, rainGroup: this.rainGroup,
......
import { GDispatcher } from "../../../libs/tc/util/GDispatcher"; import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import RainData from "./RainData"; import RainData from "./RainData";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
export default class RainObj { export default class RainObj {
private data = null; private data = null;
...@@ -47,7 +50,21 @@ export default class RainObj { ...@@ -47,7 +50,21 @@ export default class RainObj {
let _scaleY = this.module.scaleY; let _scaleY = this.module.scaleY;
egret.Tween.get(this.module).to({scaleX: _scaleX + 0.2, scaleY: _scaleY + 0.2}, 100).call(() => { 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`; this.module.source = `hbGame_${this.data.key}_touch_png`;
egret.Tween.get(this.module).to({scaleX: _scaleX, scaleY: _scaleY}, 100); egret.Tween.get(this.module).to({scaleX: _scaleX, scaleY: _scaleY}, 100).call(()=>{
if(this.data.key == 'hongbao'){
loadSvga(getResPath() + 'resource/assets/svgas/hbRainHb.svga', this.rainGroup).then(async (mv: any) => {
mv.addEventListener(egret.Event.COMPLETE, () => {
this.rainGroup.removeChild(mv);
}, this);
mv.x = this.module.x - 180 * this.module.scaleX;
mv.y = this.module.y - 250 * this.module.scaleY;
mv.scaleX = this.module.scaleX;
mv.scaleY = this.module.scaleY;
this.rainGroup.addChild(mv);
});
}
egret.Tween.get(this.module).to({alpha: 0}, 500);
})
}); });
} }
......
...@@ -6,15 +6,17 @@ ...@@ -6,15 +6,17 @@
"currentSession": { "currentSession": {
"endTime": 157292106000, "endTime": 157292106000,
"sessionIndex": 1, "sessionIndex": 1,
"limitScore": 10,
"startTime": 157292105000 "startTime": 157292105000
}, },
"nextSession": { "nextSession": {
"endTime": 157292106000, "endTime": 157292106000,
"sessionIndex": 2, "sessionIndex": 2,
"limitScore": 66,
"startTime": 157292105000 "startTime": 157292105000
} }
}, },
"desc": "OK", "desc": "OK",
"success": false, "success": true,
"timestamp": 157292100000 "timestamp": 157292100000
} }
\ 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