Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa-ios
提交
88f04f6c
o2oa-ios
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa-ios
通知
5
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa-ios
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
88f04f6c
编写于
7月 28, 2023
作者:
F
fancy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
app 首页页面可配置是否显示
上级
40776c63
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
145 addition
and
72 deletion
+145
-72
O2Platform/App/O2MainController.swift
O2Platform/App/O2MainController.swift
+99
-72
O2Platform/Framework/O2API/O2Enum.swift
O2Platform/Framework/O2API/O2Enum.swift
+40
-0
O2Platform/Models/O2AuthenticationModels.swift
O2Platform/Models/O2AuthenticationModels.swift
+6
-0
未找到文件。
O2Platform/App/O2MainController.swift
浏览文件 @
88f04f6c
...
...
@@ -45,7 +45,7 @@ class O2MainController: O2BaseForRotateUITabBarController, UITabBarControllerDel
private
lazy
var
bbsVm
:
BBSViewModel
=
{
return
BBSViewModel
()
}()
private
var
pages
:
[
MainPageType
]
=
[]
private
let
barIm
=
L10n
.
mainBarIm
private
let
barContact
=
L10n
.
mainBarContacts
private
let
barApps
=
L10n
.
mainBarApps
...
...
@@ -69,20 +69,105 @@ class O2MainController: O2BaseForRotateUITabBarController, UITabBarControllerDel
DDLogDebug
(
"进入简易模式!!!!!!!"
)
isSimple
=
true
}
if
isSimple
{
_initSimpleControllers
()
selectedIndex
=
0
currentIndex
=
0
}
else
{
_initControllers
()
selectedIndex
=
2
currentIndex
=
2
self
.
pages
.
removeAll
()
if
let
pageSet
=
O2AuthSDK
.
shared
.
customStyle
()?
.
appIndexPages
,
!
pageSet
.
isEmpty
{
pageSet
.
forEach
{
p
in
if
(
p
==
MainPageType
.
home
.
getKey
())
{
self
.
pages
.
append
(
MainPageType
.
home
)
}
if
(
p
==
MainPageType
.
im
.
getKey
())
{
self
.
pages
.
append
(
MainPageType
.
im
)
}
if
(
p
==
MainPageType
.
contact
.
getKey
())
{
self
.
pages
.
append
(
MainPageType
.
contact
)
}
if
(
p
==
MainPageType
.
app
.
getKey
())
{
self
.
pages
.
append
(
MainPageType
.
app
)
}
if
(
p
==
MainPageType
.
settings
.
getKey
())
{
self
.
pages
.
append
(
MainPageType
.
settings
)
}
}
if
!
self
.
pages
.
contains
(
MainPageType
.
home
)
{
self
.
pages
.
append
(
MainPageType
.
home
)
}
if
!
self
.
pages
.
contains
(
MainPageType
.
settings
)
{
self
.
pages
.
append
(
MainPageType
.
settings
)
}
}
else
{
if
isSimple
{
self
.
pages
.
append
(
MainPageType
.
home
)
self
.
pages
.
append
(
MainPageType
.
settings
)
}
else
{
self
.
pages
.
append
(
MainPageType
.
home
)
self
.
pages
.
append
(
MainPageType
.
im
)
self
.
pages
.
append
(
MainPageType
.
contact
)
self
.
pages
.
append
(
MainPageType
.
app
)
self
.
pages
.
append
(
MainPageType
.
settings
)
}
}
self
.
pages
.
sort
{
a
,
b
in
return
a
.
getOrder
()
<
b
.
getOrder
()
}
var
controllers
:
[
UIViewController
]
=
[]
for
p
in
self
.
pages
{
if
p
==
MainPageType
.
home
{
// main
let
mainVC
=
mainController
()
mainVC
.
tabBarItem
=
UITabBarItem
(
title
:
nil
,
image
:
UIImage
(
named
:
"icon_zhuye_nor"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.icon_zhuye_pre"
))
mainVC
.
tabBarItem
.
imageInsets
=
UIEdgeInsets
(
top
:
6
,
left
:
0
,
bottom
:
-
6
,
right
:
0
)
let
blurImage
=
OOCustomImageManager
.
default
.
loadImage
(
.
index_bottom_menu_logo_blur
)
let
newBlurImage
=
blurImage
?
.
withRenderingMode
(
.
alwaysOriginal
)
mainVC
.
tabBarItem
.
image
=
newBlurImage
let
focusImage
=
OOCustomImageManager
.
default
.
loadImage
(
.
index_bottom_menu_logo_focus
)
let
newFocusImage
=
focusImage
?
.
withRenderingMode
(
.
alwaysOriginal
)
mainVC
.
tabBarItem
.
selectedImage
=
newFocusImage
controllers
.
append
(
mainVC
)
}
if
p
==
MainPageType
.
im
{
//消息
let
conversationVC
=
IMConversationListViewController
()
conversationVC
.
title
=
barIm
let
messages
=
ZLNavigationController
(
rootViewController
:
conversationVC
)
messages
.
tabBarItem
=
UITabBarItem
(
title
:
barIm
,
image
:
UIImage
(
named
:
"icon_news_nor"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.icon_news_pre"
))
controllers
.
append
(
messages
)
}
if
p
==
MainPageType
.
contact
{
//通讯录
let
addressVC
=
OOTabBarHelper
.
getVC
(
storyboardName
:
"contacts"
,
vcName
:
nil
)
let
address
=
ZLNavigationController
(
rootViewController
:
addressVC
)
address
.
tabBarItem
=
UITabBarItem
(
title
:
barContact
,
image
:
UIImage
(
named
:
"icon_address_g"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.icon_address_list_pro"
))
controllers
.
append
(
address
)
}
if
p
==
MainPageType
.
app
{
//应用
let
appsVC
=
OOTabBarHelper
.
getVC
(
storyboardName
:
"apps"
,
vcName
:
nil
)
let
apps
=
ZLNavigationController
(
rootViewController
:
appsVC
)
apps
.
tabBarItem
=
UITabBarItem
(
title
:
barApps
,
image
:
UIImage
(
named
:
"icon_yingyong"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.icon_yingyong_pro"
))
controllers
.
append
(
apps
)
}
if
p
==
MainPageType
.
settings
{
//设置
let
settingsVC
=
OOTabBarHelper
.
getVC
(
storyboardName
:
"setting"
,
vcName
:
nil
)
let
settings
=
ZLNavigationController
(
rootViewController
:
settingsVC
)
settings
.
tabBarItem
=
UITabBarItem
(
title
:
barSettings
,
image
:
UIImage
(
named
:
"setting_normal"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.setting_selected"
))
controllers
.
append
(
settings
)
}
}
self
.
viewControllers
=
controllers
var
cIndex
=
0
for
p
in
self
.
pages
{
if
p
==
MainPageType
.
home
{
break
}
cIndex
+=
1
}
selectedIndex
=
cIndex
currentIndex
=
cIndex
// 极光
O2JPushManager
.
shared
.
o2JPushBind
()
// if O2IsConnect2Collect == false {
// //处理内部直连的时候推送的设备绑定
//
// }
//连接websocket
self
.
_startWebsocket
()
//读取消息
...
...
@@ -93,7 +178,6 @@ class O2MainController: O2BaseForRotateUITabBarController, UITabBarControllerDel
self
.
checkCloudFileVersion
()
// 论坛禁言问题
self
.
checkBBSMuteInfo
()
// 极速打卡
self
.
doFastCheckIn
()
}
...
...
@@ -121,64 +205,7 @@ class O2MainController: O2BaseForRotateUITabBarController, UITabBarControllerDel
func
tabBarController
(
_
tabBarController
:
UITabBarController
,
didSelect
viewController
:
UIViewController
)
{
self
.
currentIndex
=
tabBarController
.
selectedIndex
}
/// 普通模式
private
func
_initControllers
()
{
//消息
let
conversationVC
=
IMConversationListViewController
()
conversationVC
.
title
=
barIm
let
messages
=
ZLNavigationController
(
rootViewController
:
conversationVC
)
messages
.
tabBarItem
=
UITabBarItem
(
title
:
barIm
,
image
:
UIImage
(
named
:
"icon_news_nor"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.icon_news_pre"
))
//通讯录
let
addressVC
=
OOTabBarHelper
.
getVC
(
storyboardName
:
"contacts"
,
vcName
:
nil
)
let
address
=
ZLNavigationController
(
rootViewController
:
addressVC
)
address
.
tabBarItem
=
UITabBarItem
(
title
:
barContact
,
image
:
UIImage
(
named
:
"icon_address_g"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.icon_address_list_pro"
))
// main
let
mainVC
=
mainController
()
mainVC
.
tabBarItem
=
UITabBarItem
(
title
:
nil
,
image
:
UIImage
(
named
:
"icon_zhuye_nor"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.icon_zhuye_pre"
))
mainVC
.
tabBarItem
.
imageInsets
=
UIEdgeInsets
(
top
:
6
,
left
:
0
,
bottom
:
-
6
,
right
:
0
)
let
blurImage
=
OOCustomImageManager
.
default
.
loadImage
(
.
index_bottom_menu_logo_blur
)
let
newBlurImage
=
blurImage
?
.
withRenderingMode
(
.
alwaysOriginal
)
mainVC
.
tabBarItem
.
image
=
newBlurImage
let
focusImage
=
OOCustomImageManager
.
default
.
loadImage
(
.
index_bottom_menu_logo_focus
)
let
newFocusImage
=
focusImage
?
.
withRenderingMode
(
.
alwaysOriginal
)
mainVC
.
tabBarItem
.
selectedImage
=
newFocusImage
//应用
let
appsVC
=
OOTabBarHelper
.
getVC
(
storyboardName
:
"apps"
,
vcName
:
nil
)
let
apps
=
ZLNavigationController
(
rootViewController
:
appsVC
)
apps
.
tabBarItem
=
UITabBarItem
(
title
:
barApps
,
image
:
UIImage
(
named
:
"icon_yingyong"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.icon_yingyong_pro"
))
//设置
let
settingsVC
=
OOTabBarHelper
.
getVC
(
storyboardName
:
"setting"
,
vcName
:
nil
)
let
settings
=
ZLNavigationController
(
rootViewController
:
settingsVC
)
settings
.
tabBarItem
=
UITabBarItem
(
title
:
barSettings
,
image
:
UIImage
(
named
:
"setting_normal"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.setting_selected"
))
self
.
viewControllers
=
[
messages
,
address
,
mainVC
,
apps
,
settings
]
}
/// 简版 只有首页和设置
private
func
_initSimpleControllers
()
{
// main
let
mainVC
=
mainController
()
mainVC
.
tabBarItem
=
UITabBarItem
(
title
:
nil
,
image
:
UIImage
(
named
:
"icon_zhuye_nor"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.icon_zhuye_pre"
))
mainVC
.
tabBarItem
.
imageInsets
=
UIEdgeInsets
(
top
:
6
,
left
:
0
,
bottom
:
-
6
,
right
:
0
)
let
blurImage
=
OOCustomImageManager
.
default
.
loadImage
(
.
index_bottom_menu_logo_blur
)
let
newBlurImage
=
blurImage
?
.
withRenderingMode
(
.
alwaysOriginal
)
mainVC
.
tabBarItem
.
image
=
newBlurImage
let
focusImage
=
OOCustomImageManager
.
default
.
loadImage
(
.
index_bottom_menu_logo_focus
)
let
newFocusImage
=
focusImage
?
.
withRenderingMode
(
.
alwaysOriginal
)
mainVC
.
tabBarItem
.
selectedImage
=
newFocusImage
//设置
let
settingsVC
=
OOTabBarHelper
.
getVC
(
storyboardName
:
"setting"
,
vcName
:
nil
)
let
settings
=
ZLNavigationController
(
rootViewController
:
settingsVC
)
settings
.
tabBarItem
=
UITabBarItem
(
title
:
barSettings
,
image
:
UIImage
(
named
:
"setting_normal"
),
selectedImage
:
O2ThemeManager
.
image
(
for
:
"Icon.setting_selected"
))
self
.
viewControllers
=
[
mainVC
,
settings
]
}
private
func
mainController
()
->
UIViewController
{
let
appid
=
O2AuthSDK
.
shared
.
customStyle
()?
.
indexPortal
...
...
O2Platform/Framework/O2API/O2Enum.swift
浏览文件 @
88f04f6c
...
...
@@ -135,3 +135,43 @@ enum O2BindDiscontinue: Error {
case
noUnitCanBindError
case
unknownError
(
String
)
}
/// 首页 的 5个页面
enum
MainPageType
{
case
home
case
im
case
contact
case
app
case
settings
}
extension
MainPageType
{
func
getKey
()
->
String
{
switch
(
self
)
{
case
.
home
:
return
"home"
case
.
im
:
return
"im"
case
.
contact
:
return
"contact"
case
.
app
:
return
"app"
case
.
settings
:
return
"settings"
}
}
func
getOrder
()
->
Int
{
switch
(
self
)
{
case
.
home
:
return
1
case
.
im
:
return
2
case
.
contact
:
return
3
case
.
app
:
return
4
case
.
settings
:
return
5
}
}
}
O2Platform/Models/O2AuthenticationModels.swift
浏览文件 @
88f04f6c
...
...
@@ -942,6 +942,7 @@ public protocol IO2CustomStyleModel: HandyJSON, CustomStringConvertible {
var
nativeAppList
:
[
O2CustomNativeAppModel
]?
{
get
set
}
var
portalList
:
[
O2CustomPortalAppModel
]?
{
get
set
}
var
simpleMode
:
Bool
?
{
get
set
}
/// 简易模式
var
appIndexPages
:
[
String
]?
{
get
set
}
}
open
class
O2CustomStyleModel
:
NSObject
,
DataModel
,
NSCoding
,
IO2CustomStyleModel
{
@objc
open
var
images
:
[
O2CustomImageModel
]?
...
...
@@ -951,6 +952,7 @@ open class O2CustomStyleModel: NSObject, DataModel, NSCoding, IO2CustomStyleMode
@objc
open
var
nativeAppList
:
[
O2CustomNativeAppModel
]?
@objc
open
var
portalList
:
[
O2CustomPortalAppModel
]?
open
var
simpleMode
:
Bool
?
@objc
open
var
appIndexPages
:
[
String
]?
@objc
public
func
encode
(
with
aCoder
:
NSCoder
)
{
if
images
!=
nil
{
...
...
@@ -974,6 +976,9 @@ open class O2CustomStyleModel: NSObject, DataModel, NSCoding, IO2CustomStyleMode
if
simpleMode
!=
nil
{
aCoder
.
encode
(
simpleMode
,
forKey
:
"simpleMode"
)
}
if
appIndexPages
!=
nil
{
aCoder
.
encode
(
appIndexPages
,
forKey
:
"appIndexPages"
)
}
}
@objc
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
...
...
@@ -984,6 +989,7 @@ open class O2CustomStyleModel: NSObject, DataModel, NSCoding, IO2CustomStyleMode
nativeAppList
=
aDecoder
.
decodeObject
(
forKey
:
"nativeAppList"
)
as?
[
O2CustomNativeAppModel
]
portalList
=
aDecoder
.
decodeObject
(
forKey
:
"portalList"
)
as?
[
O2CustomPortalAppModel
]
simpleMode
=
aDecoder
.
decodeObject
(
forKey
:
"simpleMode"
)
as?
Bool
appIndexPages
=
aDecoder
.
decodeObject
(
forKey
:
"appIndexPages"
)
as?
[
String
]
}
required
public
override
init
()
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录