local ParkourBonusProgressItem = BaseClass("ParkourBonusProgressItem", UIBaseContainer)
local base = UIBaseContainer
local Localization = CS.GameEntry.Localization
local OnCreate = function(self)
  base.OnCreate(self)
  self:ComponentDefine()
  self:DataDefine()
end
local OnDestroy = function(self)
  self:DataDestroy()
  self:ComponentDestroy()
  base.OnDestroy(self)
end
local OnEnable = function(self)
  base.OnEnable(self)
end
local OnDisable = function(self)
  base.OnDisable(self)
end
local ComponentDefine = function(self)
  self.textNum = self:AddComponent(UITextMeshProUGUIEx, "NumText")
  self.imgIcon = self:AddComponent(UIImage, "Icon")
  self.imgSure = self:AddComponent(UIImage, "SureImg")
end
local ComponentDestroy = function(self)
  self.textNum = nil
  self.imgIcon = nil
  self.imgSure = nil
end
local DataDefine = function(self)
end
local DataDestroy = function(self)
end
local OnAddListener = function(self)
  base.OnAddListener(self)
end
local OnRemoveListener = function(self)
  base.OnRemoveListener(self)
end
local SetData = function(self, param, maxNum)
  self.progressNum = param.progressNum
  self.rewardId = param.rewardId
  self.textNum:SetText(math.floor(self.progressNum / maxNum * 100) .. "%")
  self:Refresh(0)
end
local Refresh = function(self, nowProgressNum)
  if nowProgressNum >= self.progressNum then
    self.textNum:SetActive(false)
    self.imgSure:SetActive(true)
  else
    self.textNum:SetActive(true)
    self.imgSure:SetActive(false)
  end
end
ParkourBonusProgressItem.OnCreate = OnCreate
ParkourBonusProgressItem.OnDestroy = OnDestroy
ParkourBonusProgressItem.OnEnable = OnEnable
ParkourBonusProgressItem.OnDisable = OnDisable
ParkourBonusProgressItem.ComponentDefine = ComponentDefine
ParkourBonusProgressItem.ComponentDestroy = ComponentDestroy
ParkourBonusProgressItem.DataDefine = DataDefine
ParkourBonusProgressItem.DataDestroy = DataDestroy
ParkourBonusProgressItem.OnAddListener = OnAddListener
ParkourBonusProgressItem.OnRemoveListener = OnRemoveListener
ParkourBonusProgressItem.SetData = SetData
ParkourBonusProgressItem.Refresh = Refresh
return ParkourBonusProgressItem
