SamsaraGame/assets/Script/panel/TeamRequestItem.js

39 lines
764 B
JavaScript
Raw Permalink Normal View History

2025-04-24 17:03:28 +08:00
import GameModel from "../ts/core/GameModel";
import GameUtil from "../ts/core/GameUtil";
cc.Class({
extends: cc.Component,
properties: {
nameLab: cc.Label,
levelLab: cc.Label,
headIcon: cc.Sprite,
},
onLoad() {
},
loadInfo(info) {
this.roleInfo = info;
this.nameLab.string = info.name;
GameUtil.setReliveLabel(this.levelLab,0,info.relive,info.level);
this.headIcon.spriteFrame = GameModel.getRoleHead(info.resid);
},
onRejectBtnClicked(e, d) {
GameModel.send('c2s_operteam', {
operation: 0,
roleid: this.roleInfo.roleid,
teamid: GameModel.player.teamid
});
},
onAgreeBtnClicked(e, d) {
GameModel.send('c2s_operteam', {
operation: 1,
roleid: this.roleInfo.roleid,
teamid: GameModel.player.teamid
});
},
});