SettingView.ts 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-03-18 15:35:37
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-03-18 17:14:13
  6. * @Description: 游戏设置界面
  7. */
  8. import { _decorator, Label, Sprite } from 'cc';
  9. import { oops } from 'db://oops-framework/core/Oops';
  10. import { GameComponent } from "db://oops-framework/module/common/GameComponent";
  11. import { UIID } from '../config/GameUIConfig';
  12. import { PlatformUtil } from 'db://oops-framework/core/utils/PlatformUtil';
  13. const { ccclass, property } = _decorator;
  14. /** 显示对象控制 */
  15. @ccclass('SettingView')
  16. export class SettingView extends GameComponent {
  17. lab_name: Label | null = null; //名字
  18. lab_ivnvite: Label | null = null!; //邀请
  19. sp_head: Sprite | null = null!; //头像
  20. lab_groupnum: Label | null = null!; //群号
  21. lab_proto: Label | null = null!; //协议
  22. lab_privacy: Label | null = null!; //隐私
  23. lab_about: Label | null = null!; //关于
  24. lab_update: Label | null = null!; //更新
  25. lab_logout: Label | null = null!; //注销
  26. lab_exit: Label | null = null!; //退出
  27. protected start() {
  28. this.setButton();
  29. this.initComponents();
  30. }
  31. private initComponents() {
  32. const lab_name = this.node.getChildByPath('btn_head/lab_name');
  33. if (lab_name) {
  34. this.lab_name = lab_name.getComponent(Label);
  35. }
  36. const lab_ivnvite = this.node.getChildByPath('btn_head/lab_ivnvite');
  37. if (lab_ivnvite) {
  38. this.lab_ivnvite = lab_ivnvite.getComponent(Label);
  39. }
  40. const sp_head = this.node.getChildByPath('btn_head/sp_head');
  41. if (sp_head) {
  42. this.sp_head = sp_head.getComponent(Sprite);
  43. }
  44. const lab_groupnum = this.node.getChildByPath('btn_group/lab_groupnum');
  45. if (lab_groupnum) {
  46. this.lab_groupnum = lab_groupnum.getComponent(Label);
  47. }
  48. const lab_proto = this.node.getChildByName('btn_proto');
  49. if (lab_proto) {
  50. this.lab_proto = lab_proto.getComponent(Label);
  51. }
  52. const lab_privacy = this.node.getChildByName('btn_privacy');
  53. if (lab_privacy) {
  54. this.lab_privacy = lab_privacy.getComponent(Label);
  55. }
  56. const lab_about = this.node.getChildByName('btn_about');
  57. if (lab_about) {
  58. this.lab_about = lab_about.getComponent(Label);
  59. }
  60. const lab_update = this.node.getChildByName('btn_update');
  61. if (lab_update) {
  62. this.lab_update = lab_update.getComponent(Label);
  63. }
  64. const lab_logout = this.node.getChildByName('btn_logout');
  65. if (lab_logout) {
  66. this.lab_logout = lab_logout.getComponent(Label);
  67. }
  68. const lab_exit = this.node.getChildByName('btn_exit');
  69. if (lab_exit) {
  70. this.lab_exit = lab_exit.getComponent(Label);
  71. }
  72. }
  73. /**
  74. * @description: 点击头像逻辑
  75. * @return {*}
  76. */
  77. private btn_head() {
  78. //复制邀请码
  79. // oops.gui.copyText(this.lab_ivnvite!.string);
  80. // PlatformUtil.copyText(this.lab_ivnvite!.string);
  81. }
  82. /**
  83. * @description: 客服
  84. * @return {*}
  85. */
  86. private btn_service() {
  87. }
  88. /**
  89. * @description: 清理缓存
  90. * @return {*}
  91. */
  92. private btn_cache() {
  93. }
  94. /**
  95. * @description: 关闭
  96. * @return {*}
  97. */
  98. private btn_close() {
  99. oops.gui.remove(UIID.Setting)
  100. }
  101. /**
  102. * @description: 协议
  103. * @return {*}
  104. */
  105. private btn_proto() {
  106. }
  107. /**
  108. * @description: 隐私
  109. * @return {*}
  110. */
  111. private btn_privacy() {
  112. }
  113. /**
  114. * @description: 关于
  115. * @return {*}
  116. */
  117. private btn_about() {
  118. }
  119. private btn_update() {
  120. }
  121. /**
  122. * @description: 注销
  123. * @return {*}
  124. */
  125. private btn_logout() {
  126. }
  127. /**
  128. * @description: 退出
  129. * @return {*}
  130. */
  131. private btn_exit() {
  132. //清除缓存
  133. //重启游戏
  134. }
  135. }