Commit 8ce3fa2e authored by 任建锋's avatar 任建锋

--

parent db038a85
/**
* 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);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj["Transform"].alpha=1;
obj.enabled=true;
}else{
obj["Transform"].alpha=0;
obj.enabled=false;
}
}
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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj["Transform"].alpha=1;
obj.enabled=true;
}else{
obj["Transform"].alpha=0;
obj.enabled=false;
}
}
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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj["Transform"].alpha=1;
obj.enabled=true;
}else{
obj["Transform"].alpha=0;
obj.enabled=false;
}
}
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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj["Transform"].alpha=1;
obj.enabled=true;
}else{
obj["Transform"].alpha=0;
obj.enabled=false;
}
}
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.setVisible(this.loadingTransform,false)
//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; */
this.setVisible(this.loadingTransform,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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj["Transform"].alpha=1;
obj.enabled=true;
}else{
obj["Transform"].alpha=0;
obj.enabled=false;
}
}
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.setVisible(this.loadingTransform,false)
//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; */
this.setVisible(this.loadingTransform,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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
obj.enabled=true;
}else{
obj.alpha=0;
obj.enabled=false;
}
}
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.setVisible(this.loadingTransform,false)
//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; */
this.setVisible(this.loadingTransform,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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
/* if(state){
obj.alpha=1;
obj.enabled=true;
}else{
obj.alpha=0;
obj.enabled=false;
} */
}
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.setVisible(this.loadingTransform,false)
//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; */
this.setVisible(this.loadingTransform,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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
//obj.enabled=true;
}else{
obj.alpha=0;
//obj.enabled=false;
}
}
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.setVisible(this.loadingTransform,false)
//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; */
this.setVisible(this.loadingTransform,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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
//obj.enabled=true;
}else{
obj.alpha=0;
//obj.enabled=false;
}
}
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; */
this.setVisible(this.loadingTransform,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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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(()=>{
this.setVisible(this.loadingTransform,false)
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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
//obj.enabled=true;
}else{
obj.alpha=0;
//obj.enabled=false;
}
}
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; */
this.setVisible(this.loadingTransform,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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
//obj.enabled=true;
}else{
obj.alpha=0;
//obj.enabled=false;
}
}
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; */
this.setVisible(this.loadingTransform,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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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(()=>{
this.setVisible(this.loadingTransform,false)
//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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
//obj.enabled=true;
}else{
obj.alpha=0;
//obj.enabled=false;
}
}
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; */
this.setVisible(this.loadingTransform,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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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(()=>{
this.setVisible(this.loadingTransform,false)
//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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
//obj.enabled=true;
}else{
obj.alpha=0;
//obj.enabled=false;
}
}
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(){
this.startBtnAnimation.enabled=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');
}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; */
this.setVisible(this.loadingTransform,true)
this.startBtnAnimation.enabled=false;
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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform: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.loadingTransform = this.loading.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(()=>{
this.setVisible(this.loadingTransform,false)
//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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
//obj.enabled=true;
}else{
obj.alpha=0;
//obj.enabled=false;
}
}
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(){
this.startBtnAnimation.enabled=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');
}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; */
this.setVisible(this.loadingTransform,true)
this.startBtnAnimation.enabled=false;
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, Button } 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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform:Transform;
startBtnButton:Button;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.startBtnButton = 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.loadingTransform = this.loading.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(()=>{
this.setVisible(this.loadingTransform,false)
//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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
//obj.enabled=true;
}else{
obj.alpha=0;
//obj.enabled=false;
}
}
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(){
this.startBtnAnimation.enabled=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');
}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; */
this.setVisible(this.loadingTransform,true)
this.startBtnAnimation.enabled=false;
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, Button } 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;
loading: Entity;
private startBtnAnimation;
pingziFrontTransform:Transform;
pingziBackTransform:Transform;
gouziTransform:Transform;
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform:Transform;
startBtnButton:Button;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.startBtnButton = this.startbtn.getComponent(Button);
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.loadingTransform = this.loading.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(()=>{
this.setVisible(this.loadingTransform,false)
//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
})
}
})
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
//obj.enabled=true;
}else{
obj.alpha=0;
//obj.enabled=false;
}
}
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(){
this.startBtnAnimation.enabled=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');
}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; */
this.setVisible(this.loadingTransform,true)
this.startBtnAnimation.enabled=false;
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;
}
}
This diff is collapsed.
This diff is collapsed.
{"map":"{\"version\":3,\"file\":\"GameLosePanel.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../assets/scripts/dialogs/GameLosePanel.ts\"],\"names\":[],\"mappings\":\";AAAA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AAEnD;IAA2C,yCAAa;IAAxD;;IAQA,CAAC;IAPA,+BAAO,GAAP;QACC,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IAED,wCAAgB,GAAhB;QACC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IACxC,CAAC;IACF,oBAAC;AAAD,CAAC,AARD,CAA2C,aAAa,GAQvD\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport DialogContent from '../popup/DialogContent';\r\nvar GameLosePanel = (function (_super) {\r\n tslib_1.__extends(GameLosePanel, _super);\r\n function GameLosePanel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GameLosePanel.prototype.onAwake = function () {\r\n _super.prototype.onAwake.call(this);\r\n };\r\n GameLosePanel.prototype.onclick_againBtn = function () {\r\n this.bubbling('fuckNavigator', 'start');\r\n };\r\n return GameLosePanel;\r\n}(DialogContent));\r\nexport default GameLosePanel;\r\n//# sourceMappingURL=GameLosePanel.js.map"}
{"map":"{\"version\":3,\"file\":\"SceneController.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../assets/scripts/scenes/SceneController.ts\"],\"names\":[],\"mappings\":\";AAAA,OAAO,eAAe,MAAM,4CAA4C,CAAC;AACzE,OAAO,oBAAoB,MAAM,mCAAmC,CAAC;AAErE;IAA6C,2CAAe;IAA5D;;IAoBA,CAAC;IAnBA,iCAAO,GAAP;QACC,iBAAM,OAAO,WAAE,CAAC;IAEjB,CAAC;IAED,8BAAI,GAAJ,UAAK,CAAC;QAEL,IAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;QAC3D,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACZ,CAAC;IAED,kCAAQ,GAAR,UAAS,CAAC;QACT,iBAAM,QAAQ,YAAC,CAAC,CAAC,CAAC;IAEnB,CAAC;IAKF,sBAAC;AAAD,CAAC,AApBD,CAA6C,eAAe,GAoB3D\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport ScillaComponent from 'scilla-components/src/base/ScillaComponent';\r\nimport SingleSceneNavigator from '../navigator/SingleSceneNavigator';\r\nvar SceneController = (function (_super) {\r\n tslib_1.__extends(SceneController, _super);\r\n function SceneController() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SceneController.prototype.onAwake = function () {\r\n _super.prototype.onAwake.call(this);\r\n };\r\n SceneController.prototype.fuck = function (p) {\r\n var nav = this.entity.getComponent(SingleSceneNavigator);\r\n nav.push(p);\r\n };\r\n SceneController.prototype.onUpdate = function (t) {\r\n _super.prototype.onUpdate.call(this, t);\r\n };\r\n return SceneController;\r\n}(ScillaComponent));\r\nexport default SceneController;\r\n//# sourceMappingURL=SceneController.js.map"}
{"map":"{\"version\":3,\"file\":\"SamplePollingApi.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../assets/scripts/api/SamplePollingApi.ts\"],\"names\":[],\"mappings\":\";AAMA,OAAO,EAAM,KAAK,GAAE,MAAM,YAAY,CAAA;AACtC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAE3C;IAA8C,4CAAY;IAA1D;QAAA,qEA+DC;QA3DA,cAAQ,GAAG,CAAC,CAAC;QACb,WAAK,GAAG,GAAG,CAAC;QAEJ,gBAAU,GAAG,KAAK,CAAC;QA0CjB,eAAS,GAAC;YACnB,OAAO,KAAI,CAAC,UAAU,CAAC;QACxB,CAAC,CAAA;QAMD,iBAAW,GAAC,UAAC,QAAQ;YAIpB,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,YAAY,CAAC;QAC7C,CAAC,CAAA;;IACF,CAAC;IAtDM,kCAAO,GAAb,UAAc,IAAI,EAAE,WAAW;QAAE,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;;;;;6BACnC,CAAA,IAAI,CAAC,IAAI,IAAI,IAAI,CAAA,EAAjB,cAAiB;wBACpB,WAAM,IAAI,CAAC,OAAO,OAAZ,IAAI,oBAAS,WAAW,GAAK,IAAI,IAAC;;wBAAxC,SAAwC,CAAC;;;;;;KAE1C;IAED,uCAAY,GAAZ,UAAa,IAAI;QAChB,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;YACtB,IAAI,CAAC,MAAM,EAAE,CAAC;SACd;IACF,CAAC;IAEe,kCAAO,GAAvB,UAAwB,WAAY;QAAE,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;;;;;4BAC5C,WAAM,iBAAM,OAAO,+BAAC,WAAW,GAAK,IAAI,IAAC;;wBAAzC,SAAyC,CAAC;wBAE1C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;wBAElB,MAAM,GAAG,EAAE,CAAC;wBAElB,IAAI,IAAI,CAAC,MAAM,EAAE;4BAChB,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;yBACtC;wBAED,IAAI,WAAW,EAAE;4BAChB,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;yBACtC;wBAEK,KAAgB,IAAI,EAAnB,GAAG,SAAA,EAAE,MAAM,YAAA,CAAS;;;;wBAGT,WAAM,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,EAAA;;wBAA1G,QAAQ,GAAG,SAA+F;wBAEhH,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;wBAE7B,WAAO,QAAQ,CAAC,IAAI,EAAC;;;wBAErB,IAAI,CAAC,UAAU,CAAC,GAAC,CAAC,CAAC;;;;;;KAEpB;IAMS,iCAAM,GAAhB;QACC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACxB,CAAC;IAQF,uBAAC;AAAD,CAAC,AA/DD,CAA8C,YAAY,GA+DzD\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport { utils, } from 'scilla/src';\r\nimport ApiComponent from \"./ApiComponent\";\r\nimport { polling } from \"../net/webService\";\r\nvar SamplePollingApi = (function (_super) {\r\n tslib_1.__extends(SamplePollingApi, _super);\r\n function SamplePollingApi() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.maxTimes = 5;\r\n _this.delay = 500;\r\n _this._abortFlag = false;\r\n _this.abortFunc = function () {\r\n return _this._abortFlag;\r\n };\r\n _this.successFunc = function (response) {\r\n return response.origin.code != \"C000000001\";\r\n };\r\n return _this;\r\n }\r\n SamplePollingApi.prototype.callApi = function (name, paramsInput) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(this.name == name)) return [3, 2];\r\n return [4, this.execute.apply(this, tslib_1.__spread([paramsInput], args))];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2];\r\n }\r\n });\r\n });\r\n };\r\n SamplePollingApi.prototype.abortCallApi = function (name) {\r\n if (this.name == name) {\r\n this._abort();\r\n }\r\n };\r\n SamplePollingApi.prototype.execute = function (paramsInput) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var params, _a, uri, method, response, e_1;\r\n return tslib_1.__generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4, _super.prototype.execute.apply(this, tslib_1.__spread([paramsInput], args))];\r\n case 1:\r\n _b.sent();\r\n this._abortFlag = false;\r\n params = {};\r\n if (this.params) {\r\n utils.injectProp(params, this.params);\r\n }\r\n if (paramsInput) {\r\n utils.injectProp(params, paramsInput);\r\n }\r\n _a = this, uri = _a.uri, method = _a.method;\r\n _b.label = 2;\r\n case 2:\r\n _b.trys.push([2, 4, , 5]);\r\n return [4, polling(this.successFunc, uri, params, this.maxTimes, this.delay, this.abortFunc, method)];\r\n case 3:\r\n response = _b.sent();\r\n this.onGotResponse(response);\r\n return [2, response.data];\r\n case 4:\r\n e_1 = _b.sent();\r\n this.onGotError(e_1);\r\n return [3, 5];\r\n case 5: return [2];\r\n }\r\n });\r\n });\r\n };\r\n SamplePollingApi.prototype._abort = function () {\r\n this._abortFlag = true;\r\n };\r\n return SamplePollingApi;\r\n}(ApiComponent));\r\nexport default SamplePollingApi;\r\n//# sourceMappingURL=SamplePollingApi.js.map"}
{"map":"{\"version\":3,\"file\":\"GameOverPanel.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../assets/scripts/dialogs/GameOverPanel.ts\"],\"names\":[],\"mappings\":\";AAAA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,WAAgE,MAAM,uBAAuB,CAAC;AAErG,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAU,MAAM,uBAAuB,CAAC;AAEzF;IAA2C,yCAAa;IAAxD;;IAiDA,CAAC;IAhDA,+BAAO,GAAP;QACC,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IAaD,6BAAK,GAAL,UAAM,IAAc;QAApB,iBAoBC;QApBK,qBAAA,EAAA,SAAc;QACnB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACjB,IAAI,CAAC,IAAI,GAAC,IAAI,CAAA;QACd,IAAI,CAAC,kBAAkB,GAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAC9D,IAAI,CAAC,YAAY,GAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;QAClD,IAAI,CAAC,iBAAiB,GAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,CAAA;QAC5D,IAAG,IAAI,CAAC,QAAQ,EAAC;YAChB,IAAI,CAAC,WAAW,GAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAA;YAC/C,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAC,IAAI,CAAC,CAAA;SACrE;QACD,IAAI,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;QAClB,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QAC9B,GAAG,CAAC,MAAM,GAAG;YAChB,KAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAC3C,KAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,GAAC,GAAG,CAAC,MAAM,CAAC;YACzD,KAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,GAAC,GAAG,CAAC,KAAK,CAAC;YACvD,KAAI,CAAC,YAAY,CAAC,KAAK,GAAC,GAAG,CAAC,KAAK,CAAC;YAClC,KAAI,CAAC,YAAY,CAAC,MAAM,GAAC,GAAG,CAAC,MAAM,CAAC;QACpC,CAAC,CAAC;QACF,IAAI,CAAC,iBAAiB,CAAC,IAAI,GAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA;IAChD,CAAC;IAED,sCAAc,GAAd;QACC,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YACrB,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAA;SAC7B;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAC5C,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IACxC,CAAC;IAED,wCAAgB,GAAhB;QACC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IACxC,CAAC;IACF,oBAAC;AAAD,CAAC,AAjDD,CAA2C,aAAa,GAiDvD\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport DialogContent from '../popup/DialogContent';\r\nimport BuriedPoint from '../common/BuriedPoint';\r\nimport { TextureRenderer, Transform, TextRenderer } from 'scilla-components/src';\r\nvar GameOverPanel = (function (_super) {\r\n tslib_1.__extends(GameOverPanel, _super);\r\n function GameOverPanel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GameOverPanel.prototype.onAwake = function () {\r\n _super.prototype.onAwake.call(this);\r\n };\r\n GameOverPanel.prototype.setup = function (data) {\r\n var _this = this;\r\n if (data === void 0) { data = {}; }\r\n console.log(data);\r\n this.data = data;\r\n this.imgTextureRenderer = this.img.getComponent(TextureRenderer);\r\n this.imgTransform = this.img.getComponent(Transform);\r\n this.titleTextRenderer = this.title.getComponent(TextRenderer);\r\n if (data.exposure) {\r\n this.BuriedPoint = this.getComponent(BuriedPoint);\r\n this.BuriedPoint.setConfig(data.exposure.dpm, data.exposure.dcm, true);\r\n }\r\n var img = new Image();\r\n img.src = data.lottery.imgUrl;\r\n img.onload = function () {\r\n _this.imgTextureRenderer.texture.setImg(img);\r\n _this.imgTextureRenderer.texture.bounds.height = img.height;\r\n _this.imgTextureRenderer.texture.bounds.width = img.width;\r\n _this.imgTransform.width = img.width;\r\n _this.imgTransform.height = img.height;\r\n };\r\n this.titleTextRenderer.text = data.lottery.title;\r\n };\r\n GameOverPanel.prototype.onclick_useBtn = function () {\r\n if (this.data.exposure) {\r\n this.BuriedPoint.onTouchTap();\r\n }\r\n window.location.href = this.data.lottery.link;\r\n this.bubbling('fuckNavigator', 'start');\r\n };\r\n GameOverPanel.prototype.onclick_closeBtn = function () {\r\n this.bubbling('fuckNavigator', 'start');\r\n };\r\n return GameOverPanel;\r\n}(DialogContent));\r\nexport default GameOverPanel;\r\n//# sourceMappingURL=GameOverPanel.js.map"}
{"map":"{\"version\":3,\"file\":\"SampleApi.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../assets/scripts/api/SampleApi.ts\"],\"names\":[],\"mappings\":\";AAMA,OAAO,EAAC,KAAK,GAAG,MAAM,YAAY,CAAA;AAClC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAE1C;IAAuC,qCAAY;IAAnD;QAAA,qEAmCC;QAjCA,wBAAkB,GAAG,KAAK,CAAC;;IAiC5B,CAAC;IA/BM,2BAAO,GAAb,UAAc,IAAI,EAAE,WAAW;QAAE,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;;;;;6BACpC,CAAA,IAAI,CAAC,IAAI,IAAI,IAAI,CAAA,EAAjB,cAAiB;wBACnB,WAAM,IAAI,CAAC,OAAO,OAAZ,IAAI,oBAAS,WAAW,GAAK,IAAI,IAAC;;wBAAxC,SAAwC,CAAC;;;;;;KAE1C;IAEe,2BAAO,GAAvB,UAAwB,WAAY;QAAE,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;;;;;4BAC5C,WAAM,iBAAM,OAAO,+BAAC,WAAW,GAAK,IAAI,IAAC;;wBAAzC,SAAyC,CAAC;wBAEpC,MAAM,GAAG,EAAE,CAAC;wBAElB,IAAG,IAAI,CAAC,MAAM,EAAC;4BACd,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;yBACtC;wBAED,IAAG,WAAW,EAAC;4BACd,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;yBACtC;wBAEK,KAAgB,IAAI,EAAnB,GAAG,SAAA,EAAE,MAAM,YAAA,CAAS;;;;wBAGT,WAAM,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC,EAAA;;wBAA9E,QAAQ,GAAG,SAAmE;wBAEpF,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;wBAE7B,WAAO,QAAQ,CAAC,IAAI,EAAC;;;wBAErB,IAAI,CAAC,UAAU,CAAC,GAAC,CAAC,CAAC;;;;;;KAEpB;IACF,gBAAC;AAAD,CAAC,AAnCD,CAAuC,YAAY,GAmClD\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport { utils, } from 'scilla/src';\r\nimport ApiComponent from \"./ApiComponent\";\r\nimport { callApi } from \"../net/webService\";\r\nvar SampleApi = (function (_super) {\r\n tslib_1.__extends(SampleApi, _super);\r\n function SampleApi() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.ignoreSuccessField = false;\r\n return _this;\r\n }\r\n SampleApi.prototype.callApi = function (name, paramsInput) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(this.name == name)) return [3, 2];\r\n return [4, this.execute.apply(this, tslib_1.__spread([paramsInput], args))];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2];\r\n }\r\n });\r\n });\r\n };\r\n SampleApi.prototype.execute = function (paramsInput) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var params, _a, uri, method, response, e_1;\r\n return tslib_1.__generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4, _super.prototype.execute.apply(this, tslib_1.__spread([paramsInput], args))];\r\n case 1:\r\n _b.sent();\r\n params = {};\r\n if (this.params) {\r\n utils.injectProp(params, this.params);\r\n }\r\n if (paramsInput) {\r\n utils.injectProp(params, paramsInput);\r\n }\r\n _a = this, uri = _a.uri, method = _a.method;\r\n _b.label = 2;\r\n case 2:\r\n _b.trys.push([2, 4, , 5]);\r\n return [4, callApi(uri, params, method, 'json', this.ignoreSuccessField)];\r\n case 3:\r\n response = _b.sent();\r\n this.onGotResponse(response);\r\n return [2, response.data];\r\n case 4:\r\n e_1 = _b.sent();\r\n this.onGotError(e_1);\r\n return [3, 5];\r\n case 5: return [2];\r\n }\r\n });\r\n });\r\n };\r\n return SampleApi;\r\n}(ApiComponent));\r\nexport default SampleApi;\r\n//# sourceMappingURL=SampleApi.js.map"}
{"map":"{\"version\":3,\"file\":\"RuleDialogContent.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../assets/scripts/dialogs/RuleDialogContent.ts\"],\"names\":[],\"mappings\":\";AAMA,OAAO,YAAY,MAAM,6CAA6C,CAAC;AAEvE,OAAO,aAAa,MAAM,wBAAwB,CAAC;AAEnD;IAA+C,6CAAa;IAA5D;;IAcA,CAAC;IATA,mCAAO,GAAP;QACC,iBAAM,OAAO,WAAE,CAAC;QAChB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACjE,CAAC;IAED,iCAAK,GAAL,UAAM,IAAI;QACT,IAAI,CAAC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACxD,CAAC;IAEF,wBAAC;AAAD,CAAC,AAdD,CAA+C,aAAa,GAc3D\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport HtmlRenderer from \"scilla-components/src/renderer/HtmlRenderer\";\r\nimport DialogContent from \"../popup/DialogContent\";\r\nvar RuleDialogContent = (function (_super) {\r\n tslib_1.__extends(RuleDialogContent, _super);\r\n function RuleDialogContent() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n RuleDialogContent.prototype.onAwake = function () {\r\n _super.prototype.onAwake.call(this);\r\n this._contentRenderer = this.Content.getComponent(HtmlRenderer);\r\n };\r\n RuleDialogContent.prototype.setup = function (data) {\r\n this._contentRenderer.htmlText = this.ajaxElement.rule;\r\n };\r\n return RuleDialogContent;\r\n}(DialogContent));\r\nexport default RuleDialogContent;\r\n//# sourceMappingURL=RuleDialogContent.js.map"}
{"map":"{\"version\":3,\"file\":\"MustCompile.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/generated/MustCompile.ts\"],\"names\":[],\"mappings\":\"AAKA,OAAO,EAAC,WAAW,EAAC,MAAM,QAAQ,CAAA;AAElC,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,WAAW,CAAC,kCAAkC,EAAE,UAAU,CAAC,CAAC;AAE5D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,WAAW,CAAC,2BAA2B,EAAE,UAAU,CAAC,CAAC;AAErD,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,WAAW,CAAC,kCAAkC,EAAE,UAAU,CAAC,CAAC;AAE5D,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,WAAW,CAAC,gCAAgC,EAAE,UAAU,CAAC,CAAC;AAE1D,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,WAAW,CAAC,gCAAgC,EAAE,UAAU,CAAC,CAAC;AAE1D,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAC3D,WAAW,CAAC,mCAAmC,EAAE,UAAU,CAAC,CAAC;AAE7D,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,WAAW,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;AAEhD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,WAAW,CAAC,gCAAgC,EAAE,UAAU,CAAC,CAAC;AAE1D,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,WAAW,CAAC,kCAAkC,EAAE,UAAU,CAAC,CAAC;AAE5D,OAAO,UAAU,MAAM,qCAAqC,CAAC;AAC7D,WAAW,CAAC,qCAAqC,EAAE,UAAU,CAAC,CAAC;AAE/D,OAAO,WAAW,MAAM,gDAAgD,CAAC;AACzE,WAAW,CAAC,qCAAqC,EAAE,WAAW,CAAC,CAAC;AAEhE,OAAO,WAAW,MAAM,2CAA2C,CAAC;AACpE,WAAW,CAAC,gCAAgC,EAAE,WAAW,CAAC,CAAC;AAE3D,OAAO,WAAW,MAAM,6CAA6C,CAAC;AACtE,WAAW,CAAC,kCAAkC,EAAE,WAAW,CAAC,CAAC;AAE7D,OAAO,WAAW,MAAM,qDAAqD,CAAC;AAC9E,WAAW,CAAC,0CAA0C,EAAE,WAAW,CAAC,CAAC;AAErE,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAChE,WAAW,CAAC,4BAA4B,EAAE,WAAW,CAAC,CAAC;AAEvD,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAC3D,WAAW,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC;AAElD,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAC7D,WAAW,CAAC,yBAAyB,EAAE,WAAW,CAAC,CAAC;AAEpD,OAAO,WAAW,MAAM,iDAAiD,CAAC;AAC1E,WAAW,CAAC,sCAAsC,EAAE,WAAW,CAAC,CAAC;AAEjE,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,WAAW,CAAC,6BAA6B,EAAE,WAAW,CAAC,CAAC;AAExD,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,WAAW,CAAC,0BAA0B,EAAE,WAAW,CAAC,CAAC;AAErD,OAAO,WAAW,MAAM,4CAA4C,CAAC;AACrE,WAAW,CAAC,iCAAiC,EAAE,WAAW,CAAC,CAAC;AAE5D,OAAO,WAAW,MAAM,yCAAyC,CAAC;AAClE,WAAW,CAAC,8BAA8B,EAAE,WAAW,CAAC,CAAC;AAEzD,OAAO,WAAW,MAAM,4CAA4C,CAAC;AACrE,WAAW,CAAC,iCAAiC,EAAE,WAAW,CAAC,CAAC;AAE5D,OAAO,WAAW,MAAM,+CAA+C,CAAC;AACxE,WAAW,CAAC,oCAAoC,EAAE,WAAW,CAAC,CAAC;AAE/D,OAAO,WAAW,MAAM,mCAAmC,CAAC;AAC5D,WAAW,CAAC,wBAAwB,EAAE,WAAW,CAAC,CAAC;AAEnD,OAAO,WAAW,MAAM,8CAA8C,CAAC;AACvE,WAAW,CAAC,mCAAmC,EAAE,WAAW,CAAC,CAAC\"}","code":"import { registerDef } from 'scilla';\r\nimport component0 from 'components/renderer/TextRenderer';\r\nregisterDef('components/renderer/TextRenderer', component0);\r\nimport component1 from 'components/base/Transform';\r\nregisterDef('components/base/Transform', component1);\r\nimport component2 from 'components/renderer/HtmlRenderer';\r\nregisterDef('components/renderer/HtmlRenderer', component2);\r\nimport component3 from 'components/base/TouchInterrupt';\r\nregisterDef('components/base/TouchInterrupt', component3);\r\nimport component4 from 'components/other/FullStageSize';\r\nregisterDef('components/other/FullStageSize', component4);\r\nimport component5 from 'components/other/CameraController';\r\nregisterDef('components/other/CameraController', component5);\r\nimport component6 from 'components/ui/Button';\r\nregisterDef('components/ui/Button', component6);\r\nimport component7 from 'components/animation/TouchZoom';\r\nregisterDef('components/animation/TouchZoom', component7);\r\nimport component8 from 'components/renderer/RectRenderer';\r\nregisterDef('components/renderer/RectRenderer', component8);\r\nimport component9 from 'components/renderer/TextureRenderer';\r\nregisterDef('components/renderer/TextureRenderer', component9);\r\nimport component10 from '../../assets/scripts/dialogs/RuleDialogContent';\r\nregisterDef('./scripts/dialogs/RuleDialogContent', component10);\r\nimport component11 from '../../assets/scripts/api/SamplePollingApi';\r\nregisterDef('./scripts/api/SamplePollingApi', component11);\r\nimport component12 from '../../assets/scripts/scenes/SceneController';\r\nregisterDef('./scripts/scenes/SceneController', component12);\r\nimport component13 from '../../assets/scripts/navigator/SingleSceneNavigator';\r\nregisterDef('./scripts/navigator/SingleSceneNavigator', component13);\r\nimport component14 from '../../assets/scripts/scenes/ScenePlay';\r\nregisterDef('./scripts/scenes/ScenePlay', component14);\r\nimport component15 from '../../assets/scripts/popup/Popup';\r\nregisterDef('./scripts/popup/Popup', component15);\r\nimport component16 from '../../assets/scripts/api/SampleApi';\r\nregisterDef('./scripts/api/SampleApi', component16);\r\nimport component17 from '../../assets/scripts/dialogs/AlertDialogContent';\r\nregisterDef('./scripts/dialogs/AlertDialogContent', component17);\r\nimport component18 from '../../assets/scripts/scenes/SceneStart';\r\nregisterDef('./scripts/scenes/SceneStart', component18);\r\nimport component19 from '../../assets/scripts/MainController';\r\nregisterDef('./scripts/MainController', component19);\r\nimport component20 from '../../assets/scripts/dialogs/GameOverPanel';\r\nregisterDef('./scripts/dialogs/GameOverPanel', component20);\r\nimport component21 from '../../assets/scripts/common/BuriedPoint';\r\nregisterDef('./scripts/common/BuriedPoint', component21);\r\nimport component22 from '../../assets/scripts/dialogs/GameLosePanel';\r\nregisterDef('./scripts/dialogs/GameLosePanel', component22);\r\nimport component23 from '../../assets/scripts/dialogs/GameNoPrizePanel';\r\nregisterDef('./scripts/dialogs/GameNoPrizePanel', component23);\r\nimport component24 from '../../assets/scripts/common/Toast';\r\nregisterDef('./scripts/common/Toast', component24);\r\nimport component25 from '../../assets/scripts/game/CustomTextRenderer';\r\nregisterDef('./scripts/game/CustomTextRenderer', component25);\r\n//# sourceMappingURL=MustCompile.js.map"}
{"map":"{\"version\":3,\"file\":\"AlertDialogContent.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../assets/scripts/dialogs/AlertDialogContent.ts\"],\"names\":[],\"mappings\":\";AAMA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD;IAAgD,8CAAa;IAA7D;QAAA,qEA2BC;QAPA,UAAI,GAAG,UAAC,IAAK,EAAE,QAAS;YACvB,KAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,KAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC/D,CAAC,CAAA;;IAKF,CAAC;IApBA,oCAAO,GAAP;QACC,iBAAM,OAAO,WAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAClE,CAAC;IAED,kCAAK,GAAL,UAAM,IAAc;QAAd,qBAAA,EAAA,SAAc;QACnB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACjB,IAAI,CAAC,IAAI,GAAC,IAAI,CAAA;QACd,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAEtB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,GAAC,IAAI,CAAC,IAAI,CAAA;IACzC,CAAC;IAMD,iDAAoB,GAApB;QACC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrB,CAAC;IACF,yBAAC;AAAD,CAAC,AA3BD,CAAgD,aAAa,GA2B5D\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport DialogContent from \"../popup/DialogContent\";\r\nimport { TextRenderer } from \"scilla-components/src\";\r\nvar AlertDialogContent = (function (_super) {\r\n tslib_1.__extends(AlertDialogContent, _super);\r\n function AlertDialogContent() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.show = function (data, callback) {\r\n _this.bubbling('showDialog', _this.entity.name, data, callback);\r\n };\r\n return _this;\r\n }\r\n AlertDialogContent.prototype.onAwake = function () {\r\n _super.prototype.onAwake.call(this);\r\n this.text[\"TextRenderer\"] = this.text.getComponent(TextRenderer);\r\n };\r\n AlertDialogContent.prototype.setup = function (data) {\r\n if (data === void 0) { data = {}; }\r\n console.log(data);\r\n this.data = data;\r\n console.log(this.text);\r\n this.text[\"TextRenderer\"].text = this.data;\r\n };\r\n AlertDialogContent.prototype.onClickConfirmButton = function () {\r\n this.hide('confirm');\r\n };\r\n return AlertDialogContent;\r\n}(DialogContent));\r\nexport default AlertDialogContent;\r\n//# sourceMappingURL=AlertDialogContent.js.map"}
{"map":"{\"version\":3,\"file\":\"MainController.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../assets/scripts/MainController.ts\"],\"names\":[],\"mappings\":\";AAAA,OAAO,eAAe,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAW,MAAM,EAAU,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,MAAM,gBAAgB,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,MAAM,eAAe,CAAC;AAElC;IAA4C,0CAAe;IAA3D;;IAuFA,CAAC;IA3EA,gCAAO,GAAP;QACC,iBAAM,OAAO,WAAE,CAAC;QAEhB,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAE5C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAE7C,OAAO,EAAE,CAAC;QAEV,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IAChG,CAAC;IAED,yCAAgB,GAAhB;QACC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IACjC,CAAC;IAED,8CAAqB,GAArB,UAAsB,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAehB,CAAC;IAED,uCAAc,GAAd,UAAe,CAAC;IAUhB,CAAC;IAED,kCAAS,GAAT,UAAU,OAAO,EAAE,QAAS;QAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAChB,OAAO,SAAA;YACP,QAAQ,UAAA;SACR,CAAC,CAAA;IACH,CAAC;IAED,mCAAU,GAAV,UAAW,IAAI,EAAE,IAAK,EAAE,QAAS;QAChC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,qCAAY,GAAZ,UAAa,MAAO;IAgBpB,CAAC;IACF,qBAAC;AAAD,CAAC,AAvFD,CAA4C,eAAe,GAuF1D\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport ScillaComponent from \"scilla-components/src/base/ScillaComponent\";\r\nimport { engine } from \"scilla/src\";\r\nimport Toast from \"./common/Toast\";\r\nimport { initEnv } from \"./common/BuriedPoint\";\r\nimport Popup from \"./popup/Popup\";\r\nvar MainController = (function (_super) {\r\n tslib_1.__extends(MainController, _super);\r\n function MainController() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MainController.prototype.onAwake = function () {\r\n _super.prototype.onAwake.call(this);\r\n engine.dataCenter.set('CFG', window['CFG']);\r\n this._toast = this.Toast.getComponent(Toast);\r\n this._popup = this.Popup.getComponent(Popup);\r\n initEnv();\r\n this.broadcast('callApi', 1, 'ajaxElement', { duibaId: this.hdToolId, activityId: this.actId });\r\n };\r\n MainController.prototype.onGotAjaxElement = function () {\r\n this.broadcast('initGameStage');\r\n };\r\n MainController.prototype.onGotAjaxElementError = function (e) {\r\n console.log(e);\r\n };\r\n MainController.prototype.showErrorToast = function (e) {\r\n };\r\n MainController.prototype.showToast = function (content, duration) {\r\n this._toast.show({\r\n content: content,\r\n duration: duration,\r\n });\r\n };\r\n MainController.prototype.showDialog = function (name, data, callback) {\r\n this._popup.showDialog(name, data, callback);\r\n };\r\n MainController.prototype.showNetError = function (action) {\r\n };\r\n return MainController;\r\n}(ScillaComponent));\r\nexport default MainController;\r\n//# sourceMappingURL=MainController.js.map"}
{"map":"{\"version\":3,\"file\":\"GameNoPrizePanel.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../assets/scripts/dialogs/GameNoPrizePanel.ts\"],\"names\":[],\"mappings\":\";AAAA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AAEnD;IAA8C,4CAAa;IAA3D;;IAOA,CAAC;IANA,kCAAO,GAAP;QACC,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IACD,2CAAgB,GAAhB;QACC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IACxC,CAAC;IACF,uBAAC;AAAD,CAAC,AAPD,CAA8C,aAAa,GAO1D\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport DialogContent from '../popup/DialogContent';\r\nvar GameNoPrizePanel = (function (_super) {\r\n tslib_1.__extends(GameNoPrizePanel, _super);\r\n function GameNoPrizePanel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GameNoPrizePanel.prototype.onAwake = function () {\r\n _super.prototype.onAwake.call(this);\r\n };\r\n GameNoPrizePanel.prototype.onclick_againBtn = function () {\r\n this.bubbling('fuckNavigator', 'start');\r\n };\r\n return GameNoPrizePanel;\r\n}(DialogContent));\r\nexport default GameNoPrizePanel;\r\n//# sourceMappingURL=GameNoPrizePanel.js.map"}
{"map":"{\"version\":3,\"file\":\"main.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/main.ts\"],\"names\":[],\"mappings\":\";AAMA,OAAO,EAAC,kBAAkB,EAAC,MAAM,YAAY,CAAA;AAC7C,OAAO,cAAc,MAAM,qBAAqB,CAAA;AAChD,OAAO,yBAAyB,CAAA;AAEhC,IAAI,QAAwB,CAAC;AAE7B,kBAAkB,CAAC;IAClB,eAAe,EAAE,GAAG;IACpB,aAAa,EAAE,KAAK;IACpB,uBAAuB,EAAE,KAAK;IAC9B,yBAAyB,EAAE,KAAK;IAChC,cAAc,EAAE,KAAK;CACrB,CAAC,CAAC;AAEH,MAAM,UAAgB,OAAO,CAAC,gBAAgB,EAAE,OAAiB,EAAE,UAAoB;IAAvC,wBAAA,EAAA,YAAiB;;;;;oBAChE,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;oBAChC,WAAM,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,EAAE,UAAU,CAAC,EAAA;;oBAA5D,SAA4D,CAAC;;;;;CAC7D\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport { modifyEngineConfig } from 'scilla/src';\r\nimport ScillaLauncher from 'scilla-launcher/src';\r\nimport './generated/MustCompile';\r\nvar launcher;\r\nmodifyEngineConfig({\r\n lineHeightRatio: 1.2,\r\n entityEnabled: false,\r\n awakeComponentWhenAdded: false,\r\n sleepComponentWhenRemoved: false,\r\n drawRenderRect: false,\r\n});\r\nexport function startup(containerElement, options, onProgress) {\r\n if (options === void 0) { options = {}; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n launcher = new ScillaLauncher();\r\n return [4, launcher.launch(containerElement, options, onProgress)];\r\n case 1:\r\n _a.sent();\r\n return [2];\r\n }\r\n });\r\n });\r\n}\r\n//# sourceMappingURL=main.js.map"}
[{"flatMessage":"Property 'onGlobalTouchBegin' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '(e: any) => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.","formatted":"\u001b[96massets/scripts/scenes/ScenePlay.ts\u001b[0m:\u001b[93m389\u001b[0m:\u001b[93m2\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2416: \u001b[0mProperty 'onGlobalTouchBegin' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '(e: any) => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.\n\n\u001b[7m389\u001b[0m onGlobalTouchBegin(e){\n\u001b[7m \u001b[0m \u001b[91m ~~~~~~~~~~~~~~~~~~\u001b[0m\n\u001b[96massets/scripts/scenes/ScenePlay.ts\u001b[0m:\u001b[93m399\u001b[0m:\u001b[93m2\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2416: \u001b[0mProperty 'onGlobalTouchEnd' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '(e: any) => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.\n\n\u001b[7m399\u001b[0m onGlobalTouchEnd(e){\n\u001b[7m \u001b[0m \u001b[91m ~~~~~~~~~~~~~~~~\u001b[0m\n\u001b[96massets/scripts/scenes/ScenePlay.ts\u001b[0m:\u001b[93m414\u001b[0m:\u001b[93m2\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2416: \u001b[0mProperty 'onGlobalTouchMove' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '() => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.\n\n\u001b[7m414\u001b[0m onGlobalTouchMove(){\n\u001b[7m \u001b[0m \u001b[91m ~~~~~~~~~~~~~~~~~\u001b[0m\n","category":1,"code":2416,"type":"semantic","fileLine":"/Users/renjianfeng/Desktop/web/scilla-project/wwjsjf-20190619/assets/scripts/scenes/ScenePlay.ts(389,2)"},{"flatMessage":"Property 'onGlobalTouchEnd' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '(e: any) => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.","formatted":"\u001b[96massets/scripts/scenes/ScenePlay.ts\u001b[0m:\u001b[93m389\u001b[0m:\u001b[93m2\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2416: \u001b[0mProperty 'onGlobalTouchBegin' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '(e: any) => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.\n\n\u001b[7m389\u001b[0m onGlobalTouchBegin(e){\n\u001b[7m \u001b[0m \u001b[91m ~~~~~~~~~~~~~~~~~~\u001b[0m\n\u001b[96massets/scripts/scenes/ScenePlay.ts\u001b[0m:\u001b[93m399\u001b[0m:\u001b[93m2\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2416: \u001b[0mProperty 'onGlobalTouchEnd' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '(e: any) => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.\n\n\u001b[7m399\u001b[0m onGlobalTouchEnd(e){\n\u001b[7m \u001b[0m \u001b[91m ~~~~~~~~~~~~~~~~\u001b[0m\n\u001b[96massets/scripts/scenes/ScenePlay.ts\u001b[0m:\u001b[93m414\u001b[0m:\u001b[93m2\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2416: \u001b[0mProperty 'onGlobalTouchMove' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '() => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.\n\n\u001b[7m414\u001b[0m onGlobalTouchMove(){\n\u001b[7m \u001b[0m \u001b[91m ~~~~~~~~~~~~~~~~~\u001b[0m\n","category":1,"code":2416,"type":"semantic","fileLine":"/Users/renjianfeng/Desktop/web/scilla-project/wwjsjf-20190619/assets/scripts/scenes/ScenePlay.ts(399,2)"},{"flatMessage":"Property 'onGlobalTouchMove' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '() => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.","formatted":"\u001b[96massets/scripts/scenes/ScenePlay.ts\u001b[0m:\u001b[93m389\u001b[0m:\u001b[93m2\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2416: \u001b[0mProperty 'onGlobalTouchBegin' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '(e: any) => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.\n\n\u001b[7m389\u001b[0m onGlobalTouchBegin(e){\n\u001b[7m \u001b[0m \u001b[91m ~~~~~~~~~~~~~~~~~~\u001b[0m\n\u001b[96massets/scripts/scenes/ScenePlay.ts\u001b[0m:\u001b[93m399\u001b[0m:\u001b[93m2\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2416: \u001b[0mProperty 'onGlobalTouchEnd' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '(e: any) => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.\n\n\u001b[7m399\u001b[0m onGlobalTouchEnd(e){\n\u001b[7m \u001b[0m \u001b[91m ~~~~~~~~~~~~~~~~\u001b[0m\n\u001b[96massets/scripts/scenes/ScenePlay.ts\u001b[0m:\u001b[93m414\u001b[0m:\u001b[93m2\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2416: \u001b[0mProperty 'onGlobalTouchMove' in type 'ScenePlay' is not assignable to the same property in base type 'InteractComponent'.\n Type '() => void' is not assignable to type '(e: any) => boolean'.\n Type 'void' is not assignable to type 'boolean'.\n\n\u001b[7m414\u001b[0m onGlobalTouchMove(){\n\u001b[7m \u001b[0m \u001b[91m ~~~~~~~~~~~~~~~~~\u001b[0m\n","category":1,"code":2416,"type":"semantic","fileLine":"/Users/renjianfeng/Desktop/web/scilla-project/wwjsjf-20190619/assets/scripts/scenes/ScenePlay.ts(414,2)"}]
This diff is collapsed.
......@@ -8,7 +8,7 @@ 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 { Transform, Button } from 'scilla-components/src';
import {createTween, ease} from "scilla";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
......@@ -26,6 +26,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
pingzi_1: Entity;
pingzi_2: Entity;
gouzi_pingzi: Entity;
loading: Entity;
private startBtnAnimation;
......@@ -36,16 +37,20 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
pingzi_1Transform:Transform;
pingzi_2Transform:Transform;
gouzi_pingziTransform:Transform;
loadingTransform:Transform;
startBtnButton:Button;
onAwake() {
super.onAwake();
this.setCountText('');
this.startBtnAnimation = this.startbtn.getComponent(Transform);
this.startBtnButton = this.startbtn.getComponent(Button);
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.loadingTransform = this.loading.getComponent(Transform);
this.grabState=false;
this.hasPrize=false;
......@@ -84,6 +89,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
.set({position: {x: -110}})
.to({position: {x: 110}},1000)
.call(()=>{
this.setVisible(this.loadingTransform,false)
//console.log(`2`)
if(this.grabState){
this.grabState=false;
......@@ -119,12 +125,23 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
this.setVisible(this.loadingTransform,false)
//console.log(sd)
//.call(resolve);
}
//是否隐藏对象
setVisible(obj,state){
if(state){
obj.alpha=1;
//obj.enabled=true;
}else{
obj.alpha=0;
//obj.enabled=false;
}
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
......@@ -175,6 +192,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
hasGraDo(){
this.startBtnButton.enabled=true;
if(this.getOrderStatus.code == "C000000001"){
this.bubbling('showDialog', 'Alert',"查询超时,请点击首页【奖品】按钮查看。");
}
......@@ -196,6 +214,8 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
onClick_startbtn() {
/* this.grabState=true;
this.hasPrize=true; */
this.setVisible(this.loadingTransform,true)
this.startBtnButton.enabled=false;
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
......
assets/singles/alert/Bitmap-1.png

2.43 KB | W: | H:

assets/singles/alert/Bitmap-1.png

61.1 KB | W: | H:

assets/singles/alert/Bitmap-1.png
assets/singles/alert/Bitmap-1.png
assets/singles/alert/Bitmap-1.png
assets/singles/alert/Bitmap-1.png
  • 2-up
  • Swipe
  • Onion skin
assets/singles/alert/Bitmap-4.png

2.53 KB | W: | H:

assets/singles/alert/Bitmap-4.png

918 Bytes | W: | H:

assets/singles/alert/Bitmap-4.png
assets/singles/alert/Bitmap-4.png
assets/singles/alert/Bitmap-4.png
assets/singles/alert/Bitmap-4.png
  • 2-up
  • Swipe
  • Onion skin
assets/singles/dialog-bg.png

27 KB | W: | H:

assets/singles/dialog-bg.png

61.1 KB | W: | H:

assets/singles/dialog-bg.png
assets/singles/dialog-bg.png
assets/singles/dialog-bg.png
assets/singles/dialog-bg.png
  • 2-up
  • Swipe
  • Onion skin
assets/singles/prize_panel/closeBtn.png

1.29 KB | W: | H:

assets/singles/prize_panel/closeBtn.png

918 Bytes | W: | H:

assets/singles/prize_panel/closeBtn.png
assets/singles/prize_panel/closeBtn.png
assets/singles/prize_panel/closeBtn.png
assets/singles/prize_panel/closeBtn.png
  • 2-up
  • Swipe
  • Onion skin
assets/singles/rule_panel/ruleBg.png

44.9 KB | W: | H:

assets/singles/rule_panel/ruleBg.png

142 KB | W: | H:

assets/singles/rule_panel/ruleBg.png
assets/singles/rule_panel/ruleBg.png
assets/singles/rule_panel/ruleBg.png
assets/singles/rule_panel/ruleBg.png
  • 2-up
  • Swipe
  • Onion skin
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