JoinGuild.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. if(!nav_info.match_id.length){
  17. nav_info.scene.showTip("no match id");
  18. return;
  19. }
  20. let str = Config.copy_prefix + "joinguild&"+nav_info.match_id;
  21. Utils.copyToZone(str, this, this.onCopy);
  22. }
  23. public onCopy(succ:boolean){
  24. if(succ){
  25. console.log("copy succ")
  26. nav_info.scene.showTip("copy succc");
  27. Utils.tryStartApp();
  28. }
  29. else{
  30. nav_info.scene.showTip("copy fail");
  31. }
  32. }
  33. }