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

// 我的证件微信上传

parent a5598ea4
...@@ -82,15 +82,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate { ...@@ -82,15 +82,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
} }
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
if let host = url.host, host.contains("platformId=wechat") {
return WXApi.handleOpen(url, delegate: self)
}
if YHAnalytics.handleSchemeUrl(url) ?? false { if YHAnalytics.handleSchemeUrl(url) ?? false {
return true return true
} }
return true return true
} }
func setupNavBar() { func setupNavBar() {
GKConfigure.setupDefault() GKConfigure.setupDefault()
} }
...@@ -125,6 +126,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate { ...@@ -125,6 +126,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
if res?.state == "wechat_sdk_demo_test", let code = res?.code { if res?.state == "wechat_sdk_demo_test", let code = res?.code {
YHShareManager.shared.getWechatAccessToken(code: code) YHShareManager.shared.getWechatAccessToken(code: code)
} }
} else if resp.isKind(of: WXLaunchMiniProgramResp.self) { // 微信小程序回调
let res = resp as? WXLaunchMiniProgramResp
if let extMsg = res?.extMsg {
if extMsg == "my_certificate" { // 我的证件 微信文件上传
NotificationCenter.default.post(name: YhConstant.YhNotification.didMyCertificateWeChatFileUploadCallBackNotification, object: nil)
}
}
} }
} }
} }
......
...@@ -177,6 +177,8 @@ class YHCertificateUploadContentListVC: YHBaseViewController { ...@@ -177,6 +177,8 @@ class YHCertificateUploadContentListVC: YHBaseViewController {
let token = YHLoginManager.shared.h5Token let token = YHLoginManager.shared.h5Token
let path = "/superApp/pages/wxUpload/wxUpload?param=\(token)&id=\(self.supplementId)&type=my_certificate" let path = "/superApp/pages/wxUpload/wxUpload?param=\(token)&id=\(self.supplementId)&type=my_certificate"
YHShareManager.shared.openMiniProgram(path:path, title: "微信上传") YHShareManager.shared.openMiniProgram(path:path, title: "微信上传")
} }
sheetView.show() sheetView.show()
} }
...@@ -570,6 +572,13 @@ extension YHCertificateUploadContentListVC { ...@@ -570,6 +572,13 @@ extension YHCertificateUploadContentListVC {
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil) 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(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didRefreshData), name: YhConstant.YhNotification.didMyCertificateWeChatFileUploadCallBackNotification, object: nil)
}
@objc func didRefreshData() {
requestList()
} }
func removeNotify() { func removeNotify() {
......
...@@ -69,6 +69,11 @@ class YHCertificateUploadSheetView: UIView { ...@@ -69,6 +69,11 @@ class YHCertificateUploadSheetView: UIView {
YHCertificateUploadItem(type:.photo, title:"相册上传"), YHCertificateUploadItem(type:.photo, title:"相册上传"),
YHCertificateUploadItem(type:.phoneFile, title:"手机文件上传", subtitle:"从手机文件管理中上传"), YHCertificateUploadItem(type:.phoneFile, title:"手机文件上传", subtitle:"从手机文件管理中上传"),
YHCertificateUploadItem(type:.cancel, title:"取消")] YHCertificateUploadItem(type:.cancel, title:"取消")]
{
didSet {
updateLayouts()
}
}
// 上传文件 // 上传文件
var uploadFilesBlock:((URL)->())? var uploadFilesBlock:((URL)->())?
...@@ -251,6 +256,8 @@ class YHCertificateUploadSheetView: UIView { ...@@ -251,6 +256,8 @@ class YHCertificateUploadSheetView: UIView {
if tips == "" { if tips == "" {
lineView.isHidden = true lineView.isHidden = true
} }
self.setNeedsLayout()
self.layoutIfNeeded()
} }
func calculateHeight() -> CGFloat { func calculateHeight() -> CGFloat {
...@@ -604,7 +611,7 @@ extension YHCertificateUploadSheetView: UIDocumentPickerDelegate { ...@@ -604,7 +611,7 @@ extension YHCertificateUploadSheetView: UIDocumentPickerDelegate {
extension YHCertificateUploadSheetView { extension YHCertificateUploadSheetView {
func selectFileFromWeChatPragram() { func selectFileFromWeChatPragram() {
self.wechatUploadBlock?() self.wechatUploadBlock?()
dismiss()
} }
} }
...@@ -247,6 +247,7 @@ extension YHCertificateViewModel { ...@@ -247,6 +247,7 @@ extension YHCertificateViewModel {
let token = YHLoginManager.shared.h5Token let token = YHLoginManager.shared.h5Token
let path = "/superApp/pages/wxUpload/wxUpload?param=\(token)&id=\(supplementId)&type=my_certificate" let path = "/superApp/pages/wxUpload/wxUpload?param=\(token)&id=\(supplementId)&type=my_certificate"
YHShareManager.shared.openMiniProgram(path:path, title: "微信上传") YHShareManager.shared.openMiniProgram(path:path, title: "微信上传")
completion?()
} }
sheetView.show() sheetView.show()
} }
......
...@@ -306,6 +306,9 @@ extension YhConstant { ...@@ -306,6 +306,9 @@ extension YhConstant {
// 刷新续签预约状态列表 // 刷新续签预约状态列表
public static let didUpdateResignAppointStatusList = Notification.Name(rawValue: "com.yinhe.resign.appoint.list.update") public static let didUpdateResignAppointStatusList = Notification.Name(rawValue: "com.yinhe.resign.appoint.list.update")
// 我的证件 微信文件上传回调
public static let didMyCertificateWeChatFileUploadCallBackNotification = Notification.Name(rawValue: "com.yinhe.myCertificate.wechat.fileUpload")
} }
} }
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