-- 成员列表Layout local ClubPlayerMatch = class("ClubPlayerMatch" , cc.UIView); local ClubDefine = require("luaScript.Protocol.Club.ClubDefine") local MATCH_DAY = { JIN_RI = 0, ZUO_RI = 1, QIAN_RI = 2, } local MATCH_DAY_Txt = { [MATCH_DAY.JIN_RI] = "今日", [MATCH_DAY.ZUO_RI] = "昨日", [MATCH_DAY.QIAN_RI] = "前日", } --一页30个 local PAGE_COUNT = 10 function ClubPlayerMatch:ctor(clubId,searchData) ClubPlayerMatch.super.ctor(self) self.clubId = clubId --单个茶馆数据 self.clubInfo = app.club_php.clubList[clubId] --只用于是否播放标签页按钮音效 self.touchIdx = 1; self.curPage = 1 self.totolPage = 1 self.dayTag = MATCH_DAY.JIN_RI --默认今日 self.tag = ClubDefine.PlayListType.MATCH_MEMBER self.sort = true; self.searchData = searchData; self:loadUI() end function ClubPlayerMatch:loadUI() local ui = loadUI("res/ui/ui_club/ui_club_player_match.ui") self.ui = ui; self:addChild(ui); end function ClubPlayerMatch:onEnter() ClubPlayerMatch.super.onEnter(self) if not self.clubInfo then return end self:initButton() self.ui.Items.Image_SelectBg:setVisible(false) self.ui.Items.ScrollView_Member:hideAllBar() self.ui.Items.ScrollView_Record:hideAllBar() self.ui.Items.ScrollView_Select:hideAllBar() self.ui.Items.Image_Up:registerClick(handler(self,self.onUp)) self.ui.Items.Image_Down:registerClick(handler(self,self.onDown)) self.ui.Items.Image_Down:setVisible(false) self:initBindEvent() end function ClubPlayerMatch:onUp() playBtnEffect() self.ui.Items.Image_SelectBg:setVisible(true) self.ui.Items.Image_Down:setVisible(true) self.ui.Items.Image_Up:setVisible(false) end function ClubPlayerMatch:onDown() playBtnEffect() self.ui.Items.Image_SelectBg:setVisible(false) self.ui.Items.Image_Down:setVisible(false) self.ui.Items.Image_Up:setVisible(true) end function ClubPlayerMatch:initButton() --关闭 self.ui.Items.Button_close:registerClick(handler(self , self.onClose)) self.ui.Items.Button_Rank:registerClick(handler(self , self.onMatchRank)) self.ui.Items.Button_Rank:setVisible(self.clubInfo.role == ClubDefine.Job.Manager or self.clubInfo.role == ClubDefine.Job.Creator) --添加成员 self.ui.Items.Button_add:registerClick(handler(self , self.onAdd)) --搜索 self.ui.Items.Button_search:registerClick(handler(self , self.onSearchPlayer)) self.ui.Items.Button_jinzhi:registerClick(handler(self , self.onClickForbidList)) if self.clubInfo.role == ClubDefine.Job.LevelOneCopartner or self.clubInfo.role == ClubDefine.Job.LevelTwoCopartner then self.ui.Items.Button_jinzhi:setVisible(false) end --翻页 self.ui.Items.Button_page_up:registerClick(handler(self , self.onClickUpPage)) self.ui.Items.Button_page_next:registerClick(handler(self , self.onClickNextPage)) --调整红花 self.ui.Items.Button_addjust_red:setVisible(false) self.ui.Items.Button_addjust_red:registerClick(handler(self , self.onAdjustRedFlower)) self.ui.Items.Button_page_up_1:registerClick(handler(self , self.onClickUpPage)) self.ui.Items.Button_page_next_1:registerClick(handler(self , self.onClickNextPage)) local radioManager = import("luaScript.Tools.RadioManager"):new() radioManager:addItem(self.ui.Items.CheckBox_match_member,ClubDefine.PlayListType.MATCH_MEMBER) radioManager:addItem(self.ui.Items.CheckBox_match_record,ClubDefine.PlayListType.MATCH_RECORD) radioManager:setCallback(handler(self , self.onClickMatchTypeTag)) local defaultView = ClubDefine.PlayListType.MATCH_MEMBER if self.searchData and self.searchData.isRecordView then defaultView = ClubDefine.PlayListType.MATCH_RECORD end radioManager:setDefault(defaultView) --昨日前日今日 self.ui.Items.Layout_Select_0:registerClick(function () self:onClickDay(MATCH_DAY.QIAN_RI) end) self.ui.Items.Layout_Select_1:registerClick(function () self:onClickDay(MATCH_DAY.JIN_RI) end) self.ui.Items.Layout_Select_2:registerClick(function () self:onClickDay(MATCH_DAY.ZUO_RI) end) local function setSeletBgVisible() self.ui.Items.Image_SelectBg:setVisible(false) self.ui.Items.Image_Down:setVisible(false) self.ui.Items.Image_Up:setVisible(true) end self.ui.Items.Layout_1:registerClick(function () setSeletBgVisible() end) self.ui.Items.ScrollView_Record:registerClick(function () setSeletBgVisible() end) --比赛场排序 self.ui.Items.Button_status:registerClick(handler(self , self.onStatuSort)) self.ui.Items.Layout_status:registerClick(handler(self , self.onStatuSort)) self.ui.Items.Button_redNum:registerClick(handler(self , self.onStatuRedNum)) self.ui.Items.Layout_redNum:registerClick(handler(self , self.onStatuRedNum)) self.ui.Items.Button_ratdio:registerClick(handler(self , self.onStatuRatdio)) self.ui.Items.Layout_ratdio:registerClick(handler(self , self.onStatuRatdio)) --比赛记录排序 self.ui.Items.Button_redNumChange:registerClick(handler(self , self.onStatuRedChange)) self.ui.Items.Layout_redNumChange:registerClick(handler(self , self.onStatuRedChange)) self.ui.Items.Button_receiveGreen:registerClick(handler(self , self.onStatuReceiveGreen)) self.ui.Items.Layout_receiveGreen:registerClick(handler(self , self.onStatuReceiveGreen)) self.ui.Items.Button_jushu:registerClick(handler(self , self.onStatuJuShu)) self.ui.Items.Layout_jushu:registerClick(handler(self , self.onStatuJuShu)) self.ui.Items.Button_score:registerClick(handler(self , self.onStatuScore)) self.ui.Items.Layout_score:registerClick(handler(self , self.onStatuScore)) self.ui.Items.Button_dayingjia:registerClick(handler(self , self.onStatuDaYingJia)) self.ui.Items.Layout_dayingjia:registerClick(handler(self , self.onStatuDaYingJia)) end --玩家状态排序 function ClubPlayerMatch:onStatuSort() playBtnEffect() if self.sort then --升序 self:sortOnline("asc"); self.sort = false; else --降序 self:sortOnline("desc"); self.sort = true; end end --状态排序 function ClubPlayerMatch:sortOnline(sortType) local playerList = self.lastSortPlayer; if playerList then local lT = {}; for k,v in pairs(playerList) do table.insert(lT,v) end if sortType == "asc" then --升序 local function sortFunc(a,b) return a.online < b.online end table.sort(lT, sortFunc); elseif sortType == "desc" then --降序 local function sortFunc(a,b) return a.online > b.online end table.sort(lT, sortFunc); end self:updatePlayerList(lT) end end function ClubPlayerMatch:onStatuRedNum() playBtnEffect() if self.sort then --升序 self:sortRedNum("asc"); self.sort = false; else --降序 self:sortRedNum("desc"); self.sort = true; end end function ClubPlayerMatch:sortRedNum(sortType) local playerList = self.lastSortPlayer; if playerList then local lT = {}; for k,v in pairs(playerList) do table.insert(lT,v) end if sortType == "asc" then --升序 local function sortFunc(a,b) return a.useRedFlower < b.useRedFlower end table.sort(lT, sortFunc); elseif sortType == "desc" then --降序 local function sortFunc(a,b) return a.useRedFlower > b.useRedFlower end table.sort(lT, sortFunc); end self:updatePlayerList(lT) end end function ClubPlayerMatch:onStatuRatdio() playBtnEffect() if self.sort then --升序 self:sortRatdio("asc"); self.sort = false; else --降序 self:sortRatdio("desc"); self.sort = true; end end function ClubPlayerMatch:sortRatdio(sortType) local playerList = self.lastSortPlayer; if playerList then local lT = {}; for k,v in pairs(playerList) do table.insert(lT,v) end if sortType == "asc" then --升序 local function sortFunc(a,b) return a.arenaRatio < b.arenaRatio end table.sort(lT, sortFunc); elseif sortType == "desc" then --降序 local function sortFunc(a,b) return a.arenaRatio > b.arenaRatio end table.sort(lT, sortFunc); end self:updatePlayerList(lT) end end function ClubPlayerMatch:onStatuRedChange() playBtnEffect() if self.sort then --升序 self:sortRedChange("asc"); self.sort = false; else --降序 self:sortRedChange("desc"); self.sort = true; end end function ClubPlayerMatch:sortRedChange(sortType) local playerList = self.lastSortPlayer; if playerList then local lT = {}; for k,v in pairs(playerList) do table.insert(lT,v) end if sortType == "asc" then --升序 local function sortFunc(a,b) return a.changeRedFlower < b.changeRedFlower end table.sort(lT, sortFunc); elseif sortType == "desc" then --降序 local function sortFunc(a,b) return a.changeRedFlower > b.changeRedFlower end table.sort(lT, sortFunc); end self:updatePlayerList(lT) end end function ClubPlayerMatch:onStatuReceiveGreen() playBtnEffect() if self.sort then --升序 self:sortReceiveGreen("asc"); self.sort = false; else --降序 self:sortReceiveGreen("desc"); self.sort = true; end end function ClubPlayerMatch:sortReceiveGreen(sortType) local playerList = self.lastSortPlayer; if playerList then local lT = {}; for k,v in pairs(playerList) do table.insert(lT,v) end if sortType == "asc" then --升序 local function sortFunc(a,b) return a.changeGreen < b.changeGreen end table.sort(lT, sortFunc); elseif sortType == "desc" then --降序 local function sortFunc(a,b) return a.changeGreen > b.changeGreen end table.sort(lT, sortFunc); end self:updatePlayerList(lT) end end function ClubPlayerMatch:onStatuJuShu() playBtnEffect() if self.sort then --升序 self:sortJuShu("asc"); self.sort = false; else --降序 self:sortJuShu("desc"); self.sort = true; end end function ClubPlayerMatch:sortJuShu(sortType) local playerList = self.lastSortPlayer; if playerList then local lT = {}; for k,v in pairs(playerList) do table.insert(lT,v) end if sortType == "asc" then --升序 local function sortFunc(a,b) return a.playNum < b.playNum end table.sort(lT, sortFunc); elseif sortType == "desc" then --降序 local function sortFunc(a,b) return a.playNum > b.playNum end table.sort(lT, sortFunc); end self:updatePlayerList(lT) end end function ClubPlayerMatch:onStatuScore() playBtnEffect() if self.sort then --升序 self:sortScore("asc"); self.sort = false; else --降序 self:sortScore("desc"); self.sort = true; end end function ClubPlayerMatch:sortScore(sortType) local playerList = self.lastSortPlayer; if playerList then local lT = {}; for k,v in pairs(playerList) do table.insert(lT,v) end if sortType == "asc" then --升序 local function sortFunc(a,b) return a.totalScore < b.totalScore end table.sort(lT, sortFunc); elseif sortType == "desc" then --降序 local function sortFunc(a,b) return a.totalScore > b.totalScore end table.sort(lT, sortFunc); end self:updatePlayerList(lT) end end function ClubPlayerMatch:onStatuDaYingJia() playBtnEffect() if self.sort then --升序 self:sortDaYingJia("asc"); self.sort = false; else --降序 self:sortDaYingJia("desc"); self.sort = true; end end function ClubPlayerMatch:sortDaYingJia(sortType) local playerList = self.lastSortPlayer; if playerList then local lT = {}; for k,v in pairs(playerList) do table.insert(lT,v) end if sortType == "asc" then --升序 local function sortFunc(a,b) return a.playWinNum < b.playWinNum end table.sort(lT, sortFunc); elseif sortType == "desc" then --降序 local function sortFunc(a,b) return a.playWinNum > b.playWinNum end table.sort(lT, sortFunc); end self:updatePlayerList(lT) end end function ClubPlayerMatch:onClickDay(tag) playBtnEffect() --重置页数 self.curPage = 1 self.dayTag = tag self.ui.Items.Image_SelectBg:setVisible(false) self.ui.Items.Image_Down:setVisible(false) self.ui.Items.Image_Up:setVisible(true) self.ui.Items.Text_Info:setText(tostring(MATCH_DAY_Txt[tag])) if self.clubInfo then local playerJson = { clubId = self.clubInfo.clubId, day = tag, viewType = ClubDefine.PlayListType.MATCH_RECORD, status = self.tag, } app.club_php:requestPlayerList(playerJson) end end function ClubPlayerMatch:initBindEvent() --绑定请求成员列表成功回调事件 self:bindEvent(app.club_php , GAME_EVENT.CLUB_PLAYER_LIST , handler(self , self.onUpdatePlayerListEvent)) --权限发生改变 self:bindEvent(app.club_php , GAME_EVENT.CLUB_CHANGE_ROLE , handler(self , self.onChangeRole)); --绑定比赛开关回调 self:bindEvent(app.club_php , GAME_EVENT.CLUB_SET , handler(self , self.onSetSuccess)); --绑定请求禁止同桌列表成功回调事件 self:bindEvent(app.club_php , GAME_EVENT.CLUB_PLAYER_BAN_LIST , handler(self , self.onPlayerBanList)); --通知界面刷新当前列表 self:bindEvent(app.club_php, GAME_EVENT.NOTICE_REQUEST_PLAYER_LIST, handler(self, self.onReuqestPlayerList)) --绑定请求禁止同桌成员列表成功回调事件 self:bindEvent(app.club_php , GAME_EVENT.CLUB_PLAYER_BAN_ALL_LIST , handler(self , self.onGetClubForbidListSuccess)); --搜素 self:bindEvent(app.club_php , GAME_EVENT.CLUB_PLAYER_SEARCH , handler(self , self.onSearchPlayerSuccess)); --设置一级合伙人失败 self:bindEvent(app.club_php , GAME_EVENT.CLUB_SET_COPARTNER_ONE_FAILE , handler(self , self.onSetCopartnerFail)); self:bindTextFildTouch() end -- 角色权限修改 function ClubPlayerMatch:onChangeRole() self:removeFromParent() end -- 当比赛一关,其他和比赛有关的界面需要关闭 function ClubPlayerMatch:onSetSuccess(data) if not data or not data.setType then return end if data.setType == GAME_CLUB_SET_STATE.Math_Switch then self:removeFromParent() end end function ClubPlayerMatch:onClose() playBtnCloseEffect() self:removeFromParent() end function ClubPlayerMatch:onMatchRank() playBtnEffect() local view = import("luaScript.Views.Club.ClubPlayerMatchRank"):new(self.clubInfo.clubId) view:setAnchorPoint(cc.p(0.5, 0.5)) app:showWaitDialog(view) end --添加成员 function ClubPlayerMatch:onAdd() playBtnEffect() if self.clubInfo.role == ClubDefine.Job.Manager then local view = import("luaScript.Views.Club.ClubAddPlayer"):new(self.clubInfo.clubId,self.tag) view:setAnchorPoint(cc.p(0.5, 0.5)) app:showWaitDialog(view) else local view = import("luaScript.Views.Club.ClubAddPlayerView"):new(self.clubInfo) view:setAnchorPoint(cc.p(0.5, 0.5)) app:showWaitDialog(view) end end --下一页 function ClubPlayerMatch:onClickNextPage() playBtnEffect() self.curPage = self.curPage + 1 if self.curPage>self.totolPage then self.curPage = self.totolPage end self:updatePlayerList() end --上一页 function ClubPlayerMatch:onClickUpPage() playBtnEffect() self.curPage = self.curPage - 1 if self.curPage<1 then self.curPage = 1 end self:updatePlayerList() end function ClubPlayerMatch:onAdjustRedFlower() playBtnEffect() local view = import("luaScript.Views.Club.ClubPlayerMatchAdjustAllHongHua"):new(self.clubInfo.clubId) view:setAnchorPoint(cc.p(0.5, 0.5)) app:showWaitDialog(view) end --获取禁止同桌成员列表 function ClubPlayerMatch:onClickForbidList() playBtnEffect() app.club_php:requestForbidList(self.clubId) end function ClubPlayerMatch:bindTextFildTouch() local nodeName = self.ui.Items.TextField_search; local function onTouchEnded(touch , event) local searchCont = nodeName:getText(); if searchCont == "" then if self.curPage == 1 then self:onUpdatePlayerListEvent({type = self.tag}) else self:updatePlayerList() end return; end end nodeName:addEventListener(onTouchEnded) end function ClubPlayerMatch:onUpdatePlayerListEvent(data) if not data or not data.type then return end local mType = data.type if mType == self.tag then --重置 self.curPage = 1 self.totolPage = 1 local players = {} local data = {} if self.searchData then data = self.clubInfo.players self.searchData = nil else data = self.clubInfo.playersMatch end for k,v in pairs(data) do table.insert(players,v) end local function sortFunc(a, b) local aRole = tonumber(a.role) local bRole = tonumber(b.role) if aRole ~= bRole and (aRole == ClubDefine.Job.Copartner or bRole == ClubDefine.Job.Copartner or aRole == ClubDefine.Job.LevelOneCopartner or aRole == ClubDefine.Job.LevelTwoCopartner or bRole == ClubDefine.Job.LevelOneCopartner or bRole == ClubDefine.Job.LevelTwoCopartner) then if (aRole == ClubDefine.Job.LevelTwoCopartner and bRole == ClubDefine.Job.LevelOneCopartner) or (bRole == ClubDefine.Job.LevelTwoCopartner and aRole == ClubDefine.Job.LevelOneCopartner)then return aRole < bRole elseif aRole == ClubDefine.Job.Copartner or aRole == ClubDefine.Job.LevelOneCopartner or aRole == ClubDefine.Job.LevelTwoCopartner then return bRole ~= ClubDefine.Job.Manager and bRole ~= ClubDefine.Job.Creator else return aRole == ClubDefine.Job.Manager or aRole == ClubDefine.Job.Creator end end return aRole > bRole end table.sort(players,sortFunc) self:updatePlayerList(players) self.ui.Items.Text_online_num:setText(tostring(self.clubInfo.onlinePlayerNum)) if self.clubInfo.role == ClubDefine.Job.Creator then self.ui.Items.Text_total_num:setText("/"..tostring(self.clubInfo.playerNum)) else self.ui.Items.Text_total_num:setText("/"..tostring(self.clubInfo.totalPlayerNum)) end --match recored self.ui.Items.Text_Total_member:setText(tostring(self.clubInfo.totalPlayerNum)) end end function ClubPlayerMatch:updatePlayerList(data) local mListView = self.tag == ClubDefine.PlayListType.MATCH_MEMBER and self.ui.Items.ScrollView_Member or self.ui.Items.ScrollView_Record local className = self.tag == ClubDefine.PlayListType.MATCH_MEMBER and "luaScript.Views.Club.ClubPlayerMatchItem" or "luaScript.Views.Club.ClubPlayerMatchRecordItem" mListView:getInnerContainer():setAutoSize(true) mListView:removeAllChildren() local players = {} if data then players = data --记录上一次排序后的players数组,点上一页下一页时用 self.lastSortPlayer = {} self.lastSortPlayer = players else if self.lastSortPlayer and table.nums(self.lastSortPlayer) > 0 then players = self.lastSortPlayer else for k,v in pairs(self.clubInfo.playersMatch) do table.insert(players,v) end end end self.totolPage = math.ceil(table.nums(players)/PAGE_COUNT) local startIndex = (self.curPage-1) * PAGE_COUNT + 1 local endIndex = startIndex + PAGE_COUNT - 1 logD("match88888当前页玩家数据:") for i=startIndex,endIndex do local v = players[i] if v then local item = import(className):new(v,self.clubInfo.clubId,i,self.dayTag,self.tag,function () self:removeFromParent() end) mListView:addChild(item.ui) end end logD("match88888当前页玩家数据打印完毕!") mListView:jumpToTopOnSizeChanged() if self.tag == ClubDefine.PlayListType.MATCH_MEMBER then --创始人显示添加及导入,管理员只显示添加显示按钮(1:成员 2:管理员 3:创始人) self.ui.Items.Layout_add_btn:setVisible(self.clubInfo.role == ClubDefine.Job.Manager or self.clubInfo.role == ClubDefine.Job.Creator or self.clubInfo.role == ClubDefine.Job.LevelOneCopartner or self.clubInfo.role == ClubDefine.Job.LevelTwoCopartner) self.ui.Items.Button_addjust_red:setVisible(self.clubInfo.role == ClubDefine.Job.Creator or self.clubInfo.role == ClubDefine.Job.LevelOneCopartner or self.clubInfo.role == ClubDefine.Job.LevelTwoCopartner) self.ui.Items.Text_Cur_page:setString(self.curPage) self.ui.Items.Text_Total_page:setString("/"..self.totolPage) else self.ui.Items.Text_Cur_page_3:setString(self.curPage) self.ui.Items.Text_Total_page_3:setString("/"..self.totolPage) end end --搜索玩家 function ClubPlayerMatch:onSearchPlayer() playBtnEffect() if not self.clubInfo then return end local searchCont = self.ui.Items.TextField_search:getText(); if searchCont == "" or not tonumber(searchCont) then showTooltip("请输入玩家ID"); return; end if self.tag == ClubDefine.PlayListType.MATCH_MEMBER then local playerJson = { clubId = self.clubInfo.clubId, viewType = ClubDefine.PlayListType.SEARCH_PLAYER, status = self.tag, suid = searchCont } app.club_php:requestPlayerList(playerJson) else local playerJson = { clubId = self.clubInfo.clubId, viewType = ClubDefine.PlayListType.SEARCH_PLAYER, status = self.tag, day = self.dayTag, suid = searchCont } app.club_php:requestPlayerList(playerJson) end end function ClubPlayerMatch:onSearchPlayerSuccess(data) if not data then return end local result = data.result --logD("result:",table.tostring(result)) if result then local tt = {} for k,v in pairs(result.list) do table.insert(tt,v) end local player = tt[1] if player then local parentPlayer = {} parentPlayer.role = player.parentRole --[[if player.copartner ~= 0 then parentPlayer.uid = player.copartner else parentPlayer.uid = player.copartner5 end--]] --lastOpId 代表大上一级ID,比如“二级的成员或者二级他自己”大上级都是一级合伙人的ID, --而parentPlayer.uid是上级ID,比如二级的成员上级ID是二级合伙人。 local lastOpId = 0 player.copartner = toNumber(player.copartner) player.copartner5 = toNumber(player.copartner5) if player.role == ClubDefine.Job.LevelOneCopartner then lastOpId = app.user.loginInfo.uid parentPlayer.uid = app.user.loginInfo.uid elseif player.role == ClubDefine.Job.LevelTwoCopartner then lastOpId = player.copartner5 --一级 parentPlayer.uid = player.copartner5 elseif player.role == ClubDefine.Job.Member then if player.copartner == 0 and player.copartner5 == 0 then --一级和二级的ID为0,则是自己的名下 lastOpId = app.user.loginInfo.uid parentPlayer.uid = app.user.loginInfo.uid elseif player.copartner == 0 and player.copartner5 > 0 then --一级名下成员 lastOpId = app.user.loginInfo.uid parentPlayer.uid = player.copartner5 elseif player.copartner > 0 and player.copartner5 > 0 then --二级名下成员 lastOpId = player.copartner5 parentPlayer.uid = player.copartner end end if player.parentRole == ClubDefine.Job.Creator or player.parentRole == self.clubInfo.role or player.role == self.clubInfo.role then self.curPage = 1 self.totolPage = 1 local mListView = self.tag == ClubDefine.PlayListType.MATCH_MEMBER and self.ui.Items.ScrollView_Member or self.ui.Items.ScrollView_Record local className = self.tag == ClubDefine.PlayListType.MATCH_MEMBER and "luaScript.Views.Club.ClubPlayerMatchItem" or "luaScript.Views.Club.ClubPlayerMatchRecordItem" mListView:getInnerContainer():setAutoSize(true) mListView:removeAllChildren() local newPlayerList = {} for k,playerInfo in pairsByKeys(self.clubInfo.players) do --id查找 local findIdEnd = string.find(playerInfo.uid, tostring(player.uid)); if findIdEnd then local playerItem = import(className):new(playerInfo,self.clubInfo.clubId,1,self.dayTag,self.tag,function () self:removeFromParent() end) mListView:addChild(playerItem.ui); end table.insert(newPlayerList,playerInfo) end self.lastSortPlayer = newPlayerList mListView:jumpToTopOnSizeChanged() if self.tag == ClubDefine.PlayListType.MATCH_MEMBER then self.ui.Items.Text_Cur_page:setString(self.curPage) self.ui.Items.Text_Total_page:setString("/"..self.totolPage) else self.ui.Items.Text_Cur_page_3:setString(self.curPage) self.ui.Items.Text_Total_page_3:setString("/"..self.totolPage) end else if self.tag == ClubDefine.PlayListType.MATCH_MEMBER then local view = import("luaScript.Views.Club.ClubPlayerMatchHeHuoRen"):new(self.clubId, parentPlayer,lastOpId,player) view:setAnchorPoint(cc.p(0.5, 0.5)) app:showWaitDialog(view) else local view = import("luaScript.Views.Club.ClubPlayerMatchHeHuoRenRecord"):new(self.clubId, parentPlayer,lastOpId,player) view:setAnchorPoint(cc.p(0.5, 0.5)) app:showWaitDialog(view) end self:removeFromParent() end else showConfirmDialog("输入的ID错误或权限不足,请重新输入!") end end end function ClubPlayerMatch:onClickMatchTypeTag(tag) if self.touchIdx > 1 then --playBtnTagEffect() end self.ui.Items.Image_SelectBg:setVisible(false) self.touchIdx = self.touchIdx + 1 self.tag = tag self.ui.Items.TextField_search:setText(""); if self.tag == ClubDefine.PlayListType.MATCH_MEMBER then self.ui.Items.Layout_MathMember:setVisible(true) self.ui.Items.Layout_MatchRecord:setVisible(false) else self.ui.Items.Layout_MatchRecord:setVisible(true) self.ui.Items.Layout_MathMember:setVisible(false) end if self.searchData and not self.searchData.isIgnore then self.ui.Items.TextField_search:setText(tostring(self.searchData.uid)) self:onUpdatePlayerListEvent({type = self.tag}) else self.searchData = nil if self.tag == ClubDefine.PlayListType.MATCH_MEMBER then if self.clubInfo then local playerJson = { clubId = self.clubInfo.clubId, viewType = ClubDefine.PlayListType.MATCH_MEMBER, status = tag, } app.club_php:requestPlayerList(playerJson) end else if self.clubInfo then local playerJson = { clubId = self.clubInfo.clubId, viewType = ClubDefine.PlayListType.MATCH_RECORD, status = tag, day = self.dayTag, } app.club_php:requestPlayerList(playerJson) end end end end --当前选中的人禁止同桌列表显示 function ClubPlayerMatch:onPlayerBanList(event) local view = import("luaScript.Views.Club.ClubPlayerBanList"):new(self.clubInfo.clubId,event.uid,event.banList) view:setAnchorPoint(cc.p(0.5, 0.5)) app:showWaitDialog(view, 180, false) end function ClubPlayerMatch:onReuqestPlayerList() --请求茶馆成员列表 local playerJson = { clubId = self.clubInfo.clubId, viewType = ClubDefine.PlayListType.MATCH_MEMBER, status = ClubDefine.PlayListType.MATCH_MEMBER, } --self.clubInfo.playersMatch = {} app.club_php:requestPlayerList(playerJson); end --当前选中的人禁止同桌列表显示 function ClubPlayerMatch:onPlayerBanList(event) if event and event.viewType == ClubDefine.PlayListType.MATCH_MEMBER then local view = import("luaScript.Views.Club.ClubPlayerBanList"):new(self.clubInfo.clubId,event.uid,event.banList) view:setAnchorPoint(cc.p(0.5, 0.5)) app:showWaitDialog(view, 180, false) end end function ClubPlayerMatch:onGetClubForbidListSuccess(event) local view = import("luaScript.Views.Club.ClubForbidSameTableList"):new(event.playerID,self.clubInfo.clubId) view:setAnchorPoint(cc.p(0.5, 0.5)) app:showWaitDialog(view, 180, false); end function ClubPlayerMatch:onSetCopartnerFail(event) local content = event.content local view = import("luaScript.Views.Club.Match.ClubMatchSetCopartnerFail"):new(content) view:setAnchorPoint(cc.p(0.5, 0.5)) app:showWaitDialog(view, 180, false); end return ClubPlayerMatch