const Api = require('../net/Api'); const { GameNotificationKey } = require("../utils/GameEnum"); const HomeApi = require("../net/HomeApi"); const AlertManager = require("../utils/AlertManager"); cc.Class({ extends: cc.Component, properties: { headSprite: cc.Sprite, nickRichText: cc.RichText, jobLevelLabel: cc.Label, jobTitleLabel: cc.Label, effectLabel: cc.Label, }, init(artistData) { this.artistData = artistData; this.jobLevelLabel.string = this.artistData.jobLevel; //有职业的时候才赋值 if (this.artistData.jobName) { this.jobTitleLabel.string = this.artistData.jobName; } else { this.jobTitleLabel.string = ""; } this.nickRichText.string = `${this.artistData.nick} `; this.effectLabel.string = `加成效果: 收益增加${this.artistData.addition}%`; Api.createImageFromUrl(this.artistData.head, (spriteFrame) => { this.headSprite.spriteFrame = spriteFrame; }, null); }, onLoad () { }, start () { }, // update (dt) {}, });