diff --git a/Assets/ManagedResources/~Lua/Modules/Mail/MainSingleInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/Mail/MainSingleInfoPanel.lua index 7efb9713f9..6aecf164d7 100644 --- a/Assets/ManagedResources/~Lua/Modules/Mail/MainSingleInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Mail/MainSingleInfoPanel.lua @@ -15,6 +15,7 @@ function MainSingleInfoPanel:InitComponent() self.closeBtn = Util.GetGameObject(self.gameObject, "bg/btnBack") self.mialHead = Util.GetGameObject(self.gameObject, "bg/mialHead"):GetComponent("Text") self.mialTimeText = Util.GetGameObject(self.gameObject, "bg/mialTimeText"):GetComponent("Text") + self.mialInfoRoot = Util.GetGameObject(self.gameObject, "bg/mialInfo") self.mialInfo = Util.GetGameObject(self.gameObject, "bg/mialInfo/mialInfoText"):GetComponent("Text") self.itemPre=Util.GetGameObject(self.gameObject, "itemPre") self.grid=Util.GetGameObject(self.gameObject, "bg/scroll/grid") @@ -176,6 +177,18 @@ function MainSingleInfoPanel:OnShowMailData(mailData) self.ScrollView:SetData(rewardStr, function (index, go) self:SingleMailDataShow(go, rewardStr[index]) end) + + -- 根据是否有附件动态修改邮件内容显示状态 + if #rewardStr > 0 then + self.root:SetActive(true) + self.mialInfoRoot.transform.sizeDelta = Vector2.New(857, 526) + self.mialInfoRoot.transform.localPosition = Vector2.New(0, 173) + else + self.root:SetActive(false) + self.mialInfoRoot.transform.sizeDelta = Vector2.New(857, 898) + self.mialInfoRoot.transform.localPosition = Vector2.New(0, 0) + end + end local _ItemList = {} function MainSingleInfoPanel:SingleMailDataShow(go, rewardStr)