75 lines
1.9 KiB
Lua
75 lines
1.9 KiB
Lua
|
|
--设置窗口对象
|
||
|
|
|
||
|
|
local LobbyAuthenticateView = {}
|
||
|
|
|
||
|
|
local M = LobbyAuthenticateView
|
||
|
|
setmetatable(M, {__index = BaseWindow})
|
||
|
|
|
||
|
|
function LobbyAuthenticateView.new()
|
||
|
|
local self = setmetatable({}, {__index = M})
|
||
|
|
self.class = 'AuthenticateView'
|
||
|
|
self._close_destroy = true
|
||
|
|
--假效果
|
||
|
|
self.authenticate = 0
|
||
|
|
self.authenticateName = ""
|
||
|
|
self.authenticateId = ""
|
||
|
|
self:init('ui://Lobby/Authentication')
|
||
|
|
return self
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:init(url)
|
||
|
|
BaseWindow.init(self, url)
|
||
|
|
|
||
|
|
local view = self._view
|
||
|
|
|
||
|
|
local input_name = view:GetChild('input_name');
|
||
|
|
input_name.onChanged:Set(function()
|
||
|
|
input_name.alpha = 1
|
||
|
|
end)
|
||
|
|
input_name.onFocusOut:Set(function()
|
||
|
|
if #input_name.text > 0 then
|
||
|
|
input_name.alpha = 1
|
||
|
|
else
|
||
|
|
input_name.alpha = 0.5
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
|
||
|
|
local input_idInfo = view:GetChild('input_idInfo');
|
||
|
|
input_idInfo.onChanged:Set(function()
|
||
|
|
input_idInfo.alpha = 1
|
||
|
|
end)
|
||
|
|
input_idInfo.onFocusOut:Set(function()
|
||
|
|
if #input_idInfo.text > 0 then
|
||
|
|
input_idInfo.alpha = 1
|
||
|
|
else
|
||
|
|
input_idInfo.alpha = 0.5
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
|
||
|
|
local btn_send = view:GetChild('btn_send')
|
||
|
|
btn_send.onClick:Set(function()
|
||
|
|
if false then
|
||
|
|
--发送身份证
|
||
|
|
else
|
||
|
|
--假发送
|
||
|
|
ViewUtil.ShowModalWait(self._root_view,"正在验证身份证...")
|
||
|
|
coroutine.start(function()
|
||
|
|
coroutine.wait(3)
|
||
|
|
ViewUtil.CloseModalWait()
|
||
|
|
self.authenticate = 1
|
||
|
|
self.authenticateName=input_name.text
|
||
|
|
self.authenticateId=input_idInfo.text
|
||
|
|
input_name.grayed = true
|
||
|
|
input_name.touchable=false
|
||
|
|
input_idInfo.grayed = true
|
||
|
|
input_idInfo.touchable=false
|
||
|
|
ViewUtil.ShowBannerOnScreenCenter("验证身份证成功")
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
return M
|