| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578 |
- local UIBoliShopView = require("UIRuneShop/UIBoliShopView_Generate")
- local IsRefreshBtnItem
- local LastItemIdx
- local redpointState = false
- local IconItemCtr = require("Common/IconItemCtr")
- function UIBoliShopView:OnAwake(data)
- self.controller = require("UIRuneShop/UIBoliShopCtr"):new()
- self.controller:Init(self)
- self.controller:SetData(data)
- end
- function UIBoliShopView:AddEventListener()
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.COIN_CHANGED, self, self.RefreshCoins)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.DIAMOND_CHANGED, self, self.RefreshDiamond)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.ROCOIN_CHANGED, self, self.RefreshROCoin)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.ROBOLISHOP_EXP_CHANGE, self, self.RefreshCurExp)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.VIP_LV_CHANGED, self, self.RefreshVipView)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.ON_BOLISHOP_DATA_CHANGE, self, self.RefreshBoliShopData)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.ON_BOLISHOP_INFO_REFRESH, self, self.RefreshGoodsItemsScroll)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.ON_BOLISHOP_REWARD_TIPS, self, self.OpenRewardsView)
- end
- function UIBoliShopView:OpenRewardsView(data)
- if data then
- local rewards = {}
- for key, value in pairs(data) do
- table.insert(rewards,{cfgId = value.key, num = value.value})
- end
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIPOPGot,{rewards = rewards})
- end
- end
- function UIBoliShopView:RefreshVipView()
- local curVipLv = ManagerContainer.DataMgr.UserData:GetVipLv()
- local vipCfg = ManagerContainer.CfgMgr:GetVipCfgById(curVipLv)
- self.vipIcon.image.sprite = nil
- self.vipIcon.image.enabled = false
- self.vipFrame.image.sprite = nil
- self.vipFrame.image.enabled = false
- if not vipCfg then
- self.vipNameTxt.text.text = ''
- return
- end
- CommonUtil.LoadIcon(self, vipCfg.BigIcon, function(sprite)
- if sprite then
- self.vipIcon.image.sprite = sprite
- self.vipIcon.image.enabled = true
- end
- end)
- CommonUtil.LoadIcon(self, vipCfg.BigFrame, function(sprite)
- if sprite then
- self.vipFrame.image.sprite = sprite
- self.vipFrame.image.enabled = true
- end
- end)
- self.vipNameTxt.text.text = string.formatbykey(vipCfg.Name)
- end
- function UIBoliShopView:RefreshCoins()
- local coin = ManagerContainer.DataMgr.UserData:GetOwnCoin()
- self.coin.number.text.text = CommonUtil.FormatNumber(coin)
- end
- function UIBoliShopView:RefreshROCoin()
- local count = CommonUtil.GetOwnResCountByItemId(Enum.ItemType.ROCoin)
- self.ro.number.text.text = CommonUtil.FormatNumber(count)
- end
- function UIBoliShopView:RefreshDiamond()
- local count = CommonUtil.GetOwnResCountByItemId(Enum.ItemType.Diamond)
- self.gold.number.text.text = CommonUtil.FormatNumber(count)
- end
- function UIBoliShopView:FillContent(data, uiBase)
- self.uiBase = uiBase
- local gameObject = self.uiBase:GetRoot()
- if gameObject ~= nil then
- self.gameObject = gameObject
- self.transform = gameObject.transform
- end
- self:InitGenerate(self.transform, data)
- self:Init()
- end
- function UIBoliShopView:Init()
- self:RefreshCoins()
- self:RefreshROCoin()
- self:RefreshDiamond()
- self.shopExpBox:SetActive(true)
- self:InitGridView()
- local enterType = self.controller:SetCurEnterType(1)
- self.privilegeToggle.toggle.isOn = true
- self:OnValueChangedToggle(nil,enterType,true)
- end
- function UIBoliShopView:OnPageInEnd()
- self.super.OnPageInEnd(self)
- self.scrollViewLv.scrollRect.enabled = true
- self.informationScrollView.scrollRect.enabled = true
- self.goodsScrollView.scrollRect.enabled = true
- end
- function UIBoliShopView:RefreshCurExp()
- local curlv = ManagerContainer.DataMgr.BoliShopData:GetCurLv()
- local curExp = ManagerContainer.DataMgr.BoliShopData:GetCurExp()
- local curData = ManagerContainer.CfgMgr:GetBoLiVipCfgById(curlv)
- local nextData = ManagerContainer.CfgMgr:GetBoLiVipCfgById(curlv + 1)
- local BoliVipCfg = ManagerContainer.CfgMgr:GetBoliVipCfg()
- self.maxCfgData = BoliVipCfg[#BoliVipCfg]
- local maxcfgData = BoliVipCfg[#BoliVipCfg - 1]
- if maxcfgData then
- self.maxExp = maxcfgData.VipExp
- end
- local exp = self.maxCfgData.Lv == curlv and self.maxExp or curData.VipExp
- self.numlv.text.text = tostring(curlv)
- if curData then
- self.numexp.text.text = curExp .."/"..exp
- self.expSlider.slider.value = curExp/curData.VipExp
- end
- self.max:SetActive(nextData == nil)
- self.btnLvUp:SetActive(nextData ~= nil)
- self.controller:RefreshGoodsData()
- end
- function UIBoliShopView:InitGridView()
- self.scrollViewLv.scrollRect.enabled = false
- self.informationScrollView.scrollRect.enabled = false
- self.goodsScrollView.scrollRect.enabled = false
- self.scrollViewLv.loopGridView:InitGridView(0, function(gridView, itemIndex, row, column)
- return self:GetItemByRowColumn(gridView, itemIndex, row, column)
- end, nil)
- self.informationScrollView.loopGridView:InitGridView(0, function(gridView, itemIndex, row, column)
- return self:GetVipDescItemByRowColumn(gridView, itemIndex, row, column)
- end, nil)
- self.goodsScrollView.loopGridView:InitGridView(0, function(gridView, itemIndex, row, column)
- return self:GetGoodsItemByRowColumn(gridView, itemIndex, row, column)
- end, nil)
- self.controller:RefreshsvipLvShowDatas()
- end
- function UIBoliShopView:RefreshBtnLvScroll()
- if self.controller:GetCurEnterType() ~= 1 then
- return
- end
- redpointState = false
- local len = self.controller:GetBoliVipLvDataLengths()
- self.scrollViewLv.loopGridView:RefreshListByIndex(len,0)
- self.privilegeToggle.redPoint:SetActive(redpointState)
- local isHide = self:GetIsHideShopBtn()
- self.shopToggle:SetActive(isHide)
- end
- function UIBoliShopView:GetIsHideShopBtn()
- local curLv = ManagerContainer.DataMgr.BoliShopData:GetCurLv()
- local showTime = ManagerContainer.DataMgr.BoliShopData:GetShowTime()
- local serverTime = ManagerContainer.LuaTimerMgr:CurLuaServerTime()
- local time = type(serverTime) == "number" and serverTime or #serverTime
- return curLv >= 1 and showTime > 0 and time >= showTime
- end
- function UIBoliShopView:StartShopGoodsItemTimer(itemLua, goodsData)
- local timer = self.shopGoodsItemTimer
- if not timer then
- timer = Timer.New(function()
- self:RefreshShopGoodsItemTimer()
- end, 1, -1)
- self.shopGoodsItemTimer = timer
- end
- local updateItemMap = timer.updateItemMap
- if not updateItemMap then
- updateItemMap = {}
- timer.updateItemMap = updateItemMap
- end
- updateItemMap[itemLua] = goodsData
- if not timer.running then
- timer:Start()
- end
- end
- function UIBoliShopView:StopShopGoodsItemTimer(itemLua)
- local timer = self.shopGoodsItemTimer
- if timer then
- local updateItemMap = timer.updateItemMap
- if updateItemMap then
- updateItemMap[itemLua] = nil
- end
- if not updateItemMap or table_is_empty(updateItemMap) then
- timer:Stop()
- end
- end
- end
- function UIBoliShopView:DisposeShopGoodsItemTimer()
- if self.shopGoodsItemTimer then
- self.shopGoodsItemTimer:Stop()
- self.shopGoodsItemTimer.updateItemMap = nil
- self.shopGoodsItemTimer = nil
- end
- end
- function UIBoliShopView:RefreshShopGoodsItemTimer()
- local timer = self.shopGoodsItemTimer
- if not timer then return end
- local updateItemMap = timer.updateItemMap
- if not updateItemMap or table_is_empty(updateItemMap) then
- timer:Stop()
- return
- end
- for itemLua, goodsData in pairs(updateItemMap) do
- itemLua.limitBox:SetActive(true)
- itemLua.timeLimit.text.text = goodsData:CalculateLimitTime()
- end
- end
- function UIBoliShopView:GetGoodsItemByRowColumn(gridView, itemIndex, row, column)
- local item = nil
- local shopData = ManagerContainer.DataMgr.BoliShopData:GetBoliShopData()
- if not shopData then return nil end
- local goods = shopData:GetShowGoodsDatas()
- if not goods then return nil end
- local goodsData = goods[itemIndex + 1]
- if not goodsData then return nil end
- local item = gridView:NewListViewItem('ShopGoodsItem')
- local itemLua = CommonUtil.BindGridViewItem2Lua(self, 'ShopGoodsItem', item.gameObject)
- local goodsCfgData = goodsData:GetGoodsCfgData()
- local data = {cfgId = goodsCfgData.GoodsItem}
- -- CommonUtil.UpdateItemPrefab(self, itemLua.iconItem, data, nil, self, self.ShowItemTips, data)
- CommonUtil.UpdateItemPrefab(self, itemLua.iconItem, data, nil)
- local itemCfgData = ManagerContainer.CfgMgr:GetItemById(goodsCfgData.PayForType)
- CommonUtil.LoadIcon(self, itemCfgData.MiniIcon, function (sprite)
- itemLua.presentPrice.icon.image.sprite = sprite
- itemLua.originalPrice.icon.image.sprite = sprite
- end, itemLua, 'CurrenyIcon')
- itemLua.itemName.text.text = goodsCfgData.GoodsName
- itemLua.presentPrice.number.text.text = goodsData.curPrice --现价
- if goodsData:IsDiscount() then --折扣
- itemLua.discount:SetActive(true)
- itemLua.originalPrice:SetActive(true)
- local discountNum = goodsData.disPercent
- --不是中文环境
- if not (ManagerContainer.LuaGameMgr.CurLangKey == "_cn"
- or ManagerContainer.LuaGameMgr.CurLangKey == "_tw") then
- discountNum = 100 - goodsData.disPercent
- else
- discountNum = goodsData.disPercent * 0.1
- end
- itemLua.discount.text.text.text = I18N.SetLanguageValue("ShopDiscount", tostring(discountNum)) -- {0}折,中文是:{0}折,非中文是{0}%off
- itemLua.originalPrice.number.text.text = goodsData.price
- elseif goodsData.hot then --热销
- itemLua.discount:SetActive(true)
- itemLua.originalPrice:SetActive(false)
- itemLua.discount.text.text.text = I18N.T("ShopSellwell")
- else
- itemLua.discount:SetActive(false)
- itemLua.originalPrice:SetActive(false)
- end
- local limitType = goodsData.limitType
- if limitType == Enum.LimitBuyType.NoLimit then
- itemLua.purchaseLimit:SetActive(false)
- itemLua.limitBox:SetActive(false)
- self:StopShopGoodsItemTimer(itemLua)
- elseif limitType == Enum.LimitBuyType.Forever then
- itemLua.purchaseLimit:SetActive(true)
- local remainNum = (goodsData.count - goodsData.buyNum)
- if remainNum < 0 then remainNum = 0 end
- itemLua.purchaseLimit.text.text = string.formatbykey("ShopForeverBuy", remainNum)
- itemLua.limitBox:SetActive(false)
- self:StopShopGoodsItemTimer(itemLua)
- elseif limitType == Enum.LimitBuyType.Daily then
- itemLua.purchaseLimit:SetActive(true)
- local remainNum = (goodsData.count - goodsData.buyNum)
- if remainNum < 0 then remainNum = 0 end
- itemLua.purchaseLimit.text.text = string.formatbykey("ShopDayBuy", remainNum)
- itemLua.limitBox:SetActive(true)
- itemLua.timeLimit.text.text = goodsData:CalculateLimitTime()
- self:StartShopGoodsItemTimer(itemLua, goodsData)
- elseif limitType == Enum.LimitBuyType.Week then
- itemLua.purchaseLimit:SetActive(true)
- local remainNum = (goodsData.count - goodsData.buyNum)
- if remainNum < 0 then remainNum = 0 end
- itemLua.purchaseLimit.text.text = string.formatbykey("ShopLoopBuy", remainNum)
- itemLua.limitBox:SetActive(true)
- itemLua.timeLimit.text.text = goodsData:CalculateLimitTime()
- self:StartShopGoodsItemTimer(itemLua, goodsData)
- elseif limitType == Enum.LimitBuyType.Time then
- itemLua.purchaseLimit:SetActive(true)
- local remainNum = (goodsData.count - goodsData.buyNum)
- if remainNum < 0 then remainNum = 0 end
- itemLua.purchaseLimit.text.text = string.formatbykey("ShopLimitBuy", remainNum)
- itemLua.limitBox:SetActive(true)
- itemLua.timeLimit.text.text = goodsData:CalculateLimitTime()
- self:StartShopGoodsItemTimer(itemLua, goodsData)
- elseif limitType == Enum.LimitBuyType.Special then
- itemLua.purchaseLimit:SetActive(true)
- local remainNum = (goodsData.count - goodsData.buyNum)
- if remainNum < 0 then remainNum = 0 end
- itemLua.purchaseLimit.text.text = string.formatbykey("ShopLimitBuy", remainNum)
- itemLua.limitBox:SetActive(false)
- self:StopShopGoodsItemTimer(itemLua)
- else
- itemLua.purchaseLimit:SetActive(false)
- itemLua.limitBox:SetActive(false)
- self:StopShopGoodsItemTimer(itemLua)
- end
- itemLua.soldout:SetActive(goodsData:IsSoldout())
- self.uiBase:AddButtonUniqueEventListener(itemLua.button, self, self.OnClickShopGoodsItem, goodsData)
- self.uiBase:AddButtonUniqueEventListener(itemLua.presentPrice.button, self, self.OnClickShopGoodsItem, goodsData)
- return item
- end
- function UIBoliShopView:OnClickShopGoodsItem(btn, params)
- local shopData = ManagerContainer.DataMgr.BoliShopData:GetBoliShopData()
- if not shopData then return end
- local goodsData = params[0]
- if not goodsData then return end
- if not goodsData:IsSoldout() then
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIBoliShopBuyTips, goodsData.id)
- end
- end
- function UIBoliShopView:GetVipDescItemByRowColumn(gridView, itemIndex, row, column)
- local item = nil
- item = gridView:NewListViewItem('PrivilegeDscItem')
- local data = self.controller:GetDescDataByIdx(itemIndex + 1)
- local itemLua = CommonUtil.BindGridViewItem2Lua(self, 'PrivilegeDscItem', item.gameObject)
- if data then
- itemLua.desTxt.text.text = string.formatbykey(data[2],data[3],data[4],data[5])
- itemLua.new:SetActive(data[1] == 1)
- end
- return item
- end
- function UIBoliShopView:GetItemByRowColumn(gridView, itemIndex, row, column)
- local item = nil
- item = gridView:NewListViewItem('BtnLv')
- local data = self.controller:GetBoliVipDataByIdx(itemIndex + 1)
- local curlv = ManagerContainer.DataMgr.BoliShopData:GetCurLv()
- local itemLua = CommonUtil.BindGridViewItem2Lua(self, 'BtnLv', item.gameObject)
- if data then
- if LastItemIdx ~= data.Lv then
- local lv = curlv
- if LastItemIdx == nil or LastItemIdx == curlv then
- lv = curlv
- else
- lv = LastItemIdx
- end
- itemLua.off:SetActive(lv ~= data.Lv)
- local isShow = (lv == 0 and data.Lv == 1) or lv == data.Lv
- itemLua.on:SetActive(isShow)
- if isShow then
- LastItemIdx = itemIndex + 1
- end
- else
- itemLua.off:SetActive(false)
- itemLua.on:SetActive(true)
- end
- itemLua.text.text.text = string.formatbykey("PrivilegeLv01",data.Lv)
- itemLua.activeted:SetActive(data.Lv == curlv)
- local rewardData = ManagerContainer.DataMgr.BoliShopData:GetRewardListById(data.Lv)
- if curlv >= data.Lv then
- itemLua.redPoint:SetActive(rewardData == nil)
- if not redpointState and rewardData == nil then
- redpointState = true
- end
- else
- itemLua.redPoint:SetActive(false)
- end
- end
- self.uiBase:AddButtonUniqueEventListener(itemLua.button, self, self.OnClickBoliLvBtn,{itemIndex,itemLua})
- return item
- end
- function UIBoliShopView:GetShowItemByIdx(idx)
- local item = self.scrollViewLv.loopGridView:GetShownItemByItemIndex(idx)
- if item then
- local itemlua = CommonUtil.GetBindGridViewItem2Lua(self, "BtnLv", item.gameObject)
- return itemlua
- end
- end
- function UIBoliShopView:OnClickBoliLvBtn(btn,param)
- local parms = param[0]
- local itemLua = self:GetShowItemByIdx(parms[1])
- local LastItemLua = self:GetShowItemByIdx(LastItemIdx - 1)
- if itemLua then
- if LastItemLua then
- LastItemLua.off:SetActive(true)
- LastItemLua.on:SetActive(false)
- end
- itemLua.off:SetActive(false)
- itemLua.on:SetActive(true)
- end
- local curlv = ManagerContainer.DataMgr.BoliShopData:GetCurLv()
- local data = self.controller:GetBoliVipDataByIdx(parms[1] + 1)
- LastItemIdx = parms[1] + 1
- if data.Lv <= curlv then
- self.prompt.text.text = string.formatbykey("BoliTips01")
- else
- self.prompt.text.text = string.formatbykey("BoliTips02",data.Lv)
- end
- self.titletext.text.text = string.formatbykey("PrivilegeLv02",data.Lv)
- self.labelActiveted:SetActive(data.Lv <= curlv)
- self:RefreshVipDescScroll(data)
- self:RefreshGiftUI(data)
- end
- function UIBoliShopView:RefreshVipDescScroll(data)
- if self.controller:GetCurEnterType() ~= 1 then
- return
- end
- if data then
- local descData = data.UnlockDes
- if descData then
- self.controller:SetDescData(descData)
- self.informationScrollView.loopGridView:RefreshListByIndex(#descData,0)
- end
- end
- end
- function UIBoliShopView:RefreshBoliShopData()
- local curlv = ManagerContainer.DataMgr.BoliShopData:GetCurLv()
- local idx = curlv > 0 and curlv or 1
- if LastItemIdx then
- idx = LastItemIdx
- end
- local data = self.controller:GetBoliVipDataByIdx(idx)
- if data then
- if data.Lv <= curlv then
- self.prompt.text.text = string.formatbykey("BoliTips01")
- else
- self.prompt.text.text = string.formatbykey("BoliTips02",data.Lv)
- end
- self.titletext.text.text = string.formatbykey("PrivilegeLv02",data.Lv)
- self.labelActiveted:SetActive(data.Lv <= curlv)
- self:RefreshVipDescScroll(data)
- self:RefreshGiftUI(data)
- end
- self:RefreshBtnLvScroll()
- self:RefreshCurExp()
- end
- function UIBoliShopView:RefreshGiftUI(data)
- if self.controller:GetCurEnterType() ~= 1 then
- return
- end
- local curlv = ManagerContainer.DataMgr.BoliShopData:GetCurLv()
- local redPoint = true
- local GetRewardIdx = 0
- local mask = false
- if curlv >= data.Lv then
- local data = ManagerContainer.DataMgr.BoliShopData:GetRewardListById(data.Lv)
- if data then
- GetRewardIdx = data
- mask = true
- end
- end
- for i = 1, 3 do
- local itemLua = self["giftItem"..i]
- if itemLua then
- local reward = data.GiftRewards[i]
- local cfgData = ManagerContainer.CfgMgr:GetItemById(reward[1])
- if cfgData then
- itemLua.giftname.text.text = cfgData.Name
- end
- local logicData = {cfgId = reward[1], num = reward[2]}
- IconItemCtr:SetData(self, itemLua.iconItem, logicData,nil, self, self.OnItemClick)
- itemLua.labelReceived:SetActive(mask)
- -- itemLua.btnReceive.button.interactable = curlv >= data.Lv
- itemLua.btnReceive.lock:SetActive(curlv < data.Lv)
- itemLua.icon:SetActive(GetRewardIdx == i)
- local logicData = {idx = i,lv = data.Lv}
- self.uiBase:AddButtonUniqueEventListener(itemLua.btnReceive.button, self, self.OnClickReceiveBtn,logicData)
- end
- end
- end
- function UIBoliShopView:OnClickReceiveBtn(button,params)
- local data = params[0]
- local curlv = ManagerContainer.DataMgr.BoliShopData:GetCurLv()
- if curlv < data.lv then
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("PrivilegeUnlock")
- else
- ManagerContainer.DataMgr.BoliShopData:SendBoliShopRewardReq(data.lv,data.idx)
- end
- end
- function UIBoliShopView:OnItemClick(button,params)
- local data = params[0]
- ManagerContainer.LuaUIMgr:OpenTips(data)
- end
- function UIBoliShopView:RemoveEventListener()
- ManagerContainer.LuaEventMgr:Unregister(self.uiData.name)
- end
- function UIBoliShopView:AddUIEventListener()
- self.uiBase:AddButtonUniqueEventListener(self.btnClose.button, self, self.OnClickCloseBtn)
- self.uiBase:AddButtonUniqueEventListener(self.btnVIP.button, self, self.OnClickVipBtn)
- self.uiBase:AddButtonUniqueEventListener(self.btnLvUp.button, self, self.OnClickVipLvUpBtn)
- self.uiBase:AddToggleEventListener(self.privilegeToggle.toggle, self, self.OnValueChangedToggle,1)
- self.uiBase:AddToggleEventListener(self.shopToggle.toggle, self, self.OnValueChangedToggle,2)
- end
- function UIBoliShopView:OnValueChangedToggle(toggle, idx, isOn)
- if not isOn then return end
- local enterType = self.controller:SetCurEnterType(idx)
- self.privilegeBox:SetActive(enterType == 1)
- self.goodsBox:SetActive(enterType == 2)
- if enterType == 1 then
- self:RefreshVipView()
- self:RefreshCurExp()
- self:RefreshBoliShopData()
- elseif enterType == 2 then
- ManagerContainer.DataMgr.BoliShopData:SendBoliShopInfoReq()
- end
- end
- function UIBoliShopView:RefreshGoodsItemsScroll()
- if self.controller:GetCurEnterType() ~= 2 then
- return
- end
- local shopData = ManagerContainer.DataMgr.BoliShopData:GetBoliShopData()
- local length = 0
- if shopData then
- local goods = shopData:GetShowGoodsDatas()
- if goods then
- length = #goods
- end
- self.goodsScrollView.loopGridView:RefreshListByIndex(length)
- end
- end
- function UIBoliShopView:OnClickVipLvUpBtn()
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIBoliShopUpLvTips)
- end
- function UIBoliShopView:OnClickVipBtn()
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIVip)
- end
- function UIBoliShopView:OnHide()
- end
- function UIBoliShopView:OnClickCloseBtn()
- ManagerContainer.LuaUIMgr:OpenSourceUI(self)
- end
- function UIBoliShopView:OnShow(data)
- self.controller:SetData(data)
- end
- function UIBoliShopView:OnClose()
- end
- function UIBoliShopView:OnDispose()
- self.controller:OnDispose()
- IsRefreshBtnItem = nil
- LastItemIdx = nil
- self.scrollViewLv.loopGridView:Dispose()
- self.informationScrollView.loopGridView:Dispose()
- self.goodsScrollView.loopGridView:Dispose()
- self:DisposeShopGoodsItemTimer()
- end
- return UIBoliShopView
|