var baseLayer = require('BaseLayer'); import ResMgr from "../base/ResMgr"; import SoundMgr from "../base/SoundMgr"; import UserInfoMgr from "../base/user/UserInfoMgr"; cc.Class({ extends: baseLayer, properties: { spHead: cc.Sprite, labName: cc.Label, labID: cc.Label, labPhone: cc.Label, maskRealname: cc.Node, maskBindphone: cc.Node, }, // LIFE-CYCLE CALLBACKS: // onLoad () {}, start () { this.setData(); }, setData(){ ResMgr.loadTexture('texture/head/h1', (sp)=>{ this.spHead.spriteFrame = sp; this.spHead.node.width = 148; this.spHead.node.height = 148; }); this.labName.string = UserInfoMgr.getUserName(); this.labID.string = `${UserInfoMgr.getUserId()}`; this.labPhone.string = '未绑定'; this.maskRealname.active = false; this.maskBindphone.active = true; }, onClickRealName(){ SoundMgr.playClick(); }, onClickBindPhone(){ SoundMgr.playClick(); UIMgr.openUI('prefabs/BindPhoneLayer'); }, onClickUpVIP(){ SoundMgr.playClick(); }, onClickOut(){ SoundMgr.playClick(); }, });