Commit 4ac0220d authored by 邱旭's avatar 邱旭

--

parent e27e3986
No preview for this file type
This diff is collapsed.
No preview for this file type
......@@ -104,6 +104,10 @@
var toActionId = 'doJoin'; // toActionId
var projectId = 'pa2340903'; // 星宿台项目id
var joinDownLink = ''; // 我也要参与按钮的下载链接
var helpDownLink = ''; // 助力按钮的下载链接
var lawoDownLink = ''; // 拉我按钮的下载链接
var rule = "欢迎加入夺宝大作战欢迎加入<br>夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战<br>欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大<br>作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入<br>夺宝大作战欢迎加入夺宝大作战欢迎加<br>入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎<br>加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大<br>作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入<br>夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战<br>欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大<br>作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入<br>夺宝大作战欢迎加入夺宝大作战欢迎加<br>入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎<br>加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大<br>作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入<br>夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战<br>欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大<br>作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入<br>夺宝大作战欢迎加入夺宝大作战欢迎加<br>入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎<br>加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大<br>作战欢迎加入夺宝大作战欢迎加入夺宝大作战欢迎加入夺宝大作战";
var mapPlugIDList = [1218, 1219];
......@@ -116,6 +120,30 @@
}
</script>
<!--QQ输入法方法-->
<script type="text/javascript">
function goClient(assistItemId = "") {
let url = window.encodeURIComponent("");
let share_url = "";
share_url += (assistItemId != "") ? `&assistItemId=${assistItemId}` : "";
let sUrl = window.encodeURIComponent(share_url);
let common = "我正在参与EMOJI大作战,最高可得66元现金红包!";
let title = "快来QQ输入法找我玩吧";
window.location.href = `com.tencent.qqpinyin.third://emoji?url=${url}&share_url=${sUrl}&common=${common}&title=${title}`;
}
function shareTo(assistItemId) {
var shareLink = "" + assistItemId ? `?assistItemId=${assistItemId}` : "";
var shareTitle = "我正在参与EMOJI大作战,最高可得66元现金红包!";
var shareDes = "快来QQ输入法找我玩吧";
QQInputAndroid.shareTo(shareLink, shareTitle, shareDes)
}
function getAndroidId() {
return QQInputAndroid.getAndroidId() || null;
}
</script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>
egret.runEgret({
......
No preview for this file type
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"index_scene","version":5,"files":["../assets/index_scene/act_title.png","../assets/index_scene/emoji_left.png","../assets/index_scene/emoji_right.png","../assets/index_scene/logo.png","../assets/index_scene/rule_btn.png","../assets/index_scene/share_tips.png","../assets/index_scene/title.png","../assets/index_scene/card/card1.png","../assets/index_scene/card/card2.png","../assets/index_scene/card/card3.png","../assets/index_scene/card/getPrize_btn.png","../assets/index_scene/card/select.png","../assets/index_scene/card/share_btn.png","../assets/index_scene/card/times_img.png","../assets/index_scene/emojis/emoji_0_disable.png","../assets/index_scene/emojis/emoji_0_enable.png","../assets/index_scene/emojis/emoji_1_disable.png","../assets/index_scene/emojis/emoji_1_enable.png","../assets/index_scene/emojis/emoji_2_disable.png","../assets/index_scene/emojis/emoji_2_enable.png","../assets/index_scene/emojis/emoji_3_disable.png","../assets/index_scene/emojis/emoji_3_enable.png","../assets/index_scene/emojis/emoji_4_disable.png","../assets/index_scene/emojis/emoji_4_enable.png","../assets/index_scene/emojis/emoji_5_disable.png","../assets/index_scene/emojis/emoji_5_enable.png","../assets/index_scene/emojis/emoji_times_bg.png","../assets/index_scene/prize_list/box_disable.png","../assets/index_scene/prize_list/box_enable.png","../assets/index_scene/prize_list/prizeLise_item.png","../assets/index_scene/prize_list/prizeList_bg.png","../assets/index_scene/prize_list/progressbar_bg.png","../assets/index_scene/prize_list/progressbar_fill.png","../assets/index_scene/score_pos/download_btn.png","../assets/index_scene/score_pos/img.png","../assets/index_scene/score_pos/scorePos_bg.png","../assets/index_scene/bg.png","../assets/index_scene/card/index_card_bg.png","../assets/index_scene/myPrize_btn.png","../assets/index_scene/prize_list/aqy.png","../assets/index_scene/prize_list/tx.png","../assets/index_scene/prize_list/yk.png","../assets/index_scene/prize_list/zfb.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"index_scene","version":5,"files":["../assets/index_scene/act_title.png","../assets/index_scene/emoji_left.png","../assets/index_scene/emoji_right.png","../assets/index_scene/logo.png","../assets/index_scene/rule_btn.png","../assets/index_scene/share_tips.png","../assets/index_scene/title.png","../assets/index_scene/card/card1.png","../assets/index_scene/card/card2.png","../assets/index_scene/card/card3.png","../assets/index_scene/card/getPrize_btn.png","../assets/index_scene/card/select.png","../assets/index_scene/card/share_btn.png","../assets/index_scene/card/times_img.png","../assets/index_scene/emojis/emoji_0_disable.png","../assets/index_scene/emojis/emoji_0_enable.png","../assets/index_scene/emojis/emoji_1_disable.png","../assets/index_scene/emojis/emoji_1_enable.png","../assets/index_scene/emojis/emoji_2_disable.png","../assets/index_scene/emojis/emoji_2_enable.png","../assets/index_scene/emojis/emoji_3_disable.png","../assets/index_scene/emojis/emoji_3_enable.png","../assets/index_scene/emojis/emoji_4_disable.png","../assets/index_scene/emojis/emoji_4_enable.png","../assets/index_scene/emojis/emoji_5_disable.png","../assets/index_scene/emojis/emoji_5_enable.png","../assets/index_scene/emojis/emoji_times_bg.png","../assets/index_scene/prize_list/box_disable.png","../assets/index_scene/prize_list/box_enable.png","../assets/index_scene/prize_list/prizeLise_item.png","../assets/index_scene/prize_list/prizeList_bg.png","../assets/index_scene/prize_list/progressbar_bg.png","../assets/index_scene/prize_list/progressbar_fill.png","../assets/index_scene/score_pos/download_btn.png","../assets/index_scene/score_pos/scorePos_bg.png","../assets/index_scene/bg.png","../assets/index_scene/card/index_card_bg.png","../assets/index_scene/myPrize_btn.png","../assets/index_scene/prize_list/aqy.png","../assets/index_scene/prize_list/tx.png","../assets/index_scene/prize_list/yk.png","../assets/index_scene/prize_list/zfb.png","../assets/index_scene/score_pos/img1.png","../assets/index_scene/score_pos/img2.png","../assets/index_scene/help.png","../assets/index_scene/join.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule_panel","version":5,"files":["../assets/rule_panel/rule_bg.png","../assets/rule_panel/rule_panel_btn.png"]}
\ No newline at end of file
......@@ -59,6 +59,10 @@
{
"keys":"over_bg_png,over_btn_png",
"name":"over_panel"
},
{
"keys":"rule_bg_png,rule_panel_btn_png",
"name":"rule_panel"
}
],
"resources":[
......@@ -491,6 +495,16 @@
"name":"join_png",
"type":"image",
"url":"assets/index_scene/join.png"
},
{
"name":"rule_bg_png",
"type":"image",
"url":"assets/rule_panel/rule_bg.png"
},
{
"name":"rule_panel_btn_png",
"type":"image",
"url":"assets/rule_panel/rule_panel_btn.png"
}
]
}
\ No newline at end of file
......@@ -62,8 +62,8 @@
<e:Label id="timesLabel" text="今日 次数:0次" y="448" textColor="0x000000" horizontalCenter="-6" size="26" bold="true"/>
<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:Label id="scrollerLable1" text="XXXXX人正在集卡" size="25" anchorOffsetX="0" width="544" y="2" x="0" textColor="0x000000"/>
<e:Label id="scrollerLable2" text="XXXXX人已集齐卡牌" size="25" anchorOffsetX="0" width="544" y="2" x="549" scaleX="1" scaleY="1" textColor="0x000000"/>
<e:Label id="scrollerLable1" text="XXXXX人正在集卡" size="25" anchorOffsetX="0" width="544" y="2" textColor="0x000000" horizontalCenter="0"/>
<e:Label id="scrollerLable2" text="XXXXX人已集齐卡牌" size="25" anchorOffsetX="0" width="544" y="2" scaleX="1" scaleY="1" textColor="0x000000" horizontalCenter="0"/>
</e:Group>
</e:Group>
<e:Group height="119" anchorOffsetY="0" horizontalCenter="0" y="798" left="0" right="0" x="0" scaleX="1" scaleY="1">
......@@ -137,4 +137,8 @@
<e:Image y="1996" scaleX="1" scaleY="1" source="logo_png" horizontalCenter="0"/>
</e:Group>
</e:Scroller>
<e:Group id="osGroup" width="750" x="0" height="2249" y="0" visible="false">
<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:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="CreditsTip" width="750" height="1335" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Button id="closeBtn" label="" y="967.52" horizontalCenter="0">
<e:Button id="closeBtn" label="" y="130.5" horizontalCenter="283.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeBtn_png" source.down="closeBtn_png" source.disabled="closeBtn_png"/>
......@@ -8,10 +8,18 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Label text="活动说明" y="111" bold="true" horizontalCenter="0"/>
<e:Scroller y="176.97" anchorOffsetX="0" anchorOffsetY="0" x="61" height="750" width="628">
<e:Group anchorOffsetX="0" anchorOffsetY="0">
<e:Label id="ruleLabel" text="" anchorOffsetX="0" anchorOffsetY="0" scaleX="1" scaleY="1" width="628" y="0" x="0" lineSpacing="20"/>
<e:Image scaleX="1" scaleY="1" y="163" source="rule_bg_png" horizontalCenter="0"/>
<e:Scroller y="287.97" anchorOffsetX="0" anchorOffsetY="0" x="137" height="411" width="477">
<e:Group anchorOffsetX="0" anchorOffsetY="0" width="477" height="452" x="202">
<e:Label id="ruleLabel" text="" anchorOffsetX="0" anchorOffsetY="0" scaleX="1" scaleY="1" width="477" y="0" x="0" lineSpacing="20" textColor="0x000000"/>
</e:Group>
</e:Scroller>
<e:Button id="ok_btn" label="" y="779" scaleX="1" scaleY="1" anchorOffsetY="58.5" anchorOffsetX="186.8" horizontalCenter="1">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="rule_panel_btn_png" source.down="rule_panel_btn_png" source.disabled="rule_panel_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Skin>
\ No newline at end of file
No preview for this file type
var Utils = /** @class */ (function () {
function Utils() {
}
Object.defineProperty(Utils, "instance", {
get: function () {
return Utils._instance || (Utils._instance = new Utils());
},
enumerable: true,
configurable: true
});
/**
* 加载Svga动画
* @param url - 资源地址
* @param loop - 是否循环播放
* @param call - 回调函数
* @param parent - 父节点
*/
Utils.loadSvga = function (url, loop, parent, call) {
var _this = this;
return new Promise(function (resolve, reject) {
var parser = new window["SVGA"].Parser();
parser.load(url, function (videoItem) {
var mv = new window["SVGA"].EgretMovieClip(videoItem);
mv.gotoAndPlay(1, loop ? -1 : 1);
if (parent) {
parent.addChild(mv);
}
mv.addEventListener(egret.Event.COMPLETE, function () {
if (call) { // 有回调就调用
call();
}
if (!loop) { // 不重复就删除
mv.stop();
parent.removeChild(mv);
}
}, _this);
resolve(mv);
}, function (error) {
reject(error.message);
});
});
};
;
/**
* 产生一个固定范围的随机数(左闭右开)
* @param start
* @param end
*/
Utils.Random = function (start, end) {
return Math.random() * (end - start) + start;
};
/**
* 产生一个固定范围的随机整数(左闭右开)
* @param start
* @param end
*/
Utils.RandomInt = function (start, end) {
return Math.floor(Math.random() * (end - start) + start);
};
return Utils;
}());
export default Utils;
......@@ -11,12 +11,12 @@ export default class Utils {
/**
* 加载Svga动画
* @param url - 资源地址
* @param loop - 是否循环播放
* @param call - 回调函数
* @param parent - 父节点
* @param url 资源地址
* @param loop 是否循环播放
* @param call 回调函数
* @param parent 父节点
*/
public static loadSvga(url: string, loop:boolean, parent?: egret.DisplayObjectContainer, call?:Function){
public static loadSvga(url: string, loop: boolean, parent?: egret.DisplayObjectContainer, call?: Function) {
return new Promise((resolve, reject) => {
const parser = new window["SVGA"].Parser();
parser.load(url, (videoItem) => {
......@@ -28,10 +28,10 @@ export default class Utils {
}
mv.addEventListener(egret.Event.COMPLETE, () => {
if(call){ // 有回调就调用
if(call) { // 有回调就调用
call();
}
if(!loop){ // 不重复就删除
if(!loop) { // 不重复就删除
mv.stop();
parent.removeChild(mv);
}
......@@ -45,6 +45,70 @@ export default class Utils {
});
};
/**
* 对象/数组 深拷贝
* @param {Object} src - 来源对象
* @param {Object} dst - 目标对象
* @returns {Object} obj - 拷贝完成的对象
*/
public static deepClone(src, dst = undefined) {
var _obj = dst || (src instanceof Array ? [] : {});
for(let key in src) {
let prop = src[key];
if(prop === _obj) { // 避免相互引用对象导致死循环,如src.a = dst的情况
continue;
}
_obj[key] = ((typeof prop === 'object') ? this.deepClone(prop) : _obj[key] = prop);
// if (typeof prop === 'object') { // 如果这是个对象则递归调用
// _obj[key] = _deepClone(prop);
// } else {
// _obj[key] = prop;
// }
}
return _obj;
};
/**
* 获取连接上的参数,以对象的形式返回
* @constructor
*/
public static getRequest() {
const url = location.search; //获取url中"?"符后的字串
let theRequest = {};
if(url.indexOf("?") != -1) {
let str = url.substr(1);
let strs = str.split("&");
for(let i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
/**
* 根据参数名获取连接上的参数值
* @param key 参数名
* @constructor
*/
public static getRequestByKey(key) {
const request = this.getRequest();
return request[key] || null;
// const url = location.search;
// let theRequest = {};
// if (url.indexOf("?") != -1)
// {
// let str = url.substr(1);
// let strs = str.split("&");
// for (let i = 0; i < strs.length; i++)
// {
// theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
// }
// }
// return theRequest[key];
}
/**
* 产生一个固定范围的随机数(左闭右开)
* @param start
......@@ -62,4 +126,18 @@ export default class Utils {
public static RandomInt(start: number, end: number) {
return Math.floor(Math.random() * (end - start) + start);
}
/**
* obj是否在array中
* @param obj
* @param array
*/
public static isInArray(obj: any, array: any[]) {
for(let i in array) {
if(obj == array[i]) {
return true;
}
}
return false;
}
}
\ No newline at end of file
......@@ -175,6 +175,7 @@ class Main extends eui.UILayer {
GDispatcher.dispatchEvent('progress', [20]);
await RES.loadGroup('index_scene');
await RES.loadGroup('rule_panel');
GDispatcher.dispatchEvent('progress', [35]);
await RES.loadGroup('gameTips_panel');
......
......@@ -2,21 +2,25 @@ import Panel from "../../MVC/views/Panel";
import { HtmlTextParser } from "../../../libs/tc/util/HtmlTextParser";
export default class RulePanel extends Panel {
public closeBtn: eui.Button;
public ruleLabel: eui.Label;
public closeBtn:eui.Button;
public ruleLabel:eui.Label;
public ok_btn:eui.Button;
public get skinKey() { return 'RulePanel' }
public get groupName() { return 'prize_panel' }
public get groupName() { return 'rule_panel' }
constructor(data?) {
super(data);
}
initEvents() {
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
}
removeEvents() {
this.closeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
}
protected onSkinComplete(): void {
......@@ -24,7 +28,7 @@ export default class RulePanel extends Panel {
this.preLoadRes();
this.onLoad();
}
protected onLoad(): void {
......
......@@ -6,6 +6,7 @@ import EffectMgr from "../../MVC/ctrls/EffectMgr";
import { GTime } from "../../../libs/tc/util/GTime";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import { getlogItem } from "../../getlogItem";
import Utils from "../../MVC/utils/Utils";
export default class IndexScene extends Scene {
public scroller:eui.Scroller;
......@@ -49,8 +50,8 @@ export default class IndexScene extends Scene {
public list:eui.List;
public image:eui.Image;
public downloadBtn:eui.Button;
public osGroup:eui.Group;
public osLabel:eui.Label;
// emoji表情
private emojisId = ["sp_1", "sp_2", "sp_3", "sp_4", "sp_5", "sp_6"];
......@@ -101,14 +102,24 @@ export default class IndexScene extends Scene {
onTouchHelp() {
PanelCtrl.instance.btnDelay(this.help_btn);
NetManager.ins.clickLog(getlogItem(6));
NetManager.ins.clickLog(getlogItem(5));
// 帮助,需要assistItemId
let assistItemId = Utils.getRequestByKey("assistItemId") || "";
window["goClient"](assistItemId);
setTimeout(()=>{
window.location.href = window['helpDownLink'];
}, 500);
}
onTouchJoin() {
PanelCtrl.instance.btnDelay(this.join_btn);
NetManager.ins.clickLog(getlogItem(6));
// 参与,不需要assistItemId
// let assistItemId = Utils.getRequestByKey("assistItemId") || "";
window["goClient"]("");
setTimeout(()=>{
window.location.href = window['joinDownLink'];
}, 500);
}
onTouchDownloadBtn() {
......@@ -116,7 +127,7 @@ export default class IndexScene extends Scene {
NetManager.ins.clickLog(getlogItem(7));
////////////////////////////////////////////////////////////////////////////////////////////////////////
// 点击拉我按钮
window.location.href = window['lawoDownLink'];
////////////////////////////////////////////////////////////////////////////////////////////////////////
}
......@@ -160,8 +171,8 @@ export default class IndexScene extends Scene {
protected onSkinComplete(): void {
super.onSkinComplete();
this.onLoad();
this.checkOS();
this.onLoad();
}
/**
......@@ -172,23 +183,43 @@ export default class IndexScene extends Scene {
|| 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
if(os && os[0].indexOf(' OS ') > -1) {
this.showToast("本活动仅限安卓用户参与哦");
} else if(os && os[0].indexOf(' OS ') == -1) {
if(os && os[0] && os[0].indexOf(' OS ') > -1) {
this.osLabel.text = "该活动仅支持安卓用户参与";
this.osGroup.visible = true;
} else if(os && os[0] && os[0].indexOf(' OS ') == -1) {
console.log("Android 4.4 以上");
} else {
this.showToast("请尽快升级最新版本参与活动吧");
this.osGroup.visible = true;
this.osLabel.text = "请尽快升级安卓系统版本参与活动";
}
}
private check() {
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 [5-9].[0-9](.[0-9])?/); // 是否是 Android 5.0 - 5.9.9
if(os && os[0] && os[0].indexOf(' OS ') > -1) {
return false;
} else if(os && os[0] && os[0].indexOf(' OS ') == -1) {
return true;
} else {
return false;
}
}
private easyScroller(obj1: any, obj2: any, duration: number) {
egret.Tween.get(obj1).to({x: -obj1.width}, duration).call(() => {
obj1.x = obj1.width;
this.scrollerLable1.text = `${Math.floor(GTime.getTimestamp() / 100000)}人正在集卡`;
egret.Tween.get(obj2).to({x: -obj2.width}, duration).call(() => {
obj2.x = obj2.width;
this.scrollerLable2.text = `${Math.floor(GTime.getTimestamp() * 2.5 / 10000 / 1000)}人已经集齐卡牌`;
this.easyScroller(obj1, obj2, duration);
egret.Tween.get(obj1).to({y: 2}, duration).wait(1500).call(() => {
egret.Tween.get(obj1).to({y: -28}, 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: -28}, duration).call(() => {
obj2.y = 30;
this.scrollerLable2.text = `${Math.floor(GTime.getTimestamp() * 2.5 / 10000 / 1000)}人已经集齐卡牌, 抽中支付宝红包`;
this.easyScroller(obj1, obj2, duration);
});
});
});
});
}
......@@ -244,24 +275,25 @@ export default class IndexScene extends Scene {
private initEffect() {
EffectMgr.instance.breathingEffect(this.downloadBtn);
// 滚动弹幕
this.scrollerGroup.mask = this.scrollerMask;
this.scrollerLable1.x = this.scrollerLable1.width;
this.scrollerLable2.x = this.scrollerLable2.width;
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, 6000);
this.scrollerLable2.text = `${Math.floor(GTime.getTimestamp() * 2.5 / 10000 / 1000)}人已经集齐卡牌`;
this.easyScroller(this.scrollerLable1, this.scrollerLable2, 1000);
// 标题扫光
this.btnGroup.mask = this.maskGroup;
this.titleGroup.mask = this.titleMask;
egret.Tween.get(this.sweepLight).to({x: 705}, 1500).wait(200).call(()=>{
egret.Tween.get(this.sweepLight).to({x: 705}, 1500).wait(200).call(() => {
this.btnSweepLight();
});
}
private btnSweepLight(){
egret.Tween.get(this.sweepLightBtn).to({x: 705}, 2500).wait(1000).call(()=>{
private btnSweepLight() {
egret.Tween.get(this.sweepLightBtn).to({x: 705}, 2500).wait(1000).call(() => {
this.sweepLightBtn.x = -85;
this.btnSweepLight();
});
......
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