1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- cc.Class({
- extends: cc.Component,
-
- properties: {
- imageBg: {
- default: null,
- type: cc.Sprite,
- serializable: true,
- },
- imageItem: {
- default: null,
- type: cc.Sprite,
- serializable: true,
- },
- buttonSub: {
- default: null,
- type: cc.Button,
- serializable: true,
- },
- imageSelect: {
- default: null,
- type: cc.Sprite,
- serializable: true,
- },
- },
- setIndex(index) {
- this.index = index;
- },
- getIndex(index) {
- return this.index;
- },
- setData(data) {
- this.data = data;
- },
- getData() {
- return this.data;
- },
- setCb(cb) {
- this.onClickCb = cb;
- },
- setSelect(b) {
- this.imageSelect.node.active = b;
- },
-
- setButtonSubShow(b) {
- this.buttonSub.node.active = b;
- },
- onClickCell() {
- if (this.onClickCb) {
- this.onClickCb(this.index, this.data)
- }
- },
- });
|