Commit 262daea0 authored by DavidHuang's avatar DavidHuang

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

parents f4235cba 78e49db3
......@@ -230,7 +230,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
if let extMsg = res?.extMsg {
if extMsg == "my_certificate" { // 我的证件 微信文件上传
NotificationCenter.default.post(name: YhConstant.YhNotification.didMyCertificateWeChatFileUploadCallBackNotification, object: nil)
} else if extMsg == "wx_upload_renewal_data" {
NotificationCenter.default.post(name: YhConstant.YhNotification.didMyResignMaterialWeChatFileUploadCallBackNotification, object: nil)
} else if extMsg == "wx_upload_sign_apply" {
NotificationCenter.default.post(name: YhConstant.YhNotification.didMySignWeChatFileUploadCallBackNotification, object: nil)
}
}
}
}
......
......@@ -68,7 +68,7 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
getData()
}
func getData() {
@objc func getData() {
viewModel.requestDocumentsDetail("\(id)", callBackBlock: {[weak self] success, error in
guard let self = self else { return }
if success {
......@@ -643,6 +643,11 @@ extension YHMyDocumentsDetailViewController: UITableViewDelegate, UITableViewDat
maxCount = 9
}
let sheetView = YHDocumentUploadView.sheetView()
sheetView.uploadTypeArr = [ YHCertificateUploadItem(type:.camera, title:"拍照上传"),
YHCertificateUploadItem(type:.photo, title:"相册上传"),
YHCertificateUploadItem(type:.phoneFile, title:"手机文件上传", subtitle:"从手机文件管理中上传"),
YHCertificateUploadItem(type:.wechatUpload, title:"微信上传"),
YHCertificateUploadItem(type:.cancel, title:"取消")]
sheetView.maxSelectCount = maxCount
sheetView.uploadFilesBlock = {
[weak self] fileUrl in
......@@ -693,6 +698,18 @@ extension YHMyDocumentsDetailViewController: UITableViewDelegate, UITableViewDat
}
}
}
sheetView.wechatUploadBlock = {
[weak self] in
guard let self = self else { return }
let token = YHLoginManager.shared.h5Token
var opt_type = 1
if let oldUrl = self.oldUrl, !oldUrl.isEmpty {
opt_type = 2
}
let path = "/superApp/pages/wxUpload/wxUpload?param=\(token)&id=\(self.viewModel.mainModel?.writing_document.doc_sign.id ?? 0)&opt_type=\(opt_type)&type=wx_upload_sign_apply&old_url=\(self.oldUrl ?? "")"
YHShareManager.shared.openMiniProgram(path:path, title: "微信上传")
}
sheetView.show()
}
......@@ -851,6 +868,9 @@ extension YHMyDocumentsDetailViewController {
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(getData), name: YhConstant.YhNotification.didMySignWeChatFileUploadCallBackNotification, object: nil)
}
func removeNotify() {
......
......@@ -24,12 +24,23 @@ class YHDocumentUploadView: UIView {
}
}
var tips = "" {
didSet {
updateLayouts()
}
}
var templateArr: [YHMaterialPath] = []
var uploadTypeArr = [
YHCertificateUploadItem(type:.camera, title:"拍照上传"),
YHCertificateUploadItem(type:.photo, title:"相册上传"),
YHCertificateUploadItem(type:.phoneFile, title:"手机文件上传", subtitle:"从手机文件管理中上传"),
YHCertificateUploadItem(type:.cancel, title:"取消")]
{
didSet {
updateLayouts()
}
}
// 上传文件
var uploadFilesBlock:((URL)->())?
......@@ -37,6 +48,8 @@ class YHDocumentUploadView: UIView {
var uploadImageBlock:(([YHSelectImageItem])->())?
// 点击模板
var clickTemplateBlock:((YHMaterialPath?)->())?
// 微信上传
var wechatUploadBlock:(()->())?
lazy var blackMaskView: UIView = {
let view = UIView()
......@@ -59,6 +72,7 @@ class YHDocumentUploadView: UIView {
let line = UIView()
line.backgroundColor = .separatorColor
line.isHidden = true
view.addSubview(line)
titleLabel.snp.makeConstraints { make in
......@@ -179,6 +193,38 @@ class YHDocumentUploadView: UIView {
make.top.equalTo(topView.snp.bottom).offset(-1)
}
}
func updateLayouts() {
let whiteHeight = calculateHeight()
whiteContentView.snp.remakeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(whiteHeight)
}
topView.snp.remakeConstraints { make in
make.top.left.right.equalToSuperview()
}
tableView.snp.remakeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(topView.snp.bottom).offset(0)
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
func calculateHeight() -> CGFloat {
// 底部5个操作行高度之和
let actionsHeight = 52.0 * Double(uploadTypeArr.count)
var tableViewHeight = actionsHeight
// 白色View总高度
var totalHeight = 53.0+tableViewHeight+k_Height_safeAreaInsetsBottom()
if totalHeight > KScreenHeight {
totalHeight = 458
}
return totalHeight
}
}
extension YHDocumentUploadView {
......@@ -225,6 +271,9 @@ extension YHDocumentUploadView: UITableViewDelegate, UITableViewDataSource {
} else if operationItem.type == .phoneFile {
selectFile()
} else if operationItem.type == .wechatUpload {
selectFileFromWeChatPragram()
}
}
}
......@@ -461,3 +510,11 @@ extension YHDocumentUploadView: UIDocumentPickerDelegate {
}
}
extension YHDocumentUploadView {
func selectFileFromWeChatPragram() {
self.wechatUploadBlock?()
dismiss()
}
}
......@@ -63,7 +63,7 @@ class YHMySignatureDetailViewController: YHBaseViewController {
getData()
}
func getData() {
@objc func getData() {
viewModel.requestSignatureDetail("\(id)", callBackBlock: {[weak self] success, error in
guard let self = self else { return }
if success {
......@@ -492,7 +492,13 @@ extension YHMySignatureDetailViewController: UITableViewDelegate, UITableViewDat
maxCount = 9
}
let sheetView = YHDocumentUploadView.sheetView()
sheetView.uploadTypeArr = [ YHCertificateUploadItem(type:.camera, title:"拍照上传"),
YHCertificateUploadItem(type:.photo, title:"相册上传"),
YHCertificateUploadItem(type:.phoneFile, title:"手机文件上传", subtitle:"从手机文件管理中上传"),
YHCertificateUploadItem(type:.wechatUpload, title:"微信上传"),
YHCertificateUploadItem(type:.cancel, title:"取消")]
sheetView.maxSelectCount = maxCount
sheetView.uploadFilesBlock = {
[weak self] fileUrl in
guard let self = self else { return }
......@@ -543,6 +549,18 @@ extension YHMySignatureDetailViewController: UITableViewDelegate, UITableViewDat
}
}
}
sheetView.wechatUploadBlock = {
[weak self] in
guard let self = self else { return }
let token = YHLoginManager.shared.h5Token
var opt_type = 1
if let oldUrl = self.oldUrl, !oldUrl.isEmpty {
opt_type = 2
}
let path = "/superApp/pages/wxUpload/wxUpload?param=\(token)&id=\(self.id)&opt_type=\(opt_type)&type=wx_upload_sign_apply&old_url=\(self.oldUrl ?? "")"
YHShareManager.shared.openMiniProgram(path:path, title: "微信上传")
}
sheetView.show()
}
......@@ -700,6 +718,16 @@ extension YHMySignatureDetailViewController {
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
// self.viewModel.requestFileAction("\(self.id)", action, successArr, self.oldUrl ?? "") {[weak self] success, error in
// guard let self = self else { return }
// self.getData()
// }
NotificationCenter.default.addObserver(self, selector: #selector(getData), name: YhConstant.YhNotification.didMySignWeChatFileUploadCallBackNotification, object: nil)
}
func removeNotify() {
......
......@@ -236,6 +236,11 @@ extension YHResignMaterialListVC {
let sheetView = YHCertificateUploadSheetView.sheetView()
sheetView.maxSelectImageCount = 9
sheetView.tips = "支持的文件格式为jpg/jpeg、png、bmp、doc/docx、xls/xlsx、pdf,最多可上传99张图片或文件"
sheetView.uploadTypeArr = [ YHCertificateUploadItem(type:.camera, title:"拍照上传"),
YHCertificateUploadItem(type:.photo, title:"相册上传"),
YHCertificateUploadItem(type:.phoneFile, title:"手机文件上传", subtitle:"从手机文件管理中上传"),
YHCertificateUploadItem(type:.wechatUpload, title:"微信上传"),
YHCertificateUploadItem(type:.cancel, title:"取消")]
sheetView.fileTypes = [ "public.image",
"com.adobe.pdf",
"com.microsoft.word.doc",
......@@ -262,6 +267,13 @@ extension YHResignMaterialListVC {
success?()
}
}
sheetView.wechatUploadBlock = {
[weak self] in
guard let self = self else { return }
let token = YHLoginManager.shared.h5Token
let path = "/superApp/pages/wxUpload/wxUpload?param=\(token)&material_id=\(material.id)&template_id=\(material.template_id)&type=wx_upload_renewal_data"
YHShareManager.shared.openMiniProgram(path:path, title: "微信上传")
}
sheetView.show()
}
}
......@@ -135,6 +135,11 @@ class YHResignMaterialUploadVC: YHBaseViewController {
let sheetView = YHCertificateUploadSheetView.sheetView()
sheetView.maxSelectImageCount = 99-items.count
sheetView.tips = "支持的文件格式为jpg/jpeg、png、bmp、doc/docx、xls/xlsx、pdf,最多可上传99张图片或文件"
sheetView.uploadTypeArr = [ YHCertificateUploadItem(type:.camera, title:"拍照上传"),
YHCertificateUploadItem(type:.photo, title:"相册上传"),
YHCertificateUploadItem(type:.phoneFile, title:"手机文件上传", subtitle:"从手机文件管理中上传"),
YHCertificateUploadItem(type:.wechatUpload, title:"微信上传"),
YHCertificateUploadItem(type:.cancel, title:"取消")]
sheetView.fileTypes = [ "public.image",
"com.adobe.pdf",
"com.microsoft.word.doc",
......@@ -161,6 +166,14 @@ class YHResignMaterialUploadVC: YHBaseViewController {
self.requestMaterialDetail()
}
}
sheetView.wechatUploadBlock = {
[weak self] in
guard let self = self else { return }
let token = YHLoginManager.shared.h5Token
let path = "/superApp/pages/wxUpload/wxUpload?param=\(token)&material_id=\(self.materialModel.id)&template_id=\(self.materialModel.template_id)&type=wx_upload_renewal_data"
YHShareManager.shared.openMiniProgram(path:path, title: "微信上传")
}
sheetView.show()
}
......@@ -559,6 +572,7 @@ extension YHResignMaterialUploadVC {
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(requestMaterialDetail), name: YhConstant.YhNotification.didMyResignMaterialWeChatFileUploadCallBackNotification, object: nil)
}
func removeNotify() {
......@@ -590,7 +604,7 @@ extension YHResignMaterialUploadVC {
extension YHResignMaterialUploadVC {
func requestMaterialDetail() {
@objc func requestMaterialDetail() {
YHHUD.show(.progress(message: "加载中..."))
viewModel.getMaterialDeal(orderId: orderId, id: batchId, materialId: materialId) {
......
......@@ -23,10 +23,8 @@ enum YHFormTitleItemType:Int, CaseIterable {
case C
case D
case E
// 国籍
case nationality
// 居住信息
case liveInfo
case F
case G
case hkAndMacaoPassport
// 中国身份证
......@@ -257,9 +255,9 @@ class YHFormTitleItem : YHFormItemProtocol {
return "子女".local
case .E:
return "随行".local
case .nationality:
case .F:
return "国籍".local
case .liveInfo:
case .G:
return "居住信息".local
case .hkAndMacaoPassport:
return "港澳通行证".local
......@@ -319,9 +317,9 @@ class YHFormTitleItem : YHFormItemProtocol {
return "".local
case .E:
return "".local
case .nationality:
case .F:
return "".local
case .liveInfo:
case .G:
return "".local
case .hkAndMacaoPassport:
return "".local
......
......@@ -68,12 +68,12 @@ class YHGCChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
if child.isFollow() { // 随行才加后面的信息
// 国籍
let title1 = YHFormTitleItem(type: .nationality)
let title1 = YHFormTitleItem(type: .F)
let item10 = YHFormDetailItem(type: .nationOrArea, value:child.nationality, tips: "请选择国籍".local)
let arr1:[YHFormItemProtocol] = [title1, item10]
// 居住信息
let title2 = YHFormTitleItem(type: .liveInfo)
let title2 = YHFormTitleItem(type: .G)
let item20 = YHFormDetailItem(type: .isLiveTother, value:String(child.isLiveTother()))
var arr2: [YHFormItemProtocol] = [title2, item20]
......@@ -446,10 +446,10 @@ extension YHGCChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] country in
guard let self = self else { return }
let title = arr[0] as! YHFormTitleItem
if title.type == .nationality { // 选国籍
if title.type == .F { // 选国籍
self.child?.nationality = country
} else if title.type == .liveInfo { // // 居住信息选国家地区
} else if title.type == .G { // // 居住信息选国家地区
self.child?.address.country = country
// 选择国家地区后需清空城市
self.child?.address.area = []
......
......@@ -398,6 +398,8 @@ extension YhConstant {
// 我的证件 微信文件上传回调
public static let didMyCertificateWeChatFileUploadCallBackNotification = Notification.Name(rawValue: "com.yinhe.myCertificate.wechat.fileUpload")
public static let didMyResignMaterialWeChatFileUploadCallBackNotification = Notification.Name(rawValue: "com.yinhe.resignMaterial.wechat.fileUpload")
public static let didMySignWeChatFileUploadCallBackNotification = Notification.Name(rawValue: "com.yinhe.sign.wechat.fileUpload")
// 已经展示银河管家
public static let didLoadYhManagerNotification = Notification.Name(rawValue: "com.yinhe.didLoadYhManager")
public static let backToHomeNotification = Notification.Name(rawValue: "com.yinhe.backToHomeNotification")
......
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