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
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
"use strict";
cc._RF.push(module, 'ed0a5fimtFPirDnn8tnfqpv', 'welfare_controller');
// Scripts/mod/welfare/welfare_controller.js
 
"use strict";
 
var _cc$Class;
 
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
 
// --------------------------------------------------------------------
// @author: xxx@syg.com(必填, 创建模块的人员)
// @description:
//     福利
// <br/>Create: 2018-12-19 10:57:29
// --------------------------------------------------------------------
var RoleController = require("role_controller");
 
var MainuiController = require("mainui_controller");
 
var MainuiConst = require("mainui_const");
 
var WelfareEvent = require("welfare_event");
 
var WelfareConst = require("welfare_const"); // var ActionConst = require("action_const");
 
 
var SHOW_BAIDU_TIEBA = true; // 是否显示百度贴吧
 
var SHOW_SINGLE_INVICODE = true; // 是否显示个人推荐码
 
var SHOW_BIND_PHONE = true; // 是否需要显示手机绑定界面
 
var SHOW_WECHAT_CERTIFY = true; // 是否显示微信公众号
 
var SHOW_GAME_SHARE = true; // 游戏分享
 
var WelfareController = cc.Class((_cc$Class = {
  "extends": BaseController,
  ctor: function ctor() {},
  // 初始化配置数据
  initConfig: function initConfig() {
    var WelfareModel = require("welfare_model");
 
    this.model = new WelfareModel();
    this.model.initConfig();
    this.welfare_list = {};
    this.welfare_status_list = {}; //福利状态列表
 
    this.welfare_cache_red = {}; //福利缓存红点状态
  },
  // 返回当前的model
  getModel: function getModel() {
    return this.model;
  },
  // 注册监听事件
  registerEvents: function registerEvents() {
    if (this.init_role_event == null) {
      this.init_role_event = gcore.GlobalEvent.bind(EventId.EVT_ROLE_CREATE_SUCCESS, function () {
        gcore.GlobalEvent.unbind(this.init_role_event);
        this.init_role_event = null; // this.requestInitProto();
 
        this.role_vo = RoleController.getInstance().getRoleVo();
 
        if (this.role_assets_event == null) {
          this.role_assets_event = this.role_vo.bind(EventId.UPDATE_ROLE_ATTRIBUTE, function (key, value) {
            if (key == "lev") {
              this.updateWelfareRedStatus(value);
            }
          }, this);
        }
      }, this);
    } //断线重连请求月卡
 
 
    if (this.re_link_game_event == null) {
      this.re_link_game_event = gcore.GlobalEvent.bind(EventId.EVT_RE_LINK_GAME, function () {
        var GuideController = require("guide_controller");
 
        if (!GuideController.getInstance().isInGuide()) this.openMainWindow(false); //判断精彩活动图标在不在,请求精彩活动的数据
 
        var vo = MainuiController.getInstance().getFunctionIconById(MainuiConst.icon.welfare);
 
        if (vo != null) {
          this.sender16705();
        }
      }, this);
    }
  },
  // 注册协议接受事件
  registerProtocals: function registerProtocals() {
    this.RegisterProtocal(14100, this.handle14100); //签到信息
 
    this.RegisterProtocal(14101, this.handle14101); //领取签到奖励
 
    this.RegisterProtocal(16705, this.handle16705); //月卡信息
 
    this.RegisterProtocal(16706, this.handle16706); //领取月卡
 
    this.RegisterProtocal(21002, this.handle21002); //今日充值次数
    //调查问卷
 
    this.RegisterProtocal(24600, this.handle24600);
    this.RegisterProtocal(24601, this.handle24601);
    this.RegisterProtocal(24602, this.handle24602);
    this.RegisterProtocal(24603, this.handle24603);
    this.RegisterProtocal(24604, this.handle24604);
    this.RegisterProtocal(21007, this.handle21007); // 每日礼
 
    this.RegisterProtocal(21008, this.handle21008);
    this.RegisterProtocal(21009, this.handle21009); // 手机绑定奖励状态
 
    this.RegisterProtocal(16635, this.handle16635);
    this.RegisterProtocal(16636, this.handle16636);
    this.RegisterProtocal(16697, this.handle16697);
    this.RegisterProtocal(16698, this.handle16698); // 微信公众号
 
    this.RegisterProtocal(16633, this.handle16633);
    this.RegisterProtocal(16634, this.handle16634); //爱微游分享和关注
 
    this.RegisterProtocal(16691, this.handle16691);
    this.RegisterProtocal(16693, this.handle16693);
    this.RegisterProtocal(16692, this.handle16692);
    this.RegisterProtocal(16694, this.handle16694); //深海小游戏收藏
 
    this.RegisterProtocal(16695, this.handle16695);
    this.RegisterProtocal(16696, this.handle16696);
  },
  //登录请求的协议
  requestInitProto: function requestInitProto() {
    this.sender14100(); //签到红点
 
    this.sender16705(); //月卡信息
 
    this.sender24600(); //问卷
 
    this.sender21008(); //每日礼
 
    this.sender16635(); //手机绑定奖励状态
 
    this.sender16633();
    this.send16693();
    this.send16691();
  },
  //签到信息
  sender14100: function sender14100() {
    var protocal = {};
    this.SendProtocal(14100, protocal);
  },
  //月卡信息
  sender16705: function sender16705() {
    var protocal = {};
    this.SendProtocal(16705, protocal);
  },
  //调查问卷状态
  sender24600: function sender24600() {
    this.SendProtocal(24600, {});
  },
  //请求每日礼状态
  sender21008: function sender21008() {
    this.SendProtocal(21008, {});
  },
  //请求手机绑定信息
  sender16635: function sender16635() {
    this.SendProtocal(16635, {});
  },
  sender16633: function sender16633() {
    this.SendProtocal(16633, {});
  },
  handle14100: function handle14100(data) {
    gcore.GlobalEvent.fire(WelfareEvent.Update_Sign_Info, data);
    var is_show = false;
    var recharge_count = this.model.getRechargeCount();
 
    if (data.status == 0 || recharge_count > 0 && data.status == 1) {
      is_show = true;
    }
 
    this.setWelfareStatus(WelfareConst.WelfareIcon.sign, is_show);
  },
  //领取签到奖励
  sender14101: function sender14101() {
    var protocal = {};
    this.SendProtocal(14101, protocal);
  },
  handle14101: function handle14101(data) {
    message(data.msg);
 
    if (data.code == 1) {
      gcore.GlobalEvent.fire(WelfareEvent.Sign_Success, data);
      var is_show = false;
      var recharge_count = this.model.getRechargeCount();
 
      if (data.status == 0 || recharge_count > 0 && data.status == 1) {
        is_show = true;
      }
 
      this.setWelfareStatus(WelfareConst.WelfareIcon.sign, is_show);
    }
  },
  handle16705: function handle16705(data) {
    this.model.setYueka(data);
    gcore.GlobalEvent.fire(WelfareEvent.Update_Yueka, data);
    var supre_status = false; //至尊月卡
 
    var honor_status = false; //荣耀月卡
 
    if (data.card1_is_reward == 1) {
      supre_status = true;
    }
 
    if (data.card2_is_reward == 1) {
      honor_status = true;
    }
 
    this.setWelfareStatus(WelfareConst.WelfareIcon.supre_yueka, supre_status);
    this.setWelfareStatus(WelfareConst.WelfareIcon.honor_yueka, honor_status);
  },
  sender16706: function sender16706(card_type) {
    var protocal = {};
    protocal.card_type = card_type;
    this.SendProtocal(16706, protocal);
  },
  handle16706: function handle16706(data) {
    message(data.msg);
 
    if (data.code == 1) {
      gcore.GlobalEvent.fire(WelfareEvent.Update_Get_Yueka, data.card_type);
 
      if (data.card_type == 1) {
        this.setWelfareStatus(WelfareConst.WelfareIcon.supre_yueka, false);
      } else if (data.card_type == 2) {
        this.setWelfareStatus(WelfareConst.WelfareIcon.honor_yueka, false);
      }
    }
  },
  //今日充值次数
  sender21002: function sender21002() {
    var protocal = {};
    this.SendProtocal(21002, protocal);
  },
  handle21002: function handle21002(data) {
    this.model.setRechargeCount(data.count);
    this.sender14100(); //更新下签到红点
  },
  //判断一个福利是否开启了
  checkCanAdd: function checkCanAdd(bid) {
    var config = gdata("holiday_client_data", "data_info", [bid]);
    if (config == null) return false;
    var role_vo = RoleController.getInstance().getRoleVo();
    if (role_vo.lev < config.open_lev) return false;
    var is_verifyios = config.is_verifyios;
    if (is_verifyios == 1) return true; //如果是提审服都要显示
 
    if (bid == WelfareConst.WelfareIcon.bindphone) {
      return SHOW_BIND_PHONE;
    } else if (bid == WelfareConst.WelfareIcon.wechat) {
      return SHOW_WECHAT_CERTIFY;
    } else if (bid == WelfareConst.WelfareIcon.poste) {
      return SHOW_BAIDU_TIEBA;
    } else if (bid == WelfareConst.WelfareIcon.invicode) {
      return SHOW_SINGLE_INVICODE;
    } else if (bid == WelfareConst.WelfareIcon.share_game) {
      return SHOW_GAME_SHARE;
    } else {
      return IS_SHOW_CHARGE;
    }
  },
  //打开福利主界面 bid取WelfareConstants WelfareIcon 跳转指定标签页 
  openMainWindow: function openMainWindow(status, bid) {
    if (status == true) {
      if (IS_SHOW_CHARGE == false) //福利面板在不可充值不要打开了
        return;
      var role_vo = RoleController.getInstance().getRoleVo();
      var data_info = Config.holiday_client_data.data_info;
 
      if (data_info && data_info[bid]) {
        if (role_vo.lev < data_info[bid].open_lev) {
          message(cc.js.formatStr(Utils.TI18N("人物等级%s开启"), data_info[bid].open_lev));
          return;
        }
      } //默认福利
      //这里重新设置一下标签
 
 
      var sub_vo = null;
 
      for (var k in Config.holiday_client_data.data_info) {
        var v = gdata("holiday_client_data", "data_info", [k]);
 
        if (this.welfare_list[v.bid] == null) {
          if (this.checkCanAdd(v.bid)) {
            var WelfareSubTabVo = require("welfare_sub_tab_vo");
 
            sub_vo = new WelfareSubTabVo();
 
            if (sub_vo.update != null) {
              sub_vo.update(v);
            }
 
            this.welfare_list[v.bid] = sub_vo;
          }
        }
      }
 
      if (!this.welfare_win) {
        this.welfare_win = Utils.createClass("welfare_main_window");
      }
 
      this.welfare_win.open(bid);
    } else {
      if (this.welfare_win != null) {
        this.welfare_win.close();
        this.welfare_win = null;
      }
    }
  },
  //获取福利标签列表
  getWelfareSubList: function getWelfareSubList() {
    var welfare_sub_list = [];
 
    var ActionController = require("action_controller");
 
    if (this.welfare_list != null && Utils.next(this.welfare_list) != null) {
      for (var k in this.welfare_list) {
        var v = this.welfare_list[k];
        var need_add = true;
 
        if (ActionController.getInstance().isSpecialBid(v.bid)) {
          var vo = ActionController.getInstance().getActionSubTabVo(v.bid);
 
          if (vo == null) {
            need_add = false;
          }
        } else if (v.bid == WelfareConst.WelfareIcon.quest) {
          var open = this.model.getQuestOpenData();
 
          if (open && open.status == 0) {
            need_add = false;
          }
        } else if (v.bid == WelfareConst.WelfareIcon.bindphone) {
          var is_over = this.checkBindPhoneStatus();
 
          if (is_over == true) {
            need_add = false;
          }
        } else if (v.bid == WelfareConst.WelfareIcon.wechat) {
          //官微福利
          // if (PLATFORM_TYPR == "SH_RH") {   //已关注并且领取了奖励
          //     if (window.SH_RH_IS_SUBSCRIBE == true && this.model.getSubscriptionAwardStatus() == 1) {
          //         need_add = false;
          //     }
          // }
          if (USE_SDK == true && (PLATFORM_TYPR == "QQ_SDK" || PLATFORM_TYPR == "SH_SDK")) {
            need_add = false;
          } else if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_SUBSCRIBE == false) {
            need_add = false;
          } else if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_SUBSCRIBE == false) {
            need_add = false;
          }
        } else if (v.bid == WelfareConst.WelfareIcon.invicode) {
          //推荐码
          if (USE_SDK == true && PLATFORM_TYPR == "QQ_SDK") {
            need_add = false;
          }
        } else if (v.bid == WelfareConst.WelfareIcon.poste) {
          //贴吧
          if (USE_SDK == true && PLATFORM_TYPR == "QQ_SDK") {
            need_add = false;
          }
        } else if (v.bid == WelfareConst.WelfareIcon.share_game) {
          //邀请好友
          if (USE_SDK == true && (PLATFORM_TYPR == "QQ_SDK" || PLATFORM_TYPR == "SH_SDK")) {
            need_add = false;
          } else if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_SHARE == false) {
            need_add = false;
          } else if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_SHARE == false) {
            need_add = false;
          }
        } else if (v.bid == WelfareConst.WelfareIcon.qq_notice) {
          //QQ公告
          if (USE_SDK == false || PLATFORM_TYPR != "QQ_SDK") {
            need_add = false;
          }
        } else if (v.bid == WelfareConst.WelfareIcon.sh_share_game || v.bid == WelfareConst.WelfareIcon.sh_collect) {
          //深海小程序游戏分享 深海小程序微信公众号 收藏有礼
          if (USE_SDK == false || PLATFORM_TYPR != "SH_SDK") {
            need_add = false;
          }
        } else if (v.bid == WelfareConst.WelfareIcon.sh_wechat) {
          //深海小程序微信公众号
          if (USE_SDK == false || PLATFORM_TYPR != "SH_SDK" || window.SH_SDK_FOLLOW == true) {
            need_add = false;
          }
        }
 
        if (need_add == true) {
          welfare_sub_list.push(v);
        }
      }
    }
 
    if (Utils.next(welfare_sub_list) != null) {
      welfare_sub_list.sort(Utils.tableLowerSorter(["sort_val"]));
    }
 
    return welfare_sub_list;
  },
  //升级的时候判断红点
  updateWelfareRedStatus: function updateWelfareRedStatus(level) {
    if (level == null) return;
    if (this.welfare_cache_red == null || this.welfare_cache_red[level] == null) return;
    var list = this.welfare_cache_red[level];
 
    for (var k in list) {
      this.setWelfareStatus(k, list[k]);
    }
  },
  //设置福利图标的状态,如果图标没有开启 应该不需要设置红点
  setWelfareStatus: function setWelfareStatus(bid, status) {
    if (this.checkCanAdd(bid) == false) {
      var config = gdata("holiday_client_data", "data_info", [bid]);
 
      if (config) {
        if (this.welfare_cache_red[config.open_lev] == null) {
          this.welfare_cache_red[config.open_lev] = {};
        }
 
        this.welfare_cache_red[config.open_lev][bid] = status;
      }
    } else {
      if (this.welfare_status_list == null) {
        this.welfare_status_list = [];
      }
 
      var num = 0;
      if (status == true) num = 1;
      var vo = {
        bid: bid,
        num: num
      };
      var vo1 = {
        bid: bid,
        status: status
      };
      this.welfare_status_list[bid] = vo1; //贴吧的红点(由于没有用到协议只能特殊处理)
 
      this.setPosteWelfareStatus(true); //这是福利功能图标红点
 
      MainuiController.getInstance().setFunctionTipsStatus(MainuiConst.icon.welfare, vo); //福利标签的面板
 
      gcore.GlobalEvent.fire(WelfareEvent.UPDATE_WELFARE_TAB_STATUS, vo1);
    }
  },
  ///贴吧的红点
  setPosteWelfareStatus: function setPosteWelfareStatus(status) {},
  //根据id获取福利的标签页状态,主要是获取是否有红点
  getWelfareStatusByID: function getWelfareStatusByID(id) {
    if (this.welfare_status_list) return this.welfare_status_list[id];
  },
  handle21008: function handle21008(data) {
    this.model.setDailyAwardStatus(data.status);
    gcore.GlobalEvent.fire(WelfareEvent.Update_Daily_Awawd_Data);
  },
  //请求领取每日礼
  sender21009: function sender21009() {
    this.SendProtocal(21009, {});
  },
  handle21009: function handle21009(data) {
    message(data.msg);
  },
  openSureveyQuestView: function openSureveyQuestView(status) {
    if (status == true) {
      if (!this.sureveyQuestWindow) {
        this.sureveyQuestWindow = Utils.createClass("sureveyquest_window", this);
      }
 
      this.sureveyQuestWindow.open();
    } else {
      if (this.sureveyQuestWindow) {
        this.sureveyQuestWindow.close();
        this.sureveyQuestWindow = null;
      }
    }
  },
  //调查问卷协议
  handle24600: function handle24600(data) {
    if (data.status == 1 && (data.flag == 0 || data.flag == 1)) {
      this.setWelfareStatus(WelfareConst.WelfareIcon.quest, true);
    } else {
      this.setWelfareStatus(WelfareConst.WelfareIcon.quest, false);
    }
 
    this.model.setQuestOpenData(data);
  },
  //获取答卷基本内容
  sender24601: function sender24601() {
    this.SendProtocal(24601, {});
  },
  handle24601: function handle24601(data) {
    gcore.GlobalEvent.fire(WelfareEvent.Get_SureveyQuest_Basic, data);
  },
  //获取答卷题目信息
  sender24602: function sender24602() {
    this.SendProtocal(24602, {});
  },
  handle24602: function handle24602(data) {
    gcore.GlobalEvent.fire(WelfareEvent.Get_SureveyQuest_Topic_Content, data);
  },
  //答卷
  sender24603: function sender24603(list) {
    var protocal = {};
    protocal.ret_list = list;
    this.SendProtocal(24603, protocal);
  },
  handle24603: function handle24603(data) {
    message(data.msg);
 
    if (data.code == 1) {
      gcore.GlobalEvent.fire(WelfareEvent.SureveyQuest_Submit, data);
    }
  },
  //领取奖励
  sender24604: function sender24604() {
    this.SendProtocal(24604, {});
  },
  handle24604: function handle24604(data) {
    message(data.msg);
 
    if (data.code == 1) {
      gcore.GlobalEvent.fire(WelfareEvent.Get_SureveyQuest_Get_Reward, data);
    }
  },
  //周、月礼包
  sender21007: function sender21007(index) {
    var protocal = {};
    protocal.type = index || 1;
    this.SendProtocal(21007, protocal);
  },
  handle21007: function handle21007(data) {
    gcore.GlobalEvent.fire(WelfareEvent.Updata_Week_Month_Data, data);
  }
}, _defineProperty(_cc$Class, "handle21008", function handle21008(data) {
  this.model.setDailyAwardStatus(data.status);
  gcore.GlobalEvent.fire(WelfareEvent.Update_Daily_Awawd_Data);
}), _defineProperty(_cc$Class, "sender21009", function sender21009() {
  var protocal = {};
  this.SendProtocal(21009, protocal);
}), _defineProperty(_cc$Class, "handle21009", function handle21009(data) {
  message(data.msg);
}), _defineProperty(_cc$Class, "openCertifyBindPhoneWindow", function openCertifyBindPhoneWindow(status) {
  if (!status) {
    if (this.certify_phone) {
      this.certify_phone.close();
      this.certify_phone = null;
    }
  } else {
    if (this.certify_phone == null) {
      this.certify_phone = Utils.createClass("certify_bind_phone_window");
    }
 
    this.certify_phone.open();
  }
}), _defineProperty(_cc$Class, "checkBindPhoneStatus", function checkBindPhoneStatus() {
  if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_BINDPHONE == false && PLATFORM_NAME == "shmix") {
    return true;
  }
 
  if (this.bind_phone_data == null || this.bind_phone_data.code != 0 || USE_SDK == true && (PLATFORM_TYPR == "QQ_SDK" || PLATFORM_TYPR == "SH_SDK")) {
    return true;
  }
 
  return false;
}), _defineProperty(_cc$Class, "getBindPhoneData", function getBindPhoneData() {
  return this.bind_phone_data;
}), _defineProperty(_cc$Class, "handle16635", function handle16635(data) {
  if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_BINDPHONE == false && PLATFORM_NAME == "shmix") {
    this.setWelfareStatus(WelfareConst.WelfareIcon.bindphone, false);
    return;
  }
 
  this.bind_phone_data = data;
  this.bind_phone_data.status = data.code;
 
  if (data.code == 0 && SHOW_BIND_PHONE) {
    //未绑定的时候显示红点
    this.setWelfareStatus(WelfareConst.WelfareIcon.bindphone, true);
  }
}), _defineProperty(_cc$Class, "requestBindPhone", function requestBindPhone(number, code) {
  var protocal = {};
  protocal.number = number;
  protocal.code = code;
 
  if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_BINDPHONE == false && PLATFORM_NAME == "shmix") {
    return;
  }
 
  this.SendProtocal(16636, protocal);
}), _defineProperty(_cc$Class, "handle16636", function handle16636(data) {
  if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_BINDPHONE == false && PLATFORM_NAME == "shmix") {
    return;
  }
 
  if (this.bind_phone_data == null) return;
  message(data.msg);
  this.bind_phone_data.status = data.code; //0:失败 1:领取奖励成功 2:发送验证码成功
 
  if (data.code != 0) {
    //发送手机验证完成
    if (data.code == 1) {
      this.bind_phone_data.code = 1;
      this.openCertifyBindPhoneWindow(false);
    }
 
    gcore.GlobalEvent.fire(WelfareEvent.UpdateBindPhoneStatus, this.bind_phone_data);
  }
}), _defineProperty(_cc$Class, "handle16633", function handle16633(data) {// if (SHOW_WECHAT_CERTIFY) {
  //     this.wechat_subscription_data = data;
  //     if (data.code == 0) {
  //         this.setWelfareStatus(WelfareConst.WelfareIcon.wechat, true)
  //     }
  // }
  // if (PLATFORM_TYPR == "SH_RH") {
  //     this.setWelfareStatus(WelfareConst.WelfareIcon.wechat, this.model.getSubscriptionAwardStatus() == 0);
  // }
}), _defineProperty(_cc$Class, "tellServerWechatStatus", function tellServerWechatStatus() {// if (this.wechat_subscription_data && this.wechat_subscription_data.code == 1) return
  // this.SendProtocal(16634, {});
}), _defineProperty(_cc$Class, "handle16634", function handle16634(data) {// if (this.wechat_subscription_data) {
  //     this.wechat_subscription_data.code = 1;
  //     this.setWelfareStatus(WelfareConst.WelfareIcon.wechat, false)
  // }
  // if (PLATFORM_TYPR == "SH_RH") {
  //     this.setWelfareStatus(WelfareConst.WelfareIcon.wechat, false);
  // }
}), _defineProperty(_cc$Class, "getWechatData", function getWechatData() {
  return this.wechat_subscription_data;
}), _defineProperty(_cc$Class, "getWelfareRoot", function getWelfareRoot() {
  if (this.welfare_win) return this.welfare_win.root_wnd;
}), _defineProperty(_cc$Class, "send16691", function send16691() {
  this.SendProtocal(16691, {});
}), _defineProperty(_cc$Class, "handle16691", function handle16691(data) {
  // cc.log("16691", data)
  if (data) {
    this.model.setShareAward(data.items);
    this.model.setShareAwardStatus(data.code);
 
    if (data.code == 1) {
      if (PLATFORM_TYPR == "SH_SDK") {
        MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_share);
      } else {
        MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shrh_share);
      }
    }
  }
}), _defineProperty(_cc$Class, "send16692", function send16692(id) {
  var protocal = {};
  protocal.id = id;
  this.SendProtocal(16692, protocal);
}), _defineProperty(_cc$Class, "handle16692", function handle16692(data) {
  // cc.log("16692", data)
  message(data.msg);
 
  if (data && data.code == 1) {
    this.model.setShareAwardStatus(data.code);
    gcore.GlobalEvent.fire(WelfareEvent.Update_get_SHRH_share_award_status, data.code);
 
    if (PLATFORM_TYPR == "SH_SDK") {
      MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_share);
    } else {
      MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shrh_share);
    }
  }
}), _defineProperty(_cc$Class, "send16693", function send16693() {
  this.SendProtocal(16693, {});
}), _defineProperty(_cc$Class, "handle16693", function handle16693(data) {
  // cc.log("16693", data)
  if (data) {
    this.model.setSubscriptionAward(data.items);
    this.model.setSubscriptionAwardStatus(data.code);
 
    if (data.code == 1) {
      if (PLATFORM_TYPR == "SH_SDK") {
        MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_sub);
      } else {
        MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shrh_sub);
      } // this.SendProtocal(16634, {});
 
    }
  }
}), _defineProperty(_cc$Class, "send16694", function send16694(id) {
  var protocal = {};
  protocal.id = id;
  this.SendProtocal(16694, protocal); // RoleController.getInstance().sender10945(str)
}), _defineProperty(_cc$Class, "handle16694", function handle16694(data) {
  // cc.log("16694", data)
  message(data.msg);
 
  if (data && data.code == 1) {
    gcore.GlobalEvent.fire(WelfareEvent.Update_SHRH_Award_Status, 1);
    this.model.setSubscriptionAwardStatus(data.code); // this.SendProtocal(16634, {});
 
    if (PLATFORM_TYPR == "SH_SDK") {
      MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_sub);
    } else {
      MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shrh_sub);
    }
  }
}), _defineProperty(_cc$Class, "send16695", function send16695() {
  var protocal = {};
  this.SendProtocal(16695, protocal);
}), _defineProperty(_cc$Class, "handle16695", function handle16695(data) {
  if (data) {
    this.model.setCollectAward(data.items);
    this.model.setCollectAwardStatus(data.code);
 
    if (data.code == 1) {
      MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_collect);
    }
  }
}), _defineProperty(_cc$Class, "send16696", function send16696() {
  var protocal = {};
  this.SendProtocal(16696, protocal);
}), _defineProperty(_cc$Class, "handle16696", function handle16696(data) {
  message(data.msg);
 
  if (data && data.code == 1) {
    this.model.setCollectAwardStatus(data.code);
    gcore.GlobalEvent.fire(WelfareEvent.Update_get_SHWX_collect_award_status, 1);
    MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_collect);
  }
}), _defineProperty(_cc$Class, "shrhShareStatus", function shrhShareStatus(status, data) {
  // message("分享成功!!!!", data)
  gcore.GlobalEvent.fire(WelfareEvent.Update_get_SHRH_share_award_status, 2);
}), _defineProperty(_cc$Class, "shrhRealNameStatus", function shrhRealNameStatus(status) {
  if (status) {
    MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shrh_realname);
  }
}), _defineProperty(_cc$Class, "send16697", function send16697() {
  this.SendProtocal(16697, {});
}), _defineProperty(_cc$Class, "handle16697", function handle16697(data) {
  if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_BINDPHONE == false && PLATFORM_NAME == "shmix") {
    this.setWelfareStatus(WelfareConst.WelfareIcon.bindphone, false);
    return;
  }
 
  if (data && PLATFORM_NAME == "shmix") {
    this.bind_phone_data = data;
    this.bind_phone_data.status = data.code;
 
    if (data.code == 0 && SHOW_BIND_PHONE) {
      //未绑定的时候显示红点
      this.setWelfareStatus(WelfareConst.WelfareIcon.bindphone, true);
    }
  }
}), _defineProperty(_cc$Class, "send16698", function send16698() {
  var protocal = {};
  this.SendProtocal(16698, protocal);
}), _defineProperty(_cc$Class, "handle16698", function handle16698(data) {
  message(data.msg);
  this.bind_phone_data.status = data.code;
 
  if (data && data.code == 1) {
    this.bind_phone_data.code = data.code;
    gcore.GlobalEvent.fire(WelfareEvent.UpdateBindPhoneStatus, 1);
  }
}), _cc$Class));
module.exports = WelfareController;
 
cc._RF.pop();