ActivityItem.js 836 B

1234567891011121314151617181920212223242526272829303132
  1. import Common from '../common/Common';
  2. import Define from '../common/Define'
  3. cc.Class({
  4. extends: cc.Component,
  5. properties: {
  6. bg:cc.Sprite,
  7. num:cc.Label,
  8. },
  9. clickTable(sender,type)
  10. {
  11. console.log("clickTable")
  12. var num = this.num.string
  13. this.parentNode.OnBtnClicked(sender,this.gameid,type,num)
  14. },
  15. setGameData(data,parentNode)
  16. {
  17. var self = this;
  18. this.gameid = data.id
  19. this.parentNode = parentNode
  20. this.num.string = data.gameMoney_money
  21. var self = this;
  22. if (data.iconUrl) {
  23. Common.loadImage(Define.GameHttpUrl+data.iconUrl,function(texture){
  24. var sprite = new cc.SpriteFrame(texture);
  25. self.bg.getComponent(cc.Sprite).spriteFrame = sprite;
  26. })
  27. }
  28. },
  29. });