75 lines
2.3 KiB
JavaScript
75 lines
2.3 KiB
JavaScript
// --------------------------------------------------------------------
|
|
// @author: xxx@syg.com(必填, 创建模块的人员)
|
|
// @description:
|
|
// 这里填写详细说明,主要填写该模块的功能简要
|
|
// <br/>Create: 2019-04-30 16:21:08
|
|
// --------------------------------------------------------------------
|
|
const BridgeController = require( "bridge.controller" );
|
|
var HeroController = require("hero_controller");
|
|
const TipsController = require("tips_controller");
|
|
var LookController = cc.Class({
|
|
extends: BridgeController,
|
|
ctor: function () {
|
|
},
|
|
|
|
// 初始化配置数据
|
|
initConfig: function () {
|
|
|
|
},
|
|
|
|
// 注册监听事件
|
|
registerEvents: function () {
|
|
|
|
},
|
|
|
|
// 注册协议接受事件
|
|
registerProtocals: function () {
|
|
// this.RegisterProtocal(1110, this.on1110);
|
|
this.RegisterProtocal(11061, this.handle11061) //--查看对方英雄信息
|
|
this.RegisterProtocal(11062, this.handle11062) //--查看对方分享英雄信息
|
|
},
|
|
sender11061(r_rid,r_srvid,partner_id){
|
|
let protocal ={}
|
|
protocal.r_rid = r_rid
|
|
protocal.r_srvid = r_srvid
|
|
protocal.partner_id = partner_id
|
|
this.SendProtocal(11061,protocal)
|
|
},
|
|
handle11061( data ){
|
|
if( data.msg != "" ){
|
|
nx.tbox(data.msg);
|
|
}
|
|
|
|
if(data.bid != 0){
|
|
let config = game.configs.partner_data.data_partner_base[data.bid]
|
|
let camp_type = 1
|
|
if(config){
|
|
camp_type = config.camp_type
|
|
}
|
|
data.camp_type = camp_type
|
|
TipsController.getInstance().showPartnerTips( data );
|
|
}
|
|
},
|
|
// --查看对方分享英雄信息
|
|
sender11062(id, srv_id){
|
|
let protocal ={}
|
|
protocal.id = id
|
|
protocal.srv_id = srv_id
|
|
this.SendProtocal(11062,protocal)
|
|
},
|
|
handle11062( data ){
|
|
nx.tbox(data.msg)
|
|
if(data.bid != 0){
|
|
let config = game.configs.partner_data.data_partner_base[data.bid]
|
|
let camp_type = 1
|
|
if(config){
|
|
camp_type = config.camp_type
|
|
}
|
|
data.camp_type = camp_type
|
|
TipsController.getInstance().showPartnerTips( data );
|
|
// HeroController.getInstance().openHeroTipsPanel(true, data)
|
|
}
|
|
},
|
|
});
|
|
|
|
module.exports = LookController; |