Commit 121c2a34 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 8d8216a8 2dadebe0
...@@ -2904,7 +2904,7 @@ ...@@ -2904,7 +2904,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 8; CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
...@@ -3105,7 +3105,7 @@ ...@@ -3105,7 +3105,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 8; CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
...@@ -3147,7 +3147,7 @@ ...@@ -3147,7 +3147,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 8; CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
......
...@@ -129,6 +129,9 @@ extension YHHomePageViewModel { ...@@ -129,6 +129,9 @@ extension YHHomePageViewModel {
callBackBlock(false,nil) callBackBlock(false,nil)
return return
} }
for item in result {
item?.calHeightParam()
}
self.arrHomeNewsData = result self.arrHomeNewsData = result
callBackBlock(true, nil) callBackBlock(true, nil)
} else { } else {
......
...@@ -56,6 +56,10 @@ class YHMyDocumentsDetailViewController: YHBaseViewController { ...@@ -56,6 +56,10 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
viewModel.requestSignBack("\(self.viewModel.mainModel?.writing_document.doc_sign.id ?? 0)") {[weak self] success, error in
guard let self = self else { return }
self.getData()
}
getData() getData()
} }
...@@ -212,6 +216,7 @@ class YHMyDocumentsDetailViewController: YHBaseViewController { ...@@ -212,6 +216,7 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
bottomView = { bottomView = {
let bottom = UIView() let bottom = UIView()
bottom.backgroundColor = .white bottom.backgroundColor = .white
bottom.isHidden = true
return bottom return bottom
}() }()
view.addSubview(bottomView) view.addSubview(bottomView)
...@@ -749,6 +754,10 @@ extension YHMyDocumentsDetailViewController: SFSafariViewControllerDelegate { ...@@ -749,6 +754,10 @@ extension YHMyDocumentsDetailViewController: SFSafariViewControllerDelegate {
// MARK: 点击左上角的完成 // MARK: 点击左上角的完成
func safariViewControllerDidFinish(_ controller: SFSafariViewController) { func safariViewControllerDidFinish(_ controller: SFSafariViewController) {
controller.navigationController?.popViewController() controller.navigationController?.popViewController()
viewModel.requestSignBack("\(self.viewModel.mainModel?.writing_document.doc_sign.id ?? 0)") {[weak self] success, error in
guard let self = self else { return }
self.getData()
}
} }
// MARK: 加载完成 // MARK: 加载完成
......
...@@ -297,6 +297,25 @@ class YHMyDocumentsDetailViewModel: YHBaseViewModel { ...@@ -297,6 +297,25 @@ class YHMyDocumentsDetailViewModel: YHBaseViewModel {
callBackBlock(false, err) callBackBlock(false, err)
} }
} }
func requestSignBack(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
// let params: [String : Any] = ["order_id": orderId]
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.signCallBack
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
} }
private extension YHMyDocumentsDetailViewModel { private extension YHMyDocumentsDetailViewModel {
......
...@@ -53,6 +53,10 @@ class YHMySignatureDetailViewController: YHBaseViewController { ...@@ -53,6 +53,10 @@ class YHMySignatureDetailViewController: YHBaseViewController {
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
viewModel.requestSignBack("\(id)") {[weak self] success, error in
guard let self = self else { return }
self.getData()
}
getData() getData()
} }
...@@ -173,6 +177,7 @@ class YHMySignatureDetailViewController: YHBaseViewController { ...@@ -173,6 +177,7 @@ class YHMySignatureDetailViewController: YHBaseViewController {
bottomView = { bottomView = {
let bottom = UIView() let bottom = UIView()
bottom.backgroundColor = .white bottom.backgroundColor = .white
bottom.isHidden = true
return bottom return bottom
}() }()
view.addSubview(bottomView) view.addSubview(bottomView)
...@@ -643,6 +648,10 @@ extension YHMySignatureDetailViewController: SFSafariViewControllerDelegate { ...@@ -643,6 +648,10 @@ extension YHMySignatureDetailViewController: SFSafariViewControllerDelegate {
// MARK: 点击左上角的完成 // MARK: 点击左上角的完成
func safariViewControllerDidFinish(_ controller: SFSafariViewController) { func safariViewControllerDidFinish(_ controller: SFSafariViewController) {
controller.navigationController?.popViewController() controller.navigationController?.popViewController()
viewModel.requestSignBack("\(id)") {[weak self] success, error in
guard let self = self else { return }
self.getData()
}
} }
// MARK: 加载完成 // MARK: 加载完成
......
...@@ -210,4 +210,23 @@ class YHMySignatureDetailViewModel: YHBaseViewModel { ...@@ -210,4 +210,23 @@ class YHMySignatureDetailViewModel: YHBaseViewModel {
callBackBlock(false, err) callBackBlock(false, err)
} }
} }
func requestSignBack(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
// let params: [String : Any] = ["order_id": orderId]
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.signCallBack
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
} }
...@@ -99,30 +99,6 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData ...@@ -99,30 +99,6 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData
extension YHServiceTableFootView: CollectionViewWaterfallLayoutDelegate { extension YHServiceTableFootView: CollectionViewWaterfallLayoutDelegate {
func collectionView(_ collectionView: UICollectionView, layout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { func collectionView(_ collectionView: UICollectionView, layout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
guard let model = items[indexPath.row] else { return CGSize.zero } guard let model = items[indexPath.row] else { return CGSize.zero }
let text = model.title return CGSize(width: model.img_width_cell, height: model.img_height_cell)
let width = (KScreenWidth - 47) / 2
let font = UIFont.PFSC_R(ofSize: 14) // 字体大小
let maxWidth = width - 16 // 最大宽度限制
// 创建NSAttributedString对象并设置属性
let attributes = [NSAttributedString.Key.font : font] as [NSAttributedString.Key : Any]
_ = NSMutableAttributedString(string: text, attributes: attributes)
// 根据指定的最大宽度和字体大小计算文本的高度
let size = (text as NSString).boundingRect(with: CGSize(width: maxWidth, height: .greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes: attributes, context: nil).size
var textHeight = size.height
if textHeight > 40 {
textHeight = 40
}
let imageSize = getImageSize(model.img_url)
var imageHeight = 0.0
if imageSize.width == 0 {
imageHeight = width
} else {
imageHeight = width * imageSize.height/imageSize.width
if imageHeight > 280 {
imageHeight = 280
}
}
let totalHeight = imageHeight + textHeight + 46
return CGSize(width: width, height: totalHeight)
} }
} }
...@@ -199,7 +199,8 @@ class YHAllApiName { ...@@ -199,7 +199,8 @@ class YHAllApiName {
static let confirm = "infoflow/my-sign/confirm" static let confirm = "infoflow/my-sign/confirm"
// 查看合同 // 查看合同
static let look = "infoflow/sign/view-detail" static let look = "infoflow/sign/view-detail"
// 查看签署状态
static let signCallBack = "infoflow/sign/sign-callback"
} }
//我的文书 //我的文书
......
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