59 lines
1.5 KiB
JavaScript
59 lines
1.5 KiB
JavaScript
|
|
const ItemBase = require( "cmp.item.base" );
|
|
const TipsController = require( "tips_controller" );
|
|
|
|
|
|
cc.Class( {
|
|
|
|
extends: ItemBase,
|
|
|
|
properties: {
|
|
|
|
},
|
|
|
|
// 重置
|
|
setData: function( _data ) {
|
|
|
|
if( !_data ) {
|
|
this.setEmpty();
|
|
return;
|
|
}
|
|
|
|
this._super( _data.base_id, _data.count );
|
|
this.setRate( _data.rate );
|
|
},
|
|
|
|
// 单设:概率
|
|
setRate: function( _rate ) {
|
|
nx.gui.setString( this, "rates/txt", _rate + "%" );
|
|
},
|
|
|
|
onTouchShowInfo: function(){
|
|
|
|
|
|
let item = gdata("item_data", "data_unit6", this.info.item_id );
|
|
// console.log( "相關顯示" + JSON.stringify( item ) );
|
|
|
|
|
|
if( nx.dt.arrNEmpty( item.effect ) ){
|
|
let item_id = item.effect[0].val;
|
|
let star = this.info.eqm_jie;
|
|
let key = item_id + "_" + star;
|
|
// let key = this.info.item_id + "_" + this.info.eqm_jie;
|
|
this.propsData = gdata("partner_data", "data_partner_show", key );
|
|
// this.propsData.bid = this.info.item_id;
|
|
this.propsData.star = star;
|
|
|
|
this.propsData.break_lev = 0;
|
|
TipsController.getInstance().showPartnerTips( this.propsData );
|
|
// console.log(JSON.stringify( nod.info ) + "数据" + JSON.stringify( nod.mdata ) );
|
|
}else{
|
|
TipsController.getInstance().showItemTips( this.info.item_id );
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
} );
|