Commit 1a3f861a authored by wildfirecode's avatar wildfirecode

1

parent 4bb17153
No preview for this file type
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
<script src="libs/security.js"></script> <script src="libs/security.js"></script>
<script src="libs/downloadApp.js"></script> <script src="libs/downloadApp.js"></script>
<script> <script>
window['golink']= 'http://aghzapi.zjkczn.com/download/' ;
window['projectID']='p32804e45'; window['projectID']='p32804e45';
window['plugs']=[1317,1319]; window['plugs']=[1317,1319];
window['INIT_BALL_NUMS']=1; window['INIT_BALL_NUMS']=1;
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="Start1Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" <e:Skin class="Start1Skin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing"> xmlns:w="http://ns.egret.com/wing">
<w:Config id="16d391cc18c" /> <w:Config id="16d391cc18c" />
<e:Image source="startscenebg_jpg" /> <e:Image source="startscenebg_jpg" />
<e:Group y="233" x="103">
<e:Image id="notLightImg" source="start 未完成暗的状态_png" horizontalCenter="0" />
<e:Image id="lightImg" source="start完成活动点亮_png" horizontalCenter="0" visible="false" />
</e:Group>
<e:Group x="27" y="376">
<e:Group width="163" height="90">
<e:Label id="btn1" text="全部活动" textColor="0x000000" horizontalCenter="0" verticalCenter="0" bold="true" size="30" />
<e:Image id="line1" source="start选中_png" y="72" x="60" />
</e:Group>
<e:Group width="163" height="90" x="163">
<e:Label id="btn2" text="我参与的" textColor="0x878787" verticalAlign="middle" textAlign="center" horizontalCenter="0"
verticalCenter="0" size="28" />
<e:Image id="line2" source="start选中_png" x="60" y="72" visible="false"/>
</e:Group>
</e:Group>
<e:Label id="tips" text="我完成的活动1个" y="408" textColor="0x2d2d2d" right="38" size="28" />
<e:Scroller id="scroll" width="698" y="479" height="675" scrollPolicyH="off" scrollPolicyV="on" x="29">
<e:Group>
<e:List id="list" width="698" itemRendererSkinName="ItemSkin">
<e:ArrayCollection>
<e:Array>
<e:Object banner="https://yun.duiba.com.cn/db_games/yyhtest12.png"/>
<e:Object banner="https://yun.duiba.com.cn/db_games/yyhtest12.png"/>
<e:Object banner="https://yun.duiba.com.cn/db_games/yyhtest12.png"/>
<e:Object banner="https://yun.duiba.com.cn/db_games/yyhtest12.png"/>
<e:Object banner="https://yun.duiba.com.cn/db_games/yyhtest12.png"/>
</e:Array>
</e:ArrayCollection>
<e:layout>
<e:VerticalLayout gap="20" horizontalAlign="center" />
</e:layout>
</e:List>
</e:Group>
</e:Scroller>
<e:Image id="pic2" source="start1暂无活动11_png" y="595.2" horizontalCenter="0"/>
<e:Image id="pic1" source="start1暂无活动22_png" y="585" x="239"/>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -5,120 +5,14 @@ import StartItem from "./StartItem"; ...@@ -5,120 +5,14 @@ import StartItem from "./StartItem";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
export default class Start1Scene extends Scene { export default class Start1Scene extends Scene {
scroll: eui.Scroller;
list: eui.List;
async start(d?) { async start(d?) {
this.showlog(); this.showlog();
super.start(); super.start();
this.stage.addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
this.scroll.height = this.stage.stageHeight - this.scroll.y - 30; window.location.href = window['golink'];
},this);
const { data } = DataManager.ins.getData('yyh_index');
this['notLightImg'].visible = !data.lighten;
this['lightImg'].visible = data.lighten;
this['tips'].text = `我完成的活动${data.completeCount}个`;
this.list.itemRenderer = StartItem;
this.list.dataProvider = new eui.ArrayCollection(data.activityList);
let showSuccess = false;
if (localStorage.getItem('yyh2_success') == null && data.lighten == 1) {
localStorage.setItem('yyh2_success', "1");
PanelCtrl.instance.show('SuccessPanel');
showSuccess = true;
}
let completeIds = [];
if (localStorage.getItem('yyh2_task') == null) {
completeIds = [];
} else {
completeIds = JSON.parse(localStorage.getItem('yyh2_task'));
}
const currentTaskIds = data.activityList.filter(i => i.userStatus == 3).map(i => i.activityId);
const newIds = currentTaskIds.filter(i => completeIds.indexOf(i) == -1);
if (newIds && newIds.length > 0) {
let newActs = data.activityList.
filter(i => newIds.indexOf(i.activityId) != -1)
.map((item, index, list) => {
if (index == list.length - 1)
return `${index + 1}${item.activityName}`
return `${index + 1}${item.activityName}\n`
});
if (newActs.length >= 4) newActs.length = 4;
// console.log(newActs);
if (!showSuccess)
PanelCtrl.instance.show('TaskPanel', newActs.join(''));
localStorage.setItem('yyh2_task', JSON.stringify(currentTaskIds));
}
// setTimeout(() => {
// const list = data.activityList.filter(item => item.userStatus != 0);
// this.list.dataProvider = new eui.ArrayCollection(list);
// }, 2000);
// setTimeout(() => {
// this.list.dataProvider = new eui.ArrayCollection(data.activityList);
// }, 5000);
this.scroll.visible = false;
this['pic1'].visible = false;
this['pic2'].visible = false;
if(data.activityList.length > 0) {
this.scroll.visible = true;
}else {
this['pic1'].visible = true;
}
this['btn1'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
this.list.dataProvider = new eui.ArrayCollection(data.activityList);
this['btn1'].size = 30;
this['btn2'].size = 28;
this['btn1'].textColor = 0x000000;
this['btn1'].bold = true;
this['btn2'].bold = false;
this['btn2'].textColor = 0x878787;
this['line1'].visible = true;
this['line2'].visible = false;
this.scroll.visible = false;
this['pic1'].visible = false;
this['pic2'].visible = false;
if(data.activityList.length > 0) {
this.scroll.visible = true;
}else {
this['pic1'].visible = true;
}
this.scroll.viewport.scrollV=0;
}, this);
this['btn2'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
const list = data.activityList.filter(item => item.userStatus != 0);
this.list.dataProvider = new eui.ArrayCollection(list);
this['btn2'].textColor = 0x000000;
this['btn1'].textColor = 0x878787;
this['line1'].visible = false;
this['line2'].visible = true;
this['btn2'].bold = true;
this['btn1'].bold = false;
this['btn2'].size = 30;
this['btn1'].size = 28;
this.scroll.visible = false;
this.scroll.viewport.scrollV=0;
this['pic1'].visible = false;
this['pic2'].visible = false;
if(list.length > 0) {
this.scroll.visible = true;
}else {
this['pic2'].visible = true;
}
}, this);
} }
initEvents() { initEvents() {
......
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