Compare commits
10 Commits
f5527880d9
...
35b6f46809
| Author | SHA1 | Date |
|---|---|---|
|
|
35b6f46809 | |
|
|
12311742ac | |
|
|
860b396fd6 | |
|
|
d28814cea3 | |
|
|
a0867973dd | |
|
|
4764ecfe8b | |
|
|
7097ab6b2e | |
|
|
06d3a6b412 | |
|
|
f67d6368d8 | |
|
|
a6c0ee2e45 |
|
|
@ -42,5 +42,5 @@ BroadcastEvent = {
|
||||||
OnJoinsChange = 'OnJoinsChange',
|
OnJoinsChange = 'OnJoinsChange',
|
||||||
OnMemberChange = "OnMemberChange",
|
OnMemberChange = "OnMemberChange",
|
||||||
OnOutFamily = "OnOutFamily",
|
OnOutFamily = "OnOutFamily",
|
||||||
|
OnOutFamily2 = "OnOutFamily2",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -671,12 +671,12 @@ function M:ReturnToRoom()
|
||||||
false,
|
false,
|
||||||
function(response)
|
function(response)
|
||||||
if (response.ReturnCode == -1) then
|
if (response.ReturnCode == -1) then
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
RestartGame()
|
RestartGame()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
end,
|
end,
|
||||||
self.tmpGroupID
|
self.tmpGroupID
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -412,6 +412,9 @@ end
|
||||||
|
|
||||||
-- 邀请在线玩家
|
-- 邀请在线玩家
|
||||||
function M:FG_InvitePlayer(group_id, tag, player_id, roomid, pid, game_name, callback)
|
function M:FG_InvitePlayer(group_id, tag, player_id, roomid, pid, game_name, callback)
|
||||||
|
if not self._mgr_client then
|
||||||
|
return
|
||||||
|
end
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data.groupId = group_id
|
_data.groupId = group_id
|
||||||
_data.tagId = tag
|
_data.tagId = tag
|
||||||
|
|
@ -456,12 +459,7 @@ end
|
||||||
|
|
||||||
--被邀请玩家收到邀请
|
--被邀请玩家收到邀请
|
||||||
function M:FG_ResponseInvited(evt_data)
|
function M:FG_ResponseInvited(evt_data)
|
||||||
local invite_id = evt_data.invite_id
|
DispatchEvent(self._dispatcher, GroupMgrEvent.InviteResponse, evt_data)
|
||||||
local g_name = evt_data.g_name
|
|
||||||
local roomid = evt_data.roomid
|
|
||||||
local pid = evt_data.pid
|
|
||||||
local groupid = evt_data.groupId
|
|
||||||
DispatchEvent(self._dispatcher, GroupMgrEvent.InviteResponse, invite_id, g_name, roomid, pid, groupid)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 设置助理,来用给对面刷新界面 tagId=助理
|
-- 设置助理,来用给对面刷新界面 tagId=助理
|
||||||
|
|
@ -611,6 +609,9 @@ function M:OnMemberOut(evt_data)
|
||||||
local uid = evt_data.uid
|
local uid = evt_data.uid
|
||||||
local groupId = evt_data.groupId
|
local groupId = evt_data.groupId
|
||||||
local group = DataManager.groups:get(groupId)
|
local group = DataManager.groups:get(groupId)
|
||||||
|
if not group then
|
||||||
|
return
|
||||||
|
end
|
||||||
group:delMember(uid)
|
group:delMember(uid)
|
||||||
DispatchEvent(self._dispatcher, GroupMgrEvent.OnFamilyMemberOut, evt_data)
|
DispatchEvent(self._dispatcher, GroupMgrEvent.OnFamilyMemberOut, evt_data)
|
||||||
Broadcast.Send(BroadcastEvent.Reflash)
|
Broadcast.Send(BroadcastEvent.Reflash)
|
||||||
|
|
|
||||||
|
|
@ -92,9 +92,12 @@ function M:CreateRoom(game_id, dataInfo, callback)
|
||||||
|
|
||||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||||
room.game_id = game_id
|
room.game_id = game_id
|
||||||
|
room.game_info = game_info
|
||||||
|
|
||||||
room.room_id = room_id
|
room.room_id = room_id
|
||||||
room.server_host = string.concat(server_ip, ":", server_port)
|
room.server_host = string.concat(server_ip, ":", server_port)
|
||||||
room.session = _client:getSession()
|
room.session = _client:getSession()
|
||||||
|
room._flag_lobby = true
|
||||||
DataManager.CurrenRoom = room
|
DataManager.CurrenRoom = room
|
||||||
|
|
||||||
local game_net = nil
|
local game_net = nil
|
||||||
|
|
@ -174,7 +177,9 @@ function M:PublicJoinRoom(cmd, room_id, callback, group_id, group_layer)
|
||||||
room.server_host = string.concat(server_ip, ":", server_port)
|
room.server_host = string.concat(server_ip, ":", server_port)
|
||||||
room.session = _client:getSession()
|
room.session = _client:getSession()
|
||||||
room.group_id = json["groupId"]
|
room.group_id = json["groupId"]
|
||||||
|
room.game_info = game_info
|
||||||
room.play_id = json["pid"]
|
room.play_id = json["pid"]
|
||||||
|
room._flag_lobby = true
|
||||||
-- 体力值开关
|
-- 体力值开关
|
||||||
room.hpOnOff = json["hpOnOff"]
|
room.hpOnOff = json["hpOnOff"]
|
||||||
-- 体力值倍数
|
-- 体力值倍数
|
||||||
|
|
@ -242,6 +247,7 @@ function M:ResetJionRoom(callback)
|
||||||
room.hpOnOff = o_room.hpOnOff
|
room.hpOnOff = o_room.hpOnOff
|
||||||
room.owner_id = o_room.owner_id
|
room.owner_id = o_room.owner_id
|
||||||
room.create_time = o_room.create_time
|
room.create_time = o_room.create_time
|
||||||
|
room._flag_lobby = true
|
||||||
room:SetReloadStatus(true)
|
room:SetReloadStatus(true)
|
||||||
DataManager.CurrenRoom = room
|
DataManager.CurrenRoom = room
|
||||||
__ConntectGameServer(Protocol.GAME_JOIN_ROOM, room, room.server_host, j_data, function(res1)
|
__ConntectGameServer(Protocol.GAME_JOIN_ROOM, room, room.server_host, j_data, function(res1)
|
||||||
|
|
@ -390,14 +396,14 @@ function M:RequestPlayBack(_data, callback, game_info)
|
||||||
end
|
end
|
||||||
|
|
||||||
--获取手机验证码
|
--获取手机验证码
|
||||||
function M:GetPhoneCode(phone, callback)
|
-- function M:GetPhoneCode(phone, callback)
|
||||||
local _client = ControllerManager.WebClient
|
-- local _client = ControllerManager.WebClient
|
||||||
local _data = {}
|
-- local _data = {}
|
||||||
_data["phone"] = phone
|
-- _data["phone"] = phone
|
||||||
_client:send(Protocol.WEB_GET_VERIFCATION_CODE, _data, function(res)
|
-- _client:send(Protocol.WEB_GET_VERIFCATION_CODE, _data, function(res)
|
||||||
callback(res)
|
-- callback(res)
|
||||||
end)
|
-- end)
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function M:GetUserInfo(callback)
|
function M:GetUserInfo(callback)
|
||||||
local _client = ControllerManager.WebClient
|
local _client = ControllerManager.WebClient
|
||||||
|
|
@ -485,3 +491,42 @@ function M:GetServiceInfo(data, callback)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--手机验证码
|
||||||
|
function M:GetPhoneCode(phone, callback)
|
||||||
|
--不走登录逻辑
|
||||||
|
local _client = ControllerManager.WebClient
|
||||||
|
local _data = {}
|
||||||
|
_data["phone"] = phone
|
||||||
|
if DataManager.SelfUser.phone and #DataManager.SelfUser.phone then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
_client:send(Protocol.WEB_GET_Phone_Code, _data, function(res)
|
||||||
|
if (callback ~= nil) then
|
||||||
|
callback(res)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
--绑定手机验证码
|
||||||
|
function M:PhoneBind(phone, code, callback)
|
||||||
|
local _client = ControllerManager.WebClient
|
||||||
|
local _data = {}
|
||||||
|
_data["phone"] = phone
|
||||||
|
_data["code"] = code
|
||||||
|
_client:send(Protocol.WEB_BIND_Phone, _data, function(res)
|
||||||
|
if (callback ~= nil) then
|
||||||
|
callback(res)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 获取亲友圈房卡记录
|
||||||
|
function M:FG_Get_Diamond_Msg(callback)
|
||||||
|
local _data = {}
|
||||||
|
_data.id = DataManager.SelfUser.account_id
|
||||||
|
local _client = ControllerManager.WebClient
|
||||||
|
_client:send(Protocol.WEB_Get_Diamond_Mssages, _data, function(res)
|
||||||
|
callback(res)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ local function __Login(cmd, _data, callBack)
|
||||||
user.phone = account.phone
|
user.phone = account.phone
|
||||||
user.address = account.address
|
user.address = account.address
|
||||||
user.games = FilterGame(data.games)
|
user.games = FilterGame(data.games)
|
||||||
|
user.havaPsw = data.havaPassword
|
||||||
if Application.platform == RuntimePlatform.WindowsPlayer or Application.platform == RuntimePlatform.WindowsEditor then
|
if Application.platform == RuntimePlatform.WindowsPlayer or Application.platform == RuntimePlatform.WindowsEditor then
|
||||||
--GameApplication.Instance.printLog = true
|
--GameApplication.Instance.printLog = true
|
||||||
else
|
else
|
||||||
|
|
@ -82,7 +83,7 @@ function M:GetPhoneCode(phone, callback)
|
||||||
local _client = ControllerManager.WebClient
|
local _client = ControllerManager.WebClient
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data["phone"] = phone
|
_data["phone"] = phone
|
||||||
_client:send(Protocol.WEB_GET_VERIFCATION_CODE, _data, function(res)
|
_client:send(Protocol.WEB_GET_Phone_Code, _data, function(res)
|
||||||
if (callback ~= nil) then
|
if (callback ~= nil) then
|
||||||
callback(res)
|
callback(res)
|
||||||
end
|
end
|
||||||
|
|
@ -93,7 +94,7 @@ function M:PhoneLogin(phone, code, callback)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data["phone"] = phone
|
_data["phone"] = phone
|
||||||
_data["code"] = code
|
_data["code"] = code
|
||||||
__Login(Protocol.WEB_PHONE_LOGIN, _data, callback)
|
__Login(Protocol.WEB_LOGIN_Phone, _data, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
--手机密码登录
|
--手机密码登录
|
||||||
|
|
@ -118,6 +119,13 @@ function M:Login(callback)
|
||||||
_data["nick"] = user.nick_name
|
_data["nick"] = user.nick_name
|
||||||
_data["sex"] = user.sex
|
_data["sex"] = user.sex
|
||||||
_data["portrait"] = user.head_url
|
_data["portrait"] = user.head_url
|
||||||
|
local sys_type = 2
|
||||||
|
if GetPlatform() == "Android" then
|
||||||
|
sys_type = 0
|
||||||
|
elseif GetPlatform() == "iOS" then
|
||||||
|
sys_type = 1
|
||||||
|
end
|
||||||
|
_data["sys_type"] = sys_type
|
||||||
__Login(Protocol.WEB_USER_LOGIN, _data, callback)
|
__Login(Protocol.WEB_USER_LOGIN, _data, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ function M:CreateRoom(game_id, _data, callback)
|
||||||
|
|
||||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||||
room.game_id = game_id
|
room.game_id = game_id
|
||||||
|
room.game_info = game_info
|
||||||
room.room_id = room_id
|
room.room_id = room_id
|
||||||
room.server_host = string.concat(server_ip, ":", server_port)
|
room.server_host = string.concat(server_ip, ":", server_port)
|
||||||
room.session = _client:getSession()
|
room.session = _client:getSession()
|
||||||
|
|
@ -201,6 +202,7 @@ function M:PublicJoinRoom(cmd, roomid, tem, callback, group_id, pid)
|
||||||
room.session = _client:getSession()
|
room.session = _client:getSession()
|
||||||
-- 圈子信息,圈子id和玩法id
|
-- 圈子信息,圈子id和玩法id
|
||||||
room.group_id = json["groupId"]
|
room.group_id = json["groupId"]
|
||||||
|
room.game_info = game_info
|
||||||
-- 圈子禁止文字聊天,禁止语音聊天
|
-- 圈子禁止文字聊天,禁止语音聊天
|
||||||
--room.ban_chat1 = json["ban_chat1"]
|
--room.ban_chat1 = json["ban_chat1"]
|
||||||
--room.ban_chat2 = json["ban_chat2"]
|
--room.ban_chat2 = json["ban_chat2"]
|
||||||
|
|
|
||||||
|
|
@ -138,10 +138,12 @@ function M:addPlay(play)
|
||||||
--printlog("添加玩法addPlay===>>>")
|
--printlog("添加玩法addPlay===>>>")
|
||||||
--pt(play)
|
--pt(play)
|
||||||
local maxRound = 0
|
local maxRound = 0
|
||||||
|
local hpdata = json.decode(play.hpData)
|
||||||
if play.maxRound then
|
if play.maxRound then
|
||||||
maxRound = play.maxRound
|
maxRound = play.maxRound
|
||||||
|
hpdata.maxRound = maxRound
|
||||||
|
play.hpData = json.encode(hpdata)
|
||||||
else
|
else
|
||||||
local hpdata = json.decode(play.hpData)
|
|
||||||
maxRound = hpdata.maxRound
|
maxRound = hpdata.maxRound
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,8 @@ local function __update_check(data, onback, _version_view)
|
||||||
if game_data["size"] then
|
if game_data["size"] then
|
||||||
printlog("lingmeng down", download_size, version_update.Progress, game_data["size"])
|
printlog("lingmeng down", download_size, version_update.Progress, game_data["size"])
|
||||||
onback(
|
onback(
|
||||||
download_size + (version_update.Progress > 1 and 1 or version_update.Progress) * game_data["size"], false)
|
download_size + (version_update.Progress > 1 and 1 or version_update.Progress) * game_data["size"],
|
||||||
|
false)
|
||||||
else
|
else
|
||||||
onback(version_update.Progress, false)
|
onback(version_update.Progress, false)
|
||||||
tex_tip.text = version_update.TextTip
|
tex_tip.text = version_update.TextTip
|
||||||
|
|
@ -127,7 +128,7 @@ function ExtendHotupdate.UpdateGame(data, callback)
|
||||||
if callback then callback() end
|
if callback then callback() end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
NetResetConnectWindow.CloseNetReset()
|
NetResetConnectWindow.CloseNetReset()
|
||||||
local _version_view = UIPackage.CreateObjectFromURL("ui://Common/ExtendHotUpdate")
|
local _version_view = UIPackage.CreateObjectFromURL("ui://Common/ExtendHotUpdate")
|
||||||
_version_view:GetChild("tex_info").text = "正在检查资源。。。"
|
_version_view:GetChild("tex_info").text = "正在检查资源。。。"
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,10 @@ end
|
||||||
|
|
||||||
function M:OnChangeOption(ctype)
|
function M:OnChangeOption(ctype)
|
||||||
self:ShowRoomPrice(ctype)
|
self:ShowRoomPrice(ctype)
|
||||||
local round = self._config:GetController("round")
|
-- local round = self._config:GetController("round")
|
||||||
round.onChanged:Set(function()
|
-- round.onChanged:Set(function()
|
||||||
self:ShowVariablePrice(ctype)
|
-- self:ShowVariablePrice(ctype)
|
||||||
end)
|
-- end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ShowVariablePrice(ctype)
|
function M:ShowVariablePrice(ctype)
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,14 @@ Protocol = {
|
||||||
ACC_GET_DIAMONDRECORD = "acc/get_recharge_diamo_list",
|
ACC_GET_DIAMONDRECORD = "acc/get_recharge_diamo_list",
|
||||||
---获取客服信息
|
---获取客服信息
|
||||||
WEB_GET_SERVICEINFO = "acc/get_customer_service",
|
WEB_GET_SERVICEINFO = "acc/get_customer_service",
|
||||||
|
---获取手机验证码
|
||||||
|
WEB_GET_Phone_Code = "acc/get_verification_code",
|
||||||
|
---绑定手机号码
|
||||||
|
WEB_BIND_Phone = "acc/binding_phone",
|
||||||
|
---手机号码登录
|
||||||
|
WEB_LOGIN_Phone = "acc/phone_login",
|
||||||
|
-- 获取自己房卡记录
|
||||||
|
WEB_Get_Diamond_Mssages = "acc/get_messages",
|
||||||
----index----
|
----index----
|
||||||
-- 获取公告
|
-- 获取公告
|
||||||
WEB_UPDATE_NOTICE = "index/get_notice",
|
WEB_UPDATE_NOTICE = "index/get_notice",
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ function FGAssistView.new(blur_view, group_id, callback)
|
||||||
|
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
self:init("ui://FGAssist/panel_assist")
|
self:init("ui://FGAssist/panel_assist")
|
||||||
print("lingmeng FGAssistView new")
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -191,28 +190,27 @@ end
|
||||||
-- end
|
-- end
|
||||||
function M:GetOnlinePlayers(index)
|
function M:GetOnlinePlayers(index)
|
||||||
index = index or 0
|
index = index or 0
|
||||||
print("lingmeng GetOnlinePlayers", self.group_id)
|
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
if not group then
|
-- if not group then
|
||||||
fgCtr:FG_GroupList(function(res)
|
fgCtr:FG_GroupList(function(res)
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败")
|
||||||
else
|
else
|
||||||
fgCtr:FG_EnterGroup(self.group_id, function(res)
|
fgCtr:FG_EnterGroup(self.group_id, function(res)
|
||||||
ViewUtil:CloseModalWait()
|
ViewUtil:CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败")
|
||||||
else
|
else
|
||||||
self:GetOnlinePlayersshow(fgCtr, DataManager.groups:get(self.group_id), index)
|
self:GetOnlinePlayersshow(fgCtr, DataManager.groups:get(self.group_id), index)
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
-- else
|
||||||
self:GetOnlinePlayersshow(fgCtr, group, index)
|
-- self:GetOnlinePlayersshow(fgCtr, group, index)
|
||||||
end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetOnlinePlayersshow(fgCtr, group, index)
|
function M:GetOnlinePlayersshow(fgCtr, group, index)
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ function M:CreatePlay()
|
||||||
-- loddyCtr:CreateRoom(gameId,_data, function (res)
|
-- loddyCtr:CreateRoom(gameId,_data, function (res)
|
||||||
-- self:__OnCreateRoomAction(res)
|
-- self:__OnCreateRoomAction(res)
|
||||||
-- end)
|
-- end)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:initePlayInfo()
|
function M:initePlayInfo()
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,9 @@ function M:InitTime()
|
||||||
return serverDayValues, serverDayItems
|
return serverDayValues, serverDayItems
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ShouRanks()
|
function M:ShouRanks(root, groupId)
|
||||||
|
self._father = root
|
||||||
|
self.group_id = groupId
|
||||||
self._lastTpe = self._father.familyType.selectedIndex
|
self._lastTpe = self._father.familyType.selectedIndex
|
||||||
self._father.familyType.selectedIndex = 0
|
self._father.familyType.selectedIndex = 0
|
||||||
self._view.visible = true
|
self._view.visible = true
|
||||||
|
|
@ -134,6 +136,7 @@ function M:SearchRank()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:RecursionSearchRank(fgCtr, index, begin_time, end_time)
|
function M:RecursionSearchRank(fgCtr, index, begin_time, end_time)
|
||||||
|
ViewUtil:ShowModalWait2()
|
||||||
fgCtr:FG_GetMemberRank(self.group_id, 0, index * 2, 2, begin_time, end_time, nil, function(res)
|
fgCtr:FG_GetMemberRank(self.group_id, 0, index * 2, 2, begin_time, end_time, nil, function(res)
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取排行榜失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取排行榜失败")
|
||||||
|
|
@ -144,6 +147,7 @@ function M:RecursionSearchRank(fgCtr, index, begin_time, end_time)
|
||||||
self:RankTableInsert(info.ranks)
|
self:RankTableInsert(info.ranks)
|
||||||
self:RecursionSearchRank(fgCtr, index + 1, begin_time, end_time)
|
self:RecursionSearchRank(fgCtr, index + 1, begin_time, end_time)
|
||||||
else
|
else
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
table.sort(self.roundRanks, function(a, b)
|
table.sort(self.roundRanks, function(a, b)
|
||||||
return a.round > b.round
|
return a.round > b.round
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ function M:Reflash(group)
|
||||||
numbers = self._group.members
|
numbers = self._group.members
|
||||||
-- print("==========================res.Data.members")
|
-- print("==========================res.Data.members")
|
||||||
pt(self._group.members)
|
pt(self._group.members)
|
||||||
ViewUtil:CloseModalWait()
|
ViewUtil:CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||||
else
|
else
|
||||||
|
|
@ -92,7 +92,9 @@ function M:FillList(numbers)
|
||||||
|
|
||||||
obj.onClick:Set(function()
|
obj.onClick:Set(function()
|
||||||
print("lingmengtextBtn_detail")
|
print("lingmengtextBtn_detail")
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_FindMember(self._group.id, numbers[i].uid, function(res)
|
fgCtr:FG_FindMember(self._group.id, numbers[i].uid, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
local familyNumberDetail = FamilyNumberDetail.new(self._group.id, self._group.lev, res)
|
local familyNumberDetail = FamilyNumberDetail.new(self._group.id, self._group.lev, res)
|
||||||
familyNumberDetail:SetTickCallback(handler(self, self.TickNumberCallback))
|
familyNumberDetail:SetTickCallback(handler(self, self.TickNumberCallback))
|
||||||
familyNumberDetail:SetRefrenCallback(handler(self, self.RefrenMemberCallback))
|
familyNumberDetail:SetRefrenCallback(handler(self, self.RefrenMemberCallback))
|
||||||
|
|
@ -124,7 +126,7 @@ function M:RefrenMemberCallback()
|
||||||
fgCtr:FG_GroupMembers(self._group.id, 0, self._group.total_member_num, false, 1, function(res)
|
fgCtr:FG_GroupMembers(self._group.id, 0, self._group.total_member_num, false, 1, function(res)
|
||||||
numbers = self._group.members
|
numbers = self._group.members
|
||||||
-- print("==========================res.Data.members")
|
-- print("==========================res.Data.members")
|
||||||
ViewUtil:CloseModalWait()
|
ViewUtil:CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ function FamilyAuditNumber.new(root)
|
||||||
self.class = "FamilyAuditNumber"
|
self.class = "FamilyAuditNumber"
|
||||||
self._scale = true
|
self._scale = true
|
||||||
self._animation = false
|
self._animation = false
|
||||||
|
self._close_destroy = true
|
||||||
self:init("ui://Family/com_auditNumber")
|
self:init("ui://Family/com_auditNumber")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
@ -39,7 +40,7 @@ function FamilyAuditNumber:init(url)
|
||||||
self.list_auditNumberList = self._view:GetChild('list_auditNumberList')
|
self.list_auditNumberList = self._view:GetChild('list_auditNumberList')
|
||||||
|
|
||||||
self.btn_close.onClick:Set(function()
|
self.btn_close.onClick:Set(function()
|
||||||
self:Close()
|
self:Destroy()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.list_auditNumberList.itemRenderer = function(index, obj)
|
self.list_auditNumberList.itemRenderer = function(index, obj)
|
||||||
|
|
@ -55,7 +56,9 @@ end
|
||||||
function FamilyAuditNumber:Show(group)
|
function FamilyAuditNumber:Show(group)
|
||||||
self._group = group
|
self._group = group
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GroupJoins(self._group.id, function(res)
|
fgCtr:FG_GroupJoins(self._group.id, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||||
return
|
return
|
||||||
|
|
@ -73,7 +76,9 @@ end
|
||||||
|
|
||||||
function FamilyAuditNumber:ClickBtn(isAllow, uid, tag)
|
function FamilyAuditNumber:ClickBtn(isAllow, uid, tag)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GroupVerifyJoin(self._group.id, uid, isAllow == 1, function(res)
|
fgCtr:FG_GroupVerifyJoin(self._group.id, uid, isAllow == 1, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||||
else
|
else
|
||||||
|
|
@ -83,6 +88,8 @@ function FamilyAuditNumber:ClickBtn(isAllow, uid, tag)
|
||||||
else
|
else
|
||||||
|
|
||||||
end
|
end
|
||||||
|
fgCtr:FG_GroupMembers12(self._group.id, 0, self._group.total_member_num + 1, 2, 2, function(res)
|
||||||
|
end)
|
||||||
local group = DataManager.groups:get(self._group.id)
|
local group = DataManager.groups:get(self._group.id)
|
||||||
group.joins = group.joins - 1
|
group.joins = group.joins - 1
|
||||||
|
|
||||||
|
|
@ -95,6 +102,7 @@ function FamilyAuditNumber:ClickBtn(isAllow, uid, tag)
|
||||||
self:Reflash()
|
self:Reflash()
|
||||||
|
|
||||||
Broadcast.Send(BroadcastEvent.OnJoinsChange)
|
Broadcast.Send(BroadcastEvent.OnJoinsChange)
|
||||||
|
Broadcast.Send(BroadcastEvent.OnMemberChange)
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
local view = BaseView.FindView("FamilyMainView")
|
local view = BaseView.FindView("FamilyMainView")
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,10 @@ local function AddPlayer(data, self)
|
||||||
players[#players + 1] = number.uid
|
players[#players + 1] = number.uid
|
||||||
self.sending = true
|
self.sending = true
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, players, data.deskName, function(res)
|
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, players, data.deskName, function(res)
|
||||||
self.sending = false
|
self.sending = false
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(-1, "设置失败")
|
ViewUtil.ErrorTip(-1, "设置失败")
|
||||||
return
|
return
|
||||||
|
|
@ -111,8 +113,10 @@ local function DelPalyer(data, uid, self)
|
||||||
|
|
||||||
self.sending = true
|
self.sending = true
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, players, data.deskName, function(res)
|
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, players, data.deskName, function(res)
|
||||||
self.sending = false
|
self.sending = false
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(-1, "删除失败")
|
ViewUtil.ErrorTip(-1, "删除失败")
|
||||||
return
|
return
|
||||||
|
|
@ -134,7 +138,9 @@ local function DelDesk(data, self)
|
||||||
|
|
||||||
self.sending = true
|
self.sending = true
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, {}, data.deskName, function()
|
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, {}, data.deskName, function()
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
self.sending = false
|
self.sending = false
|
||||||
self:Reflash()
|
self:Reflash()
|
||||||
end)
|
end)
|
||||||
|
|
@ -142,7 +148,9 @@ end
|
||||||
|
|
||||||
local function ChangeName(deskData, name, self)
|
local function ChangeName(deskData, name, self)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetBanTable1(self.root._group.id, deskData.deskId, AllUid(deskData.deskList), name, function(res)
|
fgCtr:FG_SetBanTable1(self.root._group.id, deskData.deskId, AllUid(deskData.deskList), name, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(-1, "删除失败")
|
ViewUtil.ErrorTip(-1, "删除失败")
|
||||||
return
|
return
|
||||||
|
|
@ -315,7 +323,9 @@ function BanDesk:Reflash()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
local groupId = self.root._group.id
|
local groupId = self.root._group.id
|
||||||
|
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GetBanTable1(groupId, function(res)
|
fgCtr:FG_GetBanTable1(groupId, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
self:GetBanTableCallback(res)
|
self:GetBanTableCallback(res)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -338,7 +348,9 @@ function BanDesk:GetBanTableCallback(res)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
local groupId = self.root._group.id
|
local groupId = self.root._group.id
|
||||||
local banList = {}
|
local banList = {}
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetBanTable1(groupId, -1, banList, "新建关系", function()
|
fgCtr:FG_SetBanTable1(groupId, -1, banList, "新建关系", function()
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
self.sending = false
|
self.sending = false
|
||||||
self:Reflash()
|
self:Reflash()
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ function FamilyChatRoom:Show()
|
||||||
|
|
||||||
mgr_ctr:FG_ENTER_CHATROOM(self.root._group.id, getData, function(res)
|
mgr_ctr:FG_ENTER_CHATROOM(self.root._group.id, getData, function(res)
|
||||||
if res.returnCode == 0 then
|
if res.returnCode == 0 then
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在加载聊天室......")
|
ViewUtil.ShowModalWait2(self._root_view, "正在加载聊天室......")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -167,20 +167,22 @@ end
|
||||||
|
|
||||||
function M:_evtInviteResponse(...)
|
function M:_evtInviteResponse(...)
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
local invite_id = arg[1]
|
local evt_data = arg[1]
|
||||||
local g_name = arg[2]
|
local invite_id = evt_data.invite_id
|
||||||
local roomid = arg[3]
|
local nik = evt_data.nik
|
||||||
local pid = arg[4]
|
local g_name = evt_data.g_name
|
||||||
local groupid = arg[5]
|
local roomid = evt_data.roomid
|
||||||
|
local pid = evt_data.pid
|
||||||
|
local groupid = evt_data.groupId
|
||||||
|
local playInfo = evt_data.pinfo
|
||||||
local roomCtr = ControllerManager.GetController(RoomController)
|
local roomCtr = ControllerManager.GetController(RoomController)
|
||||||
local gameId = DataManager.groups:get(groupid):getPlay(pid).gameId
|
|
||||||
UIPackage.AddPackage('base/newgroup/ui/FGAssist')
|
UIPackage.AddPackage('base/newgroup/ui/FGAssist')
|
||||||
local imv =
|
local imv =
|
||||||
FGInvitedMsgView.new(
|
FGInvitedMsgView.new(
|
||||||
self._root_view,
|
self._root_view,
|
||||||
groupid,
|
groupid,
|
||||||
pid,
|
playInfo,
|
||||||
invite_id,
|
nik,
|
||||||
function()
|
function()
|
||||||
roomCtr:PublicJoinRoom(
|
roomCtr:PublicJoinRoom(
|
||||||
Protocol.WEB_FG_JOIN_ROOM,
|
Protocol.WEB_FG_JOIN_ROOM,
|
||||||
|
|
@ -199,7 +201,8 @@ function M:_evtInviteResponse(...)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
UpdateBeat:Remove(self.OnUpdate, self)
|
UpdateBeat:Remove(self.OnUpdate, self)
|
||||||
ViewManager.ChangeView(ViewManager.View_Main, gameId, { _flag_showTip = true })
|
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id,
|
||||||
|
{ _flag_showTip = true })
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
groupid,
|
groupid,
|
||||||
|
|
@ -224,7 +227,7 @@ function M:_evtChatRoomData(...)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
view.com_FamilyChatRoom:Refalsh()
|
view.com_FamilyChatRoom:Refalsh()
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:_evtOnNewRecord(...)
|
function M:_evtOnNewRecord(...)
|
||||||
|
|
@ -333,6 +336,10 @@ function M:_evtOnFamilyReflash(...)
|
||||||
|
|
||||||
group.joins = joins
|
group.joins = joins
|
||||||
|
|
||||||
|
if not group.joinsData or #group.joinsData < 1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
for _, data in pairs(group.joinsData) do
|
for _, data in pairs(group.joinsData) do
|
||||||
if data.id == uid then
|
if data.id == uid then
|
||||||
table.remove(group.joinsData, _)
|
table.remove(group.joinsData, _)
|
||||||
|
|
@ -377,21 +384,34 @@ function M:_evtOnFamilyMemberOut(...)
|
||||||
local uid = arg.uid
|
local uid = arg.uid
|
||||||
local groupId = arg.groupId
|
local groupId = arg.groupId
|
||||||
local name = arg.name
|
local name = arg.name
|
||||||
|
local reflashType = arg.reflashType
|
||||||
|
|
||||||
local group = DataManager.groups:get(groupId)
|
local group = DataManager.groups:get(groupId)
|
||||||
|
|
||||||
local view = ViewManager.GetCurrenView()
|
local view = ViewManager.GetCurrenView()
|
||||||
if view.class ~= "FamilyMainView" then
|
if view.class ~= "FamilyMainView" or not group then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local tips = ""
|
||||||
|
|
||||||
|
if name == group.name then
|
||||||
|
tips = "【%s(%s)】亲友圈已解散"
|
||||||
|
tips = string.format(tips, group.name, groupId)
|
||||||
|
else
|
||||||
|
tips = "成员 【%s(%s)】退出了【%s(%s)】亲友圈"
|
||||||
|
tips = string.format(tips, DataManager.SelfUser.nick_name, DataManager.SelfUser.account_id, group.name, groupId)
|
||||||
|
end
|
||||||
if uid == DataManager.SelfUser.account_id then
|
if uid == DataManager.SelfUser.account_id then
|
||||||
if view._group.id == groupId then
|
DataManager.groups:del(groupId)
|
||||||
|
if #DataManager.groups.groupList == 0 then
|
||||||
view._close_destroy = true
|
view._close_destroy = true
|
||||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||||
|
else
|
||||||
|
if view._group.id == groupId then
|
||||||
|
view:Reflash()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local tips = "成员 【%s(%s)】退出了【%s(%s)】亲友圈"
|
|
||||||
tips = string.format(tips, name, uid, group.name, groupId)
|
|
||||||
local win = MsgWindow.new(view._view, tips, MsgWindow.MsgMode.OnlyOk)
|
local win = MsgWindow.new(view._view, tips, MsgWindow.MsgMode.OnlyOk)
|
||||||
win:Show()
|
win:Show()
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,13 @@ local FamilyInviteFamilyView = {}
|
||||||
local M = FamilyInviteFamilyView
|
local M = FamilyInviteFamilyView
|
||||||
setmetatable(M, { __index = BaseWindow })
|
setmetatable(M, { __index = BaseWindow })
|
||||||
|
|
||||||
function FamilyInviteFamilyView.new()
|
function FamilyInviteFamilyView.new(curGroup)
|
||||||
local self = setmetatable({}, { __index = M })
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = 'FamilyInviteFamilyView'
|
self.class = 'FamilyInviteFamilyView'
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
|
self._close_zone = false
|
||||||
self._new_hide = false
|
self._new_hide = false
|
||||||
|
self._curGroup = curGroup
|
||||||
self:init('ui://Family/InviteFamily')
|
self:init('ui://Family/InviteFamily')
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
@ -18,11 +20,17 @@ function M:init(url)
|
||||||
BaseWindow.init(self, url)
|
BaseWindow.init(self, url)
|
||||||
|
|
||||||
local view = self._view
|
local view = self._view
|
||||||
|
local tem = self._curGroup
|
||||||
|
local data = {}
|
||||||
|
data.title = string.format('亲友圈【%s】,ID【%s】,期待您的加入!', tem.name, tem.id)
|
||||||
|
data.description = "快来加入趣友麻将吧,妈妈再也不担心我串房间了,和趣友麻将小伙伴们一起玩耍吧"
|
||||||
view:GetChild('btn_wx').onClick:Add(function()
|
view:GetChild('btn_wx').onClick:Add(function()
|
||||||
ViewUtil.ErrorTip(-1, "该功能还会开放,敬请期待")
|
data.type = 0
|
||||||
|
ViewUtil.__share(data)
|
||||||
end)
|
end)
|
||||||
view:GetChild('btn_moments').onClick:Add(function()
|
view:GetChild('btn_moments').onClick:Add(function()
|
||||||
ViewUtil.ErrorTip(-1, "该功能还会开放,敬请期待")
|
data.type = 1
|
||||||
|
ViewUtil.__share(data)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ local FamilyInvitedMsgView = {}
|
||||||
local M = FamilyInvitedMsgView
|
local M = FamilyInvitedMsgView
|
||||||
setmetatable(M, { __index = BaseWindow })
|
setmetatable(M, { __index = BaseWindow })
|
||||||
|
|
||||||
function FamilyInvitedMsgView.new(blur_view, groupid, pid, invite_id, callback)
|
function FamilyInvitedMsgView.new(blur_view, groupid, pinfo, nik, callback)
|
||||||
print("lingmeng FGAssistInviteView")
|
print("lingmeng FGAssistInviteView")
|
||||||
local self = setmetatable({}, { __index = M })
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "FGAssistInviteView"
|
self.class = "FGAssistInviteView"
|
||||||
|
|
@ -14,8 +14,8 @@ function FamilyInvitedMsgView.new(blur_view, groupid, pid, invite_id, callback)
|
||||||
self._put_map = false
|
self._put_map = false
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self.groupid = groupid
|
self.groupid = groupid
|
||||||
self.pid = pid
|
self.pinfo = pinfo
|
||||||
self.invite_id = invite_id
|
self.nik = nik
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
UIPackage.AddPackage('base/newgroup/ui/FGAssist')
|
UIPackage.AddPackage('base/newgroup/ui/FGAssist')
|
||||||
self:initView("ui://FGAssist/panel_invited")
|
self:initView("ui://FGAssist/panel_invited")
|
||||||
|
|
@ -35,45 +35,35 @@ function M:initView(url)
|
||||||
self._viewText_playName.emojies = EmojiDitc.EmojiesDitc
|
self._viewText_playName.emojies = EmojiDitc.EmojiesDitc
|
||||||
|
|
||||||
self._view:GetChild('btn_no').onClick:Set(function()
|
self._view:GetChild('btn_no').onClick:Set(function()
|
||||||
print("lingmeng btn_no")
|
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
print("lingmeng FGAssistInviteView5")
|
|
||||||
|
|
||||||
self._view:GetChild('btn_yes').onClick:Set(function()
|
self._view:GetChild('btn_yes').onClick:Set(function()
|
||||||
print("lingmeng btn_yes", self.callback)
|
|
||||||
|
|
||||||
if self.callback then
|
if self.callback then
|
||||||
self.callback()
|
self.callback()
|
||||||
end
|
end
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
end)
|
end)
|
||||||
print("lingmeng FGAssistInviteViewend")
|
|
||||||
self:FillData()
|
self:FillData()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillData()
|
function M:FillData()
|
||||||
local group = DataManager.groups:get(self.groupid)
|
local group = DataManager.groups:get(self.groupid)
|
||||||
local play = group:getPlay(self.pid)
|
local play = self.pinfo
|
||||||
local player = group.memberMap[self.invite_id]
|
|
||||||
|
|
||||||
if player == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
--print("lingmeng FillData", self.groupid, self.pid, self.invite_id, type(self.invite_id), type(self.groupid),player)
|
--print("lingmeng FillData", self.groupid, self.pid, self.invite_id, type(self.invite_id), type(self.groupid),player)
|
||||||
--pt(group.memberMap)
|
--pt(group.memberMap)
|
||||||
|
|
||||||
self._viewText_groupName.text = Utils.TextOmit(group.name, 6, "...")
|
self._viewText_groupName.text = Utils.TextOmit(group.name, 6, "...")
|
||||||
self._viewText_gameName.text = play.game_name
|
self._viewText_gameName.text = play.game_name
|
||||||
self._viewText_inviteName.text = player.nick
|
self._viewText_inviteName.text = ViewUtil.stringEllipsis(self.nik)
|
||||||
self._viewText_playName.text = Utils.TextOmit(play.name, 6, "...")
|
self._viewText_playName.text = Utils.TextOmit(play.name, 6, "...")
|
||||||
|
|
||||||
local config = ExtendManager.GetExtendConfig(play.gameId)
|
local config = ExtendManager.GetExtendConfig(play.gameId)
|
||||||
local mode = config:GetGameInfo()
|
local mode = config:GetGameInfo()
|
||||||
local gamePlay = mode:LoadConfigToDetail(play.config, play.hpData)
|
local gamePlay = mode:LoadConfigToDetail(play.config, play.hpData)
|
||||||
self._viewText_playConfig.text = play.hp_times / 1000 .. "倍," .. gamePlay
|
self._viewText_playConfig.text = gamePlay
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:Destroy()
|
function M:Destroy()
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,15 @@ local tipsWindow = import("..Common.tipsWindow")
|
||||||
local FamilyJoinAndCreate = {}
|
local FamilyJoinAndCreate = {}
|
||||||
|
|
||||||
local function SendJoinRoom(self, roomId, remark)
|
local function SendJoinRoom(self, roomId, remark)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_JoinGroup(tonumber(roomId), function(res)
|
fgCtr:FG_JoinGroup(tonumber(roomId), function(res)
|
||||||
if res.ReturnCode ~= 0 then
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(res.ReturnCode)
|
if res.ReturnCode ~= 0 then
|
||||||
end
|
ViewUtil.ErrorTip(res.ReturnCode)
|
||||||
end,
|
end
|
||||||
remark)
|
end,
|
||||||
|
remark)
|
||||||
end
|
end
|
||||||
|
|
||||||
function FamilyJoinAndCreate:init(root)
|
function FamilyJoinAndCreate:init(root)
|
||||||
|
|
@ -43,11 +45,15 @@ function FamilyJoinAndCreate:init(root)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self._view:GetChild('btn_c').onClick:Set(function()
|
self._view:GetChild('btn_c').onClick:Set(function()
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GroupList(function(res)
|
fgCtr:FG_GroupList(function(res)
|
||||||
fgCtr:FG_CreateGroup(self.input_name.text, 1, 2, function(res)
|
fgCtr:FG_CreateGroup(self.input_name.text, 1, 2, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
root.familyType.selectedIndex = 1
|
root.familyType.selectedIndex = 1
|
||||||
root:ConnetFamily(1, DataManager.groups.groupList, true)
|
Utils.SaveLocalFile("Family_lastID" .. DataManager.SelfUser.account_id, res.Data.info.id)
|
||||||
|
root:Reflash()
|
||||||
|
-- root:ConnetFamily(1, DataManager.groups.groupList, true)
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, '创建大联盟失败!')
|
ViewUtil.ErrorTip(res.ReturnCode, '创建大联盟失败!')
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ local FamilyMsgDiamond = {}
|
||||||
local M = FamilyMsgDiamond
|
local M = FamilyMsgDiamond
|
||||||
|
|
||||||
--类型字段,1为进入游戏预扣,2为结束游戏返还
|
--类型字段,1为进入游戏预扣,2为结束游戏返还
|
||||||
local TypeTable = { "亲友圈开局游戏预扣", "因游戏结束返还您" }
|
local TypeTable = { "亲友圈开局游戏预扣", "因游戏结束返还您", "您为亲友圈充值" }
|
||||||
|
|
||||||
function M.New(data, callback)
|
function M.New(data, callback)
|
||||||
setmetatable(M, { __index = BaseWindow })
|
setmetatable(M, { __index = BaseWindow })
|
||||||
|
|
@ -25,7 +25,9 @@ function M:Init()
|
||||||
end
|
end
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_Get_Diamond_Msg(self.data.groupId, function(res)
|
fgCtr:FG_Get_Diamond_Msg(self.data.groupId, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取房卡记录失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取房卡记录失败")
|
||||||
else
|
else
|
||||||
|
|
@ -36,10 +38,16 @@ function M:Init()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:msgRenderer(index, obj)
|
function M:msgRenderer(index, obj)
|
||||||
local data = self.msgData
|
local data = self.msgData[index + 1]
|
||||||
obj:GetChild('tex_time').text = os.date("%Y-%m-%d %H:%M:%S", math.floor(data[index + 1].m_time / 1000))
|
local type = data.diamo_type
|
||||||
obj:GetChild('tex_msg').text = string.format("%s%d房卡,剩余%d房卡", TypeTable[data[index + 1].diamo_type + 1],
|
obj:GetChild('tex_time').text = os.date("%Y-%m-%d %H:%M:%S", math.floor(data.m_time / 1000))
|
||||||
data[index + 1].diamo_num, data[index + 1].diamo_cur)
|
if type == 2 and data.user_nick and #data.user_nick > 0 then
|
||||||
|
obj:GetChild('tex_msg').text = string.format("【%s(%s)】用户为亲友圈充值%d房卡,剩余%d房卡", data.user_nick, data.uid,
|
||||||
|
data.diamo_num, data.diamo_cur)
|
||||||
|
else
|
||||||
|
obj:GetChild('tex_msg').text = string.format("%s%d房卡,剩余%d房卡", TypeTable[data.diamo_type + 1],
|
||||||
|
data.diamo_num, data.diamo_cur)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:Show(groupId)
|
function M:Show(groupId)
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@ local FamilyMsgRecord = {}
|
||||||
-- m_state : 进入亲友圈(0)退出亲友圈(1),创建亲友圈(2),踢出亲友圈(3)
|
-- m_state : 进入亲友圈(0)退出亲友圈(1),创建亲友圈(2),踢出亲友圈(3)
|
||||||
local function RequestData(self, groupId)
|
local function RequestData(self, groupId)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_Get_Msg(groupId, function(res)
|
fgCtr:FG_Get_Msg(groupId, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode)
|
ViewUtil.ErrorTip(res.ReturnCode)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,10 @@ local root = {}
|
||||||
|
|
||||||
local function ChangeFamilyConfig(data, self)
|
local function ChangeFamilyConfig(data, self)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_UpdateGroupInfo(data,
|
fgCtr:FG_UpdateGroupInfo(data,
|
||||||
function(res)
|
function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "更改失败,请稍后再试")
|
ViewUtil.ErrorTip(res.ReturnCode, "更改失败,请稍后再试")
|
||||||
else
|
else
|
||||||
|
|
@ -40,6 +42,7 @@ end
|
||||||
local function QuitFamily(self)
|
local function QuitFamily(self)
|
||||||
local uid = DataManager.SelfUser.account_id
|
local uid = DataManager.SelfUser.account_id
|
||||||
local group = DataManager.groups:get(self.groupId)
|
local group = DataManager.groups:get(self.groupId)
|
||||||
|
local groupName = group.name
|
||||||
local player = group.memberMap[uid]
|
local player = group.memberMap[uid]
|
||||||
|
|
||||||
local tips = "确定退出该亲友圈?"
|
local tips = "确定退出该亲友圈?"
|
||||||
|
|
@ -58,12 +61,28 @@ local function QuitFamily(self)
|
||||||
self.networkSending = true
|
self.networkSending = true
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
print("发送了退出协议 familyid = ", self.family.id)
|
print("发送了退出协议 familyid = ", self.family.id)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_ExitGroup(self.family.id, function(res)
|
fgCtr:FG_ExitGroup(self.family.id, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.networkSending = false
|
self.networkSending = false
|
||||||
Broadcast.Send(BroadcastEvent.OnOutFamily)
|
-- if #DataManager.groups.groupList == 0 then
|
||||||
|
-- local view = ViewManager.GetCurrenView()
|
||||||
|
-- if view.class == "FamilyMainView" then
|
||||||
|
-- view._close_destroy = true
|
||||||
|
-- end
|
||||||
|
-- ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||||
|
-- else
|
||||||
|
if group.lev == 1 then
|
||||||
|
local win = MsgWindow.new(self._view,
|
||||||
|
string.format("群主【%s】解散了【%s】亲友圈", DataManager.SelfUser.nick_name, groupName),
|
||||||
|
MsgWindow.MsgMode.OnlyOk)
|
||||||
|
win:Show()
|
||||||
|
end
|
||||||
|
Broadcast.Send(BroadcastEvent.OnOutFamily2)
|
||||||
|
-- end
|
||||||
self:Close()
|
self:Close()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
@ -120,11 +139,11 @@ function FamilyMyFamily:Show(groupId)
|
||||||
Broadcast.AddListener(BroadcastEvent.OnJoinsChange, self.ReflashJoinsRedPoint, self)
|
Broadcast.AddListener(BroadcastEvent.OnJoinsChange, self.ReflashJoinsRedPoint, self)
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在加载亲友圈数据......")
|
ViewUtil.ShowModalWait2(self._root_view, "正在加载亲友圈数据......")
|
||||||
fgCtr:WEB_FG_GET_GROUP_DETAIL(self.groupId, function(res)
|
fgCtr:WEB_FG_GET_GROUP_DETAIL(self.groupId, function(res)
|
||||||
print("收到家族的详细信息")
|
print("收到家族的详细信息")
|
||||||
pt(res)
|
pt(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode)
|
ViewUtil.ErrorTip(res.ReturnCode)
|
||||||
end
|
end
|
||||||
|
|
@ -333,9 +352,11 @@ function FamilyMyFamily:Init()
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
self.networkSending = true
|
self.networkSending = true
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetGroupShow(0, self.family.id, function(res)
|
fgCtr:FG_SetGroupShow(0, self.family.id, function(res)
|
||||||
print("收到协议M:FG_SetGroupShow")
|
print("收到协议M:FG_SetGroupShow")
|
||||||
pt(res)
|
pt(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
self.networkSending = false
|
self.networkSending = false
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode)
|
ViewUtil.ErrorTip(res.ReturnCode)
|
||||||
|
|
@ -357,9 +378,11 @@ function FamilyMyFamily:Init()
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
self.networkSending = true
|
self.networkSending = true
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetGroupShow(1, self.family.id, function(res)
|
fgCtr:FG_SetGroupShow(1, self.family.id, function(res)
|
||||||
print("收到协议M:FG_SetGroupShow")
|
print("收到协议M:FG_SetGroupShow")
|
||||||
pt(res)
|
pt(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
self.networkSending = false
|
self.networkSending = false
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode)
|
ViewUtil.ErrorTip(res.ReturnCode)
|
||||||
|
|
@ -380,7 +403,9 @@ function FamilyMyFamily:Init()
|
||||||
self.networkSending = true
|
self.networkSending = true
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
print("发送了退出协议 familyid = ", self.family.id)
|
print("发送了退出协议 familyid = ", self.family.id)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_ExitGroup(self.family.id, function(res)
|
fgCtr:FG_ExitGroup(self.family.id, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ end
|
||||||
|
|
||||||
function FamilyMyfamilyList:Show()
|
function FamilyMyfamilyList:Show()
|
||||||
Broadcast.AddListener(BroadcastEvent.OnJoinsChange, RefalshJoinsRedPoint, self)
|
Broadcast.AddListener(BroadcastEvent.OnJoinsChange, RefalshJoinsRedPoint, self)
|
||||||
Broadcast.AddListener(BroadcastEvent.OnOutFamily, self.Refalsh, self)
|
Broadcast.AddListener(BroadcastEvent.OnOutFamily2, self.Refalsh, self)
|
||||||
|
|
||||||
HideMainView(self)
|
HideMainView(self)
|
||||||
self:Refalsh()
|
self:Refalsh()
|
||||||
|
|
@ -77,7 +77,7 @@ end
|
||||||
|
|
||||||
function FamilyMyfamilyList:Close()
|
function FamilyMyfamilyList:Close()
|
||||||
Broadcast.RemoveListener(BroadcastEvent.OnJoinsChange, RefalshJoinsRedPoint)
|
Broadcast.RemoveListener(BroadcastEvent.OnJoinsChange, RefalshJoinsRedPoint)
|
||||||
Broadcast.RemoveListener(BroadcastEvent.OnOutFamily, self.Refalsh)
|
Broadcast.RemoveListener(BroadcastEvent.OnOutFamily2, self.Refalsh)
|
||||||
|
|
||||||
ShowMainView(self)
|
ShowMainView(self)
|
||||||
BaseView.Close(self)
|
BaseView.Close(self)
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,9 @@ function M:init(url, lev, res)
|
||||||
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetJoinScore(self.groupId, info.uid, tonumber(text) or 0, MJScore, function(res)
|
fgCtr:FG_SetJoinScore(self.groupId, info.uid, tonumber(text) or 0, MJScore, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
||||||
else
|
else
|
||||||
|
|
@ -87,7 +89,9 @@ function M:init(url, lev, res)
|
||||||
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetJoinScore(self.groupId, info.uid, MJScore, tonumber(text) or 0, function(res)
|
fgCtr:FG_SetJoinScore(self.groupId, info.uid, MJScore, tonumber(text) or 0, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
||||||
else
|
else
|
||||||
|
|
@ -116,7 +120,9 @@ function M:init(url, lev, res)
|
||||||
MsgWindow.new(self._root_view, string.format("是否禁止用户(%s)进入房间", info.nick), MsgWindow.MsgMode.OkAndCancel)
|
MsgWindow.new(self._root_view, string.format("是否禁止用户(%s)进入房间", info.nick), MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(
|
_curren_msg.onOk:Add(
|
||||||
function()
|
function()
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_BanMember(self.groupId, info.uid, 1 - flag_band, 1, function()
|
fgCtr:FG_BanMember(self.groupId, info.uid, 1 - flag_band, 1, function()
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
flag_band = 1 - flag_band
|
flag_band = 1 - flag_band
|
||||||
self._view:GetChild('btn_band'):GetController('band').selectedIndex = flag_band
|
self._view:GetChild('btn_band'):GetController('band').selectedIndex = flag_band
|
||||||
|
|
@ -143,7 +149,9 @@ function M:init(url, lev, res)
|
||||||
flag_assistant == 1 and "助理身份" or "设置为助理"), MsgWindow.MsgMode.OkAndCancel)
|
flag_assistant == 1 and "助理身份" or "设置为助理"), MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(
|
_curren_msg.onOk:Add(
|
||||||
function()
|
function()
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetManager(self.groupId, info.uid, flag_assistant + 1, function(res)
|
fgCtr:FG_SetManager(self.groupId, info.uid, flag_assistant + 1, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
local g = DataManager.groups.groupMap[self.groupId]
|
local g = DataManager.groups.groupMap[self.groupId]
|
||||||
local player = g.memberMap[info.uid]
|
local player = g.memberMap[info.uid]
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,9 @@ function FamilyNumberRecord.New(root, page)
|
||||||
self._data_leftTime = os.time(timeTable) - index * 86400
|
self._data_leftTime = os.time(timeTable) - index * 86400
|
||||||
self._data_rightTime = os.time(timeTable) - index * 86400 + 86399
|
self._data_rightTime = os.time(timeTable) - index * 86400 + 86399
|
||||||
self:OnClickSortType()
|
self:OnClickSortType()
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GetConsumeStat(group_id, self._data_leftTime, self._data_rightTime, function(res)
|
fgCtr:FG_GetConsumeStat(group_id, self._data_leftTime, self._data_rightTime, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取总信息失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取总信息失败")
|
||||||
else
|
else
|
||||||
|
|
@ -135,7 +137,9 @@ function FamilyNumberRecord.New(root, page)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
--写限制分数
|
--写限制分数
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetGroupRecordUpdateDayType(group_id, ctr_limitDay.selectedIndex + 1, function(res)
|
fgCtr:FG_SetGroupRecordUpdateDayType(group_id, ctr_limitDay.selectedIndex + 1, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "分数限制分设置失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "分数限制分设置失败")
|
||||||
self.ctr_limitDay_isReverting = true
|
self.ctr_limitDay_isReverting = true
|
||||||
|
|
@ -206,7 +210,9 @@ function FamilyNumberRecord.New(root, page)
|
||||||
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetJoinScore(group_id, 0, tonumber(text) or 0, self.MJScore, function(res)
|
fgCtr:FG_SetJoinScore(group_id, 0, tonumber(text) or 0, self.MJScore, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
||||||
else
|
else
|
||||||
|
|
@ -236,7 +242,9 @@ function FamilyNumberRecord.New(root, page)
|
||||||
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetJoinScore(group_id, 0, self.MJScore, tonumber(text) or 0, function(res)
|
fgCtr:FG_SetJoinScore(group_id, 0, self.MJScore, tonumber(text) or 0, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
||||||
else
|
else
|
||||||
|
|
@ -267,8 +275,10 @@ function FamilyNumberRecord.New(root, page)
|
||||||
local _curren_msg = MsgWindow.new(self._root_view, newReadType == 1 and "确定要将选中的对局设置为未读" or "确定要将选中的对局设置为已读",
|
local _curren_msg = MsgWindow.new(self._root_view, newReadType == 1 and "确定要将选中的对局设置为未读" or "确定要将选中的对局设置为已读",
|
||||||
MsgWindow.MsgMode.OkAndCancel)
|
MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(function()
|
_curren_msg.onOk:Add(function()
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetGroupRecordReadStatus(group_id, GetPlatform(), self.military.list, newReadType - 1, self._tagId,
|
fgCtr:FG_SetGroupRecordReadStatus(group_id, GetPlatform(), self.military.list, newReadType - 1, self._tagId,
|
||||||
function(res)
|
function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
pt(res)
|
pt(res)
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "修改战绩阅读状态失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "修改战绩阅读状态失败")
|
||||||
|
|
@ -322,8 +332,9 @@ function FamilyNumberRecord.New(root, page)
|
||||||
btn_reflash.grayed = false
|
btn_reflash.grayed = false
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GetConsumeStat(group_id, self._data_leftTime, self._data_rightTime, function(res)
|
fgCtr:FG_GetConsumeStat(group_id, self._data_leftTime, self._data_rightTime, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取总信息失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取总信息失败")
|
||||||
else
|
else
|
||||||
|
|
@ -518,7 +529,8 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
||||||
local btn_play = obj:GetChild("n10")
|
local btn_play = obj:GetChild("n10")
|
||||||
btn_play.onClick:Set(function()
|
btn_play.onClick:Set(function()
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if DataManager.SelfUser.playback[allDate.military_id] ~= nil and DataManager.SelfUser.playback[allDate.military_id][round] ~= nil then
|
ViewUtil.ShowModalWait2(self._view)
|
||||||
|
if DataManager.SelfUser.playback[allDate.military_id] ~= nil and DataManager.SelfUser.playback[allDate.military_id][round] ~= nil and tonumber(DataManager.SelfUser.playback[allDate.military_id][round].info.round) == round then
|
||||||
local room = ExtendManager.GetExtendConfig(allDate.game_info.game_id):NewRoom()
|
local room = ExtendManager.GetExtendConfig(allDate.game_info.game_id):NewRoom()
|
||||||
DataManager.CurrenRoom = room
|
DataManager.CurrenRoom = room
|
||||||
room.lev = group.lev
|
room.lev = group.lev
|
||||||
|
|
@ -531,16 +543,15 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
||||||
local main = self:GenaratePlayBack(ViewManager.View_PlayBack, allDate.game_info.game_id)
|
local main = self:GenaratePlayBack(ViewManager.View_PlayBack, allDate.game_info.game_id)
|
||||||
main._currentId = allDate.military_id
|
main._currentId = allDate.military_id
|
||||||
main._currentRound = round
|
main._currentRound = round
|
||||||
main._totalRound = tonumber(rdata.round)
|
main._totalRound = tonumber(allDate.round)
|
||||||
main:FillRoomData(DataManager.SelfUser.playback[allDate.military_id][round])
|
main:FillRoomData(DataManager.SelfUser.playback[allDate.military_id][round])
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
else
|
else
|
||||||
ViewUtil.ShowModalWait(self._view)
|
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data["military_id"] = allDate.military_id
|
_data["military_id"] = allDate.military_id
|
||||||
_data["round"] = tostring(round)
|
_data["round"] = tostring(round)
|
||||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||||
ViewUtil.CloseModalWait()
|
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
if DataManager.SelfUser.playback[allDate.military_id] ~= nil then
|
if DataManager.SelfUser.playback[allDate.military_id] ~= nil then
|
||||||
DataManager.SelfUser.playback[allDate.military_id][round] = data
|
DataManager.SelfUser.playback[allDate.military_id][round] = data
|
||||||
|
|
@ -556,9 +567,10 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
||||||
main._totalRound = tonumber(allDate.round)
|
main._totalRound = tonumber(allDate.round)
|
||||||
main:FillRoomData(data)
|
main:FillRoomData(data)
|
||||||
main._room.lev = group.lev
|
main._room.lev = group.lev
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
elseif code == 25 then
|
elseif code == 25 then
|
||||||
ViewUtil.ErrorTip(-1, "回放未找到!")
|
ViewUtil.ErrorTip(-1, "回放未找到!")
|
||||||
-- btn_play_back.grayed = true
|
ViewUtil.CloseModalWait2()
|
||||||
end
|
end
|
||||||
end, allDate.game_info)
|
end, allDate.game_info)
|
||||||
end
|
end
|
||||||
|
|
@ -604,9 +616,11 @@ function M:OnClickSortType()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:RecursionGetNumberRank(fgCtr, index, round, win, cost)
|
function M:RecursionGetNumberRank(fgCtr, index, round, win, cost)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GetMemberRank_2(self.group_id, 0, index * 67, 67, self._data_leftTime, self._data_rightTime,
|
fgCtr:FG_GetMemberRank_2(self.group_id, 0, index * 67, 67, self._data_leftTime, self._data_rightTime,
|
||||||
self._data_seletedType, self._data_sortType,
|
self._data_seletedType, self._data_sortType,
|
||||||
function(res)
|
function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取排行榜失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取排行榜失败")
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,10 @@ function M:ShowNumberRecord()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:RecursionRecord(fgCtr, index, uid, leftTime, rightTime)
|
function M:RecursionRecord(fgCtr, index, uid, leftTime, rightTime)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GetGroupRecordSpe2(self.group_id, GetPlatform(), uid, 0, index * 60, 60, leftTime, rightTime, 0,
|
fgCtr:FG_GetGroupRecordSpe2(self.group_id, GetPlatform(), uid, 0, index * 60, 60, leftTime, rightTime, 0,
|
||||||
function(res)
|
function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "查看个人战绩失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "查看个人战绩失败")
|
||||||
self.visible = false
|
self.visible = false
|
||||||
|
|
@ -208,7 +210,8 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
||||||
local btn_play = obj:GetChild("n10")
|
local btn_play = obj:GetChild("n10")
|
||||||
btn_play.onClick:Set(function()
|
btn_play.onClick:Set(function()
|
||||||
local group = self.currenGroup
|
local group = self.currenGroup
|
||||||
if DataManager.SelfUser.playback[allDate.military_id] ~= nil and DataManager.SelfUser.playback[allDate.military_id][round] ~= nil then
|
ViewUtil.ShowModalWait2(self._view)
|
||||||
|
if DataManager.SelfUser.playback[allDate.military_id] ~= nil and DataManager.SelfUser.playback[allDate.military_id][round] ~= nil and tonumber(DataManager.SelfUser.playback[allDate.military_id][round].info.round) == round then
|
||||||
local room = ExtendManager.GetExtendConfig(allDate.game_info.game_id):NewRoom()
|
local room = ExtendManager.GetExtendConfig(allDate.game_info.game_id):NewRoom()
|
||||||
DataManager.CurrenRoom = room
|
DataManager.CurrenRoom = room
|
||||||
room.lev = group.lev
|
room.lev = group.lev
|
||||||
|
|
@ -221,16 +224,15 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
||||||
local main = self:GenaratePlayBack(ViewManager.View_PlayBack, allDate.game_info.game_id)
|
local main = self:GenaratePlayBack(ViewManager.View_PlayBack, allDate.game_info.game_id)
|
||||||
main._currentId = allDate.military_id
|
main._currentId = allDate.military_id
|
||||||
main._currentRound = round
|
main._currentRound = round
|
||||||
main._totalRound = tonumber(rdata.round)
|
main._totalRound = tonumber(allDate.round)
|
||||||
main:FillRoomData(DataManager.SelfUser.playback[allDate.military_id][round])
|
main:FillRoomData(DataManager.SelfUser.playback[allDate.military_id][round])
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
else
|
else
|
||||||
ViewUtil.ShowModalWait(self._view)
|
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data["military_id"] = allDate.military_id
|
_data["military_id"] = allDate.military_id
|
||||||
_data["round"] = tostring(round)
|
_data["round"] = tostring(round)
|
||||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||||
ViewUtil.CloseModalWait()
|
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
if DataManager.SelfUser.playback[allDate.military_id] ~= nil then
|
if DataManager.SelfUser.playback[allDate.military_id] ~= nil then
|
||||||
DataManager.SelfUser.playback[allDate.military_id][round] = data
|
DataManager.SelfUser.playback[allDate.military_id][round] = data
|
||||||
|
|
@ -246,9 +248,10 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
||||||
main._totalRound = tonumber(allDate.round)
|
main._totalRound = tonumber(allDate.round)
|
||||||
main:FillRoomData(data)
|
main:FillRoomData(data)
|
||||||
main._room.lev = group.lev
|
main._room.lev = group.lev
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
elseif code == 25 then
|
elseif code == 25 then
|
||||||
ViewUtil.ErrorTip(-1, "回放未找到!")
|
ViewUtil.ErrorTip(-1, "回放未找到!")
|
||||||
-- btn_play_back.grayed = true
|
ViewUtil.CloseModalWait2()
|
||||||
end
|
end
|
||||||
end, allDate.game_info)
|
end, allDate.game_info)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ local function charge(num, self)
|
||||||
_curren_msg.onOk:Add(
|
_curren_msg.onOk:Add(
|
||||||
function()
|
function()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_Recharge_Diamo(self.groupId, num, function(res)
|
fgCtr:FG_Recharge_Diamo(self.groupId, num, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "重置房卡操作失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "重置房卡操作失败")
|
||||||
return
|
return
|
||||||
|
|
@ -67,16 +69,16 @@ function FamilyRoomCard.New()
|
||||||
obj:GetController("cColor").selectedIndex = data[_idx].colorIndex
|
obj:GetController("cColor").selectedIndex = data[_idx].colorIndex
|
||||||
|
|
||||||
obj.onClick:Set(function()
|
obj.onClick:Set(function()
|
||||||
if Instance.group and Instance.group.lev ~= 1 then
|
-- if Instance.group and Instance.group.lev ~= 1 then
|
||||||
local _curren_msg =
|
-- local _curren_msg =
|
||||||
MsgWindow.new(
|
-- MsgWindow.new(
|
||||||
Instance._root_view,
|
-- Instance._root_view,
|
||||||
"只有管理员可以充值",
|
-- "只有管理员可以充值",
|
||||||
MsgWindow.MsgMode.OnlyOk
|
-- MsgWindow.MsgMode.OnlyOk
|
||||||
)
|
-- )
|
||||||
_curren_msg:Show()
|
-- _curren_msg:Show()
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
if DataManager.SelfUser.diamo < num then
|
if DataManager.SelfUser.diamo < num then
|
||||||
local _curren_msg =
|
local _curren_msg =
|
||||||
MsgWindow.new(
|
MsgWindow.new(
|
||||||
|
|
|
||||||
|
|
@ -76,12 +76,14 @@ function PlayEditView:Init()
|
||||||
obj:GetChild('Label_details'):GetChild('title').text = mode:LoadConfigToDetail(playList[index].config,
|
obj:GetChild('Label_details'):GetChild('title').text = mode:LoadConfigToDetail(playList[index].config,
|
||||||
playList[index].hpData)
|
playList[index].hpData)
|
||||||
obj:GetChild('text_playName').emojies = EmojiDitc.EmojiesDitc
|
obj:GetChild('text_playName').emojies = EmojiDitc.EmojiesDitc
|
||||||
obj:GetChild('text_playName').text = Utils.TextOmit(playList[index].name, 6, "...")
|
obj:GetChild('text_playName').text = playList[index].name
|
||||||
obj:GetController('type').selectedIndex = 1
|
obj:GetController('type').selectedIndex = 1
|
||||||
obj:GetChild('btn_del').onClick:Set(function()
|
obj:GetChild('btn_del').onClick:Set(function()
|
||||||
ViewUtil.ShowTwoChooose("是否要删除该玩法", function()
|
ViewUtil.ShowTwoChooose("是否要删除该玩法", function()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_DelPlay(self.groupId, playList[index].id, function(res)
|
fgCtr:FG_DelPlay(self.groupId, playList[index].id, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "删除玩法操作失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "删除玩法操作失败")
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,7 @@ function FamilyView.new()
|
||||||
local self = setmetatable({}, { __index = M })
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = 'FamilyMainView'
|
self.class = 'FamilyMainView'
|
||||||
self._full = true
|
self._full = true
|
||||||
|
self._full_offset = false
|
||||||
-- self._close_destroy = false
|
-- self._close_destroy = false
|
||||||
self._fristRoom = true
|
self._fristRoom = true
|
||||||
self:init('ui://Family/Main')
|
self:init('ui://Family/Main')
|
||||||
|
|
@ -133,7 +134,6 @@ end
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseView.InitView(self, url)
|
BaseView.InitView(self, url)
|
||||||
-- self._close_destroy = false
|
-- self._close_destroy = false
|
||||||
self._full_offset = false
|
|
||||||
local view = self._view
|
local view = self._view
|
||||||
self.lastTime = os.time()
|
self.lastTime = os.time()
|
||||||
|
|
||||||
|
|
@ -161,7 +161,7 @@ function M:init(url)
|
||||||
self.cChatRoomRedPoint = self.btn_chatRoom:GetController("cRedPoint")
|
self.cChatRoomRedPoint = self.btn_chatRoom:GetController("cRedPoint")
|
||||||
|
|
||||||
self:InitCloseClick()
|
self:InitCloseClick()
|
||||||
|
self._view:GetController('listFamily').selectedIndex = -1
|
||||||
--[[
|
--[[
|
||||||
fgCtr:FG_GroupList(function(res)
|
fgCtr:FG_GroupList(function(res)
|
||||||
print("获取所有圈信息")
|
print("获取所有圈信息")
|
||||||
|
|
@ -229,17 +229,20 @@ function M:init(url)
|
||||||
local group = DataManager.groups.groupList[j]
|
local group = DataManager.groups.groupList[j]
|
||||||
obj:GetChild("title").emojies = EmojiDitc.EmojiesDitc
|
obj:GetChild("title").emojies = EmojiDitc.EmojiesDitc
|
||||||
obj.text = Utils.TextOmit(group.name, 6, "...")
|
obj.text = Utils.TextOmit(group.name, 6, "...")
|
||||||
obj.onClick:Add(function()
|
obj.onClick:Set(function()
|
||||||
if self._group ~= nil and group.id == self._group.id then
|
if self._group ~= nil and group.id == self._group.id then
|
||||||
--ViewUtil.ErrorTip(-1,"已在家族中")
|
--ViewUtil.ErrorTip(-1,"已在家族中")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
self._view:GetController('listFamily').selectedIndex = i
|
||||||
self:RefNotice(group.id)
|
self:RefNotice(group.id)
|
||||||
self.curGroupIndex = j
|
self.curGroupIndex = j
|
||||||
self:ConnetFamily(j, DataManager.groups.groupList)
|
self:ConnetFamily(j, DataManager.groups.groupList)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.familyType.selectedIndex = 1
|
self.familyType.selectedIndex = 1
|
||||||
|
|
||||||
self._view:GetChild('btn_showALlStartRoom').onClick:Set(function()
|
self._view:GetChild('btn_showALlStartRoom').onClick:Set(function()
|
||||||
|
|
@ -268,6 +271,13 @@ function M:init(url)
|
||||||
self._data_falshRoomTime = 20
|
self._data_falshRoomTime = 20
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local btn_inviteFriends = self._view:GetChild('btn_inviteFriends')
|
||||||
|
if btn_inviteFriends then
|
||||||
|
btn_inviteFriends.onClick:Set(function()
|
||||||
|
self:ShareWx()
|
||||||
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:Reflash()
|
function M:Reflash()
|
||||||
|
|
@ -296,6 +306,7 @@ function M:Reflash()
|
||||||
end
|
end
|
||||||
local btn = self.list_family:GetChildAt(chooseIndex - 1)
|
local btn = self.list_family:GetChildAt(chooseIndex - 1)
|
||||||
btn.onClick:Call()
|
btn.onClick:Call()
|
||||||
|
self._view:GetController('listFamily').selectedIndex = chooseIndex - 1
|
||||||
else
|
else
|
||||||
self:JoinFamily(true)
|
self:JoinFamily(true)
|
||||||
self.btn_chatRoom.visible = false
|
self.btn_chatRoom.visible = false
|
||||||
|
|
@ -324,7 +335,7 @@ function M:InitCloseClick()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ShareWx()
|
function M:ShareWx()
|
||||||
local familyInviteFamilyView = FamilyInviteFamilyView.new()
|
local familyInviteFamilyView = FamilyInviteFamilyView.new(self._group)
|
||||||
familyInviteFamilyView:Show()
|
familyInviteFamilyView:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -462,7 +473,7 @@ function M:ShowAllRank()
|
||||||
self._ViewChild_AllRank = FamilAllRank.New(self, self._group.id)
|
self._ViewChild_AllRank = FamilAllRank.New(self, self._group.id)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self._ViewChild_AllRank:ShouRanks()
|
self._ViewChild_AllRank:ShouRanks(self, self._group.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OpenAllNumber(group)
|
function M:OpenAllNumber(group)
|
||||||
|
|
@ -529,7 +540,7 @@ function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type)
|
||||||
self.members = SortMembers(self._group.members) --local members = self._group.members
|
self.members = SortMembers(self._group.members) --local members = self._group.members
|
||||||
print("FG_GroupMembers12")
|
print("FG_GroupMembers12")
|
||||||
pt(self._group.members)
|
pt(self._group.members)
|
||||||
--ViewUtil:CloseModalWait()
|
--ViewUtil:CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||||
else
|
else
|
||||||
|
|
@ -566,7 +577,6 @@ end
|
||||||
|
|
||||||
function M:EnterGroup(fgCtr, id)
|
function M:EnterGroup(fgCtr, id)
|
||||||
fgCtr:FG_EnterGroup(id, function(res)
|
fgCtr:FG_EnterGroup(id, function(res)
|
||||||
ViewUtil:CloseModalWait()
|
|
||||||
ViewUtil:CloseModalWait2()
|
ViewUtil:CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
if res.ReturnCode == 101 then
|
if res.ReturnCode == 101 then
|
||||||
|
|
@ -594,10 +604,7 @@ function M:OnEnterGroupCallBack()
|
||||||
|
|
||||||
self:UpdateFamilyRoom(fgCtr, self._group.id)
|
self:UpdateFamilyRoom(fgCtr, self._group.id)
|
||||||
|
|
||||||
--ViewUtil.ShowModalWait(self._root_view, "正在加载亲友圈权限中......")
|
ViewUtil.CloseModalWait2()
|
||||||
--self:ChangeOther()
|
|
||||||
|
|
||||||
ViewUtil.CloseModalWait()
|
|
||||||
|
|
||||||
self:ReflashChatRoomRedPoint()
|
self:ReflashChatRoomRedPoint()
|
||||||
|
|
||||||
|
|
@ -641,7 +648,7 @@ function M:UpdateFamilyRoom(fgCtr, id)
|
||||||
show_num = #playList + #readyRoom
|
show_num = #playList + #readyRoom
|
||||||
self._view:GetChild('n364').text = string.format("已开启***桌游戏")
|
self._view:GetChild('n364').text = string.format("已开启***桌游戏")
|
||||||
end
|
end
|
||||||
self._view:GetChild('btn_showALlStartRoom'):GetController('isOpen').selectedIndex = self._group.isOpenStartRoom
|
self._view:GetChild('btn_showALlStartRoom'):GetController('isOpen').selectedIndex = self._group.isOpenStartRoom or 0
|
||||||
list_room.itemRenderer = function(index, obj)
|
list_room.itemRenderer = function(index, obj)
|
||||||
if index < #readyRoom then
|
if index < #readyRoom then
|
||||||
local newIndex = index + 1
|
local newIndex = index + 1
|
||||||
|
|
@ -794,7 +801,7 @@ function M:FillSameRoomInfo(obj, type, playInfo)
|
||||||
obj:GetChild('Label_gameRule').title = gamePlay
|
obj:GetChild('Label_gameRule').title = gamePlay
|
||||||
|
|
||||||
local roomName = playInfo.name
|
local roomName = playInfo.name
|
||||||
roomName = Utils.TextOmit(roomName, 6, "")
|
roomName = roomName
|
||||||
obj:GetChild('game_type').emojies = EmojiDitc.EmojiesDitc
|
obj:GetChild('game_type').emojies = EmojiDitc.EmojiesDitc
|
||||||
obj:GetChild('game_type').text = string.format(" (%s) %s", playInfo.game_name, roomName)
|
obj:GetChild('game_type').text = string.format(" (%s) %s", playInfo.game_name, roomName)
|
||||||
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = type
|
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = type
|
||||||
|
|
@ -843,7 +850,7 @@ function M:JieSanRomm(groupId, roomId)
|
||||||
)
|
)
|
||||||
_curren_msg.onOk:Add(
|
_curren_msg.onOk:Add(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
|
||||||
fgCtr:FG_RemoveRoom(
|
fgCtr:FG_RemoveRoom(
|
||||||
|
|
@ -853,7 +860,7 @@ function M:JieSanRomm(groupId, roomId)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!')
|
ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!')
|
||||||
return
|
return
|
||||||
|
|
@ -871,42 +878,26 @@ function M:ReflashFamilyList()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ConnetFamily(index, groups)
|
function M:ConnetFamily(index, groups)
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在加载成员列表中......")
|
ViewUtil.ShowModalWait2(self._root_view, "正在加载成员列表中......")
|
||||||
|
|
||||||
if self._group then
|
if self._group then
|
||||||
FamilyOffline(self._group.id, self)
|
FamilyOffline(self._group.id, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
UpdateBeat:Remove(self.OnUpdate, self)
|
UpdateBeat:Remove(self.OnUpdate, self)
|
||||||
ViewUtil:CloseModalWait()
|
ViewUtil:CloseModalWait2()
|
||||||
self._group = DataManager.groups:get(groups[index].id)
|
self._group = DataManager.groups:get(groups[index].id)
|
||||||
DataManager.CurrenGroup = self._group
|
DataManager.CurrenGroup = self._group
|
||||||
self._view:GetChild('text_familyId').text = self._group.id
|
self._view:GetChild('text_familyId').text = self._group.id
|
||||||
self._view:GetController('lev').selectedIndex = self._group.lev - 1
|
self._view:GetController('lev').selectedIndex = self._group.lev - 1
|
||||||
print("===================================self._group")
|
|
||||||
pt(self._group)
|
|
||||||
self._roomNum = self._group.room_num
|
self._roomNum = self._group.room_num
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在进入亲友圈......")
|
ViewUtil.ShowModalWait2(self._root_view, "正在进入亲友圈......")
|
||||||
Utils.SaveLocalFile("Family_lastID" .. DataManager.SelfUser.account_id, self._group.id)
|
Utils.SaveLocalFile("Family_lastID" .. DataManager.SelfUser.account_id, self._group.id)
|
||||||
self:EnterGroup(fgCtr, self._group.id)
|
self:EnterGroup(fgCtr, self._group.id)
|
||||||
|
|
||||||
--[[
|
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在加载亲友圈权限中......")
|
|
||||||
self:ChangeOther(tonumber(self._group.lev) + 1)
|
|
||||||
allLoad = 1
|
|
||||||
|
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在加载成员列表中......")
|
|
||||||
allLoad = allLoad +
|
|
||||||
self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num, false,
|
|
||||||
1)
|
|
||||||
|
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在加载房间列表中......")
|
|
||||||
|
|
||||||
allLoad = allLoad + self:EnterGroup(fgCtr, self._group.id)
|
|
||||||
]]
|
|
||||||
UpdateBeat:Add(self.OnUpdate, self)
|
UpdateBeat:Add(self.OnUpdate, self)
|
||||||
|
|
||||||
if self._group.isOpenChatRoom == 1 then
|
if self._group.isOpenChatRoom == 1 then
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,118 @@
|
||||||
|
local IdPasswordLoginView = {}
|
||||||
|
|
||||||
|
local M = IdPasswordLoginView
|
||||||
|
|
||||||
|
function IdPasswordLoginView.new(type, callback)
|
||||||
|
setmetatable(M, { __index = BaseWindow })
|
||||||
|
local self = setmetatable({}, { __index = M })
|
||||||
|
self.class = "IdPasswordLoginView"
|
||||||
|
self._callback = callback
|
||||||
|
self._close_destroy = true
|
||||||
|
self.codeType = type
|
||||||
|
self:init("ui://Login/IDLogin")
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:init(url)
|
||||||
|
BaseWindow.init(self, url)
|
||||||
|
|
||||||
|
local btn_login = self._view:GetChild("btn_login")
|
||||||
|
btn_login.onClick:Add(handler(self, function()
|
||||||
|
self:login()
|
||||||
|
end))
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:login()
|
||||||
|
if self.codeType == 0 then
|
||||||
|
local uid = self:CheckInputId()
|
||||||
|
if not uid then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local loginCtr = ControllerManager.GetController(LoginController)
|
||||||
|
local passwd = self:CheckInputPasswd()
|
||||||
|
if not passwd then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
|
loginCtr:IdPasswordLogin(uid, passwd, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "ID或者密码错误")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self._callback(res)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
---[[
|
||||||
|
--直接登入
|
||||||
|
local loginCtr = ControllerManager.GetController(LoginController)
|
||||||
|
|
||||||
|
local phone = self:CheckInputPhone()
|
||||||
|
if not phone then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local code = self:CheckInputPhoneCode()
|
||||||
|
if not code then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
loginCtr:PhoneLogin(phone, code, function(res)
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
|
local msg_txt = "验证码错误"
|
||||||
|
if (Table_Error_code_Map[res.ReturnCode] ~= nil) then
|
||||||
|
msg_txt = Table_Error_code_Map[res.ReturnCode].note
|
||||||
|
end
|
||||||
|
local guo_msg = MsgWindow.new(self._root_view, msg_txt, MsgWindow.MsgMode.OnlyOk)
|
||||||
|
guo_msg._new_hide = false
|
||||||
|
guo_msg:Show()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self._callback(res)
|
||||||
|
self:Destroy()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:Destroy()
|
||||||
|
getmetatable(M).__index.Destroy(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputId()
|
||||||
|
local uid = self._view:GetChild("phone_input").text
|
||||||
|
if not (string.len(uid) >= 6) then
|
||||||
|
ViewUtil.ShowTips("请输入正确的用户ID")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return uid
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputPasswd()
|
||||||
|
local tex_passwd = self._view:GetChild("tex_passwd").text
|
||||||
|
if string.len(tex_passwd) < 8 then
|
||||||
|
ViewUtil.ShowTips("密码最少八位")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return tex_passwd
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputPhone()
|
||||||
|
local phone = self._view:GetChild("phone_input").text
|
||||||
|
if not (string.len(phone) == 11) then
|
||||||
|
ViewUtil.ShowTips("请输入正确的电话号码")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return phone
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputPhoneCode()
|
||||||
|
local code = self._view:GetChild("code_input").text
|
||||||
|
if string.len(code) ~= 6 then
|
||||||
|
ViewUtil.ShowTips("请输入正确的验证码")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return code
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -185,7 +185,7 @@ function M:OnCreateRoom(mode_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在创建房间...")
|
ViewUtil.ShowModalWait2(self._root_view, "正在创建房间...")
|
||||||
loddyCtr:CreateRoom(game_id, { _data = _data, hpData = self.hpData, name = name }, function(res)
|
loddyCtr:CreateRoom(game_id, { _data = _data, hpData = self.hpData, name = name }, function(res)
|
||||||
self:__OnCreateRoomAction(res)
|
self:__OnCreateRoomAction(res)
|
||||||
end)
|
end)
|
||||||
|
|
@ -193,7 +193,7 @@ function M:OnCreateRoom(mode_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:__OnCreateRoomAction(response)
|
function M:__OnCreateRoomAction(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (response.ReturnCode == -2) then
|
if (response.ReturnCode == -2) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ local DiamondRecord = {}
|
||||||
local M = DiamondRecord
|
local M = DiamondRecord
|
||||||
|
|
||||||
--类型字段,1为进入游戏预扣,2为结束游戏返还
|
--类型字段,1为进入游戏预扣,2为结束游戏返还
|
||||||
local TypeTable = { "亲友圈开局游戏预扣", "因游戏结束返还您" }
|
local TypeTable = { "亲友圈开局游戏预扣", "因游戏结束返还您", "您为亲友圈充值" }
|
||||||
|
|
||||||
function M.New(data, callback)
|
function M.New(data, callback)
|
||||||
setmetatable(M, { __index = BaseWindow })
|
setmetatable(M, { __index = BaseWindow })
|
||||||
|
|
@ -26,13 +26,35 @@ function M:Init()
|
||||||
end
|
end
|
||||||
|
|
||||||
--大厅的请求
|
--大厅的请求
|
||||||
|
local lobbyCtr = ControllerManager.GetController(LoddyController)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
|
lobbyCtr:FG_Get_Diamond_Msg(function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "获取房卡记录失败")
|
||||||
|
else
|
||||||
|
self.msgData = res.Data.messages
|
||||||
|
list_msg.numItems = #self.msgData
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:msgRenderer(index, obj)
|
function M:msgRenderer(index, obj)
|
||||||
local data = self.msgData
|
local data = self.msgData[index + 1]
|
||||||
obj:GetChild('tex_time').text = os.date("%Y-%m-%d %H:%M:%S", math.floor(data[index + 1].m_time / 1000))
|
local type = data.diamo_type
|
||||||
obj:GetChild('tex_msg').text = string.format("%s%d房卡,剩余%d房卡", TypeTable[data[index + 1].diamo_type + 1],
|
obj:GetChild('tex_time').text = os.date("%Y-%m-%d %H:%M:%S", math.floor(data.m_time / 1000))
|
||||||
data[index + 1].diamo_num, data[index + 1].diamo_cur)
|
if type == 2 and data.user_nick and #data.user_nick > 0 then
|
||||||
|
obj:GetChild('tex_msg').text = string.format("【%s(%s)】用户为%s亲友圈充值%d房卡,剩余%d房卡", data.user_nick, data.uid,
|
||||||
|
(data.group_name and #data.group_name > 0) and string.format("【%s(%s)】", data.group_name, data.group_id) or
|
||||||
|
"",
|
||||||
|
data.diamo_num, data.diamo_cur)
|
||||||
|
elseif type == 1 and data.group_name and #data.group_name > 0 then
|
||||||
|
obj:GetChild('tex_msg').text = string.format("您解散了【%s(%s)】亲友圈,返还您%d房卡,剩余%d房卡", data.group_name, data.group_id,
|
||||||
|
data.diamo_num, data.diamo_cur)
|
||||||
|
else
|
||||||
|
obj:GetChild('tex_msg').text = string.format("%s%d房卡,剩余%d房卡", TypeTable[data.diamo_type + 1],
|
||||||
|
data.diamo_num, data.diamo_cur)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:Show(groupId)
|
function M:Show(groupId)
|
||||||
|
|
|
||||||
|
|
@ -5,45 +5,45 @@ local EditNickView = {}
|
||||||
local M = EditNickView
|
local M = EditNickView
|
||||||
|
|
||||||
function EditNickView.new(callback)
|
function EditNickView.new(callback)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "EditNickView"
|
self.class = "EditNickView"
|
||||||
self._callback = callback
|
self._callback = callback
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self:init("ui://Lobby/win_edit_nick")
|
self:init("ui://Lobby/win_edit_nick")
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
|
|
||||||
local tex_edit = self._view:GetChild("tex_edit")
|
local tex_edit = self._view:GetChild("tex_edit")
|
||||||
tex_edit.text = DataManager.SelfUser.nick_name
|
tex_edit.text = DataManager.SelfUser.nick_name
|
||||||
|
|
||||||
local btn_confirm = self._view:GetChild("btn_confirm")
|
local btn_confirm = self._view:GetChild("btn_confirm")
|
||||||
btn_confirm.onClick:Set(function()
|
btn_confirm.onClick:Set(function()
|
||||||
local nick = tex_edit.text
|
local nick = tex_edit.text
|
||||||
if nick == "" then
|
if nick == "" then
|
||||||
ViewUtil.ErrorTip(nil, "昵称不能为空")
|
ViewUtil.ErrorTip(nil, "昵称不能为空")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在连接服务器")
|
ViewUtil.ShowModalWait2(self._root_view, "正在连接服务器")
|
||||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data.type = 7
|
_data.type = 7
|
||||||
_data.nick = nick
|
_data.nick = nick
|
||||||
loddyctr:UpdateUserInfo(_data,function( res)
|
loddyctr:UpdateUserInfo(_data, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode ==0) then
|
if (res.ReturnCode == 0) then
|
||||||
DataManager.SelfUser.nick_name = nick
|
DataManager.SelfUser.nick_name = nick
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "修改失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "修改失败")
|
||||||
end
|
end
|
||||||
self._callback()
|
self._callback()
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,10 @@ function M:OnNumButtonAction(context)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:JoinRoom(str)
|
function M:JoinRoom(str)
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在加入房间...")
|
ViewUtil.ShowModalWait2(self._root_view, "正在加入房间...")
|
||||||
local boddyCtr = ControllerManager.GetController(LoddyController)
|
local boddyCtr = ControllerManager.GetController(LoddyController)
|
||||||
boddyCtr:JoinRoom(str, function(response)
|
boddyCtr:JoinRoom(str, function(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if response.ReturnCode == -2 then
|
if response.ReturnCode == -2 then
|
||||||
self:JoinRoom(str)
|
self:JoinRoom(str)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@ local LobbyHeadView = {}
|
||||||
|
|
||||||
local M = LobbyHeadView
|
local M = LobbyHeadView
|
||||||
|
|
||||||
function LobbyHeadView.new(user,agent,callback)
|
function LobbyHeadView.new(user, agent, callback)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "LobbyHeadView"
|
self.class = "LobbyHeadView"
|
||||||
self._user = user
|
self._user = user
|
||||||
self._agent = agent
|
self._agent = agent
|
||||||
|
|
@ -20,8 +20,8 @@ function LobbyHeadView.new(user,agent,callback)
|
||||||
self._full_offset = false
|
self._full_offset = false
|
||||||
self._animation = false
|
self._animation = false
|
||||||
self._put_map = false
|
self._put_map = false
|
||||||
self._new_hide = false
|
self._new_hide = false
|
||||||
self._queue = false
|
self._queue = false
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
self:init("ui://Lobby/UserInfo")
|
self:init("ui://Lobby/UserInfo")
|
||||||
|
|
||||||
|
|
@ -36,38 +36,38 @@ function M:fill_item(item_name, title, callback)
|
||||||
item.text = title
|
item.text = title
|
||||||
ctr_c1.selectedIndex = 1
|
ctr_c1.selectedIndex = 1
|
||||||
end
|
end
|
||||||
btn_opt.onClick:Set(function ()
|
btn_opt.onClick:Set(function()
|
||||||
callback()
|
callback()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:fill_user_info()
|
function M:fill_user_info()
|
||||||
local real_info = self._user.real_info
|
local real_info = self._user.real_info
|
||||||
self:fill_item("item_real",real_info and real_info.name or nil,function ()
|
self:fill_item("item_real", real_info and real_info.name or nil, function()
|
||||||
local real_view = RealAddressView.new(0,function ()
|
local real_view = RealAddressView.new(0, function()
|
||||||
self:fill_user_info()
|
self:fill_user_info()
|
||||||
end)
|
end)
|
||||||
real_view:Show()
|
real_view:Show()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local address = self._user.address
|
local address = self._user.address
|
||||||
self:fill_item("item_address",address,function ()
|
self:fill_item("item_address", address, function()
|
||||||
local real_view = RealAddressView.new(1,function ()
|
local real_view = RealAddressView.new(1, function()
|
||||||
self:fill_user_info()
|
self:fill_user_info()
|
||||||
end)
|
end)
|
||||||
real_view:Show()
|
real_view:Show()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local phone = self._user.phone
|
local phone = self._user.phone
|
||||||
self:fill_item("item_phone",phone and ViewUtil.phone_hide(phone) or nil,function ()
|
self:fill_item("item_phone", phone and ViewUtil.phone_hide(phone) or nil, function()
|
||||||
local phone_view = PhoneBindView.new(function ()
|
local phone_view = PhoneBindView.new(function()
|
||||||
self:fill_user_info()
|
self:fill_user_info()
|
||||||
end)
|
end)
|
||||||
phone_view:Show()
|
phone_view:Show()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local password = self._user.password
|
local password = self._user.password
|
||||||
self:fill_item("item_password",password,function ()
|
self:fill_item("item_password", password, function()
|
||||||
-- if not phone then
|
-- if not phone then
|
||||||
-- ViewUtil.ShowTips("请绑定手机号")
|
-- ViewUtil.ShowTips("请绑定手机号")
|
||||||
-- return
|
-- return
|
||||||
|
|
@ -82,24 +82,24 @@ function M:fill_user_info()
|
||||||
local item_invte = self.user_info:GetChild("item_invte")
|
local item_invte = self.user_info:GetChild("item_invte")
|
||||||
local ctr_invte = item_invte:GetController("c1")
|
local ctr_invte = item_invte:GetController("c1")
|
||||||
ctr_invte.selectedIndex = invitation
|
ctr_invte.selectedIndex = invitation
|
||||||
ctr_invte.onChanged:Set(function ()
|
ctr_invte.onChanged:Set(function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data.type =5
|
_data.type = 5
|
||||||
_data.invitation = ctr_invte.selectedIndex
|
_data.invitation = ctr_invte.selectedIndex
|
||||||
loddyctr:UpdateUserInfo(_data,function( res)
|
loddyctr:UpdateUserInfo(_data, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode ==0) then
|
if (res.ReturnCode == 0) then
|
||||||
DataManager.SelfUser.invitation = ctr_invte.selectedIndex
|
DataManager.SelfUser.invitation = ctr_invte.selectedIndex
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode,"提交失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "提交失败")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local acc = self._user.acc
|
local acc = self._user.acc
|
||||||
self:fill_item("item_wx",acc and "(绑定:"..self._user.nick_name..")" or "",function ()
|
self:fill_item("item_wx", acc and "(绑定:" .. self._user.nick_name .. ")" or "", function()
|
||||||
local wx_view = WeChatView.new(function()
|
local wx_view = WeChatView.new(function()
|
||||||
self:fill_user_info()
|
self:fill_user_info()
|
||||||
end)
|
end)
|
||||||
|
|
@ -118,31 +118,30 @@ function M:fill_user_info()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:ChangeToLogin()
|
function M:ChangeToLogin()
|
||||||
local _curren_msg = MsgWindow.new(self._root_view, '您是否退出当前账号?', MsgWindow.MsgMode.OkAndCancel)
|
local _curren_msg = MsgWindow.new(self._root_view, '您是否退出当前账号?', MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(function()
|
_curren_msg.onOk:Add(function()
|
||||||
PlayerPrefs.DeleteKey('session_id')
|
PlayerPrefs.DeleteKey('session_id')
|
||||||
PlayerPrefs.Save()
|
PlayerPrefs.Save()
|
||||||
RestartGame()
|
RestartGame()
|
||||||
end)
|
end)
|
||||||
_curren_msg:Show()
|
_curren_msg:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self._close_zone = true
|
self._close_zone = true
|
||||||
local view = self._view
|
local view = self._view
|
||||||
|
|
||||||
local ctr_nav = view:GetController("nav")
|
local ctr_nav = view:GetController("nav")
|
||||||
--ctr_nav.selectedIndex = self._agent and 1 or 0
|
--ctr_nav.selectedIndex = self._agent and 1 or 0
|
||||||
local ct_state = view:GetController("state")
|
local ct_state = view:GetController("state")
|
||||||
view:GetChild("tex_nickname").text = self._user.nick_name
|
view:GetChild("tex_nickname").text = self._user.nick_name
|
||||||
local str_playerid = self._user.account_id
|
local str_playerid = self._user.account_id
|
||||||
view:GetChild("tex_id").text = "ID:"..str_playerid
|
view:GetChild("tex_id").text = "ID:" .. str_playerid
|
||||||
|
|
||||||
|
|
||||||
local btn_head = view:GetChild("btn_head")
|
local btn_head = view:GetChild("btn_head")
|
||||||
ImageLoad.Load(self._user.head_url, btn_head._iconObject)
|
ImageLoad.Load(self._user.head_url, btn_head._iconObject)
|
||||||
btn_head.onClick:Set(function()
|
btn_head.onClick:Set(function()
|
||||||
|
|
@ -165,4 +164,4 @@ function M:init(url)
|
||||||
self.user_info = view:GetChild("user_info")
|
self.user_info = view:GetChild("user_info")
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
--设置窗口对象
|
--设置窗口对象
|
||||||
|
local PasswordUpdateView = import(".PasswordUpdateView")
|
||||||
|
|
||||||
local LobbyPlayerInfoView = {}
|
local LobbyPlayerInfoView = {}
|
||||||
|
|
||||||
|
|
@ -11,6 +12,7 @@ function LobbyPlayerInfoView.new(user, callback)
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self.user = user
|
self.user = user
|
||||||
self._callback = callback
|
self._callback = callback
|
||||||
|
self._loadAll = 0
|
||||||
self:init('ui://Lobby/PlayerInfo')
|
self:init('ui://Lobby/PlayerInfo')
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
@ -21,11 +23,6 @@ function M:init(url)
|
||||||
local view = self._view
|
local view = self._view
|
||||||
local user = self.user;
|
local user = self.user;
|
||||||
|
|
||||||
-- print("================phone=====================")
|
|
||||||
for k, v in pairs(user) do
|
|
||||||
-- print(string.format("k:%s|v:%s", k, v))
|
|
||||||
end
|
|
||||||
|
|
||||||
--show
|
--show
|
||||||
view:GetChild('name').text = user.nick_name
|
view:GetChild('name').text = user.nick_name
|
||||||
view:GetChild('phone').text = user.phone
|
view:GetChild('phone').text = user.phone
|
||||||
|
|
@ -33,11 +30,25 @@ function M:init(url)
|
||||||
view:GetChild('diamo').text = user.diamo
|
view:GetChild('diamo').text = user.diamo
|
||||||
view:GetChild('sex').text = user.sex == 1 and "男" or "女"
|
view:GetChild('sex').text = user.sex == 1 and "男" or "女"
|
||||||
view:GetController('ctr_sex').selectedIndex = user.sex - 1
|
view:GetController('ctr_sex').selectedIndex = user.sex - 1
|
||||||
|
view:GetChild('ip').text = DataManager.SelfUser.currenIp
|
||||||
ImageLoad.Load(DataManager.SelfUser.head_url, view:GetChild("btn_PlayerHead")._iconObject)
|
ImageLoad.Load(DataManager.SelfUser.head_url, view:GetChild("btn_PlayerHead")._iconObject)
|
||||||
|
if DataManager.SelfUser.currenIp then
|
||||||
|
self._loadAll = self._loadAll + 1
|
||||||
|
else
|
||||||
|
GameApplication.Instance:GetPublicIP(function(ip)
|
||||||
|
DataManager.SelfUser.currenIp = ip
|
||||||
|
view:GetChild('ip').text = DataManager.SelfUser.currenIp
|
||||||
|
self:CheckAllload()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
--change
|
--change
|
||||||
view:GetChild('choose_id').text = user.account_id
|
view:GetChild('choose_id').text = user.account_id
|
||||||
view:GetChild('choose_diamo').text = user.diamo
|
view:GetChild('choose_diamo').text = user.diamo
|
||||||
|
-- if user.phone and #user.phone == 11 then
|
||||||
|
-- self._view:GetChild('btn_changeInfo').visible = false
|
||||||
|
-- self._view:GetChild('btn_changeInfo').touchable = false
|
||||||
|
-- end
|
||||||
self.Lable_name = view:GetChild('Lable_name'):GetChild('text')
|
self.Lable_name = view:GetChild('Lable_name'):GetChild('text')
|
||||||
self.Lable_name.text = user.nick_name
|
self.Lable_name.text = user.nick_name
|
||||||
self.group_sex = view:GetController('group_sex')
|
self.group_sex = view:GetController('group_sex')
|
||||||
|
|
@ -45,10 +56,8 @@ function M:init(url)
|
||||||
self.Lable_phone = view:GetChild('Lable_phone'):GetChild('text')
|
self.Lable_phone = view:GetChild('Lable_phone'):GetChild('text')
|
||||||
local bind = view:GetController('bind')
|
local bind = view:GetController('bind')
|
||||||
if user.phone then
|
if user.phone then
|
||||||
bind.selectedIndex = 1
|
|
||||||
self.Lable_phone.text = user.phone
|
self.Lable_phone.text = user.phone
|
||||||
else
|
else
|
||||||
bind.selectedIndex = 0
|
|
||||||
self.Lable_phone.text = ""
|
self.Lable_phone.text = ""
|
||||||
end
|
end
|
||||||
view:GetChild('btn_headChange').onClick:Add(function()
|
view:GetChild('btn_headChange').onClick:Add(function()
|
||||||
|
|
@ -62,7 +71,6 @@ function M:init(url)
|
||||||
view:GetChild('btn_bindPhone').onClick:Add(function()
|
view:GetChild('btn_bindPhone').onClick:Add(function()
|
||||||
local guo_msg = MsgWindow.new(self._root_view, "绑定页面正在优化中,请稍后绑定", MsgWindow.MsgMode.OnlyOk)
|
local guo_msg = MsgWindow.new(self._root_view, "绑定页面正在优化中,请稍后绑定", MsgWindow.MsgMode.OnlyOk)
|
||||||
guo_msg.onOk(function()
|
guo_msg.onOk(function()
|
||||||
bind.selectedIndex = 1
|
|
||||||
end)
|
end)
|
||||||
guo_msg:Show()
|
guo_msg:Show()
|
||||||
end)
|
end)
|
||||||
|
|
@ -104,6 +112,31 @@ function M:init(url)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
local pswType = DataManager.SelfUser.havaPsw and 1 or 0
|
||||||
|
local btn_changeInfo = self._view:GetChild('btn_changeInfo')
|
||||||
|
btn_changeInfo:GetController('type').selectedIndex = pswType
|
||||||
|
btn_changeInfo.onClick:Set(function()
|
||||||
|
local passwordUpdateView = PasswordUpdateView.new(pswType, function(res)
|
||||||
|
pswType = DataManager.SelfUser.havaPsw and 1 or 0
|
||||||
|
btn_changeInfo:GetController('type').selectedIndex = pswType
|
||||||
|
end)
|
||||||
|
passwordUpdateView:Show()
|
||||||
|
end)
|
||||||
|
|
||||||
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||||
|
loddyCtr1:GetUserInfo(function(res)
|
||||||
|
if res.ReturnCode == 0 then
|
||||||
|
self:CheckAllload()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckAllload()
|
||||||
|
self._loadAll = self._loadAll + 1
|
||||||
|
if self._loadAll >= 2 then
|
||||||
|
self:Show()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ function M:PlayerScoreRenderer(index, obj)
|
||||||
_data["round"] = tostring(round)
|
_data["round"] = tostring(round)
|
||||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
if DataManager.SelfUser.playback[allDate.military_id] ~= nil then
|
if DataManager.SelfUser.playback[allDate.military_id] ~= nil then
|
||||||
DataManager.SelfUser.playback[allDate.military_id][round] = data
|
DataManager.SelfUser.playback[allDate.military_id][round] = data
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ function M:init(url)
|
||||||
obj.text = info.service_link
|
obj.text = info.service_link
|
||||||
obj:GetChild('text_title').text = string.format("%s:", info.service_name)
|
obj:GetChild('text_title').text = string.format("%s:", info.service_name)
|
||||||
obj:GetChild('btn_copy').onClick:Set(function()
|
obj:GetChild('btn_copy').onClick:Set(function()
|
||||||
GameApplication.Instance:CopyToClipboard(info.service_link) --湘北
|
GameApplication.Instance:CopyToClipboard(info.service_link)
|
||||||
ViewUtil.ErrorTip(-1, "复制成功")
|
ViewUtil.ErrorTip(-1, "复制成功")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,15 @@ function M:init(url)
|
||||||
_btn_logout.onClick:Set(function()
|
_btn_logout.onClick:Set(function()
|
||||||
local _curren_msg = MsgWindow.new(self._root_view, '您是否退出当前账号?', MsgWindow.MsgMode.OkAndCancel)
|
local _curren_msg = MsgWindow.new(self._root_view, '您是否退出当前账号?', MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(function()
|
_curren_msg.onOk:Add(function()
|
||||||
PlayerPrefs.DeleteKey('session_id')
|
-- PlayerPrefs.DeleteKey('session_id')
|
||||||
|
-- PlayerPrefs.Save()
|
||||||
|
local phone = "11"
|
||||||
|
if DataManager.SelfUser.phone and #DataManager.SelfUser.phone == 11 then
|
||||||
|
phone = DataManager.SelfUser.phone
|
||||||
|
end
|
||||||
|
PlayerPrefs.SetString("session_phone", phone)
|
||||||
PlayerPrefs.Save()
|
PlayerPrefs.Save()
|
||||||
|
print("lingmeng log", phone)
|
||||||
RestartGame()
|
RestartGame()
|
||||||
end)
|
end)
|
||||||
_curren_msg:Show()
|
_curren_msg:Show()
|
||||||
|
|
|
||||||
|
|
@ -56,14 +56,16 @@ function M:init(url)
|
||||||
-- print(DataManager.SelfUser.diamo)
|
-- print(DataManager.SelfUser.diamo)
|
||||||
-- self.UpdateDiamo()
|
-- self.UpdateDiamo()
|
||||||
--暂时用这个发送协议
|
--暂时用这个发送协议
|
||||||
local uid = DataManager.SelfUser.account_id
|
-- local uid = DataManager.SelfUser.account_id
|
||||||
fgCtr:FG_SetFamilyDiamond(self.groupID, uid, SHOP_LIST[index + 1].num, function(res)
|
-- fgCtr:FG_SetFamilyDiamond(self.groupID, uid, SHOP_LIST[index + 1].num, function(res)
|
||||||
if res.ReturnCode ~= 0 then
|
-- if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "重置房卡失败")
|
-- ViewUtil.ErrorTip(res.ReturnCode, "重置房卡失败")
|
||||||
else
|
-- else
|
||||||
|
|
||||||
end
|
-- end
|
||||||
end)
|
-- end)
|
||||||
|
local pay_url = "https://ttfenfa.com/"
|
||||||
|
UnityEngine.Application.OpenURL(pay_url)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,157 @@
|
||||||
|
local PasswordUpdateView = {}
|
||||||
|
|
||||||
|
local M = PasswordUpdateView
|
||||||
|
|
||||||
|
function PasswordUpdateView.new(type, callback)
|
||||||
|
setmetatable(M, { __index = BaseWindow })
|
||||||
|
local self = setmetatable({}, { __index = M })
|
||||||
|
self.class = "PasswordUpdateView"
|
||||||
|
self._callback = callback
|
||||||
|
self._close_destroy = true
|
||||||
|
-- self.codeType = type
|
||||||
|
self.codeType = 0
|
||||||
|
self:init("ui://Lobby/PasswordSet")
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:init(url)
|
||||||
|
BaseWindow.init(self, url)
|
||||||
|
self.login_type = self._view:GetController("type")
|
||||||
|
self.login_type.selectedIndex = self.codeType
|
||||||
|
|
||||||
|
local btn_login = self._view:GetChild("btn_login")
|
||||||
|
btn_login.onClick:Add(handler(self, function()
|
||||||
|
self:Bind()
|
||||||
|
end))
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:Bind()
|
||||||
|
if self.codeType == 0 then
|
||||||
|
local passwd = self:CheckInputPasswd()
|
||||||
|
if not passwd then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
|
local _data = {}
|
||||||
|
_data.password = passwd
|
||||||
|
_data.type = 3
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
|
loddyctr:UpdateUserInfo(_data, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
|
if (res.ReturnCode == 0) then
|
||||||
|
DataManager.SelfUser.havaPsw = true
|
||||||
|
self.login_type.selectedIndex = 1
|
||||||
|
if self._callback then self._callback() end
|
||||||
|
else
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "提交失败")
|
||||||
|
end
|
||||||
|
self:Close()
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
local myPwd = self:CheckInputPasswd2()
|
||||||
|
if not myPwd then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local passwd = self:CheckInputPasswd()
|
||||||
|
if not passwd then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
|
local _data = {}
|
||||||
|
_data.password = passwd
|
||||||
|
_data.type = 3
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
|
loddyctr:UpdateUserInfo(_data, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
|
if (res.ReturnCode == 0) then
|
||||||
|
DataManager.SelfUser.havaPsw = true
|
||||||
|
self.login_type.selectedIndex = 1
|
||||||
|
if self._callback then self._callback() end
|
||||||
|
else
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "提交失败")
|
||||||
|
end
|
||||||
|
self:Close()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:Destroy()
|
||||||
|
UpdateBeat:Remove(self.OnUpdate, self)
|
||||||
|
getmetatable(M).__index.Destroy(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputId()
|
||||||
|
local uid = self._view:GetChild("phone_input").text
|
||||||
|
if not (string.len(uid) >= 6) then
|
||||||
|
ViewUtil.ShowTips("请输入正确的用户ID")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return uid
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputPasswd2()
|
||||||
|
local tex_passwd = self._view:GetChild("my_input").text
|
||||||
|
if string.len(tex_passwd) < 8 then
|
||||||
|
ViewUtil.ShowTips("旧密码最少八位")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return tex_passwd
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputPasswd()
|
||||||
|
local tex_frist_passwd = self._view:GetChild("phone_input").text
|
||||||
|
local tex_confrim_passwd = self._view:GetChild("code_input").text
|
||||||
|
|
||||||
|
if string.len(tex_frist_passwd) < 8 then
|
||||||
|
ViewUtil.ShowTips("密码最少八位")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local flg_xiaozimu = false
|
||||||
|
local flg_dazimu = false
|
||||||
|
local fla_shuzi = false
|
||||||
|
for i = 1, #tex_frist_passwd do
|
||||||
|
local oneChar = string.sub(tex_frist_passwd, i, i)
|
||||||
|
print("lingmeng Bind", oneChar, string.byte(oneChar))
|
||||||
|
if string.byte(oneChar) >= 65 and string.byte(oneChar) <= 90 then
|
||||||
|
flg_dazimu = true
|
||||||
|
elseif string.byte(oneChar) >= 97 and string.byte(oneChar) <= 122 then
|
||||||
|
flg_xiaozimu = true
|
||||||
|
elseif string.byte(oneChar) >= 48 and string.byte(oneChar) <= 57 then
|
||||||
|
fla_shuzi = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not ((flg_xiaozimu or flg_dazimu) and fla_shuzi) then
|
||||||
|
ViewUtil.ShowTips("密码必须同时包含字母和数字")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if tex_frist_passwd ~= tex_confrim_passwd then
|
||||||
|
ViewUtil.ShowTips("确认密码必须和输入密码保持一致")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
return tex_confrim_passwd
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputPhone()
|
||||||
|
local phone = self._view:GetChild("phone_input").text
|
||||||
|
if not (string.len(phone) == 11) then
|
||||||
|
ViewUtil.ShowTips("请输入正确的电话号码")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return phone
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputPhoneCode()
|
||||||
|
local code = self._view:GetChild("code_input").text
|
||||||
|
if string.len(code) ~= 6 then
|
||||||
|
ViewUtil.ShowTips("请输入正确的验证码")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return code
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -3,8 +3,8 @@ local PhoneBindView = {}
|
||||||
local M = PhoneBindView
|
local M = PhoneBindView
|
||||||
|
|
||||||
function PhoneBindView.new(callback)
|
function PhoneBindView.new(callback)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "PhoneBindView"
|
self.class = "PhoneBindView"
|
||||||
self._callback = callback
|
self._callback = callback
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
|
|
@ -14,13 +14,13 @@ function PhoneBindView.new(callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
|
|
||||||
if DataManager.SelfUser.phone then
|
if DataManager.SelfUser.phone then
|
||||||
local ctr_update = self._view:GetController("update")
|
local ctr_update = self._view:GetController("update")
|
||||||
ctr_update.selectedIndex = 1
|
ctr_update.selectedIndex = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
local btn_getCode = self._view:GetChild("btn_getCode")
|
local btn_getCode = self._view:GetChild("btn_getCode")
|
||||||
btn_getCode.onClick:Set(function()
|
btn_getCode.onClick:Set(function()
|
||||||
self:GetCode()
|
self:GetCode()
|
||||||
|
|
@ -38,8 +38,8 @@ function M:GetCode()
|
||||||
if not phone then
|
if not phone then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
loddyctr:GetPhoneCode(phone,function( res)
|
loddyctr:GetPhoneCode(phone, function(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
self._view:GetController("code").selectedIndex = 1
|
self._view:GetController("code").selectedIndex = 1
|
||||||
self._left_time = 120
|
self._left_time = 120
|
||||||
|
|
@ -57,12 +57,12 @@ function M:OnUpdate()
|
||||||
_left_time = _left_time - deltaTime
|
_left_time = _left_time - deltaTime
|
||||||
_left_time = math.max(0, _left_time)
|
_left_time = math.max(0, _left_time)
|
||||||
local leftTime = math.floor(_left_time)
|
local leftTime = math.floor(_left_time)
|
||||||
self._view:GetChild("tex_time").text = tostring(leftTime).."后重新发送"
|
self._view:GetChild("tex_time").text = tostring(leftTime) .. "后重新发送"
|
||||||
self._left_time = _left_time
|
self._left_time = _left_time
|
||||||
else
|
else
|
||||||
self._view:GetController("code").selectedIndex=0
|
self._view:GetController("code").selectedIndex = 0
|
||||||
UpdateBeat:Remove(self.OnUpdate, self)
|
UpdateBeat:Remove(self.OnUpdate, self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:Destroy()
|
function M:Destroy()
|
||||||
|
|
@ -80,19 +80,19 @@ function M:Bind()
|
||||||
if not code then
|
if not code then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait(self._root_view,"正在提交...")
|
ViewUtil.ShowModalWait2(self._root_view, "正在提交...")
|
||||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data.type =4
|
_data.type = 4
|
||||||
_data.phone = phone
|
_data.phone = phone
|
||||||
_data.code = code
|
_data.code = code
|
||||||
loddyctr:UpdateUserInfo(_data,function( res)
|
loddyctr:UpdateUserInfo(_data, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode ==0) then
|
if (res.ReturnCode == 0) then
|
||||||
DataManager.SelfUser.phone = phone
|
DataManager.SelfUser.phone = phone
|
||||||
if self._callback then self._callback() end
|
if self._callback then self._callback() end
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode,"提交失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "提交失败")
|
||||||
end
|
end
|
||||||
self:Close()
|
self:Close()
|
||||||
end)
|
end)
|
||||||
|
|
@ -116,4 +116,4 @@ function M:CheckInputCode()
|
||||||
return code
|
return code
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,187 @@
|
||||||
|
local PhoneLoginView = {}
|
||||||
|
|
||||||
|
local M = PhoneLoginView
|
||||||
|
|
||||||
|
function PhoneLoginView.new(type, callback)
|
||||||
|
setmetatable(M, { __index = BaseWindow })
|
||||||
|
local self = setmetatable({}, { __index = M })
|
||||||
|
self.class = "PhoneLoginView"
|
||||||
|
self._callback = callback
|
||||||
|
self._close_destroy = true
|
||||||
|
self.codeType = type
|
||||||
|
self._new_hide = false
|
||||||
|
self:init("ui://Lobby/PhnoeLogin")
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:init(url)
|
||||||
|
BaseWindow.init(self, url)
|
||||||
|
self.login_type = self._view:GetController("type")
|
||||||
|
self.login_type.selectedIndex = self.codeType;
|
||||||
|
|
||||||
|
self.code = self._view:GetController("code")
|
||||||
|
|
||||||
|
local btn_login = self._view:GetChild("btn_login")
|
||||||
|
btn_login.onClick:Add(handler(self, function()
|
||||||
|
self:login()
|
||||||
|
end))
|
||||||
|
|
||||||
|
local btn_getCode = self._view:GetChild("btn_code_send")
|
||||||
|
btn_getCode.onClick:Add(handler(self, function()
|
||||||
|
self:getCode()
|
||||||
|
end))
|
||||||
|
if DataManager.SelfUser._data_codeTiem and DataManager.SelfUser._data_codeTiem - os.time() > 0 then
|
||||||
|
self._left_time = DataManager.SelfUser._data_codeTiem - os.time()
|
||||||
|
self._view:GetChild("phone_input").text = DataManager.SelfUser._data_codephone
|
||||||
|
UpdateBeat:Add(self.OnUpdate, self)
|
||||||
|
self.code.selectedIndex = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:login()
|
||||||
|
if self.codeType == 0 then
|
||||||
|
local uid = self:CheckInputId()
|
||||||
|
if not uid then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...")
|
||||||
|
local loginCtr = ControllerManager.GetController(LoddyController)
|
||||||
|
local passwd = self:CheckInputPasswd()
|
||||||
|
if not passwd then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
loginCtr:IdPasswordLogin(uid, passwd, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
|
local guo_msg = MsgWindow.new(self._root_view, "验证码已发送", MsgWindow.MsgMode.OnlyOk)
|
||||||
|
guo_msg._new_hide = false
|
||||||
|
guo_msg:Show()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self._callback(res)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
---[[
|
||||||
|
--直接登入
|
||||||
|
local loginCtr = ControllerManager.GetController(LoddyController)
|
||||||
|
|
||||||
|
local phone = self:CheckInputPhone()
|
||||||
|
if not phone then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local code = self:CheckInputPhoneCode()
|
||||||
|
if not code then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
loginCtr:PhoneBind(phone, code, function(res)
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
|
local msg_txt = "验证码错误"
|
||||||
|
if (Table_Error_code_Map[res.ReturnCode] ~= nil) then
|
||||||
|
msg_txt = Table_Error_code_Map[res.ReturnCode].note
|
||||||
|
end
|
||||||
|
local guo_msg = MsgWindow.new(self._root_view, msg_txt, MsgWindow.MsgMode.OnlyOk)
|
||||||
|
guo_msg._new_hide = false
|
||||||
|
guo_msg:Show()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self._callback(res)
|
||||||
|
self:Destroy()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:getCode()
|
||||||
|
local phone = self:CheckInputPhone()
|
||||||
|
if not phone then
|
||||||
|
self.code.selectedIndex = 0
|
||||||
|
return
|
||||||
|
end
|
||||||
|
--发送电话给后端
|
||||||
|
ViewUtil:ShowModalWait2(0.1)
|
||||||
|
local loginCtr = ControllerManager.GetController(LoginController)
|
||||||
|
loginCtr:GetPhoneCode(phone, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
|
if res.ReturnCode == 0 then
|
||||||
|
self.phone = phone
|
||||||
|
self._left_time = 60
|
||||||
|
DataManager.SelfUser._data_codeTiem = os.time() + 60
|
||||||
|
DataManager.SelfUser._data_codephone = phone
|
||||||
|
UpdateBeat:Add(self.OnUpdate, self)
|
||||||
|
else
|
||||||
|
if res.ReturnCode == 1 then
|
||||||
|
self._left_time = 15
|
||||||
|
DataManager.SelfUser._data_codeTiem = os.time() + 15
|
||||||
|
DataManager.SelfUser._data_codephone = phone
|
||||||
|
UpdateBeat:Add(self.OnUpdate, self)
|
||||||
|
ViewUtil.ErrorTip(self._root_view, "验证码还在有效期")
|
||||||
|
else
|
||||||
|
self.code.selectedIndex = 0
|
||||||
|
ViewUtil.ErrorTip(self._root_view, "网络超时,请重新获取验证码")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:OnUpdate()
|
||||||
|
local deltaTime = Time.deltaTime
|
||||||
|
local _left_time = self._left_time
|
||||||
|
if (_left_time > 0) then
|
||||||
|
_left_time = _left_time - deltaTime
|
||||||
|
_left_time = math.max(0, _left_time)
|
||||||
|
local leftTime = math.floor(_left_time)
|
||||||
|
self._view:GetChild("code_send_text").text = tostring(leftTime)
|
||||||
|
self._left_time = _left_time
|
||||||
|
else
|
||||||
|
self.code.selectedIndex = 0
|
||||||
|
UpdateBeat:Remove(self.OnUpdate, self)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:Destroy()
|
||||||
|
BaseWindow.Destroy(self)
|
||||||
|
UpdateBeat:Remove(self.OnUpdate, self)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputId()
|
||||||
|
local uid = self._view:GetChild("phone_input").text
|
||||||
|
if not (string.len(uid) >= 6) then
|
||||||
|
ViewUtil.ShowTips("请输入正确的用户ID")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return uid
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputPasswd()
|
||||||
|
local tex_passwd = self._view:GetChild("tex_passwd").text
|
||||||
|
if string.len(tex_passwd) < 6 then
|
||||||
|
ViewUtil.ShowTips("密码最少六位")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return tex_passwd
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputPhone()
|
||||||
|
local phone = self._view:GetChild("phone_input").text
|
||||||
|
if not (string.len(phone) == 11) then
|
||||||
|
ViewUtil.ShowTips("请输入正确的电话号码")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return phone
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckInputPhoneCode()
|
||||||
|
local code = self._view:GetChild("code_input").text
|
||||||
|
if string.len(code) ~= 6 then
|
||||||
|
ViewUtil.ShowTips("请输入正确的验证码")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return code
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -83,22 +83,13 @@ function M:Bind()
|
||||||
end
|
end
|
||||||
local _data = {}
|
local _data = {}
|
||||||
|
|
||||||
-- if self.ctr_update.selectedIndex == 1 then
|
ViewUtil.ShowModalWait2(self._root_view, "正在提交...")
|
||||||
|
|
||||||
-- local code = self:CheckInputCode()
|
|
||||||
-- if not code then
|
|
||||||
-- return
|
|
||||||
-- end
|
|
||||||
-- _data.phone = DataManager.SelfUser.phone
|
|
||||||
-- _data.code = code
|
|
||||||
-- end
|
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在提交...")
|
|
||||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
_data.password = password
|
_data.password = password
|
||||||
_data.type = 3
|
_data.type = 3
|
||||||
|
|
||||||
loddyctr:UpdateUserInfo(_data, function(res)
|
loddyctr:UpdateUserInfo(_data, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode == 0) then
|
if (res.ReturnCode == 0) then
|
||||||
DataManager.SelfUser.password = "123"
|
DataManager.SelfUser.password = "123"
|
||||||
if self._callback then self._callback() end
|
if self._callback then self._callback() end
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ function M:init(url)
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait(self._root_view)
|
||||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||||
loddyCtr1:RequestRecordList(function(result)
|
loddyCtr1:RequestRecordList(function(result)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -245,7 +245,7 @@ function M:InitRecord1(recordList, develop_tool)
|
||||||
ShareScreenShotWithOption(function()
|
ShareScreenShotWithOption(function()
|
||||||
result_view:Dispose()
|
result_view:Dispose()
|
||||||
end)
|
end)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
coroutine.wait(1)
|
coroutine.wait(1)
|
||||||
|
|
@ -338,7 +338,7 @@ function M:ShowRecord2(playback_id, room_type, room_id, room_time, item_score, g
|
||||||
_data["round"] = tostring(i)
|
_data["round"] = tostring(i)
|
||||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
||||||
DataManager.SelfUser.playback[playback_id][i] = data
|
DataManager.SelfUser.playback[playback_id][i] = data
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ local RealAddressView = {}
|
||||||
|
|
||||||
local M = RealAddressView
|
local M = RealAddressView
|
||||||
|
|
||||||
function RealAddressView.new(type,callback)
|
function RealAddressView.new(type, callback)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "RealAddressView"
|
self.class = "RealAddressView"
|
||||||
self._type = type
|
self._type = type
|
||||||
self._callback = callback
|
self._callback = callback
|
||||||
|
|
@ -17,7 +17,7 @@ function RealAddressView.new(type,callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
local view = self._view
|
local view = self._view
|
||||||
|
|
||||||
local btn_real = view:GetChild("btn_real")
|
local btn_real = view:GetChild("btn_real")
|
||||||
|
|
@ -26,7 +26,7 @@ function M:init(url)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local btn_address = view:GetChild("btn_address")
|
local btn_address = view:GetChild("btn_address")
|
||||||
btn_address.onClick:Set(function ()
|
btn_address.onClick:Set(function()
|
||||||
self:address_action()
|
self:address_action()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
@ -34,7 +34,7 @@ function M:init(url)
|
||||||
|
|
||||||
local ctr_nav = view:GetController("nav")
|
local ctr_nav = view:GetController("nav")
|
||||||
ctr_nav.onChanged:Set(function()
|
ctr_nav.onChanged:Set(function()
|
||||||
if ctr_nav.selectedIndex ==0 then
|
if ctr_nav.selectedIndex == 0 then
|
||||||
self:fill_real()
|
self:fill_real()
|
||||||
else
|
else
|
||||||
local user = DataManager.SelfUser
|
local user = DataManager.SelfUser
|
||||||
|
|
@ -54,33 +54,34 @@ function M:fill_real()
|
||||||
local user = DataManager.SelfUser
|
local user = DataManager.SelfUser
|
||||||
if user.real_info then
|
if user.real_info then
|
||||||
self.ctr_update.selectedIndex = 1
|
self.ctr_update.selectedIndex = 1
|
||||||
self._view:GetChild("tex_name1").text ="姓名:".. user.real_info.name
|
self._view:GetChild("tex_name1").text = "姓名:" .. user.real_info.name
|
||||||
self._view:GetChild("tex_identity1").text = "身份证号:"..ViewUtil.identity_hide(user.real_info.identity)
|
self._view:GetChild("tex_identity1").text = "身份证号:" .. ViewUtil.identity_hide(user.real_info.identity)
|
||||||
else
|
else
|
||||||
self.ctr_update.selectedIndex = 0
|
self.ctr_update.selectedIndex = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:SetCallBack(callback)
|
function M:SetCallBack(callback)
|
||||||
self._CB = callback
|
self._CB = callback
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:real_action()
|
function M:real_action()
|
||||||
local check,str = self:CheckInputValidity()
|
local check, str = self:CheckInputValidity()
|
||||||
if not check then
|
if not check then
|
||||||
ViewUtil.ShowTips(str)
|
ViewUtil.ShowTips(str)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait(self._root_view,"正在提交认证...")
|
ViewUtil.ShowModalWait2(self._root_view, "正在提交认证...")
|
||||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data.type =1
|
_data.type = 1
|
||||||
local real_info = {}
|
local real_info = {}
|
||||||
real_info.name =self._view:GetChild("tex_name").text
|
real_info.name = self._view:GetChild("tex_name").text
|
||||||
real_info.identity = self._view:GetChild("tex_identity").text
|
real_info.identity = self._view:GetChild("tex_identity").text
|
||||||
_data.real_info = real_info
|
_data.real_info = real_info
|
||||||
loddyctr:UpdateUserInfo(_data,function( res)
|
loddyctr:UpdateUserInfo(_data, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode ==0) then
|
if (res.ReturnCode == 0) then
|
||||||
DataManager.SelfUser.real_info = real_info
|
DataManager.SelfUser.real_info = real_info
|
||||||
if self._callback then self._callback() end
|
if self._callback then self._callback() end
|
||||||
else
|
else
|
||||||
|
|
@ -110,7 +111,7 @@ function M:CheckInputValidity()
|
||||||
if id then
|
if id then
|
||||||
local l = string.len(id)
|
local l = string.len(id)
|
||||||
if l ~= 18 then return false, "请输入18位身份证号码" end
|
if l ~= 18 then return false, "请输入18位身份证号码" end
|
||||||
if not (tonumber(id) or string.sub(id,18,18) == "X") then
|
if not (tonumber(id) or string.sub(id, 18, 18) == "X") then
|
||||||
return false, "请输入正确的身份证号码"
|
return false, "请输入正确的身份证号码"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -119,25 +120,25 @@ end
|
||||||
|
|
||||||
function M:address_action()
|
function M:address_action()
|
||||||
local tex_address = self._view:GetChild("tex_address").text
|
local tex_address = self._view:GetChild("tex_address").text
|
||||||
if string.len(tex_address) <=0 then
|
if string.len(tex_address) <= 0 then
|
||||||
ViewUtil.ShowTips("请输入详细地址")
|
ViewUtil.ShowTips("请输入详细地址")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait(self._root_view,"正在提交...")
|
ViewUtil.ShowModalWait2(self._root_view, "正在提交...")
|
||||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data.type =2
|
_data.type = 2
|
||||||
_data.address = tex_address
|
_data.address = tex_address
|
||||||
loddyctr:UpdateUserInfo(_data,function( res)
|
loddyctr:UpdateUserInfo(_data, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode ==0) then
|
if (res.ReturnCode == 0) then
|
||||||
DataManager.SelfUser.address = _data.address
|
DataManager.SelfUser.address = _data.address
|
||||||
if self._callback then self._callback() end
|
if self._callback then self._callback() end
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode,"提示失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "提示失败")
|
||||||
end
|
end
|
||||||
self:Close()
|
self:Close()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -5,40 +5,38 @@ local WeChatView = {}
|
||||||
local M = WeChatView
|
local M = WeChatView
|
||||||
|
|
||||||
function WeChatView.new(callback)
|
function WeChatView.new(callback)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "WeChatView"
|
self.class = "WeChatView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self._close_zone = true
|
self._close_zone = true
|
||||||
self._callback =callback
|
self._callback = callback
|
||||||
self:init("ui://Lobby/win_user_wx")
|
self:init("ui://Lobby/win_user_wx")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
|
|
||||||
local btn_ok = self._view:GetChild("btn_ok")
|
local btn_ok = self._view:GetChild("btn_ok")
|
||||||
btn_ok.onClick:Set(function ()
|
btn_ok.onClick:Set(function()
|
||||||
ViewUtil.ShowModalWait(self._root_view,"正在同步数据...")
|
ViewUtil.ShowModalWait2(self._root_view, "正在同步数据...")
|
||||||
GameApplication.Instance:WXLogin(handler(self,self.WXCallBack))
|
GameApplication.Instance:WXLogin(handler(self, self.WXCallBack))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:WXCallBack(result,data)
|
function M:WXCallBack(result, data)
|
||||||
|
if (not result) or result ~= 0 then
|
||||||
if (not result) or result ~= 0 then
|
|
||||||
if result == 10 then
|
if result == 10 then
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not data then
|
if not data then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local jd = json.decode(data)
|
local jd = json.decode(data)
|
||||||
|
|
@ -48,20 +46,20 @@ function M:WXCallBack(result,data)
|
||||||
if (sex == 0) then sex = 1 end
|
if (sex == 0) then sex = 1 end
|
||||||
local nickname = jd["nickname"]
|
local nickname = jd["nickname"]
|
||||||
|
|
||||||
if not unionid or string.len(unionid)<1 then
|
if not unionid or string.len(unionid) < 1 then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data.type =6
|
_data.type = 6
|
||||||
_data["acc"] = unionid
|
_data["acc"] = unionid
|
||||||
_data["nick"] = nickname
|
_data["nick"] = nickname
|
||||||
_data["sex"] = sex
|
_data["sex"] = sex
|
||||||
_data["portrait"] = headurl
|
_data["portrait"] = headurl
|
||||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
loddyctr:UpdateUserInfo(_data,function( res)
|
loddyctr:UpdateUserInfo(_data, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode ==0) then
|
if (res.ReturnCode == 0) then
|
||||||
local user = DataManager.SelfUser
|
local user = DataManager.SelfUser
|
||||||
user.acc = unionid
|
user.acc = unionid
|
||||||
user.nick_name = nickname
|
user.nick_name = nickname
|
||||||
|
|
@ -75,5 +73,4 @@ function M:WXCallBack(result,data)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
return M
|
|
||||||
|
|
|
||||||
|
|
@ -123,9 +123,9 @@ function M:InitView(url)
|
||||||
-- local btn_more_group = self._view:GetChild("btn_family")
|
-- local btn_more_group = self._view:GetChild("btn_family")
|
||||||
-- btn_more_group.onClick:Set(function()
|
-- btn_more_group.onClick:Set(function()
|
||||||
-- --self.groupMainView._view.visible = true
|
-- --self.groupMainView._view.visible = true
|
||||||
-- ViewUtil.ShowModalWait(self._root_view, "请稍等,获取牌友圈中...")
|
-- ViewUtil.ShowModalWait2(self._root_view, "请稍等,获取牌友圈中...")
|
||||||
-- local enterGroupCallBackFunc = function(code)
|
-- local enterGroupCallBackFunc = function(code)
|
||||||
-- ViewUtil.CloseModalWait()
|
-- ViewUtil.CloseModalWait2()
|
||||||
-- if code == 0 then
|
-- if code == 0 then
|
||||||
-- self.groupMainView._view.visible = true
|
-- self.groupMainView._view.visible = true
|
||||||
-- else
|
-- else
|
||||||
|
|
@ -172,6 +172,7 @@ function M:InitView(url)
|
||||||
|
|
||||||
local btn_invite = self._view:GetChild("btn_invite")
|
local btn_invite = self._view:GetChild("btn_invite")
|
||||||
btn_invite.onClick:Add(function()
|
btn_invite.onClick:Add(function()
|
||||||
|
GameApplication.Instance:CopyToClipboard(DataManager.DownLink or "暂无链接")
|
||||||
local _curren_msg = MsgWindow.new(self._root_view, "下载地址已复制,请到浏览器粘贴", MsgWindow.MsgMode.OnlyOk)
|
local _curren_msg = MsgWindow.new(self._root_view, "下载地址已复制,请到浏览器粘贴", MsgWindow.MsgMode.OnlyOk)
|
||||||
_curren_msg:Show()
|
_curren_msg:Show()
|
||||||
end)
|
end)
|
||||||
|
|
@ -181,6 +182,9 @@ function M:InitView(url)
|
||||||
printlog("load Callback")
|
printlog("load Callback")
|
||||||
self._flag_loadImageSucces = true
|
self._flag_loadImageSucces = true
|
||||||
end)
|
end)
|
||||||
|
GameApplication.Instance:GetPublicIP(function(ip)
|
||||||
|
DataManager.SelfUser.currenIp = ip
|
||||||
|
end)
|
||||||
btn_head.onClick:Set(function()
|
btn_head.onClick:Set(function()
|
||||||
-- local headView = HeadView.new(DataManager.SelfUser, nil, function()
|
-- local headView = HeadView.new(DataManager.SelfUser, nil, function()
|
||||||
-- view:GetChild("tex_name").text = DataManager.SelfUser.nick_name
|
-- view:GetChild("tex_name").text = DataManager.SelfUser.nick_name
|
||||||
|
|
@ -190,7 +194,7 @@ function M:InitView(url)
|
||||||
local lobbyPlayerInfoView = LobbyPlayerInfoView.new(DataManager.SelfUser, function()
|
local lobbyPlayerInfoView = LobbyPlayerInfoView.new(DataManager.SelfUser, function()
|
||||||
ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
|
ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
|
||||||
end)
|
end)
|
||||||
lobbyPlayerInfoView:Show()
|
-- lobbyPlayerInfoView:Show()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -276,9 +280,9 @@ function M:InitView(url)
|
||||||
-- local btn_more_group = self._view:GetChild("btn_more_group")
|
-- local btn_more_group = self._view:GetChild("btn_more_group")
|
||||||
-- btn_more_group.onClick:Set(function()
|
-- btn_more_group.onClick:Set(function()
|
||||||
-- --self.groupMainView._view.visible = true
|
-- --self.groupMainView._view.visible = true
|
||||||
-- ViewUtil.ShowModalWait(self._root_view,"请稍等,获取牌友圈中...")
|
-- ViewUtil.ShowModalWait2(self._root_view,"请稍等,获取牌友圈中...")
|
||||||
-- local enterGroupCallBackFunc=function (code)
|
-- local enterGroupCallBackFunc=function (code)
|
||||||
-- ViewUtil.CloseModalWait()
|
-- ViewUtil.CloseModalWait2()
|
||||||
-- if code==0 then
|
-- if code==0 then
|
||||||
-- self.groupMainView._view.visible = true
|
-- self.groupMainView._view.visible = true
|
||||||
-- else
|
-- else
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
local PhoneLoginView = import(".PhoneLoginView")
|
local PhoneLoginView = import(".PhoneLoginView2")
|
||||||
|
local IdPasswordLoginView = import(".IdPasswordLoginView")
|
||||||
LoginView = {}
|
LoginView = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -47,13 +48,13 @@ function M:init()
|
||||||
ViewUtil.ErrorTip(self._root_view, "请勾选同意《用户协议》")
|
ViewUtil.ErrorTip(self._root_view, "请勾选同意《用户协议》")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...")
|
ViewUtil.ShowModalWait2(self._root_view, "正在登录游戏...")
|
||||||
coroutine.start(function()
|
coroutine.start(function()
|
||||||
coroutine.wait(8)
|
coroutine.wait(8)
|
||||||
if self.isWXCallBackMark then
|
if self.isWXCallBackMark then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(10000, "微信登录失败!")
|
ViewUtil.ErrorTip(10000, "微信登录失败!")
|
||||||
end)
|
end)
|
||||||
if (not GameApplication.Instance.accountTest) then
|
if (not GameApplication.Instance.accountTest) then
|
||||||
|
|
@ -90,13 +91,26 @@ function M:init()
|
||||||
-- end)
|
-- end)
|
||||||
|
|
||||||
local btn_phone_code = view:GetChild("btn_phone_code")
|
local btn_phone_code = view:GetChild("btn_phone_code")
|
||||||
btn_phone_code.onClick:Set(function()
|
if btn_phone_code then
|
||||||
if self.agree.selectedIndex == 0 then
|
btn_phone_code.onClick:Set(function()
|
||||||
ViewUtil.ErrorTip(self._root_view, "请勾选同意《用户协议》")
|
if self.agree.selectedIndex == 0 then
|
||||||
return
|
ViewUtil.ErrorTip(self._root_view, "请勾选同意《用户协议》")
|
||||||
end
|
return
|
||||||
self:PhoneCodeLogin()
|
end
|
||||||
end)
|
self:PhoneCodeLogin()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local btn_id = view:GetChild("btn_id")
|
||||||
|
if btn_id then
|
||||||
|
btn_id.onClick:Set(function()
|
||||||
|
if self.agree.selectedIndex == 0 then
|
||||||
|
ViewUtil.ErrorTip(self._root_view, "请勾选同意《用户协议》")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self:IDLogin()
|
||||||
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:Destroy()
|
function M:Destroy()
|
||||||
|
|
@ -128,7 +142,7 @@ end
|
||||||
local function __join_room(roomid, res)
|
local function __join_room(roomid, res)
|
||||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||||
loddyctr:JoinRoom(roomid, function(res1)
|
loddyctr:JoinRoom(roomid, function(res1)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res1.ReturnCode == -2 then
|
if res1.ReturnCode == -2 then
|
||||||
__join_room(roomid, res)
|
__join_room(roomid, res)
|
||||||
elseif res1.ReturnCode == 0 then
|
elseif res1.ReturnCode == 0 then
|
||||||
|
|
@ -142,7 +156,7 @@ local function __join_room(roomid, res)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function __login_response(self, response)
|
local function __login_response(self, response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
local skey = "session_id"
|
local skey = "session_id"
|
||||||
if (response.ReturnCode == 0) then
|
if (response.ReturnCode == 0) then
|
||||||
local user = DataManager.SelfUser
|
local user = DataManager.SelfUser
|
||||||
|
|
@ -160,8 +174,8 @@ local function __login_response(self, response)
|
||||||
|
|
||||||
local roomid = user.room_id
|
local roomid = user.room_id
|
||||||
if (string.len(roomid) > 1) then
|
if (string.len(roomid) > 1) then
|
||||||
|
ViewUtil.ShowModalWait2(self._root_view, "正在加入房间...")
|
||||||
if user.group_id == 0 then
|
if user.group_id == 0 then
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在加入房间...")
|
|
||||||
__join_room(roomid, response)
|
__join_room(roomid, response)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
|
|
@ -185,6 +199,7 @@ local function __login_response(self, response)
|
||||||
end
|
end
|
||||||
self._mesList = mesl
|
self._mesList = mesl
|
||||||
DataManager.GameNotice = mesl
|
DataManager.GameNotice = mesl
|
||||||
|
DataManager.DownLink = data.share_link
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
@ -216,7 +231,7 @@ end
|
||||||
|
|
||||||
function M:PhoneCodeLogin()
|
function M:PhoneCodeLogin()
|
||||||
local _phoneCodeView = nil
|
local _phoneCodeView = nil
|
||||||
_phoneCodeView = PhoneLoginView.new(1, function(res)
|
_phoneCodeView = PhoneLoginView.new(1, self.phone, function(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
_phoneCodeView:Destroy()
|
_phoneCodeView:Destroy()
|
||||||
end
|
end
|
||||||
|
|
@ -228,7 +243,7 @@ end
|
||||||
|
|
||||||
function M:IDLogin()
|
function M:IDLogin()
|
||||||
local _idView = nil
|
local _idView = nil
|
||||||
_idView = IDLoginView.new(function(res)
|
_idView = IdPasswordLoginView.new(0, function(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
_idView:Destroy()
|
_idView:Destroy()
|
||||||
end
|
end
|
||||||
|
|
@ -240,9 +255,15 @@ end
|
||||||
function M:QuickLogin()
|
function M:QuickLogin()
|
||||||
if (not GameApplication.Instance.accountTest) then
|
if (not GameApplication.Instance.accountTest) then
|
||||||
local session_id = PlayerPrefs.GetString("session_id")
|
local session_id = PlayerPrefs.GetString("session_id")
|
||||||
|
self.phone = PlayerPrefs.GetString("session_phone")
|
||||||
-- print("session_id:" .. session_id)
|
-- print("session_id:" .. session_id)
|
||||||
if session_id and string.len(session_id) > 3 then
|
if session_id and string.len(session_id) > 3 then
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...")
|
PlayerPrefs.DeleteKey('session_phone')
|
||||||
|
PlayerPrefs.Save()
|
||||||
|
if self.phone and #self.phone > 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
ViewUtil.ShowModalWait2(self._root_view, "正在登录游戏...")
|
||||||
local loginCtr = ControllerManager.GetController(LoginController)
|
local loginCtr = ControllerManager.GetController(LoginController)
|
||||||
loginCtr:QuickLogin(session_id, function(response)
|
loginCtr:QuickLogin(session_id, function(response)
|
||||||
__login_response(self, response)
|
__login_response(self, response)
|
||||||
|
|
@ -258,10 +279,10 @@ function M:LoginCallBack(result, data)
|
||||||
--pt(data)
|
--pt(data)
|
||||||
if (not result) or result ~= 0 then
|
if (not result) or result ~= 0 then
|
||||||
if result == 10 then
|
if result == 10 then
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -279,7 +300,7 @@ function M:LoginCallBack(result, data)
|
||||||
DataManager.SelfUser.sex = sex
|
DataManager.SelfUser.sex = sex
|
||||||
DataManager.SelfUser.head_url = headurl
|
DataManager.SelfUser.head_url = headurl
|
||||||
if not DataManager.SelfUser.acc or string.len(DataManager.SelfUser.acc) < 1 then
|
if not DataManager.SelfUser.acc or string.len(DataManager.SelfUser.acc) < 1 then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -293,8 +314,9 @@ function M:LoginCallBack(result, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
--在进入前重连房间,如果有
|
--在进入前重连房间,如果有
|
||||||
function M:ReconnectRoom(groupId)
|
function M:ReconnectRoom(groupId, times)
|
||||||
local roomId = DataManager.SelfUser.room_id
|
local roomId = DataManager.SelfUser.room_id
|
||||||
|
local times = times or 0
|
||||||
print("===============================ReconnectRoom", roomId, 1)
|
print("===============================ReconnectRoom", roomId, 1)
|
||||||
if roomId and #roomId > 0 then
|
if roomId and #roomId > 0 then
|
||||||
local roomCtr = ControllerManager.GetController(RoomController)
|
local roomCtr = ControllerManager.GetController(RoomController)
|
||||||
|
|
@ -304,17 +326,24 @@ function M:ReconnectRoom(groupId)
|
||||||
false,
|
false,
|
||||||
function(response)
|
function(response)
|
||||||
if (response.ReturnCode == -1) then
|
if (response.ReturnCode == -1) then
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, 'response.ReturnCode == -1')
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, 'response.ReturnCode == -1')
|
||||||
RestartGame()
|
RestartGame()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if response.ReturnCode ~= 0 then
|
if response.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
-- if times >= 6 then
|
||||||
FamilyView.lastId = groupId
|
-- ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
||||||
ViewManager.ChangeView(ViewManager.View_Family)
|
-- FamilyView.lastId = groupId
|
||||||
|
-- ViewManager.ChangeView(ViewManager.View_Family)
|
||||||
|
-- return
|
||||||
|
-- else
|
||||||
|
self:ReconnectRoom(groupId, times + 1)
|
||||||
return
|
return
|
||||||
|
-- end
|
||||||
else
|
else
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
UIPackage.AddPackage("base/lobby/ui/Lobby")
|
UIPackage.AddPackage("base/lobby/ui/Lobby")
|
||||||
FamilyView.lastId = groupId
|
FamilyView.lastId = groupId
|
||||||
DataManager.SelfUser.room_id = ""
|
DataManager.SelfUser.room_id = ""
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ local SettingView = import('.SettingView')
|
||||||
local PlayerDistanceView = import('.PlayerDistanceView')
|
local PlayerDistanceView = import('.PlayerDistanceView')
|
||||||
local FGAssistView = import('.FGAssistView')
|
local FGAssistView = import('.FGAssistView')
|
||||||
local MissileSender = import(".MissileSender")
|
local MissileSender = import(".MissileSender")
|
||||||
|
local SharePicture = import('.SharePicture')
|
||||||
|
|
||||||
local function GetSeat(self, uId)
|
local function GetSeat(self, uId)
|
||||||
for _, player in pairs(self._room.player_list) do
|
for _, player in pairs(self._room.player_list) do
|
||||||
|
|
@ -409,10 +410,10 @@ function M:InitView(url, isHideIpAdds)
|
||||||
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
||||||
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
||||||
else
|
else
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
self._gamectr:LevelRoom(
|
self._gamectr:LevelRoom(
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||||
else
|
else
|
||||||
|
|
@ -445,10 +446,10 @@ function M:InitView(url, isHideIpAdds)
|
||||||
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
||||||
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
||||||
else
|
else
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
self._gamectr:LevelRoom(
|
self._gamectr:LevelRoom(
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||||
else
|
else
|
||||||
|
|
@ -469,7 +470,7 @@ function M:InitView(url, isHideIpAdds)
|
||||||
if IsRoomOwer() then
|
if IsRoomOwer() then
|
||||||
self._gamectr:AskDismissRoom(
|
self._gamectr:AskDismissRoom(
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
ViewManager.ChangeView(ViewManager.View_Family)
|
ViewManager.ChangeView(ViewManager.View_Family)
|
||||||
else
|
else
|
||||||
|
|
@ -571,6 +572,22 @@ function M:InitView(url, isHideIpAdds)
|
||||||
end
|
end
|
||||||
|
|
||||||
RefalshBtnClose(self)
|
RefalshBtnClose(self)
|
||||||
|
|
||||||
|
local config = ExtendManager.GetExtendConfig(_room.game_id)
|
||||||
|
local mode = config:GetGameInfo()
|
||||||
|
local gamePlay = mode:LoadConfigToDetail(json.encode(_room.room_config.config),
|
||||||
|
json.encode(_room.room_config.config.hpData))
|
||||||
|
local btn_invite = self._view:GetChild('btn_invite')
|
||||||
|
if btn_invite then
|
||||||
|
btn_invite.onClick:Set(function()
|
||||||
|
local data = {}
|
||||||
|
data.title = string.format('%s,房号:%d(%s%s局)', _room.game_info.name, _room.room_id,
|
||||||
|
_room.group_id ~= 0 and "亲友圈," or "", _room.room_config.config.hpData.maxRound)
|
||||||
|
data.description = gamePlay
|
||||||
|
data.type = 0
|
||||||
|
self:ShareAndOneChoose(data)
|
||||||
|
end)
|
||||||
|
end
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -592,10 +609,10 @@ function M:continue_game(continue)
|
||||||
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
||||||
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
||||||
else
|
else
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
self._gamectr:LevelRoom(
|
self._gamectr:LevelRoom(
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||||
else
|
else
|
||||||
|
|
@ -1495,6 +1512,13 @@ function M:GetPlayer(playId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M:ShareAndOneChoose(data)
|
||||||
|
local sharePicture = SharePicture.new(function()
|
||||||
|
ViewUtil.__share(data)
|
||||||
|
end)
|
||||||
|
sharePicture:Show()
|
||||||
|
end
|
||||||
|
|
||||||
-- 托管时关闭一些提示窗口,如起手胡、吃碰提示、海底,由扩展实现
|
-- 托管时关闭一些提示窗口,如起手胡、吃碰提示、海底,由扩展实现
|
||||||
function M:closeTipOnTuoguan()
|
function M:closeTipOnTuoguan()
|
||||||
end
|
end
|
||||||
|
|
@ -1553,7 +1577,7 @@ function M:Destroy()
|
||||||
ControllerManager.resetJionRoom = false
|
ControllerManager.resetJionRoom = false
|
||||||
self._popEvent = false
|
self._popEvent = false
|
||||||
GRoot.inst:HidePopup()
|
GRoot.inst:HidePopup()
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
GameApplication.Instance.StopMusic = 0
|
GameApplication.Instance.StopMusic = 0
|
||||||
coroutine.stopAll()
|
coroutine.stopAll()
|
||||||
UpdateBeat:Remove(self.OnUpdate, self)
|
UpdateBeat:Remove(self.OnUpdate, self)
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ local function __fillRoomItem(self, index, item, room)
|
||||||
)
|
)
|
||||||
_curren_msg.onOk:Add(
|
_curren_msg.onOk:Add(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
|
||||||
fgCtr:FG_RemoveRoom(
|
fgCtr:FG_RemoveRoom(
|
||||||
|
|
@ -316,7 +316,7 @@ local function __fillRoomItem(self, index, item, room)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!')
|
ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!')
|
||||||
return
|
return
|
||||||
|
|
@ -930,7 +930,7 @@ function M:InitView(url)
|
||||||
-- local delroomid
|
-- local delroomid
|
||||||
-- delroomid = (texroomid.text) or 0
|
-- delroomid = (texroomid.text) or 0
|
||||||
-- if texroomid.text == "" then
|
-- if texroomid.text == "" then
|
||||||
-- ViewUtil.CloseModalWait()
|
-- ViewUtil.CloseModalWait2()
|
||||||
-- ViewUtil.ErrorTip(nil, '输入不能为空')
|
-- ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
|
|
@ -943,7 +943,7 @@ function M:InitView(url)
|
||||||
-- _curren_msg.onOk:Add(
|
-- _curren_msg.onOk:Add(
|
||||||
-- function()
|
-- function()
|
||||||
|
|
||||||
-- ViewUtil.ShowModalWait(self._root_view)
|
-- ViewUtil.ShowModalWait2(self._root_view)
|
||||||
-- local fgCtr = ControllerManager.GetController(NewGroupController)
|
-- local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
-- fgCtr:FG_RemoveRoom(
|
-- fgCtr:FG_RemoveRoom(
|
||||||
-- self.curGroup.id,
|
-- self.curGroup.id,
|
||||||
|
|
@ -952,7 +952,7 @@ function M:InitView(url)
|
||||||
-- if self._is_destroy then
|
-- if self._is_destroy then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
-- ViewUtil.CloseModalWait()
|
-- ViewUtil.CloseModalWait2()
|
||||||
-- if res.ReturnCode ~= 0 then
|
-- if res.ReturnCode ~= 0 then
|
||||||
-- ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!')
|
-- ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!')
|
||||||
-- return
|
-- return
|
||||||
|
|
@ -1313,7 +1313,7 @@ function M:__onUpdate()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:__joinRoom(room_id)
|
function M:__joinRoom(room_id)
|
||||||
ViewUtil.ShowModalWait(self._root_view, '正在加入游戏...', 'join_room')
|
ViewUtil.ShowModalWait2(self._root_view, '正在加入游戏...', 'join_room')
|
||||||
local roomCtr = ControllerManager.GetController(RoomController)
|
local roomCtr = ControllerManager.GetController(RoomController)
|
||||||
local _gameCtrl = ControllerManager.GetController(GameController)
|
local _gameCtrl = ControllerManager.GetController(GameController)
|
||||||
local _currentCtrl = ControllerManager.GetCurrenController()
|
local _currentCtrl = ControllerManager.GetCurrenController()
|
||||||
|
|
@ -1327,7 +1327,7 @@ function M:__joinRoom(room_id)
|
||||||
false,
|
false,
|
||||||
function(response)
|
function(response)
|
||||||
if (response.ReturnCode == -1) then
|
if (response.ReturnCode == -1) then
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
RestartGame()
|
RestartGame()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -1336,7 +1336,7 @@ function M:__joinRoom(room_id)
|
||||||
self:__joinRoom(room_id)
|
self:__joinRoom(room_id)
|
||||||
return
|
return
|
||||||
elseif response.ReturnCode ~= 0 then
|
elseif response.ReturnCode ~= 0 then
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -1346,7 +1346,7 @@ function M:__joinRoom(room_id)
|
||||||
self._view.visible = false
|
self._view.visible = false
|
||||||
ImageLoad.Clear(self.class)
|
ImageLoad.Clear(self.class)
|
||||||
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
timer = 0
|
timer = 0
|
||||||
end,
|
end,
|
||||||
self.curGroup.id
|
self.curGroup.id
|
||||||
|
|
@ -1364,7 +1364,7 @@ function M:__joinRoom(room_id)
|
||||||
printlog("进入房间返回事件==========》》》")
|
printlog("进入房间返回事件==========》》》")
|
||||||
pt(response)
|
pt(response)
|
||||||
if (response.ReturnCode == -1) then
|
if (response.ReturnCode == -1) then
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
RestartGame()
|
RestartGame()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -1373,7 +1373,7 @@ function M:__joinRoom(room_id)
|
||||||
self:__joinRoom(room_id)
|
self:__joinRoom(room_id)
|
||||||
return
|
return
|
||||||
elseif response.ReturnCode ~= 0 then
|
elseif response.ReturnCode ~= 0 then
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -1383,7 +1383,7 @@ function M:__joinRoom(room_id)
|
||||||
self._view.visible = false
|
self._view.visible = false
|
||||||
ImageLoad.Clear(self.class)
|
ImageLoad.Clear(self.class)
|
||||||
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
timer = 0
|
timer = 0
|
||||||
end,
|
end,
|
||||||
self.curGroup.id
|
self.curGroup.id
|
||||||
|
|
@ -1407,7 +1407,7 @@ function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if isHidden == 1 then
|
if isHidden == 1 then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if not DataManager.SelfUser.location then
|
if not DataManager.SelfUser.location then
|
||||||
DataManager.SelfUser.location = Location.new()
|
DataManager.SelfUser.location = Location.new()
|
||||||
end
|
end
|
||||||
|
|
@ -1433,7 +1433,7 @@ function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback)
|
||||||
function(response)
|
function(response)
|
||||||
if (response.ReturnCode == -1) then
|
if (response.ReturnCode == -1) then
|
||||||
self._view:GetController('pipei').selectedIndex = 0
|
self._view:GetController('pipei').selectedIndex = 0
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
RestartGame()
|
RestartGame()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -1454,7 +1454,7 @@ function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback)
|
||||||
-- ImageLoad.Clear(self.class)
|
-- ImageLoad.Clear(self.class)
|
||||||
-- ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
-- ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
||||||
-- callback(response.ReturnCode)
|
-- callback(response.ReturnCode)
|
||||||
-- ViewUtil.CloseModalWait('join_room')
|
-- ViewUtil.CloseModalWait2('join_room')
|
||||||
-- timer = 0
|
-- timer = 0
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
@ -1473,7 +1473,7 @@ function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback)
|
||||||
is_null,
|
is_null,
|
||||||
function(response)
|
function(response)
|
||||||
if (response.ReturnCode == -1) then
|
if (response.ReturnCode == -1) then
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
RestartGame()
|
RestartGame()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -1490,7 +1490,7 @@ function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback)
|
||||||
ImageLoad.Clear(self.class)
|
ImageLoad.Clear(self.class)
|
||||||
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
||||||
callback(response.ReturnCode)
|
callback(response.ReturnCode)
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
timer = 0
|
timer = 0
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
@ -1705,7 +1705,7 @@ function M:__loadGroupData()
|
||||||
curGroup.update_room = false
|
curGroup.update_room = false
|
||||||
curGroup.update_info = false
|
curGroup.update_info = false
|
||||||
curGroup.update_joins = false
|
curGroup.update_joins = false
|
||||||
ViewUtil.ShowModalWait(self._root_view, "正在进入牌友圈,请稍等...")
|
ViewUtil.ShowModalWait2(self._root_view, "正在进入牌友圈,请稍等...")
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_EnterGroup(
|
fgCtr:FG_EnterGroup(
|
||||||
curGroup.id,
|
curGroup.id,
|
||||||
|
|
@ -1713,7 +1713,7 @@ function M:__loadGroupData()
|
||||||
-- if self._is_destroy then
|
-- if self._is_destroy then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
--self._view.visible=false
|
--self._view.visible=false
|
||||||
--ViewUtil.ErrorTip(res.ReturnCode, "获取圈子数据失败")
|
--ViewUtil.ErrorTip(res.ReturnCode, "获取圈子数据失败")
|
||||||
|
|
@ -1863,7 +1863,7 @@ end
|
||||||
|
|
||||||
-- 匹配游戏
|
-- 匹配游戏
|
||||||
function M:__startGame(roomid, pid, is_null, isHidden, callback)
|
function M:__startGame(roomid, pid, is_null, isHidden, callback)
|
||||||
ViewUtil.ShowModalWait(self._root_view, '正在加入游戏...', 'join_room')
|
ViewUtil.ShowModalWait2(self._root_view, '正在加入游戏...', 'join_room')
|
||||||
local _gameCtrl = ControllerManager.GetController(GameController)
|
local _gameCtrl = ControllerManager.GetController(GameController)
|
||||||
local _currentCtrl = ControllerManager.GetCurrenController()
|
local _currentCtrl = ControllerManager.GetCurrenController()
|
||||||
if _gameCtrl == _currentCtrl then
|
if _gameCtrl == _currentCtrl then
|
||||||
|
|
@ -1879,7 +1879,7 @@ function M:__startGame(roomid, pid, is_null, isHidden, callback)
|
||||||
self:__startGame(roomid, pid, is_null, isHidden, callback)
|
self:__startGame(roomid, pid, is_null, isHidden, callback)
|
||||||
elseif code ~= 0 then
|
elseif code ~= 0 then
|
||||||
ViewUtil.ErrorMsg(self._root_view, code, '进入房间失败')
|
ViewUtil.ErrorMsg(self._root_view, code, '进入房间失败')
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
end
|
end
|
||||||
if callback then
|
if callback then
|
||||||
callback()
|
callback()
|
||||||
|
|
@ -1900,7 +1900,7 @@ function M:__startGame(roomid, pid, is_null, isHidden, callback)
|
||||||
self:__startGame(roomid, pid, is_null, isHidden, callback)
|
self:__startGame(roomid, pid, is_null, isHidden, callback)
|
||||||
elseif code ~= 0 then
|
elseif code ~= 0 then
|
||||||
ViewUtil.ErrorMsg(self._root_view, code, '进入房间失败')
|
ViewUtil.ErrorMsg(self._root_view, code, '进入房间失败')
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait2('join_room')
|
||||||
end
|
end
|
||||||
if callback then
|
if callback then
|
||||||
callback()
|
callback()
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ local GroupJoinsView = {}
|
||||||
local M = GroupJoinsView
|
local M = GroupJoinsView
|
||||||
|
|
||||||
function GroupJoinsView.new(blur_view)
|
function GroupJoinsView.new(blur_view)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupJoinsView"
|
self.class = "GroupJoinsView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self._blur_view = blur_view
|
self._blur_view = blur_view
|
||||||
|
|
@ -17,32 +17,32 @@ function GroupJoinsView.new(blur_view)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
local function __fillJoins(self,curGroup,joins)
|
local function __fillJoins(self, curGroup, joins)
|
||||||
local lst_joins = self._view:GetChild("lst_joins")
|
local lst_joins = self._view:GetChild("lst_joins")
|
||||||
lst_joins:RemoveChildrenToPool()
|
lst_joins:RemoveChildrenToPool()
|
||||||
local fgCtr = ControllerManager.GetController(FriendGroupController)
|
local fgCtr = ControllerManager.GetController(FriendGroupController)
|
||||||
|
|
||||||
for i=1,#joins do
|
for i = 1, #joins do
|
||||||
local rdata = joins[i]
|
local rdata = joins[i]
|
||||||
local item = lst_joins:AddItemFromPool()
|
local item = lst_joins:AddItemFromPool()
|
||||||
item:GetChild("tex_name").text = rdata.nick
|
item:GetChild("tex_name").text = rdata.nick
|
||||||
item:GetChild("tex_id").text = "ID:"..rdata.id
|
item:GetChild("tex_id").text = "ID:" .. rdata.id
|
||||||
local btn_yes = item:GetChild("btn_yes")
|
local btn_yes = item:GetChild("btn_yes")
|
||||||
btn_yes.data = rdata
|
btn_yes.data = rdata
|
||||||
btn_yes.onClick:Set(function(context)
|
btn_yes.onClick:Set(function(context)
|
||||||
local _rd = context.sender.data
|
local _rd = context.sender.data
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
fgCtr:FG_GroupVerifyJoin(curGroup.id,_rd.id,true,function(res1)
|
fgCtr:FG_GroupVerifyJoin(curGroup.id, _rd.id, true, function(res1)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res1.ReturnCode == 0 then
|
if res1.ReturnCode == 0 then
|
||||||
curGroup.joins = #res1.Data.joins
|
curGroup.joins = #res1.Data.joins
|
||||||
self.change = true
|
self.change = true
|
||||||
__fillJoins(self,curGroup,res1.Data.joins)
|
__fillJoins(self, curGroup, res1.Data.joins)
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode,"邀请失败!")
|
ViewUtil.ErrorTip(res.ReturnCode, "邀请失败!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
@ -50,18 +50,18 @@ local function __fillJoins(self,curGroup,joins)
|
||||||
btn_del.data = rdata
|
btn_del.data = rdata
|
||||||
btn_del.onClick:Set(function(context)
|
btn_del.onClick:Set(function(context)
|
||||||
local _rd = context.sender.data
|
local _rd = context.sender.data
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
fgCtr:FG_GroupVerifyJoin(curGroup.id,_rd.id,false,function(res1)
|
fgCtr:FG_GroupVerifyJoin(curGroup.id, _rd.id, false, function(res1)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res1.ReturnCode == 0 then
|
if res1.ReturnCode == 0 then
|
||||||
curGroup.joins = #res1.Data.joins
|
curGroup.joins = #res1.Data.joins
|
||||||
self.change = true
|
self.change = true
|
||||||
__fillJoins(self,curGroup,res1.Data.joins)
|
__fillJoins(self, curGroup, res1.Data.joins)
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode,"邀请失败!")
|
ViewUtil.ErrorTip(res.ReturnCode, "邀请失败!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
@ -75,14 +75,14 @@ function M:FillData(curGroup)
|
||||||
lst_joins:RemoveChildrenToPool()
|
lst_joins:RemoveChildrenToPool()
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(FriendGroupController)
|
local fgCtr = ControllerManager.GetController(FriendGroupController)
|
||||||
fgCtr:FG_GroupJoins(curGroup.id,function( res)
|
fgCtr:FG_GroupJoins(curGroup.id, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if (res.ReturnCode == 0) then
|
if (res.ReturnCode == 0) then
|
||||||
__fillJoins(self,curGroup,res.Data.joins)
|
__fillJoins(self, curGroup, res.Data.joins)
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode,"获取邀请列表失败!")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取邀请列表失败!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -91,13 +91,12 @@ function M:SetCallback(callback)
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 销毁窗口
|
-- 销毁窗口
|
||||||
function M:Destroy(remove_map)
|
function M:Destroy(remove_map)
|
||||||
if self.change and self.callback then
|
if self.change and self.callback then
|
||||||
self.callback()
|
self.callback()
|
||||||
end
|
end
|
||||||
BaseWindow.Destroy(self,remove_map)
|
BaseWindow.Destroy(self, remove_map)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ local GroupMailView = {}
|
||||||
local M = GroupMailView
|
local M = GroupMailView
|
||||||
|
|
||||||
function GroupMailView.new(blur_view, curGroup)
|
function GroupMailView.new(blur_view, curGroup)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupMailView"
|
self.class = "GroupMailView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self._blur_view = blur_view
|
self._blur_view = blur_view
|
||||||
|
|
@ -17,13 +17,13 @@ function GroupMailView.new(blur_view, curGroup)
|
||||||
self:init("ui://NewGroup/Win_Mail")
|
self:init("ui://NewGroup/Win_Mail")
|
||||||
self:FillView()
|
self:FillView()
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillView()
|
function M:FillView()
|
||||||
self.lst_mail = self._view:GetChild("lst_mail")
|
self.lst_mail = self._view:GetChild("lst_mail")
|
||||||
self.lst_mail:SetVirtual()
|
self.lst_mail:SetVirtual()
|
||||||
self.lst_mail.itemRenderer = function(index, obj)
|
self.lst_mail.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_mail.scrollPane.onPullUpRelease:Set(function()
|
self.lst_mail.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetMailData(#self.mail_data)
|
self:GetMailData(#self.mail_data)
|
||||||
|
|
@ -33,7 +33,7 @@ function M:FillView()
|
||||||
local btn_delete = self._view:GetChild("btn_delete")
|
local btn_delete = self._view:GetChild("btn_delete")
|
||||||
btn_delete.onClick:Set(function()
|
btn_delete.onClick:Set(function()
|
||||||
local msg_tip = MsgWindow.new(self._root_view, "确定要删除所有邮件吗?", MsgWindow.MsgMode.OkAndCancel)
|
local msg_tip = MsgWindow.new(self._root_view, "确定要删除所有邮件吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||||
msg_tip.onOk:Add(function()
|
msg_tip.onOk:Add(function()
|
||||||
self:DelAllMail()
|
self:DelAllMail()
|
||||||
end)
|
end)
|
||||||
msg_tip:Show()
|
msg_tip:Show()
|
||||||
|
|
@ -41,67 +41,68 @@ function M:FillView()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetMailData(index)
|
function M:GetMailData(index)
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMailList(self.curGroup.id, DataManager.SelfUser.account_id, index, 20, function(res)
|
fgCtr:FG_GetMailList(self.curGroup.id, DataManager.SelfUser.account_id, index, 20, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
if #res.Data.mail_list > 0 then
|
if #res.Data.mail_list > 0 then
|
||||||
list_concat(self.mail_data, res.Data.mail_list)
|
list_concat(self.mail_data, res.Data.mail_list)
|
||||||
self.lst_mail.numItems = #self.mail_data
|
self.lst_mail.numItems = #self.mail_data
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取邮件列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取邮件列表失败")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:DelAllMail()
|
function M:DelAllMail()
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_DelAllMail(self.curGroup.id, DataManager.SelfUser.account_id, function(res)
|
fgCtr:FG_DelAllMail(self.curGroup.id, DataManager.SelfUser.account_id, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
self.mail_data = {}
|
self.mail_data = {}
|
||||||
self.lst_mail.numItems = 0
|
self.lst_mail.numItems = 0
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "删除邮件失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "删除邮件失败")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local tex_title = obj:GetChild("tex_title")
|
local tex_title = obj:GetChild("tex_title")
|
||||||
local tex_content = obj:GetChild("tex_content")
|
local tex_content = obj:GetChild("tex_content")
|
||||||
local data = json.decode(self.mail_data[index + 1])
|
local data = json.decode(self.mail_data[index + 1])
|
||||||
ImageLoad.Load(data.headurl, obj:GetChild("btn_head")._iconObject, self.class)
|
ImageLoad.Load(data.headurl, obj:GetChild("btn_head")._iconObject, self.class)
|
||||||
local nick = data.nick
|
local nick = data.nick
|
||||||
local id = data.mgr_id
|
local id = data.mgr_id
|
||||||
local hp = d2ad(data.hp)
|
local hp = d2ad(data.hp)
|
||||||
if data.type == 1 then
|
if data.type == 1 then
|
||||||
local str_lev = data.lev == 3 and "合伙人" or "管理员"
|
local str_lev = data.lev == 3 and "合伙人" or "管理员"
|
||||||
local act = hp >= 0 and "给您增加了" or "扣除了您"
|
local act = hp >= 0 and "给您增加了" or "扣除了您"
|
||||||
tex_title.text = "消息内容为:"--string.format("%s(%s) %s%s积分", nick, id, act, math.abs(hp))
|
tex_title.text = "消息内容为:" --string.format("%s(%s) %s%s积分", nick, id, act, math.abs(hp))
|
||||||
tex_content.text = string.format("%s [color=#08a446]%s[/color](%s) %s[color=#08a446] %s [/color]积分", str_lev, nick, id, act, math.abs(hp))
|
tex_content.text = string.format("%s [color=#08a446]%s[/color](%s) %s[color=#08a446] %s [/color]积分", str_lev,
|
||||||
else
|
nick, id, act, math.abs(hp))
|
||||||
tex_title.text = "消息内容为:"--string.format("%s(%s) 转账给您%s积分", nick, id, math.abs(hp))
|
else
|
||||||
tex_content.text = string.format("[color=#08a446]%s[/color](%s) 转账给您[color=#08a446] %s [/color]积分", nick, id, math.abs(hp))
|
tex_title.text = "消息内容为:" --string.format("%s(%s) 转账给您%s积分", nick, id, math.abs(hp))
|
||||||
end
|
tex_content.text = string.format("[color=#08a446]%s[/color](%s) 转账给您[color=#08a446] %s [/color]积分", nick, id,
|
||||||
obj:GetChild("tex_data").text = os.date("%Y-%m-%d %H:%M", data.time)
|
math.abs(hp))
|
||||||
|
end
|
||||||
|
obj:GetChild("tex_data").text = os.date("%Y-%m-%d %H:%M", data.time)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:SetCallback(callback)
|
function M:SetCallback(callback)
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 销毁窗口
|
-- 销毁窗口
|
||||||
function M:Destroy(remove_map)
|
function M:Destroy(remove_map)
|
||||||
if self.callback then
|
if self.callback then
|
||||||
self.callback()
|
self.callback()
|
||||||
end
|
end
|
||||||
BaseWindow.Destroy(self,remove_map)
|
BaseWindow.Destroy(self, remove_map)
|
||||||
ImageLoad.Clear(self.class)
|
ImageLoad.Clear(self.class)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,9 @@ function M:InitView(url)
|
||||||
local cgv = CreateGroupView.new(self._root_view)
|
local cgv = CreateGroupView.new(self._root_view)
|
||||||
cgv:Show()
|
cgv:Show()
|
||||||
cgv:SetCallback(function(name, pay_type, fg_type)
|
cgv:SetCallback(function(name, pay_type, fg_type)
|
||||||
ViewUtil.ShowModalWait(cgv._root_view)
|
ViewUtil.ShowModalWait2(cgv._root_view)
|
||||||
fgCtr:FG_CreateGroup(name, pay_type, fg_type, function(res)
|
fgCtr:FG_CreateGroup(name, pay_type, fg_type, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -93,9 +93,9 @@ function M:InitView(url)
|
||||||
|
|
||||||
local btn_refresh = self._view:GetChild('btn_refresh')
|
local btn_refresh = self._view:GetChild('btn_refresh')
|
||||||
btn_refresh.onClick:Set(function()
|
btn_refresh.onClick:Set(function()
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
fgCtr:FG_GroupList(function(res)
|
fgCtr:FG_GroupList(function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -239,9 +239,9 @@ function M:FillData()
|
||||||
btn_top.onClick:Set(function(context)
|
btn_top.onClick:Set(function(context)
|
||||||
context:StopPropagation()
|
context:StopPropagation()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
fgCtr:FG_TopGroup(group.id, ctr_select.selectedIndex == 0, function(res)
|
fgCtr:FG_TopGroup(group.id, ctr_select.selectedIndex == 0, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
-- 能量包
|
-- 能量包
|
||||||
local GroupTakeLogView = import(".MngView.GroupTakeLogView")
|
local GroupTakeLogView = import(".MngView.GroupTakeLogView")
|
||||||
local GroupRewardsLogView = import(".MngView.GroupRewardsLogView")
|
local GroupRewardsLogView = import(".MngView.GroupRewardsLogView")
|
||||||
local GroupNumberInputView = import(".MngView.GroupNumberInputView")
|
local GroupNumberInputView = import(".MngView.GroupNumberInputView")
|
||||||
|
|
@ -8,49 +8,48 @@ local GroupMngFagPackView = {}
|
||||||
|
|
||||||
local M = GroupMngFagPackView
|
local M = GroupMngFagPackView
|
||||||
|
|
||||||
function GroupMngFagPackView.new(gid, blur_view,ctrNum,uid)
|
function GroupMngFagPackView.new(gid, blur_view, ctrNum, uid)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
|
|
||||||
self.class = "GroupMngFagPackView"
|
self.class = "GroupMngFagPackView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self.group_id = gid
|
self.group_id = gid
|
||||||
self.blur_view = blur_view
|
self.blur_view = blur_view
|
||||||
self.ctrNum=ctrNum
|
self.ctrNum = ctrNum
|
||||||
self.shouyiData = {}
|
self.shouyiData = {}
|
||||||
self.uid = uid
|
self.uid = uid
|
||||||
self:init("ui://NewGroup/Win_bxx")
|
self:init("ui://NewGroup/Win_bxx")
|
||||||
self:FillView()
|
self:FillView()
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillView()
|
function M:FillView()
|
||||||
|
self.Ctr = self._view:GetController("ctr")
|
||||||
self.Ctr=self._view:GetController("ctr")
|
self.Ctr.selectedIndex = 1
|
||||||
self.Ctr.selectedIndex=1
|
|
||||||
|
|
||||||
self.lst_bxx = self._view:GetChild('bxx_list')
|
self.lst_bxx = self._view:GetChild('bxx_list')
|
||||||
self.lst_bxx:SetVirtual()
|
self.lst_bxx:SetVirtual()
|
||||||
self.lst_bxx.itemRenderer = function(index, item)
|
self.lst_bxx.itemRenderer = function(index, item)
|
||||||
self:fillGameItem(index, item)
|
self:fillGameItem(index, item)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
self.lst_bxx.onClickItem:Add(
|
self.lst_bxx.onClickItem:Add(
|
||||||
function(pas)
|
function(pas)
|
||||||
if self.currentSelectItem == pas.data then return end
|
if self.currentSelectItem == pas.data then return end
|
||||||
local name=pas.data.icon
|
local name = pas.data.icon
|
||||||
self.currentGameItemName=name
|
self.currentGameItemName = name
|
||||||
self.lst_bxx.numItems=self.ctrNum
|
self.lst_bxx.numItems = self.ctrNum
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
self.playerJF=self._view:GetChild('tex_player')
|
self.playerJF = self._view:GetChild('tex_player')
|
||||||
self.bankJF=self._view:GetChild('tex_bank')
|
self.bankJF = self._view:GetChild('tex_bank')
|
||||||
|
|
||||||
self.ctr_page = self._view:GetController("type")
|
self.ctr_page = self._view:GetController("type")
|
||||||
self.ctr_page.onChanged:Set(function()
|
self.ctr_page.onChanged:Set(function()
|
||||||
if self.ctr_page.selectedIndex == 0 then
|
if self.ctr_page.selectedIndex == 0 then
|
||||||
if self.shouyiData.day_rewad then
|
if self.shouyiData.day_rewad then
|
||||||
self._view:GetChild("tex_total").text = d2ad(self.shouyiData.day_rewad)
|
self._view:GetChild("tex_total").text = d2ad(self.shouyiData.day_rewad)
|
||||||
|
|
@ -64,228 +63,195 @@ function M:FillView()
|
||||||
self._view:GetChild("tex_total").text = d2ad(self.shouyiData.day_rewad_2)
|
self._view:GetChild("tex_total").text = d2ad(self.shouyiData.day_rewad_2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self._view:GetChild("btn_bankinfo").onClick:Set(function()
|
self._view:GetChild("btn_bankinfo").onClick:Set(function()
|
||||||
local gtlv = GroupBankLogView.new(self.blur_view, self.group_id,self.uid)
|
local gtlv = GroupBankLogView.new(self.blur_view, self.group_id, self.uid)
|
||||||
gtlv:Show()
|
gtlv:Show()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local btn_cr = self._view:GetChild('btn_qd')
|
local btn_cr = self._view:GetChild('btn_qd')
|
||||||
btn_cr.onClick:Set(
|
btn_cr.onClick:Set(
|
||||||
function()
|
function()
|
||||||
|
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
local value = limit
|
||||||
|
if otype == 1 then
|
||||||
local value = limit
|
value = value + ad2d(num)
|
||||||
if otype == 1 then
|
elseif otype == -1 then
|
||||||
value = value + ad2d(num)
|
value = value - ad2d(num)
|
||||||
elseif otype == - 1 then
|
else
|
||||||
value = value - ad2d(num)
|
value = ad2d(num)
|
||||||
else
|
end
|
||||||
value = ad2d(num)
|
|
||||||
end
|
if value < 0 then
|
||||||
|
ViewUtil.ErrorTip(1, "输入数据异常!")
|
||||||
if value < 0 then
|
end
|
||||||
ViewUtil.ErrorTip(1,"输入数据异常!")
|
|
||||||
end
|
ViewUtil.ShowModalWait2()
|
||||||
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
fgCtr:FG_SAVEBankInfo(self.group_id, value, self.uid, function(res1)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
ViewUtil.CloseModalWait2()
|
||||||
fgCtr:FG_SAVEBankInfo(self.group_id, value,self.uid ,function(res1)
|
pt(res1)
|
||||||
ViewUtil.CloseModalWait()
|
if (res1.ReturnCode == 0) then
|
||||||
pt(res1)
|
self:SetBank(res1.Data.hp, res1.Data.b_hp)
|
||||||
if (res1.ReturnCode == 0) then
|
ViewUtil.ErrorTip(100011000, "积分存取成功!")
|
||||||
self:SetBank(res1.Data.hp,res1.Data.b_hp)
|
else
|
||||||
ViewUtil.ErrorTip(100011000,"积分存取成功!")
|
ViewUtil.ErrorTip(res1.ReturnCode, "存取积分失败!")
|
||||||
else
|
end
|
||||||
ViewUtil.ErrorTip(res1.ReturnCode,"存取积分失败!")
|
end)
|
||||||
end
|
end, 0, nil)
|
||||||
end)
|
gniv:Show()
|
||||||
|
end
|
||||||
end, 0, nil)
|
)
|
||||||
gniv:Show()
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
local btn_qc = self._view:GetChild('btn_qc')
|
local btn_qc = self._view:GetChild('btn_qc')
|
||||||
btn_qc.onClick:Set(
|
btn_qc.onClick:Set(
|
||||||
function()
|
function()
|
||||||
|
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
local value = limit
|
||||||
|
if otype == 1 then
|
||||||
local value = limit
|
value = value + ad2d(num)
|
||||||
if otype == 1 then
|
elseif otype == -1 then
|
||||||
value = value + ad2d(num)
|
value = value - ad2d(num)
|
||||||
elseif otype == - 1 then
|
else
|
||||||
value = value - ad2d(num)
|
value = ad2d(num)
|
||||||
else
|
end
|
||||||
value = ad2d(num)
|
|
||||||
end
|
if value < 0 then
|
||||||
|
ViewUtil.ErrorTip(1, "输入数据异常!")
|
||||||
if value < 0 then
|
end
|
||||||
ViewUtil.ErrorTip(1,"输入数据异常!")
|
|
||||||
end
|
ViewUtil.ShowModalWait2()
|
||||||
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
fgCtr:FG_TakeBankInfo(self.group_id, value, self.uid, function(res1)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
ViewUtil.CloseModalWait2()
|
||||||
fgCtr:FG_TakeBankInfo(self.group_id, value,self.uid, function(res1)
|
pt(res1)
|
||||||
ViewUtil.CloseModalWait()
|
if (res1.ReturnCode == 0) then
|
||||||
pt(res1)
|
self:SetBank(res1.Data.hp, res1.Data.b_hp)
|
||||||
if (res1.ReturnCode == 0) then
|
ViewUtil.ErrorTip(100011000, "积分取出成功!")
|
||||||
self:SetBank(res1.Data.hp,res1.Data.b_hp)
|
else
|
||||||
ViewUtil.ErrorTip(100011000,"积分取出成功!")
|
ViewUtil.ErrorTip(res1.ReturnCode, "获取积分失败!")
|
||||||
else
|
end
|
||||||
ViewUtil.ErrorTip(res1.ReturnCode,"获取积分失败!")
|
end)
|
||||||
end
|
end, 0, nil)
|
||||||
end)
|
gniv:Show()
|
||||||
|
end
|
||||||
end, 0, nil)
|
)
|
||||||
gniv:Show()
|
|
||||||
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
self._view:GetChild("btn_take_log").onClick:Set(function()
|
self._view:GetChild("btn_take_log").onClick:Set(function()
|
||||||
local gtlv = GroupTakeLogView.new(self.blur_view, self.group_id,self.uid)
|
local gtlv = GroupTakeLogView.new(self.blur_view, self.group_id, self.uid)
|
||||||
gtlv:Show()
|
gtlv:Show()
|
||||||
end)
|
end)
|
||||||
self._view:GetChild("btn_hp_info").onClick:Set(function()
|
self._view:GetChild("btn_hp_info").onClick:Set(function()
|
||||||
local grlv = GroupRewardsLogView.new(self.blur_view, self.group_id,self.uid)
|
local grlv = GroupRewardsLogView.new(self.blur_view, self.group_id, self.uid)
|
||||||
grlv:Show()
|
grlv:Show()
|
||||||
end)
|
end)
|
||||||
self._view:GetChild("btn_take").onClick:Set(function()
|
self._view:GetChild("btn_take").onClick:Set(function()
|
||||||
local gniv = GroupNumberInputView.new(self.blur_view, function(num)
|
local gniv = GroupNumberInputView.new(self.blur_view, function(num)
|
||||||
if ad2d(num) > self._total_hp then
|
if ad2d(num) > self._total_hp then
|
||||||
ViewUtil.ErrorTip(nil, "奖励池积分不足")
|
ViewUtil.ErrorTip(nil, "奖励池积分不足")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_TakeHp(self.group_id, ad2d(num), self.uid,function(res)
|
fgCtr:FG_TakeHp(self.group_id, ad2d(num), self.uid, function(res)
|
||||||
if num == 0 then
|
if num == 0 then
|
||||||
ViewUtil.ErrorTip(nil, "提取值必须大于0")
|
ViewUtil.ErrorTip(nil, "提取值必须大于0")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "提取能量包失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "提取能量包失败")
|
||||||
else
|
else
|
||||||
self._total_hp = res.Data.r_hp
|
self._total_hp = res.Data.r_hp
|
||||||
self._view:GetChild("tex_left").text = d2ad(self._total_hp)
|
self._view:GetChild("tex_left").text = d2ad(self._total_hp)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end, 1, d2ad(self._total_hp), "ui://NewGroup/Win_TakeHp")
|
end, 1, d2ad(self._total_hp), "ui://NewGroup/Win_TakeHp")
|
||||||
gniv:Show()
|
gniv:Show()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--self:initBankData()
|
--self:initBankData()
|
||||||
self:initShouyiData()
|
self:initShouyiData()
|
||||||
self.lst_bxx.numItems=self.ctrNum
|
self.lst_bxx.numItems = self.ctrNum
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function M:initBankData()
|
function M:initBankData()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetBankInfo(self.group_id, self.uid,function(res)
|
fgCtr:FG_GetBankInfo(self.group_id, self.uid, function(res)
|
||||||
pt(res)
|
pt(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取银行数据失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取银行数据失败")
|
||||||
else
|
else
|
||||||
self:SetBank(res.Data.total_hp,res.Data.bank_hp)
|
self:SetBank(res.Data.total_hp, res.Data.bank_hp)
|
||||||
self.Ctr.selectedIndex=0
|
self.Ctr.selectedIndex = 0
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function M:initShouyiData()
|
function M:initShouyiData()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
self.shouyiData = {}
|
self.shouyiData = {}
|
||||||
self._view:GetChild("tex_total").text = 0
|
self._view:GetChild("tex_total").text = 0
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetTakeInfo(self.group_id,self.uid ,function(res)
|
fgCtr:FG_GetTakeInfo(self.group_id, self.uid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取保险箱数据失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取保险箱数据失败")
|
||||||
else
|
else
|
||||||
local data = res.Data
|
local data = res.Data
|
||||||
self.ctr_page.selectedIndex = 0
|
self.ctr_page.selectedIndex = 0
|
||||||
self.shouyiData = data
|
self.shouyiData = data
|
||||||
self._view:GetChild("tex_left").text = d2ad(data.total_hp)
|
self._view:GetChild("tex_left").text = d2ad(data.total_hp)
|
||||||
self._view:GetChild("tex_total").text = d2ad(data.day_rewad)
|
self._view:GetChild("tex_total").text = d2ad(data.day_rewad)
|
||||||
--self._view:GetChild("tex_totalshouyi").text = 0
|
--self._view:GetChild("tex_totalshouyi").text = 0
|
||||||
self._total_hp = data.total_hp
|
self._total_hp = data.total_hp
|
||||||
self.Ctr.selectedIndex=1
|
self.Ctr.selectedIndex = 1
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:SetCallback(callback)
|
function M:SetCallback(callback)
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M:SetBank(totalHp, bankHp)
|
||||||
function M:SetBank(totalHp,bankHp)
|
self.playerJF.text = totalHp / 1000
|
||||||
self.playerJF.text=totalHp/1000
|
self.bankJF.text = bankHp / 1000
|
||||||
self.bankJF.text=bankHp/1000
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function M:fillGameItem(index, item)
|
function M:fillGameItem(index, item)
|
||||||
if index~=0 then
|
if index ~= 0 then
|
||||||
item.icon="ui://NewGroup/button_cqg"
|
item.icon = "ui://NewGroup/button_cqg"
|
||||||
if self.currentGameItemName==nil then
|
if self.currentGameItemName == nil then
|
||||||
item.icon="ui://NewGroup/button_cqg_xz"
|
item.icon = "ui://NewGroup/button_cqg_xz"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
item.icon="ui://NewGroup/button_sjjl"
|
item.icon = "ui://NewGroup/button_sjjl"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if self.currentGameItemName==item.icon then
|
if self.currentGameItemName == item.icon then
|
||||||
item.icon=item.icon.."_xz"
|
item.icon = item.icon .. "_xz"
|
||||||
if index~=0 then
|
if index ~= 0 then
|
||||||
self:initBankData()
|
self:initBankData()
|
||||||
else
|
else
|
||||||
self:initShouyiData()
|
self:initShouyiData()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 销毁窗口
|
-- 销毁窗口
|
||||||
function M:Destroy(remove_map)
|
function M:Destroy(remove_map)
|
||||||
if self.callback then
|
if self.callback then
|
||||||
self.callback()
|
self.callback()
|
||||||
end
|
end
|
||||||
BaseWindow.Destroy(self,remove_map)
|
BaseWindow.Destroy(self, remove_map)
|
||||||
ImageLoad.Clear(self.class)
|
ImageLoad.Clear(self.class)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ function M:FillView()
|
||||||
ctr_ua.selectedIndex = bit:_and(option, 8) > 0 and 1 or 0
|
ctr_ua.selectedIndex = bit:_and(option, 8) > 0 and 1 or 0
|
||||||
|
|
||||||
self._view:GetChild("btn_ok").onClick:Set(function()
|
self._view:GetChild("btn_ok").onClick:Set(function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local data = {}
|
local data = {}
|
||||||
data.id = self.group_id
|
data.id = self.group_id
|
||||||
data.name = tex_name.text
|
data.name = tex_name.text
|
||||||
|
|
@ -104,7 +104,7 @@ function M:FillView()
|
||||||
end
|
end
|
||||||
|
|
||||||
fgCtr:FG_UpdateGroupInfo(data, function(res)
|
fgCtr:FG_UpdateGroupInfo(data, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置大联盟失败。")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置大联盟失败。")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,13 @@ local GroupRecordView = {}
|
||||||
local M = GroupRecordView
|
local M = GroupRecordView
|
||||||
|
|
||||||
function GroupRecordView.new(curGroup, qid, includeMembers, begin_time, end_time, time_type)
|
function GroupRecordView.new(curGroup, qid, includeMembers, begin_time, end_time, time_type)
|
||||||
|
setmetatable(M, { __index = BaseWindow })
|
||||||
setmetatable(M, {__index = BaseWindow})
|
local self = setmetatable({}, { __index = M })
|
||||||
local self = setmetatable({}, {__index = M})
|
|
||||||
self.class = "GroupRecordView"
|
self.class = "GroupRecordView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self.curGroup = curGroup
|
self.curGroup = curGroup
|
||||||
self.qid = qid
|
self.qid = qid
|
||||||
self.includeMembers = includeMembers
|
self.includeMembers = includeMembers
|
||||||
self.begin_time = begin_time
|
self.begin_time = begin_time
|
||||||
self.end_time = end_time
|
self.end_time = end_time
|
||||||
self.time_type = time_type
|
self.time_type = time_type
|
||||||
|
|
@ -22,12 +21,12 @@ function GroupRecordView.new(curGroup, qid, includeMembers, begin_time, end_time
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
|
|
||||||
self.record_data = {} --回放数据
|
self.record_data = {} --回放数据
|
||||||
|
|
||||||
self.lst_record = self._view:GetChild("lst_record")
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
self.lst_record:SetVirtual()
|
self.lst_record:SetVirtual()
|
||||||
self.lst_record.itemRenderer = function(index, obj)
|
self.lst_record.itemRenderer = function(index, obj)
|
||||||
self:OnRenderRecordItem(index, obj)
|
self:OnRenderRecordItem(index, obj)
|
||||||
end
|
end
|
||||||
|
|
@ -40,39 +39,37 @@ end
|
||||||
|
|
||||||
function M:OnRenderRecordItem(index, obj)
|
function M:OnRenderRecordItem(index, obj)
|
||||||
local data = self.record_data[index + 1]
|
local data = self.record_data[index + 1]
|
||||||
self:FillRecordItem(data, obj)
|
self:FillRecordItem(data, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetRecordData(index)
|
function M:GetRecordData(index)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
ViewUtil.ShowModalWait()
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetGroupRecordSpe(self.curGroup, GetPlatform(), self.qid, self.includeMembers, index, 6, self.begin_time, self.end_time, self.time_type, function(res)
|
fgCtr:FG_GetGroupRecordSpe(self.curGroup, GetPlatform(), self.qid, self.includeMembers, index, 6, self.begin_time,
|
||||||
|
self.end_time, self.time_type, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
|
||||||
ViewUtil.CloseModalWait()
|
|
||||||
|
|
||||||
if res.ReturnCode ~= 0 then
|
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
|
|
||||||
else
|
|
||||||
local records = res.Data.records
|
|
||||||
for i = 1, #records do
|
|
||||||
self.record_data[#self.record_data + 1] = records[i]
|
|
||||||
end
|
end
|
||||||
self.lst_record.numItems = #self.record_data
|
ViewUtil.CloseModalWait2()
|
||||||
end
|
|
||||||
end)
|
if res.ReturnCode ~= 0 then
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
|
||||||
|
else
|
||||||
|
local records = res.Data.records
|
||||||
|
for i = 1, #records do
|
||||||
|
self.record_data[#self.record_data + 1] = records[i]
|
||||||
|
end
|
||||||
|
self.lst_record.numItems = #self.record_data
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillRecordItem(data, obj)
|
function M:FillRecordItem(data, obj)
|
||||||
|
|
||||||
local game_id = data.game_id
|
local game_id = data.game_id
|
||||||
local room_id = data.room_id
|
local room_id = data.room_id
|
||||||
local create_time = data.create_time
|
local create_time = data.create_time
|
||||||
local room_type_str = data.game_info.name
|
local room_type_str = data.game_info.name
|
||||||
local time =tonumber(create_time)
|
local time = tonumber(create_time)
|
||||||
local room_time_str = os.date("%Y-%m-%d\n%H:%M", time)
|
local room_time_str = os.date("%Y-%m-%d\n%H:%M", time)
|
||||||
local totalScore = json.decode(data.totalScore)
|
local totalScore = json.decode(data.totalScore)
|
||||||
local hpOnOff = data.hpOnOff
|
local hpOnOff = data.hpOnOff
|
||||||
|
|
@ -90,19 +87,19 @@ function M:FillRecordItem(data, obj)
|
||||||
player_list[i].house = 0
|
player_list[i].house = 0
|
||||||
player_list[i].nick = p.nick
|
player_list[i].nick = p.nick
|
||||||
end
|
end
|
||||||
local play_name = DataManager.groups:get(self.curGroup):getPlayName(data.groupPid)
|
local play_name = DataManager.groups:get(self.curGroup):getPlayName(data.groupPid)
|
||||||
|
|
||||||
obj:GetChild("tex_time").text = room_time_str
|
obj:GetChild("tex_time").text = room_time_str
|
||||||
obj:GetChild("tex_roomid").text = room_id
|
obj:GetChild("tex_roomid").text = room_id
|
||||||
obj:GetChild("tex_times").text = d2ad(data.hp_times).."倍"
|
obj:GetChild("tex_times").text = d2ad(data.hp_times) .. "倍"
|
||||||
obj:GetChild("tex_game").text = play_name
|
obj:GetChild("tex_game").text = play_name
|
||||||
local lst_total = obj:GetChild("lst_total")
|
local lst_total = obj:GetChild("lst_total")
|
||||||
lst_total:RemoveChildrenToPool()
|
lst_total:RemoveChildrenToPool()
|
||||||
for j=1,#totalScore do
|
for j = 1, #totalScore do
|
||||||
local titem = lst_total:AddItemFromPool()
|
local titem = lst_total:AddItemFromPool()
|
||||||
local trdata = totalScore[j]
|
local trdata = totalScore[j]
|
||||||
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
||||||
titem:GetChild("tex_id").text = "ID:"..trdata.accId
|
titem:GetChild("tex_id").text = "ID:" .. trdata.accId
|
||||||
local score = trdata.score
|
local score = trdata.score
|
||||||
if trdata.hp == nil then
|
if trdata.hp == nil then
|
||||||
if hpOnOff == 1 and hpType > 1 then
|
if hpOnOff == 1 and hpType > 1 then
|
||||||
|
|
@ -111,7 +108,7 @@ function M:FillRecordItem(data, obj)
|
||||||
else
|
else
|
||||||
score = d2ad(trdata.hp)
|
score = d2ad(trdata.hp)
|
||||||
end
|
end
|
||||||
|
|
||||||
titem:GetChild("tex_score").text = score
|
titem:GetChild("tex_score").text = score
|
||||||
|
|
||||||
if score >= 0 then
|
if score >= 0 then
|
||||||
|
|
@ -129,18 +126,18 @@ function M:FillRecordItem(data, obj)
|
||||||
|
|
||||||
obj:GetChild("btn_screenshot").onClick:Set(function()
|
obj:GetChild("btn_screenshot").onClick:Set(function()
|
||||||
self:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
self:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
obj:GetChild("btn_share").onClick:Set(function()
|
obj:GetChild("btn_share").onClick:Set(function()
|
||||||
ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list)
|
ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list)
|
||||||
end)
|
end)
|
||||||
obj.onClick:Set(function()
|
obj.onClick:Set(function()
|
||||||
self:OnShowRecordInfo(data)
|
self:OnShowRecordInfo(data)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
||||||
ViewUtil.ShowModalWait(self._view, "正在分享...")
|
ViewUtil.ShowModalWait2(self._view, "正在分享...")
|
||||||
UIPackage.AddPackage("base/rank/ui/Rank")
|
UIPackage.AddPackage("base/rank/ui/Rank")
|
||||||
local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView")
|
local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView")
|
||||||
result_view.visible = false
|
result_view.visible = false
|
||||||
|
|
@ -162,15 +159,15 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
||||||
end
|
end
|
||||||
item:GetChild("score").text = score
|
item:GetChild("score").text = score
|
||||||
if score < 0 then item:GetController("di").selectedIndex = 1 end
|
if score < 0 then item:GetController("di").selectedIndex = 1 end
|
||||||
if p.portrait and p.portrait ~= "" then
|
if p.portrait and p.portrait ~= "" then
|
||||||
ImageLoad.Load(p.portrait, item:GetChild("n9")._iconObject, self.class, function( ... )
|
ImageLoad.Load(p.portrait, item:GetChild("n9")._iconObject, self.class, function(...)
|
||||||
load_head_num = load_head_num - 1
|
load_head_num = load_head_num - 1
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
load_head_num = load_head_num - 1
|
load_head_num = load_head_num - 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
coroutine.start(function ( ... )
|
coroutine.start(function(...)
|
||||||
local left_time = 4
|
local left_time = 4
|
||||||
while (true) do
|
while (true) do
|
||||||
if load_head_num == 0 or left_time == 0 then
|
if load_head_num == 0 or left_time == 0 then
|
||||||
|
|
@ -179,7 +176,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
||||||
ShareScreenShotWithOption(function()
|
ShareScreenShotWithOption(function()
|
||||||
result_view:Dispose()
|
result_view:Dispose()
|
||||||
end)
|
end)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
coroutine.wait(1)
|
coroutine.wait(1)
|
||||||
|
|
@ -201,21 +198,21 @@ function M:OnShowRecordInfo(rdata)
|
||||||
local hpOnOff = rdata.hpOnOff
|
local hpOnOff = rdata.hpOnOff
|
||||||
local hpType = rdata.game_info.hpType
|
local hpType = rdata.game_info.hpType
|
||||||
local play_name = DataManager.groups:get(self.curGroup):getPlayName(rdata.groupPid)
|
local play_name = DataManager.groups:get(self.curGroup):getPlayName(rdata.groupPid)
|
||||||
for i = 1,round_count do
|
for i = 1, round_count do
|
||||||
local item = lst_recordInfo:AddItemFromPool()
|
local item = lst_recordInfo:AddItemFromPool()
|
||||||
item:GetChild("tex_num").text = tostring(i)
|
item:GetChild("tex_num").text = tostring(i)
|
||||||
item:GetChild("tex_game").text = play_name
|
item:GetChild("tex_game").text = play_name
|
||||||
item:GetChild("tex_times").text = d2ad(rdata.hp_times).."倍"
|
item:GetChild("tex_times").text = d2ad(rdata.hp_times) .. "倍"
|
||||||
item:GetChild("tex_roomid").text = rdata.room_id
|
item:GetChild("tex_roomid").text = rdata.room_id
|
||||||
local round_score_str = rdata["round_"..i]
|
local round_score_str = rdata["round_" .. i]
|
||||||
local round_score_item = json.decode(round_score_str)
|
local round_score_item = json.decode(round_score_str)
|
||||||
local lst_total = item:GetChild("lst_total")
|
local lst_total = item:GetChild("lst_total")
|
||||||
lst_total:RemoveChildrenToPool()
|
lst_total:RemoveChildrenToPool()
|
||||||
for k=1,#round_score_item do
|
for k = 1, #round_score_item do
|
||||||
local titem = lst_total:AddItemFromPool()
|
local titem = lst_total:AddItemFromPool()
|
||||||
local trdata = round_score_item[k]
|
local trdata = round_score_item[k]
|
||||||
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
||||||
titem:GetChild("tex_id").text = trdata.accId and ("ID:"..trdata.accId) or ""
|
titem:GetChild("tex_id").text = trdata.accId and ("ID:" .. trdata.accId) or ""
|
||||||
local score = trdata.score
|
local score = trdata.score
|
||||||
if trdata.hp == nil then
|
if trdata.hp == nil then
|
||||||
if hpOnOff == 1 and hpType > 1 then
|
if hpOnOff == 1 and hpType > 1 then
|
||||||
|
|
@ -224,7 +221,7 @@ function M:OnShowRecordInfo(rdata)
|
||||||
else
|
else
|
||||||
score = d2ad(trdata.hp)
|
score = d2ad(trdata.hp)
|
||||||
end
|
end
|
||||||
|
|
||||||
titem:GetChild("tex_score").text = score
|
titem:GetChild("tex_score").text = score
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -234,11 +231,11 @@ function M:OnShowRecordInfo(rdata)
|
||||||
item:GetController("person_num").selectedIndex = 0
|
item:GetController("person_num").selectedIndex = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
local btn_play =item:GetChild("btn_play")
|
local btn_play = item:GetChild("btn_play")
|
||||||
btn_play.onClick:Set(function()
|
btn_play.onClick:Set(function()
|
||||||
local group = DataManager.groups:get(self.curGroup)
|
local group = DataManager.groups:get(self.curGroup)
|
||||||
if DataManager.SelfUser.playback[playback_id] ~= nil and DataManager.SelfUser.playback[playback_id][i] ~= nil then
|
if DataManager.SelfUser.playback[playback_id] ~= nil and DataManager.SelfUser.playback[playback_id][i] ~= nil then
|
||||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||||
DataManager.CurrenRoom = room
|
DataManager.CurrenRoom = room
|
||||||
room.lev = group.lev
|
room.lev = group.lev
|
||||||
room.game_id = game_id
|
room.game_id = game_id
|
||||||
|
|
@ -253,13 +250,13 @@ function M:OnShowRecordInfo(rdata)
|
||||||
main._totalRound = tonumber(rdata.round)
|
main._totalRound = tonumber(rdata.round)
|
||||||
main:FillRoomData(DataManager.SelfUser.playback[playback_id][i])
|
main:FillRoomData(DataManager.SelfUser.playback[playback_id][i])
|
||||||
else
|
else
|
||||||
ViewUtil.ShowModalWait(self._view)
|
ViewUtil.ShowModalWait2(self._view)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data["military_id"] = playback_id
|
_data["military_id"] = playback_id
|
||||||
_data["round"] = tostring(i)
|
_data["round"] = tostring(i)
|
||||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||||
loddyCtr1:RequestPlayBack(_data,function(code,data)
|
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
||||||
DataManager.SelfUser.playback[playback_id][i] = data
|
DataManager.SelfUser.playback[playback_id][i] = data
|
||||||
|
|
@ -285,9 +282,8 @@ function M:OnShowRecordInfo(rdata)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:GenaratePlayBack(id, game_id, ...)
|
function M:GenaratePlayBack(id, game_id, ...)
|
||||||
local tem =nil
|
local tem = nil
|
||||||
local dview_class = nil
|
local dview_class = nil
|
||||||
if not dview_class then
|
if not dview_class then
|
||||||
local exconfig = ExtendManager.GetExtendConfig(game_id)
|
local exconfig = ExtendManager.GetExtendConfig(game_id)
|
||||||
|
|
@ -296,12 +292,11 @@ function M:GenaratePlayBack(id, game_id, ...)
|
||||||
if not dview_class then
|
if not dview_class then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
tem = dview_class.new(...)
|
tem = dview_class.new(...)
|
||||||
tem.Id = id
|
tem.Id = id
|
||||||
tem:Show()
|
tem:Show()
|
||||||
return tem
|
return tem
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
return M
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ local GroupNumberInputView = import(".MngView.GroupNumberInputView")
|
||||||
local M = GroupRemitView
|
local M = GroupRemitView
|
||||||
|
|
||||||
function GroupRemitView.new(blur_view, curGroup)
|
function GroupRemitView.new(blur_view, curGroup)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupRemitView"
|
self.class = "GroupRemitView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self._blur_view = blur_view
|
self._blur_view = blur_view
|
||||||
|
|
@ -45,17 +45,17 @@ function M:FillView()
|
||||||
local btn_search = self._view:GetChild("btn_search")
|
local btn_search = self._view:GetChild("btn_search")
|
||||||
btn_search.onClick:Set(function()
|
btn_search.onClick:Set(function()
|
||||||
self._ctr_result.selectedIndex = 0
|
self._ctr_result.selectedIndex = 0
|
||||||
if not remite_id then
|
if not remite_id then
|
||||||
ViewUtil.ErrorTip(nil, "请输入玩家ID")
|
ViewUtil.ErrorTip(nil, "请输入玩家ID")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
fgCtr:FG_RemitFindMember(self.curGroup.id, remite_id, function(res)
|
fgCtr:FG_RemitFindMember(self.curGroup.id, remite_id, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "查询玩家失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "查询玩家失败")
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
|
|
@ -75,27 +75,27 @@ function M:FillView()
|
||||||
|
|
||||||
local btn_ok = self._view:GetChild("btn_ok")
|
local btn_ok = self._view:GetChild("btn_ok")
|
||||||
btn_ok.onClick:Set(function()
|
btn_ok.onClick:Set(function()
|
||||||
local msgbox = MsgWindow.new(self._root_view, "确定要转让积分吗?", MsgWindow.MsgMode.OkAndCancel)
|
local msgbox = MsgWindow.new(self._root_view, "确定要转让积分吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||||
msgbox.onOk:Add(function( ... )
|
msgbox.onOk:Add(function(...)
|
||||||
if not remite_id then
|
if not remite_id then
|
||||||
ViewUtil.ErrorTip(nil, "请输入玩家ID")
|
ViewUtil.ErrorTip(nil, "请输入玩家ID")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if self._ctr_result.selectedIndex == 0 then
|
if self._ctr_result.selectedIndex == 0 then
|
||||||
ViewUtil.ErrorTip(nil, "请先搜索玩家")
|
ViewUtil.ErrorTip(nil, "请先搜索玩家")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not remite_num then
|
if not remite_num then
|
||||||
ViewUtil.ErrorTip(nil, "请输入转让数量")
|
ViewUtil.ErrorTip(nil, "请输入转让数量")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
fgCtr:FG_FagRemit(self.curGroup.id, remite_id, ad2d(remite_num), function(res)
|
fgCtr:FG_FagRemit(self.curGroup.id, remite_id, ad2d(remite_num), function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "转让失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "转让失败")
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
|
|
@ -112,13 +112,12 @@ function M:SetCallback(callback)
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 销毁窗口
|
-- 销毁窗口
|
||||||
function M:Destroy(remove_map)
|
function M:Destroy(remove_map)
|
||||||
if self.change and self.callback then
|
if self.change and self.callback then
|
||||||
self.callback()
|
self.callback()
|
||||||
end
|
end
|
||||||
BaseWindow.Destroy(self,remove_map)
|
BaseWindow.Destroy(self, remove_map)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -3,92 +3,80 @@ local GroupSetDefaultGameView = {}
|
||||||
|
|
||||||
local M = GroupSetDefaultGameView
|
local M = GroupSetDefaultGameView
|
||||||
|
|
||||||
function GroupSetDefaultGameView.new(gid,blur_view,callback)
|
function GroupSetDefaultGameView.new(gid, blur_view, callback)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupSetDefaultGameView"
|
self.class = "GroupSetDefaultGameView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self.group_id = gid
|
self.group_id = gid
|
||||||
self._blur_view = blur_view
|
self._blur_view = blur_view
|
||||||
self._callback = callback
|
self._callback = callback
|
||||||
local url = "ui://NewGroup/Win_SetDefaultGame"
|
local url = "ui://NewGroup/Win_SetDefaultGame"
|
||||||
self:init(url)
|
self:init(url)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillData(list, index,callbackFill)
|
function M:FillData(list, index, callbackFill)
|
||||||
self.callbackFill=callbackFill
|
self.callbackFill = callbackFill
|
||||||
self._index = index
|
self._index = index
|
||||||
local lst_game = self._view:GetChild("lst_game")
|
local lst_game = self._view:GetChild("lst_game")
|
||||||
lst_game:RemoveChildrenToPool()
|
lst_game:RemoveChildrenToPool()
|
||||||
|
|
||||||
local playName="playfaconfig"..self.group_id
|
local playName = "playfaconfig" .. self.group_id
|
||||||
local json_data = Utils.LoadLocalFile(playName)
|
local json_data = Utils.LoadLocalFile(playName)
|
||||||
local localDataPlay=nil
|
local localDataPlay = nil
|
||||||
if json_data then
|
if json_data then
|
||||||
localDataPlay = json.decode(json_data)
|
localDataPlay = json.decode(json_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
for i = 1, #list do
|
for i = 1, #list do
|
||||||
local tem = list[i]
|
local tem = list[i]
|
||||||
local item = lst_game:AddItemFromPool()
|
local item = lst_game:AddItemFromPool()
|
||||||
item.title = tem.name
|
item.title = tem.name
|
||||||
item.selected = index == i
|
item.selected = index == i
|
||||||
|
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local MarkSelect=item:GetChild("btn_select")
|
local MarkSelect = item:GetChild("btn_select")
|
||||||
|
|
||||||
--if group.lev==1 then
|
--if group.lev==1 then
|
||||||
-- MarkSelect.visible=true
|
-- MarkSelect.visible=true
|
||||||
--else
|
--else
|
||||||
-- MarkSelect.visible=false
|
-- MarkSelect.visible=false
|
||||||
--end
|
--end
|
||||||
|
|
||||||
MarkSelect.visible=true
|
|
||||||
if localDataPlay and localDataPlay[tostring(tem.id)] then
|
|
||||||
MarkSelect.selected=localDataPlay[tostring(tem.id)]
|
|
||||||
else
|
|
||||||
MarkSelect.selected=false
|
|
||||||
end
|
|
||||||
|
|
||||||
MarkSelect.onClick:Set(function()
|
|
||||||
self:MarkPlay(MarkSelect,tem.id,MarkSelect.selected)
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
local btn_confirm = self._view:GetChild("btn_confirm")
|
|
||||||
btn_confirm.onClick:Set(function()
|
|
||||||
if self._callback then
|
|
||||||
self._callback(lst_game.selectedIndex + 1)
|
|
||||||
end
|
|
||||||
self:Destroy()
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
|
MarkSelect.visible = true
|
||||||
|
if localDataPlay and localDataPlay[tostring(tem.id)] then
|
||||||
|
MarkSelect.selected = localDataPlay[tostring(tem.id)]
|
||||||
|
else
|
||||||
|
MarkSelect.selected = false
|
||||||
|
end
|
||||||
|
|
||||||
|
MarkSelect.onClick:Set(function()
|
||||||
|
self:MarkPlay(MarkSelect, tem.id, MarkSelect.selected)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
local btn_confirm = self._view:GetChild("btn_confirm")
|
||||||
|
btn_confirm.onClick:Set(function()
|
||||||
|
if self._callback then
|
||||||
|
self._callback(lst_game.selectedIndex + 1)
|
||||||
|
end
|
||||||
|
self:Destroy()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M:MarkPlay(markS, pid, isMark)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function M:MarkPlay(markS,pid,isMark)
|
|
||||||
--[[local fgCtr = ControllerManager.GetController(NewGroupController)
|
--[[local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_MarkPlay(self.group_id, pid, isMark, function(res)
|
fgCtr:FG_MarkPlay(self.group_id, pid, isMark, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
group:markPlay(pid, isMark)
|
group:markPlay(pid, isMark)
|
||||||
|
|
@ -100,27 +88,22 @@ function M:MarkPlay(markS,pid,isMark)
|
||||||
ViewUtil.ErrorTip(res.ReturnCode,"设置失败,或已达设置上限")
|
ViewUtil.ErrorTip(res.ReturnCode,"设置失败,或已达设置上限")
|
||||||
end
|
end
|
||||||
end)--]]
|
end)--]]
|
||||||
|
|
||||||
if DataManager.SelfUser.PlayLocalList==nil then
|
if DataManager.SelfUser.PlayLocalList == nil then
|
||||||
DataManager.SelfUser.PlayLocalList={}
|
DataManager.SelfUser.PlayLocalList = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
DataManager.SelfUser.PlayLocalList[tostring(pid)]=isMark
|
DataManager.SelfUser.PlayLocalList[tostring(pid)] = isMark
|
||||||
--printlog("111111111122222222222223333333333333")
|
--printlog("111111111122222222222223333333333333")
|
||||||
--pt(DataManager.SelfUser.PlayLocalList)
|
--pt(DataManager.SelfUser.PlayLocalList)
|
||||||
|
|
||||||
local playName="playfaconfig"..self.group_id
|
local playName = "playfaconfig" .. self.group_id
|
||||||
|
|
||||||
Utils.SaveLocalFile(playName, json.encode(DataManager.SelfUser.PlayLocalList))
|
Utils.SaveLocalFile(playName, json.encode(DataManager.SelfUser.PlayLocalList))
|
||||||
|
|
||||||
if self.callbackFill then
|
if self.callbackFill then
|
||||||
self.callbackFill()
|
self.callbackFill()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
||||||
|
|
||||||
return M
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ function M:init(url, member)
|
||||||
]]
|
]]
|
||||||
|
|
||||||
self._view:GetChild("btn_ok").onClick:Set(function()
|
self._view:GetChild("btn_ok").onClick:Set(function()
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
--local score = tonumber(tex_tag.text) or 0
|
--local score = tonumber(tex_tag.text) or 0
|
||||||
local score = tex_tag.text
|
local score = tex_tag.text
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
|
@ -40,7 +40,7 @@ function M:init(url, member)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "备注失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "备注失败")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -8,58 +8,56 @@ local GroupSettingView = {}
|
||||||
local M = GroupSettingView
|
local M = GroupSettingView
|
||||||
|
|
||||||
function GroupSettingView.new(blur_view)
|
function GroupSettingView.new(blur_view)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupSettingView"
|
self.class = "GroupSettingView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self._blur_view = blur_view
|
self._blur_view = blur_view
|
||||||
|
|
||||||
self:init("ui://NewGroup/Win_GroupSetting")
|
self:init("ui://NewGroup/Win_GroupSetting")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function __removeGroup(self, msg, curData)
|
||||||
local function __removeGroup(self,msg,curData)
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
local _curren_msg = MsgWindow.new(self._root_view, msg, MsgWindow.MsgMode.OkAndCancel)
|
local _curren_msg = MsgWindow.new(self._root_view, msg, MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(function()
|
_curren_msg.onOk:Add(function()
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
local func = curData.owner == DataManager.SelfUser.account_id and fgCtr.FG_RemoveGroup or fgCtr.FG_ExitGroup
|
local func = curData.owner == DataManager.SelfUser.account_id and fgCtr.FG_RemoveGroup or fgCtr.FG_ExitGroup
|
||||||
func(fgCtr, curData.id, function(res)
|
func(fgCtr, curData.id, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
self.change = true
|
self.change = true
|
||||||
local groups = DataManager.groups.groupList
|
local groups = DataManager.groups.groupList
|
||||||
if #groups > 0 then
|
if #groups > 0 then
|
||||||
self:FillData()
|
self:FillData()
|
||||||
else
|
else
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode,"删除大联盟失败!")
|
ViewUtil.ErrorTip(res.ReturnCode, "删除大联盟失败!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
_curren_msg:Show()
|
_curren_msg:Show()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
local lst_group = self._view:GetChild("lst_group")
|
local lst_group = self._view:GetChild("lst_group")
|
||||||
|
|
||||||
local btn_remove = self._view:GetChild("btn_remove")
|
local btn_remove = self._view:GetChild("btn_remove")
|
||||||
btn_remove.onClick:Set(function()
|
btn_remove.onClick:Set(function()
|
||||||
local group = lst_group:GetChildAt(lst_group.selectedIndex).data
|
local group = lst_group:GetChildAt(lst_group.selectedIndex).data
|
||||||
__removeGroup(self,"您确定解散该大联盟吗?",group)
|
__removeGroup(self, "您确定解散该大联盟吗?", group)
|
||||||
end)
|
end)
|
||||||
local btn_exit = self._view:GetChild("btn_exit")
|
local btn_exit = self._view:GetChild("btn_exit")
|
||||||
btn_exit.onClick:Set(function()
|
btn_exit.onClick:Set(function()
|
||||||
local group = lst_group:GetChildAt(lst_group.selectedIndex).data
|
local group = lst_group:GetChildAt(lst_group.selectedIndex).data
|
||||||
__removeGroup(self,"您确定退出该大联盟吗?",group)
|
__removeGroup(self, "您确定退出该大联盟吗?", group)
|
||||||
end)
|
end)
|
||||||
lst_group.onClickItem:Add(function(context)
|
lst_group.onClickItem:Add(function(context)
|
||||||
local group = context.data.data
|
local group = context.data.data
|
||||||
|
|
@ -68,31 +66,29 @@ function M:init(url)
|
||||||
self._view:GetController("opt").selectedIndex = 2
|
self._view:GetController("opt").selectedIndex = 2
|
||||||
else
|
else
|
||||||
local option = group.option or 0
|
local option = group.option or 0
|
||||||
if bit:_and(option,2) > 0 then
|
if bit:_and(option, 2) > 0 then
|
||||||
self._view:GetController("opt").selectedIndex = 1
|
self._view:GetController("opt").selectedIndex = 1
|
||||||
|
|
||||||
else
|
else
|
||||||
self._view:GetController("opt").selectedIndex = 0
|
self._view:GetController("opt").selectedIndex = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillData()
|
function M:FillData()
|
||||||
local groups = DataManager.groups.groupList
|
local groups = DataManager.groups.groupList
|
||||||
local lst_group = self._view:GetChild("lst_group")
|
local lst_group = self._view:GetChild("lst_group")
|
||||||
lst_group:RemoveChildrenToPool()
|
lst_group:RemoveChildrenToPool()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
|
||||||
for i = 1, #groups do
|
for i = 1, #groups do
|
||||||
local group = groups[i]
|
local group = groups[i]
|
||||||
local item = lst_group:AddItemFromPool()
|
local item = lst_group:AddItemFromPool()
|
||||||
item:GetChild("tex_name").emojies = EmojiDitc.EmojiesDitc
|
item:GetChild("tex_name").emojies = EmojiDitc.EmojiesDitc
|
||||||
item:GetChild("tex_name").text = Utils.TextOmit(group.name, 6, "...")
|
item:GetChild("tex_name").text = Utils.TextOmit(group.name, 6, "...")
|
||||||
item:GetChild("tex_id").text = group.id
|
item:GetChild("tex_id").text = group.id
|
||||||
item:GetChild("tex_nick").text ="创建人:" .. group.o_nick
|
item:GetChild("tex_nick").text = "创建人:" .. group.o_nick
|
||||||
item.data = group
|
item.data = group
|
||||||
end
|
end
|
||||||
|
|
||||||
if #groups > 0 and lst_group.selectedIndex == -1 then
|
if #groups > 0 and lst_group.selectedIndex == -1 then
|
||||||
|
|
@ -102,32 +98,28 @@ function M:FillData()
|
||||||
self._view:GetController("opt").selectedIndex = 2
|
self._view:GetController("opt").selectedIndex = 2
|
||||||
else
|
else
|
||||||
local option = groups[1].option or 0
|
local option = groups[1].option or 0
|
||||||
if bit:_and(option,2) > 0 then
|
if bit:_and(option, 2) > 0 then
|
||||||
self._view:GetController("opt").selectedIndex = 1
|
self._view:GetController("opt").selectedIndex = 1
|
||||||
else
|
else
|
||||||
self._view:GetController("opt").selectedIndex = 0
|
self._view:GetController("opt").selectedIndex = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if #groups == 0 then
|
if #groups == 0 then
|
||||||
self._view:GetController("opt").selectedIndex = 0
|
self._view:GetController("opt").selectedIndex = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:SetCallback(callback)
|
function M:SetCallback(callback)
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 销毁窗口
|
-- 销毁窗口
|
||||||
function M:Destroy(remove_map)
|
function M:Destroy(remove_map)
|
||||||
if self.change and self.callback then
|
if self.change and self.callback then
|
||||||
self.callback()
|
self.callback()
|
||||||
end
|
end
|
||||||
BaseWindow.Destroy(self,remove_map)
|
BaseWindow.Destroy(self, remove_map)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
return M
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ local KEY_DEL = "del"
|
||||||
local KEY_CLEAR = "c"
|
local KEY_CLEAR = "c"
|
||||||
|
|
||||||
function JoinGroupView.new(blur_view)
|
function JoinGroupView.new(blur_view)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "JoinGroupView"
|
self.class = "JoinGroupView"
|
||||||
self._currenIndex = 0
|
self._currenIndex = 0
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
|
|
@ -20,28 +20,28 @@ function JoinGroupView.new(blur_view)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
|
|
||||||
self.tex_num = self._view:GetChild("tex_num")
|
self.tex_num = self._view:GetChild("tex_num")
|
||||||
self:ClearNumTex()
|
self:ClearNumTex()
|
||||||
|
|
||||||
local cnt = self._view.numChildren - 1
|
local cnt = self._view.numChildren - 1
|
||||||
|
|
||||||
for i = 0 , 9 do
|
for i = 0, 9 do
|
||||||
local obj = self._view:GetChild("btn_"..i)
|
local obj = self._view:GetChild("btn_" .. i)
|
||||||
obj.onClick:Add(handler(self , self.OnNumButtonAction))
|
obj.onClick:Add(handler(self, self.OnNumButtonAction))
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
local btn_ok = self._view:GetChild("btn_ok")
|
local btn_ok = self._view:GetChild("btn_ok")
|
||||||
btn_ok.onClick:Set(function()
|
btn_ok.onClick:Set(function()
|
||||||
if self._currenIndex <6 then
|
if self._currenIndex < 6 then
|
||||||
ViewUtil.ErrorTip(-12,"您输入的大联盟ID少于六位!")
|
ViewUtil.ErrorTip(-12, "您输入的大联盟ID少于六位!")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_JoinGroup(tonumber(self._texnum_str),function(response)
|
fgCtr:FG_JoinGroup(tonumber(self._texnum_str), function(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -49,20 +49,20 @@ function M:init(url)
|
||||||
ViewUtil.ErrorTip("请等待盟主审核")
|
ViewUtil.ErrorTip("请等待盟主审核")
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(response.ReturnCode,"加入大联盟失败!")
|
ViewUtil.ErrorTip(response.ReturnCode, "加入大联盟失败!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
local btn_del = self._view:GetChild("btn_del")
|
local btn_del = self._view:GetChild("btn_del")
|
||||||
btn_del.onClick:Add(handler(self , self.OnNumButtonAction))
|
btn_del.onClick:Add(handler(self, self.OnNumButtonAction))
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnNumButtonAction(context)
|
function M:OnNumButtonAction(context)
|
||||||
local typer = string.sub(context.sender.name ,5)
|
local typer = string.sub(context.sender.name, 5)
|
||||||
if typer == KEY_DEL then
|
if typer == KEY_DEL then
|
||||||
if (self._currenIndex > 0) then
|
if (self._currenIndex > 0) then
|
||||||
self._currenIndex = self._currenIndex - 1
|
self._currenIndex = self._currenIndex - 1
|
||||||
self._texnum_str = string.sub(self._texnum_str,0,self._currenIndex)
|
self._texnum_str = string.sub(self._texnum_str, 0, self._currenIndex)
|
||||||
self.tex_num.text = self._texnum_str
|
self.tex_num.text = self._texnum_str
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
@ -70,7 +70,6 @@ function M:OnNumButtonAction(context)
|
||||||
self._currenIndex = self._currenIndex + 1
|
self._currenIndex = self._currenIndex + 1
|
||||||
self._texnum_str = self._texnum_str .. typer
|
self._texnum_str = self._texnum_str .. typer
|
||||||
self.tex_num.text = self._texnum_str
|
self.tex_num.text = self._texnum_str
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -81,4 +80,4 @@ function M:ClearNumTex()
|
||||||
self.tex_num.text = self._texnum_str
|
self.tex_num.text = self._texnum_str
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,13 @@ function M:init(url)
|
||||||
)
|
)
|
||||||
self._view:GetChild("btn_qd").onClick:Set(
|
self._view:GetChild("btn_qd").onClick:Set(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_AddMember(
|
fgCtr:FG_AddMember(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
self.member_id,
|
self.member_id,
|
||||||
function(response)
|
function(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (response.ReturnCode == 0) then
|
if (response.ReturnCode == 0) then
|
||||||
ViewUtil.ErrorTip(-1, '添加成功!', 1)
|
ViewUtil.ErrorTip(-1, '添加成功!', 1)
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -62,15 +62,15 @@ function M:init(url)
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
self._view:GetChild("btn_search_member").onClick:Set(function()
|
self._view:GetChild("btn_search_member").onClick:Set(function()
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local qid = tonumber(self._view:GetChild("tex_find_memb").text)
|
local qid = tonumber(self._view:GetChild("tex_find_memb").text)
|
||||||
if not qid then
|
if not qid then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, "输入ID进行搜索")
|
ViewUtil.ErrorTip(nil, "输入ID进行搜索")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
fgCtr:FG_FindMember(self.group_id, qid, function(res)
|
fgCtr:FG_FindMember(self.group_id, qid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -118,9 +118,9 @@ function M:init(url)
|
||||||
table.insert(del_list, tem.uid)
|
table.insert(del_list, tem.uid)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetBanTable(self.group_id, self.member_id, set_list, del_list, function(res)
|
fgCtr:FG_SetBanTable(self.group_id, self.member_id, set_list, del_list, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
ViewUtil.ErrorTip(-1, "禁止同桌设置成功")
|
ViewUtil.ErrorTip(-1, "禁止同桌设置成功")
|
||||||
|
|
@ -171,10 +171,10 @@ function M:getMemberData(index)
|
||||||
-- if index == 0 then
|
-- if index == 0 then
|
||||||
-- group:clearMember()
|
-- group:clearMember()
|
||||||
-- end
|
-- end
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupMembers(self.group_id, index, 10, false, 1, function(res)
|
fgCtr:FG_GroupMembers(self.group_id, index, 10, false, 1, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,7 @@ function M:FillFagData()
|
||||||
pt(self.hpData)
|
pt(self.hpData)
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
if not self.play then
|
if not self.play then
|
||||||
-- 新增玩法
|
-- 新增玩法
|
||||||
fgCtr:FG_AddPlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, group.type, self.table_color,
|
fgCtr:FG_AddPlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, group.type, self.table_color,
|
||||||
|
|
@ -467,7 +467,7 @@ function M:FillFagData()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
---- print("======新增玩法=============")
|
---- print("======新增玩法=============")
|
||||||
--pt(res)
|
--pt(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
|
|
@ -508,7 +508,7 @@ function M:FillFagData()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
---- print("======修改玩法=============")
|
---- print("======修改玩法=============")
|
||||||
--pt(res)
|
--pt(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,38 @@ local GroupRoomColorView = import(".GroupRoomColorView")
|
||||||
local GameListView = require "Game/View/Lobby/GameListView"
|
local GameListView = require "Game/View/Lobby/GameListView"
|
||||||
local GroupGameSettingView = {}
|
local GroupGameSettingView = {}
|
||||||
|
|
||||||
|
-- UTF-8 正则匹配每一个字符(包括 emoji)
|
||||||
|
local function utf8_chars(str)
|
||||||
|
local chars = {}
|
||||||
|
for uchar in str:gmatch("[%z\1-\127\194-\244][\128-\191]*") do
|
||||||
|
table.insert(chars, uchar)
|
||||||
|
end
|
||||||
|
return chars
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 截取前 n 个字符(安全处理 Emoji)
|
||||||
|
local function sub(str, start_char, end_char)
|
||||||
|
local chars = utf8_chars(str)
|
||||||
|
local sub = {}
|
||||||
|
for i = start_char or 1, end_char or #chars do
|
||||||
|
if chars[i] then
|
||||||
|
table.insert(sub, chars[i])
|
||||||
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return table.concat(sub)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 获取 UTF-8 字符个数
|
||||||
|
local function len(str)
|
||||||
|
local count = 0
|
||||||
|
for _ in str:gmatch("[%z\1-\127\194-\244][\128-\191]*") do
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
return count
|
||||||
|
end
|
||||||
|
|
||||||
local M = GroupGameSettingView
|
local M = GroupGameSettingView
|
||||||
|
|
||||||
function GroupGameSettingView.new(blur_view, gid, pid, room_config, callback)
|
function GroupGameSettingView.new(blur_view, gid, pid, room_config, callback)
|
||||||
|
|
@ -49,6 +81,9 @@ function M:init(url)
|
||||||
self.btn_closeTimesPage = self._view:GetChild("btn_closeTimesPage")
|
self.btn_closeTimesPage = self._view:GetChild("btn_closeTimesPage")
|
||||||
|
|
||||||
self._view:GetChild("tex_name").emojies = EmojiDitc.EmojiesDitc
|
self._view:GetChild("tex_name").emojies = EmojiDitc.EmojiesDitc
|
||||||
|
self._view:GetChild("tex_name").onFocusOut:Set(function()
|
||||||
|
self._view:GetChild("tex_name").text = sub(self._view:GetChild("tex_name").text, 1, 7)
|
||||||
|
end)
|
||||||
|
|
||||||
self.cTimesPage = self._view:GetController("cTimesPage")
|
self.cTimesPage = self._view:GetController("cTimesPage")
|
||||||
|
|
||||||
|
|
@ -552,7 +587,7 @@ function M:FillFagData()
|
||||||
pt(self.hpData)
|
pt(self.hpData)
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
if not self.play then
|
if not self.play then
|
||||||
-- 新增玩法
|
-- 新增玩法
|
||||||
fgCtr:FG_AddPlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, group.type, self.table_color,
|
fgCtr:FG_AddPlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, group.type, self.table_color,
|
||||||
|
|
@ -560,7 +595,7 @@ function M:FillFagData()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
---- print("======新增玩法=============")
|
---- print("======新增玩法=============")
|
||||||
--pt(res)
|
--pt(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
|
|
@ -602,7 +637,7 @@ function M:FillFagData()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
---- print("======修改玩法=============")
|
---- print("======修改玩法=============")
|
||||||
--pt(res)
|
--pt(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
|
|
@ -1054,7 +1089,7 @@ function M:FillFagData_jiangxi()
|
||||||
pt(self.hpData)
|
pt(self.hpData)
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
if not self.play then
|
if not self.play then
|
||||||
-- 新增玩法
|
-- 新增玩法
|
||||||
fgCtr:FG_AddPlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, group.type, self.table_color,
|
fgCtr:FG_AddPlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, group.type, self.table_color,
|
||||||
|
|
@ -1062,7 +1097,7 @@ function M:FillFagData_jiangxi()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
---- print("======新增玩法=============")
|
---- print("======新增玩法=============")
|
||||||
--pt(res)
|
--pt(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
|
|
@ -1104,7 +1139,7 @@ function M:FillFagData_jiangxi()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
---- print("======修改玩法=============")
|
---- print("======修改玩法=============")
|
||||||
--pt(res)
|
--pt(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
|
|
|
||||||
|
|
@ -148,14 +148,14 @@ end
|
||||||
function M:GetData(index)
|
function M:GetData(index)
|
||||||
local filter = self:GetFilter()
|
local filter = self:GetFilter()
|
||||||
if filter == 0 then return end
|
if filter == 0 then return end
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMemberHpLog(self.group_id, self.member.uid, index, 6, filter, self.begin_time, self.end_time,
|
fgCtr:FG_GetMemberHpLog(self.group_id, self.member.uid, index, 6, filter, self.begin_time, self.end_time,
|
||||||
function(res)
|
function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
||||||
else
|
else
|
||||||
|
|
@ -265,13 +265,13 @@ function M:OnRenderItem(index, obj)
|
||||||
self.lst_fag:RefreshVirtualList()
|
self.lst_fag:RefreshVirtualList()
|
||||||
self.lst_fag:ScrollToView(index)
|
self.lst_fag:ScrollToView(index)
|
||||||
else
|
else
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetHpLogDetail(self.group_id, self.member.uid, data.roomid, data.time, function(res)
|
fgCtr:FG_GetHpLogDetail(self.group_id, self.member.uid, data.roomid, data.time, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
||||||
else
|
else
|
||||||
|
|
@ -292,13 +292,13 @@ end
|
||||||
|
|
||||||
-- 获取日统计数据
|
-- 获取日统计数据
|
||||||
function M:GetDailyData()
|
function M:GetDailyData()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetPlayerDailyHPCount(self.group_id, self.member.uid, function(res)
|
fgCtr:FG_GetPlayerDailyHPCount(self.group_id, self.member.uid, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -106,21 +106,21 @@ function M:init(url)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
self._view:GetChild("btn_deploy").onClick:Set(function()
|
self._view:GetChild("btn_deploy").onClick:Set(function()
|
||||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local parent_id = tonumber(num)
|
local parent_id = tonumber(num)
|
||||||
fgCtr:FG_FindMember(self.group_id, parent_id, function(res)
|
fgCtr:FG_FindMember(self.group_id, parent_id, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员")
|
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员")
|
||||||
elseif res.Data.partnerLev == 0 then
|
elseif res.Data.partnerLev == 0 then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "目标不是合伙人")
|
ViewUtil.ErrorTip(res.ReturnCode, "目标不是合伙人")
|
||||||
else
|
else
|
||||||
fgCtr:FG_DeployMember(self.group_id, member.uid, parent_id, function(res1)
|
fgCtr:FG_DeployMember(self.group_id, member.uid, parent_id, function(res1)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res1.ReturnCode == 0) then
|
if (res1.ReturnCode == 0) then
|
||||||
member.parentId = parent_id
|
member.parentId = parent_id
|
||||||
self._view:GetChild("tex_superior_id").text = parent_id
|
self._view:GetChild("tex_superior_id").text = parent_id
|
||||||
|
|
@ -146,7 +146,7 @@ function M:init(url)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res1.ReturnCode == 0 then
|
if res1.ReturnCode == 0 then
|
||||||
member.isvip = selected
|
member.isvip = selected
|
||||||
self.callBack()
|
self.callBack()
|
||||||
|
|
@ -175,12 +175,12 @@ function M:init(url)
|
||||||
end
|
end
|
||||||
local _curren_msg = MsgWindow.new(nil, "确定删除该成员吗?", MsgWindow.MsgMode.OkAndCancel)
|
local _curren_msg = MsgWindow.new(nil, "确定删除该成员吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(function()
|
_curren_msg.onOk:Add(function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GroupRemoveMember(self.group_id, member.uid, function(res1)
|
fgCtr:FG_GroupRemoveMember(self.group_id, member.uid, function(res1)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res1.ReturnCode == 0 then
|
if res1.ReturnCode == 0 then
|
||||||
self.callBack(true)
|
self.callBack(true)
|
||||||
ViewUtil.ErrorTip(-1, "已成功删除玩家")
|
ViewUtil.ErrorTip(-1, "已成功删除玩家")
|
||||||
|
|
@ -209,13 +209,13 @@ function M:init(url)
|
||||||
local str = member.ban == 1 and "确定恢复娱乐吗?" or "确定禁止娱乐吗?"
|
local str = member.ban == 1 and "确定恢复娱乐吗?" or "确定禁止娱乐吗?"
|
||||||
local _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
local _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(function()
|
_curren_msg.onOk:Add(function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local val = 1 - member.ban
|
local val = 1 - member.ban
|
||||||
fgCtr:FG_BanMember(self.group_id, member.uid, val, 1, function(res1)
|
fgCtr:FG_BanMember(self.group_id, member.uid, val, 1, function(res1)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res1.ReturnCode == 0 then
|
if res1.ReturnCode == 0 then
|
||||||
member.ban = val
|
member.ban = val
|
||||||
pic = member.ban == 1 and "mng_del_ban" or "mng_ban"
|
pic = member.ban == 1 and "mng_del_ban" or "mng_ban"
|
||||||
|
|
@ -248,13 +248,13 @@ function M:init(url)
|
||||||
local str = member.group_ban == 1 and "确定恢复该合伙人整组娱乐吗?" or "确定禁止该合伙人整组娱乐吗?"
|
local str = member.group_ban == 1 and "确定恢复该合伙人整组娱乐吗?" or "确定禁止该合伙人整组娱乐吗?"
|
||||||
local _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
local _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(function()
|
_curren_msg.onOk:Add(function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local val = member.group_ban == 1 and 0 or 1
|
local val = member.group_ban == 1 and 0 or 1
|
||||||
fgCtr:FG_BanMember(self.group_id, member.uid, val, 2, function(res1)
|
fgCtr:FG_BanMember(self.group_id, member.uid, val, 2, function(res1)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res1.ReturnCode == 0 then
|
if res1.ReturnCode == 0 then
|
||||||
member.group_ban = val
|
member.group_ban = val
|
||||||
pic = member.group_ban == 1 and "mng_del_ban_group" or "mng_ban_group"
|
pic = member.group_ban == 1 and "mng_del_ban_group" or "mng_ban_group"
|
||||||
|
|
@ -277,9 +277,9 @@ function M:init(url)
|
||||||
if not CheckPermission(group.lev, perm_array[MngPermissionList.BanSameTable]) then
|
if not CheckPermission(group.lev, perm_array[MngPermissionList.BanSameTable]) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GetBanTable(self.group_id, member.uid, function(res)
|
fgCtr:FG_GetBanTable(self.group_id, member.uid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
local btv = GroupBanSameTableView.new(self.blur_view, self.group_id, member.uid, res.Data)
|
local btv = GroupBanSameTableView.new(self.blur_view, self.group_id, member.uid, res.Data)
|
||||||
btv:Show()
|
btv:Show()
|
||||||
|
|
@ -297,9 +297,9 @@ function M:init(url)
|
||||||
btn_set_mng.icon = "ui://NewGroup/zhengzu"
|
btn_set_mng.icon = "ui://NewGroup/zhengzu"
|
||||||
btn_set_mng.onClick:Set(
|
btn_set_mng.onClick:Set(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_GetBanMemberHB(self.group_id, member.uid, function(res)
|
fgCtr:FG_GetBanMemberHB(self.group_id, member.uid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
--pt(res)
|
--pt(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
local diaoduView = GroupSetMemberInfoDiaoduView.new(self.group_id, member.uid)
|
local diaoduView = GroupSetMemberInfoDiaoduView.new(self.group_id, member.uid)
|
||||||
|
|
@ -322,13 +322,13 @@ function M:init(url)
|
||||||
local str = member.lev == 3 and "确定设置玩家为副盟主吗?" or "确定取消玩家副盟主身份吗?"
|
local str = member.lev == 3 and "确定设置玩家为副盟主吗?" or "确定取消玩家副盟主身份吗?"
|
||||||
local _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
local _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(function()
|
_curren_msg.onOk:Add(function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local val = 4 - member.lev
|
local val = 4 - member.lev
|
||||||
fgCtr:FG_SetManager(self.group_id, member.uid, val, function(res1)
|
fgCtr:FG_SetManager(self.group_id, member.uid, val, function(res1)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res1.ReturnCode == 0 then
|
if res1.ReturnCode == 0 then
|
||||||
member.lev = val + 1
|
member.lev = val + 1
|
||||||
self.callBack()
|
self.callBack()
|
||||||
|
|
@ -356,13 +356,13 @@ function M:init(url)
|
||||||
local str = member.partnerLev == 0 and "确定设置玩家为合伙人吗?" or "确定取消玩家合伙人身份吗?"
|
local str = member.partnerLev == 0 and "确定设置玩家为合伙人吗?" or "确定取消玩家合伙人身份吗?"
|
||||||
local _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
local _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
||||||
_curren_msg.onOk:Add(function()
|
_curren_msg.onOk:Add(function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local val = member.partnerLev > 0 and 2 or 1
|
local val = member.partnerLev > 0 and 2 or 1
|
||||||
fgCtr:FG_SetPartner(self.group_id, member.uid, val, function(res1)
|
fgCtr:FG_SetPartner(self.group_id, member.uid, val, function(res1)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res1.ReturnCode == 0 then
|
if res1.ReturnCode == 0 then
|
||||||
member.parentId = res1.Data.parentId
|
member.parentId = res1.Data.parentId
|
||||||
member.partnerLev = res1.Data.partnerLev
|
member.partnerLev = res1.Data.partnerLev
|
||||||
|
|
@ -411,17 +411,17 @@ function M:init(url)
|
||||||
self:MovePartner(parent_id, member, self._view)
|
self:MovePartner(parent_id, member, self._view)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_FindMember(self.group_id, parent_id, function(res)
|
fgCtr:FG_FindMember(self.group_id, parent_id, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员")
|
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员")
|
||||||
elseif res.Data.partnerLev == 0 then
|
elseif res.Data.partnerLev == 0 then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "目标不是合伙人")
|
ViewUtil.ErrorTip(res.ReturnCode, "目标不是合伙人")
|
||||||
else
|
else
|
||||||
self:MovePartner(parent_id, member, self._view)
|
self:MovePartner(parent_id, member, self._view)
|
||||||
|
|
@ -460,9 +460,9 @@ function M:init(url)
|
||||||
btn_qiangzhi.onClick:Set(function()
|
btn_qiangzhi.onClick:Set(function()
|
||||||
local msg_tip = MsgWindow.new(self._root_view, "确定全部提取吗?", MsgWindow.MsgMode.OnlyOk)
|
local msg_tip = MsgWindow.new(self._root_view, "确定全部提取吗?", MsgWindow.MsgMode.OnlyOk)
|
||||||
msg_tip.onOk:Add(function(...)
|
msg_tip.onOk:Add(function(...)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_TakeHp1(self.group_id, member.uid, function(res)
|
fgCtr:FG_TakeHp1(self.group_id, member.uid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -486,7 +486,7 @@ end
|
||||||
function M:MovePartner(parent_id, member, obj)
|
function M:MovePartner(parent_id, member, obj)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_MovePartner(self.group_id, member.uid, parent_id, function(res1)
|
fgCtr:FG_MovePartner(self.group_id, member.uid, parent_id, function(res1)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res1.ReturnCode == 0) then
|
if (res1.ReturnCode == 0) then
|
||||||
member.parentId = parent_id
|
member.parentId = parent_id
|
||||||
member.partnerLev = res1.Data.partnerLev
|
member.partnerLev = res1.Data.partnerLev
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,10 @@ function M:FillView()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if self._texnum_str == "" then return end
|
if self._texnum_str == "" then return end
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_AddMember(self.group_id, tonumber(self._texnum_str), function(response)
|
fgCtr:FG_AddMember(self.group_id, tonumber(self._texnum_str), function(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (response.ReturnCode == 0) then
|
if (response.ReturnCode == 0) then
|
||||||
ViewUtil.ErrorTip(-1, "添加成功!", 1)
|
ViewUtil.ErrorTip(-1, "添加成功!", 1)
|
||||||
else
|
else
|
||||||
|
|
@ -86,10 +86,10 @@ end
|
||||||
function M:GetJoinsData()
|
function M:GetJoinsData()
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if group.joins > 0 then
|
if group.joins > 0 then
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupJoins(self.group_id, function(res)
|
fgCtr:FG_GroupJoins(self.group_id, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode == 0) then
|
if (res.ReturnCode == 0) then
|
||||||
local joins = res.Data.joins
|
local joins = res.Data.joins
|
||||||
group.joins = #joins
|
group.joins = #joins
|
||||||
|
|
@ -127,10 +127,10 @@ function M:FillJoinList(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:VerifyPlayerJoin(id, allow)
|
function M:VerifyPlayerJoin(id, allow)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupVerifyJoin(self.group_id, id, allow, function(res)
|
fgCtr:FG_GroupVerifyJoin(self.group_id, id, allow, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode == 0) then
|
if (res.ReturnCode == 0) then
|
||||||
self:GetJoinsData()
|
self:GetJoinsData()
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ local GroupMngAddPartner = {}
|
||||||
|
|
||||||
local M = GroupMngAddPartner
|
local M = GroupMngAddPartner
|
||||||
|
|
||||||
function GroupMngAddPartner.new(group_id, member,callback)
|
function GroupMngAddPartner.new(group_id, member, callback)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupMngAddPartner"
|
self.class = "GroupMngAddPartner"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
-- self._blur_view = blur_view
|
-- self._blur_view = blur_view
|
||||||
|
|
@ -16,10 +16,8 @@ function GroupMngAddPartner.new(group_id, member,callback)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
|
BaseWindow.init(self, url)
|
||||||
BaseWindow.init(self,url)
|
|
||||||
|
|
||||||
local member = self.member
|
local member = self.member
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
|
|
@ -35,20 +33,19 @@ function M:init(url)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_SetPartner(self.group_id, member.uid, 1, function(res1)
|
fgCtr:FG_SetPartner(self.group_id, member.uid, 1, function(res1)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res1.ReturnCode == 0 then
|
if res1.ReturnCode == 0 then
|
||||||
member.parentId = res1.Data.parentId
|
member.parentId = res1.Data.parentId
|
||||||
member.partnerLev = res1.Data.partnerLev
|
member.partnerLev = res1.Data.partnerLev
|
||||||
self.callback()
|
self.callback()
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res1.ReturnCode,"设置合伙人失败失败!")
|
ViewUtil.ErrorTip(res1.ReturnCode, "设置合伙人失败失败!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
return M
|
|
||||||
|
|
|
||||||
|
|
@ -20,25 +20,21 @@ function GroupMngFagListView.new(group_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:initData()
|
function M:initData()
|
||||||
|
|
||||||
self.fag_result_data = {}
|
self.fag_result_data = {}
|
||||||
self.fag_data = {}
|
self.fag_data = {}
|
||||||
|
|
||||||
if self._view:GetController("page").selectedIndex < 2 then
|
if self._view:GetController("page").selectedIndex < 2 then
|
||||||
self:GetFagData(0)
|
self:GetFagData(0)
|
||||||
else
|
else
|
||||||
self:GetMngFagInfo()
|
self:GetMngFagInfo()
|
||||||
end
|
end
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if group.lev < 3 then
|
if group.lev < 3 then
|
||||||
self:GetHpStatistic()
|
self:GetHpStatistic()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillView()
|
function M:FillView()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupFagList")
|
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupFagList")
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if group.lev < 3 then
|
if group.lev < 3 then
|
||||||
|
|
@ -48,7 +44,7 @@ function M:FillView()
|
||||||
self.lst_fag = self._view:GetChild("lst_fag")
|
self.lst_fag = self._view:GetChild("lst_fag")
|
||||||
self.lst_fag:SetVirtual()
|
self.lst_fag:SetVirtual()
|
||||||
self.lst_fag.itemRenderer = function(index, obj)
|
self.lst_fag.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_fag.scrollPane.onPullUpRelease:Set(function()
|
self.lst_fag.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetFagData(self.lst_fag.numItems)
|
self:GetFagData(self.lst_fag.numItems)
|
||||||
|
|
@ -56,7 +52,7 @@ function M:FillView()
|
||||||
self.lst_fag_result = self._view:GetChild("lst_fag_result")
|
self.lst_fag_result = self._view:GetChild("lst_fag_result")
|
||||||
self.lst_fag_result:SetVirtual()
|
self.lst_fag_result:SetVirtual()
|
||||||
self.lst_fag_result.itemRenderer = function(index, obj)
|
self.lst_fag_result.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_fag_result.scrollPane.onPullUpRelease:Set(function()
|
self.lst_fag_result.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetFagData(self.lst_fag_result.numItems)
|
self:GetFagData(self.lst_fag_result.numItems)
|
||||||
|
|
@ -64,24 +60,23 @@ function M:FillView()
|
||||||
|
|
||||||
-- 切换页面事件,1,2页为上下分,3页是管理员总计
|
-- 切换页面事件,1,2页为上下分,3页是管理员总计
|
||||||
self._view:GetController("page").onChanged:Set(function()
|
self._view:GetController("page").onChanged:Set(function()
|
||||||
if self._view:GetController("page").selectedIndex < 2 then
|
if self._view:GetController("page").selectedIndex < 2 then
|
||||||
if self._view:GetController("search").selectedIndex == 0 then
|
if self._view:GetController("search").selectedIndex == 0 then
|
||||||
self.quary_id = 0
|
self.quary_id = 0
|
||||||
self.query_nick = ""
|
self.query_nick = ""
|
||||||
|
|
||||||
self.fag_data = {}
|
self.fag_data = {}
|
||||||
self:GetFagData(0)
|
self:GetFagData(0)
|
||||||
else
|
else
|
||||||
|
|
||||||
self.quary_id = 0
|
self.quary_id = 0
|
||||||
self.query_nick = ""
|
self.query_nick = ""
|
||||||
|
|
||||||
self.fag_result_data = {}
|
self.fag_result_data = {}
|
||||||
self:GetFagData(0)
|
self:GetFagData(0)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:GetMngFagInfo()
|
self:GetMngFagInfo()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self._view:GetChild("btn_search").onClick:Set(function()
|
self._view:GetChild("btn_search").onClick:Set(function()
|
||||||
|
|
@ -94,13 +89,14 @@ function M:FillView()
|
||||||
self:GetFagData(0)
|
self:GetFagData(0)
|
||||||
end)
|
end)
|
||||||
self._view:GetChild("btn_back").onClick:Set(function()
|
self._view:GetChild("btn_back").onClick:Set(function()
|
||||||
self.quary_id = 0
|
self.quary_id = 0
|
||||||
self.query_nick = ""
|
self.query_nick = ""
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.time_panel1 = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0, function()
|
self.time_panel1 = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"),
|
||||||
self:GetMngFagInfo()
|
self._view:GetChild("btn_date2"), -308, 0, function()
|
||||||
end)
|
self:GetMngFagInfo()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取上下分数据
|
-- 获取上下分数据
|
||||||
|
|
@ -109,28 +105,28 @@ function M:GetFagData(index)
|
||||||
qid = self.quary_id or 0
|
qid = self.quary_id or 0
|
||||||
qName = self.query_nick or ""
|
qName = self.query_nick or ""
|
||||||
-- 重新获取数据时,清空数据列表
|
-- 重新获取数据时,清空数据列表
|
||||||
if index == 0 then
|
if index == 0 then
|
||||||
if qid == 0 then
|
if qid == 0 then
|
||||||
self.fag_data = {}
|
self.fag_data = {}
|
||||||
else
|
else
|
||||||
self.fag_result_data = {}
|
self.fag_result_data = {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
|
|
||||||
--type:1管理员加分,2管理员减分,3合伙人加分,4合伙人减分
|
--type:1管理员加分,2管理员减分,3合伙人加分,4合伙人减分
|
||||||
local type = self._view:GetController("page").selectedIndex + 1
|
local type = self._view:GetController("page").selectedIndex + 1
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if group.lev == 3 then
|
if group.lev == 3 then
|
||||||
type = type + 2
|
type = type + 2
|
||||||
end
|
end
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMngHpLog(self.group_id, index, num, type, qid, qName, function(res)
|
fgCtr:FG_GetMngHpLog(self.group_id, index, num, type, qid, qName, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分记录失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取积分记录失败")
|
||||||
else
|
else
|
||||||
if res.Data.hp_logs ~= nil then
|
if res.Data.hp_logs ~= nil then
|
||||||
|
|
@ -151,77 +147,77 @@ function M:GetFagData(index)
|
||||||
lst.numItems = #local_data
|
lst.numItems = #local_data
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取体力值统计
|
-- 获取体力值统计
|
||||||
function M:GetHpStatistic()
|
function M:GetHpStatistic()
|
||||||
-- ViewUtil.ShowModalWait(nil, "正在获取数据")
|
-- ViewUtil.ShowModalWait2(nil, "正在获取数据")
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMngHpStatistic(self.group_id, function(res)
|
fgCtr:FG_GetMngHpStatistic(self.group_id, function(res)
|
||||||
-- ViewUtil.CloseModalWait()
|
-- ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分记录失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取积分记录失败")
|
||||||
else
|
else
|
||||||
self._view:GetChild("tex_yd_cost").text = d2ad(res.Data.last_hp_cost)
|
self._view:GetChild("tex_yd_cost").text = d2ad(res.Data.last_hp_cost)
|
||||||
self._view:GetChild("tex_td_cost").text = d2ad(res.Data.hp_cost)
|
self._view:GetChild("tex_td_cost").text = d2ad(res.Data.hp_cost)
|
||||||
self._view:GetChild("tex_add").text = d2ad(res.Data.hp_upper)
|
self._view:GetChild("tex_add").text = d2ad(res.Data.hp_upper)
|
||||||
self._view:GetChild("tex_minus").text = d2ad(res.Data.hp_sub)
|
self._view:GetChild("tex_minus").text = d2ad(res.Data.hp_sub)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取管理员总计/合伙人总计
|
-- 获取管理员总计/合伙人总计
|
||||||
function M:GetMngFagInfo()
|
function M:GetMngFagInfo()
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local begin_time, end_time = self.time_panel1:GetDate()
|
local begin_time, end_time = self.time_panel1:GetDate()
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local type = group.lev < 3 and 1 or 2
|
local type = group.lev < 3 and 1 or 2
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMngHpInfo(self.group_id, type, begin_time, end_time, function(res)
|
fgCtr:FG_GetMngHpInfo(self.group_id, type, begin_time, end_time, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
||||||
else
|
else
|
||||||
local add_count = 0
|
local add_count = 0
|
||||||
local minus_count = 0
|
local minus_count = 0
|
||||||
local lst_fag_info = self._view:GetChild("lst_mgr_data")
|
local lst_fag_info = self._view:GetChild("lst_mgr_data")
|
||||||
lst_fag_info:RemoveChildrenToPool()
|
lst_fag_info:RemoveChildrenToPool()
|
||||||
for i = 1, #res.Data.infos do
|
for i = 1, #res.Data.infos do
|
||||||
local data = res.Data.infos[i]
|
local data = res.Data.infos[i]
|
||||||
local item = lst_fag_info:AddItemFromPool()
|
local item = lst_fag_info:AddItemFromPool()
|
||||||
item:GetChild("tex_mgr").text = not data.lev and "合伙人" or (data.lev == 1 and "盟主" or "副盟主")
|
item:GetChild("tex_mgr").text = not data.lev and "合伙人" or (data.lev == 1 and "盟主" or "副盟主")
|
||||||
item:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
item:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||||
item:GetChild("tex_add").text = d2ad(data.hp_upper)
|
item:GetChild("tex_add").text = d2ad(data.hp_upper)
|
||||||
item:GetChild("tex_minus").text = d2ad(data.hp_sub)
|
item:GetChild("tex_minus").text = d2ad(data.hp_sub)
|
||||||
add_count = add_count + data.hp_upper
|
add_count = add_count + data.hp_upper
|
||||||
minus_count = minus_count + data.hp_sub
|
minus_count = minus_count + data.hp_sub
|
||||||
end
|
end
|
||||||
self._view:GetChild("tex_add2").text = d2ad(add_count)
|
self._view:GetChild("tex_add2").text = d2ad(add_count)
|
||||||
self._view:GetChild("tex_minus2").text = d2ad(minus_count)
|
self._view:GetChild("tex_minus2").text = d2ad(minus_count)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 填充对象
|
-- 填充对象
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local local_data = (self.quary_id == 0 and self.query_nick == "" ) and self.fag_data or self.fag_result_data
|
local local_data = (self.quary_id == 0 and self.query_nick == "") and self.fag_data or self.fag_result_data
|
||||||
local rdata = local_data[index + 1]
|
local rdata = local_data[index + 1]
|
||||||
local num = d2ad(rdata.hp)
|
local num = d2ad(rdata.hp)
|
||||||
obj:GetChild("tex_mgr_name").text = ViewUtil.stringEllipsis(rdata.m_nick)
|
obj:GetChild("tex_mgr_name").text = ViewUtil.stringEllipsis(rdata.m_nick)
|
||||||
obj:GetChild("tex_mgr_id").text = rdata.mgr_id
|
obj:GetChild("tex_mgr_id").text = rdata.mgr_id
|
||||||
obj:GetChild("tex_obj_name").text = ViewUtil.stringEllipsis(rdata.t_nick)
|
obj:GetChild("tex_obj_name").text = ViewUtil.stringEllipsis(rdata.t_nick)
|
||||||
obj:GetChild("tex_id").text = rdata.uid
|
obj:GetChild("tex_id").text = rdata.uid
|
||||||
obj:GetChild("tex_num").text = num >= 0 and "+".. num or num
|
obj:GetChild("tex_num").text = num >= 0 and "+" .. num or num
|
||||||
obj:GetController("add").selectedIndex = num >=0 and 1 or 0
|
obj:GetController("add").selectedIndex = num >= 0 and 1 or 0
|
||||||
obj:GetChild("tex_left").text = d2ad(rdata.cur_hp)
|
obj:GetChild("tex_left").text = d2ad(rdata.cur_hp)
|
||||||
obj:GetChild("tex_time").text = os.date("%Y-%m-%d\n%H:%M",rdata.time)
|
obj:GetChild("tex_time").text = os.date("%Y-%m-%d\n%H:%M", rdata.time)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -127,12 +127,12 @@ function M:OnRenderItem(index, obj)
|
||||||
local msg_del = MsgWindow.new(nil, "删除该玩法,该玩法的相关数据也会被清除。\r确定要删除吗?", MsgWindow.MsgMode.OkAndCancel)
|
local msg_del = MsgWindow.new(nil, "删除该玩法,该玩法的相关数据也会被清除。\r确定要删除吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||||
msg_del.onOk:Add(function(...)
|
msg_del.onOk:Add(function(...)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_DelPlay(self.group_id, play.id, function(res)
|
fgCtr:FG_DelPlay(self.group_id, play.id, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
group:delPlay(play.id)
|
group:delPlay(play.id)
|
||||||
self.lst_play.numItems = #group.playList
|
self.lst_play.numItems = #group.playList
|
||||||
|
|
@ -170,12 +170,12 @@ end
|
||||||
|
|
||||||
function M:MarkPlay(markS, pid, isMark)
|
function M:MarkPlay(markS, pid, isMark)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_MarkPlay(self.group_id, pid, isMark, function(res)
|
fgCtr:FG_MarkPlay(self.group_id, pid, isMark, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
group:markPlay(pid, isMark)
|
group:markPlay(pid, isMark)
|
||||||
|
|
@ -229,12 +229,12 @@ end
|
||||||
-- 禁止、恢复玩法
|
-- 禁止、恢复玩法
|
||||||
function M:BanPlay(pid, ban)
|
function M:BanPlay(pid, ban)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_BanPlay(self.group_id, pid, ban, function(res)
|
fgCtr:FG_BanPlay(self.group_id, pid, ban, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
group:banPlay(pid, ban)
|
group:banPlay(pid, ban)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
-- 开桌统计
|
-- 开桌统计
|
||||||
local GroupMngMemberInfoView = {}
|
local GroupMngMemberInfoView = {}
|
||||||
|
|
||||||
|
|
@ -12,30 +11,25 @@ function GroupMngMemberInfoView.new(gid)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:initData()
|
function M:initData()
|
||||||
self:ShowPeopleNum()
|
self:ShowPeopleNum()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ShowPeopleNum()
|
function M:ShowPeopleNum()
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMembersCount(self.group_id,function(res)
|
fgCtr:FG_GetMembersCount(self.group_id, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
|
|
||||||
ViewUtil.CloseModalWait()
|
|
||||||
|
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
self._view:GetChild('tex_memb_num').text = res.Data.member_num
|
self._view:GetChild('tex_memb_num').text = res.Data.member_num
|
||||||
self._view:GetChild('tex_total_hp').text = d2ad(res.Data.hp_num1+res.Data.otherHp)
|
self._view:GetChild('tex_total_hp').text = d2ad(res.Data.hp_num1 + res.Data.otherHp)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:InitView()
|
function M:InitView()
|
||||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupMemberInfo")
|
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupMemberInfo")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
||||||
|
|
||||||
return M
|
|
||||||
|
|
|
||||||
|
|
@ -75,11 +75,11 @@ function M:FillView()
|
||||||
local ctr_search = self._view:GetController('search')
|
local ctr_search = self._view:GetController('search')
|
||||||
self._view:GetChild('btn_search').onClick:Set(
|
self._view:GetChild('btn_search').onClick:Set(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local text = self._view:GetChild('tex_id').text
|
local text = self._view:GetChild('tex_id').text
|
||||||
local qid, qnick
|
local qid, qnick
|
||||||
if text == "" then
|
if text == "" then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -90,7 +90,7 @@ function M:FillView()
|
||||||
self.group_id,
|
self.group_id,
|
||||||
qid,
|
qid,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -141,7 +141,7 @@ function M:FillView()
|
||||||
if self._texnum_str == '' then
|
if self._texnum_str == '' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:GetAddMember(
|
fgCtr:GetAddMember(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
|
|
@ -149,7 +149,7 @@ function M:FillView()
|
||||||
function(response)
|
function(response)
|
||||||
printlog("响应获取添加玩家==》》》")
|
printlog("响应获取添加玩家==》》》")
|
||||||
pt(response)
|
pt(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (response.ReturnCode and response.ReturnCode == 0) then
|
if (response.ReturnCode and response.ReturnCode == 0) then
|
||||||
GroupAddMemberInfoView.new(self.group_id, tonumber(self._texnum_str)):SetAddMember(response.Data)
|
GroupAddMemberInfoView.new(self.group_id, tonumber(self._texnum_str)):SetAddMember(response.Data)
|
||||||
self:ClearNumTex()
|
self:ClearNumTex()
|
||||||
|
|
@ -191,7 +191,7 @@ function M:GetMemberData(index)
|
||||||
group:clearMember()
|
group:clearMember()
|
||||||
end
|
end
|
||||||
|
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupMembers11(
|
fgCtr:FG_GroupMembers11(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
|
|
@ -200,7 +200,7 @@ function M:GetMemberData(index)
|
||||||
false,
|
false,
|
||||||
1,
|
1,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, '获取成员列表失败')
|
ViewUtil.ErrorTip(res.ReturnCode, '获取成员列表失败')
|
||||||
else
|
else
|
||||||
|
|
@ -222,14 +222,14 @@ local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
||||||
nil,
|
nil,
|
||||||
function(num)
|
function(num)
|
||||||
num = ad2d((is_add and num or -num))
|
num = ad2d((is_add and num or -num))
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_ChangeFag(
|
fgCtr:FG_ChangeFag(
|
||||||
gid,
|
gid,
|
||||||
pid,
|
pid,
|
||||||
num,
|
num,
|
||||||
function(res1)
|
function(res1)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
-- if gniv._is_destroy then
|
-- if gniv._is_destroy then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
|
|
@ -397,11 +397,11 @@ function M:FillItem(obj, member, refresh)
|
||||||
|
|
||||||
obj:GetChild("super_btn").onClick:Set(
|
obj:GetChild("super_btn").onClick:Set(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local text = member.uid
|
local text = member.uid
|
||||||
local qid, qnick
|
local qid, qnick
|
||||||
if text == "" then
|
if text == "" then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -412,7 +412,7 @@ function M:FillItem(obj, member, refresh)
|
||||||
self.group_id,
|
self.group_id,
|
||||||
qid,
|
qid,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -449,12 +449,12 @@ end
|
||||||
function M:GetJoinsData()
|
function M:GetJoinsData()
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if group.joins > 0 then
|
if group.joins > 0 then
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupJoins(
|
fgCtr:FG_GroupJoins(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode == 0) then
|
if (res.ReturnCode == 0) then
|
||||||
local joins = res.Data.joins
|
local joins = res.Data.joins
|
||||||
group.joins = #joins
|
group.joins = #joins
|
||||||
|
|
@ -497,14 +497,14 @@ function M:FillJoinList(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:VerifyPlayerJoin(id, allow)
|
function M:VerifyPlayerJoin(id, allow)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupVerifyJoin(
|
fgCtr:FG_GroupVerifyJoin(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
id,
|
id,
|
||||||
allow,
|
allow,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode == 0) then
|
if (res.ReturnCode == 0) then
|
||||||
self:GetJoinsData()
|
self:GetJoinsData()
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -94,11 +94,11 @@ function M:FillView()
|
||||||
local ctr_search = self._view:GetController('search')
|
local ctr_search = self._view:GetController('search')
|
||||||
self._view:GetChild('btn_search').onClick:Set(
|
self._view:GetChild('btn_search').onClick:Set(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local text = self._view:GetChild('tex_id').text
|
local text = self._view:GetChild('tex_id').text
|
||||||
local qid, qnick
|
local qid, qnick
|
||||||
if text == "" then
|
if text == "" then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -109,7 +109,7 @@ function M:FillView()
|
||||||
self.group_id,
|
self.group_id,
|
||||||
qid,
|
qid,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -160,7 +160,7 @@ function M:FillView()
|
||||||
if self._texnum_str == '' then
|
if self._texnum_str == '' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:GetAddMember(
|
fgCtr:GetAddMember(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
|
|
@ -168,7 +168,7 @@ function M:FillView()
|
||||||
function(response)
|
function(response)
|
||||||
printlog("响应获取添加玩家==》》》")
|
printlog("响应获取添加玩家==》》》")
|
||||||
pt(response)
|
pt(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (response.ReturnCode and response.ReturnCode == 0) then
|
if (response.ReturnCode and response.ReturnCode == 0) then
|
||||||
GroupAddMemberInfoView.new(self.group_id, tonumber(self._texnum_str)):SetAddMember(response.Data)
|
GroupAddMemberInfoView.new(self.group_id, tonumber(self._texnum_str)):SetAddMember(response.Data)
|
||||||
self:ClearNumTex()
|
self:ClearNumTex()
|
||||||
|
|
@ -226,7 +226,7 @@ function M:GetMemberData(index)
|
||||||
group:clearMember()
|
group:clearMember()
|
||||||
end
|
end
|
||||||
|
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupMembers12(
|
fgCtr:FG_GroupMembers12(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
|
|
@ -235,7 +235,7 @@ function M:GetMemberData(index)
|
||||||
self.stype,
|
self.stype,
|
||||||
self.online,
|
self.online,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, '获取成员列表失败')
|
ViewUtil.ErrorTip(res.ReturnCode, '获取成员列表失败')
|
||||||
else
|
else
|
||||||
|
|
@ -257,14 +257,14 @@ local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
||||||
nil,
|
nil,
|
||||||
function(num)
|
function(num)
|
||||||
num = ad2d((is_add and num or -num))
|
num = ad2d((is_add and num or -num))
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_ChangeFag(
|
fgCtr:FG_ChangeFag(
|
||||||
gid,
|
gid,
|
||||||
pid,
|
pid,
|
||||||
num,
|
num,
|
||||||
function(res1)
|
function(res1)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
-- if gniv._is_destroy then
|
-- if gniv._is_destroy then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
|
|
@ -471,11 +471,11 @@ function M:FillItem(obj, member, refresh)
|
||||||
superBtn.visible = group.lev == 1
|
superBtn.visible = group.lev == 1
|
||||||
obj:GetChild("super_btn").onClick:Set(
|
obj:GetChild("super_btn").onClick:Set(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local text = member.uid
|
local text = member.uid
|
||||||
local qid, qnick
|
local qid, qnick
|
||||||
if text == "" then
|
if text == "" then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -486,7 +486,7 @@ function M:FillItem(obj, member, refresh)
|
||||||
self.group_id,
|
self.group_id,
|
||||||
qid,
|
qid,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -523,12 +523,12 @@ end
|
||||||
function M:GetJoinsData()
|
function M:GetJoinsData()
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if group.joins > 0 then
|
if group.joins > 0 then
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupJoins(
|
fgCtr:FG_GroupJoins(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode == 0) then
|
if (res.ReturnCode == 0) then
|
||||||
local joins = res.Data.joins
|
local joins = res.Data.joins
|
||||||
group.joins = #joins
|
group.joins = #joins
|
||||||
|
|
@ -571,14 +571,14 @@ function M:FillJoinList(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:VerifyPlayerJoin(id, allow)
|
function M:VerifyPlayerJoin(id, allow)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupVerifyJoin(
|
fgCtr:FG_GroupVerifyJoin(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
id,
|
id,
|
||||||
allow,
|
allow,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (res.ReturnCode == 0) then
|
if (res.ReturnCode == 0) then
|
||||||
self:GetJoinsData()
|
self:GetJoinsData()
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ function M:initData()
|
||||||
self.record_data = {}
|
self.record_data = {}
|
||||||
|
|
||||||
|
|
||||||
self:GetPartnerData(function (res)
|
self:GetPartnerData(function(res)
|
||||||
self:GetRecordData(0,true)
|
self:GetRecordData(0, true)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -26,21 +26,22 @@ function M:InitView()
|
||||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupMemberStat")
|
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupMemberStat")
|
||||||
|
|
||||||
self.lst_record = self._view:GetChild("lst_record")
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
self.lst_record:SetVirtual()
|
self.lst_record:SetVirtual()
|
||||||
self.lst_record.itemRenderer = function(index, obj)
|
self.lst_record.itemRenderer = function(index, obj)
|
||||||
self:OnRenderRecordItem(index, obj)
|
self:OnRenderRecordItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetRecordData(self.lst_record.numItems)
|
self:GetRecordData(self.lst_record.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0)
|
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
||||||
|
-308, 0)
|
||||||
|
|
||||||
local ctr_page = self._view:GetController("type")
|
local ctr_page = self._view:GetController("type")
|
||||||
ctr_page.onChanged:Set(function()
|
ctr_page.onChanged:Set(function()
|
||||||
self.record_data = {}
|
self.record_data = {}
|
||||||
self.lst_record.numItems = 0
|
self.lst_record.numItems = 0
|
||||||
self.begin_time = nil
|
self.begin_time = nil
|
||||||
self.end_time = nil
|
self.end_time = nil
|
||||||
self._view:GetChild("tex_id").text = ""
|
self._view:GetChild("tex_id").text = ""
|
||||||
self:GetRecordData(0)
|
self:GetRecordData(0)
|
||||||
|
|
@ -53,64 +54,59 @@ function M:InitView()
|
||||||
self.begin_time, self.end_time = self.time_panel:GetDate()
|
self.begin_time, self.end_time = self.time_panel:GetDate()
|
||||||
self:GetRecordData(0)
|
self:GetRecordData(0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取合伙人数据
|
-- 获取合伙人数据
|
||||||
function M:GetPartnerData(callback)
|
function M:GetPartnerData(callback)
|
||||||
|
ViewUtil.ShowModalWait2(nil)
|
||||||
ViewUtil.ShowModalWait(nil)
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetPartnerList(self.group_id, 1, nil, nil, function(res)
|
fgCtr:FG_GetPartnerList(self.group_id, 1, nil, nil, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.CloseModalWait()
|
|
||||||
callback(res)
|
callback(res)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetRecordData(index,init)
|
function M:GetRecordData(index, init)
|
||||||
|
|
||||||
if init == nil or init == false then
|
if init == nil or init == false then
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
end
|
end
|
||||||
|
|
||||||
quary_id = tonumber(self._view:GetChild("tex_id").text)
|
quary_id = tonumber(self._view:GetChild("tex_id").text)
|
||||||
quary_id = quary_id or 0
|
quary_id = quary_id or 0
|
||||||
|
|
||||||
local partner_id = DataManager.SelfUser.account_id
|
local partner_id = DataManager.SelfUser.account_id
|
||||||
|
|
||||||
|
|
||||||
local time_type = self._view:GetController("type").selectedIndex
|
local time_type = self._view:GetController("type").selectedIndex
|
||||||
if self.begin_time ~= nil and self.end_time ~= nil then
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
||||||
time_type = 3
|
time_type = 3
|
||||||
end
|
end
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMemberStat(self.group_id, quary_id,partner_id, index, 6, time_type,self.begin_time,self.end_time,function(res)
|
fgCtr:FG_GetMemberStat(self.group_id, quary_id, partner_id, index, 6, time_type, self.begin_time, self.end_time,
|
||||||
if init == nil or init == false then
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
if init == nil or init == false then
|
||||||
end
|
ViewUtil.CloseModalWait2()
|
||||||
|
|
||||||
if res.ReturnCode == 0 then
|
|
||||||
|
|
||||||
local members = res.Data.members
|
|
||||||
for i = 1, #members do
|
|
||||||
self.record_data[#self.record_data + 1] = members[i]
|
|
||||||
end
|
end
|
||||||
self.lst_record.numItems = #self.record_data
|
|
||||||
end
|
if res.ReturnCode == 0 then
|
||||||
end)
|
local members = res.Data.members
|
||||||
|
for i = 1, #members do
|
||||||
|
self.record_data[#self.record_data + 1] = members[i]
|
||||||
|
end
|
||||||
|
self.lst_record.numItems = #self.record_data
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillRecordItem(data, obj)
|
function M:FillRecordItem(data, obj)
|
||||||
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||||
|
obj:GetChild("tex_round").text = "" .. data.round
|
||||||
|
obj:GetChild("tex_win").text = "" .. data.win
|
||||||
|
obj:GetChild("tex_score").text = "" .. d2ad(data.score)
|
||||||
|
obj:GetChild("tex_current_score").text = "" .. d2ad(data.hp)
|
||||||
|
|
||||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
local ctr_type = obj:GetController("type")
|
||||||
obj:GetChild("tex_round").text = ""..data.round
|
|
||||||
obj:GetChild("tex_win").text = ""..data.win
|
|
||||||
obj:GetChild("tex_score").text = ""..d2ad(data.score)
|
|
||||||
obj:GetChild("tex_current_score").text = ""..d2ad(data.hp)
|
|
||||||
|
|
||||||
local ctr_type = obj:GetController("type")
|
|
||||||
if data.lev < 3 then
|
if data.lev < 3 then
|
||||||
ctr_type.selectedIndex = data.lev
|
ctr_type.selectedIndex = data.lev
|
||||||
elseif data.partnerLev ~= 0 then
|
elseif data.partnerLev ~= 0 then
|
||||||
|
|
@ -122,8 +118,7 @@ end
|
||||||
|
|
||||||
function M:OnRenderRecordItem(index, obj)
|
function M:OnRenderRecordItem(index, obj)
|
||||||
local data = self.record_data[index + 1]
|
local data = self.record_data[index + 1]
|
||||||
self:FillRecordItem(data, obj)
|
self:FillRecordItem(data, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
return M
|
|
||||||
|
|
|
||||||
|
|
@ -25,18 +25,18 @@ end
|
||||||
|
|
||||||
function M:initData()
|
function M:initData()
|
||||||
--self._view.visible = true
|
--self._view.visible = true
|
||||||
self:GetPartnerData(0)
|
self:GetPartnerData(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:InitView()
|
function M:InitView()
|
||||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPartnerList")
|
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPartnerList")
|
||||||
|
|
||||||
-- 初始化合伙人列表
|
-- 初始化合伙人列表
|
||||||
self.lst_partner = self._view:GetChild("lst_partner")
|
self.lst_partner = self._view:GetChild("lst_partner")
|
||||||
self.lst_partner:SetVirtual()
|
self.lst_partner:SetVirtual()
|
||||||
self.lst_partner.itemRenderer = function(index, obj)
|
self.lst_partner.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_partner.scrollPane.onPullUpRelease:Set(function()
|
self.lst_partner.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetPartnerData(self.lst_partner.numItems)
|
self:GetPartnerData(self.lst_partner.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
@ -44,14 +44,14 @@ function M:InitView()
|
||||||
local btn_search = self._view:GetChild("btn_search")
|
local btn_search = self._view:GetChild("btn_search")
|
||||||
btn_search.onClick:Set(function()
|
btn_search.onClick:Set(function()
|
||||||
local text = self._view:GetChild("tex_id").text
|
local text = self._view:GetChild("tex_id").text
|
||||||
local query_id = tonumber(text) or 0
|
local query_id = tonumber(text) or 0
|
||||||
local query_nick = text
|
local query_nick = text
|
||||||
self._view:GetChild("tex_id").text = ""
|
self._view:GetChild("tex_id").text = ""
|
||||||
self:QueryPartnerData(query_id, query_nick)
|
self:QueryPartnerData(query_id, query_nick)
|
||||||
end)
|
end)
|
||||||
local btn_back = self._view:GetChild("btn_back")
|
local btn_back = self._view:GetChild("btn_back")
|
||||||
btn_back.onClick:Set(function()
|
btn_back.onClick:Set(function()
|
||||||
self._view:GetController("search").selectedIndex = 0
|
self._view:GetController("search").selectedIndex = 0
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -60,44 +60,42 @@ function M:InitView()
|
||||||
|
|
||||||
self.tex_num = self._view:GetChild("tex_num")
|
self.tex_num = self._view:GetChild("tex_num")
|
||||||
self:ClearNumTex()
|
self:ClearNumTex()
|
||||||
|
|
||||||
for i = 0 ,9 do
|
for i = 0, 9 do
|
||||||
local obj = self._view:GetChild("btn_"..i)
|
local obj = self._view:GetChild("btn_" .. i)
|
||||||
obj.onClick:Add(handler(self , self.OnNumButtonAction))
|
obj.onClick:Add(handler(self, self.OnNumButtonAction))
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
local btn_ok = self._view:GetChild("btn_ok")
|
local btn_ok = self._view:GetChild("btn_ok")
|
||||||
btn_ok.onClick:Set(function()
|
btn_ok.onClick:Set(function()
|
||||||
|
ViewUtil.ShowModalWait2(nil)
|
||||||
ViewUtil.ShowModalWait(nil)
|
|
||||||
local qid = tonumber(self._view:GetChild("tex_num").text)
|
local qid = tonumber(self._view:GetChild("tex_num").text)
|
||||||
if not qid then
|
if not qid then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, "输入ID进行搜索!")
|
ViewUtil.ErrorTip(nil, "输入ID进行搜索!")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_FindMember(self.group_id, qid, function(res)
|
fgCtr:FG_FindMember(self.group_id, qid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
||||||
else
|
else
|
||||||
|
|
||||||
local member = res.Data
|
local member = res.Data
|
||||||
if member.parentId ~= 0 and member.parentId ~= DataManager.SelfUser.account_id then
|
if member.parentId ~= 0 and member.parentId ~= DataManager.SelfUser.account_id then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if member.partnerLev > 0 then
|
if member.partnerLev > 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "该玩家已经是代理!")
|
ViewUtil.ErrorTip(res.ReturnCode, "该玩家已经是代理!")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local mflv = GroupMngAddPartner.new(self.group_id, member,function ()
|
local mflv = GroupMngAddPartner.new(self.group_id, member, function()
|
||||||
self:GetPartnerData(self.lst_partner.numItems)
|
self:GetPartnerData(self.lst_partner.numItems)
|
||||||
self._view:GetController("page").selectedIndex = 0
|
self._view:GetController("page").selectedIndex = 0
|
||||||
end)
|
end)
|
||||||
|
|
@ -106,7 +104,7 @@ function M:InitView()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
local btn_del = self._view:GetChild("btn_del")
|
local btn_del = self._view:GetChild("btn_del")
|
||||||
btn_del.onClick:Add(handler(self , self.OnNumButtonAction))
|
btn_del.onClick:Add(handler(self, self.OnNumButtonAction))
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ClearNumTex()
|
function M:ClearNumTex()
|
||||||
|
|
@ -116,88 +114,80 @@ function M:ClearNumTex()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnNumButtonAction(context)
|
function M:OnNumButtonAction(context)
|
||||||
local typer = string.sub(context.sender.name ,5)
|
local typer = string.sub(context.sender.name, 5)
|
||||||
if typer == "del" then
|
if typer == "del" then
|
||||||
if (self._currenIndex > 0) then
|
if (self._currenIndex > 0) then
|
||||||
self._currenIndex = self._currenIndex - 1
|
self._currenIndex = self._currenIndex - 1
|
||||||
self._texnum_str = string.sub(self._texnum_str,0,self._currenIndex)
|
self._texnum_str = string.sub(self._texnum_str, 0, self._currenIndex)
|
||||||
self.tex_num.text = self._texnum_str
|
self.tex_num.text = self._texnum_str
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (self._currenIndex < 6) then
|
if (self._currenIndex < 6) then
|
||||||
|
|
||||||
self._currenIndex = self._currenIndex + 1
|
self._currenIndex = self._currenIndex + 1
|
||||||
self._texnum_str = self._texnum_str .. typer
|
self._texnum_str = self._texnum_str .. typer
|
||||||
self.tex_num.text = self._texnum_str
|
self.tex_num.text = self._texnum_str
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 获取合伙人数据
|
-- 获取合伙人数据
|
||||||
function M:GetPartnerData(index,callback)
|
function M:GetPartnerData(index, callback)
|
||||||
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local group = DataManager.groups:get(self.group_id)
|
if index == 0 then
|
||||||
if index == 0 then
|
self.partner_data = {}
|
||||||
self.partner_data = {}
|
end
|
||||||
end
|
ViewUtil.ShowModalWait2(nil)
|
||||||
ViewUtil.ShowModalWait(nil)
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetPartnerList(self.group_id, 0, index, 10, function(res)
|
fgCtr:FG_GetPartnerList(self.group_id, 0, index, 10, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.CloseModalWait()
|
if res.ReturnCode ~= 0 then
|
||||||
if res.ReturnCode ~= 0 then
|
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||||
else
|
else
|
||||||
local partners = res.Data.members
|
local partners = res.Data.members
|
||||||
for i = 1, #partners do
|
for i = 1, #partners do
|
||||||
self.partner_data[#self.partner_data + 1] = partners[i]
|
self.partner_data[#self.partner_data + 1] = partners[i]
|
||||||
end
|
end
|
||||||
self.lst_partner.numItems = #self.partner_data
|
self.lst_partner.numItems = #self.partner_data
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取合伙人数据
|
-- 获取合伙人数据
|
||||||
function M:QueryPartnerData(query_id,query_nick)
|
function M:QueryPartnerData(query_id, query_nick)
|
||||||
|
|
||||||
query_nick = query_nick or ""
|
query_nick = query_nick or ""
|
||||||
query_id = query_id or 0
|
query_id = query_id or 0
|
||||||
|
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
|
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res)
|
fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.CloseModalWait()
|
if res.ReturnCode ~= 0 then
|
||||||
if res.ReturnCode ~= 0 then
|
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||||
else
|
else
|
||||||
|
|
||||||
if res.Data.members ~= nil and #res.Data.members > 0 then
|
if res.Data.members ~= nil and #res.Data.members > 0 then
|
||||||
self._view:GetController("search").selectedIndex = 1
|
self._view:GetController("search").selectedIndex = 1
|
||||||
local lst_partner_search = self._view:GetChild("lst_partner_search")
|
local lst_partner_search = self._view:GetChild("lst_partner_search")
|
||||||
lst_partner_search:RemoveChildrenToPool()
|
lst_partner_search:RemoveChildrenToPool()
|
||||||
for i = 1, #res.Data.members do
|
for i = 1, #res.Data.members do
|
||||||
local tem = lst_partner_search:AddItemFromPool()
|
local tem = lst_partner_search:AddItemFromPool()
|
||||||
self:FillItem(tem,res.Data.members[i])
|
self:FillItem(tem, res.Data.members[i])
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到指定的玩家")
|
ViewUtil.ErrorTip(res.ReturnCode, "找不到指定的玩家")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 管理员权限
|
-- 管理员权限
|
||||||
local MngPermissionList = {
|
local MngPermissionList = {
|
||||||
DeleteMember = 1,-- 删除成员
|
DeleteMember = 1, -- 删除成员
|
||||||
AddMember = 2,--添加成员
|
AddMember = 2, --添加成员
|
||||||
SetFag = 3,--设置体力值
|
SetFag = 3, --设置体力值
|
||||||
BanPlaying = 4,--禁止游戏
|
BanPlaying = 4, --禁止游戏
|
||||||
BanSameTable = 5--禁止同桌
|
BanSameTable = 5 --禁止同桌
|
||||||
}
|
}
|
||||||
local function CheckPermission(lev, permission)
|
local function CheckPermission(lev, permission)
|
||||||
if lev == 2 and not permission then
|
if lev == 2 and not permission then
|
||||||
|
|
@ -211,20 +201,20 @@ end
|
||||||
local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
||||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||||
num = ad2d((is_add and num or -num))
|
num = ad2d((is_add and num or -num))
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_ChangeFag(gid, pid, num, function(res1)
|
fgCtr:FG_ChangeFag(gid, pid, num, function(res1)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
-- if gniv._is_destroy then
|
-- if gniv._is_destroy then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
if (res1.ReturnCode == 0) then
|
if (res1.ReturnCode == 0) then
|
||||||
callback(res1.Data)
|
callback(res1.Data)
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res1.ReturnCode,"更改积分失败!")
|
ViewUtil.ErrorTip(res1.ReturnCode, "更改积分失败!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
-- item:GetChild("tex_fag").text = (self_user or show_fag) and num or show_fag_str
|
-- item:GetChild("tex_fag").text = (self_user or show_fag) and num or show_fag_str
|
||||||
end, is_add and 1 or 2, cur_hp and d2ad(cur_hp) or nil)
|
end, is_add and 1 or 2, cur_hp and d2ad(cur_hp) or nil)
|
||||||
gniv:Show()
|
gniv:Show()
|
||||||
end
|
end
|
||||||
|
|
@ -243,7 +233,6 @@ end
|
||||||
|
|
||||||
-- 填充合伙人对象
|
-- 填充合伙人对象
|
||||||
function M:FillItem(obj, partner)
|
function M:FillItem(obj, partner)
|
||||||
|
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local perm_array = MngPermission.getPermData(group.permission)
|
local perm_array = MngPermission.getPermData(group.permission)
|
||||||
|
|
||||||
|
|
@ -252,7 +241,7 @@ function M:FillItem(obj, partner)
|
||||||
obj:GetChild("btn_head").icon = "ui://Common/Head0"
|
obj:GetChild("btn_head").icon = "ui://Common/Head0"
|
||||||
ImageLoad.Load(partner.portrait, obj:GetChild("btn_head")._iconObject, self.class)
|
ImageLoad.Load(partner.portrait, obj:GetChild("btn_head")._iconObject, self.class)
|
||||||
-- 体力值操作按钮事件
|
-- 体力值操作按钮事件
|
||||||
if group.lev == 1 or group.lev < 3 or (partner.uid ~= DataManager.SelfUser.account_id and group.partnerLev > 0) then
|
if group.lev == 1 or group.lev < 3 or (partner.uid ~= DataManager.SelfUser.account_id and group.partnerLev > 0) then
|
||||||
obj:GetController("fag").selectedIndex = 1
|
obj:GetController("fag").selectedIndex = 1
|
||||||
else
|
else
|
||||||
obj:GetController("fag").selectedIndex = 0
|
obj:GetController("fag").selectedIndex = 0
|
||||||
|
|
@ -262,7 +251,7 @@ function M:FillItem(obj, partner)
|
||||||
local p = group:getMember(partner.uid)
|
local p = group:getMember(partner.uid)
|
||||||
local mp = group:getMember(DataManager.SelfUser.account_id)
|
local mp = group:getMember(DataManager.SelfUser.account_id)
|
||||||
obj:GetChild("btn_fag_add").onClick:Set(function()
|
obj:GetChild("btn_fag_add").onClick:Set(function()
|
||||||
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
__change_fag(self.group_id, partner.uid, true, nil, function(data)
|
__change_fag(self.group_id, partner.uid, true, nil, function(data)
|
||||||
|
|
@ -283,8 +272,7 @@ function M:FillItem(obj, partner)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
obj:GetChild("btn_fag_minus").onClick:Set(function()
|
obj:GetChild("btn_fag_minus").onClick:Set(function()
|
||||||
|
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
||||||
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
__change_fag(self.group_id, partner.uid, false, partner.hp, function(data)
|
__change_fag(self.group_id, partner.uid, false, partner.hp, function(data)
|
||||||
|
|
@ -306,8 +294,8 @@ function M:FillItem(obj, partner)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
obj:GetChild("tex_fag").text = d2ad(partner.hp)
|
obj:GetChild("tex_fag").text = d2ad(partner.hp)
|
||||||
|
|
||||||
obj:GetChild("tex_member_count").text = ""..partner.total
|
obj:GetChild("tex_member_count").text = "" .. partner.total
|
||||||
|
|
||||||
|
|
||||||
obj:GetChild("btn_percent").onClick:Set(function()
|
obj:GetChild("btn_percent").onClick:Set(function()
|
||||||
|
|
@ -328,16 +316,11 @@ function M:FillItem(obj, partner)
|
||||||
local btnDetail = obj:GetChild("btn_detail")
|
local btnDetail = obj:GetChild("btn_detail")
|
||||||
btnDetail.visible = partner.total > 0
|
btnDetail.visible = partner.total > 0
|
||||||
btnDetail.onClick:Set(function()
|
btnDetail.onClick:Set(function()
|
||||||
local GroupMngPartnerListView2 = GroupMngPartnerListView2.new(self.group_id,partner.uid)
|
local GroupMngPartnerListView2 = GroupMngPartnerListView2.new(self.group_id, partner.uid)
|
||||||
GroupMngPartnerListView2:Show()
|
GroupMngPartnerListView2:Show()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 列表对象填充
|
-- 列表对象填充
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local partner = self.partner_data[index + 1]
|
local partner = self.partner_data[index + 1]
|
||||||
|
|
@ -346,8 +329,8 @@ end
|
||||||
|
|
||||||
-- 显示合伙人成员列表
|
-- 显示合伙人成员列表
|
||||||
function M:ShowPartnerMemberList(partner_id)
|
function M:ShowPartnerMemberList(partner_id)
|
||||||
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
||||||
pmlv:Show()
|
pmlv:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 显示合伙人奖励
|
-- 显示合伙人奖励
|
||||||
|
|
@ -356,4 +339,4 @@ function M:ShowPartnerRewards(partner_id, partnerLev)
|
||||||
prv:Show()
|
prv:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -19,23 +19,23 @@ function GroupMngPartnerListView1.new(gid, blur_view)
|
||||||
self.blur_view = blur_view
|
self.blur_view = blur_view
|
||||||
self.partner_data = {}
|
self.partner_data = {}
|
||||||
self:InitView()
|
self:InitView()
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:initData()
|
function M:initData()
|
||||||
--self._view.visible = true
|
--self._view.visible = true
|
||||||
self:GetPartnerData(0)
|
self:GetPartnerData(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:InitView()
|
function M:InitView()
|
||||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPartnerList1")
|
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPartnerList1")
|
||||||
|
|
||||||
-- 初始化合伙人列表
|
-- 初始化合伙人列表
|
||||||
self.lst_partner = self._view:GetChild("lst_partner")
|
self.lst_partner = self._view:GetChild("lst_partner")
|
||||||
self.lst_partner:SetVirtual()
|
self.lst_partner:SetVirtual()
|
||||||
self.lst_partner.itemRenderer = function(index, obj)
|
self.lst_partner.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_partner.scrollPane.onPullUpRelease:Set(function()
|
self.lst_partner.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetPartnerData(self.lst_partner.numItems)
|
self:GetPartnerData(self.lst_partner.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
@ -43,14 +43,14 @@ function M:InitView()
|
||||||
local btn_search = self._view:GetChild("btn_search")
|
local btn_search = self._view:GetChild("btn_search")
|
||||||
btn_search.onClick:Set(function()
|
btn_search.onClick:Set(function()
|
||||||
local text = self._view:GetChild("tex_id").text
|
local text = self._view:GetChild("tex_id").text
|
||||||
local query_id = tonumber(text) or 0
|
local query_id = tonumber(text) or 0
|
||||||
local query_nick = text
|
local query_nick = text
|
||||||
self._view:GetChild("tex_id").text = ""
|
self._view:GetChild("tex_id").text = ""
|
||||||
self:QueryPartnerData(query_id, query_nick)
|
self:QueryPartnerData(query_id, query_nick)
|
||||||
end)
|
end)
|
||||||
local btn_back = self._view:GetChild("btn_back")
|
local btn_back = self._view:GetChild("btn_back")
|
||||||
btn_back.onClick:Set(function()
|
btn_back.onClick:Set(function()
|
||||||
--self._view:GetController("search").selectedIndex = 0
|
--self._view:GetController("search").selectedIndex = 0
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -59,44 +59,42 @@ function M:InitView()
|
||||||
|
|
||||||
self.tex_num = self._view:GetChild("tex_num")
|
self.tex_num = self._view:GetChild("tex_num")
|
||||||
self:ClearNumTex()
|
self:ClearNumTex()
|
||||||
|
|
||||||
for i = 0 ,9 do
|
for i = 0, 9 do
|
||||||
local obj = self._view:GetChild("btn_"..i)
|
local obj = self._view:GetChild("btn_" .. i)
|
||||||
obj.onClick:Add(handler(self , self.OnNumButtonAction))
|
obj.onClick:Add(handler(self, self.OnNumButtonAction))
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
local btn_ok = self._view:GetChild("btn_ok")
|
local btn_ok = self._view:GetChild("btn_ok")
|
||||||
btn_ok.onClick:Set(function()
|
btn_ok.onClick:Set(function()
|
||||||
|
ViewUtil.ShowModalWait2(nil)
|
||||||
ViewUtil.ShowModalWait(nil)
|
|
||||||
local qid = tonumber(self._view:GetChild("tex_num").text)
|
local qid = tonumber(self._view:GetChild("tex_num").text)
|
||||||
if not qid then
|
if not qid then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, "输入ID进行搜索!")
|
ViewUtil.ErrorTip(nil, "输入ID进行搜索!")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_FindMember(self.group_id, qid, function(res)
|
fgCtr:FG_FindMember(self.group_id, qid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
||||||
else
|
else
|
||||||
|
|
||||||
local member = res.Data
|
local member = res.Data
|
||||||
if member.parentId ~= 0 and member.parentId ~= DataManager.SelfUser.account_id then
|
if member.parentId ~= 0 and member.parentId ~= DataManager.SelfUser.account_id then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if member.partnerLev > 0 then
|
if member.partnerLev > 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "该玩家已经是代理!")
|
ViewUtil.ErrorTip(res.ReturnCode, "该玩家已经是代理!")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local mflv = GroupMngAddPartner.new(self.group_id, member,function ()
|
local mflv = GroupMngAddPartner.new(self.group_id, member, function()
|
||||||
self:GetPartnerData(self.lst_partner.numItems)
|
self:GetPartnerData(self.lst_partner.numItems)
|
||||||
--self._view:GetController("page").selectedIndex = 0
|
--self._view:GetController("page").selectedIndex = 0
|
||||||
end)
|
end)
|
||||||
|
|
@ -105,7 +103,7 @@ function M:InitView()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
local btn_del = self._view:GetChild("btn_del")
|
local btn_del = self._view:GetChild("btn_del")
|
||||||
btn_del.onClick:Add(handler(self , self.OnNumButtonAction))
|
btn_del.onClick:Add(handler(self, self.OnNumButtonAction))
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ClearNumTex()
|
function M:ClearNumTex()
|
||||||
|
|
@ -115,90 +113,82 @@ function M:ClearNumTex()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnNumButtonAction(context)
|
function M:OnNumButtonAction(context)
|
||||||
local typer = string.sub(context.sender.name ,5)
|
local typer = string.sub(context.sender.name, 5)
|
||||||
if typer == "del" then
|
if typer == "del" then
|
||||||
if (self._currenIndex > 0) then
|
if (self._currenIndex > 0) then
|
||||||
self._currenIndex = self._currenIndex - 1
|
self._currenIndex = self._currenIndex - 1
|
||||||
self._texnum_str = string.sub(self._texnum_str,0,self._currenIndex)
|
self._texnum_str = string.sub(self._texnum_str, 0, self._currenIndex)
|
||||||
self.tex_num.text = self._texnum_str
|
self.tex_num.text = self._texnum_str
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (self._currenIndex < 6) then
|
if (self._currenIndex < 6) then
|
||||||
|
|
||||||
self._currenIndex = self._currenIndex + 1
|
self._currenIndex = self._currenIndex + 1
|
||||||
self._texnum_str = self._texnum_str .. typer
|
self._texnum_str = self._texnum_str .. typer
|
||||||
self.tex_num.text = self._texnum_str
|
self.tex_num.text = self._texnum_str
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 获取合伙人数据
|
-- 获取合伙人数据
|
||||||
function M:GetPartnerData(index,callback)
|
function M:GetPartnerData(index, callback)
|
||||||
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local group = DataManager.groups:get(self.group_id)
|
if index == 0 then
|
||||||
if index == 0 then
|
self.partner_data = {}
|
||||||
self.partner_data = {}
|
end
|
||||||
end
|
ViewUtil.ShowModalWait2(nil)
|
||||||
ViewUtil.ShowModalWait(nil)
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupTiChu(self.group_id, index, 10, function(res)
|
fgCtr:FG_GroupTiChu(self.group_id, index, 10, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.CloseModalWait()
|
if res.ReturnCode ~= 0 then
|
||||||
if res.ReturnCode ~= 0 then
|
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取踢出列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取踢出列表失败")
|
||||||
else
|
else
|
||||||
--printlog("aaaaaaaaaaaaa1111111111111111111111")
|
--printlog("aaaaaaaaaaaaa1111111111111111111111")
|
||||||
--pt(res)
|
--pt(res)
|
||||||
local partners = res.Data.data
|
local partners = res.Data.data
|
||||||
for i = 1, #partners do
|
for i = 1, #partners do
|
||||||
self.partner_data[#self.partner_data + 1] = partners[i]
|
self.partner_data[#self.partner_data + 1] = partners[i]
|
||||||
end
|
end
|
||||||
self.lst_partner.numItems = #self.partner_data
|
self.lst_partner.numItems = #self.partner_data
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取合伙人数据
|
-- 获取合伙人数据
|
||||||
function M:QueryPartnerData(query_id,query_nick)
|
function M:QueryPartnerData(query_id, query_nick)
|
||||||
|
|
||||||
query_nick = query_nick or ""
|
query_nick = query_nick or ""
|
||||||
query_id = query_id or 0
|
query_id = query_id or 0
|
||||||
|
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
|
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res)
|
fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.CloseModalWait()
|
if res.ReturnCode ~= 0 then
|
||||||
if res.ReturnCode ~= 0 then
|
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||||
else
|
else
|
||||||
|
|
||||||
if res.Data.members ~= nil and #res.Data.members > 0 then
|
if res.Data.members ~= nil and #res.Data.members > 0 then
|
||||||
-- self._view:GetController("search").selectedIndex = 1
|
-- self._view:GetController("search").selectedIndex = 1
|
||||||
local lst_partner_search = self._view:GetChild("lst_partner_search")
|
local lst_partner_search = self._view:GetChild("lst_partner_search")
|
||||||
lst_partner_search:RemoveChildrenToPool()
|
lst_partner_search:RemoveChildrenToPool()
|
||||||
for i = 1, #res.Data.members do
|
for i = 1, #res.Data.members do
|
||||||
local tem = lst_partner_search:AddItemFromPool()
|
local tem = lst_partner_search:AddItemFromPool()
|
||||||
self:FillItem(tem,res.Data.members[i])
|
self:FillItem(tem, res.Data.members[i])
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到指定的玩家")
|
ViewUtil.ErrorTip(res.ReturnCode, "找不到指定的玩家")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 管理员权限
|
-- 管理员权限
|
||||||
local MngPermissionList = {
|
local MngPermissionList = {
|
||||||
DeleteMember = 1,-- 删除成员
|
DeleteMember = 1, -- 删除成员
|
||||||
AddMember = 2,--添加成员
|
AddMember = 2, --添加成员
|
||||||
SetFag = 3,--设置体力值
|
SetFag = 3, --设置体力值
|
||||||
BanPlaying = 4,--禁止游戏
|
BanPlaying = 4, --禁止游戏
|
||||||
BanSameTable = 5--禁止同桌
|
BanSameTable = 5 --禁止同桌
|
||||||
}
|
}
|
||||||
local function CheckPermission(lev, permission)
|
local function CheckPermission(lev, permission)
|
||||||
if lev == 2 and not permission then
|
if lev == 2 and not permission then
|
||||||
|
|
@ -212,20 +202,20 @@ end
|
||||||
local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
||||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||||
num = ad2d((is_add and num or -num))
|
num = ad2d((is_add and num or -num))
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_ChangeFag(gid, pid, num, function(res1)
|
fgCtr:FG_ChangeFag(gid, pid, num, function(res1)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
-- if gniv._is_destroy then
|
-- if gniv._is_destroy then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
if (res1.ReturnCode == 0) then
|
if (res1.ReturnCode == 0) then
|
||||||
callback(res1.Data)
|
callback(res1.Data)
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res1.ReturnCode,"更改积分失败!")
|
ViewUtil.ErrorTip(res1.ReturnCode, "更改积分失败!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
-- item:GetChild("tex_fag").text = (self_user or show_fag) and num or show_fag_str
|
-- item:GetChild("tex_fag").text = (self_user or show_fag) and num or show_fag_str
|
||||||
end, is_add and 1 or 2, cur_hp and d2ad(cur_hp) or nil)
|
end, is_add and 1 or 2, cur_hp and d2ad(cur_hp) or nil)
|
||||||
gniv:Show()
|
gniv:Show()
|
||||||
end
|
end
|
||||||
|
|
@ -244,17 +234,16 @@ end
|
||||||
|
|
||||||
-- 填充合伙人对象
|
-- 填充合伙人对象
|
||||||
function M:FillItem(obj, partner)
|
function M:FillItem(obj, partner)
|
||||||
|
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local perm_array = MngPermission.getPermData(group.permission)
|
local perm_array = MngPermission.getPermData(group.permission)
|
||||||
|
|
||||||
obj:GetChild("tex_id").text = "("..partner.id..")"--partner.uid
|
obj:GetChild("tex_id").text = "(" .. partner.id .. ")" --partner.uid
|
||||||
|
|
||||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(partner.nick)
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(partner.nick)
|
||||||
obj:GetChild("btn_head").icon = "ui://Common/Head0"
|
obj:GetChild("btn_head").icon = "ui://Common/Head0"
|
||||||
ImageLoad.Load(partner.portrait, obj:GetChild("btn_head")._iconObject, self.class)
|
ImageLoad.Load(partner.portrait, obj:GetChild("btn_head")._iconObject, self.class)
|
||||||
-- 体力值操作按钮事件
|
-- 体力值操作按钮事件
|
||||||
if group.lev == 1 or group.lev < 3 or (partner.uid ~= DataManager.SelfUser.account_id and group.partnerLev > 0) then
|
if group.lev == 1 or group.lev < 3 or (partner.uid ~= DataManager.SelfUser.account_id and group.partnerLev > 0) then
|
||||||
--obj:GetController("fag").selectedIndex = 1
|
--obj:GetController("fag").selectedIndex = 1
|
||||||
else
|
else
|
||||||
--obj:GetController("fag").selectedIndex = 0
|
--obj:GetController("fag").selectedIndex = 0
|
||||||
|
|
@ -264,7 +253,7 @@ function M:FillItem(obj, partner)
|
||||||
local p = group:getMember(partner.uid)
|
local p = group:getMember(partner.uid)
|
||||||
local mp = group:getMember(DataManager.SelfUser.account_id)
|
local mp = group:getMember(DataManager.SelfUser.account_id)
|
||||||
obj:GetChild("btn_fag_add").onClick:Set(function()
|
obj:GetChild("btn_fag_add").onClick:Set(function()
|
||||||
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
__change_fag(self.group_id, partner.uid, true, nil, function(data)
|
__change_fag(self.group_id, partner.uid, true, nil, function(data)
|
||||||
|
|
@ -285,8 +274,7 @@ function M:FillItem(obj, partner)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
obj:GetChild("btn_fag_minus").onClick:Set(function()
|
obj:GetChild("btn_fag_minus").onClick:Set(function()
|
||||||
|
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
||||||
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
__change_fag(self.group_id, partner.uid, false, partner.hp, function(data)
|
__change_fag(self.group_id, partner.uid, false, partner.hp, function(data)
|
||||||
|
|
@ -307,9 +295,9 @@ function M:FillItem(obj, partner)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- obj:GetChild("tex_fag").text = d2ad(partner.hp)
|
-- obj:GetChild("tex_fag").text = d2ad(partner.hp)
|
||||||
|
|
||||||
obj:GetChild("tex_member_count").text = ""..partner.round
|
obj:GetChild("tex_member_count").text = "" .. partner.round
|
||||||
obj:GetChild("tex_fenzu").text = partner.group
|
obj:GetChild("tex_fenzu").text = partner.group
|
||||||
obj:GetChild("tex_caozuo").text = partner.opnick
|
obj:GetChild("tex_caozuo").text = partner.opnick
|
||||||
obj:GetChild("tex_tuichu").text = os.date('%Y/%m/%d %H:%M', partner.deltime)
|
obj:GetChild("tex_tuichu").text = os.date('%Y/%m/%d %H:%M', partner.deltime)
|
||||||
|
|
@ -331,9 +319,6 @@ function M:FillItem(obj, partner)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 列表对象填充
|
-- 列表对象填充
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local partner = self.partner_data[index + 1]
|
local partner = self.partner_data[index + 1]
|
||||||
|
|
@ -342,8 +327,8 @@ end
|
||||||
|
|
||||||
-- 显示合伙人成员列表
|
-- 显示合伙人成员列表
|
||||||
function M:ShowPartnerMemberList(partner_id)
|
function M:ShowPartnerMemberList(partner_id)
|
||||||
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
||||||
pmlv:Show()
|
pmlv:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 显示合伙人奖励
|
-- 显示合伙人奖励
|
||||||
|
|
@ -352,4 +337,4 @@ function M:ShowPartnerRewards(partner_id, partnerLev)
|
||||||
prv:Show()
|
prv:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ local GroupMngPartnerListView2 = {}
|
||||||
|
|
||||||
local M = GroupMngPartnerListView2
|
local M = GroupMngPartnerListView2
|
||||||
|
|
||||||
function GroupMngPartnerListView2.new(gid,tagId)
|
function GroupMngPartnerListView2.new(gid, tagId)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupMngPartnerListView2"
|
self.class = "GroupMngPartnerListView2"
|
||||||
self._full = true
|
self._full = true
|
||||||
self.group_id = gid
|
self.group_id = gid
|
||||||
|
|
@ -24,17 +24,15 @@ function GroupMngPartnerListView2.new(gid,tagId)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function M:InitView()
|
function M:InitView()
|
||||||
-- self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/Win_StatMember")
|
-- self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/Win_StatMember")
|
||||||
BaseWindow.init(self,"ui://NewGroup/Win_StatMember")
|
BaseWindow.init(self, "ui://NewGroup/Win_StatMember")
|
||||||
-- 初始化合伙人列表
|
-- 初始化合伙人列表
|
||||||
self.lst_partner = self._view:GetChild("lst_partner")
|
self.lst_partner = self._view:GetChild("lst_partner")
|
||||||
self.lst_partner:SetVirtual()
|
self.lst_partner:SetVirtual()
|
||||||
self.lst_partner.itemRenderer = function(index, obj)
|
self.lst_partner.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_partner.scrollPane.onPullUpRelease:Set(function()
|
self.lst_partner.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetPartnerData(self.lst_partner.numItems)
|
self:GetPartnerData(self.lst_partner.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
@ -46,72 +44,64 @@ function M:InitView()
|
||||||
self:GetPartnerData(0)
|
self:GetPartnerData(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 获取合伙人数据
|
-- 获取合伙人数据
|
||||||
function M:GetPartnerData(index,callback)
|
function M:GetPartnerData(index, callback)
|
||||||
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local group = DataManager.groups:get(self.group_id)
|
if index == 0 then
|
||||||
if index == 0 then
|
self.partner_data = {}
|
||||||
self.partner_data = {}
|
end
|
||||||
end
|
ViewUtil.ShowModalWait2(nil)
|
||||||
ViewUtil.ShowModalWait(nil)
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetPartnerList(self.group_id, 0, index, 10, function(res)
|
fgCtr:FG_GetPartnerList(self.group_id, 0, index, 10, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.CloseModalWait()
|
if res.ReturnCode ~= 0 then
|
||||||
if res.ReturnCode ~= 0 then
|
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
else
|
||||||
else
|
local partners = res.Data.members
|
||||||
local partners = res.Data.members
|
for i = 1, #partners do
|
||||||
for i = 1, #partners do
|
self.partner_data[#self.partner_data + 1] = partners[i]
|
||||||
self.partner_data[#self.partner_data + 1] = partners[i]
|
end
|
||||||
|
self.lst_partner.numItems = #self.partner_data
|
||||||
end
|
end
|
||||||
self.lst_partner.numItems = #self.partner_data
|
end,
|
||||||
end
|
self.tagId)
|
||||||
end,
|
|
||||||
self.tagId)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取合伙人数据
|
-- 获取合伙人数据
|
||||||
function M:QueryPartnerData(query_id,query_nick)
|
function M:QueryPartnerData(query_id, query_nick)
|
||||||
|
|
||||||
query_nick = query_nick or ""
|
query_nick = query_nick or ""
|
||||||
query_id = query_id or 0
|
query_id = query_id or 0
|
||||||
|
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
|
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res)
|
fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.CloseModalWait()
|
if res.ReturnCode ~= 0 then
|
||||||
if res.ReturnCode ~= 0 then
|
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||||
else
|
else
|
||||||
|
|
||||||
if res.Data.members ~= nil and #res.Data.members > 0 then
|
if res.Data.members ~= nil and #res.Data.members > 0 then
|
||||||
|
|
||||||
local lst_partner_search = self._view:GetChild("lst_partner_search")
|
local lst_partner_search = self._view:GetChild("lst_partner_search")
|
||||||
lst_partner_search:RemoveChildrenToPool()
|
lst_partner_search:RemoveChildrenToPool()
|
||||||
for i = 1, #res.Data.members do
|
for i = 1, #res.Data.members do
|
||||||
local tem = lst_partner_search:AddItemFromPool()
|
local tem = lst_partner_search:AddItemFromPool()
|
||||||
self:FillItem(tem,res.Data.members[i])
|
self:FillItem(tem, res.Data.members[i])
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到指定的玩家")
|
ViewUtil.ErrorTip(res.ReturnCode, "找不到指定的玩家")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 管理员权限
|
-- 管理员权限
|
||||||
local MngPermissionList = {
|
local MngPermissionList = {
|
||||||
DeleteMember = 1,-- 删除成员
|
DeleteMember = 1, -- 删除成员
|
||||||
AddMember = 2,--添加成员
|
AddMember = 2, --添加成员
|
||||||
SetFag = 3,--设置体力值
|
SetFag = 3, --设置体力值
|
||||||
BanPlaying = 4,--禁止游戏
|
BanPlaying = 4, --禁止游戏
|
||||||
BanSameTable = 5--禁止同桌
|
BanSameTable = 5 --禁止同桌
|
||||||
}
|
}
|
||||||
local function CheckPermission(lev, permission)
|
local function CheckPermission(lev, permission)
|
||||||
if lev == 2 and not permission then
|
if lev == 2 and not permission then
|
||||||
|
|
@ -125,20 +115,20 @@ end
|
||||||
local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
||||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||||
num = ad2d((is_add and num or -num))
|
num = ad2d((is_add and num or -num))
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_ChangeFag(gid, pid, num, function(res1)
|
fgCtr:FG_ChangeFag(gid, pid, num, function(res1)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
-- if gniv._is_destroy then
|
-- if gniv._is_destroy then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
if (res1.ReturnCode == 0) then
|
if (res1.ReturnCode == 0) then
|
||||||
callback(res1.Data)
|
callback(res1.Data)
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res1.ReturnCode,"更改积分失败!")
|
ViewUtil.ErrorTip(res1.ReturnCode, "更改积分失败!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
-- item:GetChild("tex_fag").text = (self_user or show_fag) and num or show_fag_str
|
-- item:GetChild("tex_fag").text = (self_user or show_fag) and num or show_fag_str
|
||||||
end, is_add and 1 or 2, cur_hp and d2ad(cur_hp) or nil)
|
end, is_add and 1 or 2, cur_hp and d2ad(cur_hp) or nil)
|
||||||
gniv:Show()
|
gniv:Show()
|
||||||
end
|
end
|
||||||
|
|
@ -157,7 +147,6 @@ end
|
||||||
|
|
||||||
-- 填充合伙人对象
|
-- 填充合伙人对象
|
||||||
function M:FillItem(obj, partner)
|
function M:FillItem(obj, partner)
|
||||||
|
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local perm_array = MngPermission.getPermData(group.permission)
|
local perm_array = MngPermission.getPermData(group.permission)
|
||||||
|
|
||||||
|
|
@ -177,7 +166,7 @@ function M:FillItem(obj, partner)
|
||||||
local p = group:getMember(partner.uid)
|
local p = group:getMember(partner.uid)
|
||||||
local mp = group:getMember(DataManager.SelfUser.account_id)
|
local mp = group:getMember(DataManager.SelfUser.account_id)
|
||||||
obj:GetChild("btn_fag_add").onClick:Set(function()
|
obj:GetChild("btn_fag_add").onClick:Set(function()
|
||||||
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
__change_fag(self.group_id, partner.uid, true, nil, function(data)
|
__change_fag(self.group_id, partner.uid, true, nil, function(data)
|
||||||
|
|
@ -192,12 +181,10 @@ function M:FillItem(obj, partner)
|
||||||
end
|
end
|
||||||
self.lst_partner.numItems = #self.partner_data
|
self.lst_partner.numItems = #self.partner_data
|
||||||
-- 搜索出的玩家显示
|
-- 搜索出的玩家显示
|
||||||
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
obj:GetChild("btn_fag_minus").onClick:Set(function()
|
obj:GetChild("btn_fag_minus").onClick:Set(function()
|
||||||
|
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
||||||
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
__change_fag(self.group_id, partner.uid, false, partner.hp, function(data)
|
__change_fag(self.group_id, partner.uid, false, partner.hp, function(data)
|
||||||
|
|
@ -212,13 +199,12 @@ function M:FillItem(obj, partner)
|
||||||
end
|
end
|
||||||
self.lst_partner.numItems = #self.partner_data
|
self.lst_partner.numItems = #self.partner_data
|
||||||
-- 搜索出的玩家显示
|
-- 搜索出的玩家显示
|
||||||
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
obj:GetChild("tex_fag").text = d2ad(partner.hp)
|
obj:GetChild("tex_fag").text = d2ad(partner.hp)
|
||||||
|
|
||||||
obj:GetChild("tex_member_count").text = ""..partner.total
|
obj:GetChild("tex_member_count").text = "" .. partner.total
|
||||||
|
|
||||||
|
|
||||||
obj:GetChild("btn_percent").onClick:Set(function()
|
obj:GetChild("btn_percent").onClick:Set(function()
|
||||||
|
|
@ -229,20 +215,20 @@ function M:FillItem(obj, partner)
|
||||||
btnDetail.visible = partner.total > 0
|
btnDetail.visible = partner.total > 0
|
||||||
|
|
||||||
btnDetail.onClick:Set(function()
|
btnDetail.onClick:Set(function()
|
||||||
local GroupMngPartnerListView2 = GroupMngPartnerListView2.new(self.group_id,partner.uid)
|
local GroupMngPartnerListView2 = GroupMngPartnerListView2.new(self.group_id, partner.uid)
|
||||||
GroupMngPartnerListView2:Show()
|
GroupMngPartnerListView2:Show()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local btn_bxx = obj:GetChild("btn_bxx")
|
local btn_bxx = obj:GetChild("btn_bxx")
|
||||||
btn_bxx.onClick:Set(
|
btn_bxx.onClick:Set(
|
||||||
function()
|
function()
|
||||||
local ctrNum=1
|
local ctrNum = 1
|
||||||
if not (partner.lev == 3 and partner.partnerLev == 0) then
|
if not (partner.lev == 3 and partner.partnerLev == 0) then
|
||||||
ctrNum = 2
|
ctrNum = 2
|
||||||
end
|
end
|
||||||
ctrNum=2
|
ctrNum = 2
|
||||||
printlog("cccccccccccccccccccccccccc")
|
printlog("cccccccccccccccccccccccccc")
|
||||||
local gmv = GroupMngFagPackView.new(self.curGroup.id, self._root_view,ctrNum,partner.uid)
|
local gmv = GroupMngFagPackView.new(self.curGroup.id, self._root_view, ctrNum, partner.uid)
|
||||||
gmv:SetCallback(
|
gmv:SetCallback(
|
||||||
function()
|
function()
|
||||||
btn_bxx.selected = false
|
btn_bxx.selected = false
|
||||||
|
|
@ -253,9 +239,6 @@ function M:FillItem(obj, partner)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 列表对象填充
|
-- 列表对象填充
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local partner = self.partner_data[index + 1]
|
local partner = self.partner_data[index + 1]
|
||||||
|
|
@ -264,8 +247,8 @@ end
|
||||||
|
|
||||||
-- 显示合伙人成员列表
|
-- 显示合伙人成员列表
|
||||||
function M:ShowPartnerMemberList(partner_id)
|
function M:ShowPartnerMemberList(partner_id)
|
||||||
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
||||||
pmlv:Show()
|
pmlv:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 显示合伙人奖励
|
-- 显示合伙人奖励
|
||||||
|
|
@ -274,4 +257,4 @@ function M:ShowPartnerRewards(partner_id, partnerLev)
|
||||||
prv:Show()
|
prv:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -261,14 +261,14 @@ function M:GetRewardsData()
|
||||||
local data
|
local data
|
||||||
if #self.search_partner_data == 0 then
|
if #self.search_partner_data == 0 then
|
||||||
if #self.partner_data == 0 then return end
|
if #self.partner_data == 0 then return end
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
data = self.partner_data[self.lst_partner.selectedIndex + 1]
|
data = self.partner_data[self.lst_partner.selectedIndex + 1]
|
||||||
else
|
else
|
||||||
data = self.search_partner_data[1]
|
data = self.search_partner_data[1]
|
||||||
end
|
end
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetRewards(self.group_id, data.uid, data.partnerLev, function(res)
|
fgCtr:FG_GetRewards(self.group_id, data.uid, data.partnerLev, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -296,7 +296,7 @@ function M:GetRewardsLog()
|
||||||
local data
|
local data
|
||||||
if #self.search_partner_data == 0 then
|
if #self.search_partner_data == 0 then
|
||||||
if #self.partner_data2 == 0 then return end
|
if #self.partner_data2 == 0 then return end
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
data = self.partner_data2[self.lst_partner2.selectedIndex + 1]
|
data = self.partner_data2[self.lst_partner2.selectedIndex + 1]
|
||||||
else
|
else
|
||||||
data = self.search_partner_data[1]
|
data = self.search_partner_data[1]
|
||||||
|
|
@ -304,7 +304,7 @@ function M:GetRewardsLog()
|
||||||
local begin_time, end_time = self.time_panel1:GetDate()
|
local begin_time, end_time = self.time_panel1:GetDate()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetRewardsLog(self.group_id, #self.rewards_log, 6, begin_time, end_time, data.uid, function(res)
|
fgCtr:FG_GetRewardsLog(self.group_id, #self.rewards_log, 6, begin_time, end_time, data.uid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -333,13 +333,13 @@ end
|
||||||
|
|
||||||
-- 获取奖励统计
|
-- 获取奖励统计
|
||||||
function M:GetRewardsStatistic()
|
function M:GetRewardsStatistic()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local data = self.partner_data2[self.lst_partner2.selectedIndex + 1]
|
local data = self.partner_data2[self.lst_partner2.selectedIndex + 1]
|
||||||
local begin_time, end_time = self.time_panel2:GetDate()
|
local begin_time, end_time = self.time_panel2:GetDate()
|
||||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetRewardStatistic(self.group_id, pid, begin_time, end_time, function(res)
|
fgCtr:FG_GetRewardStatistic(self.group_id, pid, begin_time, end_time, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -429,9 +429,9 @@ function M:OnRenderRewardsItem(index, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetRewards(self.group_id, data.pid, pdata.partnerLev, pdata.uid, false, tem, function(res)
|
fgCtr:FG_SetRewards(self.group_id, data.pid, pdata.partnerLev, pdata.uid, false, tem, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置合伙人奖励失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置合伙人奖励失败")
|
||||||
else
|
else
|
||||||
|
|
@ -453,10 +453,10 @@ function M:OnRenderRewardsItem(index, obj)
|
||||||
pdata = self.search_partner_data[1]
|
pdata = self.search_partner_data[1]
|
||||||
end
|
end
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetRewards(self.group_id, data.pid, pdata.partnerLev, pdata.uid, true, data.cur_value,
|
fgCtr:FG_SetRewards(self.group_id, data.pid, pdata.partnerLev, pdata.uid, true, data.cur_value,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置合伙人奖励失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置合伙人奖励失败")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ end
|
||||||
-- local fgCtr = ControllerManager.GetController(NewGroupController)
|
-- local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
-- fgCtr:FG_GetMembersCount(self.group_id,function(res)
|
-- fgCtr:FG_GetMembersCount(self.group_id,function(res)
|
||||||
|
|
||||||
-- ViewUtil.CloseModalWait()
|
-- ViewUtil.CloseModalWait2()
|
||||||
|
|
||||||
-- if res.ReturnCode == 0 then
|
-- if res.ReturnCode == 0 then
|
||||||
-- self._view:GetChild('tex_memb_num').text = res.Data.member_num
|
-- self._view:GetChild('tex_memb_num').text = res.Data.member_num
|
||||||
|
|
@ -97,11 +97,11 @@ function M:InitView()
|
||||||
self._view:GetChild('btn_search').onClick:Set(
|
self._view:GetChild('btn_search').onClick:Set(
|
||||||
function()
|
function()
|
||||||
--printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
--printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local text = self._view:GetChild('tex_id').text
|
local text = self._view:GetChild('tex_id').text
|
||||||
local qid, qnick
|
local qid, qnick
|
||||||
if text == "" then
|
if text == "" then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -118,7 +118,7 @@ function M:InitView()
|
||||||
function(res)
|
function(res)
|
||||||
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
||||||
-- pt(res)
|
-- pt(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -149,7 +149,7 @@ function M:InitView()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetRecordData(index)
|
function M:GetRecordData(index)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
|
|
||||||
local time_type = self._view:GetController("type").selectedIndex
|
local time_type = self._view:GetController("type").selectedIndex
|
||||||
if self.begin_time ~= nil and self.end_time ~= nil then
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
||||||
|
|
@ -158,7 +158,7 @@ function M:GetRecordData(index)
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetPartnerStat(self.group_id, index, 6, time_type, self.begin_time, self.end_time, function(res)
|
fgCtr:FG_GetPartnerStat(self.group_id, index, 6, time_type, self.begin_time, self.end_time, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
|
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
local members = res.Data.members
|
local members = res.Data.members
|
||||||
|
|
@ -206,10 +206,10 @@ function M:FillRecordItem(data, obj)
|
||||||
|
|
||||||
local btn_check_members = obj:GetChild("btn_check_members")
|
local btn_check_members = obj:GetChild("btn_check_members")
|
||||||
btn_check_members.onClick:Set(function()
|
btn_check_members.onClick:Set(function()
|
||||||
ViewUtil.ShowModalWait(self._root_view)
|
ViewUtil.ShowModalWait2(self._root_view)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetTotalHp(self.group_id, data.uid, function(res)
|
fgCtr:FG_GetTotalHp(self.group_id, data.uid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
local hp = d2ad(res.Data.hp)
|
local hp = d2ad(res.Data.hp)
|
||||||
tex_total_score.text = hp
|
tex_total_score.text = hp
|
||||||
|
|
@ -261,7 +261,7 @@ function M:FillRecordItem(data, obj)
|
||||||
local gfiv = GroupNumberInputView.new(self._root_view, function(num)
|
local gfiv = GroupNumberInputView.new(self._root_view, function(num)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_SetPartnerThreshold(self.group_id, data.uid, num, function(res)
|
fgCtr:FG_SetPartnerThreshold(self.group_id, data.uid, num, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置失败")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -23,21 +23,22 @@ function M:InitView()
|
||||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPersonStat")
|
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPersonStat")
|
||||||
|
|
||||||
self.lst_record = self._view:GetChild("lst_record")
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
self.lst_record:SetVirtual()
|
self.lst_record:SetVirtual()
|
||||||
self.lst_record.itemRenderer = function(index, obj)
|
self.lst_record.itemRenderer = function(index, obj)
|
||||||
self:OnRenderRecordItem(index, obj)
|
self:OnRenderRecordItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetRecordData(self.lst_record.numItems)
|
self:GetRecordData(self.lst_record.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0)
|
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
||||||
|
-308, 0)
|
||||||
self.begin_time, self.end_time = self.time_panel:GetDate()
|
self.begin_time, self.end_time = self.time_panel:GetDate()
|
||||||
local ctr_page = self._view:GetController("type")
|
local ctr_page = self._view:GetController("type")
|
||||||
ctr_page.onChanged:Set(function()
|
ctr_page.onChanged:Set(function()
|
||||||
self.record_data = {}
|
self.record_data = {}
|
||||||
self.lst_record.numItems = 0
|
self.lst_record.numItems = 0
|
||||||
self.begin_time = nil
|
self.begin_time = nil
|
||||||
self.end_time = nil
|
self.end_time = nil
|
||||||
self:GetRecordData(0)
|
self:GetRecordData(0)
|
||||||
end)
|
end)
|
||||||
|
|
@ -52,9 +53,8 @@ function M:InitView()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetRecordData(index)
|
function M:GetRecordData(index)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
|
|
||||||
ViewUtil.ShowModalWait()
|
|
||||||
|
|
||||||
local time_type = self._view:GetController("type").selectedIndex
|
local time_type = self._view:GetController("type").selectedIndex
|
||||||
|
|
||||||
if self.begin_time ~= nil and self.end_time ~= nil then
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
||||||
|
|
@ -62,33 +62,35 @@ function M:GetRecordData(index)
|
||||||
end
|
end
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetGroupPersonRecord(self.group_id, GetPlatform(), DataManager.SelfUser.account_id, time_type, self.begin_time, self.end_time, index, 6, function(res)
|
fgCtr:FG_GetGroupPersonRecord(self.group_id, GetPlatform(), DataManager.SelfUser.account_id, time_type,
|
||||||
|
self.begin_time, self.end_time, index, 6, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
|
||||||
ViewUtil.CloseModalWait()
|
|
||||||
if res.ReturnCode ~= 0 then
|
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
|
|
||||||
else
|
|
||||||
local records = res.Data.records
|
|
||||||
for i = 1, #records do
|
|
||||||
self.record_data[#self.record_data + 1] = records[i]
|
|
||||||
end
|
end
|
||||||
self.lst_record.numItems = #self.record_data
|
ViewUtil.CloseModalWait2()
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
|
||||||
|
else
|
||||||
|
local records = res.Data.records
|
||||||
|
for i = 1, #records do
|
||||||
|
self.record_data[#self.record_data + 1] = records[i]
|
||||||
|
end
|
||||||
|
self.lst_record.numItems = #self.record_data
|
||||||
|
|
||||||
printlog("ccccccccccccccccccccccccccccccccccc2222223333333333333333333333333333333",res.Data.total_round," ",res.Data.valid_round)
|
printlog("ccccccccccccccccccccccccccccccccccc2222223333333333333333333333333333333", res.Data
|
||||||
pt(res.Data)
|
.total_round,
|
||||||
if index == 0 then
|
" ", res.Data.valid_round)
|
||||||
--self._view:GetChild("tex_num1").text = ""..res.Data.total
|
pt(res.Data)
|
||||||
--self._view:GetChild("tex_num3").text = ""..d2ad(res.Data.consume)
|
if index == 0 then
|
||||||
self._view:GetChild("tex_winner_count").text = res.Data.total_round
|
--self._view:GetChild("tex_num1").text = ""..res.Data.total
|
||||||
self._view:GetChild("tex_valid_count").text = res.Data.valid_round / 100
|
--self._view:GetChild("tex_num3").text = ""..d2ad(res.Data.consume)
|
||||||
|
self._view:GetChild("tex_winner_count").text = res.Data.total_round
|
||||||
self._view:GetChild("tex_total_proportion").text = d2ad(res.Data.total_win)
|
self._view:GetChild("tex_valid_count").text = res.Data.valid_round / 100
|
||||||
|
|
||||||
|
self._view:GetChild("tex_total_proportion").text = d2ad(res.Data.total_win)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillRecordItem(data, obj)
|
function M:FillRecordItem(data, obj)
|
||||||
|
|
@ -96,7 +98,7 @@ function M:FillRecordItem(data, obj)
|
||||||
local room_id = data.room_id
|
local room_id = data.room_id
|
||||||
local create_time = data.create_time
|
local create_time = data.create_time
|
||||||
local room_type_str = data.game_info.name
|
local room_type_str = data.game_info.name
|
||||||
local time =tonumber(create_time)
|
local time = tonumber(create_time)
|
||||||
local room_time_str = os.date("%Y-%m-%d %H:%M:%S", time)
|
local room_time_str = os.date("%Y-%m-%d %H:%M:%S", time)
|
||||||
local totalScore = json.decode(data.totalScore)
|
local totalScore = json.decode(data.totalScore)
|
||||||
local hpOnOff = data.hpOnOff
|
local hpOnOff = data.hpOnOff
|
||||||
|
|
@ -114,21 +116,21 @@ function M:FillRecordItem(data, obj)
|
||||||
player_list[i].house = 0
|
player_list[i].house = 0
|
||||||
player_list[i].nick = p.nick
|
player_list[i].nick = p.nick
|
||||||
end
|
end
|
||||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.groupPid)
|
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.groupPid)
|
||||||
|
|
||||||
obj:GetChild("tex_time").text = room_time_str
|
obj:GetChild("tex_time").text = room_time_str
|
||||||
obj:GetChild("tex_roomid").text = room_id
|
obj:GetChild("tex_roomid").text = room_id
|
||||||
obj:GetChild("tex_times").text = d2ad(data.hp_times).."倍"
|
obj:GetChild("tex_times").text = d2ad(data.hp_times) .. "倍"
|
||||||
obj:GetChild("tex_game").text = play_name
|
obj:GetChild("tex_game").text = play_name
|
||||||
local lst_total = obj:GetChild("lst_total")
|
local lst_total = obj:GetChild("lst_total")
|
||||||
lst_total:RemoveChildrenToPool()
|
lst_total:RemoveChildrenToPool()
|
||||||
local ids = {}
|
local ids = {}
|
||||||
for j=1,#totalScore do
|
for j = 1, #totalScore do
|
||||||
local titem = lst_total:AddItemFromPool()
|
local titem = lst_total:AddItemFromPool()
|
||||||
local trdata = totalScore[j]
|
local trdata = totalScore[j]
|
||||||
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
||||||
titem:GetChild("tex_id").text = "ID:"..trdata.accId
|
titem:GetChild("tex_id").text = "ID:" .. trdata.accId
|
||||||
table.insert( ids, trdata.accId )
|
table.insert(ids, trdata.accId)
|
||||||
|
|
||||||
local score = trdata.score
|
local score = trdata.score
|
||||||
if trdata.hp == nil then
|
if trdata.hp == nil then
|
||||||
|
|
@ -138,7 +140,7 @@ function M:FillRecordItem(data, obj)
|
||||||
else
|
else
|
||||||
score = d2ad(trdata.hp)
|
score = d2ad(trdata.hp)
|
||||||
end
|
end
|
||||||
|
|
||||||
titem:GetChild("tex_score").text = score
|
titem:GetChild("tex_score").text = score
|
||||||
|
|
||||||
if score >= 0 then
|
if score >= 0 then
|
||||||
|
|
@ -156,24 +158,23 @@ function M:FillRecordItem(data, obj)
|
||||||
|
|
||||||
obj:GetChild("btn_screenshot").onClick:Set(function()
|
obj:GetChild("btn_screenshot").onClick:Set(function()
|
||||||
self:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
self:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
obj:GetChild("btn_share").onClick:Set(function()
|
obj:GetChild("btn_share").onClick:Set(function()
|
||||||
ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list)
|
ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list)
|
||||||
end)
|
end)
|
||||||
obj.onClick:Set(function()
|
obj.onClick:Set(function()
|
||||||
self:OnShowRecordInfo(data,ids)
|
self:OnShowRecordInfo(data, ids)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderRecordItem(index, obj)
|
function M:OnRenderRecordItem(index, obj)
|
||||||
local data = self.record_data[index + 1]
|
local data = self.record_data[index + 1]
|
||||||
self:FillRecordItem(data, obj)
|
self:FillRecordItem(data, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
||||||
function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
ViewUtil.ShowModalWait2(self._view, "正在分享...")
|
||||||
ViewUtil.ShowModalWait(self._view, "正在分享...")
|
|
||||||
UIPackage.AddPackage("base/rank/ui/Rank")
|
UIPackage.AddPackage("base/rank/ui/Rank")
|
||||||
local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView")
|
local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView")
|
||||||
result_view.visible = false
|
result_view.visible = false
|
||||||
|
|
@ -195,15 +196,15 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
||||||
end
|
end
|
||||||
item:GetChild("score").text = score
|
item:GetChild("score").text = score
|
||||||
if score < 0 then item:GetController("di").selectedIndex = 1 end
|
if score < 0 then item:GetController("di").selectedIndex = 1 end
|
||||||
if p.portrait and p.portrait ~= "" then
|
if p.portrait and p.portrait ~= "" then
|
||||||
ImageLoad.Load(p.portrait, item:GetChild("n9")._iconObject, self.class, function( ... )
|
ImageLoad.Load(p.portrait, item:GetChild("n9")._iconObject, self.class, function(...)
|
||||||
load_head_num = load_head_num - 1
|
load_head_num = load_head_num - 1
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
load_head_num = load_head_num - 1
|
load_head_num = load_head_num - 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
coroutine.start(function ( ... )
|
coroutine.start(function(...)
|
||||||
local left_time = 4
|
local left_time = 4
|
||||||
while (true) do
|
while (true) do
|
||||||
if load_head_num == 0 or left_time == 0 then
|
if load_head_num == 0 or left_time == 0 then
|
||||||
|
|
@ -212,7 +213,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
||||||
ShareScreenShotWithOption(function()
|
ShareScreenShotWithOption(function()
|
||||||
result_view:Dispose()
|
result_view:Dispose()
|
||||||
end)
|
end)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
coroutine.wait(1)
|
coroutine.wait(1)
|
||||||
|
|
@ -221,7 +222,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnShowRecordInfo(rdata,ids)
|
function M:OnShowRecordInfo(rdata, ids)
|
||||||
local ctr_record = self._view:GetController("record")
|
local ctr_record = self._view:GetController("record")
|
||||||
ctr_record.selectedIndex = 1
|
ctr_record.selectedIndex = 1
|
||||||
|
|
||||||
|
|
@ -233,26 +234,26 @@ function M:OnShowRecordInfo(rdata,ids)
|
||||||
local playback_id = rdata.military_id
|
local playback_id = rdata.military_id
|
||||||
local hpOnOff = rdata.hpOnOff
|
local hpOnOff = rdata.hpOnOff
|
||||||
local hpType = rdata.game_info.hpType
|
local hpType = rdata.game_info.hpType
|
||||||
for i = 1,round_count do
|
for i = 1, round_count do
|
||||||
local item = lst_recordInfo:AddItemFromPool()
|
local item = lst_recordInfo:AddItemFromPool()
|
||||||
item:GetChild("tex_num").text = tostring(i)
|
item:GetChild("tex_num").text = tostring(i)
|
||||||
|
|
||||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(rdata.groupPid)
|
local play_name = DataManager.groups:get(self.group_id):getPlayName(rdata.groupPid)
|
||||||
item:GetChild("tex_game").text = play_name
|
item:GetChild("tex_game").text = play_name
|
||||||
|
|
||||||
item:GetChild("tex_roomid").text = rdata.room_id
|
item:GetChild("tex_roomid").text = rdata.room_id
|
||||||
|
|
||||||
item:GetChild("tex_times").text = d2ad(rdata.hp_times).."倍"
|
item:GetChild("tex_times").text = d2ad(rdata.hp_times) .. "倍"
|
||||||
|
|
||||||
local round_score_str = rdata["round_"..i]
|
local round_score_str = rdata["round_" .. i]
|
||||||
local round_score_item = json.decode(round_score_str)
|
local round_score_item = json.decode(round_score_str)
|
||||||
local lst_total = item:GetChild("lst_total")
|
local lst_total = item:GetChild("lst_total")
|
||||||
lst_total:RemoveChildrenToPool()
|
lst_total:RemoveChildrenToPool()
|
||||||
for k=1,#round_score_item do
|
for k = 1, #round_score_item do
|
||||||
local titem = lst_total:AddItemFromPool()
|
local titem = lst_total:AddItemFromPool()
|
||||||
local trdata = round_score_item[k]
|
local trdata = round_score_item[k]
|
||||||
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
||||||
titem:GetChild("tex_id").text = "ID:".. ids[k]
|
titem:GetChild("tex_id").text = "ID:" .. ids[k]
|
||||||
|
|
||||||
local score = trdata.score
|
local score = trdata.score
|
||||||
if trdata.hp == nil then
|
if trdata.hp == nil then
|
||||||
|
|
@ -263,7 +264,7 @@ function M:OnShowRecordInfo(rdata,ids)
|
||||||
score = d2ad(trdata.hp)
|
score = d2ad(trdata.hp)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
titem:GetChild("tex_score").text = score
|
titem:GetChild("tex_score").text = score
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -272,11 +273,11 @@ function M:OnShowRecordInfo(rdata,ids)
|
||||||
else
|
else
|
||||||
item:GetController("person_num").selectedIndex = 0
|
item:GetController("person_num").selectedIndex = 0
|
||||||
end
|
end
|
||||||
local btn_play =item:GetChild("btn_play")
|
local btn_play = item:GetChild("btn_play")
|
||||||
btn_play.onClick:Set(function()
|
btn_play.onClick:Set(function()
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if DataManager.SelfUser.playback[playback_id] ~= nil and DataManager.SelfUser.playback[playback_id][i] ~= nil then
|
if DataManager.SelfUser.playback[playback_id] ~= nil and DataManager.SelfUser.playback[playback_id][i] ~= nil then
|
||||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||||
DataManager.CurrenRoom = room
|
DataManager.CurrenRoom = room
|
||||||
room.lev = group.lev
|
room.lev = group.lev
|
||||||
room.game_id = game_id
|
room.game_id = game_id
|
||||||
|
|
@ -291,13 +292,13 @@ function M:OnShowRecordInfo(rdata,ids)
|
||||||
main._totalRound = tonumber(rdata.round)
|
main._totalRound = tonumber(rdata.round)
|
||||||
main:FillRoomData(DataManager.SelfUser.playback[playback_id][i])
|
main:FillRoomData(DataManager.SelfUser.playback[playback_id][i])
|
||||||
else
|
else
|
||||||
ViewUtil.ShowModalWait(self._view)
|
ViewUtil.ShowModalWait2(self._view)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data["military_id"] = playback_id
|
_data["military_id"] = playback_id
|
||||||
_data["round"] = tostring(i)
|
_data["round"] = tostring(i)
|
||||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||||
loddyCtr1:RequestPlayBack(_data,function(code,data)
|
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
||||||
DataManager.SelfUser.playback[playback_id][i] = data
|
DataManager.SelfUser.playback[playback_id][i] = data
|
||||||
|
|
@ -324,7 +325,7 @@ function M:OnShowRecordInfo(rdata,ids)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GenaratePlayBack(id, game_id, ...)
|
function M:GenaratePlayBack(id, game_id, ...)
|
||||||
local tem =nil
|
local tem = nil
|
||||||
local dview_class = nil
|
local dview_class = nil
|
||||||
if not dview_class then
|
if not dview_class then
|
||||||
local exconfig = ExtendManager.GetExtendConfig(game_id)
|
local exconfig = ExtendManager.GetExtendConfig(game_id)
|
||||||
|
|
@ -333,11 +334,11 @@ function M:GenaratePlayBack(id, game_id, ...)
|
||||||
if not dview_class then
|
if not dview_class then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
tem = dview_class.new(...)
|
tem = dview_class.new(...)
|
||||||
tem.Id = id
|
tem.Id = id
|
||||||
tem:Show()
|
tem:Show()
|
||||||
return tem
|
return tem
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -13,63 +13,62 @@ function GroupMngPlayStatView.new(gid)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:initData()
|
function M:initData()
|
||||||
|
|
||||||
self:GetConsumeStatData()
|
self:GetConsumeStatData()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:InitView()
|
function M:InitView()
|
||||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPlayStat")
|
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPlayStat")
|
||||||
|
|
||||||
self.consume_stat = {} --消耗统计
|
self.consume_stat = {} --消耗统计
|
||||||
|
|
||||||
self.lst_consume_stat = self._view:GetChild("lst_consume_stat")
|
self.lst_consume_stat = self._view:GetChild("lst_consume_stat")
|
||||||
self.lst_consume_stat:SetVirtual()
|
self.lst_consume_stat:SetVirtual()
|
||||||
self.lst_consume_stat.itemRenderer = function(index, obj)
|
self.lst_consume_stat.itemRenderer = function(index, obj)
|
||||||
self:OnRenderConsumeItem(index, obj)
|
self:OnRenderConsumeItem(index, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
self._view:GetChild("btn_search").onClick:Set(function()
|
self._view:GetChild("btn_search").onClick:Set(function()
|
||||||
self.consume_stat = {}
|
self.consume_stat = {}
|
||||||
self.lst_consume_stat.numItems = 0
|
self.lst_consume_stat.numItems = 0
|
||||||
self:GetConsumeStatData()
|
self:GetConsumeStatData()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0)
|
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
||||||
|
-308, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetConsumeStatData()
|
function M:GetConsumeStatData()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local begin_time, end_time = self.time_panel:GetDate()
|
local begin_time, end_time = self.time_panel:GetDate()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetConsumeStat(self.group_id,begin_time,end_time, function(res)
|
fgCtr:FG_GetConsumeStat(self.group_id, begin_time, end_time, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取统计数据失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取统计数据失败")
|
||||||
else
|
else
|
||||||
self.consume_stat = res.Data.cosume_logs
|
self.consume_stat = res.Data.cosume_logs
|
||||||
|
|
||||||
local top = #self.consume_stat + 1
|
local top = #self.consume_stat + 1
|
||||||
self.consume_stat[top] = {round=0,valid=0,no_valid=0,diamo_cost=0,pid=0}
|
self.consume_stat[top] = { round = 0, valid = 0, no_valid = 0, diamo_cost = 0, pid = 0 }
|
||||||
|
|
||||||
for i = 1,#self.consume_stat - 1 do
|
for i = 1, #self.consume_stat - 1 do
|
||||||
self.consume_stat[top].round = (self.consume_stat[top].round + self.consume_stat[i].round)
|
self.consume_stat[top].round = (self.consume_stat[top].round + self.consume_stat[i].round)
|
||||||
self.consume_stat[top].valid = (self.consume_stat[top].valid + self.consume_stat[i].valid)
|
self.consume_stat[top].valid = (self.consume_stat[top].valid + self.consume_stat[i].valid)
|
||||||
self.consume_stat[top].no_valid = (self.consume_stat[top].no_valid + self.consume_stat[i].no_valid)
|
self.consume_stat[top].no_valid = (self.consume_stat[top].no_valid + self.consume_stat[i].no_valid)
|
||||||
self.consume_stat[top].diamo_cost = (self.consume_stat[top].diamo_cost + self.consume_stat[i].diamo_cost)
|
self.consume_stat[top].diamo_cost = (self.consume_stat[top].diamo_cost + self.consume_stat[i].diamo_cost)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.lst_consume_stat.numItems = #self.consume_stat
|
self.lst_consume_stat.numItems = #self.consume_stat
|
||||||
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderConsumeItem(index, obj)
|
function M:OnRenderConsumeItem(index, obj)
|
||||||
local ci = index + 1
|
local ci = index + 1
|
||||||
local data = self.consume_stat[ci]
|
local data = self.consume_stat[ci]
|
||||||
|
|
||||||
local play = DataManager.groups:get(self.group_id):getPlay(data.pid)
|
local play = DataManager.groups:get(self.group_id):getPlay(data.pid)
|
||||||
obj:GetChild("title").text = play and play.name or "总计"
|
obj:GetChild("title").text = play and play.name or "总计"
|
||||||
|
|
@ -86,4 +85,4 @@ function M:OnRenderConsumeItem(index, obj)
|
||||||
obj:GetChild("tex_diamond").text = data.diamo_cost / 100
|
obj:GetChild("tex_diamond").text = data.diamo_cost / 100
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ function GroupMngProportionView.new(gid)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:initData()
|
function M:initData()
|
||||||
self.prop_data = {}
|
self.prop_data = {}
|
||||||
self.lst_prop.numItems = 0
|
self.lst_prop.numItems = 0
|
||||||
self:GetPropData(0)
|
self:GetPropData(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillView()
|
function M:FillView()
|
||||||
|
|
@ -24,60 +24,61 @@ function M:FillView()
|
||||||
|
|
||||||
self.prop_data = {}
|
self.prop_data = {}
|
||||||
self._view:GetChild("btn_search").onClick:Set(function()
|
self._view:GetChild("btn_search").onClick:Set(function()
|
||||||
self:initData()
|
self:initData()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.lst_prop = self._view:GetChild("lst_proportion")
|
self.lst_prop = self._view:GetChild("lst_proportion")
|
||||||
self.lst_prop:SetVirtual()
|
self.lst_prop:SetVirtual()
|
||||||
self.lst_prop.itemRenderer = function(index, obj)
|
self.lst_prop.itemRenderer = function(index, obj)
|
||||||
self:OnRenderPropItem(index, obj)
|
self:OnRenderPropItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_prop.scrollPane.onPullUpRelease:Set(function()
|
self.lst_prop.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetPropData(self.lst_prop.numItems)
|
self:GetPropData(self.lst_prop.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0)
|
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
||||||
|
-308, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取抽水数据
|
-- 获取抽水数据
|
||||||
function M:GetPropData(index)
|
function M:GetPropData(index)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local begin_time, end_time = self.time_panel:GetDate()
|
local begin_time, end_time = self.time_panel:GetDate()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetPropLog(self.group_id, index, 8, begin_time, end_time, function(res)
|
fgCtr:FG_GetPropLog(self.group_id, index, 8, begin_time, end_time, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
||||||
else
|
else
|
||||||
local props = res.Data.hp_logs
|
local props = res.Data.hp_logs
|
||||||
if index == 0 then
|
if index == 0 then
|
||||||
self._view:GetChild("tex_winner_count").text = res.Data.count
|
self._view:GetChild("tex_winner_count").text = res.Data.count
|
||||||
self._view:GetChild("tex_valid_count").text = res.Data.valid_count
|
self._view:GetChild("tex_valid_count").text = res.Data.valid_count
|
||||||
self._view:GetChild("tex_winner_proportion").text = d2ad(res.Data.pump)
|
self._view:GetChild("tex_winner_proportion").text = d2ad(res.Data.pump)
|
||||||
self._view:GetChild("tex_total_proportion").text = d2ad(res.Data.gains)
|
self._view:GetChild("tex_total_proportion").text = d2ad(res.Data.gains)
|
||||||
end
|
end
|
||||||
if #props == 0 then return end
|
if #props == 0 then return end
|
||||||
for i = 1, #props do
|
for i = 1, #props do
|
||||||
self.prop_data[#self.prop_data + 1] = props[i]
|
self.prop_data[#self.prop_data + 1] = props[i]
|
||||||
end
|
end
|
||||||
self.lst_prop.numItems = #self.prop_data
|
self.lst_prop.numItems = #self.prop_data
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 填充抽水对象
|
-- 填充抽水对象
|
||||||
function M:OnRenderPropItem(index, obj)
|
function M:OnRenderPropItem(index, obj)
|
||||||
local tem = index + 1
|
local tem = index + 1
|
||||||
local data = self.prop_data[tem]
|
local data = self.prop_data[tem]
|
||||||
obj:GetChild("tex_num").text = d2ad(math.abs(data.hp))
|
obj:GetChild("tex_num").text = d2ad(math.abs(data.hp))
|
||||||
obj:GetChild("tex_winner").text = ViewUtil.stringEllipsis(data.nick)
|
obj:GetChild("tex_winner").text = ViewUtil.stringEllipsis(data.nick)
|
||||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.pid)
|
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.pid)
|
||||||
obj:GetChild("tex_game").text = play_name
|
obj:GetChild("tex_game").text = play_name
|
||||||
obj:GetChild("tex_roomid").text = data.roomid
|
obj:GetChild("tex_roomid").text = data.roomid
|
||||||
obj:GetChild("tex_date").text = os.date("%m月%d日\r%H:%M", data.time)
|
obj:GetChild("tex_date").text = os.date("%m月%d日\r%H:%M", data.time)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -22,19 +22,19 @@ end
|
||||||
|
|
||||||
-- 初始化数据
|
-- 初始化数据
|
||||||
function M:initData()
|
function M:initData()
|
||||||
self.rank_data = {}
|
self.rank_data = {}
|
||||||
self.round_data = {}
|
self.round_data = {}
|
||||||
self.win_data = {}
|
self.win_data = {}
|
||||||
self.lst_rank.numItems = 0
|
self.lst_rank.numItems = 0
|
||||||
self.lst_round.numItems = 0
|
self.lst_round.numItems = 0
|
||||||
local page = self._view:GetController("page").selectedIndex
|
local page = self._view:GetController("page").selectedIndex
|
||||||
if page == 0 then
|
if page == 0 then
|
||||||
self:GetRankData(0)
|
self:GetRankData(0)
|
||||||
elseif page == 1 then
|
elseif page == 1 then
|
||||||
self:GetRoundData()
|
self:GetRoundData()
|
||||||
elseif page == 2 then
|
elseif page == 2 then
|
||||||
self:GetWinRankData(0)
|
self:GetWinRankData(0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 快速访问
|
-- 快速访问
|
||||||
|
|
@ -57,53 +57,53 @@ function M:FillView()
|
||||||
self.win_data = {}
|
self.win_data = {}
|
||||||
self._view:GetChild("btn_search").onClick:Set(function()
|
self._view:GetChild("btn_search").onClick:Set(function()
|
||||||
self:clearRankData()
|
self:clearRankData()
|
||||||
self:GetRankData(#self.rank_data)
|
self:GetRankData(#self.rank_data)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self._view:GetChild("btn_search1").onClick:Set(function()
|
self._view:GetChild("btn_search1").onClick:Set(function()
|
||||||
self:clearRankData()
|
self:clearRankData()
|
||||||
|
|
||||||
self:GetWinRankData(#self.win_data)
|
self:GetWinRankData(#self.win_data)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.lst_rank = self._view:GetChild("lst_rank")
|
self.lst_rank = self._view:GetChild("lst_rank")
|
||||||
self.lst_rank:SetVirtual()
|
self.lst_rank:SetVirtual()
|
||||||
self.lst_rank.itemRenderer = function(index, obj)
|
self.lst_rank.itemRenderer = function(index, obj)
|
||||||
self:OnRenderRankItem(index, obj)
|
self:OnRenderRankItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_rank.scrollPane.onPullUpRelease:Set(function()
|
self.lst_rank.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetRankData(self.lst_rank.numItems)
|
self:GetRankData(self.lst_rank.numItems)
|
||||||
end)
|
end)
|
||||||
self.lst_round = self._view:GetChild("lst_round")
|
self.lst_round = self._view:GetChild("lst_round")
|
||||||
self.lst_round:SetVirtual()
|
self.lst_round:SetVirtual()
|
||||||
self.lst_round.itemRenderer = function(index, obj)
|
self.lst_round.itemRenderer = function(index, obj)
|
||||||
self:OnRenderRoundItem(index, obj)
|
self:OnRenderRoundItem(index, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
self.lst_winrank = self._view:GetChild("lst_winrank")
|
self.lst_winrank = self._view:GetChild("lst_winrank")
|
||||||
self.lst_winrank:SetVirtual()
|
self.lst_winrank:SetVirtual()
|
||||||
self.lst_winrank.itemRenderer = function(index, obj)
|
self.lst_winrank.itemRenderer = function(index, obj)
|
||||||
self:OnRenderWinRankItem(index, obj)
|
self:OnRenderWinRankItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_winrank.scrollPane.onPullUpRelease:Set(function()
|
self.lst_winrank.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetWinRankData(self.lst_winrank.numItems)
|
self:GetWinRankData(self.lst_winrank.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local ctr_page = self._view:GetController("page")
|
local ctr_page = self._view:GetController("page")
|
||||||
ctr_page.onChanged:Set(function()
|
ctr_page.onChanged:Set(function()
|
||||||
if ctr_page.selectedIndex == 0 then
|
if ctr_page.selectedIndex == 0 then
|
||||||
self.rank_data = {}
|
self.rank_data = {}
|
||||||
self.lst_rank.numItems = 0
|
self.lst_rank.numItems = 0
|
||||||
self:GetRankData(0)
|
self:GetRankData(0)
|
||||||
elseif ctr_page.selectedIndex == 1 then
|
elseif ctr_page.selectedIndex == 1 then
|
||||||
self:GetRoundData()
|
self:GetRoundData()
|
||||||
else
|
else
|
||||||
self.win_data = {}
|
self.win_data = {}
|
||||||
self.lst_winrank.numItems = 0
|
self.lst_winrank.numItems = 0
|
||||||
self:GetWinRankData(0)
|
self:GetWinRankData(0)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local items = {}
|
local items = {}
|
||||||
local values = {}
|
local values = {}
|
||||||
|
|
@ -111,97 +111,99 @@ function M:FillView()
|
||||||
table.insert(values, "0")
|
table.insert(values, "0")
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if #group.playList > 0 then
|
if #group.playList > 0 then
|
||||||
for i = 1, #group.playList do
|
for i = 1, #group.playList do
|
||||||
local play = group.playList[i]
|
local play = group.playList[i]
|
||||||
table.insert(items, play.name)
|
table.insert(items, play.name)
|
||||||
table.insert(values, tostring(play.id))
|
table.insert(values, tostring(play.id))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local cb_play = self._view:GetChild("cb_play")
|
local cb_play = self._view:GetChild("cb_play")
|
||||||
cb_play.items = items
|
cb_play.items = items
|
||||||
cb_play.values = values
|
cb_play.values = values
|
||||||
cb_play.selectedIndex = 0
|
cb_play.selectedIndex = 0
|
||||||
|
|
||||||
self._view:GetChild("cb_play").onChanged:Set(function()
|
self._view:GetChild("cb_play").onChanged:Set(function()
|
||||||
self.rank_data = {}
|
self.rank_data = {}
|
||||||
self.round_data = {}
|
self.round_data = {}
|
||||||
self.win_data = {}
|
self.win_data = {}
|
||||||
self.lst_rank.numItems = 0
|
self.lst_rank.numItems = 0
|
||||||
self.lst_round.numItems = 0
|
self.lst_round.numItems = 0
|
||||||
self.lst_winrank.numItems = 0
|
self.lst_winrank.numItems = 0
|
||||||
if ctr_page.selectedIndex == 0 then
|
if ctr_page.selectedIndex == 0 then
|
||||||
self:GetRankData(0)
|
self:GetRankData(0)
|
||||||
elseif ctr_page.selectedIndex == 1 then
|
elseif ctr_page.selectedIndex == 1 then
|
||||||
self:GetRoundData()
|
self:GetRoundData()
|
||||||
else
|
else
|
||||||
self:GetWinRankData(0)
|
self:GetWinRankData(0)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0)
|
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
||||||
self.time_panel1 = TimeSettingPanel.new(self._view, self._view:GetChild("btndate1"), self._view:GetChild("btndate2"), -308, 0)
|
-308, 0)
|
||||||
|
self.time_panel1 = TimeSettingPanel.new(self._view, self._view:GetChild("btndate1"), self._view:GetChild("btndate2"),
|
||||||
|
-308, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetRankData(index)
|
function M:GetRankData(index)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local begin_time, end_time = self.time_panel:GetDate()
|
local begin_time, end_time = self.time_panel:GetDate()
|
||||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMemberRank(self.group_id, pid, index, 6, begin_time, end_time, nil,function(res)
|
fgCtr:FG_GetMemberRank(self.group_id, pid, index, 6, begin_time, end_time, nil, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
||||||
else
|
else
|
||||||
local ranks = res.Data.ranks
|
local ranks = res.Data.ranks
|
||||||
if #ranks == 0 then return end
|
if #ranks == 0 then return end
|
||||||
for i = 1, #ranks do
|
for i = 1, #ranks do
|
||||||
self.rank_data[#self.rank_data + 1] = ranks[i]
|
self.rank_data[#self.rank_data + 1] = ranks[i]
|
||||||
end
|
end
|
||||||
self.lst_rank.numItems = #self.rank_data
|
self.lst_rank.numItems = #self.rank_data
|
||||||
self.zongren.text = "总人数:"..res.Data.allActiveNum
|
self.zongren.text = "总人数:" .. res.Data.allActiveNum
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetWinRankData(index)
|
function M:GetWinRankData(index)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local begin_time, end_time = self.time_panel1:GetDate()
|
local begin_time, end_time = self.time_panel1:GetDate()
|
||||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMemberRank(self.group_id, pid, index, 6, begin_time, end_time, 1,function(res)
|
fgCtr:FG_GetMemberRank(self.group_id, pid, index, 6, begin_time, end_time, 1, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取总输赢排名信息失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取总输赢排名信息失败")
|
||||||
else
|
else
|
||||||
local ranks = res.Data.ranks
|
local ranks = res.Data.ranks
|
||||||
if #ranks == 0 then return end
|
if #ranks == 0 then return end
|
||||||
for i = 1, #ranks do
|
for i = 1, #ranks do
|
||||||
self.win_data[#self.win_data + 1] = ranks[i]
|
self.win_data[#self.win_data + 1] = ranks[i]
|
||||||
end
|
end
|
||||||
-- table.sort(self.win_data,function (a,b)
|
-- table.sort(self.win_data,function (a,b)
|
||||||
-- return a.win > b.win
|
-- return a.win > b.win
|
||||||
-- end)
|
-- end)
|
||||||
self.lst_winrank.numItems = #self.win_data
|
self.lst_winrank.numItems = #self.win_data
|
||||||
self.zongren.text = "总人数:"..res.Data.allActiveNum
|
self.zongren.text = "总人数:" .. res.Data.allActiveNum
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderRankItem(index, obj)
|
function M:OnRenderRankItem(index, obj)
|
||||||
local tem = index + 1
|
local tem = index + 1
|
||||||
local data = self.rank_data[tem]
|
local data = self.rank_data[tem]
|
||||||
if tem < 4 then
|
if tem < 4 then
|
||||||
obj:GetController("order").selectedIndex = tem
|
obj:GetController("order").selectedIndex = tem
|
||||||
else
|
else
|
||||||
obj:GetController("order").selectedIndex = 0
|
obj:GetController("order").selectedIndex = 0
|
||||||
obj:GetChild("tex_order").text = tem
|
obj:GetChild("tex_order").text = tem
|
||||||
end
|
end
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local str_nick = ViewUtil.stringEllipsis(data.nick)
|
local str_nick = ViewUtil.stringEllipsis(data.nick)
|
||||||
if group.lev ~= 3 then
|
if group.lev ~= 3 then
|
||||||
|
|
@ -214,14 +216,14 @@ function M:OnRenderRankItem(index, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderWinRankItem(index, obj)
|
function M:OnRenderWinRankItem(index, obj)
|
||||||
local tem = index + 1
|
local tem = index + 1
|
||||||
local data = self.win_data[tem]
|
local data = self.win_data[tem]
|
||||||
if tem < 4 then
|
if tem < 4 then
|
||||||
obj:GetController("order").selectedIndex = tem
|
obj:GetController("order").selectedIndex = tem
|
||||||
else
|
else
|
||||||
obj:GetController("order").selectedIndex = 0
|
obj:GetController("order").selectedIndex = 0
|
||||||
obj:GetChild("tex_order").text = tem
|
obj:GetChild("tex_order").text = tem
|
||||||
end
|
end
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local str_nick = ViewUtil.stringEllipsis(data.nick)
|
local str_nick = ViewUtil.stringEllipsis(data.nick)
|
||||||
if group.lev ~= 3 then
|
if group.lev ~= 3 then
|
||||||
|
|
@ -233,29 +235,29 @@ function M:OnRenderWinRankItem(index, obj)
|
||||||
obj:GetChild("tex_round").text = data.round
|
obj:GetChild("tex_round").text = data.round
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetRoundData()
|
function M:GetRoundData()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetRoundStat(self.group_id, pid, function(res)
|
fgCtr:FG_GetRoundStat(self.group_id, pid, function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
||||||
else
|
else
|
||||||
self.round_data = res.Data.rounds
|
self.round_data = res.Data.rounds
|
||||||
self.lst_round.numItems = #self.round_data
|
self.lst_round.numItems = #self.round_data
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderRoundItem(index, obj)
|
function M:OnRenderRoundItem(index, obj)
|
||||||
local tem = #self.round_data - index
|
local tem = #self.round_data - index
|
||||||
local data = self.round_data[tem]
|
local data = self.round_data[tem]
|
||||||
obj:GetChild("tex_time").text = os.date("%Y-%m-%d", data.time)
|
obj:GetChild("tex_time").text = os.date("%Y-%m-%d", data.time)
|
||||||
obj:GetChild("tex_round").text = data.num
|
obj:GetChild("tex_round").text = data.num
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
local TimeSettingPanel = import(".TimeSettingPanel")
|
||||||
-- 开桌统计
|
-- 开桌统计
|
||||||
local GroupMngRoomStatView = {}
|
local GroupMngRoomStatView = {}
|
||||||
|
|
||||||
|
|
@ -25,34 +26,37 @@ end
|
||||||
|
|
||||||
function M:InitView()
|
function M:InitView()
|
||||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupStat")
|
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupStat")
|
||||||
|
|
||||||
self.record_data = {} --回放数据
|
|
||||||
self.player_record_data = {} --指定玩家的回放数据
|
|
||||||
self.qid = 0 --查询玩家id
|
|
||||||
|
|
||||||
self.lst_record_find = self._view:GetChild("lst_record_find")
|
self.record_data = {} --回放数据
|
||||||
self.lst_record_find:SetVirtual()
|
self.player_record_data = {} --指定玩家的回放数据
|
||||||
|
self.qid = 0 --查询玩家id
|
||||||
|
|
||||||
|
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
||||||
|
-308, 0)
|
||||||
|
self.begin_time, self.end_time = self.time_panel:GetDate()
|
||||||
|
|
||||||
|
self.lst_record_find = self._view:GetChild("lst_record_find")
|
||||||
|
self.lst_record_find:SetVirtual()
|
||||||
self.lst_record_find.itemRenderer = function(index, obj)
|
self.lst_record_find.itemRenderer = function(index, obj)
|
||||||
self:OnRenderRecordItem1(index, obj)
|
self:OnRenderRecordItem1(index, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.lst_record = self._view:GetChild("lst_record")
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
self.lst_record:SetVirtual()
|
self.lst_record:SetVirtual()
|
||||||
self.lst_record.itemRenderer = function(index, obj)
|
self.lst_record.itemRenderer = function(index, obj)
|
||||||
self:OnRenderRecordItem(index, obj)
|
self:OnRenderRecordItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetRecordData(self.lst_record.numItems)
|
self:GetRecordData(self.lst_record.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.lst_player_record = self._view:GetChild("lst_player_record")
|
self.lst_player_record = self._view:GetChild("lst_player_record")
|
||||||
self.lst_player_record:SetVirtual()
|
self.lst_player_record:SetVirtual()
|
||||||
self.lst_player_record.itemRenderer = function(index, obj)
|
self.lst_player_record.itemRenderer = function(index, obj)
|
||||||
self:OnRenderPlayerRecordItem(index, obj)
|
self:OnRenderPlayerRecordItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_player_record.scrollPane.onPullUpRelease:Set(function()
|
self.lst_player_record.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetRecordData(self.lst_player_record.numItems, self.qid)
|
self:GetRecordData(self.lst_player_record.numItems, self.qid)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self._view:GetChild("btn_search").onClick:Set(function()
|
self._view:GetChild("btn_search").onClick:Set(function()
|
||||||
|
|
@ -75,44 +79,44 @@ function M:InitView()
|
||||||
self.qid = 0
|
self.qid = 0
|
||||||
self.player_record_data = {}
|
self.player_record_data = {}
|
||||||
self.lst_player_record.numItems = 0
|
self.lst_player_record.numItems = 0
|
||||||
self.isFindCode=false
|
self.isFindCode = false
|
||||||
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetRecordData(index, qid)
|
function M:GetRecordData(index, qid)
|
||||||
qid = qid or 0
|
qid = qid or 0
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetGroupRecord(self.group_id, GetPlatform(), qid, index, 6, function(res)
|
fgCtr:FG_GetGroupRecordSpe(self.group_id, GetPlatform(), qid, 0, index, 6, self.begin_time, self.end_time, 0,
|
||||||
printlog("ccccccccccccccccccccccccccccccccccccc")
|
function(res)
|
||||||
pt(res)
|
printlog("ccccccccccccccccccccccccccccccccccccc")
|
||||||
if self._is_destroy then
|
pt(res)
|
||||||
return
|
if self._is_destroy then
|
||||||
end
|
return
|
||||||
ViewUtil.CloseModalWait()
|
|
||||||
if res.ReturnCode ~= 0 then
|
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
|
|
||||||
else
|
|
||||||
local ctr_search = self._view:GetController("search")
|
|
||||||
local records = res.Data.records
|
|
||||||
if qid == 0 then
|
|
||||||
for i = 1, #records do
|
|
||||||
self.record_data[#self.record_data + 1] = records[i]
|
|
||||||
end
|
|
||||||
self.lst_record.numItems = #self.record_data
|
|
||||||
if ctr_search.selectedIndex ~= 0 then
|
|
||||||
ctr_search.selectedIndex = 0
|
|
||||||
end
|
|
||||||
else
|
|
||||||
for i = 1, #records do
|
|
||||||
self.player_record_data[#self.player_record_data + 1] = records[i]
|
|
||||||
end
|
|
||||||
self.lst_player_record.numItems = #self.player_record_data
|
|
||||||
ctr_search.selectedIndex = 2
|
|
||||||
end
|
end
|
||||||
end
|
ViewUtil.CloseModalWait2()
|
||||||
end)
|
if res.ReturnCode ~= 0 then
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
|
||||||
|
else
|
||||||
|
local ctr_search = self._view:GetController("search")
|
||||||
|
local records = res.Data.records
|
||||||
|
if qid == 0 then
|
||||||
|
for i = 1, #records do
|
||||||
|
self.record_data[#self.record_data + 1] = records[i]
|
||||||
|
end
|
||||||
|
self.lst_record.numItems = #self.record_data
|
||||||
|
if ctr_search.selectedIndex ~= 0 then
|
||||||
|
ctr_search.selectedIndex = 0
|
||||||
|
end
|
||||||
|
else
|
||||||
|
for i = 1, #records do
|
||||||
|
self.player_record_data[#self.player_record_data + 1] = records[i]
|
||||||
|
end
|
||||||
|
self.lst_player_record.numItems = #self.player_record_data
|
||||||
|
ctr_search.selectedIndex = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillRecordItem(data, obj)
|
function M:FillRecordItem(data, obj)
|
||||||
|
|
@ -120,7 +124,7 @@ function M:FillRecordItem(data, obj)
|
||||||
local room_id = data.room_id
|
local room_id = data.room_id
|
||||||
local create_time = data.create_time
|
local create_time = data.create_time
|
||||||
local room_type_str = data.game_info.name
|
local room_type_str = data.game_info.name
|
||||||
local time =tonumber(create_time)
|
local time = tonumber(create_time)
|
||||||
local room_time_str = os.date("%Y-%m-%d %H:%M:%S", time)
|
local room_time_str = os.date("%Y-%m-%d %H:%M:%S", time)
|
||||||
local totalScore = json.decode(data.totalScore)
|
local totalScore = json.decode(data.totalScore)
|
||||||
local hpOnOff = data.hpOnOff
|
local hpOnOff = data.hpOnOff
|
||||||
|
|
@ -138,22 +142,22 @@ function M:FillRecordItem(data, obj)
|
||||||
player_list[i].house = 0
|
player_list[i].house = 0
|
||||||
player_list[i].nick = p.nick
|
player_list[i].nick = p.nick
|
||||||
end
|
end
|
||||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.groupPid)
|
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.groupPid)
|
||||||
|
|
||||||
obj:GetChild("tex_time").text = room_time_str
|
obj:GetChild("tex_time").text = room_time_str
|
||||||
obj:GetChild("tex_roomid").text = room_id
|
obj:GetChild("tex_roomid").text = room_id
|
||||||
obj:GetChild("tex_times").text = d2ad(data.hp_times).."倍"
|
obj:GetChild("tex_times").text = d2ad(data.hp_times) .. "倍"
|
||||||
obj:GetChild("tex_game").text = play_name
|
obj:GetChild("tex_game").text = play_name
|
||||||
local lst_total = obj:GetChild("lst_total")
|
local lst_total = obj:GetChild("lst_total")
|
||||||
lst_total:RemoveChildrenToPool()
|
lst_total:RemoveChildrenToPool()
|
||||||
local ids = {}
|
local ids = {}
|
||||||
for j=1,#totalScore do
|
for j = 1, #totalScore do
|
||||||
local titem = lst_total:AddItemFromPool()
|
local titem = lst_total:AddItemFromPool()
|
||||||
local trdata = totalScore[j]
|
local trdata = totalScore[j]
|
||||||
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
||||||
titem:GetChild("tex_id").text = trdata.accId and ("ID:"..trdata.accId) or ""
|
titem:GetChild("tex_id").text = trdata.accId and ("ID:" .. trdata.accId) or ""
|
||||||
|
|
||||||
table.insert( ids,trdata.accId )
|
table.insert(ids, trdata.accId)
|
||||||
local score = trdata.score
|
local score = trdata.score
|
||||||
if trdata.hp == nil then
|
if trdata.hp == nil then
|
||||||
if hpOnOff == 1 and hpType > 1 then
|
if hpOnOff == 1 and hpType > 1 then
|
||||||
|
|
@ -162,7 +166,7 @@ function M:FillRecordItem(data, obj)
|
||||||
else
|
else
|
||||||
score = d2ad(trdata.hp)
|
score = d2ad(trdata.hp)
|
||||||
end
|
end
|
||||||
|
|
||||||
titem:GetChild("tex_score").text = score
|
titem:GetChild("tex_score").text = score
|
||||||
|
|
||||||
if score >= 0 then
|
if score >= 0 then
|
||||||
|
|
@ -180,24 +184,24 @@ function M:FillRecordItem(data, obj)
|
||||||
|
|
||||||
obj:GetChild("btn_screenshot").onClick:Set(function()
|
obj:GetChild("btn_screenshot").onClick:Set(function()
|
||||||
self:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
self:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
obj:GetChild("btn_share").onClick:Set(function()
|
obj:GetChild("btn_share").onClick:Set(function()
|
||||||
ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list)
|
ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list)
|
||||||
end)
|
end)
|
||||||
obj.onClick:Set(function()
|
obj.onClick:Set(function()
|
||||||
self:OnShowRecordInfo(data,ids)
|
self:OnShowRecordInfo(data, ids)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderRecordItem(index, obj)
|
function M:OnRenderRecordItem(index, obj)
|
||||||
local data = self.record_data[index + 1]
|
local data = self.record_data[index + 1]
|
||||||
self:FillRecordItem(data, obj)
|
self:FillRecordItem(data, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderRecordItem1(index, obj)
|
function M:OnRenderRecordItem1(index, obj)
|
||||||
local data=self.tempRec[index+1]
|
local data = self.tempRec[index + 1]
|
||||||
self:FillRecordItem(data, obj)
|
self:FillRecordItem(data, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderPlayerRecordItem(index, obj)
|
function M:OnRenderPlayerRecordItem(index, obj)
|
||||||
|
|
@ -205,33 +209,32 @@ function M:OnRenderPlayerRecordItem(index, obj)
|
||||||
self:FillRecordItem(data, obj)
|
self:FillRecordItem(data, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:GetRecordByRoomid()
|
function M:GetRecordByRoomid()
|
||||||
local qid = self._view:GetChild("tex_id").text
|
local qid = self._view:GetChild("tex_id").text
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetRecordByRoomid(self.group_id, qid, GetPlatform(), function(res)
|
fgCtr:FG_GetRecordByRoomid(self.group_id, qid, GetPlatform(), function(res)
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
|
||||||
else
|
else
|
||||||
if not res.Data.is_rec then
|
if not res.Data.is_rec then
|
||||||
ViewUtil.ErrorTip(nil, "没有找到回放")
|
ViewUtil.ErrorTip(nil, "没有找到回放")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.tempRec=res.Data.rec
|
self.tempRec = res.Data.rec
|
||||||
self.lst_record_find.numItems = #res.Data.rec
|
self.lst_record_find.numItems = #res.Data.rec
|
||||||
|
|
||||||
self._view:GetController("search").selectedIndex = 1
|
self._view:GetController("search").selectedIndex = 1
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
|
||||||
ViewUtil.ShowModalWait(self._view, "正在分享...")
|
ViewUtil.ShowModalWait2(self._view, "正在分享...")
|
||||||
UIPackage.AddPackage("base/rank/ui/Rank")
|
UIPackage.AddPackage("base/rank/ui/Rank")
|
||||||
local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView")
|
local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView")
|
||||||
result_view.visible = false
|
result_view.visible = false
|
||||||
|
|
@ -253,15 +256,15 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
||||||
end
|
end
|
||||||
item:GetChild("score").text = score
|
item:GetChild("score").text = score
|
||||||
if score < 0 then item:GetController("di").selectedIndex = 1 end
|
if score < 0 then item:GetController("di").selectedIndex = 1 end
|
||||||
if p.portrait and p.portrait ~= "" then
|
if p.portrait and p.portrait ~= "" then
|
||||||
ImageLoad.Load(p.portrait, item:GetChild("n9")._iconObject, self.class, function( ... )
|
ImageLoad.Load(p.portrait, item:GetChild("n9")._iconObject, self.class, function(...)
|
||||||
load_head_num = load_head_num - 1
|
load_head_num = load_head_num - 1
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
load_head_num = load_head_num - 1
|
load_head_num = load_head_num - 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
coroutine.start(function ( ... )
|
coroutine.start(function(...)
|
||||||
local left_time = 4
|
local left_time = 4
|
||||||
while (true) do
|
while (true) do
|
||||||
if load_head_num == 0 or left_time == 0 then
|
if load_head_num == 0 or left_time == 0 then
|
||||||
|
|
@ -270,7 +273,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
||||||
ShareScreenShotWithOption(function()
|
ShareScreenShotWithOption(function()
|
||||||
result_view:Dispose()
|
result_view:Dispose()
|
||||||
end)
|
end)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
coroutine.wait(1)
|
coroutine.wait(1)
|
||||||
|
|
@ -279,7 +282,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnShowRecordInfo(rdata,ids)
|
function M:OnShowRecordInfo(rdata, ids)
|
||||||
local ctr_record = self._view:GetController("record")
|
local ctr_record = self._view:GetController("record")
|
||||||
ctr_record.selectedIndex = 1
|
ctr_record.selectedIndex = 1
|
||||||
|
|
||||||
|
|
@ -292,21 +295,21 @@ function M:OnShowRecordInfo(rdata,ids)
|
||||||
local hpOnOff = rdata.hpOnOff
|
local hpOnOff = rdata.hpOnOff
|
||||||
local hpType = rdata.game_info.hpType
|
local hpType = rdata.game_info.hpType
|
||||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(rdata.groupPid)
|
local play_name = DataManager.groups:get(self.group_id):getPlayName(rdata.groupPid)
|
||||||
for i = 1,round_count do
|
for i = 1, round_count do
|
||||||
local item = lst_recordInfo:AddItemFromPool()
|
local item = lst_recordInfo:AddItemFromPool()
|
||||||
item:GetChild("tex_num").text = tostring(i)
|
item:GetChild("tex_num").text = tostring(i)
|
||||||
item:GetChild("tex_game").text = play_name
|
item:GetChild("tex_game").text = play_name
|
||||||
item:GetChild("tex_times").text = d2ad(rdata.hp_times).."倍"
|
item:GetChild("tex_times").text = d2ad(rdata.hp_times) .. "倍"
|
||||||
item:GetChild("tex_roomid").text = rdata.room_id
|
item:GetChild("tex_roomid").text = rdata.room_id
|
||||||
local round_score_str = rdata["round_"..i]
|
local round_score_str = rdata["round_" .. i]
|
||||||
local round_score_item = json.decode(round_score_str)
|
local round_score_item = json.decode(round_score_str)
|
||||||
local lst_total = item:GetChild("lst_total")
|
local lst_total = item:GetChild("lst_total")
|
||||||
lst_total:RemoveChildrenToPool()
|
lst_total:RemoveChildrenToPool()
|
||||||
for k=1,#round_score_item do
|
for k = 1, #round_score_item do
|
||||||
local titem = lst_total:AddItemFromPool()
|
local titem = lst_total:AddItemFromPool()
|
||||||
local trdata = round_score_item[k]
|
local trdata = round_score_item[k]
|
||||||
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
||||||
titem:GetChild("tex_id").text = "ID:".. ids[k]
|
titem:GetChild("tex_id").text = "ID:" .. ids[k]
|
||||||
local score = trdata.score
|
local score = trdata.score
|
||||||
if trdata.hp == nil then
|
if trdata.hp == nil then
|
||||||
if hpOnOff == 1 and hpType > 1 then
|
if hpOnOff == 1 and hpType > 1 then
|
||||||
|
|
@ -315,7 +318,7 @@ function M:OnShowRecordInfo(rdata,ids)
|
||||||
else
|
else
|
||||||
score = d2ad(trdata.hp)
|
score = d2ad(trdata.hp)
|
||||||
end
|
end
|
||||||
|
|
||||||
titem:GetChild("tex_score").text = score
|
titem:GetChild("tex_score").text = score
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -325,11 +328,11 @@ function M:OnShowRecordInfo(rdata,ids)
|
||||||
item:GetController("person_num").selectedIndex = 0
|
item:GetController("person_num").selectedIndex = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
local btn_play =item:GetChild("btn_play")
|
local btn_play = item:GetChild("btn_play")
|
||||||
btn_play.onClick:Set(function()
|
btn_play.onClick:Set(function()
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if DataManager.SelfUser.playback[playback_id] ~= nil and DataManager.SelfUser.playback[playback_id][i] ~= nil then
|
if DataManager.SelfUser.playback[playback_id] ~= nil and DataManager.SelfUser.playback[playback_id][i] ~= nil then
|
||||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||||
DataManager.CurrenRoom = room
|
DataManager.CurrenRoom = room
|
||||||
room.lev = group.lev
|
room.lev = group.lev
|
||||||
room.game_id = game_id
|
room.game_id = game_id
|
||||||
|
|
@ -344,13 +347,13 @@ function M:OnShowRecordInfo(rdata,ids)
|
||||||
main._totalRound = tonumber(rdata.round)
|
main._totalRound = tonumber(rdata.round)
|
||||||
main:FillRoomData(DataManager.SelfUser.playback[playback_id][i])
|
main:FillRoomData(DataManager.SelfUser.playback[playback_id][i])
|
||||||
else
|
else
|
||||||
ViewUtil.ShowModalWait(self._view)
|
ViewUtil.ShowModalWait2(self._view)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data["military_id"] = playback_id
|
_data["military_id"] = playback_id
|
||||||
_data["round"] = tostring(i)
|
_data["round"] = tostring(i)
|
||||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||||
loddyCtr1:RequestPlayBack(_data,function(code,data)
|
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
||||||
DataManager.SelfUser.playback[playback_id][i] = data
|
DataManager.SelfUser.playback[playback_id][i] = data
|
||||||
|
|
@ -377,7 +380,7 @@ function M:OnShowRecordInfo(rdata,ids)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GenaratePlayBack(id, game_id, ...)
|
function M:GenaratePlayBack(id, game_id, ...)
|
||||||
local tem =nil
|
local tem = nil
|
||||||
local dview_class = nil
|
local dview_class = nil
|
||||||
if not dview_class then
|
if not dview_class then
|
||||||
local exconfig = ExtendManager.GetExtendConfig(game_id)
|
local exconfig = ExtendManager.GetExtendConfig(game_id)
|
||||||
|
|
@ -386,11 +389,11 @@ function M:GenaratePlayBack(id, game_id, ...)
|
||||||
if not dview_class then
|
if not dview_class then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
tem = dview_class.new(...)
|
tem = dview_class.new(...)
|
||||||
tem.Id = id
|
tem.Id = id
|
||||||
tem:Show()
|
tem:Show()
|
||||||
return tem
|
return tem
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -19,16 +19,13 @@ function M:initData()
|
||||||
self.lst_record.numItems = 0
|
self.lst_record.numItems = 0
|
||||||
self.record_data = {}
|
self.record_data = {}
|
||||||
|
|
||||||
local now_time = os.date("*t",now)
|
local now_time = os.date("*t", now)
|
||||||
local today = os.time({year=now_time.year, month=now_time.month, day=now_time.day, hour=0,min=0,sec=0})
|
local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 })
|
||||||
self.begin_time = today
|
self.begin_time = today
|
||||||
self.end_time = today + 86400
|
self.end_time = today + 86400
|
||||||
self:GetRecordData(0)
|
self:GetRecordData(0)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function M:InitView()
|
function M:InitView()
|
||||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupXingYunStat")
|
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupXingYunStat")
|
||||||
|
|
||||||
|
|
@ -38,31 +35,32 @@ function M:InitView()
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
local lst_mgr_index = self._view:GetChild("lst_mgr_index")
|
local lst_mgr_index = self._view:GetChild("lst_mgr_index")
|
||||||
|
|
||||||
|
|
||||||
self.lst_record = self._view:GetChild("lst_record")
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
self.lst_record:SetVirtual()
|
self.lst_record:SetVirtual()
|
||||||
self.lst_record.itemRenderer = function(index, obj)
|
self.lst_record.itemRenderer = function(index, obj)
|
||||||
self:OnRenderRecordItem(index, obj)
|
self:OnRenderRecordItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetRecordData(self.lst_record.numItems)
|
self:GetRecordData(self.lst_record.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0, nil, true)
|
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
||||||
|
-308, 0, nil, true)
|
||||||
|
|
||||||
local ctr_page = self._view:GetController("type")
|
local ctr_page = self._view:GetController("type")
|
||||||
ctr_page.onChanged:Set(function()
|
ctr_page.onChanged:Set(function()
|
||||||
self.record_data = {}
|
self.record_data = {}
|
||||||
self.lst_record.numItems = 0
|
self.lst_record.numItems = 0
|
||||||
if ctr_page.selectedIndex == 0 then
|
if ctr_page.selectedIndex == 0 then
|
||||||
local now_time = os.date("*t",now)
|
local now_time = os.date("*t", now)
|
||||||
local today = os.time({year=now_time.year, month=now_time.month, day=now_time.day, hour=0,min=0,sec=0})
|
local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 })
|
||||||
self.begin_time = today
|
self.begin_time = today
|
||||||
self.end_time = today + 86400
|
self.end_time = today + 86400
|
||||||
else
|
else
|
||||||
local now_time = os.date("*t",now)
|
local now_time = os.date("*t", now)
|
||||||
local today = os.time({year=now_time.year, month=now_time.month, day=now_time.day, hour=0,min=0,sec=0})
|
local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 })
|
||||||
self.begin_time = today - 86400 * ctr_page.selectedIndex
|
self.begin_time = today - 86400 * ctr_page.selectedIndex
|
||||||
self.end_time = today - 86400 * (ctr_page.selectedIndex - 1)
|
self.end_time = today - 86400 * (ctr_page.selectedIndex - 1)
|
||||||
end
|
end
|
||||||
|
|
@ -78,28 +76,23 @@ function M:InitView()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.totalwin = self._view:GetChild("tex_alltotal")
|
self.totalwin = self._view:GetChild("tex_alltotal")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:GetRecordData(index)
|
function M:GetRecordData(index)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
ViewUtil.ShowModalWait()
|
|
||||||
|
|
||||||
local time_type = self._view:GetController("type").selectedIndex
|
local time_type = self._view:GetController("type").selectedIndex
|
||||||
if self.begin_time ~= nil and self.end_time ~= nil then
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
||||||
time_type = 0
|
time_type = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
||||||
fgCtr:FG_GetXingYunStat(self.group_id, index, 6, time_type,self.begin_time,self.end_time,function(res)
|
|
||||||
|
|
||||||
ViewUtil.CloseModalWait()
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
fgCtr:FG_GetXingYunStat(self.group_id, index, 6, time_type, self.begin_time, self.end_time, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
|
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
|
|
||||||
local members = res.Data.members
|
local members = res.Data.members
|
||||||
|
|
||||||
self.totalwin.text = d2ad(res.Data.all_total_win)
|
self.totalwin.text = d2ad(res.Data.all_total_win)
|
||||||
for i = 1, #members do
|
for i = 1, #members do
|
||||||
self.record_data[#self.record_data + 1] = members[i]
|
self.record_data[#self.record_data + 1] = members[i]
|
||||||
|
|
@ -109,23 +102,19 @@ function M:GetRecordData(index)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:FillRecordItem(data, obj)
|
function M:FillRecordItem(data, obj)
|
||||||
|
local group = DataManager.groups:get(self.group_id)
|
||||||
local group = DataManager.groups:get(self.group_id)
|
|
||||||
|
|
||||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||||
obj:GetChild("tex_round_total").text = data.total_round
|
obj:GetChild("tex_round_total").text = data.total_round
|
||||||
obj:GetChild("tex_total").text = d2ad(data.total_win)
|
obj:GetChild("tex_total").text = d2ad(data.total_win)
|
||||||
obj:GetChild("tex_round_youxiao").text = data.valid_round / 100
|
obj:GetChild("tex_round_youxiao").text = data.valid_round / 100
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderRecordItem(index, obj)
|
function M:OnRenderRecordItem(index, obj)
|
||||||
local data = self.record_data[index + 1]
|
local data = self.record_data[index + 1]
|
||||||
self:FillRecordItem(data, obj)
|
self:FillRecordItem(data, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
return M
|
|
||||||
|
|
|
||||||
|
|
@ -19,16 +19,13 @@ function M:initData()
|
||||||
self.lst_record.numItems = 0
|
self.lst_record.numItems = 0
|
||||||
self.record_data = {}
|
self.record_data = {}
|
||||||
|
|
||||||
local now_time = os.date("*t",now)
|
local now_time = os.date("*t", now)
|
||||||
local today = os.time({year=now_time.year, month=now_time.month, day=now_time.day, hour=0,min=0,sec=0})
|
local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 })
|
||||||
self.begin_time = today
|
self.begin_time = today
|
||||||
self.end_time = today + 86400
|
self.end_time = today + 86400
|
||||||
self:GetRecordData(0)
|
self:GetRecordData(0)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function M:InitView()
|
function M:InitView()
|
||||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupZuanShi")
|
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupZuanShi")
|
||||||
|
|
||||||
|
|
@ -44,28 +41,29 @@ function M:InitView()
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
self.lst_record = self._view:GetChild("lst_record")
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
self.lst_record:SetVirtual()
|
self.lst_record:SetVirtual()
|
||||||
self.lst_record.itemRenderer = function(index, obj)
|
self.lst_record.itemRenderer = function(index, obj)
|
||||||
self:OnRenderRecordItem(index, obj)
|
self:OnRenderRecordItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetRecordData(self.lst_record.numItems)
|
self:GetRecordData(self.lst_record.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0, nil, true)
|
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
||||||
|
-308, 0, nil, true)
|
||||||
|
|
||||||
local ctr_page = self._view:GetController("type")
|
local ctr_page = self._view:GetController("type")
|
||||||
ctr_page.onChanged:Set(function()
|
ctr_page.onChanged:Set(function()
|
||||||
self.record_data = {}
|
self.record_data = {}
|
||||||
self.lst_record.numItems = 0
|
self.lst_record.numItems = 0
|
||||||
if ctr_page.selectedIndex == 0 then
|
if ctr_page.selectedIndex == 0 then
|
||||||
local now_time = os.date("*t",now)
|
local now_time = os.date("*t", now)
|
||||||
local today = os.time({year=now_time.year, month=now_time.month, day=now_time.day, hour=0,min=0,sec=0})
|
local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 })
|
||||||
self.begin_time = today
|
self.begin_time = today
|
||||||
self.end_time = today + 86400
|
self.end_time = today + 86400
|
||||||
else
|
else
|
||||||
local now_time = os.date("*t",now)
|
local now_time = os.date("*t", now)
|
||||||
local today = os.time({year=now_time.year, month=now_time.month, day=now_time.day, hour=0,min=0,sec=0})
|
local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 })
|
||||||
self.begin_time = today - 86400 * ctr_page.selectedIndex
|
self.begin_time = today - 86400 * ctr_page.selectedIndex
|
||||||
self.end_time = today - 86400 * (ctr_page.selectedIndex - 1)
|
self.end_time = today - 86400 * (ctr_page.selectedIndex - 1)
|
||||||
end
|
end
|
||||||
|
|
@ -78,11 +76,11 @@ function M:InitView()
|
||||||
self._view:GetChild('btn_search').onClick:Set(
|
self._view:GetChild('btn_search').onClick:Set(
|
||||||
function()
|
function()
|
||||||
--printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
--printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local text = self._view:GetChild('tex_id').text
|
local text = self._view:GetChild('tex_id').text
|
||||||
local qid, qnick
|
local qid, qnick
|
||||||
if text == "" then
|
if text == "" then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -95,11 +93,11 @@ function M:InitView()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_FindZuanShiStat(
|
fgCtr:FG_FindZuanShiStat(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
qid,0, 6, time_type,self.begin_time,self.end_time,
|
qid, 0, 6, time_type, self.begin_time, self.end_time,
|
||||||
function(res)
|
function(res)
|
||||||
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
||||||
-- pt(res)
|
-- pt(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -113,14 +111,14 @@ function M:InitView()
|
||||||
|
|
||||||
for j = 1, #res.Data.members do
|
for j = 1, #res.Data.members do
|
||||||
local tem = item_result:AddItemFromPool()
|
local tem = item_result:AddItemFromPool()
|
||||||
self:FillRecordItem(res.Data.members[j],tem)
|
self:FillRecordItem(res.Data.members[j], tem)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
local btn_back = self._view:GetChild('btn_back')
|
local btn_back = self._view:GetChild('btn_back')
|
||||||
btn_back.onClick:Set(
|
btn_back.onClick:Set(
|
||||||
function()
|
function()
|
||||||
|
|
@ -129,10 +127,8 @@ function M:InitView()
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:GetRecordData(index)
|
function M:GetRecordData(index)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
ViewUtil.ShowModalWait()
|
|
||||||
|
|
||||||
local time_type = self._view:GetController("type").selectedIndex
|
local time_type = self._view:GetController("type").selectedIndex
|
||||||
if self.begin_time ~= nil and self.end_time ~= nil then
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
||||||
|
|
@ -140,15 +136,13 @@ function M:GetRecordData(index)
|
||||||
end
|
end
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetZuanShiStat(self.group_id, index, 6, time_type,self.begin_time,self.end_time,function(res)
|
fgCtr:FG_GetZuanShiStat(self.group_id, index, 6, time_type, self.begin_time, self.end_time, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.CloseModalWait()
|
|
||||||
|
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
|
|
||||||
local members = res.Data.members
|
local members = res.Data.members
|
||||||
--printlog("aaaaaaaaaaaaaacccccccccccccccccccccccccccccccc")
|
--printlog("aaaaaaaaaaaaaacccccccccccccccccccccccccccccccc")
|
||||||
--pt(res)
|
--pt(res)
|
||||||
for i = 1, #members do
|
for i = 1, #members do
|
||||||
self.record_data[#self.record_data + 1] = members[i]
|
self.record_data[#self.record_data + 1] = members[i]
|
||||||
end
|
end
|
||||||
|
|
@ -173,32 +167,29 @@ local function __showRewardsValue(rtype, cur_value, max_value, mng)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillRecordItem(data, obj)
|
function M:FillRecordItem(data, obj)
|
||||||
|
local group = DataManager.groups:get(self.group_id)
|
||||||
|
|
||||||
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick) .. "(" .. data.total .. ")"
|
||||||
|
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||||
|
|
||||||
local group = DataManager.groups:get(self.group_id)
|
|
||||||
|
|
||||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick).."("..data.total..")"
|
|
||||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
obj:GetChild("tex_round_valid").text = data.single_diamo_cost / 100
|
obj:GetChild("tex_round_valid").text = data.single_diamo_cost / 100
|
||||||
obj:GetChild("tex_round_total").text = data.other_diamo_cost / 100
|
obj:GetChild("tex_round_total").text = data.other_diamo_cost / 100
|
||||||
obj:GetChild("tex_total").text = data.single_diamo_cost / 100 + data.other_diamo_cost / 100
|
obj:GetChild("tex_total").text = data.single_diamo_cost / 100 + data.other_diamo_cost / 100
|
||||||
|
|
||||||
local btn_detail = obj:GetChild("btn_detail")
|
local btn_detail = obj:GetChild("btn_detail")
|
||||||
btn_detail.onClick:Set(function()
|
btn_detail.onClick:Set(function()
|
||||||
local time_type = self._view:GetController("type").selectedIndex
|
local time_type = self._view:GetController("type").selectedIndex
|
||||||
--printlog("ccccccccccwwwwwwwwwwwwwwwwwwwwwwwwwwww ",self.begin_time," ",self.end_time)
|
--printlog("ccccccccccwwwwwwwwwwwwwwwwwwwwwwwwwwww ",self.begin_time," ",self.end_time)
|
||||||
local gniv = GroupPartnerZuanShiMember.new(self.group_id,data.uid, 0,self.begin_time,self.end_time)
|
local gniv = GroupPartnerZuanShiMember.new(self.group_id, data.uid, 0, self.begin_time, self.end_time)
|
||||||
gniv:Show()
|
gniv:Show()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderRecordItem(index, obj)
|
function M:OnRenderRecordItem(index, obj)
|
||||||
local data = self.record_data[index + 1]
|
local data = self.record_data[index + 1]
|
||||||
self:FillRecordItem(data, obj)
|
self:FillRecordItem(data, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
return M
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ local GroupPartnerBanPlaysView = {}
|
||||||
|
|
||||||
local M = GroupPartnerBanPlaysView
|
local M = GroupPartnerBanPlaysView
|
||||||
|
|
||||||
function GroupPartnerBanPlaysView.new(group_id,uid)
|
function GroupPartnerBanPlaysView.new(group_id, uid)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupPartnerBanPlaysView"
|
self.class = "GroupPartnerBanPlaysView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self.group_id = group_id
|
self.group_id = group_id
|
||||||
|
|
@ -17,13 +17,12 @@ function GroupPartnerBanPlaysView.new(group_id,uid)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:initView(url)
|
function M:initView(url)
|
||||||
BaseWindow.init(self, "ui://NewGroup/Win_PartnerBanPlays")
|
BaseWindow.init(self, "ui://NewGroup/Win_PartnerBanPlays")
|
||||||
|
|
||||||
self.lst_allplays = self._view:GetChild("lst_allplays")
|
self.lst_allplays = self._view:GetChild("lst_allplays")
|
||||||
self.lst_allplays:SetVirtual()
|
self.lst_allplays:SetVirtual()
|
||||||
self.lst_allplays.itemRenderer = function(index, obj)
|
self.lst_allplays.itemRenderer = function(index, obj)
|
||||||
|
self:OnRenderAllPlaysItem(index, obj)
|
||||||
self:OnRenderAllPlaysItem(index, obj)
|
|
||||||
end
|
end
|
||||||
self:GetBanPlaysData()
|
self:GetBanPlaysData()
|
||||||
end
|
end
|
||||||
|
|
@ -31,16 +30,16 @@ end
|
||||||
-- 获取奖励设置数据
|
-- 获取奖励设置数据
|
||||||
function M:GetBanPlaysData()
|
function M:GetBanPlaysData()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetAllplays(self.group_id,self.uid, function(res)
|
fgCtr:FG_GetAllplays(self.group_id, self.uid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取所有玩法失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取所有玩法失败")
|
||||||
else
|
else
|
||||||
local allplays = res.Data.allplays
|
local allplays = res.Data.allplays
|
||||||
for i=1,#allplays do
|
for i = 1, #allplays do
|
||||||
self.allplays_data[i] = allplays[i]
|
self.allplays_data[i] = allplays[i]
|
||||||
end
|
end
|
||||||
self.lst_allplays.numItems = #self.allplays_data
|
self.lst_allplays.numItems = #self.allplays_data
|
||||||
|
|
@ -48,37 +47,33 @@ function M:GetBanPlaysData()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 填充奖励设置对象
|
-- 填充奖励设置对象
|
||||||
function M:OnRenderAllPlaysItem(index, obj)
|
function M:OnRenderAllPlaysItem(index, obj)
|
||||||
local data = self.allplays_data[index + 1]
|
local data = self.allplays_data[index + 1]
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
|
|
||||||
local play_name = group:getPlayName(data.pid)
|
|
||||||
obj:GetChild("tex_name").text = data.playname
|
|
||||||
|
|
||||||
obj:GetChild("gxbtn").selected = data.ban==1
|
local play_name = group:getPlayName(data.pid)
|
||||||
|
obj:GetChild("tex_name").text = data.playname
|
||||||
|
|
||||||
|
obj:GetChild("gxbtn").selected = data.ban == 1
|
||||||
|
|
||||||
obj:GetChild("gxbtn").onClick:Set(function()
|
obj:GetChild("gxbtn").onClick:Set(function()
|
||||||
local bans = data.ban
|
local bans = data.ban
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_SetBanPlayid(self.group_id,data.pid,data.ban,self.uid, function(res)
|
fgCtr:FG_SetBanPlayid(self.group_id, data.pid, data.ban, self.uid, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置玩法失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置玩法失败")
|
||||||
else
|
else
|
||||||
local banoks = res.Data.allplays
|
local banoks = res.Data.allplays
|
||||||
obj:GetChild("gxbtn").selected = banoks[1].banok==1
|
obj:GetChild("gxbtn").selected = banoks[1].banok == 1
|
||||||
self:GetBanPlaysData()
|
self:GetBanPlaysData()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ local GroupPartnerMemberListView = {}
|
||||||
local M = GroupPartnerMemberListView
|
local M = GroupPartnerMemberListView
|
||||||
|
|
||||||
function GroupPartnerMemberListView.new(group_id, partner_id)
|
function GroupPartnerMemberListView.new(group_id, partner_id)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupPartnerMemberListView"
|
self.class = "GroupPartnerMemberListView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self._blur_view = blur_view
|
self._blur_view = blur_view
|
||||||
|
|
@ -21,13 +21,13 @@ function GroupPartnerMemberListView.new(group_id, partner_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:initView(url)
|
function M:initView(url)
|
||||||
BaseWindow.init(self, "ui://NewGroup/Win_PartnerMemberList")
|
BaseWindow.init(self, "ui://NewGroup/Win_PartnerMemberList")
|
||||||
-- 合伙人列表
|
-- 合伙人列表
|
||||||
self.lst_member = self._view:GetChild("lst_member")
|
self.lst_member = self._view:GetChild("lst_member")
|
||||||
self.lst_member:SetVirtual()
|
self.lst_member:SetVirtual()
|
||||||
self.lst_member.itemRenderer = function(index, obj)
|
self.lst_member.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_member.scrollPane.onPullUpRelease:Set(function()
|
self.lst_member.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:GetMemberData(self.lst_member.numItems)
|
self:GetMemberData(self.lst_member.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
@ -35,7 +35,7 @@ function M:initView(url)
|
||||||
local btn_back_pre = self._view:GetChild("btn_back_pre")
|
local btn_back_pre = self._view:GetChild("btn_back_pre")
|
||||||
btn_back_pre.onClick:Set(function()
|
btn_back_pre.onClick:Set(function()
|
||||||
if self.top > 1 then
|
if self.top > 1 then
|
||||||
self.partner_id[self.top] = nil
|
self.partner_id[self.top] = nil
|
||||||
self.top = self.top - 1
|
self.top = self.top - 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -48,21 +48,21 @@ function M:initView(url)
|
||||||
local btn_search = self._view:GetChild("btn_search")
|
local btn_search = self._view:GetChild("btn_search")
|
||||||
local ctr_search = self._view:GetController("search")
|
local ctr_search = self._view:GetController("search")
|
||||||
btn_search.onClick:Set(function()
|
btn_search.onClick:Set(function()
|
||||||
local gfiv = GroupNumberInputView.new(self._root_view,function(num)
|
local gfiv = GroupNumberInputView.new(self._root_view, function(num)
|
||||||
self:GetMemberData(0, num, function(data)
|
self:GetMemberData(0, num, function(data)
|
||||||
if #data == 0 then
|
if #data == 0 then
|
||||||
ViewUtil.ErrorTip(nil, "没有找到成员")
|
ViewUtil.ErrorTip(nil, "没有找到成员")
|
||||||
else
|
else
|
||||||
ctr_search.selectedIndex = 1
|
ctr_search.selectedIndex = 1
|
||||||
self:FillItem(self._view:GetChild("item_result"), data[1])
|
self:FillItem(self._view:GetChild("item_result"), data[1])
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
gfiv:Show()
|
gfiv:Show()
|
||||||
end)
|
end)
|
||||||
local btn_back = self._view:GetChild("btn_back")
|
local btn_back = self._view:GetChild("btn_back")
|
||||||
btn_back.onClick:Set(function()
|
btn_back.onClick:Set(function()
|
||||||
ctr_search.selectedIndex = 0
|
ctr_search.selectedIndex = 0
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- 初始化数据
|
-- 初始化数据
|
||||||
|
|
@ -71,37 +71,35 @@ end
|
||||||
|
|
||||||
-- 获取合伙人成员数据
|
-- 获取合伙人成员数据
|
||||||
function M:GetMemberData(index, quary_id, callback)
|
function M:GetMemberData(index, quary_id, callback)
|
||||||
quary_id = quary_id or 0
|
quary_id = quary_id or 0
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
if index == 0 then
|
if index == 0 then
|
||||||
self.member_data = {}
|
self.member_data = {}
|
||||||
end
|
end
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetPartnerMembers(self.group_id, self.partner_id[self.top], index, 8, quary_id, function(res)
|
fgCtr:FG_GetPartnerMembers(self.group_id, self.partner_id[self.top], index, 8, quary_id, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人成员列表失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人成员列表失败")
|
||||||
else
|
else
|
||||||
local members = res.Data.members
|
local members = res.Data.members
|
||||||
if quary_id == 0 then
|
if quary_id == 0 then
|
||||||
for i = 1, #members do
|
for i = 1, #members do
|
||||||
self.member_data[#self.member_data + 1] = members[i]
|
self.member_data[#self.member_data + 1] = members[i]
|
||||||
end
|
end
|
||||||
self.lst_member.numItems = #self.member_data
|
self.lst_member.numItems = #self.member_data
|
||||||
else
|
else
|
||||||
callback(members)
|
callback(members)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 填充合伙人成员对象
|
-- 填充合伙人成员对象
|
||||||
function M:FillItem(obj, data)
|
function M:FillItem(obj, data)
|
||||||
|
obj:GetChild("tex_id").text = data.uid
|
||||||
obj:GetChild("tex_id").text = data.uid
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
|
||||||
|
|
||||||
obj:GetChild("btn_head").icon = "ui://Common/Head0"
|
obj:GetChild("btn_head").icon = "ui://Common/Head0"
|
||||||
ImageLoad.Load(data.portrait, obj:GetChild("btn_head")._iconObject, self.class)
|
ImageLoad.Load(data.portrait, obj:GetChild("btn_head")._iconObject, self.class)
|
||||||
|
|
@ -109,22 +107,23 @@ function M:FillItem(obj, data)
|
||||||
obj:GetChild("tex_last_total").text = data.round or "0"
|
obj:GetChild("tex_last_total").text = data.round or "0"
|
||||||
|
|
||||||
obj:GetChild("tex_status").text = data.online == 1 and "在线" or "离线"
|
obj:GetChild("tex_status").text = data.online == 1 and "在线" or "离线"
|
||||||
|
|
||||||
obj:GetChild("tex_join_time").text = os.date("%Y/%m/%d", data.join_time)
|
obj:GetChild("tex_join_time").text = os.date("%Y/%m/%d", data.join_time)
|
||||||
|
|
||||||
obj:GetController("partner").selectedIndex = data.partnerLev > 0 and 1 or 0
|
obj:GetController("partner").selectedIndex = data.partnerLev > 0 and 1 or 0
|
||||||
|
|
||||||
obj:GetChild("btn_check_members").onClick:Set(function()
|
obj:GetChild("btn_check_members").onClick:Set(function()
|
||||||
self.partner_id[#self.partner_id + 1] = data.uid
|
self.partner_id[#self.partner_id + 1] = data.uid
|
||||||
self.top = #self.partner_id
|
self.top = #self.partner_id
|
||||||
self._view:GetController("pre").selectedIndex = 1
|
self._view:GetController("pre").selectedIndex = 1
|
||||||
self:GetMemberData(0)
|
self:GetMemberData(0)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 填充列表
|
-- 填充列表
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local data = self.member_data[index + 1]
|
local data = self.member_data[index + 1]
|
||||||
self:FillItem(obj, data)
|
self:FillItem(obj, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ end
|
||||||
function M:GetRewardsData()
|
function M:GetRewardsData()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetRewards(self.group_id, self.partner_id, self.partner_lev, function(res)
|
fgCtr:FG_GetRewards(self.group_id, self.partner_id, self.partner_lev, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -92,7 +92,7 @@ function M:OnRenderRewardsItem(index, obj)
|
||||||
obj:GetController("fandian").selectedIndex = self.showxipai
|
obj:GetController("fandian").selectedIndex = self.showxipai
|
||||||
--printlog("aaaaaaaaaaaaaaaaaaaaa ",__showRewardsValue(data.xipai_rewardType, data.xipai_cur_value, data.xipai_max_value, group.lev < 3, data.xipai_rewardValueType or 1))
|
--printlog("aaaaaaaaaaaaaaaaaaaaa ",__showRewardsValue(data.xipai_rewardType, data.xipai_cur_value, data.xipai_max_value, group.lev < 3, data.xipai_rewardValueType or 1))
|
||||||
obj:GetChild("tex_xipai").text = __showRewardsValue(data.xipai_rewardType, data.xipai_cur_value, data
|
obj:GetChild("tex_xipai").text = __showRewardsValue(data.xipai_rewardType, data.xipai_cur_value, data
|
||||||
.xipai_max_value, group.lev < 3, data.xipai_rewardValueType or 1)
|
.xipai_max_value, group.lev < 3, data.xipai_rewardValueType or 1)
|
||||||
obj:GetChild("tex_rewards").text = __showRewardsValue(data.rewardType, data.cur_value, data.max_value, group.lev < 3,
|
obj:GetChild("tex_rewards").text = __showRewardsValue(data.rewardType, data.cur_value, data.max_value, group.lev < 3,
|
||||||
data.rewardValueType or 1)
|
data.rewardValueType or 1)
|
||||||
obj:GetChild("tex_anchou").text = __showRewardsValue(data.anchou_rewardType, data.anchou_cur_value,
|
obj:GetChild("tex_anchou").text = __showRewardsValue(data.anchou_rewardType, data.anchou_cur_value,
|
||||||
|
|
@ -120,9 +120,9 @@ function M:OnRenderRewardsItem(index, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetRewards(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res)
|
fgCtr:FG_SetRewards(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置合伙人奖励失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置合伙人奖励失败")
|
||||||
else
|
else
|
||||||
|
|
@ -141,10 +141,10 @@ function M:OnRenderRewardsItem(index, obj)
|
||||||
msg_win.onOk:Add(function(...)
|
msg_win.onOk:Add(function(...)
|
||||||
local single = msg_win.btnCheck.selected and 1 or 0
|
local single = msg_win.btnCheck.selected and 1 or 0
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetRewards(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.cur_value, single,
|
fgCtr:FG_SetRewards(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.cur_value, single,
|
||||||
function(res)
|
function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置奖励失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置奖励失败")
|
||||||
else
|
else
|
||||||
|
|
@ -181,9 +181,9 @@ function M:OnRenderRewardsItem(index, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetXIPAI(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res)
|
fgCtr:FG_SetXIPAI(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置洗牌奖励失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置洗牌奖励失败")
|
||||||
else
|
else
|
||||||
|
|
@ -203,25 +203,25 @@ function M:OnRenderRewardsItem(index, obj)
|
||||||
local single = 0 --msg_win.btnCheck.selected and 1 or 0
|
local single = 0 --msg_win.btnCheck.selected and 1 or 0
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetXIPAI(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.xipai_cur_value,
|
fgCtr:FG_SetXIPAI(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.xipai_cur_value,
|
||||||
single, function(res)
|
single, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置洗牌失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置洗牌失败")
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(-1, "设置洗牌成功")
|
ViewUtil.ErrorTip(-1, "设置洗牌成功")
|
||||||
-- printlog("ccccccccccccccccc11111111111111111111111")
|
-- printlog("ccccccccccccccccc11111111111111111111111")
|
||||||
-- pt(res)
|
-- pt(res)
|
||||||
-- for i = 1, #self.rewards_data do
|
-- for i = 1, #self.rewards_data do
|
||||||
-- if self.rewards_data[i].xipai_rewardValueType == data.xipai_rewardValueType then
|
-- if self.rewards_data[i].xipai_rewardValueType == data.xipai_rewardValueType then
|
||||||
-- self.rewards_data[i].xipai_cur_value = data.xipai_cur_value
|
-- self.rewards_data[i].xipai_cur_value = data.xipai_cur_value
|
||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
-- self.lst_rewards.numItems = #self.rewards_data
|
-- self.lst_rewards.numItems = #self.rewards_data
|
||||||
self:GetRewardsData()
|
self:GetRewardsData()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
msg_win:Show()
|
msg_win:Show()
|
||||||
end)
|
end)
|
||||||
|
|
@ -245,9 +245,9 @@ function M:OnRenderRewardsItem(index, obj)
|
||||||
end
|
end
|
||||||
printlog("jefe btn_set2")
|
printlog("jefe btn_set2")
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetANCHOU(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res)
|
fgCtr:FG_SetANCHOU(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置管理奖励失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置管理奖励失败")
|
||||||
else
|
else
|
||||||
|
|
@ -267,25 +267,25 @@ function M:OnRenderRewardsItem(index, obj)
|
||||||
local single = 0 --msg_win.btnCheck.selected and 1 or 0
|
local single = 0 --msg_win.btnCheck.selected and 1 or 0
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
fgCtr:FG_SetANCHOU(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.anchou_cur_value,
|
fgCtr:FG_SetANCHOU(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.anchou_cur_value,
|
||||||
single, function(res)
|
single, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "设置管理失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "设置管理失败")
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(-1, "设置管理成功")
|
ViewUtil.ErrorTip(-1, "设置管理成功")
|
||||||
-- printlog("ccccccccccccccccc11111111111111111111111")
|
-- printlog("ccccccccccccccccc11111111111111111111111")
|
||||||
-- pt(res)
|
-- pt(res)
|
||||||
-- for i = 1, #self.rewards_data do
|
-- for i = 1, #self.rewards_data do
|
||||||
-- if self.rewards_data[i].xipai_rewardValueType == data.xipai_rewardValueType then
|
-- if self.rewards_data[i].xipai_rewardValueType == data.xipai_rewardValueType then
|
||||||
-- self.rewards_data[i].xipai_cur_value = data.anchou_cur_value
|
-- self.rewards_data[i].xipai_cur_value = data.anchou_cur_value
|
||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
-- self.lst_rewards.numItems = #self.rewards_data
|
-- self.lst_rewards.numItems = #self.rewards_data
|
||||||
self:GetRewardsData()
|
self:GetRewardsData()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
msg_win:Show()
|
msg_win:Show()
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ local GroupPartnerScoreMgnView = {}
|
||||||
local M = GroupPartnerScoreMgnView
|
local M = GroupPartnerScoreMgnView
|
||||||
|
|
||||||
function GroupPartnerScoreMgnView.new(group_id, member)
|
function GroupPartnerScoreMgnView.new(group_id, member)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupPartnerScoreMgnView"
|
self.class = "GroupPartnerScoreMgnView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
-- self._blur_view = blur_view
|
-- self._blur_view = blur_view
|
||||||
|
|
@ -18,47 +18,42 @@ function GroupPartnerScoreMgnView.new(group_id, member)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 修改体力值
|
-- 修改体力值
|
||||||
local function __change_limit(gid, pid, otype, limit,callback)
|
local function __change_limit(gid, pid, otype, limit, callback)
|
||||||
|
|
||||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||||
|
|
||||||
local value = limit
|
local value = limit
|
||||||
if otype == 1 then
|
if otype == 1 then
|
||||||
value = value + ad2d(num)
|
value = value + ad2d(num)
|
||||||
elseif otype == - 1 then
|
elseif otype == -1 then
|
||||||
value = value - ad2d(num)
|
value = value - ad2d(num)
|
||||||
else
|
else
|
||||||
value = ad2d(num)
|
value = ad2d(num)
|
||||||
end
|
end
|
||||||
|
|
||||||
if value < 0 then
|
if value < 0 then
|
||||||
ViewUtil.ErrorTip(1,"更改失败!")
|
ViewUtil.ErrorTip(1, "更改失败!")
|
||||||
end
|
end
|
||||||
|
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_SetTransHPLimit(gid, pid, value, function(res1)
|
fgCtr:FG_SetTransHPLimit(gid, pid, value, function(res1)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
|
|
||||||
if (res1.ReturnCode == 0) then
|
if (res1.ReturnCode == 0) then
|
||||||
callback(res1.Data)
|
callback(res1.Data)
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res1.ReturnCode,"更改失败!")
|
ViewUtil.ErrorTip(res1.ReturnCode, "更改失败!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end, 0, nil)
|
end, 0, nil)
|
||||||
gniv:Show()
|
gniv:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
|
BaseWindow.init(self, url)
|
||||||
BaseWindow.init(self,url)
|
|
||||||
|
|
||||||
local member = self.member
|
local member = self.member
|
||||||
|
|
||||||
local btn_close = self._view:GetChild("btn_close")
|
local btn_close = self._view:GetChild("btn_close")
|
||||||
btn_close.onClick:Set(function()
|
btn_close.onClick:Set(function()
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
|
|
@ -74,28 +69,23 @@ function M:init(url)
|
||||||
ImageLoad.Load(member.portrait, self._view:GetChild("btn_head")._iconObject, self.class)
|
ImageLoad.Load(member.portrait, self._view:GetChild("btn_head")._iconObject, self.class)
|
||||||
|
|
||||||
self._view:GetChild("btn_fag_add").onClick:Set(function()
|
self._view:GetChild("btn_fag_add").onClick:Set(function()
|
||||||
|
__change_limit(self.group_id, member.uid, 1, self.limit, function(data)
|
||||||
__change_limit(self.group_id, member.uid, 1, self.limit,function(data)
|
self.limit = data.limit
|
||||||
self.limit = data.limit
|
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
||||||
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self._view:GetChild("btn_fag_minus").onClick:Set(function()
|
self._view:GetChild("btn_fag_minus").onClick:Set(function()
|
||||||
|
__change_limit(self.group_id, member.uid, -1, self.limit, function(data)
|
||||||
|
self.limit = data.limit
|
||||||
__change_limit(self.group_id, member.uid, -1, self.limit,function(data)
|
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
||||||
self.limit = data.limit
|
|
||||||
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self._view:GetChild("btn_manager").onClick:Set(function()
|
self._view:GetChild("btn_manager").onClick:Set(function()
|
||||||
|
__change_limit(self.group_id, member.uid, 0, self.limit, function(data)
|
||||||
|
self.limit = data.limit
|
||||||
__change_limit(self.group_id, member.uid, 0, self.limit,function(data)
|
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
||||||
self.limit = data.limit
|
|
||||||
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
@ -103,18 +93,16 @@ function M:init(url)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:GetTransHPLimit()
|
function M:GetTransHPLimit()
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
ViewUtil.ShowModalWait()
|
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetTransHPLimit(self.group_id, self.member.uid, function(res)
|
fgCtr:FG_GetTransHPLimit(self.group_id, self.member.uid, function(res)
|
||||||
|
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
|
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
else
|
else
|
||||||
|
|
@ -124,5 +112,4 @@ function M:GetTransHPLimit()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
return M
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ local GroupPartnerStatMember = {}
|
||||||
local M = GroupPartnerStatMember
|
local M = GroupPartnerStatMember
|
||||||
|
|
||||||
function GroupPartnerStatMember.new(group_id, uid, time_type, begin_time, end_time)
|
function GroupPartnerStatMember.new(group_id, uid, time_type, begin_time, end_time)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupPartnerStatMember"
|
self.class = "GroupPartnerStatMember"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self.group_id = group_id
|
self.group_id = group_id
|
||||||
|
|
@ -18,20 +18,19 @@ function GroupPartnerStatMember.new(group_id, uid, time_type, begin_time, end_ti
|
||||||
self.end_time = end_time
|
self.end_time = end_time
|
||||||
self.check_member = false -- true的话是查询直属成员统计
|
self.check_member = false -- true的话是查询直属成员统计
|
||||||
self._full = true
|
self._full = true
|
||||||
|
|
||||||
self:init("ui://NewGroup/Win_PartnerStatMember")
|
self:init("ui://NewGroup/Win_PartnerStatMember")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
self.members_log = {}
|
self.members_log = {}
|
||||||
self.lst_member = self._view:GetChild("lst_member")
|
self.lst_member = self._view:GetChild("lst_member")
|
||||||
self.lst_member:SetVirtual()
|
self.lst_member:SetVirtual()
|
||||||
self.lst_member.itemRenderer = function(index, obj)
|
self.lst_member.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_member.scrollPane.onPullUpRelease:Set(function()
|
self.lst_member.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:getRewardsLog(self.lst_member.numItems)
|
self:getRewardsLog(self.lst_member.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
@ -55,80 +54,79 @@ function M:init(url)
|
||||||
self:getRewardsLog(0)
|
self:getRewardsLog(0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- 搜索玩家
|
-- 搜索玩家
|
||||||
local ctr_search = self._view:GetController('search')
|
local ctr_search = self._view:GetController('search')
|
||||||
self._view:GetChild('btn_search').onClick:Set(
|
self._view:GetChild('btn_search').onClick:Set(
|
||||||
function()
|
function()
|
||||||
-- printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
-- printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local text = self._view:GetChild('tex_id').text
|
local text = self._view:GetChild('tex_id').text
|
||||||
local qid, qnick
|
local qid, qnick
|
||||||
if text == "" then
|
if text == "" then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
qid = tonumber(text) or 0
|
qid = tonumber(text) or 0
|
||||||
qnick = text
|
qnick = text
|
||||||
local time_type = 0
|
local time_type = 0
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_FindPartnerStatMember(
|
fgCtr:FG_FindPartnerStatMember(
|
||||||
self.group_id,self.uids[#self.uids],0,
|
self.group_id, self.uids[#self.uids], 0,
|
||||||
qid,0, 6, time_type,self.begin_time,self.end_time,
|
qid, 0, 6, time_type, self.begin_time, self.end_time,
|
||||||
function(res)
|
function(res)
|
||||||
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
||||||
-- pt(res)
|
-- pt(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, '找不到成员')
|
ViewUtil.ErrorTip(res.ReturnCode, '找不到成员')
|
||||||
else
|
else
|
||||||
self._view:GetChild('tex_id').text = ''
|
self._view:GetChild('tex_id').text = ''
|
||||||
ctr_search.selectedIndex = 1
|
ctr_search.selectedIndex = 1
|
||||||
local item_result = self._view:GetChild('lst_member_find')
|
local item_result = self._view:GetChild('lst_member_find')
|
||||||
item_result:RemoveChildrenToPool()
|
item_result:RemoveChildrenToPool()
|
||||||
|
|
||||||
for j = 1, #res.Data.members do
|
for j = 1, #res.Data.members do
|
||||||
local tem = item_result:AddItemFromPool()
|
local tem = item_result:AddItemFromPool()
|
||||||
self:FillRecordItem(res.Data.members[j],tem)
|
self:FillRecordItem(res.Data.members[j], tem)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
local btn_back1 = self._view:GetChild('btn_back1')
|
local btn_back1 = self._view:GetChild('btn_back1')
|
||||||
btn_back1.onClick:Set(
|
btn_back1.onClick:Set(
|
||||||
function()
|
function()
|
||||||
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:getRewardsLog(index)
|
function M:getRewardsLog(index)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
ViewUtil.ShowModalWait()
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
local func = self.check_member and fgCtr.FG_GetDirectMemberStat or fgCtr.FG_GetPartnerStatMember
|
local func = self.check_member and fgCtr.FG_GetDirectMemberStat or fgCtr.FG_GetPartnerStatMember
|
||||||
func(fgCtr, self.group_id,self.uids[self.top],self.uids[1], index, 6, self.time_type, self.begin_time, self.end_time, function(res)
|
func(fgCtr, self.group_id, self.uids[self.top], self.uids[1], index, 6, self.time_type, self.begin_time,
|
||||||
|
self.end_time, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
||||||
else
|
else
|
||||||
local member_logs = res.Data.members
|
local member_logs = res.Data.members
|
||||||
if #member_logs > 0 then
|
if #member_logs > 0 then
|
||||||
for i = 1, #member_logs do
|
for i = 1, #member_logs do
|
||||||
table.insert(self.members_log, member_logs[i])
|
table.insert(self.members_log, member_logs[i])
|
||||||
|
end
|
||||||
|
self.lst_member.numItems = #self.members_log
|
||||||
end
|
end
|
||||||
self.lst_member.numItems = #self.members_log
|
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- function M:SortBy(data)
|
-- function M:SortBy(data)
|
||||||
|
|
@ -144,18 +142,19 @@ end
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local data = self.members_log[index + 1]
|
local data = self.members_log[index + 1]
|
||||||
--pt(data)
|
--pt(data)
|
||||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||||
obj:GetChild("tex_score").text = d2ad(data.total_win)
|
obj:GetChild("tex_score").text = d2ad(data.total_win)
|
||||||
obj:GetChild("tex_total_round").text = ""..data.total_round
|
obj:GetChild("tex_total_round").text = "" .. data.total_round
|
||||||
obj:GetChild("tex_perfect_round").text = ""
|
obj:GetChild("tex_perfect_round").text = ""
|
||||||
obj:GetChild("tex_valid_round").text = ""..d2ad(data.reward_tongji)--""..d2ad(data.reward_hp)--(data.valid_round / 100)
|
obj:GetChild("tex_valid_round").text = "" ..
|
||||||
|
d2ad(data.reward_tongji) --""..d2ad(data.reward_hp)--(data.valid_round / 100)
|
||||||
|
|
||||||
|
local tex_reward = obj:GetChild("tex_reward")
|
||||||
|
tex_reward.text = d2ad(data.reward_tongji) + d2ad(data.total_win) --d2ad(data.reward_tongji)
|
||||||
|
|
||||||
local tex_reward = obj:GetChild("tex_reward")
|
|
||||||
tex_reward.text = d2ad(data.reward_tongji)+d2ad(data.total_win)--d2ad(data.reward_tongji)
|
|
||||||
|
|
||||||
if data.partnerLev > 0 and data.uid ~= self.uids[self.top] then
|
if data.partnerLev > 0 and data.uid ~= self.uids[self.top] then
|
||||||
obj:GetController("mng").selectedIndex = 1
|
obj:GetController("mng").selectedIndex = 1
|
||||||
elseif list_check(self.uids, data.uid) and not self.check_member then
|
elseif list_check(self.uids, data.uid) and not self.check_member then
|
||||||
|
|
@ -192,24 +191,25 @@ function M:OnRenderItem(index, obj)
|
||||||
|
|
||||||
local btn_zhanji = obj:GetChild("btn_zhanji")
|
local btn_zhanji = obj:GetChild("btn_zhanji")
|
||||||
btn_zhanji.onClick:Set(function()
|
btn_zhanji.onClick:Set(function()
|
||||||
|
local groupRecordView = GroupRecordView.new(self.group_id, data.uid, data.partnerLev > 0 and 1 or 0,
|
||||||
local groupRecordView = GroupRecordView.new(self.group_id,data.uid,data.partnerLev > 0 and 1 or 0, self.begin_time, self.end_time, self.time_type)
|
self.begin_time, self.end_time, self.time_type)
|
||||||
groupRecordView:Show()
|
groupRecordView:Show()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillRecordItem(data, obj)
|
function M:FillRecordItem(data, obj)
|
||||||
--pt(data)
|
--pt(data)
|
||||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||||
obj:GetChild("tex_score").text = d2ad(data.total_win)
|
obj:GetChild("tex_score").text = d2ad(data.total_win)
|
||||||
obj:GetChild("tex_total_round").text = ""..data.total_round
|
obj:GetChild("tex_total_round").text = "" .. data.total_round
|
||||||
obj:GetChild("tex_perfect_round").text = ""
|
obj:GetChild("tex_perfect_round").text = ""
|
||||||
obj:GetChild("tex_valid_round").text = ""..d2ad(data.reward_tongji)--""..d2ad(data.reward_hp)--(data.valid_round / 100)
|
obj:GetChild("tex_valid_round").text = "" ..
|
||||||
|
d2ad(data.reward_tongji) --""..d2ad(data.reward_hp)--(data.valid_round / 100)
|
||||||
|
|
||||||
|
local tex_reward = obj:GetChild("tex_reward")
|
||||||
|
tex_reward.text = d2ad(data.reward_tongji) + d2ad(data.total_win) --d2ad(data.reward_tongji)
|
||||||
|
|
||||||
local tex_reward = obj:GetChild("tex_reward")
|
|
||||||
tex_reward.text = d2ad(data.reward_tongji)+d2ad(data.total_win)--d2ad(data.reward_tongji)
|
|
||||||
|
|
||||||
if data.partnerLev > 0 and data.uid ~= self.uids[self.top] then
|
if data.partnerLev > 0 and data.uid ~= self.uids[self.top] then
|
||||||
obj:GetController("mng").selectedIndex = 1
|
obj:GetController("mng").selectedIndex = 1
|
||||||
elseif list_check(self.uids, data.uid) and not self.check_member then
|
elseif list_check(self.uids, data.uid) and not self.check_member then
|
||||||
|
|
@ -246,10 +246,10 @@ function M:FillRecordItem(data, obj)
|
||||||
|
|
||||||
local btn_zhanji = obj:GetChild("btn_zhanji")
|
local btn_zhanji = obj:GetChild("btn_zhanji")
|
||||||
btn_zhanji.onClick:Set(function()
|
btn_zhanji.onClick:Set(function()
|
||||||
|
local groupRecordView = GroupRecordView.new(self.group_id, data.uid, data.partnerLev > 0 and 1 or 0,
|
||||||
local groupRecordView = GroupRecordView.new(self.group_id,data.uid,data.partnerLev > 0 and 1 or 0, self.begin_time, self.end_time, self.time_type)
|
self.begin_time, self.end_time, self.time_type)
|
||||||
groupRecordView:Show()
|
groupRecordView:Show()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ local GroupPartnerStatPlay = {}
|
||||||
local M = GroupPartnerStatPlay
|
local M = GroupPartnerStatPlay
|
||||||
|
|
||||||
function GroupPartnerStatPlay.new(group_id, uid, partner_lev, parent_id, time_type, begin_time, end_time)
|
function GroupPartnerStatPlay.new(group_id, uid, partner_lev, parent_id, time_type, begin_time, end_time)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupPartnerStatPlay"
|
self.class = "GroupPartnerStatPlay"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self.group_id = group_id
|
self.group_id = group_id
|
||||||
|
|
@ -20,28 +20,28 @@ function GroupPartnerStatPlay.new(group_id, uid, partner_lev, parent_id, time_ty
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
self.members_log = {}
|
self.members_log = {}
|
||||||
self.lst_member = self._view:GetChild("lst_member")
|
self.lst_member = self._view:GetChild("lst_member")
|
||||||
self.lst_member:SetVirtual()
|
self.lst_member:SetVirtual()
|
||||||
self.lst_member.itemRenderer = function(index, obj)
|
self.lst_member.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.rewards_data = {}
|
self.rewards_data = {}
|
||||||
self:getPartnerRewards(function()
|
self:getPartnerRewards(function()
|
||||||
self:getRewardsLog(0)
|
self:getRewardsLog(0)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:getPartnerRewards(callback)
|
function M:getPartnerRewards(callback)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetRewards(self.group_id, self.uid, self.partner_lev, function(res)
|
fgCtr:FG_GetRewards(self.group_id, self.uid, self.partner_lev, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人奖励失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人奖励失败")
|
||||||
else
|
else
|
||||||
local rewards = res.Data.rewards
|
local rewards = res.Data.rewards
|
||||||
|
|
@ -55,10 +55,10 @@ function M:getPartnerRewards(callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:getRewardsLog(index)
|
function M:getRewardsLog(index)
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetPartnerStatPlay(self.group_id,self.uid, self.parent_id, index, 6, self.time_type, self.begin_time, self.end_time, function(res)
|
fgCtr:FG_GetPartnerStatPlay(self.group_id, self.uid, self.parent_id, index, 6, self.time_type, self.begin_time,
|
||||||
if res.ReturnCode ~= 0 then
|
self.end_time, function(res)
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
||||||
else
|
else
|
||||||
local member_logs = res.Data.members
|
local member_logs = res.Data.members
|
||||||
|
|
@ -72,15 +72,14 @@ function M:getRewardsLog(index)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local data = self.members_log[index + 1]
|
local data = self.members_log[index + 1]
|
||||||
|
|
||||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.pid)
|
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.pid)
|
||||||
obj:GetChild("tex_name").text = play_name
|
obj:GetChild("tex_name").text = play_name
|
||||||
obj:GetChild("tex_round").text = ""..(data.round / 100)
|
obj:GetChild("tex_round").text = "" .. (data.round / 100)
|
||||||
obj:GetChild("tex_total_pump").text = ""..d2ad(data.pump)
|
obj:GetChild("tex_total_pump").text = "" .. d2ad(data.pump)
|
||||||
obj:GetChild("tex_total").text = ""..d2ad(data.award)
|
obj:GetChild("tex_total").text = "" .. d2ad(data.award)
|
||||||
|
|
||||||
for i = 1, #self.rewards_data do
|
for i = 1, #self.rewards_data do
|
||||||
local rdata = self.rewards_data[i]
|
local rdata = self.rewards_data[i]
|
||||||
|
|
@ -95,14 +94,13 @@ function M:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if self.partner_lev < 3 then
|
if self.partner_lev < 3 then
|
||||||
obj:GetChild("tex_percent").text = rdata.cur_value .."%"
|
obj:GetChild("tex_percent").text = rdata.cur_value .. "%"
|
||||||
else
|
else
|
||||||
obj:GetChild("tex_percent").text = string.format("%s%%/%s%%", rdata.cur_value, rdata.max_value)
|
obj:GetChild("tex_percent").text = string.format("%s%%/%s%%", rdata.cur_value, rdata.max_value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ local GroupPartnerZuanShiMember = {}
|
||||||
local M = GroupPartnerZuanShiMember
|
local M = GroupPartnerZuanShiMember
|
||||||
|
|
||||||
function GroupPartnerZuanShiMember.new(group_id, uid, time_type, begin_time, end_time)
|
function GroupPartnerZuanShiMember.new(group_id, uid, time_type, begin_time, end_time)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupPartnerZuanShiMember"
|
self.class = "GroupPartnerZuanShiMember"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self.group_id = group_id
|
self.group_id = group_id
|
||||||
|
|
@ -17,20 +17,19 @@ function GroupPartnerZuanShiMember.new(group_id, uid, time_type, begin_time, end
|
||||||
self.end_time = end_time
|
self.end_time = end_time
|
||||||
self.check_member = false -- true的话是查询直属成员统计
|
self.check_member = false -- true的话是查询直属成员统计
|
||||||
self._full = true
|
self._full = true
|
||||||
|
|
||||||
self:init("ui://NewGroup/Win_PartnerZuanShiMember")
|
self:init("ui://NewGroup/Win_PartnerZuanShiMember")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
self.members_log = {}
|
self.members_log = {}
|
||||||
self.lst_member = self._view:GetChild("lst_member")
|
self.lst_member = self._view:GetChild("lst_member")
|
||||||
self.lst_member:SetVirtual()
|
self.lst_member:SetVirtual()
|
||||||
self.lst_member.itemRenderer = function(index, obj)
|
self.lst_member.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_member.scrollPane.onPullUpRelease:Set(function()
|
self.lst_member.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:getRewardsLog(self.lst_member.numItems)
|
self:getRewardsLog(self.lst_member.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
@ -54,93 +53,92 @@ function M:init(url)
|
||||||
self:getRewardsLog(0)
|
self:getRewardsLog(0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- 搜索玩家
|
-- 搜索玩家
|
||||||
local ctr_search = self._view:GetController('search')
|
local ctr_search = self._view:GetController('search')
|
||||||
self._view:GetChild('btn_search').onClick:Set(
|
self._view:GetChild('btn_search').onClick:Set(
|
||||||
function()
|
function()
|
||||||
-- printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
-- printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local text = self._view:GetChild('tex_id').text
|
local text = self._view:GetChild('tex_id').text
|
||||||
local qid, qnick
|
local qid, qnick
|
||||||
if text == "" then
|
if text == "" then
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
qid = tonumber(text) or 0
|
qid = tonumber(text) or 0
|
||||||
qnick = text
|
qnick = text
|
||||||
local time_type = 0
|
local time_type = 0
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_FindPartnerZuanShiMember(
|
fgCtr:FG_FindPartnerZuanShiMember(
|
||||||
self.group_id,self.uids[#self.uids],0,
|
self.group_id, self.uids[#self.uids], 0,
|
||||||
qid,0, 6, time_type,self.begin_time,self.end_time,
|
qid, 0, 6, time_type, self.begin_time, self.end_time,
|
||||||
function(res)
|
function(res)
|
||||||
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
||||||
-- pt(res)
|
-- pt(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if self._is_destroy then
|
if self._is_destroy then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, '找不到成员')
|
ViewUtil.ErrorTip(res.ReturnCode, '找不到成员')
|
||||||
else
|
else
|
||||||
self._view:GetChild('tex_id').text = ''
|
self._view:GetChild('tex_id').text = ''
|
||||||
ctr_search.selectedIndex = 1
|
ctr_search.selectedIndex = 1
|
||||||
local item_result = self._view:GetChild('lst_member_find')
|
local item_result = self._view:GetChild('lst_member_find')
|
||||||
item_result:RemoveChildrenToPool()
|
item_result:RemoveChildrenToPool()
|
||||||
|
|
||||||
for j = 1, #res.Data.members do
|
for j = 1, #res.Data.members do
|
||||||
local tem = item_result:AddItemFromPool()
|
local tem = item_result:AddItemFromPool()
|
||||||
self:FillRecordItem(res.Data.members[j],tem)
|
self:FillRecordItem(res.Data.members[j], tem)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
local btn_back1 = self._view:GetChild('btn_back1')
|
local btn_back1 = self._view:GetChild('btn_back1')
|
||||||
btn_back1.onClick:Set(
|
btn_back1.onClick:Set(
|
||||||
function()
|
function()
|
||||||
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:getRewardsLog(index)
|
function M:getRewardsLog(index)
|
||||||
|
ViewUtil.ShowModalWait2()
|
||||||
ViewUtil.ShowModalWait()
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
local func = self.check_member and fgCtr.FG_GetDirectZuanShiStat or fgCtr.FG_GetPartnerZuanShiMember
|
local func = self.check_member and fgCtr.FG_GetDirectZuanShiStat or fgCtr.FG_GetPartnerZuanShiMember
|
||||||
func(fgCtr, self.group_id,self.uids[self.top],self.uids[1], index, 6, self.time_type, self.begin_time, self.end_time, function(res)
|
func(fgCtr, self.group_id, self.uids[self.top], self.uids[1], index, 6, self.time_type, self.begin_time,
|
||||||
|
self.end_time, function(res)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
||||||
else
|
else
|
||||||
local member_logs = res.Data.members
|
local member_logs = res.Data.members
|
||||||
if #member_logs > 0 then
|
if #member_logs > 0 then
|
||||||
for i = 1, #member_logs do
|
for i = 1, #member_logs do
|
||||||
table.insert(self.members_log, member_logs[i])
|
table.insert(self.members_log, member_logs[i])
|
||||||
|
end
|
||||||
|
self.lst_member.numItems = #self.members_log
|
||||||
end
|
end
|
||||||
self.lst_member.numItems = #self.members_log
|
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local data = self.members_log[index + 1]
|
local data = self.members_log[index + 1]
|
||||||
--pt(data)
|
--pt(data)
|
||||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||||
obj:GetChild("tex_round_valid").text = data.single_diamo_cost / 100
|
obj:GetChild("tex_round_valid").text = data.single_diamo_cost / 100
|
||||||
obj:GetChild("tex_round_total").text = data.other_diamo_cost / 100
|
obj:GetChild("tex_round_total").text = data.other_diamo_cost / 100
|
||||||
obj:GetChild("tex_total").text = data.single_diamo_cost / 100 + data.other_diamo_cost / 100
|
obj:GetChild("tex_total").text = data.single_diamo_cost / 100 + data.other_diamo_cost / 100
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if data.partnerLev > 0 and data.uid ~= self.uids[self.top] then
|
if data.partnerLev > 0 and data.uid ~= self.uids[self.top] then
|
||||||
obj:GetController("mng").selectedIndex = 1
|
obj:GetController("mng").selectedIndex = 1
|
||||||
elseif list_check(self.uids, data.uid) and not self.check_member then
|
elseif list_check(self.uids, data.uid) and not self.check_member then
|
||||||
|
|
@ -177,14 +175,14 @@ function M:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillRecordItem(data, obj)
|
function M:FillRecordItem(data, obj)
|
||||||
--pt(data)
|
--pt(data)
|
||||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||||
obj:GetChild("tex_round_valid").text = data.single_diamo_cost / 100
|
obj:GetChild("tex_round_valid").text = data.single_diamo_cost / 100
|
||||||
obj:GetChild("tex_round_total").text = data.other_diamo_cost / 100
|
obj:GetChild("tex_round_total").text = data.other_diamo_cost / 100
|
||||||
obj:GetChild("tex_total").text = data.single_diamo_cost / 100 + data.other_diamo_cost / 100
|
obj:GetChild("tex_total").text = data.single_diamo_cost / 100 + data.other_diamo_cost / 100
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if data.partnerLev > 0 and data.uid ~= self.uids[self.top] then
|
if data.partnerLev > 0 and data.uid ~= self.uids[self.top] then
|
||||||
obj:GetController("mng").selectedIndex = 1
|
obj:GetController("mng").selectedIndex = 1
|
||||||
elseif list_check(self.uids, data.uid) and not self.check_member then
|
elseif list_check(self.uids, data.uid) and not self.check_member then
|
||||||
|
|
@ -220,4 +218,4 @@ function M:FillRecordItem(data, obj)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ local GroupRewardsLogView = {}
|
||||||
|
|
||||||
local M = GroupRewardsLogView
|
local M = GroupRewardsLogView
|
||||||
|
|
||||||
function GroupRewardsLogView.new(blur_view,group_id,uid)
|
function GroupRewardsLogView.new(blur_view, group_id, uid)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupRewardsLogView"
|
self.class = "GroupRewardsLogView"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self._blur_view = blur_view
|
self._blur_view = blur_view
|
||||||
|
|
@ -20,18 +20,19 @@ function GroupRewardsLogView.new(blur_view,group_id,uid)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
self.rewards_log = {}
|
self.rewards_log = {}
|
||||||
self.lst_log = self._view:GetChild("lst_log")
|
self.lst_log = self._view:GetChild("lst_log")
|
||||||
self.lst_log:SetVirtual()
|
self.lst_log:SetVirtual()
|
||||||
self.lst_log.itemRenderer = function(index, obj)
|
self.lst_log.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_log.scrollPane.onPullUpRelease:Set(function()
|
self.lst_log.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:getRewardsLog(self.lst_log.numItems+self.m_index)
|
self:getRewardsLog(self.lst_log.numItems + self.m_index)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0)
|
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
||||||
|
-308, 0)
|
||||||
self._view:GetChild("btn_search").onClick:Set(function()
|
self._view:GetChild("btn_search").onClick:Set(function()
|
||||||
self.rewards_log = {}
|
self.rewards_log = {}
|
||||||
self:getRewardsLog(0)
|
self:getRewardsLog(0)
|
||||||
|
|
@ -43,15 +44,14 @@ end
|
||||||
function M:getRewardsLog(index)
|
function M:getRewardsLog(index)
|
||||||
local begin_time, end_time = self.time_panel:GetDate()
|
local begin_time, end_time = self.time_panel:GetDate()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
ViewUtil.ShowModalWait(nil)
|
ViewUtil.ShowModalWait2(nil)
|
||||||
local limit = 6
|
local limit = 6
|
||||||
if self.lev == 1 then
|
if self.lev == 1 then
|
||||||
limit = 20
|
limit = 20
|
||||||
end
|
end
|
||||||
fgCtr:FG_GetRewardsLog(self.group_id, index, limit, begin_time, end_time, self.uid, function(res)
|
fgCtr:FG_GetRewardsLog(self.group_id, index, limit, begin_time, end_time, self.uid, function(res)
|
||||||
|
ViewUtil.CloseModalWait2()
|
||||||
ViewUtil.CloseModalWait()
|
if res.ReturnCode ~= 0 then
|
||||||
if res.ReturnCode ~= 0 then
|
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "获取提取详情失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "获取提取详情失败")
|
||||||
else
|
else
|
||||||
local reward_logs = res.Data.reward_logs
|
local reward_logs = res.Data.reward_logs
|
||||||
|
|
@ -68,59 +68,58 @@ end
|
||||||
|
|
||||||
function M:GuoLv(data)
|
function M:GuoLv(data)
|
||||||
pt(data)
|
pt(data)
|
||||||
local tempList={}
|
local tempList = {}
|
||||||
if self.lev == 1 then
|
if self.lev == 1 then
|
||||||
|
|
||||||
local m_data = {}
|
local m_data = {}
|
||||||
for i=1,#data do
|
for i = 1, #data do
|
||||||
if m_data[data[i].roomid] == nil then
|
if m_data[data[i].roomid] == nil then
|
||||||
m_data[data[i].roomid] = {}
|
m_data[data[i].roomid] = {}
|
||||||
end
|
end
|
||||||
table.insert(m_data[data[i].roomid],data[i])
|
table.insert(m_data[data[i].roomid], data[i])
|
||||||
end
|
end
|
||||||
local m_otherdata = {}
|
local m_otherdata = {}
|
||||||
for k, v in pairs(m_data) do
|
for k, v in pairs(m_data) do
|
||||||
if #v == 2 then
|
if #v == 2 then
|
||||||
if tonumber(v[1]["hp"]) + tonumber(v[2]["hp"]) ~=0 then
|
if tonumber(v[1]["hp"]) + tonumber(v[2]["hp"]) ~= 0 then
|
||||||
table.insert(m_otherdata,v[1])
|
table.insert(m_otherdata, v[1])
|
||||||
table.insert(m_otherdata,v[2])
|
table.insert(m_otherdata, v[2])
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
table.insert(m_otherdata,v[1])
|
table.insert(m_otherdata, v[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.m_index = #data - #m_otherdata + self.m_index
|
self.m_index = #data - #m_otherdata + self.m_index
|
||||||
tempList=m_otherdata
|
tempList = m_otherdata
|
||||||
else
|
else
|
||||||
tempList=data
|
tempList = data
|
||||||
end
|
end
|
||||||
tempList=data
|
tempList = data
|
||||||
if #tempList > 0 then
|
if #tempList > 0 then
|
||||||
for i = 1, #tempList do
|
for i = 1, #tempList do
|
||||||
table.insert(self.rewards_log, tempList[i])
|
table.insert(self.rewards_log, tempList[i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.lst_log.numItems = #self.rewards_log
|
self.lst_log.numItems = #self.rewards_log
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local data = self.rewards_log[index + 1]
|
local data = self.rewards_log[index + 1]
|
||||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.pid)
|
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.pid)
|
||||||
obj:GetChild("tex_name").text = play_name
|
obj:GetChild("tex_name").text = play_name
|
||||||
obj:GetChild("tex_roomid").text = data.roomid
|
obj:GetChild("tex_roomid").text = data.roomid
|
||||||
obj:GetChild("tex_get_hp").text = d2ad(data.hp)
|
obj:GetChild("tex_get_hp").text = d2ad(data.hp)
|
||||||
obj:GetChild("tex_data").text = os.date("%Y-%m-%d\r%H:%M", data.time)
|
obj:GetChild("tex_data").text = os.date("%Y-%m-%d\r%H:%M", data.time)
|
||||||
if data.reason == 12 then
|
if data.reason == 12 then
|
||||||
obj:GetChild("tex_xiang").text = "合伙人奖励\n".."("..data.info..")"
|
obj:GetChild("tex_xiang").text = "合伙人奖励\n" .. "(" .. data.info .. ")"
|
||||||
elseif data.reason == 7 then
|
elseif data.reason == 7 then
|
||||||
obj:GetChild("tex_xiang").text = "抽水\n".."("..data.info..")"
|
obj:GetChild("tex_xiang").text = "抽水\n" .. "(" .. data.info .. ")"
|
||||||
elseif data.reason == 20 then
|
elseif data.reason == 20 then
|
||||||
obj:GetChild("tex_xiang").text = "洗牌\n".."("..data.info..")"
|
obj:GetChild("tex_xiang").text = "洗牌\n" .. "(" .. data.info .. ")"
|
||||||
elseif data.reason == 21 then
|
elseif data.reason == 21 then
|
||||||
obj:GetChild("tex_xiang").text = "合伙人洗牌奖励\n".."("..data.info..")"
|
obj:GetChild("tex_xiang").text = "合伙人洗牌奖励\n" .. "(" .. data.info .. ")"
|
||||||
elseif data.reason == 22 then
|
elseif data.reason == 22 then
|
||||||
obj:GetChild("tex_xiang").text = "合伙人管理奖励\n".."("..data.info..")"
|
obj:GetChild("tex_xiang").text = "合伙人管理奖励\n" .. "(" .. data.info .. ")"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -41,14 +41,14 @@ function M:init(url)
|
||||||
|
|
||||||
self._view:GetChild("btn_qd1").onClick:Set(
|
self._view:GetChild("btn_qd1").onClick:Set(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_BanMemberHB(
|
fgCtr:FG_BanMemberHB(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
self.member_id,
|
self.member_id,
|
||||||
0,
|
0,
|
||||||
function(response)
|
function(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (response.ReturnCode == 0) then
|
if (response.ReturnCode == 0) then
|
||||||
self.currentSelectStateText.text = "整组调动 " .. (response.Data.black + 1)
|
self.currentSelectStateText.text = "整组调动 " .. (response.Data.black + 1)
|
||||||
ViewUtil.ErrorTip(-1, '设置成功!', 1)
|
ViewUtil.ErrorTip(-1, '设置成功!', 1)
|
||||||
|
|
@ -63,14 +63,14 @@ function M:init(url)
|
||||||
|
|
||||||
self._view:GetChild("btn_qd2").onClick:Set(
|
self._view:GetChild("btn_qd2").onClick:Set(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_BanMemberHB(
|
fgCtr:FG_BanMemberHB(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
self.member_id,
|
self.member_id,
|
||||||
1,
|
1,
|
||||||
function(response)
|
function(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (response.ReturnCode == 0) then
|
if (response.ReturnCode == 0) then
|
||||||
self.currentSelectStateText.text = "整组调动 " .. (response.Data.black + 1)
|
self.currentSelectStateText.text = "整组调动 " .. (response.Data.black + 1)
|
||||||
ViewUtil.ErrorTip(-1, '设置成功!', 1)
|
ViewUtil.ErrorTip(-1, '设置成功!', 1)
|
||||||
|
|
@ -84,14 +84,14 @@ function M:init(url)
|
||||||
|
|
||||||
self._view:GetChild("btn_qd3").onClick:Set(
|
self._view:GetChild("btn_qd3").onClick:Set(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_BanMemberHB(
|
fgCtr:FG_BanMemberHB(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
self.member_id,
|
self.member_id,
|
||||||
2,
|
2,
|
||||||
function(response)
|
function(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (response.ReturnCode == 0) then
|
if (response.ReturnCode == 0) then
|
||||||
self.currentSelectStateText.text = "整组调动 " .. (response.Data.black + 1)
|
self.currentSelectStateText.text = "整组调动 " .. (response.Data.black + 1)
|
||||||
ViewUtil.ErrorTip(-1, '设置成功!', 1)
|
ViewUtil.ErrorTip(-1, '设置成功!', 1)
|
||||||
|
|
@ -149,7 +149,7 @@ function M:init(url)
|
||||||
|
|
||||||
self._view:GetChild("btn_ok").onClick:Set(
|
self._view:GetChild("btn_ok").onClick:Set(
|
||||||
function()
|
function()
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_BanMemberHB(
|
fgCtr:FG_BanMemberHB(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
|
|
@ -158,7 +158,7 @@ function M:init(url)
|
||||||
tonumber(self.txtRate.text),
|
tonumber(self.txtRate.text),
|
||||||
tonumber(self.txtBlack.text),
|
tonumber(self.txtBlack.text),
|
||||||
function(response)
|
function(response)
|
||||||
ViewUtil.CloseModalWait()
|
ViewUtil.CloseModalWait2()
|
||||||
if (response.ReturnCode == 0) then
|
if (response.ReturnCode == 0) then
|
||||||
self.currentSelectStateText.text = "整组调动 " .. (response.Data.ban + 1)
|
self.currentSelectStateText.text = "整组调动 " .. (response.Data.ban + 1)
|
||||||
self.blackList = { { 0, 0 }, { 25, 0 }, { 15, 0 } }
|
self.blackList = { { 0, 0 }, { 25, 0 }, { 15, 0 } }
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,28 @@
|
||||||
|
|
||||||
local GroupStatMember = {}
|
local GroupStatMember = {}
|
||||||
|
|
||||||
local M = GroupStatMember
|
local M = GroupStatMember
|
||||||
|
|
||||||
function GroupStatMember.new(group_id, uid)
|
function GroupStatMember.new(group_id, uid)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupStatMember"
|
self.class = "GroupStatMember"
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
self.group_id = group_id
|
self.group_id = group_id
|
||||||
self.uids = {}
|
self.uids = {}
|
||||||
self._full = true
|
self._full = true
|
||||||
|
|
||||||
self:init("ui://NewGroup/Win_StatMember")
|
self:init("ui://NewGroup/Win_StatMember")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
self.members_log = {}
|
self.members_log = {}
|
||||||
self.lst_member = self._view:GetChild("lst_member")
|
self.lst_member = self._view:GetChild("lst_member")
|
||||||
self.lst_member:SetVirtual()
|
self.lst_member:SetVirtual()
|
||||||
self.lst_member.itemRenderer = function(index, obj)
|
self.lst_member.itemRenderer = function(index, obj)
|
||||||
self:OnRenderItem(index, obj)
|
self:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
self.lst_member.scrollPane.onPullUpRelease:Set(function()
|
self.lst_member.scrollPane.onPullUpRelease:Set(function()
|
||||||
self:getRewardsLog(self.lst_member.numItems)
|
self:getRewardsLog(self.lst_member.numItems)
|
||||||
end)
|
end)
|
||||||
|
|
@ -34,18 +32,16 @@ function M:init(url)
|
||||||
self.lst_member.numItems = 0
|
self.lst_member.numItems = 0
|
||||||
self:getRewardsLog(0)
|
self:getRewardsLog(0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:getRewardsLog(index)
|
function M:getRewardsLog(index)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait2()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:OnRenderItem(index, obj)
|
function M:OnRenderItem(index, obj)
|
||||||
local data = self.members_log[index + 1]
|
local data = self.members_log[index + 1]
|
||||||
--pt(data)
|
--pt(data)
|
||||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||||
local btn_detail = obj:GetChild("btn_detail")
|
local btn_detail = obj:GetChild("btn_detail")
|
||||||
|
|
@ -54,4 +50,4 @@ function M:OnRenderItem(index, obj)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue