12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 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 = `<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) {},
- });
|