| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- cc.Class({
- extends: cc.Component,
- properties: {
- grantName: {
- default: null,
- type: cc.Label,
- serializable: true,
- },
- amount: {
- default: null,
- type: cc.Label,
- serializable: true,
- },
- //介绍
- describe: {
- default: null,
- type: cc.Label,
- serializable: true,
- },
- inputInviteValue: {
- default: 1,
- visible: false
- },
- //当前操作的果实信息
- fruitInfo:{
- default: null,
- serializable: true,
- visible:false
- },
- upTarget: {
- default: null,
- type: cc.Node,
- tooltip: "把当前操作的ui按钮传进来"
- },
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start () {
- },
- /**
- * 赠送
- */
- onGrant(){
- },
- setInfo(grantName,amount){
- this.grantName.string = grantName;
- this.amount.string = amount;
- },
- 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);
- }
- },
- onclose(){
- this.node.destroy();
- }
- });
|