Commit fbb2a2e9 authored by 邱旭's avatar 邱旭

1

parent 4ac0220d
No preview for this file type
This diff is collapsed.
No preview for this file type
...@@ -104,6 +104,8 @@ ...@@ -104,6 +104,8 @@
var toActionId = 'doJoin'; // toActionId var toActionId = 'doJoin'; // toActionId
var projectId = 'pa2340903'; // 星宿台项目id var projectId = 'pa2340903'; // 星宿台项目id
var appId = 65619; // appId 埋点需要
var joinDownLink = ''; // 我也要参与按钮的下载链接 var joinDownLink = ''; // 我也要参与按钮的下载链接
var helpDownLink = ''; // 助力按钮的下载链接 var helpDownLink = ''; // 助力按钮的下载链接
var lawoDownLink = ''; // 拉我按钮的下载链接 var lawoDownLink = ''; // 拉我按钮的下载链接
...@@ -134,7 +136,7 @@ ...@@ -134,7 +136,7 @@
} }
function shareTo(assistItemId) { function shareTo(assistItemId) {
var shareLink = "" + assistItemId ? `?assistItemId=${assistItemId}` : ""; var shareLink = "" + assistItemId ? `&assistItemId=${assistItemId}` : "";
var shareTitle = "我正在参与EMOJI大作战,最高可得66元现金红包!"; var shareTitle = "我正在参与EMOJI大作战,最高可得66元现金红包!";
var shareDes = "快来QQ输入法找我玩吧"; var shareDes = "快来QQ输入法找我玩吧";
QQInputAndroid.shareTo(shareLink, shareTitle, shareDes) QQInputAndroid.shareTo(shareLink, shareTitle, shareDes)
...@@ -143,6 +145,23 @@ ...@@ -143,6 +145,23 @@
function getAndroidId() { function getAndroidId() {
return QQInputAndroid.getAndroidId() || null; return QQInputAndroid.getAndroidId() || null;
} }
QQInputAndroid.back = function(){
window.history.go(-2);
};
console.log(QQInputAndroid);
window.onpopstate = function(event) {
window.history.go(-2);
};
window.location.replace()
var state = {
title: 'Emoji大作战',
url: '#'
};
window.history.replaceState(state, 'title', '#');
</script> </script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script> <script>
......
...@@ -57,7 +57,7 @@ export class Buried { ...@@ -57,7 +57,7 @@ export class Buried {
* @returns {string} * @returns {string}
*/ */
public static connectDpm(pageId: number, area: number, dpm: number): string { public static connectDpm(pageId: number, area: number, dpm: number): string {
return DataManager.ins.customCfgData.appId + '.' + pageId + '.' + area + '.' + dpm; return window['appId'] + '.' + pageId + '.' + area + '.' + dpm;
} }
/** /**
...@@ -68,7 +68,7 @@ export class Buried { ...@@ -68,7 +68,7 @@ export class Buried {
* @returns {string} * @returns {string}
*/ */
public static connectDcm(typeId: number, contentInfo: number, dcm: number): string { public static connectDcm(typeId: number, contentInfo: number, dcm: number): string {
return typeId + '.' + DataManager.ins.customCfgData.oaId + '.' + contentInfo + '.' + dcm; return typeId + '.' + window['projectId'] + '.' + contentInfo + '.' + dcm;
} }
/** /**
......
No preview for this file type
...@@ -59,11 +59,11 @@ ...@@ -59,11 +59,11 @@
<e:Image id="sweepLightBtn" y="-21" scaleX="1" scaleY="1" x="-146" source="sweepLight_png" touchEnabled="false"/> <e:Image id="sweepLightBtn" y="-21" scaleX="1" scaleY="1" x="-146" source="sweepLight_png" touchEnabled="false"/>
</e:Group> </e:Group>
<e:Image y="444" x="319" scaleX="1" scaleY="1" source="times_img_png"/> <e:Image y="444" x="319" scaleX="1" scaleY="1" source="times_img_png"/>
<e:Label id="timesLabel" text="今日 次数:0次" y="448" textColor="0x000000" horizontalCenter="-6" size="26" bold="true"/> <e:Label id="timesLabel" text="今日 次数:0次" y="448" textColor="0x000000" size="26" bold="true" left="269"/>
<e:Group id="scrollerGroup" width="544" height="29" x="118" y="25" anchorOffsetX="0" anchorOffsetY="0"> <e:Group id="scrollerGroup" width="544" height="29" x="118" y="25" anchorOffsetX="0" anchorOffsetY="0">
<e:Rect id="scrollerMask" top="0" right="0" left="0" bottom="0" fillAlpha="1"/> <e:Rect id="scrollerMask" top="0" right="0" left="0" bottom="0" fillAlpha="1"/>
<e:Label id="scrollerLable1" text="XXXXX人正在集卡" size="25" anchorOffsetX="0" width="544" y="2" textColor="0x000000" horizontalCenter="0"/> <e:Label id="scrollerLable1" text="XXXXX人正在集卡" size="25" anchorOffsetX="0" textColor="0x000000" horizontalCenter="0" width="544" height="29" y="0"/>
<e:Label id="scrollerLable2" text="XXXXX人已集齐卡牌" size="25" anchorOffsetX="0" width="544" y="2" scaleX="1" scaleY="1" textColor="0x000000" horizontalCenter="0"/> <e:Label id="scrollerLable2" text="XXXXX人已集齐卡牌" size="25" anchorOffsetX="0" scaleX="1" scaleY="1" textColor="0x000000" horizontalCenter="0" left="0" right="0" bottom="0" top="0"/>
</e:Group> </e:Group>
</e:Group> </e:Group>
<e:Group height="119" anchorOffsetY="0" horizontalCenter="0" y="798" left="0" right="0" x="0" scaleX="1" scaleY="1"> <e:Group height="119" anchorOffsetY="0" horizontalCenter="0" y="798" left="0" right="0" x="0" scaleX="1" scaleY="1">
...@@ -141,4 +141,8 @@ ...@@ -141,4 +141,8 @@
<e:Rect top="0" bottom="0" right="0" left="0" fillAlpha="0.8"/> <e:Rect top="0" bottom="0" right="0" left="0" fillAlpha="0.8"/>
<e:Label id="osLabel" text="Label" y="488" width="750" horizontalCenter="0" height="184" bold="true" verticalAlign="middle" textAlign="center" size="40"/> <e:Label id="osLabel" text="Label" y="488" width="750" horizontalCenter="0" height="184" bold="true" verticalAlign="middle" textAlign="center" size="40"/>
</e:Group> </e:Group>
<e:Group id="browserGroup" width="750" height="2249" x="0" y="0" visible="false">
<e:Rect top="0" bottom="0" right="0" left="0" fillAlpha="0.8"/>
<e:Image x="295" y="17" source="share_tips_png"/>
</e:Group>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<e:Image scaleX="1" scaleY="1" y="47" source="logo_png" horizontalCenter="0"/> <e:Image scaleX="1" scaleY="1" y="47" source="logo_png" horizontalCenter="0"/>
<e:Label id="percentLb" text="78%" width="750" textAlign="center" size="34" alpha="1" anchorOffsetX="0" scaleX="1" scaleY="1" x="7.5" y="585.22" verticalCenter="205.21500000000003" textColor="0x361400" visible="false"/> <e:Label id="percentLb" text="78%" width="750" textAlign="center" size="34" alpha="1" anchorOffsetX="0" scaleX="1" scaleY="1" x="7.5" y="585.22" verticalCenter="205.21500000000003" textColor="0x361400" visible="false"/>
<e:Label text="loading..." width="750" size="50" alpha="1" anchorOffsetX="0" scaleX="1" scaleY="1" verticalAlign="middle" textAlign="center" y="355.5" textColor="0x000000" bold="true" horizontalCenter="0"/> <e:Label text="loading..." width="750" size="50" alpha="1" anchorOffsetX="0" scaleX="1" scaleY="1" verticalAlign="middle" textAlign="center" y="355.5" textColor="0x000000" bold="true" horizontalCenter="0"/>
<e:Label text="66元 正向你奔来" width="750" size="46" alpha="1" anchorOffsetX="0" scaleX="1" scaleY="1" verticalAlign="middle" textAlign="center" y="567" horizontalCenter="0" textColor="0x000000" x="10" bold="true"/> <e:Label text="66元 正向你奔来" width="750" size="46" alpha="1" anchorOffsetX="0" scaleX="1" scaleY="1" verticalAlign="middle" textAlign="center" textColor="0x000000" bold="true" left="0" y="567"/>
<e:Rect id="progressBar_fill" height="44" x="174" y="459.5" anchorOffsetX="0" fillColor="0xffbe30" ellipseHeight="50" ellipseWidth="50" anchorOffsetY="0" strokeColor="0x000000"/> <e:Rect id="progressBar_fill" height="44" x="174" y="459.5" anchorOffsetX="0" fillColor="0xffbe30" ellipseHeight="50" ellipseWidth="50" anchorOffsetY="0" strokeColor="0x000000"/>
<e:Image id="progressBar_bg" scaleX="1" scaleY="1" y="482" anchorOffsetX="0" anchorOffsetY="22.5" horizontalCenter="0" source="progressbar_bg_png"/> <e:Image id="progressBar_bg" scaleX="1" scaleY="1" y="482" anchorOffsetX="0" anchorOffsetY="22.5" horizontalCenter="0" source="progressbar_bg_png"/>
<e:Image id="emoji" x="174" y="482" source="load_emoji_png" anchorOffsetX="38.5" anchorOffsetY="40.5"/> <e:Image id="emoji" x="174" y="482" source="load_emoji_png" anchorOffsetX="38.5" anchorOffsetY="40.5"/>
......
No preview for this file type
No preview for this file type
var AudioCtrl = /** @class */ (function () {
function AudioCtrl() {
}
/**
* 切换背景音乐
* @param bg 背景音乐
*/
AudioCtrl.changeBgMusic = function (bg) {
if (this.bg) {
this.bg.close();
}
if (bg) {
this.bg = bg;
this.bg.play();
}
};
/**
* 恢复当前背景音乐
*/
AudioCtrl.resumeBgMusic = function () {
if (this.bg) {
this.bg.play();
}
};
/**
* 停止背景音乐
*/
AudioCtrl.stopBgMusic = function () {
if (this.bg) {
this.bg.close();
}
};
/**
* 添加音频
* @param name 音频的名字
* @param audio 音频
*/
AudioCtrl.addAudio = function (name, audio) {
if (!this.audios[name]) {
this.audios[name] = audio;
}
};
/**
* 播放音频
* @param name 音频的名字
* @param playTimes 播放次数,默认值是 1,循环播放。 大于 0 为播放次数,如 1 为播放 1 次;小于等于 0,为循环播放。
* @param startTime 应开始播放的初始位置(以秒为单位),默认值是 0
*/
AudioCtrl.playAudio = function (name, playTimes, startTime) {
if (playTimes === void 0) { playTimes = 1; }
if (startTime === void 0) { startTime = 0; }
if (!this.audios[name]) {
return;
}
this.audios[name].play(startTime, playTimes);
};
/**
* 停止音频
* @param name 音频的名字
*/
AudioCtrl.stopAudio = function (name) {
if (this.audios[name]) {
this.audios[name].close();
}
};
/**
* 删除音频
* @param name - 音频的名字
*/
AudioCtrl.delAudio = function (name) {
if (this.audios[name]) {
delete this.audios[name];
}
};
/**
* 清空音频
*/
AudioCtrl.clearAudio = function () {
for (var v in this.audios) {
delete this.audios[v];
}
};
// static _instance: AudioCtrl;
// static get instance() {
// return this._instance || (this._instance = new AudioCtrl());
// }
AudioCtrl.audios = {};
return AudioCtrl;
}());
export default AudioCtrl;
...@@ -7,37 +7,41 @@ export default class AudioCtrl { ...@@ -7,37 +7,41 @@ export default class AudioCtrl {
// } // }
private static audios = {}; private static audios = {};
private static audioChannels = {};
private static bg: egret.Sound; private static bg: egret.Sound;
private static bgChannel: egret.SoundChannel;
/** /**
* 切换背景音乐 * 切换背景音乐
* @param bg 背景音乐 * @param bg 背景音乐
*/ */
public static changeBgMusic(bg:egret.Sound){ public static changeBgMusic(bg: egret.Sound) {
if(this.bg){ if(this.bgChannel) {
this.bg.close(); this.bgChannel.stop();
}
if(bg){
this.bg = bg;
this.bg.play();
} }
setTimeout(() => {
if(bg) {
this.bg = bg;
this.bgChannel = this.bg.play();
}
}, 50);
} }
/** /**
* 恢复当前背景音乐 * 恢复当前背景音乐
*/ */
public static resumeBgMusic(){ public static resumeBgMusic() {
if(this.bg){ if(this.bg) {
this.bg.play(); this.bgChannel = this.bg.play();
} }
} }
/** /**
* 停止背景音乐 * 停止背景音乐
*/ */
public static stopBgMusic(){ public static stopBgMusic() {
if(this.bg){ if(this.bgChannel) {
this.bg.close(); this.bgChannel.stop();
} }
} }
...@@ -62,8 +66,21 @@ export default class AudioCtrl { ...@@ -62,8 +66,21 @@ export default class AudioCtrl {
if(!this.audios[name]) { if(!this.audios[name]) {
return; return;
} }
this.audios[name].play(startTime, playTimes); this.audioChannels[name] = this.audios[name].play(startTime, playTimes);
}
/**
* 播放音频
* @param name 音频的名字
* @param audio 音频
* @param playTimes 播放次数,默认值是 1,循环播放。 大于 0 为播放次数,如 1 为播放 1 次;小于等于 0,为循环播放。
* @param startTime 应开始播放的初始位置(以秒为单位),默认值是 0
*/
public static addAndPlayAudio(name: string, audio: egret.Sound, playTimes: number = 1, startTime: number = 0) {
if(!this.audios[name]) {
this.audios[name] = audio;
}
this.audioChannels[name] = this.audios[name].play(startTime, playTimes);
} }
/** /**
...@@ -71,8 +88,8 @@ export default class AudioCtrl { ...@@ -71,8 +88,8 @@ export default class AudioCtrl {
* @param name 音频的名字 * @param name 音频的名字
*/ */
public static stopAudio(name: string) { public static stopAudio(name: string) {
if(this.audios[name]) { if(this.audioChannels[name]) {
this.audios[name].close(); this.audioChannels[name].stop();
} }
} }
...@@ -84,6 +101,9 @@ export default class AudioCtrl { ...@@ -84,6 +101,9 @@ export default class AudioCtrl {
if(this.audios[name]) { if(this.audios[name]) {
delete this.audios[name]; delete this.audios[name];
} }
if(this.audioChannels[name]) {
delete this.audioChannels[name];
}
} }
/** /**
...@@ -93,6 +113,11 @@ export default class AudioCtrl { ...@@ -93,6 +113,11 @@ export default class AudioCtrl {
for(let v in this.audios) { for(let v in this.audios) {
delete this.audios[v]; delete this.audios[v];
} }
for(let v in this.audioChannels){
delete this.audioChannels[v];
}
this.audios = {};
this.audioChannels = {};
} }
} }
\ No newline at end of file
/**
* 特效管理器
*/
var EffectMgr = /** @class */ (function () {
function EffectMgr() {
}
Object.defineProperty(EffectMgr, "instance", {
get: function () {
return EffectMgr._instance || (EffectMgr._instance = new EffectMgr());
},
enumerable: true,
configurable: true
});
/**
* 呼吸效果
* @param obj - 要呼吸的对象
*/
EffectMgr.prototype.breathingEffect = function (obj) {
var _this = this;
egret.Tween.get(obj).to({ scaleX: 0.9, scaleY: 0.9 }, 500, egret.Ease.sineInOut).call(function () {
egret.Tween.get(obj).to({ scaleX: 1, scaleY: 1 }, 500, egret.Ease.sineInOut).call(function () {
_this.breathingEffect(obj);
});
});
};
/**
* 添加弹跳效果
* @param obj
* @param height - 高度
* @param rotation - 旋转角度
* @param duration - 时间
* @param wait - 跳动结束等待时间
* @param call - 回调函数
*/
EffectMgr.prototype.jumpOnce = function (obj, height, rotation, duration, wait, call) {
var _y = obj.y - height;
egret.Tween.get(obj).to({ rotation: rotation, y: _y }, duration, egret.Ease.sineInOut).call(function () {
egret.Tween.get(obj).to({
rotation: 0,
y: _y + height
}, duration, egret.Ease.sineInOut).wait(wait).call(function () {
if (call) {
call();
}
});
});
};
/**
* 永远旋转
* @param obj - 要旋转的对象
* @param duration - 一圈的时间
*/
EffectMgr.prototype.rotationForever = function (obj, duration) {
var _this = this;
if (duration === void 0) { duration = 1000; }
egret.Tween.get(obj).to({ rotation: 360 }, duration).call(function () {
_this.rotationForever(obj, duration);
});
};
/**
* 心跳效果
* @param obj
* @param max - 最大的缩放值
* @param min - 最小的缩放值
* @param duration - 一次心跳的时间
* @param wait - 一次心跳等待的时间
*/
EffectMgr.prototype.heartbeatEffect = function (obj, max, min, duration, wait) {
var _this = this;
if (duration === void 0) { duration = 1000; }
if (wait === void 0) { wait = 500; }
egret.Tween.get(obj).to({ scaleX: max, scaleY: max }, duration / 2, egret.Ease.sineIn).call(function () {
egret.Tween.get(obj).to({ scaleX: min, scaleY: min }, duration / 2, egret.Ease.sineOut).wait(wait).call(function () {
_this.heartbeatEffect(obj, max, min, duration, wait);
});
});
};
/**
* 快速缓动透明度
* @param obj
* @param alpha - 透明度
* @param duration - 时间
* @param call - 回调函数
*/
EffectMgr.prototype.easyAlpha = function (obj, alpha, duration, call) {
if (duration === void 0) { duration = 500; }
egret.Tween.get(obj).to({
alpha: alpha,
}, duration, egret.Ease.sineInOut).call(function () {
if (call) {
call();
}
});
};
/**
* 快速缩放
* @param obj
* @param scale - 正比缩放值,若scaleY存在则是X缩放值
* @param scaleY - Y缩放值
* @param duration - 时间
* @param call - 回调函数
*/
EffectMgr.prototype.easySacleXY = function (obj, scale, scaleY, duration, call) {
if (duration === void 0) { duration = 500; }
egret.Tween.get(obj).to({
scaleX: scale,
scaleY: scaleY || scale
}, duration || 500, egret.Ease.sineInOut).call(function () {
if (call) {
call();
}
});
};
EffectMgr.prototype.addScaleOut = function (obj) {
obj.scaleX = 0;
obj.scaleY = 0;
egret.Tween.get(obj).to({ scaleX: 1, scaleY: 1 }, 300, egret.Ease.sineIn);
};
return EffectMgr;
}());
export default EffectMgr;
import Loading from "../../../Common/loading/Loading";
import { NetManager } from "../../../../libs/tw/manager/NetManager";
import { DataManager } from "../../../../libs/tw/manager/DataManager";
var getStartOrderStatus = function (callback, customizedType) {
NetManager.ins.getStartStatus(callback, DataManager.ins.doStartData.ticketId, function () { return DataManager.ins.getStartStatusData.code != 1; }, 5, customizedType);
};
/**
* 开始游戏
* @param {string} isAgain 是否是再来一次
* @param {number} credits 主动要求花费多少积分玩游戏
* @param {number} customizedType xx类型
*/
export default (function (isAgain, credits, customizedType) {
if (isAgain === void 0) { isAgain = false; }
return new Promise(function (resolve) {
if (window['requirelogin']) {
window['requirelogin']();
return;
}
var callback = function (data) {
Loading.instace.hide();
resolve(data);
};
Loading.instace.show();
NetManager.ins.doStart(function (success) {
if (success) {
getStartOrderStatus(callback, customizedType);
}
else {
callback(success);
}
}, isAgain, credits, customizedType);
});
});
// ∏import { DataManager, NetManager } from "duiba-tw";
import { DataManager } from "../../../../libs/tw/manager/DataManager";
import { NetManager } from "../../../../libs/tw/manager/NetManager";
import Loading from "../../../Common/loading/Loading";
export default (function () { return new Promise(function (resolve) {
var _callback = function (data) {
Loading.instace.hide();
resolve(data);
};
Loading.instace.show();
if (DataManager.ins.getRuleData) {
_callback(true);
}
else {
NetManager.ins.getRule(_callback);
}
}); });
// import { NetManager } from "../../../libs/tw/manager/NetManager";
import Loading from "../../../Common/loading/Loading";
import { NetManager } from "../../../../libs/tw/manager/NetManager";
/**
* 实时排行榜
* @param {number} type 0总排行榜 1今日排行榜 2 多游戏总排行榜 3 昨日排行榜
* @param {number} count 返回榜单长度 最大50
*/
export default (function (callback, type, count) {
var _callback = function (data) {
Loading.instace.hide();
callback(data);
};
Loading.instace.show();
NetManager.ins.realtimerank(_callback, type, count);
});
import Loading from "../../Common/loading/Loading";
var PanelCtrl = /** @class */ (function () {
function PanelCtrl() {
this.panels = []; // 面板栈
this.pMask = new egret.Shape();
}
Object.defineProperty(PanelCtrl, "instance", {
get: function () {
return PanelCtrl._instance || (PanelCtrl._instance = new PanelCtrl());
},
enumerable: true,
configurable: true
});
PanelCtrl.prototype.init = function (parent) {
this._parent = parent;
};
PanelCtrl.prototype.show = function (type, data, hasMask, time) {
if (hasMask === void 0) { hasMask = true; }
if (time === void 0) { time = 2500; }
var cls = this._panelClassMap[type];
Loading.instace.show();
var panel = new cls(data, hasMask, time);
this._current = panel;
// panel.setSkinName();
// panel.setMask();
// panel.setShowAct();
// panel.start(data);
this.add(panel);
this.panels.unshift(panel); // 存入面板栈
this._parent.visible = true;
};
/**
* 防止连点
* @param targe 可交互对象
* @param dtime 延时默认500ms
*/
PanelCtrl.prototype.btnDelay = function (targe, dtime) {
if (dtime === void 0) { dtime = 500; }
targe.touchEnabled = false;
setTimeout(function () {
targe.touchEnabled = true;
}, dtime);
};
/**
* clearPanel 清空面板
*/
PanelCtrl.prototype.clearPanel = function () {
// 调用基类方法依次出栈关闭面板
for (var i = 0; i < this.panels.length; i++) {
this.panels[i].hidePanel();
i--;
}
this.panels = []; // 清空面板栈
};
PanelCtrl.prototype.add = function (panel) {
this._parent.addChild(panel);
panel.addEventListener('onDestroy', this.onPanelHide, this);
panel.addEventListener('onCreditsOut', this.onCreditsOut, this);
};
PanelCtrl.prototype.remove = function (panel) {
this.panels.shift(); // 弹出面板栈
this._parent.removeChild(panel);
};
PanelCtrl.prototype.onPanelHide = function (e) {
var panel = e.target;
panel.removeEventListener('onDestroy', this.onPanelHide, this);
panel.removeEventListener('onCreditsOut', this.onCreditsOut, this);
this.remove(panel);
if (this._parent.numChildren == 0) {
this._parent.visible = false;
}
};
PanelCtrl.prototype.onCreditsOut = function (e) {
if (!window['CFG'] || !window['CFG'].appInfo)
return;
window.location.href = window['CFG'].appInfo.earnCreditsUrl;
};
PanelCtrl.prototype.registerPanelClass = function (name, definition) {
this._panelClassMap = this._panelClassMap || {};
this._panelClassMap[name] = definition;
};
PanelCtrl.prototype.closeCurrent = function () {
if (this._current)
this.remove(this._current);
};
return PanelCtrl;
}());
export default PanelCtrl;
import Loading from "../../Common/loading/Loading";
var SceneCtrl = /** @class */ (function () {
function SceneCtrl() {
}
Object.defineProperty(SceneCtrl, "instance", {
get: function () {
return SceneCtrl._instance || (SceneCtrl._instance = new SceneCtrl());
},
enumerable: true,
configurable: true
});
SceneCtrl.prototype.init = function (parent) {
this._parent = parent;
};
SceneCtrl.prototype.change = function (type, data) {
if (this._currentScene) {
this._currentScene.destroy();
this._parent.removeChild(this._currentScene);
}
Loading.instace.show();
var cls = this._sceneClassMap[type];
var scene = new cls(data);
// scene.setSkinName();
// scene.start();
this.addToStage(scene);
};
SceneCtrl.prototype.addToStage = function (scene) {
this._currentScene = scene;
this._parent.addChild(scene);
};
SceneCtrl.prototype.registerSceneClass = function (name, definition) {
this._sceneClassMap = this._sceneClassMap || {};
this._sceneClassMap[name] = definition;
};
return SceneCtrl;
}());
export default SceneCtrl;
import { ModuleTypes } from "../../types/sceneTypes";
import PanelCtrl from "./panelCtrl";
export default (function (message, btnTxt) {
PanelCtrl.instance.show(ModuleTypes.ALERT_PANEL, { message: message, btnTxt: btnTxt });
});
import Loading from "../../Common/loading/Loading";
var TopLayerCtrl = /** @class */ (function () {
function TopLayerCtrl() {
}
Object.defineProperty(TopLayerCtrl, "instance", {
get: function () {
return TopLayerCtrl._instance || (TopLayerCtrl._instance = new TopLayerCtrl());
},
enumerable: true,
configurable: true
});
TopLayerCtrl.prototype.init = function (parent) {
this._parent = parent;
};
TopLayerCtrl.prototype.show = function (type, data, hasMask, time) {
if (hasMask === void 0) { hasMask = true; }
if (time === void 0) { time = 2500; }
var cls = this._panelClassMap[type];
Loading.instace.show();
var panel = new cls(data, hasMask, time);
this._current = panel;
this.add(panel);
this._parent.visible = true;
// if(isToast){
// setTimeout(() => {
// this.panelHide(panel);
// }, time);
// }
};
/**
* 防止连点
* @param targe 可交互对象
* @param dtime 延时默认500ms
*/
TopLayerCtrl.prototype.btnDelay = function (targe, dtime) {
if (dtime === void 0) { dtime = 500; }
targe.touchEnabled = false;
setTimeout(function () {
targe.touchEnabled = true;
}, dtime);
};
TopLayerCtrl.prototype.add = function (panel) {
this._parent.addChild(panel);
panel.addEventListener('onDestroy', this.onPanelHide, this);
};
TopLayerCtrl.prototype.remove = function (panel) {
this._parent.removeChild(panel);
};
TopLayerCtrl.prototype.onPanelHide = function (e) {
var panel = e.target;
panel.removeEventListener('onDestroy', this.onPanelHide, this);
this.remove(panel);
if (this._parent.numChildren == 0) {
this._parent.visible = false;
}
};
TopLayerCtrl.prototype.panelHide = function (panel) {
panel.removeEventListener('onDestroy', this.onPanelHide, this);
this.remove(panel);
if (this._parent.numChildren == 0) {
this._parent.visible = false;
}
};
TopLayerCtrl.prototype.registerPanelClass = function (name, definition) {
this._panelClassMap = this._panelClassMap || {};
this._panelClassMap[name] = definition;
};
TopLayerCtrl.prototype.closeCurrent = function () {
if (this._current)
this.remove(this._current);
};
return TopLayerCtrl;
}());
export default TopLayerCtrl;
...@@ -27,6 +27,7 @@ import { NetName } from "../libs/tw/enum/NetName"; ...@@ -27,6 +27,7 @@ import { NetName } from "../libs/tw/enum/NetName";
////// //////
class Main extends eui.UILayer { class Main extends eui.UILayer {
private bgMusic: egret.Sound;
protected createChildren(): void { protected createChildren(): void {
super.createChildren(); super.createChildren();
// alert(1) // alert(1)
...@@ -149,23 +150,33 @@ class Main extends eui.UILayer { ...@@ -149,23 +150,33 @@ class Main extends eui.UILayer {
}); });
this.stage.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchStage, this); this.stage.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchStage, this);
document.addEventListener("visibilitychange", () => {
if(document.visibilityState == "visible") {
AudioCtrl.resumeBgMusic();
}
if(document.visibilityState == "hidden") {
AudioCtrl.stopBgMusic();
}
})
} }
onTouchStage() { onTouchStage() {
AudioCtrl.changeBgMusic(RES.getRes('bg_sound_mp3')); AudioCtrl.changeBgMusic(this.bgMusic);
this.stage.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchStage, this); this.stage.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchStage, this);
} }
//加载游戏中的资源 //加载游戏中的资源
private async getGameRes() { private async getGameRes() {
await NetManager.ins.getProjectUserInfo((success)=>{ // await NetManager.ins.getProjectUserInfo((success)=>{
if(!success){ // if(!success){
Buried.init(0); // Buried.init(0);
return; // return;
} // }
Buried.init(DataManager.ins.getData(NetName.GET_PROJECTUSERINFO).data.consumerId); // Buried.init(DataManager.ins.getData(NetName.GET_PROJECTUSERINFO).data.consumerId);
}); // });
Buried.init(0);
this.bgMusic = await RES.getResAsync('bg_sound_mp3');
SceneCtrl.instance.change(ModuleTypes.LOADING_SCENE); SceneCtrl.instance.change(ModuleTypes.LOADING_SCENE);
await RES.loadGroup('common'); await RES.loadGroup('common');
......
...@@ -7,51 +7,55 @@ import { GTime } from "../../../libs/tc/util/GTime"; ...@@ -7,51 +7,55 @@ import { GTime } from "../../../libs/tc/util/GTime";
import { NetManager } from "../../../libs/tw/manager/NetManager"; import { NetManager } from "../../../libs/tw/manager/NetManager";
import { getlogItem } from "../../getlogItem"; import { getlogItem } from "../../getlogItem";
import Utils from "../../MVC/utils/Utils"; import Utils from "../../MVC/utils/Utils";
import tr = egret.sys.tr;
import userMock from "./UserMock";
export default class IndexScene extends Scene { export default class IndexScene extends Scene {
public scroller:eui.Scroller; public scroller: eui.Scroller;
public titleGroup:eui.Group; public titleGroup: eui.Group;
public titleMask:eui.Rect; public titleMask: eui.Rect;
public sweepLight:eui.Image; public sweepLight: eui.Image;
public ruleBtn:eui.Button; public ruleBtn: eui.Button;
public prizeBtn:eui.Button; public prizeBtn: eui.Button;
public help_btn:eui.Button; public help_btn: eui.Button;
public join_btn:eui.Button; public join_btn: eui.Button;
public btnGroup:eui.Group; public btnGroup: eui.Group;
public maskGroup:eui.Group; public maskGroup: eui.Group;
public sweepLightBtn:eui.Image; public sweepLightBtn: eui.Image;
public timesLabel:eui.Label; public timesLabel: eui.Label;
public scrollerGroup:eui.Group; public scrollerGroup: eui.Group;
public scrollerMask:eui.Rect; public scrollerMask: eui.Rect;
public scrollerLable1:eui.Label; public scrollerLable1: eui.Label;
public scrollerLable2:eui.Label; public scrollerLable2: eui.Label;
public emoji0:eui.Image; public emoji0: eui.Image;
public emoji1:eui.Image; public emoji1: eui.Image;
public emoji2:eui.Image; public emoji2: eui.Image;
public emoji3:eui.Image; public emoji3: eui.Image;
public emoji4:eui.Image; public emoji4: eui.Image;
public emoji5:eui.Image; public emoji5: eui.Image;
public emojiBg0:eui.Image; public emojiBg0: eui.Image;
public emojiBg1:eui.Image; public emojiBg1: eui.Image;
public emojiBg2:eui.Image; public emojiBg2: eui.Image;
public emojiBg3:eui.Image; public emojiBg3: eui.Image;
public emojiBg4:eui.Image; public emojiBg4: eui.Image;
public emojiBg5:eui.Image; public emojiBg5: eui.Image;
public emojiLabel0:eui.Label; public emojiLabel0: eui.Label;
public emojiLabel1:eui.Label; public emojiLabel1: eui.Label;
public emojiLabel2:eui.Label; public emojiLabel2: eui.Label;
public emojiLabel3:eui.Label; public emojiLabel3: eui.Label;
public emojiLabel4:eui.Label; public emojiLabel4: eui.Label;
public emojiLabel5:eui.Label; public emojiLabel5: eui.Label;
public box:eui.Image; public box: eui.Image;
public progressBar_fill:eui.Rect; public progressBar_fill: eui.Rect;
public progressbar_bg:eui.Image; public progressbar_bg: eui.Image;
public progressbarLabel:eui.Label; public progressbarLabel: eui.Label;
public list:eui.List; public list: eui.List;
public image:eui.Image; public image: eui.Image;
public downloadBtn:eui.Button; public downloadBtn: eui.Button;
public osGroup:eui.Group; public osGroup: eui.Group;
public osLabel:eui.Label; public osLabel: eui.Label;
public browserGroup: eui.Group;
// emoji表情 // emoji表情
private emojisId = ["sp_1", "sp_2", "sp_3", "sp_4", "sp_5", "sp_6"]; private emojisId = ["sp_1", "sp_2", "sp_3", "sp_4", "sp_5", "sp_6"];
...@@ -98,28 +102,41 @@ export default class IndexScene extends Scene { ...@@ -98,28 +102,41 @@ export default class IndexScene extends Scene {
this.help_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchHelp, this); this.help_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchHelp, this);
this.join_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchJoin, this); this.join_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchJoin, this);
this.downloadBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchDownloadBtn, this); this.downloadBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchDownloadBtn, this);
this.browserGroup.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchBrowserGroup, this);
}
onTouchBrowserGroup() {
this.btnGroup.visible = false;
} }
onTouchHelp() { onTouchHelp() {
PanelCtrl.instance.btnDelay(this.help_btn); PanelCtrl.instance.btnDelay(this.help_btn);
NetManager.ins.clickLog(getlogItem(5)); NetManager.ins.clickLog(getlogItem(5));
// 帮助,需要assistItemId // 帮助,需要assistItemId
let assistItemId = Utils.getRequestByKey("assistItemId") || ""; let wx = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1;
window["goClient"](assistItemId); if(wx) {
setTimeout(()=>{ this.browserGroup.visible = true;
window.location.href = window['helpDownLink']; } else {
}, 500); let assistItemId = Utils.getRequestByKey("assistItemId") || "";
window["goClient"](assistItemId);
setTimeout(() => {
window.location.href = window['helpDownLink'];
}, 3000);
}
} }
onTouchJoin() { onTouchJoin() {
PanelCtrl.instance.btnDelay(this.join_btn); PanelCtrl.instance.btnDelay(this.join_btn);
NetManager.ins.clickLog(getlogItem(6)); NetManager.ins.clickLog(getlogItem(6));
// 参与,不需要assistItemId let wx = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1;
// let assistItemId = Utils.getRequestByKey("assistItemId") || ""; if(wx) {
window["goClient"](""); this.browserGroup.visible = true;
setTimeout(()=>{ } else {
window.location.href = window['joinDownLink']; window["goClient"]("");
}, 500); setTimeout(() => {
window.location.href = window['joinDownLink'];
}, 3000);
}
} }
onTouchDownloadBtn() { onTouchDownloadBtn() {
...@@ -181,7 +198,7 @@ export default class IndexScene extends Scene { ...@@ -181,7 +198,7 @@ export default class IndexScene extends Scene {
private checkOS() { private checkOS() {
let os = navigator.userAgent.match(/ OS /) // 是否是 iOS let os = navigator.userAgent.match(/ OS /) // 是否是 iOS
|| navigator.userAgent.match(/Android [4].[4-9](.[0-9])?/) // 是否是 Android 4.4 - 4.9.9 || navigator.userAgent.match(/Android [4].[4-9](.[0-9])?/) // 是否是 Android 4.4 - 4.9.9
|| navigator.userAgent.match(/Android [5-9].[0-9](.[0-9])?/); // 是否是 Android 5.0 - 5.9.9 || navigator.userAgent.match(/Android [5-9](.[0-9])?(.[0-9])?/); // 是否是 Android 5 - 5.9.9
if(os && os[0] && os[0].indexOf(' OS ') > -1) { if(os && os[0] && os[0].indexOf(' OS ') > -1) {
this.osLabel.text = "该活动仅支持安卓用户参与"; this.osLabel.text = "该活动仅支持安卓用户参与";
...@@ -197,7 +214,7 @@ export default class IndexScene extends Scene { ...@@ -197,7 +214,7 @@ export default class IndexScene extends Scene {
private check() { private check() {
let os = navigator.userAgent.match(/ OS /) // 是否是 iOS let os = navigator.userAgent.match(/ OS /) // 是否是 iOS
|| navigator.userAgent.match(/Android [4].[4-9](.[0-9])?/) // 是否是 Android 4.4 - 4.9.9 || navigator.userAgent.match(/Android [4].[4-9](.[0-9])?/) // 是否是 Android 4.4 - 4.9.9
|| navigator.userAgent.match(/Android [5-9].[0-9](.[0-9])?/); // 是否是 Android 5.0 - 5.9.9 || navigator.userAgent.match(/Android [5-9](.[0-9])?(.[0-9])?/); // 是否是 Android 5 - 5.9.9
if(os && os[0] && os[0].indexOf(' OS ') > -1) { if(os && os[0] && os[0].indexOf(' OS ') > -1) {
return false; return false;
...@@ -209,14 +226,17 @@ export default class IndexScene extends Scene { ...@@ -209,14 +226,17 @@ export default class IndexScene extends Scene {
} }
private easyScroller(obj1: any, obj2: any, duration: number) { private easyScroller(obj1: any, obj2: any, duration: number) {
let height = obj1.height;
obj1.y = height + 7;
obj2.y = height + 7;
let name = userMock.nameList[~~(Math.random() * userMock.nameList.length)];
let prize = userMock.prizeList[~~(Math.random() * userMock.prizeList.length)];
obj1.text = `${Math.floor(GTime.getTimestamp() % 1000000000000 / 123456)}人正在集卡`;
obj2.text = `${name}已集齐卡牌,抽中${prize}!`;
egret.Tween.get(obj1).to({y: 2}, duration).wait(1500).call(() => { egret.Tween.get(obj1).to({y: 2}, duration).wait(1500).call(() => {
egret.Tween.get(obj1).to({y: -28}, duration).call(() => { egret.Tween.get(obj1).to({y: -height-3}, duration).call(() => {
obj1.y = 30;
this.scrollerLable1.text = `${Math.floor(GTime.getTimestamp() / 100000)}人正在集卡`;
egret.Tween.get(obj2).to({y: 2}, duration).wait(1500).call(() => { egret.Tween.get(obj2).to({y: 2}, duration).wait(1500).call(() => {
egret.Tween.get(obj2).to({y: -28}, duration).call(() => { egret.Tween.get(obj2).to({y: -height-3}, duration).call(() => {
obj2.y = 30;
this.scrollerLable2.text = `${Math.floor(GTime.getTimestamp() * 2.5 / 10000 / 1000)}人已经集齐卡牌, 抽中支付宝红包`;
this.easyScroller(obj1, obj2, duration); this.easyScroller(obj1, obj2, duration);
}); });
}); });
...@@ -225,13 +245,13 @@ export default class IndexScene extends Scene { ...@@ -225,13 +245,13 @@ export default class IndexScene extends Scene {
} }
private initUI(): void { private initUI(): void {
this.setProgressBar(2, 6); this.setProgressBar(0, 6);
this.initEmojis({ this.initEmojis({
"sp_1": 0, "sp_1": 0,
"sp_2": 0, "sp_2": 0,
"sp_3": 1, "sp_3": 0,
"sp_4": 0, "sp_4": 0,
"sp_5": 2, "sp_5": 0,
"sp_6": 0 "sp_6": 0
}); });
this.timesLabel.text = `今日 次数:3次`; this.timesLabel.text = `今日 次数:3次`;
...@@ -277,10 +297,6 @@ export default class IndexScene extends Scene { ...@@ -277,10 +297,6 @@ export default class IndexScene extends Scene {
// 滚动弹幕 // 滚动弹幕
this.scrollerGroup.mask = this.scrollerMask; this.scrollerGroup.mask = this.scrollerMask;
this.scrollerLable1.y = 30;
this.scrollerLable2.y = 30;
this.scrollerLable1.text = `${Math.floor(GTime.getTimestamp() / 100000)}人正在集卡`;
this.scrollerLable2.text = `${Math.floor(GTime.getTimestamp() * 2.5 / 10000 / 1000)}人已经集齐卡牌`;
this.easyScroller(this.scrollerLable1, this.scrollerLable2, 1000); this.easyScroller(this.scrollerLable1, this.scrollerLable2, 1000);
// 标题扫光 // 标题扫光
......
This diff is collapsed.
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