NewPlayer.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. m_Editbox : cc.EditBox,
  5. },
  6. onLoad () {},
  7. start () {
  8. },
  9. OnBtBind : function () {
  10. cc.gSoundRes.PlaySound('Button');
  11. if (this.m_Editbox.string.length < 1) {
  12. this.ShowTips('請輸入正確的邀請碼!');
  13. return;
  14. }
  15. g_Lobby.ShowLoading();
  16. var Cmd = new CMD_GP_ModifyIndividual();
  17. Cmd.dwUserID = g_GlobalUserInfo.GetGlobalUserData().dwUserID;
  18. Cmd.cbGender = g_GlobalUserInfo.GetGlobalUserData().cbGender;
  19. Cmd.szPassword = g_GlobalUserInfo.GetGlobalUserData().szPassword;
  20. Cmd.DataDescribe = new tagDataDescribe();
  21. Cmd.DataDescribe.wDataSize = window.LEN_ACCOUNTS * cc.TCHAR_SIZE;
  22. Cmd.DataDescribe.wDataDescribe = DTP_GP_UI_SPREADER;
  23. Cmd.szSpreader = this.m_Editbox.string;
  24. Cmd.len_szSpreader = window.LEN_ACCOUNTS * cc.TCHAR_SIZE;
  25. var LoginMission = new CGPLoginMission(this, MDM_GP_USER_SERVICE, SUB_GP_MODIFY_INDIVIDUAL, Cmd);
  26. },
  27. OnBindSpreaderRes: function (dwCode, strDes) {
  28. g_Lobby.StopLoading();
  29. this.m_Hook.m_CheckNewPlayer = 0;
  30. if (dwCode == 0) {
  31. this.m_Hook.ShowAlert("恭喜您成功綁定推廣員!");
  32. this.m_Hook.OnBtRefeshRoomCard();
  33. this.HideView();
  34. } else {
  35. this.m_Hook.ShowAlert(strDes);
  36. }
  37. },
  38. // update (dt) {},
  39. });