Compare commits
No commits in common. "35b6f468092c167dda1bed3fc9f1453574b04edc" and "f5527880d9dcdfe1216f6e7c090d9265c97f3c86" have entirely different histories.
35b6f46809
...
f5527880d9
|
|
@ -42,5 +42,5 @@ BroadcastEvent = {
|
|||
OnJoinsChange = 'OnJoinsChange',
|
||||
OnMemberChange = "OnMemberChange",
|
||||
OnOutFamily = "OnOutFamily",
|
||||
OnOutFamily2 = "OnOutFamily2",
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -671,12 +671,12 @@ function M:ReturnToRoom()
|
|||
false,
|
||||
function(response)
|
||||
if (response.ReturnCode == -1) then
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
RestartGame()
|
||||
return
|
||||
end
|
||||
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
end,
|
||||
self.tmpGroupID
|
||||
)
|
||||
|
|
|
|||
|
|
@ -412,9 +412,6 @@ end
|
|||
|
||||
-- 邀请在线玩家
|
||||
function M:FG_InvitePlayer(group_id, tag, player_id, roomid, pid, game_name, callback)
|
||||
if not self._mgr_client then
|
||||
return
|
||||
end
|
||||
local _data = {}
|
||||
_data.groupId = group_id
|
||||
_data.tagId = tag
|
||||
|
|
@ -459,7 +456,12 @@ end
|
|||
|
||||
--被邀请玩家收到邀请
|
||||
function M:FG_ResponseInvited(evt_data)
|
||||
DispatchEvent(self._dispatcher, GroupMgrEvent.InviteResponse, evt_data)
|
||||
local invite_id = evt_data.invite_id
|
||||
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
|
||||
|
||||
-- 设置助理,来用给对面刷新界面 tagId=助理
|
||||
|
|
@ -609,9 +611,6 @@ function M:OnMemberOut(evt_data)
|
|||
local uid = evt_data.uid
|
||||
local groupId = evt_data.groupId
|
||||
local group = DataManager.groups:get(groupId)
|
||||
if not group then
|
||||
return
|
||||
end
|
||||
group:delMember(uid)
|
||||
DispatchEvent(self._dispatcher, GroupMgrEvent.OnFamilyMemberOut, evt_data)
|
||||
Broadcast.Send(BroadcastEvent.Reflash)
|
||||
|
|
|
|||
|
|
@ -92,12 +92,9 @@ function M:CreateRoom(game_id, dataInfo, callback)
|
|||
|
||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||
room.game_id = game_id
|
||||
room.game_info = game_info
|
||||
|
||||
room.room_id = room_id
|
||||
room.server_host = string.concat(server_ip, ":", server_port)
|
||||
room.session = _client:getSession()
|
||||
room._flag_lobby = true
|
||||
DataManager.CurrenRoom = room
|
||||
|
||||
local game_net = nil
|
||||
|
|
@ -177,9 +174,7 @@ function M:PublicJoinRoom(cmd, room_id, callback, group_id, group_layer)
|
|||
room.server_host = string.concat(server_ip, ":", server_port)
|
||||
room.session = _client:getSession()
|
||||
room.group_id = json["groupId"]
|
||||
room.game_info = game_info
|
||||
room.play_id = json["pid"]
|
||||
room._flag_lobby = true
|
||||
-- 体力值开关
|
||||
room.hpOnOff = json["hpOnOff"]
|
||||
-- 体力值倍数
|
||||
|
|
@ -247,7 +242,6 @@ function M:ResetJionRoom(callback)
|
|||
room.hpOnOff = o_room.hpOnOff
|
||||
room.owner_id = o_room.owner_id
|
||||
room.create_time = o_room.create_time
|
||||
room._flag_lobby = true
|
||||
room:SetReloadStatus(true)
|
||||
DataManager.CurrenRoom = room
|
||||
__ConntectGameServer(Protocol.GAME_JOIN_ROOM, room, room.server_host, j_data, function(res1)
|
||||
|
|
@ -396,14 +390,14 @@ function M:RequestPlayBack(_data, callback, game_info)
|
|||
end
|
||||
|
||||
--获取手机验证码
|
||||
-- function M:GetPhoneCode(phone, callback)
|
||||
-- local _client = ControllerManager.WebClient
|
||||
-- local _data = {}
|
||||
-- _data["phone"] = phone
|
||||
-- _client:send(Protocol.WEB_GET_VERIFCATION_CODE, _data, function(res)
|
||||
-- callback(res)
|
||||
-- end)
|
||||
-- end
|
||||
function M:GetPhoneCode(phone, callback)
|
||||
local _client = ControllerManager.WebClient
|
||||
local _data = {}
|
||||
_data["phone"] = phone
|
||||
_client:send(Protocol.WEB_GET_VERIFCATION_CODE, _data, function(res)
|
||||
callback(res)
|
||||
end)
|
||||
end
|
||||
|
||||
function M:GetUserInfo(callback)
|
||||
local _client = ControllerManager.WebClient
|
||||
|
|
@ -491,42 +485,3 @@ function M:GetServiceInfo(data, callback)
|
|||
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,7 +55,6 @@ local function __Login(cmd, _data, callBack)
|
|||
user.phone = account.phone
|
||||
user.address = account.address
|
||||
user.games = FilterGame(data.games)
|
||||
user.havaPsw = data.havaPassword
|
||||
if Application.platform == RuntimePlatform.WindowsPlayer or Application.platform == RuntimePlatform.WindowsEditor then
|
||||
--GameApplication.Instance.printLog = true
|
||||
else
|
||||
|
|
@ -83,7 +82,7 @@ function M:GetPhoneCode(phone, callback)
|
|||
local _client = ControllerManager.WebClient
|
||||
local _data = {}
|
||||
_data["phone"] = phone
|
||||
_client:send(Protocol.WEB_GET_Phone_Code, _data, function(res)
|
||||
_client:send(Protocol.WEB_GET_VERIFCATION_CODE, _data, function(res)
|
||||
if (callback ~= nil) then
|
||||
callback(res)
|
||||
end
|
||||
|
|
@ -94,7 +93,7 @@ function M:PhoneLogin(phone, code, callback)
|
|||
local _data = {}
|
||||
_data["phone"] = phone
|
||||
_data["code"] = code
|
||||
__Login(Protocol.WEB_LOGIN_Phone, _data, callback)
|
||||
__Login(Protocol.WEB_PHONE_LOGIN, _data, callback)
|
||||
end
|
||||
|
||||
--手机密码登录
|
||||
|
|
@ -119,13 +118,6 @@ function M:Login(callback)
|
|||
_data["nick"] = user.nick_name
|
||||
_data["sex"] = user.sex
|
||||
_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)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ function M:CreateRoom(game_id, _data, callback)
|
|||
|
||||
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
|
||||
room.game_id = game_id
|
||||
room.game_info = game_info
|
||||
room.room_id = room_id
|
||||
room.server_host = string.concat(server_ip, ":", server_port)
|
||||
room.session = _client:getSession()
|
||||
|
|
@ -202,7 +201,6 @@ function M:PublicJoinRoom(cmd, roomid, tem, callback, group_id, pid)
|
|||
room.session = _client:getSession()
|
||||
-- 圈子信息,圈子id和玩法id
|
||||
room.group_id = json["groupId"]
|
||||
room.game_info = game_info
|
||||
-- 圈子禁止文字聊天,禁止语音聊天
|
||||
--room.ban_chat1 = json["ban_chat1"]
|
||||
--room.ban_chat2 = json["ban_chat2"]
|
||||
|
|
|
|||
|
|
@ -138,12 +138,10 @@ function M:addPlay(play)
|
|||
--printlog("添加玩法addPlay===>>>")
|
||||
--pt(play)
|
||||
local maxRound = 0
|
||||
local hpdata = json.decode(play.hpData)
|
||||
if play.maxRound then
|
||||
maxRound = play.maxRound
|
||||
hpdata.maxRound = maxRound
|
||||
play.hpData = json.encode(hpdata)
|
||||
else
|
||||
local hpdata = json.decode(play.hpData)
|
||||
maxRound = hpdata.maxRound
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -60,8 +60,7 @@ local function __update_check(data, onback, _version_view)
|
|||
if game_data["size"] then
|
||||
printlog("lingmeng down", download_size, version_update.Progress, game_data["size"])
|
||||
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
|
||||
onback(version_update.Progress, false)
|
||||
tex_tip.text = version_update.TextTip
|
||||
|
|
@ -128,7 +127,7 @@ function ExtendHotupdate.UpdateGame(data, callback)
|
|||
if callback then callback() end
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
NetResetConnectWindow.CloseNetReset()
|
||||
local _version_view = UIPackage.CreateObjectFromURL("ui://Common/ExtendHotUpdate")
|
||||
_version_view:GetChild("tex_info").text = "正在检查资源。。。"
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ end
|
|||
|
||||
function M:OnChangeOption(ctype)
|
||||
self:ShowRoomPrice(ctype)
|
||||
-- local round = self._config:GetController("round")
|
||||
-- round.onChanged:Set(function()
|
||||
-- self:ShowVariablePrice(ctype)
|
||||
-- end)
|
||||
local round = self._config:GetController("round")
|
||||
round.onChanged:Set(function()
|
||||
self:ShowVariablePrice(ctype)
|
||||
end)
|
||||
end
|
||||
|
||||
function M:ShowVariablePrice(ctype)
|
||||
|
|
|
|||
|
|
@ -49,14 +49,6 @@ Protocol = {
|
|||
ACC_GET_DIAMONDRECORD = "acc/get_recharge_diamo_list",
|
||||
---获取客服信息
|
||||
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----
|
||||
-- 获取公告
|
||||
WEB_UPDATE_NOTICE = "index/get_notice",
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ function FGAssistView.new(blur_view, group_id, callback)
|
|||
|
||||
self.callback = callback
|
||||
self:init("ui://FGAssist/panel_assist")
|
||||
print("lingmeng FGAssistView new")
|
||||
return self
|
||||
end
|
||||
|
||||
|
|
@ -190,27 +191,28 @@ end
|
|||
-- end
|
||||
function M:GetOnlinePlayers(index)
|
||||
index = index or 0
|
||||
print("lingmeng GetOnlinePlayers", self.group_id)
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
-- if not group then
|
||||
fgCtr:FG_GroupList(function(res)
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败")
|
||||
else
|
||||
fgCtr:FG_EnterGroup(self.group_id, function(res)
|
||||
ViewUtil:CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败")
|
||||
else
|
||||
self:GetOnlinePlayersshow(fgCtr, DataManager.groups:get(self.group_id), index)
|
||||
return 1
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
-- else
|
||||
-- self:GetOnlinePlayersshow(fgCtr, group, index)
|
||||
-- end
|
||||
if not group then
|
||||
fgCtr:FG_GroupList(function(res)
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败")
|
||||
else
|
||||
fgCtr:FG_EnterGroup(self.group_id, function(res)
|
||||
ViewUtil:CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败")
|
||||
else
|
||||
self:GetOnlinePlayersshow(fgCtr, DataManager.groups:get(self.group_id), index)
|
||||
return 1
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
else
|
||||
self:GetOnlinePlayersshow(fgCtr, group, index)
|
||||
end
|
||||
end
|
||||
|
||||
function M:GetOnlinePlayersshow(fgCtr, group, index)
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ function M:CreatePlay()
|
|||
-- loddyCtr:CreateRoom(gameId,_data, function (res)
|
||||
-- self:__OnCreateRoomAction(res)
|
||||
-- end)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
end
|
||||
|
||||
function M:initePlayInfo()
|
||||
|
|
|
|||
|
|
@ -91,9 +91,7 @@ function M:InitTime()
|
|||
return serverDayValues, serverDayItems
|
||||
end
|
||||
|
||||
function M:ShouRanks(root, groupId)
|
||||
self._father = root
|
||||
self.group_id = groupId
|
||||
function M:ShouRanks()
|
||||
self._lastTpe = self._father.familyType.selectedIndex
|
||||
self._father.familyType.selectedIndex = 0
|
||||
self._view.visible = true
|
||||
|
|
@ -136,7 +134,6 @@ function M:SearchRank()
|
|||
end
|
||||
|
||||
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)
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取排行榜失败")
|
||||
|
|
@ -147,7 +144,6 @@ function M:RecursionSearchRank(fgCtr, index, begin_time, end_time)
|
|||
self:RankTableInsert(info.ranks)
|
||||
self:RecursionSearchRank(fgCtr, index + 1, begin_time, end_time)
|
||||
else
|
||||
ViewUtil.CloseModalWait2()
|
||||
table.sort(self.roundRanks, function(a, b)
|
||||
return a.round > b.round
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ function M:Reflash(group)
|
|||
numbers = self._group.members
|
||||
-- print("==========================res.Data.members")
|
||||
pt(self._group.members)
|
||||
ViewUtil:CloseModalWait2()
|
||||
ViewUtil:CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||
else
|
||||
|
|
@ -92,9 +92,7 @@ function M:FillList(numbers)
|
|||
|
||||
obj.onClick:Set(function()
|
||||
print("lingmengtextBtn_detail")
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_FindMember(self._group.id, numbers[i].uid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
local familyNumberDetail = FamilyNumberDetail.new(self._group.id, self._group.lev, res)
|
||||
familyNumberDetail:SetTickCallback(handler(self, self.TickNumberCallback))
|
||||
familyNumberDetail:SetRefrenCallback(handler(self, self.RefrenMemberCallback))
|
||||
|
|
@ -126,7 +124,7 @@ function M:RefrenMemberCallback()
|
|||
fgCtr:FG_GroupMembers(self._group.id, 0, self._group.total_member_num, false, 1, function(res)
|
||||
numbers = self._group.members
|
||||
-- print("==========================res.Data.members")
|
||||
ViewUtil:CloseModalWait2()
|
||||
ViewUtil:CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||
else
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ function FamilyAuditNumber.new(root)
|
|||
self.class = "FamilyAuditNumber"
|
||||
self._scale = true
|
||||
self._animation = false
|
||||
self._close_destroy = true
|
||||
self:init("ui://Family/com_auditNumber")
|
||||
return self
|
||||
end
|
||||
|
|
@ -40,7 +39,7 @@ function FamilyAuditNumber:init(url)
|
|||
self.list_auditNumberList = self._view:GetChild('list_auditNumberList')
|
||||
|
||||
self.btn_close.onClick:Set(function()
|
||||
self:Destroy()
|
||||
self:Close()
|
||||
end)
|
||||
|
||||
self.list_auditNumberList.itemRenderer = function(index, obj)
|
||||
|
|
@ -56,9 +55,7 @@ end
|
|||
function FamilyAuditNumber:Show(group)
|
||||
self._group = group
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_GroupJoins(self._group.id, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||
return
|
||||
|
|
@ -76,9 +73,7 @@ end
|
|||
|
||||
function FamilyAuditNumber:ClickBtn(isAllow, uid, tag)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_GroupVerifyJoin(self._group.id, uid, isAllow == 1, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||
else
|
||||
|
|
@ -88,8 +83,6 @@ function FamilyAuditNumber:ClickBtn(isAllow, uid, tag)
|
|||
else
|
||||
|
||||
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)
|
||||
group.joins = group.joins - 1
|
||||
|
||||
|
|
@ -102,7 +95,6 @@ function FamilyAuditNumber:ClickBtn(isAllow, uid, tag)
|
|||
self:Reflash()
|
||||
|
||||
Broadcast.Send(BroadcastEvent.OnJoinsChange)
|
||||
Broadcast.Send(BroadcastEvent.OnMemberChange)
|
||||
|
||||
--[[
|
||||
local view = BaseView.FindView("FamilyMainView")
|
||||
|
|
|
|||
|
|
@ -75,10 +75,8 @@ local function AddPlayer(data, self)
|
|||
players[#players + 1] = number.uid
|
||||
self.sending = true
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, players, data.deskName, function(res)
|
||||
self.sending = false
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(-1, "设置失败")
|
||||
return
|
||||
|
|
@ -113,10 +111,8 @@ local function DelPalyer(data, uid, self)
|
|||
|
||||
self.sending = true
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, players, data.deskName, function(res)
|
||||
self.sending = false
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(-1, "删除失败")
|
||||
return
|
||||
|
|
@ -138,9 +134,7 @@ local function DelDesk(data, self)
|
|||
|
||||
self.sending = true
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, {}, data.deskName, function()
|
||||
ViewUtil.CloseModalWait2()
|
||||
self.sending = false
|
||||
self:Reflash()
|
||||
end)
|
||||
|
|
@ -148,9 +142,7 @@ end
|
|||
|
||||
local function ChangeName(deskData, name, self)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetBanTable1(self.root._group.id, deskData.deskId, AllUid(deskData.deskList), name, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(-1, "删除失败")
|
||||
return
|
||||
|
|
@ -323,9 +315,7 @@ function BanDesk:Reflash()
|
|||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
local groupId = self.root._group.id
|
||||
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_GetBanTable1(groupId, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
self:GetBanTableCallback(res)
|
||||
end)
|
||||
end
|
||||
|
|
@ -348,9 +338,7 @@ function BanDesk:GetBanTableCallback(res)
|
|||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
local groupId = self.root._group.id
|
||||
local banList = {}
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetBanTable1(groupId, -1, banList, "新建关系", function()
|
||||
ViewUtil.CloseModalWait2()
|
||||
self.sending = false
|
||||
self:Reflash()
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ function FamilyChatRoom:Show()
|
|||
|
||||
mgr_ctr:FG_ENTER_CHATROOM(self.root._group.id, getData, function(res)
|
||||
if res.returnCode == 0 then
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在加载聊天室......")
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在加载聊天室......")
|
||||
end
|
||||
end)
|
||||
|
||||
|
|
|
|||
|
|
@ -167,22 +167,20 @@ end
|
|||
|
||||
function M:_evtInviteResponse(...)
|
||||
local arg = { ... }
|
||||
local evt_data = arg[1]
|
||||
local invite_id = evt_data.invite_id
|
||||
local nik = evt_data.nik
|
||||
local g_name = evt_data.g_name
|
||||
local roomid = evt_data.roomid
|
||||
local pid = evt_data.pid
|
||||
local groupid = evt_data.groupId
|
||||
local playInfo = evt_data.pinfo
|
||||
local invite_id = arg[1]
|
||||
local g_name = arg[2]
|
||||
local roomid = arg[3]
|
||||
local pid = arg[4]
|
||||
local groupid = arg[5]
|
||||
local roomCtr = ControllerManager.GetController(RoomController)
|
||||
local gameId = DataManager.groups:get(groupid):getPlay(pid).gameId
|
||||
UIPackage.AddPackage('base/newgroup/ui/FGAssist')
|
||||
local imv =
|
||||
FGInvitedMsgView.new(
|
||||
self._root_view,
|
||||
groupid,
|
||||
playInfo,
|
||||
nik,
|
||||
pid,
|
||||
invite_id,
|
||||
function()
|
||||
roomCtr:PublicJoinRoom(
|
||||
Protocol.WEB_FG_JOIN_ROOM,
|
||||
|
|
@ -201,8 +199,7 @@ function M:_evtInviteResponse(...)
|
|||
return
|
||||
else
|
||||
UpdateBeat:Remove(self.OnUpdate, self)
|
||||
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id,
|
||||
{ _flag_showTip = true })
|
||||
ViewManager.ChangeView(ViewManager.View_Main, gameId, { _flag_showTip = true })
|
||||
end
|
||||
end,
|
||||
groupid,
|
||||
|
|
@ -227,7 +224,7 @@ function M:_evtChatRoomData(...)
|
|||
return
|
||||
end
|
||||
view.com_FamilyChatRoom:Refalsh()
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
end
|
||||
|
||||
function M:_evtOnNewRecord(...)
|
||||
|
|
@ -336,10 +333,6 @@ function M:_evtOnFamilyReflash(...)
|
|||
|
||||
group.joins = joins
|
||||
|
||||
if not group.joinsData or #group.joinsData < 1 then
|
||||
return
|
||||
end
|
||||
|
||||
for _, data in pairs(group.joinsData) do
|
||||
if data.id == uid then
|
||||
table.remove(group.joinsData, _)
|
||||
|
|
@ -384,34 +377,21 @@ function M:_evtOnFamilyMemberOut(...)
|
|||
local uid = arg.uid
|
||||
local groupId = arg.groupId
|
||||
local name = arg.name
|
||||
local reflashType = arg.reflashType
|
||||
|
||||
local group = DataManager.groups:get(groupId)
|
||||
|
||||
local view = ViewManager.GetCurrenView()
|
||||
if view.class ~= "FamilyMainView" or not group then
|
||||
if view.class ~= "FamilyMainView" then
|
||||
return
|
||||
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
|
||||
DataManager.groups:del(groupId)
|
||||
if #DataManager.groups.groupList == 0 then
|
||||
if view._group.id == groupId then
|
||||
view._close_destroy = true
|
||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||
else
|
||||
if view._group.id == groupId then
|
||||
view:Reflash()
|
||||
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)
|
||||
win:Show()
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,13 +5,11 @@ local FamilyInviteFamilyView = {}
|
|||
local M = FamilyInviteFamilyView
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
|
||||
function FamilyInviteFamilyView.new(curGroup)
|
||||
function FamilyInviteFamilyView.new()
|
||||
local self = setmetatable({}, { __index = M })
|
||||
self.class = 'FamilyInviteFamilyView'
|
||||
self._close_destroy = true
|
||||
self._close_zone = false
|
||||
self._new_hide = false
|
||||
self._curGroup = curGroup
|
||||
self:init('ui://Family/InviteFamily')
|
||||
return self
|
||||
end
|
||||
|
|
@ -20,17 +18,11 @@ function M:init(url)
|
|||
BaseWindow.init(self, url)
|
||||
|
||||
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()
|
||||
data.type = 0
|
||||
ViewUtil.__share(data)
|
||||
ViewUtil.ErrorTip(-1, "该功能还会开放,敬请期待")
|
||||
end)
|
||||
view:GetChild('btn_moments').onClick:Add(function()
|
||||
data.type = 1
|
||||
ViewUtil.__share(data)
|
||||
ViewUtil.ErrorTip(-1, "该功能还会开放,敬请期待")
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ local FamilyInvitedMsgView = {}
|
|||
local M = FamilyInvitedMsgView
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
|
||||
function FamilyInvitedMsgView.new(blur_view, groupid, pinfo, nik, callback)
|
||||
function FamilyInvitedMsgView.new(blur_view, groupid, pid, invite_id, callback)
|
||||
print("lingmeng FGAssistInviteView")
|
||||
local self = setmetatable({}, { __index = M })
|
||||
self.class = "FGAssistInviteView"
|
||||
|
|
@ -14,8 +14,8 @@ function FamilyInvitedMsgView.new(blur_view, groupid, pinfo, nik, callback)
|
|||
self._put_map = false
|
||||
self._close_destroy = true
|
||||
self.groupid = groupid
|
||||
self.pinfo = pinfo
|
||||
self.nik = nik
|
||||
self.pid = pid
|
||||
self.invite_id = invite_id
|
||||
self.callback = callback
|
||||
UIPackage.AddPackage('base/newgroup/ui/FGAssist')
|
||||
self:initView("ui://FGAssist/panel_invited")
|
||||
|
|
@ -35,35 +35,45 @@ function M:initView(url)
|
|||
self._viewText_playName.emojies = EmojiDitc.EmojiesDitc
|
||||
|
||||
self._view:GetChild('btn_no').onClick:Set(function()
|
||||
print("lingmeng btn_no")
|
||||
self:Destroy()
|
||||
end)
|
||||
|
||||
print("lingmeng FGAssistInviteView5")
|
||||
|
||||
self._view:GetChild('btn_yes').onClick:Set(function()
|
||||
print("lingmeng btn_yes", self.callback)
|
||||
|
||||
if self.callback then
|
||||
self.callback()
|
||||
end
|
||||
self:Destroy()
|
||||
end)
|
||||
print("lingmeng FGAssistInviteViewend")
|
||||
self:FillData()
|
||||
end
|
||||
|
||||
function M:FillData()
|
||||
local group = DataManager.groups:get(self.groupid)
|
||||
local play = self.pinfo
|
||||
local play = group:getPlay(self.pid)
|
||||
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)
|
||||
--pt(group.memberMap)
|
||||
|
||||
self._viewText_groupName.text = Utils.TextOmit(group.name, 6, "...")
|
||||
self._viewText_gameName.text = play.game_name
|
||||
self._viewText_inviteName.text = ViewUtil.stringEllipsis(self.nik)
|
||||
self._viewText_inviteName.text = player.nick
|
||||
self._viewText_playName.text = Utils.TextOmit(play.name, 6, "...")
|
||||
|
||||
local config = ExtendManager.GetExtendConfig(play.gameId)
|
||||
local mode = config:GetGameInfo()
|
||||
local gamePlay = mode:LoadConfigToDetail(play.config, play.hpData)
|
||||
self._viewText_playConfig.text = gamePlay
|
||||
self._viewText_playConfig.text = play.hp_times / 1000 .. "倍," .. gamePlay
|
||||
end
|
||||
|
||||
function M:Destroy()
|
||||
|
|
|
|||
|
|
@ -3,15 +3,13 @@ local tipsWindow = import("..Common.tipsWindow")
|
|||
local FamilyJoinAndCreate = {}
|
||||
|
||||
local function SendJoinRoom(self, roomId, remark)
|
||||
ViewUtil.ShowModalWait2()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_JoinGroup(tonumber(roomId), function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode)
|
||||
end
|
||||
end,
|
||||
remark)
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode)
|
||||
end
|
||||
end,
|
||||
remark)
|
||||
end
|
||||
|
||||
function FamilyJoinAndCreate:init(root)
|
||||
|
|
@ -45,15 +43,11 @@ function FamilyJoinAndCreate:init(root)
|
|||
end)
|
||||
|
||||
self._view:GetChild('btn_c').onClick:Set(function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_GroupList(function(res)
|
||||
fgCtr:FG_CreateGroup(self.input_name.text, 1, 2, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode == 0 then
|
||||
root.familyType.selectedIndex = 1
|
||||
Utils.SaveLocalFile("Family_lastID" .. DataManager.SelfUser.account_id, res.Data.info.id)
|
||||
root:Reflash()
|
||||
-- root:ConnetFamily(1, DataManager.groups.groupList, true)
|
||||
root:ConnetFamily(1, DataManager.groups.groupList, true)
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, '创建大联盟失败!')
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ local FamilyMsgDiamond = {}
|
|||
local M = FamilyMsgDiamond
|
||||
|
||||
--类型字段,1为进入游戏预扣,2为结束游戏返还
|
||||
local TypeTable = { "亲友圈开局游戏预扣", "因游戏结束返还您", "您为亲友圈充值" }
|
||||
local TypeTable = { "亲友圈开局游戏预扣", "因游戏结束返还您" }
|
||||
|
||||
function M.New(data, callback)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
|
|
@ -25,9 +25,7 @@ function M:Init()
|
|||
end
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_Get_Diamond_Msg(self.data.groupId, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取房卡记录失败")
|
||||
else
|
||||
|
|
@ -38,16 +36,10 @@ function M:Init()
|
|||
end
|
||||
|
||||
function M:msgRenderer(index, obj)
|
||||
local data = self.msgData[index + 1]
|
||||
local type = data.diamo_type
|
||||
obj:GetChild('tex_time').text = os.date("%Y-%m-%d %H:%M:%S", math.floor(data.m_time / 1000))
|
||||
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
|
||||
local data = self.msgData
|
||||
obj:GetChild('tex_time').text = os.date("%Y-%m-%d %H:%M:%S", math.floor(data[index + 1].m_time / 1000))
|
||||
obj:GetChild('tex_msg').text = string.format("%s%d房卡,剩余%d房卡", TypeTable[data[index + 1].diamo_type + 1],
|
||||
data[index + 1].diamo_num, data[index + 1].diamo_cur)
|
||||
end
|
||||
|
||||
function M:Show(groupId)
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@ local FamilyMsgRecord = {}
|
|||
-- m_state : 进入亲友圈(0)退出亲友圈(1),创建亲友圈(2),踢出亲友圈(3)
|
||||
local function RequestData(self, groupId)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_Get_Msg(groupId, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode)
|
||||
return
|
||||
|
|
|
|||
|
|
@ -12,10 +12,8 @@ local root = {}
|
|||
|
||||
local function ChangeFamilyConfig(data, self)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_UpdateGroupInfo(data,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "更改失败,请稍后再试")
|
||||
else
|
||||
|
|
@ -42,7 +40,6 @@ end
|
|||
local function QuitFamily(self)
|
||||
local uid = DataManager.SelfUser.account_id
|
||||
local group = DataManager.groups:get(self.groupId)
|
||||
local groupName = group.name
|
||||
local player = group.memberMap[uid]
|
||||
|
||||
local tips = "确定退出该亲友圈?"
|
||||
|
|
@ -61,28 +58,12 @@ local function QuitFamily(self)
|
|||
self.networkSending = true
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
print("发送了退出协议 familyid = ", self.family.id)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_ExitGroup(self.family.id, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
return
|
||||
end
|
||||
self.networkSending = false
|
||||
-- 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
|
||||
Broadcast.Send(BroadcastEvent.OnOutFamily)
|
||||
self:Close()
|
||||
end)
|
||||
end)
|
||||
|
|
@ -139,11 +120,11 @@ function FamilyMyFamily:Show(groupId)
|
|||
Broadcast.AddListener(BroadcastEvent.OnJoinsChange, self.ReflashJoinsRedPoint, self)
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在加载亲友圈数据......")
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在加载亲友圈数据......")
|
||||
fgCtr:WEB_FG_GET_GROUP_DETAIL(self.groupId, function(res)
|
||||
print("收到家族的详细信息")
|
||||
pt(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode)
|
||||
end
|
||||
|
|
@ -352,11 +333,9 @@ function FamilyMyFamily:Init()
|
|||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
self.networkSending = true
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetGroupShow(0, self.family.id, function(res)
|
||||
print("收到协议M:FG_SetGroupShow")
|
||||
pt(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
self.networkSending = false
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode)
|
||||
|
|
@ -378,11 +357,9 @@ function FamilyMyFamily:Init()
|
|||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
self.networkSending = true
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetGroupShow(1, self.family.id, function(res)
|
||||
print("收到协议M:FG_SetGroupShow")
|
||||
pt(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
self.networkSending = false
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode)
|
||||
|
|
@ -403,9 +380,7 @@ function FamilyMyFamily:Init()
|
|||
self.networkSending = true
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
print("发送了退出协议 familyid = ", self.family.id)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_ExitGroup(self.family.id, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
return
|
||||
end
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ end
|
|||
|
||||
function FamilyMyfamilyList:Show()
|
||||
Broadcast.AddListener(BroadcastEvent.OnJoinsChange, RefalshJoinsRedPoint, self)
|
||||
Broadcast.AddListener(BroadcastEvent.OnOutFamily2, self.Refalsh, self)
|
||||
Broadcast.AddListener(BroadcastEvent.OnOutFamily, self.Refalsh, self)
|
||||
|
||||
HideMainView(self)
|
||||
self:Refalsh()
|
||||
|
|
@ -77,7 +77,7 @@ end
|
|||
|
||||
function FamilyMyfamilyList:Close()
|
||||
Broadcast.RemoveListener(BroadcastEvent.OnJoinsChange, RefalshJoinsRedPoint)
|
||||
Broadcast.RemoveListener(BroadcastEvent.OnOutFamily2, self.Refalsh)
|
||||
Broadcast.RemoveListener(BroadcastEvent.OnOutFamily, self.Refalsh)
|
||||
|
||||
ShowMainView(self)
|
||||
BaseView.Close(self)
|
||||
|
|
|
|||
|
|
@ -63,9 +63,7 @@ function M:init(url, lev, res)
|
|||
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetJoinScore(self.groupId, info.uid, tonumber(text) or 0, MJScore, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
||||
else
|
||||
|
|
@ -89,9 +87,7 @@ function M:init(url, lev, res)
|
|||
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetJoinScore(self.groupId, info.uid, MJScore, tonumber(text) or 0, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
||||
else
|
||||
|
|
@ -120,9 +116,7 @@ function M:init(url, lev, res)
|
|||
MsgWindow.new(self._root_view, string.format("是否禁止用户(%s)进入房间", info.nick), MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_BanMember(self.groupId, info.uid, 1 - flag_band, 1, function()
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode == 0 then
|
||||
flag_band = 1 - flag_band
|
||||
self._view:GetChild('btn_band'):GetController('band').selectedIndex = flag_band
|
||||
|
|
@ -149,9 +143,7 @@ function M:init(url, lev, res)
|
|||
flag_assistant == 1 and "助理身份" or "设置为助理"), MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetManager(self.groupId, info.uid, flag_assistant + 1, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode == 0 then
|
||||
local g = DataManager.groups.groupMap[self.groupId]
|
||||
local player = g.memberMap[info.uid]
|
||||
|
|
|
|||
|
|
@ -87,9 +87,7 @@ function FamilyNumberRecord.New(root, page)
|
|||
self._data_leftTime = os.time(timeTable) - index * 86400
|
||||
self._data_rightTime = os.time(timeTable) - index * 86400 + 86399
|
||||
self:OnClickSortType()
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_GetConsumeStat(group_id, self._data_leftTime, self._data_rightTime, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取总信息失败")
|
||||
else
|
||||
|
|
@ -137,9 +135,7 @@ function FamilyNumberRecord.New(root, page)
|
|||
return
|
||||
end
|
||||
--写限制分数
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetGroupRecordUpdateDayType(group_id, ctr_limitDay.selectedIndex + 1, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "分数限制分设置失败")
|
||||
self.ctr_limitDay_isReverting = true
|
||||
|
|
@ -210,9 +206,7 @@ function FamilyNumberRecord.New(root, page)
|
|||
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetJoinScore(group_id, 0, tonumber(text) or 0, self.MJScore, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
||||
else
|
||||
|
|
@ -242,9 +236,7 @@ function FamilyNumberRecord.New(root, page)
|
|||
ViewUtil.ShowOneChooose({ showText = "请输入正确的权限分" })
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetJoinScore(group_id, 0, self.MJScore, tonumber(text) or 0, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败")
|
||||
else
|
||||
|
|
@ -275,10 +267,8 @@ function FamilyNumberRecord.New(root, page)
|
|||
local _curren_msg = MsgWindow.new(self._root_view, newReadType == 1 and "确定要将选中的对局设置为未读" or "确定要将选中的对局设置为已读",
|
||||
MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_SetGroupRecordReadStatus(group_id, GetPlatform(), self.military.list, newReadType - 1, self._tagId,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
pt(res)
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "修改战绩阅读状态失败")
|
||||
|
|
@ -332,9 +322,8 @@ function FamilyNumberRecord.New(root, page)
|
|||
btn_reflash.grayed = false
|
||||
end)
|
||||
end)
|
||||
ViewUtil.ShowModalWait2()
|
||||
|
||||
fgCtr:FG_GetConsumeStat(group_id, self._data_leftTime, self._data_rightTime, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取总信息失败")
|
||||
else
|
||||
|
|
@ -529,8 +518,7 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
|||
local btn_play = obj:GetChild("n10")
|
||||
btn_play.onClick:Set(function()
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
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
|
||||
if DataManager.SelfUser.playback[allDate.military_id] ~= nil and DataManager.SelfUser.playback[allDate.military_id][round] ~= nil then
|
||||
local room = ExtendManager.GetExtendConfig(allDate.game_info.game_id):NewRoom()
|
||||
DataManager.CurrenRoom = room
|
||||
room.lev = group.lev
|
||||
|
|
@ -543,15 +531,16 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
|||
local main = self:GenaratePlayBack(ViewManager.View_PlayBack, allDate.game_info.game_id)
|
||||
main._currentId = allDate.military_id
|
||||
main._currentRound = round
|
||||
main._totalRound = tonumber(allDate.round)
|
||||
main._totalRound = tonumber(rdata.round)
|
||||
main:FillRoomData(DataManager.SelfUser.playback[allDate.military_id][round])
|
||||
ViewUtil.CloseModalWait2()
|
||||
else
|
||||
ViewUtil.ShowModalWait(self._view)
|
||||
local _data = {}
|
||||
_data["military_id"] = allDate.military_id
|
||||
_data["round"] = tostring(round)
|
||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||
ViewUtil.CloseModalWait()
|
||||
if code == 0 then
|
||||
if DataManager.SelfUser.playback[allDate.military_id] ~= nil then
|
||||
DataManager.SelfUser.playback[allDate.military_id][round] = data
|
||||
|
|
@ -567,10 +556,9 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
|||
main._totalRound = tonumber(allDate.round)
|
||||
main:FillRoomData(data)
|
||||
main._room.lev = group.lev
|
||||
ViewUtil.CloseModalWait2()
|
||||
elseif code == 25 then
|
||||
ViewUtil.ErrorTip(-1, "回放未找到!")
|
||||
ViewUtil.CloseModalWait2()
|
||||
-- btn_play_back.grayed = true
|
||||
end
|
||||
end, allDate.game_info)
|
||||
end
|
||||
|
|
@ -616,11 +604,9 @@ function M:OnClickSortType()
|
|||
end
|
||||
|
||||
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,
|
||||
self._data_seletedType, self._data_sortType,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取排行榜失败")
|
||||
return
|
||||
|
|
|
|||
|
|
@ -139,10 +139,8 @@ function M:ShowNumberRecord()
|
|||
end
|
||||
|
||||
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,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "查看个人战绩失败")
|
||||
self.visible = false
|
||||
|
|
@ -210,8 +208,7 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
|||
local btn_play = obj:GetChild("n10")
|
||||
btn_play.onClick:Set(function()
|
||||
local group = self.currenGroup
|
||||
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
|
||||
if DataManager.SelfUser.playback[allDate.military_id] ~= nil and DataManager.SelfUser.playback[allDate.military_id][round] ~= nil then
|
||||
local room = ExtendManager.GetExtendConfig(allDate.game_info.game_id):NewRoom()
|
||||
DataManager.CurrenRoom = room
|
||||
room.lev = group.lev
|
||||
|
|
@ -224,15 +221,16 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
|||
local main = self:GenaratePlayBack(ViewManager.View_PlayBack, allDate.game_info.game_id)
|
||||
main._currentId = allDate.military_id
|
||||
main._currentRound = round
|
||||
main._totalRound = tonumber(allDate.round)
|
||||
main._totalRound = tonumber(rdata.round)
|
||||
main:FillRoomData(DataManager.SelfUser.playback[allDate.military_id][round])
|
||||
ViewUtil.CloseModalWait2()
|
||||
else
|
||||
ViewUtil.ShowModalWait(self._view)
|
||||
local _data = {}
|
||||
_data["military_id"] = allDate.military_id
|
||||
_data["round"] = tostring(round)
|
||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||
ViewUtil.CloseModalWait()
|
||||
if code == 0 then
|
||||
if DataManager.SelfUser.playback[allDate.military_id] ~= nil then
|
||||
DataManager.SelfUser.playback[allDate.military_id][round] = data
|
||||
|
|
@ -248,10 +246,9 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
|
|||
main._totalRound = tonumber(allDate.round)
|
||||
main:FillRoomData(data)
|
||||
main._room.lev = group.lev
|
||||
ViewUtil.CloseModalWait2()
|
||||
elseif code == 25 then
|
||||
ViewUtil.ErrorTip(-1, "回放未找到!")
|
||||
ViewUtil.CloseModalWait2()
|
||||
-- btn_play_back.grayed = true
|
||||
end
|
||||
end, allDate.game_info)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@ local function charge(num, self)
|
|||
_curren_msg.onOk:Add(
|
||||
function()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_Recharge_Diamo(self.groupId, num, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "重置房卡操作失败")
|
||||
return
|
||||
|
|
@ -69,16 +67,16 @@ function FamilyRoomCard.New()
|
|||
obj:GetController("cColor").selectedIndex = data[_idx].colorIndex
|
||||
|
||||
obj.onClick:Set(function()
|
||||
-- if Instance.group and Instance.group.lev ~= 1 then
|
||||
-- local _curren_msg =
|
||||
-- MsgWindow.new(
|
||||
-- Instance._root_view,
|
||||
-- "只有管理员可以充值",
|
||||
-- MsgWindow.MsgMode.OnlyOk
|
||||
-- )
|
||||
-- _curren_msg:Show()
|
||||
-- return
|
||||
-- end
|
||||
if Instance.group and Instance.group.lev ~= 1 then
|
||||
local _curren_msg =
|
||||
MsgWindow.new(
|
||||
Instance._root_view,
|
||||
"只有管理员可以充值",
|
||||
MsgWindow.MsgMode.OnlyOk
|
||||
)
|
||||
_curren_msg:Show()
|
||||
return
|
||||
end
|
||||
if DataManager.SelfUser.diamo < num then
|
||||
local _curren_msg =
|
||||
MsgWindow.new(
|
||||
|
|
|
|||
|
|
@ -76,14 +76,12 @@ function PlayEditView:Init()
|
|||
obj:GetChild('Label_details'):GetChild('title').text = mode:LoadConfigToDetail(playList[index].config,
|
||||
playList[index].hpData)
|
||||
obj:GetChild('text_playName').emojies = EmojiDitc.EmojiesDitc
|
||||
obj:GetChild('text_playName').text = playList[index].name
|
||||
obj:GetChild('text_playName').text = Utils.TextOmit(playList[index].name, 6, "...")
|
||||
obj:GetController('type').selectedIndex = 1
|
||||
obj:GetChild('btn_del').onClick:Set(function()
|
||||
ViewUtil.ShowTwoChooose("是否要删除该玩法", function()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
fgCtr:FG_DelPlay(self.groupId, playList[index].id, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "删除玩法操作失败")
|
||||
return
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ function FamilyView.new()
|
|||
local self = setmetatable({}, { __index = M })
|
||||
self.class = 'FamilyMainView'
|
||||
self._full = true
|
||||
self._full_offset = false
|
||||
-- self._close_destroy = false
|
||||
self._fristRoom = true
|
||||
self:init('ui://Family/Main')
|
||||
|
|
@ -134,6 +133,7 @@ end
|
|||
function M:init(url)
|
||||
BaseView.InitView(self, url)
|
||||
-- self._close_destroy = false
|
||||
self._full_offset = false
|
||||
local view = self._view
|
||||
self.lastTime = os.time()
|
||||
|
||||
|
|
@ -161,7 +161,7 @@ function M:init(url)
|
|||
self.cChatRoomRedPoint = self.btn_chatRoom:GetController("cRedPoint")
|
||||
|
||||
self:InitCloseClick()
|
||||
self._view:GetController('listFamily').selectedIndex = -1
|
||||
|
||||
--[[
|
||||
fgCtr:FG_GroupList(function(res)
|
||||
print("获取所有圈信息")
|
||||
|
|
@ -229,20 +229,17 @@ function M:init(url)
|
|||
local group = DataManager.groups.groupList[j]
|
||||
obj:GetChild("title").emojies = EmojiDitc.EmojiesDitc
|
||||
obj.text = Utils.TextOmit(group.name, 6, "...")
|
||||
obj.onClick:Set(function()
|
||||
obj.onClick:Add(function()
|
||||
if self._group ~= nil and group.id == self._group.id then
|
||||
--ViewUtil.ErrorTip(-1,"已在家族中")
|
||||
return
|
||||
end
|
||||
self._view:GetController('listFamily').selectedIndex = i
|
||||
self:RefNotice(group.id)
|
||||
self.curGroupIndex = j
|
||||
self:ConnetFamily(j, DataManager.groups.groupList)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
self.familyType.selectedIndex = 1
|
||||
|
||||
self._view:GetChild('btn_showALlStartRoom').onClick:Set(function()
|
||||
|
|
@ -271,13 +268,6 @@ function M:init(url)
|
|||
self._data_falshRoomTime = 20
|
||||
end)
|
||||
end
|
||||
|
||||
local btn_inviteFriends = self._view:GetChild('btn_inviteFriends')
|
||||
if btn_inviteFriends then
|
||||
btn_inviteFriends.onClick:Set(function()
|
||||
self:ShareWx()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function M:Reflash()
|
||||
|
|
@ -306,7 +296,6 @@ function M:Reflash()
|
|||
end
|
||||
local btn = self.list_family:GetChildAt(chooseIndex - 1)
|
||||
btn.onClick:Call()
|
||||
self._view:GetController('listFamily').selectedIndex = chooseIndex - 1
|
||||
else
|
||||
self:JoinFamily(true)
|
||||
self.btn_chatRoom.visible = false
|
||||
|
|
@ -335,7 +324,7 @@ function M:InitCloseClick()
|
|||
end
|
||||
|
||||
function M:ShareWx()
|
||||
local familyInviteFamilyView = FamilyInviteFamilyView.new(self._group)
|
||||
local familyInviteFamilyView = FamilyInviteFamilyView.new()
|
||||
familyInviteFamilyView:Show()
|
||||
end
|
||||
|
||||
|
|
@ -473,7 +462,7 @@ function M:ShowAllRank()
|
|||
self._ViewChild_AllRank = FamilAllRank.New(self, self._group.id)
|
||||
return
|
||||
end
|
||||
self._ViewChild_AllRank:ShouRanks(self, self._group.id)
|
||||
self._ViewChild_AllRank:ShouRanks()
|
||||
end
|
||||
|
||||
function M:OpenAllNumber(group)
|
||||
|
|
@ -540,7 +529,7 @@ function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type)
|
|||
self.members = SortMembers(self._group.members) --local members = self._group.members
|
||||
print("FG_GroupMembers12")
|
||||
pt(self._group.members)
|
||||
--ViewUtil:CloseModalWait2()
|
||||
--ViewUtil:CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||
else
|
||||
|
|
@ -577,6 +566,7 @@ end
|
|||
|
||||
function M:EnterGroup(fgCtr, id)
|
||||
fgCtr:FG_EnterGroup(id, function(res)
|
||||
ViewUtil:CloseModalWait()
|
||||
ViewUtil:CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
if res.ReturnCode == 101 then
|
||||
|
|
@ -604,7 +594,10 @@ function M:OnEnterGroupCallBack()
|
|||
|
||||
self:UpdateFamilyRoom(fgCtr, self._group.id)
|
||||
|
||||
ViewUtil.CloseModalWait2()
|
||||
--ViewUtil.ShowModalWait(self._root_view, "正在加载亲友圈权限中......")
|
||||
--self:ChangeOther()
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
|
||||
self:ReflashChatRoomRedPoint()
|
||||
|
||||
|
|
@ -648,7 +641,7 @@ function M:UpdateFamilyRoom(fgCtr, id)
|
|||
show_num = #playList + #readyRoom
|
||||
self._view:GetChild('n364').text = string.format("已开启***桌游戏")
|
||||
end
|
||||
self._view:GetChild('btn_showALlStartRoom'):GetController('isOpen').selectedIndex = self._group.isOpenStartRoom or 0
|
||||
self._view:GetChild('btn_showALlStartRoom'):GetController('isOpen').selectedIndex = self._group.isOpenStartRoom
|
||||
list_room.itemRenderer = function(index, obj)
|
||||
if index < #readyRoom then
|
||||
local newIndex = index + 1
|
||||
|
|
@ -801,7 +794,7 @@ function M:FillSameRoomInfo(obj, type, playInfo)
|
|||
obj:GetChild('Label_gameRule').title = gamePlay
|
||||
|
||||
local roomName = playInfo.name
|
||||
roomName = roomName
|
||||
roomName = Utils.TextOmit(roomName, 6, "")
|
||||
obj:GetChild('game_type').emojies = EmojiDitc.EmojiesDitc
|
||||
obj:GetChild('game_type').text = string.format(" (%s) %s", playInfo.game_name, roomName)
|
||||
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = type
|
||||
|
|
@ -850,7 +843,7 @@ function M:JieSanRomm(groupId, roomId)
|
|||
)
|
||||
_curren_msg.onOk:Add(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
|
||||
fgCtr:FG_RemoveRoom(
|
||||
|
|
@ -860,7 +853,7 @@ function M:JieSanRomm(groupId, roomId)
|
|||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!')
|
||||
return
|
||||
|
|
@ -878,26 +871,42 @@ function M:ReflashFamilyList()
|
|||
end
|
||||
|
||||
function M:ConnetFamily(index, groups)
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在加载成员列表中......")
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在加载成员列表中......")
|
||||
|
||||
if self._group then
|
||||
FamilyOffline(self._group.id, self)
|
||||
end
|
||||
|
||||
UpdateBeat:Remove(self.OnUpdate, self)
|
||||
ViewUtil:CloseModalWait2()
|
||||
ViewUtil:CloseModalWait()
|
||||
self._group = DataManager.groups:get(groups[index].id)
|
||||
DataManager.CurrenGroup = self._group
|
||||
self._view:GetChild('text_familyId').text = self._group.id
|
||||
self._view:GetController('lev').selectedIndex = self._group.lev - 1
|
||||
print("===================================self._group")
|
||||
pt(self._group)
|
||||
self._roomNum = self._group.room_num
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在进入亲友圈......")
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在进入亲友圈......")
|
||||
Utils.SaveLocalFile("Family_lastID" .. DataManager.SelfUser.account_id, 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)
|
||||
|
||||
if self._group.isOpenChatRoom == 1 then
|
||||
|
|
|
|||
|
|
@ -1,118 +0,0 @@
|
|||
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
|
||||
|
||||
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在创建房间...")
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在创建房间...")
|
||||
loddyCtr:CreateRoom(game_id, { _data = _data, hpData = self.hpData, name = name }, function(res)
|
||||
self:__OnCreateRoomAction(res)
|
||||
end)
|
||||
|
|
@ -193,7 +193,7 @@ function M:OnCreateRoom(mode_data)
|
|||
end
|
||||
|
||||
function M:__OnCreateRoomAction(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (response.ReturnCode == -2) then
|
||||
return
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ local DiamondRecord = {}
|
|||
local M = DiamondRecord
|
||||
|
||||
--类型字段,1为进入游戏预扣,2为结束游戏返还
|
||||
local TypeTable = { "亲友圈开局游戏预扣", "因游戏结束返还您", "您为亲友圈充值" }
|
||||
local TypeTable = { "亲友圈开局游戏预扣", "因游戏结束返还您" }
|
||||
|
||||
function M.New(data, callback)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
|
|
@ -26,35 +26,13 @@ function M:Init()
|
|||
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
|
||||
|
||||
function M:msgRenderer(index, obj)
|
||||
local data = self.msgData[index + 1]
|
||||
local type = data.diamo_type
|
||||
obj:GetChild('tex_time').text = os.date("%Y-%m-%d %H:%M:%S", math.floor(data.m_time / 1000))
|
||||
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
|
||||
local data = self.msgData
|
||||
obj:GetChild('tex_time').text = os.date("%Y-%m-%d %H:%M:%S", math.floor(data[index + 1].m_time / 1000))
|
||||
obj:GetChild('tex_msg').text = string.format("%s%d房卡,剩余%d房卡", TypeTable[data[index + 1].diamo_type + 1],
|
||||
data[index + 1].diamo_num, data[index + 1].diamo_cur)
|
||||
end
|
||||
|
||||
function M:Show(groupId)
|
||||
|
|
|
|||
|
|
@ -5,45 +5,45 @@ local EditNickView = {}
|
|||
local M = EditNickView
|
||||
|
||||
function EditNickView.new(callback)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
self.class = "EditNickView"
|
||||
self._callback = callback
|
||||
self._close_destroy = true
|
||||
self:init("ui://Lobby/win_edit_nick")
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "EditNickView"
|
||||
self._callback = callback
|
||||
self._close_destroy = true
|
||||
self:init("ui://Lobby/win_edit_nick")
|
||||
|
||||
return self
|
||||
return self
|
||||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
|
||||
local tex_edit = self._view:GetChild("tex_edit")
|
||||
tex_edit.text = DataManager.SelfUser.nick_name
|
||||
local tex_edit = self._view:GetChild("tex_edit")
|
||||
tex_edit.text = DataManager.SelfUser.nick_name
|
||||
|
||||
local btn_confirm = self._view:GetChild("btn_confirm")
|
||||
btn_confirm.onClick:Set(function()
|
||||
local nick = tex_edit.text
|
||||
if nick == "" then
|
||||
ViewUtil.ErrorTip(nil, "昵称不能为空")
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在连接服务器")
|
||||
local btn_confirm = self._view:GetChild("btn_confirm")
|
||||
btn_confirm.onClick:Set(function()
|
||||
local nick = tex_edit.text
|
||||
if nick == "" then
|
||||
ViewUtil.ErrorTip(nil, "昵称不能为空")
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在连接服务器")
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
local _data = {}
|
||||
_data.type = 7
|
||||
_data.nick = nick
|
||||
loddyctr:UpdateUserInfo(_data, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if (res.ReturnCode == 0) then
|
||||
DataManager.SelfUser.nick_name = nick
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "修改失败")
|
||||
end
|
||||
self._callback()
|
||||
self:Destroy()
|
||||
end)
|
||||
end)
|
||||
local _data = {}
|
||||
_data.type = 7
|
||||
_data.nick = nick
|
||||
loddyctr:UpdateUserInfo(_data,function( res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode ==0) then
|
||||
DataManager.SelfUser.nick_name = nick
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "修改失败")
|
||||
end
|
||||
self._callback()
|
||||
self:Destroy()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -64,10 +64,10 @@ function M:OnNumButtonAction(context)
|
|||
end
|
||||
|
||||
function M:JoinRoom(str)
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在加入房间...")
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在加入房间...")
|
||||
local boddyCtr = ControllerManager.GetController(LoddyController)
|
||||
boddyCtr:JoinRoom(str, function(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if response.ReturnCode == -2 then
|
||||
self:JoinRoom(str)
|
||||
return
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ local LobbyHeadView = {}
|
|||
|
||||
local M = LobbyHeadView
|
||||
|
||||
function LobbyHeadView.new(user, agent, callback)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
function LobbyHeadView.new(user,agent,callback)
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "LobbyHeadView"
|
||||
self._user = user
|
||||
self._agent = agent
|
||||
|
|
@ -20,8 +20,8 @@ function LobbyHeadView.new(user, agent, callback)
|
|||
self._full_offset = false
|
||||
self._animation = false
|
||||
self._put_map = false
|
||||
self._new_hide = false
|
||||
self._queue = false
|
||||
self._new_hide = false
|
||||
self._queue = false
|
||||
self.callback = callback
|
||||
self:init("ui://Lobby/UserInfo")
|
||||
|
||||
|
|
@ -36,38 +36,38 @@ function M:fill_item(item_name, title, callback)
|
|||
item.text = title
|
||||
ctr_c1.selectedIndex = 1
|
||||
end
|
||||
btn_opt.onClick:Set(function()
|
||||
btn_opt.onClick:Set(function ()
|
||||
callback()
|
||||
end)
|
||||
end
|
||||
|
||||
function M:fill_user_info()
|
||||
local real_info = self._user.real_info
|
||||
self:fill_item("item_real", real_info and real_info.name or nil, function()
|
||||
local real_view = RealAddressView.new(0, function()
|
||||
self:fill_item("item_real",real_info and real_info.name or nil,function ()
|
||||
local real_view = RealAddressView.new(0,function ()
|
||||
self:fill_user_info()
|
||||
end)
|
||||
real_view:Show()
|
||||
end)
|
||||
|
||||
local address = self._user.address
|
||||
self:fill_item("item_address", address, function()
|
||||
local real_view = RealAddressView.new(1, function()
|
||||
self:fill_item("item_address",address,function ()
|
||||
local real_view = RealAddressView.new(1,function ()
|
||||
self:fill_user_info()
|
||||
end)
|
||||
real_view:Show()
|
||||
end)
|
||||
|
||||
local phone = self._user.phone
|
||||
self:fill_item("item_phone", phone and ViewUtil.phone_hide(phone) or nil, function()
|
||||
local phone_view = PhoneBindView.new(function()
|
||||
self:fill_item("item_phone",phone and ViewUtil.phone_hide(phone) or nil,function ()
|
||||
local phone_view = PhoneBindView.new(function ()
|
||||
self:fill_user_info()
|
||||
end)
|
||||
phone_view:Show()
|
||||
end)
|
||||
|
||||
local password = self._user.password
|
||||
self:fill_item("item_password", password, function()
|
||||
self:fill_item("item_password",password,function ()
|
||||
-- if not phone then
|
||||
-- ViewUtil.ShowTips("请绑定手机号")
|
||||
-- return
|
||||
|
|
@ -82,24 +82,24 @@ function M:fill_user_info()
|
|||
local item_invte = self.user_info:GetChild("item_invte")
|
||||
local ctr_invte = item_invte:GetController("c1")
|
||||
ctr_invte.selectedIndex = invitation
|
||||
ctr_invte.onChanged:Set(function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ctr_invte.onChanged:Set(function ()
|
||||
ViewUtil.ShowModalWait()
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
local _data = {}
|
||||
_data.type = 5
|
||||
_data.type =5
|
||||
_data.invitation = ctr_invte.selectedIndex
|
||||
loddyctr:UpdateUserInfo(_data, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if (res.ReturnCode == 0) then
|
||||
loddyctr:UpdateUserInfo(_data,function( res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode ==0) then
|
||||
DataManager.SelfUser.invitation = ctr_invte.selectedIndex
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "提交失败")
|
||||
ViewUtil.ErrorTip(res.ReturnCode,"提交失败")
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
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()
|
||||
self:fill_user_info()
|
||||
end)
|
||||
|
|
@ -118,18 +118,19 @@ function M:fill_user_info()
|
|||
end)
|
||||
end
|
||||
|
||||
|
||||
function M:ChangeToLogin()
|
||||
local _curren_msg = MsgWindow.new(self._root_view, '您是否退出当前账号?', MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(function()
|
||||
PlayerPrefs.DeleteKey('session_id')
|
||||
PlayerPrefs.Save()
|
||||
RestartGame()
|
||||
end)
|
||||
_curren_msg:Show()
|
||||
local _curren_msg = MsgWindow.new(self._root_view, '您是否退出当前账号?', MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(function()
|
||||
PlayerPrefs.DeleteKey('session_id')
|
||||
PlayerPrefs.Save()
|
||||
RestartGame()
|
||||
end)
|
||||
_curren_msg:Show()
|
||||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
self._close_destroy = true
|
||||
self._close_zone = true
|
||||
local view = self._view
|
||||
|
|
@ -139,7 +140,7 @@ function M:init(url)
|
|||
local ct_state = view:GetController("state")
|
||||
view:GetChild("tex_nickname").text = self._user.nick_name
|
||||
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")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
--设置窗口对象
|
||||
local PasswordUpdateView = import(".PasswordUpdateView")
|
||||
|
||||
local LobbyPlayerInfoView = {}
|
||||
|
||||
|
|
@ -12,7 +11,6 @@ function LobbyPlayerInfoView.new(user, callback)
|
|||
self._close_destroy = true
|
||||
self.user = user
|
||||
self._callback = callback
|
||||
self._loadAll = 0
|
||||
self:init('ui://Lobby/PlayerInfo')
|
||||
return self
|
||||
end
|
||||
|
|
@ -23,6 +21,11 @@ function M:init(url)
|
|||
local view = self._view
|
||||
local user = self.user;
|
||||
|
||||
-- print("================phone=====================")
|
||||
for k, v in pairs(user) do
|
||||
-- print(string.format("k:%s|v:%s", k, v))
|
||||
end
|
||||
|
||||
--show
|
||||
view:GetChild('name').text = user.nick_name
|
||||
view:GetChild('phone').text = user.phone
|
||||
|
|
@ -30,25 +33,11 @@ function M:init(url)
|
|||
view:GetChild('diamo').text = user.diamo
|
||||
view:GetChild('sex').text = user.sex == 1 and "男" or "女"
|
||||
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)
|
||||
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
|
||||
view:GetChild('choose_id').text = user.account_id
|
||||
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.text = user.nick_name
|
||||
self.group_sex = view:GetController('group_sex')
|
||||
|
|
@ -56,8 +45,10 @@ function M:init(url)
|
|||
self.Lable_phone = view:GetChild('Lable_phone'):GetChild('text')
|
||||
local bind = view:GetController('bind')
|
||||
if user.phone then
|
||||
bind.selectedIndex = 1
|
||||
self.Lable_phone.text = user.phone
|
||||
else
|
||||
bind.selectedIndex = 0
|
||||
self.Lable_phone.text = ""
|
||||
end
|
||||
view:GetChild('btn_headChange').onClick:Add(function()
|
||||
|
|
@ -71,6 +62,7 @@ function M:init(url)
|
|||
view:GetChild('btn_bindPhone').onClick:Add(function()
|
||||
local guo_msg = MsgWindow.new(self._root_view, "绑定页面正在优化中,请稍后绑定", MsgWindow.MsgMode.OnlyOk)
|
||||
guo_msg.onOk(function()
|
||||
bind.selectedIndex = 1
|
||||
end)
|
||||
guo_msg:Show()
|
||||
end)
|
||||
|
|
@ -112,31 +104,6 @@ function M:init(url)
|
|||
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
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ function M:PlayerScoreRenderer(index, obj)
|
|||
_data["round"] = tostring(round)
|
||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if code == 0 then
|
||||
if DataManager.SelfUser.playback[allDate.military_id] ~= nil then
|
||||
DataManager.SelfUser.playback[allDate.military_id][round] = data
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ function M:init(url)
|
|||
obj.text = info.service_link
|
||||
obj:GetChild('text_title').text = string.format("%s:", info.service_name)
|
||||
obj:GetChild('btn_copy').onClick:Set(function()
|
||||
GameApplication.Instance:CopyToClipboard(info.service_link)
|
||||
GameApplication.Instance:CopyToClipboard(info.service_link) --湘北
|
||||
ViewUtil.ErrorTip(-1, "复制成功")
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -73,15 +73,8 @@ function M:init(url)
|
|||
_btn_logout.onClick:Set(function()
|
||||
local _curren_msg = MsgWindow.new(self._root_view, '您是否退出当前账号?', MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(function()
|
||||
-- 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.DeleteKey('session_id')
|
||||
PlayerPrefs.Save()
|
||||
print("lingmeng log", phone)
|
||||
RestartGame()
|
||||
end)
|
||||
_curren_msg:Show()
|
||||
|
|
|
|||
|
|
@ -56,16 +56,14 @@ function M:init(url)
|
|||
-- print(DataManager.SelfUser.diamo)
|
||||
-- self.UpdateDiamo()
|
||||
--暂时用这个发送协议
|
||||
-- local uid = DataManager.SelfUser.account_id
|
||||
-- fgCtr:FG_SetFamilyDiamond(self.groupID, uid, SHOP_LIST[index + 1].num, function(res)
|
||||
-- if res.ReturnCode ~= 0 then
|
||||
-- ViewUtil.ErrorTip(res.ReturnCode, "重置房卡失败")
|
||||
-- else
|
||||
local uid = DataManager.SelfUser.account_id
|
||||
fgCtr:FG_SetFamilyDiamond(self.groupID, uid, SHOP_LIST[index + 1].num, function(res)
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "重置房卡失败")
|
||||
else
|
||||
|
||||
-- end
|
||||
-- end)
|
||||
local pay_url = "https://ttfenfa.com/"
|
||||
UnityEngine.Application.OpenURL(pay_url)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,157 +0,0 @@
|
|||
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
|
||||
|
||||
function PhoneBindView.new(callback)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "PhoneBindView"
|
||||
self._callback = callback
|
||||
self._close_destroy = true
|
||||
|
|
@ -14,7 +14,7 @@ function PhoneBindView.new(callback)
|
|||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
|
||||
if DataManager.SelfUser.phone then
|
||||
local ctr_update = self._view:GetController("update")
|
||||
|
|
@ -38,8 +38,8 @@ function M:GetCode()
|
|||
if not phone then
|
||||
return
|
||||
end
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
loddyctr:GetPhoneCode(phone, function(res)
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
loddyctr:GetPhoneCode(phone,function( res)
|
||||
if res.ReturnCode == 0 then
|
||||
self._view:GetController("code").selectedIndex = 1
|
||||
self._left_time = 120
|
||||
|
|
@ -57,10 +57,10 @@ function M:OnUpdate()
|
|||
_left_time = _left_time - deltaTime
|
||||
_left_time = math.max(0, _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
|
||||
else
|
||||
self._view:GetController("code").selectedIndex = 0
|
||||
self._view:GetController("code").selectedIndex=0
|
||||
UpdateBeat:Remove(self.OnUpdate, self)
|
||||
end
|
||||
end
|
||||
|
|
@ -80,19 +80,19 @@ function M:Bind()
|
|||
if not code then
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在提交...")
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
ViewUtil.ShowModalWait(self._root_view,"正在提交...")
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
local _data = {}
|
||||
_data.type = 4
|
||||
_data.type =4
|
||||
_data.phone = phone
|
||||
_data.code = code
|
||||
loddyctr:UpdateUserInfo(_data, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if (res.ReturnCode == 0) then
|
||||
loddyctr:UpdateUserInfo(_data,function( res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode ==0) then
|
||||
DataManager.SelfUser.phone = phone
|
||||
if self._callback then self._callback() end
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "提交失败")
|
||||
ViewUtil.ErrorTip(res.ReturnCode,"提交失败")
|
||||
end
|
||||
self:Close()
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -1,187 +0,0 @@
|
|||
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,13 +83,22 @@ function M:Bind()
|
|||
end
|
||||
local _data = {}
|
||||
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在提交...")
|
||||
-- if self.ctr_update.selectedIndex == 1 then
|
||||
|
||||
-- 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)
|
||||
_data.password = password
|
||||
_data.type = 3
|
||||
|
||||
loddyctr:UpdateUserInfo(_data, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode == 0) then
|
||||
DataManager.SelfUser.password = "123"
|
||||
if self._callback then self._callback() end
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ function M:init(url)
|
|||
ViewUtil.ShowModalWait(self._root_view)
|
||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||
loddyCtr1:RequestRecordList(function(result)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -245,7 +245,7 @@ function M:InitRecord1(recordList, develop_tool)
|
|||
ShareScreenShotWithOption(function()
|
||||
result_view:Dispose()
|
||||
end)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
break
|
||||
end
|
||||
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)
|
||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if code == 0 then
|
||||
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
||||
DataManager.SelfUser.playback[playback_id][i] = data
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ local RealAddressView = {}
|
|||
|
||||
local M = RealAddressView
|
||||
|
||||
function RealAddressView.new(type, callback)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
function RealAddressView.new(type,callback)
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "RealAddressView"
|
||||
self._type = type
|
||||
self._callback = callback
|
||||
|
|
@ -17,7 +17,7 @@ function RealAddressView.new(type, callback)
|
|||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
local view = self._view
|
||||
|
||||
local btn_real = view:GetChild("btn_real")
|
||||
|
|
@ -26,7 +26,7 @@ function M:init(url)
|
|||
end)
|
||||
|
||||
local btn_address = view:GetChild("btn_address")
|
||||
btn_address.onClick:Set(function()
|
||||
btn_address.onClick:Set(function ()
|
||||
self:address_action()
|
||||
end)
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ function M:init(url)
|
|||
|
||||
local ctr_nav = view:GetController("nav")
|
||||
ctr_nav.onChanged:Set(function()
|
||||
if ctr_nav.selectedIndex == 0 then
|
||||
if ctr_nav.selectedIndex ==0 then
|
||||
self:fill_real()
|
||||
else
|
||||
local user = DataManager.SelfUser
|
||||
|
|
@ -54,34 +54,33 @@ function M:fill_real()
|
|||
local user = DataManager.SelfUser
|
||||
if user.real_info then
|
||||
self.ctr_update.selectedIndex = 1
|
||||
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_name1").text ="姓名:".. user.real_info.name
|
||||
self._view:GetChild("tex_identity1").text = "身份证号:"..ViewUtil.identity_hide(user.real_info.identity)
|
||||
else
|
||||
self.ctr_update.selectedIndex = 0
|
||||
end
|
||||
end
|
||||
|
||||
function M:SetCallBack(callback)
|
||||
self._CB = callback
|
||||
end
|
||||
|
||||
function M:real_action()
|
||||
local check, str = self:CheckInputValidity()
|
||||
local check,str = self:CheckInputValidity()
|
||||
if not check then
|
||||
ViewUtil.ShowTips(str)
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在提交认证...")
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
ViewUtil.ShowModalWait(self._root_view,"正在提交认证...")
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
local _data = {}
|
||||
_data.type = 1
|
||||
_data.type =1
|
||||
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
|
||||
_data.real_info = real_info
|
||||
loddyctr:UpdateUserInfo(_data, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if (res.ReturnCode == 0) then
|
||||
loddyctr:UpdateUserInfo(_data,function( res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode ==0) then
|
||||
DataManager.SelfUser.real_info = real_info
|
||||
if self._callback then self._callback() end
|
||||
else
|
||||
|
|
@ -111,7 +110,7 @@ function M:CheckInputValidity()
|
|||
if id then
|
||||
local l = string.len(id)
|
||||
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, "请输入正确的身份证号码"
|
||||
end
|
||||
end
|
||||
|
|
@ -120,22 +119,22 @@ end
|
|||
|
||||
function M:address_action()
|
||||
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("请输入详细地址")
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在提交...")
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
ViewUtil.ShowModalWait(self._root_view,"正在提交...")
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
local _data = {}
|
||||
_data.type = 2
|
||||
_data.type =2
|
||||
_data.address = tex_address
|
||||
loddyctr:UpdateUserInfo(_data, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if (res.ReturnCode == 0) then
|
||||
loddyctr:UpdateUserInfo(_data,function( res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode ==0) then
|
||||
DataManager.SelfUser.address = _data.address
|
||||
if self._callback then self._callback() end
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "提示失败")
|
||||
ViewUtil.ErrorTip(res.ReturnCode,"提示失败")
|
||||
end
|
||||
self:Close()
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -5,38 +5,40 @@ local WeChatView = {}
|
|||
local M = WeChatView
|
||||
|
||||
function WeChatView.new(callback)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "WeChatView"
|
||||
self._close_destroy = true
|
||||
self._close_zone = true
|
||||
self._callback = callback
|
||||
self._callback =callback
|
||||
self:init("ui://Lobby/win_user_wx")
|
||||
return self
|
||||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
|
||||
local btn_ok = self._view:GetChild("btn_ok")
|
||||
btn_ok.onClick:Set(function()
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在同步数据...")
|
||||
GameApplication.Instance:WXLogin(handler(self, self.WXCallBack))
|
||||
btn_ok.onClick:Set(function ()
|
||||
ViewUtil.ShowModalWait(self._root_view,"正在同步数据...")
|
||||
GameApplication.Instance:WXLogin(handler(self,self.WXCallBack))
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
function M:WXCallBack(result, data)
|
||||
if (not result) or result ~= 0 then
|
||||
function M:WXCallBack(result,data)
|
||||
|
||||
if (not result) or result ~= 0 then
|
||||
if result == 10 then
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
return
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
return
|
||||
end
|
||||
|
||||
if not data then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
return
|
||||
end
|
||||
local jd = json.decode(data)
|
||||
|
|
@ -46,20 +48,20 @@ function M:WXCallBack(result, data)
|
|||
if (sex == 0) then sex = 1 end
|
||||
local nickname = jd["nickname"]
|
||||
|
||||
if not unionid or string.len(unionid) < 1 then
|
||||
ViewUtil.CloseModalWait2()
|
||||
if not unionid or string.len(unionid)<1 then
|
||||
ViewUtil.CloseModalWait()
|
||||
return
|
||||
end
|
||||
local _data = {}
|
||||
_data.type = 6
|
||||
_data.type =6
|
||||
_data["acc"] = unionid
|
||||
_data["nick"] = nickname
|
||||
_data["sex"] = sex
|
||||
_data["portrait"] = headurl
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
loddyctr:UpdateUserInfo(_data, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if (res.ReturnCode == 0) then
|
||||
loddyctr:UpdateUserInfo(_data,function( res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode ==0) then
|
||||
local user = DataManager.SelfUser
|
||||
user.acc = unionid
|
||||
user.nick_name = nickname
|
||||
|
|
@ -73,4 +75,5 @@ function M:WXCallBack(result, data)
|
|||
end)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
|
@ -123,9 +123,9 @@ function M:InitView(url)
|
|||
-- local btn_more_group = self._view:GetChild("btn_family")
|
||||
-- btn_more_group.onClick:Set(function()
|
||||
-- --self.groupMainView._view.visible = true
|
||||
-- ViewUtil.ShowModalWait2(self._root_view, "请稍等,获取牌友圈中...")
|
||||
-- ViewUtil.ShowModalWait(self._root_view, "请稍等,获取牌友圈中...")
|
||||
-- local enterGroupCallBackFunc = function(code)
|
||||
-- ViewUtil.CloseModalWait2()
|
||||
-- ViewUtil.CloseModalWait()
|
||||
-- if code == 0 then
|
||||
-- self.groupMainView._view.visible = true
|
||||
-- else
|
||||
|
|
@ -172,7 +172,6 @@ function M:InitView(url)
|
|||
|
||||
local btn_invite = self._view:GetChild("btn_invite")
|
||||
btn_invite.onClick:Add(function()
|
||||
GameApplication.Instance:CopyToClipboard(DataManager.DownLink or "暂无链接")
|
||||
local _curren_msg = MsgWindow.new(self._root_view, "下载地址已复制,请到浏览器粘贴", MsgWindow.MsgMode.OnlyOk)
|
||||
_curren_msg:Show()
|
||||
end)
|
||||
|
|
@ -182,9 +181,6 @@ function M:InitView(url)
|
|||
printlog("load Callback")
|
||||
self._flag_loadImageSucces = true
|
||||
end)
|
||||
GameApplication.Instance:GetPublicIP(function(ip)
|
||||
DataManager.SelfUser.currenIp = ip
|
||||
end)
|
||||
btn_head.onClick:Set(function()
|
||||
-- local headView = HeadView.new(DataManager.SelfUser, nil, function()
|
||||
-- view:GetChild("tex_name").text = DataManager.SelfUser.nick_name
|
||||
|
|
@ -194,7 +190,7 @@ function M:InitView(url)
|
|||
local lobbyPlayerInfoView = LobbyPlayerInfoView.new(DataManager.SelfUser, function()
|
||||
ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
|
||||
end)
|
||||
-- lobbyPlayerInfoView:Show()
|
||||
lobbyPlayerInfoView:Show()
|
||||
end)
|
||||
|
||||
|
||||
|
|
@ -280,9 +276,9 @@ function M:InitView(url)
|
|||
-- local btn_more_group = self._view:GetChild("btn_more_group")
|
||||
-- btn_more_group.onClick:Set(function()
|
||||
-- --self.groupMainView._view.visible = true
|
||||
-- ViewUtil.ShowModalWait2(self._root_view,"请稍等,获取牌友圈中...")
|
||||
-- ViewUtil.ShowModalWait(self._root_view,"请稍等,获取牌友圈中...")
|
||||
-- local enterGroupCallBackFunc=function (code)
|
||||
-- ViewUtil.CloseModalWait2()
|
||||
-- ViewUtil.CloseModalWait()
|
||||
-- if code==0 then
|
||||
-- self.groupMainView._view.visible = true
|
||||
-- else
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
local PhoneLoginView = import(".PhoneLoginView2")
|
||||
local IdPasswordLoginView = import(".IdPasswordLoginView")
|
||||
local PhoneLoginView = import(".PhoneLoginView")
|
||||
LoginView = {}
|
||||
|
||||
|
||||
|
|
@ -48,13 +47,13 @@ function M:init()
|
|||
ViewUtil.ErrorTip(self._root_view, "请勾选同意《用户协议》")
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在登录游戏...")
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...")
|
||||
coroutine.start(function()
|
||||
coroutine.wait(8)
|
||||
if self.isWXCallBackMark then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(10000, "微信登录失败!")
|
||||
end)
|
||||
if (not GameApplication.Instance.accountTest) then
|
||||
|
|
@ -91,26 +90,13 @@ function M:init()
|
|||
-- end)
|
||||
|
||||
local btn_phone_code = view:GetChild("btn_phone_code")
|
||||
if btn_phone_code then
|
||||
btn_phone_code.onClick:Set(function()
|
||||
if self.agree.selectedIndex == 0 then
|
||||
ViewUtil.ErrorTip(self._root_view, "请勾选同意《用户协议》")
|
||||
return
|
||||
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
|
||||
btn_phone_code.onClick:Set(function()
|
||||
if self.agree.selectedIndex == 0 then
|
||||
ViewUtil.ErrorTip(self._root_view, "请勾选同意《用户协议》")
|
||||
return
|
||||
end
|
||||
self:PhoneCodeLogin()
|
||||
end)
|
||||
end
|
||||
|
||||
function M:Destroy()
|
||||
|
|
@ -142,7 +128,7 @@ end
|
|||
local function __join_room(roomid, res)
|
||||
local loddyctr = ControllerManager.GetController(LoddyController)
|
||||
loddyctr:JoinRoom(roomid, function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res1.ReturnCode == -2 then
|
||||
__join_room(roomid, res)
|
||||
elseif res1.ReturnCode == 0 then
|
||||
|
|
@ -156,7 +142,7 @@ local function __join_room(roomid, res)
|
|||
end
|
||||
|
||||
local function __login_response(self, response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
local skey = "session_id"
|
||||
if (response.ReturnCode == 0) then
|
||||
local user = DataManager.SelfUser
|
||||
|
|
@ -174,8 +160,8 @@ local function __login_response(self, response)
|
|||
|
||||
local roomid = user.room_id
|
||||
if (string.len(roomid) > 1) then
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在加入房间...")
|
||||
if user.group_id == 0 then
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在加入房间...")
|
||||
__join_room(roomid, response)
|
||||
return
|
||||
else
|
||||
|
|
@ -199,7 +185,6 @@ local function __login_response(self, response)
|
|||
end
|
||||
self._mesList = mesl
|
||||
DataManager.GameNotice = mesl
|
||||
DataManager.DownLink = data.share_link
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
@ -231,7 +216,7 @@ end
|
|||
|
||||
function M:PhoneCodeLogin()
|
||||
local _phoneCodeView = nil
|
||||
_phoneCodeView = PhoneLoginView.new(1, self.phone, function(res)
|
||||
_phoneCodeView = PhoneLoginView.new(1, function(res)
|
||||
if res.ReturnCode == 0 then
|
||||
_phoneCodeView:Destroy()
|
||||
end
|
||||
|
|
@ -243,7 +228,7 @@ end
|
|||
|
||||
function M:IDLogin()
|
||||
local _idView = nil
|
||||
_idView = IdPasswordLoginView.new(0, function(res)
|
||||
_idView = IDLoginView.new(function(res)
|
||||
if res.ReturnCode == 0 then
|
||||
_idView:Destroy()
|
||||
end
|
||||
|
|
@ -255,15 +240,9 @@ end
|
|||
function M:QuickLogin()
|
||||
if (not GameApplication.Instance.accountTest) then
|
||||
local session_id = PlayerPrefs.GetString("session_id")
|
||||
self.phone = PlayerPrefs.GetString("session_phone")
|
||||
-- print("session_id:" .. session_id)
|
||||
if session_id and string.len(session_id) > 3 then
|
||||
PlayerPrefs.DeleteKey('session_phone')
|
||||
PlayerPrefs.Save()
|
||||
if self.phone and #self.phone > 0 then
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在登录游戏...")
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...")
|
||||
local loginCtr = ControllerManager.GetController(LoginController)
|
||||
loginCtr:QuickLogin(session_id, function(response)
|
||||
__login_response(self, response)
|
||||
|
|
@ -279,10 +258,10 @@ function M:LoginCallBack(result, data)
|
|||
--pt(data)
|
||||
if (not result) or result ~= 0 then
|
||||
if result == 10 then
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -300,7 +279,7 @@ function M:LoginCallBack(result, data)
|
|||
DataManager.SelfUser.sex = sex
|
||||
DataManager.SelfUser.head_url = headurl
|
||||
if not DataManager.SelfUser.acc or string.len(DataManager.SelfUser.acc) < 1 then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
return
|
||||
end
|
||||
end
|
||||
|
|
@ -314,9 +293,8 @@ function M:LoginCallBack(result, data)
|
|||
end
|
||||
|
||||
--在进入前重连房间,如果有
|
||||
function M:ReconnectRoom(groupId, times)
|
||||
function M:ReconnectRoom(groupId)
|
||||
local roomId = DataManager.SelfUser.room_id
|
||||
local times = times or 0
|
||||
print("===============================ReconnectRoom", roomId, 1)
|
||||
if roomId and #roomId > 0 then
|
||||
local roomCtr = ControllerManager.GetController(RoomController)
|
||||
|
|
@ -326,24 +304,17 @@ function M:ReconnectRoom(groupId, times)
|
|||
false,
|
||||
function(response)
|
||||
if (response.ReturnCode == -1) then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, 'response.ReturnCode == -1')
|
||||
RestartGame()
|
||||
return
|
||||
end
|
||||
|
||||
if response.ReturnCode ~= 0 then
|
||||
-- if times >= 6 then
|
||||
-- ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
||||
-- FamilyView.lastId = groupId
|
||||
-- ViewManager.ChangeView(ViewManager.View_Family)
|
||||
-- return
|
||||
-- else
|
||||
self:ReconnectRoom(groupId, times + 1)
|
||||
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
||||
FamilyView.lastId = groupId
|
||||
ViewManager.ChangeView(ViewManager.View_Family)
|
||||
return
|
||||
-- end
|
||||
else
|
||||
ViewUtil.CloseModalWait2()
|
||||
UIPackage.AddPackage("base/lobby/ui/Lobby")
|
||||
FamilyView.lastId = groupId
|
||||
DataManager.SelfUser.room_id = ""
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ local SettingView = import('.SettingView')
|
|||
local PlayerDistanceView = import('.PlayerDistanceView')
|
||||
local FGAssistView = import('.FGAssistView')
|
||||
local MissileSender = import(".MissileSender")
|
||||
local SharePicture = import('.SharePicture')
|
||||
|
||||
local function GetSeat(self, uId)
|
||||
for _, player in pairs(self._room.player_list) do
|
||||
|
|
@ -410,10 +409,10 @@ function M:InitView(url, isHideIpAdds)
|
|||
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
||||
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
||||
else
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
self._gamectr:LevelRoom(
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||
else
|
||||
|
|
@ -446,10 +445,10 @@ function M:InitView(url, isHideIpAdds)
|
|||
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
||||
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
||||
else
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
self._gamectr:LevelRoom(
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||
else
|
||||
|
|
@ -470,7 +469,7 @@ function M:InitView(url, isHideIpAdds)
|
|||
if IsRoomOwer() then
|
||||
self._gamectr:AskDismissRoom(
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
ViewManager.ChangeView(ViewManager.View_Family)
|
||||
else
|
||||
|
|
@ -572,22 +571,6 @@ function M:InitView(url, isHideIpAdds)
|
|||
end
|
||||
|
||||
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
|
||||
|
||||
|
|
@ -609,10 +592,10 @@ function M:continue_game(continue)
|
|||
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
||||
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
||||
else
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
self._gamectr:LevelRoom(
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||
else
|
||||
|
|
@ -1512,13 +1495,6 @@ function M:GetPlayer(playId)
|
|||
end
|
||||
end
|
||||
|
||||
function M:ShareAndOneChoose(data)
|
||||
local sharePicture = SharePicture.new(function()
|
||||
ViewUtil.__share(data)
|
||||
end)
|
||||
sharePicture:Show()
|
||||
end
|
||||
|
||||
-- 托管时关闭一些提示窗口,如起手胡、吃碰提示、海底,由扩展实现
|
||||
function M:closeTipOnTuoguan()
|
||||
end
|
||||
|
|
@ -1577,7 +1553,7 @@ function M:Destroy()
|
|||
ControllerManager.resetJionRoom = false
|
||||
self._popEvent = false
|
||||
GRoot.inst:HidePopup()
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
GameApplication.Instance.StopMusic = 0
|
||||
coroutine.stopAll()
|
||||
UpdateBeat:Remove(self.OnUpdate, self)
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ local function __fillRoomItem(self, index, item, room)
|
|||
)
|
||||
_curren_msg.onOk:Add(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
|
||||
fgCtr:FG_RemoveRoom(
|
||||
|
|
@ -316,7 +316,7 @@ local function __fillRoomItem(self, index, item, room)
|
|||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!')
|
||||
return
|
||||
|
|
@ -930,7 +930,7 @@ function M:InitView(url)
|
|||
-- local delroomid
|
||||
-- delroomid = (texroomid.text) or 0
|
||||
-- if texroomid.text == "" then
|
||||
-- ViewUtil.CloseModalWait2()
|
||||
-- ViewUtil.CloseModalWait()
|
||||
-- ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
-- return
|
||||
-- end
|
||||
|
|
@ -943,7 +943,7 @@ function M:InitView(url)
|
|||
-- _curren_msg.onOk:Add(
|
||||
-- function()
|
||||
|
||||
-- ViewUtil.ShowModalWait2(self._root_view)
|
||||
-- ViewUtil.ShowModalWait(self._root_view)
|
||||
-- local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
-- fgCtr:FG_RemoveRoom(
|
||||
-- self.curGroup.id,
|
||||
|
|
@ -952,7 +952,7 @@ function M:InitView(url)
|
|||
-- if self._is_destroy then
|
||||
-- return
|
||||
-- end
|
||||
-- ViewUtil.CloseModalWait2()
|
||||
-- ViewUtil.CloseModalWait()
|
||||
-- if res.ReturnCode ~= 0 then
|
||||
-- ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!')
|
||||
-- return
|
||||
|
|
@ -1313,7 +1313,7 @@ function M:__onUpdate()
|
|||
end
|
||||
|
||||
function M:__joinRoom(room_id)
|
||||
ViewUtil.ShowModalWait2(self._root_view, '正在加入游戏...', 'join_room')
|
||||
ViewUtil.ShowModalWait(self._root_view, '正在加入游戏...', 'join_room')
|
||||
local roomCtr = ControllerManager.GetController(RoomController)
|
||||
local _gameCtrl = ControllerManager.GetController(GameController)
|
||||
local _currentCtrl = ControllerManager.GetCurrenController()
|
||||
|
|
@ -1327,7 +1327,7 @@ function M:__joinRoom(room_id)
|
|||
false,
|
||||
function(response)
|
||||
if (response.ReturnCode == -1) then
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
RestartGame()
|
||||
return
|
||||
end
|
||||
|
|
@ -1336,7 +1336,7 @@ function M:__joinRoom(room_id)
|
|||
self:__joinRoom(room_id)
|
||||
return
|
||||
elseif response.ReturnCode ~= 0 then
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
||||
return
|
||||
end
|
||||
|
|
@ -1346,7 +1346,7 @@ function M:__joinRoom(room_id)
|
|||
self._view.visible = false
|
||||
ImageLoad.Clear(self.class)
|
||||
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
timer = 0
|
||||
end,
|
||||
self.curGroup.id
|
||||
|
|
@ -1364,7 +1364,7 @@ function M:__joinRoom(room_id)
|
|||
printlog("进入房间返回事件==========》》》")
|
||||
pt(response)
|
||||
if (response.ReturnCode == -1) then
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
RestartGame()
|
||||
return
|
||||
end
|
||||
|
|
@ -1373,7 +1373,7 @@ function M:__joinRoom(room_id)
|
|||
self:__joinRoom(room_id)
|
||||
return
|
||||
elseif response.ReturnCode ~= 0 then
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
||||
return
|
||||
end
|
||||
|
|
@ -1383,7 +1383,7 @@ function M:__joinRoom(room_id)
|
|||
self._view.visible = false
|
||||
ImageLoad.Clear(self.class)
|
||||
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
timer = 0
|
||||
end,
|
||||
self.curGroup.id
|
||||
|
|
@ -1407,7 +1407,7 @@ function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback)
|
|||
end
|
||||
end
|
||||
if isHidden == 1 then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if not DataManager.SelfUser.location then
|
||||
DataManager.SelfUser.location = Location.new()
|
||||
end
|
||||
|
|
@ -1433,7 +1433,7 @@ function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback)
|
|||
function(response)
|
||||
if (response.ReturnCode == -1) then
|
||||
self._view:GetController('pipei').selectedIndex = 0
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
RestartGame()
|
||||
return
|
||||
end
|
||||
|
|
@ -1454,7 +1454,7 @@ function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback)
|
|||
-- ImageLoad.Clear(self.class)
|
||||
-- ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
||||
-- callback(response.ReturnCode)
|
||||
-- ViewUtil.CloseModalWait2('join_room')
|
||||
-- ViewUtil.CloseModalWait('join_room')
|
||||
-- timer = 0
|
||||
end
|
||||
end,
|
||||
|
|
@ -1473,7 +1473,7 @@ function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback)
|
|||
is_null,
|
||||
function(response)
|
||||
if (response.ReturnCode == -1) then
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
RestartGame()
|
||||
return
|
||||
end
|
||||
|
|
@ -1490,7 +1490,7 @@ function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback)
|
|||
ImageLoad.Clear(self.class)
|
||||
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
||||
callback(response.ReturnCode)
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
timer = 0
|
||||
end
|
||||
end,
|
||||
|
|
@ -1705,7 +1705,7 @@ function M:__loadGroupData()
|
|||
curGroup.update_room = false
|
||||
curGroup.update_info = false
|
||||
curGroup.update_joins = false
|
||||
ViewUtil.ShowModalWait2(self._root_view, "正在进入牌友圈,请稍等...")
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在进入牌友圈,请稍等...")
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_EnterGroup(
|
||||
curGroup.id,
|
||||
|
|
@ -1713,7 +1713,7 @@ function M:__loadGroupData()
|
|||
-- if self._is_destroy then
|
||||
-- return
|
||||
-- end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
--self._view.visible=false
|
||||
--ViewUtil.ErrorTip(res.ReturnCode, "获取圈子数据失败")
|
||||
|
|
@ -1863,7 +1863,7 @@ end
|
|||
|
||||
-- 匹配游戏
|
||||
function M:__startGame(roomid, pid, is_null, isHidden, callback)
|
||||
ViewUtil.ShowModalWait2(self._root_view, '正在加入游戏...', 'join_room')
|
||||
ViewUtil.ShowModalWait(self._root_view, '正在加入游戏...', 'join_room')
|
||||
local _gameCtrl = ControllerManager.GetController(GameController)
|
||||
local _currentCtrl = ControllerManager.GetCurrenController()
|
||||
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)
|
||||
elseif code ~= 0 then
|
||||
ViewUtil.ErrorMsg(self._root_view, code, '进入房间失败')
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
end
|
||||
if callback then
|
||||
callback()
|
||||
|
|
@ -1900,7 +1900,7 @@ function M:__startGame(roomid, pid, is_null, isHidden, callback)
|
|||
self:__startGame(roomid, pid, is_null, isHidden, callback)
|
||||
elseif code ~= 0 then
|
||||
ViewUtil.ErrorMsg(self._root_view, code, '进入房间失败')
|
||||
ViewUtil.CloseModalWait2('join_room')
|
||||
ViewUtil.CloseModalWait('join_room')
|
||||
end
|
||||
if callback then
|
||||
callback()
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ local GroupJoinsView = {}
|
|||
local M = GroupJoinsView
|
||||
|
||||
function GroupJoinsView.new(blur_view)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupJoinsView"
|
||||
self._close_destroy = true
|
||||
self._blur_view = blur_view
|
||||
|
|
@ -17,32 +17,32 @@ function GroupJoinsView.new(blur_view)
|
|||
return self
|
||||
end
|
||||
|
||||
local function __fillJoins(self, curGroup, joins)
|
||||
local function __fillJoins(self,curGroup,joins)
|
||||
local lst_joins = self._view:GetChild("lst_joins")
|
||||
lst_joins:RemoveChildrenToPool()
|
||||
local fgCtr = ControllerManager.GetController(FriendGroupController)
|
||||
|
||||
for i = 1, #joins do
|
||||
for i=1,#joins do
|
||||
local rdata = joins[i]
|
||||
local item = lst_joins:AddItemFromPool()
|
||||
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")
|
||||
btn_yes.data = rdata
|
||||
btn_yes.onClick:Set(function(context)
|
||||
local _rd = context.sender.data
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
fgCtr:FG_GroupVerifyJoin(curGroup.id, _rd.id, true, function(res1)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
fgCtr:FG_GroupVerifyJoin(curGroup.id,_rd.id,true,function(res1)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res1.ReturnCode == 0 then
|
||||
curGroup.joins = #res1.Data.joins
|
||||
self.change = true
|
||||
__fillJoins(self, curGroup, res1.Data.joins)
|
||||
__fillJoins(self,curGroup,res1.Data.joins)
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "邀请失败!")
|
||||
ViewUtil.ErrorTip(res.ReturnCode,"邀请失败!")
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
|
@ -50,18 +50,18 @@ local function __fillJoins(self, curGroup, joins)
|
|||
btn_del.data = rdata
|
||||
btn_del.onClick:Set(function(context)
|
||||
local _rd = context.sender.data
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
fgCtr:FG_GroupVerifyJoin(curGroup.id, _rd.id, false, function(res1)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
fgCtr:FG_GroupVerifyJoin(curGroup.id,_rd.id,false,function(res1)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res1.ReturnCode == 0 then
|
||||
curGroup.joins = #res1.Data.joins
|
||||
self.change = true
|
||||
__fillJoins(self, curGroup, res1.Data.joins)
|
||||
__fillJoins(self,curGroup,res1.Data.joins)
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "邀请失败!")
|
||||
ViewUtil.ErrorTip(res.ReturnCode,"邀请失败!")
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
|
@ -75,14 +75,14 @@ function M:FillData(curGroup)
|
|||
lst_joins:RemoveChildrenToPool()
|
||||
|
||||
local fgCtr = ControllerManager.GetController(FriendGroupController)
|
||||
fgCtr:FG_GroupJoins(curGroup.id, function(res)
|
||||
fgCtr:FG_GroupJoins(curGroup.id,function( res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if (res.ReturnCode == 0) then
|
||||
__fillJoins(self, curGroup, res.Data.joins)
|
||||
__fillJoins(self,curGroup,res.Data.joins)
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取邀请列表失败!")
|
||||
ViewUtil.ErrorTip(res.ReturnCode,"获取邀请列表失败!")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
@ -91,12 +91,13 @@ function M:SetCallback(callback)
|
|||
self.callback = callback
|
||||
end
|
||||
|
||||
|
||||
-- 销毁窗口
|
||||
function M:Destroy(remove_map)
|
||||
if self.change and self.callback then
|
||||
if self.change and self.callback then
|
||||
self.callback()
|
||||
end
|
||||
BaseWindow.Destroy(self, remove_map)
|
||||
BaseWindow.Destroy(self,remove_map)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -6,8 +6,8 @@ local GroupMailView = {}
|
|||
local M = GroupMailView
|
||||
|
||||
function GroupMailView.new(blur_view, curGroup)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupMailView"
|
||||
self._close_destroy = true
|
||||
self._blur_view = blur_view
|
||||
|
|
@ -20,10 +20,10 @@ function GroupMailView.new(blur_view, curGroup)
|
|||
end
|
||||
|
||||
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.itemRenderer = function(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
end
|
||||
self.lst_mail.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetMailData(#self.mail_data)
|
||||
|
|
@ -41,67 +41,66 @@ function M:FillView()
|
|||
end
|
||||
|
||||
function M:GetMailData(index)
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetMailList(self.curGroup.id, DataManager.SelfUser.account_id, index, 20, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode == 0 then
|
||||
if #res.Data.mail_list > 0 then
|
||||
list_concat(self.mail_data, res.Data.mail_list)
|
||||
self.lst_mail.numItems = #self.mail_data
|
||||
end
|
||||
else
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
if #res.Data.mail_list > 0 then
|
||||
list_concat(self.mail_data, res.Data.mail_list)
|
||||
self.lst_mail.numItems = #self.mail_data
|
||||
end
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取邮件列表失败")
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:DelAllMail()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_DelAllMail(self.curGroup.id, DataManager.SelfUser.account_id, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode == 0 then
|
||||
self.mail_data = {}
|
||||
self.lst_mail.numItems = 0
|
||||
else
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_DelAllMail(self.curGroup.id, DataManager.SelfUser.account_id, function(res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
self.mail_data = {}
|
||||
self.lst_mail.numItems = 0
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "删除邮件失败")
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:OnRenderItem(index, obj)
|
||||
local tex_title = obj:GetChild("tex_title")
|
||||
local tex_content = obj:GetChild("tex_content")
|
||||
local data = json.decode(self.mail_data[index + 1])
|
||||
ImageLoad.Load(data.headurl, obj:GetChild("btn_head")._iconObject, self.class)
|
||||
local nick = data.nick
|
||||
local id = data.mgr_id
|
||||
local hp = d2ad(data.hp)
|
||||
if data.type == 1 then
|
||||
local str_lev = data.lev == 3 and "合伙人" or "管理员"
|
||||
local act = hp >= 0 and "给您增加了" or "扣除了您"
|
||||
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))
|
||||
else
|
||||
tex_title.text = "消息内容为:" --string.format("%s(%s) 转账给您%s积分", nick, id, math.abs(hp))
|
||||
tex_content.text = string.format("[color=#08a446]%s[/color](%s) 转账给您[color=#08a446] %s [/color]积分", nick, id,
|
||||
math.abs(hp))
|
||||
end
|
||||
obj:GetChild("tex_data").text = os.date("%Y-%m-%d %H:%M", data.time)
|
||||
local tex_title = obj:GetChild("tex_title")
|
||||
local tex_content = obj:GetChild("tex_content")
|
||||
local data = json.decode(self.mail_data[index + 1])
|
||||
ImageLoad.Load(data.headurl, obj:GetChild("btn_head")._iconObject, self.class)
|
||||
local nick = data.nick
|
||||
local id = data.mgr_id
|
||||
local hp = d2ad(data.hp)
|
||||
if data.type == 1 then
|
||||
local str_lev = data.lev == 3 and "合伙人" or "管理员"
|
||||
local act = hp >= 0 and "给您增加了" or "扣除了您"
|
||||
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))
|
||||
else
|
||||
tex_title.text = "消息内容为:"--string.format("%s(%s) 转账给您%s积分", nick, id, math.abs(hp))
|
||||
tex_content.text = string.format("[color=#08a446]%s[/color](%s) 转账给您[color=#08a446] %s [/color]积分", nick, id, math.abs(hp))
|
||||
end
|
||||
obj:GetChild("tex_data").text = os.date("%Y-%m-%d %H:%M", data.time)
|
||||
end
|
||||
|
||||
function M:SetCallback(callback)
|
||||
self.callback = callback
|
||||
end
|
||||
|
||||
|
||||
-- 销毁窗口
|
||||
function M:Destroy(remove_map)
|
||||
if self.callback then
|
||||
self.callback()
|
||||
end
|
||||
BaseWindow.Destroy(self, remove_map)
|
||||
BaseWindow.Destroy(self,remove_map)
|
||||
ImageLoad.Clear(self.class)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ function M:InitView(url)
|
|||
local cgv = CreateGroupView.new(self._root_view)
|
||||
cgv:Show()
|
||||
cgv:SetCallback(function(name, pay_type, fg_type)
|
||||
ViewUtil.ShowModalWait2(cgv._root_view)
|
||||
ViewUtil.ShowModalWait(cgv._root_view)
|
||||
fgCtr:FG_CreateGroup(name, pay_type, fg_type, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -93,9 +93,9 @@ function M:InitView(url)
|
|||
|
||||
local btn_refresh = self._view:GetChild('btn_refresh')
|
||||
btn_refresh.onClick:Set(function()
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
fgCtr:FG_GroupList(function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -239,9 +239,9 @@ function M:FillData()
|
|||
btn_top.onClick:Set(function(context)
|
||||
context:StopPropagation()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
fgCtr:FG_TopGroup(group.id, ctr_select.selectedIndex == 0, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,48 +8,49 @@ local GroupMngFagPackView = {}
|
|||
|
||||
local M = GroupMngFagPackView
|
||||
|
||||
function GroupMngFagPackView.new(gid, blur_view, ctrNum, uid)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
function GroupMngFagPackView.new(gid, blur_view,ctrNum,uid)
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
|
||||
self.class = "GroupMngFagPackView"
|
||||
self._close_destroy = true
|
||||
self.group_id = gid
|
||||
self.blur_view = blur_view
|
||||
self.ctrNum = ctrNum
|
||||
self.class = "GroupMngFagPackView"
|
||||
self._close_destroy = true
|
||||
self.group_id = gid
|
||||
self.blur_view = blur_view
|
||||
self.ctrNum=ctrNum
|
||||
self.shouyiData = {}
|
||||
self.uid = uid
|
||||
self:init("ui://NewGroup/Win_bxx")
|
||||
self:FillView()
|
||||
return self
|
||||
self:init("ui://NewGroup/Win_bxx")
|
||||
self:FillView()
|
||||
return self
|
||||
end
|
||||
|
||||
function M:FillView()
|
||||
self.Ctr = self._view:GetController("ctr")
|
||||
self.Ctr.selectedIndex = 1
|
||||
|
||||
self.Ctr=self._view:GetController("ctr")
|
||||
self.Ctr.selectedIndex=1
|
||||
|
||||
self.lst_bxx = self._view:GetChild('bxx_list')
|
||||
self.lst_bxx:SetVirtual()
|
||||
self.lst_bxx.itemRenderer = function(index, item)
|
||||
self:fillGameItem(index, item)
|
||||
end
|
||||
self.lst_bxx:SetVirtual()
|
||||
self.lst_bxx.itemRenderer = function(index, item)
|
||||
self:fillGameItem(index, item)
|
||||
end
|
||||
|
||||
|
||||
self.lst_bxx.onClickItem:Add(
|
||||
function(pas)
|
||||
if self.currentSelectItem == pas.data then return end
|
||||
local name = pas.data.icon
|
||||
self.currentGameItemName = name
|
||||
self.lst_bxx.numItems = self.ctrNum
|
||||
end
|
||||
)
|
||||
function(pas)
|
||||
if self.currentSelectItem == pas.data then return end
|
||||
local name=pas.data.icon
|
||||
self.currentGameItemName=name
|
||||
self.lst_bxx.numItems=self.ctrNum
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
self.playerJF = self._view:GetChild('tex_player')
|
||||
self.bankJF = self._view:GetChild('tex_bank')
|
||||
self.playerJF=self._view:GetChild('tex_player')
|
||||
self.bankJF=self._view:GetChild('tex_bank')
|
||||
|
||||
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.shouyiData.day_rewad then
|
||||
self._view:GetChild("tex_total").text = d2ad(self.shouyiData.day_rewad)
|
||||
|
|
@ -63,195 +64,228 @@ function M:FillView()
|
|||
self._view:GetChild("tex_total").text = d2ad(self.shouyiData.day_rewad_2)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
self._view:GetChild("btn_bankinfo").onClick:Set(function()
|
||||
local gtlv = GroupBankLogView.new(self.blur_view, self.group_id, self.uid)
|
||||
gtlv:Show()
|
||||
end)
|
||||
local gtlv = GroupBankLogView.new(self.blur_view, self.group_id,self.uid)
|
||||
gtlv:Show()
|
||||
end)
|
||||
|
||||
local btn_cr = self._view:GetChild('btn_qd')
|
||||
btn_cr.onClick:Set(
|
||||
function()
|
||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||
local value = limit
|
||||
if otype == 1 then
|
||||
value = value + ad2d(num)
|
||||
elseif otype == -1 then
|
||||
value = value - ad2d(num)
|
||||
else
|
||||
value = ad2d(num)
|
||||
end
|
||||
local btn_cr = self._view:GetChild('btn_qd')
|
||||
btn_cr.onClick:Set(
|
||||
function()
|
||||
|
||||
if value < 0 then
|
||||
ViewUtil.ErrorTip(1, "输入数据异常!")
|
||||
end
|
||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||
|
||||
ViewUtil.ShowModalWait2()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_SAVEBankInfo(self.group_id, value, self.uid, function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
pt(res1)
|
||||
if (res1.ReturnCode == 0) then
|
||||
self:SetBank(res1.Data.hp, res1.Data.b_hp)
|
||||
ViewUtil.ErrorTip(100011000, "积分存取成功!")
|
||||
else
|
||||
ViewUtil.ErrorTip(res1.ReturnCode, "存取积分失败!")
|
||||
end
|
||||
end)
|
||||
end, 0, nil)
|
||||
gniv:Show()
|
||||
end
|
||||
)
|
||||
local value = limit
|
||||
if otype == 1 then
|
||||
value = value + ad2d(num)
|
||||
elseif otype == - 1 then
|
||||
value = value - ad2d(num)
|
||||
else
|
||||
value = ad2d(num)
|
||||
end
|
||||
|
||||
if value < 0 then
|
||||
ViewUtil.ErrorTip(1,"输入数据异常!")
|
||||
end
|
||||
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_SAVEBankInfo(self.group_id, value,self.uid ,function(res1)
|
||||
ViewUtil.CloseModalWait()
|
||||
pt(res1)
|
||||
if (res1.ReturnCode == 0) then
|
||||
self:SetBank(res1.Data.hp,res1.Data.b_hp)
|
||||
ViewUtil.ErrorTip(100011000,"积分存取成功!")
|
||||
else
|
||||
ViewUtil.ErrorTip(res1.ReturnCode,"存取积分失败!")
|
||||
end
|
||||
end)
|
||||
|
||||
end, 0, nil)
|
||||
gniv:Show()
|
||||
|
||||
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
local btn_qc = self._view:GetChild('btn_qc')
|
||||
btn_qc.onClick:Set(
|
||||
function()
|
||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||
local value = limit
|
||||
if otype == 1 then
|
||||
value = value + ad2d(num)
|
||||
elseif otype == -1 then
|
||||
value = value - ad2d(num)
|
||||
else
|
||||
value = ad2d(num)
|
||||
end
|
||||
btn_qc.onClick:Set(
|
||||
function()
|
||||
|
||||
if value < 0 then
|
||||
ViewUtil.ErrorTip(1, "输入数据异常!")
|
||||
end
|
||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||
|
||||
ViewUtil.ShowModalWait2()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_TakeBankInfo(self.group_id, value, self.uid, function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
pt(res1)
|
||||
if (res1.ReturnCode == 0) then
|
||||
self:SetBank(res1.Data.hp, res1.Data.b_hp)
|
||||
ViewUtil.ErrorTip(100011000, "积分取出成功!")
|
||||
else
|
||||
ViewUtil.ErrorTip(res1.ReturnCode, "获取积分失败!")
|
||||
end
|
||||
end)
|
||||
end, 0, nil)
|
||||
gniv:Show()
|
||||
end
|
||||
)
|
||||
local value = limit
|
||||
if otype == 1 then
|
||||
value = value + ad2d(num)
|
||||
elseif otype == - 1 then
|
||||
value = value - ad2d(num)
|
||||
else
|
||||
value = ad2d(num)
|
||||
end
|
||||
|
||||
if value < 0 then
|
||||
ViewUtil.ErrorTip(1,"输入数据异常!")
|
||||
end
|
||||
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_TakeBankInfo(self.group_id, value,self.uid, function(res1)
|
||||
ViewUtil.CloseModalWait()
|
||||
pt(res1)
|
||||
if (res1.ReturnCode == 0) then
|
||||
self:SetBank(res1.Data.hp,res1.Data.b_hp)
|
||||
ViewUtil.ErrorTip(100011000,"积分取出成功!")
|
||||
else
|
||||
ViewUtil.ErrorTip(res1.ReturnCode,"获取积分失败!")
|
||||
end
|
||||
end)
|
||||
|
||||
end, 0, nil)
|
||||
gniv:Show()
|
||||
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
---------------------------
|
||||
self._view:GetChild("btn_take_log").onClick:Set(function()
|
||||
local gtlv = GroupTakeLogView.new(self.blur_view, self.group_id, self.uid)
|
||||
gtlv:Show()
|
||||
end)
|
||||
self._view:GetChild("btn_hp_info").onClick:Set(function()
|
||||
local grlv = GroupRewardsLogView.new(self.blur_view, self.group_id, self.uid)
|
||||
grlv:Show()
|
||||
end)
|
||||
self._view:GetChild("btn_take").onClick:Set(function()
|
||||
local gniv = GroupNumberInputView.new(self.blur_view, function(num)
|
||||
self._view:GetChild("btn_take_log").onClick:Set(function()
|
||||
local gtlv = GroupTakeLogView.new(self.blur_view, self.group_id,self.uid)
|
||||
gtlv:Show()
|
||||
end)
|
||||
self._view:GetChild("btn_hp_info").onClick:Set(function()
|
||||
local grlv = GroupRewardsLogView.new(self.blur_view, self.group_id,self.uid)
|
||||
grlv:Show()
|
||||
end)
|
||||
self._view:GetChild("btn_take").onClick:Set(function()
|
||||
local gniv = GroupNumberInputView.new(self.blur_view, function(num)
|
||||
if ad2d(num) > self._total_hp then
|
||||
ViewUtil.ErrorTip(nil, "奖励池积分不足")
|
||||
return
|
||||
end
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_TakeHp(self.group_id, ad2d(num), self.uid, function(res)
|
||||
if num == 0 then
|
||||
ViewUtil.ErrorTip(nil, "提取值必须大于0")
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "提取能量包失败")
|
||||
else
|
||||
self._total_hp = res.Data.r_hp
|
||||
self._view:GetChild("tex_left").text = d2ad(self._total_hp)
|
||||
end
|
||||
end)
|
||||
end, 1, d2ad(self._total_hp), "ui://NewGroup/Win_TakeHp")
|
||||
gniv:Show()
|
||||
end)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_TakeHp(self.group_id, ad2d(num), self.uid,function(res)
|
||||
if num == 0 then
|
||||
ViewUtil.ErrorTip(nil, "提取值必须大于0")
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "提取能量包失败")
|
||||
else
|
||||
self._total_hp = res.Data.r_hp
|
||||
self._view:GetChild("tex_left").text = d2ad(self._total_hp)
|
||||
end
|
||||
end)
|
||||
end, 1, d2ad(self._total_hp), "ui://NewGroup/Win_TakeHp")
|
||||
gniv:Show()
|
||||
end)
|
||||
|
||||
--self:initBankData()
|
||||
--self:initBankData()
|
||||
self:initShouyiData()
|
||||
self.lst_bxx.numItems = self.ctrNum
|
||||
self.lst_bxx.numItems=self.ctrNum
|
||||
end
|
||||
|
||||
|
||||
|
||||
function M:initBankData()
|
||||
ViewUtil.ShowModalWait2()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetBankInfo(self.group_id, self.uid, function(res)
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetBankInfo(self.group_id, self.uid,function(res)
|
||||
pt(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取银行数据失败")
|
||||
else
|
||||
self:SetBank(res.Data.total_hp, res.Data.bank_hp)
|
||||
self.Ctr.selectedIndex = 0
|
||||
self:SetBank(res.Data.total_hp,res.Data.bank_hp)
|
||||
self.Ctr.selectedIndex=0
|
||||
|
||||
end
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
function M:initShouyiData()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
self.shouyiData = {}
|
||||
self._view:GetChild("tex_total").text = 0
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetTakeInfo(self.group_id, self.uid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取保险箱数据失败")
|
||||
else
|
||||
local data = res.Data
|
||||
fgCtr:FG_GetTakeInfo(self.group_id,self.uid ,function(res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取保险箱数据失败")
|
||||
else
|
||||
local data = res.Data
|
||||
self.ctr_page.selectedIndex = 0
|
||||
self.shouyiData = data
|
||||
self._view:GetChild("tex_left").text = d2ad(data.total_hp)
|
||||
self._view:GetChild("tex_total").text = d2ad(data.day_rewad)
|
||||
--self._view:GetChild("tex_totalshouyi").text = 0
|
||||
self._total_hp = data.total_hp
|
||||
self.Ctr.selectedIndex = 1
|
||||
self.Ctr.selectedIndex=1
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:SetCallback(callback)
|
||||
self.callback = callback
|
||||
self.callback = callback
|
||||
end
|
||||
|
||||
function M:SetBank(totalHp, bankHp)
|
||||
self.playerJF.text = totalHp / 1000
|
||||
self.bankJF.text = bankHp / 1000
|
||||
|
||||
function M:SetBank(totalHp,bankHp)
|
||||
self.playerJF.text=totalHp/1000
|
||||
self.bankJF.text=bankHp/1000
|
||||
end
|
||||
|
||||
|
||||
|
||||
function M:fillGameItem(index, item)
|
||||
if index ~= 0 then
|
||||
item.icon = "ui://NewGroup/button_cqg"
|
||||
if self.currentGameItemName == nil then
|
||||
item.icon = "ui://NewGroup/button_cqg_xz"
|
||||
if index~=0 then
|
||||
item.icon="ui://NewGroup/button_cqg"
|
||||
if self.currentGameItemName==nil then
|
||||
item.icon="ui://NewGroup/button_cqg_xz"
|
||||
end
|
||||
else
|
||||
item.icon = "ui://NewGroup/button_sjjl"
|
||||
item.icon="ui://NewGroup/button_sjjl"
|
||||
end
|
||||
|
||||
|
||||
|
||||
if self.currentGameItemName == item.icon then
|
||||
item.icon = item.icon .. "_xz"
|
||||
if index ~= 0 then
|
||||
if self.currentGameItemName==item.icon then
|
||||
item.icon=item.icon.."_xz"
|
||||
if index~=0 then
|
||||
self:initBankData()
|
||||
else
|
||||
self:initShouyiData()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- 销毁窗口
|
||||
function M:Destroy(remove_map)
|
||||
if self.callback then
|
||||
self.callback()
|
||||
end
|
||||
BaseWindow.Destroy(self, remove_map)
|
||||
ImageLoad.Clear(self.class)
|
||||
if self.callback then
|
||||
self.callback()
|
||||
end
|
||||
BaseWindow.Destroy(self,remove_map)
|
||||
ImageLoad.Clear(self.class)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -63,7 +63,7 @@ function M:FillView()
|
|||
ctr_ua.selectedIndex = bit:_and(option, 8) > 0 and 1 or 0
|
||||
|
||||
self._view:GetChild("btn_ok").onClick:Set(function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local data = {}
|
||||
data.id = self.group_id
|
||||
data.name = tex_name.text
|
||||
|
|
@ -104,7 +104,7 @@ function M:FillView()
|
|||
end
|
||||
|
||||
fgCtr:FG_UpdateGroupInfo(data, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置大联盟失败。")
|
||||
else
|
||||
|
|
|
|||
|
|
@ -6,8 +6,9 @@ local GroupRecordView = {}
|
|||
local M = GroupRecordView
|
||||
|
||||
function GroupRecordView.new(curGroup, qid, includeMembers, begin_time, end_time, time_type)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupRecordView"
|
||||
self._close_destroy = true
|
||||
self.curGroup = curGroup
|
||||
|
|
@ -21,7 +22,7 @@ function GroupRecordView.new(curGroup, qid, includeMembers, begin_time, end_time
|
|||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
|
||||
self.record_data = {} --回放数据
|
||||
|
||||
|
|
@ -43,33 +44,35 @@ function M:OnRenderRecordItem(index, obj)
|
|||
end
|
||||
|
||||
function M:GetRecordData(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
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)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
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
|
||||
ViewUtil.ShowModalWait()
|
||||
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)
|
||||
|
||||
if self._is_destroy then
|
||||
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
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:FillRecordItem(data, obj)
|
||||
|
||||
local game_id = data.game_id
|
||||
local room_id = data.room_id
|
||||
local create_time = data.create_time
|
||||
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 totalScore = json.decode(data.totalScore)
|
||||
local hpOnOff = data.hpOnOff
|
||||
|
|
@ -91,15 +94,15 @@ function M:FillRecordItem(data, obj)
|
|||
|
||||
obj:GetChild("tex_time").text = room_time_str
|
||||
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
|
||||
local lst_total = obj:GetChild("lst_total")
|
||||
lst_total:RemoveChildrenToPool()
|
||||
for j = 1, #totalScore do
|
||||
for j=1,#totalScore do
|
||||
local titem = lst_total:AddItemFromPool()
|
||||
local trdata = totalScore[j]
|
||||
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
|
||||
if trdata.hp == nil then
|
||||
if hpOnOff == 1 and hpType > 1 then
|
||||
|
|
@ -137,7 +140,7 @@ function M:FillRecordItem(data, obj)
|
|||
end
|
||||
|
||||
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")
|
||||
local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView")
|
||||
result_view.visible = false
|
||||
|
|
@ -160,14 +163,14 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
|||
item:GetChild("score").text = score
|
||||
if score < 0 then item:GetController("di").selectedIndex = 1 end
|
||||
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
|
||||
end)
|
||||
else
|
||||
load_head_num = load_head_num - 1
|
||||
end
|
||||
end
|
||||
coroutine.start(function(...)
|
||||
coroutine.start(function ( ... )
|
||||
local left_time = 4
|
||||
while (true) do
|
||||
if load_head_num == 0 or left_time == 0 then
|
||||
|
|
@ -176,7 +179,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
|||
ShareScreenShotWithOption(function()
|
||||
result_view:Dispose()
|
||||
end)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
break
|
||||
end
|
||||
coroutine.wait(1)
|
||||
|
|
@ -198,21 +201,21 @@ function M:OnShowRecordInfo(rdata)
|
|||
local hpOnOff = rdata.hpOnOff
|
||||
local hpType = rdata.game_info.hpType
|
||||
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()
|
||||
item:GetChild("tex_num").text = tostring(i)
|
||||
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
|
||||
local round_score_str = rdata["round_" .. i]
|
||||
local round_score_str = rdata["round_"..i]
|
||||
local round_score_item = json.decode(round_score_str)
|
||||
local lst_total = item:GetChild("lst_total")
|
||||
lst_total:RemoveChildrenToPool()
|
||||
for k = 1, #round_score_item do
|
||||
for k=1,#round_score_item do
|
||||
local titem = lst_total:AddItemFromPool()
|
||||
local trdata = round_score_item[k]
|
||||
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
|
||||
if trdata.hp == nil then
|
||||
if hpOnOff == 1 and hpType > 1 then
|
||||
|
|
@ -231,11 +234,11 @@ function M:OnShowRecordInfo(rdata)
|
|||
item:GetController("person_num").selectedIndex = 0
|
||||
end
|
||||
|
||||
local btn_play = item:GetChild("btn_play")
|
||||
local btn_play =item:GetChild("btn_play")
|
||||
btn_play.onClick:Set(function()
|
||||
local group = DataManager.groups:get(self.curGroup)
|
||||
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
|
||||
room.lev = group.lev
|
||||
room.game_id = game_id
|
||||
|
|
@ -250,13 +253,13 @@ function M:OnShowRecordInfo(rdata)
|
|||
main._totalRound = tonumber(rdata.round)
|
||||
main:FillRoomData(DataManager.SelfUser.playback[playback_id][i])
|
||||
else
|
||||
ViewUtil.ShowModalWait2(self._view)
|
||||
ViewUtil.ShowModalWait(self._view)
|
||||
local _data = {}
|
||||
_data["military_id"] = playback_id
|
||||
_data["round"] = tostring(i)
|
||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||
ViewUtil.CloseModalWait2()
|
||||
loddyCtr1:RequestPlayBack(_data,function(code,data)
|
||||
ViewUtil.CloseModalWait()
|
||||
if code == 0 then
|
||||
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
||||
DataManager.SelfUser.playback[playback_id][i] = data
|
||||
|
|
@ -282,8 +285,9 @@ function M:OnShowRecordInfo(rdata)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
function M:GenaratePlayBack(id, game_id, ...)
|
||||
local tem = nil
|
||||
local tem =nil
|
||||
local dview_class = nil
|
||||
if not dview_class then
|
||||
local exconfig = ExtendManager.GetExtendConfig(game_id)
|
||||
|
|
@ -292,11 +296,12 @@ function M:GenaratePlayBack(id, game_id, ...)
|
|||
if not dview_class then
|
||||
return
|
||||
end
|
||||
local arg = { ... }
|
||||
local arg = {...}
|
||||
tem = dview_class.new(...)
|
||||
tem.Id = id
|
||||
tem:Show()
|
||||
return tem
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
|
@ -7,8 +7,8 @@ local GroupNumberInputView = import(".MngView.GroupNumberInputView")
|
|||
local M = GroupRemitView
|
||||
|
||||
function GroupRemitView.new(blur_view, curGroup)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupRemitView"
|
||||
self._close_destroy = true
|
||||
self._blur_view = blur_view
|
||||
|
|
@ -49,9 +49,9 @@ function M:FillView()
|
|||
ViewUtil.ErrorTip(nil, "请输入玩家ID")
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
fgCtr:FG_RemitFindMember(self.curGroup.id, remite_id, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -76,7 +76,7 @@ function M:FillView()
|
|||
local btn_ok = self._view:GetChild("btn_ok")
|
||||
btn_ok.onClick:Set(function()
|
||||
local msgbox = MsgWindow.new(self._root_view, "确定要转让积分吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||
msgbox.onOk:Add(function(...)
|
||||
msgbox.onOk:Add(function( ... )
|
||||
if not remite_id then
|
||||
ViewUtil.ErrorTip(nil, "请输入玩家ID")
|
||||
return
|
||||
|
|
@ -89,9 +89,9 @@ function M:FillView()
|
|||
ViewUtil.ErrorTip(nil, "请输入转让数量")
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
fgCtr:FG_FagRemit(self.curGroup.id, remite_id, ad2d(remite_num), function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -112,12 +112,13 @@ function M:SetCallback(callback)
|
|||
self.callback = callback
|
||||
end
|
||||
|
||||
|
||||
-- 销毁窗口
|
||||
function M:Destroy(remove_map)
|
||||
if self.change and self.callback then
|
||||
if self.change and self.callback then
|
||||
self.callback()
|
||||
end
|
||||
BaseWindow.Destroy(self, remove_map)
|
||||
BaseWindow.Destroy(self,remove_map)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -3,45 +3,45 @@ local GroupSetDefaultGameView = {}
|
|||
|
||||
local M = GroupSetDefaultGameView
|
||||
|
||||
function GroupSetDefaultGameView.new(gid, blur_view, callback)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
self.class = "GroupSetDefaultGameView"
|
||||
self._close_destroy = true
|
||||
function GroupSetDefaultGameView.new(gid,blur_view,callback)
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupSetDefaultGameView"
|
||||
self._close_destroy = true
|
||||
self.group_id = gid
|
||||
self._blur_view = blur_view
|
||||
self._callback = callback
|
||||
local url = "ui://NewGroup/Win_SetDefaultGame"
|
||||
self:init(url)
|
||||
return self
|
||||
self._blur_view = blur_view
|
||||
self._callback = callback
|
||||
local url = "ui://NewGroup/Win_SetDefaultGame"
|
||||
self:init(url)
|
||||
return self
|
||||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
end
|
||||
|
||||
function M:FillData(list, index, callbackFill)
|
||||
self.callbackFill = callbackFill
|
||||
self._index = index
|
||||
local lst_game = self._view:GetChild("lst_game")
|
||||
lst_game:RemoveChildrenToPool()
|
||||
function M:FillData(list, index,callbackFill)
|
||||
self.callbackFill=callbackFill
|
||||
self._index = index
|
||||
local lst_game = self._view:GetChild("lst_game")
|
||||
lst_game:RemoveChildrenToPool()
|
||||
|
||||
local playName = "playfaconfig" .. self.group_id
|
||||
local playName="playfaconfig"..self.group_id
|
||||
local json_data = Utils.LoadLocalFile(playName)
|
||||
local localDataPlay = nil
|
||||
if json_data then
|
||||
local localDataPlay=nil
|
||||
if json_data then
|
||||
localDataPlay = json.decode(json_data)
|
||||
end
|
||||
|
||||
|
||||
for i = 1, #list do
|
||||
local tem = list[i]
|
||||
local item = lst_game:AddItemFromPool()
|
||||
item.title = tem.name
|
||||
item.selected = index == i
|
||||
for i = 1, #list do
|
||||
local tem = list[i]
|
||||
local item = lst_game:AddItemFromPool()
|
||||
item.title = tem.name
|
||||
item.selected = index == i
|
||||
|
||||
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
|
||||
-- MarkSelect.visible=true
|
||||
|
|
@ -49,34 +49,46 @@ function M:FillData(list, index, callbackFill)
|
|||
-- MarkSelect.visible=false
|
||||
--end
|
||||
|
||||
MarkSelect.visible = true
|
||||
if localDataPlay and localDataPlay[tostring(tem.id)] then
|
||||
MarkSelect.selected = localDataPlay[tostring(tem.id)]
|
||||
MarkSelect.visible=true
|
||||
if localDataPlay and localDataPlay[tostring(tem.id)] then
|
||||
MarkSelect.selected=localDataPlay[tostring(tem.id)]
|
||||
else
|
||||
MarkSelect.selected = false
|
||||
MarkSelect.selected=false
|
||||
end
|
||||
|
||||
MarkSelect.onClick:Set(function()
|
||||
self:MarkPlay(MarkSelect, tem.id, MarkSelect.selected)
|
||||
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
|
||||
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
|
||||
|
||||
function M:MarkPlay(markS, pid, isMark)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function M:MarkPlay(markS,pid,isMark)
|
||||
--[[local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_MarkPlay(self.group_id, pid, isMark, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
group:markPlay(pid, isMark)
|
||||
|
|
@ -89,21 +101,26 @@ function M:MarkPlay(markS, pid, isMark)
|
|||
end
|
||||
end)--]]
|
||||
|
||||
if DataManager.SelfUser.PlayLocalList == nil then
|
||||
DataManager.SelfUser.PlayLocalList = {}
|
||||
if DataManager.SelfUser.PlayLocalList==nil then
|
||||
DataManager.SelfUser.PlayLocalList={}
|
||||
end
|
||||
|
||||
DataManager.SelfUser.PlayLocalList[tostring(pid)] = isMark
|
||||
DataManager.SelfUser.PlayLocalList[tostring(pid)]=isMark
|
||||
--printlog("111111111122222222222223333333333333")
|
||||
--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
|
||||
self.callbackFill()
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
return M
|
||||
|
|
@ -32,7 +32,7 @@ function M:init(url, member)
|
|||
]]
|
||||
|
||||
self._view:GetChild("btn_ok").onClick:Set(function()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
--local score = tonumber(tex_tag.text) or 0
|
||||
local score = tex_tag.text
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
|
|
@ -40,7 +40,7 @@ function M:init(url, member)
|
|||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "备注失败")
|
||||
else
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ local GroupSettingView = {}
|
|||
local M = GroupSettingView
|
||||
|
||||
function GroupSettingView.new(blur_view)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupSettingView"
|
||||
self._close_destroy = true
|
||||
self._blur_view = blur_view
|
||||
|
|
@ -18,46 +18,48 @@ function GroupSettingView.new(blur_view)
|
|||
return self
|
||||
end
|
||||
|
||||
local function __removeGroup(self, msg, curData)
|
||||
|
||||
local function __removeGroup(self,msg,curData)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
local _curren_msg = MsgWindow.new(self._root_view, msg, MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(function()
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
local func = curData.owner == DataManager.SelfUser.account_id and fgCtr.FG_RemoveGroup or fgCtr.FG_ExitGroup
|
||||
func(fgCtr, curData.id, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
self.change = true
|
||||
local groups = DataManager.groups.groupList
|
||||
if #groups > 0 then
|
||||
self:FillData()
|
||||
self:FillData()
|
||||
else
|
||||
self:Destroy()
|
||||
self:Destroy()
|
||||
end
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "删除大联盟失败!")
|
||||
ViewUtil.ErrorTip(res.ReturnCode,"删除大联盟失败!")
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
_curren_msg:Show()
|
||||
|
||||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
local lst_group = self._view:GetChild("lst_group")
|
||||
|
||||
local btn_remove = self._view:GetChild("btn_remove")
|
||||
btn_remove.onClick:Set(function()
|
||||
local group = lst_group:GetChildAt(lst_group.selectedIndex).data
|
||||
__removeGroup(self, "您确定解散该大联盟吗?", group)
|
||||
__removeGroup(self,"您确定解散该大联盟吗?",group)
|
||||
end)
|
||||
local btn_exit = self._view:GetChild("btn_exit")
|
||||
btn_exit.onClick:Set(function()
|
||||
local group = lst_group:GetChildAt(lst_group.selectedIndex).data
|
||||
__removeGroup(self, "您确定退出该大联盟吗?", group)
|
||||
__removeGroup(self,"您确定退出该大联盟吗?",group)
|
||||
end)
|
||||
lst_group.onClickItem:Add(function(context)
|
||||
local group = context.data.data
|
||||
|
|
@ -66,29 +68,31 @@ function M:init(url)
|
|||
self._view:GetController("opt").selectedIndex = 2
|
||||
else
|
||||
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
|
||||
|
||||
else
|
||||
self._view:GetController("opt").selectedIndex = 0
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
function M:FillData()
|
||||
local groups = DataManager.groups.groupList
|
||||
local lst_group = self._view:GetChild("lst_group")
|
||||
local lst_group = self._view:GetChild("lst_group")
|
||||
lst_group:RemoveChildrenToPool()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
|
||||
for i = 1, #groups do
|
||||
local group = groups[i]
|
||||
local item = lst_group:AddItemFromPool()
|
||||
item:GetChild("tex_name").emojies = EmojiDitc.EmojiesDitc
|
||||
item:GetChild("tex_name").text = Utils.TextOmit(group.name, 6, "...")
|
||||
item:GetChild("tex_id").text = group.id
|
||||
item:GetChild("tex_nick").text = "创建人:" .. group.o_nick
|
||||
item.data = group
|
||||
for i = 1, #groups do
|
||||
local group = groups[i]
|
||||
local item = lst_group:AddItemFromPool()
|
||||
item:GetChild("tex_name").emojies = EmojiDitc.EmojiesDitc
|
||||
item:GetChild("tex_name").text = Utils.TextOmit(group.name, 6, "...")
|
||||
item:GetChild("tex_id").text = group.id
|
||||
item:GetChild("tex_nick").text ="创建人:" .. group.o_nick
|
||||
item.data = group
|
||||
end
|
||||
|
||||
if #groups > 0 and lst_group.selectedIndex == -1 then
|
||||
|
|
@ -98,28 +102,32 @@ function M:FillData()
|
|||
self._view:GetController("opt").selectedIndex = 2
|
||||
else
|
||||
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
|
||||
else
|
||||
self._view:GetController("opt").selectedIndex = 0
|
||||
self._view:GetController("opt").selectedIndex = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
if #groups == 0 then
|
||||
self._view:GetController("opt").selectedIndex = 0
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function M:SetCallback(callback)
|
||||
self.callback = callback
|
||||
end
|
||||
|
||||
|
||||
-- 销毁窗口
|
||||
function M:Destroy(remove_map)
|
||||
if self.change and self.callback then
|
||||
if self.change and self.callback then
|
||||
self.callback()
|
||||
end
|
||||
BaseWindow.Destroy(self, remove_map)
|
||||
BaseWindow.Destroy(self,remove_map)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
|
@ -9,8 +9,8 @@ local KEY_DEL = "del"
|
|||
local KEY_CLEAR = "c"
|
||||
|
||||
function JoinGroupView.new(blur_view)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "JoinGroupView"
|
||||
self._currenIndex = 0
|
||||
self._close_destroy = true
|
||||
|
|
@ -20,28 +20,28 @@ function JoinGroupView.new(blur_view)
|
|||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
|
||||
self.tex_num = self._view:GetChild("tex_num")
|
||||
self:ClearNumTex()
|
||||
|
||||
local cnt = self._view.numChildren - 1
|
||||
|
||||
for i = 0, 9 do
|
||||
local obj = self._view:GetChild("btn_" .. i)
|
||||
obj.onClick:Add(handler(self, self.OnNumButtonAction))
|
||||
for i = 0 , 9 do
|
||||
local obj = self._view:GetChild("btn_"..i)
|
||||
obj.onClick:Add(handler(self , self.OnNumButtonAction))
|
||||
i = i + 1
|
||||
end
|
||||
local btn_ok = self._view:GetChild("btn_ok")
|
||||
btn_ok.onClick:Set(function()
|
||||
if self._currenIndex < 6 then
|
||||
ViewUtil.ErrorTip(-12, "您输入的大联盟ID少于六位!")
|
||||
if self._currenIndex <6 then
|
||||
ViewUtil.ErrorTip(-12,"您输入的大联盟ID少于六位!")
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_JoinGroup(tonumber(self._texnum_str), function(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
fgCtr:FG_JoinGroup(tonumber(self._texnum_str),function(response)
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -49,20 +49,20 @@ function M:init(url)
|
|||
ViewUtil.ErrorTip("请等待盟主审核")
|
||||
self:Destroy()
|
||||
else
|
||||
ViewUtil.ErrorTip(response.ReturnCode, "加入大联盟失败!")
|
||||
ViewUtil.ErrorTip(response.ReturnCode,"加入大联盟失败!")
|
||||
end
|
||||
end)
|
||||
end)
|
||||
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
|
||||
|
||||
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 (self._currenIndex > 0) then
|
||||
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
|
||||
end
|
||||
else
|
||||
|
|
@ -70,6 +70,7 @@ function M:OnNumButtonAction(context)
|
|||
self._currenIndex = self._currenIndex + 1
|
||||
self._texnum_str = self._texnum_str .. typer
|
||||
self.tex_num.text = self._texnum_str
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ function M:init(url)
|
|||
)
|
||||
self._view:GetChild("btn_qd").onClick:Set(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_AddMember(
|
||||
self.group_id,
|
||||
self.member_id,
|
||||
function(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (response.ReturnCode == 0) then
|
||||
ViewUtil.ErrorTip(-1, '添加成功!', 1)
|
||||
else
|
||||
|
|
|
|||
|
|
@ -62,15 +62,15 @@ function M:init(url)
|
|||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
self._view:GetChild("btn_search_member").onClick:Set(function()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local qid = tonumber(self._view:GetChild("tex_find_memb").text)
|
||||
if not qid then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, "输入ID进行搜索")
|
||||
return
|
||||
end
|
||||
fgCtr:FG_FindMember(self.group_id, qid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -118,9 +118,9 @@ function M:init(url)
|
|||
table.insert(del_list, tem.uid)
|
||||
end
|
||||
end
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_SetBanTable(self.group_id, self.member_id, set_list, del_list, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
self:Destroy()
|
||||
ViewUtil.ErrorTip(-1, "禁止同桌设置成功")
|
||||
|
|
@ -171,10 +171,10 @@ function M:getMemberData(index)
|
|||
-- if index == 0 then
|
||||
-- group:clearMember()
|
||||
-- end
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GroupMembers(self.group_id, index, 10, false, 1, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||||
else
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ function M:FillFagData()
|
|||
pt(self.hpData)
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
if not self.play then
|
||||
-- 新增玩法
|
||||
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
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
---- print("======新增玩法=============")
|
||||
--pt(res)
|
||||
if res.ReturnCode == 0 then
|
||||
|
|
@ -508,7 +508,7 @@ function M:FillFagData()
|
|||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
---- print("======修改玩法=============")
|
||||
--pt(res)
|
||||
if res.ReturnCode == 0 then
|
||||
|
|
|
|||
|
|
@ -4,38 +4,6 @@ local GroupRoomColorView = import(".GroupRoomColorView")
|
|||
local GameListView = require "Game/View/Lobby/GameListView"
|
||||
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
|
||||
|
||||
function GroupGameSettingView.new(blur_view, gid, pid, room_config, callback)
|
||||
|
|
@ -81,9 +49,6 @@ function M:init(url)
|
|||
self.btn_closeTimesPage = self._view:GetChild("btn_closeTimesPage")
|
||||
|
||||
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")
|
||||
|
||||
|
|
@ -587,7 +552,7 @@ function M:FillFagData()
|
|||
pt(self.hpData)
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
if not self.play then
|
||||
-- 新增玩法
|
||||
fgCtr:FG_AddPlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, group.type, self.table_color,
|
||||
|
|
@ -595,7 +560,7 @@ function M:FillFagData()
|
|||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
---- print("======新增玩法=============")
|
||||
--pt(res)
|
||||
if res.ReturnCode == 0 then
|
||||
|
|
@ -637,7 +602,7 @@ function M:FillFagData()
|
|||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
---- print("======修改玩法=============")
|
||||
--pt(res)
|
||||
if res.ReturnCode == 0 then
|
||||
|
|
@ -1089,7 +1054,7 @@ function M:FillFagData_jiangxi()
|
|||
pt(self.hpData)
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
if not self.play then
|
||||
-- 新增玩法
|
||||
fgCtr:FG_AddPlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, group.type, self.table_color,
|
||||
|
|
@ -1097,7 +1062,7 @@ function M:FillFagData_jiangxi()
|
|||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
---- print("======新增玩法=============")
|
||||
--pt(res)
|
||||
if res.ReturnCode == 0 then
|
||||
|
|
@ -1139,7 +1104,7 @@ function M:FillFagData_jiangxi()
|
|||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
---- print("======修改玩法=============")
|
||||
--pt(res)
|
||||
if res.ReturnCode == 0 then
|
||||
|
|
|
|||
|
|
@ -148,14 +148,14 @@ end
|
|||
function M:GetData(index)
|
||||
local filter = self:GetFilter()
|
||||
if filter == 0 then return end
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetMemberHpLog(self.group_id, self.member.uid, index, 6, filter, self.begin_time, self.end_time,
|
||||
function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
||||
else
|
||||
|
|
@ -265,13 +265,13 @@ function M:OnRenderItem(index, obj)
|
|||
self.lst_fag:RefreshVirtualList()
|
||||
self.lst_fag:ScrollToView(index)
|
||||
else
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetHpLogDetail(self.group_id, self.member.uid, data.roomid, data.time, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
||||
else
|
||||
|
|
@ -292,13 +292,13 @@ end
|
|||
|
||||
-- 获取日统计数据
|
||||
function M:GetDailyData()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetPlayerDailyHPCount(self.group_id, self.member.uid, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
||||
else
|
||||
|
|
|
|||
|
|
@ -106,21 +106,21 @@ function M:init(url)
|
|||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
self._view:GetChild("btn_deploy").onClick:Set(function()
|
||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local parent_id = tonumber(num)
|
||||
fgCtr:FG_FindMember(self.group_id, parent_id, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员")
|
||||
elseif res.Data.partnerLev == 0 then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "目标不是合伙人")
|
||||
else
|
||||
fgCtr:FG_DeployMember(self.group_id, member.uid, parent_id, function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res1.ReturnCode == 0) then
|
||||
member.parentId = parent_id
|
||||
self._view:GetChild("tex_superior_id").text = parent_id
|
||||
|
|
@ -146,7 +146,7 @@ function M:init(url)
|
|||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res1.ReturnCode == 0 then
|
||||
member.isvip = selected
|
||||
self.callBack()
|
||||
|
|
@ -175,12 +175,12 @@ function M:init(url)
|
|||
end
|
||||
local _curren_msg = MsgWindow.new(nil, "确定删除该成员吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_GroupRemoveMember(self.group_id, member.uid, function(res1)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res1.ReturnCode == 0 then
|
||||
self.callBack(true)
|
||||
ViewUtil.ErrorTip(-1, "已成功删除玩家")
|
||||
|
|
@ -209,13 +209,13 @@ function M:init(url)
|
|||
local str = member.ban == 1 and "确定恢复娱乐吗?" or "确定禁止娱乐吗?"
|
||||
local _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local val = 1 - member.ban
|
||||
fgCtr:FG_BanMember(self.group_id, member.uid, val, 1, function(res1)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res1.ReturnCode == 0 then
|
||||
member.ban = val
|
||||
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 _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local val = member.group_ban == 1 and 0 or 1
|
||||
fgCtr:FG_BanMember(self.group_id, member.uid, val, 2, function(res1)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res1.ReturnCode == 0 then
|
||||
member.group_ban = val
|
||||
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
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_GetBanTable(self.group_id, member.uid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
local btv = GroupBanSameTableView.new(self.blur_view, self.group_id, member.uid, res.Data)
|
||||
btv:Show()
|
||||
|
|
@ -297,9 +297,9 @@ function M:init(url)
|
|||
btn_set_mng.icon = "ui://NewGroup/zhengzu"
|
||||
btn_set_mng.onClick:Set(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_GetBanMemberHB(self.group_id, member.uid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
--pt(res)
|
||||
if res.ReturnCode == 0 then
|
||||
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 _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local val = 4 - member.lev
|
||||
fgCtr:FG_SetManager(self.group_id, member.uid, val, function(res1)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res1.ReturnCode == 0 then
|
||||
member.lev = val + 1
|
||||
self.callBack()
|
||||
|
|
@ -356,13 +356,13 @@ function M:init(url)
|
|||
local str = member.partnerLev == 0 and "确定设置玩家为合伙人吗?" or "确定取消玩家合伙人身份吗?"
|
||||
local _curren_msg = MsgWindow.new(nil, str, MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local val = member.partnerLev > 0 and 2 or 1
|
||||
fgCtr:FG_SetPartner(self.group_id, member.uid, val, function(res1)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res1.ReturnCode == 0 then
|
||||
member.parentId = res1.Data.parentId
|
||||
member.partnerLev = res1.Data.partnerLev
|
||||
|
|
@ -411,17 +411,17 @@ function M:init(url)
|
|||
self:MovePartner(parent_id, member, self._view)
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_FindMember(self.group_id, parent_id, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员")
|
||||
elseif res.Data.partnerLev == 0 then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "目标不是合伙人")
|
||||
else
|
||||
self:MovePartner(parent_id, member, self._view)
|
||||
|
|
@ -460,9 +460,9 @@ function M:init(url)
|
|||
btn_qiangzhi.onClick:Set(function()
|
||||
local msg_tip = MsgWindow.new(self._root_view, "确定全部提取吗?", MsgWindow.MsgMode.OnlyOk)
|
||||
msg_tip.onOk:Add(function(...)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_TakeHp1(self.group_id, member.uid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -486,7 +486,7 @@ end
|
|||
function M:MovePartner(parent_id, member, obj)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_MovePartner(self.group_id, member.uid, parent_id, function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res1.ReturnCode == 0) then
|
||||
member.parentId = parent_id
|
||||
member.partnerLev = res1.Data.partnerLev
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@ function M:FillView()
|
|||
return
|
||||
end
|
||||
if self._texnum_str == "" then return end
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_AddMember(self.group_id, tonumber(self._texnum_str), function(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (response.ReturnCode == 0) then
|
||||
ViewUtil.ErrorTip(-1, "添加成功!", 1)
|
||||
else
|
||||
|
|
@ -86,10 +86,10 @@ end
|
|||
function M:GetJoinsData()
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if group.joins > 0 then
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GroupJoins(self.group_id, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode == 0) then
|
||||
local joins = res.Data.joins
|
||||
group.joins = #joins
|
||||
|
|
@ -127,10 +127,10 @@ function M:FillJoinList(data)
|
|||
end
|
||||
|
||||
function M:VerifyPlayerJoin(id, allow)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GroupVerifyJoin(self.group_id, id, allow, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode == 0) then
|
||||
self:GetJoinsData()
|
||||
else
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ local GroupMngAddPartner = {}
|
|||
|
||||
local M = GroupMngAddPartner
|
||||
|
||||
function GroupMngAddPartner.new(group_id, member, callback)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
function GroupMngAddPartner.new(group_id, member,callback)
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupMngAddPartner"
|
||||
self._close_destroy = true
|
||||
-- self._blur_view = blur_view
|
||||
|
|
@ -16,8 +16,10 @@ function GroupMngAddPartner.new(group_id, member, callback)
|
|||
return self
|
||||
end
|
||||
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
|
||||
BaseWindow.init(self,url)
|
||||
|
||||
local member = self.member
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
|
|
@ -33,19 +35,20 @@ function M:init(url)
|
|||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_SetPartner(self.group_id, member.uid, 1, function(res1)
|
||||
if self._is_destroy then
|
||||
return
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res1.ReturnCode == 0 then
|
||||
member.parentId = res1.Data.parentId
|
||||
member.partnerLev = res1.Data.partnerLev
|
||||
self.callback()
|
||||
self:Destroy()
|
||||
else
|
||||
ViewUtil.ErrorTip(res1.ReturnCode, "设置合伙人失败失败!")
|
||||
ViewUtil.ErrorTip(res1.ReturnCode,"设置合伙人失败失败!")
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
|
@ -20,21 +20,25 @@ function GroupMngFagListView.new(group_id)
|
|||
end
|
||||
|
||||
function M:initData()
|
||||
|
||||
self.fag_result_data = {}
|
||||
self.fag_data = {}
|
||||
|
||||
if self._view:GetController("page").selectedIndex < 2 then
|
||||
self:GetFagData(0)
|
||||
else
|
||||
self:GetMngFagInfo()
|
||||
end
|
||||
if self._view:GetController("page").selectedIndex < 2 then
|
||||
self:GetFagData(0)
|
||||
else
|
||||
self:GetMngFagInfo()
|
||||
end
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if group.lev < 3 then
|
||||
self:GetHpStatistic()
|
||||
self:GetHpStatistic()
|
||||
end
|
||||
end
|
||||
|
||||
function M:FillView()
|
||||
|
||||
|
||||
|
||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupFagList")
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if group.lev < 3 then
|
||||
|
|
@ -44,7 +48,7 @@ function M:FillView()
|
|||
self.lst_fag = self._view:GetChild("lst_fag")
|
||||
self.lst_fag:SetVirtual()
|
||||
self.lst_fag.itemRenderer = function(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
end
|
||||
self.lst_fag.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetFagData(self.lst_fag.numItems)
|
||||
|
|
@ -52,7 +56,7 @@ function M:FillView()
|
|||
self.lst_fag_result = self._view:GetChild("lst_fag_result")
|
||||
self.lst_fag_result:SetVirtual()
|
||||
self.lst_fag_result.itemRenderer = function(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
end
|
||||
self.lst_fag_result.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetFagData(self.lst_fag_result.numItems)
|
||||
|
|
@ -60,23 +64,24 @@ function M:FillView()
|
|||
|
||||
-- 切换页面事件,1,2页为上下分,3页是管理员总计
|
||||
self._view:GetController("page").onChanged:Set(function()
|
||||
if self._view:GetController("page").selectedIndex < 2 then
|
||||
if self._view:GetController("search").selectedIndex == 0 then
|
||||
if self._view:GetController("page").selectedIndex < 2 then
|
||||
if self._view:GetController("search").selectedIndex == 0 then
|
||||
self.quary_id = 0
|
||||
self.query_nick = ""
|
||||
|
||||
self.fag_data = {}
|
||||
self:GetFagData(0)
|
||||
else
|
||||
self.fag_data = {}
|
||||
self:GetFagData(0)
|
||||
else
|
||||
|
||||
self.quary_id = 0
|
||||
self.query_nick = ""
|
||||
|
||||
self.fag_result_data = {}
|
||||
self:GetFagData(0)
|
||||
end
|
||||
else
|
||||
self:GetMngFagInfo()
|
||||
end
|
||||
self.fag_result_data = {}
|
||||
self:GetFagData(0)
|
||||
end
|
||||
else
|
||||
self:GetMngFagInfo()
|
||||
end
|
||||
end)
|
||||
|
||||
self._view:GetChild("btn_search").onClick:Set(function()
|
||||
|
|
@ -89,14 +94,13 @@ function M:FillView()
|
|||
self:GetFagData(0)
|
||||
end)
|
||||
self._view:GetChild("btn_back").onClick:Set(function()
|
||||
self.quary_id = 0
|
||||
self.quary_id = 0
|
||||
self.query_nick = ""
|
||||
end)
|
||||
|
||||
self.time_panel1 = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"),
|
||||
self._view:GetChild("btn_date2"), -308, 0, function()
|
||||
self:GetMngFagInfo()
|
||||
end)
|
||||
self.time_panel1 = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0, function()
|
||||
self:GetMngFagInfo()
|
||||
end)
|
||||
end
|
||||
|
||||
-- 获取上下分数据
|
||||
|
|
@ -105,24 +109,24 @@ function M:GetFagData(index)
|
|||
qid = self.quary_id or 0
|
||||
qName = self.query_nick or ""
|
||||
-- 重新获取数据时,清空数据列表
|
||||
if index == 0 then
|
||||
if index == 0 then
|
||||
if qid == 0 then
|
||||
self.fag_data = {}
|
||||
else
|
||||
self.fag_result_data = {}
|
||||
end
|
||||
end
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
end
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
|
||||
--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)
|
||||
if group.lev == 3 then
|
||||
type = type + 2
|
||||
end
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetMngHpLog(self.group_id, index, num, type, qid, qName, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -147,77 +151,77 @@ function M:GetFagData(index)
|
|||
lst.numItems = #local_data
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
-- 获取体力值统计
|
||||
function M:GetHpStatistic()
|
||||
-- ViewUtil.ShowModalWait2(nil, "正在获取数据")
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetMngHpStatistic(self.group_id, function(res)
|
||||
-- ViewUtil.CloseModalWait2()
|
||||
-- ViewUtil.ShowModalWait(nil, "正在获取数据")
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetMngHpStatistic(self.group_id, function(res)
|
||||
-- ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分记录失败")
|
||||
else
|
||||
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_add").text = d2ad(res.Data.hp_upper)
|
||||
self._view:GetChild("tex_minus").text = d2ad(res.Data.hp_sub)
|
||||
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_add").text = d2ad(res.Data.hp_upper)
|
||||
self._view:GetChild("tex_minus").text = d2ad(res.Data.hp_sub)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
-- 获取管理员总计/合伙人总计
|
||||
function M:GetMngFagInfo()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local begin_time, end_time = self.time_panel1:GetDate()
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
local type = group.lev < 3 and 1 or 2
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetMngHpInfo(self.group_id, type, begin_time, end_time, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败")
|
||||
else
|
||||
local add_count = 0
|
||||
local minus_count = 0
|
||||
local lst_fag_info = self._view:GetChild("lst_mgr_data")
|
||||
lst_fag_info:RemoveChildrenToPool()
|
||||
for i = 1, #res.Data.infos do
|
||||
local data = res.Data.infos[i]
|
||||
local item = lst_fag_info:AddItemFromPool()
|
||||
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_add").text = d2ad(data.hp_upper)
|
||||
item:GetChild("tex_minus").text = d2ad(data.hp_sub)
|
||||
add_count = add_count + data.hp_upper
|
||||
minus_count = minus_count + data.hp_sub
|
||||
end
|
||||
self._view:GetChild("tex_add2").text = d2ad(add_count)
|
||||
self._view:GetChild("tex_minus2").text = d2ad(minus_count)
|
||||
local add_count = 0
|
||||
local minus_count = 0
|
||||
local lst_fag_info = self._view:GetChild("lst_mgr_data")
|
||||
lst_fag_info:RemoveChildrenToPool()
|
||||
for i = 1, #res.Data.infos do
|
||||
local data = res.Data.infos[i]
|
||||
local item = lst_fag_info:AddItemFromPool()
|
||||
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_add").text = d2ad(data.hp_upper)
|
||||
item:GetChild("tex_minus").text = d2ad(data.hp_sub)
|
||||
add_count = add_count + data.hp_upper
|
||||
minus_count = minus_count + data.hp_sub
|
||||
end
|
||||
self._view:GetChild("tex_add2").text = d2ad(add_count)
|
||||
self._view:GetChild("tex_minus2").text = d2ad(minus_count)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- 填充对象
|
||||
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 num = d2ad(rdata.hp)
|
||||
obj:GetChild("tex_mgr_name").text = ViewUtil.stringEllipsis(rdata.m_nick)
|
||||
obj:GetChild("tex_mgr_id").text = rdata.mgr_id
|
||||
obj:GetChild("tex_obj_name").text = ViewUtil.stringEllipsis(rdata.t_nick)
|
||||
obj:GetChild("tex_id").text = rdata.uid
|
||||
obj:GetChild("tex_num").text = num >= 0 and "+" .. num or num
|
||||
obj:GetController("add").selectedIndex = num >= 0 and 1 or 0
|
||||
obj:GetChild("tex_num").text = num >= 0 and "+".. num or num
|
||||
obj:GetController("add").selectedIndex = num >=0 and 1 or 0
|
||||
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
|
||||
|
||||
return M
|
||||
|
|
@ -127,12 +127,12 @@ function M:OnRenderItem(index, obj)
|
|||
local msg_del = MsgWindow.new(nil, "删除该玩法,该玩法的相关数据也会被清除。\r确定要删除吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||
msg_del.onOk:Add(function(...)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_DelPlay(self.group_id, play.id, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
group:delPlay(play.id)
|
||||
self.lst_play.numItems = #group.playList
|
||||
|
|
@ -170,12 +170,12 @@ end
|
|||
|
||||
function M:MarkPlay(markS, pid, isMark)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_MarkPlay(self.group_id, pid, isMark, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
group:markPlay(pid, isMark)
|
||||
|
|
@ -229,12 +229,12 @@ end
|
|||
-- 禁止、恢复玩法
|
||||
function M:BanPlay(pid, ban)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_BanPlay(self.group_id, pid, ban, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
group:banPlay(pid, ban)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
-- 开桌统计
|
||||
local GroupMngMemberInfoView = {}
|
||||
|
||||
|
|
@ -16,20 +17,25 @@ function M:initData()
|
|||
end
|
||||
|
||||
function M:ShowPeopleNum()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetMembersCount(self.group_id, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
fgCtr:FG_GetMembersCount(self.group_id,function(res)
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
|
||||
if res.ReturnCode == 0 then
|
||||
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
|
||||
|
||||
function M:InitView()
|
||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupMemberInfo")
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
return M
|
||||
|
|
@ -75,11 +75,11 @@ function M:FillView()
|
|||
local ctr_search = self._view:GetController('search')
|
||||
self._view:GetChild('btn_search').onClick:Set(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local text = self._view:GetChild('tex_id').text
|
||||
local qid, qnick
|
||||
if text == "" then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
return
|
||||
end
|
||||
|
|
@ -90,7 +90,7 @@ function M:FillView()
|
|||
self.group_id,
|
||||
qid,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -141,7 +141,7 @@ function M:FillView()
|
|||
if self._texnum_str == '' then
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:GetAddMember(
|
||||
self.group_id,
|
||||
|
|
@ -149,7 +149,7 @@ function M:FillView()
|
|||
function(response)
|
||||
printlog("响应获取添加玩家==》》》")
|
||||
pt(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (response.ReturnCode and response.ReturnCode == 0) then
|
||||
GroupAddMemberInfoView.new(self.group_id, tonumber(self._texnum_str)):SetAddMember(response.Data)
|
||||
self:ClearNumTex()
|
||||
|
|
@ -191,7 +191,7 @@ function M:GetMemberData(index)
|
|||
group:clearMember()
|
||||
end
|
||||
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GroupMembers11(
|
||||
self.group_id,
|
||||
|
|
@ -200,7 +200,7 @@ function M:GetMemberData(index)
|
|||
false,
|
||||
1,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, '获取成员列表失败')
|
||||
else
|
||||
|
|
@ -222,14 +222,14 @@ local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
|||
nil,
|
||||
function(num)
|
||||
num = ad2d((is_add and num or -num))
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_ChangeFag(
|
||||
gid,
|
||||
pid,
|
||||
num,
|
||||
function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
-- if gniv._is_destroy then
|
||||
-- return
|
||||
-- end
|
||||
|
|
@ -397,11 +397,11 @@ function M:FillItem(obj, member, refresh)
|
|||
|
||||
obj:GetChild("super_btn").onClick:Set(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local text = member.uid
|
||||
local qid, qnick
|
||||
if text == "" then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
return
|
||||
end
|
||||
|
|
@ -412,7 +412,7 @@ function M:FillItem(obj, member, refresh)
|
|||
self.group_id,
|
||||
qid,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -449,12 +449,12 @@ end
|
|||
function M:GetJoinsData()
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if group.joins > 0 then
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GroupJoins(
|
||||
self.group_id,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode == 0) then
|
||||
local joins = res.Data.joins
|
||||
group.joins = #joins
|
||||
|
|
@ -497,14 +497,14 @@ function M:FillJoinList(data)
|
|||
end
|
||||
|
||||
function M:VerifyPlayerJoin(id, allow)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GroupVerifyJoin(
|
||||
self.group_id,
|
||||
id,
|
||||
allow,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode == 0) then
|
||||
self:GetJoinsData()
|
||||
else
|
||||
|
|
|
|||
|
|
@ -94,11 +94,11 @@ function M:FillView()
|
|||
local ctr_search = self._view:GetController('search')
|
||||
self._view:GetChild('btn_search').onClick:Set(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local text = self._view:GetChild('tex_id').text
|
||||
local qid, qnick
|
||||
if text == "" then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
return
|
||||
end
|
||||
|
|
@ -109,7 +109,7 @@ function M:FillView()
|
|||
self.group_id,
|
||||
qid,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -160,7 +160,7 @@ function M:FillView()
|
|||
if self._texnum_str == '' then
|
||||
return
|
||||
end
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:GetAddMember(
|
||||
self.group_id,
|
||||
|
|
@ -168,7 +168,7 @@ function M:FillView()
|
|||
function(response)
|
||||
printlog("响应获取添加玩家==》》》")
|
||||
pt(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (response.ReturnCode and response.ReturnCode == 0) then
|
||||
GroupAddMemberInfoView.new(self.group_id, tonumber(self._texnum_str)):SetAddMember(response.Data)
|
||||
self:ClearNumTex()
|
||||
|
|
@ -226,7 +226,7 @@ function M:GetMemberData(index)
|
|||
group:clearMember()
|
||||
end
|
||||
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GroupMembers12(
|
||||
self.group_id,
|
||||
|
|
@ -235,7 +235,7 @@ function M:GetMemberData(index)
|
|||
self.stype,
|
||||
self.online,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, '获取成员列表失败')
|
||||
else
|
||||
|
|
@ -257,14 +257,14 @@ local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
|||
nil,
|
||||
function(num)
|
||||
num = ad2d((is_add and num or -num))
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_ChangeFag(
|
||||
gid,
|
||||
pid,
|
||||
num,
|
||||
function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
-- if gniv._is_destroy then
|
||||
-- return
|
||||
-- end
|
||||
|
|
@ -471,11 +471,11 @@ function M:FillItem(obj, member, refresh)
|
|||
superBtn.visible = group.lev == 1
|
||||
obj:GetChild("super_btn").onClick:Set(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local text = member.uid
|
||||
local qid, qnick
|
||||
if text == "" then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
return
|
||||
end
|
||||
|
|
@ -486,7 +486,7 @@ function M:FillItem(obj, member, refresh)
|
|||
self.group_id,
|
||||
qid,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -523,12 +523,12 @@ end
|
|||
function M:GetJoinsData()
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if group.joins > 0 then
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GroupJoins(
|
||||
self.group_id,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode == 0) then
|
||||
local joins = res.Data.joins
|
||||
group.joins = #joins
|
||||
|
|
@ -571,14 +571,14 @@ function M:FillJoinList(data)
|
|||
end
|
||||
|
||||
function M:VerifyPlayerJoin(id, allow)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GroupVerifyJoin(
|
||||
self.group_id,
|
||||
id,
|
||||
allow,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (res.ReturnCode == 0) then
|
||||
self:GetJoinsData()
|
||||
else
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ function M:initData()
|
|||
self.record_data = {}
|
||||
|
||||
|
||||
self:GetPartnerData(function(res)
|
||||
self:GetRecordData(0, true)
|
||||
self:GetPartnerData(function (res)
|
||||
self:GetRecordData(0,true)
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
@ -34,8 +34,7 @@ function M:InitView()
|
|||
self:GetRecordData(self.lst_record.numItems)
|
||||
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")
|
||||
ctr_page.onChanged:Set(function()
|
||||
|
|
@ -54,25 +53,29 @@ function M:InitView()
|
|||
self.begin_time, self.end_time = self.time_panel:GetDate()
|
||||
self:GetRecordData(0)
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
-- 获取合伙人数据
|
||||
function M:GetPartnerData(callback)
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetPartnerList(self.group_id, 1, nil, nil, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
callback(res)
|
||||
end)
|
||||
end
|
||||
|
||||
function M:GetRecordData(index, init)
|
||||
function M:GetRecordData(index,init)
|
||||
|
||||
if init == nil or init == false then
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
end
|
||||
|
||||
quary_id = tonumber(self._view:GetChild("tex_id").text)
|
||||
quary_id = quary_id or 0
|
||||
quary_id = tonumber(self._view:GetChild("tex_id").text)
|
||||
quary_id = quary_id or 0
|
||||
|
||||
local partner_id = DataManager.SelfUser.account_id
|
||||
|
||||
|
|
@ -83,30 +86,31 @@ function M:GetRecordData(index, init)
|
|||
end
|
||||
|
||||
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)
|
||||
if init == nil or init == false then
|
||||
ViewUtil.CloseModalWait2()
|
||||
end
|
||||
fgCtr:FG_GetMemberStat(self.group_id, quary_id,partner_id, index, 6, time_type,self.begin_time,self.end_time,function(res)
|
||||
if init == nil or init == false then
|
||||
ViewUtil.CloseModalWait()
|
||||
end
|
||||
|
||||
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
|
||||
self.lst_record.numItems = #self.record_data
|
||||
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
|
||||
end)
|
||||
end
|
||||
|
||||
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)
|
||||
|
||||
local ctr_type = obj:GetController("type")
|
||||
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)
|
||||
|
||||
local ctr_type = obj:GetController("type")
|
||||
if data.lev < 3 then
|
||||
ctr_type.selectedIndex = data.lev
|
||||
elseif data.partnerLev ~= 0 then
|
||||
|
|
@ -121,4 +125,5 @@ function M:OnRenderRecordItem(index, obj)
|
|||
self:FillRecordItem(data, obj)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
|
@ -25,7 +25,7 @@ end
|
|||
|
||||
function M:initData()
|
||||
--self._view.visible = true
|
||||
self:GetPartnerData(0)
|
||||
self:GetPartnerData(0)
|
||||
end
|
||||
|
||||
function M:InitView()
|
||||
|
|
@ -35,7 +35,7 @@ function M:InitView()
|
|||
self.lst_partner = self._view:GetChild("lst_partner")
|
||||
self.lst_partner:SetVirtual()
|
||||
self.lst_partner.itemRenderer = function(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
end
|
||||
self.lst_partner.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetPartnerData(self.lst_partner.numItems)
|
||||
|
|
@ -44,14 +44,14 @@ function M:InitView()
|
|||
local btn_search = self._view:GetChild("btn_search")
|
||||
btn_search.onClick:Set(function()
|
||||
local text = self._view:GetChild("tex_id").text
|
||||
local query_id = tonumber(text) or 0
|
||||
local query_nick = text
|
||||
local query_id = tonumber(text) or 0
|
||||
local query_nick = text
|
||||
self._view:GetChild("tex_id").text = ""
|
||||
self:QueryPartnerData(query_id, query_nick)
|
||||
self:QueryPartnerData(query_id, query_nick)
|
||||
end)
|
||||
local btn_back = self._view:GetChild("btn_back")
|
||||
btn_back.onClick:Set(function()
|
||||
self._view:GetController("search").selectedIndex = 0
|
||||
self._view:GetController("search").selectedIndex = 0
|
||||
end)
|
||||
|
||||
|
||||
|
|
@ -61,29 +61,31 @@ function M:InitView()
|
|||
self.tex_num = self._view:GetChild("tex_num")
|
||||
self:ClearNumTex()
|
||||
|
||||
for i = 0, 9 do
|
||||
local obj = self._view:GetChild("btn_" .. i)
|
||||
obj.onClick:Add(handler(self, self.OnNumButtonAction))
|
||||
for i = 0 ,9 do
|
||||
local obj = self._view:GetChild("btn_"..i)
|
||||
obj.onClick:Add(handler(self , self.OnNumButtonAction))
|
||||
i = i + 1
|
||||
end
|
||||
local btn_ok = self._view:GetChild("btn_ok")
|
||||
btn_ok.onClick:Set(function()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local qid = tonumber(self._view:GetChild("tex_num").text)
|
||||
if not qid then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, "输入ID进行搜索!")
|
||||
return
|
||||
end
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_FindMember(self.group_id, qid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
||||
else
|
||||
|
||||
local member = res.Data
|
||||
if member.parentId ~= 0 and member.parentId ~= DataManager.SelfUser.account_id then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
||||
|
|
@ -95,7 +97,7 @@ function M:InitView()
|
|||
return
|
||||
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._view:GetController("page").selectedIndex = 0
|
||||
end)
|
||||
|
|
@ -104,7 +106,7 @@ function M:InitView()
|
|||
end)
|
||||
end)
|
||||
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
|
||||
|
||||
function M:ClearNumTex()
|
||||
|
|
@ -114,65 +116,73 @@ function M:ClearNumTex()
|
|||
end
|
||||
|
||||
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 (self._currenIndex > 0) then
|
||||
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
|
||||
end
|
||||
else
|
||||
if (self._currenIndex < 6) then
|
||||
|
||||
self._currenIndex = self._currenIndex + 1
|
||||
self._texnum_str = self._texnum_str .. typer
|
||||
self.tex_num.text = self._texnum_str
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- 获取合伙人数据
|
||||
function M:GetPartnerData(index, callback)
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if index == 0 then
|
||||
self.partner_data = {}
|
||||
end
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
function M:GetPartnerData(index,callback)
|
||||
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if index == 0 then
|
||||
self.partner_data = {}
|
||||
end
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetPartnerList(self.group_id, 0, index, 10, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||
else
|
||||
local partners = res.Data.members
|
||||
for i = 1, #partners do
|
||||
local partners = res.Data.members
|
||||
for i = 1, #partners do
|
||||
self.partner_data[#self.partner_data + 1] = partners[i]
|
||||
end
|
||||
self.lst_partner.numItems = #self.partner_data
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
-- 获取合伙人数据
|
||||
function M:QueryPartnerData(query_id, query_nick)
|
||||
function M:QueryPartnerData(query_id,query_nick)
|
||||
|
||||
query_nick = query_nick or ""
|
||||
query_id = query_id or 0
|
||||
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||
else
|
||||
|
||||
if res.Data.members ~= nil and #res.Data.members > 0 then
|
||||
self._view:GetController("search").selectedIndex = 1
|
||||
local lst_partner_search = self._view:GetChild("lst_partner_search")
|
||||
lst_partner_search:RemoveChildrenToPool()
|
||||
for i = 1, #res.Data.members do
|
||||
local tem = lst_partner_search:AddItemFromPool()
|
||||
self:FillItem(tem, res.Data.members[i])
|
||||
self:FillItem(tem,res.Data.members[i])
|
||||
end
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到指定的玩家")
|
||||
|
|
@ -183,11 +193,11 @@ end
|
|||
|
||||
-- 管理员权限
|
||||
local MngPermissionList = {
|
||||
DeleteMember = 1, -- 删除成员
|
||||
AddMember = 2, --添加成员
|
||||
SetFag = 3, --设置体力值
|
||||
BanPlaying = 4, --禁止游戏
|
||||
BanSameTable = 5 --禁止同桌
|
||||
DeleteMember = 1,-- 删除成员
|
||||
AddMember = 2,--添加成员
|
||||
SetFag = 3,--设置体力值
|
||||
BanPlaying = 4,--禁止游戏
|
||||
BanSameTable = 5--禁止同桌
|
||||
}
|
||||
local function CheckPermission(lev, permission)
|
||||
if lev == 2 and not permission then
|
||||
|
|
@ -201,20 +211,20 @@ end
|
|||
local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||
num = ad2d((is_add and num or -num))
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_ChangeFag(gid, pid, num, function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
-- if gniv._is_destroy then
|
||||
-- return
|
||||
-- end
|
||||
if (res1.ReturnCode == 0) then
|
||||
callback(res1.Data)
|
||||
else
|
||||
ViewUtil.ErrorTip(res1.ReturnCode, "更改积分失败!")
|
||||
ViewUtil.ErrorTip(res1.ReturnCode,"更改积分失败!")
|
||||
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)
|
||||
gniv:Show()
|
||||
end
|
||||
|
|
@ -233,6 +243,7 @@ end
|
|||
|
||||
-- 填充合伙人对象
|
||||
function M:FillItem(obj, partner)
|
||||
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
local perm_array = MngPermission.getPermData(group.permission)
|
||||
|
||||
|
|
@ -241,7 +252,7 @@ function M:FillItem(obj, partner)
|
|||
obj:GetChild("btn_head").icon = "ui://Common/Head0"
|
||||
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
|
||||
else
|
||||
obj:GetController("fag").selectedIndex = 0
|
||||
|
|
@ -272,6 +283,7 @@ function M:FillItem(obj, partner)
|
|||
end)
|
||||
end)
|
||||
obj:GetChild("btn_fag_minus").onClick:Set(function()
|
||||
|
||||
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
||||
return
|
||||
end
|
||||
|
|
@ -295,7 +307,7 @@ function M:FillItem(obj, partner)
|
|||
|
||||
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()
|
||||
|
|
@ -316,11 +328,16 @@ function M:FillItem(obj, partner)
|
|||
local btnDetail = obj:GetChild("btn_detail")
|
||||
btnDetail.visible = partner.total > 0
|
||||
btnDetail.onClick:Set(function()
|
||||
local GroupMngPartnerListView2 = GroupMngPartnerListView2.new(self.group_id, partner.uid)
|
||||
local GroupMngPartnerListView2 = GroupMngPartnerListView2.new(self.group_id,partner.uid)
|
||||
GroupMngPartnerListView2:Show()
|
||||
end)
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-- 列表对象填充
|
||||
function M:OnRenderItem(index, obj)
|
||||
local partner = self.partner_data[index + 1]
|
||||
|
|
@ -329,8 +346,8 @@ end
|
|||
|
||||
-- 显示合伙人成员列表
|
||||
function M:ShowPartnerMemberList(partner_id)
|
||||
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
||||
pmlv:Show()
|
||||
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
||||
pmlv:Show()
|
||||
end
|
||||
|
||||
-- 显示合伙人奖励
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ end
|
|||
|
||||
function M:initData()
|
||||
--self._view.visible = true
|
||||
self:GetPartnerData(0)
|
||||
self:GetPartnerData(0)
|
||||
end
|
||||
|
||||
function M:InitView()
|
||||
|
|
@ -34,7 +34,7 @@ function M:InitView()
|
|||
self.lst_partner = self._view:GetChild("lst_partner")
|
||||
self.lst_partner:SetVirtual()
|
||||
self.lst_partner.itemRenderer = function(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
end
|
||||
self.lst_partner.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetPartnerData(self.lst_partner.numItems)
|
||||
|
|
@ -43,14 +43,14 @@ function M:InitView()
|
|||
local btn_search = self._view:GetChild("btn_search")
|
||||
btn_search.onClick:Set(function()
|
||||
local text = self._view:GetChild("tex_id").text
|
||||
local query_id = tonumber(text) or 0
|
||||
local query_nick = text
|
||||
local query_id = tonumber(text) or 0
|
||||
local query_nick = text
|
||||
self._view:GetChild("tex_id").text = ""
|
||||
self:QueryPartnerData(query_id, query_nick)
|
||||
self:QueryPartnerData(query_id, query_nick)
|
||||
end)
|
||||
local btn_back = self._view:GetChild("btn_back")
|
||||
btn_back.onClick:Set(function()
|
||||
--self._view:GetController("search").selectedIndex = 0
|
||||
--self._view:GetController("search").selectedIndex = 0
|
||||
end)
|
||||
|
||||
|
||||
|
|
@ -60,29 +60,31 @@ function M:InitView()
|
|||
self.tex_num = self._view:GetChild("tex_num")
|
||||
self:ClearNumTex()
|
||||
|
||||
for i = 0, 9 do
|
||||
local obj = self._view:GetChild("btn_" .. i)
|
||||
obj.onClick:Add(handler(self, self.OnNumButtonAction))
|
||||
for i = 0 ,9 do
|
||||
local obj = self._view:GetChild("btn_"..i)
|
||||
obj.onClick:Add(handler(self , self.OnNumButtonAction))
|
||||
i = i + 1
|
||||
end
|
||||
local btn_ok = self._view:GetChild("btn_ok")
|
||||
btn_ok.onClick:Set(function()
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local qid = tonumber(self._view:GetChild("tex_num").text)
|
||||
if not qid then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, "输入ID进行搜索!")
|
||||
return
|
||||
end
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_FindMember(self.group_id, qid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
||||
else
|
||||
|
||||
local member = res.Data
|
||||
if member.parentId ~= 0 and member.parentId ~= DataManager.SelfUser.account_id then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到成员!")
|
||||
|
|
@ -94,7 +96,7 @@ function M:InitView()
|
|||
return
|
||||
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._view:GetController("page").selectedIndex = 0
|
||||
end)
|
||||
|
|
@ -103,7 +105,7 @@ function M:InitView()
|
|||
end)
|
||||
end)
|
||||
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
|
||||
|
||||
function M:ClearNumTex()
|
||||
|
|
@ -113,67 +115,75 @@ function M:ClearNumTex()
|
|||
end
|
||||
|
||||
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 (self._currenIndex > 0) then
|
||||
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
|
||||
end
|
||||
else
|
||||
if (self._currenIndex < 6) then
|
||||
|
||||
self._currenIndex = self._currenIndex + 1
|
||||
self._texnum_str = self._texnum_str .. typer
|
||||
self.tex_num.text = self._texnum_str
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- 获取合伙人数据
|
||||
function M:GetPartnerData(index, callback)
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if index == 0 then
|
||||
self.partner_data = {}
|
||||
end
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
function M:GetPartnerData(index,callback)
|
||||
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if index == 0 then
|
||||
self.partner_data = {}
|
||||
end
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GroupTiChu(self.group_id, index, 10, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取踢出列表失败")
|
||||
else
|
||||
--printlog("aaaaaaaaaaaaa1111111111111111111111")
|
||||
--pt(res)
|
||||
local partners = res.Data.data
|
||||
for i = 1, #partners do
|
||||
local partners = res.Data.data
|
||||
for i = 1, #partners do
|
||||
self.partner_data[#self.partner_data + 1] = partners[i]
|
||||
end
|
||||
self.lst_partner.numItems = #self.partner_data
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
-- 获取合伙人数据
|
||||
function M:QueryPartnerData(query_id, query_nick)
|
||||
function M:QueryPartnerData(query_id,query_nick)
|
||||
|
||||
query_nick = query_nick or ""
|
||||
query_id = query_id or 0
|
||||
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||
else
|
||||
|
||||
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")
|
||||
lst_partner_search:RemoveChildrenToPool()
|
||||
for i = 1, #res.Data.members do
|
||||
local tem = lst_partner_search:AddItemFromPool()
|
||||
self:FillItem(tem, res.Data.members[i])
|
||||
self:FillItem(tem,res.Data.members[i])
|
||||
end
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到指定的玩家")
|
||||
|
|
@ -184,11 +194,11 @@ end
|
|||
|
||||
-- 管理员权限
|
||||
local MngPermissionList = {
|
||||
DeleteMember = 1, -- 删除成员
|
||||
AddMember = 2, --添加成员
|
||||
SetFag = 3, --设置体力值
|
||||
BanPlaying = 4, --禁止游戏
|
||||
BanSameTable = 5 --禁止同桌
|
||||
DeleteMember = 1,-- 删除成员
|
||||
AddMember = 2,--添加成员
|
||||
SetFag = 3,--设置体力值
|
||||
BanPlaying = 4,--禁止游戏
|
||||
BanSameTable = 5--禁止同桌
|
||||
}
|
||||
local function CheckPermission(lev, permission)
|
||||
if lev == 2 and not permission then
|
||||
|
|
@ -202,20 +212,20 @@ end
|
|||
local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||
num = ad2d((is_add and num or -num))
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_ChangeFag(gid, pid, num, function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
-- if gniv._is_destroy then
|
||||
-- return
|
||||
-- end
|
||||
if (res1.ReturnCode == 0) then
|
||||
callback(res1.Data)
|
||||
else
|
||||
ViewUtil.ErrorTip(res1.ReturnCode, "更改积分失败!")
|
||||
ViewUtil.ErrorTip(res1.ReturnCode,"更改积分失败!")
|
||||
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)
|
||||
gniv:Show()
|
||||
end
|
||||
|
|
@ -234,16 +244,17 @@ end
|
|||
|
||||
-- 填充合伙人对象
|
||||
function M:FillItem(obj, partner)
|
||||
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
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("btn_head").icon = "ui://Common/Head0"
|
||||
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
|
||||
else
|
||||
--obj:GetController("fag").selectedIndex = 0
|
||||
|
|
@ -274,6 +285,7 @@ function M:FillItem(obj, partner)
|
|||
end)
|
||||
end)
|
||||
obj:GetChild("btn_fag_minus").onClick:Set(function()
|
||||
|
||||
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
||||
return
|
||||
end
|
||||
|
|
@ -295,9 +307,9 @@ 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.round
|
||||
obj:GetChild("tex_member_count").text = ""..partner.round
|
||||
obj:GetChild("tex_fenzu").text = partner.group
|
||||
obj:GetChild("tex_caozuo").text = partner.opnick
|
||||
obj:GetChild("tex_tuichu").text = os.date('%Y/%m/%d %H:%M', partner.deltime)
|
||||
|
|
@ -319,6 +331,9 @@ function M:FillItem(obj, partner)
|
|||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-- 列表对象填充
|
||||
function M:OnRenderItem(index, obj)
|
||||
local partner = self.partner_data[index + 1]
|
||||
|
|
@ -327,8 +342,8 @@ end
|
|||
|
||||
-- 显示合伙人成员列表
|
||||
function M:ShowPartnerMemberList(partner_id)
|
||||
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
||||
pmlv:Show()
|
||||
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
||||
pmlv:Show()
|
||||
end
|
||||
|
||||
-- 显示合伙人奖励
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ local GroupMngPartnerListView2 = {}
|
|||
|
||||
local M = GroupMngPartnerListView2
|
||||
|
||||
function GroupMngPartnerListView2.new(gid, tagId)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
function GroupMngPartnerListView2.new(gid,tagId)
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupMngPartnerListView2"
|
||||
self._full = true
|
||||
self.group_id = gid
|
||||
|
|
@ -24,14 +24,16 @@ function GroupMngPartnerListView2.new(gid, tagId)
|
|||
return self
|
||||
end
|
||||
|
||||
|
||||
|
||||
function M:InitView()
|
||||
-- self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/Win_StatMember")
|
||||
BaseWindow.init(self, "ui://NewGroup/Win_StatMember")
|
||||
-- self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/Win_StatMember")
|
||||
BaseWindow.init(self,"ui://NewGroup/Win_StatMember")
|
||||
-- 初始化合伙人列表
|
||||
self.lst_partner = self._view:GetChild("lst_partner")
|
||||
self.lst_partner:SetVirtual()
|
||||
self.lst_partner.itemRenderer = function(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
end
|
||||
self.lst_partner.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetPartnerData(self.lst_partner.numItems)
|
||||
|
|
@ -44,49 +46,57 @@ function M:InitView()
|
|||
self:GetPartnerData(0)
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- 获取合伙人数据
|
||||
function M:GetPartnerData(index, callback)
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if index == 0 then
|
||||
self.partner_data = {}
|
||||
end
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
function M:GetPartnerData(index,callback)
|
||||
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if index == 0 then
|
||||
self.partner_data = {}
|
||||
end
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetPartnerList(self.group_id, 0, index, 10, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||
else
|
||||
local partners = res.Data.members
|
||||
for i = 1, #partners do
|
||||
self.partner_data[#self.partner_data + 1] = partners[i]
|
||||
end
|
||||
self.lst_partner.numItems = #self.partner_data
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||
else
|
||||
local partners = res.Data.members
|
||||
for i = 1, #partners do
|
||||
self.partner_data[#self.partner_data + 1] = partners[i]
|
||||
end
|
||||
end,
|
||||
self.tagId)
|
||||
self.lst_partner.numItems = #self.partner_data
|
||||
end
|
||||
end,
|
||||
self.tagId)
|
||||
end
|
||||
|
||||
-- 获取合伙人数据
|
||||
function M:QueryPartnerData(query_id, query_nick)
|
||||
function M:QueryPartnerData(query_id,query_nick)
|
||||
|
||||
query_nick = query_nick or ""
|
||||
query_id = query_id or 0
|
||||
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人列表失败")
|
||||
else
|
||||
|
||||
if res.Data.members ~= nil and #res.Data.members > 0 then
|
||||
|
||||
local lst_partner_search = self._view:GetChild("lst_partner_search")
|
||||
lst_partner_search:RemoveChildrenToPool()
|
||||
for i = 1, #res.Data.members do
|
||||
local tem = lst_partner_search:AddItemFromPool()
|
||||
self:FillItem(tem, res.Data.members[i])
|
||||
self:FillItem(tem,res.Data.members[i])
|
||||
end
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "找不到指定的玩家")
|
||||
|
|
@ -97,11 +107,11 @@ end
|
|||
|
||||
-- 管理员权限
|
||||
local MngPermissionList = {
|
||||
DeleteMember = 1, -- 删除成员
|
||||
AddMember = 2, --添加成员
|
||||
SetFag = 3, --设置体力值
|
||||
BanPlaying = 4, --禁止游戏
|
||||
BanSameTable = 5 --禁止同桌
|
||||
DeleteMember = 1,-- 删除成员
|
||||
AddMember = 2,--添加成员
|
||||
SetFag = 3,--设置体力值
|
||||
BanPlaying = 4,--禁止游戏
|
||||
BanSameTable = 5--禁止同桌
|
||||
}
|
||||
local function CheckPermission(lev, permission)
|
||||
if lev == 2 and not permission then
|
||||
|
|
@ -115,20 +125,20 @@ end
|
|||
local function __change_fag(gid, pid, is_add, cur_hp, callback)
|
||||
local gniv = GroupNumberInputView.new(nil, function(num)
|
||||
num = ad2d((is_add and num or -num))
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_ChangeFag(gid, pid, num, function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
-- if gniv._is_destroy then
|
||||
-- return
|
||||
-- end
|
||||
if (res1.ReturnCode == 0) then
|
||||
callback(res1.Data)
|
||||
else
|
||||
ViewUtil.ErrorTip(res1.ReturnCode, "更改积分失败!")
|
||||
ViewUtil.ErrorTip(res1.ReturnCode,"更改积分失败!")
|
||||
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)
|
||||
gniv:Show()
|
||||
end
|
||||
|
|
@ -147,6 +157,7 @@ end
|
|||
|
||||
-- 填充合伙人对象
|
||||
function M:FillItem(obj, partner)
|
||||
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
local perm_array = MngPermission.getPermData(group.permission)
|
||||
|
||||
|
|
@ -181,9 +192,11 @@ function M:FillItem(obj, partner)
|
|||
end
|
||||
self.lst_partner.numItems = #self.partner_data
|
||||
-- 搜索出的玩家显示
|
||||
|
||||
end)
|
||||
end)
|
||||
obj:GetChild("btn_fag_minus").onClick:Set(function()
|
||||
|
||||
if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then
|
||||
return
|
||||
end
|
||||
|
|
@ -199,12 +212,13 @@ function M:FillItem(obj, partner)
|
|||
end
|
||||
self.lst_partner.numItems = #self.partner_data
|
||||
-- 搜索出的玩家显示
|
||||
|
||||
end)
|
||||
end)
|
||||
|
||||
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()
|
||||
|
|
@ -215,20 +229,20 @@ function M:FillItem(obj, partner)
|
|||
btnDetail.visible = partner.total > 0
|
||||
|
||||
btnDetail.onClick:Set(function()
|
||||
local GroupMngPartnerListView2 = GroupMngPartnerListView2.new(self.group_id, partner.uid)
|
||||
local GroupMngPartnerListView2 = GroupMngPartnerListView2.new(self.group_id,partner.uid)
|
||||
GroupMngPartnerListView2:Show()
|
||||
end)
|
||||
|
||||
local btn_bxx = obj:GetChild("btn_bxx")
|
||||
btn_bxx.onClick:Set(
|
||||
function()
|
||||
local ctrNum = 1
|
||||
local ctrNum=1
|
||||
if not (partner.lev == 3 and partner.partnerLev == 0) then
|
||||
ctrNum = 2
|
||||
end
|
||||
ctrNum = 2
|
||||
ctrNum=2
|
||||
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(
|
||||
function()
|
||||
btn_bxx.selected = false
|
||||
|
|
@ -239,6 +253,9 @@ function M:FillItem(obj, partner)
|
|||
)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-- 列表对象填充
|
||||
function M:OnRenderItem(index, obj)
|
||||
local partner = self.partner_data[index + 1]
|
||||
|
|
@ -247,8 +264,8 @@ end
|
|||
|
||||
-- 显示合伙人成员列表
|
||||
function M:ShowPartnerMemberList(partner_id)
|
||||
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
||||
pmlv:Show()
|
||||
local pmlv = GroupPartnerMemberListView.new(self.group_id, partner_id)
|
||||
pmlv:Show()
|
||||
end
|
||||
|
||||
-- 显示合伙人奖励
|
||||
|
|
|
|||
|
|
@ -261,14 +261,14 @@ function M:GetRewardsData()
|
|||
local data
|
||||
if #self.search_partner_data == 0 then
|
||||
if #self.partner_data == 0 then return end
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
data = self.partner_data[self.lst_partner.selectedIndex + 1]
|
||||
else
|
||||
data = self.search_partner_data[1]
|
||||
end
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetRewards(self.group_id, data.uid, data.partnerLev, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -296,7 +296,7 @@ function M:GetRewardsLog()
|
|||
local data
|
||||
if #self.search_partner_data == 0 then
|
||||
if #self.partner_data2 == 0 then return end
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
data = self.partner_data2[self.lst_partner2.selectedIndex + 1]
|
||||
else
|
||||
data = self.search_partner_data[1]
|
||||
|
|
@ -304,7 +304,7 @@ function M:GetRewardsLog()
|
|||
local begin_time, end_time = self.time_panel1:GetDate()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetRewardsLog(self.group_id, #self.rewards_log, 6, begin_time, end_time, data.uid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -333,13 +333,13 @@ end
|
|||
|
||||
-- 获取奖励统计
|
||||
function M:GetRewardsStatistic()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local data = self.partner_data2[self.lst_partner2.selectedIndex + 1]
|
||||
local begin_time, end_time = self.time_panel2:GetDate()
|
||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetRewardStatistic(self.group_id, pid, begin_time, end_time, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -429,9 +429,9 @@ function M:OnRenderRewardsItem(index, obj)
|
|||
end
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_SetRewards(self.group_id, data.pid, pdata.partnerLev, pdata.uid, false, tem, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置合伙人奖励失败")
|
||||
else
|
||||
|
|
@ -453,10 +453,10 @@ function M:OnRenderRewardsItem(index, obj)
|
|||
pdata = self.search_partner_data[1]
|
||||
end
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_SetRewards(self.group_id, data.pid, pdata.partnerLev, pdata.uid, true, data.cur_value,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置合伙人奖励失败")
|
||||
else
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ end
|
|||
-- local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
-- fgCtr:FG_GetMembersCount(self.group_id,function(res)
|
||||
|
||||
-- ViewUtil.CloseModalWait2()
|
||||
-- ViewUtil.CloseModalWait()
|
||||
|
||||
-- if res.ReturnCode == 0 then
|
||||
-- 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(
|
||||
function()
|
||||
--printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local text = self._view:GetChild('tex_id').text
|
||||
local qid, qnick
|
||||
if text == "" then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
return
|
||||
end
|
||||
|
|
@ -118,7 +118,7 @@ function M:InitView()
|
|||
function(res)
|
||||
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
||||
-- pt(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -149,7 +149,7 @@ function M:InitView()
|
|||
end
|
||||
|
||||
function M:GetRecordData(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
|
||||
local time_type = self._view:GetController("type").selectedIndex
|
||||
if self.begin_time ~= nil and self.end_time ~= nil then
|
||||
|
|
@ -158,7 +158,7 @@ function M:GetRecordData(index)
|
|||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetPartnerStat(self.group_id, index, 6, time_type, self.begin_time, self.end_time, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
|
||||
if res.ReturnCode == 0 then
|
||||
local members = res.Data.members
|
||||
|
|
@ -206,10 +206,10 @@ function M:FillRecordItem(data, obj)
|
|||
|
||||
local btn_check_members = obj:GetChild("btn_check_members")
|
||||
btn_check_members.onClick:Set(function()
|
||||
ViewUtil.ShowModalWait2(self._root_view)
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetTotalHp(self.group_id, data.uid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
local hp = d2ad(res.Data.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 fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_SetPartnerThreshold(self.group_id, data.uid, num, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置失败")
|
||||
else
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ function M:InitView()
|
|||
self:GetRecordData(self.lst_record.numItems)
|
||||
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()
|
||||
local ctr_page = self._view:GetController("type")
|
||||
ctr_page.onChanged:Set(function()
|
||||
|
|
@ -53,7 +52,8 @@ function M:InitView()
|
|||
end
|
||||
|
||||
function M:GetRecordData(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
|
||||
ViewUtil.ShowModalWait()
|
||||
|
||||
local time_type = self._view:GetController("type").selectedIndex
|
||||
|
||||
|
|
@ -62,35 +62,33 @@ function M:GetRecordData(index)
|
|||
end
|
||||
|
||||
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)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
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
|
||||
fgCtr:FG_GetGroupPersonRecord(self.group_id, GetPlatform(), DataManager.SelfUser.account_id, time_type, self.begin_time, self.end_time, index, 6, function(res)
|
||||
|
||||
printlog("ccccccccccccccccccccccccccccccccccc2222223333333333333333333333333333333", res.Data
|
||||
.total_round,
|
||||
" ", res.Data.valid_round)
|
||||
pt(res.Data)
|
||||
if index == 0 then
|
||||
--self._view:GetChild("tex_num1").text = ""..res.Data.total
|
||||
--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_valid_count").text = res.Data.valid_round / 100
|
||||
|
||||
self._view:GetChild("tex_total_proportion").text = d2ad(res.Data.total_win)
|
||||
end
|
||||
if self._is_destroy then
|
||||
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
|
||||
|
||||
printlog("ccccccccccccccccccccccccccccccccccc2222223333333333333333333333333333333",res.Data.total_round," ",res.Data.valid_round)
|
||||
pt(res.Data)
|
||||
if index == 0 then
|
||||
--self._view:GetChild("tex_num1").text = ""..res.Data.total
|
||||
--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_valid_count").text = res.Data.valid_round / 100
|
||||
|
||||
self._view:GetChild("tex_total_proportion").text = d2ad(res.Data.total_win)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:FillRecordItem(data, obj)
|
||||
|
|
@ -98,7 +96,7 @@ function M:FillRecordItem(data, obj)
|
|||
local room_id = data.room_id
|
||||
local create_time = data.create_time
|
||||
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 totalScore = json.decode(data.totalScore)
|
||||
local hpOnOff = data.hpOnOff
|
||||
|
|
@ -120,17 +118,17 @@ function M:FillRecordItem(data, obj)
|
|||
|
||||
obj:GetChild("tex_time").text = room_time_str
|
||||
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
|
||||
local lst_total = obj:GetChild("lst_total")
|
||||
lst_total:RemoveChildrenToPool()
|
||||
local ids = {}
|
||||
for j = 1, #totalScore do
|
||||
for j=1,#totalScore do
|
||||
local titem = lst_total:AddItemFromPool()
|
||||
local trdata = totalScore[j]
|
||||
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
|
||||
titem:GetChild("tex_id").text = "ID:" .. trdata.accId
|
||||
table.insert(ids, trdata.accId)
|
||||
titem:GetChild("tex_id").text = "ID:"..trdata.accId
|
||||
table.insert( ids, trdata.accId )
|
||||
|
||||
local score = trdata.score
|
||||
if trdata.hp == nil then
|
||||
|
|
@ -164,7 +162,7 @@ function M:FillRecordItem(data, obj)
|
|||
ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list)
|
||||
end)
|
||||
obj.onClick:Set(function()
|
||||
self:OnShowRecordInfo(data, ids)
|
||||
self:OnShowRecordInfo(data,ids)
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
@ -173,8 +171,9 @@ function M:OnRenderRecordItem(index, obj)
|
|||
self:FillRecordItem(data, obj)
|
||||
end
|
||||
|
||||
|
||||
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")
|
||||
local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView")
|
||||
result_view.visible = false
|
||||
|
|
@ -197,14 +196,14 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
|||
item:GetChild("score").text = score
|
||||
if score < 0 then item:GetController("di").selectedIndex = 1 end
|
||||
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
|
||||
end)
|
||||
else
|
||||
load_head_num = load_head_num - 1
|
||||
end
|
||||
end
|
||||
coroutine.start(function(...)
|
||||
coroutine.start(function ( ... )
|
||||
local left_time = 4
|
||||
while (true) do
|
||||
if load_head_num == 0 or left_time == 0 then
|
||||
|
|
@ -213,7 +212,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
|||
ShareScreenShotWithOption(function()
|
||||
result_view:Dispose()
|
||||
end)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
break
|
||||
end
|
||||
coroutine.wait(1)
|
||||
|
|
@ -222,7 +221,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
|||
end)
|
||||
end
|
||||
|
||||
function M:OnShowRecordInfo(rdata, ids)
|
||||
function M:OnShowRecordInfo(rdata,ids)
|
||||
local ctr_record = self._view:GetController("record")
|
||||
ctr_record.selectedIndex = 1
|
||||
|
||||
|
|
@ -234,7 +233,7 @@ function M:OnShowRecordInfo(rdata, ids)
|
|||
local playback_id = rdata.military_id
|
||||
local hpOnOff = rdata.hpOnOff
|
||||
local hpType = rdata.game_info.hpType
|
||||
for i = 1, round_count do
|
||||
for i = 1,round_count do
|
||||
local item = lst_recordInfo:AddItemFromPool()
|
||||
item:GetChild("tex_num").text = tostring(i)
|
||||
|
||||
|
|
@ -243,17 +242,17 @@ function M:OnShowRecordInfo(rdata, ids)
|
|||
|
||||
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 lst_total = item:GetChild("lst_total")
|
||||
lst_total:RemoveChildrenToPool()
|
||||
for k = 1, #round_score_item do
|
||||
for k=1,#round_score_item do
|
||||
local titem = lst_total:AddItemFromPool()
|
||||
local trdata = round_score_item[k]
|
||||
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
|
||||
if trdata.hp == nil then
|
||||
|
|
@ -273,11 +272,11 @@ function M:OnShowRecordInfo(rdata, ids)
|
|||
else
|
||||
item:GetController("person_num").selectedIndex = 0
|
||||
end
|
||||
local btn_play = item:GetChild("btn_play")
|
||||
local btn_play =item:GetChild("btn_play")
|
||||
btn_play.onClick:Set(function()
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
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
|
||||
room.lev = group.lev
|
||||
room.game_id = game_id
|
||||
|
|
@ -292,13 +291,13 @@ function M:OnShowRecordInfo(rdata, ids)
|
|||
main._totalRound = tonumber(rdata.round)
|
||||
main:FillRoomData(DataManager.SelfUser.playback[playback_id][i])
|
||||
else
|
||||
ViewUtil.ShowModalWait2(self._view)
|
||||
ViewUtil.ShowModalWait(self._view)
|
||||
local _data = {}
|
||||
_data["military_id"] = playback_id
|
||||
_data["round"] = tostring(i)
|
||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||
ViewUtil.CloseModalWait2()
|
||||
loddyCtr1:RequestPlayBack(_data,function(code,data)
|
||||
ViewUtil.CloseModalWait()
|
||||
if code == 0 then
|
||||
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
||||
DataManager.SelfUser.playback[playback_id][i] = data
|
||||
|
|
@ -325,7 +324,7 @@ function M:OnShowRecordInfo(rdata, ids)
|
|||
end
|
||||
|
||||
function M:GenaratePlayBack(id, game_id, ...)
|
||||
local tem = nil
|
||||
local tem =nil
|
||||
local dview_class = nil
|
||||
if not dview_class then
|
||||
local exconfig = ExtendManager.GetExtendConfig(game_id)
|
||||
|
|
@ -334,7 +333,7 @@ function M:GenaratePlayBack(id, game_id, ...)
|
|||
if not dview_class then
|
||||
return
|
||||
end
|
||||
local arg = { ... }
|
||||
local arg = {...}
|
||||
tem = dview_class.new(...)
|
||||
tem.Id = id
|
||||
tem:Show()
|
||||
|
|
|
|||
|
|
@ -13,62 +13,63 @@ function GroupMngPlayStatView.new(gid)
|
|||
end
|
||||
|
||||
function M:initData()
|
||||
|
||||
self:GetConsumeStatData()
|
||||
end
|
||||
|
||||
function M:InitView()
|
||||
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:SetVirtual()
|
||||
self.lst_consume_stat.itemRenderer = function(index, obj)
|
||||
self:OnRenderConsumeItem(index, obj)
|
||||
self:OnRenderConsumeItem(index, obj)
|
||||
end
|
||||
|
||||
self._view:GetChild("btn_search").onClick:Set(function()
|
||||
self.consume_stat = {}
|
||||
self.lst_consume_stat.numItems = 0
|
||||
self:GetConsumeStatData()
|
||||
self:GetConsumeStatData()
|
||||
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
|
||||
|
||||
function M:GetConsumeStatData()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local begin_time, end_time = self.time_panel:GetDate()
|
||||
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
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取统计数据失败")
|
||||
else
|
||||
self.consume_stat = res.Data.cosume_logs
|
||||
|
||||
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
|
||||
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].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)
|
||||
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].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].diamo_cost = (self.consume_stat[top].diamo_cost + self.consume_stat[i].diamo_cost)
|
||||
end
|
||||
|
||||
self.lst_consume_stat.numItems = #self.consume_stat
|
||||
self.lst_consume_stat.numItems = #self.consume_stat
|
||||
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:OnRenderConsumeItem(index, obj)
|
||||
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)
|
||||
obj:GetChild("title").text = play and play.name or "总计"
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ function GroupMngProportionView.new(gid)
|
|||
end
|
||||
|
||||
function M:initData()
|
||||
self.prop_data = {}
|
||||
self.lst_prop.numItems = 0
|
||||
self:GetPropData(0)
|
||||
self.prop_data = {}
|
||||
self.lst_prop.numItems = 0
|
||||
self:GetPropData(0)
|
||||
end
|
||||
|
||||
function M:FillView()
|
||||
|
|
@ -24,61 +24,60 @@ function M:FillView()
|
|||
|
||||
self.prop_data = {}
|
||||
self._view:GetChild("btn_search").onClick:Set(function()
|
||||
self:initData()
|
||||
self:initData()
|
||||
end)
|
||||
|
||||
self.lst_prop = self._view:GetChild("lst_proportion")
|
||||
self.lst_prop:SetVirtual()
|
||||
self.lst_prop.itemRenderer = function(index, obj)
|
||||
self:OnRenderPropItem(index, obj)
|
||||
self:OnRenderPropItem(index, obj)
|
||||
end
|
||||
self.lst_prop.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetPropData(self.lst_prop.numItems)
|
||||
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
|
||||
|
||||
-- 获取抽水数据
|
||||
function M:GetPropData(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
local begin_time, end_time = self.time_panel:GetDate()
|
||||
ViewUtil.ShowModalWait()
|
||||
local begin_time, end_time = self.time_panel:GetDate()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetPropLog(self.group_id, index, 8, begin_time, end_time, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
||||
else
|
||||
local props = res.Data.hp_logs
|
||||
if index == 0 then
|
||||
self._view:GetChild("tex_winner_count").text = res.Data.count
|
||||
local props = res.Data.hp_logs
|
||||
if index == 0 then
|
||||
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_winner_proportion").text = d2ad(res.Data.pump)
|
||||
self._view:GetChild("tex_total_proportion").text = d2ad(res.Data.gains)
|
||||
end
|
||||
if #props == 0 then return end
|
||||
for i = 1, #props do
|
||||
self.prop_data[#self.prop_data + 1] = props[i]
|
||||
end
|
||||
self.lst_prop.numItems = #self.prop_data
|
||||
self._view:GetChild("tex_winner_proportion").text = d2ad(res.Data.pump)
|
||||
self._view:GetChild("tex_total_proportion").text = d2ad(res.Data.gains)
|
||||
end
|
||||
if #props == 0 then return end
|
||||
for i = 1, #props do
|
||||
self.prop_data[#self.prop_data + 1] = props[i]
|
||||
end
|
||||
self.lst_prop.numItems = #self.prop_data
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- 填充抽水对象
|
||||
function M:OnRenderPropItem(index, obj)
|
||||
local tem = index + 1
|
||||
local data = self.prop_data[tem]
|
||||
obj:GetChild("tex_num").text = d2ad(math.abs(data.hp))
|
||||
obj:GetChild("tex_winner").text = ViewUtil.stringEllipsis(data.nick)
|
||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.pid)
|
||||
obj:GetChild("tex_game").text = play_name
|
||||
obj:GetChild("tex_roomid").text = data.roomid
|
||||
obj:GetChild("tex_date").text = os.date("%m月%d日\r%H:%M", data.time)
|
||||
local tem = index + 1
|
||||
local data = self.prop_data[tem]
|
||||
obj:GetChild("tex_num").text = d2ad(math.abs(data.hp))
|
||||
obj:GetChild("tex_winner").text = ViewUtil.stringEllipsis(data.nick)
|
||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.pid)
|
||||
obj:GetChild("tex_game").text = play_name
|
||||
obj:GetChild("tex_roomid").text = data.roomid
|
||||
obj:GetChild("tex_date").text = os.date("%m月%d日\r%H:%M", data.time)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -22,19 +22,19 @@ end
|
|||
|
||||
-- 初始化数据
|
||||
function M:initData()
|
||||
self.rank_data = {}
|
||||
self.round_data = {}
|
||||
self.rank_data = {}
|
||||
self.round_data = {}
|
||||
self.win_data = {}
|
||||
self.lst_rank.numItems = 0
|
||||
self.lst_round.numItems = 0
|
||||
local page = self._view:GetController("page").selectedIndex
|
||||
if page == 0 then
|
||||
self:GetRankData(0)
|
||||
elseif page == 1 then
|
||||
self:GetRoundData()
|
||||
self.lst_rank.numItems = 0
|
||||
self.lst_round.numItems = 0
|
||||
local page = self._view:GetController("page").selectedIndex
|
||||
if page == 0 then
|
||||
self:GetRankData(0)
|
||||
elseif page == 1 then
|
||||
self:GetRoundData()
|
||||
elseif page == 2 then
|
||||
self:GetWinRankData(0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 快速访问
|
||||
|
|
@ -57,7 +57,7 @@ function M:FillView()
|
|||
self.win_data = {}
|
||||
self._view:GetChild("btn_search").onClick:Set(function()
|
||||
self:clearRankData()
|
||||
self:GetRankData(#self.rank_data)
|
||||
self:GetRankData(#self.rank_data)
|
||||
end)
|
||||
|
||||
self._view:GetChild("btn_search1").onClick:Set(function()
|
||||
|
|
@ -69,7 +69,7 @@ function M:FillView()
|
|||
self.lst_rank = self._view:GetChild("lst_rank")
|
||||
self.lst_rank:SetVirtual()
|
||||
self.lst_rank.itemRenderer = function(index, obj)
|
||||
self:OnRenderRankItem(index, obj)
|
||||
self:OnRenderRankItem(index, obj)
|
||||
end
|
||||
self.lst_rank.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetRankData(self.lst_rank.numItems)
|
||||
|
|
@ -77,33 +77,33 @@ function M:FillView()
|
|||
self.lst_round = self._view:GetChild("lst_round")
|
||||
self.lst_round:SetVirtual()
|
||||
self.lst_round.itemRenderer = function(index, obj)
|
||||
self:OnRenderRoundItem(index, obj)
|
||||
self:OnRenderRoundItem(index, obj)
|
||||
end
|
||||
|
||||
|
||||
self.lst_winrank = self._view:GetChild("lst_winrank")
|
||||
self.lst_winrank:SetVirtual()
|
||||
self.lst_winrank.itemRenderer = function(index, obj)
|
||||
self:OnRenderWinRankItem(index, obj)
|
||||
self:OnRenderWinRankItem(index, obj)
|
||||
end
|
||||
self.lst_winrank.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetWinRankData(self.lst_winrank.numItems)
|
||||
end)
|
||||
|
||||
local ctr_page = self._view:GetController("page")
|
||||
ctr_page.onChanged:Set(function()
|
||||
if ctr_page.selectedIndex == 0 then
|
||||
local ctr_page = self._view:GetController("page")
|
||||
ctr_page.onChanged:Set(function()
|
||||
if ctr_page.selectedIndex == 0 then
|
||||
self.rank_data = {}
|
||||
self.lst_rank.numItems = 0
|
||||
self:GetRankData(0)
|
||||
self:GetRankData(0)
|
||||
elseif ctr_page.selectedIndex == 1 then
|
||||
self:GetRoundData()
|
||||
self:GetRoundData()
|
||||
else
|
||||
self.win_data = {}
|
||||
self.lst_winrank.numItems = 0
|
||||
self:GetWinRankData(0)
|
||||
end
|
||||
end)
|
||||
self:GetWinRankData(0)
|
||||
end
|
||||
end)
|
||||
|
||||
local items = {}
|
||||
local values = {}
|
||||
|
|
@ -111,99 +111,97 @@ function M:FillView()
|
|||
table.insert(values, "0")
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if #group.playList > 0 then
|
||||
for i = 1, #group.playList do
|
||||
local play = group.playList[i]
|
||||
table.insert(items, play.name)
|
||||
table.insert(values, tostring(play.id))
|
||||
end
|
||||
end
|
||||
for i = 1, #group.playList do
|
||||
local play = group.playList[i]
|
||||
table.insert(items, play.name)
|
||||
table.insert(values, tostring(play.id))
|
||||
end
|
||||
end
|
||||
local cb_play = self._view:GetChild("cb_play")
|
||||
cb_play.items = items
|
||||
cb_play.values = values
|
||||
cb_play.selectedIndex = 0
|
||||
|
||||
self._view:GetChild("cb_play").onChanged:Set(function()
|
||||
self.rank_data = {}
|
||||
self.round_data = {}
|
||||
self.rank_data = {}
|
||||
self.round_data = {}
|
||||
self.win_data = {}
|
||||
self.lst_rank.numItems = 0
|
||||
self.lst_round.numItems = 0
|
||||
self.lst_rank.numItems = 0
|
||||
self.lst_round.numItems = 0
|
||||
self.lst_winrank.numItems = 0
|
||||
if ctr_page.selectedIndex == 0 then
|
||||
self:GetRankData(0)
|
||||
if ctr_page.selectedIndex == 0 then
|
||||
self:GetRankData(0)
|
||||
elseif ctr_page.selectedIndex == 1 then
|
||||
self:GetRoundData()
|
||||
self:GetRoundData()
|
||||
else
|
||||
self:GetWinRankData(0)
|
||||
end
|
||||
end)
|
||||
|
||||
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
||||
-308, 0)
|
||||
self.time_panel1 = TimeSettingPanel.new(self._view, self._view:GetChild("btndate1"), self._view:GetChild("btndate2"),
|
||||
-308, 0)
|
||||
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0)
|
||||
self.time_panel1 = TimeSettingPanel.new(self._view, self._view:GetChild("btndate1"), self._view:GetChild("btndate2"), -308, 0)
|
||||
end
|
||||
|
||||
function M:GetRankData(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
local begin_time, end_time = self.time_panel:GetDate()
|
||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||
ViewUtil.ShowModalWait()
|
||||
local begin_time, end_time = self.time_panel:GetDate()
|
||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||
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
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
||||
else
|
||||
local ranks = res.Data.ranks
|
||||
if #ranks == 0 then return end
|
||||
for i = 1, #ranks do
|
||||
self.rank_data[#self.rank_data + 1] = ranks[i]
|
||||
end
|
||||
self.lst_rank.numItems = #self.rank_data
|
||||
self.zongren.text = "总人数:" .. res.Data.allActiveNum
|
||||
local ranks = res.Data.ranks
|
||||
if #ranks == 0 then return end
|
||||
for i = 1, #ranks do
|
||||
self.rank_data[#self.rank_data + 1] = ranks[i]
|
||||
end
|
||||
self.lst_rank.numItems = #self.rank_data
|
||||
self.zongren.text = "总人数:"..res.Data.allActiveNum
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:GetWinRankData(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
local begin_time, end_time = self.time_panel1:GetDate()
|
||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||
ViewUtil.ShowModalWait()
|
||||
local begin_time, end_time = self.time_panel1:GetDate()
|
||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||
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
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取总输赢排名信息失败")
|
||||
else
|
||||
local ranks = res.Data.ranks
|
||||
if #ranks == 0 then return end
|
||||
for i = 1, #ranks do
|
||||
self.win_data[#self.win_data + 1] = ranks[i]
|
||||
end
|
||||
local ranks = res.Data.ranks
|
||||
if #ranks == 0 then return end
|
||||
for i = 1, #ranks do
|
||||
self.win_data[#self.win_data + 1] = ranks[i]
|
||||
end
|
||||
-- table.sort(self.win_data,function (a,b)
|
||||
-- return a.win > b.win
|
||||
-- end)
|
||||
self.lst_winrank.numItems = #self.win_data
|
||||
self.zongren.text = "总人数:" .. res.Data.allActiveNum
|
||||
self.lst_winrank.numItems = #self.win_data
|
||||
self.zongren.text = "总人数:"..res.Data.allActiveNum
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:OnRenderRankItem(index, obj)
|
||||
local tem = index + 1
|
||||
local data = self.rank_data[tem]
|
||||
if tem < 4 then
|
||||
obj:GetController("order").selectedIndex = tem
|
||||
else
|
||||
local tem = index + 1
|
||||
local data = self.rank_data[tem]
|
||||
if tem < 4 then
|
||||
obj:GetController("order").selectedIndex = tem
|
||||
else
|
||||
obj:GetController("order").selectedIndex = 0
|
||||
obj:GetChild("tex_order").text = tem
|
||||
end
|
||||
obj:GetChild("tex_order").text = tem
|
||||
end
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
local str_nick = ViewUtil.stringEllipsis(data.nick)
|
||||
if group.lev ~= 3 then
|
||||
|
|
@ -216,14 +214,14 @@ function M:OnRenderRankItem(index, obj)
|
|||
end
|
||||
|
||||
function M:OnRenderWinRankItem(index, obj)
|
||||
local tem = index + 1
|
||||
local data = self.win_data[tem]
|
||||
if tem < 4 then
|
||||
obj:GetController("order").selectedIndex = tem
|
||||
else
|
||||
local tem = index + 1
|
||||
local data = self.win_data[tem]
|
||||
if tem < 4 then
|
||||
obj:GetController("order").selectedIndex = tem
|
||||
else
|
||||
obj:GetController("order").selectedIndex = 0
|
||||
obj:GetChild("tex_order").text = tem
|
||||
end
|
||||
obj:GetChild("tex_order").text = tem
|
||||
end
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
local str_nick = ViewUtil.stringEllipsis(data.nick)
|
||||
if group.lev ~= 3 then
|
||||
|
|
@ -236,28 +234,28 @@ function M:OnRenderWinRankItem(index, obj)
|
|||
end
|
||||
|
||||
function M:GetRoundData()
|
||||
ViewUtil.ShowModalWait2()
|
||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||
ViewUtil.ShowModalWait()
|
||||
local pid = tonumber(self._view:GetChild("cb_play").value)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetRoundStat(self.group_id, pid, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
||||
else
|
||||
self.round_data = res.Data.rounds
|
||||
self.lst_round.numItems = #self.round_data
|
||||
self.round_data = res.Data.rounds
|
||||
self.lst_round.numItems = #self.round_data
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:OnRenderRoundItem(index, obj)
|
||||
local tem = #self.round_data - index
|
||||
local data = self.round_data[tem]
|
||||
obj:GetChild("tex_time").text = os.date("%Y-%m-%d", data.time)
|
||||
obj:GetChild("tex_round").text = data.num
|
||||
local tem = #self.round_data - index
|
||||
local data = self.round_data[tem]
|
||||
obj:GetChild("tex_time").text = os.date("%Y-%m-%d", data.time)
|
||||
obj:GetChild("tex_round").text = data.num
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
local TimeSettingPanel = import(".TimeSettingPanel")
|
||||
-- 开桌统计
|
||||
local GroupMngRoomStatView = {}
|
||||
|
||||
|
|
@ -27,15 +26,11 @@ end
|
|||
function M:InitView()
|
||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupStat")
|
||||
|
||||
self.record_data = {} --回放数据
|
||||
self.record_data = {} --回放数据
|
||||
self.player_record_data = {} --指定玩家的回放数据
|
||||
self.qid = 0 --查询玩家id
|
||||
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 = self._view:GetChild("lst_record_find")
|
||||
self.lst_record_find:SetVirtual()
|
||||
self.lst_record_find.itemRenderer = function(index, obj)
|
||||
self:OnRenderRecordItem1(index, obj)
|
||||
|
|
@ -47,7 +42,7 @@ function M:InitView()
|
|||
self:OnRenderRecordItem(index, obj)
|
||||
end
|
||||
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetRecordData(self.lst_record.numItems)
|
||||
self:GetRecordData(self.lst_record.numItems)
|
||||
end)
|
||||
|
||||
self.lst_player_record = self._view:GetChild("lst_player_record")
|
||||
|
|
@ -56,7 +51,8 @@ function M:InitView()
|
|||
self:OnRenderPlayerRecordItem(index, obj)
|
||||
end
|
||||
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)
|
||||
|
||||
self._view:GetChild("btn_search").onClick:Set(function()
|
||||
|
|
@ -79,44 +75,44 @@ function M:InitView()
|
|||
self.qid = 0
|
||||
self.player_record_data = {}
|
||||
self.lst_player_record.numItems = 0
|
||||
self.isFindCode = false
|
||||
self.isFindCode=false
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
function M:GetRecordData(index, qid)
|
||||
qid = qid or 0
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetGroupRecordSpe(self.group_id, GetPlatform(), qid, 0, index, 6, self.begin_time, self.end_time, 0,
|
||||
function(res)
|
||||
printlog("ccccccccccccccccccccccccccccccccccccc")
|
||||
pt(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
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
|
||||
fgCtr:FG_GetGroupRecord(self.group_id, GetPlatform(), qid, index, 6, function(res)
|
||||
printlog("ccccccccccccccccccccccccccccccccccccc")
|
||||
pt(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
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
|
||||
end)
|
||||
end
|
||||
|
||||
function M:FillRecordItem(data, obj)
|
||||
|
|
@ -124,7 +120,7 @@ function M:FillRecordItem(data, obj)
|
|||
local room_id = data.room_id
|
||||
local create_time = data.create_time
|
||||
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 totalScore = json.decode(data.totalScore)
|
||||
local hpOnOff = data.hpOnOff
|
||||
|
|
@ -146,18 +142,18 @@ function M:FillRecordItem(data, obj)
|
|||
|
||||
obj:GetChild("tex_time").text = room_time_str
|
||||
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
|
||||
local lst_total = obj:GetChild("lst_total")
|
||||
lst_total:RemoveChildrenToPool()
|
||||
local ids = {}
|
||||
for j = 1, #totalScore do
|
||||
for j=1,#totalScore do
|
||||
local titem = lst_total:AddItemFromPool()
|
||||
local trdata = totalScore[j]
|
||||
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
|
||||
if trdata.hp == nil then
|
||||
if hpOnOff == 1 and hpType > 1 then
|
||||
|
|
@ -190,17 +186,17 @@ function M:FillRecordItem(data, obj)
|
|||
ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list)
|
||||
end)
|
||||
obj.onClick:Set(function()
|
||||
self:OnShowRecordInfo(data, ids)
|
||||
self:OnShowRecordInfo(data,ids)
|
||||
end)
|
||||
end
|
||||
|
||||
function M:OnRenderRecordItem(index, obj)
|
||||
local data = self.record_data[index + 1]
|
||||
local data = self.record_data[index + 1]
|
||||
self:FillRecordItem(data, obj)
|
||||
end
|
||||
|
||||
function M:OnRenderRecordItem1(index, obj)
|
||||
local data = self.tempRec[index + 1]
|
||||
local data=self.tempRec[index+1]
|
||||
self:FillRecordItem(data, obj)
|
||||
end
|
||||
|
||||
|
|
@ -209,15 +205,16 @@ function M:OnRenderPlayerRecordItem(index, obj)
|
|||
self:FillRecordItem(data, obj)
|
||||
end
|
||||
|
||||
|
||||
function M:GetRecordByRoomid()
|
||||
local qid = self._view:GetChild("tex_id").text
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetRecordByRoomid(self.group_id, qid, GetPlatform(), function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
|
||||
else
|
||||
|
|
@ -225,8 +222,8 @@ function M:GetRecordByRoomid()
|
|||
ViewUtil.ErrorTip(nil, "没有找到回放")
|
||||
return
|
||||
end
|
||||
self.tempRec = res.Data.rec
|
||||
self.lst_record_find.numItems = #res.Data.rec
|
||||
self.tempRec=res.Data.rec
|
||||
self.lst_record_find.numItems = #res.Data.rec
|
||||
|
||||
self._view:GetController("search").selectedIndex = 1
|
||||
end
|
||||
|
|
@ -234,7 +231,7 @@ function M:GetRecordByRoomid()
|
|||
end
|
||||
|
||||
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")
|
||||
local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView")
|
||||
result_view.visible = false
|
||||
|
|
@ -257,14 +254,14 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
|||
item:GetChild("score").text = score
|
||||
if score < 0 then item:GetController("di").selectedIndex = 1 end
|
||||
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
|
||||
end)
|
||||
else
|
||||
load_head_num = load_head_num - 1
|
||||
end
|
||||
end
|
||||
coroutine.start(function(...)
|
||||
coroutine.start(function ( ... )
|
||||
local left_time = 4
|
||||
while (true) do
|
||||
if load_head_num == 0 or left_time == 0 then
|
||||
|
|
@ -273,7 +270,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
|||
ShareScreenShotWithOption(function()
|
||||
result_view:Dispose()
|
||||
end)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
break
|
||||
end
|
||||
coroutine.wait(1)
|
||||
|
|
@ -282,7 +279,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
|
|||
end)
|
||||
end
|
||||
|
||||
function M:OnShowRecordInfo(rdata, ids)
|
||||
function M:OnShowRecordInfo(rdata,ids)
|
||||
local ctr_record = self._view:GetController("record")
|
||||
ctr_record.selectedIndex = 1
|
||||
|
||||
|
|
@ -295,21 +292,21 @@ function M:OnShowRecordInfo(rdata, ids)
|
|||
local hpOnOff = rdata.hpOnOff
|
||||
local hpType = rdata.game_info.hpType
|
||||
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()
|
||||
item:GetChild("tex_num").text = tostring(i)
|
||||
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
|
||||
local round_score_str = rdata["round_" .. i]
|
||||
local round_score_str = rdata["round_"..i]
|
||||
local round_score_item = json.decode(round_score_str)
|
||||
local lst_total = item:GetChild("lst_total")
|
||||
lst_total:RemoveChildrenToPool()
|
||||
for k = 1, #round_score_item do
|
||||
for k=1,#round_score_item do
|
||||
local titem = lst_total:AddItemFromPool()
|
||||
local trdata = round_score_item[k]
|
||||
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
|
||||
if trdata.hp == nil then
|
||||
if hpOnOff == 1 and hpType > 1 then
|
||||
|
|
@ -328,11 +325,11 @@ function M:OnShowRecordInfo(rdata, ids)
|
|||
item:GetController("person_num").selectedIndex = 0
|
||||
end
|
||||
|
||||
local btn_play = item:GetChild("btn_play")
|
||||
local btn_play =item:GetChild("btn_play")
|
||||
btn_play.onClick:Set(function()
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
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
|
||||
room.lev = group.lev
|
||||
room.game_id = game_id
|
||||
|
|
@ -347,13 +344,13 @@ function M:OnShowRecordInfo(rdata, ids)
|
|||
main._totalRound = tonumber(rdata.round)
|
||||
main:FillRoomData(DataManager.SelfUser.playback[playback_id][i])
|
||||
else
|
||||
ViewUtil.ShowModalWait2(self._view)
|
||||
ViewUtil.ShowModalWait(self._view)
|
||||
local _data = {}
|
||||
_data["military_id"] = playback_id
|
||||
_data["round"] = tostring(i)
|
||||
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
||||
loddyCtr1:RequestPlayBack(_data, function(code, data)
|
||||
ViewUtil.CloseModalWait2()
|
||||
loddyCtr1:RequestPlayBack(_data,function(code,data)
|
||||
ViewUtil.CloseModalWait()
|
||||
if code == 0 then
|
||||
if DataManager.SelfUser.playback[playback_id] ~= nil then
|
||||
DataManager.SelfUser.playback[playback_id][i] = data
|
||||
|
|
@ -380,7 +377,7 @@ function M:OnShowRecordInfo(rdata, ids)
|
|||
end
|
||||
|
||||
function M:GenaratePlayBack(id, game_id, ...)
|
||||
local tem = nil
|
||||
local tem =nil
|
||||
local dview_class = nil
|
||||
if not dview_class then
|
||||
local exconfig = ExtendManager.GetExtendConfig(game_id)
|
||||
|
|
@ -389,7 +386,7 @@ function M:GenaratePlayBack(id, game_id, ...)
|
|||
if not dview_class then
|
||||
return
|
||||
end
|
||||
local arg = { ... }
|
||||
local arg = {...}
|
||||
tem = dview_class.new(...)
|
||||
tem.Id = id
|
||||
tem:Show()
|
||||
|
|
|
|||
|
|
@ -19,13 +19,16 @@ function M:initData()
|
|||
self.lst_record.numItems = 0
|
||||
self.record_data = {}
|
||||
|
||||
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 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})
|
||||
self.begin_time = today
|
||||
self.end_time = today + 86400
|
||||
self:GetRecordData(0)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
function M:InitView()
|
||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupXingYunStat")
|
||||
|
||||
|
|
@ -46,21 +49,20 @@ function M:InitView()
|
|||
self:GetRecordData(self.lst_record.numItems)
|
||||
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")
|
||||
ctr_page.onChanged:Set(function()
|
||||
self.record_data = {}
|
||||
self.lst_record.numItems = 0
|
||||
if ctr_page.selectedIndex == 0 then
|
||||
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 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})
|
||||
self.begin_time = today
|
||||
self.end_time = today + 86400
|
||||
else
|
||||
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 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})
|
||||
self.begin_time = today - 86400 * ctr_page.selectedIndex
|
||||
self.end_time = today - 86400 * (ctr_page.selectedIndex - 1)
|
||||
end
|
||||
|
|
@ -76,10 +78,13 @@ function M:InitView()
|
|||
end)
|
||||
|
||||
self.totalwin = self._view:GetChild("tex_alltotal")
|
||||
|
||||
end
|
||||
|
||||
|
||||
function M:GetRecordData(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
|
||||
ViewUtil.ShowModalWait()
|
||||
|
||||
local time_type = self._view:GetController("type").selectedIndex
|
||||
if self.begin_time ~= nil and self.end_time ~= nil then
|
||||
|
|
@ -87,10 +92,12 @@ function M:GetRecordData(index)
|
|||
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.CloseModalWait2()
|
||||
fgCtr:FG_GetXingYunStat(self.group_id, index, 6, time_type,self.begin_time,self.end_time,function(res)
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
|
||||
if res.ReturnCode == 0 then
|
||||
|
||||
local members = res.Data.members
|
||||
|
||||
self.totalwin.text = d2ad(res.Data.all_total_win)
|
||||
|
|
@ -102,14 +109,17 @@ function M:GetRecordData(index)
|
|||
end)
|
||||
end
|
||||
|
||||
function M:FillRecordItem(data, obj)
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
obj:GetChild("tex_round_total").text = data.total_round
|
||||
obj:GetChild("tex_total").text = d2ad(data.total_win)
|
||||
function M:FillRecordItem(data, obj)
|
||||
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
obj:GetChild("tex_round_total").text = data.total_round
|
||||
obj:GetChild("tex_total").text = d2ad(data.total_win)
|
||||
obj:GetChild("tex_round_youxiao").text = data.valid_round / 100
|
||||
|
||||
end
|
||||
|
||||
function M:OnRenderRecordItem(index, obj)
|
||||
|
|
@ -117,4 +127,5 @@ function M:OnRenderRecordItem(index, obj)
|
|||
self:FillRecordItem(data, obj)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
|
@ -19,13 +19,16 @@ function M:initData()
|
|||
self.lst_record.numItems = 0
|
||||
self.record_data = {}
|
||||
|
||||
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 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})
|
||||
self.begin_time = today
|
||||
self.end_time = today + 86400
|
||||
self:GetRecordData(0)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
function M:InitView()
|
||||
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupZuanShi")
|
||||
|
||||
|
|
@ -49,21 +52,20 @@ function M:InitView()
|
|||
self:GetRecordData(self.lst_record.numItems)
|
||||
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")
|
||||
ctr_page.onChanged:Set(function()
|
||||
self.record_data = {}
|
||||
self.lst_record.numItems = 0
|
||||
if ctr_page.selectedIndex == 0 then
|
||||
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 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})
|
||||
self.begin_time = today
|
||||
self.end_time = today + 86400
|
||||
else
|
||||
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 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})
|
||||
self.begin_time = today - 86400 * ctr_page.selectedIndex
|
||||
self.end_time = today - 86400 * (ctr_page.selectedIndex - 1)
|
||||
end
|
||||
|
|
@ -76,11 +78,11 @@ function M:InitView()
|
|||
self._view:GetChild('btn_search').onClick:Set(
|
||||
function()
|
||||
--printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local text = self._view:GetChild('tex_id').text
|
||||
local qid, qnick
|
||||
if text == "" then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
return
|
||||
end
|
||||
|
|
@ -93,11 +95,11 @@ function M:InitView()
|
|||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_FindZuanShiStat(
|
||||
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)
|
||||
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
||||
-- pt(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -111,7 +113,7 @@ function M:InitView()
|
|||
|
||||
for j = 1, #res.Data.members do
|
||||
local tem = item_result:AddItemFromPool()
|
||||
self:FillRecordItem(res.Data.members[j], tem)
|
||||
self:FillRecordItem(res.Data.members[j],tem)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -127,8 +129,10 @@ function M:InitView()
|
|||
)
|
||||
end
|
||||
|
||||
|
||||
function M:GetRecordData(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
|
||||
ViewUtil.ShowModalWait()
|
||||
|
||||
local time_type = self._view:GetController("type").selectedIndex
|
||||
if self.begin_time ~= nil and self.end_time ~= nil then
|
||||
|
|
@ -136,13 +140,15 @@ function M:GetRecordData(index)
|
|||
end
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetZuanShiStat(self.group_id, index, 6, time_type, self.begin_time, self.end_time, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
fgCtr:FG_GetZuanShiStat(self.group_id, index, 6, time_type,self.begin_time,self.end_time,function(res)
|
||||
|
||||
ViewUtil.CloseModalWait()
|
||||
|
||||
if res.ReturnCode == 0 then
|
||||
|
||||
local members = res.Data.members
|
||||
--printlog("aaaaaaaaaaaaaacccccccccccccccccccccccccccccccc")
|
||||
--pt(res)
|
||||
--pt(res)
|
||||
for i = 1, #members do
|
||||
self.record_data[#self.record_data + 1] = members[i]
|
||||
end
|
||||
|
|
@ -167,10 +173,11 @@ local function __showRewardsValue(rtype, cur_value, max_value, mng)
|
|||
end
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
|
@ -182,9 +189,10 @@ function M:FillRecordItem(data, obj)
|
|||
btn_detail.onClick:Set(function()
|
||||
local time_type = self._view:GetController("type").selectedIndex
|
||||
--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()
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
function M:OnRenderRecordItem(index, obj)
|
||||
|
|
@ -192,4 +200,5 @@ function M:OnRenderRecordItem(index, obj)
|
|||
self:FillRecordItem(data, obj)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
|
@ -4,9 +4,9 @@ local GroupPartnerBanPlaysView = {}
|
|||
|
||||
local M = GroupPartnerBanPlaysView
|
||||
|
||||
function GroupPartnerBanPlaysView.new(group_id, uid)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
function GroupPartnerBanPlaysView.new(group_id,uid)
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupPartnerBanPlaysView"
|
||||
self._close_destroy = true
|
||||
self.group_id = group_id
|
||||
|
|
@ -17,12 +17,13 @@ function GroupPartnerBanPlaysView.new(group_id, uid)
|
|||
end
|
||||
|
||||
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:SetVirtual()
|
||||
self.lst_allplays.itemRenderer = function(index, obj)
|
||||
self:OnRenderAllPlaysItem(index, obj)
|
||||
|
||||
self:OnRenderAllPlaysItem(index, obj)
|
||||
end
|
||||
self:GetBanPlaysData()
|
||||
end
|
||||
|
|
@ -30,8 +31,8 @@ end
|
|||
-- 获取奖励设置数据
|
||||
function M:GetBanPlaysData()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetAllplays(self.group_id, self.uid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
fgCtr:FG_GetAllplays(self.group_id,self.uid, function(res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -39,7 +40,7 @@ function M:GetBanPlaysData()
|
|||
ViewUtil.ErrorTip(res.ReturnCode, "获取所有玩法失败")
|
||||
else
|
||||
local allplays = res.Data.allplays
|
||||
for i = 1, #allplays do
|
||||
for i=1,#allplays do
|
||||
self.allplays_data[i] = allplays[i]
|
||||
end
|
||||
self.lst_allplays.numItems = #self.allplays_data
|
||||
|
|
@ -47,21 +48,23 @@ function M:GetBanPlaysData()
|
|||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- 填充奖励设置对象
|
||||
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 play_name = group:getPlayName(data.pid)
|
||||
obj:GetChild("tex_name").text = data.playname
|
||||
local play_name = group:getPlayName(data.pid)
|
||||
obj:GetChild("tex_name").text = data.playname
|
||||
|
||||
obj:GetChild("gxbtn").selected = data.ban == 1
|
||||
obj:GetChild("gxbtn").selected = data.ban==1
|
||||
|
||||
obj:GetChild("gxbtn").onClick:Set(function()
|
||||
local bans = data.ban
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_SetBanPlayid(self.group_id, data.pid, data.ban, self.uid, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
fgCtr:FG_SetBanPlayid(self.group_id,data.pid,data.ban,self.uid, function(res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -69,11 +72,13 @@ function M:OnRenderAllPlaysItem(index, obj)
|
|||
ViewUtil.ErrorTip(res.ReturnCode, "设置玩法失败")
|
||||
else
|
||||
local banoks = res.Data.allplays
|
||||
obj:GetChild("gxbtn").selected = banoks[1].banok == 1
|
||||
obj:GetChild("gxbtn").selected = banoks[1].banok==1
|
||||
self:GetBanPlaysData()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -6,8 +6,8 @@ local GroupPartnerMemberListView = {}
|
|||
local M = GroupPartnerMemberListView
|
||||
|
||||
function GroupPartnerMemberListView.new(group_id, partner_id)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupPartnerMemberListView"
|
||||
self._close_destroy = true
|
||||
self._blur_view = blur_view
|
||||
|
|
@ -21,12 +21,12 @@ function GroupPartnerMemberListView.new(group_id, partner_id)
|
|||
end
|
||||
|
||||
function M:initView(url)
|
||||
BaseWindow.init(self, "ui://NewGroup/Win_PartnerMemberList")
|
||||
-- 合伙人列表
|
||||
self.lst_member = self._view:GetChild("lst_member")
|
||||
BaseWindow.init(self, "ui://NewGroup/Win_PartnerMemberList")
|
||||
-- 合伙人列表
|
||||
self.lst_member = self._view:GetChild("lst_member")
|
||||
self.lst_member:SetVirtual()
|
||||
self.lst_member.itemRenderer = function(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
self:OnRenderItem(index, obj)
|
||||
end
|
||||
self.lst_member.scrollPane.onPullUpRelease:Set(function()
|
||||
self:GetMemberData(self.lst_member.numItems)
|
||||
|
|
@ -48,21 +48,21 @@ function M:initView(url)
|
|||
local btn_search = self._view:GetChild("btn_search")
|
||||
local ctr_search = self._view:GetController("search")
|
||||
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)
|
||||
if #data == 0 then
|
||||
ViewUtil.ErrorTip(nil, "没有找到成员")
|
||||
else
|
||||
ctr_search.selectedIndex = 1
|
||||
self:FillItem(self._view:GetChild("item_result"), data[1])
|
||||
end
|
||||
if #data == 0 then
|
||||
ViewUtil.ErrorTip(nil, "没有找到成员")
|
||||
else
|
||||
ctr_search.selectedIndex = 1
|
||||
self:FillItem(self._view:GetChild("item_result"), data[1])
|
||||
end
|
||||
end)
|
||||
end)
|
||||
gfiv:Show()
|
||||
end)
|
||||
local btn_back = self._view:GetChild("btn_back")
|
||||
btn_back.onClick:Set(function()
|
||||
ctr_search.selectedIndex = 0
|
||||
ctr_search.selectedIndex = 0
|
||||
end)
|
||||
|
||||
-- 初始化数据
|
||||
|
|
@ -71,35 +71,37 @@ end
|
|||
|
||||
-- 获取合伙人成员数据
|
||||
function M:GetMemberData(index, quary_id, callback)
|
||||
quary_id = quary_id or 0
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if index == 0 then
|
||||
self.member_data = {}
|
||||
end
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
quary_id = quary_id or 0
|
||||
local group = DataManager.groups:get(self.group_id)
|
||||
if index == 0 then
|
||||
self.member_data = {}
|
||||
end
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetPartnerMembers(self.group_id, self.partner_id[self.top], index, 8, quary_id, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人成员列表失败")
|
||||
else
|
||||
local members = res.Data.members
|
||||
if quary_id == 0 then
|
||||
for i = 1, #members do
|
||||
self.member_data[#self.member_data + 1] = members[i]
|
||||
end
|
||||
self.lst_member.numItems = #self.member_data
|
||||
else
|
||||
callback(members)
|
||||
end
|
||||
local members = res.Data.members
|
||||
if quary_id == 0 then
|
||||
for i = 1, #members do
|
||||
self.member_data[#self.member_data + 1] = members[i]
|
||||
end
|
||||
self.lst_member.numItems = #self.member_data
|
||||
else
|
||||
callback(members)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
-- 填充合伙人成员对象
|
||||
function M:FillItem(obj, data)
|
||||
obj:GetChild("tex_id").text = data.uid
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
|
||||
obj:GetChild("tex_id").text = data.uid
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
|
||||
obj:GetChild("btn_head").icon = "ui://Common/Head0"
|
||||
ImageLoad.Load(data.portrait, obj:GetChild("btn_head")._iconObject, self.class)
|
||||
|
|
@ -113,17 +115,16 @@ function M:FillItem(obj, data)
|
|||
obj:GetController("partner").selectedIndex = data.partnerLev > 0 and 1 or 0
|
||||
|
||||
obj:GetChild("btn_check_members").onClick:Set(function()
|
||||
self.partner_id[#self.partner_id + 1] = data.uid
|
||||
self.top = #self.partner_id
|
||||
self._view:GetController("pre").selectedIndex = 1
|
||||
self:GetMemberData(0)
|
||||
self.partner_id[#self.partner_id + 1] = data.uid
|
||||
self.top = #self.partner_id
|
||||
self._view:GetController("pre").selectedIndex = 1
|
||||
self:GetMemberData(0)
|
||||
end)
|
||||
end
|
||||
|
||||
-- 填充列表
|
||||
function M:OnRenderItem(index, obj)
|
||||
local data = self.member_data[index + 1]
|
||||
self:FillItem(obj, data)
|
||||
local data = self.member_data[index + 1]
|
||||
self:FillItem(obj, data)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -36,7 +36,7 @@ end
|
|||
function M:GetRewardsData()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetRewards(self.group_id, self.partner_id, self.partner_lev, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -92,7 +92,7 @@ function M:OnRenderRewardsItem(index, obj)
|
|||
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))
|
||||
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,
|
||||
data.rewardValueType or 1)
|
||||
obj:GetChild("tex_anchou").text = __showRewardsValue(data.anchou_rewardType, data.anchou_cur_value,
|
||||
|
|
@ -120,9 +120,9 @@ function M:OnRenderRewardsItem(index, obj)
|
|||
end
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_SetRewards(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置合伙人奖励失败")
|
||||
else
|
||||
|
|
@ -141,10 +141,10 @@ function M:OnRenderRewardsItem(index, obj)
|
|||
msg_win.onOk:Add(function(...)
|
||||
local single = msg_win.btnCheck.selected and 1 or 0
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_SetRewards(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.cur_value, single,
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置奖励失败")
|
||||
else
|
||||
|
|
@ -181,9 +181,9 @@ function M:OnRenderRewardsItem(index, obj)
|
|||
end
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_SetXIPAI(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置洗牌奖励失败")
|
||||
else
|
||||
|
|
@ -203,25 +203,25 @@ function M:OnRenderRewardsItem(index, obj)
|
|||
local single = 0 --msg_win.btnCheck.selected and 1 or 0
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_SetXIPAI(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.xipai_cur_value,
|
||||
single, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置洗牌失败")
|
||||
else
|
||||
ViewUtil.ErrorTip(-1, "设置洗牌成功")
|
||||
-- printlog("ccccccccccccccccc11111111111111111111111")
|
||||
-- pt(res)
|
||||
-- for i = 1, #self.rewards_data do
|
||||
-- if self.rewards_data[i].xipai_rewardValueType == data.xipai_rewardValueType then
|
||||
-- self.rewards_data[i].xipai_cur_value = data.xipai_cur_value
|
||||
-- end
|
||||
-- end
|
||||
-- self.lst_rewards.numItems = #self.rewards_data
|
||||
self:GetRewardsData()
|
||||
end
|
||||
end)
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置洗牌失败")
|
||||
else
|
||||
ViewUtil.ErrorTip(-1, "设置洗牌成功")
|
||||
-- printlog("ccccccccccccccccc11111111111111111111111")
|
||||
-- pt(res)
|
||||
-- for i = 1, #self.rewards_data do
|
||||
-- if self.rewards_data[i].xipai_rewardValueType == data.xipai_rewardValueType then
|
||||
-- self.rewards_data[i].xipai_cur_value = data.xipai_cur_value
|
||||
-- end
|
||||
-- end
|
||||
-- self.lst_rewards.numItems = #self.rewards_data
|
||||
self:GetRewardsData()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
msg_win:Show()
|
||||
end)
|
||||
|
|
@ -245,9 +245,9 @@ function M:OnRenderRewardsItem(index, obj)
|
|||
end
|
||||
printlog("jefe btn_set2")
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_SetANCHOU(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置管理奖励失败")
|
||||
else
|
||||
|
|
@ -267,25 +267,25 @@ function M:OnRenderRewardsItem(index, obj)
|
|||
local single = 0 --msg_win.btnCheck.selected and 1 or 0
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
fgCtr:FG_SetANCHOU(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.anchou_cur_value,
|
||||
single, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置管理失败")
|
||||
else
|
||||
ViewUtil.ErrorTip(-1, "设置管理成功")
|
||||
-- printlog("ccccccccccccccccc11111111111111111111111")
|
||||
-- pt(res)
|
||||
-- for i = 1, #self.rewards_data do
|
||||
-- if self.rewards_data[i].xipai_rewardValueType == data.xipai_rewardValueType then
|
||||
-- self.rewards_data[i].xipai_cur_value = data.anchou_cur_value
|
||||
-- end
|
||||
-- end
|
||||
-- self.lst_rewards.numItems = #self.rewards_data
|
||||
self:GetRewardsData()
|
||||
end
|
||||
end)
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "设置管理失败")
|
||||
else
|
||||
ViewUtil.ErrorTip(-1, "设置管理成功")
|
||||
-- printlog("ccccccccccccccccc11111111111111111111111")
|
||||
-- pt(res)
|
||||
-- for i = 1, #self.rewards_data do
|
||||
-- if self.rewards_data[i].xipai_rewardValueType == data.xipai_rewardValueType then
|
||||
-- self.rewards_data[i].xipai_cur_value = data.anchou_cur_value
|
||||
-- end
|
||||
-- end
|
||||
-- self.lst_rewards.numItems = #self.rewards_data
|
||||
self:GetRewardsData()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
msg_win:Show()
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ local GroupPartnerScoreMgnView = {}
|
|||
local M = GroupPartnerScoreMgnView
|
||||
|
||||
function GroupPartnerScoreMgnView.new(group_id, member)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupPartnerScoreMgnView"
|
||||
self._close_destroy = true
|
||||
-- self._blur_view = blur_view
|
||||
|
|
@ -18,39 +18,44 @@ function GroupPartnerScoreMgnView.new(group_id, member)
|
|||
return self
|
||||
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 value = limit
|
||||
if otype == 1 then
|
||||
value = value + ad2d(num)
|
||||
elseif otype == -1 then
|
||||
elseif otype == - 1 then
|
||||
value = value - ad2d(num)
|
||||
else
|
||||
value = ad2d(num)
|
||||
end
|
||||
|
||||
if value < 0 then
|
||||
ViewUtil.ErrorTip(1, "更改失败!")
|
||||
ViewUtil.ErrorTip(1,"更改失败!")
|
||||
end
|
||||
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_SetTransHPLimit(gid, pid, value, function(res1)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
|
||||
if (res1.ReturnCode == 0) then
|
||||
callback(res1.Data)
|
||||
else
|
||||
ViewUtil.ErrorTip(res1.ReturnCode, "更改失败!")
|
||||
ViewUtil.ErrorTip(res1.ReturnCode,"更改失败!")
|
||||
end
|
||||
end)
|
||||
|
||||
end, 0, nil)
|
||||
gniv:Show()
|
||||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
|
||||
BaseWindow.init(self,url)
|
||||
|
||||
local member = self.member
|
||||
|
||||
|
|
@ -69,23 +74,28 @@ function M:init(url)
|
|||
ImageLoad.Load(member.portrait, self._view:GetChild("btn_head")._iconObject, self.class)
|
||||
|
||||
self._view:GetChild("btn_fag_add").onClick:Set(function()
|
||||
__change_limit(self.group_id, member.uid, 1, self.limit, function(data)
|
||||
self.limit = data.limit
|
||||
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
||||
|
||||
__change_limit(self.group_id, member.uid, 1, self.limit,function(data)
|
||||
self.limit = data.limit
|
||||
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
||||
end)
|
||||
end)
|
||||
|
||||
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
|
||||
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
||||
|
||||
|
||||
__change_limit(self.group_id, member.uid, -1, self.limit,function(data)
|
||||
self.limit = data.limit
|
||||
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
||||
end)
|
||||
end)
|
||||
|
||||
self._view:GetChild("btn_manager").onClick:Set(function()
|
||||
__change_limit(self.group_id, member.uid, 0, self.limit, function(data)
|
||||
self.limit = data.limit
|
||||
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
||||
|
||||
|
||||
__change_limit(self.group_id, member.uid, 0, self.limit,function(data)
|
||||
self.limit = data.limit
|
||||
self._view:GetChild("tex_fag").text = d2ad(self.limit)
|
||||
end)
|
||||
end)
|
||||
|
||||
|
|
@ -93,14 +103,16 @@ function M:init(url)
|
|||
end
|
||||
|
||||
function M:GetTransHPLimit()
|
||||
ViewUtil.ShowModalWait2()
|
||||
|
||||
ViewUtil.ShowModalWait()
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetTransHPLimit(self.group_id, self.member.uid, function(res)
|
||||
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
||||
|
|
@ -112,4 +124,5 @@ function M:GetTransHPLimit()
|
|||
end)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
|
@ -5,8 +5,8 @@ local GroupPartnerStatMember = {}
|
|||
local M = GroupPartnerStatMember
|
||||
|
||||
function GroupPartnerStatMember.new(group_id, uid, time_type, begin_time, end_time)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupPartnerStatMember"
|
||||
self._close_destroy = true
|
||||
self.group_id = group_id
|
||||
|
|
@ -23,8 +23,9 @@ function GroupPartnerStatMember.new(group_id, uid, time_type, begin_time, end_ti
|
|||
return self
|
||||
end
|
||||
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
self.members_log = {}
|
||||
self.lst_member = self._view:GetChild("lst_member")
|
||||
self.lst_member:SetVirtual()
|
||||
|
|
@ -54,79 +55,80 @@ function M:init(url)
|
|||
self:getRewardsLog(0)
|
||||
end)
|
||||
|
||||
-- 搜索玩家
|
||||
local ctr_search = self._view:GetController('search')
|
||||
self._view:GetChild('btn_search').onClick:Set(
|
||||
function()
|
||||
-- 搜索玩家
|
||||
local ctr_search = self._view:GetController('search')
|
||||
self._view:GetChild('btn_search').onClick:Set(
|
||||
function()
|
||||
-- printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
local text = self._view:GetChild('tex_id').text
|
||||
local qid, qnick
|
||||
if text == "" then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
return
|
||||
end
|
||||
qid = tonumber(text) or 0
|
||||
qnick = text
|
||||
local time_type = 0
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local text = self._view:GetChild('tex_id').text
|
||||
local qid, qnick
|
||||
if text == "" then
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
return
|
||||
end
|
||||
qid = tonumber(text) or 0
|
||||
qnick = text
|
||||
local time_type = 0
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_FindPartnerStatMember(
|
||||
self.group_id, self.uids[#self.uids], 0,
|
||||
qid, 0, 6, time_type, self.begin_time, self.end_time,
|
||||
function(res)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_FindPartnerStatMember(
|
||||
self.group_id,self.uids[#self.uids],0,
|
||||
qid,0, 6, time_type,self.begin_time,self.end_time,
|
||||
function(res)
|
||||
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
||||
-- pt(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, '找不到成员')
|
||||
else
|
||||
self._view:GetChild('tex_id').text = ''
|
||||
ctr_search.selectedIndex = 1
|
||||
local item_result = self._view:GetChild('lst_member_find')
|
||||
item_result:RemoveChildrenToPool()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, '找不到成员')
|
||||
else
|
||||
self._view:GetChild('tex_id').text = ''
|
||||
ctr_search.selectedIndex = 1
|
||||
local item_result = self._view:GetChild('lst_member_find')
|
||||
item_result:RemoveChildrenToPool()
|
||||
|
||||
for j = 1, #res.Data.members do
|
||||
local tem = item_result:AddItemFromPool()
|
||||
self:FillRecordItem(res.Data.members[j], tem)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
for j = 1, #res.Data.members do
|
||||
local tem = item_result:AddItemFromPool()
|
||||
self:FillRecordItem(res.Data.members[j],tem)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
|
||||
local btn_back1 = self._view:GetChild('btn_back1')
|
||||
btn_back1.onClick:Set(
|
||||
function()
|
||||
local btn_back1 = self._view:GetChild('btn_back1')
|
||||
btn_back1.onClick:Set(
|
||||
function()
|
||||
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
function M:getRewardsLog(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
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)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
||||
else
|
||||
local member_logs = res.Data.members
|
||||
if #member_logs > 0 then
|
||||
for i = 1, #member_logs do
|
||||
table.insert(self.members_log, member_logs[i])
|
||||
end
|
||||
self.lst_member.numItems = #self.members_log
|
||||
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()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
||||
else
|
||||
local member_logs = res.Data.members
|
||||
if #member_logs > 0 then
|
||||
for i = 1, #member_logs do
|
||||
table.insert(self.members_log, member_logs[i])
|
||||
end
|
||||
self.lst_member.numItems = #self.members_log
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- function M:SortBy(data)
|
||||
|
|
@ -142,18 +144,17 @@ end
|
|||
-- end
|
||||
|
||||
function M:OnRenderItem(index, obj)
|
||||
local data = self.members_log[index + 1]
|
||||
--pt(data)
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
obj:GetChild("tex_score").text = d2ad(data.total_win)
|
||||
obj:GetChild("tex_total_round").text = "" .. data.total_round
|
||||
obj:GetChild("tex_perfect_round").text = ""
|
||||
obj:GetChild("tex_valid_round").text = "" ..
|
||||
d2ad(data.reward_tongji) --""..d2ad(data.reward_hp)--(data.valid_round / 100)
|
||||
local data = self.members_log[index + 1]
|
||||
--pt(data)
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
obj:GetChild("tex_score").text = d2ad(data.total_win)
|
||||
obj:GetChild("tex_total_round").text = ""..data.total_round
|
||||
obj:GetChild("tex_perfect_round").text = ""
|
||||
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
|
||||
obj:GetController("mng").selectedIndex = 1
|
||||
|
|
@ -191,24 +192,23 @@ function M:OnRenderItem(index, obj)
|
|||
|
||||
local btn_zhanji = obj:GetChild("btn_zhanji")
|
||||
btn_zhanji.onClick:Set(function()
|
||||
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)
|
||||
|
||||
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)
|
||||
groupRecordView:Show()
|
||||
end)
|
||||
end
|
||||
|
||||
function M:FillRecordItem(data, obj)
|
||||
--pt(data)
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
obj:GetChild("tex_score").text = d2ad(data.total_win)
|
||||
obj:GetChild("tex_total_round").text = "" .. data.total_round
|
||||
obj:GetChild("tex_perfect_round").text = ""
|
||||
obj:GetChild("tex_valid_round").text = "" ..
|
||||
d2ad(data.reward_tongji) --""..d2ad(data.reward_hp)--(data.valid_round / 100)
|
||||
--pt(data)
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
obj:GetChild("tex_score").text = d2ad(data.total_win)
|
||||
obj:GetChild("tex_total_round").text = ""..data.total_round
|
||||
obj:GetChild("tex_perfect_round").text = ""
|
||||
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
|
||||
obj:GetController("mng").selectedIndex = 1
|
||||
|
|
@ -246,8 +246,8 @@ function M:FillRecordItem(data, obj)
|
|||
|
||||
local btn_zhanji = obj:GetChild("btn_zhanji")
|
||||
btn_zhanji.onClick:Set(function()
|
||||
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)
|
||||
|
||||
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)
|
||||
groupRecordView:Show()
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ local GroupPartnerStatPlay = {}
|
|||
local M = GroupPartnerStatPlay
|
||||
|
||||
function GroupPartnerStatPlay.new(group_id, uid, partner_lev, parent_id, time_type, begin_time, end_time)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupPartnerStatPlay"
|
||||
self._close_destroy = true
|
||||
self.group_id = group_id
|
||||
|
|
@ -20,7 +20,7 @@ function GroupPartnerStatPlay.new(group_id, uid, partner_lev, parent_id, time_ty
|
|||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
self.members_log = {}
|
||||
self.lst_member = self._view:GetChild("lst_member")
|
||||
self.lst_member:SetVirtual()
|
||||
|
|
@ -37,7 +37,7 @@ end
|
|||
function M:getPartnerRewards(callback)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_GetRewards(self.group_id, self.uid, self.partner_lev, function(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -55,9 +55,9 @@ function M:getPartnerRewards(callback)
|
|||
end
|
||||
|
||||
function M:getRewardsLog(index)
|
||||
|
||||
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, self.end_time, function(res)
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
||||
else
|
||||
|
|
@ -72,14 +72,15 @@ function M:getRewardsLog(index)
|
|||
end)
|
||||
end
|
||||
|
||||
function M:OnRenderItem(index, obj)
|
||||
local data = self.members_log[index + 1]
|
||||
|
||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.pid)
|
||||
obj:GetChild("tex_name").text = play_name
|
||||
obj:GetChild("tex_round").text = "" .. (data.round / 100)
|
||||
obj:GetChild("tex_total_pump").text = "" .. d2ad(data.pump)
|
||||
obj:GetChild("tex_total").text = "" .. d2ad(data.award)
|
||||
function M:OnRenderItem(index, obj)
|
||||
local data = self.members_log[index + 1]
|
||||
|
||||
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.pid)
|
||||
obj:GetChild("tex_name").text = play_name
|
||||
obj:GetChild("tex_round").text = ""..(data.round / 100)
|
||||
obj:GetChild("tex_total_pump").text = ""..d2ad(data.pump)
|
||||
obj:GetChild("tex_total").text = ""..d2ad(data.award)
|
||||
|
||||
for i = 1, #self.rewards_data do
|
||||
local rdata = self.rewards_data[i]
|
||||
|
|
@ -94,13 +95,14 @@ function M:OnRenderItem(index, obj)
|
|||
end
|
||||
else
|
||||
if self.partner_lev < 3 then
|
||||
obj:GetChild("tex_percent").text = rdata.cur_value .. "%"
|
||||
obj:GetChild("tex_percent").text = rdata.cur_value .."%"
|
||||
else
|
||||
obj:GetChild("tex_percent").text = string.format("%s%%/%s%%", rdata.cur_value, rdata.max_value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -4,8 +4,8 @@ local GroupPartnerZuanShiMember = {}
|
|||
local M = GroupPartnerZuanShiMember
|
||||
|
||||
function GroupPartnerZuanShiMember.new(group_id, uid, time_type, begin_time, end_time)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupPartnerZuanShiMember"
|
||||
self._close_destroy = true
|
||||
self.group_id = group_id
|
||||
|
|
@ -22,8 +22,9 @@ function GroupPartnerZuanShiMember.new(group_id, uid, time_type, begin_time, end
|
|||
return self
|
||||
end
|
||||
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
self.members_log = {}
|
||||
self.lst_member = self._view:GetChild("lst_member")
|
||||
self.lst_member:SetVirtual()
|
||||
|
|
@ -53,89 +54,90 @@ function M:init(url)
|
|||
self:getRewardsLog(0)
|
||||
end)
|
||||
|
||||
-- 搜索玩家
|
||||
local ctr_search = self._view:GetController('search')
|
||||
self._view:GetChild('btn_search').onClick:Set(
|
||||
function()
|
||||
-- 搜索玩家
|
||||
local ctr_search = self._view:GetController('search')
|
||||
self._view:GetChild('btn_search').onClick:Set(
|
||||
function()
|
||||
-- printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
local text = self._view:GetChild('tex_id').text
|
||||
local qid, qnick
|
||||
if text == "" then
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
return
|
||||
end
|
||||
qid = tonumber(text) or 0
|
||||
qnick = text
|
||||
local time_type = 0
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local text = self._view:GetChild('tex_id').text
|
||||
local qid, qnick
|
||||
if text == "" then
|
||||
ViewUtil.CloseModalWait()
|
||||
ViewUtil.ErrorTip(nil, '输入不能为空')
|
||||
return
|
||||
end
|
||||
qid = tonumber(text) or 0
|
||||
qnick = text
|
||||
local time_type = 0
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_FindPartnerZuanShiMember(
|
||||
self.group_id, self.uids[#self.uids], 0,
|
||||
qid, 0, 6, time_type, self.begin_time, self.end_time,
|
||||
function(res)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_FindPartnerZuanShiMember(
|
||||
self.group_id,self.uids[#self.uids],0,
|
||||
qid,0, 6, time_type,self.begin_time,self.end_time,
|
||||
function(res)
|
||||
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
||||
-- pt(res)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, '找不到成员')
|
||||
else
|
||||
self._view:GetChild('tex_id').text = ''
|
||||
ctr_search.selectedIndex = 1
|
||||
local item_result = self._view:GetChild('lst_member_find')
|
||||
item_result:RemoveChildrenToPool()
|
||||
ViewUtil.CloseModalWait()
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, '找不到成员')
|
||||
else
|
||||
self._view:GetChild('tex_id').text = ''
|
||||
ctr_search.selectedIndex = 1
|
||||
local item_result = self._view:GetChild('lst_member_find')
|
||||
item_result:RemoveChildrenToPool()
|
||||
|
||||
for j = 1, #res.Data.members do
|
||||
local tem = item_result:AddItemFromPool()
|
||||
self:FillRecordItem(res.Data.members[j], tem)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
for j = 1, #res.Data.members do
|
||||
local tem = item_result:AddItemFromPool()
|
||||
self:FillRecordItem(res.Data.members[j],tem)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
|
||||
local btn_back1 = self._view:GetChild('btn_back1')
|
||||
btn_back1.onClick:Set(
|
||||
function()
|
||||
local btn_back1 = self._view:GetChild('btn_back1')
|
||||
btn_back1.onClick:Set(
|
||||
function()
|
||||
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
function M:getRewardsLog(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
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)
|
||||
ViewUtil.CloseModalWait2()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
||||
else
|
||||
local member_logs = res.Data.members
|
||||
if #member_logs > 0 then
|
||||
for i = 1, #member_logs do
|
||||
table.insert(self.members_log, member_logs[i])
|
||||
end
|
||||
self.lst_member.numItems = #self.members_log
|
||||
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()
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败")
|
||||
else
|
||||
local member_logs = res.Data.members
|
||||
if #member_logs > 0 then
|
||||
for i = 1, #member_logs do
|
||||
table.insert(self.members_log, member_logs[i])
|
||||
end
|
||||
self.lst_member.numItems = #self.members_log
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M:OnRenderItem(index, obj)
|
||||
local data = self.members_log[index + 1]
|
||||
--pt(data)
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
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_total").text = data.single_diamo_cost / 100 + data.other_diamo_cost / 100
|
||||
local data = self.members_log[index + 1]
|
||||
--pt(data)
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
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_total").text = data.single_diamo_cost / 100 + data.other_diamo_cost / 100
|
||||
|
||||
|
||||
|
||||
|
|
@ -175,12 +177,12 @@ function M:OnRenderItem(index, obj)
|
|||
end
|
||||
|
||||
function M:FillRecordItem(data, obj)
|
||||
--pt(data)
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
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_total").text = data.single_diamo_cost / 100 + data.other_diamo_cost / 100
|
||||
--pt(data)
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
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_total").text = data.single_diamo_cost / 100 + data.other_diamo_cost / 100
|
||||
|
||||
|
||||
if data.partnerLev > 0 and data.uid ~= self.uids[self.top] then
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ local GroupRewardsLogView = {}
|
|||
|
||||
local M = GroupRewardsLogView
|
||||
|
||||
function GroupRewardsLogView.new(blur_view, group_id, uid)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
function GroupRewardsLogView.new(blur_view,group_id,uid)
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupRewardsLogView"
|
||||
self._close_destroy = true
|
||||
self._blur_view = blur_view
|
||||
|
|
@ -20,7 +20,7 @@ function GroupRewardsLogView.new(blur_view, group_id, uid)
|
|||
end
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
self.rewards_log = {}
|
||||
self.lst_log = self._view:GetChild("lst_log")
|
||||
self.lst_log:SetVirtual()
|
||||
|
|
@ -28,11 +28,10 @@ function M:init(url)
|
|||
self:OnRenderItem(index, obj)
|
||||
end
|
||||
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)
|
||||
|
||||
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.rewards_log = {}
|
||||
self:getRewardsLog(0)
|
||||
|
|
@ -44,13 +43,14 @@ end
|
|||
function M:getRewardsLog(index)
|
||||
local begin_time, end_time = self.time_panel:GetDate()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
ViewUtil.ShowModalWait2(nil)
|
||||
ViewUtil.ShowModalWait(nil)
|
||||
local limit = 6
|
||||
if self.lev == 1 then
|
||||
limit = 20
|
||||
end
|
||||
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
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "获取提取详情失败")
|
||||
else
|
||||
|
|
@ -68,32 +68,33 @@ end
|
|||
|
||||
function M:GuoLv(data)
|
||||
pt(data)
|
||||
local tempList = {}
|
||||
local tempList={}
|
||||
if self.lev == 1 then
|
||||
|
||||
local m_data = {}
|
||||
for i = 1, #data do
|
||||
for i=1,#data do
|
||||
if m_data[data[i].roomid] == nil then
|
||||
m_data[data[i].roomid] = {}
|
||||
end
|
||||
table.insert(m_data[data[i].roomid], data[i])
|
||||
table.insert(m_data[data[i].roomid],data[i])
|
||||
end
|
||||
local m_otherdata = {}
|
||||
for k, v in pairs(m_data) do
|
||||
if #v == 2 then
|
||||
if tonumber(v[1]["hp"]) + tonumber(v[2]["hp"]) ~= 0 then
|
||||
table.insert(m_otherdata, v[1])
|
||||
table.insert(m_otherdata, v[2])
|
||||
if tonumber(v[1]["hp"]) + tonumber(v[2]["hp"]) ~=0 then
|
||||
table.insert(m_otherdata,v[1])
|
||||
table.insert(m_otherdata,v[2])
|
||||
end
|
||||
else
|
||||
table.insert(m_otherdata, v[1])
|
||||
table.insert(m_otherdata,v[1])
|
||||
end
|
||||
end
|
||||
self.m_index = #data - #m_otherdata + self.m_index
|
||||
tempList = m_otherdata
|
||||
tempList=m_otherdata
|
||||
else
|
||||
tempList = data
|
||||
tempList=data
|
||||
end
|
||||
tempList = data
|
||||
tempList=data
|
||||
if #tempList > 0 then
|
||||
for i = 1, #tempList do
|
||||
table.insert(self.rewards_log, tempList[i])
|
||||
|
|
@ -104,21 +105,21 @@ end
|
|||
|
||||
function M:OnRenderItem(index, obj)
|
||||
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_roomid").text = data.roomid
|
||||
obj:GetChild("tex_get_hp").text = d2ad(data.hp)
|
||||
obj:GetChild("tex_data").text = os.date("%Y-%m-%d\r%H:%M", data.time)
|
||||
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
|
||||
obj:GetChild("tex_xiang").text = "抽水\n" .. "(" .. data.info .. ")"
|
||||
obj:GetChild("tex_xiang").text = "抽水\n".."("..data.info..")"
|
||||
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
|
||||
obj:GetChild("tex_xiang").text = "合伙人洗牌奖励\n" .. "(" .. data.info .. ")"
|
||||
obj:GetChild("tex_xiang").text = "合伙人洗牌奖励\n".."("..data.info..")"
|
||||
elseif data.reason == 22 then
|
||||
obj:GetChild("tex_xiang").text = "合伙人管理奖励\n" .. "(" .. data.info .. ")"
|
||||
obj:GetChild("tex_xiang").text = "合伙人管理奖励\n".."("..data.info..")"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -41,14 +41,14 @@ function M:init(url)
|
|||
|
||||
self._view:GetChild("btn_qd1").onClick:Set(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_BanMemberHB(
|
||||
self.group_id,
|
||||
self.member_id,
|
||||
0,
|
||||
function(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (response.ReturnCode == 0) then
|
||||
self.currentSelectStateText.text = "整组调动 " .. (response.Data.black + 1)
|
||||
ViewUtil.ErrorTip(-1, '设置成功!', 1)
|
||||
|
|
@ -63,14 +63,14 @@ function M:init(url)
|
|||
|
||||
self._view:GetChild("btn_qd2").onClick:Set(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_BanMemberHB(
|
||||
self.group_id,
|
||||
self.member_id,
|
||||
1,
|
||||
function(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (response.ReturnCode == 0) then
|
||||
self.currentSelectStateText.text = "整组调动 " .. (response.Data.black + 1)
|
||||
ViewUtil.ErrorTip(-1, '设置成功!', 1)
|
||||
|
|
@ -84,14 +84,14 @@ function M:init(url)
|
|||
|
||||
self._view:GetChild("btn_qd3").onClick:Set(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_BanMemberHB(
|
||||
self.group_id,
|
||||
self.member_id,
|
||||
2,
|
||||
function(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (response.ReturnCode == 0) then
|
||||
self.currentSelectStateText.text = "整组调动 " .. (response.Data.black + 1)
|
||||
ViewUtil.ErrorTip(-1, '设置成功!', 1)
|
||||
|
|
@ -149,7 +149,7 @@ function M:init(url)
|
|||
|
||||
self._view:GetChild("btn_ok").onClick:Set(
|
||||
function()
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_BanMemberHB(
|
||||
self.group_id,
|
||||
|
|
@ -158,7 +158,7 @@ function M:init(url)
|
|||
tonumber(self.txtRate.text),
|
||||
tonumber(self.txtBlack.text),
|
||||
function(response)
|
||||
ViewUtil.CloseModalWait2()
|
||||
ViewUtil.CloseModalWait()
|
||||
if (response.ReturnCode == 0) then
|
||||
self.currentSelectStateText.text = "整组调动 " .. (response.Data.ban + 1)
|
||||
self.blackList = { { 0, 0 }, { 25, 0 }, { 15, 0 } }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
|
||||
local GroupStatMember = {}
|
||||
|
||||
local M = GroupStatMember
|
||||
|
||||
function GroupStatMember.new(group_id, uid)
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
setmetatable(M, {__index = BaseWindow})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
self.class = "GroupStatMember"
|
||||
self._close_destroy = true
|
||||
self.group_id = group_id
|
||||
|
|
@ -15,8 +16,9 @@ function GroupStatMember.new(group_id, uid)
|
|||
return self
|
||||
end
|
||||
|
||||
|
||||
function M:init(url)
|
||||
BaseWindow.init(self, url)
|
||||
BaseWindow.init(self,url)
|
||||
self.members_log = {}
|
||||
self.lst_member = self._view:GetChild("lst_member")
|
||||
self.lst_member:SetVirtual()
|
||||
|
|
@ -32,16 +34,18 @@ function M:init(url)
|
|||
self.lst_member.numItems = 0
|
||||
self:getRewardsLog(0)
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
function M:getRewardsLog(index)
|
||||
ViewUtil.ShowModalWait2()
|
||||
ViewUtil.ShowModalWait()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
end
|
||||
|
||||
|
||||
function M:OnRenderItem(index, obj)
|
||||
local data = self.members_log[index + 1]
|
||||
--pt(data)
|
||||
--pt(data)
|
||||
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
||||
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
||||
local btn_detail = obj:GetChild("btn_detail")
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue