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
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
"use strict";
cc._RF.push(module, '3f27dqUQapJ4LUEFzPeFEif', 'action_model');
// Scripts/mod/action/action_model.js
 
"use strict";
 
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: 2019-03-02 16:49:03
// --------------------------------------------------------------------
var MainuiController = require("mainui_controller");
 
var MainuiConst = require("mainui_const");
 
var ActionEvent = require("action_event");
 
var ActionConst = require("action_const");
 
var ActionModel = cc.Class({
  "extends": BaseClass,
  ctor: function ctor() {},
  properties: {},
  initConfig: function initConfig() {
    // -- 基金红点数据
    this.fund_red_list = {};
  },
  //------------------@ 基金活动相关
  // -- 开启中的基金活动id
  setOpenFundIds: function setOpenFundIds(id_list) {
    this.fund_id_list = id_list || [];
    this.checkFundRedStatus();
  },
  getOpenFundIds: function getOpenFundIds() {
    return this.fund_id_list || [];
  },
  // -- 设置基金的数据
  setFundSrvData: function setFundSrvData(data) {
    this.fund_datas = this.fund_datas || {};
 
    if (data && data.id) {
      this.fund_datas[data.id] = data;
      this.updateFundStatus(data.id, data.status);
    }
  },
  // -- 获取基金数据
  getFundSrvDataById: function getFundSrvDataById(id) {
    this.fund_datas = this.fund_datas || {};
    return this.fund_datas[id] || {};
  },
  updateFundStatus: function updateFundStatus(id, status) {
    this.fund_id_list = this.fund_id_list || [];
 
    for (var k = 0; k < this.fund_id_list.length; ++k) {
      var v = this.fund_id_list[k];
 
      if (v.id == id) {
        v.status = status;
        break;
      }
    }
 
    this.checkFundRedStatus();
  },
  //检查超值基金红点
  checkFundRedStatus: function checkFundRedStatus() {
    this.fund_id_list = this.fund_id_list || [];
 
    for (var k = 0; k < this.fund_id_list.length; ++k) {
      var v = this.fund_id_list[k];
 
      if (v.id == ActionConst.FundType.type_one) {
        this.updateFundRedStatus(ActionConst.FundRedIndex.fund_get_one, v.status == 1);
        this.updateFundRedStatus(ActionConst.FundRedIndex.fund_buy_one, v.status == 0);
      } else if (v.id == ActionConst.FundType.type_two) {
        this.updateFundRedStatus(ActionConst.FundRedIndex.fund_get_two, v.status == 1);
        this.updateFundRedStatus(ActionConst.FundRedIndex.fund_buy_two, v.status == 0);
      }
    }
  },
  // -- 更新基金红点数据
  updateFundRedStatus: function updateFundRedStatus(bid, status) {
    var _status = this.fund_red_list[bid];
    if (_status == status) return; // -- 购买的红点只有登陆时才显示,点击之后消失,之后不再显示
 
    if ((bid == ActionConst.FundRedIndex.fund_buy_one || bid == ActionConst.FundRedIndex.fund_buy_two) && _status == false) {
      return;
    }
 
    this.fund_red_list[bid] = status;
    var red_status = false;
 
    for (var k in this.fund_red_list) {
      var v = this.fund_red_list[k];
 
      if (v == true) {
        red_status = true;
        break;
      }
    }
 
    MainuiController.getInstance().setFunctionTipsStatus(MainuiConst.icon.fund, red_status);
    gcore.GlobalEvent.fire(ActionEvent.UPDATA_FUND_RED_STATUS_EVENT);
  },
  updateSevenLoginData: function updateSevenLoginData(data) {
    this.seven_login_data = data;
  },
  getSevenLoginData: function getSevenLoginData() {
    return this.seven_login_data;
  },
  // --desc:获取当前可领取7天登录的最大天数
  getMaxSevenDay: function getMaxSevenDay() {
    if (this.seven_login_data == null || this.seven_login_data.status_list == null) return;
    var status_list = this.seven_login_data.status_list;
    status_list.sort(function (a, b) {
      return a.day - b.day;
    });
    var day = null;
 
    for (var i in status_list) {
      if (status_list[i].status == 2) {
        day = status_list[i];
        break;
      }
    }
 
    if (day == null) {
      day = status_list[status_list.length];
    }
 
    return day;
  },
  setFirstBtnStatus: function setFirstBtnStatus(data) {
    this.firstBtnStatus = {};
 
    for (var i = 0; i < data.length; ++i) {
      var v = data[i];
      this.firstBtnStatus[v.id] = v.status;
    }
  },
  getFirstBtnStatus: function getFirstBtnStatus(index) {
    if (!this.firstBtnStatus) return;
    return this.firstBtnStatus[index] || 0;
  },
  // 获取七日目标的周期数
  setSevenGoldPeriod: function setSevenGoldPeriod(period) {
    this.sevenPeriod = period;
  },
  getSevenGoldPeriod: function getSevenGoldPeriod() {
    return this.sevenPeriod;
  },
  // 七天目标检查红点   --当前天数以下的
  checkRedPoint: function checkRedPoint(day) {
    if (day < 1 || day > 7) return;
    day = day || 1; // 福利
 
    this.welfareRetPoint = [];
 
    for (var i = 1; i <= day; i++) {
      var welfare = this.getSevenGoalWelfareList(i);
      this.welfareRetPoint[i] = false;
 
      for (var k in welfare) {
        if (welfare[k].status == 1) {
          this.welfareRetPoint[i] = true;
          break;
        }
      }
    } // 每日目标
 
 
    this.growRetPoint = [];
 
    for (var i = 1; i <= day; i++) {
      var grow = this.getServerGrowListData(i - 1);
      this.growRetPoint[i] = false;
 
      for (var k in grow) {
        if (grow[k].status == 1) {
          this.growRetPoint[i] = true;
          break;
        }
      }
    } // 超值礼包
 
 
    this.giftRetPoint = [];
 
    for (var i = 1; i <= day; i++) {
      var grow = this.getServerGiftListData(i - 1);
      this.giftRetPoint[i] = false;
 
      for (var k in grow) {
        if (grow[k].status == 1) {
          this.giftRetPoint[i] = true;
          break;
        }
      }
    }
 
    this.halfRedPoint = []; // 0、还有领取  1、已领取
 
    for (var i = 1; i <= day; i++) {
      var half = this.getHalfGiftList(i);
      this.halfRedPoint[i] = false;
 
      for (var k in half) {
        if (k == 0 && half[k].status == 0) {
          this.halfRedPoint[i] = true;
          break;
        }
      }
    } // 宝箱
 
 
    this.boxRedPoint = [];
    var box = this.getSevenGoalBoxList();
 
    for (var i in box) {
      this.boxRedPoint[i] = false;
 
      if (box[i].status == 1) {
        this.boxRedPoint[i] = true;
      }
    }
 
    var redStatus = false;
    var redStatus1 = false;
    var redStatus2 = false;
    var redStatus3 = false;
    var redStatus4 = false;
    var redStatus5 = false;
 
    for (var i in this.welfareRetPoint) {
      if (this.welfareRetPoint[i] == true) {
        redStatus1 = true;
        break;
      }
    }
 
    for (var i in this.growRetPoint) {
      if (this.growRetPoint[i] == true) {
        redStatus2 = true;
        break;
      }
    }
 
    for (var i in this.giftRetPoint) {
      if (this.giftRetPoint[i] == true) {
        redStatus3 = true;
        break;
      }
    }
 
    for (var i in this.halfRedPoint) {
      if (this.halfRedPoint[i] == true) {
        redStatus5 = true;
        break;
      }
    }
 
    for (var i in this.boxRedPoint) {
      if (this.boxRedPoint[i] == true) {
        redStatus4 = true;
        break;
      }
    }
 
    redStatus = redStatus1 || redStatus2 || redStatus3 || redStatus4 || redStatus5;
    var icon_id = MainuiConst.icon.seven_goal;
 
    if (this.getSevenGoldPeriod() == 1) {
      icon_id = MainuiConst.icon.seven_goal;
    } else if (this.getSevenGoldPeriod() == 2) {
      icon_id = MainuiConst.icon.seven_goal1;
    } else if (this.getSevenGoldPeriod() == 3) {
      icon_id = MainuiConst.icon.seven_goal2;
    } else {
      icon_id = MainuiConst.icon.seven_goal3;
    }
 
    MainuiController.getInstance().setFunctionTipsStatus(icon_id, redStatus);
  },
  // 红点状态
  getRedPointWelfareStatus: function getRedPointWelfareStatus(day) {
    if (!this.welfareRetPoint) return;
    var status = false;
    status = this.welfareRetPoint[day];
    return status;
  },
  // 更新
  updataRedPointWelfareStatus: function updataRedPointWelfareStatus(day, status) {
    if (!this.welfareRetPoint) return;
    this.welfareRetPoint[day] = status;
  },
  getRedPointGrowStatus: function getRedPointGrowStatus(day) {
    if (!this.growRetPoint) return;
    var status = false;
    status = this.growRetPoint[day];
    return status;
  },
  // 更新
  updataRedPointGrowStatus: function updataRedPointGrowStatus(day, status) {
    if (!this.growRetPoint) return;
    this.growRetPoint[day] = status;
  },
  getRedPointGiftStatus: function getRedPointGiftStatus(day) {
    if (!this.giftRetPoint) return;
    var status = false;
    status = this.giftRetPoint[day];
    return status;
  },
  // 更新
  updataRedPointGiftStatus: function updataRedPointGiftStatus(day, status) {
    if (!this.giftRetPoint) return;
    this.giftRetPoint[day] = status;
  },
  // 福利礼包
  getRedPointHalfStatus: function getRedPointHalfStatus(day) {
    if (!this.halfRedPoint) return;
    var status = false;
    status = this.halfRedPoint[day];
    return status;
  },
  // 更新
  updataRedPointHalfStatus: function updataRedPointHalfStatus(day, status) {
    if (!this.halfRedPoint) return;
    this.halfRedPoint[day] = status;
  },
  getRedPointBoxStatus: function getRedPointBoxStatus(index) {
    if (!this.boxRedPoint) return;
    var status = false;
    status = this.boxRedPoint[index];
    return status;
  },
  // 更新
  updataRedPointBoxStatus: function updataRedPointBoxStatus(index, status) {
    if (!this.boxRedPoint) return;
    this.boxRedPoint[index] = status;
  },
  // 七天目标*********** start *****
  initSevenWalfare: function initSevenWalfare(index) {
    this.setWalfareData(index);
    this.setWalfareGrowUpData(index);
    this.setHalfGiftData(index);
    this.setBoxRewardData(index);
  },
  // 宝箱
  setBoxRewardData: function setBoxRewardData(index) {
    var data = Config.day_goals_data.data_all_target[index];
    this.boxRewardData = [];
 
    for (var i in data) {
      this.boxRewardData.push(data[i][0]);
    }
 
    this.boxRewardData.sort(function (a, b) {
      return a.id - b.id;
    });
  },
  getBoxRewardData: function getBoxRewardData() {
    return this.boxRewardData || [];
  },
  // 福利
  setWalfareData: function setWalfareData(index) {
    var data = Config.day_goals_data.data_welfarecollection[index];
    this.welfareData = Utils.deepCopy(data);
  },
  // 成长目标
  setWalfareGrowUpData: function setWalfareGrowUpData(index) {
    var data = Config.day_goals_data.data_growthtarget[index];
    this.welfareGrowData = [];
    this.welfareGiftData = [];
 
    for (var i in data) {
      var tab = [];
      var tab1 = [];
 
      for (var k in data[i]) {
        if (data[i][k].target_type == 1) {
          tab.push(data[i][k]);
        } else if (data[i][k].target_type == 2) {
          tab1.push(data[i][k]);
        }
      }
 
      this.welfareGrowData.push(tab);
      this.welfareGiftData.push(tab1);
    }
  },
  // 福利礼包
  setHalfGiftData: function setHalfGiftData(index) {
    var data = Config.day_goals_data.data_halfdiscount[index];
    this.walfareHalfData = [];
 
    for (var i = 1; i <= 7; i++) {
      this.walfareHalfData[i] = [];
    }
 
    for (var i in data) {
      this.walfareHalfData[data[i][0].day].push(data[i][0]);
    }
 
    for (var i = 1; i <= 7; i++) {
      this.walfareHalfData[i].sort(function (a, b) {
        return a.id - b.id;
      });
    }
  },
  getWalfareData: function getWalfareData(day) {
    if (!this.welfareData) return;
    return this.welfareData[day] || [];
  },
  getWalfareGrowUpData: function getWalfareGrowUpData(day) {
    if (!this.welfareGrowData) return;
    return this.welfareGrowData[day] || [];
  },
  getWelfareGiftData: function getWelfareGiftData(day) {
    if (!this.welfareGiftData) return;
    return this.welfareGiftData[day] || [];
  },
  getWelfareHalfData: function getWelfareHalfData(day) {
    if (this.walfareHalfData && this.walfareHalfData[day]) {
      return this.walfareHalfData[day] || [];
    }
  },
  // *********** 协议相关*********
  // 七天目标的福利领取
  setSevenGoalWelfareList: function setSevenGoalWelfareList(data) {
    this.welfareList = [];
 
    for (var i = 1; i <= 7; i++) {
      this.welfareList[i] = [];
    }
 
    for (var i in data) {
      this.welfareList[data[i].day].push(data[i]);
    }
  },
  getSevenGoalWelfareList: function getSevenGoalWelfareList(day) {
    if (!this.welfareList) return;
    return this.welfareList[day] || [];
  },
  // 更新数据
  updataGoalWelfareList: function updataGoalWelfareList(day, index, status) {
    this.welfareList[day][index].status = status;
  },
  // 七天目标的成长目标
  setSevenGoalGrowList: function setSevenGoalGrowList(data) {
    var grow_list = [];
 
    for (var i = 1; i <= 7; i++) {
      grow_list[i] = [];
    }
 
    for (var i in data) {
      grow_list[data[i].day].push(data[i]);
    }
 
    this.serverGrowListData = [];
    this.serverGiftListData = [];
 
    for (var i in grow_list) {
      var tab = [];
      var tab1 = [];
 
      for (var k in grow_list[i]) {
        if (grow_list[i][k].target_type == 1) {
          tab.push(grow_list[i][k]);
        } else if (grow_list[i][k].target_type == 2) {
          tab1.push(grow_list[i][k]);
        }
      }
 
      this.serverGrowListData.push(tab);
      this.serverGiftListData.push(tab1);
    }
  },
  getServerGrowListData: function getServerGrowListData(day) {
    if (this.serverGrowListData && this.serverGrowListData[day]) {
      return this.serverGrowListData[day] || [];
    }
 
    return [];
  },
  // 更新数据
  updataGrowListData: function updataGrowListData(day, index, status) {
    this.serverGrowListData[day][index].status = status;
  },
  getServerGiftListData: function getServerGiftListData(day) {
    if (!this.serverGiftListData) return;
    return this.serverGiftListData[day] || [];
  },
  // 更新数据
  updataGiftListData: function updataGiftListData(day, index, status) {
    this.serverGiftListData[day][index].status = status;
  },
  // 福利礼包礼包购买
  setHalfGiftList: function setHalfGiftList(data) {
    this.halfGiftList = [];
 
    for (var i = 1; i <= 7; i++) {
      this.halfGiftList[i] = [];
    }
 
    for (var i = 1; i <= 7; i++) {
      var half_list = this.getWelfareHalfData(i);
 
      for (var k in half_list) {
        for (var b in data) {
          if (half_list[k].id == data[b].day) {
            this.halfGiftList[i].push(data[b]);
          }
        }
      }
    }
  },
  getHalfGiftList: function getHalfGiftList(day) {
    if (this.halfGiftList && this.halfGiftList[day]) {
      return this.halfGiftList[day] || [];
    }
  },
  // 更新数据
  updataHalfListData: function updataHalfListData(day, index, status) {
    this.halfGiftList[day][index].status = status;
  },
  // 活跃宝箱
  setSevenGoalBoxList: function setSevenGoalBoxList(data) {
    this.boxList = data;
  },
  getSevenGoalBoxList: function getSevenGoalBoxList() {
    if (!this.boxList) return;
    this.boxList.sort(Utils.tableLowerSorter(["goal_id"]));
    return this.boxList || [];
  },
  // 更新数据
  updataBoxListData: function updataBoxListData(index, status) {
    this.boxList[index].status = status;
  },
  sortItemList: function sortItemList(list) {
    var _tempsort;
 
    var tempsort = (_tempsort = {}, _defineProperty(_tempsort, 0, 2), _defineProperty(_tempsort, 1, 1), _defineProperty(_tempsort, 2, 3), _tempsort);
 
    var sortFunc = function sortFunc(objA, objB) {
      if (objA.status != objB.status) {
        if (tempsort[objA.status] && tempsort[objB.status]) {
          return tempsort[objA.status] - tempsort[objB.status];
        } else {
          return -1;
        }
      } else {
        return objA.aim - objB.aim;
      }
    };
 
    list.sort(sortFunc);
  },
  //设置倒计时
  setCountDownTime: function setCountDownTime(text, less_time) {
    var node = text.node;
    if (!node) return;
    node.stopAllActions();
 
    if (less_time > 0) {
      this.setTimeFormatString(text, less_time);
      var callfun = cc.callFunc(function () {
        less_time = less_time - 1;
 
        if (less_time < 0) {
          node.stopAllActions();
          text.string = "00:00:00";
        } else {
          this.setTimeFormatString(text, less_time);
        }
      }.bind(this));
      node.runAction(cc.repeatForever(cc.sequence(cc.delayTime(1), callfun)));
    } else {
      this.setTimeFormatString(text, less_time);
    }
  },
  setTimeFormatString: function setTimeFormatString(text, time) {
    var TimeTool = require("timetool");
 
    if (time > 0) {
      text.string = TimeTool.getTimeForFunction(time);
    } else {
      text.node.stopAllActions();
      text.string = "00:00:00";
    }
  },
  // *********** end *********************************************
  // 幸运值
  setLucklyRewardData: function setLucklyRewardData() {
    var data = Config.dial_data.data_get_lucky_award;
    var list = this.sortLucklyData(data);
    this.lucky_num1 = list[0];
    this.lucky_num2 = list[1];
  },
  getLucklyRewardData: function getLucklyRewardData(index) {
    if (!this.lucky_num1 || !this.lucky_num2) return [];
 
    if (index == 1) {
      return this.lucky_num1 || [];
    } else if (index == 2) {
      return this.lucky_num2 || [];
    }
  },
  // 抽奖两个按钮
  setBuyRewardData: function setBuyRewardData() {
    var data = Config.dial_data.data_get_limit_open;
    var list = this.sortLucklyData(data, true);
    this.buy_num_list1 = list[0];
    this.buy_num_list2 = list[1];
  },
  getBuyRewardData: function getBuyRewardData(index) {
    if (!this.buy_num_list1 || !this.buy_num_list2) return [];
 
    if (index == 1) {
      return this.buy_num_list1 || [];
    } else if (index == 2) {
      return this.buy_num_list2 || [];
    }
  },
  sortLucklyData: function sortLucklyData(data, _type) {
    var list1 = [];
    var list2 = [];
 
    for (var i in data) {
      var v = data[i];
 
      if (v.type == 1) {
        list1.push(v);
      } else if (v.type == 2) {
        list2.push(v);
      }
    }
 
    if (_type) {
      list1.sort(function (a, b) {
        return a.type2 - b.type2;
      });
      list2.sort(function (a, b) {
        return a.type2 - b.type2;
      });
    } else {
      list1.sort(function (a, b) {
        return a.id - b.id;
      });
      list2.sort(function (a, b) {
        return a.id - b.id;
      });
    }
 
    return [list1, list2];
  },
  // ------- 探宝服务器返回----------
  // 寻宝数据
  setTreasureInitData: function setTreasureInitData(data) {
    this.treasureInitData = [];
 
    for (var i in data) {
      this.treasureInitData[data[i].type] = data[i];
    }
  },
  getTreasureInitData: function getTreasureInitData(index) {
    if (!this.treasureInitData) return [];
    return this.treasureInitData[index] || [];
  },
  // 更新
  updataTreasureInitData: function updataTreasureInitData(index, data) {
    if (!this.treasureInitData) return;
    this.treasureInitData[index].count = data.count;
    this.treasureInitData[index].end_time = data.end_time;
    this.treasureInitData[index].lucky = data.lucky;
    this.treasureInitData[index].lucky_award = data.lucky_award;
    this.treasureInitData[index].rand_lists = data.rand_lists;
  },
  // 更新日记
  updataTreasureLogData: function updataTreasureLogData(index, data) {
    if (!this.treasureInitData) return;
    this.treasureInitData[index].log_list = data;
  },
  // *********探宝红点*********
  lucklyRedPoint: function lucklyRedPoint() {
    this.setLucklyRewardData();
    this.tab_redpoint = [false, false];
 
    for (var val = 1; val <= 2; val++) {
      var data = this.getLucklyRewardData(val);
      var serve_data = this.getTreasureInitData(val);
      var status = false;
 
      for (var j in data) {
        var _bool = true;
 
        for (var k in serve_data.lucky_award) {
          if (data[j].id == serve_data.lucky_award[k].lucky) {
            _bool = false;
            break;
          }
        }
 
        if (serve_data.lucky < data[j].lucky_val) {
          _bool = false;
        }
 
        if (_bool == true) {
          status = true;
          break;
        }
      }
 
      this.setLucklyTabRedPoint(val, status);
    }
 
    MainuiController.getInstance().setFunctionTipsStatus(MainuiConst.icon.lucky_treasure, this.tab_redpoint[1] || this.tab_redpoint[2]);
  },
  // 获取幸运探宝页签红点
  setLucklyTabRedPoint: function setLucklyTabRedPoint(index, status) {
    this.tab_redpoint[index] = status;
  },
  getLucklyTabRedPoint: function getLucklyTabRedPoint(index) {
    if (this.tab_redpoint && this.tab_redpoint[index]) {
      return this.tab_redpoint[index];
    }
 
    return false;
  },
  getFundRedStatusByBid: function getFundRedStatusByBid(bid) {
    return this.fund_red_list[bid];
  },
  //杂货铺数据
  setStoneShopData: function setStoneShopData(data) {
    this.stone_shop_data = {};
 
    for (var i in data) {
      var v = data[i];
      this.stone_shop_data[v.id] = v;
    }
  },
  getStoneShopData: function getStoneShopData(id) {
    if (this.stone_shop_data && this.stone_shop_data[id] != null) {
      return this.stone_shop_data[id];
    }
 
    return null;
  },
  // -----------每日红点仅显示一次-----------
  updateGiftRedPointStatus: function updateGiftRedPointStatus(data) {
    var bid = data.bid;
    this.gift_id_list = this.gift_id_list || [];
    this.gift_id_list[bid] = data;
  },
  getGiftRedStatusByBid: function getGiftRedStatusByBid(bid) {
    if (!this.gift_id_list) return;
    var list = this.gift_id_list[bid];
 
    if (list) {
      return list.status;
    }
  },
  setGiftRedStatus: function setGiftRedStatus(data) {
    if (!this.gift_id_list) return;
    var bid = data.bid;
    var status = data.status;
    var list = this.gift_id_list[bid];
 
    if (list && list.status != status) {
      list.status = status;
    }
 
    gcore.GlobalEvent.fire(ActionEvent.SHOW_ACTIVITY_RED_POINT, bid, status);
  },
  updataFestvalRedStatus: function updataFestvalRedStatus(bid, data) {
    var red_status = this.getRedPointStatus(data);
    var festval_bid = MainuiConst.icon.festval;
 
    if (bid == ActionConst.ActionRankCommonType.festval_day) {
      festval_bid = MainuiConst.icon.festval_spring;
    } else if (bid == ActionConst.ActionRankCommonType.lover_day) {
      festval_bid = MainuiConst.icon.festval_lover;
    }
 
    MainuiController.getInstance().setFunctionTipsStatus(festval_bid, red_status);
  },
  getRedPointStatus: function getRedPointStatus(data) {
    if (!data) return false;
    var red_status = false;
 
    for (var k = 0; k < data.length; ++k) {
      var v = data[k];
 
      if (v.status == 1) {
        red_status = true;
        break;
      }
    }
 
    return red_status;
  },
  updataCombineLoginRedStatus: function updataCombineLoginRedStatus(data) {
    if (!data) return;
    var red_status = false;
 
    for (var k = 0; k < data.length; ++k) {
      var v = data[k];
 
      if (v.status == 1) {
        red_status = true;
        break;
      }
    }
 
    MainuiController.getInstance().setFunctionTipsStatus(MainuiConst.icon.combine_login, red_status);
  },
  updataPreferentialRedStatus: function updataPreferentialRedStatus(status, id) {
    if (true) return; //暂时屏蔽掉 不需要
    // id = id or MainuiConst.icon.preferential
    // if status then
    //     if self.prefer_fisrt_flag == nil then
    //         self.prefer_fisrt_flag = {}
    //     end
    //     if not self.prefer_fisrt_flag[id] then
    //         self.prefer_fisrt_flag[id] = true
    //     else
    //         status = false
    //     end
    // end
    // MainuiController:getInstance():setFunctionTipsStatus(id, status)
  },
  clearFundSrvData: function clearFundSrvData() {
    this.fund_datas = {};
  }
});
 
cc._RF.pop();