This commit is contained in:
2020-08-03 23:05:29 +08:00
parent f3ecc018ff
commit 9e8c6f080f
64 changed files with 325 additions and 261 deletions

View File

@@ -97,7 +97,7 @@ function TRPLogin:setEventDelegate()
formData,
function(content, orgs)
if content.success then
MyUtl.setIsHidePhone(content.result.cover_phoneNo_flag)
-- MyUtl.setIsHidePhone(content.result.cover_phoneNo_flag)
Prefs.setUserName(formData.phone)
Prefs.setUserPsd(formData.password)
@@ -115,8 +115,32 @@ function TRPLogin:setEventDelegate()
getPanelAsy("PanelSelectCompany", onLoadedPanel, d)
end
else
MyUtl.setIsHidePhone(currGroup.cover_phoneNo_flag)
getPanelAsy("PanelConnect", onLoadedPanel)
local useOldCurrGroup = false
currGroup = json.decode(currGroup)
for i, v in ipairs(content.result) do
if v.company_id == currGroup.company_id then
Prefs.setCurrGroup(Prefs.getUserName(), json.encode(v))
currGroup = v
useOldCurrGroup = true
break
end
end
if useOldCurrGroup then
MyUtl.setIsHidePhone(currGroup.cover_phoneNo_flag)
getPanelAsy("PanelConnect", onLoadedPanel)
else
if #(content.result) == 1 then
Prefs.setCurrGroup(Prefs.getUserName(), json.encode(content.result[1]))
MyUtl.setIsHidePhone(content.result[1].cover_phoneNo_flag)
getPanelAsy("PanelConnect", onLoadedPanel)
else
---@type _ParamTRPSelectGroup
local d = {}
d.isHideCloseBtn = true
d.companyList = content.result
getPanelAsy("PanelSelectCompany", onLoadedPanel, d)
end
end
end
end
end,