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
2e2d277d
Commit
2e2d277d
authored
Aug 09, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 原则批
parent
62d6ef60
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
143 additions
and
45 deletions
+143
-45
YHPrincipleUploadListVC.swift
...rvice/PrincipleBatch(原则批)/C/YHPrincipleUploadListVC.swift
+30
-0
YHPrincipleUploadModel.swift
...ervice/PrincipleBatch(原则批)/M/YHPrincipleUploadModel.swift
+1
-1
YHPrincipleUploadFileCell.swift
...ice/PrincipleBatch(原则批)/V/YHPrincipleUploadFileCell.swift
+1
-0
YHPrincipleUploadStatusCell.swift
...e/PrincipleBatch(原则批)/V/YHPrincipleUploadStatusCell.swift
+5
-3
YHPrincleViewModel.swift
...erService/PrincipleBatch(原则批)/VM/YHPrincleViewModel.swift
+106
-41
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/CustomerService/PrincipleBatch(原则批)/C/YHPrincipleUploadListVC.swift
View file @
2e2d277d
...
@@ -298,6 +298,18 @@ extension YHPrincipleUploadListVC {
...
@@ -298,6 +298,18 @@ extension YHPrincipleUploadListVC {
}
}
}
.
show
()
}
.
show
()
}
}
func
showUploadSheetView
(
supplementId
:
Int
,
completion
:(()
->
())?)
{
let
sheetView
=
YHCertificateUploadSheetView
.
sheetView
()
sheetView
.
maxSelectCount
=
9
sheetView
.
uploadImageBlock
=
{
[
weak
self
]
targetImgArr
in
guard
let
self
=
self
else
{
return
}
}
sheetView
.
show
()
}
}
}
extension
YHPrincipleUploadListVC
:
UITableViewDelegate
,
UITableViewDataSource
{
extension
YHPrincipleUploadListVC
:
UITableViewDelegate
,
UITableViewDataSource
{
...
@@ -359,6 +371,24 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
...
@@ -359,6 +371,24 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
self
.
showFileOperationAlertView
(
index
,
itemModel
:
model
)
self
.
showFileOperationAlertView
(
index
,
itemModel
:
model
)
}
}
// 上传文件点击
cell
.
uploadBtnClick
=
{
[
weak
self
]
selectModel
in
guard
let
self
=
self
else
{
return
}
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
guard
let
self
=
self
else
{
return
}
let
item
=
YHSelectImageItem
()
item
.
name
=
"999.png"
item
.
data
=
image
let
arr
=
[
item
]
self
.
viewModel
.
uploadImageArr
(
arr
)
{
resultArr
in
model
.
content_url
.
append
(
contentsOf
:
resultArr
)
self
.
tableView
.
reloadData
()
}
}
}
return
cell
return
cell
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/CustomerService/PrincipleBatch(原则批)/M/YHPrincipleUploadModel.swift
View file @
2e2d277d
...
@@ -62,7 +62,7 @@ class YHPrincipleNameExtraModel: SmartCodable {
...
@@ -62,7 +62,7 @@ class YHPrincipleNameExtraModel: SmartCodable {
class
YHPrincipleContentUrlModel
:
SmartCodable
{
class
YHPrincipleContentUrlModel
:
SmartCodable
{
var
name
:
String
=
""
var
name
:
String
=
""
var
url
:
String
=
""
var
url
:
String
=
""
var
type
:
Int
=
0
var
type
:
Int
=
1
var
fileUrl
:
String
=
""
var
fileUrl
:
String
=
""
var
updated_at
:
String
=
""
var
updated_at
:
String
=
""
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/CustomerService/PrincipleBatch(原则批)/V/YHPrincipleUploadFileCell.swift
View file @
2e2d277d
...
@@ -20,6 +20,7 @@ class YHPrincipleUploadFileCell: UITableViewCell {
...
@@ -20,6 +20,7 @@ class YHPrincipleUploadFileCell: UITableViewCell {
var
timeLabel
:
UILabel
!
var
timeLabel
:
UILabel
!
var
editBtn
:
UIButton
!
var
editBtn
:
UIButton
!
var
editBlock
:
((
YHPrincipleContentUrlModel
)
->
())?
var
editBlock
:
((
YHPrincipleContentUrlModel
)
->
())?
var
isShowEditBtn
:
Bool
=
false
{
var
isShowEditBtn
:
Bool
=
false
{
didSet
{
didSet
{
editBtn
.
isHidden
=
!
isShowEditBtn
editBtn
.
isHidden
=
!
isShowEditBtn
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/CustomerService/PrincipleBatch(原则批)/V/YHPrincipleUploadStatusCell.swift
View file @
2e2d277d
...
@@ -32,6 +32,8 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
...
@@ -32,6 +32,8 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
var
expandClick
:((
Bool
)
->
())?
var
expandClick
:((
Bool
)
->
())?
var
fileEditBlock
:((
YHPrincipleContentUrlModel
,
Int
)
->
())?
var
fileEditBlock
:((
YHPrincipleContentUrlModel
,
Int
)
->
())?
var
uploadBtnClick
:((
YHPrincipleAgreementModel
?)
->
())?
// var status: YHPrincipleUploadStatus = .preUpload
// var status: YHPrincipleUploadStatus = .preUpload
let
viewModel
=
YHPrincleViewModel
()
let
viewModel
=
YHPrincleViewModel
()
...
@@ -149,7 +151,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
...
@@ -149,7 +151,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
}
}
@objc
func
didClickUploadBtn
()
{
@objc
func
didClickUploadBtn
()
{
uploadBtnClick
?(
self
.
itemModel
)
}
}
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
...
@@ -440,9 +442,9 @@ extension YHPrincipleUploadStatusCell: UITableViewDataSource, UITableViewDelegat
...
@@ -440,9 +442,9 @@ extension YHPrincipleUploadStatusCell: UITableViewDataSource, UITableViewDelegat
cell
.
isShowEditBtn
=
false
cell
.
isShowEditBtn
=
false
}
}
cell
.
editBlock
=
{
cell
.
editBlock
=
{
[
weak
self
]
m
odel
in
[
weak
self
]
selectM
odel
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
self
.
fileEditBlock
?(
m
odel
,
indexPath
.
section
)
self
.
fileEditBlock
?(
selectM
odel
,
indexPath
.
section
)
}
}
}
}
return
cell
return
cell
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/CustomerService/PrincipleBatch(原则批)/VM/YHPrincleViewModel.swift
View file @
2e2d277d
...
@@ -112,9 +112,8 @@ class YHPrincleViewModel: YHBaseViewModel {
...
@@ -112,9 +112,8 @@ class YHPrincleViewModel: YHBaseViewModel {
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Principle
.
getIsSendMail
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Principle
.
getIsSendMail
let
params
:
[
String
:
Any
]
=
[
"order_id"
:
orderId
]
let
params
:
[
String
:
Any
]
=
[
"order_id"
:
orderId
]
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
params
)
{
json
,
code
in
//1. json字符串 转 对象
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
printLog
(
"model 是 ==>
\(
json
)
"
)
printLog
(
"model 是 ==>
\(
json
)
"
)
if
json
.
code
==
200
{
if
json
.
code
==
200
{
...
@@ -139,7 +138,8 @@ class YHPrincleViewModel: YHBaseViewModel {
...
@@ -139,7 +138,8 @@ class YHPrincleViewModel: YHBaseViewModel {
let
params
:
[
String
:
Any
]
=
[
"file_list"
:
arr
]
let
params
:
[
String
:
Any
]
=
[
"file_list"
:
arr
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Principle
.
uploadFiles
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Principle
.
uploadFiles
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
json
,
code
in
//1. json字符串 转 对象
//1. json字符串 转 对象
printLog
(
"model 是 ==>
\(
json
)
"
)
printLog
(
"model 是 ==>
\(
json
)
"
)
...
@@ -156,46 +156,111 @@ class YHPrincleViewModel: YHBaseViewModel {
...
@@ -156,46 +156,111 @@ class YHPrincleViewModel: YHBaseViewModel {
}
}
}
}
func
getEnvelopModel
()
->
YHPrincipleEnvelopeModel
{
func
uploadImageArr
(
_
targetImgArr
:[
YHSelectImageItem
],
successBlock
:(([
YHPrincipleContentUrlModel
])
->
())?)
{
let
model
=
YHPrincipleEnvelopeModel
()
model
.
name
=
"黄金龙"
model
.
sex
=
1
model
.
date
=
"2024-12-12"
return
model
}
func
getTestModel
()
->
YHPrincipleWaitResultModel
{
var
files
:
[
YHFileNumberList
]
=
[]
let
ossGroup
=
DispatchGroup
()
let
m
=
YHFileNumberList
()
var
ossArr
:[
YHPrincipleContentUrlModel
]
=
[]
m
.
applicationName
=
"杜宇"
m
.
fileNumber
=
"23412-AVAVS-SADFAS"
let
m2
=
YHFileNumberList
()
m2
.
applicationName
=
"宇"
m2
.
fileNumber
=
"23412-AVAVS-SADFAS"
files
.
append
(
m
)
files
.
append
(
m2
)
var
imgs
:
[
YHResultImageList
]
=
[]
let
n
=
YHResultImageList
()
n
.
applicationName
=
"嘟嘟"
let
n1
=
YHResultImageList
()
n1
.
applicationName
=
"嘟嘟"
let
n2
=
YHResultImageList
()
n2
.
applicationName
=
"嘟嘟"
imgs
.
append
(
n
)
imgs
.
append
(
n1
)
imgs
.
append
(
n2
)
let
applicant
=
YHApplicant
()
YHHUD
.
show
(
.
progress
(
message
:
"上传中..."
))
applicant
.
userName
=
"哈哈哈"
// 先将所有图片组上传到OSS
for
item
in
targetImgArr
{
if
let
image
=
item
.
data
{
ossGroup
.
enter
()
self
.
uploadImage
(
image
,
imageName
:
item
.
name
)
{
success
,
urlModel
in
if
success
,
let
model
=
urlModel
{
ossArr
.
append
(
model
)
}
ossGroup
.
leave
()
}
}
}
// 再将OSS上传信息组上传到服务器
ossGroup
.
notify
(
queue
:
.
main
)
{
YHHUD
.
hide
()
if
ossArr
.
count
<=
0
{
YHHUD
.
flash
(
message
:
"上传失败"
)
successBlock
?([])
return
}
successBlock
?(
ossArr
)
}
}
func
uploadImage
(
_
img
:
UIImage
,
imageName
:
String
,
callBack
:((
Bool
,
YHPrincipleContentUrlModel
?)
->
())?)
{
let
model
=
YHPrincipleWaitResultModel
(
lastQueryAt
:
"2024-12-01 23:34:12"
,
// 先OSS上传得到URL
queryCount
:
40
,
self
.
uploadImage
(
img
)
{
fileNumberList
:
files
,
url
,
error
in
resultImageList
:
imgs
,
if
let
url
=
url
,
!
url
.
isEmpty
{
applicant
:
applicant
,
var
suffix
=
"jpg"
applicationFileNumberAttachment
:
"你要死啊"
)
let
suffixName
=
url
.
pathExtension
.
lowercased
()
return
model
if
!
suffixName
.
isEmpty
{
suffix
=
suffixName
}
// 再调用业务接口
let
model
=
YHPrincipleContentUrlModel
()
model
.
name
=
imageName
model
.
url
=
url
model
.
fileUrl
=
url
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"HH:mm:ss"
let
dateString
=
dateFormatter
.
string
(
from
:
Date
())
model
.
updated_at
=
dateString
callBack
?(
true
,
model
)
}
else
{
callBack
?(
false
,
nil
)
}
}
}
}
// func getEnvelopModel() -> YHPrincipleEnvelopeModel {
// let model = YHPrincipleEnvelopeModel()
// model.name = "黄金龙"
// model.sex = 1
// model.date = "2024-12-12"
// return model
// }
//
// func getTestModel() -> YHPrincipleWaitResultModel {
//
// var files: [YHFileNumberList] = []
// let m = YHFileNumberList()
// m.applicationName = "杜宇"
// m.fileNumber = "23412-AVAVS-SADFAS"
// let m2 = YHFileNumberList()
// m2.applicationName = "宇"
// m2.fileNumber = "23412-AVAVS-SADFAS"
// files.append(m)
// files.append(m2)
//
// var imgs: [YHResultImageList] = []
// let n = YHResultImageList()
// n.applicationName = "嘟嘟"
// let n1 = YHResultImageList()
// n1.applicationName = "嘟嘟"
// let n2 = YHResultImageList()
// n2.applicationName = "嘟嘟"
// imgs.append(n)
// imgs.append(n1)
// imgs.append(n2)
//
// let applicant = YHApplicant()
// applicant.userName = "哈哈哈"
//
// let model = YHPrincipleWaitResultModel(lastQueryAt: "2024-12-01 23:34:12",
// queryCount: 40,
// fileNumberList: files,
// resultImageList: imgs,
// applicant: applicant,
// applicationFileNumberAttachment: "你要死啊")
// return model
// }
//
}
}
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