Commit b3b1b50c authored by pete谢兆麟's avatar pete谢兆麟

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

parents 8d4ac3d3 c80e2dfc
...@@ -27,6 +27,8 @@ class YHHomeIdentityItem { ...@@ -27,6 +27,8 @@ class YHHomeIdentityItem {
class YHHomeIdentityViewController: YHBaseViewController { class YHHomeIdentityViewController: YHBaseViewController {
var scrollContentY: CGFloat = 0.0
var isShowBottomView: Bool = false
var imgItems:[YHHomeIdentityItem] = [YHHomeIdentityItem(img:UIImage(named: "identity_talent_1")), var imgItems:[YHHomeIdentityItem] = [YHHomeIdentityItem(img:UIImage(named: "identity_talent_1")),
YHHomeIdentityItem(img:UIImage(named: "identity_talent_2")), YHHomeIdentityItem(img:UIImage(named: "identity_talent_2")),
YHHomeIdentityItem(img:UIImage(named: "identity_talent_3")), YHHomeIdentityItem(img:UIImage(named: "identity_talent_3")),
...@@ -60,6 +62,7 @@ class YHHomeIdentityViewController: YHBaseViewController { ...@@ -60,6 +62,7 @@ class YHHomeIdentityViewController: YHBaseViewController {
tableView.register(YHHomeIdentityCell.self, forCellReuseIdentifier: YHHomeIdentityCell.cellReuseIdentifier) tableView.register(YHHomeIdentityCell.self, forCellReuseIdentifier: YHHomeIdentityCell.cellReuseIdentifier)
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
tableView.bounces = false
tableView.tableHeaderView = self.headerView tableView.tableHeaderView = self.headerView
return tableView return tableView
}() }()
...@@ -148,16 +151,6 @@ class YHHomeIdentityViewController: YHBaseViewController { ...@@ -148,16 +151,6 @@ class YHHomeIdentityViewController: YHBaseViewController {
make.top.equalTo(headImgView.snp.bottom).offset(8.0) make.top.equalTo(headImgView.snp.bottom).offset(8.0)
} }
} }
func scrollViewDidScroll(_ scrollView: UIScrollView) {
printLog("offset: \(scrollView.contentOffset.y)")
if scrollView.contentOffset.y <= self.headerView.height {
if self.segmentedView.selectedIndex != 0 {
self.segmentedView.defaultSelectedIndex = 0
self.segmentedView.reloadDataWithoutListContainer()
}
}
}
} }
extension YHHomeIdentityViewController: JXSegmentedViewDelegate { extension YHHomeIdentityViewController: JXSegmentedViewDelegate {
...@@ -212,6 +205,44 @@ extension YHHomeIdentityViewController: UITableViewDataSource, UITableViewDelega ...@@ -212,6 +205,44 @@ extension YHHomeIdentityViewController: UITableViewDataSource, UITableViewDelega
} }
} }
extension YHHomeIdentityViewController: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
printLog("offset: \(scrollView.contentOffset.y)")
if scrollView.contentOffset.y <= self.headerView.height {
if self.segmentedView.selectedIndex != 0 {
self.segmentedView.defaultSelectedIndex = 0
self.segmentedView.reloadDataWithoutListContainer()
}
}
let gap = 10.0
if scrollView.contentOffset.y >= self.scrollContentY+gap {
self.scrollContentY = scrollView.contentOffset.y
if !self.isShowBottomView {
self.isShowBottomView = true
printLog("ABC show: \(self.scrollContentY)")
var model = TabBarShareModel()
model.showFlag = true
model.shareUrl = ""
model.codeUrl = ""
model.downloadUrl = ""
NotificationCenter.default.post(name: YhConstant.YhNotification.changeShareViewStatusOnTabBarNotifiction, object: model)
}
} else if scrollView.contentOffset.y <= self.scrollContentY-gap {
self.scrollContentY = scrollView.contentOffset.y
if self.isShowBottomView {
self.isShowBottomView = false
printLog("ABC hide: \(self.scrollContentY)")
var model = TabBarShareModel()
model.showFlag = false
NotificationCenter.default.post(name: YhConstant.YhNotification.changeShareViewStatusOnTabBarNotifiction, object: model)
}
}
}
}
extension YHHomeIdentityViewController { extension YHHomeIdentityViewController {
func requestData() { func requestData() {
......
...@@ -71,6 +71,7 @@ class YHSupplementInfo: SmartCodable { ...@@ -71,6 +71,7 @@ class YHSupplementInfo: SmartCodable {
var auditContent: String = "" var auditContent: String = ""
var uploadRequirement: Int = 0 var uploadRequirement: Int = 0
var contentUrl: [YHContentUrl] = [] var contentUrl: [YHContentUrl] = []
var isNeedDealt: Bool = false // 是否是银河代办
func getStatusName() -> String { func getStatusName() -> String {
if checkStatus == YHCertificateUploadStatus.review.rawValue { if checkStatus == YHCertificateUploadStatus.review.rawValue {
...@@ -104,6 +105,7 @@ class YHSupplementInfo: SmartCodable { ...@@ -104,6 +105,7 @@ class YHSupplementInfo: SmartCodable {
case auditContent = "audit_content" case auditContent = "audit_content"
case uploadRequirement = "upload_requirement" case uploadRequirement = "upload_requirement"
case contentUrl = "content_url" case contentUrl = "content_url"
case isNeedDealt = "is_need_dealt"
} }
required init() { required init() {
......
...@@ -13,7 +13,7 @@ import AttributedString ...@@ -13,7 +13,7 @@ import AttributedString
class YHCertificateInfoCell: UITableViewCell { class YHCertificateInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateInfoCell" static let cellReuseIdentifier = "YHCertificateInfoCell"
var model: YHSupplementInfo = YHSupplementInfo()
var status : YHCertificateUploadStatus = .preUpload var status : YHCertificateUploadStatus = .preUpload
var templateBlock:(()->())? var templateBlock:(()->())?
var whiteView: UIView! var whiteView: UIView!
...@@ -21,7 +21,19 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -21,7 +21,19 @@ class YHCertificateInfoCell: UITableViewCell {
var infoLabel: UILabel! var infoLabel: UILabel!
var statusLabel: UILabel! var statusLabel: UILabel!
var rightArrowImgV: UIImageView! var rightArrowImgV: UIImageView!
var templateButton: UIButton! lazy var templateButton: UIButton = {
let btn = UIButton()
btn.frame = CGRect(x: 0, y: 0, width: 48, height: 16)
btn.setTitle("资料模版", for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 10)
btn.setTitleColor(.brandMainColor, for: .normal)
btn.layer.cornerRadius = kCornerRadius3
btn.clipsToBounds = true
btn.backgroundColor = .brandMainColor8
btn.addTarget(self, action: #selector(didTemplateBtnClicked), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
super.init(coder: coder) super.init(coder: coder)
...@@ -34,6 +46,7 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -34,6 +46,7 @@ class YHCertificateInfoCell: UITableViewCell {
func updateModel(_ model: YHSupplementInfo) { func updateModel(_ model: YHSupplementInfo) {
self.model = model
if let status = YHCertificateUploadStatus(rawValue: model.checkStatus) { if let status = YHCertificateUploadStatus(rawValue: model.checkStatus) {
var titleColor: UIColor = .labelTextColor2 var titleColor: UIColor = .labelTextColor2
...@@ -82,14 +95,26 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -82,14 +95,26 @@ class YHCertificateInfoCell: UITableViewCell {
var result:ASAttributedString = .init(string:"", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor)) var result:ASAttributedString = .init(string:"", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.failColor)) let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.failColor))
let cerName: ASAttributedString = .init(string:model.name , .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor)) var name = model.name
if !model.nameExtra.organization.isEmpty {
name += "(\(model.nameExtra.organization))"
}
let cerName: ASAttributedString = .init(string:name , .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
var template: ASAttributedString = " \(.view(templateButton, .original(.center)))" var template: ASAttributedString = " \(.view(templateButton, .original(.center)))"
// 是否展示右边的模版按钮 // 是否展示右边的模版按钮
var showTemplateBtn = true var showTemplateBtn = true
if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty { if model.isNeedDealt {
templateButton.setTitle("银河代办", for: .normal)
showTemplateBtn = false template = " \(.view(templateButton, .original(.center)))"
} else {
templateButton.setTitle("资料模版", for: .normal)
template = " \(.view(templateButton, .original(.center)))"
if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty {
showTemplateBtn = false
}
} }
if model.isNeedSupplemnt() { if model.isNeedSupplemnt() {
...@@ -103,6 +128,9 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -103,6 +128,9 @@ class YHCertificateInfoCell: UITableViewCell {
} }
@objc func didTemplateBtnClicked() { @objc func didTemplateBtnClicked() {
if self.model.isNeedDealt { // 银河代办
return
}
if let templateBlock = templateBlock { if let templateBlock = templateBlock {
templateBlock() templateBlock()
} }
...@@ -127,16 +155,6 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -127,16 +155,6 @@ class YHCertificateInfoCell: UITableViewCell {
nameTextView.isSelectable = false nameTextView.isSelectable = false
whiteView.addSubview(nameTextView) whiteView.addSubview(nameTextView)
templateButton = UIButton()
templateButton.frame = CGRect(x: 0, y: 0, width: 48, height: 16)
templateButton.setTitle("资料模版", for: .normal)
templateButton.titleLabel?.font = .PFSC_M(ofSize: 10)
templateButton.setTitleColor(.brandMainColor, for: .normal)
templateButton.layer.cornerRadius = kCornerRadius3
templateButton.clipsToBounds = true
templateButton.backgroundColor = .brandMainColor8
templateButton.addTarget(self, action: #selector(didTemplateBtnClicked), for: .touchUpInside)
templateButton.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
nameTextView.attributed.text = """ nameTextView.attributed.text = """
\("资料名称", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateButton, .original(.center)))) \("资料名称", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateButton, .original(.center))))
......
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