/****************************************************************** * * 装备更换弹窗 * ******************************************************************/ const BridgeWindow = require( "bridge.window" ); const ItemDesc = require( "cmp.item.detail" ); const BackPackConst = require( "backpack_const" ); const TipsController = require("tips_controller"); const BIT = BackPackConst.item_type; cc.Class( { extends: BridgeWindow, properties: { itemDesc: { default: null, type: ItemDesc, displayName: "道具详情" }, nodOps: { default: null, type: cc.Node, displayName: "操作组" }, }, // 重载:参数打开 onOpenConfigs: function( _params ) { let initparams = _params; this.bid = _params.data.config ? _params.data.config.id : _params.data.base_id ; let type = _params.data.config ? _params.data.config.type : 0; let noop = _params.data.noop; let show = {}; if( noop ){ nx.gui.setActive( this.nodOps, "" , false ); show = BackPackConst.uniformData( _params.data.base_id ); show.extra = initparams.data.extra; }else{ show = initparams.data; if( type == BIT.ARTIFACTCHIPS ){ nx.gui.setActive( this.nodOps, "refinement" , true ); }else if( ( type == BIT.GOD_EARRING || type == BIT.GOD_RING || type == BIT.GOD_NECKLACE || type == BIT.GOD_BANGLE ) && _params.data ){ nx.gui.setActive( this.nodOps, "refinement" , !nx.dt.arrEmpty( _params.data.holy_eqm_attr ) && _params.data.config.eqm_jie >= 1 ); }else{ nx.gui.setActive( this.nodOps, "refinement" , false ); } nx.gui.setActive( this.nodOps, "" , true ); } console.log( "当前的数据显示相关" + JSON.stringify( show ) ); // if( _params.data. ) this.cb = _params.cb ? _params.cb : "" ; this.itemDesc.setData( show, "partner" ); }, // 点击更换 onTouchChange: function() { nx.dt.fnInvoke( this.cb, "change", this ); }, // 点击脱下 onTouchTakeOff: function() { nx.dt.fnInvoke( this.cb, "takeoff", this ); }, // 点击脱下 onTouchRefinement: function() { nx.dt.fnInvoke( this.cb, "refinement", this ); }, onTouchRandom: function(){ let TC = TipsController.getInstance(); if( TC ){ TC.showItemRandomTips( true, this.bid ); } } } );