sk-client/Assets/ManagedResources/~Lua/Modules/Questionnaire/QuestionnairePanel.lua

67 lines
1.5 KiB
Lua

require("Base/BasePanel")
QuestionnairePanel = Inherit(BasePanel)
local this = QuestionnairePanel
local items = {}
function this:InitComponent()
this.mask = Util.GetGameObject(this.gameObject, "mask")
this.btnBack = Util.GetGameObject(this.gameObject, "btnBack")
this.btnGo = Util.GetGameObject(this.gameObject, "btnGo")
this.grid = Util.GetGameObject(this.gameObject, "grid")
end
function this:BindEvent()
Util.AddClick(this.mask, function()
this:ClosePanel()
end)
Util.AddClick(this.btnBack, function()
this:ClosePanel()
end)
Util.AddClick(this.btnGo, function()
if AppConst.isSDKLogin then
SDKMgr:LoginPanel_Btn2()
end
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnOpen()
local config = ConfigManager.GetConfigDataByKey(ConfigName.SpecialConfig, "Key", "Questionnaire_tw_RewardShow")
local data = string.split(config.Value, "|")
for i = 1, #items do
items[i].gameObject:SetActive(false)
end
for i = 1, #data do
local reward = string.split(data[i], "#")
if not items[i] then
items[i] = SubUIManager.Open(SubUIConfig.ItemView, this.grid.transform)
end
items[i]:OnOpen(false, reward, 0.8)
items[i].gameObject:SetActive(true)
end
end
function this:OnShow()
end
function this:OnSortingOrderChange()
end
function this:OnClose()
end
function this:OnDestroy()
items = {}
end
return QuestionnairePanel