Commit c62eac94 authored by wildfirecode's avatar wildfirecode

1

parent 15788746
...@@ -40,8 +40,8 @@ import getHomeData, { BLOOD_NUMS_MAX } from "../../src/getHomeData"; ...@@ -40,8 +40,8 @@ import getHomeData, { BLOOD_NUMS_MAX } from "../../src/getHomeData";
import BloodPanel2 from "../../src/panels/BloodPanel2"; import BloodPanel2 from "../../src/panels/BloodPanel2";
import ExchangePanel from "../../src/panels/ExchangePanel"; import ExchangePanel from "../../src/panels/ExchangePanel";
import { initstatistics } from "../../src/statistics"; import { initstatistics } from "../../src/statistics";
import TaskPanel from "../../src/panels/TaskItemRenderer";
import ADPanel from "../../src/panels/ADPanel"; import ADPanel from "../../src/panels/ADPanel";
import TaskPanel from "../../src/panels/TaskPanel";
export default class MainBase extends eui.UILayer { export default class MainBase extends eui.UILayer {
constructor() { constructor() {
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="AddSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui">
<e:Image source="闯关失败_png" y="27" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="609" y="197">
<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:Label text="AD广告" x="260" y="604"/>
</e:Skin>
\ No newline at end of file
...@@ -67,7 +67,15 @@ ...@@ -67,7 +67,15 @@
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Button id="taskBtn" label="" x="31.7" y="305.41" visible="false"> <e:Button id="taskBtn" label="" x="31.7" y="305.41">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="recordbtn_png" source.down="recordbtn_png" source.disabled="recordbtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="adBtn" label="" x="44.3" y="459.41">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="recordbtn_png" source.down="recordbtn_png" source.disabled="recordbtn_png"/> <e:Image width="100%" height="100%" source="recordbtn_png" source.down="recordbtn_png" source.disabled="recordbtn_png"/>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="TaskItemSkin" width="400" height="300" xmlns:e="http://ns.egret.com/eui"> <e:Skin class="TaskItemSkin" width="400" height="50" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Label id="nameTxt" text="111" x="20" y="16"/>
</e:Skin> </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="TaskSkin" width="400" height="300" xmlns:e="http://ns.egret.com/eui"> <e:Skin class="TaskSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="闯关失败_png" y="27" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="609" y="197">
<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:Scroller id="scroll" width="400" height="400" y="279" horizontalCenter="0" scrollPolicyV="on" scrollPolicyH="off">
<e:Group>
<e:List id="list" width="100%" itemRendererSkinName="TaskItemSkin">
<e:ArrayCollection>
<e:Array>
<e:Object a="taskname1"/>
<e:Object a="taskname2"/>
<e:Object a="taskname3"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
</e:Array>
</e:ArrayCollection>
<e:layout>
<e:VerticalLayout gap="0"/>
</e:layout>
</e:List>
</e:Group>
</e:Scroller>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -308,7 +308,10 @@ export default class MapScene extends Scene { ...@@ -308,7 +308,10 @@ export default class MapScene extends Scene {
this['bloodTxt'].text = `${data.remainEnargy}`; this['bloodTxt'].text = `${data.remainEnargy}`;
} }
onTap_taskBtn(){ onTap_taskBtn(){
console.log('onTap_taskBtn') PanelCtrl.instance.show('task');
}
onTap_adBtn(){
PanelCtrl.instance.show('ad');
} }
onTap_signBtn(){ onTap_signBtn(){
NetManager.ins.getSignInfo(() => { NetManager.ins.getSignInfo(() => {
...@@ -318,6 +321,7 @@ export default class MapScene extends Scene { ...@@ -318,6 +321,7 @@ export default class MapScene extends Scene {
protected initEvents() { protected initEvents() {
// this['goldBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_goldBtn, this) // this['goldBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_goldBtn, this)
this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_adBtn, this)
this['taskBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_taskBtn, this) this['taskBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_taskBtn, this)
this['signBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_signBtn, this) this['signBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_signBtn, this)
this['bloodBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_bloodBtn, this) this['bloodBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_bloodBtn, this)
......
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import getHomeData, { BLOOD_NUMS_MAX } from "../getHomeData";
import { NetManager } from "../../libs/tw/manager/NetManager";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { getlogItem } from "../Main";
import wait from "../../libs/new_tc/wait";
import { showShare } from "../shareCtrl";
import { iswx } from "../iswx";
import getShowOffPic from "../getShowOffPic";
import getSharePic, { getShareUrl } from "../getSharePic";
import CountDown from "../mapScene/CountDown";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
export default class ADPanel extends Panel { export default class ADPanel extends Panel {
start(data) { start(data) {
...@@ -23,15 +11,15 @@ export default class ADPanel extends Panel { ...@@ -23,15 +11,15 @@ export default class ADPanel extends Panel {
// NetManager.ins.showLog(getlogItem(4)); // NetManager.ins.showLog(getlogItem(4));
} }
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)
} }
onTapInvite() { onTapInvite() {
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] } protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
get skinKey() { return 'Task' } get skinKey() { return 'AD' }
} }
\ No newline at end of file
import Panel from "../../libs/new_wx/components/Panel"; import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
import getHomeData, { BLOOD_NUMS_MAX } from "../getHomeData";
import { NetManager } from "../../libs/tw/manager/NetManager";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { getlogItem } from "../Main";
import wait from "../../libs/new_tc/wait";
import { showShare } from "../shareCtrl";
import { iswx } from "../iswx";
import getShowOffPic from "../getShowOffPic";
import getSharePic, { getShareUrl } from "../getSharePic";
import CountDown from "../mapScene/CountDown";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
export default class TaskPanel extends Panel { export default class TaskItemRenderer extends eui.ItemRenderer {
start(data) { constructor() {
super.start(); super();
this.showlog(); this.skinName = getSkinPath('TaskItem');
} }
showlog(){ dataChanged(){
// NetManager.ins.showLog(getlogItem(3)); this['nameTxt'].text = this.data + '';
// NetManager.ins.showLog(getlogItem(4));
} }
initEvents() {
super.initEvents();
this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this)
}
onTapInvite() {
}
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
get skinKey() { return 'Task' }
} }
\ No newline at end of file
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import getHomeData, { BLOOD_NUMS_MAX } from "../getHomeData"; import TaskItemRenderer from "./TaskItemRenderer";
import { NetManager } from "../../libs/tw/manager/NetManager";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { getlogItem } from "../Main";
import wait from "../../libs/new_tc/wait";
import { showShare } from "../shareCtrl";
import { iswx } from "../iswx";
import getShowOffPic from "../getShowOffPic";
import getSharePic, { getShareUrl } from "../getSharePic";
import CountDown from "../mapScene/CountDown";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
export default class TaskPanel extends Panel { export default class TaskPanel extends Panel {
public list: eui.List;
start(data) { start(data) {
super.start(); super.start();
this.showlog(); this.showlog();
this.list.useVirtualLayout = false;
this.list.itemRenderer = TaskItemRenderer;
const ac = new eui.ArrayCollection([1,2,3,4,5,6,7,8,9,10]);
this.list.dataProvider = ac;
} }
showlog(){ showlog(){
...@@ -26,7 +21,7 @@ export default class TaskPanel extends Panel { ...@@ -26,7 +21,7 @@ export default class TaskPanel 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)
} }
onTapInvite() { onTapInvite() {
......
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