Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa-ios
提交
f8dbb6f1
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 搜索 >>
提交
f8dbb6f1
编写于
7月 24, 2023
作者:
F
fancy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
门户角标
app 消息在外部打开
上级
fc2cee95
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
101 addition
and
28 deletion
+101
-28
O2Platform/App/Applications/m/O2PortalInfo.swift
O2Platform/App/Applications/m/O2PortalInfo.swift
+7
-0
O2Platform/App/Applications/v/O2CollectionViewCell.swift
O2Platform/App/Applications/v/O2CollectionViewCell.swift
+26
-0
O2Platform/App/IM-聊天/IMChatViewController.swift
O2Platform/App/IM-聊天/IMChatViewController.swift
+1
-1
O2Platform/App/IM-聊天/IMInstantMessageViewController.swift
O2Platform/App/IM-聊天/IMInstantMessageViewController.swift
+27
-19
O2Platform/App/IM-聊天/Model/IMConversationInfo.swift
O2Platform/App/IM-聊天/Model/IMConversationInfo.swift
+3
-1
O2Platform/App/IM-聊天/View/IMChatMessageViewCell.swift
O2Platform/App/IM-聊天/View/IMChatMessageViewCell.swift
+5
-5
O2Platform/App/Work-工作/v/NewMainAppCollectionViewCell.swift
O2Platform/App/Work-工作/v/NewMainAppCollectionViewCell.swift
+27
-0
O2Platform/Framework/O2API/PortalAPI/PortalAPI.swift
O2Platform/Framework/O2API/PortalAPI/PortalAPI.swift
+5
-2
未找到文件。
O2Platform/App/Applications/m/O2PortalInfo.swift
浏览文件 @
f8dbb6f1
...
...
@@ -30,3 +30,10 @@ class O2PortalInfo:NSObject, DataModel {
mapper
<<<
self
.
desc
<--
"description"
}
}
class
O2PortalCornerMarkNumber
:
NSObject
,
DataModel
{
var
count
:
Int
?
required
override
init
(){}
}
O2Platform/App/Applications/v/O2CollectionViewCell.swift
浏览文件 @
f8dbb6f1
...
...
@@ -11,6 +11,7 @@ import CocoaLumberjack
import
Alamofire
import
AlamofireObjectMapper
import
ObjectMapper
import
Promises
class
O2CollectionViewCell
:
UICollectionViewCell
{
...
...
@@ -30,6 +31,9 @@ class O2CollectionViewCell: UICollectionViewCell {
private
var
nowData
:
O2App
?
private
let
portalAPI
=
OOMoyaProvider
<
PortalAPI
>
()
override
func
prepareForReuse
()
{
super
.
prepareForReuse
()
self
.
appIconImageView
.
image
=
nil
...
...
@@ -68,6 +72,14 @@ class O2CollectionViewCell: UICollectionViewCell {
}
}
self
.
loadPortalCornerMarkNumber
(
portalId
:
app
.
appId
!
)
.
then
{
number
in
if
number
>
0
{
self
.
numberLabel
.
text
=
"
\(
number
)
"
self
.
numberLabel
.
isHidden
=
false
}
}
.
catch
{
err
in
DDLogError
(
"
\(
err
.
localizedDescription
)
"
)
}
}
else
{
self
.
appIconImageView
.
image
=
UIImage
(
named
:
app
.
normalIcon
!
)
self
.
appIconImageView
.
highlightedImage
=
UIImage
(
named
:
app
.
selectedIcon
!
)
...
...
@@ -123,5 +135,19 @@ class O2CollectionViewCell: UICollectionViewCell {
}
private
func
loadPortalCornerMarkNumber
(
portalId
:
String
)
->
Promise
<
Int
>
{
return
Promise
{
fulfill
,
reject
in
self
.
portalAPI
.
request
(
.
cornerMark
(
portalId
))
{
result
in
let
response
=
OOResult
<
BaseModelClass
<
O2PortalCornerMarkNumber
>>
(
result
)
if
response
.
isResultSuccess
()
{
var
number
=
response
.
model
?
.
data
?
.
count
??
0
fulfill
(
number
)
}
else
{
fulfill
(
0
)
}
}
}
}
}
O2Platform/App/IM-聊天/IMChatViewController.swift
浏览文件 @
f8dbb6f1
...
...
@@ -937,7 +937,7 @@ extension IMChatViewController: AudioPlayerManagerDelegate {
// MARK: - 消息点击 delegate
extension
IMChatViewController
:
IMChatMessageDelegate
{
func
openWebview
(
url
:
String
)
{
func
openWebview
(
url
:
String
,
openExternally
:
Bool
?
)
{
//
}
...
...
O2Platform/App/IM-聊天/IMInstantMessageViewController.swift
浏览文件 @
f8dbb6f1
...
...
@@ -108,19 +108,7 @@ class IMInstantMessageViewController: UITableViewController {
self
.
hideLoading
()
// 打开在线会议
if
let
link
=
meeting
.
roomLink
,
let
mode
=
meeting
.
mode
,
!
link
.
isEmpty
,
mode
==
"online"
{
guard
let
url
=
URL
(
string
:
link
)
else
{
DDLogError
(
"url地址不正确,
\(
link
)
"
)
return
}
if
#available(iOS 10, *)
{
if
UIApplication
.
shared
.
canOpenURL
(
url
)
{
UIApplication
.
shared
.
open
(
url
,
options
:
[:],
completionHandler
:
nil
)
}
else
{
DDLogError
(
"无法打开url,
\(
link
)
"
)
}
}
else
{
UIApplication
.
shared
.
openURL
(
url
)
}
self
.
openUrlBySafari
(
link
:
link
)
}
else
{
// 打开会议详情
let
storyBoard
=
UIStoryboard
(
name
:
"meeting"
,
bundle
:
nil
)
...
...
@@ -139,15 +127,35 @@ class IMInstantMessageViewController: UITableViewController {
self
.
showError
(
title
:
"
\(
error
.
localizedDescription
)
"
)
}
}
private
func
openUrlBySafari
(
link
:
String
)
{
guard
let
url
=
URL
(
string
:
link
)
else
{
DDLogError
(
"url地址不正确,
\(
link
)
"
)
return
}
if
#available(iOS 10, *)
{
if
UIApplication
.
shared
.
canOpenURL
(
url
)
{
UIApplication
.
shared
.
open
(
url
,
options
:
[:],
completionHandler
:
nil
)
}
else
{
DDLogError
(
"无法打开url,
\(
link
)
"
)
}
}
else
{
UIApplication
.
shared
.
openURL
(
url
)
}
}
}
extension
IMInstantMessageViewController
:
IMChatMessageDelegate
{
func
openWebview
(
url
:
String
)
{
let
destVC
=
OOTabBarHelper
.
getVC
(
storyboardName
:
"apps"
,
vcName
:
"OOMainWebVC"
)
if
let
mail
=
destVC
as?
MailViewController
{
mail
.
openUrl
=
url
let
nav
=
ZLNavigationController
(
rootViewController
:
mail
)
self
.
present
(
nav
,
animated
:
true
,
completion
:
nil
)
func
openWebview
(
url
:
String
,
openExternally
:
Bool
?)
{
if
let
out
=
openExternally
,
out
==
true
{
self
.
openUrlBySafari
(
link
:
url
)
}
else
{
let
destVC
=
OOTabBarHelper
.
getVC
(
storyboardName
:
"apps"
,
vcName
:
"OOMainWebVC"
)
if
let
mail
=
destVC
as?
MailViewController
{
mail
.
openUrl
=
url
let
nav
=
ZLNavigationController
(
rootViewController
:
mail
)
self
.
present
(
nav
,
animated
:
true
,
completion
:
nil
)
}
}
}
...
...
O2Platform/App/IM-聊天/Model/IMConversationInfo.swift
浏览文件 @
f8dbb6f1
...
...
@@ -193,7 +193,8 @@ class InstantMessage: NSObject, DataModel {
// 自定义消息
class
CustomO2AppTextMsg
:
NSObject
,
DataModel
{
@objc
var
content
:
String
?
@objc
var
url
:
String
?
@objc
var
url
:
String
?
var
openExternally
:
Bool
?
required
override
init
()
{
}
}
class
CustomO2AppImageMsg
:
NSObject
,
DataModel
{
...
...
@@ -204,6 +205,7 @@ class CustomO2AppCardMsg: NSObject, DataModel {
@objc
var
title
:
String
?
@objc
var
desc
:
String
?
@objc
var
url
:
String
?
var
openExternally
:
Bool
?
required
override
init
()
{
}
}
enum
CustomO2AppMsgType
{
...
...
O2Platform/App/IM-聊天/View/IMChatMessageViewCell.swift
浏览文件 @
f8dbb6f1
...
...
@@ -15,7 +15,7 @@ protocol IMChatMessageDelegate {
func
openLocatinMap
(
info
:
IMMessageBodyInfo
)
func
openApplication
(
storyboard
:
String
,
msgBody
:
String
?)
func
openWork
(
workId
:
String
)
func
openWebview
(
url
:
String
)
func
openWebview
(
url
:
String
,
openExternally
:
Bool
?
)
func
openHttpImage
(
imageUrl
:
String
)
func
openPersonInfo
(
person
:
String
)
}
...
...
@@ -101,7 +101,7 @@ class IMChatMessageViewCell: UITableViewCell {
isRender
=
true
if
let
url
=
text
.
url
,
url
.
isUrl
()
{
setcc
(
label
:
msgLabel
)
{
tap
in
self
.
delegate
?
.
openWebview
(
url
:
url
)
self
.
delegate
?
.
openWebview
(
url
:
url
,
openExternally
:
text
.
openExternally
)
}
}
}
...
...
@@ -115,7 +115,7 @@ class IMChatMessageViewCell: UITableViewCell {
}
if
appMsg
.
msgType
()
==
CustomO2AppMsgType
.
textcard
{
if
let
textcard
=
appMsg
.
textcard
,
let
title
=
textcard
.
title
,
let
url
=
textcard
.
url
{
self
.
textCardMsgRender
(
title
:
title
,
desc
:
textcard
.
desc
??
title
,
url
:
url
)
self
.
textCardMsgRender
(
title
:
title
,
desc
:
textcard
.
desc
??
title
,
url
:
url
,
openExternally
:
textcard
.
openExternally
??
false
)
isRender
=
true
}
}
...
...
@@ -344,7 +344,7 @@ class IMChatMessageViewCell: UITableViewCell {
}
// 卡片消息
private
func
textCardMsgRender
(
title
:
String
,
desc
:
String
,
url
:
String
)
{
private
func
textCardMsgRender
(
title
:
String
,
desc
:
String
,
url
:
String
,
openExternally
:
Bool
)
{
self
.
messageBackgroundWidth
.
constant
=
IMTextCardView
.
IMTextCardView_width
+
20
self
.
messageBackgroundHeight
.
constant
=
IMTextCardView
.
IMTextCardView_height
+
20
self
.
textcardView
.
translatesAutoresizingMaskIntoConstraints
=
false
...
...
@@ -352,7 +352,7 @@ class IMChatMessageViewCell: UITableViewCell {
self
.
textcardView
.
setupTextCard
(
title
:
title
,
desc
:
desc
)
self
.
constraintWithContent
(
contentView
:
self
.
textcardView
)
self
.
textcardView
.
addTapGesture
{
tap
in
self
.
delegate
?
.
openWebview
(
url
:
url
)
self
.
delegate
?
.
openWebview
(
url
:
url
,
openExternally
:
openExternally
)
}
}
...
...
O2Platform/App/Work-工作/v/NewMainAppCollectionViewCell.swift
浏览文件 @
f8dbb6f1
...
...
@@ -11,6 +11,7 @@ import Alamofire
import
AlamofireObjectMapper
import
ObjectMapper
import
CocoaLumberjack
import
Promises
class
NewMainAppCollectionViewCell
:
UICollectionViewCell
{
...
...
@@ -23,6 +24,9 @@ class NewMainAppCollectionViewCell: UICollectionViewCell {
private
var
nowData
:
O2App
?
private
let
portalAPI
=
OOMoyaProvider
<
PortalAPI
>
()
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
...
...
@@ -49,6 +53,14 @@ class NewMainAppCollectionViewCell: UICollectionViewCell {
}
}
self
.
loadPortalCornerMarkNumber
(
portalId
:
app
.
appId
!
)
.
then
{
number
in
if
number
>
0
{
self
.
numberLabel
.
text
=
"
\(
number
)
"
self
.
numberLabel
.
isHidden
=
false
}
}
.
catch
{
err
in
DDLogError
(
"
\(
err
.
localizedDescription
)
"
)
}
}
else
{
self
.
appIconImageView
.
image
=
UIImage
(
named
:
app
.
normalIcon
!
)
}
...
...
@@ -96,4 +108,19 @@ class NewMainAppCollectionViewCell: UICollectionViewCell {
}
}
}
private
func
loadPortalCornerMarkNumber
(
portalId
:
String
)
->
Promise
<
Int
>
{
return
Promise
{
fulfill
,
reject
in
self
.
portalAPI
.
request
(
.
cornerMark
(
portalId
))
{
result
in
let
response
=
OOResult
<
BaseModelClass
<
O2PortalCornerMarkNumber
>>
(
result
)
if
response
.
isResultSuccess
()
{
var
number
=
response
.
model
?
.
data
?
.
count
??
0
fulfill
(
number
)
}
else
{
fulfill
(
0
)
}
}
}
}
}
O2Platform/Framework/O2API/PortalAPI/PortalAPI.swift
浏览文件 @
f8dbb6f1
...
...
@@ -12,6 +12,7 @@ import Moya
enum
PortalAPI
{
case
listMobile
case
cornerMark
(
String
)
}
extension
PortalAPI
:
OOAPIContextCapable
{
...
...
@@ -42,12 +43,14 @@ extension PortalAPI: TargetType {
switch
self
{
case
.
listMobile
:
return
"/jaxrs/portal/list/mobile"
case
.
cornerMark
(
let
portalId
):
return
"/jaxrs/portal/
\(
portalId
)
/corner/mark"
}
}
var
method
:
Moya
.
Method
{
switch
self
{
case
.
listMobile
:
case
.
listMobile
,
.
cornerMark
(
_
)
:
return
.
get
}
}
...
...
@@ -58,7 +61,7 @@ extension PortalAPI: TargetType {
var
task
:
Task
{
switch
self
{
case
.
listMobile
:
case
.
listMobile
,
.
cornerMark
(
_
)
:
return
.
requestPlain
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录