64 lines
1.5 KiB
JavaScript
64 lines
1.5 KiB
JavaScript
/******************************************************************
|
|
*
|
|
* 伙伴图标
|
|
*
|
|
******************************************************************/
|
|
|
|
const ItemBase = require( "cmp.item.base" );
|
|
const TipsController = require( "tips_controller" );
|
|
|
|
cc.Class( {
|
|
|
|
extends: ItemBase,
|
|
|
|
properties: {},
|
|
|
|
// 重载:刷新
|
|
freshAll: function() {
|
|
|
|
this._super();
|
|
|
|
if( !this.info ) {
|
|
return;
|
|
}
|
|
|
|
// SSR流光
|
|
nx.gui.setActive( this, "ssr", this.info.quality >= 4 );
|
|
|
|
// 品质图标
|
|
if( this.info.quality == 1 ) {
|
|
nx.gui.setSpriteFrame( this, "qaIcon", null );
|
|
nx.gui.setActive( this, "qaIcon/spine", false );
|
|
} else if ( this.info.quality == 5 ) {
|
|
nx.gui.setSpriteFrame( this, "qaIcon", null );
|
|
nx.gui.setActive( this, "qaIcon/spine", true );
|
|
} else {
|
|
let file = cc.path.join( "coms/images", "mk_sqa" + this.info.quality );
|
|
nx.gui.setSpriteFrame( this, "qaIcon", file );
|
|
nx.gui.setActive( this, "qaIcon/spine", false );
|
|
}
|
|
|
|
},
|
|
|
|
// 置空
|
|
setEmpty: function() {
|
|
|
|
this._super();
|
|
},
|
|
|
|
// 点击
|
|
onTouchTip: function() {
|
|
|
|
if( !this.info ) {
|
|
return;
|
|
}
|
|
|
|
let key = this.info.bid + "_" + this.info.stars;
|
|
let propsData = gdata( "partner_data", "data_partner_show", key );
|
|
propsData.star = this.info.stars;
|
|
propsData.break_lev = 0;
|
|
TipsController.getInstance().showPartnerTips( propsData );
|
|
},
|
|
|
|
} );
|