Commit 6fe5106f authored by 邱旭's avatar 邱旭

1

parent e3c7f4dd
......@@ -60,6 +60,7 @@
<script src="libs/fileSave.js"></script>
<img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;"/>
<script>
window['hbRainTime'] = 30;
window['plugs'] = [1, 2, 3]
// localStorage.clear();
window['isInvitePage'] = 0;
......
......@@ -177,7 +177,7 @@
"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"
},
{
......@@ -201,8 +201,8 @@
"name": "redbombtips"
},
{
"name": "preload",
"keys": "maplight2_png"
"keys": "maplight2_png",
"name": "preload"
}
],
"resources": [
......@@ -3534,9 +3534,14 @@
"subkeys": "反馈1_00000,反馈1_00001,反馈1_00002,反馈1_00003,反馈1_00004,反馈1_00005,反馈1_00006,反馈1_00007,反馈1_00008,反馈1_00009,反馈1_00010,反馈1_00011,反馈1_00012,反馈1_00013,反馈1_00014,反馈1_00015,反馈1_00016,反馈1_00017,反馈1_00018,反馈1_00019,反馈1_00020,反馈1_00021,反馈1_00022,反馈1_00023,反馈1_00024,反馈1_00025,反馈1_00026,反馈1_00027,反馈1_00028"
},
{
"name": "maplight2_png",
"url": "assets/map/maplight2.png",
"type": "image",
"url": "assets/map/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";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import CutTimer from "../../CutTimer";
export default class HbRainIcon extends IconBase {
......@@ -18,11 +19,17 @@ export default class HbRainIcon extends IconBase {
private updateIcon() {
NetManager.ins.hbRainBaseInfo((success, res) => {
if(!success) {
if(res.code == "600054" || res.code == "600055"){
if(res.code == "600054" || res.code == "600055") {
this.visible = false;
}
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 {
protected onTouchBtn(e: egret.TouchEvent) {
super.onTouchBtn(e);
PanelCtrl.instance.show("HbCutTime");
NetManager.ins.hbRainBaseInfo((success, res) => {
PanelCtrl.instance.show("HbCutTime", {res: res});
});
GDispatcher.dispatchEvent('closeActBtn');
}
protected initEvents() {
super.initEvents();
GDispatcher.addEvent('updateHbRainIcon', this.updateIcon, this);
}
protected removeEvents() {
super.removeEvents();
GDispatcher.removeEvent('updateHbRainIcon', this.updateIcon, this);
}
protected destory() {
......
......@@ -31,50 +31,51 @@ export default class HbCutTime extends Panel {
}
private hbRainBaseInfo() {
NetManager.ins.hbRainBaseInfo((success, res) => {
if(!success) {
this.ok_btn.source = 'hbCutTime_btn_null_png';
this.tipImage.source = 'hbCutTime_cutLine_disable_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
return;
}
let data = res.data;
this.cutTimer = new CutTimer(this.cutTimeLabel, 'hh时mm分ss秒', () => this.hidePanel());
let sysTime = res.timestamp; // 当前系统事件
let time;
if(data.currentSession) {
time = data.currentSession.endTime - sysTime + 3000;
if(data.canJoin) {
this.ok_btn.source = 'hbCutTime_btn_enable_png';
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
} else {
this.ok_btn.source = 'hbCutTime_btn_disable_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
}
this.tipImage.source = 'hbCutTime_cutLine_enable_png';
if(!this.cutTimer.start(time)) {
this.cutTimer.stop();
this.cutTimer.start(time);
}
} else if(data.nextSession) {
time = data.nextSession.startTime - sysTime + 3000;
this.ok_btn.source = 'hbCutTime_btn_disable_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
this.tipImage.source = 'hbCutTime_cutLine_disable_png';
if(!this.cutTimer.start(time)) {
this.cutTimer.stop();
this.cutTimer.start(time);
}
const success = this.data.res.success;
const res = this.data.res;
const data = this.data.res.data;
if(!success) {
this.ok_btn.source = 'hbCutTime_btn_soon_png';
this.tipImage.source = 'hbCutTime_cutLine_disable_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
return;
}
this.cutTimer = new CutTimer(this.cutTimeLabel, 'hh时mm分ss秒', () => this.hidePanel());
let sysTime = res.timestamp; // 当前系统时间
let time;
if(data.currentSession) {
time = data.currentSession.endTime - sysTime + 3000;
if(data.canJoin) {
this.ok_btn.source = 'hbCutTime_btn_enable_png';
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
} else {
this.ok_btn.source = 'hbCutTime_btn_null_png';
this.tipImage.source = 'hbCutTime_cutLine_disable_png';
this.ok_btn.source = 'hbCutTime_btn_disable_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
}
})
this.tipImage.source = 'hbCutTime_cutLine_enable_png';
if(!this.cutTimer.start(time)) {
this.cutTimer.stop();
this.cutTimer.start(time);
}
} else if(data.nextSession) {
time = data.nextSession.startTime - sysTime + 3000;
this.ok_btn.source = 'hbCutTime_btn_soon_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
this.tipImage.source = 'hbCutTime_cutLine_disable_png';
if(!this.cutTimer.start(time)) {
this.cutTimer.stop();
this.cutTimer.start(time);
}
} else {
this.ok_btn.source = 'hbCutTime_btn_null_png';
this.tipImage.source = 'hbCutTime_cutLine_disable_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
}
}
destroy() {
if(this.cutTimer){
if(this.cutTimer) {
this.cutTimer.stop();
}
super.destroy();
......@@ -112,7 +113,7 @@ export default class HbCutTime extends Panel {
}
onTouchOK() {
PanelCtrl.instance.show('HbGame');
PanelCtrl.instance.show('HbGame', {needScore: this.data.res.data.currentSession.limitScore});
}
protected get closeBtns(): eui.Button[] {
......
......@@ -25,7 +25,7 @@ export default class HbGame extends Panel {
private rainMgr: RainMgr = null;
private cutTime: egret.Timer = null;
private time: number = 15;
private time: number = window['hbRainTime'];
private score = 0;
private scoreLabelStr = 0;
......@@ -44,7 +44,7 @@ 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.tipLabel.textFlow = (new HtmlTextParser).parser(`抢到<b>${this.data.needScore}</b>个红包才有奖励哦~`);
this.cutTimeLabel.text = `${this.time}`
}
......@@ -61,7 +61,7 @@ export default class HbGame extends Panel {
private gameOver() {
this.cutTime.stop();
this.cutTime.removeEventListener(egret.TimerEvent.TIMER, this.timeCallFun, this);
GDispatcher.dispatchEvent('hbRainGameOver');
this.rainMgr.gameOver();
this.hbDoJoin();
}
......
import Panel from "../../../libs/new_wx/components/Panel";
import { DataManager } from "../../../libs/tw/manager/DataManager";
import { HtmlTextParser } from "../../../libs/new_wx/HtmlTextParser";
import getSkinPath from "../../../libs/new_wx/utils/getSkinPath";
......@@ -32,18 +31,20 @@ export default class HbRule extends Panel {
private addRule() {
const text =
`<br>1、用户每天邀请指定数量的新玩家参与闯关,可获得指定的现金券奖励。
2、用户发起邀请后,需在24小时内完成邀请任务;超过24小时,邀请任务失败,无法获得奖励,需重新发起邀请。
3、新用户仅包含未参与过狮狮连萌活动的用户。
4、用户不可为自己助力,或重复为好友助力。
5、完成邀请任务后,玩家可点击首页“邀请得现金券”图标领取现金券。
6、发放的奖励请在规定的有效时间内尽快领取或使用,逾期未领取或使用的会失效哦。
7、活动过程中,凡以不正当手段(包括但不限于作弊、恶意套现、扰乱系统、网络攻击等违规行为)参与本次活动的用户,苏宁易购有权终止其参加活动,并取消其获得奖励的资格。
8、极少数特殊情况下,若用户在完成活动的任务中被系统判定异常账户或风控账户,则可能导致奖励发放异常。
9、如遇不可抗力(包括但不限于重大自然灾害事件、活动受政府机关指令需要停止举办或调整的、活动遭受严重网络攻击不能正常进行的),苏宁易购有权取消、修改或暂停活动。`
`<br>1、红包雨活动在当天多个时间段开启;每个时间段,所有用户均有1次参与机会,奖励先到先得。
2、在倒计时结束后,收集红包达到目标数量可获得奖励;未达到目标数量,则无法获得奖励。
3、游戏过程中,点击1个红包记为1个红包,点击1个动物元素记为2个红包。
4、发放的奖励请在规定的有效时间内尽快领取或使用,逾期未领取或使用的会失效哦。
5、活动过程中,凡以不正当手段(包括但不限于作弊、恶意套现、扰乱系统、网络攻击等违规行为)参与本次活动的用户,苏宁易购有权终止其参加活动,并取消其获得奖励的资格。
6、极少数特殊情况下,若用户在完成活动的任务中被系统判定异常账户或风控账户,则可能导致奖励发放异常。
7、如遇不可抗力(包括但不限于重大自然灾害事件、活动受政府机关指令需要停止举办或调整的、活动遭受严重网络攻击不能正常进行的),苏宁易购有权取消、修改或暂停活动`
this.labContent.textFlow = (new HtmlTextParser).parser(text);
}
protected onSkinComplete() {
}
get skinKey() {
return 'HbRule'
}
......
......@@ -21,7 +21,7 @@ export default class RainMgr {
this.start();
}
private gameOver() {
public gameOver() {
this.timer.stop(); // 停止计时器
// 隐藏全部掉落物品
......@@ -61,7 +61,11 @@ export default class RainMgr {
private addPool() {
this.rainPool = new Pooling();
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({
key: v,
rainGroup: this.rainGroup,
......
import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
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 {
private data = null;
......@@ -47,7 +50,21 @@ export default class RainObj {
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);
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 @@
"currentSession": {
"endTime": 157292106000,
"sessionIndex": 1,
"limitScore": 10,
"startTime": 157292105000
},
"nextSession": {
"endTime": 157292106000,
"sessionIndex": 2,
"limitScore": 66,
"startTime": 157292105000
}
},
"desc": "OK",
"success": false,
"success": true,
"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