This commit is contained in:
2020-08-01 17:55:18 +08:00
parent 29a8a1dae3
commit 4435098171
160 changed files with 21247 additions and 2405 deletions

View File

@@ -6,7 +6,7 @@ local transform = nil
CSPMine.sizeAdjust = 1
CSPMine.contentRect = Vector4.zero
local objs = {}
local headData = {}
local mdata = {}
-- 初始化,只会调用一次
function CSPMine.init(csObj)
@@ -29,30 +29,31 @@ 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
-- 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为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
function CSPMine.show()
mdata = DBUser.getMyInfor()
CSPMine.setHeadInfor()
objs.scrollView:ResetPosition()
end
function CSPMine.setHeadInfor()
objs.Top:setValue(headData)
objs.Top:setValue(mdata)
DBUser.getIcon(
headData.loginNo,
mdata.loginNo,
function(content)
objs.HeadIcon.mainTexture = content
end
@@ -69,6 +70,11 @@ end
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
function CSPMine.procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.personal_data_query then
CSPMine.show()
end
end
end
-- 处理ui上的事件,例如点击等