Commit 66c2e998df6d03073c044f8ccd1de1aa10a9340a

Authored by liushiyu
1 parent 574676de

认证选择

metaCode/Classes/Main/MinePage/Controller/CNLiveMineAuthFormViewController.swift
@@ -51,18 +51,21 @@ class CNLiveMineAuthFormViewController: CNLiveBaseViewController, UITableViewDel @@ -51,18 +51,21 @@ class CNLiveMineAuthFormViewController: CNLiveBaseViewController, UITableViewDel
51 return 2 51 return 2
52 } 52 }
53 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 53 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
54 - return 1 54 + return section == 0 ? 1 : 2
55 } 55 }
56 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 56 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
57 guard let cell = tableView.dequeueReusableCell(withIdentifier: kMIneBodyAuthFormViewCellIdentifier) as? MineAuthFormTableViewCell else { 57 guard let cell = tableView.dequeueReusableCell(withIdentifier: kMIneBodyAuthFormViewCellIdentifier) as? MineAuthFormTableViewCell else {
58 return MineAuthFormTableViewCell() 58 return MineAuthFormTableViewCell()
59 } 59 }
60 - if indexPath.section == 0 { 60 + if indexPath.section == 0 && indexPath.row == 1 {
61 cell.mainView.image = UIImage(named: "mine_persion_auth_btn") 61 cell.mainView.image = UIImage(named: "mine_persion_auth_btn")
62 } 62 }
63 if indexPath.section == 1 { 63 if indexPath.section == 1 {
64 cell.mainView.image = UIImage(named: "mine_form_auth_btn") 64 cell.mainView.image = UIImage(named: "mine_form_auth_btn")
65 } 65 }
  66 +// if indexPath.section == 1 && indexPath.row == 1 {
  67 +// cell.mainView.image = UIImage(named: "mine_form_auth_btn")
  68 +// }
66 return cell 69 return cell
67 } 70 }
68 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 71 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
@@ -75,12 +78,15 @@ class CNLiveMineAuthFormViewController: CNLiveBaseViewController, UITableViewDel @@ -75,12 +78,15 @@ class CNLiveMineAuthFormViewController: CNLiveBaseViewController, UITableViewDel
75 return adapt_length(length: 10) 78 return adapt_length(length: 10)
76 } 79 }
77 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 80 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
78 - if indexPath.section == 0 {  
79 - self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _listModel, authType: .person), animated: true)  
80 - }  
81 - if indexPath.section == 1 {  
82 - self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _listModel, authType: .enterprise), animated: true)  
83 - } 81 +// if indexPath.section == 0 {
  82 +// self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _listModel, authType: .person), animated: true)
  83 +// }
  84 +// if indexPath.section == 1 {
  85 +// self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _listModel, authType: .enterprise), animated: true)
  86 +// }
  87 +// if indexPath.section == 2 {
  88 +// self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _listModel, authType: .agency), animated: true)
  89 +// }
84 } 90 }
85 } 91 }
86 92
@@ -95,6 +101,14 @@ class MineAuthFormTableViewCell: UITableViewCell { @@ -95,6 +101,14 @@ class MineAuthFormTableViewCell: UITableViewCell {
95 return view 101 return view
96 }() 102 }()
97 103
  104 + lazy var whiteView: UIView = {
  105 + let view = UIView.init()
  106 + view.backgroundColor = .white
  107 + view.layer.masksToBounds = true
  108 + view.layer.cornerRadius = adapt_length(length: 10)
  109 + return view
  110 + }()
  111 +
