Commit b5305459 authored by 邱旭's avatar 邱旭

1

parent 849ad0dd
......@@ -50,6 +50,7 @@ import InviteRulePanel from "../../src/panels/InviteRulePanel";
import InvitePrizePanel from "../../src/panels/InvitePrizePanel";
import BagPanel from "../../src/panels/BagPanel";
import H5Scene from "../../src/H5Scene";
import InviteCutTimePanel from "../../src/panels/InviteCutTimePanel";
export default class MainBase extends eui.UILayer {
constructor() {
......@@ -89,6 +90,7 @@ export default class MainBase extends eui.UILayer {
['back', { cls: BackPanel }],
['invite', { cls: InvitePanel }],
['invitePrize', { cls: InvitePrizePanel }],
['inviteCutTime', {cls: InviteCutTimePanel}],
['inviteRule', { cls: InviteRulePanel }],
['friend', { cls: FriendPanel }],
['ad', { cls: ADPanel }],
......
{"file":"cutTimeFont.png","frames":{
":":{"x":240,"y":0,"w":16,"h":45,"offX":0,"offY":27,"sourceW":16,"sourceH":99},
"0":{"x":180,"y":99,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"1":{"x":60,"y":0,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"2":{"x":0,"y":0,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"3":{"x":120,"y":99,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"4":{"x":180,"y":0,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"5":{"x":0,"y":198,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"6":{"x":120,"y":0,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"7":{"x":60,"y":99,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"8":{"x":60,"y":198,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"9":{"x":0,"y":99,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99}}}
\ No newline at end of file
......@@ -89,7 +89,7 @@
"name": "friend"
},
{
"keys": "invite_rule_bg_png,invite_prize_btn_png,invite_prize_bg_png,invite_prize_ad_png,invite_invite_png,invite_help_png,invite_btn_png,invite_bg_png",
"keys": "invite_invite_png,invite_help_png,invite_btn_png,invite_bg_png,invitePrize_btn_png,invitePrize_bg_png,invitePrize_game_btn_png,invateCut_bg_png,invateCut_btn_png,invite_wx_tip_png",
"name": "invite"
},
{
......@@ -822,31 +822,11 @@
"type": "image",
"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"
},
{
"url": "assets/friend/friend_icon1.png",
"type": "image",
......@@ -2091,6 +2071,51 @@
"url": "assets/mainScene/yezi1.png",
"type": "image",
"name": "yezi1_png"
},
{
"url": "assets/invite/rule/invite_rule_bg.png",
"type": "image",
"name": "invite_rule_bg_png"
},
{
"url": "assets/invite/prize/invitePrize_btn.png",
"type": "image",
"name": "invitePrize_btn_png"
},
{
"url": "assets/invite/prize/invitePrize_bg.png",
"type": "image",
"name": "invitePrize_bg_png"
},
{
"url": "assets/invite/prize/invitePrize_game_btn.png",
"type": "image",
"name": "invitePrize_game_btn_png"
},
{
"url": "assets/invite/cutTime/invateCut_bg.png",
"type": "image",
"name": "invateCut_bg_png"
},
{
"url": "assets/invite/cutTime/invateCut_btn.png",
"type": "image",
"name": "invateCut_btn_png"
},
{
"url": "assets/invite/invite_wx_tip.png",
"type": "image",
"name": "invite_wx_tip_png"
},
{
"url": "assets/common/cutTimeFont.fnt",
"type": "font",
"name": "cutTimeFont_fnt"
},
{
"url": "assets/common/cutTimeFont.png",
"type": "image",
"name": "cutTimeFont_png"
}
]
}
\ No newline at end of file
{
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/ADSkin.exml",
"resource/skins/ADSmallSkin.exml",
"resource/skins/AlertSkin.exml",
"resource/skins/AvatarSkin.exml",
"resource/skins/BackSkin.exml",
"resource/skins/BagSkin.exml",
"resource/skins/Blood2Skin.exml",
"resource/skins/BloodSkin.exml",
"resource/skins/Box2Skin.exml",
"resource/skins/BoxSkin.exml",
"resource/skins/Buy1Skin.exml",
"resource/skins/Buy2Skin.exml",
"resource/skins/Buy3Skin.exml",
"resource/skins/ExchangeSkin.exml",
"resource/skins/FailSkin.exml",
"resource/skins/FriendItem2Skin.exml",
"resource/skins/FriendItemSkin.exml",
"resource/skins/FriendSkin.exml",
"resource/skins/H5Skin.exml",
"resource/skins/IconButtonSkin.exml",
"resource/skins/InviteItemSkin.exml",
"resource/skins/InvitePrizePanelSkin.exml",
"resource/skins/InviteRulePanelSkin.exml",
"resource/skins/InviteSkin.exml",
"resource/skins/Main2Skin.exml",
"resource/skins/MapBottomSkin.exml",
"resource/skins/MapRepeatSkin.exml",
"resource/skins/MapSkin.exml",
"resource/skins/MapTopSkin.exml",
"resource/skins/NoPrizeSkin.exml",
"resource/skins/OptionItemSkin.exml",
"resource/skins/OptionsSkin.exml",
"resource/skins/PlaySkin.exml",
"resource/skins/Prize2Skin.exml",
"resource/skins/PrizeSkin.exml",
"resource/skins/QuitSkin.exml",
"resource/skins/RankItemSkin.exml",
"resource/skins/RankSkin.exml",
"resource/skins/ReliveSkin.exml",
"resource/skins/RuleSkin.exml",
"resource/skins/Share2Skin.exml",
"resource/skins/ShareSkin.exml",
"resource/skins/ShareTipsSkin.exml",
"resource/skins/ShopSkin.exml",
"resource/skins/ShowOffSkin.exml",
"resource/skins/SignItemSkin.exml",
"resource/skins/SignPrizeSkin.exml",
"resource/skins/SignSkin.exml",
"resource/skins/StarSkin.exml",
"resource/skins/StartPanelSkin.exml",
"resource/skins/StartSkin.exml",
"resource/skins/TargetItemSkin.exml",
"resource/skins/TaskItemSkin.exml",
"resource/skins/TaskPrizeSkin.exml",
"resource/skins/TaskSkin.exml",
"resource/skins/ToastSkin.exml",
"resource/skins/VScrollBarSkin.exml"
],
"path": "resource/default.thm.json"
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/ADSkin.exml",
"resource/skins/ADSmallSkin.exml",
"resource/skins/AlertSkin.exml",
"resource/skins/AvatarSkin.exml",
"resource/skins/BackSkin.exml",
"resource/skins/BagSkin.exml",
"resource/skins/Blood2Skin.exml",
"resource/skins/BloodSkin.exml",
"resource/skins/Box2Skin.exml",
"resource/skins/BoxSkin.exml",
"resource/skins/Buy1Skin.exml",
"resource/skins/Buy2Skin.exml",
"resource/skins/Buy3Skin.exml",
"resource/skins/ExchangeSkin.exml",
"resource/skins/FailSkin.exml",
"resource/skins/FriendItem2Skin.exml",
"resource/skins/FriendItemSkin.exml",
"resource/skins/FriendSkin.exml",
"resource/skins/H5Skin.exml",
"resource/skins/IconButtonSkin.exml",
"resource/skins/InviteItemSkin.exml",
"resource/skins/InvitePrizePanelSkin.exml",
"resource/skins/InviteRulePanelSkin.exml",
"resource/skins/InviteCutTimePanelSkin.exml",
"resource/skins/InviteSkin.exml",
"resource/skins/Main2Skin.exml",
"resource/skins/MapBottomSkin.exml",
"resource/skins/MapRepeatSkin.exml",
"resource/skins/MapSkin.exml",
"resource/skins/MapTopSkin.exml",
"resource/skins/NoPrizeSkin.exml",
"resource/skins/OptionItemSkin.exml",
"resource/skins/OptionsSkin.exml",
"resource/skins/PlaySkin.exml",
"resource/skins/Prize2Skin.exml",
"resource/skins/PrizeSkin.exml",
"resource/skins/QuitSkin.exml",
"resource/skins/RankItemSkin.exml",
"resource/skins/RankSkin.exml",
"resource/skins/ReliveSkin.exml",
"resource/skins/RuleSkin.exml",
"resource/skins/Share2Skin.exml",
"resource/skins/ShareSkin.exml",
"resource/skins/ShareTipsSkin.exml",
"resource/skins/ShopSkin.exml",
"resource/skins/ShowOffSkin.exml",
"resource/skins/SignItemSkin.exml",
"resource/skins/SignPrizeSkin.exml",
"resource/skins/SignSkin.exml",
"resource/skins/StarSkin.exml",
"resource/skins/StartPanelSkin.exml",
"resource/skins/StartSkin.exml",
"resource/skins/TargetItemSkin.exml",
"resource/skins/TaskItemSkin.exml",
"resource/skins/TaskPrizeSkin.exml",
"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="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing">
<e:Image y="216.33" source="invateCut_bg_png" horizontalCenter="0"/>
<e:BitmapLabel id="cutTimeLabel" y="396.33" font="cutTimeFont_fnt" text="00:00:00" letterSpacing="10" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="615" y="208.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="596" anchorOffsetX="150" anchorOffsetY="48" horizontalCenter="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="invateCut_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Component y="726.33" skinName="ADSmallSkin" horizontalCenter="0"/>
</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:Image y="45.33" horizontalCenter="0" source="invitePrize_bg_png"/>
<e:Image id="prizeImg" y="426.77" 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">
......@@ -12,10 +12,18 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="ok_btn" label="" y="748" horizontalCenter="0" anchorOffsetX="179" anchorOffsetY="51">
<e:Button id="ok_btn" label="" y="760" anchorOffsetX="138.5" anchorOffsetY="56.5" x="236.5">
<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:Image width="100%" height="100%" source="invitePrize_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="game_btn" label="" y="760" anchorOffsetX="139" anchorOffsetY="56.5" x="527">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="invitePrize_game_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
......
......@@ -35,4 +35,8 @@
</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 source="invite_wx_tip_png" x="484" y="0"/>
</e:Group>
</e:Skin>
\ No newline at end of file
This diff is collapsed.
import Panel from "../../libs/new_wx/components/Panel";
/**
* 邀请规则面板
*/
export default class InviteCutTimePanel extends Panel {
public cutTimeLabel:eui.BitmapLabel;
public closeBtn:eui.Button;
public ok_btn:eui.Button;
private timer: egret.Timer;
private cutTime: number;
constructor(data) {
super();
this.data = data;
}
start() {
super.start();
}
protected onSkinComplete() {
this.initUI();
}
initEvents() {
super.initEvents();
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
}
removeEvents() {
super.removeEvents();
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
}
initUI() {
this.cutTime = this.data.endTime - this.data.sysTime + 1000;
this.timer = new egret.Timer(1000, 0);
this.timer.addEventListener(egret.TimerEvent.TIMER, this.cutTimer, this);
this.timer.start();
this.cutTimer();
}
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: this.prefixInteger(hour, 2),
min: this.prefixInteger(min, 2),
sec: this.prefixInteger(sec, 2)
}
}
prefixInteger(num, length) {
return (Array(length).join('0') + num).slice(-length);
}
protected get closeBtns(): eui.Button[] {
return [this['closeBtn']]
}
get skinKey() {
return 'InviteCutTimePanel'
}
}
......@@ -11,6 +11,7 @@ export default class InvitePanel extends Panel {
public numLabel: eui.Label;
public cutTimeLabel: eui.Label;
public list: eui.List;
public wxShareTip: eui.Group;
private invite_img: egret.Texture;
private timer: egret.Timer;
......@@ -60,6 +61,7 @@ export default class InvitePanel extends Panel {
}
initUI() {
this.setWXShareTip();
this.prizeImg.source = this.data.img;
let dNum = this.data.invitationCount - this.data.invitationUser.length;
this.numLabel.text = `仅差${dNum}人可获得`;
......@@ -67,6 +69,20 @@ export default class InvitePanel extends Panel {
this.data.invitationUser.push({
nickname: "nickname",
avatar: this.invite_img,
callFun: () => {
NetManager.ins.getShareCode((success, res) => {
if(!success) {
return;
}
let shareCode = res.data;
if(iswx()) { //微信端
this.wxShareTip.visible = true;
} else {//端内
this.wxShareTip.visible = true;
// window["inviteShare"](shareCode);
}
});
}
});
}
this.list.useVirtualLayout = false;
......@@ -83,9 +99,9 @@ export default class InvitePanel extends Panel {
private cutTimer() {
let timer = this.convertTime(this.cutTime -= 1000);
if(timer.hour === 0
&& timer.min === 0
&& timer.sec === 0) {
if(timer.hour === "00"
&& timer.min === "00"
&& timer.sec === "00") {
this.timer.stop();
this.hidePanel();
}
......@@ -93,17 +109,30 @@ export default class InvitePanel extends Panel {
}
private convertTime(time: number) {
let hour = ~~(time / 3600000); // 小时
let min = ~~((time - hour * 3600000) / 60000); // 分
let sec = ~~((time - hour * 3600000 - min * 60000) / 1000); // 秒
let hour = ~~(time / 3600000); // 小时
let min = ~~((time - hour * 3600000) / 60000); // 分
let sec = ~~((time - hour * 3600000 - min * 60000) / 1000); // 秒
return {
hour: hour,
min: min,
sec: sec,
hour: this.prefixInteger(hour, 2),
min: this.prefixInteger(min, 2),
sec: this.prefixInteger(sec, 2)
}
}
prefixInteger(num, length) {
return (Array(length).join('0') + num).slice(-length);
}
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']]
}
......@@ -133,17 +162,9 @@ class InviteItem extends eui.ItemRenderer {
dataChanged() {
this.img.source = this.data.avatar;
this.img.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.getShareCode((success, res) => {
if(!success) {
return;
}
let shareCode = res.data;
if(iswx()) { //微信端
} else {//端内
window["inviteShare"](shareCode);
}
});
if(this.data.callFun) {
this.data.callFun();
}
}, this);
}
}
......
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";
/**
......@@ -10,25 +7,31 @@ export default class InvitePrizePanel 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['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this)
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapGoPrize, this);
this.game_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, 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);
this.game_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
}
onTapGoPrize(){
......@@ -36,7 +39,7 @@ export default class InvitePrizePanel extends Panel {
}
initUI() {
this.prizeImg.source = this.data.prizeImg;
}
protected get closeBtns(): eui.Button[] {
......
......@@ -5,9 +5,9 @@
"timestamp": 1566199822308,
"data": {
"invitationId": "活动id",
"invitationCount": 3,
"invitationCount": 4,
"img": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg",
"sysTime": 1570586400000,
"sysTime": 1570597800000,
"endTime": 1570672800000,
"invitationUser": [
{
......@@ -15,16 +15,11 @@
"avatar": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg"
}
],
"completeFlag": true,
"openPriz": true,
"openPrizMsg": "图片",
"prizeInfo": [
{
"prizeType": "nickname",
"prizeName": "nickname",
"prizeImg": "nickname",
"facePrice": "avatar"
}
]
"completeFlag": 2,
"openPrizeMsg": "图片",
"prizeType": "nickname",
"prizeName": "nickname",
"prizeImg": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg",
"facePrice": "avatar"
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment