This commit is contained in:
2020-07-11 17:07:30 +08:00
parent e84465cd64
commit d587401a58
56 changed files with 6913 additions and 5316 deletions

View File

@@ -6,6 +6,7 @@ local transform = nil
CSPMine.sizeAdjust = 1
CSPMine.contentRect = Vector4.zero
local objs = {}
local headData = {}
-- 初始化,只会调用一次
function CSPMine.init(csObj)
@@ -14,9 +15,12 @@ function CSPMine.init(csObj)
CSPMine.contentRect = MyUtl.getUIContent(csSelf, nil, nil, true)
objs.Content = getCC(transform, "PanelContent", "UIPanel")
objs.Content.transform.localPosition = Vector3.zero
objs.Content.clipOffset = Vector2.zero
objs.Content.baseClipRegion = CSPMine.contentRect
MyUtl.setContentView(objs.Content, 147 + 370)
---@type CLUIFormRoot
objs.Top = getCC(transform, "Top", "CLUIFormRoot")
---@type UITexture
objs.HeadIcon = getCC(objs.Top.transform, "SpriteHeadBg/SpriteHeadIcon", "UITexture")
---@type UIScrollView
objs.scrollView = objs.Content:GetComponent("UIScrollView")
@@ -24,14 +28,35 @@ end
-- 设置数据
function CSPMine.setData(paras)
-- 初始化顶部数据
local currGroup = Prefs.getCurrGroup(Prefs.getUserName())
local companyInfro = json.decode(currGroup)
local user = DBUser.getUserById(companyInfro.login_no)
headData.company_id = companyInfro.company_id
headData.company_name = companyInfro.company_name
if user then
headData.loginNo = user.loginNo
headData.loginName = user.loginName
headData.imageUrl = user.imageUrl
else
printe("账号信息未取得!")
end
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function CSPMine.show()
CSPMine.setHeadInfor()
objs.scrollView:ResetPosition()
end
function CSPMine.onClickBottonBtn(cell)
function CSPMine.setHeadInfor()
objs.Top:setValue(headData)
DBUser.getIcon(
headData.loginNo,
function(content)
objs.HeadIcon.mainTexture = content
end
)
end
-- 刷新
@@ -44,37 +69,17 @@ end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function CSPMine.procNetwork(cmd, succ, msg, paras)
--[[
if(succ == 1) then
if(cmd == "xxx") then
-- TODO:
end
end
--]]
end
-- 处理ui上的事件例如点击等
function CSPMine.uiEventDelegate(go)
local goName = go.name
if (goName == "Button01") then
--[[
if isNilOrEmpty(__uid__) then
getPanelAsy("PanelLogin", onLoadedPanelTT, {function (uid)
if uid then
getPanelAsy("PanelPasswordSave", onLoadedPanelTT)
end
end}
)
else
-- 密码保护
getPanelAsy("PanelPasswordSave", onLoadedPanelTT)
end
--]]
getPanelAsy("PanelPasswordSave", onLoadedPanelTT)
elseif goName == "ButtonQR" then
if goName == "ButtonMyCheck" then
showHotWheel()
-- CSPMine.onGetLocation(json.encode({code = 0, latitude = "116.404", longitude = "39.915"}))
MyLocation.self:getMyLocation(CSPMine.onGetLocation)
elseif goName == "ButtonSetting" or goName == "ButtonMySetting" then
getPanelAsy("PanelSetting", onLoadedPanelTT)
end
end