91 lines
2.3 KiB
Lua
91 lines
2.3 KiB
Lua
--[[
|
|
* @Classname CommonConfirmPanel
|
|
* @Description TODO
|
|
* @Date 2019/7/25 14:18
|
|
* @Created by MagicianJoker
|
|
--]]
|
|
|
|
---@class GMCommonConfirmPanel
|
|
local CommonConfirmTipPanel = quick_class("CommonConfirmTipPanel", BasePanel)
|
|
|
|
function CommonConfirmTipPanel:InitComponent()
|
|
--self.spLoader = SpriteLoader.New()
|
|
|
|
self.title = Util.GetGameObject(self.transform, "Title"):GetComponent("Text")
|
|
self.content = Util.GetGameObject(self.transform, "tip"):GetComponent("Text")
|
|
|
|
--self.doublePart = Util.GetGameObject(self.transform, "frame/bg/doublepart")
|
|
self.confirmBtn = Util.GetGameObject(self.transform, "okBtn")
|
|
self.confirmText = Util.GetGameObject(self.confirmBtn, "Text"):GetComponent("Text")
|
|
self.cancelBtn = Util.GetGameObject(self.transform, "cancelBtn")
|
|
self.cancelText = Util.GetGameObject(self.cancelBtn, "Text"):GetComponent("Text")
|
|
self.btn_close=Util.GetGameObject(self.transform, "Mask")
|
|
end
|
|
|
|
function CommonConfirmTipPanel:BindEvent()
|
|
Util.AddClick(self.confirmBtn, function()
|
|
self:OnConfirmBtnClicked()
|
|
end)
|
|
|
|
-- Util.AddClick(self.singleConfirmBtn, function()
|
|
-- self:OnConfirmBtnClicked()
|
|
-- end)
|
|
|
|
Util.AddClick(self.cancelBtn, function()
|
|
self:OnCancelBtnClicked()
|
|
end)
|
|
Util.AddClick(self.btn_close, function()
|
|
self:ClosePanel()
|
|
end)
|
|
|
|
end
|
|
|
|
-- context = {
|
|
-- title = "",
|
|
-- content = "",
|
|
-- confirmCallback = function() end,
|
|
-- cancelCallback = function() end,
|
|
-- confirmText = "确认",
|
|
-- cancelText = "取消",
|
|
-- type, -- 单双按钮
|
|
-- extra,--额外操作
|
|
-- }
|
|
local sureFunc=nil
|
|
local cancelFunc=nil
|
|
function CommonConfirmTipPanel:OnOpen(args)
|
|
local info=args[1]
|
|
local sureStr=args[2]
|
|
local cancelStr=args[3]
|
|
sureFunc=args[4]
|
|
cancelFunc=args[5]
|
|
self.title.text=GetLanguageStrById(11351)
|
|
self.content.text = info
|
|
self.confirmText.text = sureStr
|
|
self.cancelText.text = cancelStr
|
|
--self.doublePart:SetActive(true)
|
|
|
|
end
|
|
|
|
function CommonConfirmTipPanel:OnShow()
|
|
|
|
end
|
|
|
|
function CommonConfirmTipPanel:OnClose()
|
|
|
|
end
|
|
|
|
function CommonConfirmTipPanel:OnConfirmBtnClicked()
|
|
self:ClosePanel()
|
|
if sureFunc then
|
|
sureFunc()
|
|
end
|
|
end
|
|
|
|
function CommonConfirmTipPanel:OnCancelBtnClicked()
|
|
self:ClosePanel()
|
|
if cancelFunc then
|
|
cancelFunc()
|
|
end
|
|
end
|
|
|
|
return CommonConfirmTipPanel |