Commit 4ef6befb21daf248ab06746bd3f944a388ea77c7

Authored by “张旭”
1 parent da99994c

1.频道列表接口 2.行业认证列表接口 3.认证首页整体逻辑修改

metaCode/Classes/Config/CNLiveConfigUserInfo.swift
... ... @@ -39,6 +39,9 @@ class UserInfoModel: BaseModel {
39 39 var wxUid:String = ""
40 40 var access_token:String = ""
41 41 var expires_in:String = ""//过期时间
  42 +
  43 + var userMsgUsers: MineGetUserMsgUsersModel?
  44 + var currentUser:MineGetUserMsgVerifyUsersModel?
42 45  
43 46 override func mapping(mapper: HelpingMapper) {
44 47  
... ... @@ -245,7 +248,7 @@ class StandSortManager: NSObject {
245 248 var haveArray = Array<Any>()
246 249 for item in stands {
247 250 let listModel = item as! StandListModel
248   - if listModel.auth {
  251 + if listModel.userAuth {
249 252 //2.21 需求把已经认证的第一次展示的时候再通过认证的时间先后顺序进行排序
250 253 // tempArray.insert(listModel, at: 0)
251 254 haveArray.append(listModel)
... ...
metaCode/Classes/Main/HomePage/Controller/AuthMainController/CNMetaCodeHomePageController.swift
... ... @@ -427,10 +427,11 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
427 427  
428 428 let identityModel = dataArray[index] as! StandListModel
429 429 bannerView?.idModel = identityModel
430   - if (identityModel.auth == true){
  430 + if (identityModel.userAuth == true){
  431 + //已有数字认证
431 432 bannerView?.baseScrollView.isScrollEnabled = true
432 433 }else{
433   - //未认证
  434 + //未数字认证,显示个人 企业 机构
434 435 if (identityModel.downType == 3 || identityModel.downType == 4 || identityModel.upType == 3 || identityModel.upType == 4)
435 436 {//电商工作台和详情页 禁止滑动
436 437 bannerView?.baseScrollView.isScrollEnabled = false
... ... @@ -664,10 +665,12 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
664 665 }
665 666 }
666 667  
667   - //MARK: - 网络请求获取身份列表
  668 + let group = DispatchGroup()
  669 + let queue = DispatchQueue.global(qos: .default)
  670 + //MARK: - 网络请求获取频道列表
668 671 func getUserIdentityApi()
669 672 {
670   -// showLoading(message: "")
  673 + showLoading(message: "")
671 674 CNLiveMineViewModel.requestAuthStandList(page: 1)
672 675 { [self] result, respStatue in
673 676  
... ... @@ -675,13 +678,37 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
675 678 if respStatue == .success{
676 679 self.NetApiStatus = .success
677 680 let listArray:NSArray = (result as! StandListBaseModel).list as NSArray
  681 + self.dataArray = NSMutableArray.init()
  682 + self.dataArray.addObjects(from: listArray as! [Any])
  683 +
678 684 if (listArray.count > 0){
679   -
680   - self.dataArray = NSMutableArray.init()
681   - self.dataArray.addObjects(from: listArray as! [Any])
  685 +
  686 + listArray.forEach { list in
  687 + if let listModel = list as? StandListModel{
  688 +
  689 + listModel.authenticationsModel.forEach({ childModel in
  690 + childModel.child.forEach { childChildModel in
  691 + childChildModel.identities.forEach { identities in
  692 + if identities.userAuth == 1{
  693 + listModel.userAuth = true//是否已经身份认证
  694 + }
  695 + }
  696 + }
  697 + })
  698 +
  699 + group.enter()
  700 +
  701 + self.getAuthenticationsApi(channelId: String(format: "%d", listModel.id), listModel: listModel)
  702 + }
  703 + }
  704 +
  705 + group.notify(queue: .main) {
  706 + // 所有网络请求都已完成,在这里执行你的任务
  707 +
  708 + self.addPageView()
  709 + self.backgroupView.updateData(idArray: listArray as! Array<StandListModel>)
  710 + }
682 711  
683   - self.addPageView()
684   - self.backgroupView.updateData(idArray: listArray as! Array<StandListModel>)
685 712 }else{
686 713 self.NetApiStatus = .apiError
687 714 }
... ... @@ -695,6 +722,29 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
695 722 }
696 723 }
697 724  
  725 + //行业认证列表
  726 + func getAuthenticationsApi(channelId:String , listModel:StandListModel)
  727 + {
  728 + showLoading(message: "")
  729 + let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? ""
  730 + CNLiveMineViewModel.requestsIndustryInfo(channelId: channelId, sid: UserInfoManager.shared.userInfo.uid, vsid: vsid) { result, respStatue in
  731 + if respStatue == .success{//UserInfoManager.shared.userInfo.uid vsid "1342671" "2"
  732 + if let res = result as? [MineAuthenticationsChildModel]{
  733 + //添加每个MineAuthenticationsBaseModel到self.dataArray对应的 频道列表model里
  734 + if self.dataArray.contains(listModel){
  735 + let index = self.dataArray.index(of: listModel)
  736 + let listMdl = listModel
  737 + listMdl.authenticationsModel = res
  738 + self.dataArray.replaceObject(at: index, with: listMdl)
  739 + self.group.leave()
  740 + }
  741 + }
  742 + }else{
  743 + self.group.leave()
  744 + }
  745 + }
  746 + }
  747 +
698 748 // MARK: - 获取电商状态
699 749 func getApplyShopInfo(){
700 750 //获取当前店铺审核状态
... ...
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNIDCardView.swift
... ... @@ -17,7 +17,7 @@ class CNIDCardView: UIView{
17 17 }
18 18 set{
19 19 _idModel = newValue
20   - self.iDCardBGView.kf.setImage(with: URL(string: _idModel!.cardImg))
  20 +// self.iDCardBGView.kf.setImage(with: URL(string: _idModel!.cardImg))
21 21 if _idModel?.id == 9{
22 22 //电商 , 拼接数据
23 23 let nameArr = ["公司名称","认证时间","编号"]
... ...
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNMainView.swift
... ... @@ -319,36 +319,36 @@ class CNFrontMainView : UIView{
319 319 }()
320 320  
321 321 ///已认证-前置视图卡片容器
322   - lazy var frontCardContentView : UIView = {
323   -
324   - let frontCardContentView = UIView.init(frame: CGRect(x: 0, y: 0, width: self.width, height: self.height ))
325   - frontCardContentView.backgroundColor = UIColor.white
326   - frontCardContentView.clipsToBounds = true
327   - frontCardContentView.layer.cornerRadius = 20
328   - frontCardContentView.addSubview(self.cardViewBgImgView)
329   - cardViewBgImgView.snp.makeConstraints { make in
330   - make.top.equalToSuperview()
331   - make.left.equalToSuperview()
332   - make.right.equalToSuperview()
333   - make.bottom.equalToSuperview()
334   - }
335   -
336   - frontCardContentView.addSubview(self.iDCardView)
337   - iDCardView.snp.makeConstraints { make in
338   - make.centerX.equalToSuperview()
339   - make.bottom.equalToSuperview().offset(-62)
340   - make.width.equalTo(262*KSreenWidth/375)
341   - make.height.equalTo(0.52*262*KSreenWidth/375)
342   - }
343   - return frontCardContentView
344   -
345   - }()
346   - /// 已认证-身份卡片
347   - lazy var iDCardView:CNIDCardView = {
348   -
349   - let iDCardView:CNIDCardView = CNIDCardView(frame: CGRect(x: 0, y: 0, width: 262*KSreenWidth/375, height: 0.52*262*KSreenWidth/375))
350   - return iDCardView
351   - }()
  322 +// lazy var frontCardContentView : UIView = {
  323 +//
  324 +// let frontCardContentView = UIView.init(frame: CGRect(x: 0, y: 0, width: self.width, height: self.height ))
  325 +// frontCardContentView.backgroundColor = UIColor.white
  326 +// frontCardContentView.clipsToBounds = true
  327 +// frontCardContentView.layer.cornerRadius = 20
  328 +//// frontCardContentView.addSubview(self.cardViewBgImgView)
  329 +//// cardViewBgImgView.snp.makeConstraints { make in
  330 +//// make.top.equalToSuperview()
  331 +//// make.left.equalToSuperview()
  332 +//// make.right.equalToSuperview()
  333 +//// make.bottom.equalToSuperview()
  334 +//// }
  335 +//
  336 +//// frontCardContentView.addSubview(self.iDCardView)
  337 +//// iDCardView.snp.makeConstraints { make in
  338 +//// make.centerX.equalToSuperview()
  339 +//// make.bottom.equalToSuperview().offset(-62)
  340 +//// make.width.equalTo(262*KSreenWidth/375)
  341 +//// make.height.equalTo(0.52*262*KSreenWidth/375)
  342 +//// }
  343 +// return frontCardContentView
  344 +//
  345 +// }()
  346 +// /// 已认证-身份卡片
  347 +// lazy var iDCardView:CNIDCardView = {
  348 +//
  349 +// let iDCardView:CNIDCardView = CNIDCardView(frame: CGRect(x: 0, y: 0, width: 262*KSreenWidth/375, height: 0.52*262*KSreenWidth/375))
  350 +// return iDCardView
  351 +// }()
352 352  
353 353 /// 已认证-身份卡片
354 354 lazy var textViewBgImgView:UIImageView = {
... ... @@ -360,13 +360,13 @@ class CNFrontMainView : UIView{
360 360 }()
361 361  
362 362 /// 已认证-卡片后的背景图
363   - lazy var cardViewBgImgView:UIImageView = {
364   -
365   - let cardViewBgImgView:UIImageView = UIImageView()
366   - cardViewBgImgView.clipsToBounds = true
367   - cardViewBgImgView.layer.cornerRadius = 20
368   - return cardViewBgImgView
369   - }()
  363 +// lazy var cardViewBgImgView:UIImageView = {
  364 +//
  365 +// let cardViewBgImgView:UIImageView = UIImageView()
  366 +// cardViewBgImgView.clipsToBounds = true
  367 +// cardViewBgImgView.layer.cornerRadius = 20
  368 +// return cardViewBgImgView
  369 +// }()
370 370  
371 371 //IDmodel
372 372 var _idModel : StandListModel?
... ... @@ -376,26 +376,38 @@ class CNFrontMainView : UIView{
376 376 }
377 377 set{
378 378 _idModel = newValue
379   - let auth = newValue!.auth
380   - if(auth == true){
381   - //已认证身份
  379 + let auth = newValue!.userAuth
  380 + if(auth == false){//true
  381 + //已认证身份 //显示数字认证
382 382 //显示证件View
383   - frontCardContentView.isHidden = false
384   - self.addStandBtn.isHidden = true
385   - self.iDCardView.idModel = newValue!
386   - cardViewBgImgView.kf.setImage(with: URL(string: _idModel!.cardBackgroundImg), placeholder: UIImage(named: "homepage_cardBGImg"))
  383 +// frontCardContentView.isHidden = false
  384 + self.addStandBtn.isHidden = false
  385 + self.addStandBtn.setTitle("我的数字认证", for: .normal)
  386 + self.addStandBtn.backgroundColor = HexColor(_idModel?.backgroundColor ?? "#004FE0")//
  387 +
  388 +
  389 +// self.iDCardView.idModel = newValue!
  390 +// cardViewBgImgView.kf.setImage(with: URL(string: _idModel!.cardBackgroundImg), placeholder: UIImage(named: "homepage_cardBGImg"))
387 391 //隐藏textview
388 392 textView.isHidden = true
389 393 unStandBtnBgView.isHidden = true
390 394  
391   - if frontCardContentView.contains(self.upMoreGIF){
  395 +// if frontCardContentView.contains(self.upMoreGIF){
  396 +// self.upMoreGIF.removeFromSuperview()
  397 +// }
  398 +// frontCardContentView.addSubview(self.upMoreGIF)
  399 +// if frontCardContentView.contains(self.downMoreGIF){
  400 +// self.downMoreGIF.removeFromSuperview()
  401 +// }
  402 +// frontCardContentView.addSubview(self.downMoreGIF)
  403 + if frontDescContentView.contains(self.upMoreGIF){
392 404 self.upMoreGIF.removeFromSuperview()
393 405 }
394   - frontCardContentView.addSubview(self.upMoreGIF)
395   - if frontCardContentView.contains(self.downMoreGIF){
  406 + frontDescContentView.addSubview(self.upMoreGIF)
  407 + if frontDescContentView.contains(self.downMoreGIF){
396 408 self.downMoreGIF.removeFromSuperview()
397 409 }
398   - frontCardContentView.addSubview(self.downMoreGIF)
  410 + frontDescContentView.addSubview(self.downMoreGIF)
399 411 self.setUpMoreGIFAndDownMoreGIF()
400 412 //上滑 下滑引导gif
401 413 upMoreGIF.kf.setImage(with: URL(string: newValue!.upGuideImg))
... ... @@ -409,6 +421,7 @@ class CNFrontMainView : UIView{
409 421 upMoreGIF.isHidden = false
410 422 downMoreGIF.isHidden = false
411 423 }
  424 + textViewBgImgView.kf.setImage(with: URL(string: _idModel!.descBackgroundImg), placeholder: UIImage(named: "homepage_desc_bgImg"))
412 425 }else
413 426 {//未认证身份
414 427 textView.isHidden = false
... ... @@ -425,6 +438,7 @@ class CNFrontMainView : UIView{
425 438 self.enterpriseStandBtn.isHidden = true
426 439 self.unStandBtnBgView.isHidden = true
427 440 self.addStandBtn.isUserInteractionEnabled = true
  441 + textViewBgImgView.kf.setImage(with: URL(string: _idModel!.descBackgroundImg), placeholder: UIImage(named: "homepage_desc_bgImg"))
428 442 if idModel?.shopInfoModel?.state == "0" || idModel?.shopInfoModel?.state == "4"{
429 443 //0未申请 //4闭店
430 444 //未认证->店铺认证
... ... @@ -448,86 +462,97 @@ class CNFrontMainView : UIView{
448 462 upMoreGIF.isHidden = false
449 463 downMoreGIF.isHidden = false
450 464  
451   - if idModel!.userAuth && idModel!.enterpriseAuth && !idModel!.agencyAuth{
452   - self.addStandBtn.isHidden = true
453   - self.personalStandBtn.isHidden = false
454   - self.enterpriseStandBtn.isHidden = false
455   - unStandBtnBgView.isHidden = true
456   - //个人+企业
457   - self.personalStandBtn.setTitle("个人认证", for: .normal)
458   - self.enterpriseStandBtn.setTitle("企业认证", for: .normal)
459   - }else if idModel!.userAuth && idModel!.agencyAuth && !idModel!.enterpriseAuth{
460   - self.addStandBtn.isHidden = true
461   - self.personalStandBtn.isHidden = false
462   - self.enterpriseStandBtn.isHidden = false
463   - unStandBtnBgView.isHidden = true
464   - //个人+机构
465   - self.personalStandBtn.setTitle("个人认证", for: .normal)
466   - self.enterpriseStandBtn.setTitle("机构认证", for: .normal)
467   - }else if idModel!.enterpriseAuth && idModel!.agencyAuth && !idModel!.userAuth{
468   - self.addStandBtn.isHidden = true
469   - self.personalStandBtn.isHidden = false
470   - self.enterpriseStandBtn.isHidden = false
471   - unStandBtnBgView.isHidden = true
472   - //企业+机构
473   - self.personalStandBtn.setTitle("企业认证", for: .normal)
474   - self.enterpriseStandBtn.setTitle("机构认证", for: .normal)
475   - }else if idModel!.userAuth && !idModel!.enterpriseAuth && !idModel!.agencyAuth{
476   - //个人
477   - self.addStandBtn.isHidden = false
478   - self.addStandBtn.setTitle("个人认证", for: .normal)
479   - self.personalStandBtn.isHidden = true
480   - self.enterpriseStandBtn.isHidden = true
481   - self.unStandBtnBgView.isHidden = true
482   - }else if !idModel!.userAuth && idModel!.enterpriseAuth && !idModel!.agencyAuth{
483   - //企业
484   - self.addStandBtn.isHidden = false
485   - self.addStandBtn.setTitle("企业认证", for: .normal)
486   - self.personalStandBtn.isHidden = true
487   - self.enterpriseStandBtn.isHidden = true
488   - self.unStandBtnBgView.isHidden = true
489   - }else if !idModel!.userAuth && !idModel!.enterpriseAuth && idModel!.agencyAuth{
490   - //机构
491   - self.addStandBtn.isHidden = false
492   - self.addStandBtn.setTitle("机构认证", for: .normal)
493   - self.personalStandBtn.isHidden = true
494   - self.enterpriseStandBtn.isHidden = true
495   - self.unStandBtnBgView.isHidden = true
496   - }else if idModel!.userAuth && idModel!.enterpriseAuth && idModel!.agencyAuth{
497   - //个人+企业+机构
498   - self.addStandBtn.isHidden = true
499   - self.personalStandBtn.isHidden = true
500   - self.enterpriseStandBtn.isHidden = true
501   - self.unStandBtnBgView.isHidden = false
502   - self.setUnStandBtnBgViewLayer(startHex: newValue!.atPersonageColour, endHex: newValue!.backgroundColor)
503   - }else if !idModel!.userAuth && !idModel!.enterpriseAuth && !idModel!.agencyAuth{
504   - //无企业和个人
505   - //不显示认证按钮
506   - self.addStandBtn.isHidden = true
507   - self.personalStandBtn.isHidden = true
508   - self.enterpriseStandBtn.isHidden = true
509   - self.unStandBtnBgView.isHidden = true
510   - }
  465 + //显示 个人 企业 机构
  466 + self.addStandBtn.isHidden = true
  467 + self.personalStandBtn.isHidden = true
  468 + self.enterpriseStandBtn.isHidden = true
  469 + self.unStandBtnBgView.isHidden = false
  470 + self.setUnStandBtnBgViewLayer(startHex: newValue!.atPersonageColour, endHex: newValue!.backgroundColor)
  471 +
  472 + textViewBgImgView.kf.setImage(with: URL(string: _idModel!.descBackgroundImg), placeholder: UIImage(named: "homepage_desc_bgImg"))
  473 +
  474 +// if idModel!.userAuth{
  475 +// //显示数字认证
  476 +//
  477 +// self.addStandBtn.isHidden = true
  478 +// self.personalStandBtn.isHidden = false
  479 +// self.enterpriseStandBtn.isHidden = false
  480 +// unStandBtnBgView.isHidden = true
  481 +// //个人+企业
  482 +// self.personalStandBtn.setTitle("个人认证", for: .normal)
  483 +// self.enterpriseStandBtn.setTitle("企业认证", for: .normal)
  484 +// }else if idModel!.userAuth && idModel!.agencyAuth && !idModel!.enterpriseAuth{
  485 +// self.addStandBtn.isHidden = true
  486 +// self.personalStandBtn.isHidden = false
  487 +// self.enterpriseStandBtn.isHidden = false
  488 +// unStandBtnBgView.isHidden = true
  489 +// //个人+机构
  490 +// self.personalStandBtn.setTitle("个人认证", for: .normal)
  491 +// self.enterpriseStandBtn.setTitle("机构认证", for: .normal)
  492 +// }else if idModel!.enterpriseAuth && idModel!.agencyAuth && !idModel!.userAuth{
  493 +// self.addStandBtn.isHidden = true
  494 +// self.personalStandBtn.isHidden = false
  495 +// self.enterpriseStandBtn.isHidden = false
  496 +// unStandBtnBgView.isHidden = true
  497 +// //企业+机构
  498 +// self.personalStandBtn.setTitle("企业认证", for: .normal)
  499 +// self.enterpriseStandBtn.setTitle("机构认证", for: .normal)
  500 +// }else if idModel!.userAuth && !idModel!.enterpriseAuth && !idModel!.agencyAuth{
  501 +// //个人
  502 +// self.addStandBtn.isHidden = false
  503 +// self.addStandBtn.setTitle("个人认证", for: .normal)
  504 +// self.personalStandBtn.isHidden = true
  505 +// self.enterpriseStandBtn.isHidden = true
  506 +// self.unStandBtnBgView.isHidden = true
  507 +// }else if !idModel!.userAuth && idModel!.enterpriseAuth && !idModel!.agencyAuth{
  508 +// //企业
  509 +// self.addStandBtn.isHidden = false
  510 +// self.addStandBtn.setTitle("企业认证", for: .normal)
  511 +// self.personalStandBtn.isHidden = true
  512 +// self.enterpriseStandBtn.isHidden = true
  513 +// self.unStandBtnBgView.isHidden = true
  514 +// }else if !idModel!.userAuth && !idModel!.enterpriseAuth && idModel!.agencyAuth{
  515 +// //机构
  516 +// self.addStandBtn.isHidden = false
  517 +// self.addStandBtn.setTitle("机构认证", for: .normal)
  518 +// self.personalStandBtn.isHidden = true
  519 +// self.enterpriseStandBtn.isHidden = true
  520 +// self.unStandBtnBgView.isHidden = true
  521 +// }else if idModel!.userAuth && idModel!.enterpriseAuth && idModel!.agencyAuth{
  522 +// //个人+企业+机构
  523 +// self.addStandBtn.isHidden = true
  524 +// self.personalStandBtn.isHidden = true
  525 +// self.enterpriseStandBtn.isHidden = true
  526 +// self.unStandBtnBgView.isHidden = false
  527 +// self.setUnStandBtnBgViewLayer(startHex: newValue!.atPersonageColour, endHex: newValue!.backgroundColor)
  528 +// }else if !idModel!.userAuth && !idModel!.enterpriseAuth && !idModel!.agencyAuth{
  529 +// //无企业和个人
  530 +// //不显示认证按钮
  531 +// self.addStandBtn.isHidden = true
  532 +// self.personalStandBtn.isHidden = true
  533 +// self.enterpriseStandBtn.isHidden = true
  534 +// self.unStandBtnBgView.isHidden = true
  535 +// }
511 536  
512 537 //有企业认证显示提示lbl
513   - if idModel!.enterpriseAuth{
514   - self.enterpriseTipsLabel.isHidden = false
515   - self.enterpriseTipsLabel.textColor = HexColor(newValue!.tipsColour)
516   - }else{
517   - self.enterpriseTipsLabel.isHidden = true
518   - }
519   - //有机构认证显示提示lbl
520   - if idModel!.agencyAuth{
521   - self.agencyTipsLabel.isHidden = false
522   - self.agencyTipsLabel.textColor = HexColor(newValue!.tipsColour)
523   - }else{
524   - self.agencyTipsLabel.isHidden = false
525   - }
  538 +// if idModel!.enterpriseAuth{
  539 +// self.enterpriseTipsLabel.isHidden = false
  540 +// self.enterpriseTipsLabel.textColor = HexColor(newValue!.tipsColour)
  541 +// }else{
  542 +// self.enterpriseTipsLabel.isHidden = true
  543 +// }
  544 +// //有机构认证显示提示lbl
  545 +// if idModel!.agencyAuth{
  546 +// self.agencyTipsLabel.isHidden = false
  547 +// self.agencyTipsLabel.textColor = HexColor(newValue!.tipsColour)
  548 +// }else{
  549 +// self.agencyTipsLabel.isHidden = false
  550 +// }
526 551  
527 552 }
528 553  
529 554 self.addStandBtn.backgroundColor = HexColor(newValue!.backgroundColor)
530   - frontCardContentView.isHidden = true
  555 +// frontCardContentView.isHidden = true
531 556 //显示textview 添加身份
532 557 textView.text = newValue!.description
533 558  
... ... @@ -546,9 +571,9 @@ class CNFrontMainView : UIView{
546 571 downMoreGIF.kf.setImage(with: URL(string: newValue!.downGuideImg))
547 572  
548 573 //个人认证,企业认证
549   - personalStandBtn.backgroundColor = HexColor(newValue!.atPersonageColour)
  574 +// personalStandBtn.backgroundColor = HexColor(newValue!.atPersonageColour)
550 575 enterpriseStandBtn.backgroundColor = HexColor(newValue!.backgroundColor)
551   - textViewBgImgView.kf.setImage(with: URL(string: _idModel!.descBackgroundImg), placeholder: UIImage(named: "homepage_desc_bgImg"))
  576 +// textViewBgImgView.kf.setImage(with: URL(string: _idModel!.descBackgroundImg), placeholder: UIImage(named: "homepage_desc_bgImg"))
552 577 }
553 578 }
554 579 }
... ... @@ -602,7 +627,7 @@ class CNFrontMainView : UIView{
602 627 {
603 628 self.addSubview(self.frontTotolContentView)
604 629 self.frontTotolContentView.addSubview(self.frontDescContentView)
605   - self.frontTotolContentView.addSubview(self.frontCardContentView)
  630 +// self.frontTotolContentView.addSubview(self.frontCardContentView)
606 631  
607 632 self.makeConstraints()
608 633 }
... ... @@ -624,11 +649,14 @@ class CNFrontMainView : UIView{
624 649 var type: CNLiveMineInputAuthType = .person
625 650 if self.idModel!.userAuth{
626 651 type = .person
627   - }else if self.idModel!.enterpriseAuth{
  652 + }else{
628 653 type = .enterprise
629   - }else if self.idModel!.agencyAuth{
630   - type = .agency
631 654 }
  655 +// else if self.idModel!.enterpriseAuth{
  656 +// type = .enterprise
  657 +// }else if self.idModel!.agencyAuth{
  658 +// type = .agency
  659 +// }
632 660 self.btnClickAuthType = type
633 661 self.getStandInfo(identityId:String(self.idModel!.id))
634 662 }
... ... @@ -639,9 +667,12 @@ class CNFrontMainView : UIView{
639 667 var type: CNLiveMineInputAuthType = .person
640 668 if self.idModel!.userAuth{
641 669 type = .person
642   - }else if self.idModel!.enterpriseAuth{
  670 + }else{
643 671 type = .enterprise
644 672 }
  673 +// else if self.idModel!.enterpriseAuth{
  674 +// type = .enterprise
  675 +// }
645 676 self.btnClickAuthType = type
646 677 self.getStandInfo(identityId:String(self.idModel!.id))
647 678 }
... ... @@ -649,11 +680,12 @@ class CNFrontMainView : UIView{
649 680 //跳转到 2个按钮时 第二个认证页面
650 681 //个人+企业 个人+机构 企业+机构
651 682 var type: CNLiveMineInputAuthType = .enterprise
652   - if self.idModel!.enterpriseAuth{
653   - type = .enterprise
654   - }else if self.idModel!.agencyAuth{
655   - type = .agency
656   - }
  683 + type = .enterprise
  684 +// if self.idModel!.enterpriseAuth{
  685 +// type = .enterprise
  686 +// }else if self.idModel!.agencyAuth{
  687 +// type = .agency
  688 +// }
657 689 self.btnClickAuthType = type
658 690 self.getStandInfo(identityId:String(self.idModel!.id))
659 691 }
... ...
metaCode/Classes/Main/MinePage/Controller/CNLiveMineAddInfoViewController.swift
... ... @@ -204,7 +204,7 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel
204 204 func checkAlreadyAuthStatue() {
205 205 for item in self.dataArray {
206 206 let authModel = item as! StandListModel
207   - if authModel.auth {
  207 + if authModel.userAuth {
208 208 NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthSortNotificationResult, object: nil)
209 209 break
210 210 }
... ... @@ -290,7 +290,9 @@ extension CNLiveMineAddInfoViewController {
290 290 return MineInfoLListTableViewCell()
291 291 }
292 292 let listModel = dataArray[indexPath.row] as! StandListModel
293   - cell.setupWithDataSource(icon: listModel.icon!, name: listModel.name!, is_auth: listModel.auth)
  293 + cell.setupWithDataSource(icon: "", name: listModel.name!, is_auth: listModel.userAuth)
  294 +
  295 +// cell.setupWithDataSource(icon: listModel.icon!, name: listModel.name!, is_auth: listModel.auth)
294 296 cell.userInteractionEnabledWhileDragging = true
295 297 return cell
296 298  
... ... @@ -319,7 +321,7 @@ extension CNLiveMineAddInfoViewController {
319 321 }
320 322 if _show_type == .add {
321 323 let listModel = dataArray[indexPath.row] as! StandListModel
322   - if listModel.auth {
  324 + if listModel.userAuth {
323 325 showMessage(message: "您已添加此身份,请直接使用")
324 326 return
325 327 }
... ...
metaCode/Classes/Main/MinePage/Controller/CNLiveMineAuthFormViewController.swift
... ... @@ -29,21 +29,16 @@ class CNLiveMineAuthFormViewController: CNLiveBaseViewController, UITableViewDel
29 29 lazy var dataArray: NSMutableArray = {
30 30 let array = NSMutableArray.init()
31 31 if _listModel.userAuth {
32   - array.add(["back":"mine_form_auth_btn_persion","icon":"mine_form_auth_btn_persion_icon","name":"个人认证","desc":"适合个人创作者、行业专家、自媒体领域"])
33   - }
34   - if _listModel.enterpriseAuth && _listModel.agencyAuth {
  32 +
  33 + }else{
  34 + let dict03 = ["back":"mine_form_auth_btn_persion","icon":"mine_form_auth_btn_persion_icon","name":"个人认证","desc":"适合个人创作者、行业专家、自媒体领域"]
35 35 let dict01 = ["back":"mine_form_auth_btn_formal_larg","icon":"mine_form_auth_btn_enterprise_icon","name":"企业认证","desc":"适合企业、个体工商户"]
36 36 let dict02 = ["back":"mine_form_auth_btn_formal_larg","icon":"mine_form_auth_btn_agency_icon","name":"机构认证","desc":"适合国家机构、社会组织、高校等"]
37 37 let temp_array = NSMutableArray()
38 38 temp_array.add(dict01)
39 39 temp_array.add(dict02)
  40 + temp_array.add(dict03)
40 41 array.add(temp_array as! [Dictionary<String,String>])
41   - } else {
42   - if _listModel.enterpriseAuth {
43   - array.add(["back":"mine_form_auth_btn_formal","icon":"mine_form_auth_btn_enterprise_icon","name":"企业认证","desc":"适合企业、个体工商户"])
44   - }else if _listModel.agencyAuth {
45   - array.add(["back":"mine_form_auth_btn_formal","icon":"mine_form_auth_btn_agency_icon","name":"机构认证","desc":"适合国家机构、社会组织、高校等"])
46   - }
47 42 }
48 43 return array
49 44 }()
... ...
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
... ... @@ -137,29 +137,39 @@ class StandListBaseModel: BaseModel {
137 137 final class StandListModel: BaseModel {//, TableCodable {
138 138  
139 139 var id: Int = 0//ID号- 9:电商,其他非电商
140   - var name: String?//名称-
141   - var icon: String?//小圆图标-
142   - var createTime: Int = 0//注册时间-
143   - var enable: Bool = false//没用-
  140 + var description: String = ""//首页身份说明描述-
144 141 var backgroundImg: String = ""//首页背景图-
145   - var upGuideImg: String = ""//顶部引导图GiF url-
146 142 var downGuideImg: String = ""//底部引导图GiF url-
147   - var backgroundColor: String = kCNDownSlideBackgroundColorHex//企业认证按钮背景色&&认证背景颜色
148   - var atPersonageColour: String = kCNDownSlideBackgroundColorHex//个人认证按钮背景色-
149   - var backgroundColour: String = ""//-
150 143 var tipsColour: String = ""//-企业,机构 提醒文本颜色
151   - var description: String = ""//首页身份说明描述-
  144 + var backgroundColour: String = ""//-
  145 + var backgroundColor: String = kCNDownSlideBackgroundColorHex//企业认证按钮背景色&&认证背景颜色
  146 + var upGuideImg: String = ""//顶部引导图GiF url-
152 147 var descBackgroundImg: String = ""//首页文字背景图
153   - var cardImg: String = ""//卡片背景图-
154   - var cardBackgroundImg: String = ""//首页卡片背景图
155   - var upPath: String = ""//顶部h5 或原生页面pageId
  148 + var createTime: Int = 0//注册时间-
156 149 var upType: Int = 0//下滑类型1:h5 2:原生页面 3店铺详情 4 店铺控制台
157   - var downType: Int = 0//上滑类型1:h5 2:原生页面 3店铺详情 4 店铺控制台
  150 + var upPath: String = ""//顶部h5 或原生页面pageId
158 151 var downPath: String = ""//底部h5url 或原生页面pageId-
159   - var userAuth: Bool = true//是否显示个人认证
160   - var enterpriseAuth: Bool = false//是否显示企业认证
161   - var agencyAuth: Bool = false//是否显示机构认证
162   - var auth: Bool = false//身份是否验证
  152 + var downType: Int = 0//上滑类型1:h5 2:原生页面 3店铺详情 4 店铺控制台
  153 + var name: String?//名称-
  154 +
  155 + var status:Int = 0//
  156 + var sort:Int = 0//
  157 + var industryIds:String = ""
  158 + var industries: String = ""//
  159 +
  160 + //行业认证model
  161 + var authenticationsModel = [MineAuthenticationsChildModel]()
  162 + var userAuth:Bool = false//是否有 数字认证
  163 +
  164 +// var icon: String?//小圆图标-
  165 +// var enable: Bool = false//没用-
  166 + var atPersonageColour: String = kCNDownSlideBackgroundColorHex//个人认证按钮背景色-
  167 +// var cardImg: String = ""//卡片背景图-
  168 +// var cardBackgroundImg: String = ""//首页卡片背景图
  169 +// var userAuth: Bool = true//是否显示个人认证
  170 +// var enterpriseAuth: Bool = false//是否显示企业认证
  171 +// var agencyAuth: Bool = false//是否显示机构认证
  172 +// var auth: Bool = false//身份是否验证
163 173  
164 174 var createTimeString: String = ""//-
165 175 var timeString: String = ""
... ... @@ -176,9 +186,7 @@ final class StandListModel: BaseModel {//, TableCodable {
176 186  
177 187 if lhs.id == rhs.id &&
178 188 lhs.name == rhs.name &&
179   - lhs.icon == rhs.icon &&
180 189 lhs.createTime == rhs.createTime &&
181   - lhs.enable == rhs.enable &&
182 190 lhs.backgroundImg == rhs.backgroundImg &&
183 191 lhs.upGuideImg == rhs.upGuideImg &&
184 192 lhs.downGuideImg == rhs.downGuideImg &&
... ... @@ -251,6 +259,47 @@ final class StandListModel: BaseModel {//, TableCodable {
251 259 // }
252 260 }
253 261  
  262 +// !!!: /api/contentApi/authentications 接口标记
  263 +class MineAuthenticationsBaseModel: BaseModel {
  264 + var data = [MineAuthenticationsChildModel]()//
  265 +}
  266 +class MineAuthenticationsChildModel: BaseModel {
  267 + var industryId: Int = 0
  268 + var name: String = ""
  269 + var child = [MineAuthenticationsChildModel]()//卡片标签
  270 + var identities = [MineAuthenticationsChildIdentitiesModel]()//报名项说明
  271 +}
  272 +class MineAuthenticationsChildIdentitiesModel: BaseModel {
  273 + var id: Int = 0
  274 + var industryId: Int = 0
  275 + var name: String = ""
  276 + var icon: String = ""
  277 + var createTime: Int = 0
  278 + var auth: Bool = false
  279 + var status: Int = 0
  280 + var sort: Int = 0
  281 + var type: Int = 0
  282 + var userAuth: Int = 0
  283 +}
  284 +
  285 +// !!!: /api/identityApi/getUserMsg 接口标记
  286 +class MineGetUserMsgUsersModel: BaseModel {
  287 + var id: Int = 0
  288 + var nick: String = ""
  289 + var icon: String = ""
  290 + var phone: String = ""
  291 + var createTime:String = ""
  292 + var verifySid:String = ""
  293 + var verifyUsers = [MineGetUserMsgVerifyUsersModel]()
  294 +
  295 +}
  296 +class MineGetUserMsgVerifyUsersModel: BaseModel {
  297 + var vsid: String = ""
  298 + var name: String = ""
  299 + var idNo: String = ""
  300 + var createTime: String = ""
  301 +}
  302 +
254 303 // !!!: /api/identityApi/getIdentity 接口标记
255 304 class MineStandInfoBaseModel: BaseModel {
256 305 var authInfos = [MineStandInfoModel]()//个人认证
... ...
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
... ... @@ -477,7 +477,7 @@ class CNLiveMineViewModel: NSObject {
477 477 }
478 478 }
479 479  
480   - /// 获取身份信息列表数据
  480 + /// 获取频道列表数据
481 481 /// - Parameters:
482 482 /// - page: 页数
483 483 /// - resultBlock: 返回
... ... @@ -492,7 +492,7 @@ class CNLiveMineViewModel: NSObject {
492 492 CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
493 493 CNLiveNetworking.setAllowRequestDefaultArgument(true)
494 494 CNLiveNetworking.setupShowDataResult(false)
495   - CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseMCUrl+"/identityApi/allList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
  495 + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseMCUrl+"/contentApi/channels", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
496 496 hiddenLoading()
497 497 if (error == nil) {
498 498 let resp = result as! NSDictionary
... ... @@ -538,6 +538,43 @@ class CNLiveMineViewModel: NSObject {
538 538 }
539 539 }
540 540  
  541 + /// 获取用户信息
  542 + /// - Parameters:
  543 + /// - page: 页数
  544 + /// - resultBlock: 返回
  545 + static func requestGetUserMsg(sid: String, resultBlock: @escaping resultNewsBlock) {
  546 + let param = NSMutableDictionary()
  547 + param.setValue(sid, forKey: "sid")
  548 + let custom_param = NSMutableDictionary()
  549 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId")
  550 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey, forKey: "appKey")
  551 + CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
  552 + CNLiveNetworking.setAllowRequestDefaultArgument(true)
  553 + CNLiveNetworking.setupShowDataResult(false)
  554 + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseMCUrl+"/identityApi/getUserMsg", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
  555 + hiddenLoading()
  556 + if (error == nil) {
  557 + let resp = result as! NSDictionary
  558 + let errorCode = "\(resp["errorCode"] ?? "0")"
  559 + if (errorCode == "0") {
  560 + let listModel = dictionaryToModel(resp as! [String : Any], MineGetUserMsgUsersModel.self,"data") as! MineGetUserMsgUsersModel
  561 + resultBlock(listModel,.success)
  562 + } else {
  563 + showMessage(message: resp["errorMessage"] as! String)
  564 + resultBlock(NSNull(),.failed)
  565 + }
  566 + } else {
  567 + if CNLiveNetworking.isNetworking() {
  568 + showMessage(message: "获取失败")
  569 + resultBlock(NSNull(),.failed)
  570 + } else {
  571 + showMessage(message: "似乎与网络断开链接")
  572 + resultBlock(NSNull(),.noNetwork)
  573 + }
  574 + }
  575 + }
  576 + }
  577 +
541 578 /// 获取已认证身份列表
542 579 /// - Parameters:
543 580 /// - page: 页数
... ... @@ -669,6 +706,58 @@ class CNLiveMineViewModel: NSObject {
669 706 }
670 707 }
671 708  
  709 + /// 获取行业认证列表
  710 + /// - Parameters:
  711 + /// - channelId: 频道 channelId
  712 + /// - sid: 用户id
  713 + /// - vsid: 实名id
  714 + /// - resultBlock: 返回
  715 + static func requestsIndustryInfo(channelId: String, sid: String, vsid: String,resultBlock: @escaping resultNewsBlock) {
  716 + let param = NSMutableDictionary()
  717 +// param.setValue("1342671", forKey: "sid")//
  718 +// param.setValue("2", forKey: "vsid")
  719 + param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid")
  720 + param.setValue(vsid, forKey: "vsid")
  721 + param.setValue(channelId, forKey: "channelId")
  722 + let custom_param = NSMutableDictionary()
  723 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId")
  724 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey, forKey: "appKey")
  725 + CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
  726 + CNLiveNetworking.setAllowRequestDefaultArgument(true)
  727 + CNLiveNetworking.setupShowDataResult(false)
  728 + CNLiveNetworking.setupShowResult(true)
  729 + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseMCUrl+"/contentApi/authentications", param: param as! [String: String], cacheType: .networkOnly) { task, result, error in
  730 + hiddenLoading()
  731 + if (error == nil) {
  732 + let resp = result as! NSDictionary
  733 + let errorCode = "\(resp["errorCode"] ?? "0")"
  734 + if (errorCode == "0") {
  735 + if resp["data"] is NSNull {
  736 + resultBlock(NSNull(),.failed)
  737 + } else {
  738 + var resultArr = Array<MineAuthenticationsChildModel>()
  739 + let resArr = resp["data"] as! Array<[String:Any]>
  740 + resArr.forEach { dic in
  741 + let newsModel = newDictionaryToModel(dic, MineAuthenticationsChildModel.self) as! MineAuthenticationsChildModel
  742 + resultArr.append(newsModel)
  743 + }
  744 + resultBlock(resultArr,.success)
  745 + }
  746 + } else {
  747 + showMessage(message: resp["errorMessage"] as! String)
  748 + resultBlock(NSNull(),.failed)
  749 + }
  750 + } else {
  751 + if CNLiveNetworking.isNetworking() {
  752 + showMessage(message: "获取失败")
  753 + resultBlock(NSNull(),.failed)
  754 + } else {
  755 + showMessage(message: "似乎与网络断开链接")
  756 + resultBlock(NSNull(),.noNetwork)
  757 + }
  758 + }
  759 + }
  760 + }
672 761  
673 762 /// 获取身份信息数据
674 763 /// - Parameters:
... ...
metaCode/Classes/Other/AppDelegate.swift
... ... @@ -51,6 +51,23 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
51 51 let is_login = UserDefaults.standard.bool(forKey: "is_login")
52 52 window?.rootViewController = is_login ? CNLiveBaseTabBarViewController.init() : UINavigationController(rootViewController: CNLiveLoginViewController.init())
53 53 window?.makeKeyAndVisible()
  54 + if is_login{
  55 + //获取用户信息 /api/identityApi/getUserMsg
  56 + CNLiveMineViewModel.requestGetUserMsg(sid: UserInfoManager.shared.userInfo.uid) { result, respStatue in
  57 + if respStatue == .success{
  58 + if let res = result as? MineGetUserMsgUsersModel{
  59 + let userInfo = UserInfoManager.shared.userInfo
  60 + userInfo.userMsgUsers = res
  61 + userInfo.currentUser = res.verifyUsers.first
  62 + UserInfoManager.cacheUserInfo(userInfo: userInfo)
  63 + }
  64 + }
  65 + }
  66 +
  67 +
  68 + }
  69 +
  70 +
54 71  
55 72 ///设置APM监控SDK
56 73 // let apmConfig = RangersAPMConfig.init(appID: "591048", appToken: "8dcc7f8b0a3a4aee8ef698311ef89a62")
... ...