var HeadIcon = require("HeadIcon") cc.Class({ extends: cc.Component, properties: { imageAdd: { default: null, type: cc.Sprite, serializable: true, }, imageGold: { default: null, type: cc.Sprite, serializable: true, }, nodeStatusMask: { default: null, type: cc.Node, serializable: true, }, textGold: { default: null, type: cc.Label, serializable: true, }, textName: { default: null, type: cc.Label, serializable: true, }, headIcon: { default: null, type: HeadIcon, serializable: true, }, }, resetData(data) { this.data = data; this.refreshView(); }, refreshView() { let showNull = this.data == null this.imageAdd.node.active = showNull; this.textName.node.active = !showNull; this.imageGold.node.active = !showNull; this.textGold.node.active = !showNull; this.headIcon.node.active = !showNull; this.nodeStatusMask.active = !showNull; if (showNull) { return; } this.textName.string = this.data.playerInfo.nickname this.headIcon.setPlayerInfo(this.data.playerInfo); }, setPrice(boxsPrice) { this.textGold.string = G.PlayerUtils.getPrice(boxsPrice); }, setActive(isShow) { this.node.active = isShow; }, });