73 lines
2.2 KiB
JavaScript
73 lines
2.2 KiB
JavaScript
const SVCItem = require("nx.fx.sv.expand.item");
|
|
const { data2Icon } = require( "bridge.utils.item" );
|
|
|
|
|
|
cc.Class({
|
|
|
|
extends: SVCItem,
|
|
|
|
properties: {
|
|
|
|
},
|
|
|
|
// 数据重置
|
|
rebind: function (_idx, _data, _key) {
|
|
|
|
this._super(_idx, _data, _key);
|
|
|
|
this.freshInfo();
|
|
},
|
|
|
|
// 刷新具体信息
|
|
freshInfo:function(){
|
|
|
|
if( !this.mdata ){
|
|
return;
|
|
}
|
|
let ifg = data2Icon( this.mdata.face_id );
|
|
let showIdcon = ifg.icon;
|
|
nx.bridge.setIcon( this, "header", showIdcon );
|
|
let idpath = ( "prefab/acts/collect/ui/bg_" + this.mdata.quality );
|
|
nx.gui.setSpriteFrame( this, "bg", idpath );
|
|
|
|
nx.gui.setString( this, "ico/txt", nx.text.format( "MustTip", this.mdata.must ) );
|
|
nx.gui.setActive( this, "ico", this.mdata.is_show != 0 );
|
|
|
|
nx.bridge.setIcon( this, "get/header", showIdcon );
|
|
let path = ( "prefab/acts/collect/ui/bg_0" + this.mdata.quality );
|
|
|
|
nx.gui.setSpriteFrame( this, "get/bg", path );
|
|
nx.gui.setActive( this, "get", this.mdata.status != 0 );
|
|
nx.gui.setActive( this, "ico", this.mdata.status == 0 && this.mdata.is_show == 1 );
|
|
|
|
let spine = nx.gui.getComponent( this, "bgspine", "nx.fx.spine" );
|
|
let spinepath = "";
|
|
switch( this.mdata.quality ){
|
|
case 2 : { spinepath = "resDB/effects/E90906/action" };break;
|
|
case 3 : { spinepath = "resDB/effects/E90907/action" };break;
|
|
case 4 : { spinepath = "resDB/effects/E90908/action" };break;
|
|
case 5 : { spinepath = "resDB/effects/E90909/action" };break;
|
|
}
|
|
|
|
if( spine ){
|
|
spine.load( spinepath, ( _e ) => {
|
|
if( !_e ) {
|
|
spine.action( "action", true, ( _event ) => {
|
|
});
|
|
} else {
|
|
spine.stop();
|
|
}
|
|
} );
|
|
}
|
|
|
|
nx.gui.setActive( this, "bgspine", this.mdata.status == 0 );
|
|
nx.gui.setActive( this, "focus", false );
|
|
// nx.tween.fadeOut( this, "focus", 0.01 );
|
|
nx.gui.setActive( this, "itemnormal", false );
|
|
nx.gui.setActive( this, "item", false );
|
|
},
|
|
|
|
|
|
|
|
});
|