45 lines
1.3 KiB
Lua
45 lines
1.3 KiB
Lua
|
|
-- 备注界面
|
||
|
|
local GroupSetBindView = {}
|
||
|
|
|
||
|
|
local M = GroupSetBindView
|
||
|
|
|
||
|
|
function GroupSetBindView.new(group_id, member, callback)
|
||
|
|
setmetatable(M, {__index = BaseWindow})
|
||
|
|
local self = setmetatable({}, {__index = M})
|
||
|
|
self.class = "GroupSetBindView"
|
||
|
|
self._close_destroy = true
|
||
|
|
self.callback = callback
|
||
|
|
self.group_id = group_id
|
||
|
|
self:init("ui://NewGroup/Win_SetTag", member)
|
||
|
|
return self
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:init(url, member)
|
||
|
|
BaseWindow.init(self,url)
|
||
|
|
|
||
|
|
local tex_tag = self._view:GetChild("tex_tag")
|
||
|
|
if tag ~= 0 then
|
||
|
|
tex_tag.text = member.score
|
||
|
|
end
|
||
|
|
self._view:GetChild("btn_ok").onClick:Set(function()
|
||
|
|
ViewUtil.ShowModalWait(nil)
|
||
|
|
local score = tonumber(tex_tag.text) or 0
|
||
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||
|
|
fgCtr:FG_SetMemberTag(self.group_id, member.uid, score, function(res)
|
||
|
|
if self._is_destroy then
|
||
|
|
return
|
||
|
|
end
|
||
|
|
ViewUtil.CloseModalWait()
|
||
|
|
if res.ReturnCode ~= 0 then
|
||
|
|
ViewUtil.ErrorTip(res.ReturnCode, "标注失败")
|
||
|
|
else
|
||
|
|
ViewUtil.ShowBannerOnScreenCenter("标注成功")
|
||
|
|
member.score = score
|
||
|
|
self:Destroy()
|
||
|
|
self.callback(true)
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
|
||
|
|
return M
|