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
"use strict";
cc._RF.push(module, '4d6ddVhgN1OvahXwVtbTIe4', 'guild_reward_window');
// Scripts/mod/guild/view/guild_reward_window.js
 
"use strict";
 
// --------------------------------------------------------------------
// @author: shiraho@syg.com(必填, 创建模块的人员)
// @description:
//      奖励一览的总界面
// <br/>Create: new Date().toISOString()
// --------------------------------------------------------------------
var PathTool = require("pathtool");
 
var GuildController = require("guild_controller");
 
var GuildRewardItem = require("guild_reward_item");
 
var CommonScrollView = require("common_scrollview");
 
var GuildRewardWindow = cc.Class({
  "extends": BaseView,
  ctor: function ctor() {
    this.prefabPath = PathTool.getPrefabPath("guild", "guild_reward_window");
    this.win_type = WinType.Mini;
    this.viewTag = SCENE_TAG.dialogue;
    this.ctrl = GuildController.getInstance();
  },
  openCallBack: function openCallBack() {
    this.background = this.seekChild("background");
    this.background.scale = FIT_SCALE;
    this.main_container = this.seekChild("main_container");
    var main_panel = this.seekChild(this.main_container, "main_panel");
    this.close_btn = this.seekChild("close_btn");
    var container = this.seekChild(main_panel, "container");
    var size = container.getContentSize();
    var list_size = cc.size(size.width, size.height - 10);
    var setting = {
      item_class: GuildRewardItem,
      // 单元类
      start_x: 10,
      // 第一个单元的X起点
      space_x: 0,
      // x方向的间隔
      start_y: 0,
      // 第一个单元的Y起点
      space_y: 0,
      // y方向的间隔
      item_width: 599,
      // 单元的尺寸width
      item_height: 159,
      // 单元的尺寸height
      row: 0,
      // 行数,作用于水平滚动类型
      col: 1,
      // 列数,作用于垂直滚动类型
      need_dynamic: true
    };
    this.scroll_view = new CommonScrollView();
    this.scroll_view.createScroll(container, cc.v2(0, 0), ScrollViewDir.vertical, ScrollViewStartPos.top, list_size, setting, cc.v2(0.5, 0.5));
  },
  registerEvent: function registerEvent() {
    this.background.on(cc.Node.EventType.TOUCH_END, function () {
      this.ctrl.openGuildRewardWindow(false);
    }, this);
    this.close_btn.on(cc.Node.EventType.TOUCH_END, function () {
      this.ctrl.openGuildRewardWindow(false);
    }, this);
  },
  openRootWnd: function openRootWnd() {
    var list = Config.guild_quest_data.data_lev_data;
    var arr = [];
 
    for (var i in list) {
      var v = list[i];
      if (v.lev != 0) arr.push(v);
    }
 
    this.scroll_view.setData(arr);
  },
  closeCallBack: function closeCallBack() {
    this.ctrl.openGuildRewardWindow(false);
 
    if (this.scroll_view) {
      this.scroll_view.deleteMe();
      this.scroll_view = null;
    }
  }
});
module.exports = GuildRewardWindow;
 
cc._RF.pop();