BaoxianxiangItem.js 789 B

12345678910111213141516171819202122232425262728293031
  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. var self = this;
  21. if (data.iconUrl) {
  22. Common.loadImage(Define.GameHttpUrl+data.iconUrl,function(texture){
  23. var sprite = new cc.SpriteFrame(texture);
  24. self.bg.getComponent(cc.Sprite).spriteFrame = sprite;
  25. })
  26. }
  27. },
  28. });