Commit 66c2e998df6d03073c044f8ccd1de1aa10a9340a

Authored by liushiyu
1 parent 574676de

认证选择

metaCode/Classes/Main/MinePage/Controller/CNLiveMineAuthFormViewController.swift
... ... @@ -51,18 +51,21 @@ class CNLiveMineAuthFormViewController: CNLiveBaseViewController, UITableViewDel
51 51 return 2
52 52 }
53 53 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
54   - return 1
  54 + return section == 0 ? 1 : 2
55 55 }
56 56 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
57 57 guard let cell = tableView.dequeueReusableCell(withIdentifier: kMIneBodyAuthFormViewCellIdentifier) as? MineAuthFormTableViewCell else {
58 58 return MineAuthFormTableViewCell()
59 59 }
60   - if indexPath.section == 0 {
  60 + if indexPath.section == 0 && indexPath.row == 1 {
61 61 cell.mainView.image = UIImage(named: "mine_persion_auth_btn")
62 62 }
63 63 if indexPath.section == 1 {
64 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 69 return cell
67 70 }
68 71 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
... ... @@ -75,12 +78,15 @@ class CNLiveMineAuthFormViewController: CNLiveBaseViewController, UITableViewDel
75 78 return adapt_length(length: 10)
76 79 }
77 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 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 112 override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
99 113 super.init(style: style, reuseIdentifier: reuseIdentifier)
100 114 contentView.backgroundColor = .clear
... ... @@ -107,6 +121,10 @@ class MineAuthFormTableViewCell: UITableViewCell {
107 121 make.top.left.equalToSuperview().offset(10)
108 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 130 required init?(coder: NSCoder) {
... ...
metaCode/Classes/Main/MinePage/Controller/CNLiveMineInputViewController.swift
... ... @@ -10,8 +10,9 @@ import EmptyDataSet_Swift
10 10 import HXPHPicker
11 11 import APButton
12 12 enum CNLiveMineInputAuthType {
13   - case person//个人认证
14   - case enterprise//企业认证
  13 + case person //个人认证
  14 + case enterprise //企业认证
  15 + case agency //机构认证
15 16 }
16 17  
17 18 typealias resultUploadImageBlock = (_ url: String) -> Void
... ...
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
... ... @@ -224,6 +224,7 @@ final class StandListModel: BaseModel {//, TableCodable {
224 224 class MineStandInfoBaseModel: BaseModel {
225 225 var authInfos = [MineStandInfoModel]()
226 226 var enterpriseAuthInfos = [MineStandInfoModel]()
  227 + var agencyAuthInfos = [MineStandInfoModel]()
227 228 var icon: String?
228 229 var name: String?
229 230 var identityId: Int = 0
... ... @@ -240,7 +241,7 @@ class MineStandInfoModel: BaseModel {
240 241 var sort: Int = 0
241 242 var name: String?//卡片标签
242 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 245 var nonEmpty: Bool = false
245 246 var length: Int = 10
246 247 var children = [MineStandInfoModel]()
... ... @@ -248,6 +249,7 @@ class MineStandInfoModel: BaseModel {
248 249 var input: Bool = false
249 250 var show: Bool = false
250 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 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 515 resultBlock(tempArray,.success)
509 516 }else if (type == .effect) {
510 517 resultBlock(newsModel,.success)
... ...