12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- ---@class KLEarningsItem:UIKmlLuaPanelBase
- ---@field view KLEarningsItemView
- local KLEarningsItem = class(UIKmlLuaPanelBase)
- local this =KLEarningsItem
- ---创建时调用一次
- function this:Init()
- end
- ---创建或者刷新界面数据时调用
- function this:Refresh()
- end
- ---剩余三倍收益时间时长小于列表项领取的时长或月卡时间为0,“领取”按钮发暗,不可点击
- function this:UpdateUI(data,minute)
- local monthallTime = InfoManager.monthCardInfo.MonthCardTimeTotal-SL:GetMetaValue(EMetaVarGetKey.SERVER_TIME) --月卡总时间
- self.data = data
- self.iscanget = false --是否可领取
- if minute > 0 and data.hourtime * 60 <= minute then
- self.iscanget = true
- end
- if monthallTime <= 0 then
- self.iscanget = false
- end
- GUI:Button_setGrey(self.view.getBtn, not self.iscanget)
- GUI:Text_setString(self.view.predes, data.des)
- end
- ---注册UI事件和服务器消息
- function this:RegistEvents()
- GUI:AddOnClickEvent(self.view.getBtn, self, self.OnClickGetButton)
- end
- ---领取奖励
- function this:OnClickGetButton()
- if self.iscanget then
- SL:SendLuaNetMsg(LuaMessageIdToSever.TRIPLE_INCOME_RECEIVE,self.data.hourtime) --请求三倍收益信息
- end
- end
- function this:Close()
- end
- return this
|