diff --git a/lua_probject/base_project/Game/Controller/GameController.lua b/lua_probject/base_project/Game/Controller/GameController.lua index 696d0432..d8e837f5 100644 --- a/lua_probject/base_project/Game/Controller/GameController.lua +++ b/lua_probject/base_project/Game/Controller/GameController.lua @@ -166,7 +166,7 @@ function M:ExitWitnessGame(pid, gid, rid) _data["room_id"] = rid -- _data["session"] = _client:getSession() _client:send(Protocol.GAME_Exit_WITNESS_ROOM, _data) - _client:destroy() + -- _client:destroy() end --聊天 diff --git a/lua_probject/base_project/Game/View/Family/FamilAllRank.lua b/lua_probject/base_project/Game/View/Family/FamilAllRank.lua index 938b85d8..d7f99e93 100644 --- a/lua_probject/base_project/Game/View/Family/FamilAllRank.lua +++ b/lua_probject/base_project/Game/View/Family/FamilAllRank.lua @@ -121,7 +121,7 @@ function M:ScoreListRenderer(index, obj) obj:GetChild('text_rank').text = index obj:GetChild('text_id').text = rankTable[index + 1].rankTable obj:GetChild('text_name').text = rankTable[index + 1].nick - obj:GetChild('text_other').text = d2ad(rankTable[index + 1].score) + obj:GetChild('text_other').text = rankTable[index + 1].score ImageLoad.Load(rankTable[index + 1].portrait, obj:GetChild('btn_head')._iconObject) end diff --git a/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua b/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua index 88546fb4..373954bc 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua @@ -56,7 +56,8 @@ function M:initBtn() end end if #tempNumberList == 0 then - ViewUtil.ShowOneChooose("没有找到该成员") + local guo_msg = MsgWindow.new(self._root_view, "没有找到该成员", MsgWindow.MsgMode.OnlyOk) + guo_msg:Show() else self:FillList(tempNumberList) end diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua index 1e007f32..be090ce0 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua @@ -46,15 +46,22 @@ function M:init(url, lev, res) self._view:GetController('isAssistant').selectedIndex = info.lev == 1 and 0 or (lev == 2 and 1 or 2) self._view:GetChild('btn_changeTag').onClick:Set(function() - ViewUtil.ShowOneChooose("该功能还未开放") + local guo_msg = MsgWindow.new(self._root_view, "该功能还未开放", MsgWindow.MsgMode.OnlyOk) + guo_msg:Show() end) self._view:GetChild('btn_changeMJScore').onClick:Set(function() - ViewUtil.ShowOneInput("修改麻将进入限制分", function(text) + local inputData = {} + inputData.text = 0 - tonumber(self._view:GetChild('text_score_majiang').text) + inputData.titleText = "进入牌局限制分设置" + inputData.promptText = "请输入限制分" + inputData.btnType = 2 + inputData.showText = "小提示\n1.设置为0分时表示进入牌局不受限制\n2.每天未读的输分高于设置的分数后无法进入牌局" + ViewUtil.ShowOneInput(inputData, function(text) -- print("lingmeng修改扑克进入限制分", text) fgCtr:FG_SetJoinScore(self.groupId, info.uid, tonumber(text), MJScore, function(res) if res.ReturnCode ~= 0 then - ViewUtil.ShowOneChooose("修改限制分失败" .. res.ReturnCode) + ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败") else MJScore = tonumber(text) self._view:GetChild('text_score_majiang').text = -MJScore @@ -64,11 +71,17 @@ function M:init(url, lev, res) end) self._view:GetChild('btn_changePokerScore').onClick:Set(function() - ViewUtil.ShowOneInput("修改扑克进入限制分", function(text) + local inputData = {} + inputData.text = 0 - tonumber(self._view:GetChild('text_score_poker').text) + inputData.titleText = "进入牌局限制分设置" + inputData.promptText = "请输入限制分" + inputData.btnType = 2 + inputData.showText = "小提示\n1.设置为0分时表示进入牌局不受限制\n2.每天未读的输分高于设置的分数后无法进入牌局" + ViewUtil.ShowOneInput(inputData, function(text) -- print("lingmeng修改扑克进入限制分", text) fgCtr:FG_SetJoinScore(self.groupId, info.uid, MJScore, tonumber(text), function(res) if res.ReturnCode ~= 0 then - ViewUtil.ShowOneChooose("修改限制分失败" .. res.ReturnCode) + ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败") else PKScore = tonumber(text) self._view:GetChild('text_score_poker').text = -PKScore @@ -78,36 +91,50 @@ function M:init(url, lev, res) end) self._view:GetChild('btn_tick').onClick:Set(function() - ViewUtil.ShowTwoChooose(string.format("是否将用户(%s)踢出", info.nick), function() - fgCtr:FG_GroupRemoveMember(self.groupId, info.uid, self._callback_tick) - self:Destroy() - end) + local _curren_msg = + MsgWindow.new(self._root_view, string.format("是否将用户(%s)踢出", info.nick), MsgWindow.MsgMode.OkAndCancel) + _curren_msg.onOk:Add( + function() + fgCtr:FG_GroupRemoveMember(self.groupId, info.uid, self._callback_tick) + self:Destroy() + end + ) + _curren_msg:Show() end) self._view:GetChild('btn_band'):GetController('band').selectedIndex = flag_band self._view:GetChild('btn_band').onClick:Set(function() - ViewUtil.ShowTwoChooose(string.format("是否禁止用户(%s)进入房间", info.nick), function() - fgCtr:FG_BanMember(self.groupId, info.uid, 1 - flag_band, 1, function() - if res.ReturnCode == 0 then - flag_band = 1 - flag_band - self._view:GetChild('btn_band'):GetController('band').selectedIndex = flag_band - self._callback_refren() - else - ViewUtil.ShowOneChooose("设置进房权限失败") - end - end) - end) + local _curren_msg = + MsgWindow.new(self._root_view, string.format("是否禁止用户(%s)进入房间", info.nick), MsgWindow.MsgMode.OkAndCancel) + _curren_msg.onOk:Add( + function() + fgCtr:FG_BanMember(self.groupId, info.uid, 1 - flag_band, 1, function() + if res.ReturnCode == 0 then + flag_band = 1 - flag_band + self._view:GetChild('btn_band'):GetController('band').selectedIndex = flag_band + self._callback_refren() + else + local guo_msg = MsgWindow.new(self._root_view, "设置进房权限失败", MsgWindow.MsgMode.OnlyOk) + guo_msg:Show() + end + end) + end + ) + _curren_msg:Show() end) self._view:GetChild('btn_makeOver').onClick:Set(function() - ViewUtil.ShowOneChooose("该功能还未开放") + local guo_msg = MsgWindow.new(self._root_view, "该功能还未开放", MsgWindow.MsgMode.OnlyOk) + guo_msg:Show() end) self._view:GetChild('btn_assistant'):GetController('isAssistant').selectedIndex = flag_assistant self._view:GetChild('btn_assistant').onClick:Set(function() - ViewUtil.ShowTwoChooose( - string.format("是否%s用户(%s)%s", flag_assistant == 1 and "取消" or "将", info.nick, - flag_assistant == 1 and "助理身份" or "设置为助理"), function() + local _curren_msg = + MsgWindow.new(self._root_view, string.format("是否%s用户(%s)%s", flag_assistant == 1 and "取消" or "将", info.nick, + flag_assistant == 1 and "助理身份" or "设置为助理"), MsgWindow.MsgMode.OkAndCancel) + _curren_msg.onOk:Add( + function() fgCtr:FG_SetManager(self.groupId, info.uid, flag_assistant + 1, function(res) if res.ReturnCode == 0 then local g = DataManager.groups.groupMap[self.groupId] @@ -121,10 +148,13 @@ function M:init(url, lev, res) local mgr_ctr = ControllerManager.GetController(GroupMgrController) mgr_ctr:FG_Update_Assistant(self.groupId, info.uid, function() end) else - ViewUtil.ShowOneChooose("设置助理失败") + local guo_msg = MsgWindow.new(self._root_view, "设置助理失败", MsgWindow.MsgMode.OnlyOk) + guo_msg:Show() end end) - end) + end + ) + _curren_msg:Show() end) end diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua index 7b28e366..ecd80f9c 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua @@ -147,7 +147,8 @@ function FamilyNumberRecord.New(root, page) end end if #tempRank == 0 then - ViewUtil.ShowOneChooose("没有该玩家排行榜") + local guo_msg = MsgWindow.new(self._root_view, "没有该玩家排行榜", MsgWindow.MsgMode.OnlyOk) + guo_msg:Show() else self.showRank = tempRank self._viewList_numverRecord.numItems = #self.showRank @@ -155,7 +156,13 @@ function FamilyNumberRecord.New(root, page) end end) self._view:GetChild('btn_changeMJScore').onClick:Set(function() - ViewUtil.ShowOneInput("修改麻将进入限制分", function(text) + local inputData = {} + inputData.text = 0 - tonumber(self.text_score_majiang.text) + inputData.titleText = "进入牌局限制分设置" + inputData.promptText = "请输入限制分" + inputData.btnType = 2 + inputData.showText = "小提示\n1.设置为0分时表示进入牌局不受限制\n2.每天未读的输分高于设置的分数后无法进入牌局" + ViewUtil.ShowOneInput(inputData, function(text) print("lingmeng修改扑克进入限制分", text) local day if self.btn_oneday.selected then @@ -165,7 +172,7 @@ function FamilyNumberRecord.New(root, page) end fgCtr:FG_SetJoinScore(group_id, 0, tonumber(text), self.MJScore, function(res) if res.ReturnCode ~= 0 then - ViewUtil.ShowOneChooose("修改限制分失败" .. res.ReturnCode) + ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败") else self.MJScore = tonumber(text) self.text_score_majiang.text = 0 - self.MJScore @@ -175,7 +182,13 @@ function FamilyNumberRecord.New(root, page) end) self._view:GetChild('btn_changePKScore').onClick:Set(function() - ViewUtil.ShowOneInput("修改扑克进入限制分", function(text) + local inputData = {} + inputData.text = 0 - tonumber(self.text_score_poker.text) + inputData.titleText = "进入牌局限制分设置" + inputData.promptText = "请输入限制分" + inputData.btnType = 2 + inputData.showText = "小提示\n1.设置为0分时表示进入牌局不受限制\n2.每天未读的输分高于设置的分数后无法进入牌局" + ViewUtil.ShowOneInput(inputData, function(text) print("lingmeng修改扑克进入限制分", text) local day if self.btn_oneday.selected then @@ -185,7 +198,7 @@ function FamilyNumberRecord.New(root, page) end fgCtr:FG_SetJoinScore(group_id, 0, self.MJScore, tonumber(text), function(res) if res.ReturnCode ~= 0 then - ViewUtil.ShowOneChooose("修改限制分失败" .. res.ReturnCode) + ViewUtil.ErrorTip(res.ReturnCode, "修改限制分失败") else self.PKScore = tonumber(text) self.text_score_poker.text = 0 - self.PKScore @@ -211,7 +224,7 @@ function FamilyNumberRecord.New(root, page) function(res) pt(res) if res.ReturnCode ~= 0 then - ViewUtil.ShowOneChooose("修改战绩阅读状态失败" .. res.ReturnCode) + ViewUtil.ErrorTip(res.ReturnCode, "修改战绩阅读状态失败") else self.ctr_numberRecord.selectedIndex = 1 self:OnClickNumberRank(group_id, self.rankNumber.uid, self.rankNumber.round) @@ -419,15 +432,14 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj) for i = 1, #rdata do local obj2 = list:AddItemFromPool() obj2:GetChild('title').text = rdata[i].score - if round == tonumber(allDate.round) and allDate.applyDismisUserId and allDate.applyDismisUserId ~= "null" then + if allDate.dismisType and allDate.applyDismisUserId and allDate.dismisType == 1 and round == tonumber(allDate.round) and allDate.applyDismisUserId ~= "null" then obj2:GetController('jiesan').selectedIndex = rdata[i].nick == allDate.applyDismisUserId and 1 or 2 else obj2:GetController('jiesan').selectedIndex = 0 end end if round == tonumber(allDate.round) then - obj:GetController('jiesan_mng').selectedIndex = (not allDate.applyDismisUserId or allDate.applyDismisUserId == "null") and - 1 or 0 + obj:GetController('jiesan_mng').selectedIndex = allDate.dismisType or 0 else obj:GetController('jiesan_mng').selectedIndex = 0 end @@ -556,7 +568,7 @@ function M:RecursionGetNumberRecord(fgCtr, groupId, uid, index) function(res) pt(res) if res.ReturnCode ~= 0 then - ViewUtil.ShowOneChooose("获取查看个人战绩失败" .. res.ReturnCode) + ViewUtil.ErrorTip(res.ReturnCode, "获取查看个人战绩失败") self.ctr_numberRecord.selectedIndex = 0 else local records = res.Data.records diff --git a/lua_probject/base_project/Game/View/Family/FamilyRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyRecord.lua index 82d7cc3e..b771a446 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyRecord.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyRecord.lua @@ -106,8 +106,7 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj) end end if round == tonumber(allDate.round) then - obj:GetController('jiesan_mng').selectedIndex = (not allDate.applyDismisUserId or allDate.applyDismisUserId == "null") and - 1 or 0 + obj:GetController('jiesan_mng').selectedIndex = allDate.dismisType or 0 else obj:GetController('jiesan_mng').selectedIndex = 0 end diff --git a/lua_probject/base_project/Game/View/Family/PlayEditView.lua b/lua_probject/base_project/Game/View/Family/PlayEditView.lua index 81130597..52ff69be 100644 --- a/lua_probject/base_project/Game/View/Family/PlayEditView.lua +++ b/lua_probject/base_project/Game/View/Family/PlayEditView.lua @@ -75,7 +75,7 @@ function PlayEditView:Init() -- times倍数 local times = json.decode(playList[index].hpData).times obj:GetChild('Label_details'):GetChild('title').text = times / 1000 .. - "倍," .. mode:LoadConfigToDetail(playList[index].config, playList[index].hpData) + "倍," .. mode:LoadConfigToDetail(playList[index].config, playList[index].hpData) obj:GetChild('text_playName').emojies = EmojiDitc.EmojiesDitc obj:GetChild('text_playName').text = Utils.TextOmit(playList[index].name, 6, "...") obj:GetController('type').selectedIndex = 1 diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index bdb837c3..03128af8 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -1175,9 +1175,9 @@ function M:Show() Broadcast.AddListener(BroadcastEvent.OnOutFamily, self.Reflash, self) self._familyEventView:AddListener() - BaseView.Show(self) - self:Reflash() + + BaseView.Show(self) end function M:Close() diff --git a/lua_probject/base_project/Game/View/Lobby/LobbyAuthenticateView.lua b/lua_probject/base_project/Game/View/Lobby/LobbyAuthenticateView.lua index 3dd62adf..2b8925a9 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbyAuthenticateView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbyAuthenticateView.lua @@ -58,8 +58,7 @@ function M:init(url) if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "实名认证失败") else - pt(res) - ViewUtil.ShowOneChooose("实名认证成功") + ViewUtil.ErrorTip(res.ReturnCode, "实名认证成功") self:Destroy() end end) diff --git a/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua b/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua index 686fd3f7..7ddd1a42 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua @@ -51,15 +51,19 @@ function M:init(url) self.Lable_phone.text = "" end view:GetChild('btn_headChange').onClick:Add(function() - ViewUtil.ShowOneChooose("暂不支持更换头像", 1) + local guo_msg = MsgWindow.new(self._root_view, "暂不支持更换头像", MsgWindow.MsgMode.OnlyOk) + guo_msg:Show() end) view:GetChild('btn_changePhone').onClick:Add(function() - ViewUtil.ShowOneChooose("绑定页面正在优化中,请稍后绑定", 1) + local guo_msg = MsgWindow.new(self._root_view, "绑定页面正在优化中,请稍后绑定", MsgWindow.MsgMode.OnlyOk) + guo_msg:Show() end) view:GetChild('btn_bindPhone').onClick:Add(function() - ViewUtil.ShowOneChooose("绑定页面正在优化中,请稍后绑定", 1, function() + local guo_msg = MsgWindow.new(self._root_view, "绑定页面正在优化中,请稍后绑定", MsgWindow.MsgMode.OnlyOk) + guo_msg.onOk(function() bind.selectedIndex = 1 end) + guo_msg:Show() end) local type = view:GetController('type') view:GetChild('btn_save').onClick:Add(function() @@ -71,11 +75,13 @@ function M:init(url) cnt = cnt + 2 end if cnt > 0 then - ViewUtil.ShowOneChooose( + local guo_msg = MsgWindow.new(self._root_view, string.format("确定要修改%s%s%s吗?", cnt % 2 == 1 and "昵称" or "", cnt == 3 and "、" or "", - cnt >= 2 and "性别" or ""), 1, function() - type.selectedIndex = 0 - end) + cnt >= 2 and "性别" or ""), MsgWindow.MsgMode.OnlyOk) + guo_msg.onOk(function() + type.selectedIndex = 0 + end) + guo_msg:Show() else type.selectedIndex = 0 end diff --git a/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua b/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua index 9946a30c..6a740e09 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua @@ -22,27 +22,29 @@ function M:init(url) local btn_music = view:GetChild('btn_vedio_music') local btn_sound = view:GetChild('btn_vedio_sound') - -- slider_sound.value = GameApplication.Instance.SoundValue - -- slider_music.value = GameApplication.Instance.MusicValue + slider_sound.value = GameApplication.Instance.SoundValue + slider_music.value = GameApplication.Instance.MusicValue + btn_sound.selected = GameApplication.Instance.SoundMute + btn_music.selected = GameApplication.Instance.MusicMute slider_music.onChanged:Add(function() - -- GameApplication.Instance.MusicValue = slider_music.value - -- btn_music.selected = false - -- GameApplication.Instance.MusicMute = false; + GameApplication.Instance.MusicValue = slider_music.value + btn_music.selected = false + GameApplication.Instance.MusicMute = false; end) slider_sound.onChanged:Add(function() - -- GameApplication.Instance.SoundValue = slider_sound.value - -- btn_sound.selected = false - -- GameApplication.Instance.SoundMute = false; + GameApplication.Instance.SoundValue = slider_sound.value + btn_sound.selected = false + GameApplication.Instance.SoundMute = false; end) btn_sound.onClick:Add(function() - -- GameApplication.Instance.SoundMute = btn_sound.selected; + GameApplication.Instance.SoundMute = btn_sound.selected; end) btn_music.onClick:Add(function() - -- GameApplication.Instance.MusicMute = btn_music.selected; + GameApplication.Instance.MusicMute = btn_music.selected; end) local _btn_logout = self._view:GetChild('btn_switchAccount') @@ -62,20 +64,6 @@ function M:init(url) Application.Quit() end ) - --[[ - - local _btn_logout = self._view:GetChild('btn_del') - _btn_logout.onClick:Set(function() - local _curren_msg = MsgWindow.new(self._root_view, '您是否退出当前账号?', MsgWindow.MsgMode.OkAndCancel) - _curren_msg.onOk:Add(function() - PlayerPrefs.DeleteKey('session_id') - PlayerPrefs.Save() - RestartGame() - end) - _curren_msg:Show() - end) - - --]] end return M diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index f2e80671..9bbf0273 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -155,7 +155,8 @@ function M:InitView(url) local btn_invite = self._view:GetChild("btn_invite") btn_invite.onClick:Add(function() - ViewUtil.ShowOneChooose("下载地址已复制,请到浏览器粘贴", 1) + local _curren_msg = MsgWindow.new(self._root_view, "下载地址已复制,请到浏览器粘贴", MsgWindow.MsgMode.OnlyOk) + _curren_msg:Show() end) local btn_head = view:GetChild("btn_head") diff --git a/lua_probject/base_project/Game/View/ViewUtil.lua b/lua_probject/base_project/Game/View/ViewUtil.lua index d87b400e..2432c43b 100644 --- a/lua_probject/base_project/Game/View/ViewUtil.lua +++ b/lua_probject/base_project/Game/View/ViewUtil.lua @@ -349,17 +349,22 @@ function ViewUtil.ShowTwoChooose(showText, leftCallback, rightCallback) end) end -function ViewUtil.ShowOneInput(showText, callback) +function ViewUtil.ShowOneInput(data, callback) + local data = data or {} local pop_oneInput = UIPackage.CreateObjectFromURL("ui://Common/pop_oneInput") - pop_oneInput:GetChild('label_detial').title = showText + pop_oneInput:GetChild('title').text = data.titleText or "" + pop_oneInput:GetChild('label_detial').text = data.showText or "" + pop_oneInput:GetChild('input_oneInput').promptText = data.promptText or "" GRoot.inst:AddChild(pop_oneInput) pop_oneInput:Center() local btn_center = pop_oneInput:GetChild('btn_center') - -- if type(btnType) == "number" then - -- btn_center.icon = string.format("ui://Common/btn_%d", btnType) - -- else - -- btn_center.icon = btnType - -- end + if data.btnType then + if type(data.btnType) == "number" then + btn_center.icon = string.format("ui://Common/btn_%d", data.btnType) + else + btn_center.icon = data.btnType + end + end btn_center.onClick:Add(function() GRoot.inst:RemoveChild(pop_oneInput) if callback then diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXSettingView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXSettingView.lua index 8574f66f..8a48ca27 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXSettingView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXSettingView.lua @@ -93,18 +93,6 @@ function M:init(url) ViewManager.ChangeView(ViewManager.View_Family) end) end) - - self._view:GetChild("btn_closeRoom").onClick:Set(function() - local _gamectr = ControllerManager.GetController(GameController) - _gamectr:LevelRoom(function(res) - print("退出房间") - if res.ReturnCode ~= 0 then - ViewUtil.ErrorTip(res.ReturnCode) - return - end - ViewManager.ChangeView(ViewManager.View_Family) - end) - end) end return M diff --git a/lua_probject/main_project/main/majiang/MJSettingViewNew.lua b/lua_probject/main_project/main/majiang/MJSettingViewNew.lua index 2df23cf1..a478c23e 100644 --- a/lua_probject/main_project/main/majiang/MJSettingViewNew.lua +++ b/lua_probject/main_project/main/majiang/MJSettingViewNew.lua @@ -158,15 +158,44 @@ function M:init(url) end) end) - --游戏内解散房间功能 - self._view:GetController('lev').selectedIndex = 0 - self.btn_closeRoom.onClick:Set(function() - if self._flag_witness then - local _room = DataManager.CurrenRoom - self._mainView._gamectr:ExitWitnessGame(_room.play_id, _room.game_id, _room.room_id) - ViewManager.ChangeView(ViewManager.View_Family) - return - end + local group = DataManager.groups:get(DataManager.CurrenRoom.group_id) + self._view:GetController('lev').selectedIndex = (group and group.lev and group.lev < 3) and 0 or 1 + self._view:GetChild("btn_jiesan").onClick:Set(function() + local _curren_msg = + MsgWindow.new( + self._root_view, + '确定要解散该房间吗?', + MsgWindow.MsgMode.OkAndCancel + ) + _curren_msg.onOk:Add( + function() + ViewUtil.ShowModalWait(self._root_view) + local fgCtr = ControllerManager.GetController(NewGroupController) + + fgCtr:FG_RemoveRoom( + DataManager.CurrenRoom.group_id, + DataManager.CurrenRoom.room_id, + function(res) + if self._is_destroy then + return + end + ViewUtil.CloseModalWait() + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!') + return + else + if self._flag_witness then + local _room = DataManager.CurrenRoom + self._mainView._gamectr:ExitWitnessGame(_room.play_id, _room.game_id, _room.room_id) + ViewManager.ChangeView(ViewManager.View_Family) + return + end + end + end + ) + end + ) + _curren_msg:Show() end) end diff --git a/wb_new_ui/assets/Chat/Main.xml b/wb_new_ui/assets/Chat/Main.xml index 9c774baf..e71667bc 100644 --- a/wb_new_ui/assets/Chat/Main.xml +++ b/wb_new_ui/assets/Chat/Main.xml @@ -12,9 +12,9 @@ - + - + @@ -44,7 +44,7 @@ - +