JoinGuild.ts 976 B

123456789101112131415161718192021222324252627282930313233
  1. import { _decorator, Component, Label, Node } from 'cc';
  2. import { UtilsPanel } from '../../scene/script/UtilsPanel';
  3. import { Config, nav_info } from '../../scene/script/NavInfo';
  4. import { Utils } from '../../scene/script/Utils';
  5. const { ccclass } = _decorator;
  6. @ccclass('JoinGuild')
  7. export class JoinGuild extends Component {
  8. private lb_id: Label = null;
  9. protected onLoad(){
  10. UtilsPanel.getAllNeedCom(this, this.node, false);
  11. }
  12. protected start(): void {
  13. this.lb_id.string = nav_info.match_id + ":الانضمام إلى النقابة ";
  14. }
  15. private onGoClick(){
  16. let str = Config.copy_prefix + "joinguild&"+nav_info.match_id;
  17. Utils.copyToZone(str, this, this.onCopy);
  18. }
  19. public onCopy(succ:boolean){
  20. if(succ){
  21. console.log("copy succ")
  22. nav_info.scene.showTip("copy succc");
  23. Utils.tryStartApp();
  24. }
  25. else{
  26. nav_info.scene.showTip("copy fail");
  27. }
  28. }
  29. }