LeaseSaleInfo.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. saleName: {
  5. default: null,
  6. type: cc.Label,
  7. serializable: true,
  8. },
  9. saleAmount: {
  10. default: null,
  11. type: cc.Label,
  12. serializable: true,
  13. },
  14. inputInviteValue: {
  15. default: 1,
  16. visible: false
  17. },
  18. },
  19. inputValue(value, e) {
  20. var numberTemp = new RegExp("^[A-Za-z0-9]+$");
  21. if (numberTemp.test(value)) {
  22. if(Number(value)>=1){
  23. this.inputInviteValue = Number(value);
  24. }else{
  25. this.inputInviteValue = 1;
  26. this.inputContainer.getComponent(cc.EditBox).string = this.inputInviteValue;
  27. }
  28. } else {
  29. this.inputInviteValue = 1;
  30. this.inputContainer.getComponent(cc.EditBox).string = this.inputInviteValue;
  31. console.log("请输入整数的倍数", this.inputInviteValue);
  32. // gameToast.getInstance().show(this.ToastParent, "请输入整数的倍数", 2, () => {
  33. // console.log("finish toast!");
  34. // }, this);
  35. }
  36. },
  37. setInfo(saleName,amount){
  38. this.saleName.string = saleName;
  39. this.saleAmount.string = amount;
  40. },
  41. onclose(){
  42. this.node.destroy();
  43. }
  44. });