源战役客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

91 行
2.3 KiB

  1. CSMainExploitRankDailyRewardView = CSMainExploitRankDailyRewardView or BaseClass(BaseView)
  2. local CSMainExploitRankDailyRewardView = CSMainExploitRankDailyRewardView
  3. function CSMainExploitRankDailyRewardView:__init()
  4. self.base_file = "csMain"
  5. self.layout_file = "CSMainExploitRankDailyRewardView"
  6. self.layer_name = "Activity"
  7. self.destroy_imm = true
  8. self.use_background = true
  9. self.change_scene_close = true
  10. self.hide_maincancas = true --是否隐藏主界面
  11. self.append_to_ctl_queue = false --是否要添加进界面堆栈
  12. self.need_show_money = false --是否要显示顶部的金钱栏
  13. self.click_bg_toClose = true
  14. self.is_set_zdepth = true
  15. self.model = CSMainModel:getInstance()
  16. self.load_callback = function ()
  17. self:LoadSuccess()
  18. self:AddEvent()
  19. end
  20. self.open_callback = function ( )
  21. self:OpenSuccess()
  22. end
  23. self.destroy_callback = function ( )
  24. self:DestroySuccess()
  25. end
  26. end
  27. function CSMainExploitRankDailyRewardView:Open()
  28. BaseView.Open(self)
  29. end
  30. function CSMainExploitRankDailyRewardView:LoadSuccess()
  31. local nodes = {
  32. "bg:raw",
  33. "ScrollView", "ScrollView/Viewport/Content",
  34. }
  35. self:GetChildren(nodes)
  36. lua_resM:setOutsideRawImage(self,self.bg_raw,GameResPath.GetViewBigBg("cs_main_daily_reward_bg"))
  37. end
  38. function CSMainExploitRankDailyRewardView:AddEvent()
  39. local function on_update_reward_view()
  40. self:UpdateView()
  41. end
  42. self:BindEvent(self.model, CSMainConst.UPDATE_EXPLOIT_DAILY_REWARD_VIEW, on_update_reward_view)
  43. local function CLICK_GET_WAY_ITEM( )
  44. self:Close()
  45. end
  46. self:BindEvent(GlobalEventSystem, EventName.CLICK_GET_WAY_ITEM, CLICK_GET_WAY_ITEM)
  47. end
  48. function CSMainExploitRankDailyRewardView:OpenSuccess()
  49. self:UpdateView()
  50. end
  51. function CSMainExploitRankDailyRewardView:UpdateView( )
  52. local reward_cfg = self.model:GetCSMainSortExploitRankRewardCfg()
  53. if not self.item_list_com then
  54. self.item_list_com = self:AddUIComponent(UI.ItemListCreator)
  55. end
  56. local info = {
  57. data_list = reward_cfg,
  58. item_con = self.Content,
  59. item_class = CSMainExploitRankDailyRewardItem,
  60. item_width = 683,
  61. item_height = 80,
  62. -- space_x = 0,
  63. space_y = 0,
  64. start_x = 5,
  65. start_y = 5,
  66. scroll_view = self.ScrollView,
  67. create_frequency = 0.01,
  68. on_update_item = function(item, i, v)
  69. item:SetData(v,i)
  70. end,
  71. }
  72. self.item_list_com:UpdateItems(info)
  73. end
  74. function CSMainExploitRankDailyRewardView:DestroySuccess( )
  75. end