Commit 1af7f5eb650c0e3a831252e74aba6ade20093b94

Authored by “张旭”
1 parent 67136295

3个认证状态的逻辑

metaCode.xcodeproj/project.pbxproj
... ... @@ -2070,7 +2070,7 @@
2070 2070 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
2071 2071 CODE_SIGN_IDENTITY = "Apple Development";
2072 2072 CODE_SIGN_STYLE = Automatic;
2073   - CURRENT_PROJECT_VERSION = 1.0.4.24.01.22.17;
  2073 + CURRENT_PROJECT_VERSION = 1.0.4.24.01.26.17;
2074 2074 DEVELOPMENT_TEAM = 94X49GG3ZW;
2075 2075 ENABLE_BITCODE = NO;
2076 2076 ENABLE_MODULE_VERIFIER = NO;
... ... @@ -2324,7 +2324,7 @@
2324 2324 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
2325 2325 CODE_SIGN_IDENTITY = "Apple Development";
2326 2326 CODE_SIGN_STYLE = Automatic;
2327   - CURRENT_PROJECT_VERSION = 1.0.4.24.01.22.17;
  2327 + CURRENT_PROJECT_VERSION = 1.0.4.24.01.26.17;
2328 2328 DEVELOPMENT_TEAM = 94X49GG3ZW;
2329 2329 ENABLE_BITCODE = NO;
2330 2330 ENABLE_MODULE_VERIFIER = NO;
... ...
metaCode/Classes/Main/HomePage/Controller/AuthMainController/CNMetaCodeHomePageController.swift
... ... @@ -673,7 +673,9 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
673 673 let standInfoBaseModel = result as! MineStandInfoBaseModel
674 674 self.dataArray.forEach { standListModel in
675 675 let listModel = standListModel as! StandListModel
676   - listModel.standInfoBaseModel = standInfoBaseModel
  676 + if listModel.id == standInfoBaseModel.identityId{
  677 + listModel.standInfoBaseModel = standInfoBaseModel
  678 + }
677 679 }
678 680  
679 681 if standInfoBaseModel.authInfos.count > 0{
... ...
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNMainView.swift
... ... @@ -16,7 +16,9 @@ let KTransformAnimationTime:CGFloat = 0.75;
16 16 class CNFrontMainView : UIView{
17 17 ///点击反转事件
18 18 var tapTransformAciton:closureBlock?
19   -
  19 + let delegate = UIApplication.shared.delegate as! AppDelegate
  20 + var standInfoSubTitleModel:MineStandInfoSubTitleModel?//17时弹窗的跳转model
  21 +
20 22 override init(frame: CGRect) {
21 23 super.init(frame: frame)
22 24 self.initUI()
... ... @@ -150,13 +152,116 @@ class CNFrontMainView : UIView{
150 152 enterpriseStandBtn.isHidden = true
151 153 return enterpriseStandBtn
152 154 }()
  155 +
  156 + ///未认证-3个认证按钮的 第1个
  157 + lazy var StandBtn1: UIButton = {
  158 + //第1个按钮
  159 + let StandBtn1 = UIButton(type: .custom)
  160 + StandBtn1.setTitle("个人认证", for: .normal)
  161 + StandBtn1.setTitleColor(HexColor("#FFFFFF"), for: .normal)
  162 + StandBtn1.titleLabel?.font = UIFont.init(name: "PingFangSC-Medium", size: 14)
  163 + StandBtn1.addTarget(self, action: #selector(StandBtn1Action), for: .touchUpInside)
  164 + return StandBtn1
  165 + }()
  166 + ///未认证-3个认证按钮的 第2个
  167 + lazy var StandBtn2: UIButton = {
  168 + //第2个按钮
  169 + let StandBtn2 = UIButton(type: .custom)
  170 + StandBtn2.setTitle("企业认证", for: .normal)
  171 + StandBtn2.setTitleColor(HexColor("#FFFFFF"), for: .normal)
  172 + StandBtn2.titleLabel?.font = UIFont.init(name: "PingFangSC-Medium", size: 14)
  173 + StandBtn2.addTarget(self, action: #selector(StandBtn2Action), for: .touchUpInside)
  174 + return StandBtn2
  175 + }()
  176 + ///未认证-3个认证按钮的 第3个
  177 + lazy var StandBtn3: UIButton = {
  178 + //第3个按钮
  179 + let StandBtn3 = UIButton(type: .custom)
  180 + StandBtn3.setTitle("机构认证", for: .normal)
  181 + StandBtn3.setTitleColor(HexColor("#FFFFFF"), for: .normal)
  182 + StandBtn3.titleLabel?.font = UIFont.init(name: "PingFangSC-Medium", size: 14)
  183 + StandBtn3.addTarget(self, action: #selector(StandBtn3Action), for: .touchUpInside)
  184 + return StandBtn3
  185 + }()
  186 + lazy var line1View :UIView = {
  187 + let line1View = UIView(frame: CGRect(x: 0, y: 0, width: 0.5, height: 10))
  188 + line1View.backgroundColor = HexColor("#FEFFFF")
  189 + return line1View
  190 + }()
  191 + lazy var line2View :UIView = {
  192 + let line2View = UIView(frame: CGRect(x: 0, y: 0, width: 0.5, height: 10))
  193 + line2View.backgroundColor = HexColor("#FEFFFF")
  194 + return line2View
  195 + }()
  196 +
153 197 //未认证-3个认证按钮背景图
154 198 lazy var unStandBtnBgView :UIView = {
155 199 let unStandBtnBgView = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
156   - unStandBtnBgView.backgroundColor = .red
  200 + unStandBtnBgView.layer.cornerRadius = 18
  201 + unStandBtnBgView.clipsToBounds = true
  202 +
  203 + unStandBtnBgView.addSubview(self.StandBtn1)
  204 + StandBtn1.snp.makeConstraints { make in
  205 + make.left.equalToSuperview()
  206 + make.top.equalToSuperview()
  207 + make.width.equalTo((self.width-60)/3)
  208 + make.height.equalTo(36)
  209 + }
  210 + unStandBtnBgView.addSubview(self.StandBtn2)
  211 + StandBtn2.snp.makeConstraints { make in
  212 + make.centerX.equalToSuperview()
  213 + make.top.equalToSuperview()
  214 + make.width.equalTo(self.StandBtn1.snp.width)
  215 + make.height.equalTo(36)
  216 + }
  217 + unStandBtnBgView.addSubview(self.StandBtn3)
  218 + StandBtn3.snp.makeConstraints { make in
  219 + make.right.equalToSuperview()
  220 + make.top.equalToSuperview()
  221 + make.width.equalTo(self.StandBtn1.snp.width)
  222 + make.height.equalTo(36)
  223 + }
  224 +
  225 + unStandBtnBgView.addSubview(self.line1View)
  226 + line1View.snp.makeConstraints { make in
  227 + make.centerX.equalTo(self.StandBtn1.snp.right)
  228 + make.centerY.equalToSuperview()
  229 + make.width.equalTo(0.5)
  230 + make.height.equalTo(10)
  231 + }
  232 + unStandBtnBgView.addSubview(self.line2View)
  233 + line2View.snp.makeConstraints { make in
  234 + make.centerX.equalTo(self.StandBtn2.snp.right)
  235 + make.centerY.equalToSuperview()
  236 + make.width.equalTo(0.5)
  237 + make.height.equalTo(10)
  238 + }
  239 +
157 240 return unStandBtnBgView
158 241 }()
  242 + /// 未认证-inputType17时弹窗背景图
  243 + lazy var alertBgImgView:UIImageView = {
  244 + let alertBgImgView:UIImageView = UIImageView()
  245 + alertBgImgView.tag = 20001
  246 + alertBgImgView.isUserInteractionEnabled = true
  247 + let ges = UITapGestureRecognizer(target: self, action: #selector(alertBgImgViewClickAction))
  248 + alertBgImgView.addGestureRecognizer(ges)
159 249  
  250 + return alertBgImgView
  251 + }()
  252 + /// 未认证-inputType17时弹窗背景图蒙版
  253 + lazy var alertBgView:UIView = {
  254 + let alertBgView:UIView = UIView(frame: CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenHeight))
  255 + alertBgView.backgroundColor = HexColor("#000000")
  256 + alertBgView.alpha = 0.6
  257 + alertBgView.isUserInteractionEnabled = true
  258 + alertBgView.tag = 20000
  259 +
  260 + let ges = UITapGestureRecognizer(target: self, action: #selector(alertBgViewClickAction))
  261 + alertBgView.addGestureRecognizer(ges)
  262 +
  263 + return alertBgView
  264 + }()
160 265  
161 266 //上滑更多Gif
162 267 lazy var upMoreGIF: UIImageView = {
... ... @@ -171,6 +276,7 @@ class CNFrontMainView : UIView{
171 276 return downMoreGIF
172 277 }()
173 278  
  279 + // MARK: - 已认证
174 280 ///已认证-前置视图卡片容器
175 281 lazy var frontCardContentView : UIView = {
176 282  
... ... @@ -350,11 +456,11 @@ class CNFrontMainView : UIView{
350 456 self.enterpriseStandBtn.isHidden = true
351 457 self.unStandBtnBgView.isHidden = true
352 458 }else if idModel?.isPersonOrEnterprise == 4{//个人+企业+机构
353   - //显示认证按钮
354 459 self.addStandBtn.isHidden = true
355 460 self.personalStandBtn.isHidden = true
356 461 self.enterpriseStandBtn.isHidden = true
357 462 self.unStandBtnBgView.isHidden = false
  463 + self.setUnStandBtnBgViewLayer(startHex: newValue!.atPersonageColour, endHex: newValue!.backgroundColor)
358 464 }else if idModel?.isPersonOrEnterprise == 5{//机构
359 465 self.addStandBtn.isHidden = false
360 466 self.addStandBtn.setTitle("机构认证", for: .normal)
... ... @@ -407,6 +513,35 @@ class CNFrontMainView : UIView{
407 513 }
408 514 }
409 515  
  516 + let unStandBtnBgViewLayer = "unStandBtnBgViewLayer"
  517 + func setUnStandBtnBgViewLayer(startHex:String,endHex:String){
  518 + let payLayer = self.subLayer(name: unStandBtnBgViewLayer, viewLayer: self.unStandBtnBgView.layer)
  519 +
  520 + if (payLayer != nil){
  521 + //已添加layer
  522 + }else{
  523 + //未添加layer
  524 + let gradient = CAGradientLayer()
  525 + gradient.frame = self.bounds
  526 + gradient.colors = [HexColor(startHex)!.cgColor, HexColor(endHex)!.cgColor]
  527 + gradient.locations = [0, 1]
  528 + gradient.startPoint = CGPoint(x: 0, y: 0.43)
  529 + gradient.endPoint = CGPoint(x: 0.43, y: 0.43)
  530 + gradient.name = unStandBtnBgViewLayer
  531 + self.unStandBtnBgView.layer.insertSublayer(gradient, at: 0)
  532 + self.unStandBtnBgView.backgroundColor = .clear
  533 + }
  534 + }
  535 + func subLayer(name:String,viewLayer:CALayer) -> CALayer?{
  536 + if let subLayer = viewLayer.sublayers?.first(where: { $0.name == name }) {
  537 + // 这里可以对获取到的子图层进行操作或者访问其属性等
  538 + return subLayer
  539 + } else {
  540 +// print("未找到指定名称的图层")
  541 + return nil
  542 + }
  543 + }
  544 +
410 545 func initUI()
411 546 {
412 547 self.addSubview(self.frontTotolContentView)
... ... @@ -437,6 +572,71 @@ class CNFrontMainView : UIView{
437 572 self.pushStandVC(isPersonOrEnterprise: 2)
438 573 }
439 574  
  575 + @objc func StandBtn1Action() {
  576 + //跳转到 个人认证页面
  577 + self.pushStandVC(isPersonOrEnterprise: 1)
  578 + }
  579 + @objc func StandBtn2Action() {
  580 + //跳转到 企业认证页面
  581 + self.pushStandVC(isPersonOrEnterprise: 2)
  582 + }
  583 + @objc func StandBtn3Action() {
  584 + //跳转到 机构认证页面
  585 + self.pushStandVC(isPersonOrEnterprise: 3)
  586 + }
  587 +
  588 + // MARK: - 点击弹窗,按类型跳转
  589 + @objc func alertBgImgViewClickAction() {
  590 + //点击弹窗,按类型跳转
  591 + if self.standInfoSubTitleModel?.jumpType == UpDownTypeH5{
  592 + let webVC = CNWebViewController()
  593 + webVC.url = URL(string: self.standInfoSubTitleModel?.jumpPath ?? "")
  594 + navigationViewController().pushViewController(webVC, animated: pushAnimated)
  595 + }else if self.standInfoSubTitleModel?.jumpType == UpDownTypePage{
  596 + let upSlideVC = CNUpSlideViewController()
  597 + upSlideVC.downPath = self.standInfoSubTitleModel?.jumpPath ?? ""
  598 + navigationViewController().pushViewController(upSlideVC, animated: pushAnimated)
  599 + }else if self.standInfoSubTitleModel?.jumpType == UpDownTypeShopDetail{
  600 +
  601 + }else if self.standInfoSubTitleModel?.jumpType == UpDownTypeShopControlConsole{
  602 + let shopConsoleVC = CNLiveShopConsoleController()
  603 + navigationViewController().pushViewController(shopConsoleVC, animated: pushAnimated)
  604 + }else if self.standInfoSubTitleModel?.jumpType == UpDownTypeAuthAlertUp{
  605 +
  606 + let customIndexView = ((self.superview as! CNMainView).superview as! UIScrollView).superview as! CNCustomIndexView
  607 + let baseScrollView = customIndexView.baseScrollView
  608 + baseScrollView.setContentOffset(CGPoint(x: 0, y: 0), animated: true)
  609 + currentViewController()?.tabBarController?.tabBar.isHidden = false
  610 + customIndexView.superScrollView?.isScrollEnabled = true
  611 +
  612 + let time = DispatchTime.now() + 0.5
  613 + DispatchQueue.main.asyncAfter(deadline:time, execute: DispatchWorkItem(block: {
  614 + //下滑提醒View回到初始位置
  615 + customIndexView.downSlideViewRemindView.top = -((customIndexView.downSlideViewRemindView.height) + 50)
  616 + }))
  617 +
  618 + }else if self.standInfoSubTitleModel?.jumpType == UpDownTypeAuthAlertDown{
  619 + let customIndexView = ((self.superview as! CNMainView).superview as! UIScrollView).superview as! CNCustomIndexView
  620 + let baseScrollView = customIndexView.baseScrollView
  621 + baseScrollView.setContentOffset(CGPoint(x: 0, y: (baseScrollView.height*2+KNavigationHeight)), animated: true)
  622 + currentViewController()?.tabBarController?.tabBar.isHidden = false
  623 + customIndexView.superScrollView?.isScrollEnabled = true
  624 +
  625 + let time = DispatchTime.now() + 0.5
  626 + DispatchQueue.main.asyncAfter(deadline:time, execute: DispatchWorkItem(block: {
  627 + //下滑提醒View回到初始位置
  628 + customIndexView.downSlideViewRemindView.top = -((customIndexView.downSlideViewRemindView.height) + 50)
  629 + }))
  630 + }
  631 +
  632 + self.hiden17Alert()
  633 + }
  634 + @objc func alertBgViewClickAction() {
  635 + //点击蒙版隐藏view
  636 + self.hiden17Alert()
  637 + }
  638 +
  639 + // MARK: - 通用跳转认证页面 isPersonOrEnterprise 1个人 2企业 3机构
440 640 func pushStandVC(isPersonOrEnterprise:Int){
441 641 //跳转到 个人认证&企业认证 页面
442 642 if _idModel!.id == 9 {
... ... @@ -493,10 +693,60 @@ class CNFrontMainView : UIView{
493 693 }
494 694 }else if self._idModel!.isPersonOrEnterprise == 4{
495 695 //个人+企业+机构
496   - sdd
  696 + if (self._idModel?.standInfoBaseModel?.authInfos.first?.inputType == 17 && isPersonOrEnterprise == 1) || (self._idModel?.standInfoBaseModel?.enterpriseAuthInfos.first?.inputType == 17 && isPersonOrEnterprise == 2) || (self._idModel?.standInfoBaseModel?.agencyAuthInfos.first?.inputType == 17 && isPersonOrEnterprise == 3){
  697 + //弹窗
  698 + self.show17Alert(index: isPersonOrEnterprise)
  699 + return
  700 + }
  701 + var authType:CNLiveMineInputAuthType = .person
  702 + if isPersonOrEnterprise == 1{
  703 + authType = .person
  704 + }else if isPersonOrEnterprise == 2{
  705 + authType = .enterprise
  706 + }else if isPersonOrEnterprise == 3{
  707 + authType = .agency
  708 + }
  709 + navigationViewController().pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!, authType: authType), animated: pushAnimated)
497 710 }
498 711 }
499 712 }
  713 +
  714 + //弹出弹窗
  715 + func show17Alert(index:Int){
  716 + delegate.window?.addSubview(self.alertBgView)
  717 + delegate.window?.addSubview(self.alertBgImgView)
  718 + alertBgImgView.snp.makeConstraints { make in
  719 + make.centerX.equalToSuperview()
  720 + make.centerY.equalToSuperview()
  721 + make.width.equalTo(KSreenWidth-80)
  722 + make.height.equalTo((KSreenWidth-80)*170.5/295)
  723 + }
  724 +
  725 + var alertBgImgStr = ""
  726 + var subTitleModel:MineStandInfoSubTitleModel = MineStandInfoSubTitleModel()
  727 + if index == 1{
  728 + let subTitle = self.idModel?.standInfoBaseModel?.authInfos.first?.subTitle
  729 + subTitleModel = jsonToModel(subTitle ?? "", MineStandInfoSubTitleModel.self) as! MineStandInfoSubTitleModel
  730 + alertBgImgStr = subTitleModel.image ?? ""
  731 + }else if index == 2{
  732 + let subTitle = self.idModel?.standInfoBaseModel?.enterpriseAuthInfos.first?.subTitle
  733 + subTitleModel = jsonToModel(subTitle ?? "", MineStandInfoSubTitleModel.self) as! MineStandInfoSubTitleModel
  734 + alertBgImgStr = subTitleModel.image ?? ""
  735 + }else if index == 3{
  736 + let subTitle = self.idModel?.standInfoBaseModel?.agencyAuthInfos.first?.subTitle
  737 + subTitleModel = jsonToModel(subTitle ?? "", MineStandInfoSubTitleModel.self) as! MineStandInfoSubTitleModel
  738 + alertBgImgStr = subTitleModel.image ?? ""
  739 + }
  740 + self.alertBgImgView.kf.setImage(with: URL(string: alertBgImgStr))
  741 + self.standInfoSubTitleModel = subTitleModel
  742 + }
  743 + func hiden17Alert(){
  744 + delegate.window?.subviews.forEach({ view in
  745 + if view.tag >= 20000{
  746 + view.removeFromSuperview()
  747 + }
  748 + })
  749 + }
500 750 }
501 751  
502 752 ///反面View
... ...
metaCode/Classes/Main/HomePage/View/VerticalViews/UpSlide/CNUpSlideView.swift
... ... @@ -12,6 +12,8 @@ let UpDownTypeH5 = 1///h5
12 12 let UpDownTypePage = 2///原生page页面
13 13 let UpDownTypeShopDetail = 3///店铺详情
14 14 let UpDownTypeShopControlConsole = 4///店铺控制台
  15 +let UpDownTypeAuthAlertUp = 5///上滑地址 认证-弹窗
  16 +let UpDownTypeAuthAlertDown = 6///下滑地址 认证-弹窗
15 17  
16 18 ///上滑显示的VIew
17 19 class CNUpSlideView:UIView{
... ...
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
... ... @@ -257,7 +257,7 @@ class MineStandInfoModel: BaseModel {
257 257 }
258 258 class MineStandInfoSubTitleModel: BaseModel {
259 259 var image: String? = ""//弹窗图片
260   - var jumpType: String? = ""//弹窗点击跳转类型
  260 + var jumpType: Int = 0//弹窗点击跳转类型
261 261 var jumpPath: String? = ""//弹窗点击跳转地址
262 262 }
263 263  
... ...