80 lines
1.8 KiB
JavaScript
80 lines
1.8 KiB
JavaScript
/******************************************************************
|
|
*
|
|
* 同步完成弹窗
|
|
*
|
|
******************************************************************/
|
|
|
|
const BridgeWindow = require( "bridge.window" );
|
|
|
|
const FxSpine = require( "nx.fx.spine" );
|
|
const CmpItem = require( "cmp.item.inbag" );
|
|
|
|
cc.Class( {
|
|
|
|
extends: BridgeWindow,
|
|
|
|
properties: {
|
|
|
|
spAnim: { default: null, type: FxSpine },
|
|
cmpItem: { default: null, type: CmpItem },
|
|
nodLevel: { default: null, type: cc.Node },
|
|
|
|
},
|
|
|
|
// 重载:参数打开
|
|
onOpenConfigs: function( _params ) {
|
|
|
|
this.partner = _params;
|
|
|
|
let tf = nx.text.format( "LvNumber", this.partner.resonate_lev );
|
|
let tt = nx.text.format( "LvNumber", this.partner.lev );
|
|
|
|
// 等级信息
|
|
nx.gui.setString( this.nodLevel, "from", tf );
|
|
nx.gui.setString( this.nodLevel, "to", tt );
|
|
|
|
// 目标伙伴
|
|
this.cmpItem.setData( this.partner );
|
|
|
|
// 第一阶段
|
|
this.doStep1();
|
|
|
|
},
|
|
|
|
// 第一阶段
|
|
doStep1: function() {
|
|
|
|
nx.gui.setActive( this, "panel/touch", false );
|
|
nx.gui.setOpacity( this, "panel/infos", 0 );
|
|
|
|
this.spAnim.action( "action", false, ( _key, _name ) => {
|
|
console.log( _key, _name );
|
|
|
|
if( _key == "reward" ) {
|
|
nx.tween.fadeIn( this, "panel/infos", 0.3 );
|
|
return;
|
|
}
|
|
|
|
if( _key == "complete" ) {
|
|
this.doStep2();
|
|
return;
|
|
}
|
|
|
|
} );
|
|
|
|
},
|
|
|
|
// 第二阶段
|
|
doStep2: function() {
|
|
|
|
this.spAnim.action( "action2", true );
|
|
|
|
this.scheduleOnce( () => {
|
|
let node = nx.gui.setActive( this, "panel/touch", true );
|
|
nx.tween.fadeIn( node, "", 0.5 );
|
|
}, 0.5 );
|
|
|
|
},
|
|
|
|
} );
|