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

104 lines
2.8 KiB
Lua
Raw Normal View History

2020-08-17 11:13:33 +08:00
-- xx界面
local CLLPSendSms = {}
---@type Coolape.CLPanelLua
local csSelf = nil
---@type UnityEngine.Transform
local transform = nil
local uiobjs = {}
---@type _DBCust
local mdata
-- 初始化,只会调用一次
function CLLPSendSms.init(csObj)
csSelf = csObj
transform = csObj.transform
---@type CLUIFormRoot
uiobjs.offset = getCC(transform, "Bottom/offset", "CLUIFormRoot")
uiobjs.InputContentCell = getCC(uiobjs.offset.transform, "InputContent", "CLCellLua")
local attr = {}
attr.attrName = "短信内容"
attr.id = "body"
attr.attrType = DBCust.FieldType.multext
attr.ifMust = 1
attr.donotJoinKey = true
---@type _ParamCellExtendFiled
local param = {}
param.attr = attr
uiobjs.InputContentCell:init(param, nil)
end
-- 设置数据
function CLLPSendSms.setData(paras)
mdata = paras
end
--当有通用背板显示时的回调
function CLLPSendSms.onShowFrame()
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function CLLPSendSms.show()
uiobjs.offset:setValue({})
end
-- 刷新
function CLLPSendSms.refresh()
end
-- 关闭页面
function CLLPSendSms.hide()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function CLLPSendSms.procNetwork(cmd, succ, msg, paras)
--[[
if(succ == NetSuccess) then
if(cmd == "xxx") then
-- TODO:
end
end
--]]
end
-- 处理ui上的事件例如点击等
function CLLPSendSms.uiEventDelegate(go)
local goName = go.name
2020-08-26 19:56:45 +08:00
if goName == "ButtonClose" or goName == "SpriteBg" then
2020-08-17 11:13:33 +08:00
hideTopPanel(csSelf)
elseif goName == "ButtonYunSend" then
local err = uiobjs.offset:checkValid()
if not isNilOrEmpty(err) then
MyUtl.toastW(err)
return
end
local data = uiobjs.offset:getValue(true)
MyUtl.toastW("//TODO:云发短信的接口")
elseif goName == "ButtonNativeSend" then
local err = uiobjs.offset:checkValid()
if not isNilOrEmpty(err) then
MyUtl.toastW(err)
return
end
local data = uiobjs.offset:getValue(true)
Application.OpenURL(joinStr("sms:", mdata.phoneNo, "?body=", data.body))
end
end
-- 当顶层页面发生变化时回调
function CLLPSendSms.onTopPanelChange(topPanel)
end
-- 当按了返回键时关闭自己返值为true时关闭
function CLLPSendSms.hideSelfOnKeyBack()
if NetProto and csSelf then
NetProto.removePanelListener(csSelf)
end
return true
end
--------------------------------------------
return CLLPSendSms