Commit 364058fe authored by David黄金龙's avatar David黄金龙

Merge branch 'develop'

* develop: (179 commits)
  no message
  删除不使用的代码
  进度字体修改
  去除侧滑代码
  1、使用配置URL 2、修改版本号 0.2.10.5
  图片相应交互
  // 测评码UI更改
  // adhoc
  // add aps-environment
  // UI
  保存图片到相册
  解决复杂UI布局下 滑动返回失效问题
  // add tag 0.2.10-4
  // UI走查
  //  UI走查
  1、每页20请求数据 2、添加webView下方保存按钮的button
  //  关于我们
  去除banner空隙
  // push
  还原一处代码
  ...

# Conflicts:
#	galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
parents 3168859a 7fcf0883
......@@ -10,7 +10,15 @@
0414BDA92BC7E81500225367 /* YHMyPermissionSettingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0414BDA82BC7E81500225367 /* YHMyPermissionSettingVC.swift */; };
0414BDAB2BC7E9C200225367 /* YHMyPermissionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0414BDAA2BC7E9C200225367 /* YHMyPermissionCell.swift */; };
0414BDAD2BC7F02C00225367 /* YHMyNotifySettingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0414BDAC2BC7F02C00225367 /* YHMyNotifySettingVC.swift */; };
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.swift */; };
0414BDB22BCCC0A500225367 /* YHCollectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0414BDB12BCCC0A500225367 /* YHCollectionModel.swift */; };
04174D642BCD52BD000BA46D /* YHDeviceInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D632BCD52BD000BA46D /* YHDeviceInfoViewController.swift */; };
04174D732BCD5B74000BA46D /* YHMsgViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D672BCD5B74000BA46D /* YHMsgViewModel.swift */; };
04174D742BCD5B74000BA46D /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D692BCD5B74000BA46D /* IMAppKey.swift */; };
04174D762BCD5B74000BA46D /* YHMsgListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D6C2BCD5B74000BA46D /* YHMsgListModel.swift */; };
04174D772BCD5B74000BA46D /* YHMessageDetailListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D6E2BCD5B74000BA46D /* YHMessageDetailListVC.swift */; };
04174D782BCD5B74000BA46D /* YHMessageListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D6F2BCD5B74000BA46D /* YHMessageListVC.swift */; };
04174D792BCD5B74000BA46D /* YHMessageSessionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D712BCD5B74000BA46D /* YHMessageSessionCell.swift */; };
04174D7A2BCD5B74000BA46D /* YHDetailMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D722BCD5B74000BA46D /* YHDetailMessageCell.swift */; };
0425E63D2BA9345200A5E763 /* YHSchemeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */; };
0425E6402BA9357D00A5E763 /* YHScemeItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63F2BA9357D00A5E763 /* YHScemeItemModel.swift */; };
0425E6422BA95B1B00A5E763 /* YHSchemeTableFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E6412BA95B1B00A5E763 /* YHSchemeTableFooterView.swift */; };
......@@ -20,10 +28,6 @@
0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */; };
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; };
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA822BA2DEB100024EAE /* YHCardButton.swift */; };
043F0AB22BC781F5006CB887 /* YHMessageSessionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043F0AB12BC781F5006CB887 /* YHMessageSessionCell.swift */; };
043F0AB42BC7B80F006CB887 /* YHTestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043F0AB32BC7B80F006CB887 /* YHTestViewController.swift */; };
043F0AB62BC7CE1B006CB887 /* YHInformationFillVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043F0AB52BC7CE1B006CB887 /* YHInformationFillVC.swift */; };
043F0AB82BC7CE5C006CB887 /* YHInformationFillCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043F0AB72BC7CE5C006CB887 /* YHInformationFillCell.swift */; };
044413F72BC2786200784A14 /* YHHomeWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044413F62BC2786200784A14 /* YHHomeWebViewController.swift */; };
044413F92BC279D200784A14 /* YHHomeWebBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044413F82BC279D200784A14 /* YHHomeWebBottomView.swift */; };
044413FB2BC27E6F00784A14 /* YHHomeWebBottomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044413FA2BC27E6F00784A14 /* YHHomeWebBottomButton.swift */; };
......@@ -37,6 +41,7 @@
044867B42BA1953B00DFAD4A /* YHCertificateFilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B32BA1953B00DFAD4A /* YHCertificateFilterView.swift */; };
044867B62BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */; };
044867B82BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B72BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift */; };
044BACC72BCFA58E00184C64 /* YHNoDataTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044BACC62BCFA58E00184C64 /* YHNoDataTipsView.swift */; };
044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CF8D32BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift */; };
044CF8D62BBA57DC00008CE8 /* YHFailPromptView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CF8D52BBA57DC00008CE8 /* YHFailPromptView.swift */; };
044E1E812BC3BBC200A3B4AF /* YHSearchInfomationVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044E1E802BC3BBC200A3B4AF /* YHSearchInfomationVC.swift */; };
......@@ -215,6 +220,7 @@
045EEF232B9F171A0022A143 /* YHItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EEE762B9F171A0022A143 /* YHItemView.swift */; };
045EEF242B9F171A0022A143 /* YHStepView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EEE772B9F171A0022A143 /* YHStepView.swift */; };
045EEF252B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EEE782B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift */; };
04684A7F2BD6520A007D95B8 /* UIScrollView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04684A7E2BD6520A007D95B8 /* UIScrollView+Extension.swift */; };
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */; };
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; };
......@@ -226,7 +232,6 @@
0468D4312B5654C100CFB916 /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0468D42C2B56549200CFB916 /* libresolv.tbd */; };
0468D4362B57752F00CFB916 /* YHUserModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4352B57752F00CFB916 /* YHUserModel.swift */; };
0468D43A2B579EAC00CFB916 /* YHLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4392B579EAC00CFB916 /* YHLoginViewModel.swift */; };
047294E82B988A19008E0B84 /* YHNewWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047294E72B988A19008E0B84 /* YHNewWebViewController.swift */; };
04754A952B96FF3D00F8ADCA /* UITextField+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */; };
047619E92BA9867100F45358 /* YHCountryHotView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047619E82BA9867100F45358 /* YHCountryHotView.swift */; };
047619ED2BA9B9C900F45358 /* area.plist in Resources */ = {isa = PBXBuildFile; fileRef = 047619EC2BA9B9C900F45358 /* area.plist */; };
......@@ -238,6 +243,11 @@
0480976B2BA15269000B9DCA /* YHCertificateInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */; };
0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */; };
048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */; };
048787D12BCE61B20036E221 /* YHServiceNoOrderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */; };
048787D32BCE6B7D0036E221 /* YHServiceOrderAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D22BCE6B7D0036E221 /* YHServiceOrderAlertView.swift */; };
048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */; };
048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */; };
048787D92BCF68530036E221 /* YHProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D82BCF68530036E221 /* YHProgressView.swift */; };
048B2A442BC7901900A93BF0 /* YHHomeWebViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048B2A432BC7901900A93BF0 /* YHHomeWebViewModel.swift */; };
048B2A462BC7912400A93BF0 /* YHWebModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048B2A452BC7912400A93BF0 /* YHWebModel.swift */; };
048B2A482BC7CE4800A93BF0 /* YHFourKingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048B2A472BC7CE4800A93BF0 /* YHFourKingViewController.swift */; };
......@@ -251,8 +261,6 @@
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; };
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */; };
049AC4C62BC3E55300F857F4 /* YHServiceSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049AC4C52BC3E55300F857F4 /* YHServiceSectionView.swift */; };
049AC4C82BC513AB00F857F4 /* YHOrderListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049AC4C72BC513AB00F857F4 /* YHOrderListView.swift */; };
049AC4CA2BC5141600F857F4 /* YHServerNoOrderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049AC4C92BC5141600F857F4 /* YHServerNoOrderView.swift */; };
049AC4CC2BC6615500F857F4 /* YHHomeListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049AC4CB2BC6615500F857F4 /* YHHomeListModel.swift */; };
049AC4CE2BC674A700F857F4 /* YHHomeClassifyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049AC4CD2BC674A700F857F4 /* YHHomeClassifyModel.swift */; };
04A271232BABFF3200652B1B /* YHCertificateUploadTypeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A271222BABFF3200652B1B /* YHCertificateUploadTypeCell.swift */; };
......@@ -276,6 +284,7 @@
04C8F4832B7216D800ADF59B /* YHUserInfoHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C8F4822B7216D800ADF59B /* YHUserInfoHeaderView.swift */; };
04CC2EF02BC3DDB2000305DD /* YHServiceBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */; };
04D5C5662B8ED92600190021 /* YHBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D5C5652B8ED92600190021 /* YHBaseModel.swift */; };
04E41DE82BD240570077EAE3 /* YHOrderDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E41DE72BD240570077EAE3 /* YHOrderDetailViewController.swift */; };
04E86E092B707ACE00A35F4B /* YHPhoneLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */; };
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */; };
04E86E0D2B70D51D00A35F4B /* YHWebViewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */; };
......@@ -303,8 +312,8 @@
A520124F2BABCE05008655EA /* YHFileListContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A520124E2BABCE05008655EA /* YHFileListContentView.swift */; };
A53B61122BB128AF0010B573 /* YHFileListItemsView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53B61112BB128AF0010B573 /* YHFileListItemsView2.swift */; };
A53B61192BB3C9960010B573 /* YHMyDocListHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53B61182BB3C9960010B573 /* YHMyDocListHeaderView.swift */; };
A53D381E2BC23794006AE6F7 /* YHMsgViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53D381D2BC23794006AE6F7 /* YHMsgViewController.swift */; };
A53D38202BC243F1006AE6F7 /* YHStartPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53D381F2BC243F1006AE6F7 /* YHStartPageViewController.swift */; };
A53F05ED2BCE86E50071D35A /* YHAgreementAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53F05EC2BCE86E50071D35A /* YHAgreementAlertView.swift */; };
A53F42B92BC3DCA9009CAC70 /* YHHomeKingKongBlockModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53F42B82BC3DCA9009CAC70 /* YHHomeKingKongBlockModel.swift */; };
A53F42BB2BC3DE6F009CAC70 /* YHHomeKingKongBlockItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53F42BA2BC3DE6F009CAC70 /* YHHomeKingKongBlockItem.swift */; };
A554A5122B99715000EA5973 /* YHConstantArrayData.swift in Sources */ = {isa = PBXBuildFile; fileRef = A554A5112B99715000EA5973 /* YHConstantArrayData.swift */; };
......@@ -314,6 +323,7 @@
A5573EE92B317C0100D98EC0 /* galaxyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EE82B317C0100D98EC0 /* galaxyTests.swift */; };
A5573EF32B317C0100D98EC0 /* galaxyUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EF22B317C0100D98EC0 /* galaxyUITests.swift */; };
A5573EF52B317C0100D98EC0 /* galaxyUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EF42B317C0100D98EC0 /* galaxyUITestsLaunchTests.swift */; };
A567E5642BD6309700D5D5A0 /* YHHomeWebViewBottomForSavePicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A567E5632BD6309700D5D5A0 /* YHHomeWebViewBottomForSavePicView.swift */; };
A56D2D612B62020C009C83A8 /* YHContractMainItemStatusCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A56D2D602B62020C009C83A8 /* YHContractMainItemStatusCell.swift */; };
A57F1F252B48F09200B644E6 /* ATAuthSDK_D.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; };
A580371E2BAD784B0031C312 /* YHMySchemeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A580371D2BAD784B0031C312 /* YHMySchemeViewModel.swift */; };
......@@ -393,6 +403,7 @@
A5D001212BAA9D99001F003C /* YHChoiceButtonHoldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D001202BAA9D99001F003C /* YHChoiceButtonHoldView.swift */; };
A5D0012A2BABC84A001F003C /* YHFileListHeaerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D001272BABC84A001F003C /* YHFileListHeaerView.swift */; };
A5D0012C2BABC84A001F003C /* YHFileListBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D001292BABC84A001F003C /* YHFileListBottomView.swift */; };
A5D335F92BCE51E700236F21 /* YHServiceCenterProgressModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D335F82BCE51E700236F21 /* YHServiceCenterProgressModel.swift */; };
A5D5ADEF2BB90FBC0039FA6B /* YHCheckEamilAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D5ADEE2BB90FBB0039FA6B /* YHCheckEamilAlertView.swift */; };
A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */; };
A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */; };
......@@ -450,7 +461,15 @@
0414BDA82BC7E81500225367 /* YHMyPermissionSettingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyPermissionSettingVC.swift; sourceTree = "<group>"; };
0414BDAA2BC7E9C200225367 /* YHMyPermissionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyPermissionCell.swift; sourceTree = "<group>"; };
0414BDAC2BC7F02C00225367 /* YHMyNotifySettingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyNotifySettingVC.swift; sourceTree = "<group>"; };
041B52862B5657B3007EBCEB /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; };
0414BDB12BCCC0A500225367 /* YHCollectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCollectionModel.swift; sourceTree = "<group>"; };
04174D632BCD52BD000BA46D /* YHDeviceInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDeviceInfoViewController.swift; sourceTree = "<group>"; };
04174D672BCD5B74000BA46D /* YHMsgViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMsgViewModel.swift; sourceTree = "<group>"; };
04174D692BCD5B74000BA46D /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; };
04174D6C2BCD5B74000BA46D /* YHMsgListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMsgListModel.swift; sourceTree = "<group>"; };
04174D6E2BCD5B74000BA46D /* YHMessageDetailListVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMessageDetailListVC.swift; sourceTree = "<group>"; };
04174D6F2BCD5B74000BA46D /* YHMessageListVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMessageListVC.swift; sourceTree = "<group>"; };
04174D712BCD5B74000BA46D /* YHMessageSessionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMessageSessionCell.swift; sourceTree = "<group>"; };
04174D722BCD5B74000BA46D /* YHDetailMessageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHDetailMessageCell.swift; sourceTree = "<group>"; };
0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableViewCell.swift; sourceTree = "<group>"; };
0425E63F2BA9357D00A5E763 /* YHScemeItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScemeItemModel.swift; sourceTree = "<group>"; };
0425E6412BA95B1B00A5E763 /* YHSchemeTableFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableFooterView.swift; sourceTree = "<group>"; };
......@@ -460,10 +479,6 @@
0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCommonAlertView.swift; sourceTree = "<group>"; };
0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileMethodTableViewCell.swift; sourceTree = "<group>"; };
0435FA822BA2DEB100024EAE /* YHCardButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCardButton.swift; sourceTree = "<group>"; };
043F0AB12BC781F5006CB887 /* YHMessageSessionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = YHMessageSessionCell.swift; path = galaxy/Classes/Base/C/YHMessageSessionCell.swift; sourceTree = SOURCE_ROOT; };
043F0AB32BC7B80F006CB887 /* YHTestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTestViewController.swift; sourceTree = "<group>"; };
043F0AB52BC7CE1B006CB887 /* YHInformationFillVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationFillVC.swift; sourceTree = "<group>"; };
043F0AB72BC7CE5C006CB887 /* YHInformationFillCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = YHInformationFillCell.swift; path = "galaxy/Classes/Modules/Message(消息)/C/YHInformationFillCell.swift"; sourceTree = SOURCE_ROOT; };
044413F62BC2786200784A14 /* YHHomeWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebViewController.swift; sourceTree = "<group>"; };
044413F82BC279D200784A14 /* YHHomeWebBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebBottomView.swift; sourceTree = "<group>"; };
044413FA2BC27E6F00784A14 /* YHHomeWebBottomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebBottomButton.swift; sourceTree = "<group>"; };
......@@ -477,6 +492,7 @@
044867B32BA1953B00DFAD4A /* YHCertificateFilterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateFilterView.swift; sourceTree = "<group>"; };
044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateFilterItemCell.swift; sourceTree = "<group>"; };
044867B72BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadFailTipsView.swift; sourceTree = "<group>"; };
044BACC62BCFA58E00184C64 /* YHNoDataTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNoDataTipsView.swift; sourceTree = "<group>"; };
044CF8D32BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSignatureUploadTableViewCell.swift; sourceTree = "<group>"; };
044CF8D52BBA57DC00008CE8 /* YHFailPromptView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFailPromptView.swift; sourceTree = "<group>"; };
044E1E802BC3BBC200A3B4AF /* YHSearchInfomationVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSearchInfomationVC.swift; sourceTree = "<group>"; };
......@@ -655,6 +671,7 @@
045EEE762B9F171A0022A143 /* YHItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHItemView.swift; sourceTree = "<group>"; };
045EEE772B9F171A0022A143 /* YHStepView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHStepView.swift; sourceTree = "<group>"; };
045EEE782B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMainInformationCardTableViewCell.swift; sourceTree = "<group>"; };
04684A7E2BD6520A007D95B8 /* UIScrollView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIScrollView+Extension.swift"; sourceTree = "<group>"; };
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVerificationCodeLoginController.swift; sourceTree = "<group>"; };
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; };
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeResultViewController.swift; sourceTree = "<group>"; };
......@@ -666,7 +683,9 @@
0468D42F2B5654B500CFB916 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
0468D4352B57752F00CFB916 /* YHUserModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = YHUserModel.swift; path = "galaxy/Classes/Modules/Login(登录)/M/YHUserModel.swift"; sourceTree = SOURCE_ROOT; };
0468D4392B579EAC00CFB916 /* YHLoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginViewModel.swift; sourceTree = "<group>"; };
047294E72B988A19008E0B84 /* YHNewWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNewWebViewController.swift; sourceTree = "<group>"; };
046AB7762BD674170086C6F1 /* galaxy.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = galaxy.entitlements; sourceTree = "<group>"; };
046AB7772BD674170086C6F1 /* galaxyDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = galaxyDebug.entitlements; sourceTree = "<group>"; };
046AB7782BD674170086C6F1 /* galaxyTestEnv.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = galaxyTestEnv.entitlements; sourceTree = "<group>"; };
04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Extension.swift"; sourceTree = "<group>"; };
047619E82BA9867100F45358 /* YHCountryHotView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCountryHotView.swift; sourceTree = "<group>"; };
047619EC2BA9B9C900F45358 /* area.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = area.plist; sourceTree = "<group>"; };
......@@ -678,6 +697,11 @@
0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfoCell.swift; sourceTree = "<group>"; };
0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateListVC.swift; sourceTree = "<group>"; };
048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchBar.swift; sourceTree = "<group>"; };
048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceNoOrderView.swift; sourceTree = "<group>"; };
048787D22BCE6B7D0036E221 /* YHServiceOrderAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderAlertView.swift; sourceTree = "<group>"; };
048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderListViewController.swift; sourceTree = "<group>"; };
048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderProgressTableViewCell.swift; sourceTree = "<group>"; };
048787D82BCF68530036E221 /* YHProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHProgressView.swift; sourceTree = "<group>"; };
048B2A432BC7901900A93BF0 /* YHHomeWebViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebViewModel.swift; sourceTree = "<group>"; };
048B2A452BC7912400A93BF0 /* YHWebModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWebModel.swift; sourceTree = "<group>"; };
048B2A472BC7CE4800A93BF0 /* YHFourKingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFourKingViewController.swift; sourceTree = "<group>"; };
......@@ -691,8 +715,6 @@
049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; };
049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsAdvantageCell.swift; sourceTree = "<group>"; };
049AC4C52BC3E55300F857F4 /* YHServiceSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceSectionView.swift; sourceTree = "<group>"; };
049AC4C72BC513AB00F857F4 /* YHOrderListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOrderListView.swift; sourceTree = "<group>"; };
049AC4C92BC5141600F857F4 /* YHServerNoOrderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServerNoOrderView.swift; sourceTree = "<group>"; };
049AC4CB2BC6615500F857F4 /* YHHomeListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeListModel.swift; sourceTree = "<group>"; };
049AC4CD2BC674A700F857F4 /* YHHomeClassifyModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeClassifyModel.swift; sourceTree = "<group>"; };
04A271222BABFF3200652B1B /* YHCertificateUploadTypeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadTypeCell.swift; sourceTree = "<group>"; };
......@@ -710,13 +732,13 @@
04A7BD162BA43A0F00BD35A2 /* YHMyDocumentsDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyDocumentsDetailViewModel.swift; sourceTree = "<group>"; };
04A7BD182BA441D400BD35A2 /* YHMyDocumentsUrlModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyDocumentsUrlModel.swift; sourceTree = "<group>"; };
04AA19FC2BB40D5C00C1CBBD /* Applegate(JPush).swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Applegate(JPush).swift"; sourceTree = "<group>"; };
04AA19FE2BB5198100C1CBBD /* galaxyDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = galaxyDebug.entitlements; sourceTree = "<group>"; };
04AF58C32B4FC51C0066011A /* YHLocalizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLocalizable.swift; sourceTree = "<group>"; };
04C693612B723AB8004C1758 /* YHMySettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingViewController.swift; sourceTree = "<group>"; };
04C693632B723B56004C1758 /* YHMySettingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingCell.swift; sourceTree = "<group>"; };
04C8F4822B7216D800ADF59B /* YHUserInfoHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserInfoHeaderView.swift; sourceTree = "<group>"; };
04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceBannerView.swift; sourceTree = "<group>"; };
04D5C5652B8ED92600190021 /* YHBaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseModel.swift; sourceTree = "<group>"; };
04E41DE72BD240570077EAE3 /* YHOrderDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOrderDetailViewController.swift; sourceTree = "<group>"; };
04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneLoginViewController.swift; sourceTree = "<group>"; };
04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; };
04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWebViewViewController.swift; sourceTree = "<group>"; };
......@@ -746,8 +768,8 @@
A520124E2BABCE05008655EA /* YHFileListContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHFileListContentView.swift; sourceTree = "<group>"; };
A53B61112BB128AF0010B573 /* YHFileListItemsView2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFileListItemsView2.swift; sourceTree = "<group>"; };
A53B61182BB3C9960010B573 /* YHMyDocListHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyDocListHeaderView.swift; sourceTree = "<group>"; };
A53D381D2BC23794006AE6F7 /* YHMsgViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMsgViewController.swift; sourceTree = "<group>"; };
A53D381F2BC243F1006AE6F7 /* YHStartPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHStartPageViewController.swift; sourceTree = "<group>"; };
A53F05EC2BCE86E50071D35A /* YHAgreementAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAgreementAlertView.swift; sourceTree = "<group>"; };
A53F42B82BC3DCA9009CAC70 /* YHHomeKingKongBlockModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeKingKongBlockModel.swift; sourceTree = "<group>"; };
A53F42BA2BC3DE6F009CAC70 /* YHHomeKingKongBlockItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeKingKongBlockItem.swift; sourceTree = "<group>"; };
A554A5112B99715000EA5973 /* YHConstantArrayData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHConstantArrayData.swift; sourceTree = "<group>"; };
......@@ -761,6 +783,7 @@
A5573EEE2B317C0100D98EC0 /* galaxyUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = galaxyUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
A5573EF22B317C0100D98EC0 /* galaxyUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = galaxyUITests.swift; sourceTree = "<group>"; };
A5573EF42B317C0100D98EC0 /* galaxyUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = galaxyUITestsLaunchTests.swift; sourceTree = "<group>"; };
A567E5632BD6309700D5D5A0 /* YHHomeWebViewBottomForSavePicView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebViewBottomForSavePicView.swift; sourceTree = "<group>"; };
A56D2D602B62020C009C83A8 /* YHContractMainItemStatusCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContractMainItemStatusCell.swift; sourceTree = "<group>"; };
A580371D2BAD784B0031C312 /* YHMySchemeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySchemeViewModel.swift; sourceTree = "<group>"; };
A58037202BAD7B2A0031C312 /* YHMySchemeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySchemeModel.swift; sourceTree = "<group>"; };
......@@ -840,6 +863,7 @@
A5D001202BAA9D99001F003C /* YHChoiceButtonHoldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChoiceButtonHoldView.swift; sourceTree = "<group>"; };
A5D001272BABC84A001F003C /* YHFileListHeaerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHFileListHeaerView.swift; sourceTree = "<group>"; };
A5D001292BABC84A001F003C /* YHFileListBottomView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHFileListBottomView.swift; sourceTree = "<group>"; };
A5D335F82BCE51E700236F21 /* YHServiceCenterProgressModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterProgressModel.swift; sourceTree = "<group>"; };
A5D5ADEE2BB90FBB0039FA6B /* YHCheckEamilAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCheckEamilAlertView.swift; sourceTree = "<group>"; };
A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeModel.swift; sourceTree = "<group>"; };
A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomePageViewModel.swift; sourceTree = "<group>"; };
......@@ -893,14 +917,68 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
041B52852B565798007EBCEB /* IM */ = {
0414BDB02BCCC09000225367 /* Model */ = {
isa = PBXGroup;
children = (
041B52862B5657B3007EBCEB /* IMAppKey.swift */,
0414BDB12BCCC0A500225367 /* YHCollectionModel.swift */,
);
path = Model;
sourceTree = "<group>";
};
04174D652BCD5B74000BA46D /* Message(消息) */ = {
isa = PBXGroup;
children = (
04174D662BCD5B74000BA46D /* VM */,
04174D682BCD5B74000BA46D /* IM */,
04174D6A2BCD5B74000BA46D /* M */,
04174D6D2BCD5B74000BA46D /* C */,
04174D702BCD5B74000BA46D /* V */,
);
path = "Message(消息)";
sourceTree = "<group>";
};
04174D662BCD5B74000BA46D /* VM */ = {
isa = PBXGroup;
children = (
04174D672BCD5B74000BA46D /* YHMsgViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
};
04174D682BCD5B74000BA46D /* IM */ = {
isa = PBXGroup;
children = (
04174D692BCD5B74000BA46D /* IMAppKey.swift */,
);
path = IM;
sourceTree = "<group>";
};
04174D6A2BCD5B74000BA46D /* M */ = {
isa = PBXGroup;
children = (
04174D6C2BCD5B74000BA46D /* YHMsgListModel.swift */,
);
path = M;
sourceTree = "<group>";
};
04174D6D2BCD5B74000BA46D /* C */ = {
isa = PBXGroup;
children = (
04174D6F2BCD5B74000BA46D /* YHMessageListVC.swift */,
04174D6E2BCD5B74000BA46D /* YHMessageDetailListVC.swift */,
);
path = C;
sourceTree = "<group>";
};
04174D702BCD5B74000BA46D /* V */ = {
isa = PBXGroup;
children = (
04174D712BCD5B74000BA46D /* YHMessageSessionCell.swift */,
04174D722BCD5B74000BA46D /* YHDetailMessageCell.swift */,
);
path = V;
sourceTree = "<group>";
};
0425E63B2BA931B300A5E763 /* View */ = {
isa = PBXGroup;
children = (
......@@ -1740,50 +1818,6 @@
path = V;
sourceTree = "<group>";
};
A53D38172BC23745006AE6F7 /* Message(消息) */ = {
isa = PBXGroup;
children = (
041B52852B565798007EBCEB /* IM */,
A53D381C2BC2376C006AE6F7 /* VM */,
A53D381A2BC2375B006AE6F7 /* C */,
A53D38192BC23757006AE6F7 /* V */,
A53D38182BC23752006AE6F7 /* M */,
);
path = "Message(消息)";
sourceTree = "<group>";
};
A53D38182BC23752006AE6F7 /* M */ = {
isa = PBXGroup;
children = (
);
path = M;
sourceTree = "<group>";
};
A53D38192BC23757006AE6F7 /* V */ = {
isa = PBXGroup;
children = (
043F0AB12BC781F5006CB887 /* YHMessageSessionCell.swift */,
043F0AB72BC7CE5C006CB887 /* YHInformationFillCell.swift */,
);
path = V;
sourceTree = "<group>";
};
A53D381A2BC2375B006AE6F7 /* C */ = {
isa = PBXGroup;
children = (
A53D381D2BC23794006AE6F7 /* YHMsgViewController.swift */,
043F0AB52BC7CE1B006CB887 /* YHInformationFillVC.swift */,
);
path = C;
sourceTree = "<group>";
};
A53D381C2BC2376C006AE6F7 /* VM */ = {
isa = PBXGroup;
children = (
);
path = VM;
sourceTree = "<group>";
};
A5573EC52B317BFF00D98EC0 = {
isa = PBXGroup;
children = (
......@@ -1810,9 +1844,11 @@
A5573ED02B317BFF00D98EC0 /* galaxy */ = {
isa = PBXGroup;
children = (
04AA19FE2BB5198100C1CBBD /* galaxyDebug.entitlements */,
A5573ED12B317BFF00D98EC0 /* AppDelegate.swift */,
04AA19FC2BB40D5C00C1CBBD /* Applegate(JPush).swift */,
046AB7762BD674170086C6F1 /* galaxy.entitlements */,
046AB7772BD674170086C6F1 /* galaxyDebug.entitlements */,
046AB7782BD674170086C6F1 /* galaxyTestEnv.entitlements */,
A51044172B493675006B60BB /* README.md */,
A5ACE9142B4564F7002C94D2 /* Res */,
A5ACE8D72B4564F7002C94D2 /* Classes */,
......@@ -1894,7 +1930,6 @@
04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */,
04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */,
04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */,
047294E72B988A19008E0B84 /* YHNewWebViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -1924,6 +1959,7 @@
A5ACE8E72B4564F7002C94D2 /* Mine(我的) */ = {
isa = PBXGroup;
children = (
0414BDB02BCCC09000225367 /* Model */,
048B2A4B2BC7DACF00A93BF0 /* ViewModel */,
A5ACE8EB2B4564F7002C94D2 /* V */,
A5ACE8E92B4564F7002C94D2 /* C */,
......@@ -1940,6 +1976,7 @@
0414BDAC2BC7F02C00225367 /* YHMyNotifySettingVC.swift */,
049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */,
048B2A492BC7D9DC00A93BF0 /* YHMyLikeViewController.swift */,
04174D632BCD52BD000BA46D /* YHDeviceInfoViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -1998,6 +2035,7 @@
A5ACE9032B4564F7002C94D2 /* UILable+Extension.swift */,
A5ACE9042B4564F7002C94D2 /* Array+Extension.swift */,
04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */,
04684A7E2BD6520A007D95B8 /* UIScrollView+Extension.swift */,
);
path = Extention;
sourceTree = "<group>";
......@@ -2070,6 +2108,7 @@
A5FD63C02B62616D00D1D9DA /* YHInformationPerfectModel.swift */,
A5FD63C22B63438A00D1D9DA /* YHContactMainItemStatusModel.swift */,
A58556B92B6BCF1A003746B2 /* YHPersonInfoFillStepModel.swift */,
A5D335F82BCE51E700236F21 /* YHServiceCenterProgressModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -2078,6 +2117,8 @@
isa = PBXGroup;
children = (
A5ACE9192B4564F7002C94D2 /* YHServiceCenterMainViewController.swift */,
04E41DE72BD240570077EAE3 /* YHOrderDetailViewController.swift */,
048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */,
044413FC2BC386DA00784A14 /* YHServiceViewController.swift */,
044413FE2BC391F000784A14 /* YHServiceListViewController.swift */,
044414002BC3979800784A14 /* YHServerHKLifeViewController.swift */,
......@@ -2101,11 +2142,11 @@
044414022BC39B8D00784A14 /* YHServerTableHeadView.swift */,
049AC4C52BC3E55300F857F4 /* YHServiceSectionView.swift */,
044414042BC3B9DE00784A14 /* YHServiceTableFootView.swift */,
044414062BC3C54B00784A14 /* YHHomeCollectionViewCell.swift */,
044414082BC3CE8500784A14 /* YHHomeCollectionLayout.swift */,
04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */,
049AC4C72BC513AB00F857F4 /* YHOrderListView.swift */,
049AC4C92BC5141600F857F4 /* YHServerNoOrderView.swift */,
048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */,
048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */,
048787D82BCF68530036E221 /* YHProgressView.swift */,
044BACC62BCFA58E00184C64 /* YHNoDataTipsView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -2113,7 +2154,7 @@
A5ACE91B2B4564F7002C94D2 /* Modules */ = {
isa = PBXGroup;
children = (
A53D38172BC23745006AE6F7 /* Message(消息) */,
04174D652BCD5B74000BA46D /* Message(消息) */,
A5ACE9592B457113002C94D2 /* Home(首页) */,
A5ACE8D82B4564F7002C94D2 /* Login(登录) */,
A5ACE9162B4564F7002C94D2 /* IntelligentService(服务中心) */,
......@@ -2136,7 +2177,6 @@
isa = PBXGroup;
children = (
A5ACE9202B4564F7002C94D2 /* YHBaseViewController.swift */,
043F0AB32BC7B80F006CB887 /* YHTestViewController.swift */,
A5ACE9212B4564F7002C94D2 /* YHNavigationController.swift */,
A5ACE9222B4564F7002C94D2 /* YHTabBarViewController.swift */,
A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */,
......@@ -2184,12 +2224,12 @@
A5ACE95B2B45712D002C94D2 /* V */ = {
isa = PBXGroup;
children = (
A5C5B30F2B57677300A7C5D1 /* YHGestureTableView.swift */,
044413F82BC279D200784A14 /* YHHomeWebBottomView.swift */,
044413FA2BC27E6F00784A14 /* YHHomeWebBottomButton.swift */,
A501BE652BC2B76200C4F1FB /* YHHomeHeadView.swift */,
A5C5B2FA2B5535DF00A7C5D1 /* YHHomeBannerView.swift */,
A501BE672BC2B85F00C4F1FB /* YHHomeSearchView.swift */,
A5C5B30F2B57677300A7C5D1 /* YHGestureTableView.swift */,
044E1E862BC3D00E00A3B4AF /* YHSearchItemLayout.swift */,
044E1E822BC3BBFC00A3B4AF /* YHSearchInfoHistoryView.swift */,
044E1E842BC3BEC300A3B4AF /* YHSearchInfoHistoryCell.swift */,
......@@ -2200,7 +2240,12 @@
A5F9AD322BC3CD66000323F8 /* YHHkLifeAndIdItemView.swift */,
A53F42BA2BC3DE6F009CAC70 /* YHHomeKingKongBlockItem.swift */,
A50A747B2BC8EC86003D28D9 /* YHHomeBannerCollectionViewCell.swift */,
044414062BC3C54B00784A14 /* YHHomeCollectionViewCell.swift */,
044414082BC3CE8500784A14 /* YHHomeCollectionLayout.swift */,
A50A747D2BC91308003D28D9 /* YHHomeBannerIndicatorView.swift */,
048787D22BCE6B7D0036E221 /* YHServiceOrderAlertView.swift */,
A53F05EC2BCE86E50071D35A /* YHAgreementAlertView.swift */,
A567E5632BD6309700D5D5A0 /* YHHomeWebViewBottomForSavePicView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -2208,9 +2253,9 @@
A5ACE95C2B457133002C94D2 /* C */ = {
isa = PBXGroup;
children = (
044413F62BC2786200784A14 /* YHHomeWebViewController.swift */,
A53D381F2BC243F1006AE6F7 /* YHStartPageViewController.swift */,
A5173D672BC399B9007D4E74 /* YHHomePageViewController.swift */,
A53D381F2BC243F1006AE6F7 /* YHStartPageViewController.swift */,
044413F62BC2786200784A14 /* YHHomeWebViewController.swift */,
044E1E802BC3BBC200A3B4AF /* YHSearchInfomationVC.swift */,
A5A4FD622BC79901001EF9F7 /* YHConfigManager.swift */,
048B2A472BC7CE4800A93BF0 /* YHFourKingViewController.swift */,
......@@ -2457,7 +2502,7 @@
044867B82BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift in Sources */,
045EEF002B9F171A0022A143 /* YHFormItemEnterDetailCell.swift in Sources */,
A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */,
043F0AB82BC7CE5C006CB887 /* YHInformationFillCell.swift in Sources */,
048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */,
A5D0012A2BABC84A001F003C /* YHFileListHeaerView.swift in Sources */,
044414052BC3B9DE00784A14 /* YHServiceTableFootView.swift in Sources */,
045EEEEF2B9F171A0022A143 /* YHCertificateInfoController.swift in Sources */,
......@@ -2479,6 +2524,7 @@
A5173D682BC399B9007D4E74 /* YHHomePageViewController.swift in Sources */,
045EEF0E2B9F171A0022A143 /* YHBasicInfoFillView.swift in Sources */,
045EEEA12B9F171A0022A143 /* YHWorkExperienceDetailModel.swift in Sources */,
04684A7F2BD6520A007D95B8 /* UIScrollView+Extension.swift in Sources */,
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */,
A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */,
045EEF252B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift in Sources */,
......@@ -2503,7 +2549,6 @@
044413FB2BC27E6F00784A14 /* YHHomeWebBottomButton.swift in Sources */,
045EEEB32B9F171A0022A143 /* YHWorkFileSyncTableViewCell.swift in Sources */,
045EEEF12B9F171A0022A143 /* YHChildInfoContainerVC.swift in Sources */,
049AC4C82BC513AB00F857F4 /* YHOrderListView.swift in Sources */,
049AC4CC2BC6615500F857F4 /* YHHomeListModel.swift in Sources */,
045EEF0B2B9F171A0022A143 /* YHBasicInfoFillViewController.swift in Sources */,
A582B2452BBA4CF9009D098C /* YHHKPlanDocModel.swift in Sources */,
......@@ -2532,6 +2577,7 @@
045EEE812B9F171A0022A143 /* YHPreviewQuestionAndAnswerModel.swift in Sources */,
045EEEB02B9F171A0022A143 /* YHWorkItemView.swift in Sources */,
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */,
048787D12BCE61B20036E221 /* YHServiceNoOrderView.swift in Sources */,
04AA19FD2BB40D5C00C1CBBD /* Applegate(JPush).swift in Sources */,
0468D4362B57752F00CFB916 /* YHUserModel.swift in Sources */,
045EEE992B9F171A0022A143 /* YHPreviewInfoHoldView.swift in Sources */,
......@@ -2549,6 +2595,7 @@
04A271232BABFF3200652B1B /* YHCertificateUploadTypeCell.swift in Sources */,
A582B2412BB95998009D098C /* YHHKPlanTipsCell.swift in Sources */,
A5D0012C2BABC84A001F003C /* YHFileListBottomView.swift in Sources */,
04E41DE82BD240570077EAE3 /* YHOrderDetailViewController.swift in Sources */,
A5FD63C52B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift in Sources */,
045EEF222B9F171A0022A143 /* YHImagePickerView.swift in Sources */,
A5ACE9442B4564F7002C94D2 /* Array+Extension.swift in Sources */,
......@@ -2578,14 +2625,17 @@
045EEEB92B9F171A0022A143 /* YHWorkMessageSelectTableViewCell.swift in Sources */,
044E1E812BC3BBC200A3B4AF /* YHSearchInfomationVC.swift in Sources */,
04A7BD0F2BA41C9800BD35A2 /* YHMyDocumentsModel.swift in Sources */,
04174D642BCD52BD000BA46D /* YHDeviceInfoViewController.swift in Sources */,
A5ACE92E2B4564F7002C94D2 /* YHValidateCodeInputView.swift in Sources */,
045EEED82B9F171A0022A143 /* YHQuestionInfo.swift in Sources */,
048787D32BCE6B7D0036E221 /* YHServiceOrderAlertView.swift in Sources */,
A5ACE94E2B4564F7002C94D2 /* AlignedCollectionViewFlowLayout.swift in Sources */,
A592FE932BA6CFFC0062FACA /* YHCertificateEntryBottomView.swift in Sources */,
A5ACE93B2B4564F7002C94D2 /* UIFont+Extension.swift in Sources */,
045EEE802B9F171A0022A143 /* YHAcademicPreviewModel.swift in Sources */,
04C693642B723B56004C1758 /* YHMySettingCell.swift in Sources */,
A5FD63C92B63A35B00D1D9DA /* YHInformationFillTipsAlertView.swift in Sources */,
04174D762BCD5B74000BA46D /* YHMsgListModel.swift in Sources */,
045EEEE32B9F171A0022A143 /* YHMySignatureListModel.swift in Sources */,
049AC4C62BC3E55300F857F4 /* YHServiceSectionView.swift in Sources */,
A582B2432BB95E20009D098C /* YHHKPlanCell.swift in Sources */,
......@@ -2593,7 +2643,6 @@
045EEE842B9F171A0022A143 /* YHPreviewBasiceInformationViewController.swift in Sources */,
A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */,
0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */,
043F0AB42BC7B80F006CB887 /* YHTestViewController.swift in Sources */,
048B2A4D2BC7DAE800A93BF0 /* YHMyLikeViewModel.swift in Sources */,
04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */,
045EEECD2B9F171A0022A143 /* YHScoreDataModel.swift in Sources */,
......@@ -2602,6 +2651,7 @@
045EEEFA2B9F171A0022A143 /* YHFormPickerViewType.swift in Sources */,
A5ACE9502B4564F7002C94D2 /* YhCacheTool.swift in Sources */,
045EEEFC2B9F171A0022A143 /* YHSheetPickerView.swift in Sources */,
04174D732BCD5B74000BA46D /* YHMsgViewModel.swift in Sources */,
045EEF122B9F171A0022A143 /* YHCNIDCardModel.swift in Sources */,
045EEF032B9F171A0022A143 /* YHFormItemDoubleChoiceCell.swift in Sources */,
045EEEAE2B9F171A0022A143 /* YHWorkHighlightsTableViewCell.swift in Sources */,
......@@ -2622,7 +2672,6 @@
045EEF152B9F171A0022A143 /* YHHKIDCardModel.swift in Sources */,
0477E17E2BA4362A00436346 /* YHCustomNavigationBar.swift in Sources */,
045EEEC42B9F171A0022A143 /* YHOtherInfoFillCell.swift in Sources */,
043F0AB62BC7CE1B006CB887 /* YHInformationFillVC.swift in Sources */,
045EEE9F2B9F171A0022A143 /* YHWorkExperienceModel.swift in Sources */,
045EEF232B9F171A0022A143 /* YHItemView.swift in Sources */,
04754A952B96FF3D00F8ADCA /* UITextField+Extension.swift in Sources */,
......@@ -2658,7 +2707,6 @@
A5ACE9552B4564F7002C94D2 /* YHTabBarViewController.swift in Sources */,
045EEF0A2B9F171A0022A143 /* YHBasicInfoSessionModel.swift in Sources */,
045EEF022B9F171A0022A143 /* YHFormItemDegreeInfoCell.swift in Sources */,
049AC4CA2BC5141600F857F4 /* YHServerNoOrderView.swift in Sources */,
045EEEF72B9F171A0022A143 /* YHFormItemAddCell.swift in Sources */,
045EEEC82B9F171A0022A143 /* YHOtherSelecteItemView.swift in Sources */,
0480976B2BA15269000B9DCA /* YHCertificateInfoCell.swift in Sources */,
......@@ -2680,6 +2728,7 @@
045EEED12B9F171A0022A143 /* YHScorePersonInfoCell.swift in Sources */,
044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */,
045EEF0D2B9F171A0022A143 /* YHBasicInfoFillCell.swift in Sources */,
048787D92BCF68530036E221 /* YHProgressView.swift in Sources */,
048B2A462BC7912400A93BF0 /* YHWebModel.swift in Sources */,
045EEEEC2B9F171A0022A143 /* YHBrotherInfoVC.swift in Sources */,
0477E17A2BA41C7E00436346 /* YHCertificateModel.swift in Sources */,
......@@ -2689,6 +2738,7 @@
045EEEB52B9F171A0022A143 /* YHWorkIntroductionItemView.swift in Sources */,
045EEF202B9F171A0022A143 /* YHCardExampleView.swift in Sources */,
04A6715E2B9FFCA700C1FB91 /* YHCertificateNameCell.swift in Sources */,
048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */,
04EA23082BB50753009DA928 /* YHDocumentMessageTableViewCell.swift in Sources */,
045EEE8E2B9F171A0022A143 /* YHPreviewInfoWorkSummaryView.swift in Sources */,
045EEECE2B9F171A0022A143 /* YHScoreDetailViewController.swift in Sources */,
......@@ -2705,6 +2755,7 @@
A5ACE9492B4564F7002C94D2 /* YHHUDSuccessView.swift in Sources */,
045EEE9C2B9F171A0022A143 /* YHCompanyViewModel.swift in Sources */,
A58556BA2B6BCF1A003746B2 /* YHPersonInfoFillStepModel.swift in Sources */,
A53F05ED2BCE86E50071D35A /* YHAgreementAlertView.swift in Sources */,
045EEEC92B9F171A0022A143 /* YHOtherInfoSessionView.swift in Sources */,
045EEEE22B9F171A0022A143 /* YHMySignatureDetailViewModel.swift in Sources */,
045EEE7D2B9F171A0022A143 /* YHWorkExpDataModel.swift in Sources */,
......@@ -2713,17 +2764,18 @@
044414032BC39B8D00784A14 /* YHServerTableHeadView.swift in Sources */,
045EEECB2B9F171A0022A143 /* YHScoreResultBaseModel.swift in Sources */,
04A7BD192BA441D400BD35A2 /* YHMyDocumentsUrlModel.swift in Sources */,
04174D792BCD5B74000BA46D /* YHMessageSessionCell.swift in Sources */,
045EEEA62B9F171A0022A143 /* YHCompanySelectViewController.swift in Sources */,
0425E6462BA9678E00A5E763 /* YHSchemeHeadTotalScoreView.swift in Sources */,
045EEEA92B9F171A0022A143 /* YHWorkExperienceListViewController.swift in Sources */,
04A7BD132BA42F4200BD35A2 /* YHMyDocumentsDetailViewController.swift in Sources */,
04A671622BA058DE00C1FB91 /* YHCertificateEditSheetView.swift in Sources */,
A5ACE9432B4564F7002C94D2 /* UILable+Extension.swift in Sources */,
0414BDB22BCCC0A500225367 /* YHCollectionModel.swift in Sources */,
A53D38202BC243F1006AE6F7 /* YHStartPageViewController.swift in Sources */,
045EEE882B9F171A0022A143 /* YHPreviewAcademicAndProfessionalQualificationViewController.swift in Sources */,
0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */,
A5ACE9382B4564F7002C94D2 /* UIApplication+Extension.swift in Sources */,
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */,
0468D42B2B55019900CFB916 /* YHAnalytics.swift in Sources */,
A5173D6A2BC3C187007D4E74 /* YHHkLifeAndIdView.swift in Sources */,
045EEEBE2B9F171A0022A143 /* YHResultBottomView.swift in Sources */,
......@@ -2733,9 +2785,11 @@
A5ACE93C2B4564F7002C94D2 /* UIColor+Extension.swift in Sources */,
045EEEC02B9F171A0022A143 /* YHOtherInfoFillViewModel.swift in Sources */,
045EEEF22B9F171A0022A143 /* YHChildBasicInfoVC.swift in Sources */,
04174D772BCD5B74000BA46D /* YHMessageDetailListVC.swift in Sources */,
A592BFEF2B9AB720004C04A9 /* YHWholeScreenTipsView.swift in Sources */,
045EEEF42B9F171A0022A143 /* YHSpouseBasicInfoVC.swift in Sources */,
A5FD63C32B63438A00D1D9DA /* YHContactMainItemStatusModel.swift in Sources */,
A567E5642BD6309700D5D5A0 /* YHHomeWebViewBottomForSavePicView.swift in Sources */,
045EEEEA2B9F171A0022A143 /* YHFamilyInitialInfo.swift in Sources */,
A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */,
045EEEA52B9F171A0022A143 /* YHImageViewController.swift in Sources */,
......@@ -2760,12 +2814,12 @@
044E1E832BC3BBFC00A3B4AF /* YHSearchInfoHistoryView.swift in Sources */,
045EEEA02B9F171A0022A143 /* YHWorkItemListModel.swift in Sources */,
04EA230E2BB538E9009DA928 /* YHDocumentUploadTableViewCell.swift in Sources */,
04174D742BCD5B74000BA46D /* IMAppKey.swift in Sources */,
045EEEAD2B9F171A0022A143 /* YHWorkExperienceListTableViewCell.swift in Sources */,
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */,
047619E92BA9867100F45358 /* YHCountryHotView.swift in Sources */,
045EEEF82B9F171A0022A143 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */,
0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */,
043F0AB22BC781F5006CB887 /* YHMessageSessionCell.swift in Sources */,
045EEE8B2B9F171A0022A143 /* YHPreviewMainApplicantInfoViewController.swift in Sources */,
045EEE922B9F171A0022A143 /* YHPreviewInfoNameAndSubNameItemView.swift in Sources */,
045EEEF92B9F171A0022A143 /* YHFormItemTitleCell.swift in Sources */,
......@@ -2777,6 +2831,7 @@
044413F92BC279D200784A14 /* YHHomeWebBottomView.swift in Sources */,
045EEEC32B9F171A0022A143 /* YHOtherResidenceFillView.swift in Sources */,
045EEE792B9F171A0022A143 /* YHPreviewViewModel.swift in Sources */,
04174D782BCD5B74000BA46D /* YHMessageListVC.swift in Sources */,
A517A4E12BB573EB000DEECD /* YHDocListCell.swift in Sources */,
A58037212BAD7B2A0031C312 /* YHMySchemeModel.swift in Sources */,
0493B3DE2BA80C2300AF9393 /* YHCertificateFilterButton.swift in Sources */,
......@@ -2797,7 +2852,6 @@
A554A5122B99715000EA5973 /* YHConstantArrayData.swift in Sources */,
049AC4CE2BC674A700F857F4 /* YHHomeClassifyModel.swift in Sources */,
045EEE962B9F171A0022A143 /* YHPreviewInfoCertificatePictureItemsView.swift in Sources */,
A53D381E2BC23794006AE6F7 /* YHMsgViewController.swift in Sources */,
A592FE912BA6CC010062FACA /* YHCertificateEntryHeadView.swift in Sources */,
0425E63D2BA9345200A5E763 /* YHSchemeTableViewCell.swift in Sources */,
A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */,
......@@ -2819,17 +2873,19 @@
A5ACE9352B4564F7002C94D2 /* YHNetRequest.swift in Sources */,
A5FD63CB2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift in Sources */,
045EEF1F2B9F171A0022A143 /* YHDatePickView.swift in Sources */,
04174D7A2BCD5B74000BA46D /* YHDetailMessageCell.swift in Sources */,
045EEE972B9F171A0022A143 /* YHPreviewInfoWorkExpView.swift in Sources */,
044BACC72BCFA58E00184C64 /* YHNoDataTipsView.swift in Sources */,
044414012BC3979800784A14 /* YHServerHKLifeViewController.swift in Sources */,
04D5C5662B8ED92600190021 /* YHBaseModel.swift in Sources */,
A5F8AC082B9F414000A21EFA /* YHCustomTextView.swift in Sources */,
0414BDAD2BC7F02C00225367 /* YHMyNotifySettingVC.swift in Sources */,
A5ACE9272B4564F7002C94D2 /* YHLoginViewController.swift in Sources */,
0425E6402BA9357D00A5E763 /* YHScemeItemModel.swift in Sources */,
A5D335F92BCE51E700236F21 /* YHServiceCenterProgressModel.swift in Sources */,
045EEECC2B9F171A0022A143 /* YHScoreResultModel.swift in Sources */,
045EEEDC2B9F171A0022A143 /* YHQualificationDetailVC.swift in Sources */,
045EEEF52B9F171A0022A143 /* YHSpouseInfoContainerVC.swift in Sources */,
047294E82B988A19008E0B84 /* YHNewWebViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -2929,10 +2985,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -2944,15 +3001,20 @@
INFOPLIST_FILE = galaxy/Res/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "智汇银河-Test";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_NSCameraUsageDescription = cameraDesciption;
INFOPLIST_KEY_NSFileProviderDomainUsageDescription = "需要访问您的文件以选择和上传";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = photoLibraryDesciption;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.9;
MARKETING_VERSION = 0.2.10;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -3133,7 +3195,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -3145,15 +3207,20 @@
INFOPLIST_FILE = galaxy/Res/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "智汇银河-Dev";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_NSCameraUsageDescription = cameraDesciption;
INFOPLIST_KEY_NSFileProviderDomainUsageDescription = "需要访问您的文件以选择和上传";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = photoLibraryDesciption;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.9;
MARKETING_VERSION = 0.2.10;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -3172,10 +3239,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -3187,15 +3255,20 @@
INFOPLIST_FILE = galaxy/Res/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "智汇银河";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_NSCameraUsageDescription = cameraDesciption;
INFOPLIST_KEY_NSFileProviderDomainUsageDescription = "需要访问您的文件以选择和上传";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = photoLibraryDesciption;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.9;
MARKETING_VERSION = 0.2.10;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......
......@@ -35,21 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
//4.本地用户信息加载
YHLoginManager.shared.loadLocalUserInfoData()
YHConfigManager.shared.loadConfigData()
// YHAnalytics.analyticsStart(launchOptions: launchOptions)
// var i = 0
// for family: String in UIFont.familyNames {
// print("\(i)---项目字体---\(family)")
// for names: String in UIFont.fontNames(forFamilyName: family) {
// print("== \(names)")
// }
// i += 1
// }
return true
}
......@@ -123,30 +109,10 @@ extension AppDelegate {
//1.设置主窗口
private func setupRootVC() {
let tabBarController = YHTabBarViewController()
let homeVC = YHHomePageViewController()
tabBarController.delegate = homeVC
let v0 = YHNavigationController(rootVC:homeVC)
let v1 = YHNavigationController(rootVC:YHServiceViewController())
let v2 = YHNavigationController(rootVC:YHMsgViewController())
let v3 = YHNavigationController(rootVC:YHMyViewController())
v0.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "首页", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1"))
v1.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "服务中心", image: UIImage(named: "service"), selectedImage: UIImage(named: "service_1"))
v2.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "消息", image: UIImage(named: "msg"), selectedImage: UIImage(named: "msg_1"))
v3.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "我的", image: UIImage(named: "me"), selectedImage: UIImage(named: "me_1"))
tabBarController.viewControllers = [v0,v1,v2,v3]
tabBarController.tabBar.backgroundColor = .white
let nav = YHNavigationController(rootVC:YHStartPageViewController())
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = YHStartPageViewController()
window?.rootViewController = nav
window?.makeKeyAndVisible()
}
}
......
......@@ -24,15 +24,21 @@ extension AppDelegate: JPUSHRegisterDelegate {
// init Push
// notice: 2.1.5 版本的 SDK 新增的注册方法,改成可上报 IDFA,如果没有使用 IDFA 直接传 nil
//初始化极光推送服务,调用了本 API 后,开启 JPush 推送服务,将会开始收集上报 SDK 业务功能所必要的用户个人信息
// [JPUSHService setupWithOption:launchOptions appKey:appKey
// channel:channel
// apsForProduction:isProduction
// advertisingIdentifier:advertisingId];
// [JPUSHService setupWithOption:launchOptions appKey:appKey
// channel:channel
// apsForProduction:isProduction
// advertisingIdentifier:advertisingId];
#if DEBUG
let isProduction = false
#elseif TESTENV
let isProduction = true
#else
let isProduction = true
#endif
JPUSHService.setup(withOption:launchOptions,
appKey:"c6a9e10575b85ee90f3e8afe",
channel:"",
channel:"appStore",
apsForProduction: isProduction)
}
......@@ -41,47 +47,80 @@ extension AppDelegate: JPUSHRegisterDelegate {
let deviceTokenStr = deviceToken.map{String(format:"%02.2hhx", arguments: [$0]) }.joined()
print("deviceToken:\(deviceTokenStr)")
JPUSHService.registerDeviceToken(deviceToken)
YHLoginManager.shared.userModel?.deviceToken = deviceTokenStr
YHLoginManager.shared.deviceTokenModel.deviceToken = deviceTokenStr
#if DEBUG
// YHHUD.flash(message: deviceTokenStr)
#elseif TESTENV
// YHHUD.flash(message: deviceTokenStr)
#else
#endif
}
//获取token 失败
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { //可选
print("did Fail To Register For Remote Notifications With Error: \(error)")
#if DEBUG
YHHUD.flash(message: error.localizedDescription)
#elseif TESTENV
YHHUD.flash(message: error.localizedDescription)
#else
#endif
}
//点推送进来执行这个方法
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
JPUSHService.handleRemoteNotification(userInfo)
completionHandler(UIBackgroundFetchResult.newData)
JPUSHService.handleRemoteNotification(userInfo)
completionHandler(UIBackgroundFetchResult.newData)
// 转换到消息tab
YHLoginManager.shared.needJumpToMsgTabFlag = true
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25, execute: {
goTabBarBy(tabType: .message)
})
}
//后台进前台
func applicationDidEnterBackground(_ application: UIApplication) {
//销毁通知红点
UIApplication.shared.applicationIconBadgeNumber = 0
JPUSHService.setBadge(0)
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
func applicationWillEnterForeground(_ application: UIApplication) {
DispatchQueue.main.async {
// 请求消息页面通知权限通知
NotificationCenter.default.post(name: YhConstant.YhNotification.didReqeustNotifyPermissionNotification, object: nil)
}
}
@available(iOS 10.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: ((Int) -> Void)) {
let userInfo = notification.request.content.userInfo
if notification.request.trigger is UNPushNotificationTrigger {
JPUSHService.handleRemoteNotification(userInfo)
}
// 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以选择设置
completionHandler(Int(UNNotificationPresentationOptions.alert.rawValue))
// 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以选择设置
completionHandler(Int(UNNotificationPresentationOptions.alert.rawValue))
// 显示通知时需要刷新消息列表和消息未读总数
DispatchQueue.main.async {
// 请求消息未读总数通知
NotificationCenter.default.post(name: YhConstant.YhNotification.didRequestUnreadMsgTotalCountNotification, object: nil)
// 请求消息列表通知
NotificationCenter.default.post(name: YhConstant.YhNotification.didRequestUnreadMsgListNotification, object: nil)
}
}
@available(iOS 10.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: (() -> Void)) {
let userInfo = response.notification.request.content.userInfo
let userInfo = response.notification.request.content.userInfo
if response.notification.request.trigger is UNPushNotificationTrigger {
JPUSHService.handleRemoteNotification(userInfo)
}
// 系统要求执行这个方法
completionHandler()
// 转换到消息tab
YHLoginManager.shared.needJumpToMsgTabFlag = true
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25, execute: {
goTabBarBy(tabType: .message)
})
}
......
......@@ -28,8 +28,7 @@ class YHBaseViewController: UIViewController {
#if DEBUG
IQKeyboardManager.shared.enable = true
#endif
navigationController?.interactivePopGestureRecognizer?.delegate = self
}
override var prefersStatusBarHidden: Bool {
......@@ -45,4 +44,36 @@ class YHBaseViewController: UIViewController {
printLog(#function)
#endif
}
func popGestureClose() {
if let ges = self.navigationController?.interactivePopGestureRecognizer?.view?.gestureRecognizers {
for item in ges {
item.isEnabled = false
}
}
}
func popGestureOpen() {
if let ges = self.navigationController?.interactivePopGestureRecognizer?.view?.gestureRecognizers {
for item in ges {
item.isEnabled = false
}
}
}
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
if children.count == 1 {
return false
}else{
return true
}
}
}
extension YHBaseViewController: UIGestureRecognizerDelegate {
// 这个方法是在手势将要激活前调用
// 返回YES允许右滑手势的激活,返回NO不允许右滑手势的激活
func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}
......@@ -10,6 +10,13 @@ import UIKit
class YHNavigationController: UINavigationController {
override func viewDidLoad() {
super.viewDidLoad()
guard let targets = interactivePopGestureRecognizer?.value(forKey: "_targets") as? [NSObject] else {return}
let targetObjc = targets[0]
let target = targetObjc.value(forKey: "target")
let action = Selector(("handleNavigationTransition:"))
let panges = UIPanGestureRecognizer(target: target, action: action)
view.addGestureRecognizer(panges)
}
override func pushViewController(_ viewController: UIViewController, animated: Bool) {
......
......@@ -10,9 +10,28 @@ import UIKit
import ESTabBarController_swift
class YHTabBarViewController: ESTabBarController {
lazy var viewModel = {
let model = YHMsgViewModel()
return model
}()
override func viewDidLoad() {
super.viewDidLoad()
handleTabBarLine()
addObservers()
if YHLoginManager.shared.isLogin() {
getTotalUnreadMsgCount()
reportDeviceInfo()
}
}
func addObservers() {
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(clearAllUnreadBadge), name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(getTotalUnreadMsgCount), name: YhConstant.YhNotification.didRequestUnreadMsgTotalCountNotification, object: nil)
}
}
......@@ -24,6 +43,68 @@ extension YHTabBarViewController {
@objc func showTabBar() -> Void {
self.tabBar.isHidden = false
}
@objc func loginSuccess() {
printLog("登录成功,进行相应的 UI刷新操作")
getTotalUnreadMsgCount()
}
@objc func logoutSuccess() {
printLog("登出成功")
}
@objc func clearAllUnreadBadge() {
DispatchQueue.main.async {
if let vcs = self.viewControllers, let msgListVC = vcs[safe: 2] {
msgListVC.tabBarItem.badgeValue = nil
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
}
// 请求未读消息总数
@objc func getTotalUnreadMsgCount() {
if !YHLoginManager.shared.isLogin() {
return
}
self.viewModel.requestTotalUnreadMsgCount {
[weak self] success, error in
guard let self = self else { return }
DispatchQueue.main.async {
if let vcs = self.viewControllers, let msgListVC = vcs[safe: 2] {
let count = self.viewModel.unreadTotalCount
var unreadText:String? = nil
if 0 < count && count <= 99 {
unreadText = String(count)
} else if count > 99 {
unreadText = "99+"
}
msgListVC.tabBarItem.badgeValue = unreadText
}
}
}
}
func reportDeviceInfo() {
if !YHLoginManager.shared.isLogin() {
return
}
JPUSHService.registrationIDCompletionHandler {
resCode, registrationID in
if let deviceId = registrationID, !deviceId.isEmpty {
printLog("deviceId:\(deviceId)")
YHLoginManager.shared.deviceTokenModel.registerId = deviceId
self.viewModel.requestReportDeviceInfo(deviceId: deviceId) {
success, error in
if let error = error, !error.errorMsg.isEmpty {
printLog("error:\(error.errorMsg)")
}
}
}
}
}
}
extension YHTabBarViewController {
......@@ -31,7 +112,7 @@ extension YHTabBarViewController {
//展示tabbar上的横线
func handleTabBarLine() -> Void {
let rect = CGRect.init(x:0,y:0,width:KScreenWidth,height:0.5)
let fillColor = UIColor(hex:0x222222,transparency: 0.2)!
let fillColor = UIColor(hex:0x121A26,transparency: 0.05)!
let img = UIImage.from(color: fillColor, rect: rect)
UIView.transition(with:self.tabBar, duration:0.5, options: .transitionCrossDissolve) {
......@@ -42,5 +123,4 @@ extension YHTabBarViewController {
} completion: { Bool in
}
}
}
......@@ -22,16 +22,65 @@ class YHConfigManager: NSObject {
super.init()
}
//测试环境-H5
static let baseH5UrlTest : String = "https://test-hkdiy-h5.galaxy-immi.com"
//正式环境-H5
static let baseH5UrlRelease : String = "https://hkdiy-h5.galaxy-immi.com"
//h5地址
var h5Url : String {
return reqVM.configModel?.article_h5_url ?? ""
var tH5url = reqVM.configModel?.article_h5_url ?? ""
if tH5url.isEmpty {
#if DEBUG
tH5url = YHConfigManager.baseH5UrlTest
#elseif TESTENV
tH5url = YHConfigManager.baseH5UrlTest
#else
tH5url = YHConfigManager.baseH5UrlRelease
#endif
}
if !loadNewDataFlag {
loadConfigData()
}
return tH5url + "/"
}
//测试环境-OSS
static let baseOSSUrlTest : String = "https://test-comserver.galaxy-immi.com"
//正式环境-OSS
static let baseOSSUrlRelease : String = "http://comserver.galaxy-immi.com"
//OSS
var ossUrl : String {
var tOssUrl = reqVM.configModel?.oss_server ?? ""
if tOssUrl.isEmpty {
#if DEBUG
tOssUrl = YHConfigManager.baseOSSUrlTest
#elseif TESTENV
tOssUrl = YHConfigManager.baseOSSUrlTest
#else
tOssUrl = YHConfigManager.baseOSSUrlRelease
#endif
}
if !loadNewDataFlag {
loadConfigData()
}
return tOssUrl + "/"
}
}
extension YHConfigManager {
func loadConfigData() {
reqVM.getHomeConfig { flag, error in
if flag {
self.loadNewDataFlag = true
DispatchQueue.global().async {
self.reqVM.getHomeConfig { flag, error in
DispatchQueue.main.async {
if flag {
self.loadNewDataFlag = true
}
}
}
}
}
......
......@@ -17,23 +17,9 @@ class YHFourKingViewController: YHBaseViewController {
var dataSouce: [YHHomeListModel?] = [] {
didSet {
self.homeTableView.reloadData()
self.tableFootView.items = dataSouce
}
}
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .plain)
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0
}
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 81.0
tableView.register(YHServerHKLifeViewCell.self,forCellReuseIdentifier: YHServerHKLifeViewCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
......@@ -53,18 +39,35 @@ extension YHFourKingViewController {
for item in classify {
let model = item as YHHomeClassifyModel
if model.id == self.id {
gk_navTitle = model.name
self.sectionView.items = model.children
let classifyID = model.children.first?.id ?? 0
self.classId = classifyID
self.homeViewModel.getList(true, classifyID) {[weak self] success, error in
guard let self = self else { return }
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
if self.classId == 0 {
gk_navTitle = model.name
self.sectionView.items = model.children
if model.children.count == 1 {
self.updateAllView()
}
let classifyID = model.children.first?.id ?? 0
self.classId = classifyID
self.homeViewModel.getList(true, classifyID) {[weak self] success, error in
guard let self = self else { return }
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
}
}
}
}
}
}
func updateAllView() {
sectionView.snp.remakeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(0)
}
tableFootView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
}
}
func setupUI() {
gk_navBarAlpha = 1
......@@ -73,81 +76,46 @@ extension YHFourKingViewController {
let view = YHServiceSectionView()
view.block = {[weak self] model in
guard let self = self else { return }
self.tableFootView.myCollectView.es.resetNoMoreData()
self.tableFootView.myCollectView.setContentOffset(CGPoint.zero, animated: false)
self.classId = model.id
self.homeViewModel.getList(true, model.id) {[weak self] success, error in
guard let self = self else { return }
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
if self.homeViewModel.hasMoreForHomeNews == false {
self.homeTableView.es.noticeNoMoreData()
self.tableFootView.myCollectView.es.noticeNoMoreData()
}
}
}
return view
}()
view.addSubview(homeTableView)
homeTableView.tableFooterView = tableFootView
homeTableView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
view.addSubview(sectionView)
sectionView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(48)
}
homeTableView.delegate = self
homeTableView.dataSource = self
homeTableView.es.addInfiniteScrolling {[weak self] in
tableFootView = YHServiceTableFootView()
tableFootView.moreBlock = {[weak self] in
guard let self = self else { return }
self.homeViewModel.getList(false, self.classId) {[weak self] success, error in
guard let self = self else { return }
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
self.homeTableView.es.stopLoadingMore()
if self.homeViewModel.hasMoreForHomeNews == false {
self.homeTableView.es.noticeNoMoreData()
}
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.35, execute: {
CATransaction.setDisableActions(true)
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
CATransaction.commit()
self.tableFootView.myCollectView.es.stopLoadingMore()
if self.homeViewModel.hasMoreForHomeNews == false {
self.tableFootView.myCollectView.es.noticeNoMoreData()
}
})
}
}
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHFourKingViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 48
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return sectionView
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return KScreenHeight
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = tableView.dequeueReusableCell(withClass: YHServerHKLifeViewCell.self)
cell0.tableFootView.items = dataSouce
cell0.selectionStyle = .none
return cell0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
view.addSubview(tableFootView)
tableFootView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar + 48)
}
}
}
......@@ -8,6 +8,7 @@
import UIKit
import WebKit
import Photos
class YHHKEventViewController: YHBaseViewController {
let homeViewModel: YHHomePageViewModel = YHHomePageViewModel()
......@@ -23,6 +24,17 @@ class YHHKEventViewController: YHBaseViewController {
super.viewWillAppear(animated)
loadData()
}
lazy var bottomViewForSavePic: YHHomeWebViewBottomForSavePicView = {
let view = YHHomeWebViewBottomForSavePicView()
view.isHidden = true
return view
}()
private var picUrl : String = ""
}
extension YHHKEventViewController {
......@@ -53,6 +65,21 @@ extension YHHKEventViewController {
let request = NSURLRequest(url: url! as URL)
// 加载请求
self.webview.load(request as URLRequest)
let navHeight = self.navigationController?.navigationBar.frame.height
//获取状态栏高度
let statusHeight = k_Height_statusBar()
if model.tag.contains("日历") {
picUrl = urlString
bottomViewForSavePic.isHidden = false
// 创建wkwebview
webview.frame = CGRect(x: 0, y: statusHeight + navHeight! + 48, width: self.view.frame.width, height: self.view.frame.height - statusHeight - navHeight! - 48 - YHHomeWebViewBottomForSavePicView.viewH)
} else {
bottomViewForSavePic.isHidden = true
webview.frame = CGRect(x: 0, y: statusHeight + navHeight! + 48, width: self.view.frame.width, height: self.view.frame.height - statusHeight - navHeight! - 48)
}
}
return view
}()
......@@ -71,7 +98,55 @@ extension YHHKEventViewController {
// 创建wkwebview
webview = WKWebView(frame: CGRect(x: 0, y: statusHeight + navHeight! + 48, width: self.view.frame.width, height: self.view.frame.height - statusHeight - navHeight! - 48))
// 添加wkwebview
self.view.addSubview(webview)
view.addSubview(webview)
view.addSubview(bottomViewForSavePic)
bottomViewForSavePic.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(YHHomeWebViewBottomForSavePicView.viewH)
}
bottomViewForSavePic.block = { tag in
self.saveImageToPhotoLib()
}
}
}
extension YHHKEventViewController {
func saveImageToPhotoLib() {
var urlString = self.picUrl
guard let url = URL(string: urlString) else {
YHHUD.flash(message: "参数错误,保存失败")
return
}
YHHUD.show(.progress(message: "处理中..."))
let task = URLSession.shared.dataTask(with: url) { data, response, error in
DispatchQueue.main.async {
YHHUD.hide()
guard let data = data, error == nil else { return YHHUD.flash(message: "保存成功") }
let image = UIImage(data: data)
if let image = image {
// 保存图片到图库
PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.creationRequestForAsset(from: image)
}, completionHandler: { success, error in
if success {
// 图片保存成功
DispatchQueue.main.async {
YHHUD.flash(message: "保存成功")
}
} else if let error = error {
// 保存失败
DispatchQueue.main.async {
YHHUD.flash(message: "保存失败")
}
print("保存图片出错: \(error.localizedDescription)")
}
})
}
}
}
task.resume()
}
}
......@@ -20,7 +20,7 @@ class YHHomePageViewController: YHBaseViewController {
// 设置布局方向
let flowLayout = YHHomeCollectionLayout()
flowLayout.minimumInteritemSpacing = 7.0
flowLayout.minimumColumnSpacing = 10.0
flowLayout.minimumColumnSpacing = 7.0
flowLayout.sectionInset = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
......@@ -55,9 +55,8 @@ class YHHomePageViewController: YHBaseViewController {
return view
}()
var tapTimestamp : CFAbsoluteTime = -10.0
var tapTimestamp : CFAbsoluteTime = -10.0
}
private extension YHHomePageViewController {
......@@ -67,44 +66,58 @@ private extension YHHomePageViewController {
}
func getData() {
homeHeaderView.homeBannerView.dataArr = [YHBannerModel.localDefaultItem()]
loadFirstData()
getHomeBannerData()
viewModel.getHomeBanner(0) {[weak self] success, error in
guard let self = self else { return }
self.homeHeaderView.homeBannerView.dataArr = self.viewModel.banners ?? []
}
func getHomeBannerData() {
DispatchQueue.global().async {
self.viewModel.getHomeBanner(0) {[weak self] success, error in
guard let self = self else { return }
DispatchQueue.main.async {
self.homeHeaderView.homeBannerView.dataArr = self.viewModel.banners ?? [YHBannerModel.localDefaultItem()]
}
}
}
}
func loadMoreData() {
viewModel.getHomeNewsList(firstPageFlag : false) {[weak self] success, error in
guard let self = self else { return }
homeCollectView.es.stopLoadingMore()
if self.viewModel.hasMoreForHomeNews == false {
homeCollectView.es.noticeNoMoreData()
DispatchQueue.global().async {
self.viewModel.getHomeNewsList(firstPageFlag : false) {[weak self] success, error in
guard let self = self else { return }
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.35, execute: {
CATransaction.setDisableActions(true)
self.homeCollectView.reloadData()
CATransaction.commit()
self.homeCollectView.es.stopLoadingMore()
if self.viewModel.hasMoreForHomeNews == false {
self.homeCollectView.es.noticeNoMoreData()
}
})
}
self.homeCollectView.reloadData()
}
}
func loadFirstData() {
viewModel.getHomeNewsList(firstPageFlag : true) {[weak self] success, error in
guard let self = self else { return }
homeCollectView.es.stopPullToRefresh()
if self.viewModel.hasMoreForHomeNews == false {
homeCollectView.es.noticeNoMoreData()
DispatchQueue.global().async {
self.viewModel.getHomeNewsList(firstPageFlag : true) {[weak self] success, error in
guard let self = self else { return }
DispatchQueue.main.async {
self.homeCollectView.es.stopPullToRefresh()
if self.viewModel.hasMoreForHomeNews == false {
self.homeCollectView.es.noticeNoMoreData()
}
CATransaction.setDisableActions(true)
self.homeCollectView.reloadData()
CATransaction.commit()
}
}
self.homeCollectView.reloadData()
// DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute:{
// printLog(YHHomeHeadView.viewH)
// printLog(self.homeCollectView.contentOffset)
// })
}
}
......@@ -112,7 +125,9 @@ private extension YHHomePageViewController {
gk_navigationBar.isHidden = true
view.backgroundColor = .white
// NotificationCenter.default.addObserver(self, selector: #selector(homepageRefresh), name:YhConstant.YhNotification.refreshHomePageNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
view.addSubview(searchView)
searchView.snp.makeConstraints { make in
......@@ -124,13 +139,14 @@ private extension YHHomePageViewController {
view.addSubview(homeCollectView)
homeCollectView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.left.right.equalToSuperview()
make.top.equalTo(searchView.snp.bottom).offset(6)
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
}
homeHeaderView.frame = CGRect(x: 20, y: -YHHomeHeadView.viewH, width: KScreenWidth - 40, height: YHHomeHeadView.viewH)
homeCollectView.addSubview(homeHeaderView)
homeCollectView.contentInset = UIEdgeInsets(top: YHHomeHeadView.viewH, left: 0, bottom: 20, right: 0)
homeCollectView.contentInset = UIEdgeInsets(top: YHHomeHeadView.viewH, left: 0, bottom: 0, right: 0)
let tmpHeadView = homeCollectView.es.addPullToRefresh {
self.loadFirstData()
......@@ -140,6 +156,8 @@ private extension YHHomePageViewController {
r.origin.y = r.origin.y - YHHomeHeadView.viewH
tmpHeadView.frame = r
homeCollectView.showsHorizontalScrollIndicator = false
homeCollectView.showsVerticalScrollIndicator = false
homeCollectView.es.addInfiniteScrolling {
self.loadMoreData()
}
......@@ -148,6 +166,15 @@ private extension YHHomePageViewController {
@objc func homepageRefresh() {
loadFirstData()
}
@objc func loginSuccess() {
getData()
}
@objc func logoutSuccess() {
getData()
}
}
extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDataSource {
......@@ -166,7 +193,7 @@ extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDa
guard let model = self.viewModel.arrHomeNewsData?[indexPath.row] else { return }
if model.type == 2 {
let vc = YHHomeWebViewController()
vc.url = YHConfigManager.shared.h5Url + "?id=\(model.id)"
vc.url = YHBaseUrlManager.shared.curH5URL() + "articleDetail.html" + "?id=\(model.id)"
vc.id = model.id
vc.block = { item in
if let arr = self.viewModel.arrHomeNewsData {
......@@ -174,11 +201,10 @@ extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDa
if targetItem.id == item.id {
targetItem.is_like = item.is_like
targetItem.like_count = item.like_count
self.homeCollectView.reloadItems(at: [IndexPath(index: index)])
self.homeCollectView.reloadItems(at: [IndexPath.SubSequence(item: index, section: 0)])
}
}
}
}
self.navigationController?.pushViewController(vc)
} else if model.type == 1 {
......@@ -203,11 +229,36 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
let timestamp = CFAbsoluteTimeGetCurrent()
printLog(timestamp - self.tapTimestamp)
if timestamp - self.tapTimestamp < doubleTapInterval {
UIView.animate(withDuration: 0.25) {
self.homeCollectView.contentOffset = CGPoint(x: 0, y: -YHHomeHeadView.viewH)//置顶功能
}
self.homeCollectView.setContentOffset(CGPoint(x: 0, y: -YHHomeHeadView.viewH), animated: true)
}
self.tapTimestamp = timestamp
} else if tabBarController.selectedIndex == 2 {
// 点击消息tab 清空应用icon未读数
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
guard let index = tabBarController.viewControllers?.firstIndex(of: viewController) else {
return false
}
if index == 1 || index == 2 {
if YHLoginManager.shared.isLogin() {
return true
} else {
let vc = UINavigationController(rootVC: YHPhoneLoginViewController())
vc.modalPresentationStyle = .custom
UIViewController.current?.navigationController?.present(vc, animated: true)
YHLoginManager.shared.loginSuccessActionBlock = {[weak self] in
guard self != nil else { return }
tabBarController.selectedIndex = index
YHLoginManager.shared.loginSuccessActionBlock = nil
}
return false
}
}
return true
}
}
......@@ -8,6 +8,7 @@
import UIKit
import WebKit
import Photos
class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
......@@ -23,9 +24,25 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
var bottomView: YHHomeWebBottomView!
var url = ""
var id: Int = 0
var vcTitle : String?
lazy var bottomViewForSavePic: YHHomeWebViewBottomForSavePicView = {
let view = YHHomeWebViewBottomForSavePicView()
view.isHidden = true
return view
}()
//有些界面需要保存图片的功能
var showSavePicBottomFlag : Bool = false
override func viewDidLoad() {
super.viewDidLoad()
gk_navBarAlpha = 1.0
gk_navLineHidden = false
gk_navTitle = vcTitle
view.backgroundColor = .white
viewModel = YHHomeWebViewModel()
//获取导航栏高度
let navHeight = self.navigationController?.navigationBar.frame.height
......@@ -67,7 +84,6 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
guard let self = self else { return }
if success {
operationFlag = true
YHHUD.flash(message: "已点赞")
self.getData()
} else {
operationFlag = false
......@@ -78,7 +94,6 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
guard let self = self else { return }
if success {
operationFlag = true
YHHUD.flash(message: "已取消点赞")
self.getData()
} else {
operationFlag = false
......@@ -100,7 +115,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
guard let self = self else { return }
if success {
operationFlag = true
YHHUD.flash(message: "已收藏")
YHHUD.flash(message: "已加入收藏")
self.getData()
} else {
operationFlag = false
......@@ -111,7 +126,6 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
guard let self = self else { return }
if success {
operationFlag = true
YHHUD.flash(message: "已取消收藏")
self.getData()
} else {
operationFlag = false
......@@ -126,7 +140,6 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
make.bottom.left.right.equalToSuperview()
make.height.equalTo(59 + k_Height_safeAreaInsetsBottom())
}
getData()
if id == 0 {
if self.url.contains("?id=") {
......@@ -134,6 +147,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
if list.count == 2 {
if let iddd = list[1].int {
id = iddd
getData()
return
}
}
......@@ -141,6 +155,24 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
bottomView.isHidden = true
webview.frame = CGRect(x: 0, y: statusHeight + navHeight!, width: self.view.frame.width, height: self.view.frame.height - statusHeight - navHeight!)
}
if showSavePicBottomFlag {
bottomViewForSavePic.isHidden = false
view.addSubview(bottomViewForSavePic)
bottomViewForSavePic.snp.makeConstraints { make in
make.left.bottom.right.equalToSuperview()
make.height.equalTo(YHHomeWebViewBottomForSavePicView.viewH)
}
bottomViewForSavePic.block = { tag in
self.saveImageToPhotoLib()
}
webview.frame = CGRect(x: 0, y: statusHeight + navHeight!, width: self.view.frame.width, height: self.view.frame.height - statusHeight - navHeight! - YHHomeWebViewBottomForSavePicView.viewH)
} else {
bottomViewForSavePic.isHidden = true
}
getData()
}
deinit {
......@@ -148,23 +180,31 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
}
func getData() {
viewModel.getWebDetail(self.id) {[weak self] success, error in
guard let self = self else { return }
if success {
guard let model = self.viewModel.mainModel else { return }
bottomView.likeCount = model.like_count
bottomView.starCount = model.collect_count
bottomView.isStar = model.is_collect
bottomView.isLike = model.is_like
self.block?(model)
if id > 0 {
viewModel.getWebDetail(self.id) {[weak self] success, error in
guard let self = self else { return }
if success {
guard let model = self.viewModel.mainModel else { return }
bottomView.likeCount = model.like_count
bottomView.starCount = model.collect_count
bottomView.isStar = model.is_collect
bottomView.isLike = model.is_like
if operationFlag {
self.block?(model)
}
}
}
}
}
// MARK: - WKNavigationDelegate
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.navigationItem.title = webview.title
if vcTitle == nil {
gk_navTitle = webview.title
}
}
// MARK: - WKUIDelegate
......@@ -193,7 +233,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
webview.goBack()
}
}
@objc func toForward() {
if webview.canGoForward {
webview.goForward()
......@@ -201,12 +241,12 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
}
// MARK: - KVO
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if keyPath == "estimatedProgress" {
self.progBar.alpha = 1.0
progBar.setProgress(Float(webview.estimatedProgress), animated: true)
//进度条的值最大为1.0
//进度条的值最大为1.0
if(self.webview.estimatedProgress >= 1.0) {
UIView.animate(withDuration: 0.3, delay: 0.1, options: .curveEaseInOut, animations: { () -> Void in
self.progBar.alpha = 0.0
......@@ -220,4 +260,41 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
override class func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
}
func saveImageToPhotoLib() {
var urlString = self.url
guard let url = URL(string: urlString) else {
YHHUD.flash(message: "参数错误,保存失败")
return
}
YHHUD.show(.progress(message: "处理中..."))
let task = URLSession.shared.dataTask(with: url) { data, response, error in
DispatchQueue.main.async {
YHHUD.hide()
guard let data = data, error == nil else { return YHHUD.flash(message: "保存成功") }
let image = UIImage(data: data)
if let image = image {
// 保存图片到图库
PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.creationRequestForAsset(from: image)
}, completionHandler: { success, error in
if success {
// 图片保存成功
DispatchQueue.main.async {
YHHUD.flash(message: "保存成功")
}
} else if let error = error {
// 保存失败
DispatchQueue.main.async {
YHHUD.flash(message: "保存失败")
}
print("保存图片出错: \(error.localizedDescription)")
}
})
}
}
}
task.resume()
}
}
......@@ -7,11 +7,14 @@
//
import UIKit
import AVFoundation
import AVKit
class YHSearchInfomationVC: YHBaseViewController {
static let searchInfoHistoryKey = "searchInfoHistoryKey"
static let searchHistoryMaxCount = 10
var searchStr = ""
var items:[YHHomeListModel] = []
lazy var viewModel: YHHomePageViewModel = {
......@@ -19,6 +22,11 @@ class YHSearchInfomationVC: YHBaseViewController {
return viewModel
}()
lazy var homeViewModel: YHHomeWebViewModel = {
let viewModel = YHHomeWebViewModel()
return viewModel
}()
lazy var navBar:UIView = {
let bar = UIView()
let backBtn = UIButton()
......@@ -39,9 +47,16 @@ class YHSearchInfomationVC: YHBaseViewController {
bar.searchBlock = {
[weak self] text in
guard let self = self else { return }
searchText(self.searchBar.textField.text ?? "")
if let searchText = self.searchBar.textField.text, searchText.count > 0 {
self.saveSearchHistory(searchText)
searchStr = self.searchBar.textField.text ?? ""
searchStr = searchStr.trimmingCharacters(in: .whitespaces)
if isEmptyString(searchStr) {
searchStr = "香港身份"
self.searchBar.textField.text = "香港身份"
}
searchText()
if searchStr.count > 0 {
self.saveSearchHistory(searchStr)
}
}
bar.textChange = {
......@@ -60,10 +75,7 @@ class YHSearchInfomationVC: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionHeaderHeight = 0.1
tableView.estimatedSectionFooterHeight = 20.0
tableView.showsVerticalScrollIndicator = false
......@@ -73,6 +85,12 @@ class YHSearchInfomationVC: YHBaseViewController {
tableView.backgroundColor = .white
tableView.backgroundView = emptyDataTipsView
tableView.register(YHSearchInfoCell.self, forCellReuseIdentifier: YHSearchInfoCell.cellReuseIdentifier)
tableView.es.addPullToRefresh {
self.loadFirstData()
}
tableView.es.addInfiniteScrolling {
self.loadMoreData()
}
return tableView
}()
......@@ -84,7 +102,8 @@ class YHSearchInfomationVC: YHBaseViewController {
guard let self = self else { return }
self.searchHistoryView.isHidden = true
self.searchBar.textField.text = text
searchText(text)
self.searchStr = text
searchText()
self.saveSearchHistory(text)
}
return view
......@@ -118,6 +137,11 @@ class YHSearchInfomationVC: YHBaseViewController {
return view
}()
lazy var playerViewController: AVPlayerViewController = {
let vc = AVPlayerViewController()
return vc
}()
override func viewDidLoad() {
super.viewDidLoad()
self.setupUI()
......@@ -159,12 +183,14 @@ class YHSearchInfomationVC: YHBaseViewController {
}
}
func searchText(_ text:String) {
func searchText() {
self.tableView.scrollToTop()
YHHUD.show(.progress(message: "搜索中..."))
self.viewModel.searchArticleList(text) {
viewModel.searchArticleList(self.searchStr, isFirstPage : true) {
[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
items.removeAll()
if let arr = self.viewModel.arrHomeNewsData {
items.append(contentsOf: arr)
......@@ -172,6 +198,67 @@ class YHSearchInfomationVC: YHBaseViewController {
emptyDataTipsView.isHidden = (items.count > 0)
searchHistoryView.isHidden = true
self.tableView.reloadData()
tableView.es.stopPullToRefresh()
// 只有一页的时候不展示没有更多数据了
if self.viewModel.totalCount < self.viewModel.searchPageSize { // 不足一页
tableView.footer?.isHidden = true
} else {
tableView.footer?.isHidden = false
if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData()
}
}
}
}
func loadMoreData() {
viewModel.searchArticleList(self.searchStr, isFirstPage : false) {
[weak self] success, error in
guard let self = self else { return }
items.removeAll()
if let arr = self.viewModel.arrHomeNewsData {
items.append(contentsOf: arr)
}
emptyDataTipsView.isHidden = (items.count > 0)
searchHistoryView.isHidden = true
self.tableView.reloadData()
tableView.es.stopLoadingMore()
// 只有一页的时候不展示没有更多数据了
if self.viewModel.totalCount < self.viewModel.searchPageSize { // 不足一页
tableView.footer?.isHidden = true
} else {
tableView.footer?.isHidden = false
if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData()
}
}
}
}
func loadFirstData() {
viewModel.searchArticleList(self.searchStr, isFirstPage : true) {
[weak self] success, error in
guard let self = self else { return }
items.removeAll()
if let arr = self.viewModel.arrHomeNewsData {
items.append(contentsOf: arr)
}
emptyDataTipsView.isHidden = (items.count > 0)
searchHistoryView.isHidden = true
self.tableView.reloadData()
tableView.es.stopPullToRefresh()
// 只有一页的时候不展示没有更多数据了
if self.viewModel.totalCount < self.viewModel.searchPageSize { // 不足一页
tableView.footer?.isHidden = true
} else {
tableView.footer?.isHidden = false
if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData()
}
}
}
}
......@@ -187,10 +274,13 @@ class YHSearchInfomationVC: YHBaseViewController {
if isEmptyString(text) { return }
var arr = getSearchHistoryList()
// 去除两端的空格
let targetText = text.trimmingCharacters(in: .whitespaces)
// 查找历史记录中是否有相同记录
var targetIndex = -1
for (index, history) in arr.enumerated() {
if history == text {
if history == targetText {
targetIndex = index
break
}
......@@ -202,9 +292,9 @@ class YHSearchInfomationVC: YHBaseViewController {
// 将最近记录放在第一位
if arr.count < Self.searchHistoryMaxCount {
arr.insert(text, at: 0)
arr.insert(targetText, at: 0)
} else {
arr.insert(text, at: 0)
arr.insert(targetText, at: 0)
arr.removeLast()
}
UserDefaults.standard.set(arr, forKey: Self.searchInfoHistoryKey)
......@@ -233,7 +323,7 @@ extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource {
if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section]
cell.updateModel(item)
cell.renderHighLightText(self.searchBar.textField.text ?? "")
cell.renderHighLightText(searchStr)
}
return cell
}
......@@ -246,9 +336,29 @@ extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource {
if 0 <= indexPath.section && indexPath.section < items.count {
let model = items[indexPath.section]
if model.type == 1 { // 视频
if !model.media_url.isEmpty, let url = URL(string: model.media_url) {
let player = AVPlayer(url:url)
player.isMuted = true
playerViewController.player = player
self.present(self.playerViewController, animated: true) {
self.playerViewController.player!.play() // 开始播放视频
}
DispatchQueue.main.async {
self.homeViewModel.getWebDetail(model.id) { success, error in
}
}
}
return
}
// 非视频类型
let vc = YHHomeWebViewController()
vc.url = YHConfigManager.shared.h5Url + "?id=\(model.id)"
vc.url = YHBaseUrlManager.shared.curH5URL() + "articleDetail.html" + "?id=\(model.id)"
vc.id = model.id
print("URL: \(vc.url)")
self.navigationController?.pushViewController(vc)
}
}
......
......@@ -35,8 +35,13 @@ class YHStartPageViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
initView()
self.startTimer()
}
lazy var agreeAlertView : YHAgreementAlertView = {
let view = YHAgreementAlertView()
view.isHidden = true
return view
}()
}
......@@ -70,13 +75,14 @@ private extension YHStartPageViewController {
}
func initView() {
gk_navigationBar.isHidden = true
imagV.image = UIImage(named: "start_page_bkg")
view.addSubview(imagV)
imagV.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
view.addSubview(closeBtn)
closeBtn.layer.zPosition = 10
closeBtn.clipsToBounds = true
......@@ -88,6 +94,54 @@ private extension YHStartPageViewController {
make.height.equalTo(28)
}
closeBtn.addTarget(self, action: #selector(clickCancelBtn), for: .touchUpInside)
view.addSubview(agreeAlertView)
agreeAlertView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
if let key = UserDefaults.standard.value(forKey: "userAgreeProtocal") as? String,key.contains("true") {
startTimer()
} else {
agreeAlertView.isHidden = false
cancelTimer()
closeBtn.isHidden = true
agreeAlertView.agreeBlock = {
UserDefaults.standard.set("true", forKey: "userAgreeProtocal")
UserDefaults.standard.synchronize()
self.closeBtn.isHidden = false
self.startTimer()
}
agreeAlertView.cancelBlock = {
//点击了取消按钮
YHCommonAlertView.show("", "确认退出智汇银河App?", "退出", "继续使用") {
//退出
exit(0)
} callBack: {
//继续使用
self.view.addSubview(self.agreeAlertView)
self.agreeAlertView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
self.agreeAlertView.isHidden = false
self.cancelTimer()
self.closeBtn.isHidden = true
}
}
agreeAlertView.urlBlock = { [weak self] url in
guard let self = self else { return }
let vc = YHWebViewViewController()
vc.url = url
self.navigationController?.pushViewController(vc)
}
}
}
@objc func clickCancelBtn() {
......@@ -101,13 +155,13 @@ private extension YHStartPageViewController {
let homeVC = YHHomePageViewController()
tabBarController.delegate = homeVC
let v0 = YHNavigationController(rootVC:homeVC)
let v1 = YHNavigationController(rootVC:YHServiceViewController())
let v2 = YHNavigationController(rootVC:YHMsgViewController())
let v1 = YHNavigationController(rootVC:YHServiceCenterMainViewController())
let v2 = YHNavigationController(rootVC:YHMessageListVC())
let v3 = YHNavigationController(rootVC:YHMyViewController())
v0.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "首页", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1"))
v1.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "服务中心", image: UIImage(named: "service"), selectedImage: UIImage(named: "service_1"))
v1.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "服务", image: UIImage(named: "service"), selectedImage: UIImage(named: "service_1"))
v2.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "消息", image: UIImage(named: "msg"), selectedImage: UIImage(named: "msg_1"))
......@@ -119,5 +173,11 @@ private extension YHStartPageViewController {
let window = UIApplication.shared.yhKeyWindow()
window?.rootViewController = tabBarController
window?.makeKeyAndVisible()
if YHLoginManager.shared.needJumpToMsgTabFlag {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25, execute: {
goTabBarBy(tabType: .message)
})
}
}
}
......@@ -16,4 +16,16 @@ class YHBannerModel: YHBaseModel {
var create_at: String = ""
var skip_type: Int = 0
var id: Int = 0
//是否为本地
var isLocalItemFlag : Bool = false
//
static func localDefaultItem() -> YHBannerModel {
let model = YHBannerModel()
model.isLocalItemFlag = true
model.img_url = "home_banner_default_icon"
model.type = 0
return model
}
}
......@@ -71,6 +71,8 @@ class YHHomeListModel: YHBaseModel {
imageHeight = width * imageSize.height/imageSize.width
if imageHeight > 280 {
imageHeight = 280
} else if imageHeight < 140 {
imageHeight = 140
}
}
......
//
// YHAgreementAlertView.swift
// galaxy
//
// Created by davidhuangA on 2024/4/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHAgreementAlertView: UIView {
typealias UrlBlock = (_ url: String) -> ()
var urlBlock: UrlBlock?
typealias AgreeBlock = () -> ()
var agreeBlock: AgreeBlock?
var cancelBlock:AgreeBlock?
var centerView: UIView!
var titleLabel: UILabel!
var lineView: UIView!
var messageLabel: UILabel!
var agreeButton: UIButton!
var disAgressButton: UIButton!
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x0000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.left.equalTo(38)
make.right.equalTo(-38)
}
titleLabel = {
let label = UILabel()
label.textAlignment = .center
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 17)
label.numberOfLines = 0
label.text = "欢迎使用智汇银河App"
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.top.equalTo(kMargin)
}
lineView = {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xF0F0F0)
return line
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalTo(0)
make.height.equalTo(1)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
messageLabel = {
let label = UILabel()
label.textAlignment = .center
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_R(ofSize: 16)
label.numberOfLines = 0
label.text = ""
return label
}()
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(21)
make.right.equalTo(-21)
make.top.equalTo(lineView.snp.bottom).offset(kMargin)
}
disAgressButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("取消", for: .normal)
button.setTitleColor( UIColor(hex:0x3c86f8), for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x3c86f8).cgColor
button.addTarget(self, action: #selector(disagree), for: .touchUpInside)
return button
}()
let itemW = (KScreenWidth - kMargin * 2 - 10 - 38 * 2) / 2.0
centerView.addSubview(disAgressButton)
disAgressButton.snp.makeConstraints { make in
make.top.equalTo(messageLabel.snp.bottom).offset(21)
make.left.equalTo(kMargin)
make.bottom.equalTo(-kMargin)
make.height.equalTo(45)
make.width.equalTo(itemW)
}
agreeButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x3c86f8)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("确认", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.addTarget(self, action: #selector(agree), for: .touchUpInside)
return button
}()
centerView.addSubview(agreeButton)
agreeButton.snp.makeConstraints { make in
make.height.equalTo(disAgressButton.snp.height)
make.top.equalTo(disAgressButton.snp.top)
make.width.equalTo(itemW)
make.left.equalTo(disAgressButton.snp.right).offset(10)
}
let a: ASAttributedString = .init("感谢您信任并使用智汇银河App,我们将通过", .font(UIFont.PFSC_R(ofSize: 16)),.foreground(UIColor.mainTextColor))
let aa: ASAttributedString = .init("《智汇银河App隐私协议》", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.brandMainColor), .action {
if let block = self.urlBlock {
block("https://www.baidu.com")
}
})
let and: ASAttributedString = .init("和", .font(UIFont.PFSC_R(ofSize: 16)),.foreground(UIColor.mainTextColor))
let aab: ASAttributedString = .init("《智汇银河App用户条款》", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.brandMainColor), .action {
if let block = self.urlBlock {
block("https://www.baidu.com")
}
})
let aaa: ASAttributedString = .init("帮助您了解我们收集、使用、存储和共享个人信息的情况,特别是我们所采取的个人信息类型和用途的对应关系。此外,您还能了解到您所享受的相关权利以及实现途径。认真阅读之后,如您同意,请点击下方的按钮开始接受我们的服务。", .font(UIFont.PFSC_R(ofSize: 16)),.foreground(UIColor.mainTextColor))
messageLabel.attributed.text = a + aa + and + aab + aaa
}
@objc func agree() {
if let block = self.agreeBlock {
block()
}
dismiss()
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
dismiss()
}
@objc func disagree() {
if let block = self.cancelBlock {
block()
}
dismiss()
}
func dismiss() {
removeFromSuperview()
}
}
extension YHAgreementAlertView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
......@@ -121,29 +121,14 @@ private extension YHHkLifeAndIdItemView {
@objc func tapView(gestureRecognizer:UITapGestureRecognizer) {
if itemType == .hkID {
//香港身份
if let vc = UIApplication.shared.keyWindow?.rootViewController as? YHTabBarViewController {
vc.selectedIndex = 1
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
if let vcs = vc.viewControllers,vcs.count > 1 {
if let nvc = vcs[1] as? YHNavigationController,let vvc = nvc.topViewController as? YHServiceViewController {
vvc.jumpToItemIndex(itemIndex: 0)
}
}
}
}
let vc = YHServiceViewController()
vc.defaltIndex = 0
UIViewController.current?.navigationController?.pushViewController(vc)
} else if itemType == .hklife {
//香港生活
if let vc = UIApplication.shared.keyWindow?.rootViewController as? YHTabBarViewController {
vc.selectedIndex = 1
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
if let vcs = vc.viewControllers,vcs.count > 1 {
if let nvc = vcs[1] as? YHNavigationController,let vvc = nvc.topViewController as? YHServiceViewController {
vvc.jumpToItemIndex(itemIndex: 1)
}
}
}
}
let vc = YHServiceViewController()
vc.defaltIndex = 1
UIViewController.current?.navigationController?.pushViewController(vc)
} else {
printLog("errorr:未处理")
}
......
......@@ -27,6 +27,7 @@ class YHHomeBannerCollectionViewCell: FSPagerViewCell {
let imagV : UIImageView = UIImageView()
imagV.contentMode = .scaleAspectFill
imagV.clipsToBounds = true
imagV.image = UIImage(named: "global_default_image")
return imagV
}()
......@@ -75,9 +76,22 @@ private extension YHHomeBannerCollectionViewCell {
func updateUI() {
guard let model = dataModel else { return }
if let url = URL(string: model.img_url) {
bannerImagV.kf.setImage(with: url)
if model.isLocalItemFlag {
bannerTitleLable.isHidden = true
effectV.isHidden = true
bannerImagV.image = UIImage(named: model.img_url)
} else {
bannerTitleLable.isHidden = false
effectV.isHidden = false
if let url = URL(string: model.img_url) {
bannerImagV.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
} else {
bannerImagV.image = UIImage(named: "global_default_image")
}
bannerTitleLable.text = model.name
}
bannerTitleLable.text = model.name
}
}
......@@ -32,7 +32,7 @@ class YHHomeBannerView: UIView {
let view = FSPagerView()
view.delegate = self
view.dataSource = self
view.automaticSlidingInterval = 4
view.automaticSlidingInterval = 3
view.register(YHHomeBannerCollectionViewCell.self, forCellWithReuseIdentifier: "cell")
view.itemSize = CGSizeMake(YHHomeBannerView.viewH, YHHomeBannerView.viewH)//FSPagerView.automaticSize
return view
......@@ -106,6 +106,9 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
return
}
let model = dataArr[index]
if model.isLocalItemFlag {
return
}
if model.skip_url.isEmpty == false {
switch model.skip_type {
case 1: //跳转H5
......
......@@ -28,8 +28,9 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
}
lazy var titleImageView:UIImageView = {
let imageV = UIImageView(image: UIImage(named: "home_title_image"))
let imageV = UIImageView(image: UIImage(named: "home_banner_default_icon"))
imageV.contentMode = .scaleAspectFill
imageV.isUserInteractionEnabled = true
return imageV
}()
......@@ -40,7 +41,7 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
label.textColor = UIColor(hex: 0x121A26, alpha: 1.0)
label.font = UIFont.PFSC_R(ofSize: 14)
label.numberOfLines = 2
label.lineBreakMode = .byWordWrapping
label.lineBreakMode = .byTruncatingTail
return label
}()
......@@ -92,14 +93,20 @@ extension YHHomeCollectionViewCell {
@objc func clickPlayButton() {
guard let listModel = listModel else { return }
//"https://upload.cdn.galaxy-immi.com/sell/production/video/1638527500518.mp4"
if listModel.media_url.isEmpty == false,let url = URL(string: listModel.media_url) {
let player = AVPlayer(url:url)
player.isMuted = true
playerViewController.player = player
self.parentViewController?.present(playerViewController, animated: true) {
self.playerViewController.player!.play() // 开始播放视频
}
DispatchQueue.main.async {
self.viewModel.getWebDetail(listModel.id) { success, error in
}
}
}
}
......@@ -164,15 +171,17 @@ extension YHHomeCollectionViewCell {
make.height.equalTo(listModel.img_height_use)
}
if let url = URL(string: listModel.img_url) {
titleImageView.kf.setImage(with: url)
titleImageView.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
}
descripeLable.text = listModel.title.defaultStringIfEmpty(detaultValue: "***")
descripeLable.text = listModel.title.defaultStringIfEmpty(detaultValue: "银河世纪")
descripeLable.snp.removeConstraints()
descripeLable.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(10)
make.left.equalToSuperview().offset(8)
make.right.equalToSuperview().offset(-8)
make.bottom.equalTo(-36)
make.height.equalTo(listModel.textH)
// make.bottom.equalTo(-36)
}
numLable.text = listModel.like_count.string
heartImageViewBtn.isSelected = listModel.is_like
......@@ -198,7 +207,6 @@ extension YHHomeCollectionViewCell {
viewModel.getLike(listModel.id, 1) {[weak self] success, error in
guard let self = self else { return }
if success {
YHHUD.flash(message: "已点赞")
listModel.is_like = true
listModel.like_count = listModel.like_count + 1
updataSubViews()
......@@ -208,7 +216,6 @@ extension YHHomeCollectionViewCell {
viewModel.getLike(listModel.id, 0) {[weak self] success, error in
guard let self = self else { return }
if success {
YHHUD.flash(message: "已取消点赞")
listModel.is_like = false
listModel.like_count = listModel.like_count - 1
updataSubViews()
......
......@@ -36,7 +36,7 @@ private extension YHHomeSearchView {
let lable = UILabel()
lable.text = "大家正在搜香港身份"
lable.text = "香港身份"
lable.font = UIFont.PFSC_R(ofSize: 12)
lable.textColor = UIColor(hex: 0x94A3B8, alpha: 1.0)
addSubview(lable)
......
......@@ -50,13 +50,13 @@ class YHHomeWebBottomView: UIView {
likeButton = {
let button = YHHomeWebBottomButton()
button.setContent("home_web_like", "652")
button.setContent("home_web_like", "0")
button.addTarget(self, action: #selector(likeBtnClick), for: .touchUpInside)
return button
}()
addSubview(likeButton)
likeButton.snp.makeConstraints { make in
make.right.equalTo(-31)
make.right.equalTo(-79)
make.top.equalTo(10)
make.height.equalTo(39)
make.width.equalTo(24)
......@@ -64,13 +64,13 @@ class YHHomeWebBottomView: UIView {
starButton = {
let button = YHHomeWebBottomButton()
button.setContent("home_web_star", "34")
button.setContent("home_web_star", "0")
button.addTarget(self, action: #selector(starBtnClick), for: .touchUpInside)
return button
}()
addSubview(starButton)
starButton.snp.makeConstraints { make in
make.right.equalTo(-79)
make.right.equalTo(-31)
make.top.equalTo(10)
make.height.equalTo(39)
make.width.equalTo(24)
......@@ -78,6 +78,12 @@ class YHHomeWebBottomView: UIView {
}
@objc private func likeBtnClick() {
if YHLoginManager.shared.isLogin() == false {
if let block = likeBlock {
block(isLike)
}
return
}
isLike = !isLike
if let block = likeBlock {
block(isLike)
......@@ -85,6 +91,13 @@ class YHHomeWebBottomView: UIView {
}
@objc private func starBtnClick() {
if YHLoginManager.shared.isLogin() == false {
if let block = starBlock {
block(isStar)
}
return
}
isStar = !isStar
if let block = starBlock {
block(isStar)
......
//
// YHHomeWebViewBottomForSavePicView.swift
// galaxy
//
// Created by davidhuangA on 2024/4/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHHomeWebViewBottomForSavePicView: UIView {
static let viewH : CGFloat = 98.0
override init(frame: CGRect) {
super.init(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: YHBasicInfoFillBottomView.viewH))
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
typealias Block = (Int) -> ()
var block: Block?
var saveButton: UIButton!
}
private extension YHHomeWebViewBottomForSavePicView {
func setupUI() {
backgroundColor = .white
saveButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.contentBkgColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("保存到相册", for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.layer.borderWidth = 0.5
button.layer.borderColor = UIColor.brandMainColor.cgColor
button.addTarget(self, action: #selector(save), for: .touchUpInside)
return button
}()
addSubview(saveButton)
saveButton.snp.makeConstraints { make in
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
make.top.equalTo(12)
make.height.equalTo(44)
}
}
@objc func save() {
block?(0)
}
}
......@@ -37,7 +37,7 @@ class YHSearchInfoBar: UIView {
lazy var textField:UITextField = {
let textField = UITextField()
textField.backgroundColor = .clear
textField.attributedPlaceholder = NSAttributedString(string: "大家正在搜香港身份".local, attributes: [NSAttributedString.Key.foregroundColor : UIColor(hex: 0x94A3B8)])
textField.attributedPlaceholder = NSAttributedString(string: "香港身份".local, attributes: [NSAttributedString.Key.foregroundColor : UIColor(hex: 0x94A3B8)])
textField.font = UIFont.PFSC_M(ofSize: 12)
textField.tintColor = UIColor(hex: 0x3570DC)
textField.textColor = UIColor(hexString: "#121A26")
......
......@@ -18,7 +18,6 @@ class YHSearchInfoCell: UITableViewCell {
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
......@@ -40,7 +39,7 @@ class YHSearchInfoCell: UITableViewCell {
lazy var titleLabel: UILabel = {
var label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.font = .PFSC_R(ofSize: 15)
label.textAlignment = .left
label.textColor = UIColor(hex: 0x121A26)
label.numberOfLines = 2
......@@ -51,9 +50,8 @@ class YHSearchInfoCell: UITableViewCell {
self.model = model
titleLabel.text = model.title
videoPlayImgView.isHidden = (model.type != 1)
if let url = URL(string: model.img_url) {
headImgView.kf.setImage(with: url)
}
let url = URL(string: model.img_url)
headImgView.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
}
func setupUI() {
......@@ -108,7 +106,7 @@ class YHSearchInfoCell: UITableViewCell {
var occurrences: [Range<String.Index>] = []
var searchStartIndex = string.startIndex
while let range = string.range(of: searchString, options: [], range: searchStartIndex..<string.endIndex) {
while let range = string.range(of: searchString, options: [.caseInsensitive], range: searchStartIndex..<string.endIndex) {
occurrences.append(range)
searchStartIndex = range.upperBound
}
......
......@@ -81,8 +81,8 @@ class YHSearchInfoHistoryView: UIView {
func getwith(font: UIFont, height: CGFloat, string: String) -> CGSize {
let size = CGSize.init(width: CGFloat(MAXFLOAT), height: height)
let dic = [NSAttributedString.Key.font: font] // swift 4.2
let strSize = string.boundingRect(with: size, options: [.usesLineFragmentOrigin], attributes: dic, context:nil).size
return strSize
var strSize = string.boundingRect(with: size, options: [.usesLineFragmentOrigin], attributes: dic, context:nil).size
return CGSizeMake(ceil(strSize.width), strSize.height)
}
}
......@@ -99,8 +99,8 @@ extension YHSearchInfoHistoryView: UICollectionViewDelegate, UICollectionViewDat
let size = self.getwith(font: UIFont.systemFont(ofSize: 12), height: 24, string: historyItems[indexPath.item])
var width = size.width + gap*2.0
if width > collectionView.width {
width = collectionView.width
if width > 226.0 {
width = 226.0
}
return CGSize(width: width, height: cellHeight)
}
......
//
// YHServiceOrderAlertView.swift
// galaxy
//
// Created by EDY on 2024/4/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHServiceOrderAlertView: UIView {
var centerView: UIView!
var titleLabel: UILabel!
var closeButton: UIButton!
var lineView: UIView!
var knowButton: UIButton!
var measageLabel: UILabel!
var subMeasageLabel: UILabel!
static func show() {
let view = YHServiceOrderAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x0000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius8
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(401)
}
titleLabel = {
let label = UILabel()
label.text = "原因说明"
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.height.equalTo(21)
make.right.equalTo(-21)
}
closeButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "service_card_close"), for: .normal)
button.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return button
}()
centerView.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.right.equalTo(-21)
make.width.height.equalTo(24)
make.top.equalTo(16)
}
lineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.right.equalTo(-21)
make.left.equalTo(21)
make.top.equalTo(52)
make.height.equalTo(1)
}
knowButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("我知道了", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.clipsToBounds = true
button.addTarget(self, action: #selector(goNext), for: .touchUpInside)
return button
}()
centerView.addSubview(knowButton)
knowButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.left.equalTo(16)
make.height.equalTo(48)
make.bottom.equalTo(-29)
}
measageLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.numberOfLines = 0
return label
}()
centerView.addSubview(measageLabel)
measageLabel.snp.makeConstraints { make in
make.right.equalTo(-21)
make.left.equalTo(21)
make.top.equalTo(73)
}
subMeasageLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.numberOfLines = 0
return label
}()
centerView.addSubview(subMeasageLabel)
subMeasageLabel.snp.makeConstraints { make in
make.right.equalTo(-21)
make.left.equalTo(21)
make.top.equalTo(157)
}
let a: ASAttributedString = .init("1.当前仅支持查看", .font(UIFont.PFSC_M(ofSize: 15)),.foreground(UIColor(hex: 0x121a26).withAlphaComponent(0.7)))
let aa: ASAttributedString = .init(NSAttributedString(string: "优才订单"), .font(UIFont.PFSC_M(ofSize: 15)),.foreground(UIColor.brandMainColor))
let aaa: ASAttributedString = .init(",如果是签约了其他高才、专扌、留学等订单,请与您的服务管家或销售顾问企微沟通联系哦", .font(UIFont.PFSC_M(ofSize: 15)),.foreground(UIColor(hex: 0x121a26).withAlphaComponent(0.7)))
let b: ASAttributedString = .init(NSAttributedString(string: "2.使用其他手机号签约合同/订单,请退出登录"), .font(UIFont.PFSC_M(ofSize: 15)),.foreground(UIColor(hex: 0x121a26).withAlphaComponent(0.7)))
let bb: ASAttributedString = .init("切换账号", .font(UIFont.PFSC_M(ofSize: 15)),.foreground(UIColor.brandMainColor))
let bbb: ASAttributedString = .init("查看", .font(UIFont.PFSC_M(ofSize: 15)),.foreground(UIColor(hex: 0x121a26).withAlphaComponent(0.7)))
measageLabel.attributed.text = a + aa + aaa
subMeasageLabel.attributed.text = b + bb + bbb
knowButton.backgroundColor = .brandMainColor
knowButton.addYinHeGradualLayer()
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
dismiss()
}
@objc func dismiss() {
removeFromSuperview()
}
@objc func goNext() {
dismiss()
}
}
extension YHServiceOrderAlertView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
......@@ -17,9 +17,11 @@ class YHHomePageViewModel : YHBaseViewModel {
var hkList: [YHHKEventModel]?
//首页相关参数
private var curPageIndex : Int = 1
private var page_Size : Int = 6
private var totalCount : Int = 0
private var page_Size : Int = 20
var totalCount : Int = 0
var hasMoreForHomeNews : Bool = true
// 搜索
let searchPageSize: Int = 20
}
//接口
......@@ -47,12 +49,11 @@ extension YHHomePageViewModel {
/*
firstPageFlag true - 首页 false - 更多
*/
func getHomeNewsList(firstPageFlag : Bool,callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
var params: [String : Any] = ["page": curPageIndex,
"page_size": page_Size]
if firstPageFlag {
params = ["page": curPageIndex,
params = ["page": 1,
"page_size": page_Size]
} else {
params = ["page": curPageIndex + 1,
......@@ -85,7 +86,7 @@ extension YHHomePageViewModel {
}
if let count = self.arrHomeNewsData?.count {
if count == self.totalCount {
if count >= self.totalCount {
self.hasMoreForHomeNews = false
} else {
self.hasMoreForHomeNews = true
......@@ -114,23 +115,41 @@ extension YHHomePageViewModel {
if json.code == 200 {
let dic = json.data
guard let result = [YHBannerModel].deserialize(from: dic as? [Any]) else {
let model = YHBannerModel.localDefaultItem()
self.banners?.removeAll()
self.banners = [model]
callBackBlock(false,nil)
return
}
var arrData = result as? [YHBannerModel]
if let arr = arrData,arr.count > 6 {
arrData = Array(arrData?[0...5] ?? [])
if let arr = arrData {
if arr.isEmpty {
let model = YHBannerModel.localDefaultItem()
arrData = [model]
} else if arr.count > 10 {
arrData = Array(arrData?[0...9] ?? [])
}
}
self.banners = arrData
callBackBlock(true, nil)
} else {
let model = YHBannerModel.localDefaultItem()
self.banners?.removeAll()
self.banners = [model]
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
let model = YHBannerModel.localDefaultItem()
self.banners?.removeAll()
self.banners = [model]
callBackBlock(false,err)
}
}
......@@ -159,18 +178,16 @@ extension YHHomePageViewModel {
func getList(_ firstPageFlag : Bool, _ classifyID: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
var params: [String : Any] = ["page": curPageIndex,
"page_size": page_Size,
"page_size": searchPageSize,
"classify_id[0]": classifyID]
if firstPageFlag {
curPageIndex = 1
params = ["page": curPageIndex,
"page_size": page_Size,
params = ["page": 1,
"page_size": searchPageSize,
"classify_id[0]": classifyID]
} else {
params = ["page": curPageIndex + 1,
"page_size": page_Size,
"page_size": searchPageSize,
"classify_id[0]": classifyID]
curPageIndex = curPageIndex + 1
}
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.article
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
......@@ -188,9 +205,11 @@ extension YHHomePageViewModel {
}
if firstPageFlag {
self.curPageIndex = 1
self.totalCount = result.total
self.arrHomeNewsData = result.data
} else {
self.curPageIndex = self.curPageIndex + 1
self.arrHomeNewsData?.append(contentsOf: result.data)
}
......@@ -237,34 +256,60 @@ extension YHHomePageViewModel {
}
// 搜索
func searchArticleList(_ title: String, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let params: [String : Any] = ["page": 1,
"page_size": 10,
"title": title]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.article
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
guard let self = self else { return }
//1. json字符串 转 对象
if json.code == 200 {
let dic = json.data
guard let result = YHHomeListTotalModel.deserialize(from: dic as? Dictionary) else {
self.arrHomeNewsData = []
callBackBlock(false,nil)
return
}
for item in result.data {
item.calHeightParam()
}
func searchArticleList(_ title: String, isFirstPage:Bool, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
var params: [String : Any] = [:]
if isFirstPage {
params = ["page": 1,
"page_size": searchPageSize,
"title": title]
} else {
params = ["page": curPageIndex + 1,
"page_size": searchPageSize,
"title": title]
}
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.article
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
guard let self = self else { return }
//1. json字符串 转 对象
if json.code == 200 {
let dic = json.data
guard let result = YHHomeListTotalModel.deserialize(from: dic as? Dictionary) else {
self.arrHomeNewsData = []
callBackBlock(false,nil)
return
}
for item in result.data {
item.calHeightParam()
}
if isFirstPage {
self.totalCount = result.total
self.arrHomeNewsData = result.data
callBackBlock(true, nil)
curPageIndex = 1
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
curPageIndex = curPageIndex + 1
self.arrHomeNewsData?.append(contentsOf: result.data)
}
} failBlock: { err in
callBackBlock(false,err)
if let count = self.arrHomeNewsData?.count {
if count == self.totalCount {
self.hasMoreForHomeNews = false
} else {
self.hasMoreForHomeNews = true
}
}
callBackBlock(true, nil)
} else {
self.arrHomeNewsData = []
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
self.arrHomeNewsData = []
callBackBlock(false,err)
}
}
}
......@@ -109,9 +109,11 @@ extension YHInformationPerfectListVC {
serviceCenterMainReqVM.submitSweetNotifyOp(params: params as [String : Any]) { success, error in
if success == true {
YHInformationFillTipsAlertView.hideCheckView()
} else {
YHHUD.flash(message: error?.errorMsg ?? "发生错误,请重试")
}
self.loadData()
}
}
......@@ -130,7 +132,7 @@ extension YHInformationPerfectListVC {
guard let orderId = orderId else { return}
self.serviceCenterMainReqVM.getPersonInfoFillStep(params: ["orderId":orderId]) { success, error in
if success == true {
if self.serviceCenterMainReqVM.myInfoFillStep > 6 {
self.hasSubmitFlag = true
} else {
......@@ -146,6 +148,12 @@ extension YHInformationPerfectListVC {
}
}
self.homeTableView.reloadData()
// if self.serviceCenterMainReqVM.informationFillStepModel?.sweet_notify_status == 0 {
// self.showTipsAlert()
// return
// }
}
}
......@@ -459,7 +467,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
let vc = YHOtherInfoFillViewController()
vc.orderId = orderId
navigationController?.pushViewController(vc)
}
}
else {
}
......
//
// YHOrderDetailViewController.swift
// galaxy
//
// Created by EDY on 2024/4/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHOrderDetailViewController: YHBaseViewController {
var centerView: UIView!
var titleLabel: UILabel!
var lineView: UIView!
var orderLabel: UILabel!
var orderNumLabel: UILabel!
var phoneLabel: UILabel!
var phoneNumLabel: UILabel!
var copyButton: UIButton!
var model: YHContactItemModel = YHContactItemModel()
override func viewDidLoad() {
super.viewDidLoad()
setView()
// Do any additional setup after loading the view.
}
func setView() {
gk_navTitle = "我的订单"
gk_navBackgroundColor = UIColor.white
gk_navBarAlpha = 1
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius8
view.masksToBounds = true
return view
}()
view.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 16)
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(149)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = model.productName
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.top.equalTo(18)
make.left.equalTo(16)
make.height.equalTo(24)
}
lineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.top.equalTo(54.5)
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(1)
}
orderLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor(hex: 0x121A26).withAlphaComponent(0.5)
label.text = "合同编号: "
return label
}()
centerView.addSubview(orderLabel)
orderLabel.snp.makeConstraints { make in
make.top.equalTo(72.5)
make.left.equalTo(16)
make.height.equalTo(20)
}
phoneLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor(hex: 0x121A26).withAlphaComponent(0.5)
label.text = "签约手机号:"
return label
}()
centerView.addSubview(phoneLabel)
phoneLabel.snp.makeConstraints { make in
make.top.equalTo(110.5)
make.left.equalTo(16)
make.height.equalTo(20)
}
orderNumLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor(hex: 0x121A26)
label.text = model.orderSn
label.textAlignment = .right
return label
}()
centerView.addSubview(orderNumLabel)
orderNumLabel.snp.makeConstraints { make in
make.top.equalTo(72.5)
make.right.equalTo(-58)
make.height.equalTo(20)
}
phoneNumLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor(hex: 0x121A26)
label.text = model.mobile
label.textAlignment = .right
return label
}()
centerView.addSubview(phoneNumLabel)
phoneNumLabel.snp.makeConstraints { make in
make.top.equalTo(110.5)
make.right.equalTo(-16)
make.height.equalTo(20)
}
copyButton = {
let button = UIButton(type: .custom)
button.setTitle("复制", for: .normal)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 13)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.addTarget(self, action: #selector(copyButtonClick), for: .touchUpInside)
return button
}()
centerView.addSubview(copyButton)
copyButton.snp.makeConstraints { make in
make.top.equalTo(72.5)
make.right.equalTo(-16)
make.height.equalTo(18)
make.width.equalTo(26)
}
let subLineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(subLineView)
subLineView.snp.makeConstraints { make in
make.centerY.equalTo(copyButton.snp.centerY)
make.right.equalTo(-50)
make.width.equalTo(1)
make.height.equalTo(6)
}
}
@objc func copyButtonClick() {
let textToCopy = orderNumLabel.text
UIPasteboard.general.string = textToCopy
YHHUD.flash(message: "复制成功")
}
}
......@@ -15,9 +15,10 @@ class YHServerHKLifeViewController: YHBaseViewController {
var tableFootView: YHServiceTableFootView!
var sectionView: YHServiceSectionView!
var classId: Int = 0
var cell: YHServerHKLifeViewCell!
var dataSouce: [YHHomeListModel?] = [] {
didSet {
self.homeTableView.reloadData()
cell.tableFootView.items = dataSouce
}
}
var homeTableView: UITableView = {
......@@ -31,6 +32,7 @@ class YHServerHKLifeViewController: YHBaseViewController {
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 81.0
tableView.bounces = false
tableView.register(YHServerHKLifeViewCell.self,forCellReuseIdentifier: YHServerHKLifeViewCell.cellReuseIdentifier)
return tableView
}()
......@@ -48,10 +50,11 @@ class YHServerHKLifeViewController: YHBaseViewController {
extension YHServerHKLifeViewController {
func loadData() {
self.tableHeadView.bannarView.dataArr = [YHBannerModel.localDefaultItem()]
homeViewModel.getHomeBanner(2){[weak self] success, error in
guard let self = self else { return }
self.tableHeadView.bannarView.dataArr = self.homeViewModel.banners ?? []
self.tableHeadView.bannarView.dataArr = self.homeViewModel.banners ?? [YHBannerModel.localDefaultItem()]
}
homeViewModel.getHomeClassify{[weak self] success, error in
......@@ -60,13 +63,15 @@ extension YHServerHKLifeViewController {
let model = item as YHHomeClassifyModel
if model.id == 2 {
self.sectionView.items = model.children
let classifyID = model.children.first?.id ?? 0
self.classId = classifyID
self.homeViewModel.getList(true, classifyID) {[weak self] success, error in
guard let self = self else { return }
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
if self.homeViewModel.hasMoreForHomeNews == false {
self.homeTableView.es.noticeNoMoreData()
if self.classId == 0 {
let classifyID = model.children.first?.id ?? 0
self.classId = classifyID
self.homeViewModel.getList(true, classifyID) {[weak self] success, error in
guard let self = self else { return }
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
if self.homeViewModel.hasMoreForHomeNews == false {
self.homeTableView.es.noticeNoMoreData()
}
}
}
}
......@@ -77,11 +82,14 @@ extension YHServerHKLifeViewController {
func setupUI() {
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
view.backgroundColor = .white
sectionView = {
let view = YHServiceSectionView()
view.block = {[weak self] model in
guard let self = self else { return }
self.cell.tableFootView.myCollectView.es.resetNoMoreData()
self.cell.tableFootView.myCollectView.setContentOffset(CGPoint.zero, animated: false)
self.classId = model.id
self.homeViewModel.getList(true, model.id) {[weak self] success, error in
guard let self = self else { return }
......@@ -101,21 +109,10 @@ extension YHServerHKLifeViewController {
homeTableView.tableFooterView = tableFootView
homeTableView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
make.bottom.equalToSuperview()
}
homeTableView.delegate = self
homeTableView.dataSource = self
homeTableView.es.addInfiniteScrolling {[weak self] in
guard let self = self else { return }
self.homeTableView.es.stopLoadingMore()
self.homeViewModel.getList(false, self.classId) {[weak self] success, error in
guard let self = self else { return }
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
if self.homeViewModel.hasMoreForHomeNews == false {
self.homeTableView.es.noticeNoMoreData()
}
}
}
}
}
......@@ -131,6 +128,9 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if sectionView.items.count == 1 {
return 0
}
return 48
}
......@@ -148,15 +148,31 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return KScreenHeight
// return KScreenHeight - k_Height_NavigationtBarAndStatuBar - 48 - k_Height_safeAreaInsetsBottom() - 50
return self.view.frame.height - 48
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = tableView.dequeueReusableCell(withClass: YHServerHKLifeViewCell.self)
cell0.tableFootView.items = dataSouce
cell0.tableFootView.myCollectView.es.removeRefreshFooter()
cell0.selectionStyle = .none
return cell0
cell = tableView.dequeueReusableCell(withClass: YHServerHKLifeViewCell.self)
cell.moreBlock = {[weak self] in
guard let self = self else { return }
self.homeViewModel.getList(false, self.classId) {[weak self] success, error in
guard let self = self else { return }
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.35, execute: {
CATransaction.setDisableActions(true)
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
CATransaction.commit()
self.cell.tableFootView.myCollectView.es.stopLoadingMore()
if self.homeViewModel.hasMoreForHomeNews == false {
self.cell.tableFootView.myCollectView.es.noticeNoMoreData()
}
})
}
}
cell.tableFootView.items = dataSouce
// cell.tableFootView.myCollectView.es.removeRefreshFooter()
cell.selectionStyle = .none
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
......@@ -171,6 +187,9 @@ extension YHServerHKLifeViewController: JXSegmentedListContainerViewListDelegate
}
class YHServerHKLifeViewCell: UITableViewCell {
typealias LoadBlock = () -> ()
var moreBlock: LoadBlock?
static let cellReuseIdentifier = "YHServerHKLifeViewCell"
var tableFootView: YHServiceTableFootView!
......@@ -210,8 +229,17 @@ extension YHServerHKLifeViewCell {
backgroundColor = .clear
contentView.backgroundColor = .clear
tableFootView = YHServiceTableFootView()
tableFootView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)
tableFootView.moreBlock = {[weak self] in
guard let self = self else { return }
if let block = self.moreBlock {
block()
}
}
// tableFootView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)
contentView.addSubview(tableFootView)
tableFootView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
}
}
......@@ -7,76 +7,95 @@
import UIKit
import JXSegmentedView
import AttributedString
//服务中心
class YHServiceCenterMainViewController: YHBaseViewController {
private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
var titleLabel: UILabel!
var nameBgImageView: UIImageView!
var nameLabel: UILabel!
var orderButton: UIButton!
var orderId: Int = 0
var mobile: String = ""
var model: YHContactItemModel = YHContactItemModel()
private lazy var topBkg : UIView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "service_center_head_bkg")
imagV.image = UIImage(named: "service_center_head_bkg4")
imagV.contentMode = .scaleAspectFill
imagV.isUserInteractionEnabled = true
return imagV
}()
private let loginTipsView : YHLoginTipsView = {
let view = YHLoginTipsView()
view.viewType = 0
private let noDataView : YHServiceNoOrderView = {
let view = YHServiceNoOrderView()
view.isHidden = true
return view
}()
private let noDataView : YHLoginTipsView = {
let view = YHLoginTipsView()
view.viewType = 1
view.isHidden = true
return view
var controllerOne: YHServiceOrderListView = YHServiceOrderListView()
var controllerTwo: YHServiceOrderListView = YHServiceOrderListView()
var controllerThree: YHServiceOrderListView = YHServiceOrderListView()
var controllerFour: YHServiceOrderListView = YHServiceOrderListView()
var arrItemTitles = ["全部", "待开始", "进行中", "已完成"]
var arrItemVCs: [YHServiceOrderListView] = []
var segmentedView : JXSegmentedView = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_safeAreaInsetsTop(), width: KScreenWidth, height: 48))
lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PFSC_M(ofSize: 14)
dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 14)
dataSource.titleSelectedColor = .mainTextColor
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
dataSource.itemSpacing = 16
return dataSource
}()
private func loginOp() {
let vc = UINavigationController(rootVC: YHPhoneLoginViewController())
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
}
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 81.0
tableView.register(YHContractCell.self,forCellReuseIdentifier: YHContractCell.cellReuseIdentifier)
return tableView
//分类title 所对应的VC
lazy var listContainerView: JXSegmentedListContainerView! = {
return JXSegmentedListContainerView(dataSource: self, type: .scrollView)
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
handleRightUI()
addListView()
noDataView.clickMoreBtnClickkBlock = {[weak self] in
guard let self = self else { return }
let vc = YHServiceViewController()
vc.defaltIndex = 0
self.navigationController?.pushViewController(vc)
}
noDataView.clickBackBtnClickBlock = {[weak self] in
guard self != nil else { return }
goTabBarBy(tabType: .home)
}
noDataView.clickShowBtnClickBlock = {
YHServiceOrderAlertView.show()
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
handleRightUI()
loadData()
}
}
extension YHServiceCenterMainViewController {
func loadData() {
if YHLoginManager.shared.isLogin() == false {
return
}
serviceCenterMainReqVM.getContactList { success, error in
serviceCenterMainReqVM.getContactList {[weak self] success, error in
guard let self = self else { return }
if success == true {
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
......@@ -85,147 +104,270 @@ extension YHServiceCenterMainViewController {
}
func setupUI() {
gk_navTitle = "服务中心"
gk_navBarAlpha = 1.0
loginTipsView.clickLoginBtnCallBackBlock = {
self.loginOp()
}
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
view.backgroundColor = .white
view.addSubview(topBkg)
topBkg.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(216)
make.height.equalTo(202)
}
view.addSubview(loginTipsView)
loginTipsView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
make.width.equalTo(KScreenWidth)
titleLabel = {
let label = UILabel()
label.text = "我的服务"
label.font = UIFont.PFSC_M(ofSize: 21)
label.textColor = UIColor.mainTextColor
return label
}()
view.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.top.equalTo(53)
make.left.equalTo(20)
make.height.equalTo(29)
}
view.addSubview(noDataView)
noDataView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
make.width.equalTo(KScreenWidth)
}
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
orderButton = {
let button = UIButton(type: .custom)
button.setTitle("我的订单", for: .normal)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.setTitleColor(UIColor(hex: 0x94a3b8), for: .normal)
button.addTarget(self, action: #selector(pushOrderView), for: .touchUpInside)
return button
}()
view.addSubview(orderButton)
orderButton.snp.makeConstraints { make in
make.right.equalTo(-20)
make.centerY.equalTo(titleLabel.snp.centerY)
make.height.equalTo(20)
make.width.equalTo(56)
}
homeTableView.delegate = self
homeTableView.dataSource = self
self.homeTableView.isHidden = true
self.noDataView.isHidden = false
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHServiceCenterMainViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return self.serviceCenterMainReqVM.arrContactList.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return kMargin
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: kMargin))
return view
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
segmentedView.frame = CGRect(x: 4, y: k_Height_safeAreaInsetsTop() + 98, width: view.bounds.size.width - 8, height: 48)
listContainerView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop() + 48 + 98, width: view.bounds.size.width, height: view.bounds.size.height - 48 - k_Height_safeAreaInsetsTop() - 98 - k_Height_TabBar)
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
@objc func pushOrderView() {
let vc = YHOrderDetailViewController()
vc.model = model
self.navigationController?.pushViewController(vc)
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
extension YHServiceCenterMainViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 81
/// 正在滚动中的回调
///
/// - Parameters:
/// - segmentedView: JXSegmentedView
/// - leftIndex: 正在滚动中,相对位置处于左边的index
/// - rightIndex: 正在滚动中,相对位置处于右边的index
/// - percent: 从左往右计算的百分比
func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewWillBeginDragging"), object: nil)
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = tableView.dequeueReusableCell(withClass: YHContractCell.self)
cell0.selectionStyle = .none
if indexPath.section < self.serviceCenterMainReqVM.arrContactList.count {
cell0.dataModel = self.serviceCenterMainReqVM.arrContactList[indexPath.section]
}
extension YHServiceCenterMainViewController: JXSegmentedListContainerViewDataSource {
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
return titleDataSource.dataSource.count
}
return cell0
return 0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.section)")
//获取订单号
let orderId = serviceCenterMainReqVM.arrContactList[indexPath.section].id
UserDefaults.standard.set(orderId, forKey: "orderIdForPreview")
UserDefaults.standard.synchronize()
let vc = YHServiceCenterSecondViewController()
vc.orderId = orderId
vc.mobile = serviceCenterMainReqVM.arrContactList[indexPath.section].mobile
self.navigationController?.pushViewController(vc)
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
return arrItemVCs[index]
}
}
extension YHServiceCenterMainViewController {
@objc func loginSuccess() {
printLog("登录成功,进行相应的 UI刷新操作")
loadData()
}
@objc func logoutSuccess() {
handleRightUI()
}
private func handleRightUI() {
if YHLoginManager.shared.isLogin() == false {
loginTipsView.isHidden = false
noDataView.isHidden = true
homeTableView.isHidden = true
if serviceCenterMainReqVM.arrContactList.isEmpty {
noDataView.isHidden = false
nameBgImageView.isHidden = true
segmentedView.isHidden = true
listContainerView.isHidden = true
orderButton.isHidden = true
} else {
loginTipsView.isHidden = true
if serviceCenterMainReqVM.arrContactList.isEmpty {
homeTableView.isHidden = true
noDataView.isHidden = false
} else {
homeTableView.isHidden = false
noDataView.isHidden = true
guard let model = serviceCenterMainReqVM.arrContactList.first else {
return
}
noDataView.isHidden = true
nameBgImageView.isHidden = false
segmentedView.isHidden = false
listContainerView.isHidden = false
orderButton.isHidden = false
orderId = model.id
mobile = model.mobile
self.model = model
UserDefaults.standard.set(orderId, forKey: "orderIdForPreview")
UserDefaults.standard.synchronize()
for i in 0..<arrItemTitles.count {
let vc = arrItemVCs[i] as YHServiceOrderListView
vc.type = i
if i == 1 {
vc.type = 2
}
if i == 2 {
vc.type = 1
}
vc.orderID = orderId
vc.mobile = mobile
vc.loadData()
vc.block = {[weak self] type, count in
guard let self = self else {
return
}
if type == 0 {
arrItemTitles[0] = "全部(\(count))"
} else if type == 2 {
arrItemTitles[1] = "进行中(\(count))"
} else if type == 1 {
arrItemTitles[2] = "待开始(\(count))"
} else if type == 3 {
arrItemTitles[3] = "已完成(\(count))"
}
self.updata()
}
}
segmentedView.dataSource = segmentedDataSource
segmentedView.reloadData()
serviceCenterMainReqVM.getPersonInfoFillStep(params: ["orderId":orderId]) {[weak self] success, error in
guard let self = self else { return }
var name = ""
if let applicant = self.serviceCenterMainReqVM.informationFillStepModel {
if applicant.applicantName.isEmpty {
name = "尊敬的客户"
} else {
name = applicant.applicantName
if applicant.sex == 1 {
name = name + "先生"
} else if applicant.sex == 2 {
name = name + "女士"
} else {
}
}
}
let a: ASAttributedString = .init("您好,\(name),您当前处于", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor(hex: 0x121a26)))
let aa: ASAttributedString = .init(NSAttributedString(string: "身份申请"), .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor.brandMainColor))
let aaa: ASAttributedString = .init("阶段", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor(hex: 0x121a26)))
self.nameLabel.attributed.text = a + aa + aaa
}
}
homeTableView.reloadData()
}
}
func addListView() {
nameBgImageView = {
let view = UIImageView()
view.image = UIImage(named: "service_name_bg")
return view
}()
view.addSubview(nameBgImageView)
nameBgImageView.snp.makeConstraints { make in
make.top.equalTo(92)
make.left.equalTo(20)
make.right.equalTo(-20)
make.height.equalTo(50)
}
nameLabel = {
let label = UILabel()
label.text = "您好,张先生,您当前处于身份申请阶段"
label.font = UIFont.PFSC_M(ofSize: 12)
label.textColor = UIColor.brandMainColor
return label
}()
nameBgImageView.addSubview(nameLabel)
nameLabel.snp.makeConstraints { make in
make.top.equalTo(21)
make.left.equalTo(14)
make.right.equalTo(-14)
make.height.equalTo(17)
}
view.addSubview(noDataView)
noDataView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
make.width.equalTo(KScreenWidth)
make.height.equalTo(225)
}
controllerOne.type = 0
controllerOne.orderID = orderId
controllerOne.block = {[weak self] type, count in
guard let self = self else { return }
arrItemTitles[0] = "全部(\(count))"
self.updata()
}
controllerTwo.type = 2
controllerTwo.orderID = orderId
controllerTwo.block = {[weak self] type, count in
guard let self = self else { return }
arrItemTitles[1] = "进行中(\(count))"
self.updata()
}
controllerThree.type = 1
controllerThree.orderID = orderId
controllerThree.block = {[weak self] type, count in
guard let self = self else { return }
arrItemTitles[2] = "待开始(\(count))"
self.updata()
}
controllerFour.type = 3
controllerFour.orderID = orderId
controllerFour.block = {[weak self] type, count in
guard let self = self else { return }
arrItemTitles[3] = "已完成(\(count))"
self.updata()
}
arrItemVCs.append(controllerOne)
arrItemVCs.append(controllerTwo)
arrItemVCs.append(controllerThree)
arrItemVCs.append(controllerFour)
//segmentedViewDataSource一定要通过属性强持有!!!!!!!!!
segmentedView.dataSource = segmentedDataSource
segmentedView.delegate = self
segmentedView.collectionView.backgroundColor = .white
view.addSubview(segmentedView)
extension YHServiceCenterMainViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
segmentedView.listContainer = listContainerView
view.addSubview(listContainerView)
//分类Title
segmentedView.dataSource = segmentedDataSource
segmentedView.delegate = self
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorColor = .blue
segmentedView.indicators = [indicator]
segmentedView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1)
segmentedView.defaultSelectedIndex = 1
}
func updata(){
DispatchQueue.main.async {
self.segmentedDataSource.titles = self.arrItemTitles
self.segmentedView.reloadData()
}
}
}
......@@ -10,7 +10,7 @@ import UIKit
//服务中心
class YHServiceCenterSecondViewController: YHBaseViewController {
var orderId : Int?
var orderId : Int = 0
var mobile: String?
private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
private var unfoldFlag : Bool = true //是否展开
......@@ -54,13 +54,11 @@ class YHServiceCenterSecondViewController: YHBaseViewController {
extension YHServiceCenterSecondViewController {
func loadData2() {
guard let orderId = orderId else { return}
self.serviceCenterMainReqVM.getPersonInfoFillStep(params: ["orderId":orderId]) { success, error in
}
}
func loadData() {
guard let orderId = orderId else { return}
self.serviceCenterMainReqVM.getContactStatus(params: ["orderId":orderId]) { success, error in
self.homeTableView.reloadData()
}
......@@ -198,12 +196,12 @@ extension YHServiceCenterSecondViewController : UITableViewDelegate,UITableViewD
navigationController?.pushViewController(vc)
} else if model.type == 4 {
let vc = YHMyDocumentsListViewController()
vc.orderId = orderId ?? 0
vc.orderId = orderId
vc.mobile = mobile ?? ""
navigationController?.pushViewController(vc)
} else if model.type == 5 {
let vc = YHMySignatureListViewController()
vc.orderId = orderId ?? 0
vc.orderId = orderId
navigationController?.pushViewController(vc)
} else if model.type == 6 {
let vc = YHMineSchemeViewController()
......
......@@ -10,32 +10,52 @@ import UIKit
import JXSegmentedView
class YHServiceListViewController: YHBaseViewController {
private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
let homeViewModel: YHHomePageViewModel = YHHomePageViewModel()
var orderListView: YHOrderListView!
var normalView: YHServerNoOrderView!
var tableHeadView: YHServerTableHeadView!
var tableFootView: YHServiceTableFootView!
var sectionView: YHServiceSectionView!
var classId: Int = 0
var cell: YHServerHKLifeViewCell!
var dataSouce: [YHHomeListModel?] = [] {
didSet {
cell.tableFootView.items = dataSouce
}
}
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .plain)
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0
}
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 81.0
tableView.bounces = false
tableView.register(YHServerHKLifeViewCell.self,forCellReuseIdentifier: YHServerHKLifeViewCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
handleRightUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
handleRightUI()
loadData()
}
}
extension YHServiceListViewController {
func loadData() {
self.tableHeadView.bannarView.dataArr = [YHBannerModel.localDefaultItem()]
homeViewModel.getHomeBanner(1){[weak self] success, error in
guard let self = self else { return }
self.normalView.tableHeadView.bannarView.dataArr = self.homeViewModel.banners ?? []
self.tableHeadView.bannarView.dataArr = self.homeViewModel.banners ?? [YHBannerModel.localDefaultItem()]
}
homeViewModel.getHomeClassify{[weak self] success, error in
......@@ -43,99 +63,119 @@ extension YHServiceListViewController {
for item in classify {
let model = item as YHHomeClassifyModel
if model.id == 1 {
self.normalView.sectionView.items = model.children
let classifyID = model.children.first?.id ?? 0
self.classId = classifyID
self.homeViewModel.getList(true, classifyID) {[weak self] success, error in
guard let self = self else { return }
self.normalView.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
if self.homeViewModel.hasMoreForHomeNews == false {
self.normalView.homeTableView.es.noticeNoMoreData()
self.sectionView.items = model.children
if self.classId == 0 {
let classifyID = model.children.first?.id ?? 0
self.classId = classifyID
self.homeViewModel.getList(true, classifyID) {[weak self] success, error in
guard let self = self else { return }
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
if self.homeViewModel.hasMoreForHomeNews == false {
self.homeTableView.es.noticeNoMoreData()
}
}
}
}
}
}
if YHLoginManager.shared.isLogin() == false {
self.handleRightUI()
return
}
serviceCenterMainReqVM.getContactList { success, error in
if success == true {
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
self.handleRightUI()
}
}
func setupUI() {
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
orderListView = {
let view = YHOrderListView()
return view
}()
view.addSubview(orderListView)
orderListView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
}
normalView = {
let view = YHServerNoOrderView()
view.sectionBlock = {[weak self] model in
view.backgroundColor = .white
sectionView = {
let view = YHServiceSectionView()
view.block = {[weak self] model in
guard let self = self else { return }
self.cell.tableFootView.myCollectView.es.resetNoMoreData()
self.cell.tableFootView.myCollectView.setContentOffset(CGPoint.zero, animated: false)
self.classId = model.id
self.homeViewModel.getList(true, model.id) {[weak self] success, error in
guard let self = self else { return }
self.normalView.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
if self.homeViewModel.hasMoreForHomeNews == false {
self.normalView.homeTableView.es.noticeNoMoreData()
}
}
}
view.loadMoreBlock = {[weak self] model in
guard let self = self else { return }
self.homeViewModel.getList(false, self.classId) {[weak self] success, error in
guard let self = self else { return }
self.normalView.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
if self.homeViewModel.hasMoreForHomeNews == false {
self.normalView.homeTableView.es.noticeNoMoreData()
self.homeTableView.es.noticeNoMoreData()
}
}
}
return view
}()
view.addSubview(normalView)
normalView.snp.makeConstraints { make in
tableHeadView = YHServerTableHeadView()
tableHeadView.titleLabel.text = "香港身份攻略"
tableHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 365)
view.addSubview(homeTableView)
homeTableView.tableHeaderView = tableHeadView
homeTableView.tableFooterView = tableFootView
homeTableView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
make.bottom.equalToSuperview()
}
homeTableView.delegate = self
homeTableView.dataSource = self
}
}
extension YHServiceListViewController {
private func handleRightUI() {
if YHLoginManager.shared.isLogin() == false {
normalView.isHidden = false
orderListView.isHidden = true
} else {
if serviceCenterMainReqVM.arrContactList.isEmpty {
normalView.isHidden = false
orderListView.isHidden = true
} else {
normalView.isHidden = true
orderListView.isHidden = false
orderListView.dataSource = serviceCenterMainReqVM.arrContactList
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHServiceListViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if sectionView.items.count == 1 {
return 0
}
return 48
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return sectionView
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return self.view.frame.height - 48
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
cell = tableView.dequeueReusableCell(withClass: YHServerHKLifeViewCell.self)
cell.moreBlock = {[weak self] in
guard let self = self else { return }
self.homeViewModel.getList(false, self.classId) {[weak self] success, error in
guard let self = self else { return }
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.35, execute: {
CATransaction.setDisableActions(true)
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
CATransaction.commit()
self.cell.tableFootView.myCollectView.es.stopLoadingMore()
if self.homeViewModel.hasMoreForHomeNews == false {
self.cell.tableFootView.myCollectView.es.noticeNoMoreData()
}
})
}
}
cell.tableFootView.items = dataSouce
cell.selectionStyle = .none
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
......@@ -143,8 +183,4 @@ extension YHServiceListViewController: JXSegmentedListContainerViewListDelegate
func listView() -> UIView {
return view
}
func listWillAppear() {
loadData()
}
}
//
// YHServiceOrderListView.swift
// galaxy
//
// Created by EDY on 2024/4/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
class YHServiceOrderListView: YHBaseViewController {
private let viewModel : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
typealias Block = (Int,Int) -> ()
var block: Block?
var orderID: Int = 0
var type: Int = 0
var mobile: String = ""
var homeTableView: UITableView!
private let noDataView : YHNoDataTipsView = {
let view = YHNoDataTipsView()
view.isHidden = true
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadData()
}
}
extension YHServiceOrderListView {
func loadData() {
if YHLoginManager.shared.isLogin() {
viewModel.getServiceCenterProgressList(orderID, type) {[weak self] success, error in
guard let self = self else { return }
if (self.homeTableView != nil) {
if self.viewModel.arrDataForSeviceCenterProgress.count == 0 {
self.homeTableView.isHidden = true
self.noDataView.isHidden = false
} else {
self.homeTableView.isHidden = false
self.noDataView.isHidden = true
self.homeTableView.reloadData()
}
}
if let block = self.block {
block(type, self.viewModel.arrDataForSeviceCenterProgress.count)
}
}
}
}
func setupUI() {
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
homeTableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 81.0
tableView.dataSource = self
tableView.delegate = self
tableView.register(cellWithClass: YHServiceOrderProgressTableViewCell.self)
return tableView
}()
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.top.right.left.bottom.equalToSuperview()
}
view.addSubview(noDataView)
noDataView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
make.width.equalTo(KScreenWidth)
make.height.equalTo(150)
}
}
}
extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return self.viewModel.arrDataForSeviceCenterProgress.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return kMargin
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: kMargin))
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 144
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = tableView.dequeueReusableCell(withClass: YHServiceOrderProgressTableViewCell.self)
cell0.selectionStyle = .none
if indexPath.section < self.viewModel.arrDataForSeviceCenterProgress.count {
cell0.dataModel = self.viewModel.arrDataForSeviceCenterProgress[indexPath.section]
}
return cell0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = self.viewModel.arrDataForSeviceCenterProgress[indexPath.section]
if model.status == 1 {
return
} else {
//1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书
if model.type == 1 {
let vc = YHMineCertificateEntryViewController()
vc.orderId = orderID
navigationController?.pushViewController(vc)
} else if model.type == 2 {
let vc = YHInformationPerfectListVC()
vc.orderId = orderID
navigationController?.pushViewController(vc)
} else if model.type == 3 {
let vc = YHScoreDetailViewController()
vc.orderId = orderID
// vc.model = serviceCenterMainReqVM.allInfoScoreModel
navigationController?.pushViewController(vc)
} else if model.type == 4 {
let vc = YHMineSchemeViewController()
navigationController?.pushViewController(vc)
} else if model.type == 5 {
let vc = YHMySignatureListViewController()
vc.orderId = orderID
navigationController?.pushViewController(vc)
} else if model.type == 6 {
let vc = YHMyDocumentsListViewController()
vc.orderId = orderID
vc.mobile = mobile
navigationController?.pushViewController(vc)
}
}
}
}
extension YHServiceOrderListView: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
}
......@@ -10,14 +10,8 @@ import UIKit
import JXSegmentedView
class YHServiceViewController: YHBaseViewController {
var canScroll : Bool = false {
didSet {
for vc in arrItemVCs {
}
}
}
var defaltIndex: Int = 0
let arrItemTitles = ["香港身份","香港生活"]
......@@ -40,12 +34,30 @@ class YHServiceViewController: YHBaseViewController {
return dataSource
}()
lazy var navBar: UIView = {
let bar = UIView()
let backBtn = UIButton()
backBtn.setImage(UIImage(named: "back_icon"), for: .normal)
backBtn.addTarget(self, action: #selector(didBackBtnClicked), for: .touchUpInside)
backBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
bar.addSubview(backBtn)
backBtn.snp.makeConstraints { make in
make.width.height.equalTo(21)
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(16)
}
return bar
}()
//分类title 所对应的VC
lazy var listContainerView: JXSegmentedListContainerView! = {
return JXSegmentedListContainerView(dataSource: self, type: .scrollView)
}()
@objc func didBackBtnClicked() {
self.navigationController?.popViewController(animated: true)
}
override func viewDidLoad() {
super.viewDidLoad()
gk_navBarAlpha = 0
......@@ -64,7 +76,6 @@ class YHServiceViewController: YHBaseViewController {
//segmentedViewDataSource一定要通过属性强持有!!!!!!!!!
segmentedView.dataSource = segmentedDataSource
segmentedView.delegate = self
segmentedView.collectionView.backgroundColor = .white
view.addSubview(segmentedView)
......@@ -79,9 +90,19 @@ class YHServiceViewController: YHBaseViewController {
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorColor = .blue
indicator.indicatorColor = UIColor(hex: 0x3570dc)
segmentedView.indicators = [indicator]
segmentedView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1)
view.addSubview(navBar)
navBar.snp.makeConstraints { make in
make.left.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_statusBar())
make.height.equalTo(k_Height_NavContentBar)
make.width.equalTo(47)
}
segmentedView.defaultSelectedIndex = defaltIndex
}
override func viewWillAppear(_ animated: Bool) {
......@@ -105,26 +126,16 @@ class YHServiceViewController: YHBaseViewController {
listContainerView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop() + 48, width: view.bounds.size.width, height: view.bounds.size.height - 48 - k_Height_safeAreaInsetsTop())
}
}
extension YHServiceViewController {
func jumpToItemIndex(itemIndex : Int) {
self.segmentedView.selectItemAt(index: itemIndex)
}
}
extension YHServiceViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0)
}
}
/// 正在滚动中的回调
///
/// - Parameters:
/// - segmentedView: JXSegmentedView
/// - leftIndex: 正在滚动中,相对位置处于左边的index
/// - rightIndex: 正在滚动中,相对位置处于右边的index
/// - percent: 从左往右计算的百分比
func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewWillBeginDragging"), object: nil)
extension YHServiceViewController {
func jumpToItemIndex(itemIndex : Int) {
self.segmentedView.selectItemAt(index: itemIndex)
}
}
......
//
// YHServiceCenterProgressModel.swift
// galaxy
//
// Created by davidhuangA on 2024/4/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHServiceCenterProgressModel : YHBaseModel {
var name : String = ""
var percentage : Int = 0
var status : Int = 0 // 0未知 1待开始 2进行中 3 已完成
var num : Int = 0
var type : Int = 0 // 1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书
}
......@@ -13,7 +13,7 @@ import UIKit
class YHMineCertificateEntryViewController: YHBaseViewController {
var orderId : Int?
var orderId : Int = 0
private let certificateReqVM : YHCertificateViewModel = YHCertificateViewModel()
lazy var navBar: YHCustomNavigationBar = {
......@@ -70,8 +70,8 @@ class YHMineCertificateEntryViewController: YHBaseViewController {
extension YHMineCertificateEntryViewController {
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
let param = ["order_id":orderID,"node":"1","state":"1"]
if orderId != 0 {
let param = ["order_id":orderId,"node":"1","state":"1"] as [String : Any]
certificateReqVM.getCertificateStatisticData(params: param) { success, error in
if success == true {
self.headerView.dataModel = self.certificateReqVM.certificateEntryModel
......@@ -81,8 +81,6 @@ extension YHMineCertificateEntryViewController {
self.homeTableView.reloadData()
}
} else {
printLog("error : orderID 为空")
}
}
......@@ -189,7 +187,7 @@ extension YHMineCertificateEntryViewController : UITableViewDelegate,UITableView
printLog("点击了 tableView Cell \(indexPath.section)")
guard let model = certificateReqVM.certificateEntryModel else { return }
let vc = YHCertificateListContainerVC()
vc.orderId = orderId
if indexPath.section < model.category_data.count {
......
......@@ -56,6 +56,7 @@ class YHCustomNavigationBar: UIView {
private lazy var rightButton: UIButton = {
let btn = UIButton()
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
btn.addTarget(self, action: #selector(didRightButtonClicked), for: .touchUpInside)
return btn
}()
......
......@@ -183,7 +183,7 @@ class YHSchemeTableViewCell: UITableViewCell {
if title.contains("资料清单") {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
let vc = YHMineCertificateEntryViewController()
vc.orderId = orderID as? Int
vc.orderId = orderID as? Int ?? 0
UIViewController.current?.navigationController?.pushViewController(vc)
} else {
YHHUD.flash(message: "订单号为空")
......
......@@ -218,9 +218,9 @@ extension YHScorePersonInfoCell {
self.requestVM.getPublicImageUrl(url) {[weak self] success, error in
guard let self = self else { return }
guard success != nil else { return }
self.headImagV.kf.setImage(with: URL(string: success))
self.headImagV.kf.setImage(with: URL(string: success), placeholder: UIImage(named: "global_default_image"))
}
}
}
}
......@@ -11,6 +11,7 @@ import UIKit
class YHCommonAlertView: UIView {
typealias AgreeBlock = () -> ()
var agreeBlock: AgreeBlock?
var cancelBlcok: AgreeBlock?
var centerView: UIView!
var titleLabel: UILabel!
var lineView: UIView!
......@@ -18,9 +19,10 @@ class YHCommonAlertView: UIView {
var agreeButton: UIButton!
var disAgressButton: UIButton!
static func show(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil, callBack: @escaping (() -> Void)) {
static func show(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil,cancelCallBack: (() -> Void)? = nil, callBack: @escaping (() -> Void)) {
let view = YHCommonAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.agreeBlock = callBack
view.cancelBlcok = cancelCallBack
view.setContent(title, message, leftButtonString, rightButtonString)
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
......@@ -54,6 +56,10 @@ class YHCommonAlertView: UIView {
make.height.lessThanOrEqualTo(60)
make.top.equalTo(37)
}
lineView.isHidden = true
} else {
lineView.isHidden = false
}
}
......@@ -176,6 +182,9 @@ class YHCommonAlertView: UIView {
}
@objc func disagree() {
if let block = self.cancelBlcok {
block()
}
dismiss()
}
......
......@@ -112,14 +112,14 @@ class YHPreviewControllerHoldViewController: UIViewController {
super.viewWillAppear(animated)
//处于第一个item的时候,才允许屏幕边缘手势返回
navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0)
// navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
//离开页面的时候,需要恢复屏幕边缘手势,不能影响其他页面
navigationController?.interactivePopGestureRecognizer?.isEnabled = true
// navigationController?.interactivePopGestureRecognizer?.isEnabled = true
}
override func viewDidLayoutSubviews() {
......
......@@ -75,7 +75,8 @@ class YHImageViewController: YHBaseViewController {
self.back()
}
}
self.resultView.kf.setImage(with: URL(string: success))
// self.resultView.kf.setImage(with: URL(string: success))
self.resultView.kf.setImage(with: URL(string: success), placeholder: UIImage(named: "global_default_image"))
}
}
}
//
// YHNoDataTipsView.swift
// galaxy
//
// Created by EDY on 2024/4/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHNoDataTipsView: UIView {
private lazy var iconImgV : UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "list_no_data")
imagV.contentMode = .scaleAspectFill
return imagV
}()
lazy var tipsLab : UILabel = {
let lable = UILabel()
lable.textColor = UIColor.labelTextColor2
lable.font = UIFont.PFSC_R(ofSize: 14)
lable.textAlignment = .center
lable.text = "暂无"
return lable
}()
public override init(frame: CGRect) {
super.init(frame:frame)
initView()
}
private func initView() {
addSubview(iconImgV)
iconImgV.snp.makeConstraints { make in
make.top.equalToSuperview()
make.centerX.equalToSuperview()
make.height.equalTo(93)
make.width.equalTo(93)
}
addSubview(tipsLab)
tipsLab.snp.makeConstraints { make in
make.top.equalTo(iconImgV.snp.bottom).offset(12)
make.centerX.equalToSuperview()
make.left.right.equalToSuperview()
}
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
//
// YHOrderListView.swift
// galaxy
//
// Created by EDY on 2024/4/9.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHOrderListView: UIView {
var dataSource: [YHContactItemModel] = [] {
didSet {
self.homeTableView.reloadData()
}
}
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 81.0
tableView.register(YHContractCell.self,forCellReuseIdentifier: YHContractCell.cellReuseIdentifier)
return tableView
}()
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupUI() {
addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
homeTableView.delegate = self
homeTableView.dataSource = self
}
}
extension YHOrderListView : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return self.dataSource.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return kMargin
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: kMargin))
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 81
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = tableView.dequeueReusableCell(withClass: YHContractCell.self)
cell0.selectionStyle = .none
if indexPath.section < self.dataSource.count {
cell0.dataModel = self.dataSource[indexPath.section]
}
return cell0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.section)")
//获取订单号
let orderId = dataSource[indexPath.section].id
UserDefaults.standard.set(orderId, forKey: "orderIdForPreview")
UserDefaults.standard.synchronize()
let vc = YHServiceCenterSecondViewController()
vc.orderId = orderId
vc.mobile = dataSource[indexPath.section].mobile
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
//
// YHProgressView.swift
// galaxy
//
// Created by EDY on 2024/4/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHProgressView: UIView {
private let progressLayer = CAShapeLayer()
override init(frame: CGRect) {
super.init(frame: frame)
configure()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
configure()
}
func changeColor(_ color: UIColor) {
progressLayer.strokeColor = color.cgColor // 设置进度条颜色
}
private func configure() {
// 创建底部圆形路径
let center = CGPoint(x: bounds.midX, y: bounds.midY)
let lineWidth: CGFloat = 3 // 圆环路径宽度
let radius = (min(bounds.width, bounds.height) - lineWidth) / 2 // 圆的半径
let startAngle = -CGFloat.pi / 2 // 起始角度
let endAngle = 1.5 * CGFloat.pi // 终点角度
// 创建进度条圆形路径
let progressPath = UIBezierPath(arcCenter: center,
radius: radius,
startAngle: startAngle,
endAngle: endAngle,
clockwise: true)
// 配置进度条CAShapeLayer
progressLayer.path = progressPath.cgPath
progressLayer.strokeColor = UIColor(hex: 0x00BF60).cgColor // 进度条颜色
progressLayer.fillColor = UIColor.clear.cgColor
progressLayer.lineWidth = lineWidth // 进度条宽度
progressLayer.lineCap = .round
// 设置初始进度
progressLayer.strokeEnd = 0
layer.addSublayer(progressLayer)
}
func setProgress(_ progress: Float, animated: Bool) {
let animation = CABasicAnimation(keyPath: "strokeEnd")
animation.fromValue = progressLayer.strokeEnd
animation.toValue = progress
animation.duration = animated ? 1.0 : 0
progressLayer.strokeEnd = CGFloat(progress)
progressLayer.add(animation, forKey: "progressAnimation")
}
}
//
// YHServerNoOrderView.swift
// galaxy
//
// Created by EDY on 2024/4/9.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHServerNoOrderView: UIView {
typealias SectionBlock = (YHClassifyModel) -> ()
var sectionBlock: SectionBlock?
var loadMoreBlock: SectionBlock?
var tableHeadView: YHServerTableHeadView!
var sectionView: YHServiceSectionView!
var dataSouce: [YHHomeListModel?] = [] {
didSet {
self.homeTableView.reloadData()
}
}
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .plain)
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0
}
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 81.0
tableView.register(YHServerHKLifeViewCell.self,forCellReuseIdentifier: YHServerHKLifeViewCell.cellReuseIdentifier)
return tableView
}()
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupUI() {
sectionView = {
let view = YHServiceSectionView()
view.block = {[weak self] model in
guard let self = self else { return }
if let block = sectionBlock {
block(model)
}
}
return view
}()
tableHeadView = YHServerTableHeadView()
tableHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 365)
addSubview(homeTableView)
homeTableView.tableHeaderView = tableHeadView
homeTableView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
homeTableView.delegate = self
homeTableView.dataSource = self
homeTableView.es.addInfiniteScrolling {[weak self] in
guard let self = self else { return }
self.homeTableView.es.stopLoadingMore()
if let block = self.loadMoreBlock {
block(YHClassifyModel())
}
}
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHServerNoOrderView : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 48
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return sectionView
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return KScreenHeight
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = tableView.dequeueReusableCell(withClass: YHServerHKLifeViewCell.self)
cell0.tableFootView.items = dataSouce
cell0.tableFootView.myCollectView.es.removeRefreshFooter()
cell0.selectionStyle = .none
return cell0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
......@@ -37,7 +37,7 @@ class YHServiceBannerView: UIView {
view.automaticSlidingInterval = 3
view.register(FSPagerViewCell.self, forCellWithReuseIdentifier: "cell")
view.itemSize = FSPagerView.automaticSize
view.interitemSpacing = 10
// view.interitemSpacing = 10
return view
}()
......@@ -118,12 +118,16 @@ extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
public func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: "cell", at: index)
let image = UIImage(named: "default_placeholder_image")?.bs_scaled(toWidth: UIDevice.kScreenW - 16*2, opaque: false)
cell.imageView?.image = image
if index < dataArr.count {
let model = dataArr[index]
if let url = URL(string: model.img_url) {
cell.imageView?.kf.setImage(with: url)
if model.id != 0 {
if let url = URL(string: model.img_url) {
// cell.imageView?.kf.setImage(with: url)
cell.imageView?.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
}
} else {
cell.imageView?.image = UIImage(named: model.img_url)
}
// cell.textLabel?.text = model.name
}
......@@ -143,6 +147,11 @@ extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
return
}
let model = dataArr[index]
if model.isLocalItemFlag {
return
}
if model.skip_url.isEmpty == false {
switch model.skip_type {
case 1: //跳转H5
......
//
// YHServiceNoOrderView.swift
// galaxy
//
// Created by EDY on 2024/4/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHServiceNoOrderView: UIView {
public var clickMoreBtnClickkBlock : (()->())?
public var clickBackBtnClickBlock : (()->())?
public var clickShowBtnClickBlock : (()->())?
private lazy var iconImgV : UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "service_center_no_data")
imagV.contentMode = .scaleAspectFill
return imagV
}()
private lazy var tipsLab : UILabel = {
let lable = UILabel()
lable.textColor = UIColor.mainTextColor
lable.font = UIFont.PFSC_R(ofSize: 14)
lable.textAlignment = .center
lable.text = "您还没有相关订单"
return lable
}()
private lazy var noFindLab : UILabel = {
let lable = UILabel()
lable.textColor = UIColor.labelTextColor2
lable.font = UIFont.PFSC_R(ofSize: 12)
lable.textAlignment = .center
lable.text = "找不到订单"
return lable
}()
private lazy var showBtn : UIButton = {
let btn = UIButton(type: .custom)
btn.setBackgroundImage(UIImage(named: "service_no_order_alert"), for: .normal)
return btn
}()
private lazy var moreBtn : UIButton = {
let btn = UIButton(type: .custom)
btn.setTitle("更多资讯", for: .normal)
btn.layer.cornerRadius = kCornerRadius6
btn.clipsToBounds = true
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
btn.setTitleColor(UIColor.mainTextColor, for: .normal)
btn.backgroundColor = UIColor.contentBkgColor
return btn
}()
private lazy var backBtn : UIButton = {
let btn = UIButton(type: .custom)
btn.setTitle("返回首页", for: .normal)
btn.layer.cornerRadius = kCornerRadius6
btn.clipsToBounds = true
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
btn.setTitleColor(.white, for: .normal)
return btn
}()
public override init(frame: CGRect) {
super.init(frame:frame)
initView()
}
private func initView() {
addSubview(iconImgV)
iconImgV.snp.makeConstraints { make in
make.top.equalToSuperview()
make.centerX.equalToSuperview()
make.height.equalTo(93)
make.width.equalTo(93)
}
addSubview(tipsLab)
tipsLab.snp.makeConstraints { make in
make.top.equalTo(iconImgV.snp.bottom).offset(12)
make.centerX.equalToSuperview()
make.left.right.equalToSuperview()
}
addSubview(noFindLab)
noFindLab.snp.makeConstraints { make in
make.top.equalTo(tipsLab.snp.bottom).offset(8.5)
make.centerX.equalToSuperview().offset(-8)
}
addSubview(showBtn)
showBtn.snp.makeConstraints { make in
make.left.equalTo(noFindLab.snp.right).offset(2)
make.centerY.equalTo(noFindLab.snp.centerY)
make.width.height.equalTo(16)
}
addSubview(moreBtn)
moreBtn.snp.makeConstraints { make in
make.top.equalTo(noFindLab.snp.bottom).offset(22.5)
make.right.equalTo(self.snp.centerX).offset(-8.5)
make.height.equalTo(38)
make.width.equalTo(84)
}
addSubview(backBtn)
backBtn.snp.makeConstraints { make in
make.top.equalTo(noFindLab.snp.bottom).offset(22.5)
make.left.equalTo(self.snp.centerX).offset(8.5)
make.height.equalTo(38)
make.width.equalTo(84)
}
showBtn.addTarget(self, action: #selector(showBtnClick), for: .touchUpInside)
backBtn.addTarget(self, action: #selector(backBtnClick), for: .touchUpInside)
moreBtn.addTarget(self, action: #selector(moreBtnClick), for: .touchUpInside)
showBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
layoutIfNeeded()
backBtn.backgroundColor = .brandMainColor
backBtn.addYinHeGradualLayer()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc func moreBtnClick() {
self.clickMoreBtnClickkBlock?()
}
@objc func backBtnClick() {
self.clickBackBtnClickBlock?()
}
@objc func showBtnClick() {
self.clickShowBtnClickBlock?()
}
}
//
// YHServiceOrderProgressTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/4/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHServiceOrderProgressTableViewCell: UITableViewCell {
var titleLabel: UILabel!
var messageLabel: UILabel!
var buttonLabel: UILabel!
var progressImageView: UIImageView!
var progressLabel: UILabel!
var progress: YHProgressView!
var dataModel : YHServiceCenterProgressModel? {
didSet {
updateUI()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
extension YHServiceOrderProgressTableViewCell {
func updateUI() {
guard let model = dataModel else { return }
messageLabel.text = "您还有" + "\(model.num)" + "份信息待填写哦~"
// 0未知 1待开始 2进行中 3 已完成
if model.status == 1 {
titleLabel.textColor = UIColor(hex: 0x121a26)
messageLabel.textColor = UIColor(hex: 0x94a3b8)
buttonLabel.text = "待开始"
buttonLabel.backgroundColor = UIColor(hex: 0xb8babe)
progressImageView.image = UIImage(named: "service_progress_normal")
// 1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书
if model.type == 1 {
titleLabel.text = "我的证件"
messageLabel.text = "您的证件还没生成哦~"
}
if model.type == 2 {
titleLabel.text = "我的信息"
}
if model.type == 3 {
titleLabel.text = "我的评分"
messageLabel.text = "您的评分报告还没生成哦~"
}
if model.type == 4 {
titleLabel.text = "我的方案"
messageLabel.text = "您的专属方案还没生成哦~"
}
if model.type == 5 {
titleLabel.text = "我的签字"
messageLabel.text = "您的文件还没签字哦~"
}
if model.type == 6 {
titleLabel.text = "我的文书"
messageLabel.text = "您的文书还没确认哦~"
}
let b: ASAttributedString = .init(NSAttributedString(string: "\(model.percentage)"), .font(UIFont(name: "DINAlternate-Bold", size: 24)!),.foreground(UIColor(hex: 0x121a26)))
let bb: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 10)),.foreground(UIColor(hex: 0x121a26).withAlphaComponent(0.3)))
progressLabel.attributed.text = b + bb
}
if model.status == 2 {
titleLabel.textColor = UIColor.mainTextColor
buttonLabel.text = "进行中"
buttonLabel.backgroundColor = UIColor.brandMainColor
progressImageView.image = UIImage(named: "service_progress_start")
progress.changeColor(UIColor.brandMainColor)
// 1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书
if model.type == 1 {
titleLabel.text = "我的证件"
// messageLabel.text = "恭喜您,证件已全部上传完~"
buttonLabel.text = "去上传"
let a: ASAttributedString = .init("您还有", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
let aa: ASAttributedString = .init(NSAttributedString(string: "\(model.num)份"), .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor.brandMainColor))
let aaa: ASAttributedString = .init("证件待上传哦~", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
messageLabel.attributed.text = a + aa + aaa
}
if model.type == 2 {
titleLabel.text = "我的信息"
buttonLabel.text = "去填写"
let a: ASAttributedString = .init("您还有", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
let aa: ASAttributedString = .init(NSAttributedString(string: "\(model.num)份"), .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor.brandMainColor))
let aaa: ASAttributedString = .init("信息待填写哦~", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
messageLabel.attributed.text = a + aa + aaa
}
if model.type == 3 {
titleLabel.text = "我的评分"
messageLabel.text = "后端出问题会显示"
}
if model.type == 4 {
titleLabel.text = "我的方案"
messageLabel.text = "后端出问题会显示"
}
if model.type == 5 {
titleLabel.text = "我的签字"
buttonLabel.text = "去签字"
let a: ASAttributedString = .init("您还有", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
let aa: ASAttributedString = .init(NSAttributedString(string: "\(model.num)份"), .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor.brandMainColor))
let aaa: ASAttributedString = .init("文件待签字哦~", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
messageLabel.attributed.text = a + aa + aaa
}
if model.type == 6 {
titleLabel.text = "我的文书"
buttonLabel.text = "去确认"
let a: ASAttributedString = .init("您还有", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
let aa: ASAttributedString = .init(NSAttributedString(string: "\(model.num)份"), .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor.brandMainColor))
let aaa: ASAttributedString = .init("文书待确认哦~", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
messageLabel.attributed.text = a + aa + aaa
}
let b: ASAttributedString = .init(NSAttributedString(string: "\(model.percentage)"), .font(UIFont(name: "DINAlternate-Bold", size: 24)!),.foreground(UIColor(hex: 0x121a26)))
let bb: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 10)),.foreground(UIColor(hex: 0x121a26).withAlphaComponent(0.3)))
progressLabel.attributed.text = b + bb
}
if model.status == 3 {
titleLabel.textColor = UIColor.mainTextColor
messageLabel.textColor = UIColor(hex: 0x94a3b8)
buttonLabel.text = "去查看"
progress.changeColor(UIColor(hex: 0x55cba0))
buttonLabel.backgroundColor = UIColor(hex: 0x55cba0)
progressImageView.image = UIImage(named: "service_progress_end")
// 1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书
if model.type == 1 {
titleLabel.text = "我的证件"
messageLabel.text = "恭喜您,证件已全部上传完~"
}
if model.type == 2 {
titleLabel.text = "我的信息"
messageLabel.text = "恭喜您,信息已全部填写完~"
}
if model.type == 3 {
titleLabel.text = "我的评分"
messageLabel.text = "恭喜您,评分报告已生成~"
}
if model.type == 4 {
titleLabel.text = "我的方案"
messageLabel.text = "恭喜您,专属方案已生成~"
}
if model.type == 5 {
titleLabel.text = "我的签字"
messageLabel.text = "恭喜您,文件已全部签字完~"
}
if model.type == 6 {
titleLabel.text = "我的文书"
messageLabel.text = "恭喜您,文件已全部确认完~"
}
let b: ASAttributedString = .init(NSAttributedString(string: "\(model.percentage)"), .font(UIFont(name: "DINAlternate-Bold", size: 24)!),.foreground(UIColor(hex: 0x121a26)))
let bb: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 10)),.foreground(UIColor(hex: 0x121a26).withAlphaComponent(0.3)))
progressLabel.attributed.text = b + bb
}
if model.percentage == 0 {
progress.isHidden = true
} else {
progress.setProgress(Float(CGFloat(model.percentage))/100.0, animated: false)
progress.isHidden = false
}
}
func setupUI() {
let holdView = UIView()
holdView.backgroundColor = .white
holdView.layer.cornerRadius = kCornerRadius6
holdView.clipsToBounds = true
backgroundColor = .clear
contentView.backgroundColor = .clear
contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
return label
}()
holdView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.top.equalTo(21)
make.left.equalTo(21)
make.height.equalTo(24)
}
messageLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 13)
label.textColor = UIColor.mainTextColor
return label
}()
holdView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.top.equalTo(49)
make.left.equalTo(21)
make.height.equalTo(18)
}
buttonLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 13)
label.textColor = .white
label.backgroundColor = UIColor.brandMainColor
label.layer.cornerRadius = kCornerRadius4
label.masksToBounds = true
label.textAlignment = .center
return label
}()
holdView.addSubview(buttonLabel)
buttonLabel.snp.makeConstraints { make in
make.bottom.equalTo(-19)
make.left.equalTo(21)
make.height.equalTo(27)
make.width.equalTo(57)
}
progressImageView = {
let view = UIImageView()
return view
}()
holdView.addSubview(progressImageView)
progressImageView.snp.makeConstraints { make in
make.top.equalTo(24)
make.right.equalTo(-32)
make.height.equalTo(80)
make.width.equalTo(80)
}
progressLabel = {
let label = UILabel()
label.textAlignment = .center
// label.font = UIFont.PFSC_M(ofSize: 13)
// label.textColor = UIColor.mainTextColor
return label
}()
holdView.addSubview(progressLabel)
progressLabel.snp.makeConstraints { make in
make.center.equalTo(progressImageView.snp.center)
make.width.equalTo(60)
make.height.equalTo(29)
}
progress = {
let view = YHProgressView(frame: CGRect(x: 0, y: 0, width: 80, height: 80))
return view
}()
holdView.addSubview(progress)
progress.snp.makeConstraints { make in
make.top.equalTo(24)
make.right.equalTo(-32)
make.height.equalTo(80)
make.width.equalTo(80)
}
}
}
......@@ -43,10 +43,11 @@ class YHServiceSectionView: UIView {
collectinoView.register(YHServiceSectionCollectionViewCell.self, forCellWithReuseIdentifier:YHServiceSectionCollectionViewCell.cellReuseIdentifier)
collectinoView.delegate = self
collectinoView.dataSource = self
collectinoView.showsVerticalScrollIndicator = false
collectinoView.translatesAutoresizingMaskIntoConstraints = false
collectinoView.alwaysBounceVertical = true
collectinoView.bounces = false
collectinoView.showsHorizontalScrollIndicator = false
collectinoView.showsVerticalScrollIndicator = false
return collectinoView
}()
......@@ -121,7 +122,7 @@ class YHServiceSectionCollectionViewCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHServiceSectionCollectionViewCell"
func setSelectedStyle() {
contentView.backgroundColor = UIColor.brandMainColor
contentView.backgroundColor = UIColor(hex: 0x3570dc)
descripeLable.textColor = UIColor.white
}
......
......@@ -29,9 +29,11 @@ class YHServiceTableFootView: UIView {
collectinoView.register(YHHomeCollectionViewCell.self, forCellWithReuseIdentifier:YHHomeCollectionViewCell.cellReuseIdentifier)
collectinoView.delegate = self
collectinoView.dataSource = self
collectinoView.bounces = false
// collectinoView.bounces = false
collectinoView.translatesAutoresizingMaskIntoConstraints = false
collectinoView.alwaysBounceVertical = true
collectinoView.showsVerticalScrollIndicator = false
collectinoView.showsHorizontalScrollIndicator = false
return collectinoView
}()
......@@ -55,7 +57,7 @@ class YHServiceTableFootView: UIView {
myCollectView.es.addInfiniteScrolling {[weak self] in
guard let self = self else { return }
if let block = moreBlock {
block ()
block()
}
}
}
......@@ -82,8 +84,20 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData
guard let model = items[indexPath.row] else { return }
if model.type == 2 {
let vc = YHHomeWebViewController()
vc.url = YHConfigManager.shared.h5Url + "?id=\(model.id)"
vc.url = YHBaseUrlManager.shared.curH5URL() + "articleDetail.html" + "?id=\(model.id)"
vc.id = model.id
vc.block = {[weak self] model in
guard let self = self else { return }
let arr = self.items
for (index, targetItem) in arr.enumerated() {
guard let target = targetItem else { return }
if target.id == model.id {
target.is_like = model.is_like
target.like_count = model.like_count
self.myCollectView.reloadItems(at: [IndexPath.SubSequence(item: index, section: 0)])
}
}
}
UIViewController.current?.navigationController?.pushViewController(vc)
} else if model.type == 1 {
printLog("直接播放视频")
......
......@@ -24,12 +24,50 @@ class YHServiceCenterMainViewModel: YHBaseViewModel {
//我的评分
var myScoreResultData : YHScoreResultModel?//网络请求的结果数据
var localScoreData : YHScoreDataModel? //本地缓存的数据
var allInfoScoreModel: YHContactInfoScoreModel? //提交信息获取 得分
//服务中心进度模型
var arrDataForSeviceCenterProgress : [YHServiceCenterProgressModel] = []
}
//请求接口
extension YHServiceCenterMainViewModel {
//服务中心进度列表
func getServiceCenterProgressList(_ orderId: Int, _ type: Int,callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
/*
orderId integer 订单id 可选
status integer 可选 0全部 1待开始 2进行中 3 已完成
let arr = ["orderId":id,"status"]
*/
let params: [String : Any] = ["orderId": orderId,
"status": type]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Order.serviceCenterProgressApi
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
let dic = json.data
guard let result = [YHServiceCenterProgressModel].deserialize(from: dic as? [Any]) else {
callBackBlock(false,nil)
return
}
self.arrDataForSeviceCenterProgress = result as! [YHServiceCenterProgressModel]
callBackBlock(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
//获取我的评分结果
func getMyScoreDetail( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
......@@ -271,7 +309,6 @@ extension YHServiceCenterMainViewModel {
model.isFinished = false
}
if item == target {
model.isDoing = true
}
......
......@@ -96,15 +96,19 @@ class YHCodeSueecssViewController: YHBaseViewController {
guard let self = self else { return }
if let phone = self.phoneNumber {
self.viewModel?.login(phone : phone, code: code, callBackBlock: {[weak self] success,error in
guard let self = self else { return }
if success == false {
YHHUD.flash(message: error?.errorMsg ?? "")
} else {
YHHUD.flash(message: "登录成功")
self.dismiss(animated: true)
// 登录接口需要加一个deviceToken参数
YHHUD.show(.progress(message: "登录中..."))
if YHLoginManager.shared.deviceTokenModel.registerId.isEmpty {
JPUSHService.registrationIDCompletionHandler {
resCode, registrationID in
YHHUD.hide()
YHLoginManager.shared.deviceTokenModel.registerId = registrationID ?? ""
self.requetLogin(phone: phone, code: code)
}
})
} else {
self.requetLogin(phone: phone, code: code)
}
} else {
printLog("errror : 电话号码为空")
}
......@@ -163,6 +167,21 @@ class YHCodeSueecssViewController: YHBaseViewController {
}
func requetLogin(phone: String, code: String) {
YHHUD.show(.progress(message: "登录中..."))
self.viewModel?.login(phone : phone, code: code, callBackBlock: {[weak self] success,error in
YHHUD.hide()
guard let self = self else { return }
if success == false {
YHHUD.flash(message: error?.errorMsg ?? "")
} else {
YHLoginManager.shared.loginSuccessActionBlock?()
YHHUD.flash(message: "登录成功")
self.dismiss(animated: true)
}
})
}
func startTime() {
getCodeLabel.isHidden = false
getCodeButton.isHidden = true
......
//
// YHNewWebViewController.swift
// galaxy
//
// Created by EDY on 2024/3/6.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import WebKit
class YHNewWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
var webView = WKWebView()
var progBar = UIProgressView()
var url = "https://www.baidu.com"
override func viewDidLoad() {
super.viewDidLoad()
gk_navBackgroundColor = .clear
gk_navShadowColor = .clear
gk_navigationBar.isHidden = true
// 创建wkwebview
webView = WKWebView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height))
webView.navigationDelegate = self
webView.uiDelegate = self
// 创建网址
let url = NSURL(string: url)
// 创建请求
let request = NSURLRequest(url: url! as URL)
// 加载请求
webView.load(request as URLRequest)
// 添加wkwebview
self.view.addSubview(webView)
// 加载网页的进度条
progBar = UIProgressView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 30))
progBar.progress = 0.0
progBar.tintColor = UIColor.brandMainColor
webView.addSubview(progBar)
// 监听网页加载的进度
webView.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil)
}
override func viewDidDisappear(_ animated: Bool) {
webView.removeObserver(self, forKeyPath: "estimatedProgress")
}
// MARK: - WKNavigationDelegate
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.navigationItem.title = webView.title
}
// MARK: - WKUIDelegate
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
// 实现非安全链接的跳转。如果目标主视图不为空,则允许导航
if !(navigationAction.targetFrame?.isMainFrame != nil) {
webView.load(navigationAction.request)
}
return nil
}
func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) {
// 修复弹窗弹出的问题
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
completionHandler()
}))
self.present(alert, animated: true, completion: nil)
}
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
printLog("\(navigationAction.request.url?.absoluteString ?? "")")
// https://www.galaxy-immi.com/
decisionHandler(.allow)
}
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
print("页面开始加载")
}
func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) {
print("页面提交")
}
// MARK: - webview function
@objc func toBack() {
if webView.canGoBack {
webView.goBack()
}
}
@objc func toForward() {
if webView.canGoForward {
webView.goForward()
}
}
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if keyPath == "estimatedProgress" {
self.progBar.alpha = 1.0
progBar.setProgress(Float(webView.estimatedProgress), animated: true)
//进度条的值最大为1.0
if(self.webView.estimatedProgress >= 1.0) {
UIView.animate(withDuration: 0.3, delay: 0.1, options: .curveEaseInOut, animations: { () -> Void in
self.progBar.alpha = 0.0
}, completion: { (finished:Bool) -> Void in
self.progBar.progress = 0
})
}
}
}
override class func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
}
}
......@@ -41,6 +41,10 @@ class YHPhoneLoginViewController: YHBaseViewController {
YHAnalytics.timeEnd("loginTime")
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
}
func setView() {
view.backgroundColor = .white
bgImageView = {
......@@ -197,11 +201,6 @@ class YHPhoneLoginViewController: YHBaseViewController {
msg = String(error?.errorCode ?? 404)
}
YHHUD.flash(message: msg)
#if DEBUG
// let vc = YHCodeSueecssViewController()
// vc.phoneNumber = self.phoneMessageView.phoneTextField.text
// self.navigationController?.pushViewController(vc)
#endif
}
})
} else {
......@@ -222,6 +221,7 @@ class YHPhoneLoginViewController: YHBaseViewController {
}
@objc func close() {
YHLoginManager.shared.loginSuccessActionBlock = nil
self.dismiss(animated: true)
}
}
......@@ -17,8 +17,10 @@ struct YHUserModel: SmartCodable {
var sex: Int?
var token: String?
}
struct YHDeviceTokenModel {
var deviceToken: String = ""
var pushUserId: String = ""
var registerId: String = ""
}
......
......@@ -12,8 +12,18 @@ class YHLoginManager: NSObject {
static let shared = YHLoginManager()
var userModel: YHUserModel?
var deviceTokenModel : YHDeviceTokenModel = YHDeviceTokenModel()
//检查到未登录的情况下 调用登录界面,在登录成功后,是否需要继续之前的行为
typealias Block = () -> ()
var loginSuccessActionBlock : Block?
private override init() {}
var needJumpToMsgTabFlag : Bool = false
}
extension YHLoginManager {
func isLogin() -> Bool {
let ttt = userModel?.token?.count ?? 0
if ttt != 0 {
......@@ -33,6 +43,7 @@ class YHLoginManager: NSObject {
// 清空用户数据
func clearUserInfo() {
userModel = nil
deviceTokenModel.registerId = ""
UserDefaults.standard.set(nil, forKey: YhConstant.KLoginedInfoKey)
UserDefaults.standard.synchronize()
}
......
......@@ -81,4 +81,27 @@ extension YHLoginViewModel {
callBackBlock(false,err)
}
}
func logout(_ callBackBlock: @escaping (_ success: Bool,_ error: YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Auth.logout
let _ = YHNetRequest.postRequest(url: strUrl) {
[weak self] json, code in
//1. json字符串 转 对象
guard self != nil else { return }
printLog(json)
_ = json.data
if json.code == 200 {
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { error in
callBackBlock(false, error)
}
}
}
......@@ -8,14 +8,25 @@
import UIKit
class YHInformationFillVC: YHBaseViewController {
class YHMessageDetailListVC: YHBaseViewController {
var msgArr:[String] = ["","","",""]
var type:Int = -1
var msgArr:[YHDetailMessageModel] = []
// 滑动过程中出现在屏幕上的未读消息集合
var visibleUnreadMsgIdSet = Set<String>()
var visibleUnreadMsgArr = [YHDetailMessageModel]()
lazy var viewModel = {
let model = YHMsgViewModel()
return model
}()
lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar()
bar.backgroundColor = .white
bar.title = "资料填写".local
if let title = self.title, !title.isEmpty {
bar.title = title
}
bar.showRightButtonType(.clean)
bar.backBlock = {
[weak self] in
......@@ -25,8 +36,13 @@ class YHInformationFillVC: YHBaseViewController {
bar.rightBtnClick = {
[weak self] in
guard let self = self else { return }
let unreadMessages = self.msgArr.filter { !$0.isRead }
if unreadMessages.count <= 0 {
YHHUD.flash(message: "暂无未读消息~")
return
}
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
self.markAllMsgsRead()
}
}
return bar
......@@ -34,23 +50,56 @@ class YHInformationFillVC: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.sectionHeaderHeight = 46.0
tableView.estimatedSectionHeaderHeight = 1.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = UIColor(hex:0xF8F8F8)
tableView.backgroundView = emptyDataTipsView
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHInformationFillCell.self, forCellReuseIdentifier: YHInformationFillCell.cellReuseIdentifier)
tableView.register(YHDetailMessageCell.self, forCellReuseIdentifier: YHDetailMessageCell.cellReuseIdentifier)
return tableView
}()
lazy var emptyDataTipsView:UIView = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 124))
view.isHidden = true
let imgView = UIImageView(image: UIImage(named: "msg_no_data"))
view.addSubview(imgView)
let label = UILabel()
label.textColor = UIColor(hex: 0x94A3B8)
label.font = UIFont.PFSC_R(ofSize: 14)
label.textAlignment = .center
label.text = "暂无消息".local
view.addSubview(label)
let topMargin = (KScreenHeight-k_Height_NavigationtBarAndStatuBar-124.0)/2.0
imgView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(topMargin)
make.width.height.equalTo(92)
make.centerX.equalTo(view)
}
label.snp.makeConstraints { make in
make.top.equalTo(imgView.snp.bottom).offset(12)
make.centerX.equalTo(view)
}
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
getMsgList()
}
func setupUI() {
gk_navigationBar.isHidden = true
......@@ -68,22 +117,87 @@ class YHInformationFillVC: YHBaseViewController {
make.bottom.equalToSuperview()
}
}
func getMsgList() {
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getMsgDetailList(type: self.type) {
[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
msgArr.removeAll()
msgArr.append(contentsOf: self.viewModel.msgDetailList)
emptyDataTipsView.isHidden = msgArr.count > 0
self.tableView.reloadData {
[weak self] in
guard let self = self else { return }
self.addUpAppearUnreadMessages()
self.markAppearMessagsReaded()
}
}
}
func markAllMsgsRead() {
YHHUD.show(.progress(message: "清除中..."))
self.viewModel.readMessages(type:self.type, msgIds:nil, isAllRead:true) {
[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
if success {
YHHUD.flash(message: "清除成功")
for item in self.msgArr {
item.isRead = true
}
self.tableView.reloadData()
return
}
var msg = "清除失败"
if let error = error {
if error.errorMsg.count > 0 {
msg = error.errorMsg
}
}
YHHUD.flash(message: msg)
}
}
func markAppearMessagsReaded() {
var msgIds:[Int] = []
var resultArr:[YHDetailMessageModel] = []
for msgItem in visibleUnreadMsgArr {
if let msgId = Int(msgItem.id), msgItem.isRead == false {
msgIds.append(msgId)
resultArr.append(msgItem)
}
}
if msgIds.count <= 0 { return }
self.viewModel.readMessages(type: self.type, msgIds: msgIds, isAllRead:false) {
[weak self] success, error in
guard let self = self else { return }
if success {
for msgItem in resultArr {
msgItem.isRead = true
}
self.tableView.reloadData()
return
}
}
}
}
extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return msgArr.count
}
extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
return msgArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHInformationFillCell.cellReuseIdentifier, for: indexPath) as! YHInformationFillCell
let cell = tableView.dequeueReusableCell(withIdentifier: YHDetailMessageCell.cellReuseIdentifier, for: indexPath) as! YHDetailMessageCell
if 0 <= indexPath.row && indexPath.row < msgArr.count {
let item = msgArr[indexPath.row]
cell.updateModel(item)
cell.updateBottomBtn(type: self.type)
}
return cell
}
......@@ -92,11 +206,55 @@ extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.row && indexPath.row < msgArr.count {
let item = msgArr[indexPath.row]
printLog("order_id: \(item.orderId)")
if !item.isRead, let msgId = Int(item.id), msgId > 0 { // 消息为未读消息
self.viewModel.readMessages(type: self.type, msgIds: [msgId], isAllRead: false) {
[weak self] success, error in
guard let self = self else { return }
if success {
item.isRead = true
self.tableView.reloadData()
}
}
}
if self.type == YHMessageType.infoFill.rawValue { // 资料填写
if let orderId = Int(item.orderId), orderId > 0 {
let vc = YHInformationPerfectListVC()
vc.orderId = orderId
navigationController?.pushViewController(vc)
}
} else if self.type == YHMessageType.cerUpload.rawValue { // 证件上传
if let orderId = Int(item.orderId), orderId > 0 {
let vc = YHMineCertificateEntryViewController()
vc.orderId = orderId
navigationController?.pushViewController(vc)
}
} else if self.type == YHMessageType.draft.rawValue { // 文书定稿
if let orderId = Int(item.orderId), orderId > 0 {
let vc = YHMyDocumentsListViewController()
vc.orderId = orderId
navigationController?.pushViewController(vc)
}
} else if self.type == YHMessageType.fileSign.rawValue { // 文件签字
if let orderId = Int(item.orderId), orderId > 0 {
let vc = YHMySignatureListViewController()
vc.orderId = orderId
navigationController?.pushViewController(vc)
}
}
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 46.0
return 1.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
......@@ -109,19 +267,37 @@ extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
let label = UILabel()
label.textColor = UIColor(hex: 0x121A26, alpha: 0.3)
label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize:12)
label.text = "2023-09-13"
view.addSubview(label)
label.snp.makeConstraints { make in
make.edges.equalToSuperview()
return UIView()
}
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
if scrollView == tableView && !decelerate {
// 在这里处理滑动停止事件
print("TableView 滑动停止")
markAppearMessagsReaded()
}
return view
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
addUpAppearUnreadMessages()
}
// 累计出现在屏幕上的未读消息集合
func addUpAppearUnreadMessages() {
let visibleCells = tableView.visibleCells as! [YHDetailMessageCell]
if visibleCells.count <= 0 { return }
for cell in visibleCells {
if let msgItem = cell.model {
if !msgItem.isRead {
if !visibleUnreadMsgIdSet.contains(msgItem.id) {
visibleUnreadMsgIdSet.insert(msgItem.id)
visibleUnreadMsgArr.append(msgItem)
}
}
}
}
printLog("visiblemsgIdSet:/n \(visibleUnreadMsgIdSet)")
}
}
......@@ -8,13 +8,18 @@
import UIKit
class YHMsgViewController: YHBaseViewController {
class YHMessageListVC: YHBaseViewController {
var msgArr:[String] = ["","","",""]
var msgArr:[YHMessageInfoModel] = []
lazy var viewModel = {
let model = YHMsgViewModel()
return model
}()
var isNotifyEnabled = false
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.sectionHeaderHeight = 42.0
tableView.estimatedSectionHeaderHeight = 1.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
......@@ -22,37 +27,83 @@ class YHMsgViewController: YHBaseViewController {
tableView.dataSource = self
tableView.backgroundColor = .white
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.backgroundView = emptyDataTipsView
tableView.register(YHMessageSessionCell.self, forCellReuseIdentifier: YHMessageSessionCell.cellReuseIdentifier)
return tableView
}()
lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar()
bar.backButton.isHidden = true
bar.backgroundColor = .white
bar.title = "消息"
bar.showRightButtonType(.clean)
bar.backBlock = {
[weak self] in
guard let self = self else { return }
self.navigationController?.popViewController(animated: true)
lazy var navBar: UIView = {
let bar = UIView()
let titleLabel = UILabel()
titleLabel.textColor = UIColor(hex: 0x121A26)
titleLabel.textAlignment = .left
titleLabel.font = UIFont.PFSC_M(ofSize:21)
titleLabel.text = "消息"
bar.addSubview(titleLabel)
let cleanBtn = UIButton()
cleanBtn.setImage(UIImage(named: "msg_clean"), for: .normal)
cleanBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
cleanBtn.addTarget(self, action: #selector(didCleanButtonClicked), for: .touchUpInside)
bar.addSubview(cleanBtn)
titleLabel.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(20)
make.right.equalTo(cleanBtn.snp.left).offset(-20)
}
bar.rightBtnClick = {
[weak self] in
guard let self = self else { return }
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
}
cleanBtn.snp.makeConstraints { make in
make.width.height.equalTo(24)
make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-20)
}
return bar
}()
lazy var emptyDataTipsView:UIView = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 124))
view.isHidden = true
let imgView = UIImageView(image: UIImage(named: "msg_no_data"))
view.addSubview(imgView)
let label = UILabel()
label.textColor = UIColor(hex: 0x94A3B8)
label.font = UIFont.PFSC_R(ofSize: 14)
label.textAlignment = .center
label.text = "暂无消息".local
view.addSubview(label)
let topMargin = (KScreenHeight-k_Height_NavigationtBarAndStatuBar-k_Height_TabBar-124.0)/2.0
imgView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(topMargin)
make.width.height.equalTo(92)
make.centerX.equalTo(view)
}
label.snp.makeConstraints { make in
make.top.equalTo(imgView.snp.bottom).offset(12)
make.centerX.equalTo(view)
}
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
func setupUI() {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
YHLoginManager.shared.needJumpToMsgTabFlag = false
getUnreadMsgList()
checkNotificationPermisson()
NotificationCenter.default.post(name: YhConstant.YhNotification.didRequestUnreadMsgTotalCountNotification, object: nil)
}
func setupUI() {
addObservers()
gk_navigationBar.isHidden = true
view.backgroundColor = .white
view.addSubview(navBar)
......@@ -68,21 +119,164 @@ class YHMsgViewController: YHBaseViewController {
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
}
}
}
extension YHMsgViewController {
@objc func clean() {
func addObservers() {
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(getUnreadMsgList), name: YhConstant.YhNotification.didRequestUnreadMsgListNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(getUnreadMsgList), name: YhConstant.YhNotification.didRequestUnreadMsgListNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(checkNotificationPermisson), name: YhConstant.YhNotification.didReqeustNotifyPermissionNotification, object: nil)
}
deinit {
NotificationCenter.default.removeObserver(self)
}
@objc func loginSuccess() {
printLog("登录成功,进行相应的 UI刷新操作")
}
@objc func logoutSuccess() {
}
@objc func didCleanButtonClicked() {
let unreadMessages = self.msgArr.filter { $0.unreadCount > 0 }
if unreadMessages.count <= 0 {
YHHUD.flash(message: "暂无未读消息~")
return
}
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
self.markAllMsgsRead()
}
}
@objc func getUnreadMsgList() {
if !YHLoginManager.shared.isLogin() {
return
}
self.viewModel.getUnreadMsgList {
[weak self] success, error in
guard let self = self else { return }
if success {
msgArr.removeAll()
var hasUnreadMsg = false
// 资料填写
if !self.viewModel.msgList.information.lastMessage.isEmpty {
hasUnreadMsg = true
}
// 证件上传
if !self.viewModel.msgList.certificate.lastMessage.isEmpty {
hasUnreadMsg = true
}
// 文书定稿
if !self.viewModel.msgList.draft.lastMessage.isEmpty {
hasUnreadMsg = true
}
// 文件签字
if !self.viewModel.msgList.signature.lastMessage.isEmpty {
hasUnreadMsg = true
}
if hasUnreadMsg {
msgArr.append(self.viewModel.msgList.information)
msgArr.append(self.viewModel.msgList.certificate)
msgArr.append(self.viewModel.msgList.draft)
msgArr.append(self.viewModel.msgList.signature)
}
emptyDataTipsView.isHidden = msgArr.count > 0
self.tableView.reloadData()
}
}
}
func markAllMsgsRead() {
YHHUD.show(.progress(message: "清除中..."))
self.viewModel.readMessages(type:nil, msgIds:nil, isAllRead:true) {
[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
if success {
YHHUD.flash(message: "清除成功")
for item in self.msgArr {
item.unreadCount = 0
}
self.tableView.reloadData()
// 发送清空所有未读消息通知
NotificationCenter.default.post(name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil)
return
}
if let error = error {
var msg = "清除失败"
if error.errorMsg.count > 0 {
msg = error.errorMsg
}
YHHUD.flash(message: msg)
return
}
}
}
@objc func checkNotificationPermisson() {
checkNotificationAuthorizationStatus {
[weak self] granted in
guard let self = self else { return }
DispatchQueue.main.async {
self.isNotifyEnabled = granted
self.tableView.reloadData()
}
}
}
func checkNotificationAuthorizationStatus(_ callBack:((Bool)->())?) {
UNUserNotificationCenter.current().getNotificationSettings { settings in
var enableStatus = false
switch settings.authorizationStatus {
case .authorized:
print("通知已授权")
enableStatus = true
case .denied:
print("通知被拒绝")
enableStatus = false
case .notDetermined:
print("通知权限尚未确定")
enableStatus = false
case .provisional:
print("通知以临时方式授权")
enableStatus = false
case .ephemeral:
enableStatus = false
@unknown default:
break
}
callBack?(enableStatus)
}
}
}
extension YHMessageListVC {
@objc func didEnableNotifyBtnClicked() {
self.goToSettingPage()
}
func goToSettingPage() {
let url = URL(string: UIApplication.openSettingsURLString)
if let url = url, UIApplication .shared.canOpenURL(url) {
UIApplication .shared.open(url, options: [:], completionHandler: {
(success) in
})
}
}
}
extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return msgArr.count
}
......@@ -90,6 +284,10 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMessageSessionCell.cellReuseIdentifier, for: indexPath) as! YHMessageSessionCell
if 0 <= indexPath.row && indexPath.row < msgArr.count {
let model = msgArr[indexPath.row]
cell.updateModel(model)
}
return cell
}
......@@ -99,12 +297,20 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHInformationFillVC()
self.navigationController?.pushViewController(vc)
if 0 <= indexPath.row && indexPath.row < msgArr.count {
let msgItem = msgArr[indexPath.row]
let vc = YHMessageDetailListVC()
vc.type = msgItem.type
vc.title = msgItem.getTitle()
self.navigationController?.pushViewController(vc)
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 42.0
if !isNotifyEnabled {
return 52.0
}
return 1.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
......@@ -118,15 +324,24 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if isNotifyEnabled {
return UIView()
}
let view = UIView()
view.backgroundColor = UIColor(hex: 0x3570DC, alpha: 0.06)
let contentview = UIView()
contentview.backgroundColor = UIColor(hex: 0x3570DC, alpha: 0.06)
view.addSubview(contentview)
contentview.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.bottom.equalToSuperview().offset(-10)
}
let label = UILabel()
label.textColor = UIColor(hex: 0x121A26)
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:13)
label.text = "开启通知,及时掌握最新消息".local
view.addSubview(label)
contentview.addSubview(label)
let enableBtn = UIButton()
enableBtn.setTitle("开启".local, for: .normal)
......@@ -134,19 +349,19 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
enableBtn.titleLabel?.font = .PFSC_R(ofSize: 13)
enableBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 12, left: 20, bottom: 12, right: 20)
enableBtn.addTarget(self, action: #selector(didEnableNotifyBtnClicked), for: .touchUpInside)
view.addSubview(enableBtn)
contentview.addSubview(enableBtn)
label.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalTo(enableBtn.snp.left).offset(-20)
make.centerY.equalToSuperview()
}
enableBtn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: 26, height: 18))
make.size.equalTo(CGSize(width: 26, height: 42.0))
make.right.equalToSuperview().offset(-20)
make.centerY.equalToSuperview()
make.top.bottom.equalToSuperview()
}
return view
}
}
//
// YHMsgListModel.swift
// galaxy
//
// Created by edy on 2024/4/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
enum YHMessageType: Int {
case none = 0
case infoFill = 1 // 资料填写
case cerUpload = 2 // 证件上传
case draft = 3 // 文书定稿
case fileSign = 4 // 文件签字
}
class YHMessageInfoModel: SmartCodable {
var unreadCount: Int = 0
var lastMessage: String = ""
var lastMessageTime: Int = 0
var type: Int = 0
required init() {
}
enum CodingKeys: String, CodingKey {
case unreadCount = "unread_count"
case lastMessage = "last_message"
case lastMessageTime = "last_message_time"
case type = "type"
}
func getTitle() -> String {
if type == YHMessageType.infoFill.rawValue {
return "资料填写"
} else if type == YHMessageType.cerUpload.rawValue {
return "证件上传"
} else if type == YHMessageType.draft.rawValue {
return "文书定稿"
} else if type == YHMessageType.fileSign.rawValue {
return "文件签字"
}
return ""
}
}
class YHMsgListModel: SmartCodable {
var information: YHMessageInfoModel = YHMessageInfoModel()
var certificate: YHMessageInfoModel = YHMessageInfoModel()
var draft: YHMessageInfoModel = YHMessageInfoModel()
var signature: YHMessageInfoModel = YHMessageInfoModel()
required init() {
self.information.type = YHMessageType.infoFill.rawValue
self.certificate.type = YHMessageType.cerUpload.rawValue
self.draft.type = YHMessageType.draft.rawValue
self.signature.type = YHMessageType.fileSign.rawValue
}
}
class YHDetailMessageModel: SmartCodable {
var id: String = ""
var title: String = ""
var content: String = ""
var time: Int = 0
var isRead: Bool = false
var orderId: String = ""
required init() {
}
enum CodingKeys: String, CodingKey {
case id, title, content, time
case isRead = "is_read"
case orderId = "order_id"
}
}
......@@ -9,9 +9,9 @@
import UIKit
import AttributedString
class YHInformationFillCell: UITableViewCell {
class YHDetailMessageCell: UITableViewCell {
static let cellReuseIdentifier = "YHInformationFillCell"
static let cellReuseIdentifier = "YHDetailMessageCell"
static let unreadPointWidth = 6.0
var whiteView:UIView!
......@@ -20,6 +20,8 @@ class YHInformationFillCell: UITableViewCell {
var unreadPointView:UIView!
var bottomBtn:UIButton!
var lineView:UIView!
var timeLabel:UILabel!
var model:YHDetailMessageModel?
required init?(coder: NSCoder) {
super.init(coder: coder)
......@@ -30,10 +32,65 @@ class YHInformationFillCell: UITableViewCell {
setupUI()
}
func updateModel(_ model: YHDetailMessageModel) {
self.model = model
titleLabel.text = model.title
detailLabel.text = model.content
unreadPointView.isHidden = model.isRead
timeLabel.text = formatTimestamp(Double(model.time))
}
func updateBottomBtn(type:Int) {
if type == YHMessageType.infoFill.rawValue {
bottomBtn.setTitle("去填写".local, for: .normal)
} else if type == YHMessageType.cerUpload.rawValue {
bottomBtn.setTitle("去上传".local, for: .normal)
} else if type == YHMessageType.draft.rawValue {
bottomBtn.setTitle("去定稿".local, for: .normal)
} else if type == YHMessageType.fileSign.rawValue {
bottomBtn.setTitle("去签字".local, for: .normal)
}
}
func formatTimestamp(_ timestamp: TimeInterval) -> String {
let currentDate = Date()
let calendar = Calendar.current
let currentYear = calendar.component(.year, from: currentDate)
let currentDay = calendar.component(.day, from: currentDate)
let date = Date(timeIntervalSince1970: timestamp)
let year = calendar.component(.year, from: date)
let day = calendar.component(.day, from: date)
let dateFormatter = DateFormatter()
if year == currentYear {
if day == currentDay {
dateFormatter.dateFormat = "HH:mm"
} else {
dateFormatter.dateFormat = "MM-dd"
}
} else {
dateFormatter.dateFormat = "yyyy-MM-dd"
}
return dateFormatter.string(from: date)
}
func setupUI() {
self.selectionStyle = .none
contentView.backgroundColor = UIColor(hex:0xF8F8F8)
timeLabel = UILabel()
timeLabel.textColor = UIColor(hex: 0x121A26, alpha: 0.3)
timeLabel.textAlignment = .center
timeLabel.font = UIFont.PFSC_R(ofSize:12)
timeLabel.text = "2023-09-13"
contentView.addSubview(timeLabel)
whiteView = UIView()
whiteView.backgroundColor = .white
......@@ -54,10 +111,11 @@ class YHInformationFillCell: UITableViewCell {
unreadPointView.clipsToBounds = true
whiteView.addSubview(unreadPointView)
detailLabel = UILabel()
detailLabel.textAlignment = .left
detailLabel.numberOfLines = 0
detailLabel.font = UIFont.PFSC_R(ofSize:14)
detailLabel.textColor = UIColor(hex: 0x121A26, alpha: 0.7)
whiteView.addSubview(detailLabel)
lineView = UIView()
......@@ -65,16 +123,23 @@ class YHInformationFillCell: UITableViewCell {
whiteView.addSubview(lineView)
bottomBtn = UIButton()
bottomBtn.isUserInteractionEnabled = false
bottomBtn.setTitle("去填写".local, for: .normal)
bottomBtn.setTitleColor(UIColor(hex: 0x3570DC), for: .normal)
bottomBtn.titleLabel?.font = .PFSC_R(ofSize: 14)
bottomBtn.addTarget(self, action: #selector(didBottomBtnClicked), for: .touchUpInside)
whiteView.addSubview(bottomBtn)
timeLabel.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(46.0)
}
whiteView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.top.bottom.equalToSuperview()
make.top.equalTo(timeLabel.snp.bottom)
make.bottom.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
......@@ -107,8 +172,6 @@ class YHInformationFillCell: UITableViewCell {
make.left.right.bottom.equalToSuperview()
make.height.equalTo(52)
}
updateModel()
}
@objc func didBottomBtnClicked() {
......
......@@ -30,6 +30,69 @@ class YHMessageSessionCell: UITableViewCell {
setupUI()
}
func updateModel(_ model: YHMessageInfoModel) {
self.nameLabel.text = model.getTitle()
if model.type == YHMessageType.infoFill.rawValue {
self.iconImgView.image = UIImage(named: "msg_icon_info_fill")
} else if model.type == YHMessageType.cerUpload.rawValue {
self.iconImgView.image = UIImage(named: "msg_icon_cer_upload")
} else if model.type == YHMessageType.draft.rawValue {
self.iconImgView.image = UIImage(named: "msg_icon_draft")
} else if model.type == YHMessageType.fileSign.rawValue {
self.iconImgView.image = UIImage(named: "msg_icon_file_sign")
}
self.badgeLabel.isHidden = model.unreadCount <= 0
let unreadCountText = (model.unreadCount < 100 ? String(model.unreadCount) : "99+")
self.badgeLabel.text = unreadCountText
self.badgeLabel.snp.updateConstraints { make in
var width = badgeHeight
if unreadCountText.count < 2 { // 个位数
width = badgeHeight
} else if unreadCountText.count == 2 { // 两位数
width = 22.0
} else if unreadCountText.count >= 3 { // 三位数
width = 30.0
}
make.width.equalTo(width)
}
self.detailLabel.text = !model.lastMessage.isEmpty ? model.lastMessage : "暂无消息".local
self.timeLabel.text = formatTimestamp(Double(model.lastMessageTime))
self.timeLabel.isHidden = model.lastMessage.isEmpty
}
func formatTimestamp(_ timestamp: TimeInterval) -> String {
let currentDate = Date()
let calendar = Calendar.current
let currentYear = calendar.component(.year, from: currentDate)
let currentDay = calendar.component(.day, from: currentDate)
let date = Date(timeIntervalSince1970: timestamp)
let year = calendar.component(.year, from: date)
let day = calendar.component(.day, from: date)
let dateFormatter = DateFormatter()
if year == currentYear {
if day == currentDay {
dateFormatter.dateFormat = "HH:mm"
} else {
dateFormatter.dateFormat = "MM-dd"
}
} else {
dateFormatter.dateFormat = "yyyy-MM-dd"
}
return dateFormatter.string(from: date)
}
func setupUI() {
self.selectionStyle = .none
......@@ -41,7 +104,6 @@ class YHMessageSessionCell: UITableViewCell {
contentView.addSubview(iconContentView)
iconImgView = UIImageView()
iconImgView.backgroundColor = .red
iconContentView.addSubview(iconImgView)
badgeLabel = UILabel()
......@@ -74,13 +136,8 @@ class YHMessageSessionCell: UITableViewCell {
contentView.addSubview(timeLabel)
bottomLineView = UIView()
bottomLineView.backgroundColor = UIColor(hex: 0xF0F3F7)
bottomLineView.backgroundColor = UIColor(hex:0x121A26,transparency: 0.05)
contentView.addSubview(bottomLineView)
badgeLabel.text = "5"
nameLabel.text = "资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写"
detailLabel.text = "尊敬的用户,您好~很高兴通知您进行资料填写列尊敬的用户,您好~很高兴通知您进行资料填写列尊敬的用户,您好~很高兴通知您进行资料填写列"
timeLabel.text = "2024-01-01"
iconContentView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
......@@ -122,9 +179,8 @@ class YHMessageSessionCell: UITableViewCell {
bottomLineView.snp.makeConstraints { make in
make.left.right.equalTo(detailLabel)
make.height.equalTo(1)
make.height.equalTo(0.5)
make.bottom.equalToSuperview()
}
}
}
//
// YHMsgViewModel.swift
// galaxy
//
// Created by edy on 2024/4/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHMsgViewModel: NSObject {
var msgList: YHMsgListModel = YHMsgListModel()
var msgDetailList : [YHDetailMessageModel] = []
var unreadTotalCount: Int = 0
func getUnreadMsgList(_ callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.unreadMsgListApi
let _ = YHNetRequest.getRequest(url: strUrl) { json, code in
let dic = json.data
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let result = YHMsgListModel.deserialize(dict: dic as? Dictionary ) else {
let error = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false, error)
return
}
self.msgList = result
self.msgList.information.type = YHMessageType.infoFill.rawValue
self.msgList.certificate.type = YHMessageType.cerUpload.rawValue
self.msgList.draft.type = YHMessageType.draft.rawValue
self.msgList.signature.type = YHMessageType.fileSign.rawValue
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { error in
callBackBlock(false, error)
}
}
func getMsgDetailList(type:Int, _ callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.msgDetaiListApi
let params = ["type": type]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { json, code in
let dic = json.data
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let arr = [YHDetailMessageModel].deserialize(array: dic as? [Any]) else {
let error = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
self.msgDetailList = []
callBackBlock(false, error)
return
}
self.msgDetailList.removeAll()
for item in arr {
if let item = item {
self.msgDetailList.append(item)
}
}
callBackBlock(true, nil)
} else {
self.msgDetailList = []
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { error in
self.msgDetailList = []
callBackBlock(false, error)
}
}
func readMessages(type:Int?, msgIds:[Int]?, isAllRead:Bool?, _ callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.readMsgApi
var params:[String : Any] = [:]
if let type = type {
params["type"] = type
}
if let msgIds = msgIds, msgIds.count > 0 {
params["ids"] = msgIds
}
if let isAllRead = isAllRead {
params["all_read"] = isAllRead
}
printLog("params 是 ==> \(params)")
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { json, code in
let dic = json.data
printLog("model 是 ==> \(json)")
if json.code == 200 {
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { error in
callBackBlock(false, error)
}
}
func requestTotalUnreadMsgCount(_ callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.unreadTotalCountApi
let _ = YHNetRequest.getRequest(url: strUrl) {
json, code in
let dic = json.data as? [String : Any]
printLog("model 是 ==> \(json)")
if json.code == 200 {
if let dic = dic, let total = dic["total"] as? Int {
self.unreadTotalCount = total
callBackBlock(true, nil)
} else {
self.unreadTotalCount = 0
callBackBlock(false, nil)
}
} else {
self.unreadTotalCount = 0
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { error in
self.unreadTotalCount = 0
callBackBlock(false, error)
}
}
func requestReportDeviceInfo(deviceId:String, _ callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.reportDeviceInfoApi
let params = ["device_id" : deviceId]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) {
json, code in
let dic = json.data as? [String : Any]
printLog("model 是 ==> \(json)")
if json.code == 200 {
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { error in
callBackBlock(false, error)
}
}
}
......@@ -19,10 +19,10 @@ struct AboutAdvantageItem {
class YHAboutUsViewController: YHBaseViewController {
lazy var items = {
return [AboutAdvantageItem(iconName: "about_match", title: "ABC".local, detail: "大数据精准匹配,专属方案获批率更高", url: ""),
return [AboutAdvantageItem(iconName: "about_match", title: "精准匹配".local, detail: "大数据精准匹配,专属方案获批率更高", url: ""),
AboutAdvantageItem(iconName: "about_response", title: "快速响应", detail: "身份规划师一对一专业服务,第一时间响应您的需求", url: ""),
AboutAdvantageItem(iconName: "about_service", title: "专业服务", detail: "5年经验+英语专8级文案导师团队倾力支持", url: ""),
AboutAdvantageItem(iconName: "about_service2", title: "精准匹配", detail: "香港专才、香港留学获批常年保持90%以上", url: "")]
AboutAdvantageItem(iconName: "about_service2", title: "获批保障", detail: "香港专才、香港留学获批常年保持90%以上", url: "")]
}()
lazy var collectView = {
......@@ -50,9 +50,9 @@ class YHAboutUsViewController: YHBaseViewController {
lazy var aboutLabel = {
var label = UILabel()
label.text = "关于银河".local
label.textColor = UIColor.mainTextColor
label.textColor = UIColor.init(hex: 0x121A26)
label.textAlignment = NSTextAlignment.left
label.font = UIFont.systemFont(ofSize: 20)
label.font = UIFont.PFSC_B(ofSize: 21)
return label
}()
......@@ -62,16 +62,16 @@ class YHAboutUsViewController: YHBaseViewController {
label.numberOfLines = 0
label.textColor = .labelTextColor2
label.textAlignment = NSTextAlignment.left
label.font = UIFont.systemFont(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
lazy var advantageLabel = {
var label = UILabel()
label.text = "四大优势"
label.textColor = UIColor.mainTextColor
label.textColor = UIColor.init(hex: 0x121A26)
label.textAlignment = .center
label.font = UIFont.systemFont(ofSize: 15)
label.font = UIFont.PFSC_B(ofSize: 17)
return label
}()
......@@ -93,14 +93,12 @@ class YHAboutUsViewController: YHBaseViewController {
self.collectView.reloadData()
self.collectView.layoutIfNeeded()
let height = self.collectView.contentSize.height
printLog("self.collectView.contentSize.height = \(height)")
}
func setupUI() {
self.title = "关于我们"
self.gk_navTitle = "关于我们"
view.backgroundColor = .white
view.addSubview(collectView)
......@@ -113,19 +111,19 @@ class YHAboutUsViewController: YHBaseViewController {
aboutLabel.snp.makeConstraints { make in
make.left.equalTo(view).offset(18)
make.right.equalTo(view).offset(-18)
make.top.equalTo(view).offset(k_Height_NavigationtBarAndStatuBar+18)
make.top.equalTo(view).offset(k_Height_NavigationtBarAndStatuBar+16)
}
detailLabel.snp.makeConstraints { make in
make.left.equalTo(view).offset(18)
make.right.equalTo(view).offset(-18)
make.top.equalTo(aboutLabel.snp.bottom).offset(18)
make.top.equalTo(aboutLabel.snp.bottom).offset(12)
}
advantageLabel.snp.makeConstraints { make in
make.centerX.equalTo(view)
make.height.equalTo(40)
make.top.equalTo(detailLabel.snp.bottom).offset(48)
make.top.equalTo(detailLabel.snp.bottom).offset(38)
}
advantageLeftImgView.snp.makeConstraints { make in
......@@ -142,7 +140,7 @@ class YHAboutUsViewController: YHBaseViewController {
collectView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(advantageLabel.snp.bottom).offset(22)
make.top.equalTo(advantageLabel.snp.bottom).offset(18)
}
}
......
......@@ -8,26 +8,25 @@
import UIKit
class YHTestViewController: YHBaseViewController {
class YHDeviceInfoViewController: YHBaseViewController {
lazy var nameLabel: UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor(hex:0x121A26)
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_M(ofSize:15)
nameLabel.numberOfLines = 0
return nameLabel
lazy var deviceInfoLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hex:0x121A26)
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:15)
label.numberOfLines = 0
return label
}()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
view.addSubview(nameLabel)
nameLabel.snp.makeConstraints { make in
view.addSubview(deviceInfoLabel)
deviceInfoLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview()
}
YHHUD.show(.progress(message: "加载中..."))
......@@ -36,14 +35,16 @@ class YHTestViewController: YHBaseViewController {
resCode, registrationID in
YHHUD.hide()
YHLoginManager.shared.userModel?.registerId = registrationID ?? ""
YHLoginManager.shared.deviceTokenModel.registerId = registrationID ?? ""
var info = "deviceToken: \n" + (YHLoginManager.shared.userModel?.deviceToken ?? "")
info += "\nregisterId: \n" + (YHLoginManager.shared.userModel?.registerId ?? "")
var info = "deviceToken: \n" + (YHLoginManager.shared.deviceTokenModel.deviceToken)
info += "\n"
info += "\nregisterId: \n" + (YHLoginManager.shared.deviceTokenModel.registerId)
DispatchQueue.main.async {
self.nameLabel.text = info
self.deviceInfoLabel.text = info
}
}
}
}
......@@ -12,7 +12,12 @@ class YHMyLikeViewController: YHBaseViewController {
let viewModel: YHMyLikeViewModel = YHMyLikeViewModel()
var tableFootView: YHServiceTableFootView!
var id = 1
private let noDataView : YHNoDataTipsView = {
let view = YHNoDataTipsView()
view.tipsLab.text = "暂无数据"
view.isHidden = true
return view
}()
var dataSouce: [YHHomeListModel?] = [] {
didSet {
self.tableFootView.items = dataSouce
......@@ -27,7 +32,7 @@ class YHMyLikeViewController: YHBaseViewController {
} else if id == 2{
title = "我的收藏"
} else {
title = "我的浏览"
title = "浏览记录"
}
gk_navTitle = title
setupUI()
......@@ -44,6 +49,13 @@ extension YHMyLikeViewController {
if id == 1 || id == 2 {
self.viewModel.getList(true ,id) {[weak self] success, error in
guard let self = self else { return }
if self.viewModel.arrHomeNewsData?.count == 0 {
self.tableFootView.isHidden = true
self.noDataView.isHidden = false
} else {
self.tableFootView.isHidden = false
self.noDataView.isHidden = true
}
self.dataSouce = self.viewModel.arrHomeNewsData ?? []
if self.viewModel.hasMoreForHomeNews == false {
self.tableFootView.myCollectView.es.noticeNoMoreData()
......@@ -52,6 +64,13 @@ extension YHMyLikeViewController {
} else {
self.viewModel.getList(true, callBackBlock: {[weak self] success, error in
guard let self = self else { return }
if self.viewModel.arrHomeNewsData?.count == 0 {
self.tableFootView.isHidden = true
self.noDataView.isHidden = false
} else {
self.tableFootView.isHidden = false
self.noDataView.isHidden = true
}
self.dataSouce = self.viewModel.arrHomeNewsData ?? []
if self.viewModel.hasMoreForHomeNews == false {
self.tableFootView.myCollectView.es.noticeNoMoreData()
......@@ -62,28 +81,37 @@ extension YHMyLikeViewController {
func setupUI() {
gk_navBarAlpha = 1
view.backgroundColor = .white
tableFootView = {
let view = YHServiceTableFootView()
view.moreBlock = {[weak self] in
guard let self = self else { return }
if id == 1 || id == 2 {
self.tableFootView.myCollectView.es.stopLoadingMore()
self.viewModel.getList(false ,id) {[weak self] success, error in
guard let self = self else { return }
self.dataSouce = self.viewModel.arrHomeNewsData ?? []
if self.viewModel.hasMoreForHomeNews == false {
self.tableFootView.myCollectView.es.noticeNoMoreData()
}
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.35, execute: {
CATransaction.setDisableActions(true)
self.dataSouce = self.viewModel.arrHomeNewsData ?? []
CATransaction.commit()
self.tableFootView.myCollectView.es.stopLoadingMore()
if self.viewModel.hasMoreForHomeNews == false {
self.tableFootView.myCollectView.es.noticeNoMoreData()
}
})
}
} else {
self.tableFootView.myCollectView.es.stopLoadingMore()
self.viewModel.getList(false, callBackBlock: {[weak self] success, error in
guard let self = self else { return }
self.dataSouce = self.viewModel.arrHomeNewsData ?? []
if self.viewModel.hasMoreForHomeNews == false {
self.tableFootView.myCollectView.es.noticeNoMoreData()
}
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.35, execute: {
CATransaction.setDisableActions(true)
self.dataSouce = self.viewModel.arrHomeNewsData ?? []
CATransaction.commit()
self.tableFootView.myCollectView.es.stopLoadingMore()
if self.viewModel.hasMoreForHomeNews == false {
self.tableFootView.myCollectView.es.noticeNoMoreData()
}
})
})
}
}
......@@ -95,5 +123,13 @@ extension YHMyLikeViewController {
make.bottom.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
}
view.addSubview(noDataView)
noDataView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
make.width.equalTo(KScreenWidth)
make.height.equalTo(150)
}
}
}
......@@ -14,6 +14,7 @@ class YHMyNotifySettingVC: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
......@@ -30,6 +31,11 @@ class YHMyNotifySettingVC: YHBaseViewController {
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
checkNotifyPermission()
}
func setupUI() {
gk_navTitle = "通知设置".local
view.backgroundColor = .white
......@@ -39,6 +45,47 @@ class YHMyNotifySettingVC: YHBaseViewController {
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
}
NotificationCenter.default.addObserver(self, selector: #selector(checkNotifyPermission), name: YhConstant.YhNotification.didReqeustNotifyPermissionNotification, object: nil)
}
@objc func checkNotifyPermission() {
checkNotificationAuthorizationStatus {
[weak self] granted in
guard let self = self else { return }
for item in items {
if item.type == .notify {
item.enableStatus = granted
}
}
DispatchQueue.main.async {
self.tableView.reloadData()
}
}
}
func checkNotificationAuthorizationStatus(_ callBack:((Bool)->())?) {
UNUserNotificationCenter.current().getNotificationSettings { settings in
var enableStatus = false
switch settings.authorizationStatus {
case .authorized:
print("通知已授权")
enableStatus = true
case .denied:
print("通知被拒绝")
enableStatus = false
case .notDetermined:
print("通知权限尚未确定")
enableStatus = false
case .provisional:
print("通知以临时方式授权")
enableStatus = false
case .ephemeral:
enableStatus = false
@unknown default:
break
}
callBack?(enableStatus)
}
}
}
......
......@@ -38,6 +38,7 @@ class YHMyPermissionSettingVC: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
......@@ -68,29 +69,58 @@ class YHMyPermissionSettingVC: YHBaseViewController {
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
}
NotificationCenter.default.addObserver(self, selector: #selector(updateNetWorkStatus), name: .reachabilityChanged, object: nil)
}
@objc func updateNetWorkStatus() {
for item in items {
if item.type == .network {
DispatchQueue.main.async {
item.enableStatus = YHNetworkStatusManager.shared.isNetWorkOK
self.tableView.reloadData()
}
}
}
}
func requestPermission() {
// 获取相册权限
// 1)获取网络状态并更新
updateNetWorkStatus()
// 2)获取相册权限
requestAndUpdatePhotoPermission()
// 3)获取相机权限
requestAndUpdateCameraPermission()
}
func requestAndUpdatePhotoPermission() {
requestPhotoLibraryPermission {
[weak self] grant in
guard let self = self else { return }
for item in items {
if item.type == .photo {
item.enableStatus = grant
self.tableView.reloadData()
DispatchQueue.main.async {
item.enableStatus = grant
self.tableView.reloadData()
}
}
}
}
// 获取相机权限
}
func requestAndUpdateCameraPermission() {
requestCameraPermission {
[weak self] grant in
guard let self = self else { return }
for item in items {
if item.type == .camera {
item.enableStatus = grant
self.tableView.reloadData()
DispatchQueue.main.async {
item.enableStatus = grant
self.tableView.reloadData()
}
}
}
}
......@@ -137,6 +167,10 @@ class YHMyPermissionSettingVC: YHBaseViewController {
completion(false)
}
}
deinit {
NotificationCenter.default.removeObserver(self)
}
}
extension YHMyPermissionSettingVC: UITableViewDelegate, UITableViewDataSource {
......@@ -160,12 +194,40 @@ extension YHMyPermissionSettingVC: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let url = URL(string: UIApplication.openSettingsURLString)
if let url = url, UIApplication .shared.canOpenURL(url) {
UIApplication .shared.open(url, options: [:], completionHandler: {
(success) in
})
if 0 <= indexPath.row && indexPath.row < items.count {
let item = items[indexPath.row]
if item.type == .photo {
let status = PHPhotoLibrary.authorizationStatus()
if status == .notDetermined {
PHPhotoLibrary.requestAuthorization {
authorizationStatus in
self.requestPhotoLibraryPermission {
[weak self] granted in
guard let self = self else { return }
requestAndUpdatePhotoPermission()
}
}
return
}
}
if item.type == .camera {
let status = AVCaptureDevice.authorizationStatus(for: .video)
if status == .notDetermined {
AVCaptureDevice.requestAccess(for: .video) {
[weak self] granted in
guard let self = self else { return }
requestAndUpdateCameraPermission()
}
return
}
}
let url = URL(string: UIApplication.openSettingsURLString)
if let url = url, UIApplication .shared.canOpenURL(url) {
printLog("settingUrl:\(url)")
UIApplication .shared.open(url, options: [:], completionHandler: {
(success) in
})
}
}
}
......
......@@ -11,11 +11,10 @@ import SnapKit
class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget {
let viewModel: YHLoginViewModel = YHLoginViewModel()
lazy var tableView: UITableView = {
let tableView = UITableView(frame: CGRect.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.contentInsetAdjustmentBehavior = .never
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.register(YHMySettingCell.self, forCellReuseIdentifier: YHMySettingCell.cellReuseIdentifier)
......@@ -35,12 +34,35 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
return btn
}()
lazy var versionLabel:UILabel = {
let btn = UILabel()
btn.text = "版本号:V0.1.8测试服"
btn.textColor = UIColor(hex: 0x949DB5, alpha: 1.0)
btn.font = UIFont.PFSC_R(ofSize: 13)
btn.textAlignment = .center
return btn
}()
lazy var items: [PersonalModuleItem] = {
#if DEBUG
return [PersonalModuleItem(title: "通知设置".local, type:.notifySettings),
PersonalModuleItem(title: "权限配置".local, type:.permissionSettings),
PersonalModuleItem(title: "关于我们".local, type:.aboutUs),
PersonalModuleItem(title: "设备相关".local, type:.deviceInfo)]
#elseif TESTENV
return [PersonalModuleItem(title: "通知设置".local, type:.notifySettings),
PersonalModuleItem(title: "权限配置".local, type:.permissionSettings),
PersonalModuleItem(title: "关于我们".local, type:.aboutUs),
PersonalModuleItem(title: "设备相关".local, type:.deviceInfo)]
#else
return [PersonalModuleItem(title: "通知设置".local, type:.notifySettings),
PersonalModuleItem(title: "权限配置".local, type:.permissionSettings),
PersonalModuleItem(title: "个人信息收集清单".local, type:.infoCollectList),
PersonalModuleItem(title: "第三方信息共享清单".local, type:.infoShareList),
// PersonalModuleItem(title: "个人信息收集清单".local, type:.infoCollectList),
// PersonalModuleItem(title: "第三方信息共享清单".local, type:.infoShareList),
PersonalModuleItem(title: "关于我们".local, type:.aboutUs)]
#endif
}()
override func viewDidLoad() {
......@@ -54,25 +76,67 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
self.view.backgroundColor = .white
view.addSubview(tableView)
view.addSubview(logoutBtn)
view.addSubview(versionLabel)
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalToSuperview()
make.bottom.equalTo(logoutBtn.snp.top).offset(-30)
make.bottom.equalTo(versionLabel.snp.top).offset(-30)
}
versionLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.height.equalTo(18)
make.bottom.equalTo(logoutBtn.snp.top).offset(-kMargin)
}
logoutBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.height.equalTo(48.0)
make.bottom.equalToSuperview().offset(-30)
}
#if DEBUG
let version = "版本号:V" + UIDevice.appVersion() + "_" + UIDevice.appBuild() + "开发服"
versionLabel.text = version
#elseif TESTENV
let version = "版本号:V" + UIDevice.appVersion() + "_" + UIDevice.appBuild() + "测试服"
versionLabel.text = version
#else
let version = "版本号:V" + UIDevice.appVersion() + "_" + UIDevice.appBuild()
versionLabel.text = version
#endif
}
@objc func logout() {
YHLoginManager.shared.clearUserInfo()
NotificationCenter.default.post(name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
YHHUD.flash(message: "退出成功")
self.navigationController?.popViewController(animated: true)
YHHUD.show(.progress(message: "退出登录中..."))
self.viewModel.logout() {
[weak self] success, error in
guard let self = self else { return }
YHHUD.hide()
if success {
DispatchQueue.main.async {
YHHUD.flash(message: "退出成功")
YHLoginManager.shared.clearUserInfo()
NotificationCenter.default.post(name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
// 发送清空所有未读消息通知
NotificationCenter.default.post(name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil)
self.navigationController?.popViewController(animated: true)
}
return
}
var msg = "退出失败"
if let error = error, !error.errorMsg.isEmpty {
msg = error.errorMsg
}
YHHUD.flash(message: msg)
}
}
}
......@@ -98,6 +162,7 @@ extension YHMySettingViewController : UITableViewDelegate, UITableViewDataSource
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.row && indexPath.row < items.count {
let item = items[indexPath.row]
if item.type == .notifySettings {
let vc = YHMyNotifySettingVC()
......@@ -110,6 +175,10 @@ extension YHMySettingViewController : UITableViewDelegate, UITableViewDataSource
} else if item.type == .aboutUs {
let vc = YHAboutUsViewController()
self.navigationController?.pushViewController(vc)
} else if item.type == .deviceInfo {
let vc = YHDeviceInfoViewController()
self.navigationController?.pushViewController(vc)
}
}
}
......
......@@ -25,12 +25,15 @@ enum YHPersonalModuleItemType: Int {
case infoCollectList
case infoShareList
case aboutUs
case deviceInfo
}
struct PersonalModuleItem {
class PersonalModuleItem {
var icon: String?
var title: String
var type:YHPersonalModuleItemType = .none
var isShowRedPoint:Bool = false
init(icon: String? = nil, title: String, type:YHPersonalModuleItemType) {
self.icon = icon
self.title = title
......@@ -40,11 +43,12 @@ struct PersonalModuleItem {
class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
let likeViewModel: YHMyLikeViewModel = YHMyLikeViewModel()
let msgViewModel: YHMsgViewModel = YHMsgViewModel()
lazy var tableView: UITableView = {
let tableView = UITableView(frame: CGRect.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionHeaderHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.tableHeaderView = headerView
......@@ -58,18 +62,13 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
}()
lazy var items: [PersonalModuleItem] = {
let version = "app版本号:" + UIDevice.appVersion() + "_" + UIDevice.appBuild()
return [PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage),
PersonalModuleItem(icon: "mine_item_progress", title: "我的进度".local, type:.myProgress),
PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter),
PersonalModuleItem(icon: "mine_item_recommend", title: "推荐有礼".local, type:.recommend),
PersonalModuleItem(icon: "mine_item_poster", title: "我的海报".local, type:.myPoster),
PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode),
PersonalModuleItem(icon: "mine_item_appoint", title: "预约银河湾".local, type:.appointGalaxyBay),
PersonalModuleItem(icon: "mine_item_appoint", title: version, type:.appointGalaxyBay),
]
var arrData = [
PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage),
PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter),
PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode),
PersonalModuleItem(icon: "mine_item_appoint", title: "预约银河湾".local, type:.appointGalaxyBay)
]
return arrData
}()
lazy var headerView: YHUserInfoHeaderView = {
......@@ -125,11 +124,16 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
}
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
initView()
return
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
requestLikeCollectionCount()
getTotalUnreadMsgCount()
}
@objc func clickBtn() {
......@@ -150,6 +154,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
gk_navigationBar.isHidden = true
view.addSubview(tableView)
self.view.backgroundColor = .white
updateUserUI()
......@@ -159,51 +164,56 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
}
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(clearUnreadBadge), name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil)
}
func openXLSXRemoteFile(urlString: String) {
guard let url = URL(string: urlString) else { return }
let configuration = URLSessionConfiguration.default
let session = URLSession(configuration: configuration)
let task = session.downloadTask(with: url) { (tempLocalUrl, response, error) in
if let tempLocalUrl = tempLocalUrl, error == nil {
// 下载完成,尝试打开文件
let fileManager = FileManager.default
let destination = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(response?.suggestedFilename ?? UUID().uuidString)
try? fileManager.moveItem(at: tempLocalUrl, to: destination)
// 打开文件
self.openXLSXFile(at: destination)
} else {
print("Error downloading the file: \(error?.localizedDescription ?? "Unknown error")")
deinit {
NotificationCenter.default.removeObserver(self)
}
func requestLikeCollectionCount() {
self.likeViewModel.getLikeCollectionRecentScanCountInfo {
[weak self] success, error in
guard let self = self else { return }
self.headerView.updateLikeCollectCount(self.likeViewModel.likeCollectCountInfo)
}
}
// 请求未读消息总数
func getTotalUnreadMsgCount() {
if YHLoginManager.shared.isLogin() {
self.msgViewModel.requestTotalUnreadMsgCount {
[weak self] success, error in
guard let self = self else { return }
DispatchQueue.main.async {
let count = self.msgViewModel.unreadTotalCount
for item in self.items {
if item.type == .myMessage {
item.isShowRedPoint = count > 0
break
}
}
self.tableView .reloadData()
}
}
}
task.resume()
}
func openXLSXFile(at fileURL: URL) {
let controller = UIDocumentInteractionController(url: fileURL)
controller.delegate = self
@objc func clearUnreadBadge() {
DispatchQueue.main.async {
controller.presentPreview(animated: true)
for item in self.items {
if item.type == .myMessage {
item.isShowRedPoint = false
break
}
}
self.tableView .reloadData()
}
}
}
extension YHMyViewController: UIDocumentInteractionControllerDelegate {
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
return self
}
}
extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
......@@ -230,6 +240,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
return
<<<<<<< HEAD
} else {
let vc = YHTestViewController()
......@@ -272,41 +283,79 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
} else if item.title == "我的测评码" {
=======
>>>>>>> develop
}
>>>>>>> develop
// if item.title == "关于我们" {
// let vc = YHAboutUsViewController()
// self.navigationController?.pushViewController(vc)
//
// } else if item.title == "我的设置" {
//
// let account = "duyu"
// let token = "123456"
// let vc = ConversationController()
// self.navigationController?.pushViewController(vc)
//
// IMKitClient.instance.loginIM(account, token) { error in
// if let err = error {
// print("login error in app : ", err.localizedDescription)
// }else {
// let _ = NEAtMessageManager.instance
//
// }
// }
//
//
//
// } else {
// let vc = YHLoginViewController()
// self.navigationController?.pushViewController(vc)
// }
let item: PersonalModuleItem = items[indexPath.row]
switch item.type {
case .myMessage://我的消息
printLog("我的消息")
goTabBarBy(tabType: .message)
case .scoreCenter:////积分中心
printLog("积分中心")
if let param = YHLoginManager.shared.userModel?.token,param.count>5 {
printLog(param)
var token : String = param
var url = YHBaseUrlManager.shared.curH5URL() + "superApp/integral"
let addtionString = randomAlphanumericString(6)//随机6个字母或者数字
let indexToInsert = token.index(token.startIndex, offsetBy: 6) //插入位置,这里以第六个字符后面为例
token.insert(contentsOf: addtionString, at: indexToInsert)
url = url + "?param=" + token
let vc = YHHomeWebViewController()
vc.vcTitle = "积分中心"
vc.url = url
self.navigationController?.pushViewController(vc)
}
case .myTestCode://我的测评码
printLog("我的测评码")
let vc = YHHomeWebViewController()
vc.vcTitle = "香港身份测评码"
vc.showSavePicBottomFlag = true
vc.url = "https://cdn-public.galaxy-immi.com/app/cepingma.png"
self.navigationController?.pushViewController(vc)
case .appointGalaxyBay://预约银河湾
printLog("预约银河湾")
let vc = YHHomeWebViewController()
vc.vcTitle = "预约银河湾"
vc.url = "https://upload.cdn.galaxy-immi.com/sell/product/images/page-1686138671996.png"
self.navigationController?.pushViewController(vc)
default:
printLog("不需要响应")
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
}
extension YHMyViewController {
func randomAlphanumericString(_ length: Int) -> String {
let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let randomString = (0..<length).map{ _ in String(letters.randomElement()!) }.reduce("", +)
return randomString
}
@objc func loginSuccess() {
printLog("登录成功,进行相应的 UI刷新操作")
updateUserUI()
......
//
// YHCollectionModel.swift
// galaxy
//
// Created by edy on 2024/4/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
struct YHCollectionModel: SmartCodable {
var myCollectCount: Int = 0
var myLikeCount: Int = 0
var myViewCount: Int = 0
enum CodingKeys: String, CodingKey {
case myCollectCount = "my_collect_count"
case myLikeCount = "my_like_count"
case myViewCount = "my_view_count"
}
}
......@@ -30,20 +30,18 @@ class YHAboutUsAdvantageCell: UICollectionViewCell {
lazy var titleLabel:UILabel = {
let label = UILabel()
label.text = "是的发放"
label.textColor = UIColor(hexString:"#333333")
label.textColor = UIColor.init(hex: 0x121A26)
label.textAlignment = .center
label.font = UIFont.systemFont(ofSize: 14)
label.font = UIFont.PFSC_B(ofSize: 14)
return label
}()
lazy var detailLabel:UILabel = {
let label = UILabel()
label.text = "sdfasfdasfasdfasfasdfasdfsafasdfasdfasdfasfdas"
label.textColor = .labelTextColor2
label.textColor = UIColor(hex: 0x121A2680, alpha: 0.5)
label.numberOfLines = 0
label.textAlignment = .center
label.font = UIFont.systemFont(ofSize: 12)
label.font = UIFont.PFSC_R(ofSize: 11)
return label
}()
......@@ -60,7 +58,7 @@ class YHAboutUsAdvantageCell: UICollectionViewCell {
func setupUI() {
contentView.backgroundColor = UIColor(hexString: "#F8F9FB")
contentView.backgroundColor = UIColor.init(hex: 0xF8FAFB)
contentView.layer.cornerRadius = 4
contentView.clipsToBounds = true
......@@ -81,9 +79,9 @@ class YHAboutUsAdvantageCell: UICollectionViewCell {
}
detailLabel.snp.makeConstraints { make in
make.left.equalTo(contentView).offset(5)
make.right.equalTo(contentView).offset(-5)
make.top.equalTo(titleLabel.snp.bottom).offset(8)
make.left.equalTo(contentView).offset(15)
make.right.equalTo(contentView).offset(-15)
make.top.equalTo(titleLabel.snp.bottom).offset(6)
make.bottom.equalTo(contentView).offset(-5)
}
}
......
......@@ -11,7 +11,8 @@ import SnapKit
class YHPersonalCenterCell: UITableViewCell {
static let cellReuseIdentifier = "YHPersonalCenterCell"
static let redPointWidth = 6.0
lazy var iconImgView:UIImageView = {
let icon = UIImageView(image: UIImage(named: "mine_manager"))
return icon
......@@ -25,6 +26,14 @@ class YHPersonalCenterCell: UITableViewCell {
return label
}()
lazy var redPointView:UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0xF81D22)
view.layer.cornerRadius = Self.redPointWidth/2.0
view.clipsToBounds = true
return view
}()
lazy var arrowImgView:UIImageView = {
let arrowImgView = UIImageView(image: UIImage(named: "mine_arrow_right"))
return arrowImgView
......@@ -46,6 +55,7 @@ class YHPersonalCenterCell: UITableViewCell {
iconImgView.image = nil
}
titleLabel.text = item.title;
redPointView.isHidden = !item.isShowRedPoint
}
func setupUI() {
......@@ -56,6 +66,7 @@ class YHPersonalCenterCell: UITableViewCell {
contentView.addSubview(iconImgView)
contentView.addSubview(titleLabel)
contentView.addSubview(arrowImgView)
contentView.addSubview(redPointView)
iconImgView.snp.makeConstraints { make in
make.left.equalTo(contentView.snp.left).offset(27)
......@@ -66,7 +77,13 @@ class YHPersonalCenterCell: UITableViewCell {
titleLabel.snp.makeConstraints { make in
make.centerY.equalTo(contentView)
make.left.equalTo(iconImgView.snp.right).offset(10)
make.right.equalTo(arrowImgView.snp.left).offset(-20)
make.right.equalTo(redPointView.snp.left).offset(-5)
}
redPointView.snp.makeConstraints { make in
make.width.height.equalTo(Self.redPointWidth)
make.centerY.equalToSuperview()
make.right.equalTo(arrowImgView.snp.left).offset(-5)
}
arrowImgView.snp.makeConstraints { make in
......
......@@ -178,9 +178,23 @@ class YHUserInfoHeaderView: UIView {
return view
}
func updateLikeCollectCount(_ model: YHCollectionModel) {
let likeCount = showCount(model.myLikeCount)
let collectCount = showCount(model.myCollectCount)
let scanCount = showCount(model.myViewCount)
self.likeLabel.text = "点赞 \(likeCount)"
self.collectLabel.text = "收藏 \(collectCount)"
self.scanLabel.text = "最近浏览 \(scanCount)"
}
func showCount(_ count: Int)-> String {
return count < 10000 ? String(count) : String(format: "%.1fw", Double(count/1000)/10.0)
}
private func createUI() {
self.addSubview(bgImgView)
self.addSubview(settingView)
settingView.addSubview(settingBtn)
......
......@@ -10,9 +10,9 @@ import UIKit
class YHMyLikeViewModel: YHBaseViewModel {
var arrHomeNewsData: [YHHomeListModel]?
var likeCollectCountInfo: YHCollectionModel = YHCollectionModel()
private var curPageIndex : Int = 1
private var page_Size : Int = 6
private var page_Size : Int = 10
private var totalCount : Int = 0
var hasMoreForHomeNews : Bool = true
}
......@@ -32,7 +32,6 @@ extension YHMyLikeViewModel {
params = ["page": curPageIndex + 1,
"page_size": page_Size,
"operate_type": type]
curPageIndex = curPageIndex + 1
}
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.user
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
......@@ -55,10 +54,11 @@ extension YHMyLikeViewModel {
self.arrHomeNewsData = result.data
} else {
self.arrHomeNewsData?.append(contentsOf: result.data)
curPageIndex = curPageIndex + 1
}
if let count = self.arrHomeNewsData?.count {
if count == self.totalCount {
if count >= self.totalCount {
self.hasMoreForHomeNews = false
} else {
self.hasMoreForHomeNews = true
......@@ -87,7 +87,6 @@ extension YHMyLikeViewModel {
} else {
params = ["page": curPageIndex + 1,
"page_size": page_Size]
curPageIndex = curPageIndex + 1
}
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.userLook
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
......@@ -110,10 +109,11 @@ extension YHMyLikeViewModel {
self.arrHomeNewsData = result.data
} else {
self.arrHomeNewsData?.append(contentsOf: result.data)
curPageIndex = curPageIndex + 1
}
if let count = self.arrHomeNewsData?.count {
if count == self.totalCount {
if count >= self.totalCount {
self.hasMoreForHomeNews = false
} else {
self.hasMoreForHomeNews = true
......@@ -130,4 +130,30 @@ extension YHMyLikeViewModel {
callBackBlock(false,err)
}
}
// 获取点赞、收藏、最近浏览数量
func getLikeCollectionRecentScanCountInfo(callBack:((_ success: Bool,_ error:YHErrorModel?)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.likeCollect
let _ = YHNetRequest.getRequest(url: strUrl) { [weak self] json, code in
guard let self = self else { return }
//1. json字符串 转 对象
if json.code == 200 {
let dic = json.data
guard let result = YHCollectionModel.deserialize(dict: dic as? Dictionary ) else {
let error = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBack?(false, error)
return
}
self.likeCollectCountInfo = result as YHCollectionModel
callBack?(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBack?(false, error)
}
} failBlock: { err in
callBack?(false,err)
}
}
}
......@@ -12,10 +12,10 @@ import UIKit
extension UIColor {
//品牌主色
static let brandMainColor : UIColor = UIColor(hexString: "#2F7EF6")!
static let brandMainColor : UIColor = UIColor(hexString: "#3570DC")!
//品牌渐变色
static let arrBrandGradaterColors : [UIColor] = [UIColor(hexString: "#2274EE")!,UIColor(hexString: "#3A85FC")!]
static let arrBrandGradaterColors : [UIColor] = [UIColor(hexString: "#3570DC")!,UIColor(hexString: "#3A85FC")!]
//品牌主色 16
static let brandMainColor16 : UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.16)!
......
//
// YHViewController.swift
// galaxy
//
// Created by EDY on 2024/4/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
extension UIScrollView {
// 解决有UIScrollView时不能在屏幕左边侧滑返回
open override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
// 过滤UITextView(因为UITextView继承自UIScrollView),否则会引起崩溃
if (gestureRecognizer.view?.isMember(of: UITextView.self))! {
return true
}
let velocity = (gestureRecognizer as! UIPanGestureRecognizer).velocity(in: self)
let location = gestureRecognizer.location(in: self)
if (velocity.x > 0.0 && Int(location.x) % Int(UIScreen.main.bounds.size.width) < 60) {
return false
}
return true
}
}
......@@ -196,5 +196,17 @@ extension YhConstant {
//首页刷新通知
public static let refreshHomePageNotifiction = Notification.Name(rawValue: "com.yinhe.homePage.refresh")
//清空所有未读消息数
public static let didMarkAllMessagesReadedNotifiction = Notification.Name(rawValue: "com.yinhe.msgPage.readAll")
// 请求消息未读总数通知
public static let didRequestUnreadMsgTotalCountNotification = Notification.Name(rawValue: "com.yinhe.msgPage.unreadMsgTotal")
// 请求消息未读列表通知
public static let didRequestUnreadMsgListNotification = Notification.Name(rawValue: "com.yinhe.msgPage.unreadList")
// 请求通知权限通知
public static let didReqeustNotifyPermissionNotification = Notification.Name(rawValue: "com.yinhe.msgPage.notifyPermission")
}
}
......@@ -32,6 +32,8 @@ class YHAllApiName {
static let userLook = "infoflow/user/view"
//获取香港办事
static let hklist = "infoflow/tool/list"
// 点赞、收藏、最近浏览数量
static let likeCollect = "infoflow/article/myArticleRecord"
}
//order 模块
......@@ -59,6 +61,8 @@ class YHAllApiName {
//保存其他资料信息
static let updateOtherInfoApi = "infoflow/order/updateOrderOtherInformation"
//服务中心进度列表
static let serviceCenterProgressApi = "infoflow/order/service-list"
}
struct Family {
......@@ -158,6 +162,7 @@ class YHAllApiName {
//登录
struct Auth {
static let login = "infoflow/auth/login"
static let logout = "infoflow/auth/logout"
}
//获取验证
......@@ -252,4 +257,18 @@ class YHAllApiName {
//方案计划
static let applyPlanApi = "infoflow/assessment/apply_plan"
}
// 消息
struct Message {
// 获取未读消息列表
static let unreadMsgListApi = "infoflow/unread-message"
// 具体业务消息列表
static let msgDetaiListApi = "infoflow/message/list"
// 标记消息已读
static let readMsgApi = "infoflow/read-push"
// 获取未读消息总数
static let unreadTotalCountApi = "infoflow/unread-total"
// 报备设备信息
static let reportDeviceInfoApi = "infoflow/report-device-info"
}
}
......@@ -12,34 +12,28 @@ class YHBaseUrlManager {
static let shared = YHBaseUrlManager()
//测试环境
static let baseUrlTest : String = "https://test-app-go-api.galaxy-immi.com/" //APP 使用域名
static let baseUrlTest : String = "https://test-app-go-api.galaxy-immi.com" //APP 使用域名
//正式环境
static let baseUrlRelease : String = "https://app-go-api.galaxy-immi.com/"
//测试环境-OSS
static let baseOSSUrlTest : String = "https://test-comserver.galaxy-immi.com/"
//正式环境-OSS
static let baseOSSUrlRelease : String = "http://comserver.galaxy-immi.com/"
static let baseUrlRelease : String = "https://app-go-api.galaxy-immi.com"
func curURL() -> String {
#if DEBUG
return YHBaseUrlManager.baseUrlTest
return YHBaseUrlManager.baseUrlTest + "/"
#elseif TESTENV
return YHBaseUrlManager.baseUrlTest
return YHBaseUrlManager.baseUrlTest + "/"
#else
return YHBaseUrlManager.baseUrlRelease
return YHBaseUrlManager.baseUrlRelease + "/"
#endif
}
//ossUrl
func curOssURL() -> String {
#if DEBUG
return YHBaseUrlManager.baseOSSUrlTest
#elseif TESTENV
return YHBaseUrlManager.baseOSSUrlTest
#else
return YHBaseUrlManager.baseOSSUrlRelease
#endif
return YHConfigManager.shared.ossUrl
}
//h5Url
func curH5URL() -> String {
return YHConfigManager.shared.h5Url
}
}
......@@ -81,6 +81,9 @@ class YHNetRequest: NSObject {
requestHeader.add(name:"appid",value:"1")
let dateStr = String(Date().timeIntervalSince1970)
requestHeader.add(name:"timestamp",value:dateStr)
requestHeader.add(name:"appPlatform",value:"iOS")
let version = UIDevice.appVersion()
requestHeader.add(name:"appVersion",value:version)
requestHeader.add(name:"pass",value:"")
let appkey = "958364f87222c200a72414f492bf0e26"
......@@ -90,6 +93,9 @@ class YHNetRequest: NSObject {
requestHeader.add(name:"sign",value:sign)
requestHeader.add(name: "token", value: YHLoginManager.shared.userModel?.token ?? "-")
if !YHLoginManager.shared.deviceTokenModel.registerId.isEmpty {
requestHeader.add(name: "device-id", value: YHLoginManager.shared.deviceTokenModel.registerId)
}
// requestHeader.add(name: "token", value: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTI0NjA1NzQsImkiOjk4OTcwNDI5NjA3NzI0OSwidSI6IumTtuays-mbhuWboiIsInIiOiJzdXBlcl9hcHAifQ.jyBpXSii6nlRIITdOya3GQa5eb5G42Jh9nj39Cncwl8")
......@@ -284,6 +290,18 @@ class YHNetRequest: NSObject {
#if DEBUG
printLog("服务器返回数据是:\(obj)")
#endif
if obj.code == 10010 {
DispatchQueue.main.async {
YHLoginManager.shared.clearUserInfo()
YHHUD.flash(message: "登录状态失效")
// 发送清空所有红点通知
NotificationCenter.default.post(name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil)
UIViewController.current?.navigationController?.popToRootViewController(animated: false)
goTabBarBy(tabType: .home)
YHHUD.hide()
}
return
}
guard let suclock = self.success else { return }
suclock(obj, statusCode)
} else {
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "摄图网_501771221_家庭亲子户外露营玩耍(企业商用) 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "摄图网_501771221_家庭亲子户外露营玩耍(企业商用) 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Frame 1@2x.png",
"filename" : "Group 2033194158@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 1@3x.png",
"filename" : "Group 2033194158@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "a1ee8b3bd2c4f4969fd48d8db3c66fd 93@2x.png",
"filename" : "Message_zhengjian@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "a1ee8b3bd2c4f4969fd48d8db3c66fd 93@3x.png",
"filename" : "Message_zhengjian@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "fa969293-cb4c-490e-b597-3345266ff912 54@2x.png",
"filename" : "icon-wenshuqingdan@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "fa969293-cb4c-490e-b597-3345266ff912 54@3x.png",
"filename" : "icon-wenshuqingdan@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon-wenshuqingdan@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon-wenshuqingdan@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033194489@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033194489@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 3112@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3112@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "list_no_data@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "list_no_data@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_center_head_bkg4@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_center_head_bkg4@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "更多内容敬请期待@2x.png",
"filename" : "Group 3098@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "更多内容敬请期待@3x.png",
"filename" : "Group 3098@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_name_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_name_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_no_order_alert@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_no_order_alert@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_progress_end@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_progress_end@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_progress_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_progress_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_progress_start@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_progress_start@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "摄图网_501771221_家庭亲子户外露营玩耍(企业商用) 1@2x.png",
"filename" : "启动页@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "摄图网_501771221_家庭亲子户外露营玩耍(企业商用) 1@3x.png",
"filename" : "启动页@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "超级app启动页占位图.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "启动页@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "启动页@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"filename" : "tab_home_Unchecked@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"filename" : "tab_home_Unchecked@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"filename" : "tab_home@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"filename" : "tab_home@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"filename" : "tab_wode_Unchecked@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"filename" : "tab_wode_Unchecked@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"filename" : "tab_wode@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"filename" : "tab_wode@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"filename" : "tab_Message_Unchecked@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"filename" : "tab_Message_Unchecked@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"filename" : "tab_Message@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"filename" : "tab_Message@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"filename" : "tab_service_Unchecked@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"filename" : "tab_service_Unchecked@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"filename" : "tab_service@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"filename" : "tab_service@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -2,81 +2,75 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>UIAppFonts</key>
<array>
<string>DIN Alternate Bold</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
<key>NSFileProviderDomainUsageDescription</key>
<string>需要访问您的文件以选择和上传</string>
<key>UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>PDF Document</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>com.adobe.pdf</string>
</array>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>JPEG Image</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>public.jpeg</string>
</array>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>PNG Image</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>public.png</string>
</array>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>Microsoft Word Document</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>org.openxmlformats.wordprocessingml.document</string>
<string>com.microsoft.word.doc</string>
</array>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>Microsoft PowerPoint Presentation</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>org.openxmlformats.presentationml.presentation</string>
<string>com.microsoft.powerpoint.ppt</string>
</array>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIAppFonts</key>
<array>
<string>DIN Alternate Bold</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
</dict>
</plist>
......@@ -47,7 +47,7 @@
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "无更多数据"
"value" : "没有更多了~"
}
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>production</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>production</string>
</dict>
</plist>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment