PlayerInfoLayer.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. var baseLayer = require('BaseLayer');
  2. import ResMgr from "../base/ResMgr";
  3. import SoundMgr from "../base/SoundMgr";
  4. import UserInfoMgr from "../base/user/UserInfoMgr";
  5. cc.Class({
  6. extends: baseLayer,
  7. properties: {
  8. spHead: cc.Sprite,
  9. labName: cc.Label,
  10. labID: cc.Label,
  11. labPhone: cc.Label,
  12. maskRealname: cc.Node,
  13. maskBindphone: cc.Node,
  14. },
  15. // LIFE-CYCLE CALLBACKS:
  16. // onLoad () {},
  17. start () {
  18. this.setData();
  19. },
  20. setData(){
  21. ResMgr.loadTexture('texture/head/h1', (sp)=>{
  22. this.spHead.spriteFrame = sp;
  23. this.spHead.node.width = 148;
  24. this.spHead.node.height = 148;
  25. });
  26. this.labName.string = UserInfoMgr.getUserName();
  27. this.labID.string = `${UserInfoMgr.getUserId()}`;
  28. this.labPhone.string = '未绑定';
  29. this.maskRealname.active = false;
  30. this.maskBindphone.active = true;
  31. },
  32. onClickRealName(){
  33. SoundMgr.playClick();
  34. },
  35. onClickBindPhone(){
  36. SoundMgr.playClick();
  37. UIMgr.openUI('prefabs/BindPhoneLayer');
  38. },
  39. onClickUpVIP(){
  40. SoundMgr.playClick();
  41. },
  42. onClickOut(){
  43. SoundMgr.playClick();
  44. },
  45. });