ExchangeRecord.js 856 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. var List = require("List");
  2. import SoundMgr from "../base/SoundMgr";
  3. cc.Class({
  4. extends: cc.Component,
  5. properties: {
  6. recordList: List,
  7. },
  8. // LIFE-CYCLE CALLBACKS:
  9. // onLoad () {},
  10. start () {
  11. },
  12. onEnable(){
  13. this.showRecord();
  14. },
  15. showRecord(){
  16. this.itemData = [];
  17. for(let i=0; i < 10; i++){
  18. this.itemData.push(i);
  19. }
  20. this.recordList.numItems = this.itemData.length;
  21. },
  22. listRender(item, idx){
  23. item.active = true;
  24. item.getChildByName('lab').getComponent(cc.Label).string = '123';
  25. item.getChildByName('labTime').getComponent(cc.Label).string = '456';
  26. item.getChildByName('end').active = true;
  27. item.getChildByName('ing').active = false;
  28. },
  29. onClose(){
  30. this.node.active = false;
  31. }
  32. });