diff --git a/lua_probject/base_project/Game/Controller/GameController.lua b/lua_probject/base_project/Game/Controller/GameController.lua index 2966187e..f77c66af 100644 --- a/lua_probject/base_project/Game/Controller/GameController.lua +++ b/lua_probject/base_project/Game/Controller/GameController.lua @@ -671,12 +671,12 @@ function M:ReturnToRoom() false, function(response) if (response.ReturnCode == -1) then - ViewUtil.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('join_room') RestartGame() return end ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id) - ViewUtil.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('join_room') end, self.tmpGroupID ) diff --git a/lua_probject/base_project/Game/Controller/LoddyController.lua b/lua_probject/base_project/Game/Controller/LoddyController.lua index 45c4b21e..28f7ff05 100644 --- a/lua_probject/base_project/Game/Controller/LoddyController.lua +++ b/lua_probject/base_project/Game/Controller/LoddyController.lua @@ -92,9 +92,12 @@ 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 @@ -174,7 +177,9 @@ function M:PublicJoinRoom(cmd, room_id, callback, group_id, group_layer) room.server_host = string.concat(server_ip, ":", server_port) room.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"] -- 体力值倍数 @@ -242,6 +247,7 @@ 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) @@ -390,14 +396,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 @@ -485,3 +491,42 @@ 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.GroupClient + _client:send(Protocol.WEB_Get_Diamond_Mssages, _data, function(res) + callback(res) + end) +end diff --git a/lua_probject/base_project/Game/Controller/LoginController.lua b/lua_probject/base_project/Game/Controller/LoginController.lua index c225a192..a5002067 100644 --- a/lua_probject/base_project/Game/Controller/LoginController.lua +++ b/lua_probject/base_project/Game/Controller/LoginController.lua @@ -82,7 +82,7 @@ function M:GetPhoneCode(phone, callback) local _client = ControllerManager.WebClient local _data = {} _data["phone"] = phone - _client:send(Protocol.WEB_GET_VERIFCATION_CODE, _data, function(res) + _client:send(Protocol.WEB_GET_Phone_Code, _data, function(res) if (callback ~= nil) then callback(res) end @@ -93,7 +93,7 @@ function M:PhoneLogin(phone, code, callback) local _data = {} _data["phone"] = phone _data["code"] = code - __Login(Protocol.WEB_PHONE_LOGIN, _data, callback) + __Login(Protocol.WEB_LOGIN_Phone, _data, callback) end --手机密码登录 @@ -118,6 +118,13 @@ 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 diff --git a/lua_probject/base_project/Game/Controller/RoomController.lua b/lua_probject/base_project/Game/Controller/RoomController.lua index 5c63a189..49bd7420 100644 --- a/lua_probject/base_project/Game/Controller/RoomController.lua +++ b/lua_probject/base_project/Game/Controller/RoomController.lua @@ -77,6 +77,7 @@ 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() @@ -201,6 +202,7 @@ 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"] diff --git a/lua_probject/base_project/Game/Data/GroupData.lua b/lua_probject/base_project/Game/Data/GroupData.lua index 7a77d472..2846d2bc 100644 --- a/lua_probject/base_project/Game/Data/GroupData.lua +++ b/lua_probject/base_project/Game/Data/GroupData.lua @@ -138,10 +138,12 @@ 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 diff --git a/lua_probject/base_project/Game/ExtendHotupdate.lua b/lua_probject/base_project/Game/ExtendHotupdate.lua index 210969d5..b00ac8f4 100644 --- a/lua_probject/base_project/Game/ExtendHotupdate.lua +++ b/lua_probject/base_project/Game/ExtendHotupdate.lua @@ -60,7 +60,8 @@ 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 @@ -127,7 +128,7 @@ function ExtendHotupdate.UpdateGame(data, callback) if callback then callback() end return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() local _version_view = UIPackage.CreateObjectFromURL("ui://Common/ExtendHotUpdate") _version_view:GetChild("tex_info").text = "正在检查资源。。。" diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua index ed738614..c42fabb3 100644 --- a/lua_probject/base_project/Game/Protocol.lua +++ b/lua_probject/base_project/Game/Protocol.lua @@ -49,6 +49,14 @@ 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_diamo_messages", ----index---- -- 获取公告 WEB_UPDATE_NOTICE = "index/get_notice", diff --git a/lua_probject/base_project/Game/View/FGAssistView.lua b/lua_probject/base_project/Game/View/FGAssistView.lua index cb0881be..9be52dfc 100644 --- a/lua_probject/base_project/Game/View/FGAssistView.lua +++ b/lua_probject/base_project/Game/View/FGAssistView.lua @@ -200,7 +200,7 @@ function M:GetOnlinePlayers(index) ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败") else fgCtr:FG_EnterGroup(self.group_id, function(res) - ViewUtil:CloseModalWait() + ViewUtil:CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败") else diff --git a/lua_probject/base_project/Game/View/Family/CreatePlayView.lua b/lua_probject/base_project/Game/View/Family/CreatePlayView.lua index ac371b26..d1d97757 100644 --- a/lua_probject/base_project/Game/View/Family/CreatePlayView.lua +++ b/lua_probject/base_project/Game/View/Family/CreatePlayView.lua @@ -95,7 +95,7 @@ function M:CreatePlay() -- loddyCtr:CreateRoom(gameId,_data, function (res) -- self:__OnCreateRoomAction(res) -- end) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() end function M:initePlayInfo() diff --git a/lua_probject/base_project/Game/View/Family/FamilAllRank.lua b/lua_probject/base_project/Game/View/Family/FamilAllRank.lua index d91fd8f8..0faaa531 100644 --- a/lua_probject/base_project/Game/View/Family/FamilAllRank.lua +++ b/lua_probject/base_project/Game/View/Family/FamilAllRank.lua @@ -134,6 +134,7 @@ 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, "获取排行榜失败") @@ -144,6 +145,7 @@ 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) diff --git a/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua b/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua index 373954bc..624782da 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua @@ -23,7 +23,7 @@ function M:Reflash(group) numbers = self._group.members -- print("==========================res.Data.members") pt(self._group.members) - ViewUtil:CloseModalWait() + ViewUtil:CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败") else @@ -92,7 +92,9 @@ 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)) @@ -124,7 +126,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:CloseModalWait() + ViewUtil:CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败") else diff --git a/lua_probject/base_project/Game/View/Family/FamilyAuditNumber.lua b/lua_probject/base_project/Game/View/Family/FamilyAuditNumber.lua index 9af59ee2..8f509757 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyAuditNumber.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyAuditNumber.lua @@ -55,7 +55,9 @@ 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 @@ -73,7 +75,9 @@ 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 diff --git a/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua b/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua index f341c2ee..cfcf60d4 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua @@ -75,8 +75,10 @@ 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 @@ -111,8 +113,10 @@ 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 @@ -134,7 +138,9 @@ 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) @@ -142,7 +148,9 @@ 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 @@ -315,7 +323,9 @@ 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 @@ -338,7 +348,9 @@ 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) diff --git a/lua_probject/base_project/Game/View/Family/FamilyChatRoom.lua b/lua_probject/base_project/Game/View/Family/FamilyChatRoom.lua index 88e37c4a..cac3d296 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyChatRoom.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyChatRoom.lua @@ -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.ShowModalWait(self._root_view, "正在加载聊天室......") + ViewUtil.ShowModalWait2(self._root_view, "正在加载聊天室......") end end) diff --git a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua index d883429e..4fff628b 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua @@ -224,7 +224,7 @@ function M:_evtChatRoomData(...) return end view.com_FamilyChatRoom:Refalsh() - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() end function M:_evtOnNewRecord(...) diff --git a/lua_probject/base_project/Game/View/Family/FamilyInviteFamilyView.lua b/lua_probject/base_project/Game/View/Family/FamilyInviteFamilyView.lua index 9c18f491..5221196d 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyInviteFamilyView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyInviteFamilyView.lua @@ -5,11 +5,13 @@ local FamilyInviteFamilyView = {} local M = FamilyInviteFamilyView setmetatable(M, { __index = BaseWindow }) -function FamilyInviteFamilyView.new() +function FamilyInviteFamilyView.new(curGroup) 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 @@ -18,11 +20,17 @@ 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() - ViewUtil.ErrorTip(-1, "该功能还会开放,敬请期待") + data.type = 0 + ViewUtil.__share(data) end) view:GetChild('btn_moments').onClick:Add(function() - ViewUtil.ErrorTip(-1, "该功能还会开放,敬请期待") + data.type = 1 + ViewUtil.__share(data) end) end diff --git a/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua b/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua index f4778593..e28ec7d2 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua @@ -3,13 +3,15 @@ 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) - if res.ReturnCode ~= 0 then - ViewUtil.ErrorTip(res.ReturnCode) - end - end, - remark) + ViewUtil.CloseModalWait2() + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode) + end + end, + remark) end function FamilyJoinAndCreate:init(root) @@ -43,8 +45,10 @@ 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 root:ConnetFamily(1, DataManager.groups.groupList, true) diff --git a/lua_probject/base_project/Game/View/Family/FamilyMsgDiamond.lua b/lua_probject/base_project/Game/View/Family/FamilyMsgDiamond.lua index 3b634fc3..d5076279 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMsgDiamond.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMsgDiamond.lua @@ -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,7 +25,9 @@ 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 diff --git a/lua_probject/base_project/Game/View/Family/FamilyMsgRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyMsgRecord.lua index bc1bb6b5..0c6eb7b2 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMsgRecord.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMsgRecord.lua @@ -3,7 +3,9 @@ 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 diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua index a0b96bb4..a390d758 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -12,8 +12,10 @@ 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 @@ -58,7 +60,9 @@ 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 @@ -120,11 +124,11 @@ function FamilyMyFamily:Show(groupId) Broadcast.AddListener(BroadcastEvent.OnJoinsChange, self.ReflashJoinsRedPoint, self) local fgCtr = ControllerManager.GetController(NewGroupController) - ViewUtil.ShowModalWait(self._root_view, "正在加载亲友圈数据......") + ViewUtil.ShowModalWait2(self._root_view, "正在加载亲友圈数据......") fgCtr:WEB_FG_GET_GROUP_DETAIL(self.groupId, function(res) print("收到家族的详细信息") pt(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode) end @@ -333,9 +337,11 @@ 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) @@ -357,9 +363,11 @@ 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) @@ -380,7 +388,9 @@ 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 diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua index e906ecae..9711eb18 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua @@ -63,7 +63,9 @@ 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 @@ -87,7 +89,9 @@ 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 @@ -116,7 +120,9 @@ 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 @@ -143,7 +149,9 @@ 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] diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua index 292ad421..d4c17515 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua @@ -87,7 +87,9 @@ 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 @@ -135,7 +137,9 @@ 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 @@ -206,7 +210,9 @@ 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 @@ -236,7 +242,9 @@ 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 @@ -267,8 +275,10 @@ 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, "修改战绩阅读状态失败") @@ -322,8 +332,9 @@ 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 @@ -605,9 +616,11 @@ 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 diff --git a/lua_probject/base_project/Game/View/Family/FamilyRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyRecord.lua index 1a88d19e..44cadf5a 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyRecord.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyRecord.lua @@ -139,8 +139,10 @@ 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 diff --git a/lua_probject/base_project/Game/View/Family/FamilyRoomCard.lua b/lua_probject/base_project/Game/View/Family/FamilyRoomCard.lua index 91eeb693..1eb8c30f 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyRoomCard.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyRoomCard.lua @@ -18,7 +18,9 @@ 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 diff --git a/lua_probject/base_project/Game/View/Family/PlayEditView.lua b/lua_probject/base_project/Game/View/Family/PlayEditView.lua index 85e2754d..dd46d6df 100644 --- a/lua_probject/base_project/Game/View/Family/PlayEditView.lua +++ b/lua_probject/base_project/Game/View/Family/PlayEditView.lua @@ -81,7 +81,9 @@ function PlayEditView:Init() 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 diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 3e843fbd..c7cf7418 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -268,6 +268,13 @@ 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() @@ -324,7 +331,7 @@ function M:InitCloseClick() end function M:ShareWx() - local familyInviteFamilyView = FamilyInviteFamilyView.new() + local familyInviteFamilyView = FamilyInviteFamilyView.new(self._group) familyInviteFamilyView:Show() end @@ -529,7 +536,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:CloseModalWait() + --ViewUtil:CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败") else @@ -566,7 +573,7 @@ end function M:EnterGroup(fgCtr, id) fgCtr:FG_EnterGroup(id, function(res) - ViewUtil:CloseModalWait() + ViewUtil:CloseModalWait2() ViewUtil:CloseModalWait2() if res.ReturnCode ~= 0 then if res.ReturnCode == 101 then @@ -594,10 +601,10 @@ function M:OnEnterGroupCallBack() self:UpdateFamilyRoom(fgCtr, self._group.id) - --ViewUtil.ShowModalWait(self._root_view, "正在加载亲友圈权限中......") + --ViewUtil.ShowModalWait2(self._root_view, "正在加载亲友圈权限中......") --self:ChangeOther() - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() self:ReflashChatRoomRedPoint() @@ -843,7 +850,7 @@ function M:JieSanRomm(groupId, roomId) ) _curren_msg.onOk:Add( function() - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_RemoveRoom( @@ -853,7 +860,7 @@ function M:JieSanRomm(groupId, roomId) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!') return @@ -871,14 +878,14 @@ function M:ReflashFamilyList() end function M:ConnetFamily(index, groups) - ViewUtil.ShowModalWait(self._root_view, "正在加载成员列表中......") + ViewUtil.ShowModalWait2(self._root_view, "正在加载成员列表中......") if self._group then FamilyOffline(self._group.id, self) end UpdateBeat:Remove(self.OnUpdate, self) - ViewUtil:CloseModalWait() + ViewUtil:CloseModalWait2() self._group = DataManager.groups:get(groups[index].id) DataManager.CurrenGroup = self._group self._view:GetChild('text_familyId').text = self._group.id @@ -889,21 +896,21 @@ function M:ConnetFamily(index, groups) local fgCtr = ControllerManager.GetController(NewGroupController) - ViewUtil.ShowModalWait(self._root_view, "正在进入亲友圈......") + ViewUtil.ShowModalWait2(self._root_view, "正在进入亲友圈......") Utils.SaveLocalFile("Family_lastID" .. DataManager.SelfUser.account_id, self._group.id) self:EnterGroup(fgCtr, self._group.id) --[[ - ViewUtil.ShowModalWait(self._root_view, "正在加载亲友圈权限中......") + ViewUtil.ShowModalWait2(self._root_view, "正在加载亲友圈权限中......") self:ChangeOther(tonumber(self._group.lev) + 1) allLoad = 1 - ViewUtil.ShowModalWait(self._root_view, "正在加载成员列表中......") + ViewUtil.ShowModalWait2(self._root_view, "正在加载成员列表中......") allLoad = allLoad + self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num, false, 1) - ViewUtil.ShowModalWait(self._root_view, "正在加载房间列表中......") + ViewUtil.ShowModalWait2(self._root_view, "正在加载房间列表中......") allLoad = allLoad + self:EnterGroup(fgCtr, self._group.id) ]] diff --git a/lua_probject/base_project/Game/View/Lobby/CreateRoomView.lua b/lua_probject/base_project/Game/View/Lobby/CreateRoomView.lua index e629e3a6..8af19f96 100644 --- a/lua_probject/base_project/Game/View/Lobby/CreateRoomView.lua +++ b/lua_probject/base_project/Game/View/Lobby/CreateRoomView.lua @@ -185,7 +185,7 @@ function M:OnCreateRoom(mode_data) end - ViewUtil.ShowModalWait(self._root_view, "正在创建房间...") + ViewUtil.ShowModalWait2(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.CloseModalWait() + ViewUtil.CloseModalWait2() if (response.ReturnCode == -2) then return end diff --git a/lua_probject/base_project/Game/View/Lobby/DiamondRecord.lua b/lua_probject/base_project/Game/View/Lobby/DiamondRecord.lua index 4f71f015..6f02a88a 100644 --- a/lua_probject/base_project/Game/View/Lobby/DiamondRecord.lua +++ b/lua_probject/base_project/Game/View/Lobby/DiamondRecord.lua @@ -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,6 +26,15 @@ function M:Init() end --大厅的请求 + local lobbyCtr = ControllerManager.GetController(LoddyController) + lobbyCtr:FG_Get_Diamond_Msg(function(res) + 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) diff --git a/lua_probject/base_project/Game/View/Lobby/EditNickView.lua b/lua_probject/base_project/Game/View/Lobby/EditNickView.lua index 155145cc..54509594 100644 --- a/lua_probject/base_project/Game/View/Lobby/EditNickView.lua +++ b/lua_probject/base_project/Game/View/Lobby/EditNickView.lua @@ -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.ShowModalWait(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.ShowModalWait2(self._root_view, "正在连接服务器") local loddyctr = ControllerManager.GetController(LoddyController) - 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) + 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) end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/Lobby/JoinRoomView.lua b/lua_probject/base_project/Game/View/Lobby/JoinRoomView.lua index 79945615..ef3b7215 100644 --- a/lua_probject/base_project/Game/View/Lobby/JoinRoomView.lua +++ b/lua_probject/base_project/Game/View/Lobby/JoinRoomView.lua @@ -64,10 +64,10 @@ function M:OnNumButtonAction(context) end function M:JoinRoom(str) - ViewUtil.ShowModalWait(self._root_view, "正在加入房间...") + ViewUtil.ShowModalWait2(self._root_view, "正在加入房间...") local boddyCtr = ControllerManager.GetController(LoddyController) boddyCtr:JoinRoom(str, function(response) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if response.ReturnCode == -2 then self:JoinRoom(str) return diff --git a/lua_probject/base_project/Game/View/Lobby/LobbyHeadView.lua b/lua_probject/base_project/Game/View/Lobby/LobbyHeadView.lua index 9f279043..ce5cbf69 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbyHeadView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbyHeadView.lua @@ -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.ShowModalWait() + ctr_invte.onChanged:Set(function() + ViewUtil.ShowModalWait2() local loddyctr = ControllerManager.GetController(LoddyController) local _data = {} - _data.type =5 + _data.type = 5 _data.invitation = ctr_invte.selectedIndex - loddyctr:UpdateUserInfo(_data,function( res) - ViewUtil.CloseModalWait() - if (res.ReturnCode ==0) then + loddyctr:UpdateUserInfo(_data, function(res) + ViewUtil.CloseModalWait2() + 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,31 +118,30 @@ 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 + local view = self._view local ctr_nav = view:GetController("nav") --ctr_nav.selectedIndex = self._agent and 1 or 0 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") ImageLoad.Load(self._user.head_url, btn_head._iconObject) btn_head.onClick:Set(function() @@ -165,4 +164,4 @@ function M:init(url) self.user_info = view:GetChild("user_info") end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua b/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua index d026b4dd..ad639d3c 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua @@ -1,4 +1,5 @@ --设置窗口对象 +local PhoneLoginView = import(".PhoneLoginView2") local LobbyPlayerInfoView = {} @@ -21,11 +22,6 @@ 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 @@ -33,11 +29,18 @@ 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) - + GameApplication.Instance:GetPublicIP(function(ip) + DataManager.SelfUser.currenIp = ip + 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') @@ -45,10 +48,8 @@ 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() @@ -62,7 +63,6 @@ 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) @@ -104,6 +104,19 @@ function M:init(url) end end) end) + + local btn_changeInfo = self._view:GetChild('btn_changeInfo') + btn_changeInfo.onClick:Set(function() + local phoneLoginView = PhoneLoginView.new(1, function(res) + view:GetChild('phone').text = res.Data.phone + user.phone = res.Data.phone + if user.phone and #user.phone == 11 then + self._view:GetChild('btn_changeInfo').visible = false + self._view:GetChild('btn_changeInfo').touchable = false + end + end) + phoneLoginView:Show() + end) end return M diff --git a/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua b/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua index 038a148c..6bafca79 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua @@ -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.CloseModalWait() + ViewUtil.CloseModalWait2() if code == 0 then if DataManager.SelfUser.playback[allDate.military_id] ~= nil then DataManager.SelfUser.playback[allDate.military_id][round] = data diff --git a/lua_probject/base_project/Game/View/Lobby/LobbyService.lua b/lua_probject/base_project/Game/View/Lobby/LobbyService.lua index 2821afe5..cdd2147b 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbyService.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbyService.lua @@ -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 diff --git a/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua b/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua index bbaefede..4b2d094e 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua @@ -73,8 +73,15 @@ 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.DeleteKey('session_id') + -- PlayerPrefs.Save() + local phone = "11" + if DataManager.SelfUser.phone and #DataManager.SelfUser.phone == 11 then + phone = DataManager.SelfUser.phone + end + PlayerPrefs.SetString("session_phone", phone) PlayerPrefs.Save() + print("lingmeng log", phone) RestartGame() end) _curren_msg:Show() diff --git a/lua_probject/base_project/Game/View/Lobby/PhoneBindView.lua b/lua_probject/base_project/Game/View/Lobby/PhoneBindView.lua index 58e39cc2..b32ac4c5 100644 --- a/lua_probject/base_project/Game/View/Lobby/PhoneBindView.lua +++ b/lua_probject/base_project/Game/View/Lobby/PhoneBindView.lua @@ -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,13 +14,13 @@ 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") ctr_update.selectedIndex = 1 end - + local btn_getCode = self._view:GetChild("btn_getCode") btn_getCode.onClick:Set(function() self:GetCode() @@ -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,12 +57,12 @@ 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 end function M:Destroy() @@ -80,19 +80,19 @@ function M:Bind() if not code then return end - ViewUtil.ShowModalWait(self._root_view,"正在提交...") - local loddyctr = ControllerManager.GetController(LoddyController) + ViewUtil.ShowModalWait2(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.CloseModalWait() - if (res.ReturnCode ==0) then + loddyctr:UpdateUserInfo(_data, function(res) + ViewUtil.CloseModalWait2() + 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) @@ -116,4 +116,4 @@ function M:CheckInputCode() return code end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/Lobby/PhoneLoginView2.lua b/lua_probject/base_project/Game/View/Lobby/PhoneLoginView2.lua new file mode 100644 index 00000000..5f143f6d --- /dev/null +++ b/lua_probject/base_project/Game/View/Lobby/PhoneLoginView2.lua @@ -0,0 +1,187 @@ +local PhoneLoginView = {} + +local M = PhoneLoginView + +function PhoneLoginView.new(type, callback) + setmetatable(M, { __index = BaseWindow }) + local self = setmetatable({}, { __index = M }) + self.class = "PhoneLoginView" + self._callback = callback + self._close_destroy = true + self.codeType = type + self._new_hide = false + self:init("ui://Lobby/PhnoeLogin") + + return self +end + +function M:init(url) + BaseWindow.init(self, url) + self.login_type = self._view:GetController("type") + self.login_type.selectedIndex = self.codeType; + + self.code = self._view:GetController("code") + + local btn_login = self._view:GetChild("btn_login") + btn_login.onClick:Add(handler(self, function() + self:login() + end)) + + local btn_getCode = self._view:GetChild("btn_code_send") + btn_getCode.onClick:Add(handler(self, function() + self:getCode() + end)) + if DataManager.SelfUser._data_codeTiem and DataManager.SelfUser._data_codeTiem - os.time() > 0 then + self._left_time = DataManager.SelfUser._data_codeTiem - os.time() + self._view:GetChild("phone_input").text = DataManager.SelfUser._data_codephone + UpdateBeat:Add(self.OnUpdate, self) + self.code.selectedIndex = 1 + end +end + +function M:login() + if self.codeType == 0 then + local uid = self:CheckInputId() + if not uid then + return + end + ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...") + local loginCtr = ControllerManager.GetController(LoddyController) + local passwd = self:CheckInputPasswd() + if not passwd then + return + end + loginCtr:IdPasswordLogin(uid, passwd, function(res) + ViewUtil.CloseModalWait2() + if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then + local guo_msg = MsgWindow.new(self._root_view, "验证码已发送", MsgWindow.MsgMode.OnlyOk) + guo_msg._new_hide = false + guo_msg:Show() + return + end + return + end + self._callback(res) + end) + else + ---[[ + --直接登入 + local loginCtr = ControllerManager.GetController(LoddyController) + + local phone = self:CheckInputPhone() + if not phone then + return + end + + local code = self:CheckInputPhoneCode() + if not code then + return + end + + loginCtr:PhoneBind(phone, code, function(res) + if res.ReturnCode ~= 0 then + local msg_txt = "验证码错误" + if (Table_Error_code_Map[res.ReturnCode] ~= nil) then + msg_txt = Table_Error_code_Map[res.ReturnCode].note + end + local guo_msg = MsgWindow.new(self._root_view, msg_txt, MsgWindow.MsgMode.OnlyOk) + guo_msg._new_hide = false + guo_msg:Show() + return + end + self._callback(res) + self:Destroy() + end) + end +end + +function M:getCode() + local phone = self:CheckInputPhone() + if not phone then + self.code.selectedIndex = 0 + return + end + --发送电话给后端 + ViewUtil:ShowModalWait2(0.1) + local loginCtr = ControllerManager.GetController(LoginController) + loginCtr:GetPhoneCode(phone, function(res) + ViewUtil.CloseModalWait2() + if res.ReturnCode == 0 then + self.phone = phone + self._left_time = 60 + DataManager.SelfUser._data_codeTiem = os.time() + 60 + DataManager.SelfUser._data_codephone = phone + UpdateBeat:Add(self.OnUpdate, self) + else + if res.ReturnCode == 1 then + self._left_time = 15 + DataManager.SelfUser._data_codeTiem = os.time() + 15 + DataManager.SelfUser._data_codephone = phone + UpdateBeat:Add(self.OnUpdate, self) + ViewUtil.ErrorTip(self._root_view, "验证码还在有效期") + else + self.code.selectedIndex = 0 + ViewUtil.ErrorTip(self._root_view, "网络超时,请重新获取验证码") + end + end + end) +end + +function M:OnUpdate() + local deltaTime = Time.deltaTime + local _left_time = self._left_time + if (_left_time > 0) then + _left_time = _left_time - deltaTime + _left_time = math.max(0, _left_time) + local leftTime = math.floor(_left_time) + self._view:GetChild("code_send_text").text = tostring(leftTime) + self._left_time = _left_time + else + self.code.selectedIndex = 0 + UpdateBeat:Remove(self.OnUpdate, self) + end +end + +function M:Destroy() + BaseWindow.Destroy(self) + UpdateBeat:Remove(self.OnUpdate, self) +end + +function M:CheckInputId() + local uid = self._view:GetChild("phone_input").text + if not (string.len(uid) >= 6) then + ViewUtil.ShowTips("请输入正确的用户ID") + return + end + return uid +end + +function M:CheckInputPasswd() + local tex_passwd = self._view:GetChild("tex_passwd").text + if string.len(tex_passwd) < 6 then + ViewUtil.ShowTips("密码最少六位") + return + end + return tex_passwd +end + +function M:CheckInputPhone() + local phone = self._view:GetChild("phone_input").text + if not (string.len(phone) == 11) then + ViewUtil.ShowTips("请输入正确的电话号码") + return + end + return phone +end + +function M:CheckInputPhoneCode() + local code = self._view:GetChild("code_input").text + if string.len(code) ~= 6 then + ViewUtil.ShowTips("请输入正确的验证码") + return + end + return code +end + +return M diff --git a/lua_probject/base_project/Game/View/Lobby/PhonePasswordView.lua b/lua_probject/base_project/Game/View/Lobby/PhonePasswordView.lua index bdc41d99..3fd35581 100644 --- a/lua_probject/base_project/Game/View/Lobby/PhonePasswordView.lua +++ b/lua_probject/base_project/Game/View/Lobby/PhonePasswordView.lua @@ -92,13 +92,13 @@ function M:Bind() -- _data.phone = DataManager.SelfUser.phone -- _data.code = code -- end - ViewUtil.ShowModalWait(self._root_view, "正在提交...") + ViewUtil.ShowModalWait2(self._root_view, "正在提交...") local loddyctr = ControllerManager.GetController(LoddyController) _data.password = password _data.type = 3 loddyctr:UpdateUserInfo(_data, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if (res.ReturnCode == 0) then DataManager.SelfUser.password = "123" if self._callback then self._callback() end diff --git a/lua_probject/base_project/Game/View/Lobby/RankView.lua b/lua_probject/base_project/Game/View/Lobby/RankView.lua index 8b3d8458..d10ee187 100644 --- a/lua_probject/base_project/Game/View/Lobby/RankView.lua +++ b/lua_probject/base_project/Game/View/Lobby/RankView.lua @@ -45,7 +45,7 @@ function M:init(url) ViewUtil.ShowModalWait(self._root_view) local loddyCtr1 = ControllerManager.GetController(LoddyController) loddyCtr1:RequestRecordList(function(result) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end @@ -245,7 +245,7 @@ function M:InitRecord1(recordList, develop_tool) ShareScreenShotWithOption(function() result_view:Dispose() end) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() if code == 0 then if DataManager.SelfUser.playback[playback_id] ~= nil then DataManager.SelfUser.playback[playback_id][i] = data diff --git a/lua_probject/base_project/Game/View/Lobby/RealAddressView.lua b/lua_probject/base_project/Game/View/Lobby/RealAddressView.lua index fe1bacf7..baf01fa2 100644 --- a/lua_probject/base_project/Game/View/Lobby/RealAddressView.lua +++ b/lua_probject/base_project/Game/View/Lobby/RealAddressView.lua @@ -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,33 +54,34 @@ 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.ShowModalWait(self._root_view,"正在提交认证...") - local loddyctr = ControllerManager.GetController(LoddyController) + ViewUtil.ShowModalWait2(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.CloseModalWait() - if (res.ReturnCode ==0) then + loddyctr:UpdateUserInfo(_data, function(res) + ViewUtil.CloseModalWait2() + if (res.ReturnCode == 0) then DataManager.SelfUser.real_info = real_info if self._callback then self._callback() end else @@ -110,7 +111,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 @@ -119,25 +120,25 @@ 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.ShowModalWait(self._root_view,"正在提交...") - local loddyctr = ControllerManager.GetController(LoddyController) + ViewUtil.ShowModalWait2(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.CloseModalWait() - if (res.ReturnCode ==0) then + loddyctr:UpdateUserInfo(_data, function(res) + ViewUtil.CloseModalWait2() + 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) end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/Lobby/WeChatView.lua b/lua_probject/base_project/Game/View/Lobby/WeChatView.lua index 4c487a65..21d02763 100644 --- a/lua_probject/base_project/Game/View/Lobby/WeChatView.lua +++ b/lua_probject/base_project/Game/View/Lobby/WeChatView.lua @@ -5,40 +5,38 @@ 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.ShowModalWait(self._root_view,"正在同步数据...") - GameApplication.Instance:WXLogin(handler(self,self.WXCallBack)) + btn_ok.onClick:Set(function() + ViewUtil.ShowModalWait2(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.ShowModalWait(self._root_view) - return + ViewUtil.ShowModalWait2(self._root_view) + return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() return end if not data then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() return end local jd = json.decode(data) @@ -48,20 +46,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.CloseModalWait() + if not unionid or string.len(unionid) < 1 then + ViewUtil.CloseModalWait2() 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.CloseModalWait() - if (res.ReturnCode ==0) then + loddyctr:UpdateUserInfo(_data, function(res) + ViewUtil.CloseModalWait2() + if (res.ReturnCode == 0) then local user = DataManager.SelfUser user.acc = unionid user.nick_name = nickname @@ -75,5 +73,4 @@ function M:WXCallBack(result,data) end) end - -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index 4a5d6c56..86571aa8 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -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.ShowModalWait(self._root_view, "请稍等,获取牌友圈中...") + -- ViewUtil.ShowModalWait2(self._root_view, "请稍等,获取牌友圈中...") -- local enterGroupCallBackFunc = function(code) - -- ViewUtil.CloseModalWait() + -- ViewUtil.CloseModalWait2() -- if code == 0 then -- self.groupMainView._view.visible = true -- else @@ -181,6 +181,9 @@ 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 @@ -276,9 +279,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.ShowModalWait(self._root_view,"请稍等,获取牌友圈中...") + -- ViewUtil.ShowModalWait2(self._root_view,"请稍等,获取牌友圈中...") -- local enterGroupCallBackFunc=function (code) - -- ViewUtil.CloseModalWait() + -- ViewUtil.CloseModalWait2() -- if code==0 then -- self.groupMainView._view.visible = true -- else diff --git a/lua_probject/base_project/Game/View/LoginView.lua b/lua_probject/base_project/Game/View/LoginView.lua index 19882e6b..c6fca6ec 100644 --- a/lua_probject/base_project/Game/View/LoginView.lua +++ b/lua_probject/base_project/Game/View/LoginView.lua @@ -1,4 +1,4 @@ -local PhoneLoginView = import(".PhoneLoginView") +local PhoneLoginView = import(".PhoneLoginView2") LoginView = {} @@ -47,13 +47,13 @@ function M:init() ViewUtil.ErrorTip(self._root_view, "请勾选同意《用户协议》") return end - ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...") + ViewUtil.ShowModalWait2(self._root_view, "正在登录游戏...") coroutine.start(function() coroutine.wait(8) if self.isWXCallBackMark then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(10000, "微信登录失败!") end) if (not GameApplication.Instance.accountTest) then @@ -128,7 +128,7 @@ end local function __join_room(roomid, res) local loddyctr = ControllerManager.GetController(LoddyController) loddyctr:JoinRoom(roomid, function(res1) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res1.ReturnCode == -2 then __join_room(roomid, res) elseif res1.ReturnCode == 0 then @@ -142,7 +142,7 @@ local function __join_room(roomid, res) end local function __login_response(self, response) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() local skey = "session_id" if (response.ReturnCode == 0) then local user = DataManager.SelfUser @@ -161,7 +161,7 @@ local function __login_response(self, response) local roomid = user.room_id if (string.len(roomid) > 1) then if user.group_id == 0 then - ViewUtil.ShowModalWait(self._root_view, "正在加入房间...") + ViewUtil.ShowModalWait2(self._root_view, "正在加入房间...") __join_room(roomid, response) return else @@ -216,7 +216,7 @@ end function M:PhoneCodeLogin() local _phoneCodeView = nil - _phoneCodeView = PhoneLoginView.new(1, function(res) + _phoneCodeView = PhoneLoginView.new(1, self.phone, function(res) if res.ReturnCode == 0 then _phoneCodeView:Destroy() end @@ -240,9 +240,15 @@ 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 - ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...") + PlayerPrefs.DeleteKey('session_phone') + PlayerPrefs.Save() + if self.phone and #self.phone > 0 then + return + end + ViewUtil.ShowModalWait2(self._root_view, "正在登录游戏...") local loginCtr = ControllerManager.GetController(LoginController) loginCtr:QuickLogin(session_id, function(response) __login_response(self, response) @@ -258,10 +264,10 @@ function M:LoginCallBack(result, data) --pt(data) if (not result) or result ~= 0 then if result == 10 then - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() return end @@ -279,7 +285,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.CloseModalWait() + ViewUtil.CloseModalWait2() return end end diff --git a/lua_probject/base_project/Game/View/MainView.lua b/lua_probject/base_project/Game/View/MainView.lua index bc481dfb..f943a43d 100644 --- a/lua_probject/base_project/Game/View/MainView.lua +++ b/lua_probject/base_project/Game/View/MainView.lua @@ -409,10 +409,10 @@ function M:InitView(url, isHideIpAdds) if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。') else - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) self._gamectr:LevelRoom( function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then ViewManager.ChangeView(ViewManager.View_Lobby) else @@ -445,10 +445,10 @@ function M:InitView(url, isHideIpAdds) if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。') else - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) self._gamectr:LevelRoom( function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then ViewManager.ChangeView(ViewManager.View_Lobby) else @@ -469,7 +469,7 @@ function M:InitView(url, isHideIpAdds) if IsRoomOwer() then self._gamectr:AskDismissRoom( function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then ViewManager.ChangeView(ViewManager.View_Family) else @@ -571,6 +571,23 @@ 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 + pt("lingmeng share ", data) + ViewUtil.__share(data) + end) + end ------------------------------------------------------------ end @@ -592,10 +609,10 @@ function M:continue_game(continue) if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。') else - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) self._gamectr:LevelRoom( function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then ViewManager.ChangeView(ViewManager.View_Lobby) else @@ -1553,7 +1570,7 @@ function M:Destroy() ControllerManager.resetJionRoom = false self._popEvent = false GRoot.inst:HidePopup() - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() GameApplication.Instance.StopMusic = 0 coroutine.stopAll() UpdateBeat:Remove(self.OnUpdate, self) diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua index 108db03b..e567d7cb 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua @@ -306,7 +306,7 @@ local function __fillRoomItem(self, index, item, room) ) _curren_msg.onOk:Add( function() - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.CloseModalWait() + -- ViewUtil.CloseModalWait2() -- ViewUtil.ErrorTip(nil, '输入不能为空') -- return -- end @@ -943,7 +943,7 @@ function M:InitView(url) -- _curren_msg.onOk:Add( -- function() - -- ViewUtil.ShowModalWait(self._root_view) + -- ViewUtil.ShowModalWait2(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.CloseModalWait() + -- ViewUtil.CloseModalWait2() -- if res.ReturnCode ~= 0 then -- ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!') -- return @@ -1313,7 +1313,7 @@ function M:__onUpdate() end function M:__joinRoom(room_id) - ViewUtil.ShowModalWait(self._root_view, '正在加入游戏...', 'join_room') + ViewUtil.ShowModalWait2(self._root_view, '正在加入游戏...', 'join_room') local roomCtr = ControllerManager.GetController(RoomController) local _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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('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.CloseModalWait('join_room') + -- ViewUtil.CloseModalWait2('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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('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.ShowModalWait(self._root_view, "正在进入牌友圈,请稍等...") + ViewUtil.ShowModalWait2(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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait(self._root_view, '正在加入游戏...', 'join_room') + ViewUtil.ShowModalWait2(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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('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.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('join_room') end if callback then callback() diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupJoinsView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupJoinsView.lua index 2a8c8201..a43d0f2d 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupJoinsView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupJoinsView.lua @@ -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.ShowModalWait(self._root_view) - fgCtr:FG_GroupVerifyJoin(curGroup.id,_rd.id,true,function(res1) + ViewUtil.ShowModalWait2(self._root_view) + fgCtr:FG_GroupVerifyJoin(curGroup.id, _rd.id, true, function(res1) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait(self._root_view) - fgCtr:FG_GroupVerifyJoin(curGroup.id,_rd.id,false,function(res1) + ViewUtil.ShowModalWait2(self._root_view) + fgCtr:FG_GroupVerifyJoin(curGroup.id, _rd.id, false, function(res1) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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,13 +91,12 @@ 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupMailView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupMailView.lua index 8cf0f7a6..e69b54ff 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupMailView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupMailView.lua @@ -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 @@ -17,13 +17,13 @@ function GroupMailView.new(blur_view, curGroup) self:init("ui://NewGroup/Win_Mail") self:FillView() return self -end +end function M:FillView() - self.lst_mail = self._view:GetChild("lst_mail") - self.lst_mail:SetVirtual() + 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) @@ -33,7 +33,7 @@ function M:FillView() local btn_delete = self._view:GetChild("btn_delete") btn_delete.onClick:Set(function() local msg_tip = MsgWindow.new(self._root_view, "确定要删除所有邮件吗?", MsgWindow.MsgMode.OkAndCancel) - msg_tip.onOk:Add(function() + msg_tip.onOk:Add(function() self:DelAllMail() end) msg_tip:Show() @@ -41,67 +41,68 @@ function M:FillView() end function M:GetMailData(index) - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetMailList(self.curGroup.id, DataManager.SelfUser.account_id, index, 20, function(res) - 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.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.ErrorTip(res.ReturnCode, "获取邮件列表失败") - end - end) + end + end) end function M:DelAllMail() - 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.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.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 -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupMainView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupMainView.lua index 2d4b2b7b..fb482d35 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupMainView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupMainView.lua @@ -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.ShowModalWait(cgv._root_view) + ViewUtil.ShowModalWait2(cgv._root_view) fgCtr:FG_CreateGroup(name, pay_type, fg_type, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) fgCtr:FG_GroupList(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) fgCtr:FG_TopGroup(group.id, ctr_select.selectedIndex == 0, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupMngFagPackView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupMngFagPackView.lua index 067a0189..eb4f8f01 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupMngFagPackView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupMngFagPackView.lua @@ -1,4 +1,4 @@ --- 能量包 +-- 能量包 local GroupTakeLogView = import(".MngView.GroupTakeLogView") local GroupRewardsLogView = import(".MngView.GroupRewardsLogView") local GroupNumberInputView = import(".MngView.GroupNumberInputView") @@ -8,49 +8,48 @@ 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 - ) - - - self.playerJF=self._view:GetChild('tex_player') - self.bankJF=self._view:GetChild('tex_bank') - + 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.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) @@ -64,228 +63,195 @@ 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 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 - - 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 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 + + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + + 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 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 - - 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 - ) - - + 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 + + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + + 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 + ) + + --------------------------- - 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.ShowModalWait() - local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_GetBankInfo(self.group_id, self.uid,function(res) + ViewUtil.ShowModalWait2() + local fgCtr = ControllerManager.GetController(NewGroupController) + fgCtr:FG_GetBankInfo(self.group_id, self.uid, function(res) pt(res) - ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() - 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.CloseModalWait2() + 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupMngSettingView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupMngSettingView.lua index 1bb7dc5f..56d95982 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupMngSettingView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupMngSettingView.lua @@ -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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "设置大联盟失败。") else diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupRecordView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupRecordView.lua index 95587a7f..d980b6ce 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupRecordView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupRecordView.lua @@ -6,14 +6,13 @@ 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 self.qid = qid - self.includeMembers = includeMembers + self.includeMembers = includeMembers self.begin_time = begin_time self.end_time = end_time self.time_type = time_type @@ -22,12 +21,12 @@ 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 = {} --回放数据 - + self.lst_record = self._view:GetChild("lst_record") - self.lst_record:SetVirtual() + self.lst_record:SetVirtual() self.lst_record.itemRenderer = function(index, obj) self:OnRenderRecordItem(index, obj) end @@ -40,39 +39,37 @@ end function M:OnRenderRecordItem(index, obj) local data = self.record_data[index + 1] - self:FillRecordItem(data, obj) + self:FillRecordItem(data, obj) end function M:GetRecordData(index) - - ViewUtil.ShowModalWait() + 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.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] + 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 - self.lst_record.numItems = #self.record_data - end - 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 + 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 @@ -90,19 +87,19 @@ function M:FillRecordItem(data, obj) player_list[i].house = 0 player_list[i].nick = p.nick end - local play_name = DataManager.groups:get(self.curGroup):getPlayName(data.groupPid) + local play_name = DataManager.groups:get(self.curGroup):getPlayName(data.groupPid) obj:GetChild("tex_time").text = room_time_str - obj:GetChild("tex_roomid").text = room_id - obj:GetChild("tex_times").text = d2ad(data.hp_times).."倍" + obj:GetChild("tex_roomid").text = room_id + 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 @@ -111,7 +108,7 @@ function M:FillRecordItem(data, obj) else score = d2ad(trdata.hp) end - + titem:GetChild("tex_score").text = score if score >= 0 then @@ -129,18 +126,18 @@ function M:FillRecordItem(data, obj) obj:GetChild("btn_screenshot").onClick:Set(function() self:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType) - end) + end) obj:GetChild("btn_share").onClick:Set(function() ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list) - end) + end) obj.onClick:Set(function() self:OnShowRecordInfo(data) - end) + end) end -function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType) - ViewUtil.ShowModalWait(self._view, "正在分享...") +function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType) + ViewUtil.ShowModalWait2(self._view, "正在分享...") UIPackage.AddPackage("base/rank/ui/Rank") local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView") result_view.visible = false @@ -162,15 +159,15 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, end 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( ... ) - load_head_num = load_head_num - 1 - end) + if p.portrait and p.portrait ~= "" then + 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 @@ -179,7 +176,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, ShareScreenShotWithOption(function() result_view:Dispose() end) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() break end coroutine.wait(1) @@ -201,21 +198,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_roomid").text = rdata.room_id - local round_score_str = rdata["round_"..i] + 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_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 @@ -224,7 +221,7 @@ function M:OnShowRecordInfo(rdata) else score = d2ad(trdata.hp) end - + titem:GetChild("tex_score").text = score end @@ -234,11 +231,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 @@ -253,13 +250,13 @@ function M:OnShowRecordInfo(rdata) main._totalRound = tonumber(rdata.round) main:FillRoomData(DataManager.SelfUser.playback[playback_id][i]) else - ViewUtil.ShowModalWait(self._view) + ViewUtil.ShowModalWait2(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.CloseModalWait() + loddyCtr1:RequestPlayBack(_data, function(code, data) + ViewUtil.CloseModalWait2() if code == 0 then if DataManager.SelfUser.playback[playback_id] ~= nil then DataManager.SelfUser.playback[playback_id][i] = data @@ -285,9 +282,8 @@ 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) @@ -296,12 +292,11 @@ 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupRemitView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupRemitView.lua index ee812b6a..d2f562f4 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupRemitView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupRemitView.lua @@ -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 @@ -45,17 +45,17 @@ function M:FillView() local btn_search = self._view:GetChild("btn_search") btn_search.onClick:Set(function() self._ctr_result.selectedIndex = 0 - if not remite_id then + if not remite_id then ViewUtil.ErrorTip(nil, "请输入玩家ID") - return + return end - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) fgCtr:FG_RemitFindMember(self.curGroup.id, remite_id, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "查询玩家失败") return else @@ -75,27 +75,27 @@ 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( ... ) - if not remite_id then + local msgbox = MsgWindow.new(self._root_view, "确定要转让积分吗?", MsgWindow.MsgMode.OkAndCancel) + msgbox.onOk:Add(function(...) + if not remite_id then ViewUtil.ErrorTip(nil, "请输入玩家ID") - return + return end if self._ctr_result.selectedIndex == 0 then ViewUtil.ErrorTip(nil, "请先搜索玩家") return end - if not remite_num then + if not remite_num then ViewUtil.ErrorTip(nil, "请输入转让数量") - return + return end - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) fgCtr:FG_FagRemit(self.curGroup.id, remite_id, ad2d(remite_num), function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "转让失败") return else @@ -112,13 +112,12 @@ 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupSetDefaultGameView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupSetDefaultGameView.lua index 7bdc0968..73e46053 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupSetDefaultGameView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupSetDefaultGameView.lua @@ -3,92 +3,80 @@ 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() - - local playName="playfaconfig"..self.group_id +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 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 --else -- MarkSelect.visible=false --end - - MarkSelect.visible=true - if localDataPlay and localDataPlay[tostring(tem.id)] then - MarkSelect.selected=localDataPlay[tostring(tem.id)] - else - MarkSelect.selected=false - end - - MarkSelect.onClick:Set(function() - self:MarkPlay(MarkSelect,tem.id,MarkSelect.selected) - end) - - - - end - local btn_confirm = self._view:GetChild("btn_confirm") - btn_confirm.onClick:Set(function() - if self._callback then - self._callback(lst_game.selectedIndex + 1) - end - self:Destroy() - end) - - - + MarkSelect.visible = true + if localDataPlay and localDataPlay[tostring(tem.id)] then + MarkSelect.selected = localDataPlay[tostring(tem.id)] + else + MarkSelect.selected = false + end + + MarkSelect.onClick:Set(function() + self:MarkPlay(MarkSelect, tem.id, MarkSelect.selected) + end) + end + local btn_confirm = self._view:GetChild("btn_confirm") + btn_confirm.onClick:Set(function() + if self._callback then + self._callback(lst_game.selectedIndex + 1) + end + self:Destroy() + end) end - - - - - -function M:MarkPlay(markS,pid,isMark) +function M:MarkPlay(markS, pid, isMark) --[[local fgCtr = ControllerManager.GetController(NewGroupController) - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_MarkPlay(self.group_id, pid, isMark, function(res) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then local group = DataManager.groups:get(self.group_id) group:markPlay(pid, isMark) @@ -100,27 +88,22 @@ function M:MarkPlay(markS,pid,isMark) ViewUtil.ErrorTip(res.ReturnCode,"设置失败,或已达设置上限") 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 - - Utils.SaveLocalFile(playName, json.encode(DataManager.SelfUser.PlayLocalList)) - + + local playName = "playfaconfig" .. self.group_id + + Utils.SaveLocalFile(playName, json.encode(DataManager.SelfUser.PlayLocalList)) + if self.callbackFill then self.callbackFill() end - - end - - - -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupSetTagView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupSetTagView.lua index a3e6754f..8876cf37 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupSetTagView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupSetTagView.lua @@ -32,7 +32,7 @@ function M:init(url, member) ]] self._view:GetChild("btn_ok").onClick:Set(function() - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(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.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "备注失败") else diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupSettingView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupSettingView.lua index 70f8a574..3413c116 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupSettingView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupSettingView.lua @@ -8,58 +8,56 @@ 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 - + self:init("ui://NewGroup/Win_GroupSetting") 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.ShowModalWait(self._root_view) + _curren_msg.onOk:Add(function() + ViewUtil.ShowModalWait2(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.CloseModalWait() + ViewUtil.CloseModalWait2() 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 @@ -68,31 +66,29 @@ 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 + 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 @@ -102,32 +98,28 @@ function M:FillData() self._view:GetController("opt").selectedIndex = 2 else local option = groups[1].option or 0 - if bit:_and(option,2) > 0 then - self._view:GetController("opt").selectedIndex = 1 + 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/JoinGroupView.lua b/lua_probject/base_project/Game/View/NewGroup/JoinGroupView.lua index c26b9b57..ac97da8a 100644 --- a/lua_probject/base_project/Game/View/NewGroup/JoinGroupView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/JoinGroupView.lua @@ -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.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_JoinGroup(tonumber(self._texnum_str),function(response) - ViewUtil.CloseModalWait() + fgCtr:FG_JoinGroup(tonumber(self._texnum_str), function(response) + ViewUtil.CloseModalWait2() 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 + 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,7 +70,6 @@ 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 @@ -81,4 +80,4 @@ function M:ClearNumTex() self.tex_num.text = self._texnum_str end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupAddMemberInfoView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupAddMemberInfoView.lua index 825cfd65..a984c5b4 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupAddMemberInfoView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupAddMemberInfoView.lua @@ -29,13 +29,13 @@ function M:init(url) ) self._view:GetChild("btn_qd").onClick:Set( function() - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_AddMember( self.group_id, self.member_id, function(response) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if (response.ReturnCode == 0) then ViewUtil.ErrorTip(-1, '添加成功!', 1) else diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupBanSameTableView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupBanSameTableView.lua index d8b6ba25..5216eca4 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupBanSameTableView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupBanSameTableView.lua @@ -62,15 +62,15 @@ function M:init(url) local fgCtr = ControllerManager.GetController(NewGroupController) self._view:GetChild("btn_search_member").onClick:Set(function() - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local qid = tonumber(self._view:GetChild("tex_find_memb").text) if not qid then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(nil, "输入ID进行搜索") return end fgCtr:FG_FindMember(self.group_id, qid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end @@ -118,9 +118,9 @@ function M:init(url) table.insert(del_list, tem.uid) end end - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_SetBanTable(self.group_id, self.member_id, set_list, del_list, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GroupMembers(self.group_id, index, 10, false, 1, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败") else diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua index bcbf5046..44470860 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua @@ -459,7 +459,7 @@ function M:FillFagData() pt(self.hpData) local fgCtr = ControllerManager.GetController(NewGroupController) - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(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.CloseModalWait() + ViewUtil.CloseModalWait2() ---- print("======新增玩法=============") --pt(res) if res.ReturnCode == 0 then @@ -508,7 +508,7 @@ function M:FillFagData() if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ---- print("======修改玩法=============") --pt(res) if res.ReturnCode == 0 then diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua index 84b52565..a1f1c482 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua @@ -552,7 +552,7 @@ function M:FillFagData() pt(self.hpData) local fgCtr = ControllerManager.GetController(NewGroupController) - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(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, @@ -560,7 +560,7 @@ function M:FillFagData() if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ---- print("======新增玩法=============") --pt(res) if res.ReturnCode == 0 then @@ -602,7 +602,7 @@ function M:FillFagData() if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ---- print("======修改玩法=============") --pt(res) if res.ReturnCode == 0 then @@ -1054,7 +1054,7 @@ function M:FillFagData_jiangxi() pt(self.hpData) local fgCtr = ControllerManager.GetController(NewGroupController) - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(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, @@ -1062,7 +1062,7 @@ function M:FillFagData_jiangxi() if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ---- print("======新增玩法=============") --pt(res) if res.ReturnCode == 0 then @@ -1104,7 +1104,7 @@ function M:FillFagData_jiangxi() if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ---- print("======修改玩法=============") --pt(res) if res.ReturnCode == 0 then diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberFagLogView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberFagLogView.lua index 2903ca6c..acb89b22 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberFagLogView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberFagLogView.lua @@ -148,14 +148,14 @@ end function M:GetData(index) local filter = self:GetFilter() if filter == 0 then return end - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败") else @@ -292,13 +292,13 @@ end -- 获取日统计数据 function M:GetDailyData() - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetPlayerDailyHPCount(self.group_id, self.member.uid, function(res) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取积分详情失败") else diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberOperateView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberOperateView.lua index 3dd80a68..0eb627b1 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberOperateView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberOperateView.lua @@ -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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(res.ReturnCode, "找不到成员") elseif res.Data.partnerLev == 0 then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(res.ReturnCode, "目标不是合伙人") else fgCtr:FG_DeployMember(self.group_id, member.uid, parent_id, function(res1) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_GroupRemoveMember(self.group_id, member.uid, function(res1) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_GetBanTable(self.group_id, member.uid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_GetBanMemberHB(self.group_id, member.uid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() --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.ShowModalWait() + ViewUtil.ShowModalWait2() local val = 4 - member.lev fgCtr:FG_SetManager(self.group_id, member.uid, val, function(res1) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(res.ReturnCode, "找不到成员") elseif res.Data.partnerLev == 0 then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_TakeHp1(self.group_id, member.uid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() if (res1.ReturnCode == 0) then member.parentId = parent_id member.partnerLev = res1.Data.partnerLev diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngAddMemberView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngAddMemberView.lua index e62e2e51..2c4d6bff 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngAddMemberView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngAddMemberView.lua @@ -56,10 +56,10 @@ function M:FillView() return end if self._texnum_str == "" then return end - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_AddMember(self.group_id, tonumber(self._texnum_str), function(response) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GroupJoins(self.group_id, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GroupVerifyJoin(self.group_id, id, allow, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if (res.ReturnCode == 0) then self:GetJoinsData() else diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngAddPartner.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngAddPartner.lua index 78b57cfc..4b174510 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngAddPartner.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngAddPartner.lua @@ -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,10 +16,8 @@ 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) @@ -35,20 +33,19 @@ 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.CloseModalWait() + ViewUtil.CloseModalWait2() 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngFagListView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngFagListView.lua index 43eb97fd..40821f2c 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngFagListView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngFagListView.lua @@ -20,25 +20,21 @@ 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 @@ -48,7 +44,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) @@ -56,7 +52,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) @@ -64,24 +60,23 @@ 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() @@ -94,13 +89,14 @@ 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 -- 获取上下分数据 @@ -109,28 +105,28 @@ 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.ShowModalWait(nil) + end + ViewUtil.ShowModalWait2(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.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取积分记录失败") else if res.Data.hp_logs ~= nil then @@ -151,77 +147,77 @@ function M:GetFagData(index) lst.numItems = #local_data end end - end) + end) end -- 获取体力值统计 function M:GetHpStatistic() - -- ViewUtil.ShowModalWait(nil, "正在获取数据") - local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_GetMngHpStatistic(self.group_id, function(res) - -- ViewUtil.CloseModalWait() + -- ViewUtil.ShowModalWait2(nil, "正在获取数据") + local fgCtr = ControllerManager.GetController(NewGroupController) + fgCtr:FG_GetMngHpStatistic(self.group_id, function(res) + -- ViewUtil.CloseModalWait2() if self._is_destroy then return end - if res.ReturnCode ~= 0 then + 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.ShowModalWait(nil) + ViewUtil.ShowModalWait2(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.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end - if res.ReturnCode ~= 0 then + 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngGameListView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngGameListView.lua index 8883c8b5..488e67dd 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngGameListView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngGameListView.lua @@ -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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_DelPlay(self.group_id, play.id, function(res) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_MarkPlay(self.group_id, pid, isMark, function(res) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_BanPlay(self.group_id, pid, ban, function(res) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then local group = DataManager.groups:get(self.group_id) group:banPlay(pid, ban) diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberInfoView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberInfoView.lua index 833d90f7..8c98d14a 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberInfoView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberInfoView.lua @@ -1,4 +1,3 @@ - -- 开桌统计 local GroupMngMemberInfoView = {} @@ -12,30 +11,25 @@ function GroupMngMemberInfoView.new(gid) return self end -function M:initData() +function M:initData() self:ShowPeopleNum() end function M:ShowPeopleNum() - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_GetMembersCount(self.group_id,function(res) + fgCtr:FG_GetMembersCount(self.group_id, function(res) + ViewUtil.CloseModalWait2() - ViewUtil.CloseModalWait() - if res.ReturnCode == 0 then 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberListView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberListView.lua index 38e80f1c..5b4b1266 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberListView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberListView.lua @@ -75,11 +75,11 @@ function M:FillView() local ctr_search = self._view:GetController('search') self._view:GetChild('btn_search').onClick:Set( function() - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local text = self._view:GetChild('tex_id').text local qid, qnick if text == "" then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(nil, '输入不能为空') return end @@ -90,7 +90,7 @@ function M:FillView() self.group_id, qid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end @@ -141,7 +141,7 @@ function M:FillView() if self._texnum_str == '' then return end - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:GetAddMember( self.group_id, @@ -149,7 +149,7 @@ function M:FillView() function(response) printlog("响应获取添加玩家==》》》") pt(response) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait(nil) + ViewUtil.ShowModalWait2(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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_ChangeFag( gid, pid, num, function(res1) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() -- 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.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local text = member.uid local qid, qnick if text == "" then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(nil, '输入不能为空') return end @@ -412,7 +412,7 @@ function M:FillItem(obj, member, refresh) self.group_id, qid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GroupJoins( self.group_id, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GroupVerifyJoin( self.group_id, id, allow, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if (res.ReturnCode == 0) then self:GetJoinsData() else diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberListView1.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberListView1.lua index 09f99d4a..7ad05d9a 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberListView1.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberListView1.lua @@ -94,11 +94,11 @@ function M:FillView() local ctr_search = self._view:GetController('search') self._view:GetChild('btn_search').onClick:Set( function() - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local text = self._view:GetChild('tex_id').text local qid, qnick if text == "" then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(nil, '输入不能为空') return end @@ -109,7 +109,7 @@ function M:FillView() self.group_id, qid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end @@ -160,7 +160,7 @@ function M:FillView() if self._texnum_str == '' then return end - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:GetAddMember( self.group_id, @@ -168,7 +168,7 @@ function M:FillView() function(response) printlog("响应获取添加玩家==》》》") pt(response) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait(nil) + ViewUtil.ShowModalWait2(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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_ChangeFag( gid, pid, num, function(res1) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() -- 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.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local text = member.uid local qid, qnick if text == "" then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(nil, '输入不能为空') return end @@ -486,7 +486,7 @@ function M:FillItem(obj, member, refresh) self.group_id, qid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GroupJoins( self.group_id, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GroupVerifyJoin( self.group_id, id, allow, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if (res.ReturnCode == 0) then self:GetJoinsData() else diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberStatView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberStatView.lua index 65567c9a..04512c2a 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberStatView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngMemberStatView.lua @@ -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 @@ -26,21 +26,22 @@ function M:InitView() self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupMemberStat") self.lst_record = self._view:GetChild("lst_record") - self.lst_record:SetVirtual() + self.lst_record:SetVirtual() self.lst_record.itemRenderer = function(index, obj) self:OnRenderRecordItem(index, obj) end self.lst_record.scrollPane.onPullUpRelease:Set(function() 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() self.record_data = {} self.lst_record.numItems = 0 - self.begin_time = nil + self.begin_time = nil self.end_time = nil self._view:GetChild("tex_id").text = "" self:GetRecordData(0) @@ -53,64 +54,59 @@ function M:InitView() self.begin_time, self.end_time = self.time_panel:GetDate() self:GetRecordData(0) end) - end -- 获取合伙人数据 function M:GetPartnerData(callback) - - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetPartnerList(self.group_id, 1, nil, nil, function(res) - - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() callback(res) end) end -function M:GetRecordData(index,init) - +function M:GetRecordData(index, init) if init == nil or init == false then - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() 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 - + local time_type = self._view:GetController("type").selectedIndex if self.begin_time ~= nil and self.end_time ~= nil then time_type = 3 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.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] + 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 - self.lst_record.numItems = #self.record_data - end - 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 + 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) - 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") + local ctr_type = obj:GetController("type") if data.lev < 3 then ctr_type.selectedIndex = data.lev elseif data.partnerLev ~= 0 then @@ -122,8 +118,7 @@ end function M:OnRenderRecordItem(index, obj) local data = self.record_data[index + 1] - self:FillRecordItem(data, obj) + self:FillRecordItem(data, obj) end - -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView.lua index 0455ec2e..a510caae 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView.lua @@ -25,18 +25,18 @@ end function M:initData() --self._view.visible = true - self:GetPartnerData(0) + self:GetPartnerData(0) end function M:InitView() self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPartnerList") - + -- 初始化合伙人列表 self.lst_partner = self._view:GetChild("lst_partner") - self.lst_partner:SetVirtual() + self.lst_partner:SetVirtual() self.lst_partner.itemRenderer = function(index, obj) - self:OnRenderItem(index, obj) - end + self:OnRenderItem(index, obj) + end self.lst_partner.scrollPane.onPullUpRelease:Set(function() self:GetPartnerData(self.lst_partner.numItems) end) @@ -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) @@ -60,44 +60,42 @@ 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.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local qid = tonumber(self._view:GetChild("tex_num").text) if not qid then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(nil, "输入ID进行搜索!") return end local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_FindMember(self.group_id, qid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end - if res.ReturnCode ~= 0 then + 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, "找不到成员!") - return + return end if member.partnerLev > 0 then ViewUtil.ErrorTip(res.ReturnCode, "该玩家已经是代理!") 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) @@ -106,7 +104,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() @@ -116,88 +114,80 @@ 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 + 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.ShowModalWait(nil) +function M:GetPartnerData(index, callback) + local group = DataManager.groups:get(self.group_id) + if index == 0 then + self.partner_data = {} + end + ViewUtil.ShowModalWait2(nil) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetPartnerList(self.group_id, 0, index, 10, function(res) - - ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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.ShowModalWait(nil) + + ViewUtil.ShowModalWait2(nil) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res) - - ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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, "找不到指定的玩家") - end + end end end) 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 @@ -211,20 +201,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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_ChangeFag(gid, pid, num, function(res1) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() -- 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 @@ -243,7 +233,6 @@ end -- 填充合伙人对象 function M:FillItem(obj, partner) - local group = DataManager.groups:get(self.group_id) local perm_array = MngPermission.getPermData(group.permission) @@ -252,7 +241,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 @@ -262,7 +251,7 @@ function M:FillItem(obj, partner) local p = group:getMember(partner.uid) local mp = group:getMember(DataManager.SelfUser.account_id) obj:GetChild("btn_fag_add").onClick:Set(function() - if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then + if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then return end __change_fag(self.group_id, partner.uid, true, nil, function(data) @@ -283,8 +272,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 + if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then return end __change_fag(self.group_id, partner.uid, false, partner.hp, function(data) @@ -306,8 +294,8 @@ function M:FillItem(obj, partner) 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() @@ -328,16 +316,11 @@ 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] @@ -346,8 +329,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 -- 显示合伙人奖励 @@ -356,4 +339,4 @@ function M:ShowPartnerRewards(partner_id, partnerLev) prv:Show() end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView1.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView1.lua index ec6321df..1652765a 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView1.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView1.lua @@ -19,23 +19,23 @@ function GroupMngPartnerListView1.new(gid, blur_view) self.blur_view = blur_view self.partner_data = {} self:InitView() - return self + return self end function M:initData() --self._view.visible = true - self:GetPartnerData(0) + self:GetPartnerData(0) end function M:InitView() self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPartnerList1") - + -- 初始化合伙人列表 self.lst_partner = self._view:GetChild("lst_partner") - self.lst_partner:SetVirtual() + self.lst_partner:SetVirtual() self.lst_partner.itemRenderer = function(index, obj) - self:OnRenderItem(index, obj) - end + self:OnRenderItem(index, obj) + end self.lst_partner.scrollPane.onPullUpRelease:Set(function() self:GetPartnerData(self.lst_partner.numItems) end) @@ -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) @@ -59,44 +59,42 @@ 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.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local qid = tonumber(self._view:GetChild("tex_num").text) if not qid then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(nil, "输入ID进行搜索!") return end local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_FindMember(self.group_id, qid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end - if res.ReturnCode ~= 0 then + 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, "找不到成员!") - return + return end if member.partnerLev > 0 then ViewUtil.ErrorTip(res.ReturnCode, "该玩家已经是代理!") 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) @@ -105,7 +103,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() @@ -115,90 +113,82 @@ 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 + 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.ShowModalWait(nil) +function M:GetPartnerData(index, callback) + local group = DataManager.groups:get(self.group_id) + if index == 0 then + self.partner_data = {} + end + ViewUtil.ShowModalWait2(nil) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GroupTiChu(self.group_id, index, 10, function(res) - - ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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.ShowModalWait(nil) + + ViewUtil.ShowModalWait2(nil) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res) - - ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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, "找不到指定的玩家") - end + end end end) 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 @@ -212,20 +202,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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_ChangeFag(gid, pid, num, function(res1) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() -- 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 @@ -244,17 +234,16 @@ 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 @@ -264,7 +253,7 @@ function M:FillItem(obj, partner) local p = group:getMember(partner.uid) local mp = group:getMember(DataManager.SelfUser.account_id) obj:GetChild("btn_fag_add").onClick:Set(function() - if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then + if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then return end __change_fag(self.group_id, partner.uid, true, nil, function(data) @@ -285,8 +274,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 + if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then return end __change_fag(self.group_id, partner.uid, false, partner.hp, function(data) @@ -307,9 +295,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) @@ -331,9 +319,6 @@ function M:FillItem(obj, partner) end) end - - - -- 列表对象填充 function M:OnRenderItem(index, obj) local partner = self.partner_data[index + 1] @@ -342,8 +327,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 -- 显示合伙人奖励 @@ -352,4 +337,4 @@ function M:ShowPartnerRewards(partner_id, partnerLev) prv:Show() end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView2.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView2.lua index b8fd2761..7bac54aa 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView2.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerListView2.lua @@ -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,17 +24,15 @@ 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:SetVirtual() self.lst_partner.itemRenderer = function(index, obj) - self:OnRenderItem(index, obj) - end + self:OnRenderItem(index, obj) + end self.lst_partner.scrollPane.onPullUpRelease:Set(function() self:GetPartnerData(self.lst_partner.numItems) end) @@ -46,72 +44,64 @@ 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.ShowModalWait(nil) +function M:GetPartnerData(index, callback) + local group = DataManager.groups:get(self.group_id) + if index == 0 then + self.partner_data = {} + end + ViewUtil.ShowModalWait2(nil) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetPartnerList(self.group_id, 0, index, 10, function(res) - - 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] + 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 end - self.lst_partner.numItems = #self.partner_data - end - end, - self.tagId) + 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.ShowModalWait(nil) + + ViewUtil.ShowModalWait2(nil) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_QueryPartnerList(self.group_id, query_id, query_nick, function(res) - - ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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, "找不到指定的玩家") - end + end end end) 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 @@ -125,20 +115,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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_ChangeFag(gid, pid, num, function(res1) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() -- 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 @@ -157,7 +147,6 @@ end -- 填充合伙人对象 function M:FillItem(obj, partner) - local group = DataManager.groups:get(self.group_id) local perm_array = MngPermission.getPermData(group.permission) @@ -177,7 +166,7 @@ function M:FillItem(obj, partner) local p = group:getMember(partner.uid) local mp = group:getMember(DataManager.SelfUser.account_id) obj:GetChild("btn_fag_add").onClick:Set(function() - if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then + if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then return end __change_fag(self.group_id, partner.uid, true, nil, function(data) @@ -192,12 +181,10 @@ 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 + if not CheckPermission(group.lev, perm_array[MngPermissionList.SetFag]) then return end __change_fag(self.group_id, partner.uid, false, partner.hp, function(data) @@ -212,13 +199,12 @@ 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() @@ -229,20 +215,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 @@ -253,9 +239,6 @@ function M:FillItem(obj, partner) ) end - - - -- 列表对象填充 function M:OnRenderItem(index, obj) local partner = self.partner_data[index + 1] @@ -264,8 +247,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 -- 显示合伙人奖励 @@ -274,4 +257,4 @@ function M:ShowPartnerRewards(partner_id, partnerLev) prv:Show() end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerRewardsView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerRewardsView.lua index f63de9c0..57204ecf 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerRewardsView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerRewardsView.lua @@ -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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end @@ -333,13 +333,13 @@ end -- 获取奖励统计 function M:GetRewardsStatistic() - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end @@ -429,9 +429,9 @@ function M:OnRenderRewardsItem(index, obj) end local fgCtr = ControllerManager.GetController(NewGroupController) - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_SetRewards(self.group_id, data.pid, pdata.partnerLev, pdata.uid, false, tem, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_SetRewards(self.group_id, data.pid, pdata.partnerLev, pdata.uid, true, data.cur_value, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "设置合伙人奖励失败") else diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerStatView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerStatView.lua index 493d3973..253b3525 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerStatView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPartnerStatView.lua @@ -31,7 +31,7 @@ end -- local fgCtr = ControllerManager.GetController(NewGroupController) -- fgCtr:FG_GetMembersCount(self.group_id,function(res) --- ViewUtil.CloseModalWait() +-- ViewUtil.CloseModalWait2() -- 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.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local text = self._view:GetChild('tex_id').text local qid, qnick if text == "" then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(nil, '输入不能为空') return end @@ -118,7 +118,7 @@ function M:InitView() function(res) -- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222") -- pt(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end @@ -149,7 +149,7 @@ function M:InitView() end function M:GetRecordData(index) - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetTotalHp(self.group_id, data.uid, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "设置失败") else diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPersonStatView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPersonStatView.lua index e83121a9..83e9d4dc 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPersonStatView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPersonStatView.lua @@ -23,21 +23,22 @@ function M:InitView() self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPersonStat") self.lst_record = self._view:GetChild("lst_record") - self.lst_record:SetVirtual() + self.lst_record:SetVirtual() self.lst_record.itemRenderer = function(index, obj) self:OnRenderRecordItem(index, obj) end self.lst_record.scrollPane.onPullUpRelease:Set(function() 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() self.record_data = {} self.lst_record.numItems = 0 - self.begin_time = nil + self.begin_time = nil self.end_time = nil self:GetRecordData(0) end) @@ -52,9 +53,8 @@ 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 @@ -62,33 +62,35 @@ 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.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] + 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 - self.lst_record.numItems = #self.record_data + ViewUtil.CloseModalWait2() + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败") + else + local records = res.Data.records + for i = 1, #records do + self.record_data[#self.record_data + 1] = records[i] + end + self.lst_record.numItems = #self.record_data - printlog("ccccccccccccccccccccccccccccccccccc2222223333333333333333333333333333333",res.Data.total_round," ",res.Data.valid_round) - 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) + 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) + end) end function M:FillRecordItem(data, obj) @@ -96,7 +98,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 @@ -114,21 +116,21 @@ function M:FillRecordItem(data, obj) player_list[i].house = 0 player_list[i].nick = p.nick end - local play_name = DataManager.groups:get(self.group_id):getPlayName(data.groupPid) + local play_name = DataManager.groups:get(self.group_id):getPlayName(data.groupPid) obj:GetChild("tex_time").text = room_time_str - obj:GetChild("tex_roomid").text = room_id - obj:GetChild("tex_times").text = d2ad(data.hp_times).."倍" + obj:GetChild("tex_roomid").text = room_id + 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 @@ -138,7 +140,7 @@ function M:FillRecordItem(data, obj) else score = d2ad(trdata.hp) end - + titem:GetChild("tex_score").text = score if score >= 0 then @@ -156,24 +158,23 @@ function M:FillRecordItem(data, obj) obj:GetChild("btn_screenshot").onClick:Set(function() self:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType) - end) + end) obj:GetChild("btn_share").onClick:Set(function() ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list) - end) + end) obj.onClick:Set(function() - self:OnShowRecordInfo(data,ids) - end) + self:OnShowRecordInfo(data, ids) + end) end function M:OnRenderRecordItem(index, obj) local data = self.record_data[index + 1] - self:FillRecordItem(data, obj) + self:FillRecordItem(data, obj) end - -function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType) - ViewUtil.ShowModalWait(self._view, "正在分享...") +function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType) + ViewUtil.ShowModalWait2(self._view, "正在分享...") UIPackage.AddPackage("base/rank/ui/Rank") local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView") result_view.visible = false @@ -195,15 +196,15 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, end 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( ... ) - load_head_num = load_head_num - 1 - end) + if p.portrait and p.portrait ~= "" then + 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 @@ -212,7 +213,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, ShareScreenShotWithOption(function() result_view:Dispose() end) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() break end coroutine.wait(1) @@ -221,7 +222,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 @@ -233,26 +234,26 @@ 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) - local play_name = DataManager.groups:get(self.group_id):getPlayName(rdata.groupPid) + local play_name = DataManager.groups:get(self.group_id):getPlayName(rdata.groupPid) item:GetChild("tex_game").text = play_name - item:GetChild("tex_roomid").text = rdata.room_id + item:GetChild("tex_roomid").text = rdata.room_id - item:GetChild("tex_times").text = d2ad(rdata.hp_times).."倍" + item:GetChild("tex_times").text = d2ad(rdata.hp_times) .. "倍" - local round_score_str = rdata["round_"..i] + local round_score_str = rdata["round_" .. i] local round_score_item = json.decode(round_score_str) local 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 @@ -263,7 +264,7 @@ function M:OnShowRecordInfo(rdata,ids) score = d2ad(trdata.hp) end - + titem:GetChild("tex_score").text = score end @@ -272,11 +273,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 @@ -291,13 +292,13 @@ function M:OnShowRecordInfo(rdata,ids) main._totalRound = tonumber(rdata.round) main:FillRoomData(DataManager.SelfUser.playback[playback_id][i]) else - ViewUtil.ShowModalWait(self._view) + ViewUtil.ShowModalWait2(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.CloseModalWait() + loddyCtr1:RequestPlayBack(_data, function(code, data) + ViewUtil.CloseModalWait2() if code == 0 then if DataManager.SelfUser.playback[playback_id] ~= nil then DataManager.SelfUser.playback[playback_id][i] = data @@ -324,7 +325,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) @@ -333,11 +334,11 @@ 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPlayStatView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPlayStatView.lua index 81024764..4e11cdc3 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPlayStatView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngPlayStatView.lua @@ -13,63 +13,62 @@ 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:SetVirtual() self.lst_consume_stat.itemRenderer = function(index, obj) - self:OnRenderConsumeItem(index, obj) - end + 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.ShowModalWait() +function M:GetConsumeStatData() + ViewUtil.ShowModalWait2() 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.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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 "总计" @@ -86,4 +85,4 @@ function M:OnRenderConsumeItem(index, obj) obj:GetChild("tex_diamond").text = data.diamo_cost / 100 end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngProportionView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngProportionView.lua index 0d5dc6ca..a5df3bc9 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngProportionView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngProportionView.lua @@ -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,60 +24,61 @@ 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:SetVirtual() self.lst_prop.itemRenderer = function(index, obj) - self:OnRenderPropItem(index, obj) - end + 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.ShowModalWait() - local begin_time, end_time = self.time_panel:GetDate() +function M:GetPropData(index) + ViewUtil.ShowModalWait2() + 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.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngRankView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngRankView.lua index de4c1adb..969c8122 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngRankView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngRankView.lua @@ -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,53 +57,53 @@ 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() self:clearRankData() - + self:GetWinRankData(#self.win_data) end) self.lst_rank = self._view:GetChild("lst_rank") - self.lst_rank:SetVirtual() + self.lst_rank:SetVirtual() self.lst_rank.itemRenderer = function(index, obj) - self:OnRenderRankItem(index, obj) - end + self:OnRenderRankItem(index, obj) + end self.lst_rank.scrollPane.onPullUpRelease:Set(function() self:GetRankData(self.lst_rank.numItems) end) 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:SetVirtual() self.lst_winrank.itemRenderer = function(index, obj) - self:OnRenderWinRankItem(index, obj) - end + 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,97 +111,99 @@ 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.ShowModalWait() - local begin_time, end_time = self.time_panel:GetDate() - local pid = tonumber(self._view:GetChild("cb_play").value) +function M:GetRankData(index) + ViewUtil.ShowModalWait2() + 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.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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.ShowModalWait() - local begin_time, end_time = self.time_panel1:GetDate() - local pid = tonumber(self._view:GetChild("cb_play").value) +function M:GetWinRankData(index) + ViewUtil.ShowModalWait2() + 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.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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 @@ -214,14 +216,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 @@ -233,29 +235,29 @@ function M:OnRenderWinRankItem(index, obj) obj:GetChild("tex_round").text = data.round end -function M:GetRoundData() - ViewUtil.ShowModalWait() - local pid = tonumber(self._view:GetChild("cb_play").value) +function M:GetRoundData() + ViewUtil.ShowModalWait2() + 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.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngRoomStatView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngRoomStatView.lua index deda722d..afa28ada 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngRoomStatView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngRoomStatView.lua @@ -25,34 +25,33 @@ end function M:InitView() self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupStat") - - self.record_data = {} --回放数据 - self.player_record_data = {} --指定玩家的回放数据 - self.qid = 0 --查询玩家id - self.lst_record_find = self._view:GetChild("lst_record_find") - self.lst_record_find:SetVirtual() + self.record_data = {} --回放数据 + self.player_record_data = {} --指定玩家的回放数据 + self.qid = 0 --查询玩家id + + 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) end self.lst_record = self._view:GetChild("lst_record") - self.lst_record:SetVirtual() + self.lst_record:SetVirtual() self.lst_record.itemRenderer = function(index, obj) 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") - self.lst_player_record:SetVirtual() + self.lst_player_record:SetVirtual() self.lst_player_record.itemRenderer = function(index, obj) 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() @@ -75,14 +74,13 @@ 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetGroupRecord(self.group_id, GetPlatform(), qid, index, 6, function(res) printlog("ccccccccccccccccccccccccccccccccccccc") @@ -90,8 +88,8 @@ function M:GetRecordData(index, qid) if self._is_destroy then return end - ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败") else local ctr_search = self._view:GetController("search") @@ -120,7 +118,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 @@ -138,22 +136,22 @@ function M:FillRecordItem(data, obj) player_list[i].house = 0 player_list[i].nick = p.nick end - local play_name = DataManager.groups:get(self.group_id):getPlayName(data.groupPid) - + local play_name = DataManager.groups:get(self.group_id):getPlayName(data.groupPid) + obj:GetChild("tex_time").text = room_time_str - obj:GetChild("tex_roomid").text = room_id - obj:GetChild("tex_times").text = d2ad(data.hp_times).."倍" + obj:GetChild("tex_roomid").text = room_id + 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 "" - - table.insert( ids,trdata.accId ) + titem:GetChild("tex_id").text = trdata.accId and ("ID:" .. trdata.accId) or "" + + table.insert(ids, trdata.accId) local score = trdata.score if trdata.hp == nil then if hpOnOff == 1 and hpType > 1 then @@ -162,7 +160,7 @@ function M:FillRecordItem(data, obj) else score = d2ad(trdata.hp) end - + titem:GetChild("tex_score").text = score if score >= 0 then @@ -180,24 +178,24 @@ function M:FillRecordItem(data, obj) obj:GetChild("btn_screenshot").onClick:Set(function() self:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType) - end) + end) obj:GetChild("btn_share").onClick:Set(function() ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list) - end) + end) obj.onClick:Set(function() - self:OnShowRecordInfo(data,ids) - end) + self:OnShowRecordInfo(data, ids) + end) end function M:OnRenderRecordItem(index, obj) - local data = self.record_data[index + 1] - self:FillRecordItem(data, obj) + local data = self.record_data[index + 1] + self:FillRecordItem(data, obj) end function M:OnRenderRecordItem1(index, obj) - local data=self.tempRec[index+1] - self:FillRecordItem(data, obj) + local data = self.tempRec[index + 1] + self:FillRecordItem(data, obj) end function M:OnRenderPlayerRecordItem(index, obj) @@ -205,33 +203,32 @@ function M:OnRenderPlayerRecordItem(index, obj) self:FillRecordItem(data, obj) end - function M:GetRecordByRoomid() local qid = self._view:GetChild("tex_id").text - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetRecordByRoomid(self.group_id, qid, GetPlatform(), function(res) if self._is_destroy then return end - ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败") else if not res.Data.is_rec then 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 end) end -function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType) - ViewUtil.ShowModalWait(self._view, "正在分享...") +function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType) + ViewUtil.ShowModalWait2(self._view, "正在分享...") UIPackage.AddPackage("base/rank/ui/Rank") local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView") result_view.visible = false @@ -253,15 +250,15 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, end 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( ... ) - load_head_num = load_head_num - 1 - end) + if p.portrait and p.portrait ~= "" then + 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 @@ -270,7 +267,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, ShareScreenShotWithOption(function() result_view:Dispose() end) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() break end coroutine.wait(1) @@ -279,7 +276,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 @@ -292,21 +289,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_roomid").text = rdata.room_id - local round_score_str = rdata["round_"..i] + 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_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 @@ -315,7 +312,7 @@ function M:OnShowRecordInfo(rdata,ids) else score = d2ad(trdata.hp) end - + titem:GetChild("tex_score").text = score end @@ -325,11 +322,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 @@ -344,13 +341,13 @@ function M:OnShowRecordInfo(rdata,ids) main._totalRound = tonumber(rdata.round) main:FillRoomData(DataManager.SelfUser.playback[playback_id][i]) else - ViewUtil.ShowModalWait(self._view) + ViewUtil.ShowModalWait2(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.CloseModalWait() + loddyCtr1:RequestPlayBack(_data, function(code, data) + ViewUtil.CloseModalWait2() if code == 0 then if DataManager.SelfUser.playback[playback_id] ~= nil then DataManager.SelfUser.playback[playback_id][i] = data @@ -377,7 +374,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) @@ -386,11 +383,11 @@ 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngXingYunStatView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngXingYunStatView.lua index 54cb956c..77a2f126 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngXingYunStatView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngXingYunStatView.lua @@ -19,16 +19,13 @@ 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") @@ -38,31 +35,32 @@ function M:InitView() -- end local lst_mgr_index = self._view:GetChild("lst_mgr_index") - + self.lst_record = self._view:GetChild("lst_record") - self.lst_record:SetVirtual() + self.lst_record:SetVirtual() self.lst_record.itemRenderer = function(index, obj) self:OnRenderRecordItem(index, obj) end self.lst_record.scrollPane.onPullUpRelease:Set(function() 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 @@ -78,28 +76,23 @@ function M:InitView() end) self.totalwin = self._view:GetChild("tex_alltotal") - end - function M:GetRecordData(index) - - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() local time_type = self._view:GetController("type").selectedIndex if self.begin_time ~= nil and self.end_time ~= nil then time_type = 0 end - - local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_GetXingYunStat(self.group_id, index, 6, time_type,self.begin_time,self.end_time,function(res) - ViewUtil.CloseModalWait() + local fgCtr = ControllerManager.GetController(NewGroupController) + fgCtr:FG_GetXingYunStat(self.group_id, index, 6, time_type, self.begin_time, self.end_time, function(res) + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then - local members = res.Data.members - + self.totalwin.text = d2ad(res.Data.all_total_win) for i = 1, #members do self.record_data[#self.record_data + 1] = members[i] @@ -109,23 +102,19 @@ function M:GetRecordData(index) end) end - function M:FillRecordItem(data, obj) - - local group = DataManager.groups:get(self.group_id) + local group = DataManager.groups:get(self.group_id) - obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick) - obj:GetChild("tex_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_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) local data = self.record_data[index + 1] - self:FillRecordItem(data, obj) + self:FillRecordItem(data, obj) end - -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngZuanShiStatView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngZuanShiStatView.lua index c83fa0a2..a38eb00e 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngZuanShiStatView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMngZuanShiStatView.lua @@ -19,16 +19,13 @@ 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") @@ -44,28 +41,29 @@ function M:InitView() -- end self.lst_record = self._view:GetChild("lst_record") - self.lst_record:SetVirtual() + self.lst_record:SetVirtual() self.lst_record.itemRenderer = function(index, obj) self:OnRenderRecordItem(index, obj) end self.lst_record.scrollPane.onPullUpRelease:Set(function() 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 @@ -78,11 +76,11 @@ function M:InitView() self._view:GetChild('btn_search').onClick:Set( function() --printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111") - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(nil) local text = self._view:GetChild('tex_id').text local qid, qnick if text == "" then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.ErrorTip(nil, '输入不能为空') return end @@ -95,11 +93,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.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end @@ -113,14 +111,14 @@ 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 + end ) end ) - + local btn_back = self._view:GetChild('btn_back') btn_back.onClick:Set( function() @@ -129,10 +127,8 @@ function M:InitView() ) end - function M:GetRecordData(index) - - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() local time_type = self._view:GetController("type").selectedIndex if self.begin_time ~= nil and self.end_time ~= nil then @@ -140,15 +136,13 @@ 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.CloseModalWait() + fgCtr:FG_GetZuanShiStat(self.group_id, index, 6, time_type, self.begin_time, self.end_time, function(res) + ViewUtil.CloseModalWait2() 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 @@ -173,32 +167,29 @@ 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 - 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 btn_detail = obj:GetChild("btn_detail") 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) - gniv:Show() + 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) local data = self.record_data[index + 1] - self:FillRecordItem(data, obj) + self:FillRecordItem(data, obj) end - -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerBanPlaysView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerBanPlaysView.lua index 769cb833..70fad395 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerBanPlaysView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerBanPlaysView.lua @@ -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,13 +17,12 @@ 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 @@ -31,16 +30,16 @@ end -- 获取奖励设置数据 function M:GetBanPlaysData() local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_GetAllplays(self.group_id,self.uid, function(res) - ViewUtil.CloseModalWait() + fgCtr:FG_GetAllplays(self.group_id, self.uid, function(res) + ViewUtil.CloseModalWait2() if self._is_destroy then return end - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then 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 @@ -48,37 +47,33 @@ 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 - obj:GetChild("gxbtn").selected = data.ban==1 + local play_name = group:getPlayName(data.pid) + obj:GetChild("tex_name").text = data.playname + + obj:GetChild("gxbtn").selected = data.ban == 1 obj:GetChild("gxbtn").onClick:Set(function() local bans = data.ban local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_SetBanPlayid(self.group_id,data.pid,data.ban,self.uid, function(res) - ViewUtil.CloseModalWait() + fgCtr:FG_SetBanPlayid(self.group_id, data.pid, data.ban, self.uid, function(res) + ViewUtil.CloseModalWait2() if self._is_destroy then return end - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerMemberListView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerMemberListView.lua index c055e892..377ade5f 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerMemberListView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerMemberListView.lua @@ -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,13 +21,13 @@ 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") - self.lst_member:SetVirtual() + 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) - end + self:OnRenderItem(index, obj) + end self.lst_member.scrollPane.onPullUpRelease:Set(function() self:GetMemberData(self.lst_member.numItems) end) @@ -35,7 +35,7 @@ function M:initView(url) local btn_back_pre = self._view:GetChild("btn_back_pre") btn_back_pre.onClick:Set(function() if self.top > 1 then - self.partner_id[self.top] = nil + self.partner_id[self.top] = nil self.top = self.top - 1 end @@ -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) - 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 + 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 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,37 +71,35 @@ 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.ShowModalWait(nil) + 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) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetPartnerMembers(self.group_id, self.partner_id[self.top], index, 8, quary_id, function(res) - ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + 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) @@ -109,22 +107,23 @@ function M:FillItem(obj, data) obj:GetChild("tex_last_total").text = data.round or "0" obj:GetChild("tex_status").text = data.online == 1 and "在线" or "离线" - + obj:GetChild("tex_join_time").text = os.date("%Y/%m/%d", data.join_time) obj: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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerRewardsView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerRewardsView.lua index 056ed73e..7270195d 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerRewardsView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerRewardsView.lua @@ -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.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_SetRewards(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_SetRewards(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.cur_value, single, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_SetXIPAI(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_SetXIPAI(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.xipai_cur_value, single, function(res) - 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) + 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) 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_SetANCHOU(self.group_id, data.pid, self.partner_lev, self.partner_id, false, tem, 0, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then 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.ShowModalWait() + ViewUtil.ShowModalWait2() fgCtr:FG_SetANCHOU(self.group_id, data.pid, self.partner_lev, self.partner_id, true, data.anchou_cur_value, single, function(res) - 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) + 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) end) msg_win:Show() end) diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerScoreMgnView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerScoreMgnView.lua index 961eead0..08ca7323 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerScoreMgnView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerScoreMgnView.lua @@ -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,47 +18,42 @@ 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_SetTransHPLimit(gid, pid, value, function(res1) - ViewUtil.CloseModalWait() - + ViewUtil.CloseModalWait2() + 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 - + local btn_close = self._view:GetChild("btn_close") btn_close.onClick:Set(function() self:Destroy() @@ -74,28 +69,23 @@ 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) @@ -103,18 +93,16 @@ function M:init(url) end function M:GetTransHPLimit() - - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetTransHPLimit(self.group_id, self.member.uid, function(res) - if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取数据失败") self:Destroy() else @@ -124,5 +112,4 @@ function M:GetTransHPLimit() end) end - -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerStatMember.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerStatMember.lua index af62fd13..86afec85 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerStatMember.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerStatMember.lua @@ -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 @@ -18,20 +18,19 @@ function GroupPartnerStatMember.new(group_id, uid, time_type, begin_time, end_ti self.end_time = end_time self.check_member = false -- true的话是查询直属成员统计 self._full = true - + self:init("ui://NewGroup/Win_PartnerStatMember") 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() + self.lst_member:SetVirtual() self.lst_member.itemRenderer = function(index, obj) self:OnRenderItem(index, obj) - end + end self.lst_member.scrollPane.onPullUpRelease:Set(function() self:getRewardsLog(self.lst_member.numItems) end) @@ -55,80 +54,79 @@ 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.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) + 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 + + 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.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 - ) - - local btn_back1 = self._view:GetChild('btn_back1') - btn_back1.onClick:Set( - function() - - end - ) + 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() + + 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() + + end + ) end function M:getRewardsLog(index) - - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() 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.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]) + 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 end - self.lst_member.numItems = #self.members_log end - end - end) + end) end -- function M:SortBy(data) @@ -144,18 +142,19 @@ 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 elseif list_check(self.uids, data.uid) and not self.check_member then @@ -192,24 +191,25 @@ function M:OnRenderItem(index, obj) local btn_zhanji = obj:GetChild("btn_zhanji") 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 elseif list_check(self.uids, data.uid) and not self.check_member then @@ -246,10 +246,10 @@ function M:FillRecordItem(data, obj) local btn_zhanji = obj:GetChild("btn_zhanji") 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 -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerStatPlay.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerStatPlay.lua index 8e2ac682..13344882 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerStatPlay.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerStatPlay.lua @@ -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,28 +20,28 @@ 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() + self.lst_member:SetVirtual() self.lst_member.itemRenderer = function(index, obj) self:OnRenderItem(index, obj) - end - + end + self.rewards_data = {} self:getPartnerRewards(function() - self:getRewardsLog(0) + self:getRewardsLog(0) end) end function M:getPartnerRewards(callback) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_GetRewards(self.group_id, self.uid, self.partner_lev, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if self._is_destroy then return end - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取合伙人奖励失败") else local rewards = res.Data.rewards @@ -55,10 +55,10 @@ 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) - if res.ReturnCode ~= 0 then + 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 local member_logs = res.Data.members @@ -72,15 +72,14 @@ 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) + 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] @@ -95,14 +94,13 @@ 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 \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerZuanShiMember.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerZuanShiMember.lua index e648626f..71cd0923 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerZuanShiMember.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerZuanShiMember.lua @@ -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 @@ -17,20 +17,19 @@ function GroupPartnerZuanShiMember.new(group_id, uid, time_type, begin_time, end self.end_time = end_time self.check_member = false -- true的话是查询直属成员统计 self._full = true - + self:init("ui://NewGroup/Win_PartnerZuanShiMember") 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() + self.lst_member:SetVirtual() self.lst_member.itemRenderer = function(index, obj) self:OnRenderItem(index, obj) - end + end self.lst_member.scrollPane.onPullUpRelease:Set(function() self:getRewardsLog(self.lst_member.numItems) end) @@ -54,93 +53,92 @@ 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.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) + 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 + + 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.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 - ) - - local btn_back1 = self._view:GetChild('btn_back1') - btn_back1.onClick:Set( - function() - - end - ) + 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() + + 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() + + end + ) end function M:getRewardsLog(index) - - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() 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.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]) + 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 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 + + - if data.partnerLev > 0 and data.uid ~= self.uids[self.top] then obj:GetController("mng").selectedIndex = 1 elseif list_check(self.uids, data.uid) and not self.check_member then @@ -177,14 +175,14 @@ 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 obj:GetController("mng").selectedIndex = 1 elseif list_check(self.uids, data.uid) and not self.check_member then @@ -220,4 +218,4 @@ function M:FillRecordItem(data, obj) end) end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupRewardsLogView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupRewardsLogView.lua index 62ff39c8..81b59664 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupRewardsLogView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupRewardsLogView.lua @@ -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,18 +20,19 @@ 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() + self.lst_log:SetVirtual() self.lst_log.itemRenderer = function(index, obj) self:OnRenderItem(index, obj) - end + 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) @@ -43,15 +44,14 @@ end function M:getRewardsLog(index) local begin_time, end_time = self.time_panel:GetDate() local fgCtr = ControllerManager.GetController(NewGroupController) - ViewUtil.ShowModalWait(nil) + ViewUtil.ShowModalWait2(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.CloseModalWait() - if res.ReturnCode ~= 0 then + ViewUtil.CloseModalWait2() + if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取提取详情失败") else local reward_logs = res.Data.reward_logs @@ -68,59 +68,58 @@ 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]) - end - end + end + end self.lst_log.numItems = #self.rewards_log 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..")" - end + obj:GetChild("tex_xiang").text = "合伙人管理奖励\n" .. "(" .. data.info .. ")" + end end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupSetMemberInfoDiaoduView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupSetMemberInfoDiaoduView.lua index b844106b..b321d8d6 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupSetMemberInfoDiaoduView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupSetMemberInfoDiaoduView.lua @@ -41,14 +41,14 @@ function M:init(url) self._view:GetChild("btn_qd1").onClick:Set( function() - ViewUtil.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_BanMemberHB( self.group_id, self.member_id, 0, function(response) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_BanMemberHB( self.group_id, self.member_id, 1, function(response) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_BanMemberHB( self.group_id, self.member_id, 2, function(response) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() 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.ShowModalWait() + ViewUtil.ShowModalWait2() 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.CloseModalWait() + ViewUtil.CloseModalWait2() if (response.ReturnCode == 0) then self.currentSelectStateText.text = "整组调动 " .. (response.Data.ban + 1) self.blackList = { { 0, 0 }, { 25, 0 }, { 15, 0 } } diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupStatMember.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupStatMember.lua index a648027a..1bded81e 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupStatMember.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupStatMember.lua @@ -1,30 +1,28 @@ - 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 self.uids = {} self._full = true - + self:init("ui://NewGroup/Win_StatMember") 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() + self.lst_member:SetVirtual() self.lst_member.itemRenderer = function(index, obj) self:OnRenderItem(index, obj) - end + end self.lst_member.scrollPane.onPullUpRelease:Set(function() self:getRewardsLog(self.lst_member.numItems) end) @@ -34,18 +32,16 @@ function M:init(url) self.lst_member.numItems = 0 self:getRewardsLog(0) end) - end -function M:getRewardsLog(index) - ViewUtil.ShowModalWait() +function M:getRewardsLog(index) + ViewUtil.ShowModalWait2() 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") @@ -54,4 +50,4 @@ function M:OnRenderItem(index, obj) end) end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/PhoneLoginView.lua b/lua_probject/base_project/Game/View/PhoneLoginView.lua index e8198a77..c20ec698 100644 --- a/lua_probject/base_project/Game/View/PhoneLoginView.lua +++ b/lua_probject/base_project/Game/View/PhoneLoginView.lua @@ -36,14 +36,14 @@ function M:login() if not uid then return end - ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...") + ViewUtil.ShowModalWait2(self._root_view, "正在登录游戏...") local loginCtr = ControllerManager.GetController(LoginController) local passwd = self:CheckInputPasswd() if not passwd then return end loginCtr:IdPasswordLogin(uid, passwd, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "ID或者密码错误") return @@ -73,7 +73,7 @@ function M:login() if not code then return end - ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...") + ViewUtil.ShowModalWait2(self._root_view, "正在登录游戏...") local phone = self:CheckInputPhone() if not phone then return @@ -82,7 +82,7 @@ function M:login() local loginCtr = ControllerManager.GetController(LoginController) if false then loginCtr:PhoneLogin(phone, code, function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == "100" then ViewUtil.ErrorTip(self._root_view, "验证码错误") elseif res.ReturnCode == "101" then @@ -105,7 +105,7 @@ function M:login() else ViewUtil.ErrorTip(self._root_view, "验证码失效") end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() end end end diff --git a/lua_probject/base_project/Game/View/PhoneLoginView2.lua b/lua_probject/base_project/Game/View/PhoneLoginView2.lua new file mode 100644 index 00000000..3259c77f --- /dev/null +++ b/lua_probject/base_project/Game/View/PhoneLoginView2.lua @@ -0,0 +1,200 @@ +local PhoneLoginView = {} + +local M = PhoneLoginView + +function PhoneLoginView.new(type, phone, callback) + setmetatable(M, { __index = BaseWindow }) + local self = setmetatable({}, { __index = M }) + self.class = "PhoneLoginView" + self._callback = callback + self._close_destroy = true + self.codeType = type + self.phone = phone + self:init("ui://Login/PhnoeLogin") + + return self +end + +function M:init(url) + BaseWindow.init(self, url) + self.login_type = self._view:GetController("type") + self.code = self._view:GetController("code") + + if self.phone and #self.phone == 11 then + self._view:GetChild("phone_input").text = self.phone + self.login_type.selectedIndex = 0 + else + self.login_type.selectedIndex = self.codeType + end + + local btn_login = self._view:GetChild("btn_login") + btn_login.onClick:Add(handler(self, function() + local baseView = ViewManager.GetCurrenView() + if self.login_type.selectedIndex == 0 and baseView.QuickLogin then + baseView:QuickLogin() + self:Destroy() + else + self:login() + end + 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 + + self._view:GetChild("phone_input").onFocusOut:Set(function() + if self._view:GetChild("phone_input").text ~= self.phone then + self.phone = "" + self.login_type.selectedIndex = 1 + end + end) +end + +function M:login() + if self.codeType == 0 then + local uid = self:CheckInputId() + if not uid then + return + end + ViewUtil.ShowModalWait2(self._root_view, "正在登录游戏...") + local loginCtr = ControllerManager.GetController(LoginController) + local passwd = self:CheckInputPasswd() + if not passwd then + return + end + 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: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() + 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: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 diff --git a/lua_probject/base_project/Game/View/ResultView.lua b/lua_probject/base_project/Game/View/ResultView.lua index 8c06cc3e..b07d30e9 100644 --- a/lua_probject/base_project/Game/View/ResultView.lua +++ b/lua_probject/base_project/Game/View/ResultView.lua @@ -1,3 +1,5 @@ +local SharePicture = import('.SharePicture') + ResultView = {} local M = ResultView @@ -12,9 +14,9 @@ function M:Show(time) self._view:GetChild("Frist"):TweenMove(Vector2.New(pos.x, pos.y + 200), time or 1.5) end if self._root then - self._root._view_clearingFather:AddChild(self._view) - self._view:AddRelation(self._root._view_clearingFather, RelationType.Size) self._view:MakeFullScreen() + self._view:AddRelation(self._root._view_clearingFather, RelationType.Size) + self._root._view_clearingFather:AddChild(self._view) else BaseWindow.Show(self) end @@ -102,7 +104,8 @@ end function M:init(url, isBigFull) self._animation = false -- self._scale = true - self._full = false + self._full = true + self._full_offset = false if self._root then self._view = UIPackage.CreateObjectFromURL(url) else @@ -437,7 +440,7 @@ end -- 继续游戏 function M:ContinueGame(gid, pid, game_id) - ViewUtil.ShowModalWait(self._root_view, nil, 'join_room') + ViewUtil.ShowModalWait2(self._root_view, nil, 'join_room') local roomCtr = ControllerManager.GetController(RoomController) roomCtr:PublicJoinRoom( Protocol.WEB_FG_MATCH_ROOM, @@ -445,20 +448,20 @@ function M:ContinueGame(gid, pid, game_id) false, function(response) if (response.ReturnCode == -1) then - ViewUtil.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('join_room') RestartGame() return end if response.ReturnCode ~= 0 then ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败') - ViewUtil.CloseModalWait("join_room") + ViewUtil.CloseModalWait2("join_room") self:Destroy() ViewManager.ChangeView(ViewManager.View_Lobby) return else ViewManager.ChangeView(ViewManager.View_Main, game_id) - ViewUtil.CloseModalWait('join_room') + ViewUtil.CloseModalWait2('join_room') end end, gid, @@ -466,6 +469,28 @@ function M:ContinueGame(gid, pid, game_id) ) end +function M:SaveRenderTextureToPNG() + local sharePicture = SharePicture.new(function() + local json_data = {} + json_data["title"] = "" + local mediaObject = {} + local filename = "share_screenshot" + print(Application.persistentDataPath) + mediaObject["path"] = string.format("%s/%s", Application.persistentDataPath, "share") + mediaObject["filename"] = filename + mediaObject["type"] = 1 + json_data["mediaObject"] = mediaObject + json_data["description"] = "一款现实中朋友约局休闲娱乐的场所!速度约朋友一起来玩吧!" + json_data["scene"] = 0 + print("json_data==================") + local json_str = json.encode(json_data) + pt(json_str) + + GameApplication.Instance:ShareLink(1, json_str, nil, true) + end) + sharePicture:Show() +end + function M:Destroy() if self._root then self._view:RemoveFromParent() diff --git a/lua_probject/base_project/Game/View/SettingView.lua b/lua_probject/base_project/Game/View/SettingView.lua index e455173d..fda268e6 100644 --- a/lua_probject/base_project/Game/View/SettingView.lua +++ b/lua_probject/base_project/Game/View/SettingView.lua @@ -90,8 +90,8 @@ function M:init(url) local _curren_msg = MsgWindow.new(self._root_view, '您是否退出当前账号?', MsgWindow.MsgMode.OkAndCancel) _curren_msg.onOk:Add( function() - PlayerPrefs.DeleteKey('session_id') - PlayerPrefs.Save() + -- PlayerPrefs.DeleteKey('session_id') + -- PlayerPrefs.Save() RestartGame() end ) diff --git a/lua_probject/base_project/Game/View/SharePicture.lua b/lua_probject/base_project/Game/View/SharePicture.lua new file mode 100644 index 00000000..e83f9a8a --- /dev/null +++ b/lua_probject/base_project/Game/View/SharePicture.lua @@ -0,0 +1,34 @@ +--设置窗口对象 + +local SharePicture = {} + +local M = SharePicture +setmetatable(M, { __index = BaseWindow }) + +function SharePicture.new(callback) + local self = setmetatable({}, { __index = M }) + self.class = 'SharePicture' + self._close_destroy = true + self._close_zone = false + self._new_hide = false + self._callback = callback + self:init('ui://Common/SharePicture') + return self +end + +function M:init(url) + BaseWindow.init(self, url) + + local view = self._view + view:GetChild('btn_wx').onClick:Add(function() + self:Close() + self._callback() + self:Destroy() + end) + -- view:GetChild('btn_moments').onClick:Add(function() + -- data.type = 1 + -- ViewUtil.__share(data) + -- end) +end + +return M diff --git a/lua_probject/base_project/Game/View/ViewUtil.lua b/lua_probject/base_project/Game/View/ViewUtil.lua index 81bf2c50..65985b98 100644 --- a/lua_probject/base_project/Game/View/ViewUtil.lua +++ b/lua_probject/base_project/Game/View/ViewUtil.lua @@ -38,7 +38,7 @@ end local modal_wait_win = nil -- local modal_wait_win_url = "ui://Common/GlobalModalWaiting" function ViewUtil.ShowModalWait(blur_view, title, time) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() ViewUtil.continue = coroutine.start( function() coroutine.wait(time or 1) @@ -59,7 +59,7 @@ function ViewUtil.ShowModalWait2(blur_view, time) ViewUtil.CloseModalWait2() ViewUtil.continue = coroutine.start( function() - coroutine.wait(time or 0.5) + coroutine.wait(tonumber(time) or 0.01) ModalWaitingWindow2.ShowModal() end ) @@ -408,3 +408,25 @@ function ViewUtil.ShowOneInput(data, callback) GRoot.inst:RemoveChild(pop_oneInput) end) end + +function ViewUtil.__share(data) + local url = "https://ttfenfa.com/index.php/login" + local json_data = {} + json_data['title'] = data.title + local mediaObject = {} + mediaObject['url'] = url + mediaObject['type'] = 0 + json_data['mediaObject'] = mediaObject + json_data['description'] = data.description + json_data['scene'] = data.type + local filename = "icon96.png" + mediaObject["path"] = Application.persistentDataPath + mediaObject["filename"] = filename + GameApplication.Instance:ShareLink(1, json.encode(json_data), function(...) + end) +end + +function ViewUtil.__openWx() + GameApplication.Instance:WXOnlyOpen(1, function(...) + end) +end diff --git a/lua_probject/base_project/Game/View/WitnessView.lua b/lua_probject/base_project/Game/View/WitnessView.lua index b516266f..bee0599a 100644 --- a/lua_probject/base_project/Game/View/WitnessView.lua +++ b/lua_probject/base_project/Game/View/WitnessView.lua @@ -458,7 +458,7 @@ function M:Destroy() ControllerManager.resetJionRoom = false self._popEvent = false GRoot.inst:HidePopup() - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() GameApplication.Instance.StopMusic = 0 coroutine.stopAll() UpdateBeat:Remove(self.OnUpdate, self) diff --git a/lua_probject/base_project/Game/ViewManager.lua b/lua_probject/base_project/Game/ViewManager.lua index 406878d7..c8ae6485 100644 --- a/lua_probject/base_project/Game/ViewManager.lua +++ b/lua_probject/base_project/Game/ViewManager.lua @@ -77,7 +77,7 @@ local function __OnGameConnectAction(state) else NetResetConnectWindow.ShowNetReset() end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() end function ViewManager.Init() @@ -93,7 +93,7 @@ function ViewManager.Init() PlayerPrefs.Save() end if response.ReturnCode == -1 or response.ReturnCode == Table_Error_code.ERR_LOGOUT then - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() RestartGame() return true diff --git a/lua_probject/base_project/Main.lua b/lua_probject/base_project/Main.lua index a61f35f1..d18a302d 100644 --- a/lua_probject/base_project/Main.lua +++ b/lua_probject/base_project/Main.lua @@ -299,7 +299,7 @@ end --程序切到后台 function OnApplicationPause() - -- ViewUtil.CloseModalWait() + -- ViewUtil.CloseModalWait2() ViewManager.OnApplicationPause() local gMgr = ControllerManager.GetController(GroupMgrController) diff --git a/lua_probject/base_project/table/Table_Error_code.lua b/lua_probject/base_project/table/Table_Error_code.lua index e6d528cb..e99f51bf 100644 --- a/lua_probject/base_project/table/Table_Error_code.lua +++ b/lua_probject/base_project/table/Table_Error_code.lua @@ -46,7 +46,8 @@ Table_Error_code_Map = { [55] = { id = 55, note = "GPS服务未开启,请开启GPS服务!" }, [56] = { id = 56, note = "不是亲友圈" }, [57] = { id = 57, note = "亲友圈不能退出" }, - [59] = { id = 59, note = "无效的验证码" }, + [58] = { id = 58, note = "该手机号码不存在,请先绑定手机号码!" }, + [59] = { id = 59, note = "验证码错误或失效" }, [61] = { id = 61, note = "手机号码已绑定玩家" }, [80] = { id = 80, note = "房间已删除" }, [81] = { id = 81, note = "是亲友圈房间" }, diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua index 6c7b8231..a18ae6ff 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua @@ -55,16 +55,16 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne Text_BoJing.visible = false - --回放不需要显示还剩下多少牌 if self.flag_back then - result.cardList = {} mainCtr.selectedIndex = 1 nextRoundBtn2.touchable = false - else - if result then - if result.cardList then - result.cardList = json.decode(result.cardList) - end + end + + if result then + if result.cardList then + result.cardList = json.decode(result.cardList) + else + result.cardList = {} end end self.list_lastCard = self._view:GetChild('list_lastCard') @@ -104,9 +104,43 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne end) endRound.onClick:Set(function() - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end) + local Btn_Share = self._view:GetChild('Btn_Share') + if Btn_Share then + Btn_Share.onClick:Set(function() + self:SaveRenderTextureToPNG() + end) + end + + local Btn_Copy = self._view:GetChild('Btn_Copy') + if Btn_Copy then + Btn_Copy.onClick:Set(function() + local resultStr = "" + if room.group_id ~= 0 then + local group = DataManager.groups:get(room.group_id) + resultStr = string.format("【%s】俱乐部,", group.name) + end + resultStr = string.format("%s%s\n", resultStr, room.game_info.name) + for i = 1, peopleNum do + local totalInfoList = total_result.info_list[i] + local playInfo = room:GetPlayerBySeat(totalInfoList.seat) + resultStr = string.format("%s%s\nID:%s【%s】\n", resultStr, playInfo.self_user.nick_name, + playInfo.self_user.account_id, + totalInfoList.total_score) + end + resultStr = string.format("%s房号:%s 局数:%s/%s局\n结束时间:%s", resultStr, room.room_id, room.curren_round, + room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time())) + ViewUtil.__openWx() + GameApplication.Instance:CopyToClipboard(resultStr) + end) + end + if over == 0 then showBtnTypeCtr.selectedIndex = 0 _overCtr.selectedIndex = 0 @@ -145,7 +179,11 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne showBtnTypeCtr.selectedIndex = 1 self:fillResult1(room, peopleNum, total_result) else - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end end end diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua index 9db1fde5..8b645ed9 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua @@ -31,7 +31,7 @@ function M:InitView(url) self._tex_round = self._view:GetChild("tex_round") self._tex_LeftCard = self._view:GetChild("remaining_card") self._anchor = self._view:GetChild("mask_tips") - self.jing = self._view:GetChild('jing') + self.jing = self._view:GetChild('jing') self.HuCardImg = setmetatable(HuCardImg, { __index = self.HuCardImg }) self.asset_group = "FuZhou_MJ" @@ -65,7 +65,7 @@ function M:FillRoomData(data) self:UpdateLeftCard(left_count) local round = data.info.round self:UpdateRound(round) - self:ShowJing() + self:ShowJing() local roominfo_panel = self._view:GetChild("roominfo_panel1") roominfo_panel:GetChild("tex_roomid").text = room.room_id @@ -83,9 +83,9 @@ function M:FillRoomData(data) self:GenerateAllStepData(data) self:UpdateStep(1) self:Play() - self._laiziMove:Play() - self._touxiangMove:Play() - -- self:ShowStep(0) + self._laiziMove:Play() + self._touxiangMove:Play() + -- self:ShowStep(0) end function M:ShowStep(index) @@ -104,8 +104,8 @@ function M:ShowStep(index) p.outcard_list = step.player_card_data[i].outcard_list p.fz_list = step.player_card_data[i].fz_list p.hand_left_count = #p.card_list - -- info:Clear() - -- info:ResetFzList() + -- info:Clear() + -- info:ResetFzList() p.piao_niao = step.player_card_data[i].piao_niao local head_info = self._player_info[self:GetPos(i)] if p.piao_niao and p.piao_niao > 0 then @@ -122,169 +122,169 @@ function M:ShowStep(index) else info:UpdateOutCardList() end - ---显示提示按钮 - local _ctr_tips = info._view:GetController('tip2') - local _lit_fanzi = info._view:GetChild("Comp_Back_FZTips") - local _flag_tipGetCard = false - if step.cmd == Record_Event.Evt_FZTip then - if p.seat == step.seat then - local tip = step.tiplist - local _tlist = tip.tip_sortList - _lit_fanzi.itemRenderer = function(index, obj) - local type = obj:GetController('type') - if index == tip.tip_num then - type.selectedIndex = 0 - else - index = index + 1 - if _tlist[index].type == FZType.HU then - type.selectedIndex = 4 - obj:GetChild('btn_Card1').icon = string.format('ui://Main_Majiang/b202_%d', - _tlist[index].card) - _flag_tipGetCard = self.last_get_seat ~= step.seat - elseif _tlist[index].type == FZType.Chi then - type.selectedIndex = FZType.Chi - for i = 1, 3 do - obj:GetChild(string.format('btn_Card%d', i)).icon = string.format( - 'ui://Main_Majiang/b202_%d', - _tlist[index].opcard[i]) - end - elseif _tlist[index].type == FZType.Peng then - type.selectedIndex = FZType.Peng - for i = 1, 3 do - obj:GetChild(string.format('btn_Card%d', i)).icon = string.format( - 'ui://Main_Majiang/b202_%d', - _tlist[index].card) - end - else - for i = 1, 4 do - obj:GetChild(string.format('btn_Card%d', i)).icon = string.format( - 'ui://Main_Majiang/b202_%d', - _tlist[index].card) - end - type.selectedIndex = FZType.Gang - if _tlist[index].type == FZType.Gang_An then - obj:GetChild('btn_Card4').icon = 'ui://Main_Majiang/b202_00' - end - _flag_tipGetCard = true - end - end - end - _ctr_tips.selectedIndex = 1 - _lit_fanzi.numItems = tip.tip_num + 1 - end - else - _ctr_tips.selectedIndex = 0 - _lit_fanzi.numItems = 0 - end - ----多人胡的时候,同时显示胡 - if step.cmd == Record_Event.Evt_Result then - --所有都显示胡吧,暂时没做胡和自摸的判断 - if not self.result then - if step.result_data.info_list[i].is_win then - local info2 = self._player_card_info[self:GetPos(step.result_data.info_list[i].seat)] - local loader_HuEffect = info2._viewLoader_selfHuCardEffect - local isZiMo = false - DataManager.CurrenRoom.isZiMoHu = isZiMo - local hu_sound = isZiMo and ("zimo") or ("hu") - printlog("声音====>>>", hu_sound) - self:PlaySound(self.asset_group, p.self_user.sex, hu_sound) + ---显示提示按钮 + local _ctr_tips = info._view:GetController('tip2') + local _lit_fanzi = info._view:GetChild("Comp_Back_FZTips") + local _flag_tipGetCard = false + if step.cmd == Record_Event.Evt_FZTip then + if p.seat == step.seat then + local tip = step.tiplist + local _tlist = tip.tip_sortList + _lit_fanzi.itemRenderer = function(index, obj) + local type = obj:GetController('type') + if index == tip.tip_num then + type.selectedIndex = 0 + else + index = index + 1 + if _tlist[index].type == FZType.HU then + type.selectedIndex = 4 + obj:GetChild('btn_Card1').icon = string.format('ui://Main_Majiang/b202_%d', + _tlist[index].card) + _flag_tipGetCard = self.last_get_seat ~= step.seat + elseif _tlist[index].type == FZType.Chi then + type.selectedIndex = FZType.Chi + for i = 1, 3 do + obj:GetChild(string.format('btn_Card%d', i)).icon = string.format( + 'ui://Main_Majiang/b202_%d', + _tlist[index].opcard[i]) + end + elseif _tlist[index].type == FZType.Peng then + type.selectedIndex = FZType.Peng + for i = 1, 3 do + obj:GetChild(string.format('btn_Card%d', i)).icon = string.format( + 'ui://Main_Majiang/b202_%d', + _tlist[index].card) + end + else + for i = 1, 4 do + obj:GetChild(string.format('btn_Card%d', i)).icon = string.format( + 'ui://Main_Majiang/b202_%d', + _tlist[index].card) + end + type.selectedIndex = FZType.Gang + if _tlist[index].type == FZType.Gang_An then + obj:GetChild('btn_Card4').icon = 'ui://Main_Majiang/b202_00' + end + _flag_tipGetCard = true + end + end + end + _ctr_tips.selectedIndex = 1 + _lit_fanzi.numItems = tip.tip_num + 1 + end + else + _ctr_tips.selectedIndex = 0 + _lit_fanzi.numItems = 0 + end + ----多人胡的时候,同时显示胡 + if step.cmd == Record_Event.Evt_Result then + --所有都显示胡吧,暂时没做胡和自摸的判断 + if not self.result then + if step.result_data.info_list[i].is_win then + local info2 = self._player_card_info[self:GetPos(step.result_data.info_list[i].seat)] + local loader_HuEffect = info2._viewLoader_selfHuCardEffect + local isZiMo = false + DataManager.CurrenRoom.isZiMoHu = isZiMo + local hu_sound = isZiMo and ("zimo") or ("hu") + printlog("声音====>>>", hu_sound) + self:PlaySound(self.asset_group, p.self_user.sex, hu_sound) - local effects = isZiMo and ("tile_zimo") or ("tile_hu") - loader_HuEffect.visible = true - loader_HuEffect.url = "ui://Main_Majiang/" .. effects - loader_HuEffect:SetScale(2, 2) - local hu_tween = loader_HuEffect:TweenScale(Vector2(1, 1), 0.3) - hu_tween:SetEase(EaseType.QuartOut) - hu_tween:OnComplete(function() - loader_HuEffect.visible = false - end) - end - end - end - if step.cmd ~= Record_Event.Evt_OutCard and step.cmd ~= Record_Event.Evt_GangScore and step.cmd ~= Record_Event.Evt_Win and p.seat == step.current_out_seat or step.cmd == Record_Event.Evt_Result then - if step.cmd == Record_Event.Evt_Action then - pt("lingmeng step ", step) - local fz = step.fz - local info = self._player_card_info[self:GetPos(i)] - local loader_HuEffect = info._viewClip_Peng_Gang - local effects = "" - if fz.type == FZType.Peng then - self:PlaySound("Main_Majiang", p.self_user.sex, "peng") - effects = "clip_peng" - elseif fz.type == FZType.Chi then + local effects = isZiMo and ("tile_zimo") or ("tile_hu") + loader_HuEffect.visible = true + loader_HuEffect.url = "ui://Main_Majiang/" .. effects + loader_HuEffect:SetScale(2, 2) + local hu_tween = loader_HuEffect:TweenScale(Vector2(1, 1), 0.3) + hu_tween:SetEase(EaseType.QuartOut) + hu_tween:OnComplete(function() + loader_HuEffect.visible = false + end) + end + end + end + if step.cmd ~= Record_Event.Evt_OutCard and step.cmd ~= Record_Event.Evt_GangScore and step.cmd ~= Record_Event.Evt_Win and step.cmd ~= Record_Event.Evt_Niao and p.seat == step.current_out_seat or step.cmd == Record_Event.Evt_Result then + if step.cmd == Record_Event.Evt_Action then + pt("lingmeng step ", step) + local fz = step.fz + local info = self._player_card_info[self:GetPos(i)] + local loader_HuEffect = info._viewClip_Peng_Gang + local effects = "" + if fz.type == FZType.Peng then + self:PlaySound("Main_Majiang", p.self_user.sex, "peng") + effects = "clip_peng" + elseif fz.type == FZType.Chi then - else - self:PlaySound("Main_Majiang", p.self_user.sex, "gang") - effects = "clip_gang" - end - local clip = UIPackage.CreateObjectFromURL(string.format("ui://Main_Majiang/%s", effects)) - clip:SetSize(loader_HuEffect.width, loader_HuEffect.height) - loader_HuEffect:AddChild(clip) - clip:SetPlaySettings(0, -1, 1, -1) - clip.onPlayEnd:Add(function() - if clip.parent then - clip.parent:RemoveChild(clip) - end - clip:Dispose() - end) - clip.playing = true - info:UpdateFzList(fz, index, true, self:GetPos(fz.from_seat)) - end - printlog("lingmeng UpdateHandCard", step.cmd, p.seat, step.fz and step.fz.type or -1, FZType.Peng, - _flag_tipGetCard) - if step.cmd == Record_Event.Evt_Action and step.fz.type ~= FZType.Peng then - info:UpdateHandCard(false, true) - elseif step.cmd == Record_Event.Evt_FZTip and not _flag_tipGetCard then - info:UpdateHandCard(false, true) - elseif step.cmd == Record_Event.Evt_Result then - local _flag_result = false - for i = 1, #step.result_data.info_list do - printlog("lingmeng UpdateHandCard3", step.result_data.info_list[i].is_win, - step.result_data.info_list[i].seat) + else + self:PlaySound("Main_Majiang", p.self_user.sex, "gang") + effects = "clip_gang" + end + local clip = UIPackage.CreateObjectFromURL(string.format("ui://Main_Majiang/%s", effects)) + clip:SetSize(loader_HuEffect.width, loader_HuEffect.height) + loader_HuEffect:AddChild(clip) + clip:SetPlaySettings(0, -1, 1, -1) + clip.onPlayEnd:Add(function() + if clip.parent then + clip.parent:RemoveChild(clip) + end + clip:Dispose() + end) + clip.playing = true + info:UpdateFzList(fz, index, true, self:GetPos(fz.from_seat)) + end + printlog("lingmeng UpdateHandCard", step.cmd, p.seat, step.fz and step.fz.type or -1, FZType.Peng, + _flag_tipGetCard) + if step.cmd == Record_Event.Evt_Action and step.fz.type ~= FZType.Peng then + info:UpdateHandCard(false, true) + elseif step.cmd == Record_Event.Evt_FZTip and not _flag_tipGetCard then + info:UpdateHandCard(false, true) + elseif step.cmd == Record_Event.Evt_Result then + local _flag_result = false + for i = 1, #step.result_data.info_list do + printlog("lingmeng UpdateHandCard3", step.result_data.info_list[i].is_win, + step.result_data.info_list[i].seat) - if step.result_data.info_list[i].is_win and p.seat == step.result_data.info_list[i].seat then - _flag_result = true - end - end - printlog("lingmeng UpdateHandCard3", _flag_result) - info:UpdateHandCard(_flag_result, true) - else - info:UpdateHandCard(true, true) - end - else - if step.cmd == Record_Event.Evt_Win then - else - info:UpdateHandCard(false, true) - end - end - end + if step.result_data.info_list[i].is_win and p.seat == step.result_data.info_list[i].seat then + _flag_result = true + end + end + printlog("lingmeng UpdateHandCard3", _flag_result) + info:UpdateHandCard(_flag_result, true) + else + info:UpdateHandCard(true, true) + end + else + if step.cmd == Record_Event.Evt_Win or step.cmd == Record_Event.Evt_Niao then + else + info:UpdateHandCard(false, true) + end + end + end - --统一在大结算时显示 - if step.cmd == Record_Event.Evt_Win then - else - if self._win_pic then - self._win_pic:Dispose() - end - end - --统一在大结算时显示 - if step.cmd == Record_Event.Evt_Niao then - local niao_list = step.niao - else - end - if step.cmd == Record_Event.Evt_Result then - print("lingmeng playerback", self.result) - if not self.result then - local result = step.result_data - result.cardList = step.residual_card - self.result = EXClearingView.new(self, { flag_back = true }) - self.result:InitData(0, self._room, result) - self.result._view.x = (GRoot.inst.width - self.result._view.width) * -0.5 - self.result._view.width = GRoot.inst.width - self.result._view.height = GRoot.inst.height - self._anchor:AddChild(self.result._view) - self.result._view.visible = false - self.result._view.x = self._anchor.x * -1 - self.result._view.y = self._anchor.y * -1 + --统一在大结算时显示 + if step.cmd == Record_Event.Evt_Win then + else + if self._win_pic then + self._win_pic:Dispose() + end + end + --统一在大结算时显示 + if step.cmd == Record_Event.Evt_Niao then + local niao_list = step.niao + else + end + if step.cmd == Record_Event.Evt_Result then + print("lingmeng playerback", self.result) + if not self.result then + local result = step.result_data + result.cardList = step.residual_card + self.result = EXClearingView.new(self, { flag_back = true }) + self.result:InitData(0, self._room, result) + self.result._view.x = (GRoot.inst.width - self.result._view.width) * -0.5 + self.result._view.width = GRoot.inst.width + self.result._view.height = GRoot.inst.height + self._anchor:AddChild(self.result._view) + self.result._view.visible = false + self.result._view.x = self._anchor.x * -1 + self.result._view.y = self._anchor.y * -1 local liuju = result and result.liuju or nil coroutine.start(function() @@ -451,18 +451,18 @@ function M:ShowStep(index) end function M:GenerateAllStepData(data) - local cmdList = self.cmdList - self._step = {} - local step = {} - local info = data.info - step.cmd = "" - step.left_card = info.left_card - step.last_get_seat = 0 - step.last_out_seat = 0 - step.current_out_seat = 1 - step.win = 0 - step.niao = 0 - step.residual_card = info.residual_card + local cmdList = self.cmdList + self._step = {} + local step = {} + local info = data.info + step.cmd = "" + step.left_card = info.left_card + step.last_get_seat = 0 + step.last_out_seat = 0 + step.current_out_seat = 1 + step.win = 0 + step.niao = 0 + step.residual_card = info.residual_card step.player_card_data = {} for i = 1, #self._room.player_list do @@ -485,13 +485,13 @@ function M:GenerateAllStepData(data) end function M:CmdGetCard(cmd, index) - local data = self:CopyLastStep(index) - data.cmd = cmd.cmd - data.current_out_seat = cmd.seat - data.last_get_seat = cmd.seat - data.left_card = cmd.data.left_count - local u = data.player_card_data[cmd.seat] - u.card_list[#u.card_list + 1] = cmd.data.card + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.current_out_seat = cmd.seat + data.last_get_seat = cmd.seat + data.left_card = cmd.data.left_count + local u = data.player_card_data[cmd.seat] + u.card_list[#u.card_list + 1] = cmd.data.card end function M:CmdOutCard(cmd, index) @@ -505,48 +505,48 @@ function M:CmdOutCard(cmd, index) end function M:CmdAction(cmd, index) - local data = self:CopyLastStep(index) - data.cmd = cmd.cmd - data.last_out_seat = 0 - data.current_out_seat = cmd.seat - local u = data.player_card_data[cmd.seat] - local fz = nil - local index = -1 - local ftype = cmd.data.type - if (ftype == FZType.Gang_Peng) then - for i = 1, #u.fz_list do - if (u.fz_list[i].card == cmd.data.card) then - u.fz_list[i].card = cmd.data.card - fz = u.fz_list[i] - fz.type = cmd.data.type - index = i - 1 - break - end - end - end - fz = {} - fz.card = cmd.data.card - fz.type = cmd.data.type - if (index == -1) then - u.fz_list[#u.fz_list + 1] = fz - end - fz.from_seat = cmd.data.from_seat - local remove_num = #cmd.data.opcard + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.last_out_seat = 0 + data.current_out_seat = cmd.seat + local u = data.player_card_data[cmd.seat] + local fz = nil + local index = -1 + local ftype = cmd.data.type + if (ftype == FZType.Gang_Peng) then + for i = 1, #u.fz_list do + if (u.fz_list[i].card == cmd.data.card) then + u.fz_list[i].card = cmd.data.card + fz = u.fz_list[i] + fz.type = cmd.data.type + index = i - 1 + break + end + end + end + fz = {} + fz.card = cmd.data.card + fz.type = cmd.data.type + if (index == -1) then + u.fz_list[#u.fz_list + 1] = fz + end + fz.from_seat = cmd.data.from_seat + local remove_num = #cmd.data.opcard - for i = 1, remove_num do - if ftype == FZType.Gang_Peng then - list_remove(u.card_list, cmd.data.card) - else - list_remove(u.card_list, cmd.data.opcard[i]) - end - end + for i = 1, remove_num do + if ftype == FZType.Gang_Peng then + list_remove(u.card_list, cmd.data.card) + else + list_remove(u.card_list, cmd.data.opcard[i]) + end + end - u.hand_left_count = u.hand_left_count - remove_num - if cmd.data.from_seat ~= u.seat and ftype ~= FZType.Gang_Peng then - local u = data.player_card_data[cmd.data.from_seat] - table.remove(u.outcard_list, #u.outcard_list) - end - data.fz = fz + u.hand_left_count = u.hand_left_count - remove_num + if cmd.data.from_seat ~= u.seat and ftype ~= FZType.Gang_Peng then + local u = data.player_card_data[cmd.data.from_seat] + table.remove(u.outcard_list, #u.outcard_list) + end + data.fz = fz end function M:CmdWin(cmd, index) @@ -601,19 +601,22 @@ function M:GangScore(cmd, index) end function M:CmdResult(cmd, index) - local data = self:CopyLastStep(index) - data.cmd = cmd.cmd - data.seat = 0 - data.result_data = cmd.data - for i = 1, #cmd.data.info_list do - local info = cmd.data.info_list[i] - if info.is_win and info.seat ~= data.current_out_seat then - local u = data.player_card_data[info.seat] - u.card_list[#u.card_list + 1] = info.win_card - local u = data.player_card_data[data.last_out_seat] - table.remove(u.outcard_list, #u.outcard_list) - end - end + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.seat = 0 + data.result_data = cmd.data + if not data._flag_result then + for i = 1, #cmd.data.info_list do + local info = cmd.data.info_list[i] + if info.is_win and info.seat ~= data.current_out_seat then + local u = data.player_card_data[info.seat] + u.card_list[#u.card_list + 1] = info.win_card + local u = data.player_card_data[data.last_out_seat] + table.remove(u.outcard_list, #u.outcard_list) + end + end + end + data._flag_result = true end function M:CopyLastStep(index) @@ -646,13 +649,13 @@ function M:UpdateRound() end function M:ShowJing() - print("lingmeng jing ", self._room.jing) - if self._room.jing then - self.jing.visible = true - MJPlayerCardInfoView.fillCard2(self, self.jing, "b202_", self._room.jing) - else - self.jing.visible = false - end + print("lingmeng jing ", self._room.jing) + if self._room.jing then + self.jing.visible = true + MJPlayerCardInfoView.fillCard2(self, self.jing, "b202_", self._room.jing) + else + self.jing.visible = false + end end function M:UpdateStep(step) diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua index e5ff3c7f..f5dfd03b 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua @@ -52,16 +52,16 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne local playerNum = self._view:GetController("playerNum") local showBtnTypeCtr = self._view:GetController("showType") - --回放不需要显示还剩下多少牌 if self.flag_back then - result.cardList = {} mainCtr.selectedIndex = 1 nextRoundBtn2.touchable = false - else - if result then - if result.cardList then - result.cardList = json.decode(result.cardList) - end + end + + if result then + if result.cardList then + result.cardList = json.decode(result.cardList) + else + result.cardList = {} end end self.list_lastCard = self._view:GetChild('list_lastCard') @@ -103,9 +103,43 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne endRound.onClick:Set(function() - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end) + local Btn_Share = self._view:GetChild('Btn_Share') + if Btn_Share then + Btn_Share.onClick:Set(function() + self:SaveRenderTextureToPNG() + end) + end + + local Btn_Copy = self._view:GetChild('Btn_Copy') + if Btn_Copy then + Btn_Copy.onClick:Set(function() + local resultStr = "" + if room.group_id ~= 0 then + local group = DataManager.groups:get(room.group_id) + resultStr = string.format("【%s】俱乐部,", group.name) + end + resultStr = string.format("%s%s\n", resultStr, room.game_info.name) + for i = 1, peopleNum do + local totalInfoList = total_result.info_list[i] + local playInfo = room:GetPlayerBySeat(totalInfoList.seat) + resultStr = string.format("%s%s\nID:%s【%s】\n", resultStr, playInfo.self_user.nick_name, + playInfo.self_user.account_id, + totalInfoList.total_score) + end + resultStr = string.format("%s房号:%s 局数:%s/%s局\n结束时间:%s", resultStr, room.room_id, room.curren_round, + room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time())) + ViewUtil.__openWx() + GameApplication.Instance:CopyToClipboard(resultStr) + end) + end + if over == 0 then showBtnTypeCtr.selectedIndex = 0 _overCtr.selectedIndex = 0 @@ -144,7 +178,11 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne showBtnTypeCtr.selectedIndex = 1 self:fillResult1(room, peopleNum, total_result) else - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end end end diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua index f901e7e2..ef3f6278 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua @@ -195,7 +195,7 @@ function M:LoadConfigToDetailOnlyPlay(data, hpdata) returnString = string.format("%s人数%s人", returnString, configData.maxPlayers) if hpData then - returnString = string.format("%s %s", returnString, hpData.maxRound) + returnString = string.format("%s %s局", returnString, hpData.maxRound) end if configData.zimo then diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua index 86d58db3..2710c291 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua @@ -48,8 +48,8 @@ function M:InitView(url) self._cmdmap[Record_Event.Evt_Niao] = self.CmdNiao self._cmdmap[Record_Event.Evt_Piao] = self.CmdPiao self._cmdmap[Record_Event.Evt_Result] = self.CmdResult - self._cmdmap[Record_Event.Evt_FZTip] = self.CmdFZTip - self._cmdmap[Record_Event.Evt_GangScore] = self.GangScore + self._cmdmap[Record_Event.Evt_FZTip] = self.CmdFZTip + self._cmdmap[Record_Event.Evt_GangScore] = self.GangScore self.com_logocType.selectedIndex = 3 end @@ -201,7 +201,7 @@ function M:ShowStep(index) end end end - if step.cmd ~= Record_Event.Evt_OutCard and step.cmd ~= Record_Event.Evt_GangScore and step.cmd ~= Record_Event.Evt_Win and p.seat == step.current_out_seat or step.cmd == Record_Event.Evt_Result then + if step.cmd ~= Record_Event.Evt_OutCard and step.cmd ~= Record_Event.Evt_GangScore and step.cmd ~= Record_Event.Evt_Win and step.cmd ~= Record_Event.Evt_Niao and p.seat == step.current_out_seat or step.cmd == Record_Event.Evt_Result then if step.cmd == Record_Event.Evt_Action then pt("lingmeng step ", step) local fz = step.fz @@ -252,7 +252,7 @@ function M:ShowStep(index) info:UpdateHandCard(true, true) end else - if step.cmd == Record_Event.Evt_Win then + if step.cmd == Record_Event.Evt_Win or step.cmd == Record_Event.Evt_Niao then else info:UpdateHandCard(false, true) end @@ -371,83 +371,83 @@ function M:ShowStep(index) end end - --展示摸鸟 - local niao_list = result.niao - self._niao = UIPackage.CreateObject("Extend_MJ_JinXi", "Panel_Birds") - self._view:GetChild('jiangma_show'):AddChild(self._niao) - self._niao:Center() - local list_niao_card = self._niao:GetChild("Lst_birds") - list_niao_card:RemoveChildrenToPool() - for i = 1, #niao_list do - --顯示正面 - local item = list_niao_card:AddItemFromPool() - local card = niao_list[i].card - item.icon = UIPackage.GetItemURL("Main_Majiang", "b202_" .. card) - if niao_list[i].score > 0 then - item:GetController("select").selectedIndex = 1 - else - item:GetController("select").selectedIndex = 0 - end - coroutine.wait(2 / #niao_list) - end - coroutine.wait(0.3) - self._niao:Dispose() + --展示摸鸟 + local niao_list = result.niao + self._niao = UIPackage.CreateObject("Extend_MJ_JinXi", "Panel_Birds") + self._view:GetChild('jiangma_show'):AddChild(self._niao) + self._niao:Center() + local list_niao_card = self._niao:GetChild("Lst_birds") + list_niao_card:RemoveChildrenToPool() + for i = 1, #niao_list do + --顯示正面 + local item = list_niao_card:AddItemFromPool() + local card = niao_list[i].card + item.icon = UIPackage.GetItemURL("Main_Majiang", "b202_" .. card) + if niao_list[i].score > 0 then + item:GetController("select").selectedIndex = 1 + else + item:GetController("select").selectedIndex = 0 + end + coroutine.wait(2 / #niao_list) + end + coroutine.wait(0.3) + self._niao:Dispose() - --统一显示弹出分数 - for i = 1, #result.info_list do - local hu_info = result.info_list[i] - local head_info = self._player_info[self:GetPos(hu_info.seat)] + --统一显示弹出分数 + for i = 1, #result.info_list do + local hu_info = result.info_list[i] + local head_info = self._player_info[self:GetPos(hu_info.seat)] -- 扣分动画 head_info:UpdateScore(hu_info.total_score, true) end coroutine.wait(0.3) - if liuju then - self:PlayMJSound("liuju.mp3") - coroutine.wait(3) - self:PlayMJSound("end_music.mp3") - else - self:PlayMJSound("end_music.mp3") - end - coroutine.wait(0.5) - self.result._view.visible = true - end) - else - -- self.result._view.visible = true - end - end - --显示杠分 - if step.cmd == Record_Event.Evt_GangScore then - local totalScoreList = step.totalScoreList - local playerList = step.playerList - local addScoreList = step.addScoreList - local scoreData = {} - for i = 1, #totalScoreList do - local p = {} + if liuju then + self:PlayMJSound("liuju.mp3") + coroutine.wait(3) + self:PlayMJSound("end_music.mp3") + else + self:PlayMJSound("end_music.mp3") + end + coroutine.wait(0.5) + self.result._view.visible = true + end) + else + -- self.result._view.visible = true + end + end + --显示杠分 + if step.cmd == Record_Event.Evt_GangScore then + local totalScoreList = step.totalScoreList + local playerList = step.playerList + local addScoreList = step.addScoreList + local scoreData = {} + for i = 1, #totalScoreList do + local p = {} - p.totalScore = totalScoreList[i] - p.player = playerList[i] - p.addScore = addScoreList[i] + p.totalScore = totalScoreList[i] + p.player = playerList[i] + p.addScore = addScoreList[i] - scoreData[#scoreData + 1] = p - end + scoreData[#scoreData + 1] = p + end - for _, p in pairs(scoreData) do - local player = self._room:GetPlayerById(p.player) - local infoView = self._player_info[self:GetPos(player.seat)] - player.cur_hp = p.totalScore + for _, p in pairs(scoreData) do + local player = self._room:GetPlayerById(p.player) + local infoView = self._player_info[self:GetPos(player.seat)] + player.cur_hp = p.totalScore - if p.addScore ~= 0 then - infoView:ScoreAnimation(p.addScore) - if player.cur_hp >= 0 then - infoView._view:GetChild("text_jifen").text = "+" .. player.cur_hp - else - infoView._view:GetChild("text_jifen").text = player.cur_hp - end - end - end - end + if p.addScore ~= 0 then + infoView:ScoreAnimation(p.addScore) + if player.cur_hp >= 0 then + infoView._view:GetChild("text_jifen").text = "+" .. player.cur_hp + else + infoView._view:GetChild("text_jifen").text = player.cur_hp + end + end + end + end end function M:GenerateAllStepData(data) @@ -568,36 +568,36 @@ function M:CmdPiao(cmd, index) end function M:CmdFZTip(cmd, index) - local data = self:CopyLastStep(index) - data.cmd = cmd.cmd - data.seat = cmd.seat - local tiplist = FZTipList.new() - local list = cmd.data.tip_list - for i = 1, #list do - local dtip = list[i] - local tip = {} - tip.id = dtip["id"] - tip.weight = dtip["weight"] - tip.card = dtip["card"] - tip.type = dtip["type"] - tip.opcard = dtip["opcard"] - tiplist:AddTip(tip) - end - --排序规则,胡杠碰 - tiplist:SortList(function(a, b) - return a.type < b.type - end) - data.tiplist = tiplist - data.weight = cmd.data.weight + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.seat = cmd.seat + local tiplist = FZTipList.new() + local list = cmd.data.tip_list + for i = 1, #list do + local dtip = list[i] + local tip = {} + tip.id = dtip["id"] + tip.weight = dtip["weight"] + tip.card = dtip["card"] + tip.type = dtip["type"] + tip.opcard = dtip["opcard"] + tiplist:AddTip(tip) + end + --排序规则,胡杠碰 + tiplist:SortList(function(a, b) + return a.type < b.type + end) + data.tiplist = tiplist + data.weight = cmd.data.weight end function M:GangScore(cmd, index) - local data = self:CopyLastStep(index) - data.cmd = cmd.cmd - data.seat = cmd.seat - data.totalScoreList = cmd.data.totalScoreList - data.playerList = cmd.data.playerList - data.addScoreList = cmd.data.addScoreList + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.seat = cmd.seat + data.totalScoreList = cmd.data.totalScoreList + data.playerList = cmd.data.playerList + data.addScoreList = cmd.data.addScoreList end function M:CmdResult(cmd, index) @@ -605,15 +605,18 @@ function M:CmdResult(cmd, index) data.cmd = cmd.cmd data.seat = 0 data.result_data = cmd.data - for i = 1, #cmd.data.info_list do - local info = cmd.data.info_list[i] - if info.is_win and info.seat ~= data.current_out_seat then - local u = data.player_card_data[info.seat] - u.card_list[#u.card_list + 1] = info.win_card - local u = data.player_card_data[data.last_out_seat] - table.remove(u.outcard_list, #u.outcard_list) + if not data._flag_result then + for i = 1, #cmd.data.info_list do + local info = cmd.data.info_list[i] + if info.is_win and info.seat ~= data.current_out_seat then + local u = data.player_card_data[info.seat] + u.card_list[#u.card_list + 1] = info.win_card + local u = data.player_card_data[data.last_out_seat] + table.remove(u.outcard_list, #u.outcard_list) + end end end + data._flag_result = true end function M:CopyLastStep(index) diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua index 289c2d1d..fb39a2e2 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua @@ -52,16 +52,16 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne local playerNum = self._view:GetController("playerNum") local showBtnTypeCtr = self._view:GetController("showType") - --回放不需要显示还剩下多少牌 if self.flag_back then mainCtr.selectedIndex = 1 nextRoundBtn2.touchable = false - if result then - if result.cardList then - result.cardList = json.decode(result.cardList) - else - result.cardList = {} - end + end + + if result then + if result.cardList then + result.cardList = json.decode(result.cardList) + else + result.cardList = {} end end @@ -99,9 +99,43 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne end) endRound.onClick:Set(function() - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end) + local Btn_Share = self._view:GetChild('Btn_Share') + if Btn_Share then + Btn_Share.onClick:Set(function() + self:SaveRenderTextureToPNG() + end) + end + + local Btn_Copy = self._view:GetChild('Btn_Copy') + if Btn_Copy then + Btn_Copy.onClick:Set(function() + local resultStr = "" + if room.group_id ~= 0 then + local group = DataManager.groups:get(room.group_id) + resultStr = string.format("【%s】俱乐部,", group.name) + end + resultStr = string.format("%s%s\n", resultStr, room.game_info.name) + for i = 1, peopleNum do + local totalInfoList = total_result.info_list[i] + local playInfo = room:GetPlayerBySeat(totalInfoList.seat) + resultStr = string.format("%s%s\nID:%s【%s】\n", resultStr, playInfo.self_user.nick_name, + playInfo.self_user.account_id, + totalInfoList.total_score) + end + resultStr = string.format("%s房号:%s 局数:%s/%s局\n结束时间:%s", resultStr, room.room_id, room.curren_round, + room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time())) + ViewUtil.__openWx() + GameApplication.Instance:CopyToClipboard(resultStr) + end) + end + if over == 0 then showBtnTypeCtr.selectedIndex = 0 _overCtr.selectedIndex = 0 @@ -137,7 +171,11 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne showBtnTypeCtr.selectedIndex = 1 self:fillResult1(room, peopleNum, total_result) else - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end end end diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXPlayBackView.lua index a11ecd66..9c908612 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXPlayBackView.lua @@ -201,7 +201,7 @@ function M:ShowStep(index) end end end - if step.cmd ~= Record_Event.Evt_OutCard and step.cmd ~= Record_Event.Evt_GangScore and step.cmd ~= Record_Event.Evt_Win and p.seat == step.current_out_seat or step.cmd == Record_Event.Evt_Result then + if step.cmd ~= Record_Event.Evt_OutCard and step.cmd ~= Record_Event.Evt_GangScore and step.cmd ~= Record_Event.Evt_Win and step.cmd ~= Record_Event.Evt_Niao and p.seat == step.current_out_seat or step.cmd == Record_Event.Evt_Result then if step.cmd == Record_Event.Evt_Action then pt("lingmeng step ", step) local fz = step.fz @@ -252,7 +252,7 @@ function M:ShowStep(index) info:UpdateHandCard(true, true) end else - if step.cmd == Record_Event.Evt_Win then + if step.cmd == Record_Event.Evt_Win or step.cmd == Record_Event.Evt_Niao then else info:UpdateHandCard(false, true) end @@ -605,15 +605,18 @@ function M:CmdResult(cmd, index) data.cmd = cmd.cmd data.seat = 0 data.result_data = cmd.data - for i = 1, #cmd.data.info_list do - local info = cmd.data.info_list[i] - if info.is_win and info.seat ~= data.current_out_seat then - local u = data.player_card_data[info.seat] - u.card_list[#u.card_list + 1] = info.win_card - local u = data.player_card_data[data.last_out_seat] - table.remove(u.outcard_list, #u.outcard_list) + if not data._flag_result then + for i = 1, #cmd.data.info_list do + local info = cmd.data.info_list[i] + if info.is_win and info.seat ~= data.current_out_seat then + local u = data.player_card_data[info.seat] + u.card_list[#u.card_list + 1] = info.win_card + local u = data.player_card_data[data.last_out_seat] + table.remove(u.outcard_list, #u.outcard_list) + end end end + data._flag_result = true end function M:CopyLastStep(index) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua index 9cd84250..0de44c0f 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua @@ -55,16 +55,16 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne Text_BoJing.visible = false - --回放不需要显示还剩下多少牌 if self.flag_back then - result.cardList = {} mainCtr.selectedIndex = 1 nextRoundBtn2.touchable = false - else - if result then - if result.cardList then - result.cardList = json.decode(result.cardList) - end + end + + if result then + if result.cardList then + result.cardList = json.decode(result.cardList) + else + result.cardList = {} end end self.list_lastCard = self._view:GetChild('list_lastCard') @@ -104,9 +104,43 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne end) endRound.onClick:Set(function() - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end) + local Btn_Share = self._view:GetChild('Btn_Share') + if Btn_Share then + Btn_Share.onClick:Set(function() + self:SaveRenderTextureToPNG() + end) + end + + local Btn_Copy = self._view:GetChild('Btn_Copy') + if Btn_Copy then + Btn_Copy.onClick:Set(function() + local resultStr = "" + if room.group_id ~= 0 then + local group = DataManager.groups:get(room.group_id) + resultStr = string.format("【%s】俱乐部,", group.name) + end + resultStr = string.format("%s%s\n", resultStr, room.game_info.name) + for i = 1, peopleNum do + local totalInfoList = total_result.info_list[i] + local playInfo = room:GetPlayerBySeat(totalInfoList.seat) + resultStr = string.format("%s%s\nID:%s【%s】\n", resultStr, playInfo.self_user.nick_name, + playInfo.self_user.account_id, + totalInfoList.total_score) + end + resultStr = string.format("%s房号:%s 局数:%s/%s局\n结束时间:%s", resultStr, room.room_id, room.curren_round, + room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time())) + ViewUtil.__openWx() + GameApplication.Instance:CopyToClipboard(resultStr) + end) + end + if over == 0 then showBtnTypeCtr.selectedIndex = 0 _overCtr.selectedIndex = 0 @@ -145,7 +179,11 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne showBtnTypeCtr.selectedIndex = 1 self:fillResult1(room, peopleNum, total_result) else - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end end end diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua index c38f4105..aa81d268 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua @@ -48,8 +48,8 @@ function M:InitView(url) self._cmdmap[Record_Event.Evt_Niao] = self.CmdNiao self._cmdmap[Record_Event.Evt_Piao] = self.CmdPiao self._cmdmap[Record_Event.Evt_Result] = self.CmdResult - self._cmdmap[Record_Event.Evt_FZTip] = self.CmdFZTip - self._cmdmap[Record_Event.Evt_GangScore] = self.GangScore + self._cmdmap[Record_Event.Evt_FZTip] = self.CmdFZTip + self._cmdmap[Record_Event.Evt_GangScore] = self.GangScore self.com_logocType.selectedIndex = 1 end @@ -201,7 +201,7 @@ function M:ShowStep(index) end end end - if step.cmd ~= Record_Event.Evt_OutCard and step.cmd ~= Record_Event.Evt_GangScore and step.cmd ~= Record_Event.Evt_Win and p.seat == step.current_out_seat or step.cmd == Record_Event.Evt_Result then + if step.cmd ~= Record_Event.Evt_OutCard and step.cmd ~= Record_Event.Evt_GangScore and step.cmd ~= Record_Event.Evt_Win and step.cmd ~= Record_Event.Evt_Niao and p.seat == step.current_out_seat or step.cmd == Record_Event.Evt_Result then if step.cmd == Record_Event.Evt_Action then pt("lingmeng step ", step) local fz = step.fz @@ -252,7 +252,7 @@ function M:ShowStep(index) info:UpdateHandCard(true, true) end else - if step.cmd == Record_Event.Evt_Win then + if step.cmd == Record_Event.Evt_Win or step.cmd == Record_Event.Evt_Niao then else info:UpdateHandCard(false, true) end @@ -371,83 +371,83 @@ function M:ShowStep(index) end end - --展示摸鸟 - local niao_list = result.niao - self._niao = UIPackage.CreateObject("Extend_MJ_NanCheng", "Panel_Birds") - self._view:GetChild('jiangma_show'):AddChild(self._niao) - self._niao:Center() - local list_niao_card = self._niao:GetChild("Lst_birds") - list_niao_card:RemoveChildrenToPool() - for i = 1, #niao_list do - --顯示正面 - local item = list_niao_card:AddItemFromPool() - local card = niao_list[i].card - item.icon = UIPackage.GetItemURL("Main_Majiang", "b202_" .. card) - if niao_list[i].score > 0 then - item:GetController("select").selectedIndex = 1 - else - item:GetController("select").selectedIndex = 0 - end - coroutine.wait(2 / #niao_list) - end - coroutine.wait(0.3) - self._niao:Dispose() + --展示摸鸟 + local niao_list = result.niao + self._niao = UIPackage.CreateObject("Extend_MJ_NanCheng", "Panel_Birds") + self._view:GetChild('jiangma_show'):AddChild(self._niao) + self._niao:Center() + local list_niao_card = self._niao:GetChild("Lst_birds") + list_niao_card:RemoveChildrenToPool() + for i = 1, #niao_list do + --顯示正面 + local item = list_niao_card:AddItemFromPool() + local card = niao_list[i].card + item.icon = UIPackage.GetItemURL("Main_Majiang", "b202_" .. card) + if niao_list[i].score > 0 then + item:GetController("select").selectedIndex = 1 + else + item:GetController("select").selectedIndex = 0 + end + coroutine.wait(2 / #niao_list) + end + coroutine.wait(0.3) + self._niao:Dispose() - --统一显示弹出分数 - for i = 1, #result.info_list do - local hu_info = result.info_list[i] - local head_info = self._player_info[self:GetPos(hu_info.seat)] + --统一显示弹出分数 + for i = 1, #result.info_list do + local hu_info = result.info_list[i] + local head_info = self._player_info[self:GetPos(hu_info.seat)] -- 扣分动画 head_info:UpdateScore(hu_info.total_score, true) end coroutine.wait(0.3) - if liuju then - self:PlayMJSound("liuju.mp3") - coroutine.wait(3) - self:PlayMJSound("end_music.mp3") - else - self:PlayMJSound("end_music.mp3") - end - coroutine.wait(0.5) - self.result._view.visible = true - end) - else - -- self.result._view.visible = true - end - end - --显示杠分 - if step.cmd == Record_Event.Evt_GangScore then - local totalScoreList = step.totalScoreList - local playerList = step.playerList - local addScoreList = step.addScoreList - local scoreData = {} - for i = 1, #totalScoreList do - local p = {} + if liuju then + self:PlayMJSound("liuju.mp3") + coroutine.wait(3) + self:PlayMJSound("end_music.mp3") + else + self:PlayMJSound("end_music.mp3") + end + coroutine.wait(0.5) + self.result._view.visible = true + end) + else + -- self.result._view.visible = true + end + end + --显示杠分 + if step.cmd == Record_Event.Evt_GangScore then + local totalScoreList = step.totalScoreList + local playerList = step.playerList + local addScoreList = step.addScoreList + local scoreData = {} + for i = 1, #totalScoreList do + local p = {} - p.totalScore = totalScoreList[i] - p.player = playerList[i] - p.addScore = addScoreList[i] + p.totalScore = totalScoreList[i] + p.player = playerList[i] + p.addScore = addScoreList[i] - scoreData[#scoreData + 1] = p - end + scoreData[#scoreData + 1] = p + end - for _, p in pairs(scoreData) do - local player = self._room:GetPlayerById(p.player) - local infoView = self._player_info[self:GetPos(player.seat)] - player.cur_hp = p.totalScore + for _, p in pairs(scoreData) do + local player = self._room:GetPlayerById(p.player) + local infoView = self._player_info[self:GetPos(player.seat)] + player.cur_hp = p.totalScore - if p.addScore ~= 0 then - infoView:ScoreAnimation(p.addScore) - if player.cur_hp >= 0 then - infoView._view:GetChild("text_jifen").text = "+" .. player.cur_hp - else - infoView._view:GetChild("text_jifen").text = player.cur_hp - end - end - end - end + if p.addScore ~= 0 then + infoView:ScoreAnimation(p.addScore) + if player.cur_hp >= 0 then + infoView._view:GetChild("text_jifen").text = "+" .. player.cur_hp + else + infoView._view:GetChild("text_jifen").text = player.cur_hp + end + end + end + end end function M:GenerateAllStepData(data) @@ -568,36 +568,36 @@ function M:CmdPiao(cmd, index) end function M:CmdFZTip(cmd, index) - local data = self:CopyLastStep(index) - data.cmd = cmd.cmd - data.seat = cmd.seat - local tiplist = FZTipList.new() - local list = cmd.data.tip_list - for i = 1, #list do - local dtip = list[i] - local tip = {} - tip.id = dtip["id"] - tip.weight = dtip["weight"] - tip.card = dtip["card"] - tip.type = dtip["type"] - tip.opcard = dtip["opcard"] - tiplist:AddTip(tip) - end - --排序规则,胡杠碰 - tiplist:SortList(function(a, b) - return a.type < b.type - end) - data.tiplist = tiplist - data.weight = cmd.data.weight + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.seat = cmd.seat + local tiplist = FZTipList.new() + local list = cmd.data.tip_list + for i = 1, #list do + local dtip = list[i] + local tip = {} + tip.id = dtip["id"] + tip.weight = dtip["weight"] + tip.card = dtip["card"] + tip.type = dtip["type"] + tip.opcard = dtip["opcard"] + tiplist:AddTip(tip) + end + --排序规则,胡杠碰 + tiplist:SortList(function(a, b) + return a.type < b.type + end) + data.tiplist = tiplist + data.weight = cmd.data.weight end function M:GangScore(cmd, index) - local data = self:CopyLastStep(index) - data.cmd = cmd.cmd - data.seat = cmd.seat - data.totalScoreList = cmd.data.totalScoreList - data.playerList = cmd.data.playerList - data.addScoreList = cmd.data.addScoreList + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.seat = cmd.seat + data.totalScoreList = cmd.data.totalScoreList + data.playerList = cmd.data.playerList + data.addScoreList = cmd.data.addScoreList end function M:CmdResult(cmd, index) @@ -605,15 +605,18 @@ function M:CmdResult(cmd, index) data.cmd = cmd.cmd data.seat = 0 data.result_data = cmd.data - for i = 1, #cmd.data.info_list do - local info = cmd.data.info_list[i] - if info.is_win and info.seat ~= data.current_out_seat then - local u = data.player_card_data[info.seat] - u.card_list[#u.card_list + 1] = info.win_card - local u = data.player_card_data[data.last_out_seat] - table.remove(u.outcard_list, #u.outcard_list) + if not data._flag_result then + for i = 1, #cmd.data.info_list do + local info = cmd.data.info_list[i] + if info.is_win and info.seat ~= data.current_out_seat then + local u = data.player_card_data[info.seat] + u.card_list[#u.card_list + 1] = info.win_card + local u = data.player_card_data[data.last_out_seat] + table.remove(u.outcard_list, #u.outcard_list) + end end end + data._flag_result = true end function M:CopyLastStep(index) diff --git a/lua_probject/extend_project/extend/poker/chuntian/ChunTian_MainView.lua b/lua_probject/extend_project/extend/poker/chuntian/ChunTian_MainView.lua index a89b79d9..ffa97de1 100644 --- a/lua_probject/extend_project/extend/poker/chuntian/ChunTian_MainView.lua +++ b/lua_probject/extend_project/extend/poker/chuntian/ChunTian_MainView.lua @@ -352,7 +352,7 @@ function M:EventInit() end self:PlayXiPai(xipaiCB) else - ViewUtil.ShowModalWait(self._root_view,"等待其它玩家洗牌...") + ViewUtil.ShowModalWait2(self._root_view,"等待其它玩家洗牌...") coroutine.start(function() coroutine.wait(3) ViewUtil.CloseModalWait() diff --git a/lua_probject/extend_project/extend/poker/mushi/MuShi_MainView.lua b/lua_probject/extend_project/extend/poker/mushi/MuShi_MainView.lua index d9a61b22..38f949ac 100644 --- a/lua_probject/extend_project/extend/poker/mushi/MuShi_MainView.lua +++ b/lua_probject/extend_project/extend/poker/mushi/MuShi_MainView.lua @@ -31,12 +31,12 @@ local bg_config = { local gameState = { None = 0, - ROOM_STATUS_INIT = 1, --初始化 - ROOM_STATUS_START = 2, --开始 - ROOM_STATUS_QIANGZHUANG = 3, --抢庄 - ROOM_STATUS_XIAZHU = 4, --下注 - ROOM_STATUS_BUPAI = 5, --补牌 - ROOM_STATUS_FINISH = 6, --完成 + ROOM_STATUS_INIT = 1, --初始化 + ROOM_STATUS_START = 2, --开始 + ROOM_STATUS_QIANGZHUANG = 3, --抢庄 + ROOM_STATUS_XIAZHU = 4, --下注 + ROOM_STATUS_BUPAI = 5, --补牌 + ROOM_STATUS_FINISH = 6, --完成 } function M:InitView(url) @@ -93,7 +93,7 @@ function M:InitView(url) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) @@ -835,7 +835,7 @@ function M:EventInit() rt = self._room.score_times end if over == 1 and self._room.hpOnOff == 1 then - head_info:UpdateScore(player.score / 10) --不可负分 + head_info:UpdateScore(player.score / 10) --不可负分 else head_info:UpdateScore(player.score * rt) end @@ -1483,7 +1483,7 @@ function M:OnPlayerEnter(...) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) diff --git a/lua_probject/extend_project/extend/poker/runfast/EXWitnessView.lua b/lua_probject/extend_project/extend/poker/runfast/EXWitnessView.lua index 6704c5ce..a0bded4e 100644 --- a/lua_probject/extend_project/extend/poker/runfast/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/EXWitnessView.lua @@ -73,7 +73,7 @@ function M:InitView(url) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) @@ -137,7 +137,7 @@ function M:InitView(url) -- self._view:GetChild('Btn_Spectator').onClick:Set(function() -- ViewUtil.ErrorMsg(self._view, "", "该功能还未开放") -- end) - self._view:GetChild('Btn_Invite').onClick:Set(function() + self._view:GetChild('btn_invite').onClick:Set(function() ViewUtil.ErrorMsg(self._view, "", "该功能还未开放") end) diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua index 7ffd2254..cce9afd9 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua @@ -97,7 +97,7 @@ function M:InitView(url) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) @@ -219,17 +219,6 @@ function M:InitView(url) self._gamectr._cardCheck = self._cardCheck self:UpdateRound(self._room.curren_round or 0) - --按钮功能全部未开放 - -- self._view:GetChild('Btn_Spectator').onClick:Set(function() - -- ViewUtil.ErrorMsg(self._view, "", "该功能还未开放") - -- end) - -- self._view:GetChild('Btn_GamePlay').onClick:Set(function() - -- ViewUtil.ErrorMsg(self._view, "", "该功能还未开放") - -- end) - self._view:GetChild('Btn_Invite').onClick:Set(function() - ViewUtil.ErrorMsg(self._view, "", "该功能还未开放") - end) - self._view:GetChild('text_roomId').text = self._room.room_id self._ctr_inClear = self._view:GetController('Inclear') self._view:GetChild('btn_ready_inClear').onClick:Set(function() @@ -448,7 +437,7 @@ function M:EventInit() ViewUtil.ShowModalWait(self._root_view,"等待其它玩家洗牌...") coroutine.start(function() coroutine.wait(3) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() end) @@ -1649,7 +1638,7 @@ function M:OnPlayerEnter(...) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua index 4bf1581a..8751781f 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua @@ -29,21 +29,21 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards) self._view:GetController('over').selectedIndex = 0 if over == 2 and room.curren_round <= 0 then - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end - - --按钮功能全部未开放 - self._view:GetChild('btn_shareRecord').onClick:Set(function() - ViewUtil.ErrorMsg(self._view, "", "该功能还未开放") - end) - self._view:GetChild('btn_copyRecord').onClick:Set(function() - ViewUtil.ErrorMsg(self._view, "", "该功能还未开放") - end) ------------------ --只有一人直接退,有两人才进正常结算 if not over and #data == 1 then - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end self._view:GetChild('btn_over1Close').onClick:Set(function() @@ -77,7 +77,11 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards) end self._view:GetChild('btn_closeRound').onClick:Set(function() - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end) self._view:GetController('win').selectedIndex = win_seat == room.self_player.seat and 1 or 0 @@ -109,6 +113,7 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards) self._view:GetChild('text_time').text = os.date('%m-%d %H:%M', os.time()) self._view:GetChild('text_groupID').text = room.group_id or 0 self._view:GetController('num').selectedIndex = #data == 2 and 0 or 1 + self._view:GetController('isgroup').selectedIndex = room.group_id ~= 0 and 1 or 0 for i = 1, #data do local info = data[i] local playerInfo = room:GetPlayerBySeat(info.seat) @@ -121,6 +126,37 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards) self._view:GetController('over').selectedIndex = 1 end) end + + + local Btn_Share = self._view:GetChild('btn_shareRecord') + if Btn_Share then + Btn_Share.onClick:Set(function() + self:SaveRenderTextureToPNG() + end) + end + + local Btn_Copy = self._view:GetChild('btn_copyRecord') + if Btn_Copy then + Btn_Copy.onClick:Set(function() + local resultStr = "" + if room.group_id ~= 0 then + local group = DataManager.groups:get(room.group_id) + resultStr = string.format("【%s】俱乐部,", group.name) + end + resultStr = string.format("%s%s\n", resultStr, room.game_info.name) + for i = 1, #data do + local info = data[i] + local playerInfo = room:GetPlayerBySeat(info.seat) + resultStr = string.format("%s%s\nID:%s【%s】\n", resultStr, playerInfo.self_user.nick_name, + playerInfo.self_user.account_id, + info.total_score) + end + resultStr = string.format("%s房号:%s 局数:%s/%s局\n结束时间:%s", resultStr, room.room_id, room.curren_round, + room.room_config.Times, os.date("%Y-%m-%d %H:%M:%S", os.time())) + ViewUtil.__openWx() + GameApplication.Instance:CopyToClipboard(resultStr) + end) + end end function M:FillPlayerInfoEnd(view, info, playerInfo, bigWin) diff --git a/lua_probject/extend_project/extend/poker/sanqianfen/SanQianFen_MainView.lua b/lua_probject/extend_project/extend/poker/sanqianfen/SanQianFen_MainView.lua index 15a0dffc..686e77d2 100644 --- a/lua_probject/extend_project/extend/poker/sanqianfen/SanQianFen_MainView.lua +++ b/lua_probject/extend_project/extend/poker/sanqianfen/SanQianFen_MainView.lua @@ -110,7 +110,7 @@ function M:InitView(url) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) @@ -443,7 +443,7 @@ function M:EventInit() ViewUtil.ShowModalWait(self._root_view,"等待其它玩家洗牌...") coroutine.start(function() coroutine.wait(3) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() end) @@ -1017,7 +1017,7 @@ function M:EventInit() if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then -- body card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_SanQianFen/" .. card_n .. - "_1") + "_1") else card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_SanQianFen/" .. card_n) end @@ -1025,7 +1025,7 @@ function M:EventInit() if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then -- body card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_SanQianFen/" .. card_n .. - "_2") + "_2") else card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2") end @@ -1694,7 +1694,7 @@ function M:OnPlayerEnter(...) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) diff --git a/lua_probject/extend_project/extend/poker/shengsidu/ShengSiDu_MainView.lua b/lua_probject/extend_project/extend/poker/shengsidu/ShengSiDu_MainView.lua index d3484615..c3554c4a 100644 --- a/lua_probject/extend_project/extend/poker/shengsidu/ShengSiDu_MainView.lua +++ b/lua_probject/extend_project/extend/poker/shengsidu/ShengSiDu_MainView.lua @@ -96,7 +96,7 @@ function M:InitView(url) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) @@ -711,7 +711,7 @@ function M:EventInit() if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then -- body card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_ShengSiDu/" .. card_n .. - "_2") + "_2") else card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_ShengSiDu/" .. card_n) end @@ -719,7 +719,7 @@ function M:EventInit() if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then -- body card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_ShengSiDu/" .. card_n .. - "_2") + "_2") else card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2") end @@ -1367,7 +1367,7 @@ function M:OnPlayerEnter(...) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) diff --git a/lua_probject/extend_project/extend/poker/suoha/SuoHa_MainView.lua b/lua_probject/extend_project/extend/poker/suoha/SuoHa_MainView.lua index 6b77151c..48293291 100644 --- a/lua_probject/extend_project/extend/poker/suoha/SuoHa_MainView.lua +++ b/lua_probject/extend_project/extend/poker/suoha/SuoHa_MainView.lua @@ -95,7 +95,7 @@ function M:InitView(url) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) @@ -376,10 +376,10 @@ function M:EventInit() end self:PlayXiPai(xipaiCB) else - ViewUtil.ShowModalWait(self._root_view,"等待其它玩家洗牌...") + ViewUtil.ShowModalWait2(self._root_view,"等待其它玩家洗牌...") coroutine.start(function() coroutine.wait(3) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() end) @@ -1489,7 +1489,7 @@ function M:OnPlayerEnter(...) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) diff --git a/lua_probject/extend_project/extend/poker/twodoudizhu/TwoDouDiZhu_MainView.lua b/lua_probject/extend_project/extend/poker/twodoudizhu/TwoDouDiZhu_MainView.lua index 32c9edd9..065763b6 100644 --- a/lua_probject/extend_project/extend/poker/twodoudizhu/TwoDouDiZhu_MainView.lua +++ b/lua_probject/extend_project/extend/poker/twodoudizhu/TwoDouDiZhu_MainView.lua @@ -28,11 +28,11 @@ local bg_config = { } local GameState = { - ROOM_STATUS_INIT = 1, --初始化 - ROOM_STATUS_FAPAI = 2, --发牌 - ROOM_STATUS_JIAO_DIZHU = 3, --叫地主 - ROOM_STATUS_QIANG_DIZHU = 4, --抢地主 - ROOM_STATUS_CHUPAI = 5, --出牌中 + ROOM_STATUS_INIT = 1, --初始化 + ROOM_STATUS_FAPAI = 2, --发牌 + ROOM_STATUS_JIAO_DIZHU = 3, --叫地主 + ROOM_STATUS_QIANG_DIZHU = 4, --抢地主 + ROOM_STATUS_CHUPAI = 5, --出牌中 ROOM_STATUS_FINISH = 6, } @@ -114,7 +114,7 @@ function M:InitView(url) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) @@ -888,7 +888,7 @@ function M:EventInit() if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then -- body card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_TwoDouDiZhu/" .. - card_n .. "_1") + card_n .. "_1") else card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_TwoDouDiZhu/" .. card_n) end @@ -896,7 +896,7 @@ function M:EventInit() if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then -- body card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_TwoDouDiZhu/" .. - card_n .. "_2") + card_n .. "_2") else card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2") end @@ -1632,7 +1632,7 @@ function M:OnPlayerEnter(...) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) diff --git a/lua_probject/extend_project/extend/poker2/suoha/ExMainView.lua b/lua_probject/extend_project/extend/poker2/suoha/ExMainView.lua index 11d5d59d..52a5408f 100644 --- a/lua_probject/extend_project/extend/poker2/suoha/ExMainView.lua +++ b/lua_probject/extend_project/extend/poker2/suoha/ExMainView.lua @@ -96,7 +96,7 @@ function M:InitView(url) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) @@ -208,7 +208,7 @@ function M:InitView(url) self._view:GetChild('Btn_Message').onClick:Set(function() ViewUtil.ErrorMsg(self._view, "", "该功能还未开放") end) - self._view:GetChild('Btn_Invite').onClick:Set(function() + self._view:GetChild('btn_invite').onClick:Set(function() ViewUtil.ErrorMsg(self._view, "", "该功能还未开放") end) @@ -846,7 +846,7 @@ function M:OnPlayerEnter(...) ErrorMsgTip:Destroy() ErrorMsgTip = nil self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() NetResetConnectWindow.CloseNetReset() ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) diff --git a/lua_probject/extend_project/extend/zipai/hsrunbeard/EXMainView.lua b/lua_probject/extend_project/extend/zipai/hsrunbeard/EXMainView.lua index 85604c5a..006c69df 100644 --- a/lua_probject/extend_project/extend/zipai/hsrunbeard/EXMainView.lua +++ b/lua_probject/extend_project/extend/zipai/hsrunbeard/EXMainView.lua @@ -154,7 +154,7 @@ function M:EventInit() ViewUtil.ShowModalWait(self._root_view, "等待其它玩家洗牌...") coroutine.start(function() coroutine.wait(4) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() end) end end) diff --git a/lua_probject/main_project/main/majiang/MJClearingView.lua b/lua_probject/main_project/main/majiang/MJClearingView.lua index 10897e41..8d0afb31 100644 --- a/lua_probject/main_project/main/majiang/MJClearingView.lua +++ b/lua_probject/main_project/main/majiang/MJClearingView.lua @@ -85,7 +85,11 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne endRound.onClick:Set(function() - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end) if over == 0 then @@ -122,7 +126,11 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne showBtnTypeCtr.selectedIndex = 1 self:fillResult1(room, peopleNum, total_result) else - ViewManager.ChangeView(ViewManager.View_Family) + if room._flag_lobby then + ViewManager.ChangeView(ViewManager.View_Lobby) + else + ViewManager.ChangeView(ViewManager.View_Family) + end end end end diff --git a/lua_probject/main_project/main/majiang/MJSettingViewNew.lua b/lua_probject/main_project/main/majiang/MJSettingViewNew.lua index d76df1b0..436abe6c 100644 --- a/lua_probject/main_project/main/majiang/MJSettingViewNew.lua +++ b/lua_probject/main_project/main/majiang/MJSettingViewNew.lua @@ -207,7 +207,7 @@ function M:init(url) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!') return diff --git a/lua_probject/main_project/main/poker/PKSettingView.lua b/lua_probject/main_project/main/poker/PKSettingView.lua index c5f5d888..f6c08850 100644 --- a/lua_probject/main_project/main/poker/PKSettingView.lua +++ b/lua_probject/main_project/main/poker/PKSettingView.lua @@ -170,7 +170,7 @@ function M:init(url) ) _curren_msg.onOk:Add( function() - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_RemoveRoom( @@ -180,7 +180,7 @@ function M:init(url) if self._is_destroy then return end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!') return @@ -233,10 +233,10 @@ function M:showSettingOption() local _gamectr = ControllerManager.GetController(GameController) if state > 0 and state < 3 then if ispanguangzhe then - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) _gamectr:LevelRoom( function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then ViewManager.ChangeView(ViewManager.View_Lobby) else @@ -248,10 +248,10 @@ function M:showSettingOption() ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。') end else - ViewUtil.ShowModalWait(self._root_view) + ViewUtil.ShowModalWait2(self._root_view) _gamectr:LevelRoom( function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then ViewManager.ChangeView(ViewManager.View_Lobby) else diff --git a/lua_probject/main_project/main/poker2/PKSettingView.lua b/lua_probject/main_project/main/poker2/PKSettingView.lua index 50f5e6da..0c26d700 100644 --- a/lua_probject/main_project/main/poker2/PKSettingView.lua +++ b/lua_probject/main_project/main/poker2/PKSettingView.lua @@ -116,7 +116,7 @@ function M:showSettingOption() ViewUtil.ShowModalWait(self._root_view) _gamectr:LevelRoom( function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then ViewManager.ChangeView(ViewManager.View_Lobby) else @@ -131,7 +131,7 @@ function M:showSettingOption() ViewUtil.ShowModalWait(self._root_view) _gamectr:LevelRoom( function(res) - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait2() if res.ReturnCode == 0 then ViewManager.ChangeView(ViewManager.View_Lobby) else diff --git a/wb_new_ui/assets/Common/InviteFamily/Component/btn_close.xml b/wb_new_ui/assets/Common/InviteFamily/Component/btn_close.xml new file mode 100644 index 00000000..7bba3dc0 --- /dev/null +++ b/wb_new_ui/assets/Common/InviteFamily/Component/btn_close.xml @@ -0,0 +1,10 @@ + + + + + + + + +