Commit e4613f9f authored by Steven杜宇's avatar Steven杜宇

// 证件上传参数优化

parent 918e99ad
...@@ -118,9 +118,9 @@ extension YHCertificateListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -118,9 +118,9 @@ extension YHCertificateListVC: UITableViewDelegate, UITableViewDataSource {
} }
// 非待上传的进入详情 // 非待上传的进入详情
let vc = YHCertificateUploadContentListVC() let vc = YHCertificateUploadContentListVC()
vc.orderId = orderId vc.orderId = orderId ?? 0
vc.categoryInfo = categoryInfo vc.categoryId = categoryInfo.categoryId
vc.supplementInfo = item vc.supplementId = item.id
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} }
...@@ -298,9 +298,9 @@ extension YHCertificateListVC { ...@@ -298,9 +298,9 @@ extension YHCertificateListVC {
// 待上传的进入详情 // 待上传的进入详情
DispatchQueue.main.async { DispatchQueue.main.async {
let vc = YHCertificateUploadContentListVC() let vc = YHCertificateUploadContentListVC()
vc.orderId = self.orderId vc.orderId = self.orderId ?? 0
vc.categoryInfo = self.categoryInfo vc.categoryId = self.categoryInfo.categoryId
vc.supplementInfo = supplementInfo vc.supplementId = supplementInfo.id
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} }
...@@ -347,9 +347,9 @@ extension YHCertificateListVC { ...@@ -347,9 +347,9 @@ extension YHCertificateListVC {
YHHUD.flash(message: "\(ossArr.count)张照片上传成功\n\(targetImgArr.count-ossArr.count)张照片上传失败") YHHUD.flash(message: "\(ossArr.count)张照片上传成功\n\(targetImgArr.count-ossArr.count)张照片上传失败")
} }
let vc = YHCertificateUploadContentListVC() let vc = YHCertificateUploadContentListVC()
vc.orderId = self.orderId vc.orderId = self.orderId ?? 0
vc.categoryInfo = self.categoryInfo vc.categoryId = self.categoryInfo.categoryId
vc.supplementInfo = supplementInfo vc.supplementId = supplementInfo.id
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} else { } else {
......
...@@ -155,9 +155,9 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat ...@@ -155,9 +155,9 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat
} }
// 非待上传的进入详情 // 非待上传的进入详情
let vc = YHCertificateUploadContentListVC() let vc = YHCertificateUploadContentListVC()
vc.orderId = orderId vc.orderId = orderId ?? 0
vc.categoryInfo = categoryInfo vc.categoryId = self.categoryInfo?.categoryId ?? 0
vc.supplementInfo = item vc.supplementId = item.id
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} }
...@@ -311,9 +311,9 @@ extension YHCertificateSearchViewController { ...@@ -311,9 +311,9 @@ extension YHCertificateSearchViewController {
// 待上传的进入详情 // 待上传的进入详情
DispatchQueue.main.async { DispatchQueue.main.async {
let vc = YHCertificateUploadContentListVC() let vc = YHCertificateUploadContentListVC()
vc.orderId = self.orderId vc.orderId = self.orderId ?? 0
vc.categoryInfo = self.categoryInfo vc.categoryId = self.categoryInfo?.categoryId ?? 0
vc.supplementInfo = supplementInfo vc.supplementId = supplementInfo.id
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} }
...@@ -356,9 +356,9 @@ extension YHCertificateSearchViewController { ...@@ -356,9 +356,9 @@ extension YHCertificateSearchViewController {
if success { if success {
let vc = YHCertificateUploadContentListVC() let vc = YHCertificateUploadContentListVC()
vc.orderId = self.orderId vc.orderId = self.orderId ?? 0
vc.categoryInfo = self.categoryInfo vc.categoryId = self.categoryInfo?.categoryId ?? 0
vc.supplementInfo = supplementInfo vc.supplementId = supplementInfo.id
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
if ossArr.count == targetImgArr.count { if ossArr.count == targetImgArr.count {
......
...@@ -12,23 +12,25 @@ import AttributedString ...@@ -12,23 +12,25 @@ import AttributedString
class YHCertificateUploadContentListVC: YHBaseViewController { class YHCertificateUploadContentListVC: YHBaseViewController {
var orderId : Int! // 进入该页面以下三个参数必传
var categoryInfo: YHCategoryData! var orderId : Int = 0
var supplementInfo: YHSupplementInfo! { var categoryId: Int = 0
var supplementId: Int = 0
private var categoryInfo = YHCategoryData()
private var supplementInfo = YHSupplementInfo() {
didSet { didSet {
templateArr.removeAll() templateArr.removeAll()
if let uploadInfo = supplementInfo { if supplementInfo.templateInfo.materialPath.count > 0 {
if uploadInfo.templateInfo.materialPath.count > 0 { let template = supplementInfo.templateInfo.materialPath[0]
let template = uploadInfo.templateInfo.materialPath[0]
template.type = 0 template.type = 0
templateArr.append(template) templateArr.append(template)
} }
if uploadInfo.templateInfo.guideFilePath.count > 0 { if supplementInfo.templateInfo.guideFilePath.count > 0 {
let guide = uploadInfo.templateInfo.guideFilePath[0] let guide = supplementInfo.templateInfo.guideFilePath[0]
guide.type = 1 guide.type = 1
templateArr.append(guide) templateArr.append(guide)
} }
}
self.tableView.reloadData() self.tableView.reloadData()
} }
} }
...@@ -95,7 +97,9 @@ class YHCertificateUploadContentListVC: YHBaseViewController { ...@@ -95,7 +97,9 @@ class YHCertificateUploadContentListVC: YHBaseViewController {
createUI() createUI()
items.removeAll() items.removeAll()
items.append(contentsOf: supplementInfo.contentUrl) if supplementInfo.contentUrl.count > 0 {
items.append(contentsOf: supplementInfo.contentUrl)
}
tableView.reloadData() tableView.reloadData()
requestList() requestList()
...@@ -614,11 +618,11 @@ extension YHCertificateUploadContentListVC { ...@@ -614,11 +618,11 @@ extension YHCertificateUploadContentListVC {
func requestList() { func requestList() {
let params:[String:Any] = [ let params:[String:Any] = [
"order_id" : orderId ?? 0, "order_id" : orderId,
"node": "1", "node": "1",
"state": "1", "state": "1",
"category_id": categoryInfo.categoryId, "category_id": categoryId,
"supplement_ids": supplementInfo.id] "supplement_ids": supplementId]
print(params) print(params)
viewModel.getCertificateList(params: params) { viewModel.getCertificateList(params: params) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment