|
|
@@ -150,21 +150,31 @@ function UINoticeTipsView:Init()
|
|
|
local params1 = data[7]
|
|
|
local cost = data[8]
|
|
|
|
|
|
- self.noticeTitle.uILocalizeScript:SetContent(NoticeList[idx].title)
|
|
|
- self.questionTxt.uILocalizeScript:SetContentAndValues(NoticeList[idx].notice1, params1)
|
|
|
- self.dscBox.dscTxt.uILocalizeScript:SetContentAndValues(NoticeList[idx].notice, params)
|
|
|
- self.btnSure.uILocalizeScript:SetContent(NoticeList[idx].btnSure)
|
|
|
- if NoticeList[idx].btnCancle then
|
|
|
- self.btnCancleText.uILocalizeScript:SetContent(NoticeList[idx].btnCancle)
|
|
|
+ local curNotice = NoticeList[idx]
|
|
|
+ if type(idx) == "table" then
|
|
|
+ curNotice = idx
|
|
|
+ elseif type(idx) == "number" or type(idx) == "string" then
|
|
|
+ curNotice = NoticeList[idx]
|
|
|
+ else
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
+ self.noticeTitle.uILocalizeScript:SetContent(curNotice.title)
|
|
|
+ self.questionTxt.uILocalizeScript:SetContentAndValues(curNotice.notice1, params1)
|
|
|
+ self.dscBox.dscTxt.uILocalizeScript:SetContentAndValues(curNotice.notice, params)
|
|
|
+ self.btnSure.uILocalizeScript:SetContent(curNotice.btnSure)
|
|
|
+ if curNotice.btnCancle then
|
|
|
+ self.btnCancleText.uILocalizeScript:SetContent(curNotice.btnCancle)
|
|
|
else
|
|
|
self.btnCancleText.uILocalizeScript:SetContent("BtnCancle")
|
|
|
end
|
|
|
|
|
|
- if NoticeList[idx].hideCancel then
|
|
|
+ if curNotice.hideCancel then
|
|
|
self.btnClose:SetActive(false)
|
|
|
self.btnCancle:SetActive(false)
|
|
|
else
|
|
|
- if NoticeList[idx].hideClose then
|
|
|
+ if curNotice.hideClose then
|
|
|
self.btnClose:SetActive(false)
|
|
|
else
|
|
|
self.btnClose:SetActive(true)
|
|
|
@@ -172,7 +182,7 @@ function UINoticeTipsView:Init()
|
|
|
self.btnCancle:SetActive(true)
|
|
|
end
|
|
|
|
|
|
- if NoticeList[idx].needCost then
|
|
|
+ if curNotice.needCost then
|
|
|
self.btnClose:SetActive(false)
|
|
|
self.btnCancle:SetActive(false)
|
|
|
self.btnRight:SetActive(false)
|
|
|
@@ -199,7 +209,7 @@ function UINoticeTipsView:Init()
|
|
|
self.btnOpen:SetActive(false)
|
|
|
end
|
|
|
|
|
|
- self.questionTxt:SetActive(NoticeList[idx].notice1~=nil and NoticeList[idx].notice1~="")
|
|
|
+ self.questionTxt:SetActive(curNotice.notice1~=nil and curNotice.notice1~="")
|
|
|
end
|
|
|
|
|
|
function UINoticeTipsView:OnBtnSureClick()
|
|
|
@@ -238,7 +248,8 @@ end
|
|
|
function UINoticeTipsView:OnBtnCloseClick()
|
|
|
local data = self.controller:GetData()
|
|
|
local idx = data[1]
|
|
|
- if NoticeList[idx].hideClose then
|
|
|
+ local curNotice = NoticeList[idx]
|
|
|
+ if curNotice.hideClose then
|
|
|
return
|
|
|
end
|
|
|
self:CloseUI()
|