|
-
- -- 主界面子游戏图标
-
- --[[
- 从 subGameManger 获取版本号、更新地址、更新状态
- 并使用 subGameManger 进行更新
- --]]
-
- local MainViewGameIconGroup = class("MainViewGameIconGroup")
-
- function MainViewGameIconGroup:ctor(groupConfig)
-
- local ui = loadUI("res/ui/ui_dating/ui_dating_icon_group.ui")
- self.ui = ui
-
- self.groupConfig = groupConfig
-
- dump(self.groupConfig, "MainViewGameIconGroup:ctor groupConfig")
-
- self:init()
- end
-
- function MainViewGameIconGroup:init()
-
- -- 默认不显示下载相关的节点
- self.ui.Items.ImageView_RedPoint:setVisible(false)
-
- -- 图标点击事件
- self.ui.Items.ImageView_Icon:registerClick(handler(self, self.onClickIcon))
-
-
- --免费标签
- -- local gameFangKaConfig = app.user:getGameConfig(self.gameId);
- -- if gameFangKaConfig then
- -- --isFree 1表示免费 0: 收费
- -- local isFree = gameFangKaConfig.isFree == 1
- -- self.ui.Items.ImageView_FreeTag:setVisible(isFree)
- -- else
- self.ui.Items.ImageView_FreeTag:setVisible(false)
- -- end
-
- -- 设置icon
- setImageFromUrl(self.ui.Items.ImageView_Icon,self.groupConfig.icon)
-
- if self.groupConfig.webgame then
- for k,gameId in pairs(self.groupConfig.games or {}) do
- local item = self.ui.Items.Layout_Item:getCopied()
- local icon = item:getChildByName("ImageView_Icon_Small")
- local gameConfig = app.serverConfigs:getWebGameConfig(gameId)
- if gameConfig then
- setImageFromUrl(icon,gameConfig.icon)
- end
- self.ui.Items.Layout_Content:addChild(item)
- end
- else
- for k,gameId in pairs(self.groupConfig.games or {}) do
- local item = self.ui.Items.Layout_Item:getCopied()
- local icon = item:getChildByName("ImageView_Icon_Small")
- local gameConfig = app.serverConfigs.subGameList[gameId]
- if gameConfig then
- setImageFromUrl(icon,gameConfig.gameIcon)
- end
- self.ui.Items.Layout_Content:addChild(item)
- end
- end
-
- end
-
-
- -- 点击事件 - 图标
- function MainViewGameIconGroup:onClickIcon()
- playBtnEffect()
- local view = import("luaScript.Views.Main.MainViewGameGroupView"):new(self.groupConfig)
- view:setAnchorPoint(cc.p(0.5, 0.5))
- app:showWaitDialog(view,nil,true)
- end
-
-
- return MainViewGameIconGroup
|