ExchangeItem.js 991 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import ResMgr from "../base/ResMgr";
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. atlasCoin: cc.SpriteAtlas, //金币图集
  6. labCoin: cc.Label,
  7. spIcon: cc.Sprite,
  8. labCi: cc.Label,
  9. labBiNum: cc.Label,
  10. labVip: cc.Label,
  11. },
  12. // LIFE-CYCLE CALLBACKS:
  13. // onLoad () {},
  14. start () {
  15. },
  16. setInfo(exchangeJs, info){
  17. this.exchangeJs = exchangeJs;
  18. this.labCoin.string = `${11111}金币`;
  19. this.spIcon.spriteFrame = this.atlasCoin.getSpriteFrame('coin2');
  20. // ResMgr.loadTexture('texture/head/h1', (sp)=>{
  21. // this.spIcon.spriteFrame = sp;
  22. // // this.spIcon.node.width = 90;
  23. // // this.spIcon.node.height = 90;
  24. // });
  25. this.labCi.string = `今日剩余兑换${2}次`;
  26. this.labBiNum.string = `x${123}`;
  27. this.labVip.string = `VIP${3}可兑换`;
  28. },
  29. onClickExchange(){
  30. console.log('aaaaaaaaa');
  31. },
  32. });