Commit 671362950fb0ee1233e919bd00c4e341b4882791

Authored by “张旭”
2 parents 7288c14d fef50fca

Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode

# Conflicts:
#	metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNMainView.swift
... ... @@ -425,7 +425,7 @@ class CNFrontMainView : UIView{
425 425 }
426 426  
427 427 @objc func addStandBtnAction() {
428   - //跳转到 电商认证 / 个人 / 企业
  428 + //跳转到 电商认证 / 个人 / 企业 / 机构
429 429 self.pushStandVC(isPersonOrEnterprise: 3)
430 430 }
431 431 @objc func personalStandBtnAction() {
... ... @@ -457,17 +457,43 @@ class CNFrontMainView : UIView{
457 457  
458 458 }else if self._idModel!.isPersonOrEnterprise == 5{
459 459 //机构
460   - navigationViewController().pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!, authType: .enterprise), animated: pushAnimated)//enterprise换成机构
  460 + navigationViewController().pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!, authType: .agency), animated: pushAnimated)
461 461  
462   - }else{
  462 + }else if self._idModel!.isPersonOrEnterprise == 0{
  463 + //2个按钮
463 464 if isPersonOrEnterprise == 1{
464   - navigationViewController().pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!, authType: .person), animated: pushAnimated)
  465 + //第1个按钮
  466 + var authType:CNLiveMineInputAuthType = .person
  467 + if self._idModel?.standInfoBaseModel?.authInfos.count ?? 0 > 0{
  468 + //点击个人
  469 + authType = .person
  470 + }else if self._idModel?.standInfoBaseModel?.enterpriseAuthInfos.count ?? 0 > 0{
  471 + //点击企业
  472 + authType = .enterprise
  473 + }else{
  474 +
  475 + }
  476 + navigationViewController().pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!, authType: authType), animated: pushAnimated)
465 477  
466 478 }else if isPersonOrEnterprise == 2{
467   - navigationViewController().pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!, authType: .enterprise), animated: pushAnimated)
  479 + //第二个按钮
  480 + var authType:CNLiveMineInputAuthType = .enterprise
  481 + if self._idModel?.standInfoBaseModel?.enterpriseAuthInfos.count ?? 0 > 0{
  482 + //点击企业
  483 + authType = .enterprise
  484 + }else if self._idModel?.standInfoBaseModel?.agencyAuthInfos.count ?? 0 > 0{
  485 + //点击机构
  486 + authType = .agency
  487 + }else{
  488 +
  489 + }
  490 + navigationViewController().pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!, authType: authType), animated: pushAnimated)
468 491 }else{
469 492 navigationViewController().pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!, authType: .person), animated: pushAnimated)
470 493 }
  494 + }else if self._idModel!.isPersonOrEnterprise == 4{
  495 + //个人+企业+机构
  496 + sdd
471 497 }
472 498 }
473 499 }
... ...
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/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)
... ...