92 lines
2.2 KiB
JavaScript
92 lines
2.2 KiB
JavaScript
|
|
const ItemBase = require( "cmp.item.base" );
|
||
|
|
const ActMod = require( "act.sign30.mod" );
|
||
|
|
|
||
|
|
|
||
|
|
cc.Class({
|
||
|
|
extends: ItemBase,
|
||
|
|
|
||
|
|
properties: {
|
||
|
|
nodGot: {default:null, type: cc.Node},
|
||
|
|
},
|
||
|
|
|
||
|
|
// 数据重置
|
||
|
|
setData: function( _data ) {
|
||
|
|
|
||
|
|
this._super( _data );
|
||
|
|
|
||
|
|
// 刷新
|
||
|
|
this.setStaus( -1, false );
|
||
|
|
// nx.gui.setActive( this.nodGot, "", false );
|
||
|
|
// nx.gui.setActive( this, "again", false );
|
||
|
|
// nx.gui.setActive( this, "get", false );
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
// 单设:品质
|
||
|
|
setQuality: function( _qa ) {
|
||
|
|
|
||
|
|
if ( this.nodBG ) {
|
||
|
|
let qa = null;
|
||
|
|
if ( nx.dt.numPositive( _qa ) ) {
|
||
|
|
qa = cc.path.join( "coms/images", "bg_qa" + _qa );
|
||
|
|
}
|
||
|
|
|
||
|
|
nx.gui.setSpriteFrame( this.nodBG, "", qa );
|
||
|
|
if( !qa ){
|
||
|
|
nx.gui.getComponent( this.nodBG, "", cc.Sprite ).curKey = "";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
setStaus: function( _status, _state ){
|
||
|
|
|
||
|
|
nx.gui.setActive( this.nodGot, "", _status == 2 );
|
||
|
|
nx.gui.setActive( this, "again", _status == 1 );
|
||
|
|
nx.gui.setActive( this, "get", _status == 0 );
|
||
|
|
nx.gui.setActive( this, "again/tip", _state );
|
||
|
|
},
|
||
|
|
|
||
|
|
// 聚焦获得
|
||
|
|
onFocus: function(){
|
||
|
|
nx.gui.setActive( this.nodFocus,"", true );
|
||
|
|
if( nx.bridge.plot && nx.bridge.plot.isDoing() && this.index == 0 && nx.dt.strEmpty( this.nodFocus.getComponent( "cmp.plot.trigger" ).pID ) ){
|
||
|
|
// this.nodFocus.getComponent( "cmp.plot.trigger" ).pID = "sign";
|
||
|
|
// this.nodFocus.getComponent( "cmp.plot.trigger" ).regist();
|
||
|
|
}
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
// 聚焦失去
|
||
|
|
outFocus: function(){
|
||
|
|
nx.gui.setActive( this.nodFocus,"", false );
|
||
|
|
},
|
||
|
|
|
||
|
|
setFun: function( _cb ){
|
||
|
|
this.cb = _cb;
|
||
|
|
},
|
||
|
|
|
||
|
|
setAgainFun: function( _cb ){
|
||
|
|
this.acb = _cb;
|
||
|
|
},
|
||
|
|
|
||
|
|
onTouchSign: function(){
|
||
|
|
|
||
|
|
nx.dt.fnInvoke( this.cb );
|
||
|
|
// let AC = ActMod.getInstance();
|
||
|
|
// if( AC ){
|
||
|
|
// AC.reqSign();
|
||
|
|
// }
|
||
|
|
},
|
||
|
|
|
||
|
|
onTouchAgain: function(){
|
||
|
|
|
||
|
|
nx.dt.fnInvoke( this.acb );
|
||
|
|
// let AC = ActMod.getInstance();
|
||
|
|
// if( AC ){
|
||
|
|
// AC.reqSign();
|
||
|
|
// }
|
||
|
|
},
|
||
|
|
|
||
|
|
});
|