ArtistResidentItemPlaceholder.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const Api = require('../net/Api');
  2. const { GameNotificationKey } = require("../utils/GameEnum");
  3. const HomeApi = require("../net/HomeApi");
  4. const AlertManager = require("../utils/AlertManager");
  5. cc.Class({
  6. extends: cc.Component,
  7. properties: {
  8. headSprite: cc.Sprite,
  9. nickRichText: cc.RichText,
  10. jobLevelLabel: cc.Label,
  11. jobTitleLabel: cc.Label,
  12. effectLabel: cc.Label,
  13. },
  14. init(artistData) {
  15. this.artistData = artistData;
  16. this.jobLevelLabel.string = this.artistData.jobLevel;
  17. this.jobTitleLabel.string = this.artistData.jobName;
  18. this.nickRichText.string = `<color=#584a47>${this.artistData.nick}</c> <img src='50002'/>`;
  19. this.effectLabel.string = `加成效果: 收益增加${this.artistData.addition}%`;
  20. Api.createImageFromUrl(this.artistData.head, (spriteFrame) => {
  21. this.headSprite.spriteFrame = spriteFrame;
  22. }, null);
  23. },
  24. onLoad () {
  25. },
  26. start () {
  27. },
  28. // update (dt) {},
  29. });