Commit ef173ada authored by 邱旭's avatar 邱旭

1

parent 7def75b5
...@@ -52,6 +52,8 @@ import BagPanel from "../../src/panels/BagPanel"; ...@@ -52,6 +52,8 @@ import BagPanel from "../../src/panels/BagPanel";
import H5Scene from "../../src/H5Scene"; import H5Scene from "../../src/H5Scene";
import InviteCutTimePanel from "../../src/panels/InviteCutTimePanel"; import InviteCutTimePanel from "../../src/panels/InviteCutTimePanel";
import RulePanel2 from "./components/RulePanel2"; import RulePanel2 from "./components/RulePanel2";
import ScratchPanel from "../../src/panels/ScratchPanel";
import ScratchPrizePanel from "../../src/panels/ScratchPrizePanel";
export default class MainBase extends eui.UILayer { export default class MainBase extends eui.UILayer {
constructor() { constructor() {
...@@ -94,6 +96,8 @@ export default class MainBase extends eui.UILayer { ...@@ -94,6 +96,8 @@ export default class MainBase extends eui.UILayer {
['invitePrize', { cls: InvitePrizePanel }], ['invitePrize', { cls: InvitePrizePanel }],
['inviteCutTime', { cls: InviteCutTimePanel }], ['inviteCutTime', { cls: InviteCutTimePanel }],
['inviteRule', { cls: InviteRulePanel }], ['inviteRule', { cls: InviteRulePanel }],
['scratch', { cls: ScratchPanel }],
['scratchPrize', { cls: ScratchPrizePanel }],
['friend', { cls: FriendPanel }], ['friend', { cls: FriendPanel }],
['ad', { cls: ADPanel }], ['ad', { cls: ADPanel }],
]; ];
......
...@@ -127,6 +127,18 @@ ...@@ -127,6 +127,18 @@
{ {
"keys": "sharefriend_png", "keys": "sharefriend_png",
"name": "friendshare" "name": "friendshare"
},
{
"keys": "scratch_bg_png,scratch_help_png,scratch_wx_tip_png,scratchbg2_png,scratch_invite_png,scratch_progress_bg_png,scratch_hongbao_png",
"name": "scratch"
},
{
"keys": "scratchPrize_bg_png,scratchPrize_btn_png,scratchPrize_game_btn_png",
"name": "scratchprizepanel"
},
{
"keys": "scratch_rule_bg_png",
"name": "scratchrulepanel"
} }
], ],
"resources": [ "resources": [
...@@ -2274,6 +2286,61 @@ ...@@ -2274,6 +2286,61 @@
"url": "assets/ad/adbg.png", "url": "assets/ad/adbg.png",
"type": "image", "type": "image",
"name": "adbg_png" "name": "adbg_png"
},
{
"url": "assets/scratch/scratch_bg.png",
"type": "image",
"name": "scratch_bg_png"
},
{
"url": "assets/scratch/scratch_help.png",
"type": "image",
"name": "scratch_help_png"
},
{
"url": "assets/scratch/scratch_wx_tip.png",
"type": "image",
"name": "scratch_wx_tip_png"
},
{
"url": "assets/scratch/scratchbg2.png",
"type": "image",
"name": "scratchbg2_png"
},
{
"url": "assets/scratch/scratch_invite.png",
"type": "image",
"name": "scratch_invite_png"
},
{
"url": "assets/scratch/prize/scratchPrize_bg.png",
"type": "image",
"name": "scratchPrize_bg_png"
},
{
"url": "assets/scratch/prize/scratchPrize_btn.png",
"type": "image",
"name": "scratchPrize_btn_png"
},
{
"url": "assets/scratch/prize/scratchPrize_game_btn.png",
"type": "image",
"name": "scratchPrize_game_btn_png"
},
{
"url": "assets/scratch/rule/scratch_rule_bg.png",
"type": "image",
"name": "scratch_rule_bg_png"
},
{
"url": "assets/scratch/scratch_progress_bg.png",
"type": "image",
"name": "scratch_progress_bg_png"
},
{
"url": "assets/scratch/scratch_hongbao.png",
"type": "image",
"name": "scratch_hongbao_png"
} }
] ]
} }
\ No newline at end of file
{ {
"skins": {}, "skins": {},
"autoGenerateExmlsList": true, "autoGenerateExmlsList": true,
"exmls": [ "exmls": [
"resource/skins/ADSkin.exml", "resource/skins/ADSkin.exml",
"resource/skins/ADSmallSkin.exml", "resource/skins/ADSmallSkin.exml",
"resource/skins/AlertSkin.exml", "resource/skins/AlertSkin.exml",
"resource/skins/AvatarSkin.exml", "resource/skins/AvatarSkin.exml",
"resource/skins/BackSkin.exml", "resource/skins/BackSkin.exml",
"resource/skins/BagSkin.exml", "resource/skins/BagSkin.exml",
"resource/skins/Blood2Skin.exml", "resource/skins/Blood2Skin.exml",
"resource/skins/BloodSkin.exml", "resource/skins/BloodSkin.exml",
"resource/skins/Box2Skin.exml", "resource/skins/Box2Skin.exml",
"resource/skins/BoxSkin.exml", "resource/skins/BoxSkin.exml",
"resource/skins/Buy1Skin.exml", "resource/skins/Buy1Skin.exml",
"resource/skins/Buy2Skin.exml", "resource/skins/Buy2Skin.exml",
"resource/skins/Buy3Skin.exml", "resource/skins/Buy3Skin.exml",
"resource/skins/ExchangeSkin.exml", "resource/skins/ExchangeSkin.exml",
"resource/skins/FailSkin.exml", "resource/skins/FailSkin.exml",
"resource/skins/FriendItem2Skin.exml", "resource/skins/FriendItem2Skin.exml",
"resource/skins/FriendItemSkin.exml", "resource/skins/FriendItemSkin.exml",
"resource/skins/FriendShareSkin.exml", "resource/skins/FriendShareSkin.exml",
"resource/skins/FriendSkin.exml", "resource/skins/FriendSkin.exml",
"resource/skins/H5Skin.exml", "resource/skins/H5Skin.exml",
"resource/skins/IconButtonSkin.exml", "resource/skins/IconButtonSkin.exml",
"resource/skins/InviteCutTimePanelSkin.exml", "resource/skins/InviteCutTimePanelSkin.exml",
"resource/skins/InviteItemSkin.exml", "resource/skins/InviteItemSkin.exml",
"resource/skins/InvitePrizePanelSkin.exml", "resource/skins/InvitePrizePanelSkin.exml",
"resource/skins/InviteRulePanelSkin.exml", "resource/skins/InviteRulePanelSkin.exml",
"resource/skins/InviteRuleSkin.exml", "resource/skins/InviteRuleSkin.exml",
"resource/skins/InviteSkin.exml", "resource/skins/InviteSkin.exml",
"resource/skins/Main2Skin.exml", "resource/skins/Main2Skin.exml",
"resource/skins/MapBottomSkin.exml", "resource/skins/MapBottomSkin.exml",
"resource/skins/MapRepeatSkin.exml", "resource/skins/MapRepeatSkin.exml",
"resource/skins/MapSkin.exml", "resource/skins/MapSkin.exml",
"resource/skins/MapTopSkin.exml", "resource/skins/MapTopSkin.exml",
"resource/skins/NoPrizeSkin.exml", "resource/skins/NoPrizeSkin.exml",
"resource/skins/OptionItemSkin.exml", "resource/skins/OptionItemSkin.exml",
"resource/skins/OptionsSkin.exml", "resource/skins/OptionsSkin.exml",
"resource/skins/PlaySkin.exml", "resource/skins/PlaySkin.exml",
"resource/skins/Prize2Skin.exml", "resource/skins/Prize2Skin.exml",
"resource/skins/PrizeSkin.exml", "resource/skins/PrizeSkin.exml",
"resource/skins/QuitSkin.exml", "resource/skins/QuitSkin.exml",
"resource/skins/RankFriendListSkin.exml", "resource/skins/RankFriendListSkin.exml",
"resource/skins/RankItemSkin.exml", "resource/skins/RankItemSkin.exml",
"resource/skins/RankSkin.exml", "resource/skins/RankSkin.exml",
"resource/skins/ReliveSkin.exml", "resource/skins/ReliveSkin.exml",
"resource/skins/RuleSkin.exml", "resource/skins/RuleSkin.exml",
"resource/skins/Share2Skin.exml", "resource/skins/ScratchItemSkin.exml",
"resource/skins/Share3Skin.exml", "resource/skins/ScratchPrizeSkin.exml",
"resource/skins/ShareSkin.exml", "resource/skins/ScratchRuleSkin.exml",
"resource/skins/ShareTipsSkin.exml", "resource/skins/ScratchSkin.exml",
"resource/skins/ShopSkin.exml", "resource/skins/Share2Skin.exml",
"resource/skins/ShowOffSkin.exml", "resource/skins/Share3Skin.exml",
"resource/skins/SignItemSkin.exml", "resource/skins/ShareSkin.exml",
"resource/skins/SignPrizeSkin.exml", "resource/skins/ShareTipsSkin.exml",
"resource/skins/SignSkin.exml", "resource/skins/ShopSkin.exml",
"resource/skins/StarSkin.exml", "resource/skins/ShowOffSkin.exml",
"resource/skins/StartPanelSkin.exml", "resource/skins/SignItemSkin.exml",
"resource/skins/StartSkin.exml", "resource/skins/SignPrizeSkin.exml",
"resource/skins/TargetItemSkin.exml", "resource/skins/SignSkin.exml",
"resource/skins/TaskItemSkin.exml", "resource/skins/StarSkin.exml",
"resource/skins/TaskPrizeSkin.exml", "resource/skins/StartPanelSkin.exml",
"resource/skins/TaskSkin.exml", "resource/skins/StartSkin.exml",
"resource/skins/ToastSkin.exml", "resource/skins/TargetItemSkin.exml",
"resource/skins/VScrollBarSkin.exml" "resource/skins/TaskItemSkin.exml",
], "resource/skins/TaskPrizeSkin.exml",
"path": "resource/default.thm.json" "resource/skins/TaskSkin.exml",
"resource/skins/ToastSkin.exml",
"resource/skins/VScrollBarSkin.exml"
],
"path": "resource/default.thm.json"
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="InviteItemSkin" width="90" height="90" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="img" source="" top="0" left="0" bottom="0" right="0"/>
<e:Rect id="mask" left="0" top="0" bottom="0" right="0" ellipseWidth="90" ellipseHeight="90"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing">
<e:Image y="45.33" horizontalCenter="0" source="scratchPrize_bg_png"/>
<e:Image id="prizeImg" y="426.77" source="" horizontalCenter="0" width="510" height="228"/>
<e:Button id="closeBtn" label="" x="624" y="313.33">
<e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png"
source.disabled="closeCommonBtn_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="ok_btn" label="" y="764" anchorOffsetX="138.5" anchorOffsetY="56.5" x="236.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="scratchPrize_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="game_btn" label="" y="764" anchorOffsetX="139" anchorOffsetY="56.5" x="527">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="scratchPrize_game_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="InviteRuleSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Rect left="0" bottom="0" top="0" right="0" fillColor="0x000000" fillAlpha="0.7"/>
<e:Image id="ruleBg" horizontalCenter="0.5" y="152" source="scratch_rule_bg_png"/>
<e:Scroller id="scroller" width="545" x="104.76" height="507" y="377.2">
<e:Group id="group" width="100%">
<e:Label id="labContent" width="100%" text="" lineSpacing="10" size="30" multiline="true" textColor="0xa54615"/>
<e:layout>
<e:VerticalLayout/>
</e:layout>
</e:Group>
</e:Scroller>
<e:Button id="closeBtn" label="" x="614" y="301">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing">
<w:Config id="16dd8f58b77" visible="false"/>
<e:Image id="light2" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296" source="scratchbg2_png"/>
<e:Image id="light1" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296" source="scratchbg2_png"/>
<e:Image y="259.33" source="scratch_bg_png" horizontalCenter="0"/>
<e:Group id="con" y="-67"/>
<e:Label text="共2位好友帮你刮了90.3%" y="381.33" textColor="0xF54500" size="28" horizontalCenter="0" fontFamily="Lucida Family" verticalAlign="middle" textAlign="center"/>
<e:Image id="prizeImg" y="439.33" horizontalCenter="0.5" source="" width="510" height="228"/>
<e:Button id="closeBtn" label="" x="605" y="219.33">
<e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png"
source.disabled="closeCommonBtn_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="helpBtn" label="" x="564" y="376.33">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="scratch_help_png" source.down="scratch_help_png" source.disabled="scratch_help_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="numLabel" text="仅差3人可获得" y="679.33" textColor="0xf54500" size="28" horizontalCenter="0" visible="false"/>
<e:Label id="cutTimeLabel" text="将在23:43:21后失效" y="883.33" size="28" textColor="0xffffff" horizontalCenter="0"/>
<e:Scroller width="487" height="90" y="775" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="32.5">
<e:Group anchorOffsetX="0" y="2">
<e:List id="list" x="0" y="0" anchorOffsetX="0">
<e:layout>
<e:HorizontalLayout horizontalAlign="center" verticalAlign="middle" gap="23"/>
</e:layout>
</e:List>
<e:layout>
<e:HorizontalLayout gap="66" horizontalAlign="center" verticalAlign="middle"/>
</e:layout>
</e:Group>
</e:Scroller>
<e:Group id="wxShareTip" width="750" height="1206" y="0" x="0" visible="false">
<e:Rect fillAlpha="0.7" left="0" top="0" right="0" bottom="0"/>
<e:Image x="424" y="0" source="scratch_wx_tip_png"/>
</e:Group>
<e:Group x="133" y="711" width="437" height="22">
<e:Image id="progressMask" source="scratch_progress_bg_png" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0" verticalCenter="0"/>
<e:Group id="progressGroup" horizontalCenter="0" verticalCenter="0">
<e:Image id="progressBg" source="scratch_progress_bg_png" anchorOffsetX="0" anchorOffsetY="0" x="0" y="0" width="437" height="22"/>
<e:Rect id="progress" fillColor="0xeb1917" left="0" verticalCenter="0" width="99" height="22"/>
<e:Label text="仅剩90.7%" size="18" verticalCenter="0" horizontalCenter="0"/>
</e:Group>
</e:Group>
<e:Image id="hongbao" x="586" y="697" source="scratch_hongbao_png"/>
</e:Skin>
\ No newline at end of file
This diff is collapsed.
import Panel from "../../libs/new_wx/components/Panel";
import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { iswx } from "../iswx";
import Utils from "../Utils";
import ScratchRulePanel from "./ScratchRulePanel";
export default class ScratchPanel extends Panel {
public light2:eui.Image;
public light1:eui.Image;
public con:eui.Group;
public prizeImg:eui.Image;
public closeBtn:eui.Button;
public helpBtn:eui.Button;
public numLabel:eui.Label;
public cutTimeLabel:eui.Label;
public list:eui.List;
public wxShareTip:eui.Group;
public progressMask:eui.Image;
public progressGroup:eui.Group;
public progressBg:eui.Image;
public progress:eui.Rect;
public hongbao:eui.Image;
private invite_img: egret.Texture;
private timer: egret.Timer;
private cutTime: number;
constructor(data) {
super();
this.data = data;
}
async start(data) {
super.start();
this.showlog();
this['light1'].visible = this['light2'].visible = false;
// this['con'].addChild(this.data.svga);
// this.data.svga.gotoAndPlay(1, true);
// this.data.svga.once(egret.Event.COMPLETE, () => {
// this.data.svga.stop(1);
// }, this);
setTimeout(() => {
this.playBgAni();
}, 500);
}
playBgAni() {
this['light1'].visible = this['light2'].visible = true;
const time = 7000;
egret.Tween.get(this['light1'], { loop: true }).to({ rotation: 360 }, time);
egret.Tween.get(this['light2'], { loop: true }).to({ rotation: -360 }, time);
}
showlog() {
}
initEvents() {
super.initEvents();
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.helpBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapRule, this);
}
onTouchTap_closeBtn() {
GDispatcher.dispatchEvent("getInviteInfo");
super.onTouchTap_closeBtn();
}
removeEvents() {
super.removeEvents();
this.closeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.helpBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapRule, this);
}
onTapRule() {
const rule = new ScratchRulePanel();
rule.loadSkin();
rule.start();
this.addChild(rule);
}
protected onSkinComplete() {
this.getGameRes().then(r => this.initUI());
}
initUI() {
this.setWXShareTip();
this.progressGroup.mask = this.progressMask;
this.setProgress(90.7);
// this.prizeImg.source = this.data.prizeImg;
// if (!this.data.invitationUser) {
// this.data.invitationUser = [];
// }
// let dNum = this.data.invitationCount - this.data.invitationUser.length;
// this.numLabel.text = `仅差${dNum}人可获得`;
//
// for (let i = 0; i < dNum; i++) {
// this.data.invitationUser.push({
// nickname: "nickname",
// avatar: this.invite_img,
// });
// }
// for (let i = 0; i < this.data.invitationUser.length; i++) {
// this.data.invitationUser[i]['callFun'] = () => {
// NetManager.ins.getShareCode((success, res) => {
// if (!success) {
// return;
// }
// let shareCode = res.data; // 分享码
// CFG.wxShareLink = window['h5URL'] + "&shareCode=" + shareCode; // 分享链接
// CFG.wxShareTitle = '狮狮连萌超好玩~我已经玩到第一了!';
// CFG.wxShareDesc = '我在萌狮消消乐等你来挑战哦';
// CFG.wxShareImg="http://yun.duiba.com.cn/db_games/xiaoxiaole2.jpg";
// if (iswx()) { //微信端
// this.wxShareTip.visible = true;
// window["invokeWX"]();
// } else {//端内
// this.wxShareTip.visible = false;
// window["inviteShare"](shareCode);
// }
// });
// }
// }
// this.list.useVirtualLayout = false;
// this.list.itemRenderer = ScratchItem;
// this.list.dataProvider = new eui.ArrayCollection(this.data.invitationUser);
//
// this.cutTime = this.data.endTime - this.data.sysTime + 5000;
// if (this.timer) {
// this.timer.stop();
// }
// this.timer = new egret.Timer(1000, 0);
// this.timer.addEventListener(egret.TimerEvent.TIMER, this.cutTimer, this);
// this.timer.start();
// this.cutTimer();
}
private setProgress(progress) {
if(progress > 100) {
progress = 100;
} else if(progress < 0) {
progress = 0;
}
this.progress.width = this.progressBg.width * progress / 100;
}
private cutTimer() {
let timer = this.convertTime(this.cutTime -= 1000);
if(timer.hour === "00"
&& timer.min === "00"
&& timer.sec === "00") {
this.timer.stop();
this.hidePanel();
}
this.cutTimeLabel.text = `将在${timer.hour}:${timer.min}:${timer.sec}后失效`;
}
private convertTime(time: number) {
let hour = ~~(time / 3600000); // 小时
let min = ~~((time - hour * 3600000) / 60000); // 分
let sec = ~~((time - hour * 3600000 - min * 60000) / 1000); // 秒
return {
hour: Utils.prefixInteger(hour, 2),
min: Utils.prefixInteger(min, 2),
sec: Utils.prefixInteger(sec, 2)
}
}
private setWXShareTip() {
this.wxShareTip.visible = false;
this.wxShareTip.width = this.width / window.innerWidth * window.innerWidth;
this.wxShareTip.height = this.width / window.innerWidth * window.innerHeight;
this.wxShareTip.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
this.wxShareTip.visible = false;
}, this);
}
protected get closeBtns(): eui.Button[] {
return [this['closeBtn']]
}
private async getGameRes() {
this.invite_img = await RES.getResAsync("scratch_invite_png");
}
get skinKey() {
return 'Scratch'
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
/**
* 邀请好友的列表项
*/
class ScratchItem extends eui.ItemRenderer {
public img: eui.Image;
public mask: eui.Rect;
constructor() {
super();
this.skinName = getSkinPath('ScratchItem');
}
dataChanged() {
this.img.mask = this.mask
console.log(this.data);
this.img.source = this.data.avatar || "http://yun.duiba.com.cn/db_games/default_avatar.png";
this.img.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if(this.data.callFun) {
this.data.callFun();
}
}, this);
}
}
import Panel from "../../libs/new_wx/components/Panel";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import getHomeData from "../getHomeData";
import { changeMapScene } from "../startScene/StartScene";
import { addAdComp } from "./BoxPanel";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
/**
* 邀请规则面板
*/
export default class ScratchPrizePanel extends Panel {
public prizeImg:eui.Image;
public closeBtn:eui.Button;
public ok_btn:eui.Button;
public game_btn:eui.Button;
constructor(data) {
super();
this.data = data;
}
start() {
super.start();
}
protected onSkinComplete() {
this.initUI();
}
initEvents() {
super.initEvents();
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapGoPrize, this);
this.game_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
}
removeEvents() {
super.removeEvents();
this.closeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapGoPrize, this);
this.game_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
}
onTouchTap_closeBtn() {
// GDispatcher.dispatchEvent("getInviteInfo");
super.onTouchTap_closeBtn();
}
onTouchOK() {
if((getHomeData().levels.length + 1) > window['last_level']) {
changeMapScene();
super.hidePanel();
return;
}
// GDispatcher.dispatchEvent("getInviteInfo");
PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1);
}
onTapGoPrize() {
window.location.href = window['__link__'];
}
initUI() {
this.prizeImg.source = this.data.prizeImg;
addAdComp(84, 845.33, this);
}
protected get closeBtns(): eui.Button[] {
return [this['closeBtn']]
}
get skinKey() {
return 'ScratchPrize'
}
}
import Panel from "../../libs/new_wx/components/Panel";
import { HtmlTextParser } from "../../libs/new_wx/HtmlTextParser";
import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
/**
* 邀请规则面板
*/
export default class ScratchRulePanel extends Panel {
public scroller: eui.Scroller;
public group: eui.Group;
public labContent: eui.Label;
public closeBtn: eui.Button;
private _mask: egret.Sprite;
start() {
super.start();
this.addRule();
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, ()=>{
this.visible = false;
}, this);
}
loadSkin() {
this.skinName = getSkinPath(this.skinKey);
if (this.skin) {
this.onSkinComplete();
} else {
this.addEventListener(egret.Event.COMPLETE, this.onSkinComplete, this);
}
}
private addRule() {
const text =
`<br>1、用户每天邀请指定数量的新玩家参与闯关,可获得指定的现金券奖励。
2、用户发起邀请后,需在24小时内完成邀请任务;超过24小时,邀请任务失败,无法获得奖励,需重新发起邀请。
3、新用户仅包含未参与过狮狮连萌活动的用户。
4、用户不可为自己助力,或重复为好友助力。
5、完成邀请任务后,玩家可点击首页“邀请得现金券”图标领取现金券。
6、发放的奖励请在规定的有效时间内尽快领取或使用,逾期未领取或使用的会失效哦。
7、活动过程中,凡以不正当手段(包括但不限于作弊、恶意套现、扰乱系统、网络攻击等违规行为)参与本次活动的用户,苏宁易购有权终止其参加活动,并取消其获得奖励的资格。
8、极少数特殊情况下,若用户在完成活动的任务中被系统判定异常账户或风控账户,则可能导致奖励发放异常。
9、如遇不可抗力(包括但不限于重大自然灾害事件、活动受政府机关指令需要停止举办或调整的、活动遭受严重网络攻击不能正常进行的),苏宁易购有权取消、修改或暂停活动。`
this.labContent.textFlow = (new HtmlTextParser).parser(text);
}
get skinKey() {
return 'ScratchRule'
}
}
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"avatar": null "avatar": null
} }
], ],
"completeFlag": 1, "completeFlag": 0,
"openPrizeMsg": "图片", "openPrizeMsg": "图片",
"prizeType": "nickname", "prizeType": "nickname",
"prizeName": "nickname", "prizeName": "nickname",
......
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