difenduandada
2024-12-31 34abe6963b344c882358274957f4b992456fee40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
// --------------------------------------------------------------------
// @author: xxx@syg.com(必填, 创建模块的人员)
// @description:
//     这里是描述这个窗体的作用的
// <br/>Create: 2019-08-09 15:58:31
// --------------------------------------------------------------------
var PathTool = require("pathtool");
var ActionController = require("action_controller")
var EliteSummonEvent = require("elitesummon_event")
var ElitesummonController = require("elitesummon_controller")
var RoleController = require("role_controller")
var BackpackController = require("backpack_controller")
var BackpackEvent = require("backpack_event")
var BackPackConst = require("backpack_const")
var SummonEvent = require("partnersummon_event");
var MainUiController = require("mainui_controller")
var PartnersummonController = require("partnersummon_controller")
var TimeTool = require("timetool")
var ElitesummonPanel = cc.Class({
    extends: BasePanel,
    ctor: function () {
        this.prefabPath = PathTool.getPrefabPath("action", "action_time_summon_panel");
        this.holiday_bid = arguments[0]
        this.ctrl = ElitesummonController.getInstance()
    },
 
    // 可以初始化声明一些变量的
    initConfig:function(){
        this._summon_type_1 = 1      // 单抽的抽取类型(1免费 3钻石 4道具)
        this._summon_type_10 = 3      // 十连抽抽取类型(3钻石 4道具)
        this.role_vo = RoleController.getInstance().getRoleVo();
        this.arard_data = Config.recruit_holiday_elite_data.data_award
        this.const_data = Config.recruit_holiday_elite_data.data_const
        this.summon_item_bid = this.const_data["common_s"].val
        this.summon_data = Config.recruit_holiday_elite_data.data_summon
        this.action_config = Config.recruit_holiday_elite_data.data_action
    },
 
    // 初始化一些配置数据,可以用于声明一些变量之类的
    initPanel:function(){
        this.setPosition(0,-20)
        let main_container = this.root_wnd.getChildByName("main_container")
        this.progress_txt = main_container.getChildByName("progress_txt").getComponent(cc.Label)
        let image_bg_sp = main_container.getChildByName("image_bg").getComponent(cc.Sprite)
        this.progress = main_container.getChildByName("progress").getComponent(cc.ProgressBar)
        this.baodi_bg = main_container.getChildByName("baodi_bg")
        let str_bg = "txt_cn_elitesummon_1";
        let tab_vo = ActionController.getInstance().getActionSubTabVo(this.holiday_bid)
        if(tab_vo && tab_vo.aim_title != "" && tab_vo.aim_title){
            str_bg = tab_vo.aim_title
        }
        let path = PathTool.getBigBg(str_bg,"jpg","timesummon")
        this.loadRes(path,function(res){
            image_bg_sp.spriteFrame = res
        }.bind(this))
        this.item_num_txt = main_container.getChildByName("item_num_txt").getComponent(cc.Label)
        this.award_btn = main_container.getChildByName("award_btn")
        this.award_btn.getChildByName("label").getComponent(cc.Label).string = Utils.TI18N("奖励预览")
        main_container.getChildByName("preview_btn").active = false
        this.summon_btn_1 = main_container.getChildByName("summon_btn_1")
        this.summon_btn_1.getChildByName("label").getComponent(cc.Label).string = Utils.TI18N("招募1次")
        this.summon_txt_1_rt = this.summon_btn_1.getChildByName("summon_txt_1").getComponent(cc.RichText)
        this.summon_prop_1_nd = this.summon_btn_1.getChildByName("summon_prop")
        this.summon_prop_num_lb = this.summon_prop_1_nd.getChildByName("summon_prop_num").getComponent(cc.Label)
 
        this.summon_btn_10 = main_container.getChildByName("summon_btn_10")
        this.summon_btn_10.getChildByName("label").getComponent(cc.Label).string = Utils.TI18N("招募10次")
        this.summon_prop_10_nd = this.summon_btn_10.getChildByName("summon_prop");
        this.summon_prop_sp = this.summon_prop_10_nd.getChildByName("summon_prop_item").getComponent(cc.Sprite)
        this.summon_10_num_lb = this.summon_prop_10_nd.getChildByName("summon_prop_num").getComponent(cc.Label)
 
        this.time_txt = main_container.getChildByName("time_txt").getComponent(cc.Label)
        this.time_txt.node.setPosition(414,283)
        this.time_txt.node.color = new cc.Color(255,252,187);
        let line = this.time_txt.node.addComponent(cc.LabelOutline);
        line.color = new cc.Color(112,18,18);
        line.width = 2;
        this.time_txt.lineHeight = 30;
        // this.time_txt.node.active = false;
        this.baodi_text_rt = this.seekChild("baodi_text",cc.RichText);
        this.baodi_text_rt.node.setAnchorPoint(1,0.5)
        this.baodi_text_rt.node.x = 75;
        this.award_item = ItemsPool.getInstance().getItem("backpack_item")
        this.award_item.setParent(main_container);
        this.award_item.setPosition(60, 728)
        this.award_item.initConfig(false, 0.6, false, false);
        this.award_item.show();
        this.award_item.addCallBack(this._onClickAwardItem.bind(this))
 
        let item_config = Utils.getItemConfig(this.summon_item_bid)
        let path1 = PathTool.getItemRes(item_config.icon)
        this.loadRes(path1,function(res){
            this.summon_prop_1_nd.getChildByName("summon_prop_item").getComponent(cc.Sprite).spriteFrame = res;
            main_container.getChildByName("item_icon").getComponent(cc.Sprite).spriteFrame = res;
        }.bind(this))
        this.baodi_bg.getChildByName("tip").active = true;
        this.btn_rule = this.baodi_bg.getChildByName("tip")
    },
 
    // 注册事件监听的接口,不需要手动调用,如果是使用gcore.GlobalEvent监听,可以直接调用addGlobalEvent
    registerEvent:function(){
        this.addGlobalEvent(EliteSummonEvent.EliteSummon_Message,function(data){
            if(!data) return;
            let status = this.ctrl.getModel().isHolidayHasID(data.camp_id)
            if(status){
                this.setData(data)
            }
        }.bind(this))
        // --物品道具增加
        this.addGlobalEvent(BackpackEvent.ADD_GOODS,function(bag_code,data_list){
            this.updateItemNum(bag_code,data_list)
        }.bind(this))
        //物品道具删除
        this.addGlobalEvent(BackpackEvent.DELETE_GOODS,function(bag_code,data_list){
            this.updateItemNum(bag_code,data_list)
        }.bind(this))
        //物品道具改变
        this.addGlobalEvent(BackpackEvent.MODIFY_GOODS_NUM,function(bag_code,data_list){
            this.updateItemNum(bag_code,data_list)
        }.bind(this))
        // 召唤成功
        this.addGlobalEvent(SummonEvent.PartnerSummonSuccess, function() {
            this.playRecruitEffect();
        }.bind(this));
        this.award_btn.on("click",function(){
            if(this.data && this.data.camp_id){
                let config = this.action_config[this.data.camp_id]
                if (config){
                    var TimesummonController = require("timesummon_controller")
                    TimesummonController.getInstance().openTimeSummonAwardView(true,config.group_id, this.data,true)
                }
            }
 
        },this)
        this.btn_rule.on('click',function(event){
            if(this.data && this.data.camp_id){
                let config = this.action_config[this.data.camp_id]
                if(config){
                    let pos = event.node.convertToWorldSpaceAR(cc.v2(0, 0))
                    require("tips_controller").getInstance().showCommonTips(config.desc,pos,null,null,500)
                }
            }
        },this)
        this.summon_btn_1.on('click',function(){
            Utils.playButtonSound(1)
            if(this.checkHeroBagIsFull(1)) return;
            if(this.last_time && gcore.SmartSocket.getTime() - this.last_time < 2){
                return
            }
            this.last_time = gcore.SmartSocket.getTime()
            if(this._summon_type_1 == 3){
                if(this.data && this.data.camp_id){
                    let group_id = this.action_config[this.data.camp_id].group_id
                    let config = this.summon_data[group_id]
                    let num = config.loss_gold_once[0][1]
                    let call_back = function (){
                        this.ctrl.send23221( 1, this._summon_type_1 )
                    }
                    let item_icon_2 = Utils.getItemConfig(config.loss_gold_once[0][0]).icon
                    let val_str = Utils.getItemConfig(config.gain_once[0][0]).name || ""
                    let val_num = config.gain_once[0][1]
                    let call_num = 1
                    this.showGoldTips(item_icon_2,num,call_num,val_num,val_str,call_back)
                }
                  
            }else{
                this.ctrl.send23221( 1, this._summon_type_1 )
            }
        },this)
        this.summon_btn_10.on("click",function(){
            Utils.playButtonSound(1)
            if(this.checkHeroBagIsFull(10)) return;
            if(this.last_time && Math.abs(gcore.SmartSocket.getTime() - this.last_time) < 0.5){
                return
            }
            this.last_time = gcore.SmartSocket.getTime()
            if(this._summon_type_10 == 3){
                if(this.data && this.data.camp_id){
                    let group_id = this.action_config[this.data.camp_id].group_id
                    let config = this.summon_data[group_id]
                    let num = config.loss_gold_ten[0][1]
                    let call_back = function (){
                        this.ctrl.send23221( 10, this._summon_type_10 )
                    }
                    let item_icon_2 = Utils.getItemConfig(config.loss_gold_ten[0][0]).icon
                    let val_str = Utils.getItemConfig(config.gain_ten[0][0]).name || ""
                    let val_num = config.gain_ten[0][1]
                    let call_num = 10
                    this.showGoldTips(item_icon_2,num,call_num,val_num,val_str,call_back)
                }
            }else{
                this.ctrl.send23221( 10, this._summon_type_10 )
            }
        },this)
        this.ctrl.send23220()
    },
 
    // 预制体加载完成之后,添加到对应主节点之后的回调可以设置一些数据了
    onShow:function(params){
 
    },
 
    // 面板设置不可见的回调,这里做一些不可见的屏蔽处理
    onHide:function(){
 
    },
    setData(data){
        this.data = data
        this.updateSummonBtnStatus()
        this.nextRewardLevel()
        this.updateItemNum()
        let str_time = cc.js.formatStr("%s-%s",TimeTool.getMD2(data.start_time),TimeTool.getMD2(data.end_time))
        this.time_txt.string = str_time;
        this.baodi_text_rt.string =  Utils.TI18N(cc.js.formatStr(StringUtil.parseStr("<div fontcolor=#ffffff outline=2,#000000>剩余</div><div fontcolor=#5fde46 outline=2,#000000>%d</div><div fontcolor=#ffffff outline=2,#000000>次招募内必出UP英雄</div>").string, data.must_count))
    },
    updateSummonBtnStatus(){
        if(this.data && this.data.camp_id){
            let config = this.action_config[this.data.camp_id]
            let data = this.summon_data[config.group_id]
            let summon_have_num = BackpackController.getInstance().getModel().getItemNumByBid(this.summon_item_bid)
            // -- 单抽
            let cur_time = gcore.SmartSocket.getTime()
            if(this.data.free_time == 0 && this.data.free_time <= cur_time){
                let txt_str_1 = Utils.TI18N(StringUtil.parseStr("<div fontcolor=#ffffff>免费召唤</div>").string)
                this._summon_type_1 = 1
                this.openSummonFreeTimer(false)
                this.summon_txt_1_rt.node.active = true;//免费 或者 倒计时
                this.summon_prop_1_nd.active = false;//道具
                this.summon_txt_1_rt.string = txt_str_1;
            }else if(summon_have_num >= 1){
                this._summon_type_1 = 4
                this.openSummonFreeTimer(false)
                this.summon_txt_1_rt.node.active = false;//免费 或者 倒计时
                this.summon_prop_1_nd.active = true;//道具
                this.summon_prop_num_lb.string = summon_have_num;
            }else if(this.data.free_time){
                this.left_time = this.data.free_time - cur_time
                this.summon_txt_1_rt.node.active = true;//免费 或者 倒计时
                this.summon_prop_1_nd.active = false;//道具
                this._summon_type_1 = 3
                this.openSummonFreeTimer(true)
            }
 
            // -- 十连抽
            if(summon_have_num >= 10){
                let item_config = Utils.getItemConfig(this.summon_item_bid);
                if(item_config){
                    let path = PathTool.getItemRes(item_config.icon);
                    this.summon_10_num_lb.string = summon_have_num;
                    this.summon_prop_sp.node.scale = 0.4
                    this.loadRes(path,function(res){
                        this.summon_prop_sp.spriteFrame = res;
                    }.bind(this))
                }
                this._summon_type_10 = 4
            }else{
                let bid = data.loss_gold_ten[0][0]
                let num = data.loss_gold_ten[0][1]
                let path = PathTool.getItemRes(bid)
                this.summon_prop_sp.node.scale = 0.3
                this.loadRes(path,function(res){
                    this.summon_prop_sp.spriteFrame = res;
                }.bind(this))
                this.summon_10_num_lb.string = num;
                this._summon_type_10 = 3
            }
        }
    },
    openSummonFreeTimer(status){
        if(status){
            if(this.left_time > 0 && this.summon_txt_1_rt){
                if(!this.summon_timer){
                    this.setTimeFormatString()
                    this.summon_timer = gcore.Timer.set(function(){
                        this.setTimeFormatString()
                    }.bind(this),1000,-1)
                }
            }else{
                if(this.summon_timer){
                    gcore.Timer.del(this.summon_timer);
                    this.summon_timer = null
                }
            }
        }else{
            if(this.summon_timer != null){
                gcore.Timer.del(this.summon_timer);
                this.summon_timer = null;
            }
        }
    },
    setTimeFormatString(){
        if(this.data && (this.data.free_time - gcore.SmartSocket.getTime()) > 0){
            this.left_time = this.data.free_time - gcore.SmartSocket.getTime()
            this.summon_txt_1_rt.string =  cc.js.formatStr(Utils.TI18N(StringUtil.parseStr("<div fontcolor=#35ff14>%s</div><div fontcolor=#ffffff>后免费</div>").string), TimeTool.getTimeFormat(this.left_time))
            this._summon_type_1 = 3
        }else{
            this.summon_txt_1_rt.string = Utils.TI18N(StringUtil.parseStr("<div fontcolor=#ffffff>免费召唤</div>").string)
            this._summon_type_1 = 1
            if(this.summon_timer){
                gcore.Timer.del(this.summon_timer);
                this.summon_timer = null
            }
        }
    },
    nextRewardLevel(){
        let count = this.nextCount(this.data.times)
        if(this.arard_data[this.data.camp_id] && this.arard_data[this.data.camp_id][count]){
            let data = this.arard_data[this.data.camp_id]
            let _award_is_over = false
            if(this.award_item){
                let bid = data[count].reward[0][0]
                let num = data[count].reward[0][1]
                this.award_item.setData({bid:bid, num:num})
                let obj = this.getBaoDIStatus()
                this.is_can_award = obj.status
                let can_id = obj.id 
                if(this.is_can_award == true){
                    if(can_id){
                        let bid = data[can_id].reward[0][0]
                        let num = data[can_id].reward[0][1]
                        this.award_item.setData({bid:bid, num:num})
                    }
                    this.award_item.showItemEffect(true, 263, PlayerAction.action_1, true, 1.1)
                }else{
                    this.award_item.showItemEffect(false)
                }
                // --全部领取完毕的时候
                if(this.is_can_award == false && this.data.times >= data[Utils.getArrLen(data)].times){
                    // setChildUnEnabled(true, this.award_item)
                    this.award_item.setReceivedIcon(true)
                    _award_is_over = true;
                }
            }
            let num_times = data[count].times
            let label = ""
            if(_award_is_over){
                label = Utils.TI18N("招募次数 ") + this.data.times + "/" + num_times
            }else{ 
                label = Utils.TI18N("下一阶段 ") + this.data.times+"/"+num_times
            }
            this.progress_txt.string = label
            let cur_num = 0
            let totle_num = num_times
            if(count == 1){
                cur_num = this.data.times
            }else{
                cur_num = this.data.times - data[count-1].times
                totle_num = num_times-data[count-1].times
            }
            let percent = cur_num / totle_num
            if(this.data.times >= data[Utils.getArrLen(data)].times){
                percent = 1
            }
            this.progress.progress = percent
        }
    },
    _onClickAwardItem(){
        if(this.data){
            if(this.is_can_award){
                this.ctrl.send23222()
            }else{
                var TimesummonController = require("timesummon_controller")
                TimesummonController.getInstance().openTimeSummonProgressView(true, this.data.times, this.data.camp_id)
            }
        }
    },
    // --根据当前阶段计算下一次奖励
    nextCount(cur_num){
        let count = 1
        let data = this.arard_data[this.data.camp_id]
        if(this.arard_data && data){
            let len = Utils.getArrLen(data)
            if(cur_num >= data[len].times){
                return data[len].id
            }
 
            for(let i in data){
                let m = i+1
                if(m >= len){
                    m = len
                }
                if(data[i].times > cur_num && cur_num <= data[m].times){
                    count = data[i].id
                    break
                }
            }
        }
        return count
    },
    // --领取保底状态
    getBaoDIStatus(){
        let status = false
        let id = null
        if(this.data){
            if(this.arard_data[this.data.camp_id]){
                for(let i in this.arard_data[this.data.camp_id]){
                    let v = this.arard_data[this.data.camp_id][i]
                    let cur_status = false
                    let cur_id = null
                    if(this.data.times >= v.times){
                        cur_status = true
                        cur_id = v.id
                    }
                    let true_status = true
                    if(cur_status == true){
                        for(let j=0;j<this.data.reward_list.length;++j){
                            let k = this.data.reward_list[j]
                            if(k.id == cur_id){
                                true_status = false
                                break
                            }
                        }
                    }
                    if(cur_id && true_status == true){
                        status = true
                        id = cur_id
                    }
                }
            }
        }
        return {status:status,id:id}
    },
    updateItemNum(bag_code, data_list){
        if(this.summon_item_bid){
            if(bag_code && data_list){
                if(bag_code == BackPackConst.Bag_Code.BACKPACK){
                    for(let i in data_list){
                        let v = data_list[i]
                        if(v && v.base_id && this.summon_item_bid == v.base_id){
                            let summon_have_num = BackpackController.getInstance().getModel().getItemNumByBid(this.summon_item_bid)
                            this.item_num_txt.string = summon_have_num;
                            this.updateSummonBtnStatus()
                            break
                        }
                    }
                }
            }else{
                let summon_have_num = BackpackController.getInstance().getModel().getItemNumByBid(this.summon_item_bid)
                this.item_num_txt.string = summon_have_num;
            }
        }
    },
    checkHeroBagIsFull(times){
        // 判断英雄背包空间
        var HeroController = require("hero_controller");
        var hero_model = HeroController.getInstance().getModel();
        var hero_bag_info = hero_model.getHeroMaxCount();
        var limit_num = hero_bag_info.max_count - hero_bag_info.have_coutn;
        if (times > limit_num) {
            var str = Utils.TI18N("英雄列表已满,可通过提升贵族等级或购买增加英雄携带数量,是否前往购买?")
            var CommonAlert = require("commonalert");
            CommonAlert.show(str, Utils.TI18N("确定"), function() {
                var MainuiConst = require("mainui_const")
                var ActionController = require("action_controller")
                MainUiController.getInstance().changeMainUIStatus(MainuiConst.btn_index.partner)
                ActionController.getInstance().openActionMainPanel(false)
            }, Utils.TI18N("取消"), function() {
            })
            return true
        }     
        return false;   
    },
    showGoldTips(good_res_path,need_num,call_num,val_num,val_str,call_back){
        //图标 买几次 购买经验 回调函数
        if(this.alert){
            this.alert.close()
            this.alert = null;
        }
        let hvae_num = this.role_vo.gold;
        let buy_ori = cc.js.formatStr(StringUtil.parseStr(Lang.DIAMOND_CONSUME).string, good_res_path, need_num, hvae_num);
        let get_ori = cc.js.formatStr(StringUtil.parseStr(Lang.BUY_DES).string,  val_num, val_str,call_num);
        let des_str = buy_ori + get_ori;
        var frame_arrays = [];
        var good_path = PathTool.getIconPath("item", "3");
        frame_arrays.push(good_path);
 
        var CommonAlert = require("commonalert");
        this.alert = CommonAlert.show(des_str, "确定", call_back.bind(this), "取消", null, null, null, {resArr: frame_arrays,maxWidth:450,align:cc.macro.TextAlignment.LEFT});
    },
    playRecruitEffect(){
        let config_data = this.summon_data
        if(this.summonBg == null){ 
            this.summonBg = new cc.Node().addComponent(cc.Sprite)
            this.summonBg.type = cc.Sprite.Type.SLICED;
            this.summonBg.sizeMode = cc.Sprite.SizeMode.CUSTOM;
            ViewManager.getInstance().addToSceneNode(this.summonBg.node,SCENE_TAG.dialogue)
            this.summonBg.node.setContentSize(720,1280)
            this.summonBg.node.scale = FIT_SCALE;
            this.summonBg.node.setPosition(0, 0)
            let group_id = this.action_config[this.data.camp_id].group_id
            let path = PathTool.getBigBg("timesummon/"+ config_data[group_id].call_bg_card,"jpg")
            this.loadRes(path,function(res){
                this.summonBg.spriteFrame = res;
                this.summonBg.node.setContentSize(cc.size(720,1280))
            }.bind(this))
            this.summonBg.node.on("touchend",function(){
                this.summonBg.node.active = !this.summonBg.node.active;
                if(this.floor_effect){
                    this.floor_effect.paused = true;
                }
                if(this.book_effect){
                    this.book_effect.paused = true;
                }
                if(this.light_effect){
                    this.light_effect.paused = true;
                }
                this.animaComplete()
            },this)
        }else{
            this.summonBg.node.active = !this.summonBg.node.active;
        }
        let data = PartnersummonController.getInstance().getModel().getRecruitData()
        var TimesummonController =require("timesummon_controller")
        let rewards = TimesummonController.getInstance().getModel().getEffectAction(data.rewards)
        this.floor_action = rewards[0]
        this.light_action = rewards[1]
        let config = config_data[data.group_id]
        let action_name = "action";
        if (config){
            action_name = config.action_name;
        }
        // 播放音效
        let music_name = "recruit_" + action_name;
        Utils.playEffectSound(AUDIO_TYPE.Recruit, music_name);
        this.handleFloorEffect()
        this.handleLightEffect()
        this.handleBookEffect()
        MainUiController.getInstance().setMainUIBottomStatus(false);
        MainUiController.getInstance().setMainUITopStatus(false);    
    },
    handleFloorEffect(){
        let action = this.floor_action || PlayerAction.action_1
        if(this.summonBg && this.floor_effect == null){
            this.floor_effect = new cc.Node().addComponent(sp.Skeleton)
            this.summonBg.node.addChild(this.floor_effect.node)
            this.floor_effect.node.setPosition(0,-270)
            let effect_res = PathTool.getEffectRes("671");
            let effect_path = PathTool.getSpinePath(effect_res, "action");
            this.loadRes(effect_path,function(recruit_sk){
                this.floor_effect.skeletonData = recruit_sk;
                this.floor_effect.setAnimation(0, action);
            }.bind(this))
        }else if(this.floor_effect){
            this.floor_effect.setToSetupPose()
            this.floor_effect.paused = false
            this.floor_effect.setAnimation(0, action);
        }
 
    },
    handleLightEffect(){
        let action = this.light_action || PlayerAction.action_1
        if(this.summonBg && this.light_effect == null){
            this.light_effect = new cc.Node().addComponent(sp.Skeleton)
            this.summonBg.node.addChild(this.light_effect.node)
            this.light_effect.node.setPosition(0,-240)
            let effect_res = PathTool.getEffectRes("670");
            let effect_path = PathTool.getSpinePath(effect_res, "action");
            this.light_effect.setCompleteListener(this.animaComplete.bind(this))
            this.loadRes(effect_path,function(recruit_sk){
                this.light_effect.skeletonData = recruit_sk;
                this.light_effect.setAnimation(0, action);
            }.bind(this))
        }else if(this.light_effect){
            this.light_effect.setToSetupPose()
            this.light_effect.paused = false
            this.light_effect.setAnimation(0, action);
        }
    },
    handleBookEffect(){
        if(this.summonBg && this.book_effect == null){
            this.book_effect = new cc.Node().addComponent(sp.Skeleton)
            this.summonBg.node.addChild(this.book_effect.node)
            this.book_effect.node.setPosition(0,-240)
            let effect_res = PathTool.getEffectRes("672");
            let effect_path = PathTool.getSpinePath(effect_res, "action");
            this.loadRes(effect_path,function(recruit_sk){
                this.book_effect.skeletonData = recruit_sk;
                this.book_effect.setAnimation(0, PlayerAction.action);
            }.bind(this))
        }else if(this.book_effect){
            this.book_effect.setToSetupPose()
            this.book_effect.paused = false
            this.book_effect.setAnimation(0, PlayerAction.action);
        }
    },
    animaComplete(){
        this.summonBg.node.active = false;
        MainUiController.getInstance().setMainUIBottomStatus(true);        
        MainUiController.getInstance().setMainUITopStatus(true);   
        var PartnersummonController = require("partnersummon_controller")     
        PartnersummonController.getInstance().openSummonGainWindow(true);
    },
    // 当面板从主节点释放掉的调用接口,需要手动调用,而且也一定要调用
    onDelete:function(){
        if(this.award_item){
            this.award_item.deleteMe()
            this.award_item = null;
        }
        if(this.summon_timer){
            gcore.Timer.del(this.summon_timer);
            this.summon_timer = null
        }
    },
})