| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- local UIDojoBuyTimesCtr = class("UIDojoBuyTimesCtr", require("UICtrBase"))
- function UIDojoBuyTimesCtr:Init(view)
- self.view = view
- end
- function UIDojoBuyTimesCtr:SetData(data)
- self.asyncIdx = 0
- if data == nil then return end
- self.data = data
- end
- function UIDojoBuyTimesCtr:GetAsyncIdx()
- self.asyncIdx = self.asyncIdx + 1
- return self.asyncIdx
- end
- function UIDojoBuyTimesCtr:GetData()
- return self.data
- end
- function UIDojoBuyTimesCtr:OnDispose()
- self.data = nil
- self.view = nil
- end
- function UIDojoBuyTimesCtr:GetCostNum()
- if self.data then
- return self.data[1] or 0
- end
- return 0
- end
- function UIDojoBuyTimesCtr:GetRemainCount()
- if self.data then
- return self.data[2]
- end
- return nil
- end
- function UIDojoBuyTimesCtr:HandleCallback()
- if self.data then
- local cb = self.data[3]
- local ownerCb = self.data[4]
- local param = self.data[5]
- if cb then
- if ownerCb then
- cb(ownerCb,param)
- else
- cb(param)
- end
- end
- end
- end
- function UIDojoBuyTimesCtr:GetCostType()
- if self.data then
- return self.data[6]
- end
- return nil
- end
- return UIDojoBuyTimesCtr
|