Commit 16b95fbe authored by 邱旭's avatar 邱旭

--

parent 2c954424
...@@ -46,6 +46,8 @@ import TaskPrizePanel from "../../src/panels/TaskPrizePanel"; ...@@ -46,6 +46,8 @@ import TaskPrizePanel from "../../src/panels/TaskPrizePanel";
import BackPanel from "../../src/panels/BackPanel"; import BackPanel from "../../src/panels/BackPanel";
import InvitePanel from "../../src/panels/InvitePanel"; import InvitePanel from "../../src/panels/InvitePanel";
import FriendPanel from "../../src/panels/FriendPanel"; import FriendPanel from "../../src/panels/FriendPanel";
import InviteRulePanel from "../../src/panels/InviteRulePanel";
import InvitePrizePanel from "../../src/panels/InvitePrizePanel";
export default class MainBase extends eui.UILayer { export default class MainBase extends eui.UILayer {
constructor() { constructor() {
...@@ -83,6 +85,8 @@ export default class MainBase extends eui.UILayer { ...@@ -83,6 +85,8 @@ export default class MainBase extends eui.UILayer {
['taskPrize', { cls: TaskPrizePanel }], ['taskPrize', { cls: TaskPrizePanel }],
['back', { cls: BackPanel }], ['back', { cls: BackPanel }],
['invite', { cls: InvitePanel }], ['invite', { cls: InvitePanel }],
['invitePrize', {cls: InvitePrizePanel}],
['inviteRule', {cls: InviteRulePanel}],
['friend', { cls: FriendPanel }], ['friend', { cls: FriendPanel }],
['ad', { cls: ADPanel }], ['ad', { cls: ADPanel }],
]; ];
......
...@@ -32,5 +32,4 @@ export default class ComponentBase extends eui.Component { ...@@ -32,5 +32,4 @@ export default class ComponentBase extends eui.Component {
destroy() { destroy() {
this.removeEvents(); this.removeEvents();
} }
} }
\ No newline at end of file
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
"name": "preload" "name": "preload"
}, },
{ {
"keys": "invite_bg_png,invite_help_png,invite_invite_png", "keys": "invite_bg_png,invite_help_png,invite_invite_png,invite_rule_bg_png,invite_btn_png,invite_prize_ad_png,invite_prize_bg_png,invite_prize_btn_png",
"name": "invite" "name": "invite"
} }
], ],
...@@ -2032,6 +2032,31 @@ ...@@ -2032,6 +2032,31 @@
"url": "assets/invite/invite_bg.png", "url": "assets/invite/invite_bg.png",
"type": "image", "type": "image",
"name": "invite_bg_png" "name": "invite_bg_png"
},
{
"url": "assets/invite/invite_rule_bg.png",
"type": "image",
"name": "invite_rule_bg_png"
},
{
"url": "assets/invite/invite_btn.png",
"type": "image",
"name": "invite_btn_png"
},
{
"url": "assets/invite/invite_prize_ad.png",
"type": "image",
"name": "invite_prize_ad_png"
},
{
"url": "assets/invite/invite_prize_bg.png",
"type": "image",
"name": "invite_prize_bg_png"
},
{
"url": "assets/invite/invite_prize_btn.png",
"type": "image",
"name": "invite_prize_btn_png"
} }
] ]
} }
\ No newline at end of file
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
"resource/skins/RuleSkin.exml", "resource/skins/RuleSkin.exml",
"resource/skins/Share2Skin.exml", "resource/skins/Share2Skin.exml",
"resource/skins/ShareSkin.exml", "resource/skins/ShareSkin.exml",
"resource/skins/ShareTipsSkin.exml",
"resource/skins/ShopSkin.exml", "resource/skins/ShopSkin.exml",
"resource/skins/ShowOffSkin.exml", "resource/skins/ShowOffSkin.exml",
"resource/skins/SignItemSkin.exml", "resource/skins/SignItemSkin.exml",
...@@ -48,6 +49,9 @@ ...@@ -48,6 +49,9 @@
"resource/skins/ADSkin.exml", "resource/skins/ADSkin.exml",
"resource/skins/BackSkin.exml", "resource/skins/BackSkin.exml",
"resource/skins/InviteSkin.exml", "resource/skins/InviteSkin.exml",
"resource/skins/InviteItemSkin.exml",
"resource/skins/InvitePrizePanelSkin.exml",
"resource/skins/InviteRulePanelSkin.exml",
"resource/skins/ToastSkin.exml", "resource/skins/ToastSkin.exml",
"resource/skins/VScrollBarSkin.exml" "resource/skins/VScrollBarSkin.exml"
], ],
......
<?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" left="0" top="0" bottom="0" right="0" source=""/>
</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="invite_prize_bg_png"/>
<e:Image id="prizeImg" y="431.33" source="" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="632" y="317.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="748" horizontalCenter="0" anchorOffsetX="179" anchorOffsetY="51">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" scaleX.down="0.9" scaleY.down="0.9" source="invite_prize_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Group x="84" y="845.33">
<e:Image y="0" source="invite_prize_ad_png" x="0"/>
<e:Image id="ad_ico" source="" x="48" y="55.67"/>
<e:Label id="label1" text="Label" x="277.5" y="77.5" textColor="0xe5150e" size="24"/>
<e:Label id="label2" text="Label" x="262.5" y="124.5" textColor="0xE5150E" size="34" bold="true"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="RuleSkin" 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" verticalCenter="-231" source="invite_rule_bg_png"/>
<e:Scroller id="scroller" width="545" height="542" y="372.2" horizontalCenter="0.5" anchorOffsetY="0">
<e:Group id="group" width="100%" x="-1.26" y="36" anchorOffsetY="0" height="515">
<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="280">
<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"?> <?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:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"
<e:Image y="45.33" horizontalCenter="0" source="invite_bg_png"/> xmlns:w="http://ns.egret.com/wing">
<e:Image id="prizeImg" y="439.33" horizontalCenter="0.5" source=""/> <e:Image y="45.33" horizontalCenter="0" source="invite_bg_png" />
<e:Image id="prizeImg" y="439.33" horizontalCenter="0.5" source="" />
<e:Button id="closeBtn" label="" x="605" y="227.33"> <e:Button id="closeBtn" label="" x="605" y="227.33">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing"> <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:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png"
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/> source.disabled="closeCommonBtn_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Button id="helpBtn" label="" x="564" y="376.33"> <e:Button id="helpBtn" label="" x="564" y="376.33">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="invite_help_png" source.down="invite_help_png" source.disabled="invite_help_png"/> <e:Image width="100%" height="100%" source="invite_help_png" source.down="invite_help_png"
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" xmlns:w="http://ns.egret.com/wing"/> source.disabled="invite_help_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" xmlns:w="http://ns.egret.com/wing" />
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Label id="numLabel" text="仅差3人可获得" y="679.33" textColor="0xf54500" size="28" horizontalCenter="0"/> <e:Label id="numLabel" text="仅差3人可获得" y="679.33" textColor="0xf54500" size="28" horizontalCenter="0" />
<e:Label text="将在23:43:21后失效" y="877.33" size="28" id="numLabel0" textColor="0xffffff" horizontalCenter="0.5"/> <e:Label id="cutTimeLabel" text="将在23:43:21后失效" y="883.33" size="28" textColor="0xffffff" horizontalCenter="0"/>
<e:Scroller id="scroller" width="554" height="83" y="766.33" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0"> <e:Scroller width="554" height="90" y="766.33" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0">
<e:Group id="scrollerGroup" anchorOffsetX="0"> <e:Group anchorOffsetX="0">
<e:List id="list" width="0" x="0" height="83" y="0"/> <e:List id="list" x="0" height="100%" y="0" anchorOffsetX="0" width="100%">
<e:layout> <e:layout>
<e:HorizontalLayout horizontalAlign="center" verticalAlign="middle" gap="66"/> <e:HorizontalLayout horizontalAlign="center" verticalAlign="middle" gap="66"/>
</e:layout> </e:layout>
</e:List>
</e:Group> </e:Group>
</e:Scroller> </e:Scroller>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Group x="84.67" y="0"> <e:Group x="84.67" y="0">
<e:Image source="invite_txtbg_png" x="0" y="0"/> <e:Image source="invite_txtbg_png" x="0" y="0" touchEnabled="false"/>
<e:Label id="inviteTips" text="待领取" horizontalCenter="0" verticalCenter="0" verticalAlign="middle" textAlign="center" textColor="0xffffff" size="18"/> <e:Label id="inviteTips" text="待领取" horizontalCenter="0" verticalCenter="0" verticalAlign="middle" textAlign="center" textColor="0xffffff" size="18"/>
</e:Group> </e:Group>
</e:Group> </e:Group>
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="Share2Skin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16cd6d4c8ff"/>
<e:Rect width="750" height="1624" fillAlpha="0.7"/>
<e:Group id="inviteGroup" x="0" bottom="0">
<e:Image source="朋友圈中间分享蒙层1_jpg" y="0" x="0"/>
<e:Group y="66" x="261">
<e:Button id="btn1" label="" x="0" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="share_btn1_png" source.down="share_btn1_png" source.disabled="share_btn1_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="btn2" label="" x="152">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="share_btn2_png" source.down="share_btn2_png" source.disabled="share_btn2_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group>
</e:Group>
</e:Skin>
\ No newline at end of file
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { showShare } from "../shareCtrl"; import { callShareApi, hideShare } from "../shareCtrl";
import layers from "../../libs/new_wx/views/layers";
import ComponentBase from "../../libs/new_wx/components/ComponentBase";
import { iswx } from "../iswx";
import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import InviteRulePanel from "./InviteRulePanel";
import Loading from "../../libs/new_wx/components/Loading";
export default class InvitePanel extends Panel { export default class InvitePanel extends Panel {
public prizeImg: eui.Image; public prizeImg: eui.Image;
public closeBtn: eui.Button; public closeBtn: eui.Button;
public helpBtn: eui.Button; public helpBtn: eui.Button;
public numLabel: eui.Label; public numLabel: eui.Label;
public numLabel0: eui.Label; public cutTimeLabel: eui.Label;
public scroller: eui.Scroller;
public scrollerGroup: eui.Group;
public list: eui.List; public list: eui.List;
private invite_img: egret.Texture;
start(data) { start(data) {
super.start(); super.start();
...@@ -24,6 +30,21 @@ export default class InvitePanel extends Panel { ...@@ -24,6 +30,21 @@ export default class InvitePanel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
// this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this) // this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this)
this.helpBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapRule, this);
}
removeEvents() {
super.removeEvents();
// this['inviteBtn'].removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this)
this.helpBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapRule, this);
}
onTapRule() {
// PanelCtrl.instance.show('invitePrize');
const rule = new InviteRulePanel();
rule.loadSkin();
rule.start();
this.addChild(rule);
} }
onTapInvite() { onTapInvite() {
...@@ -31,20 +52,137 @@ export default class InvitePanel extends Panel { ...@@ -31,20 +52,137 @@ export default class InvitePanel extends Panel {
} }
protected onSkinComplete() { protected onSkinComplete() {
this.initUI(); this.getGameRes().then(r => this.initUI());
} }
initUI() { initUI() {
// showShare(); let data = [
{
img: this.invite_img,
},
{
img: this.invite_img,
},
{
img: this.invite_img,
},
];
this.list.useVirtualLayout = false;
this.list.itemRenderer = InviteItem;
this.list.dataProvider = new eui.ArrayCollection(data);
} }
protected get closeBtns(): eui.Button[] { protected get closeBtns(): eui.Button[] {
return [this['closeBtn']] return [this['closeBtn']]
} }
private async getGameRes() {
this.invite_img = await RES.getResAsync("invite_invite_png");
}
get skinKey() { get skinKey() {
return 'Invite' return 'Invite'
} }
} }
////////////////////////////////////////////////////////////////////////////////////////////////
/**
* 邀请好友的列表项
*/
class InviteItem extends eui.ItemRenderer {
public img: eui.Image;
constructor() {
super();
this.skinName = getSkinPath('InviteItem');
}
dataChanged() {
this.img.source = this.data.img;
this.img.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
showShareTips("");
}, this);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
class ShareTips extends ComponentBase {
public inviteGroup: eui.Group;
public btn1: eui.Button;
public btn2: eui.Button;
private img: string;
setUrl(img: string) {
this.img = img;
}
start() {
this.once(egret.TouchEvent.ADDED_TO_STAGE, () => {
this.height = this.stage.stageHeight;
}, this);
this.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
hideShare();
}, this);
this.btn1.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if(iswx()) { //微信端
} else {//端内
this.getFunc('2');//朋友圈
}
hideShare();
}, this);
this.btn2.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if(iswx()) { //微信端
} else {//端内
this.getFunc('1');//好友微信
}
hideShare();
}, this);
}
//channel 1 好友 2 朋友圈
getFunc(channel: string) {
// let base64;
// if(this.type==1)
// base64= getPrintScreenData(this['pic' + this.type], 0, 0, 579, 866);
// else
// base64= getPrintScreenData(this['pic' + this.type], 0, 0, 600, 965);
// NetManager.ins.imgUrl((success) => {
// const data = DataManager.ins.getData('imgURL');
// img.src = base64;
// img.src = data.data;
// }, base64);
callShareApi(this.img, channel);
}
get skinKey() {
return 'ShareTips';
}
}
let inited = false;
let _share: ShareTips;
const initShare = () => {
const layer = layers.shareLayer;
const share = new ShareTips();
share.loadSkin();
share.start();
layer.addChild(share);
_share = share;
};
const showShareTips = (url: string) => {
if(!inited) {
initShare();
inited = true;
}
_share.setUrl(url);
layers.shareLayer.visible = true;
};
\ No newline at end of file
import { DataManager } from "../../libs/tw/manager/DataManager";
import { HtmlTextParser } from "../../libs/new_wx/HtmlTextParser";
import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
import Panel from "../../libs/new_wx/components/Panel";
/**
* 邀请规则面板
*/
export default class InvitePrizePanel extends Panel {
public prizeImg:eui.Image;
public closeBtn:eui.Button;
public ok_btn:eui.Button;
public ad_ico:eui.Image;
public label1:eui.Label;
public label2:eui.Label;
start() {
super.start();
}
protected onSkinComplete() {
}
initEvents() {
super.initEvents();
// this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this)
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapGoPrize, this);
}
removeEvents() {
super.removeEvents();
// this['inviteBtn'].removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this)
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapGoPrize, this);
}
onTapGoPrize(){
}
initUI() {
}
protected get closeBtns(): eui.Button[] {
return [this['closeBtn']]
}
get skinKey() {
return 'InvitePrizePanel'
}
}
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";
/**
* 邀请规则面板
*/
export default class InviteRulePanel 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>' + DataManager.ins.ajaxElementData.rule;
this.labContent.textFlow = (new HtmlTextParser).parser(text);
}
get skinKey() {
return 'InviteRulePanel'
}
}
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