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;
        this.jobTitleLabel.string = this.artistData.jobName;

        this.nickRichText.string = `<color=#584a47>${this.artistData.nick}</c> <img src='50002'/>`;
        this.effectLabel.string = `加成效果: 收益增加${this.artistData.addition}%`;
        Api.createImageFromUrl(this.artistData.head, (spriteFrame) => {
            this.headSprite.spriteFrame = spriteFrame;
        }, null);
    },


    onLoad () {

    },
    start () {

    },


    // update (dt) {},
});
