123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import SoundMgr from "../base/SoundMgr";
- import Tool from "../base/Tool";
- var baseLayer = require('BaseLayer');
- cc.Class({
- extends: baseLayer,
- properties: {
- labVip: cc.RichText,
- labNum: cc.Label,
- labCun: cc.Label,
- labY: cc.Label,
- labCi: cc.Label,
- itemPre: cc.Node,
- conNode: cc.Node,
- acNode: cc.Node,
- ruleUI: cc.Node,
- ruleItemPre: cc.Node,
- ruleConNode: cc.Node,
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start () {
- this.labVip.string = `当前<color=#FFF33A>${'VIP12'}</color>储存上限`;
- this.labNum.string = '123123';
- this.labCun.string = 480;
- this.labY.string = `¥${12}`;
- this.labCi.string = `今日可购次数${21}`;
- this.acNode.getComponent('RechargeActivity').setType(3, this);
- this.initItems();
- this.initRuleItems();
- },
- initItems(){
- this.conNode.removeAllChildren();
- for(let i=0; i < 20; i++){
- let temp = cc.instantiate(this.itemPre);
- temp.setParent(this.conNode);
- temp.name = `${i}`;
- temp.active = true;
- temp.getChildByName('name').getComponent(cc.Label).string = '西门吹雪';
- temp.getChildByName('money').getComponent(cc.Label).string = 789;
- }
- },
- initRuleItems(){
- this.ruleConNode.removeAllChildren();
- for(let i=0; i < 11; i++){
- let temp = cc.instantiate(this.ruleItemPre);
- temp.setParent(this.ruleConNode);
- temp.name = `${i}`;
- temp.active = true;
- temp.getChildByName('labVip').getComponent(cc.Label).string = `VIP${i}`;
- temp.getChildByName('labCi').getComponent(cc.Label).string = `${21}次`;
- temp.getChildByName('labMax').getComponent(cc.Label).string = 778899;
- }
-
- },
- onClickYellow(){
- SoundMgr.playClick();
- },
- onClickRule(){
- SoundMgr.playClick();
- this.ruleUI.active = !this.ruleUI.active;
- },
- });
|