Commit 916036f1 authored by 任建锋's avatar 任建锋

--

parent 70e4707b
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
onTap_startBtn(){
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight=750/window.innerWidth*window.innerHeight;
this.scroller_body.height=stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer=TaskItem;
NetPromise.ins.listDo()
.then(()=>{
this.list.dataProvider=new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(()=>{
})
NetPromise.ins.detailDo()
.then(()=>{
})
.catch(()=>{})
}
animation(){
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item)=>{
item.tween.loop=true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public detailBtn:eui.Group;
public detailText:eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
onTap_startBtn(){
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight=750/window.innerWidth*window.innerHeight;
this.scroller_body.height=stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer=TaskItem;
NetPromise.ins.listDo()
.then(()=>{
this.list.dataProvider=new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(()=>{
})
NetPromise.ins.detailDo()
.then(()=>{
})
.catch(()=>{})
}
animation(){
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item)=>{
item.tween.loop=true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public detailBtn:eui.Group;
public detailText:eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
onTap_startBtn(){
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight=750/window.innerWidth*window.innerHeight;
this.scroller_body.height=stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer=TaskItem;
NetPromise.ins.listDo()
.then(()=>{
this.list.dataProvider=new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(()=>{
})
NetPromise.ins.detailDo()
.then(()=>{
this.detailText.text=DataManager.ins.getData(NetName.detailDo).data.total
})
.catch(()=>{})
}
animation(){
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item)=>{
item.tween.loop=true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public detailBtn:eui.Group;
public detailText:eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
onTap_startBtn(){
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight=750/window.innerWidth*window.innerHeight;
this.scroller_body.height=stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer=TaskItem;
NetPromise.ins.listDo()
.then(()=>{
this.list.dataProvider=new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(()=>{
})
NetPromise.ins.detailDo()
.then(()=>{
this.detailText.text=DataManager.ins.getData(NetName.detailDo).data.total.toFexid(2)
})
.catch(()=>{})
}
animation(){
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item)=>{
item.tween.loop=true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public detailBtn:eui.Group;
public detailText:eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
onTap_startBtn(){
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight=750/window.innerWidth*window.innerHeight;
this.scroller_body.height=stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer=TaskItem;
NetPromise.ins.listDo()
.then(()=>{
this.list.dataProvider=new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(()=>{
})
NetPromise.ins.detailDo()
.then(()=>{
this.detailText.text=DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(()=>{})
}
animation(){
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item)=>{
item.tween.loop=true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public detailBtn:eui.Group;
public detailText:eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_detailBtn,this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_detailBtn,this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
}
onTap_startBtn(){
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight=750/window.innerWidth*window.innerHeight;
this.scroller_body.height=stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer=TaskItem;
NetPromise.ins.listDo()
.then(()=>{
this.list.dataProvider=new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(()=>{
})
NetPromise.ins.detailDo()
.then(()=>{
this.detailText.text=DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(()=>{})
}
animation(){
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item)=>{
item.tween.loop=true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public detailBtn:eui.Group;
public detailText:eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_detailBtn,this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_detailBtn,this)
}
onTap_startBtn(){
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight=750/window.innerWidth*window.innerHeight;
this.scroller_body.height=stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer=TaskItem;
NetPromise.ins.listDo()
.then(()=>{
this.list.dataProvider=new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(()=>{
})
NetPromise.ins.detailDo()
.then(()=>{
this.detailText.text=DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(()=>{})
}
animation(){
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item)=>{
item.tween.loop=true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public detailBtn:eui.Group;
public detailText:eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_detailBtn,this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_detailBtn,this)
}
onTap_detailBtn(){
this.enabled=false;
NetPromise.ins.detailDo()
.then(()=>{
this.enabled=true;
this.detailText.text=DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(()=>{
this.enabled=true;
})
}
onTap_startBtn(){
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight=750/window.innerWidth*window.innerHeight;
this.scroller_body.height=stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer=TaskItem;
NetPromise.ins.listDo()
.then(()=>{
this.list.dataProvider=new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(()=>{
})
NetPromise.ins.detailDo()
.then(()=>{
this.detailText.text=DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(()=>{})
}
animation(){
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item)=>{
item.tween.loop=true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public detailBtn:eui.Group;
public detailText:eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_detailBtn,this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_detailBtn,this)
}
onTap_detailBtn(){
this.enabled=false;
NetPromise.ins.detailDo()
.then(()=>{
this.enabled=true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(()=>{
this.enabled=true;
})
}
onTap_startBtn(){
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight=750/window.innerWidth*window.innerHeight;
this.scroller_body.height=stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer=TaskItem;
NetPromise.ins.listDo()
.then(()=>{
this.list.dataProvider=new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(()=>{
})
NetPromise.ins.detailDo()
.then(()=>{
this.detailText.text=DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(()=>{})
}
animation(){
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item)=>{
item.tween.loop=true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public ruleBtn:eui.Button;
public record:eui.Button;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public detailBtn:eui.Group;
public detailText:eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_detailBtn,this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_startBtn,this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_detailBtn,this)
}
onTap_detailBtn(){
this.enabled=false;
NetPromise.ins.detailDo()
.then(()=>{
this.enabled=true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(()=>{
this.enabled=true;
})
}
onTap_startBtn(){
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight=750/window.innerWidth*window.innerHeight;
this.scroller_body.height=stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer=TaskItem;
NetPromise.ins.listDo()
.then(()=>{
this.list.dataProvider=new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(()=>{
})
NetPromise.ins.detailDo()
.then(()=>{
this.detailText.text=DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(()=>{})
}
animation(){
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item)=>{
item.tween.loop=true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public record: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body:eui.Scroller;
public bg:eui.Image;
public topBtn:eui.Group;
public ruleBtn:eui.Button;
public recordBtn:eui.Button;
public disc_ico:eui.Image;
public startBtn:eui.Button;
public list:eui.List;
public detailBtn:eui.Group;
public detailText:eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn(){
let rule=`规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"ruleGroup",rule:rule})
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn(){
let ruleData=`规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"ruleGroup",ruleData:ruleData})
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn(){
let ruleData=`规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"ruleGroup",ruleData:ruleData})
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2)
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn(){
let ruleData=`规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"ruleGroup",ruleData:ruleData})
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow=new Date().getUTCFullYear()
let monthNow=new Date().getUTCFullYear()
let dayNow=new Date().getUTCFullYear()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if(DataManager.ins.getData(NetName.detailDo).data.endTime<=new Date()){
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"overActGroup"})
}else if()
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn(){
let ruleData=`规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"ruleGroup",ruleData:ruleData})
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow=new Date().getUTCFullYear()
let monthNow=new Date().getUTCMonth()
let dayNow=new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if(DataManager.ins.getData(NetName.detailDo).data.endTime<=new Date()){
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"overActGroup"})
}else if()
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn(){
let ruleData=`规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"ruleGroup",ruleData:ruleData})
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow=new Date().getUTCFullYear()
let monthNow=new Date().getUTCMonth()
let dayNow=new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if(DataManager.ins.getData(NetName.detailDo).data.endTime<=new Date()){
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"overActGroup"})
}else if(year==yearNow&&month==monthNow&&dayNow-day==1){
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"lastDayGroup"})
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn(){
let ruleData=`规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"ruleGroup",ruleData:ruleData})
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day=new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow=new Date().getUTCFullYear()
let monthNow=new Date().getUTCMonth()
let dayNow=new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if(DataManager.ins.getData(NetName.detailDo).data.endTime<=new Date()){
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"overActGroup"})
}else if(year==yearNow&&month==monthNow&&dayNow-day==0){
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL,{winType:"lastDayGroup"})
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn() {
let ruleData = `规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow = new Date().getUTCFullYear()
let monthNow = new Date().getUTCMonth()
let dayNow = new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if (DataManager.ins.getData(NetName.detailDo).data.endTime <= new Date()) {
if (!localStorage.overActGroup) {
localStorage.overActGroup = 1
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "overActGroup" })
}
} else if (year == yearNow && month == monthNow && dayNow - day == 0) {
if (!localStorage.lastDayGroup) {
localStorage.lastDayGroup = 1
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "lastDayGroup" })
}
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn() {
let ruleData = `规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow = new Date().getUTCFullYear()
let monthNow = new Date().getUTCMonth()
let dayNow = new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if (DataManager.ins.getData(NetName.detailDo).data.endTime <= new Date()) {
if (!localStorage.overActGroup) {
localStorage.overActGroup = 1;
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "overActGroup" });
}
} else if (year == yearNow && month == monthNow && dayNow - day == 0) {
if (!localStorage.lastDayGroup) {
localStorage.lastDayGroup = 1;
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "lastDayGroup" });
}
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn() {
let ruleData = `规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow = new Date().getUTCFullYear()
let monthNow = new Date().getUTCMonth()
let dayNow = new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if (DataManager.ins.getData(NetName.detailDo).data.endTime <= new Date()) {
if (!localStorage.overActGroup) {
localStorage.overActGroup = 1;
//活动已结束弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "overActGroup" });
}
} else if (year == yearNow && month == monthNow && dayNow - day == 0) {
if (!localStorage.lastDayGroup) {
localStorage.lastDayGroup = 1;
//活动最后一天弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "lastDayGroup" });
}
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public limitTodyText: eui.Label;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn() {
let ruleData = `规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow = new Date().getUTCFullYear()
let monthNow = new Date().getUTCMonth()
let dayNow = new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if (DataManager.ins.getData(NetName.detailDo).data.endTime <= new Date()) {
if (!localStorage.overActGroup) {
localStorage.overActGroup = 1;
//活动已结束弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "overActGroup" });
}
} else if (year == yearNow && month == monthNow && dayNow - day == 0) {
if (!localStorage.lastDayGroup) {
localStorage.lastDayGroup = 1;
//活动最后一天弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "lastDayGroup" });
}
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public limitTodyText: eui.Label;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn() {
let ruleData = `规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.limitTodyText.text=`今天剩余次数:${DataManager.ins.getData(NetName.times)}次`
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow = new Date().getUTCFullYear()
let monthNow = new Date().getUTCMonth()
let dayNow = new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if (DataManager.ins.getData(NetName.detailDo).data.endTime <= new Date()) {
if (!localStorage.overActGroup) {
localStorage.overActGroup = 1;
//活动已结束弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "overActGroup" });
}
} else if (year == yearNow && month == monthNow && dayNow - day == 0) {
if (!localStorage.lastDayGroup) {
localStorage.lastDayGroup = 1;
//活动最后一天弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "lastDayGroup" });
}
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public limitTodyText: eui.Label;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn() {
let ruleData = `规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.limitTodyText.text=`今天剩余次数:${DataManager.ins.getData(NetName.times).data.times}次`
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow = new Date().getUTCFullYear()
let monthNow = new Date().getUTCMonth()
let dayNow = new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if (DataManager.ins.getData(NetName.detailDo).data.endTime <= new Date()) {
if (!localStorage.overActGroup) {
localStorage.overActGroup = 1;
//活动已结束弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "overActGroup" });
}
} else if (year == yearNow && month == monthNow && dayNow - day == 0) {
if (!localStorage.lastDayGroup) {
localStorage.lastDayGroup = 1;
//活动最后一天弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "lastDayGroup" });
}
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public limitTodyText: eui.Label;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn() {
let ruleData = `规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
NetPromise.ins.join2recordDo()
.then(()=>{
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
})
.catch(()=>{})
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.limitTodyText.text=`今天剩余次数:${DataManager.ins.getData(NetName.times).data.times}次`
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow = new Date().getUTCFullYear()
let monthNow = new Date().getUTCMonth()
let dayNow = new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if (DataManager.ins.getData(NetName.detailDo).data.endTime <= new Date()) {
if (!localStorage.overActGroup) {
localStorage.overActGroup = 1;
//活动已结束弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "overActGroup" });
}
} else if (year == yearNow && month == monthNow && dayNow - day == 0) {
if (!localStorage.lastDayGroup) {
localStorage.lastDayGroup = 1;
//活动最后一天弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "lastDayGroup" });
}
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public limitTodyText: eui.Label;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn() {
let ruleData = `规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
NetPromise.ins.join2recordDo()
.then(()=>{
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
})
.catch(()=>{})
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.limitTodyText.text=`今天剩余次数:${DataManager.ins.getData(NetName.times).data.times}次`
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow = new Date().getUTCFullYear()
let monthNow = new Date().getUTCMonth()
let dayNow = new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if (DataManager.ins.getData(NetName.detailDo).data.endTime <= new Date()) {
if (!localStorage.overActGroup) {
localStorage.overActGroup = 1;
//活动已结束弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "overActGroup" });
}
} else if (year == yearNow && month == monthNow && dayNow - day == 0) {
if (!localStorage.lastDayGroup) {
localStorage.lastDayGroup = 1;
//活动最后一天弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "lastDayGroup" });
}
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public limitTodyText: eui.Label;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn() {
let ruleData = `规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
if(DataManager.ins.getData(NetName.times).data.times<0){
}
NetPromise.ins.join2recordDo()
.then(()=>{
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
})
.catch(()=>{})
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.limitTodyText.text=`今天剩余次数:${DataManager.ins.getData(NetName.times).data.times}次`
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow = new Date().getUTCFullYear()
let monthNow = new Date().getUTCMonth()
let dayNow = new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if (DataManager.ins.getData(NetName.detailDo).data.endTime <= new Date()) {
if (!localStorage.overActGroup) {
localStorage.overActGroup = 1;
//活动已结束弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "overActGroup" });
}
} else if (year == yearNow && month == monthNow && dayNow - day == 0) {
if (!localStorage.lastDayGroup) {
localStorage.lastDayGroup = 1;
//活动最后一天弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "lastDayGroup" });
}
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
import { IDynamicData } from './../../libs/tw/data/game/datapash/IDynamicData';
import { GamePlayModel } from './../../libs/tw/model/game/GamePlayModel';
import { ModuleTypes } from './../types/sceneTypes';
import { NetManager } from './../../libs/tw/manager/NetManager';
import Scene from "../views/Scene";
import Loading from "../loading/Loading";
import PanelCtrl from '../ctrls/panelCtrl';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { GTime } from '../../libs/tc/util/GTime';
import { Buried } from '../../libs/tw/util/Buried';
import SceneCtrl from '../ctrls/sceneCtrl';
import TaskItem from './TaskItem';
import { NetPromise } from '../NetPromise';
import { NetName } from '../../libs/tw/enum/NetName';
export default class StartScene extends Scene {
public scroller_body: eui.Scroller;
public bg: eui.Image;
public topBtn: eui.Group;
public ruleBtn: eui.Button;
public recordBtn: eui.Button;
public disc_ico: eui.Image;
public startBtn: eui.Button;
public limitTodyText: eui.Label;
public list: eui.List;
public detailBtn: eui.Group;
public detailText: eui.Label;
public get skinKey() { return 'StartScene' }
public get groupName() { return 'start_scene' }
constructor(data?) {
super(data);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this)
this.detailBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_detailBtn, this)
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this)
}
onTap_ruleBtn() {
let ruleData = `规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
规则规则规则规则规则规则规则规则规则
`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
}
onTap_detailBtn() {
this.enabled = false;
NetPromise.ins.detailDo()
.then(() => {
this.enabled = true;
SceneCtrl.instance.change(ModuleTypes.RED_SCENE)
})
.catch(() => {
this.enabled = true;
})
}
onTap_startBtn() {
if(DataManager.ins.getData(NetName.times).data.times<0){
if(DataManager.ins.getData(NetName.times).data.qualification){
console.log("分享增加次数弹窗")
}else{
console.log("次数已用完弹窗")
}
return;
}
NetPromise.ins.join2recordDo()
.then(()=>{
const isfirst = egret.localStorage.getItem('showGuide');
if (!isfirst) {
egret.localStorage.setItem('showGuide', 'true');
PanelCtrl.instance.show(ModuleTypes.GUIDE_PANEL);
} else {
SceneCtrl.instance.change(ModuleTypes.GAME_SCENE)
}
})
.catch(()=>{})
}
protected onSkinComplete(): void {
super.onSkinComplete();
// this.mainbg.texture = this.bgtexture;
let stageHeight = 750 / window.innerWidth * window.innerHeight;
this.scroller_body.height = stageHeight;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
this.animation()
this.limitTodyText.text=`今天剩余次数:${DataManager.ins.getData(NetName.times).data.times}次`
this.list.itemRenderer = TaskItem;
NetPromise.ins.listDo()
.then(() => {
this.list.dataProvider = new eui.ArrayCollection(DataManager.ins.getData(NetName.listDo).data)
})
.catch(() => {
})
NetPromise.ins.detailDo()
.then(() => {
let year = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCFullYear()
let month = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCMonth()
let day = new Date(DataManager.ins.getData(NetName.detailDo).data.endTime).getUTCDate()
let yearNow = new Date().getUTCFullYear()
let monthNow = new Date().getUTCMonth()
let dayNow = new Date().getUTCDate()
this.detailText.text = DataManager.ins.getData(NetName.detailDo).data.total.toFixed(2);
if (DataManager.ins.getData(NetName.detailDo).data.endTime <= new Date()) {
if (!localStorage.overActGroup) {
localStorage.overActGroup = 1;
//活动已结束弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "overActGroup" });
}
} else if (year == yearNow && month == monthNow && dayNow - day == 0) {
if (!localStorage.lastDayGroup) {
localStorage.lastDayGroup = 1;
//活动最后一天弹窗
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "lastDayGroup" });
}
}
})
.catch(() => { })
}
animation() {
this["disc_loop"].play(0)
this["disc_loop"].items.forEach((item) => {
item.tween.loop = true;
})
}
private bgtexture: egret.Texture;
protected async preLoadRes() {
//加载背景并设置背景图片
// this.bgtexture = await RES.getResAsync('gameBg_jpg');
// console.log('载背景并设置背景图片mainscene');
return new Promise(function (resolve, reject) {
resolve();
});
}
timer
start(data?) {
super.start(data);
this.timer = new egret.Timer(1000);
this.percentHeight = 100;
}
private onLoad(): void {
this.initUI();
}
private initUI(): void {
}
private canStart: boolean;
}
\ No newline at end of file
...@@ -58,7 +58,7 @@ export default class StartScene extends Scene { ...@@ -58,7 +58,7 @@ export default class StartScene extends Scene {
3、未下载民生银行App的用户,可至各大应用商城搜索下载“民生银行手机银行”App。 3、未下载民生银行App的用户,可至各大应用商城搜索下载“民生银行手机银行”App。
5、活动仅限截止2019年11月23日前开户的上海分行客户参加。 5、活动仅限上海分行客户参加。
6、本次活动最终解释权归中国民生银行上海分行所有。` 6、本次活动最终解释权归中国民生银行上海分行所有。`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData }) PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
......
http://activity.m.duibatest.com.cn/projectx/p79f6420d/index.html
var _href = "http://activity.m.duibatest.com.cn/projectx/p79f6420d/index.html";
var sd=_href.replace(new RegExp("\\S*projectx\\W(\\S+)\\Windex.html","g"),$1);
console.log(sd);
//var regular="(\\S+)//(\\S+)projectx/(\\S+)/index.html";
var projectId=window.location.href.replace(new RegExp("(\\S+)//(\\S+)projectx/(\\S+)/index.html","g"),"$3")
console.log(projectId)
...@@ -58,7 +58,7 @@ export default class StartScene extends Scene { ...@@ -58,7 +58,7 @@ export default class StartScene extends Scene {
3、未下载民生银行App的用户,可至各大应用商城搜索下载“民生银行手机银行”App。 3、未下载民生银行App的用户,可至各大应用商城搜索下载“民生银行手机银行”App。
5、活动仅限截止2019年11月23日前开户的上海分行客户参加。 5、活动仅限上海分行客户参加。
6、本次活动最终解释权归中国民生银行上海分行所有。` 6、本次活动最终解释权归中国民生银行上海分行所有。`
PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData }) PanelCtrl.instance.show(ModuleTypes.PUB_PANEL, { winType: "ruleGroup", ruleData: ruleData })
......
...@@ -6,4 +6,5 @@ console.log(sd); ...@@ -6,4 +6,5 @@ console.log(sd);
//var regular="(\\S+)//(\\S+)projectx/(\\S+)/index.html"; //var regular="(\\S+)//(\\S+)projectx/(\\S+)/index.html";
var projectId=window.location.href.replace(new RegExp("(\\S+)//(\\S+)projectx/(\\S+)/index.html","g"),"$3") var projectId=window.location.href.replace(new RegExp("(\\S+)//(\\S+)projectx/(\\S+)/index.html","g"),"$3")
console.log(projectId) console.log(projectId)
\ 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