2026-01-04 21:54:26 +08:00
|
|
|
|
---
|
|
|
|
|
|
--- Created by 谌建军.
|
|
|
|
|
|
--- DateTime: 2017/12/19 11:05
|
|
|
|
|
|
---
|
|
|
|
|
|
require("Game.View.ResultView")
|
|
|
|
|
|
|
|
|
|
|
|
local EXResultView = {}
|
|
|
|
|
|
|
|
|
|
|
|
local M = EXResultView
|
|
|
|
|
|
|
2026-01-26 23:15:47 +08:00
|
|
|
|
function EXResultView.new(root, data, over, win_seat)
|
2026-01-04 21:54:26 +08:00
|
|
|
|
setmetatable(M, { __index = ResultView })
|
|
|
|
|
|
local self = setmetatable({}, { __index = M })
|
|
|
|
|
|
|
|
|
|
|
|
self.class = "EXResultView"
|
|
|
|
|
|
self._currenIndex = 0
|
|
|
|
|
|
self._close_zone = false
|
|
|
|
|
|
self._root_runFast = root
|
|
|
|
|
|
self._gamectr = ControllerManager.GetController(GameController)
|
2026-01-26 23:15:47 +08:00
|
|
|
|
self:init("ui://Extend_Poker_SanDaHa/clearing_new", data, over, win_seat)
|
|
|
|
|
|
|
2026-01-04 21:54:26 +08:00
|
|
|
|
return self
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2026-01-26 23:15:47 +08:00
|
|
|
|
function M:init(url, data, over, win_seat)
|
2026-01-04 21:54:26 +08:00
|
|
|
|
ResultView.init(self, url, true)
|
|
|
|
|
|
|
|
|
|
|
|
local room = DataManager.CurrenRoom
|
|
|
|
|
|
self._view:GetController('over').selectedIndex = 0
|
|
|
|
|
|
|
|
|
|
|
|
if over == 2 and room.curren_round <= 0 then
|
|
|
|
|
|
if room._flag_lobby then
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
|
else
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Family)
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
------------------
|
|
|
|
|
|
|
|
|
|
|
|
--只有一人直接退,有两人才进正常结算
|
|
|
|
|
|
if not over and #data == 1 then
|
|
|
|
|
|
if room._flag_lobby then
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
|
else
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Family)
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
self._view:GetChild('btn_nextRound').onClick:Set(function()
|
|
|
|
|
|
if over == 0 then
|
|
|
|
|
|
local _gamectr = ControllerManager.GetController(GameController)
|
|
|
|
|
|
_gamectr:ConformToNextGame()
|
|
|
|
|
|
self:Destroy()
|
|
|
|
|
|
else
|
|
|
|
|
|
self._view:GetController('over').selectedIndex = 1
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
self._view:GetChild('btn_closeRound').onClick:Set(function()
|
|
|
|
|
|
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
|
|
|
|
|
|
|
2026-01-26 23:15:47 +08:00
|
|
|
|
self:FillOver0(data,room)
|
|
|
|
|
|
|
|
|
|
|
|
self:FillOver1(over,room,data)
|
|
|
|
|
|
-- 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:FillOver0(data,room)
|
|
|
|
|
|
--先把庄家拖出来
|
|
|
|
|
|
local bankerInfo = {}
|
|
|
|
|
|
local otherInfo = {}
|
|
|
|
|
|
|
|
|
|
|
|
for i,v in ipairs(data) do
|
|
|
|
|
|
if v.seat == room.banker_seat then
|
|
|
|
|
|
bankerInfo = v
|
|
|
|
|
|
else
|
|
|
|
|
|
table.insert(otherInfo,v)
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2026-01-04 21:54:26 +08:00
|
|
|
|
local over0List = self._view:GetChild('list_over0')
|
2026-01-26 23:15:47 +08:00
|
|
|
|
|
2026-01-04 21:54:26 +08:00
|
|
|
|
over0List.itemRenderer = function(index, obj)
|
|
|
|
|
|
local info = data[index + 1]
|
|
|
|
|
|
local playerInfo = room:GetPlayerBySeat(info.seat)
|
2026-01-26 23:15:47 +08:00
|
|
|
|
obj:GetChild('text_name').text = playerInfo.self_user.nick_name
|
|
|
|
|
|
obj:GetChild('text_score').text = info.winscore
|
|
|
|
|
|
ImageLoad.Load(playerInfo.self_user.head_url,obj:GetChild('btn_head')._iconObject)
|
|
|
|
|
|
obj:GetController('seat').selectedIndex = (room.banker_seat + info.seat)%3
|
2026-01-04 21:54:26 +08:00
|
|
|
|
end
|
2026-01-26 23:15:47 +08:00
|
|
|
|
over0List.numItems = #otherInfo
|
|
|
|
|
|
|
|
|
|
|
|
local playerInfo = room:GetPlayerBySeat(bankerInfo.seat)
|
|
|
|
|
|
ImageLoad.Load(playerInfo.self_user.head_url,self._view:GetChild('icon_zhuangHead')._iconObject)
|
|
|
|
|
|
self._view:GetChild('text_zhuangName').text = playerInfo.self_user.nick_name
|
|
|
|
|
|
self._view:GetChild('text_zhuangScore').text = bankerInfo.winscore
|
|
|
|
|
|
self._view:GetChild('text_jiao').text = room.jiaofen
|
|
|
|
|
|
self._view:GetChild('text_get').text = room.getfen
|
|
|
|
|
|
self._view:GetChild('text_yu').text = room.yufen
|
|
|
|
|
|
end
|
2026-01-04 21:54:26 +08:00
|
|
|
|
|
2026-01-26 23:15:47 +08:00
|
|
|
|
--填充大结算信息
|
|
|
|
|
|
function M:FillOver1(over,room,data)
|
|
|
|
|
|
if over == 1 or (over == 2 and room.curren_round > 0) then
|
2026-01-04 21:54:26 +08:00
|
|
|
|
self._view:GetChild('text_roomID').text = room.room_id
|
|
|
|
|
|
self._view:GetChild('text_time').text = os.date('%m-%d %H:%M', os.time())
|
|
|
|
|
|
for i = 1, #data do
|
|
|
|
|
|
local info = data[i]
|
|
|
|
|
|
local playerInfo = room:GetPlayerBySeat(info.seat)
|
2026-01-26 23:15:47 +08:00
|
|
|
|
self:FillPlayerInfoEnd(self._view:GetChild(string.format("comp_playerInfo%d_over1", i)), info, playerInfo)
|
2026-01-04 21:54:26 +08:00
|
|
|
|
end
|
|
|
|
|
|
coroutine.start(function()
|
|
|
|
|
|
coroutine.wait(2)
|
|
|
|
|
|
self._view:GetController('over').selectedIndex = 1
|
|
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:FillPlayerInfoEnd(view, info, playerInfo, bigWin)
|
2026-01-26 23:15:47 +08:00
|
|
|
|
-- local room = DataManager.CurrenRoom
|
2026-01-04 21:54:26 +08:00
|
|
|
|
|
2026-01-26 23:15:47 +08:00
|
|
|
|
-- self:FillPlayerHead(view:GetChild('comp_playerInfo'), playerInfo, bigWin)
|
2026-01-04 21:54:26 +08:00
|
|
|
|
|
2026-01-26 23:15:47 +08:00
|
|
|
|
-- local detailList = view:GetChild('list_detail')
|
2026-01-04 21:54:26 +08:00
|
|
|
|
|
2026-01-26 23:15:47 +08:00
|
|
|
|
-- self:FillDetailChild(detailList:AddItemFromPool(), 0, info.settle_log.maxscore)
|
|
|
|
|
|
-- self:FillDetailChild(detailList:AddItemFromPool(), 1, info.settle_log.boomnum)
|
|
|
|
|
|
-- self:FillDetailChild(detailList:AddItemFromPool(), 2,
|
|
|
|
|
|
-- string.format("%d赢%d输", info.settle_log.winnum, room.room_config.Times - info.settle_log.winnum))
|
|
|
|
|
|
-- self:FillDetailChild(detailList:AddItemFromPool(), 3, info.total_score)
|
2026-01-04 21:54:26 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:FillPlayerHead(view, playerInfo, bigWin)
|
2026-01-26 23:15:47 +08:00
|
|
|
|
-- ImageLoad.Load(playerInfo.self_user.head_url, view:GetChild('btn_head')._iconObject)
|
|
|
|
|
|
-- view:GetChild('text_name').text = ViewUtil.stringEllipsis(playerInfo.self_user.nick_name)
|
|
|
|
|
|
-- view:GetChild('text|_ID').text = playerInfo.self_user.account_id
|
|
|
|
|
|
-- view:GetController('bigWin').selectedIndex = bigWin and 1 or 0
|
2026-01-04 21:54:26 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:FillDetailChild(view, index, value)
|
2026-01-26 23:15:47 +08:00
|
|
|
|
-- view:GetController('ShowTitle').selectedIndex = index
|
|
|
|
|
|
-- view:GetChild('text_value').text = value
|
2026-01-04 21:54:26 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:SetDestroryCallback(fct)
|
|
|
|
|
|
self._destoryCallback = fct
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:Destroy()
|
|
|
|
|
|
if self._destoryCallback then
|
|
|
|
|
|
self._destoryCallback()
|
|
|
|
|
|
end
|
|
|
|
|
|
getmetatable(M).__index.Destroy(self)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return M
|