Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
096a9edc
Commit
096a9edc
authored
Apr 16, 2024
by
Steven杜宇
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 消息
parent
33db172a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
112 additions
and
10 deletions
+112
-10
YHInformationFillVC.swift
...y/Classes/Modules/Message(消息)/C/YHInformationFillVC.swift
+23
-1
YHMsgViewController.swift
...y/Classes/Modules/Message(消息)/C/YHMsgViewController.swift
+7
-3
YHMsgListModel.swift
...galaxy/Classes/Modules/Message(消息)/M/YHMsgListModel.swift
+27
-1
YHMessageSessionCell.swift
.../Classes/Modules/Message(消息)/V/YHMessageSessionCell.swift
+17
-5
YHMsgViewModel.swift
...alaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
+36
-0
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+2
-0
No files found.
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHInformationFillVC.swift
View file @
096a9edc
...
...
@@ -10,7 +10,12 @@ import UIKit
class
YHInformationFillVC
:
YHBaseViewController
{
var
msgArr
:[
String
]
=
[
""
,
""
,
""
,
""
]
var
msgArr
:[
YHDetailMessageModel
]
=
[]
lazy
var
viewModel
=
{
let
model
=
YHMsgViewModel
()
return
model
}()
lazy
var
navBar
:
YHCustomNavigationBar
=
{
let
bar
=
YHCustomNavigationBar
.
navBar
()
...
...
@@ -51,6 +56,11 @@ class YHInformationFillVC: YHBaseViewController {
setupUI
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
getMsgList
()
}
func
setupUI
()
{
gk_navigationBar
.
isHidden
=
true
...
...
@@ -68,6 +78,18 @@ class YHInformationFillVC: YHBaseViewController {
make
.
bottom
.
equalToSuperview
()
}
}
func
getMsgList
()
{
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
self
.
viewModel
.
getMsgDetailList
{
[
weak
self
]
success
,
error
in
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
msgArr
.
removeAll
()
msgArr
.
append
(
contentsOf
:
self
.
viewModel
.
msgDetailList
)
self
.
tableView
.
reloadData
()
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHMsgViewController.swift
View file @
096a9edc
...
...
@@ -47,7 +47,8 @@ class YHMsgViewController: YHBaseViewController {
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
YHCommonAlertView
.
show
(
"清除未读"
,
"确定要清除所有未读提示吗?"
,
"取消"
,
"确认"
)
{
let
vc
=
YHInformationFillVC
()
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
return
bar
...
...
@@ -117,18 +118,22 @@ class YHMsgViewController: YHBaseViewController {
msgArr
.
removeAll
()
// 资料填写
if
let
infoMsg
=
msgList
.
information
{
infoMsg
.
customType
=
.
infoFill
msgArr
.
append
(
infoMsg
)
}
// 证件上传
if
let
cerMsg
=
msgList
.
certificate
{
cerMsg
.
customType
=
.
cerUpload
msgArr
.
append
(
cerMsg
)
}
// 文书定稿
if
let
dratMsg
=
msgList
.
draft
{
dratMsg
.
customType
=
.
draft
msgArr
.
append
(
dratMsg
)
}
// 文件签字
if
let
signMsg
=
msgList
.
signature
{
signMsg
.
customType
=
.
fileSign
msgArr
.
append
(
signMsg
)
}
self
.
tableView
.
reloadData
()
...
...
@@ -170,7 +175,7 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
vc
=
YHInformationFillVC
()
let
vc
=
YHInformationFillVC
()
self
.
navigationController
?
.
pushViewController
(
vc
)
}
...
...
@@ -219,5 +224,4 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
}
return
view
}
}
galaxy/galaxy/Classes/Modules/Message(消息)/M/YHMsgListModel.swift
View file @
096a9edc
...
...
@@ -9,11 +9,25 @@
import
UIKit
import
SmartCodable
struct
YHMessageInfoModel
:
Codable
{
enum
YHMessageType
:
Int
{
case
none
=
0
case
infoFill
=
1
// 资料填写
case
cerUpload
=
2
// 证件上传
case
draft
=
3
// 文书定稿
case
fileSign
=
4
// 文件签字
}
class
YHMessageInfoModel
:
SmartCodable
{
var
unreadCount
:
Int
=
0
var
lastMessage
:
String
=
""
var
lastMessageTime
:
Int
=
0
var
type
:
Int
=
0
var
customType
:
YHMessageType
=
.
none
required
init
()
{
}
enum
CodingKeys
:
String
,
CodingKey
{
case
unreadCount
=
"unread_count"
...
...
@@ -33,3 +47,15 @@ class YHMsgListModel: SmartCodable {
}
}
class
YHDetailMessageModel
:
SmartCodable
{
var
id
:
String
=
""
var
title
:
String
=
""
var
content
:
String
=
""
var
time
:
Int
=
0
var
isRead
:
Bool
=
false
required
init
()
{
}
}
galaxy/galaxy/Classes/Modules/Message(消息)/V/YHMessageSessionCell.swift
View file @
096a9edc
...
...
@@ -31,6 +31,23 @@ class YHMessageSessionCell: UITableViewCell {
}
func
updateModel
(
_
model
:
YHMessageInfoModel
)
{
if
model
.
customType
==
.
infoFill
{
self
.
nameLabel
.
text
=
"资料填写"
}
else
if
model
.
customType
==
.
cerUpload
{
self
.
nameLabel
.
text
=
"证件上传"
}
else
if
model
.
customType
==
.
draft
{
self
.
nameLabel
.
text
=
"文书定稿"
}
else
if
model
.
customType
==
.
fileSign
{
self
.
nameLabel
.
text
=
"文件签字"
}
else
{
self
.
nameLabel
.
text
=
""
}
self
.
badgeLabel
.
text
=
(
model
.
unreadCount
<
100
?
String
(
model
.
unreadCount
)
:
"99+"
)
self
.
detailLabel
.
text
=
model
.
lastMessage
self
.
timeLabel
.
text
=
formatTimestamp
(
Double
(
model
.
lastMessageTime
))
...
...
@@ -107,11 +124,6 @@ class YHMessageSessionCell: UITableViewCell {
bottomLineView
=
UIView
()
bottomLineView
.
backgroundColor
=
UIColor
(
hex
:
0xF0F3F7
)
contentView
.
addSubview
(
bottomLineView
)
badgeLabel
.
text
=
"5"
nameLabel
.
text
=
"资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写"
detailLabel
.
text
=
"尊敬的用户,您好~很高兴通知您进行资料填写列尊敬的用户,您好~很高兴通知您进行资料填写列尊敬的用户,您好~很高兴通知您进行资料填写列"
timeLabel
.
text
=
"2024-01-01"
iconContentView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
20
)
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
View file @
096a9edc
...
...
@@ -7,10 +7,12 @@
//
import
UIKit
import
SmartCodable
class
YHMsgViewModel
:
NSObject
{
var
msgList
:
YHMsgListModel
?
var
msgDetailList
:
[
YHDetailMessageModel
]
=
[]
func
getUnreadMsgList
(
_
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
...
...
@@ -40,4 +42,38 @@ class YHMsgViewModel: NSObject {
callBackBlock
(
false
,
error
)
}
}
func
getMsgDetailList
(
_
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Message
.
msgDetaiList
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
json
,
code
in
let
dic
=
json
.
data
printLog
(
"model 是 ==>
\(
json
)
"
)
if
json
.
code
==
200
{
guard
let
arr
=
[
YHDetailMessageModel
]
.
deserialize
(
array
:
dic
as?
[
Any
])
else
{
let
error
=
YHErrorModel
(
errorCode
:
YHErrorCode
.
dictParseError
.
rawValue
,
errorMsg
:
YHErrorCode
.
dictParseError
.
description
())
self
.
msgDetailList
=
[]
callBackBlock
(
false
,
error
)
return
}
self
.
msgDetailList
.
removeAll
()
for
item
in
arr
{
if
let
item
=
item
{
self
.
msgDetailList
.
append
(
item
)
}
}
callBackBlock
(
true
,
nil
)
}
else
{
self
.
msgDetailList
=
[]
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
error
in
self
.
msgDetailList
=
[]
callBackBlock
(
false
,
error
)
}
}
}
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
096a9edc
...
...
@@ -259,5 +259,7 @@ class YHAllApiName {
struct
Message
{
// 获取未读消息列表
static
let
unreadMsgList
=
"infoflow/unread-message"
// 具体业务消息列表
static
let
msgDetaiList
=
"infoflow/message/list"
}
}
pete谢兆麟
@pete
mentioned in commit
988d0309
·
Apr 16, 2024
mentioned in commit
988d0309
mentioned in commit 988d030966c13f511ac181028e22b1eef76958d1
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment