1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- import SoundMgr from "../base/SoundMgr";
- var baseLayer = require('BaseLayer');
- cc.Class({
- extends: baseLayer,
- properties: {
- togNodes: [cc.Node],
- spBar: cc.Sprite,
- labGet: cc.Label,
- labNum: cc.Label,
- labY: cc.Label,
- acNode: cc.Node,
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start () {
- this.init();
- this.selectToggle(null, 0);
- },
- init(){
- for(let i=0; i < this.togNodes.length; i++){
- cc.find('off/lab', this.togNodes[i]).getComponent(cc.Label).string = `${10}元`;
- cc.find('on/lab', this.togNodes[i]).getComponent(cc.Label).string = `${10}元`;
- }
- this.acNode.getComponent('RechargeActivity').setType(1, this);
- },
- selectToggle(event, index){
- for(let i=0; i < this.togNodes.length; i++){
- this.togNodes[i].getChildByName('on').active = false;
- }
- this.togNodes[index].getChildByName('on').active = true;
- this.spBar.fillRange = - 0.22;
- this.labGet.string = `获得\n${12345}万金币开启`;
- this.labNum.string = 100;
- this.labY.string = `${2}元 开启礼包`;
- },
- onClickGreen(){
- SoundMgr.playClick();
- },
- });
|