| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- cc.Class({
- extends: cc.Component,
- properties: {
- saleName: {
- default: null,
- type: cc.Label,
- serializable: true,
- },
- saleAmount: {
- default: null,
- type: cc.Label,
- serializable: true,
- },
- inputInviteValue: {
- default: 1,
- visible: false
- },
- },
- inputValue(value, e) {
- var numberTemp = new RegExp("^[A-Za-z0-9]+$");
- if (numberTemp.test(value)) {
- if(Number(value)>=1){
- this.inputInviteValue = Number(value);
- }else{
- this.inputInviteValue = 1;
- this.inputContainer.getComponent(cc.EditBox).string = this.inputInviteValue;
- }
- } else {
- this.inputInviteValue = 1;
- this.inputContainer.getComponent(cc.EditBox).string = this.inputInviteValue;
- console.log("请输入整数的倍数", this.inputInviteValue);
- // gameToast.getInstance().show(this.ToastParent, "请输入整数的倍数", 2, () => {
- // console.log("finish toast!");
- // }, this);
- }
- },
- setInfo(saleName,amount){
- this.saleName.string = saleName;
- this.saleAmount.string = amount;
- },
- onclose(){
- this.node.destroy();
- }
- });
|