user_info_view.ts 1017 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { _decorator, Component, Node, Label, Sprite } from 'cc';
  2. import { GameMng } from '../GameMng';
  3. import GBaseUI from '../gcommon/GBaseUI';
  4. import { UIButton } from '../gcommon/UIButton';
  5. import { Tools } from '../Tools';
  6. import { userData } from '../UserData/userData';
  7. const { ccclass, property } = _decorator;
  8. @ccclass('user_info_view')
  9. export class user_info_view extends GBaseUI {
  10. @property(Node)
  11. lab_name: Node = null;
  12. @property(Node)
  13. btn_close: Node = null;
  14. @property(Node)
  15. spr_icon: Node = null;
  16. @property(Node)
  17. lab_id: Node = null;
  18. start() {
  19. UIButton.BindClick(this.btn_close,()=>{
  20. this.closeUI()
  21. },this)
  22. }
  23. show(user_data:userData){
  24. Tools.loadWeiXinHead(user_data.user_avatar,this.spr_icon.getComponent(Sprite))
  25. this.lab_name.getComponent(Label).string = user_data.user_name
  26. this.lab_id.getComponent(Label).string ="ID:"+user_data.userid
  27. }
  28. update(deltaTime: number) {
  29. }
  30. }