Commit db038a85 authored by 任建锋's avatar 任建锋

--

parent 9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onClick_startbtn() {
this.grabState=true;
this.hasPrize=true;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getNgameStartStatus', {
orderId: this.doJoin
});
}
onGotDojoinError(data?) {
console.log('onGotDojoinError')
console.log(this.doJoin)
console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getNgameStartStatus', {
orderId: this.doJoin
});
}
onGotDojoinError(data?) {
console.log('onGotDojoinError')
console.log(this.doJoin)
console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getNgameStartStatus', {
orderId: this.doJoin
});
}
onGotDojoinError(data?) {
console.log('onGotDojoinError')
console.log(this.doJoin)
console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getNgameStartStatus', {
orderId: this.doJoin
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoin)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getNgameStartStatus', {
orderId: this.doJoin
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoin)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoinData);
this.broadcast('callApi', 1, 'getNgameStartStatus', {
orderId: this.doJoinData
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoinData)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoinData);
// this.broadcast('callApi', 1, 'getNgameStartStatus', {
// orderId: this.doJoinData
// });
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoinData)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
this.broadcast('callApi', 1, 'doJoinData', {
/* activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId */
});
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoinData);
// this.broadcast('callApi', 1, 'getNgameStartStatus', {
// orderId: this.doJoinData
// });
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoinData)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoinData);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoinData
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoinData)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoinData);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoinData
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoinData)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
this.hasPrize=false;
}else{
this.hasPrize=true;
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.hasPrize=false;
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoinData);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoinData
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoinData)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
this.hasPrize=false;
}else{
this.hasPrize=true;
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.hasPrize=false;
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoinData);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoinData
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoinData)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
this.hasPrize=false;
}else{
this.hasPrize=true;
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.hasPrize=false;
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoinData);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoinData
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoinData)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
this.hasPrize=false;
}else{
this.hasPrize=true;
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.hasPrize=false;
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoinData', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoinData);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoinData
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoinData)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoinData: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
this.hasPrize=false;
}else{
this.hasPrize=true;
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.hasPrize=false;
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoinData);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoinData
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoinData)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
this.hasPrize=false;
}else{
this.hasPrize=true;
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.hasPrize=false;
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoin)
//console.log(data)
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
this.hasPrize=false;
}else{
this.hasPrize=true;
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.hasPrize=false;
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoin)
//console.log(data)
}
onGot_getNgameStartStatus() {
//console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
//console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
this.hasPrize=false;
}else{
this.hasPrize=true;
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.hasPrize=false;
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
console.log(this.doJoin)
//console.log(data)
}
onGot_getNgameStartStatus() {
//console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
//console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
this.hasPrize=false;
}else{
this.hasPrize=true;
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.hasPrize=false;
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
/* this.broadcast('callApi', 1, 'doJoinData', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
}
onGotDojoinError(data?) {
console.log('onGotDojoinError')
console.log(this.doJoin)
console.log(data)
}
onGot_getNgameStartStatus() {
//console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
//console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
this.hasPrize=false;
}else{
this.hasPrize=true;
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.hasPrize=false;
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
}
onGotDojoinError(data?) {
console.log('onGotDojoinError')
console.log(this.doJoin)
console.log(data)
}
onGot_getNgameStartStatus() {
//console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
//console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.hasPrize=false;
}else{
this.hasPrize=true;
}
}else{
this.hasPrize=false;
}
}
hasGraDo(){
if(this.getOrderStatus.code == "C000000001"){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
}else{
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
}
onGotDojoinError(data?) {
console.log('onGotDojoinError')
console.log(this.doJoin)
console.log(data)
}
onGot_getNgameStartStatus() {
//console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
//console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.hasGraDo()
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.hasPrize=false;
}else{
this.hasPrize=true;
}
}else{
this.hasPrize=false;
}
}
hasGraDo(){
if(this.getOrderStatus.code == "C000000001"){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
}else{
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
}
onGotDojoinError(data?) {
console.log('onGotDojoinError')
console.log(this.doJoin)
console.log(data)
}
onGot_getNgameStartStatus() {
//console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
//console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
/**
* Created by rockyl on 2019-04-09.
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, Tween } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import Wave from 'components/animation/Wave'
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Transform } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
recordbtn: Entity;
pingziFront: Entity;
pingziBack: Entity;
rankbtn: Entity;
rulebtn: Entity;
gouzi: Entity;
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.pingziFrontTransform = this.pingziFront.getComponent(Transform);
this.pingziBackTransform = this.pingziBack.getComponent(Transform);
this.gouziTransform = this.gouzi.getComponent(Transform);
this.pingzi_1Transform = this.pingzi_1.getComponent(Transform);
this.pingzi_2Transform = this.pingzi_2.getComponent(Transform);
this.gouzi_pingziTransform = this.gouzi_pingzi.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console.log("sd")
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this.gouzi_pingziTransform.alpha=0
this.pingzi_2Transform.alpha=1
createTween(this, this.startBtnAnimation,true,{loop:-1})
.set({scale: {x: 1, y: 1}})
.to({scale: {x: .9, y: .9}}, 300)
.wait(1000)
.to({scale: {x: 1, y: 1}}, 300)
createTween(this, this.pingziBackTransform,true,{loop:-1})
.set({position: {x: 47.5}})
.to({position: {x: -152.5}},1000)
createTween(this, this.pingziFrontTransform,true,{loop:-1})
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
//console.log(`2`)
if(this.grabState){
this.grabState=false;
var time=1000;
if(this.hasPrize){
time=1000;
}else{
time=500;
}
createTween(this, this.gouziTransform,true,{loop:0})
.set({position: {y: 132.5}})
.to({position: {y: 335}},time)
.call(()=>{
if(this.hasPrize){
this.hasPrize=false;
this.pingzi_2Transform.alpha=0
this.gouzi_pingziTransform.alpha=1
setTimeout(()=>{
this.pingzi_2Transform.alpha=1
},1000)
}
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.hasGraDo()
this.pingzi_2Transform.alpha=1
this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
initGameStage() {
this.updateCountText();
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
grabState=false;
hasPrize=false;
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.hasPrize=false;
}else{
this.hasPrize=true;
}
}else{
this.hasPrize=false;
}
}
hasGraDo(){
if(this.getOrderStatus.code == "C000000001"){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
}else{
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
}
onGotDojoinError(data?) {
console.log('onGotDojoinError')
console.log(this.doJoin)
console.log(data)
}
onGot_getNgameStartStatus() {
//console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
//console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_recordbtn() {
console.log('onClick_rulebtn');
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
alert('onClick_rankbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
{"success":true,"code":"0000000000","desc":"OK","timestamp":1548915321930,"data":123456}
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1548923950498,
"data": {
"element": {
"success": false,
"isCreditsTypeOpen": false,
"needCredits": "100",
"myCredits": "999999630434",
"myCreditsLong": 999999630434,
"needCreditsLong": 100,
"freeLimit": -1,
"status": 2,
"freeEmpty": true
},
"lottery": null,
"exposure": {
"dcm":"202.3233.0.0",
"dpm":"1212.110.1.1"
},
"creditsInfo": {
"activityId": 82567,
"prizeId": 4,
"orderNum": null,
"developerBizId": "3029576",
"score": null,
"recordStatus": 1,
"errorMsg": null
},
"againTag": null
}
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1548923950498,
"data": {
"element": {
"success": false,
"isCreditsTypeOpen": false,
"needCredits": "100",
"myCredits": "999999630434",
"myCreditsLong": 999999630434,
"needCreditsLong": 100,
"freeLimit": -1,
"status": 2,
"freeEmpty": true
},
"lottery": {
"id": 253071,
"type": "virtual",
"imgUrl": "//yun.duiba.com.cn/images/201806/y7jhibke16.png",
"link": "//activity.m.duiba.com.cn/activity/takePrizeNew?recordId=4552894285&dbnewopen",
"title": "5搜豆",
"itemId": 42967,
"appItemId": null,
"bonus": null,
"bonusMin": null,
"bonusMax": null,
"needAccount": null,
"appLucky": null,
"tip": null,
"useBtnText": null,
"validate": null,
"couponCode": null,
"couponKey": null,
"stInfoDpmImg": null,
"stInfoDpmClose": null,
"stInfoDpmGoUse": null,
"showUse": null,
"openUrl": null,
"iosDownloadUrl": null,
"androidDownloadUrl": null,
"isDownloadUrl": null,
"confirm": null,
"phaseNumber": null,
"happyCode": null,
"appHidden": true,
"zybangJson": null
},
"exposure": {
"dcm":"202.3233.0.0",
"dpm":"1212.110.1.1"
},
"creditsInfo": {
"activityId": 82567,
"prizeId": 4,
"orderNum": null,
"developerBizId": "3029576",
"score": null,
"recordStatus": 1,
"errorMsg": null
},
"againTag": null
}
}
\ No newline at end of file
......@@ -116,7 +116,59 @@
"gouzi": "entity|14e15843-7bff-474b-857f-c23cf3dae20a",
"pingzi_1": "entity|f8175d37-59a4-46bf-b281-6b9d8c7e8019",
"pingzi_2": "entity|e285b74a-1412-4cd6-a305-16378a030922",
"gouzi_pingzi": "entity|baba7316-9d74-44c1-b2a8-1852e716e67d"
"gouzi_pingzi": "entity|baba7316-9d74-44c1-b2a8-1852e716e67d",
"doJoinData": "dynamic|API|doJoinData",
"getOrderStatus": "dynamic|API|getOrderStatus"
}
},
{
"script": "./scripts/api/SamplePollingApi",
"properties": {
"name": "getOrderStatus",
"uri": "/hdtool/recon/getOrderStatus",
"onError": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onError_orderStatus"
}
],
"onFinish": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onFinish_orderStatus"
}
],
"onResponse": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onResponse_orderStatus"
}
]
}
},
{
"script": "./scripts/api/SampleApi",
"properties": {
"name": "doJoin",
"method": "GET",
"onError": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onGotDojoinError"
}
],
"onFinish": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onGotDojoin"
}
],
"uri": "/hdtool/recon/doJoin"
}
}
],
......
......@@ -13,7 +13,7 @@ import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
......@@ -108,8 +108,9 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
})
.to({position: {y: 132.5}},1000)
.call(()=>{
this.hasGraDo()
this.pingzi_2Transform.alpha=1
//this.gouzi_pingziTransform.alpha=0
this.gouzi_pingziTransform.alpha=0
})
}
......@@ -146,10 +147,56 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
grabState=false;
hasPrize=false;
onClick_startbtn() {
onFinish_orderStatus(){
if(!this.getOrderStatus){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
}
onResponse_orderStatus() {
//this.bubbling('showDialog', 'GameOver');
console.log(1)
console.log(this.getOrderStatus)
this.grabState=true;
if(this.getOrderStatus.code == "C000000001"){
this.hasPrize=false;
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.hasPrize=false;
}else{
this.hasPrize=true;
/* if (window['getDuibaToken']) {
}
}else{
this.hasPrize=false;
}
}
hasGraDo(){
if(this.getOrderStatus.code == "C000000001"){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
else if(this.getOrderStatus.lottery){
if(this.getOrderStatus.lottery.type=="thanks"){
this.bubbling('showDialog', 'GameNoPrize');
}else{
this.bubbling('showDialog', 'GameOver',this.getOrderStatus);
}
}else{
this.bubbling('showDialog', 'GameNoPrize');
}
}
onError_orderStatus() {
console.log(2)
}
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
......@@ -166,12 +213,12 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.broadcast('callApi', 1, 'getNgameStartStatus', {
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
}
......@@ -183,13 +230,13 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
onGot_getNgameStartStatus() {
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
console.log(this.getNgameStartStatus)
//console.log(this.getNgameStartStatus)
console.log('onGotError_getNgameStartStatus');
}
......
{"success":false,"code":"0000000000","desc":"OK","timestamp":1548915321930,"data":123456}
{"success":true,"code":"0000000000","desc":"OK","timestamp":1548915321930,"data":123456}
......@@ -5,65 +5,65 @@
import {registerDef} from 'scilla'
import component0 from 'components/base/Transform';
registerDef('components/base/Transform', component0);
import component0 from 'components/renderer/TextRenderer';
registerDef('components/renderer/TextRenderer', component0);
import component1 from 'components/other/FullStageSize';
registerDef('components/other/FullStageSize', component1);
import component1 from 'components/base/Transform';
registerDef('components/base/Transform', component1);
import component2 from 'components/renderer/TextureRenderer';
registerDef('components/renderer/TextureRenderer', component2);
import component2 from 'components/renderer/HtmlRenderer';
registerDef('components/renderer/HtmlRenderer', component2);
import component3 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component3);
import component3 from 'components/base/TouchInterrupt';
registerDef('components/base/TouchInterrupt', component3);
import component4 from 'components/animation/TouchZoom';
registerDef('components/animation/TouchZoom', component4);
import component4 from 'components/other/FullStageSize';
registerDef('components/other/FullStageSize', component4);
import component5 from 'components/ui/Button';
registerDef('components/ui/Button', component5);
import component5 from 'components/other/CameraController';
registerDef('components/other/CameraController', component5);
import component6 from 'components/renderer/TextRenderer';
registerDef('components/renderer/TextRenderer', component6);
import component6 from 'components/ui/Button';
registerDef('components/ui/Button', component6);
import component7 from 'components/other/CameraController';
registerDef('components/other/CameraController', component7);
import component7 from 'components/animation/TouchZoom';
registerDef('components/animation/TouchZoom', component7);
import component8 from 'components/base/TouchInterrupt';
registerDef('components/base/TouchInterrupt', component8);
import component8 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component8);
import component9 from 'components/renderer/HtmlRenderer';
registerDef('components/renderer/HtmlRenderer', component9);
import component9 from 'components/renderer/TextureRenderer';
registerDef('components/renderer/TextureRenderer', component9);
import component10 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component10);
import component10 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/dialogs/RuleDialogContent', component10);
import component11 from '../../assets/scripts/navigator/SingleSceneNavigator';
registerDef('./scripts/navigator/SingleSceneNavigator', component11);
import component11 from '../../assets/scripts/api/SamplePollingApi';
registerDef('./scripts/api/SamplePollingApi', component11);
import component12 from '../../assets/scripts/scenes/SceneController';
registerDef('./scripts/scenes/SceneController', component12);
import component13 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/scenes/SceneStart', component13);
import component13 from '../../assets/scripts/navigator/SingleSceneNavigator';
registerDef('./scripts/navigator/SingleSceneNavigator', component13);
import component14 from '../../assets/scripts/api/SamplePollingApi';
registerDef('./scripts/api/SamplePollingApi', component14);
import component14 from '../../assets/scripts/scenes/ScenePlay';
registerDef('./scripts/scenes/ScenePlay', component14);
import component15 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component15);
import component16 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component16);
import component16 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component16);
import component17 from '../../assets/scripts/dialogs/AlertDialogContent';
registerDef('./scripts/dialogs/AlertDialogContent', component17);
import component18 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/dialogs/RuleDialogContent', component18);
import component18 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/scenes/SceneStart', component18);
import component19 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component19);
import component19 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component19);
import component20 from '../../assets/scripts/dialogs/GameOverPanel';
registerDef('./scripts/dialogs/GameOverPanel', component20);
......@@ -80,5 +80,5 @@ registerDef('./scripts/dialogs/GameNoPrizePanel', component23);
import component24 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component24);
import component25 from '../../assets/scripts/scenes/ScenePlay';
registerDef('./scripts/scenes/ScenePlay', component25);
import component25 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component25);
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