Register.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. let global = require("Global");
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. nextPanel:cc.Node,
  6. phoneNum:cc.Label,
  7. code:cc.Label,
  8. },
  9. onLoad () {
  10. this.receiveCode = '';
  11. },
  12. onClose () {
  13. this.node.destroy();
  14. this.node.parent.destroy();
  15. },
  16. onGotoLogin()
  17. {
  18. this.node.destroy();
  19. },
  20. onNext()
  21. {
  22. if(this.phoneNum.string.length!=11)
  23. {
  24. global.alert('您输入的电话号码不对',this);
  25. return;
  26. }
  27. let code = this.code.string;
  28. if(code=!this.receiveCode)
  29. {
  30. global.alert('验证码不正确',this);
  31. return;
  32. }
  33. this.onGotoLogin();
  34. },
  35. onSendCode()
  36. {
  37. if(this.phoneNum.string.length!=11)
  38. {
  39. global.alert('您输入的电话号码不对',this);
  40. return;
  41. }
  42. this.receiveCode = '9527';
  43. },
  44. activeNext()
  45. {
  46. this.nextPanel.active = true;
  47. },
  48. });