Commit 52e2dd2a authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  文书逻辑重新调整,以及接口调试
  续签补件逻辑补充
parents 274e08b7 1f2e9216
...@@ -446,7 +446,6 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource { ...@@ -446,7 +446,6 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = self.arrDataForSeviceCenterProgress[indexPath.row] let model = self.arrDataForSeviceCenterProgress[indexPath.row]
if model.status == 1 || model.status == 4 { if model.status == 1 || model.status == 4 {
YHServiceOrderListView.jumpToMessageController(type: model.type, orderId: orderID, stepID)
return return
} else { } else {
YHServiceOrderListView.jumpToMessageController(type: model.type, orderId: orderID, stepID) YHServiceOrderListView.jumpToMessageController(type: model.type, orderId: orderID, stepID)
......
...@@ -63,7 +63,7 @@ class YHFilePreviewTool: NSObject { ...@@ -63,7 +63,7 @@ class YHFilePreviewTool: NSObject {
} }
DispatchQueue.main.async { [weak self] in DispatchQueue.main.async { [weak self] in
guard let self = self, let presentingVC = self.targetVC else { guard let self = self, self.targetVC != nil else {
printLog("Target view controller is not available") printLog("Target view controller is not available")
return return
} }
......
...@@ -52,6 +52,8 @@ class YHResignUploadDocDetailViewController: YHBaseViewController { ...@@ -52,6 +52,8 @@ class YHResignUploadDocDetailViewController: YHBaseViewController {
if #available(iOS 11.0, *) { if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never tableView.contentInsetAdjustmentBehavior = .never
} }
tableView.estimatedSectionHeaderHeight = 0.01
tableView.estimatedSectionFooterHeight = 0.01
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .white tableView.backgroundColor = .white
tableView.separatorStyle = .none tableView.separatorStyle = .none
...@@ -113,8 +115,21 @@ class YHResignUploadDocDetailViewController: YHBaseViewController { ...@@ -113,8 +115,21 @@ class YHResignUploadDocDetailViewController: YHBaseViewController {
} }
@objc func didClickUploadBtn() { @objc func didClickUploadBtn() {
if self.materialModel.unavailable_reason.count != 0 {
self.viewModel.postUploadDocFillUnavailableReason(id: id, reason: self.materialModel.unavailable_reason) {[weak self] success, err in
guard let self = self else { return }
if success {
self.navigationController?.popViewController(animated: true)
}
}
} else {
self.viewModel.postUploadDocUpload(id: id, file: self.items) { [weak self] success, err in
guard let self = self else { return }
if success {
self.navigationController?.popViewController(animated: true)
}
}
}
} }
func createUI() { func createUI() {
...@@ -365,7 +380,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie ...@@ -365,7 +380,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie
let model = YHResignUploadDetailFileListModel() let model = YHResignUploadDetailFileListModel()
model.url = item model.url = item
model.name = "\(UInt64(timestamp))" + ".jpg" model.name = "\(UInt64(timestamp))" + ".jpg"
// model.uploadedAt = formattedDate model.updated_at = formattedDate
self.items.append(model) self.items.append(model)
} }
self.tableView.reloadData() self.tableView.reloadData()
...@@ -393,10 +408,10 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie ...@@ -393,10 +408,10 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie
return 77.0 return 77.0
} }
if indexPath.section == 2 { if indexPath.section == 2 {
return 61 return 57
} }
if indexPath.section == 3 { if indexPath.section == 3 {
return 45 return 41
} }
return 55.0 return 55.0
} }
...@@ -408,7 +423,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie ...@@ -408,7 +423,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie
if section == 1 { if section == 1 {
return UITableView.automaticDimension return UITableView.automaticDimension
} }
return 0.01 return 1
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
...@@ -486,10 +501,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie ...@@ -486,10 +501,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie
if section == 0 { if section == 0 {
return UITableView.automaticDimension return UITableView.automaticDimension
} }
// if section == 1 { return 1
// return 60.0
// }
return 0.01
} }
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
...@@ -626,6 +638,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie ...@@ -626,6 +638,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie
} }
return view return view
} }
view.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.01)
return view return view
} }
......
...@@ -191,7 +191,7 @@ class YHResignUploadDocItemView: UIView { ...@@ -191,7 +191,7 @@ class YHResignUploadDocItemView: UIView {
addSubview(titleLabel) addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview() make.left.top.bottom.equalToSuperview()
make.right.equalTo(-50) make.right.equalTo(-70)
} }
explainLabel = { explainLabel = {
......
...@@ -39,6 +39,47 @@ extension YHResignUploadDetailViewModel { ...@@ -39,6 +39,47 @@ extension YHResignUploadDetailViewModel {
} }
} }
func postUploadDocFillUnavailableReason(id: Int, reason: String, callBackBlock:@escaping (_ success: Bool,_ err:YHErrorModel?)->()) {
let params: [String : Any] = ["id": id, "unavailable_reason": reason]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignUploadDoc.reason
let _ = YHNetRequest.postRequest(url: strUrl, params:params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
callBackBlock(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
func postUploadDocUpload(id: Int, file: [YHResignUploadDetailFileListModel], callBackBlock:@escaping (_ success: Bool,_ err:YHErrorModel?)->()) {
var urls: [Any] = []
for item in file {
let file = ["name": item.name, "url": item.url, "upload_date": item.updated_at]
urls.append(file)
}
let params: [String : Any] = ["id": id, "file_list": urls]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignUploadDoc.upload
let _ = YHNetRequest.postRequest(url: strUrl, params:params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
callBackBlock(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
} }
...@@ -598,6 +598,9 @@ class YHAllApiName { ...@@ -598,6 +598,9 @@ class YHAllApiName {
static let progress = "super-app/renewal/supplement/progress" static let progress = "super-app/renewal/supplement/progress"
static let list = "super-app/renewal/supplement/list" static let list = "super-app/renewal/supplement/list"
static let detail = "super-app/renewal/supplement/upload/detail" static let detail = "super-app/renewal/supplement/upload/detail"
static let reason = "super-app/renewal/supplement/fill-unavailable-reason"
static let upload = "super-app/renewal/supplement/confirm-upload"
} }
// 续签-电子签证缴费 // 续签-电子签证缴费
struct ResignVisa { struct ResignVisa {
......
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