ResetPWD.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. let global = require("Global");
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. phoneNum:cc.Label,
  6. phoneCode:cc.Label,
  7. mailAdress:cc.Label,
  8. mailCode:cc.Label,
  9. pwd1:cc.Label,
  10. pwd2:cc.Label,
  11. },
  12. onLoad () {
  13. this.receive_phoneCode = '';
  14. this.receive_mailCode = '';
  15. },
  16. onClose () {
  17. this.node.destroy();
  18. this.node.parent.destroy();
  19. },
  20. sendCodePhone()
  21. {
  22. if(this.phoneNum.string.length!=11)
  23. {
  24. global.alert('您输入的电话号码不对',this);
  25. return;
  26. }
  27. this.receive_phoneCode = '9527';
  28. },
  29. sendCodeMail()
  30. {
  31. if(this.mailAdress.string.indexOf("@") == -1)
  32. {
  33. global.alert('您输入的邮箱不对',this);
  34. return;
  35. }
  36. this.receive_mailCode = '9527';
  37. },
  38. onGotoLogin()
  39. {
  40. if(this.phoneNum.string.length!=11)
  41. {
  42. global.alert('您输入的电话号码不对',this);
  43. return;
  44. }
  45. let phoneCode = this.phoneCode.string;
  46. if(phoneCode =!this.receive_phoneCode)
  47. {
  48. global.alert('手机验证码不正确',this);
  49. return;
  50. }
  51. if(this.mailAdress.string.indexOf("@") == -1)
  52. {
  53. global.alert('您输入的邮箱不对',this);
  54. return;
  55. }
  56. let mailCode = this.mailCode.string;
  57. if(mailCode=!this.receive_mailCode)
  58. {
  59. global.alert('邮箱验证码不正确',this);
  60. return;
  61. }
  62. let pwd1 = this.pwd1.string;
  63. let pwd2 = this.pwd2.string;
  64. if(pwd1=!pwd2)
  65. {
  66. global.alert('两次输入密码不一致',this);
  67. return;
  68. }
  69. this.node.destroy();
  70. },
  71. });