Преглед изворни кода

Merge branch 'hy_dny' of ssh://192.168.0.8:29418/xianjing into hy_dny_16

# Conflicts:
#	Assets/Lua/Core/Constant.lua
gdl_123 пре 3 месеци
родитељ
комит
a0eb5ab885

Разлика између датотеке није приказан због своје велике величине
+ 125 - 145
Assets/Content/Prefabs/UI/UICommonTips/UINoticeTips.prefab


+ 1 - 0
Assets/Lua/Core/Constant.lua

@@ -10,6 +10,7 @@ local Constant = {
     DeleteAccount = false, -- 删除账户
 
     OpenSystemLink = true,
+    OpenSdkGameStartNtf = true,
 
     HeroLeaderIcon = "FrameNew/label_main",
     HeroBattleIcon = "FrameNew/label_battling",

+ 27 - 0
Assets/Lua/Managers/SDKEventReportMgr.lua

@@ -218,4 +218,31 @@ end
 function SDKEventReportMgr:SendClickGoods()
 	self:SendEvent(self.EventType.ClickGoods)
 end
+
+function SDKEventReportMgr:GetSDKNtfAndShow()
+	if not Constant.OpenSdkGameStartNtf then
+		return
+	end
+	local url = PlatformPack.NOTIFY_URL.."SdkGameStartNotice.json"--"http://192.168.0.8:8060/res/Notice/SdkGameStartNotice.json"--
+	local OnRequestHttpCb = function (noticeInfo)
+		local noticesJson
+		local ok, errors = RO_XPCALL(function()  noticesJson = JSON:decode(noticeInfo) end, debug.traceback)
+		if ok then
+			LogError(Inspect(noticesJson))	
+			local copyUrl = noticesJson.url
+			local scb = nil
+			if noticesJson.HasSureCb then
+				scb	 = function ()
+					LogError("url = "..copyUrl)
+					UnityEngine.GUIUtility.systemCopyBuffer = copyUrl
+				 end
+			end
+			 local data = {noticesJson, {}, nil, nil, scb}
+				ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UINoticeTips, data)
+		else
+			LogError(errors)			
+		end
+	end
+	ManagerContainer.LuaGameMgr:RequestHttpServer(url,OnRequestHttpCb)
+end
 return SDKEventReportMgr

+ 22 - 11
Assets/Lua/UI/UICommonTips/UINoticeTipsView.lua

@@ -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()

+ 5 - 0
Assets/Lua/UI/UIMain/UIMainView.lua

@@ -207,6 +207,11 @@ function UIMainView:Init()
 	--统一刷新数据
 	self:RefreshData()
 	self:RefreshBoliShopState()
+
+	if ManagerContainer.SDKEventReportMgr ~= nil then
+		ManagerContainer.SDKEventReportMgr:GetSDKNtfAndShow()
+	end
+  
 end
 
 function UIMainView:RefreshBoliShopState()

Неке датотеке нису приказане због велике количине промена