|
|
@@ -149,16 +149,11 @@ function UINoticeTipsView:Init()
|
|
|
local params1 = data[7]
|
|
|
local cost = data[8]
|
|
|
|
|
|
- local curNotice = NoticeList[idx]
|
|
|
- if type(idx) == "table" then
|
|
|
- curNotice = idx
|
|
|
- elseif type(idx) == "number" or type(idx) == "string" then
|
|
|
- curNotice = NoticeList[idx]
|
|
|
- else
|
|
|
+ local curNotice = self:GitCurNotice(idx)
|
|
|
+ if curNotice == nil then
|
|
|
return
|
|
|
end
|
|
|
|
|
|
-
|
|
|
self.noticeTitle.uILocalizeScript:SetContent(curNotice.title)
|
|
|
self.questionTxt.uILocalizeScript:SetContentAndValues(curNotice.notice1, params1)
|
|
|
self.dscBox.dscTxt.uILocalizeScript:SetContentAndValues(curNotice.notice, params)
|
|
|
@@ -247,7 +242,10 @@ end
|
|
|
function UINoticeTipsView:OnBtnCloseClick()
|
|
|
local data = self.controller:GetData()
|
|
|
local idx = data[1]
|
|
|
- local curNotice = NoticeList[idx]
|
|
|
+ local curNotice = self:GitCurNotice(idx)
|
|
|
+ if curNotice == nil then
|
|
|
+ return
|
|
|
+ end
|
|
|
if curNotice.hideClose then
|
|
|
return
|
|
|
end
|
|
|
@@ -290,5 +288,17 @@ function UINoticeTipsView:OnDispose()
|
|
|
|
|
|
end
|
|
|
|
|
|
+function UINoticeTipsView:GitCurNotice(idx)
|
|
|
+ local curNotice = nil
|
|
|
+ if type(idx) == "table" then
|
|
|
+ curNotice = idx
|
|
|
+ elseif type(idx) == "number" or type(idx) == "string" then
|
|
|
+ curNotice = NoticeList[idx]
|
|
|
+ else
|
|
|
+ curNotice = nil
|
|
|
+ end
|
|
|
+ return curNotice
|
|
|
+end
|
|
|
+
|
|
|
return UINoticeTipsView
|
|
|
|