SamsaraGame/assets/Script/panel/BangListItem.js

40 lines
787 B
JavaScript
Raw 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_operbang', {
operation: 0,
roleid: this.roleInfo.roleid,
bangid: GameModel.player.bangid
});
this.node.destroy();
},
onAgreeBtnClicked(e, d) {
GameModel.send('c2s_operbang', {
operation: 1,
roleid: this.roleInfo.roleid,
bangid: GameModel.player.bangid
});
},
});