40 lines
787 B
JavaScript
40 lines
787 B
JavaScript
|
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
|
||
|
});
|
||
|
},
|
||
|
});
|