local UIPayMallBasePanel = UIViewClass() local EventSystem = require('Event/EventSystem') local BgDir = ConstAssetPathConfig.Path14 -------------------------------- 系统函数 ------------------------------------ function UIPayMallBasePanel:OnOpened(context) UIUtils.SetLabelText(self.UITemplateTitlePanel.lab_Title, Const_IDS.IDS_Store_PayStore) self.view = nil self:RegistSystemEvent(EventID.UI_PayMall_ShowSomeBaseUI, self.ShowSomeEffectUI) self:RegistSystemEvent(EventID.UI_PayMall_HideSomeBaseUI, self.HideSomeEffectUI) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift1, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift2, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift3, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift4, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift5, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift6, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift7, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift8, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift9, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift10, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_DirectGiftOrder_DirectGift11, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_DailyGift, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_MonthCard, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PayMallBase_DoubleMonthCard, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_GrowthFund, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_OfficialPositionFund, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_HonorOrder, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_HeroFund, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_HorseFund, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_TreasureFund, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_GoldIngotFund, self.RefreshRedPoint) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_PayMallBase, self.RefreshRedPoint) self:RegistSystemEvent(EventID.UI_PayMall_RefreshRedPoint, self.RefreshRedPoint) self:RegistSystemEvent(EventID.UI_PushGift_NewGiftChange, self.RefreshRedPoint) self:RegistSystemEvent(EventID.UI_PayMall_OpenSpecificView, self.SelectedSpecifiedTabIndex) self:RegistSystemEvent(EventID.UI_PayMall_SaveCurrentShopTabIndex,self.SaveCurrentShopTabIndex) self:RegistSystemEvent(EventID.FunctionUnlockUpdate, self.RefreshTab) self:RegistSystemEvent(EventID.UI_PayMall_RefreshTab, self.RefreshTab) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.PayMall_TotalTop, self.RefreshRedPoint) self:RegistSystemEvent(EventID.UI_Fund_RefreshPanel, self.RefreshTabByFund) self:RegistSystemEvent(EventID.UI_OperationActivity_InfoChanged, self.RefreshTabIfDirectGift) self:RegistSystemEvent(EventID.UI_PushGift_TimeRefresh, self.RefreshTabIfDirectGift) self:RefreshEventTitle() self.context = context if CTL.PayMall.CurrentShowContext ~= nil then self.context = CTL.PayMall.CurrentShowContext CTL.PayMall.CurrentShowContext = nil end self:SelectedSpecifiedTabIndex(self.context) end --选择指定的TabIndex,处理跳转过来的情况 function UIPayMallBasePanel:SelectedSpecifiedTabIndex(context) if context and context.tabId then if context.tabId == CTL.PayMall.ShopTabType.Shop then local tabIndex local itemIndex if context then tabIndex = MDL.PayMall.GetShowTabIndexById(context.childTabId) local itemId = context.itemId if itemId then tabIndex, itemIndex = MDL.PayMall.GetTabIndexAndItemIndex(context.itemId) end end self.loop_EventTitle:SelectIndex(self:GetTabIndex(CTL.PayMall.ShopTabType.Shop)) self.loop_EventList:SelectIndex(tabIndex or 0) elseif context.tabId == CTL.PayMall.ShopTabType.TotalTopUp then self.loop_EventTitle:SelectIndex(self.tabIndexArray[CTL.PayMall.ShopTabType.TotalTopUp]) elseif context.tabId == CTL.PayMall.ShopTabType.Recharge then self.loop_EventTitle:SelectIndex(self.tabIndexArray[CTL.PayMall.ShopTabType.Recharge]) elseif context.tabId == CTL.PayMall.ShopTabType.PreferentialOrder then self.cellList = CTL.PayMall.GetShopListByTab(CTL.PayMall.ShopTabType.PreferentialOrder) local selectIndex = 0 if #self.cellList > 0 then for i, v in ipairs(self.cellList) do if v.ID == context.childTabId then selectIndex = i - 1 break end end end self.loop_EventTitle:SelectIndex(self:GetTabIndex(CTL.PayMall.ShopTabType.PreferentialOrder)) self.loop_EventList:SelectIndex(selectIndex) elseif context.tabId == CTL.PayMall.ShopTabType.DirectGiftOrder then if self.loop_EventTitle.Count >= CTL.PayMall.ShopTabType.DirectGiftOrder then self.cellList = CTL.PayMall.GetShopListByTab(CTL.PayMall.ShopTabType.DirectGiftOrder) local selectIndex = 0 if #self.cellList > 0 then for i, v in ipairs(self.cellList) do if v.ID == context.childTabId then selectIndex = i - 1 break end end end self.loop_EventTitle:SelectIndex(self:GetTabIndex(CTL.PayMall.ShopTabType.DirectGiftOrder)) self.loop_EventList:SelectIndex(selectIndex) end end else local tabIndex, childTabIndex = MDL.PayMall.GetCurrentShopTabIndex() if tabIndex ~= nil then self.loop_EventTitle:SelectIndex(tabIndex) if self.tabId ~= CTL.PayMall.ShopTabType.TotalTopUp and self.tabId ~= CTL.PayMall.ShopTabType.Recharge then --累充无子页签 self.loop_EventList:SelectIndex(childTabIndex or 0) return end end self.loop_EventTitle:SelectIndex(0) end end function UIPayMallBasePanel:SwitchBgByTab(tabId,childTabId) local bgName local dir = BgDir if tabId == CTL.PayMall.ShopTabType.PreferentialOrder then if childTabId == CTL.PayMall.ShopChildTabType.DailyGift or childTabId == CTL.PayMall.ShopChildTabType.MonthCard or CTL.PayMall.IsGrowthFund(childTabId) or (childTabId >= CTL.PayMall.ShopChildTabType.DirectGift1 and childTabId <= CTL.PayMall.GetLastDirectGiftTabType()) then bgName = "czjj_bg_03.png" elseif childTabId == CTL.PayMall.ShopChildTabType.HonorOrder then bgName = "sjzl_bg_10.png" elseif CTL.PayMall.IsXFund(childTabId) then bgName = "mjzl_bg_01.png" end elseif tabId == CTL.PayMall.ShopTabType.Shop or tabId == CTL.PayMall.ShopTabType.TotalTopUp or tabId == CTL.PayMall.ShopTabType.Recharge then bgName = "czjj_bg_03.png" elseif tabId == CTL.PayMall.ShopTabType.DirectGiftOrder then bgName = "zglb_bg_01.png" end bgName = dir..bgName UIUtils.SetTextureByAssetBundle(self.Bottom, bgName) end function UIPayMallBasePanel:OnBackButtonPressed() self:OnButtonClicked(self.UITemplateTitlePanel.btn_close) end function UIPayMallBasePanel:OnButtonClicked(comp) if comp == self.UITemplateTitlePanel.btn_close then self:CloseView(true) if CTL.PayMall.RemoveMonthCardNewGoodRedPoint then MDL.PayMall.RemoveMonthCardNewGoodRedPoint() end elseif comp == self.UITemplateTitlePanel.btn_Home then CTL.HomeMain.CloseViewBackHomeMain() if CTL.PayMall.RemoveMonthCardNewGoodRedPoint then MDL.PayMall.RemoveMonthCardNewGoodRedPoint() end elseif comp == self.UITemplateTitlePanel.btn_Info then local desc1, timeStr1 = UTL.Time.GetDateDescAndTime({[1] = 1}) local desc2, timeStr2 = UTL.Time.GetDateDescAndTime({[1] = 2}) local desc3, timeStr3 = UTL.Time.GetDateDescAndTime({[1] = 3}) if GameAppInfo.IsVietnamPackage() then UIManager.OpenView(Const_UI_Lua.UIEnum.UICommonNoteView, {id = LuaConst.NoteID.PayStore, params = {timeStr1.." "..string.lower(desc1), timeStr2.." "..string.lower(desc2), timeStr3.." "..string.lower(desc3)}}) else UIManager.OpenView(Const_UI_Lua.UIEnum.UICommonNoteView, {id = LuaConst.NoteID.PayStore, params = {desc1..timeStr1, desc2..timeStr2, desc3..timeStr3}}) end end end -- 一级页签索引 function UIPayMallBasePanel:GetTabIndex(type) local index = self.tabIndexArray[type] if index == nil then return 0 end return index end --一级页签红点 function UIPayMallBasePanel:SetTabRedPoint(data,cellTable) --红点逻辑 if data.Type == CTL.PayMall.ShopTabType.Shop then -- 商城 UIUtils.SetActive(cellTable.img_New, MDL.PayMall.GetMonthCardNewGoodsRedPoint()) if MDL.PayMall.GetMonthCardNewGoodsRedPoint() then cellTable.cell:SetRedPoint(false) else cellTable.cell:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.PayMall_PayMallBase)) end elseif data.Type == CTL.PayMall.ShopTabType.TotalTopUp then cellTable.cell:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.PayMall_TotalTop)) elseif data.Type == CTL.PayMall.ShopTabType.Recharge then UIUtils.SetActive(cellTable.img_New, false) cellTable.cell:SetRedPoint(false) elseif data.Type == CTL.PayMall.ShopTabType.DirectGiftOrder then cellTable.cell:SetRedPoint(CTL.DirectGift.IsWelfareShowNew() or CTL.PushGift.IsShowNewInPayMall()) -- New改为红点显示 elseif data.Type == CTL.PayMall.ShopTabType.PreferentialOrder then cellTable.cell:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder)) end end --二级页签红点 function UIPayMallBasePanel:SetChildTabRedPoint(data,cellTable) UIUtils.SetActive(cellTable.img_New, false) --红点状态 if self.tabId == CTL.PayMall.ShopTabType.DirectGiftOrder and (CTL.DirectGift.IsWelfareShowNew(data.ID) or CTL.PushGift.IsShowNewByTabId(data.ID)) then cellTable.cell:SetRedPoint(true) -- New改为红点显示 elseif self.tabId == CTL.PayMall.ShopTabType.Shop then if data.TabID == CTL.PayMall.ShopChildTabType.DoubleMonthCardShop then -- 双月卡 UIUtils.SetActive(cellTable.img_New, MDL.PayMall.GetMonthCardNewGoodsRedPoint()) if MDL.PayMall.GetMonthCardNewGoodsRedPoint() then cellTable.cell:SetRedPoint(false) else cellTable.cell:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.PayMall_PayMallBase_DoubleMonthCard)) end else cellTable.cell:SetRedPoint(false) end elseif self.tabId == CTL.PayMall.ShopTabType.DirectGiftOrder then cellTable.cell:SetRedPoint(false) --直购礼包无红点 elseif self.tabId == CTL.PayMall.ShopTabType.PreferentialOrder then if data.ID == CTL.PayMall.ShopChildTabType.DailyGift then cellTable.cell:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_DailyGift)) elseif data.ID == CTL.PayMall.ShopChildTabType.MonthCard then cellTable.cell:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_MonthCard)) elseif CTL.PayMall.IsGrowthFund(data.ID) then local isFirstShow = CTL.GrowthFund.GetFirstShowRP(data.ID) if isFirstShow then UIUtils.SetActive(cellTable.img_New, true) --有新字就显示新字,关闭红点 cellTable.cell:SetRedPoint(false) else UIUtils.SetActive(cellTable.img_New, false) cellTable.cell:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_GrowthFund)) end elseif data.ID == CTL.PayMall.ShopChildTabType.OfficialPositionFund then cellTable.cell:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_OfficialPositionFund)) elseif data.ID == CTL.PayMall.ShopChildTabType.HonorOrder then cellTable.cell:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.PayMall_PreferentialOrder_HonorOrder)) elseif CTL.PayMall.IsXFund(data.ID) then cellTable.cell:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.PayMall.GetXFundRPKeyByTabType(data.ID))) end end end function UIPayMallBasePanel:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.loop_EventTitle then UIUtils.SetLabelText(cellTable.txt_Unselected, Const_IDS[data.Ids]) UIUtils.SetLabelText(cellTable.txt_Selected, Const_IDS[data.Ids]) UIUtils.SetLabelText(cellTable.loc_SelectedTxt, Const_IDS[data.Ids]) UIUtils.SetLabelText(cellTable.loc_UnselectedTxt, Const_IDS[data.Ids]) UTL.Item.SetAtlasSprite(cellTable.icon_Unselected, "UI_Welfare", data.Icon_UnSelected) UTL.Item.SetAtlasSprite(cellTable.icon_selected, "UI_Welfare", data.Icon_Selected) --红点逻辑 self:SetTabRedPoint(data,cellTable) elseif scrollRect == self.loop_EventList then UIUtils.SetActive(cellTable.group_Time, false) cellTable.txt_Time:EndTimer() if self.tabId == CTL.PayMall.ShopTabType.Shop then local tabName = MDL.Shop.GetStoreTypeTabName(data.TabID) if tabName then UIUtils.SetLabelText(cellTable.txt_Unselected, Const_IDS[tabName]) UIUtils.SetLabelText(cellTable.txt_Selected, Const_IDS[tabName]) end else UIUtils.SetLabelText(cellTable.txt_Unselected, Const_IDS[data.ActivityName]) UIUtils.SetLabelText(cellTable.txt_Selected, Const_IDS[data.ActivityName]) local id = data.ID if id >= CTL.PayMall.ShopChildTabType.DirectGift7 and id <= CTL.PayMall.ShopChildTabType.DirectGift9 then UIUtils.SetActive(cellTable.group_Time, true) cellTable.txt_Time:SetDHMSStr( UIUtils.GetLocalizedTxt(Const_IDS["IDS_DirectGift_TimeHint_1"]), UIUtils.GetLocalizedTxt(Const_IDS["IDS_DirectGift_TimeHint_2"]), UIUtils.GetLocalizedTxt(Const_IDS["IDS_DirectGift_TimeHint_3"]), UIUtils.GetLocalizedTxt(Const_IDS["IDS_DirectGift_TimeHint_4"]) ) local giftInfo = MDL.PushGift.GetPushGiftInfoById(data.PushGiftID, data.PushGiftRewardID) if giftInfo then cellTable.txt_Time:ResetAndBeginTimer(false, giftInfo.endTime - UTL.Time.GetServerTimestamp(), 0) end end end --红点状态 self:SetChildTabRedPoint(data,cellTable) end end function UIPayMallBasePanel:OnCellSelect(scrollRect, index, cellTable, data) if scrollRect == self.loop_EventTitle then self.tabId = data.Type self.currentTab = cellTable self.currentTabData = data self.currentTabIndex = index if self.context == nil then self.context = {} end self.context.tabId = self.tabId self:RefreshEventListByTabId(self.tabId) CTL.Sound.PlayGameSound("UI_red_packet") elseif scrollRect == self.loop_EventList then local viewId if self.tabId == CTL.PayMall.ShopTabType.Shop then viewId = data.TabID else viewId = data.ID end --特惠中的 每日礼包、成长基金、月卡 点击时需要播放声音 if self.tabId == CTL.PayMall.ShopTabType.PreferentialOrder then if viewId == CTL.PayMall.ShopChildTabType.DailyGift then--每日礼包 CTL.Sound.PlayGameSound("UI_gift") elseif viewId == CTL.PayMall.ShopChildTabType.MonthCard then --月卡 CTL.Sound.PlayGameSound("UI_month_card") elseif CTL.PayMall.IsGrowthFund(viewId) then --成长基金 CTL.Sound.PlayGameSound("UI_foundation") elseif viewId == CTL.PayMall.ShopChildTabType.HonorOrder then CTL.Sound.PlayGameSound("UI_jeweled_02") end end if self.viewId == viewId then return end self.currentChildTab = cellTable self.currentChildTabData = data self.currentChildTabIndex = index self.context.childTabId = data.ID --商城Tab 只刷新不重新打开 if self.tabId == CTL.PayMall.ShopTabType.Shop and self.subView_PayMall:IsViewOpened(Const_UI_Lua.UIEnum.UIPayMallMain) then self.viewId = viewId EventSystem.Dispatch(EventID.UI_PayMall_RefreshGoodsUI,{TabIndex= index, TypeData = data, itemId = self.context.itemId}) self.context.itemId = nil --这里置空 防止切换Tab时反复打开 UIPayMallPopUp 见 :JWS2-26376 return end if self.view then self.subView_PayMall:CloseAll() self.view = nil self.viewId = nil end self.viewId = viewId self.view = CTL.PayMall.OpenViewByShopType(self.tabId, self.subView_PayMall, self.viewId, index, data, self.context.itemId) self:SwitchBgByTab(self.tabId,self.viewId) self.context.itemId = nil --这里置空 防止切换Tab时反复打开 UIPayMallPopUp 见 :JWS2-26376 if CTL.PayMall.IsGrowthFund(viewId) and CTL.GrowthFund.GetFirstShowRP(viewId) then CTL.GrowthFund.SetFirstShow(viewId) -- 已经看过了,下次不用展示“新字” end end end --保存点击的Tab索引 function UIPayMallBasePanel:SaveCurrentShopTabIndex() MDL.PayMall.SaveCurrentShopTabIndex(self.currentTabIndex,self.currentChildTabIndex) end function UIPayMallBasePanel:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.loop_Commodity then CTL.PayMall.OpenPayMallPopUp(data) end end ------------------------------------------------------------------------------ function UIPayMallBasePanel:RefreshTabByFund() local id = self.context.childTabId if id and CTL.PayMall.IsGrowthFund(id) then if CTL.GrowthFund.IsHasGrowthFundGetOver(id) then self:RefreshTab() end end end function UIPayMallBasePanel:RefreshTabIfDirectGift() if self.context.childTabId and (self.context.childTabId >= CTL.PayMall.ShopChildTabType.DirectGift1 and self.context.childTabId <= CTL.PayMall.GetLastDirectGiftTabType()) then self:RefreshTab() end end --功能解锁或关闭后刷新页签 function UIPayMallBasePanel:RefreshTab() self:RefreshEventTitle() self:SelectedSpecifiedTabIndex(self.context) end -- 一级页签 function UIPayMallBasePanel:RefreshEventTitle() if self.loop_EventTitle.Count > 0 then self.loop_EventTitle:ClearCells() end self.tabIndexArray = {} local index = 0 for i, v in ipairs(CTL.PayMall.GetSortShopTabTypeArray()) do local data = CTL.PayMall.ShopTabDataArray[v] --直购/特惠 需要判断下是否有数据,无数据不显示1级页签 if v == CTL.PayMall.ShopTabType.DirectGiftOrder or v == CTL.PayMall.ShopTabType.PreferentialOrder then if CTL.HotFix.CheckAssetIsReady("PayMallTab_1") and #CTL.PayMall.GetShopListByTab(v) > 0 then self.loop_EventTitle:AddData(data, 0) self.tabIndexArray[v] = index index = index + 1 end elseif v == CTL.PayMall.ShopTabType.Recharge then if MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.Recharge) then self.loop_EventTitle:AddData(data, 0) self.tabIndexArray[v] = index index = index + 1 end else self.loop_EventTitle:AddData(data, 0) self.tabIndexArray[v] = index index = index + 1 end end end function UIPayMallBasePanel:OpenTotalTopUp() if self.subView_PayMall:IsViewOpened(Const_UI_Lua.UIEnum.UITotalTopUp) then return end if self.view then self.subView_PayMall:CloseAll() self.view = nil self.viewId = nil end self.viewId = CTL.PayMall.ShopTabType.TotalTopUp self.currentChildTab = nil self.currentChildTabData = nil self.currentChildTabIndex = nil self.context.childTabId = nil self.context.itemId = nil if self.context.totalTopUpData == nil then self.context.totalTopUpData = { subIndex = 0 } end self.view = self.subView_PayMall:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UITotalTopUp), { parentContext = self.context.totalTopUpData }) self:SwitchBgByTab(CTL.PayMall.ShopTabType.TotalTopUp) end function UIPayMallBasePanel:OpenRecharge() if self.subView_PayMall:IsViewOpened(Const_UI_Lua.UIEnum.UIRechargeView) then return end if self.view then self.subView_PayMall:CloseAll() self.view = nil self.viewId = nil end self.viewId = CTL.PayMall.ShopTabType.Recharge self.currentChildTab = nil self.currentChildTabData = nil self.currentChildTabIndex = nil self.context.childTabId = nil self.context.itemId = nil self.view = self.subView_PayMall:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIRechargeView)) self:SwitchBgByTab(CTL.PayMall.ShopTabType.Recharge) UIUtils.SetActive(self.loop_EventList, false) end -- 二级页签 function UIPayMallBasePanel:RefreshEventListByTabId(tabId) if self.loop_EventList.Count > 0 then self.loop_EventList:ClearCells() end UIUtils.SetActive(self.loop_EventList, true) UIUtils.SetActive(self.img_Line, true) --累充页签是一个独立的界面,没有二级子页签 if tabId == CTL.PayMall.ShopTabType.TotalTopUp then self:OpenTotalTopUp() UIUtils.SetActive(self.loop_EventList, false) elseif tabId == CTL.PayMall.ShopTabType.Recharge then self:OpenRecharge() UIUtils.SetActive(self.img_Line, false) UIUtils.SetActive(self.loop_EventList, false) else self.cellList = CTL.PayMall.GetShopListByTab(tabId) if #self.cellList > 0 then for i, v in ipairs(self.cellList) do self.loop_EventList:AddData(v, 0) end --当外部有传指定itemId时,不用选中,后面会执行选中 --这里默认选中第一个页签,反而会导致在该页签下,找不到对应的道具 if self.context.itemId == nil then self.loop_EventList:SelectIndex(0) end end end end function UIPayMallBasePanel:RefreshRedPoint() if self.currentTab then self:SetTabRedPoint(self.currentTabData,self.currentTab) end if self.currentChildTab then self:SetChildTabRedPoint(self.currentChildTabData, self.currentChildTab) end --再刷一次一级页签 for i = 0, self.loop_EventTitle.Count -1 do self.loop_EventTitle:UpdateIndex(i) end --再刷一次二级页签 for i = 0, self.loop_EventList.Count -1 do self.loop_EventList:UpdateIndex(i) end end --特效UI层级太高,关闭其他子页面时再显示 function UIPayMallBasePanel:HideSomeEffectUI() UIUtils.SetActive(self.UITemplateTitlePanel.gameObject,false) UIUtils.SetActive(self.group_TabLine,false) UIUtils.SetActive(self.loop_EventTitle, false) UIUtils.SetActive(self.loop_EventList, false) end --特效UI层级太高,打开其他子页面时需要隐藏 function UIPayMallBasePanel:ShowSomeEffectUI() UIUtils.SetActive(self.UITemplateTitlePanel.gameObject,true) UIUtils.SetActive(self.group_TabLine,true) UIUtils.SetActive(self.loop_EventTitle, true) UIUtils.SetActive(self.loop_EventList, true) end return UIPayMallBasePanel