43 lines
841 B
JavaScript
43 lines
841 B
JavaScript
var gameConfig = require("gameConfig");
|
|
var Utils = require("Utils");
|
|
cc.Class({
|
|
extends: cc.Component,
|
|
|
|
properties: {
|
|
nd_notget: {
|
|
default: null,
|
|
type: cc.Node,
|
|
},
|
|
nd_buy: {
|
|
default: null,
|
|
type: cc.Node,
|
|
},
|
|
sp_icon: {
|
|
default: null,
|
|
type: cc.Sprite,
|
|
},
|
|
},
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
// onLoad () {},
|
|
|
|
start() {},
|
|
initdata(v) {
|
|
this.skinid = v;
|
|
Utils.setitem(this, v, this.sp_icon);
|
|
this.refresh();
|
|
},
|
|
refresh() {
|
|
this.nd_notget.active = !cc.playerData.checkhasgetskin(this.skinid);
|
|
this.nd_buy.active = this.nd_notget.active;
|
|
},
|
|
onclickbuy() {
|
|
cc.Notifier.emit("buyitem", this.skinid);
|
|
},
|
|
onclickshow() {
|
|
cc.Notifier.emit("infochangeskin", this.skinid);
|
|
},
|
|
// update (dt) {},
|
|
});
|