changhong/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngFagPackStatView.lua

38 lines
1.2 KiB
Lua

-- 能量包统计
local GroupTakeLogView = import(".GroupTakeLogView")
local GroupRewardsLogView = import(".GroupRewardsLogView")
local GroupNumberInputView = import(".GroupNumberInputView")
local GroupMngFagPackStatView = {}
local M = GroupMngFagPackStatView
function GroupMngFagPackStatView.new(gid, blur_view)
local self = M
self.class = "GroupMngFagPackStatView"
self.group_id = gid
self.blur_view = blur_view
self:InitView()
return self
end
function M:InitView()
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupFagPackStat")
end
function M:initData()
local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_GetFagPackInfo(self.group_id, function(res)
if res.ReturnCode ~= 0 then
ViewUtil.ErrorTip(res.ReturnCode, "获取能量包失败")
else
local data = res.Data
self._view:GetChild("tex_total_fag").text = d2ad(data.hp_num1)
self._view:GetChild("tex_minus_fag").text = d2ad(data.hp_num2)
self._view:GetChild("tex_fagpack").text = d2ad(data.hp_num3)
self._view:GetChild("tex_group_total_fag").text = d2ad(data.hp_num1 + data.hp_num3)
end
end)
end
return M