98 override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { 112 override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
99 super.init(style: style, reuseIdentifier: reuseIdentifier) 113 super.init(style: style, reuseIdentifier: reuseIdentifier)
100 contentView.backgroundColor = .clear 114 contentView.backgroundColor = .clear
@@ -107,6 +121,10 @@ class MineAuthFormTableViewCell: UITableViewCell { @@ -107,6 +121,10 @@ class MineAuthFormTableViewCell: UITableViewCell {
107 make.top.left.equalToSuperview().offset(10) 121 make.top.left.equalToSuperview().offset(10)
108 make.bottom.right.equalToSuperview().offset(-10) 122 make.bottom.right.equalToSuperview().offset(-10)
109 } 123 }
  124 +
  125 + contentView.addSubview(whiteView)
  126 + whiteView.snp.makeConstraints { make in
  127 + }
110 } 128 }
111 129
112 required init?(coder: NSCoder) { 130 required init?(coder: NSCoder) {
metaCode/Classes/Main/MinePage/Controller/CNLiveMineInputViewController.swift
@@ -10,8 +10,9 @@ import EmptyDataSet_Swift @@ -10,8 +10,9 @@ import EmptyDataSet_Swift
10 import HXPHPicker 10 import HXPHPicker
11 import APButton 11 import APButton
12 enum CNLiveMineInputAuthType { 12 enum CNLiveMineInputAuthType {
13 - case person//个人认证  
14 - case enterprise//企业认证 13 + case person //个人认证
  14 + case enterprise //企业认证
  15 + case agency //机构认证
15 } 16 }
16 17
17 typealias resultUploadImageBlock = (_ url: String) -> Void 18 typealias resultUploadImageBlock = (_ url: String) -> Void
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
@@ -224,6 +224,7 @@ final class StandListModel: BaseModel {//, TableCodable { @@ -224,6 +224,7 @@ final class StandListModel: BaseModel {//, TableCodable {
224 class MineStandInfoBaseModel: BaseModel { 224 class MineStandInfoBaseModel: BaseModel {
225 var authInfos = [MineStandInfoModel]() 225 var authInfos = [MineStandInfoModel]()
226 var enterpriseAuthInfos = [MineStandInfoModel]() 226 var enterpriseAuthInfos = [MineStandInfoModel]()
  227 + var agencyAuthInfos = [MineStandInfoModel]()
227 var icon: String? 228 var icon: String?
228 var name: String? 229 var name: String?
229 var identityId: Int = 0 230 var identityId: Int = 0
@@ -240,7 +241,7 @@ class MineStandInfoModel: BaseModel { @@ -240,7 +241,7 @@ class MineStandInfoModel: BaseModel {
240 var sort: Int = 0 241 var sort: Int = 0
241 var name: String?//卡片标签 242 var name: String?//卡片标签
242 var sub_title: String?//报名项说明 243 var sub_title: String?//报名项说明
243 - var inputType: Int = 0//1 文本输入 2数字输入 3下拉选择 4认证时间 5认证编码 6正图 7小竖图 8大横图 9单选 10多选 11选项 12时间选择器 13主标题 16大文本框 244 + var inputType: Int = 0//1文本输入 2数字输入 3下拉选择 4认证时间 5认证编码 6正图 7小竖图 8大横图 9单选 10多选 11选项 12时间选择器 13主标题 16大文本框 17弹窗
244 var nonEmpty: Bool = false 245 var nonEmpty: Bool = false
245 var length: Int = 10 246 var length: Int = 10
246 var children = [MineStandInfoModel]() 247 var children = [MineStandInfoModel]()
@@ -248,6 +249,7 @@ class MineStandInfoModel: BaseModel { @@ -248,6 +249,7 @@ class MineStandInfoModel: BaseModel {
248 var input: Bool = false 249 var input: Bool = false
249 var show: Bool = false 250 var show: Bool = false
250 var value: String? = ""//自己定义的值 251 var value: String? = ""//自己定义的值
  252 + var subTitle: String? = ""
251 253
252 } 254 }
253 255
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
@@ -505,6 +505,13 @@ class CNLiveMineViewModel: NSObject { @@ -505,6 +505,13 @@ class CNLiveMineViewModel: NSObject {
505 } 505 }
506 } 506 }
507 } 507 }
  508 + if authType == .agency {
  509 + for authinfo in newsModel.agencyAuthInfos {
  510 + if authinfo.input {
  511 + tempArray.add(authinfo)
  512 + }
  513 + }
  514 + }
508 resultBlock(tempArray,.success) 515 resultBlock(tempArray,.success)
509 }else if (type == .effect) { 516 }else if (type == .effect) {
510 resultBlock(newsModel,.success) 517 resultBlock(newsModel,.success)