Files
tianrunCRM/Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPBindPhone.lua

76 lines
2.4 KiB
Lua
Raw Normal View History

2020-07-24 22:12:55 +08:00
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPBindPhone:TRBasePanel
local TRPBindPhone = class("TRPBindPhone", TRBasePanel)
local uiobjs = {}
-- 初始化,只会调用一次
function TRPBindPhone:init(csObj)
TRPBindPhone.super.init(self, csObj)
uiobjs.content = getChild(self.transform, "PanelContent")
MyUtl.setContentView(uiobjs.content)
---@type UIScrollView
uiobjs.scrollview = getCC(self.transform, "PanelContent", "UIScrollView")
2020-08-03 23:05:29 +08:00
uiobjs.scrollview.dampenStrength = MyUtl.dampenStrength
2020-07-24 22:12:55 +08:00
uiobjs.formRoot = getCC(uiobjs.scrollview.transform, "Table", "CLUIFormRoot")
2020-08-18 17:24:02 +08:00
uiobjs.ButtonAuth = getChild(uiobjs.formRoot.transform, "ButtonAuth").gameObject
2020-07-24 22:12:55 +08:00
self:setEventDelegate()
end
-- 设置数据
---@param paras _ParamTRPBindPhone
function TRPBindPhone:setData(paras)
self.mdata = paras
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPBindPhone:show()
uiobjs.formRoot:setValue(self.mdata)
uiobjs.scrollview:ResetPosition()
end
-- 刷新
function TRPBindPhone:refresh()
2020-08-18 17:24:02 +08:00
local user = DBUser.getMyInfor()
SetActive(uiobjs.ButtonAuth, user.ifPhoAuth ~= "Y" or false)
2020-07-24 22:12:55 +08:00
end
-- 关闭页面
function TRPBindPhone:hide()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPBindPhone:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
--[[
if cmd == xx then
end
]]
end
end
function TRPBindPhone:setEventDelegate()
self.EventDelegate = {
ButtonModify = function()
2020-08-18 17:24:02 +08:00
getPanelAsy("PanelResetPasswordStep1", onLoadedPanelTT, {isBindPhone = true})
end,
ButtonAuth = function()
getPanelAsy("PanelResetPasswordStep1", onLoadedPanelTT, {phone = self.mdata.phoneNo, isAuth = true})
2020-07-24 22:12:55 +08:00
end
}
end
-- 处理ui上的事件例如点击等
function TRPBindPhone:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPBindPhone:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPBindPhone