5个文件已删除
1 文件已重命名
38个文件已修改
6 文件已复制
36个文件已添加
| | |
| | | 1896F2731FD0EDB5009D6EEF /* OtherCouponViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1896F2711FD0EDB5009D6EEF /* OtherCouponViewController.xib */; }; |
| | | 1896F2811FD10437009D6EEF /* CoupleCollectionReusableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1896F27F1FD10437009D6EEF /* CoupleCollectionReusableView.m */; }; |
| | | 1896F2821FD10437009D6EEF /* CoupleCollectionReusableView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1896F2801FD10437009D6EEF /* CoupleCollectionReusableView.xib */; }; |
| | | 189711CE1FCF9B1200B5393A /* MineToolBarTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 189711CC1FCF9B1200B5393A /* MineToolBarTableViewCell.m */; }; |
| | | 189711CF1FCF9B1200B5393A /* MineToolBarTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 189711CD1FCF9B1200B5393A /* MineToolBarTableViewCell.xib */; }; |
| | | 189711D21FCFA16600B5393A /* ZXButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 189711D11FCFA16600B5393A /* ZXButton.m */; }; |
| | | 189711DE1FD0090400B5393A /* CollectionViewHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 189711D71FD0090300B5393A /* CollectionViewHeaderView.m */; }; |
| | | 189711DF1FD0090400B5393A /* LJCollectionViewFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 189711DA1FD0090300B5393A /* LJCollectionViewFlowLayout.m */; }; |
| | |
| | | 2D00BC78211A9A7300C129D7 /* NEWHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D00BC77211A9A7200C129D7 /* NEWHomeViewController.m */; }; |
| | | 2D08C10B20BFCE2C00A2423B /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D08C10820BFCE2900A2423B /* LoginViewController.m */; }; |
| | | 2D08C10C20BFCE2C00A2423B /* LoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2D08C10920BFCE2B00A2423B /* LoginViewController.xib */; }; |
| | | 2D09AC63212A5AAB000F4160 /* ALNetWorking.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D09AC62212A5AAB000F4160 /* ALNetWorking.m */; }; |
| | | 2D09AC66212ABB51000F4160 /* MineToolBarTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D09AC65212ABB51000F4160 /* MineToolBarTableViewCell.m */; }; |
| | | 2D0A297720C54CAF00A51A55 /* SJRemoveBoundView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0A297620C54CAF00A51A55 /* SJRemoveBoundView.m */; }; |
| | | 2D0D7D1220BFF51B009D5D48 /* MineThirdTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0D7D1020BFF51B009D5D48 /* MineThirdTableViewCell.m */; }; |
| | | 2D0D7D1320BFF51B009D5D48 /* MineThirdTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2D0D7D1120BFF51B009D5D48 /* MineThirdTableViewCell.xib */; }; |
| | |
| | | 2D1175B121199F4000D4CD0F /* ObtainProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D1175AB21199F3F00D4CD0F /* ObtainProperty.m */; }; |
| | | 2D1175B221199F4000D4CD0F /* PlistFileOperator.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D1175AC21199F3F00D4CD0F /* PlistFileOperator.m */; }; |
| | | 2D1175B321199F4000D4CD0F /* FileOperator.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D1175AE21199F4000D4CD0F /* FileOperator.m */; }; |
| | | 2D15A76D212D3640005C0CAC /* ShareAppView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D15A76C212D3640005C0CAC /* ShareAppView.m */; }; |
| | | 2D15A771212D3FEE005C0CAC /* ShareAppCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D15A770212D3FEE005C0CAC /* ShareAppCell.m */; }; |
| | | 2D1C962A20DF5EDF00D6DBDC /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D1C962920DF5EDE00D6DBDC /* CoreMotion.framework */; }; |
| | | 2D222B1E20C77D7200D444C3 /* UIViewController+Tools.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D222B1D20C77D7100D444C3 /* UIViewController+Tools.m */; }; |
| | | 2D2392DD2105ABC900C78B5F /* CustomProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D2392DC2105ABC900C78B5F /* CustomProgressHUD.m */; }; |
| | | 2D2392E02105B1FB00C78B5F /* Algorithm.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D2392DF2105B1FB00C78B5F /* Algorithm.m */; }; |
| | | 2D24A114212BBEDD00BEC4BB /* SearchCouponView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D24A113212BBEDD00BEC4BB /* SearchCouponView.m */; }; |
| | | 2D24A11E212C16F100BEC4BB /* HZPhotoBrowser.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2D24A116212C16F100BEC4BB /* HZPhotoBrowser.bundle */; }; |
| | | 2D24A11F212C16F100BEC4BB /* HZPhotoBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D24A118212C16F100BEC4BB /* HZPhotoBrowser.m */; }; |
| | | 2D24A120212C16F100BEC4BB /* HZPhotoBrowserView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D24A11B212C16F100BEC4BB /* HZPhotoBrowserView.m */; }; |
| | | 2D24A121212C16F100BEC4BB /* HZWaitingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D24A11D212C16F100BEC4BB /* HZWaitingView.m */; }; |
| | | 2D37FC4420C0E1AB00E11051 /* AddIncarnateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D37FC4220C0E1AB00E11051 /* AddIncarnateViewController.m */; }; |
| | | 2D37FC4520C0E1AB00E11051 /* AddIncarnateViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2D37FC4320C0E1AB00E11051 /* AddIncarnateViewController.xib */; }; |
| | | 2D37FC4920C0F75000E11051 /* ModifyAccountViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D37FC4720C0F75000E11051 /* ModifyAccountViewController.m */; }; |
| | |
| | | 2D9F158D2117E8E800EFFAFB /* test.html in Resources */ = {isa = PBXBuildFile; fileRef = 2D9F15862117E8E800EFFAFB /* test.html */; }; |
| | | 2D9F15902117E91400EFFAFB /* ShonpingShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9F158F2117E91400EFFAFB /* ShonpingShareViewController.m */; }; |
| | | 2D9F279620E2404200643E5A /* Mainhot.gif in Resources */ = {isa = PBXBuildFile; fileRef = 2D9F279520E2404100643E5A /* Mainhot.gif */; }; |
| | | 2DD814D2212E47BD0029B5D7 /* MainBaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DD814D1212E47BD0029B5D7 /* MainBaseController.m */; }; |
| | | 2DD814D8212E499B0029B5D7 /* ALBaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DD814D7212E499B0029B5D7 /* ALBaseController.m */; }; |
| | | 2DEAE78220EC6748003349B4 /* SJNetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DEAE78120EC6748003349B4 /* SJNetwork.m */; }; |
| | | 2DEF568120FF20990071C985 /* SJTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DEF568020FF20990071C985 /* SJTipView.m */; }; |
| | | 2DEF568420FF36620071C985 /* SJBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DEF568320FF36620071C985 /* SJBaseViewController.m */; }; |
| | |
| | | 1896F27E1FD10437009D6EEF /* CoupleCollectionReusableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CoupleCollectionReusableView.h; sourceTree = "<group>"; }; |
| | | 1896F27F1FD10437009D6EEF /* CoupleCollectionReusableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CoupleCollectionReusableView.m; sourceTree = "<group>"; }; |
| | | 1896F2801FD10437009D6EEF /* CoupleCollectionReusableView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CoupleCollectionReusableView.xib; sourceTree = "<group>"; }; |
| | | 189711CB1FCF9B1200B5393A /* MineToolBarTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MineToolBarTableViewCell.h; sourceTree = "<group>"; }; |
| | | 189711CC1FCF9B1200B5393A /* MineToolBarTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MineToolBarTableViewCell.m; sourceTree = "<group>"; }; |
| | | 189711CD1FCF9B1200B5393A /* MineToolBarTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MineToolBarTableViewCell.xib; sourceTree = "<group>"; }; |
| | | 189711D01FCFA16600B5393A /* ZXButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXButton.h; sourceTree = "<group>"; }; |
| | | 189711D11FCFA16600B5393A /* ZXButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXButton.m; sourceTree = "<group>"; }; |
| | | 189711D61FD0090300B5393A /* CollectionViewHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CollectionViewHeaderView.h; path = "MIduo/çé¢/é¦é¡µ/CollectionViewHeaderView.h"; sourceTree = SOURCE_ROOT; }; |
| | |
| | | 2D08C10820BFCE2900A2423B /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; }; |
| | | 2D08C10920BFCE2B00A2423B /* LoginViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LoginViewController.xib; sourceTree = "<group>"; }; |
| | | 2D08C10A20BFCE2C00A2423B /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = "<group>"; }; |
| | | 2D09AC61212A5AAB000F4160 /* ALNetWorking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALNetWorking.h; sourceTree = "<group>"; }; |
| | | 2D09AC62212A5AAB000F4160 /* ALNetWorking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ALNetWorking.m; sourceTree = "<group>"; }; |
| | | 2D09AC64212ABB51000F4160 /* MineToolBarTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MineToolBarTableViewCell.h; sourceTree = "<group>"; }; |
| | | 2D09AC65212ABB51000F4160 /* MineToolBarTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MineToolBarTableViewCell.m; sourceTree = "<group>"; }; |
| | | 2D0A297520C54CAF00A51A55 /* SJRemoveBoundView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SJRemoveBoundView.h; sourceTree = "<group>"; }; |
| | | 2D0A297620C54CAF00A51A55 /* SJRemoveBoundView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SJRemoveBoundView.m; sourceTree = "<group>"; }; |
| | | 2D0D7D0F20BFF51B009D5D48 /* MineThirdTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MineThirdTableViewCell.h; sourceTree = "<group>"; }; |
| | |
| | | 2D1175AE21199F4000D4CD0F /* FileOperator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileOperator.m; sourceTree = "<group>"; }; |
| | | 2D1175AF21199F4000D4CD0F /* PlistFileOperator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlistFileOperator.h; sourceTree = "<group>"; }; |
| | | 2D1175B021199F4000D4CD0F /* ObtainProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObtainProperty.h; sourceTree = "<group>"; }; |
| | | 2D15A76B212D3640005C0CAC /* ShareAppView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareAppView.h; sourceTree = "<group>"; }; |
| | | 2D15A76C212D3640005C0CAC /* ShareAppView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareAppView.m; sourceTree = "<group>"; }; |
| | | 2D15A76F212D3FEE005C0CAC /* ShareAppCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareAppCell.h; sourceTree = "<group>"; }; |
| | | 2D15A770212D3FEE005C0CAC /* ShareAppCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareAppCell.m; sourceTree = "<group>"; }; |
| | | 2D1C962920DF5EDE00D6DBDC /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; |
| | | 2D222B1C20C77D7000D444C3 /* UIViewController+Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+Tools.h"; sourceTree = "<group>"; }; |
| | | 2D222B1D20C77D7100D444C3 /* UIViewController+Tools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+Tools.m"; sourceTree = "<group>"; }; |
| | |
| | | 2D2392DC2105ABC900C78B5F /* CustomProgressHUD.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomProgressHUD.m; sourceTree = "<group>"; }; |
| | | 2D2392DE2105B1FA00C78B5F /* Algorithm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Algorithm.h; sourceTree = "<group>"; }; |
| | | 2D2392DF2105B1FB00C78B5F /* Algorithm.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Algorithm.m; sourceTree = "<group>"; }; |
| | | 2D24A112212BBEDD00BEC4BB /* SearchCouponView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SearchCouponView.h; sourceTree = "<group>"; }; |
| | | 2D24A113212BBEDD00BEC4BB /* SearchCouponView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SearchCouponView.m; sourceTree = "<group>"; }; |
| | | 2D24A116212C16F100BEC4BB /* HZPhotoBrowser.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = HZPhotoBrowser.bundle; sourceTree = "<group>"; }; |
| | | 2D24A117212C16F100BEC4BB /* HZPhotoBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HZPhotoBrowser.h; sourceTree = "<group>"; }; |
| | | 2D24A118212C16F100BEC4BB /* HZPhotoBrowser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZPhotoBrowser.m; sourceTree = "<group>"; }; |
| | | 2D24A119212C16F100BEC4BB /* HZPhotoBrowserConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HZPhotoBrowserConfig.h; sourceTree = "<group>"; }; |
| | | 2D24A11A212C16F100BEC4BB /* HZPhotoBrowserView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HZPhotoBrowserView.h; sourceTree = "<group>"; }; |
| | | 2D24A11B212C16F100BEC4BB /* HZPhotoBrowserView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZPhotoBrowserView.m; sourceTree = "<group>"; }; |
| | | 2D24A11C212C16F100BEC4BB /* HZWaitingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HZWaitingView.h; sourceTree = "<group>"; }; |
| | | 2D24A11D212C16F100BEC4BB /* HZWaitingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZWaitingView.m; sourceTree = "<group>"; }; |
| | | 2D37FC4120C0E1AB00E11051 /* AddIncarnateViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AddIncarnateViewController.h; sourceTree = "<group>"; }; |
| | | 2D37FC4220C0E1AB00E11051 /* AddIncarnateViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AddIncarnateViewController.m; sourceTree = "<group>"; }; |
| | | 2D37FC4320C0E1AB00E11051 /* AddIncarnateViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AddIncarnateViewController.xib; sourceTree = "<group>"; }; |
| | |
| | | 2D9F158E2117E91400EFFAFB /* ShonpingShareViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShonpingShareViewController.h; sourceTree = "<group>"; }; |
| | | 2D9F158F2117E91400EFFAFB /* ShonpingShareViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShonpingShareViewController.m; sourceTree = "<group>"; }; |
| | | 2D9F279520E2404100643E5A /* Mainhot.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Mainhot.gif; sourceTree = "<group>"; }; |
| | | 2DD814D0212E47BD0029B5D7 /* MainBaseController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainBaseController.h; sourceTree = "<group>"; }; |
| | | 2DD814D1212E47BD0029B5D7 /* MainBaseController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainBaseController.m; sourceTree = "<group>"; }; |
| | | 2DD814D6212E499B0029B5D7 /* ALBaseController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALBaseController.h; sourceTree = "<group>"; }; |
| | | 2DD814D7212E499B0029B5D7 /* ALBaseController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALBaseController.m; sourceTree = "<group>"; }; |
| | | 2DEAE78020EC6748003349B4 /* SJNetwork.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SJNetwork.h; sourceTree = "<group>"; }; |
| | | 2DEAE78120EC6748003349B4 /* SJNetwork.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SJNetwork.m; sourceTree = "<group>"; }; |
| | | 2DEF567F20FF20990071C985 /* SJTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SJTipView.h; sourceTree = "<group>"; }; |
| | |
| | | 18956EBE1FD64A03001531A1 /* TipView.m */, |
| | | 18B30CC91FDA2937009A235C /* SearchTip.h */, |
| | | 18B30CC81FDA2936009A235C /* SearchTip.m */, |
| | | 2D24A112212BBEDD00BEC4BB /* SearchCouponView.h */, |
| | | 2D24A113212BBEDD00BEC4BB /* SearchCouponView.m */, |
| | | 2D37FC6620C14C2300E11051 /* SJLoginTaoBao.h */, |
| | | 2D37FC6720C14C2300E11051 /* SJLoginTaoBao.m */, |
| | | 2D00BC74211A795300C129D7 /* SJNoNetwork.h */, |
| | | 2D00BC75211A795300C129D7 /* SJNoNetwork.m */, |
| | | 2D43E74C211D92790008BA48 /* ALAnomalyNetWorkView.h */, |
| | | 2D43E74D211D92790008BA48 /* ALAnomalyNetWorkView.m */, |
| | | 2D15A76E212D3FB3005C0CAC /* ShareAppView */, |
| | | ); |
| | | path = LXAlertView; |
| | | sourceTree = "<group>"; |
| | |
| | | 188E95521E5C436400F0F895 /* MineHelperTableViewCell.h */, |
| | | 188E95531E5C436400F0F895 /* MineHelperTableViewCell.m */, |
| | | 188E95541E5C436400F0F895 /* MineHelperTableViewCell.xib */, |
| | | 189711CB1FCF9B1200B5393A /* MineToolBarTableViewCell.h */, |
| | | 189711CC1FCF9B1200B5393A /* MineToolBarTableViewCell.m */, |
| | | 189711CD1FCF9B1200B5393A /* MineToolBarTableViewCell.xib */, |
| | | 2D09AC64212ABB51000F4160 /* MineToolBarTableViewCell.h */, |
| | | 2D09AC65212ABB51000F4160 /* MineToolBarTableViewCell.m */, |
| | | 2D0D7D0F20BFF51B009D5D48 /* MineThirdTableViewCell.h */, |
| | | 2D0D7D1020BFF51B009D5D48 /* MineThirdTableViewCell.m */, |
| | | 2D0D7D1120BFF51B009D5D48 /* MineThirdTableViewCell.xib */, |
| | |
| | | 18AC534D1E5A92B7006D1FDF /* BaseNavigationController.m */, |
| | | 2DEF568220FF36620071C985 /* SJBaseViewController.h */, |
| | | 2DEF568320FF36620071C985 /* SJBaseViewController.m */, |
| | | 2DD814D0212E47BD0029B5D7 /* MainBaseController.h */, |
| | | 2DD814D1212E47BD0029B5D7 /* MainBaseController.m */, |
| | | 2DD814D6212E499B0029B5D7 /* ALBaseController.h */, |
| | | 2DD814D7212E499B0029B5D7 /* ALBaseController.m */, |
| | | 2D37FC5620C126AD00E11051 /* 卿 */, |
| | | 1845E052207A019C00EB1571 /* é请 */, |
| | | 18AC534B1E5A9186006D1FDF /* é¦é¡µ */, |
| | |
| | | 18AC53821E5A9840006D1FDF /* YTHNetInterface.m */, |
| | | 18603038206A1F4E0016DA6F /* JYNetWorking.h */, |
| | | 18603037206A1F4E0016DA6F /* JYNetWorking.m */, |
| | | 2D09AC61212A5AAB000F4160 /* ALNetWorking.h */, |
| | | 2D09AC62212A5AAB000F4160 /* ALNetWorking.m */, |
| | | ); |
| | | path = DataNet; |
| | | sourceTree = "<group>"; |
| | |
| | | 18AC538B1E5A9876006D1FDF /* lib */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 2D24A115212C16F100BEC4BB /* ptotoBrowser */, |
| | | 2D1175AA21199F2700D4CD0F /* FileManger */, |
| | | 2D9F157B2117E8E800EFFAFB /* EasyJSWebView-master */, |
| | | 1845C239209C562C009C639B /* LBXScan */, |
| | |
| | | path = FileManger; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 2D15A76E212D3FB3005C0CAC /* ShareAppView */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 2D15A76B212D3640005C0CAC /* ShareAppView.h */, |
| | | 2D15A76C212D3640005C0CAC /* ShareAppView.m */, |
| | | 2D15A76F212D3FEE005C0CAC /* ShareAppCell.h */, |
| | | 2D15A770212D3FEE005C0CAC /* ShareAppCell.m */, |
| | | ); |
| | | path = ShareAppView; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 2D24A115212C16F100BEC4BB /* ptotoBrowser */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 2D24A116212C16F100BEC4BB /* HZPhotoBrowser.bundle */, |
| | | 2D24A117212C16F100BEC4BB /* HZPhotoBrowser.h */, |
| | | 2D24A118212C16F100BEC4BB /* HZPhotoBrowser.m */, |
| | | 2D24A119212C16F100BEC4BB /* HZPhotoBrowserConfig.h */, |
| | | 2D24A11A212C16F100BEC4BB /* HZPhotoBrowserView.h */, |
| | | 2D24A11B212C16F100BEC4BB /* HZPhotoBrowserView.m */, |
| | | 2D24A11C212C16F100BEC4BB /* HZWaitingView.h */, |
| | | 2D24A11D212C16F100BEC4BB /* HZWaitingView.m */, |
| | | ); |
| | | path = ptotoBrowser; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 2D37FC5620C126AD00E11051 /* 卿 */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | |
| | | 18332E0B207DE7B3002C6626 /* ServiceTableViewCell.xib in Resources */, |
| | | 18360AFE206CBB3400F9EAB1 /* MinMessDetailViewController.xib in Resources */, |
| | | 18D4305C1E7A30770007CCB5 /* FilterCommonCollectionViewCell.xib in Resources */, |
| | | 2D24A11E212C16F100BEC4BB /* HZPhotoBrowser.bundle in Resources */, |
| | | 1839BF3B20844C0100FD7104 /* WeiboSDK.bundle in Resources */, |
| | | 188E95411E5C237E00F0F895 /* FooterCollectionReusableView.xib in Resources */, |
| | | 2D4DF1B320EDF0E60043C545 /* SJKitingViewController.xib in Resources */, |
| | |
| | | 18E5ADFB1E5EC8B3009F85E0 /* SettingViewController.xib in Resources */, |
| | | 2D08C10C20BFCE2C00A2423B /* LoginViewController.xib in Resources */, |
| | | 1845C440209C562D009C639B /* COPYING in Resources */, |
| | | 189711CF1FCF9B1200B5393A /* MineToolBarTableViewCell.xib in Resources */, |
| | | 2D6858F520DB5D8B00E4376A /* SJCouponCollectionViewCell.xib in Resources */, |
| | | 1839BF3E20844C0100FD7104 /* ShareSDK.bundle in Resources */, |
| | | 2D4DF1A920EDB2E10043C545 /* SJStoreTableViewCell.xib in Resources */, |
| | |
| | | 1845C4CF209C562E009C639B /* ZXCodaBarReader.m in Sources */, |
| | | 18966CAA20AD7F6A004CD297 /* GDrecomeTableViewCell.m in Sources */, |
| | | 1845C504209C562E009C639B /* ZXQRCodeDataMask.m in Sources */, |
| | | 2D15A76D212D3640005C0CAC /* ShareAppView.m in Sources */, |
| | | 1845C4B6209C562E009C639B /* ZXAI01393xDecoder.m in Sources */, |
| | | 2D0DF78C20C642AE002BB619 /* SJUnbindPhoneViewController.m in Sources */, |
| | | 1897D9A61E5FDB44003DF6FE /* searchDetailViewController.m in Sources */, |
| | |
| | | 1845C4C9209C562E009C639B /* ZXAbstractRSSReader.m in Sources */, |
| | | 2D92BE8E20DA0DA2007F1C3F /* UIView+SJTools.m in Sources */, |
| | | 18E7C7901EB9ABCC00A02A14 /* PraiseView.m in Sources */, |
| | | 2D15A771212D3FEE005C0CAC /* ShareAppCell.m in Sources */, |
| | | 1845C589209C6450009C639B /* MyQRViewController.m in Sources */, |
| | | 1845C459209C562D009C639B /* ZXExpandedProductResultParser.m in Sources */, |
| | | 1892034820BE51C6008C1045 /* ZXingWrapper.m in Sources */, |
| | | 1845C4B9209C562E009C639B /* ZXAI01AndOtherAIs.m in Sources */, |
| | | 1845C484209C562D009C639B /* ZXDetectorResult.m in Sources */, |
| | | 2D24A114212BBEDD00BEC4BB /* SearchCouponView.m in Sources */, |
| | | 18B30CCA1FDA2937009A235C /* SearchTip.m in Sources */, |
| | | 1845C453209C562D009C639B /* ZXBookmarkDoCoMoResultParser.m in Sources */, |
| | | 18AC53901E5A9C2D006D1FDF /* GTMBase64.m in Sources */, |
| | |
| | | 18AC539C1E5AC874006D1FDF /* shufflingCollectionReusableView.m in Sources */, |
| | | 1845C483209C562D009C639B /* ZXDefaultGridSampler.m in Sources */, |
| | | 1845C4FF209C562E009C639B /* ZXPDF417Reader.m in Sources */, |
| | | 2D24A121212C16F100BEC4BB /* HZWaitingView.m in Sources */, |
| | | 1845C4D0209C562E009C639B /* ZXCodaBarWriter.m in Sources */, |
| | | 1845C511209C562E009C639B /* ZXQRCodeFinderPatternInfo.m in Sources */, |
| | | 2DD814D8212E499B0029B5D7 /* ALBaseController.m in Sources */, |
| | | 2DEF568420FF36620071C985 /* SJBaseViewController.m in Sources */, |
| | | 1845C516209C562E009C639B /* ZXQRCodeMatrixUtil.m in Sources */, |
| | | 1845C4A0209C562D009C639B /* ZXDataMatrixC40Encoder.m in Sources */, |
| | |
| | | 1845C444209C562D009C639B /* ZXAztecBinaryShiftToken.m in Sources */, |
| | | 1845C4D3209C562E009C639B /* ZXCode39Reader.m in Sources */, |
| | | 1845C479209C562D009C639B /* ZXGenericGFPoly.m in Sources */, |
| | | 189711CE1FCF9B1200B5393A /* MineToolBarTableViewCell.m in Sources */, |
| | | 2D08C10B20BFCE2C00A2423B /* LoginViewController.m in Sources */, |
| | | 1845C4E1209C562E009C639B /* ZXUPCAReader.m in Sources */, |
| | | 1845C4A8209C562E009C639B /* ZXDataMatrixTextEncoder.m in Sources */, |
| | |
| | | 1845C478209C562D009C639B /* ZXGenericGF.m in Sources */, |
| | | 1845C44E209C562D009C639B /* ZXAbstractDoCoMoResultParser.m in Sources */, |
| | | 1845C4E6209C562E009C639B /* ZXUPCEANReader.m in Sources */, |
| | | 2D09AC66212ABB51000F4160 /* MineToolBarTableViewCell.m in Sources */, |
| | | 1845C487209C562D009C639B /* ZXHybridBinarizer.m in Sources */, |
| | | 1845C494209C562D009C639B /* ZXPlanarYUVLuminanceSource.m in Sources */, |
| | | 1845C4FD209C562E009C639B /* ZXPDF417HighLevelEncoder.m in Sources */, |
| | |
| | | 18AC53AB1E5ACE45006D1FDF /* HeaderCollectionReusableView.m in Sources */, |
| | | 1836507F206E19AA001D6651 /* IncarnateViewController.m in Sources */, |
| | | 188E954B1E5C42F100F0F895 /* MineRedEnvelopesTableViewCell.m in Sources */, |
| | | 2D09AC63212A5AAB000F4160 /* ALNetWorking.m in Sources */, |
| | | 1845C45F209C562D009C639B /* ZXProductParsedResult.m in Sources */, |
| | | 1845C475209C562D009C639B /* ZXMathUtils.m in Sources */, |
| | | 2D1175B221199F4000D4CD0F /* PlistFileOperator.m in Sources */, |
| | |
| | | 1845C4A5209C562E009C639B /* ZXDataMatrixHighLevelEncoder.m in Sources */, |
| | | 18D430431E7A2D1F0007CCB5 /* SideSlipCommonTableViewCell.m in Sources */, |
| | | 18FB09AA206B904300006656 /* BalanceViewController.m in Sources */, |
| | | 2D24A11F212C16F100BEC4BB /* HZPhotoBrowser.m in Sources */, |
| | | 18966CA920AD7F6A004CD297 /* GDetailView.m in Sources */, |
| | | 18AC532C1E5A8F01006D1FDF /* main.m in Sources */, |
| | | 1894B3A720A003590058A35B /* CodeFieldViewController.m in Sources */, |
| | |
| | | 1845C472209C562D009C639B /* ZXCapture.m in Sources */, |
| | | 18AC53A61E5ACCD8006D1FDF /* recommendCollectionViewCell.m in Sources */, |
| | | 1845C4F7209C562E009C639B /* ZXPDF417DetectorResult.m in Sources */, |
| | | 2D24A120212C16F100BEC4BB /* HZPhotoBrowserView.m in Sources */, |
| | | 1845C4C8209C562E009C639B /* ZXRSSExpandedRow.m in Sources */, |
| | | 18332E0A207DE7B3002C6626 /* ServiceTableViewCell.m in Sources */, |
| | | 18AE875C1FE38439005DB018 /* TCollectionViewCell.m in Sources */, |
| | |
| | | 1845C4AB209C562E009C639B /* ZXDataMatrixWriter.m in Sources */, |
| | | 1894E7F620B6C73F00C28F33 /* XHWebImageAutoSizeConst.m in Sources */, |
| | | 1845C4EC209C562E009C639B /* ZXPDF417BarcodeMetadata.m in Sources */, |
| | | 2DD814D2212E47BD0029B5D7 /* MainBaseController.m in Sources */, |
| | | 18360AFD206CBB3400F9EAB1 /* MinMessDetailViewController.m in Sources */, |
| | | ); |
| | | runOnlyForDeploymentPostprocessing = 0; |
| | |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> |
| | | <BreakpointContent |
| | | shouldBeEnabled = "No" |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | scope = "0" |
| | |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/界面/我的/MergeAccountViewController.h" |
| | | timestampString = "555402530.7800241" |
| | | filePath = "MIduo/界面/首页/recommendViewController.m" |
| | | timestampString = "556703371.057799" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "28" |
| | | endingLineNumber = "28"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/界面/我的/LoginViewController.m" |
| | | timestampString = "556015784.412843" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "562" |
| | | endingLineNumber = "562" |
| | | landmarkName = "-WeChatHasLoged:" |
| | | startingLineNumber = "538" |
| | | endingLineNumber = "538" |
| | | landmarkName = "-collectionView:didSelectItemAtIndexPath:" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | shouldBeEnabled = "Yes" |
| | | shouldBeEnabled = "No" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/界面/我的/MineViewController.m" |
| | | timestampString = "556193666.6095949" |
| | | filePath = "MIduo/界面/首页/recommendViewController.m" |
| | | timestampString = "556703371.057916" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "679" |
| | | endingLineNumber = "679" |
| | | landmarkName = "-noticeOrderOrShopCarBackWithLoginVc" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "../SGNetObserver-master/SGNetObserver/SGNetObserver.m" |
| | | timestampString = "555902137.230881" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "77" |
| | | endingLineNumber = "77" |
| | | landmarkName = "-networkStatusDidChanged" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/界面/我的/SJUnbindPhoneViewController.m" |
| | | timestampString = "555922371.278873" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "101" |
| | | endingLineNumber = "101" |
| | | landmarkName = "-unBindPhonewithPhoneString:" |
| | | landmarkType = "7"> |
| | | <Locations> |
| | | <Location |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | symbolName = "__58-[SJUnbindPhoneViewController unBindPhonewithPhoneString:]_block_invoke" |
| | | moduleName = "MIduo" |
| | | usesParentBreakpointCondition = "Yes" |
| | | urlString = "file:///Users/mj/Desktop/haicaojie/MIduo/%E7%95%8C%E9%9D%A2/%E6%88%91%E7%9A%84/SJUnbindPhoneViewController.m" |
| | | timestampString = "556193672.6899689" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "101" |
| | | endingLineNumber = "101" |
| | | offsetFromSymbolStart = "508"> |
| | | </Location> |
| | | <Location |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | symbolName = "__58-[SJUnbindPhoneViewController unBindPhonewithPhoneString:]_block_invoke_2" |
| | | moduleName = "MIduo" |
| | | usesParentBreakpointCondition = "Yes" |
| | | urlString = "file:///Users/mj/Desktop/haicaojie/MIduo/%E7%95%8C%E9%9D%A2/%E6%88%91%E7%9A%84/SJUnbindPhoneViewController.m" |
| | | timestampString = "556193672.691522" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "101" |
| | | endingLineNumber = "101" |
| | | offsetFromSymbolStart = "36"> |
| | | </Location> |
| | | </Locations> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/界面/我的/SJUnbindPhoneViewController.m" |
| | | timestampString = "555922374.87973" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "104" |
| | | endingLineNumber = "104" |
| | | landmarkName = "-unBindPhonewithPhoneString:" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/界面/邀请/商品分享/ShonpingShareViewController.m" |
| | | timestampString = "556015784.412999" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "546" |
| | | endingLineNumber = "546" |
| | | landmarkName = "-dealloc" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/界面/我的/message/MineMessageViewController.m" |
| | | timestampString = "556015784.413071" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "77" |
| | | endingLineNumber = "77" |
| | | landmarkName = "-getMessage" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/界面/我的/messageLogin/MessageLoginViewController.m" |
| | | timestampString = "556015784.413177" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "437" |
| | | endingLineNumber = "437" |
| | | landmarkName = "-sendMessage:" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/界面/我的/SettingViewController.m" |
| | | timestampString = "556015933.093775" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "82" |
| | | endingLineNumber = "82" |
| | | landmarkName = "-fromBack:" |
| | | startingLineNumber = "636" |
| | | endingLineNumber = "636" |
| | | landmarkName = "-collectionView:cellForItemAtIndexPath:" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | |
| | | [dic setObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] forKey:@"uid"]; |
| | | NSMutableDictionary * dictionary = [SJNetwork CommonDictionarywithDic:dic]; |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"push/uidBindDeviceToken"] param:dictionary isMainOrDynamic:YES success:^(NSDictionary *object) { |
| | | NSLog(@"%@",object); |
| | | |
| | | } fail:^(id object) { |
| | | NSLog(@"%@",object); |
| | | |
| | | }]; |
| | | } |
| | | - (void)loadViews{ |
| | |
| | | NSMutableDictionary * dictionary = [SJNetwork CommonDictionarywithDic:dic]; |
| | | |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"customer/findAccountMessageList"] param:dictionary isMainOrDynamic:YES success:^(NSDictionary *object) { |
| | | NSLog(@"%@",object); |
| | | // NSInteger code = [object[@"code"]integerValue]; |
| | | |
| | | NSDictionary *dic = object[@"data"]; |
| | | NSArray *array = dic[@"list"]; |
| | | BOOL bor = NO; |
| | |
| | | } |
| | | |
| | | } fail:^(id object) { |
| | | NSLog(@"%@",object); |
| | | |
| | | }]; |
| | | } |
| | | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options { |
| | |
| | | |
| | | stringByReplacingOccurrencesOfString:@" " withString:@""]; |
| | | |
| | | NSLog(@"deviceTokenStr:\n%@",deviceTokenStr); |
| | | [YTHsharedManger startManger].deviceToken = deviceTokenStr; |
| | | NSMutableDictionary *dic = @{}.mutableCopy; |
| | | [dic setObject:deviceTokenStr forKey:@"deviceToken"]; |
| | | NSLog(@"%@",[NSString stringWithFormat:@"%@/%@",domainHTTP,@"push/insertDeviceToken"]); |
| | | |
| | | NSMutableDictionary * dictionary = [SJNetwork CommonDictionarywithDic:dic]; |
| | | |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"push/insertDeviceToken"] param:dictionary isMainOrDynamic: YES success:^(NSDictionary *object) { |
| | | NSLog(@"%@",object); |
| | | // NSInteger code = [object[@"code"]integerValue]; |
| | | // [self.datasource removeAllObjects]; |
| | | |
| | | |
| | | } fail:^(id object) { |
| | | NSLog(@"%@",object); |
| | | |
| | | }]; |
| | | if([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]!=nil){ |
| | | [self loginDeviceToken]; |
| | |
| | | { |
| | | // 注åAPNS失败 |
| | | // èªè¡å¤ç |
| | | NSLog(@"%@",err); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { |
| | | // UIApplicationStateActive åºç¨ç¨åºå¤äºåå° |
| | | NSLog(@"%@",userInfo); |
| | | |
| | | if(application.applicationState == UIApplicationStateActive){ |
| | | |
| | | //ç¨åºå½åæ£å¤äºåå° |
| | |
| | | @param completionHandler 宿åè° |
| | | */ |
| | | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { |
| | | NSLog(@"[XGDemo] userinfo %@", userInfo); |
| | | |
| | | if(application.applicationState == UIApplicationStateActive){ |
| | | //ç¨åºå½åæ£å¤äºåå° |
| | | //å鿬å°éç¥ |
| | |
| | | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 |
| | | // App ç¨æ·ç¹å»éç¥çåè° |
| | | // æ 论æ¬å°æ¨éè¿æ¯è¿ç¨æ¨éé½ä¼èµ°è¿ä¸ªåè° |
| | | - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler { |
| | | NSLog(@"[XGDemo] click notification"); |
| | | - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(nonnull void (^)(void))completionHandler{ |
| | | |
| | | NSDictionary * userInfo = response.notification.request.content.userInfo; |
| | | [YTHsharedManger startManger].infomation = userInfo; |
| | | // [[NSNotificationCenter defaultCenter] postNotification:notification]; |
| | |
| | | /** |
| | | * é
置客æ·ç«¯ä¿¡æ¯ |
| | | */ |
| | | -(void)getInfoFromCompany{ |
| | | - (void)getInfoFromCompany { |
| | | //夿ä¹åæ¯å¦ç¼åäºç¨æ·ä¿¡æ¯ |
| | | NSFileManager *fileManager = [NSFileManager defaultManager]; |
| | | if ([fileManager fileExistsAtPath:USERINFOfILE]){ |
| | |
| | | if (isSuccessful) { |
| | | NSUserDefaults *uid = [NSUserDefaults standardUserDefaults]; |
| | | NSArray *tempArr=[[result objectForKey:@"data"] objectForKey:@"systemClientParamsList"]; |
| | | for (int i=0; i<tempArr.count; i++) { |
| | | for (int i = 0; i < tempArr.count; i++) { |
| | | NSDictionary *tempDic=tempArr[i]; |
| | | [uid setObject:[tempDic objectForKey:@"value"] forKey:[tempDic objectForKey:@"key"]]; |
| | | } |
copy from "MIduo/Assets.xcassets/\346\210\221\347\232\204/\344\274\232\345\221\230\347\211\271\346\235\203.imageset/Contents.json"
copy to "MIduo/Assets.xcassets/\346\210\221\347\232\204/QQ\345\245\275\345\217\213.imageset/Contents.json"
File was copied from MIduo/Assets.xcassets/ÎÒµÄ/»áÔ±ÌØÈ¨.imageset/Contents.json |
| | |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@2x.png", |
| | | "filename" : "QQ好å@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@3x.png", |
| | | "filename" : "QQ好å@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
File was renamed from MIduo/Assets.xcassets/ÎÒµÄ/»áÔ±ÌØÈ¨.imageset/Contents.json |
| | |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@2x.png", |
| | | "filename" : "QQ空é´@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@3x.png", |
| | | "filename" : "QQ空é´@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
copy from "MIduo/Assets.xcassets/\346\210\221\347\232\204/\344\274\232\345\221\230\347\211\271\346\235\203.imageset/Contents.json"
copy to "MIduo/Assets.xcassets/\346\210\221\347\232\204/\345\210\206\344\272\253APP.imageset/Contents.json"
File was copied from MIduo/Assets.xcassets/ÎÒµÄ/»áÔ±ÌØÈ¨.imageset/Contents.json |
| | |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@2x.png", |
| | | "filename" : "å享APP@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@3x.png", |
| | | "filename" : "å享APP@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
copy from "MIduo/Assets.xcassets/\346\210\221\347\232\204/\344\274\232\345\221\230\347\211\271\346\235\203.imageset/Contents.json"
copy to "MIduo/Assets.xcassets/\346\210\221\347\232\204/\345\276\256\344\277\241\345\245\275\345\217\213.imageset/Contents.json"
File was copied from MIduo/Assets.xcassets/ÎÒµÄ/»áÔ±ÌØÈ¨.imageset/Contents.json |
| | |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@2x.png", |
| | | "filename" : "微信@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@3x.png", |
| | | "filename" : "微信@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
copy from "MIduo/Assets.xcassets/\346\210\221\347\232\204/\344\274\232\345\221\230\347\211\271\346\235\203.imageset/Contents.json"
copy to "MIduo/Assets.xcassets/\346\210\221\347\232\204/\346\226\260\346\265\252\345\276\256\345\215\232.imageset/Contents.json"
File was copied from MIduo/Assets.xcassets/ÎÒµÄ/»áÔ±ÌØÈ¨.imageset/Contents.json |
| | |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@2x.png", |
| | | "filename" : "æ°æµªå¾®å@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@3x.png", |
| | | "filename" : "æ°æµªå¾®å@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
copy from "MIduo/Assets.xcassets/\346\210\221\347\232\204/\344\274\232\345\221\230\347\211\271\346\235\203.imageset/Contents.json"
copy to "MIduo/Assets.xcassets/\346\210\221\347\232\204/\346\234\213\345\217\213\345\234\210.imageset/Contents.json"
File was copied from MIduo/Assets.xcassets/ÎÒµÄ/»áÔ±ÌØÈ¨.imageset/Contents.json |
| | |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@2x.png", |
| | | "filename" : "æåå@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@3x.png", |
| | | "filename" : "æåå@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
New file |
| | |
| | | { |
| | | "info" : { |
| | | "version" : 1, |
| | | "author" : "xcode" |
| | | } |
| | | } |
copy from "MIduo/Assets.xcassets/\346\210\221\347\232\204/\344\274\232\345\221\230\347\211\271\346\235\203.imageset/Contents.json"
copy to "MIduo/Assets.xcassets/\346\231\272\350\203\275\346\220\234\347\264\242/bgRed.imageset/Contents.json"
File was copied from MIduo/Assets.xcassets/ÎÒµÄ/»áÔ±ÌØÈ¨.imageset/Contents.json |
| | |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "bg 4.png", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "icon_ä¼åç¹æ@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "è¿@2x.png", |
| | | "filename" : "å¥é@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "filename" : "è¿@3x.png", |
| | | "filename" : "å¥é@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
New file |
| | |
| | | // |
| | | // ALNetWorking.h |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/15. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @interface ALNetWorking : NSObject |
| | | |
| | | + (ALNetWorking *)startInterface; |
| | | |
| | | - (void)cancelAll; |
| | | |
| | | - (void)Post:(NSString *)url |
| | | param:(NSDictionary *)param |
| | | success:(NetBlock)successBlock |
| | | fail:(ErrorBlock)errorBlock; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // ALNetWorking.m |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/15. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "ALNetWorking.h" |
| | | |
| | | static ALNetWorking * aLNetWorking = nil; |
| | | static AFHTTPSessionManager *managers; |
| | | |
| | | @implementation ALNetWorking |
| | | |
| | | //YTHNetInterfaceçå便¹æ³ |
| | | + (ALNetWorking *)startInterface{ |
| | | |
| | | static dispatch_once_t token; |
| | | dispatch_once(&token, ^{ |
| | | aLNetWorking = [[ALNetWorking alloc] init]; |
| | | managers = [AFHTTPSessionManager manager]; |
| | | }); |
| | | return aLNetWorking ; |
| | | } |
| | | |
| | | #pragma mark 䏿ææè¯·æ± |
| | | - (void)cancelAll{ |
| | | |
| | | if ([managers.tasks count] > 0) { |
| | | // åæ¶ç½ç»è¯·æ± |
| | | [managers.tasks makeObjectsPerformSelector:@selector(cancel)]; |
| | | } |
| | | |
| | | [managers.operationQueue cancelAllOperations]; |
| | | } |
| | | |
| | | - (void)Post:(NSString *)url param:(NSDictionary *)param success:(NetBlock)successBlock fail:(ErrorBlock)errorBlock |
| | | { |
| | | url= [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; |
| | | |
| | | // AFSecurityPolicy *securityPolicy = [[AFSecurityPolicy alloc] init]; |
| | | // [securityPolicy setAllowInvalidCertificates:YES]; |
| | | |
| | | // [manager setSecurityPolicy:securityPolicy]; |
| | | // 设置è¶
æ¶æ¶é´ |
| | | managers.requestSerializer.timeoutInterval = 15; |
| | | managers.responseSerializer = [AFHTTPResponseSerializer serializer]; |
| | | managers.responseSerializer = [AFJSONResponseSerializer serializer]; |
| | | managers.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/plain"]; |
| | | |
| | | [managers POST:url parameters:param progress:^(NSProgress * _Nonnull uploadProgress) { |
| | | |
| | | } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { |
| | | |
| | | if (successBlock) { |
| | | |
| | | successBlock(responseObject); |
| | | } |
| | | |
| | | } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { |
| | | |
| | | if (errorBlock) { |
| | | |
| | | errorBlock(error); |
| | | } |
| | | }]; |
| | | } |
| | | |
| | | @end |
| | |
| | | @property (nonatomic , strong) NSString *Uid; |
| | | @property (nonatomic , strong) NSMutableDictionary *boundDic; |
| | | @property (nonatomic , assign) BOOL isBound; |
| | | @property (nonatomic , assign)BOOL isfirst; |
| | | @property (nonatomic , strong)NSString *tbPicString; |
| | | @property (nonatomic , assign) BOOL isfirst; |
| | | @property (nonatomic , strong) NSString *tbPicString; |
| | | @property (nonatomic , strong) NSString *deviceToken; |
| | | @property (nonatomic , strong)NSDictionary *infomation; |
| | | @property (nonatomic , assign)BOOL POPPraise; |
| | | @property (nonatomic , assign)NSInteger isDetailWebValue; |
| | | @property (nonatomic , assign)BOOL isEnterForeground; |
| | | @property (nonatomic , assign)BOOL isChangeWX; |
| | | @property (nonatomic , assign)CGFloat height; |
| | | @property (nonatomic , strong)NSString *weexUrlString; |
| | | @property (nonatomic , strong)NSString *membersUrl; |
| | | @property (nonatomic , strong)NSString *myTeamURL; |
| | | @property (nonatomic , assign)NSInteger playingType; |
| | | @property (nonatomic , assign)BOOL isminebound; |
| | | @property (nonatomic , assign)BOOL isBackGoodDeTr; |
| | | @property (nonatomic , assign)BOOL isUserInfo; |
| | | @property (nonatomic , strong)NSString * minPrice; |
| | | @property (nonatomic , strong)NSString * maxPrice; |
| | | @property (nonatomic , assign)NSInteger networkStatus; |
| | | @property (nonatomic , strong) NSDictionary *infomation; |
| | | @property (nonatomic , assign) BOOL POPPraise; |
| | | @property (nonatomic , assign) NSInteger isDetailWebValue; |
| | | @property (nonatomic , assign) BOOL isEnterForeground; |
| | | @property (nonatomic , assign) BOOL isChangeWX; |
| | | /// æ§å¶æ°ç¨æ·çº¢å
æç¤ºå¼¹æ¡(0:å¼¹åº 1ï¼ä¸å¼¹åº) |
| | | @property (nonatomic , assign) NSInteger isNewUser; |
| | | @property (nonatomic , assign) CGFloat height; |
| | | @property (nonatomic , strong) NSString *weexUrlString; |
| | | @property (nonatomic , strong) NSString *membersUrl; |
| | | @property (nonatomic , strong) NSString *myTeamURL; |
| | | @property (nonatomic , assign) NSInteger playingType; |
| | | @property (nonatomic , assign) BOOL isminebound; |
| | | @property (nonatomic , assign) BOOL isBackGoodDeTr; |
| | | @property (nonatomic , assign) BOOL isUserInfo; |
| | | @property (nonatomic , strong) NSString * minPrice; |
| | | @property (nonatomic , strong) NSString * maxPrice; |
| | | @property (nonatomic , assign) NSInteger networkStatus; |
| | | /// æ¯å¦æ¯ç¹å»è´ç©è½¦æè
订å微信ç»å½ç夿 |
| | | @property (nonatomic, assign) BOOL isShopCarWXLogin; |
| | | |
| | |
| | | |
| | | } |
| | | }else{ |
| | | NSLog(@"åå°ç»å½å¤±è´¥"); |
| | | NSLog(@"%@",error); |
| | | |
| | | block(NO, nil); |
| | | } |
| | | }]; |
| | |
| | | } else { |
| | | |
| | | block(NO, nil); |
| | | |
| | | NSLog(@"æµ·èè¡ç»å½å¤±è´¥"); |
| | | } |
| | | }]; |
| | | } |
| | | } |
| | | } failureCallback:^(ALBBSession *session, NSError *error) { |
| | | NSLog(@"ç»å½å¤±è´¥ï¼"); |
| | | // [SVProgressHUD setContainerView:[UIApplication sharedApplication].delegate.window]; |
| | | // [SVProgressHUD showErrorWithStatus:@"ç»å½å¤±è´¥ï¼è¯·ç¨ååè¯"]; |
| | | |
| | | ALToastCenter(@"ç»å½å¤±è´¥ï¼è¯·ç¨ååè¯"); |
| | | |
| | | [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"TaoBaoLogin"]; |
| | |
| | | [userMessage setObject:resp.unionGender forKey:@"unionGender"]; |
| | | |
| | | // ç¬¬ä¸æ¹å¹³å°SDKæºæ°æ® |
| | | NSLog(@"QQ originalResponse: %@", resp.originalResponse); |
| | | |
| | | //å°å½åç»éçä¿¡æ¯åå¨å°æ¬å° |
| | | [[NSUserDefaults standardUserDefaults] setObject:userMessage forKey:@"QQuserMessage"]; |
New file |
| | |
| | | // |
| | | // SearchCouponView.h |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/21. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | typedef void(^selectIndex)(NSInteger index); |
| | | |
| | | @interface SearchCouponView : UIView |
| | | |
| | | @property (nonatomic, copy) selectIndex hasIndex; |
| | | |
| | | - (id)initWithSearchStr:(NSString *)searchStr; |
| | | |
| | | ///show |
| | | - (void)show; |
| | | |
| | | ///dismiss |
| | | -(void)dismiss; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // SearchCouponView.m |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/21. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | static CGFloat backgroundsViewHeight = 260; |
| | | static CGFloat backgroundsViewMargainLeft_Right = 40; |
| | | |
| | | static CGFloat redimageViewHeight = 105; |
| | | |
| | | #import "SearchCouponView.h" |
| | | |
| | | @interface SearchCouponView () |
| | | |
| | | /// æç´¢å
容 |
| | | @property (nonatomic,copy, nullable) NSString *searchString; |
| | | |
| | | @property (nonatomic, strong, nullable) UIView *overlayView; |
| | | |
| | | @property (nonatomic, strong, nullable) UIView *backgroundsView; |
| | | |
| | | @property (nonatomic, strong, nullable) UIImageView *redimageView; |
| | | |
| | | @property (nonatomic, strong, nullable) UIView *whiteView; |
| | | |
| | | @property (nonatomic, strong, nullable) UILabel *titleLabel; |
| | | |
| | | @property (nonatomic, strong, nullable) UILabel *titleDescLabel; |
| | | /// æç¤ºå
容 |
| | | @property (nonatomic, strong, nullable) UILabel *contentLabel; |
| | | /// 横线 |
| | | @property (nonatomic, strong, nullable) UIView *horizontalLine; |
| | | /// ç«çº¿ |
| | | @property (nonatomic, strong, nullable) UIView *verticalLine; |
| | | /// æç´¢æé® |
| | | @property (nonatomic, strong, nullable) UIButton *searchButton; |
| | | /// åæ¶æé® |
| | | @property (nonatomic, strong, nullable) UIButton *cancelButton; |
| | | |
| | | @end |
| | | |
| | | @implementation SearchCouponView |
| | | |
| | | - (id)initWithSearchStr:(NSString *)searchStr { |
| | | |
| | | self = [super init]; |
| | | |
| | | if (self) { |
| | | |
| | | self.searchString = searchStr; |
| | | |
| | | [self viewConfig]; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | #pragma mark - confirm |
| | | - (void)buttonAlert:(UIButton *)sender { |
| | | _hasIndex(sender.tag); |
| | | } |
| | | |
| | | - (UIViewController *)appRootViewController { |
| | | UIViewController *appRootVc = [UIApplication sharedApplication].keyWindow.rootViewController; |
| | | //å¦ææ¯æ¨¡æ. |
| | | while (appRootVc.presentedViewController) { |
| | | appRootVc = appRootVc.presentedViewController; |
| | | } |
| | | return appRootVc; |
| | | } |
| | | |
| | | |
| | | - (void)show { |
| | | |
| | | UIViewController *topVC = [self appRootViewController]; |
| | | [topVC.view addSubview:self]; |
| | | |
| | | self.sd_layout |
| | | .leftSpaceToView(topVC.view, 0) |
| | | .topSpaceToView(topVC.view, 0) |
| | | .widthIs(KScreenW) |
| | | .heightIs(KScreenH); |
| | | } |
| | | |
| | | - (void)dismiss { |
| | | [self removeFromSuperview]; |
| | | } |
| | | |
| | | - (void)viewConfig { |
| | | |
| | | [self addSubview:self.overlayView]; |
| | | self.overlayView.sd_layout |
| | | .leftSpaceToView(self, 0) |
| | | .topSpaceToView(self, 0) |
| | | .rightSpaceToView(self, 0) |
| | | .bottomSpaceToView(self, 0); |
| | | |
| | | [self addSubview:self.backgroundsView]; |
| | | self.backgroundsView.sd_layout |
| | | .leftSpaceToView(self, backgroundsViewMargainLeft_Right) |
| | | .rightSpaceToView(self, backgroundsViewMargainLeft_Right) |
| | | .heightIs(backgroundsViewHeight) |
| | | .centerYEqualToView(self); |
| | | |
| | | [self.backgroundsView addSubview:self.redimageView]; |
| | | self.redimageView.sd_layout |
| | | .leftSpaceToView(self.backgroundsView, 0) |
| | | .topSpaceToView(self.backgroundsView, 0) |
| | | .rightSpaceToView(self.backgroundsView, 0) |
| | | .heightIs(redimageViewHeight); |
| | | |
| | | [self.redimageView addSubview:self.titleLabel]; |
| | | self.titleLabel.sd_layout |
| | | .leftSpaceToView(self.redimageView, 10) |
| | | .rightSpaceToView(self.redimageView, 10) |
| | | .topSpaceToView(self.redimageView, 25) |
| | | .heightIs(30); |
| | | |
| | | [self.redimageView addSubview:self.titleDescLabel]; |
| | | self.titleDescLabel.sd_layout |
| | | .leftSpaceToView(self.redimageView, 10) |
| | | .rightSpaceToView(self.redimageView, 10) |
| | | .topSpaceToView(self.titleLabel, 5) |
| | | .heightIs(30); |
| | | |
| | | [self.backgroundsView addSubview:self.whiteView]; |
| | | |
| | | [self.whiteView addSubview:self.contentLabel]; |
| | | self.contentLabel.sd_layout |
| | | .leftSpaceToView(self.whiteView, 18) |
| | | .topSpaceToView(self.whiteView, 10) |
| | | .rightSpaceToView(self.whiteView, 18) |
| | | .heightIs(80); |
| | | |
| | | [self.whiteView addSubview:self.horizontalLine]; |
| | | self.horizontalLine.sd_layout |
| | | .leftSpaceToView(self.whiteView, 0) |
| | | .rightSpaceToView(self.whiteView, 0) |
| | | .topSpaceToView(self.contentLabel, 10) |
| | | .heightIs(1); |
| | | |
| | | [self.whiteView addSubview:self.verticalLine]; |
| | | self.verticalLine.sd_layout |
| | | .topSpaceToView(self.horizontalLine, 0) |
| | | .bottomSpaceToView(self.whiteView, 0) |
| | | .centerXEqualToView(self.whiteView) |
| | | .widthIs(1); |
| | | |
| | | [self.whiteView addSubview:self.searchButton]; |
| | | self.searchButton.sd_layout |
| | | .leftSpaceToView(self.verticalLine, 0) |
| | | .topSpaceToView(self.horizontalLine, 0) |
| | | .rightSpaceToView(self.whiteView, 0) |
| | | .bottomSpaceToView(self.whiteView, 0); |
| | | |
| | | [self.whiteView addSubview:self.cancelButton]; |
| | | self.cancelButton.sd_layout |
| | | .leftSpaceToView(self.whiteView, 0) |
| | | .topSpaceToView(self.horizontalLine, 0) |
| | | .rightSpaceToView(self.verticalLine, 0) |
| | | .bottomSpaceToView(self.whiteView, 0); |
| | | } |
| | | |
| | | - (UIView *)overlayView { |
| | | |
| | | if (!_overlayView) { |
| | | _overlayView = [[UIView alloc] init]; |
| | | _overlayView.backgroundColor = SJColor(0, 0, 0, 0.5); |
| | | } |
| | | return _overlayView; |
| | | } |
| | | |
| | | - (UIView *)backgroundsView { |
| | | |
| | | if (!_backgroundsView) { |
| | | _backgroundsView = [[UIView alloc] init]; |
| | | // _backgroundsView.backgroundColor = [UIColor redColor]; |
| | | } |
| | | return _backgroundsView; |
| | | } |
| | | |
| | | - (UIImageView *)redimageView { |
| | | |
| | | if (!_redimageView) { |
| | | _redimageView = [[UIImageView alloc] init]; |
| | | _redimageView.image = [UIImage imageNamed:@"bgRed"]; |
| | | } |
| | | return _redimageView; |
| | | } |
| | | |
| | | - (UIView *)whiteView { |
| | | |
| | | if (!_whiteView) { |
| | | _whiteView = [[UIView alloc] initWithFrame:CGRectMake(0, redimageViewHeight, KScreenW - backgroundsViewMargainLeft_Right * 2, backgroundsViewHeight - redimageViewHeight)]; |
| | | _whiteView.backgroundColor = [UIColor whiteColor]; |
| | | |
| | | UIBezierPath * maskPath = [UIBezierPath bezierPathWithRoundedRect:_whiteView.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)]; |
| | | |
| | | CAShapeLayer * maskLayer = [[CAShapeLayer alloc] init]; |
| | | maskLayer.frame = _whiteView.bounds; |
| | | maskLayer.path = maskPath.CGPath; |
| | | _whiteView.layer.mask = maskLayer; |
| | | } |
| | | return _whiteView; |
| | | } |
| | | |
| | | -(UILabel *)titleLabel { |
| | | if (!_titleLabel) { |
| | | _titleLabel = [[UILabel alloc] init]; |
| | | _titleLabel.text = @"æº è½ æ ç´¢ ä¼ æ å¸"; |
| | | _titleLabel.textColor = [UIColor whiteColor]; |
| | | _titleLabel.font = [UIFont boldSystemFontOfSize:25.0]; |
| | | _titleLabel.textAlignment = NSTextAlignmentCenter; |
| | | _titleLabel.shadowColor = SJColor(124, 1, 1, 0.3); //è®¾ç½®ææ¬çé´å½±è²å½©åéæåº¦ã |
| | | _titleLabel.shadowOffset = CGSizeMake(2.0f, 2.0f); |
| | | } |
| | | return _titleLabel; |
| | | } |
| | | |
| | | -(UILabel *)titleDescLabel { |
| | | if (!_titleDescLabel) { |
| | | _titleDescLabel = [[UILabel alloc] init]; |
| | | _titleDescLabel.text = @"ä½ æ¯å¦éè¦æç´¢ä¸ååå?"; |
| | | _titleDescLabel.textColor = [UIColor whiteColor]; |
| | | _titleDescLabel.font = [UIFont systemFontOfSize:15.0]; |
| | | _titleDescLabel.textAlignment = NSTextAlignmentCenter; |
| | | } |
| | | return _titleDescLabel; |
| | | } |
| | | |
| | | -(UILabel *)contentLabel { |
| | | |
| | | if (!_contentLabel) { |
| | | _contentLabel = [[UILabel alloc] init]; |
| | | _contentLabel.textColor = YTHColor(51, 51, 51); |
| | | _contentLabel.text = self.searchString; |
| | | _contentLabel.textAlignment = NSTextAlignmentCenter; |
| | | _contentLabel.numberOfLines = 3; |
| | | _contentLabel.font = [UIFont italicSystemFontOfSize:18.0]; |
| | | } |
| | | return _contentLabel; |
| | | } |
| | | |
| | | - (UIView *)horizontalLine { |
| | | |
| | | if (!_horizontalLine) { |
| | | _horizontalLine = [[UIView alloc] init]; |
| | | _horizontalLine.backgroundColor = SJColor(243, 243, 243, 1.0); |
| | | } |
| | | return _horizontalLine; |
| | | } |
| | | |
| | | - (UIView *)verticalLine { |
| | | |
| | | if (!_verticalLine) { |
| | | _verticalLine = [[UIView alloc] init]; |
| | | _verticalLine.backgroundColor = SJColor(243, 243, 243, 1.0); |
| | | } |
| | | return _verticalLine; |
| | | } |
| | | |
| | | - (UIButton *)searchButton { |
| | | |
| | | if (!_searchButton) { |
| | | _searchButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | _searchButton.tag = 791; |
| | | [_searchButton setTitle:@"æç´¢" forState:UIControlStateNormal]; |
| | | [_searchButton setTitleColor:SJColor(241, 66, 66, 1.0) forState:UIControlStateNormal]; |
| | | _searchButton.titleLabel.font = [UIFont boldSystemFontOfSize:17.0]; |
| | | [_searchButton addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _searchButton; |
| | | } |
| | | |
| | | - (UIButton *)cancelButton { |
| | | |
| | | if (!_cancelButton) { |
| | | _cancelButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | _cancelButton.tag = 790; |
| | | [_cancelButton setTitle:@"åæ¶" forState:UIControlStateNormal]; |
| | | [_cancelButton setTitleColor:SJColor(136, 136, 136, 1.0) forState:UIControlStateNormal]; |
| | | _cancelButton.titleLabel.font = [UIFont boldSystemFontOfSize:17.0]; |
| | | [_cancelButton addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _cancelButton; |
| | | } |
| | | |
| | | @end |
| | |
| | | _cancelButton.layer.masksToBounds=YES; |
| | | _cancelButton.layer.cornerRadius=18.0f; |
| | | |
| | | [_cancelButton addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchDown]; |
| | | [_cancelButton addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _cancelButton; |
| | | } |
| | |
| | | _SearchButton.layer.masksToBounds=YES; |
| | | _SearchButton.layer.cornerRadius=18.0f; |
| | | |
| | | [_SearchButton addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchDown]; |
| | | [_SearchButton addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _SearchButton; |
| | | } |
| | |
| | | _closeBtn.frame = CGRectMake(kAlertWidth-38,3,35,35); |
| | | _closeBtn.tag =791; |
| | | [_closeBtn setImage:[UIImage imageNamed:@"Cross"] forState:UIControlStateNormal]; |
| | | [_closeBtn addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchDown]; |
| | | [_closeBtn addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _closeBtn; |
| | | } |
New file |
| | |
| | | // |
| | | // ShareAppCell.h |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/22. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | @interface ShareAppCell : UICollectionViewCell |
| | | |
| | | @property (nonatomic, strong, nullable) UIView *line; |
| | | |
| | | @property (nonatomic, copy, nullable) NSString *dataString; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // ShareAppCell.m |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/22. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "ShareAppCell.h" |
| | | |
| | | static CGFloat imageViewHeght = 49; |
| | | |
| | | @interface ShareAppCell () |
| | | |
| | | @property (nonatomic, strong, nullable) UIImageView *imageView; |
| | | |
| | | @property (nonatomic, strong, nullable) UILabel *titleLabel; |
| | | |
| | | @end |
| | | |
| | | @implementation ShareAppCell |
| | | |
| | | - (instancetype)initWithFrame:(CGRect)frame { |
| | | |
| | | self = [super initWithFrame:frame]; |
| | | if ( self ) { |
| | | [self cellConfig]; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)cellConfig{ |
| | | |
| | | [self.contentView addSubview:self.line]; |
| | | self.line.sd_layout |
| | | .leftSpaceToView(self.contentView, 0) |
| | | .rightSpaceToView(self.contentView, 0) |
| | | .topSpaceToView(self.contentView, 0) |
| | | .heightIs(1); |
| | | |
| | | |
| | | [self.contentView addSubview:self.imageView]; |
| | | self.imageView.sd_layout |
| | | .centerXEqualToView(self.contentView) |
| | | .topSpaceToView(self.contentView, 10) |
| | | .widthIs(imageViewHeght) |
| | | .heightIs(imageViewHeght); |
| | | |
| | | [self.contentView addSubview:self.titleLabel]; |
| | | self.titleLabel.sd_layout |
| | | .leftSpaceToView(self.contentView, 0) |
| | | .rightSpaceToView(self.contentView, 0) |
| | | .topSpaceToView(self.imageView, 0) |
| | | .heightIs(25); |
| | | } |
| | | |
| | | - (void)setDataString:(NSString *)dataString { |
| | | |
| | | if (dataString) { |
| | | _imageView.image = [UIImage imageNamed:dataString]; |
| | | _titleLabel.text = dataString; |
| | | } |
| | | } |
| | | |
| | | - (UIImageView *)imageView { |
| | | |
| | | if (!_imageView) { |
| | | _imageView = [[UIImageView alloc] init]; |
| | | } |
| | | return _imageView; |
| | | } |
| | | |
| | | -(UILabel *)titleLabel { |
| | | if (!_titleLabel) { |
| | | _titleLabel = [[UILabel alloc] init]; |
| | | _titleLabel.textColor = SJColor(156, 156, 156, 1.0); |
| | | _titleLabel.font = [UIFont systemFontOfSize:15.0]; |
| | | _titleLabel.textAlignment = NSTextAlignmentCenter; |
| | | |
| | | } |
| | | return _titleLabel; |
| | | } |
| | | |
| | | - (UIView *)line { |
| | | |
| | | if (!_line) { |
| | | _line = [[UIView alloc] init]; |
| | | _line.backgroundColor = XYRBackgroundColor; |
| | | } |
| | | return _line; |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // ShareAppView.h |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/22. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | typedef void(^selectIndex)(NSInteger index); |
| | | |
| | | @interface ShareAppView : UIView |
| | | |
| | | - (instancetype)initShareAppView; |
| | | |
| | | @property (nonatomic, copy) selectIndex haveIndex; |
| | | |
| | | - (void)show; |
| | | |
| | | - (void)diss; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // ShareAppView.m |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/22. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | static CGFloat dissButtonHeght = 50; |
| | | |
| | | static CGFloat timeAnitmation = 0.5f; |
| | | |
| | | #import "ShareAppView.h" |
| | | #import "ShareAppCell.h" |
| | | |
| | | @interface ShareAppView () <UICollectionViewDelegate, UICollectionViewDataSource> |
| | | |
| | | @property (nonatomic, strong, nullable) UICollectionView *collectionView; |
| | | |
| | | @property (nonatomic, assign) CGFloat cellHeight; |
| | | |
| | | @property (nonatomic, assign) CGFloat collectionheight; |
| | | |
| | | @property (nonatomic, strong) NSArray *dataArr; |
| | | |
| | | @property (nonatomic, strong, nullable) UIView *bgView; |
| | | |
| | | @property (nonatomic, strong, nullable) UIButton *dissButton; |
| | | |
| | | @property (nonatomic, strong, nullable) UIView *line; |
| | | |
| | | @end |
| | | |
| | | @implementation ShareAppView |
| | | |
| | | - (instancetype)initShareAppView { |
| | | |
| | | self = [super init]; |
| | | |
| | | if (self) { |
| | | |
| | | [self setDataSource]; |
| | | |
| | | [self viewConfig]; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)show { |
| | | |
| | | UIViewController *topVC = [self appRootViewController]; |
| | | self.backgroundColor = SJColor(0, 0, 0, 0.5); |
| | | [topVC.view addSubview:self]; |
| | | |
| | | self.sd_layout.leftSpaceToView(topVC.view, 0).topSpaceToView(topVC.view, 0).widthIs(KScreenW).heightIs(KScreenH); |
| | | |
| | | [UIView animateWithDuration:timeAnitmation animations:^{ |
| | | |
| | | self.bgView.frame = CGRectMake(0, KScreenH - ((self.collectionheight * 2) + dissButtonHeght), KScreenW, (self.collectionheight * 2) + dissButtonHeght); |
| | | }]; |
| | | } |
| | | |
| | | - (void)diss { |
| | | |
| | | [UIView animateWithDuration:timeAnitmation animations:^{ |
| | | |
| | | self.bgView.frame = CGRectMake(0, KScreenH, KScreenW, (self.collectionheight * 2) + dissButtonHeght); |
| | | |
| | | [self performSelector:@selector(onDidss) withObject:nil afterDelay:timeAnitmation]; |
| | | }]; |
| | | } |
| | | |
| | | - (void)onDidss { |
| | | |
| | | [self removeFromSuperview]; |
| | | } |
| | | |
| | | - (void)setDataSource { |
| | | |
| | | self.dataArr = @[@"微信好å",@"æåå",@"æ°æµªå¾®å",@"QQ好å",@"QQ空é´"]; |
| | | self.cellHeight = KScreenW / 3; |
| | | self.collectionheight = KScreenW / 3 - 30; |
| | | |
| | | } |
| | | |
| | | - (UIViewController *)appRootViewController { |
| | | UIViewController *appRootVc = [UIApplication sharedApplication].keyWindow.rootViewController; |
| | | //å¦ææ¯æ¨¡æ. |
| | | while (appRootVc.presentedViewController) { |
| | | appRootVc = appRootVc.presentedViewController; |
| | | } |
| | | return appRootVc; |
| | | } |
| | | |
| | | |
| | | - (void)viewConfig { |
| | | |
| | | [self addSubview:self.bgView]; |
| | | |
| | | [self.bgView addSubview:self.collectionView]; |
| | | |
| | | [self.bgView addSubview:self.line]; |
| | | self.line.sd_layout |
| | | .leftSpaceToView(self.bgView, 0) |
| | | .topSpaceToView(self.collectionView, 0) |
| | | .rightSpaceToView(self.bgView, 0) |
| | | .heightIs(1); |
| | | |
| | | [self.bgView addSubview:self.dissButton]; |
| | | self.dissButton.sd_layout |
| | | .leftSpaceToView(self.bgView, 0) |
| | | .topSpaceToView(self.line, 0) |
| | | .rightSpaceToView(self.bgView, 0) |
| | | .bottomSpaceToView(self.bgView, 0); |
| | | } |
| | | |
| | | #pragma mark ----- collectionView ä»£çæ¹æ³ ----- |
| | | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { |
| | | |
| | | self.haveIndex(indexPath.row); |
| | | } |
| | | |
| | | - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { |
| | | |
| | | return self.dataArr.count; |
| | | } |
| | | |
| | | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { |
| | | |
| | | ShareAppCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"shareAppCell" forIndexPath:indexPath]; |
| | | |
| | | cell.dataString = self.dataArr[indexPath.row]; |
| | | |
| | | if (indexPath.row > 2) { |
| | | |
| | | cell.line.hidden = YES; |
| | | |
| | | } else { |
| | | |
| | | cell.line.hidden = NO; |
| | | } |
| | | |
| | | return cell; |
| | | } |
| | | |
| | | #pragma mark æ¯ä¸ªcellç尺寸 |
| | | - (CGSize)collectionView:(UICollectionView *)collectionView |
| | | layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ |
| | | |
| | | return CGSizeMake(self.cellHeight, self.collectionheight); |
| | | } |
| | | |
| | | - (CGFloat)collectionView:(UICollectionView *)collectionView |
| | | layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{ |
| | | return 0; |
| | | } |
| | | |
| | | - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView |
| | | layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{ |
| | | return UIEdgeInsetsMake(0, 0, 0, 0); |
| | | } |
| | | |
| | | #pragma mark --- getter --- |
| | | - (UICollectionView *)collectionView { |
| | | |
| | | if (!_collectionView) { |
| | | UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; |
| | | |
| | | [layout setScrollDirection:UICollectionViewScrollDirectionVertical]; |
| | | // åç´æ¹åçé´è· |
| | | layout.minimumInteritemSpacing = 0; |
| | | // æ°´å¹³æ¹åçé´è· |
| | | layout.minimumLineSpacing = 0; |
| | | |
| | | _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, |
| | | 0, |
| | | KScreenW, |
| | | self.collectionheight * 2) |
| | | collectionViewLayout:layout]; |
| | | |
| | | |
| | | _collectionView.showsVerticalScrollIndicator = NO; |
| | | _collectionView.delegate = self; |
| | | _collectionView.dataSource = self; |
| | | _collectionView.backgroundColor = [UIColor whiteColor]; |
| | | |
| | | [_collectionView registerClass:[ShareAppCell class] forCellWithReuseIdentifier:@"shareAppCell"]; |
| | | } |
| | | return _collectionView; |
| | | } |
| | | |
| | | - (UIView *)bgView { |
| | | |
| | | if (!_bgView) { |
| | | _bgView = [[UIView alloc] initWithFrame:CGRectMake(0, KScreenH, KScreenW, (self.collectionheight * 2) + dissButtonHeght)]; |
| | | _bgView.backgroundColor = [UIColor whiteColor]; |
| | | } |
| | | return _bgView; |
| | | } |
| | | |
| | | - (UIButton *)dissButton { |
| | | |
| | | if (!_dissButton) { |
| | | _dissButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | [_dissButton setTitle:@"åæ¶" forState:UIControlStateNormal]; |
| | | [_dissButton setTitleColor:SJColor(156, 156, 156, 1.0) forState:UIControlStateNormal]; |
| | | _dissButton.titleLabel.font = [UIFont systemFontOfSize:15.0]; |
| | | |
| | | @weakify(self) |
| | | [[_dissButton rac_signalForControlEvents:UIControlEventTouchUpInside] |
| | | subscribeNext:^(UIButton *button) { |
| | | @strongify(self) |
| | | [self diss]; |
| | | }]; |
| | | } |
| | | return _dissButton; |
| | | } |
| | | |
| | | - (UIView *)line { |
| | | |
| | | if (!_line) { |
| | | _line = [[UIView alloc] init]; |
| | | _line.backgroundColor = XYRBackgroundColor; |
| | | } |
| | | return _line; |
| | | } |
| | | |
| | | - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { |
| | | |
| | | [self diss]; |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // HZPhotoBrowser.h |
| | | // photobrowser |
| | | // |
| | | // Created by huangzhenyu on 15-2-3. |
| | | // Copyright (c) 2015å¹´ huangzhenyu. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | |
| | | @class HZButton, HZPhotoBrowser; |
| | | |
| | | //é
ç½®å°å¾åå¤§å¾ |
| | | @protocol HZPhotoBrowserDelegate <NSObject> |
| | | @required |
| | | - (UIImage *)photoBrowser:(HZPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index; |
| | | - (NSURL *)photoBrowser:(HZPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index; |
| | | @end |
| | | |
| | | |
| | | @interface HZPhotoBrowser : UIView <UIScrollViewDelegate> |
| | | //第ä¸ç§å±ç¤ºæ¹å¼ï¼éåºæ¶è½åå°åæ¥çä½ç½®ï¼ï¼éè¦å®ä¹ä¹å¾æ§ä»¶ï¼ä¸é¢ä¸¤ä¸ªåæ°å¿
ä¼ |
| | | @property (nonatomic, weak) UIView *sourceImagesContainerView; |
| | | @property (nonatomic, assign) NSInteger imageCount; |
| | | |
| | | //第äºç§å±ç¤ºæ¹å¼ï¼éåºæ¶ä¸è½åå°åæ¥çä½ç½®ï¼é»è®¤åå°å±å¹æ£ä¸å¤®ï¼ç´æ¥ä¼ url,å¾çurlå表å¿
ä¼ |
| | | @property (nonatomic,strong) NSArray *imageArray; |
| | | |
| | | //ä»ç¬¬å å¼ å¾çå¼å§å±ç¤ºï¼é»è®¤ 0ï¼ç¬¬ä¸ç§æè
第äºç§æ¹å¼å±ç¤ºé½å¿
é¡»ä¼ ï¼ |
| | | @property (nonatomic, assign) int currentImageIndex; |
| | | //æ¯å¦å¨æ¨ªå±çæ¶åç´æ¥æ»¡å®½åº¦ï¼è䏿¯æ»¡é«åº¦ï¼ä¸è¬æ¯å¨æé¿å¾éæ±çæ¶å设置为YES(é»è®¤å¼YES) |
| | | @property (nonatomic, assign) BOOL isFullWidthForLandScape; |
| | | //æ¯å¦æ¯ææ¨ªç«å±ï¼é»è®¤æ¯æï¼YESï¼ |
| | | @property (nonatomic, assign) BOOL isNeedLandscape; |
| | | @property (nonatomic, weak) id<HZPhotoBrowserDelegate> delegate; |
| | | - (void)show; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // HZPhotoBrowser.m |
| | | // photobrowser |
| | | // |
| | | // Created by huangzhenyu on 15-2-3. |
| | | // Copyright (c) 2015å¹´ huangzhenyu. All rights reserved. |
| | | // |
| | | |
| | | #import "HZPhotoBrowser.h" |
| | | #import "UIImageView+WebCache.h" |
| | | #import "HZPhotoBrowserView.h" |
| | | #import "HZPhotoBrowserConfig.h" |
| | | |
| | | |
| | | @interface HZPhotoBrowser() |
| | | @property (nonatomic,strong) UITapGestureRecognizer *singleTap; |
| | | @property (nonatomic,strong) UITapGestureRecognizer *doubleTap; |
| | | @property (nonatomic,strong) UIPanGestureRecognizer *pan; |
| | | @property (nonatomic,strong) UIImageView *tempView; |
| | | @property (nonatomic,strong) UIView *coverView; |
| | | @property (nonatomic,strong) UILabel *tipLabel; |
| | | @property (nonatomic,strong) HZPhotoBrowserView *photoBrowserView; |
| | | @property (nonatomic,assign) UIDeviceOrientation orientation; |
| | | @property (nonatomic,assign) HZPhotoBrowserStyle photoBrowserStyle; |
| | | @end |
| | | @implementation HZPhotoBrowser |
| | | { |
| | | UIScrollView *_scrollView; |
| | | BOOL _hasShowedFistView;//å¼å§å±ç¤ºå¾çæµè§å¨ |
| | | UILabel *_indexLabel; |
| | | UIButton *_saveButton; |
| | | UIView *_contentView; |
| | | } |
| | | |
| | | #pragma mark recyle |
| | | - (id)initWithFrame:(CGRect)frame |
| | | { |
| | | self = [super initWithFrame:frame]; |
| | | if (self) { |
| | | self.backgroundColor = HZPhotoBrowserBackgrounColor; |
| | | self.isFullWidthForLandScape = YES; |
| | | self.isNeedLandscape = YES; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | //å½è§å¾ç§»å¨å®æåè°ç¨ |
| | | - (void)didMoveToSuperview |
| | | { |
| | | [super didMoveToSuperview]; |
| | | //å¤ç䏿 å¯è½è¶ççbug |
| | | _currentImageIndex = _currentImageIndex < 0 ? 0 : _currentImageIndex; |
| | | NSInteger count = _imageCount - 1; |
| | | if (count > 0) { |
| | | if (_currentImageIndex > count) { |
| | | _currentImageIndex = 0; |
| | | } |
| | | } |
| | | [self setupScrollView]; |
| | | [self setupToolbars]; |
| | | [self addGestureRecognizer:self.singleTap]; |
| | | [self addGestureRecognizer:self.doubleTap]; |
| | | [self addGestureRecognizer:self.pan]; |
| | | self.photoBrowserView = _scrollView.subviews[self.currentImageIndex]; |
| | | } |
| | | |
| | | - (void)layoutSubviews |
| | | { |
| | | [super layoutSubviews]; |
| | | // NSLog(@"layoutSubviews -- "); |
| | | CGRect rect = self.bounds; |
| | | rect.size.width += HZPhotoBrowserImageViewMargin * 2; |
| | | _scrollView.bounds = rect; |
| | | _scrollView.center = CGPointMake(self.bounds.size.width *0.5, self.bounds.size.height *0.5); |
| | | NSLog(@"%@",NSStringFromCGRect(_scrollView.frame)); |
| | | CGFloat y = 0; |
| | | __block CGFloat w = _scrollView.frame.size.width - HZPhotoBrowserImageViewMargin * 2; |
| | | CGFloat h = _scrollView.frame.size.height; |
| | | [_scrollView.subviews enumerateObjectsUsingBlock:^(HZPhotoBrowserView *obj, NSUInteger idx, BOOL *stop) { |
| | | CGFloat x = HZPhotoBrowserImageViewMargin + idx * (HZPhotoBrowserImageViewMargin * 2 + w); |
| | | obj.frame = CGRectMake(x, y, w, h); |
| | | }]; |
| | | |
| | | _scrollView.contentSize = CGSizeMake(_scrollView.subviews.count * _scrollView.frame.size.width, _scrollView.frame.size.height); |
| | | _scrollView.contentOffset = CGPointMake(self.currentImageIndex * _scrollView.frame.size.width, 0); |
| | | |
| | | |
| | | if (!_hasShowedFistView) { |
| | | [self showFirstImage]; |
| | | } |
| | | _indexLabel.bounds = CGRectMake(0, 0, 80, 30); |
| | | _indexLabel.center = CGPointMake(self.bounds.size.width * 0.5, 30); |
| | | _saveButton.frame = CGRectMake(30, self.bounds.size.height - 70, 55, 30); |
| | | _tipLabel.frame = CGRectMake((self.bounds.size.width - 150)*0.5, (self.bounds.size.height - 40)*0.5, 150, 40); |
| | | } |
| | | |
| | | - (void)dealloc |
| | | { |
| | | // NSLog(@"å¾çæµè§å¨éæ¯"); |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| | | } |
| | | |
| | | -(void)setSourceImagesContainerView:(UIView *)sourceImagesContainerView{ |
| | | _sourceImagesContainerView = sourceImagesContainerView; |
| | | _imageArray = nil; |
| | | _photoBrowserStyle = HZPhotoBrowserStyleDefault; |
| | | } |
| | | |
| | | - (void)setImageArray:(NSArray *)imageArray{ |
| | | _imageArray = imageArray; |
| | | _imageCount = imageArray.count; |
| | | _sourceImagesContainerView = nil; |
| | | _photoBrowserStyle = HZPhotoBrowserStyleSimple; |
| | | } |
| | | |
| | | #pragma mark getter settter |
| | | - (UITapGestureRecognizer *)singleTap{ |
| | | if (!_singleTap) { |
| | | _singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(photoClick:)]; |
| | | _singleTap.numberOfTapsRequired = 1; |
| | | _singleTap.delaysTouchesBegan = YES; |
| | | //åªè½æä¸ä¸ªæå¿åå¨ |
| | | [_singleTap requireGestureRecognizerToFail:self.doubleTap]; |
| | | } |
| | | return _singleTap; |
| | | } |
| | | |
| | | - (UITapGestureRecognizer *)doubleTap |
| | | { |
| | | if (!_doubleTap) { |
| | | _doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)]; |
| | | _doubleTap.numberOfTapsRequired = 2; |
| | | // _doubleTap.numberOfTouchesRequired = 1; |
| | | } |
| | | return _doubleTap; |
| | | } |
| | | |
| | | - (UIPanGestureRecognizer *)pan{ |
| | | if (!_pan) { |
| | | _pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(didPan:)]; |
| | | } |
| | | return _pan; |
| | | } |
| | | |
| | | - (UIImageView *)tempView{ |
| | | if (!_tempView) { |
| | | HZPhotoBrowserView *photoBrowserView = _scrollView.subviews[self.currentImageIndex]; |
| | | UIImageView *currentImageView = photoBrowserView.imageview; |
| | | CGFloat tempImageX = currentImageView.frame.origin.x - photoBrowserView.scrollOffset.x; |
| | | CGFloat tempImageY = currentImageView.frame.origin.y - photoBrowserView.scrollOffset.y; |
| | | |
| | | CGFloat tempImageW = photoBrowserView.zoomImageSize.width; |
| | | CGFloat tempImageH = photoBrowserView.zoomImageSize.height; |
| | | UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; |
| | | if (UIDeviceOrientationIsLandscape(orientation)) {//æ¨ªå± |
| | | |
| | | //å¤çé¿å¾,å¾ç太é¿ä¼å¯¼è´æè½¬å¨ç»é£æ |
| | | if (tempImageH > KAppHeight) { |
| | | tempImageH = tempImageH > (tempImageW * 1.5)? (tempImageW * 1.5):tempImageH; |
| | | if (fabs(tempImageY) > tempImageH) { |
| | | tempImageY = 0; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | _tempView = [[UIImageView alloc] init]; |
| | | //è¿è¾¹çcontentmodeè¦è· HZPhotoGropéé¢çæé®ç contentmodeä¿æä¸è´ï¼é²æ¢æååºç°éªå¨çå¨ç»ï¼ |
| | | _tempView.contentMode = UIViewContentModeScaleAspectFill; |
| | | _tempView.clipsToBounds = YES; |
| | | _tempView.frame = CGRectMake(tempImageX, tempImageY, tempImageW, tempImageH); |
| | | _tempView.image = currentImageView.image; |
| | | } |
| | | return _tempView; |
| | | } |
| | | |
| | | //åé¢è²æ¸åå¨ç»çviewï¼è®©éåºå¨ç»æ´å æå |
| | | - (UIView *)coverView{ |
| | | if (!_coverView) { |
| | | _coverView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds]; |
| | | _coverView.backgroundColor = HZPhotoBrowserBackgrounColor; |
| | | } |
| | | return _coverView; |
| | | } |
| | | |
| | | - (void)setPhotoBrowserView:(HZPhotoBrowserView *)photoBrowserView{ |
| | | _photoBrowserView = photoBrowserView; |
| | | __weak typeof(self) weakSelf = self; |
| | | _photoBrowserView.scrollViewWillEndDragging = ^(CGPoint velocity,CGPoint offset) { |
| | | __strong typeof(weakSelf) strongSelf = weakSelf; |
| | | if (((velocity.y < -2 && offset.y < 0) || offset.y < -100)) { |
| | | [strongSelf hidePhotoBrowser]; |
| | | } |
| | | }; |
| | | } |
| | | |
| | | - (void)setCurrentImageIndex:(int)currentImageIndex{ |
| | | _currentImageIndex = currentImageIndex < 0 ? 0 : currentImageIndex; |
| | | NSInteger count0 = _imageCount; |
| | | NSInteger count1 = _imageArray.count; |
| | | if (count0 > 0) { |
| | | if (_currentImageIndex > count0) { |
| | | _currentImageIndex = 0; |
| | | } |
| | | } |
| | | if (count1 > 0) { |
| | | if (_currentImageIndex > count1) { |
| | | _currentImageIndex = 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #pragma mark private methods |
| | | - (void)setupToolbars |
| | | { |
| | | // 1. åºæ |
| | | UILabel *indexLabel = [[UILabel alloc] init]; |
| | | indexLabel.textAlignment = NSTextAlignmentCenter; |
| | | indexLabel.textColor = [UIColor whiteColor]; |
| | | indexLabel.font = [UIFont boldSystemFontOfSize:20]; |
| | | indexLabel.backgroundColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:0.3f]; |
| | | indexLabel.bounds = CGRectMake(0, 0, 80, 30); |
| | | indexLabel.center = CGPointMake(kAPPWidth * 0.5, 30); |
| | | indexLabel.layer.cornerRadius = 15; |
| | | indexLabel.clipsToBounds = YES; |
| | | if (self.imageCount > 1) { |
| | | indexLabel.text = [NSString stringWithFormat:@"1/%ld", (long)self.imageCount]; |
| | | _indexLabel = indexLabel; |
| | | [self addSubview:indexLabel]; |
| | | } |
| | | |
| | | // 2.ä¿åæé® |
| | | // UIButton *saveButton = [[UIButton alloc] init]; |
| | | // [saveButton setTitle:@"ä¿å" forState:UIControlStateNormal]; |
| | | // [saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
| | | // saveButton.layer.borderWidth = 0.1; |
| | | // saveButton.layer.borderColor = [UIColor whiteColor].CGColor; |
| | | // saveButton.backgroundColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:0.3f]; |
| | | // saveButton.layer.cornerRadius = 2; |
| | | // saveButton.clipsToBounds = YES; |
| | | // [saveButton addTarget:self action:@selector(saveImage) forControlEvents:UIControlEventTouchUpInside]; |
| | | // _saveButton = saveButton; |
| | | // [self addSubview:saveButton]; |
| | | } |
| | | |
| | | //ä¿åå¾å |
| | | - (void)saveImage |
| | | { |
| | | int index = _scrollView.contentOffset.x / _scrollView.bounds.size.width; |
| | | HZPhotoBrowserView *currentView = _scrollView.subviews[index]; |
| | | if (currentView.hasLoadedImage) { |
| | | UIImageWriteToSavedPhotosAlbum(currentView.imageview.image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL); |
| | | } else { |
| | | [self showTip:HZPhotoBrowserSaveImageFailText]; |
| | | } |
| | | } |
| | | |
| | | - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo; |
| | | { |
| | | if (error) { |
| | | [self showTip:HZPhotoBrowserSaveImageFailText]; |
| | | } else { |
| | | [self showTip:HZPhotoBrowserSaveImageSuccessText]; |
| | | } |
| | | } |
| | | |
| | | - (void)showTip:(NSString *)tipStr{ |
| | | if (_tipLabel) { |
| | | [_tipLabel removeFromSuperview]; |
| | | _tipLabel = nil; |
| | | } |
| | | UILabel *label = [[UILabel alloc] init]; |
| | | _tipLabel = label; |
| | | label.textColor = [UIColor whiteColor]; |
| | | label.backgroundColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:0.90f]; |
| | | label.layer.cornerRadius = 5; |
| | | label.clipsToBounds = YES; |
| | | label.textAlignment = NSTextAlignmentCenter; |
| | | label.font = [UIFont boldSystemFontOfSize:20]; |
| | | label.text = tipStr; |
| | | [self addSubview:label]; |
| | | [label performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1.0]; |
| | | } |
| | | |
| | | - (void)setupScrollView |
| | | { |
| | | _scrollView = [[UIScrollView alloc] init]; |
| | | _scrollView.delegate = self; |
| | | _scrollView.showsHorizontalScrollIndicator = NO; |
| | | _scrollView.showsVerticalScrollIndicator = NO; |
| | | _scrollView.pagingEnabled = YES; |
| | | [self addSubview:_scrollView]; |
| | | for (int i = 0; i < self.imageCount; i++) { |
| | | HZPhotoBrowserView *view = [[HZPhotoBrowserView alloc] init]; |
| | | view.isFullWidthForLandScape = self.isFullWidthForLandScape; |
| | | view.imageview.tag = i; |
| | | [_scrollView addSubview:view]; |
| | | } |
| | | [self setupImageOfImageViewForIndex:self.currentImageIndex]; |
| | | } |
| | | |
| | | // å è½½å¾ç |
| | | - (void)setupImageOfImageViewForIndex:(NSInteger)index |
| | | { |
| | | HZPhotoBrowserView *view = _scrollView.subviews[index]; |
| | | if (view.beginLoadingImage) return; |
| | | if ([self highQualityImageURLForIndex:index]) { |
| | | [view setImageWithURL:[self highQualityImageURLForIndex:index] placeholderImage:[self placeholderImageForIndex:index]]; |
| | | } else { |
| | | view.imageview.image = [self placeholderImageForIndex:index]; |
| | | } |
| | | view.beginLoadingImage = YES; |
| | | } |
| | | |
| | | - (void)onDeviceOrientationChangeWithObserver |
| | | { |
| | | [self onDeviceOrientationChange]; |
| | | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDeviceOrientationChange) name:UIDeviceOrientationDidChangeNotification object:nil]; |
| | | } |
| | | |
| | | -(void)onDeviceOrientationChange |
| | | { |
| | | if (!self.isNeedLandscape) { |
| | | return; |
| | | } |
| | | |
| | | HZPhotoBrowserView *currentView = _scrollView.subviews[self.currentImageIndex]; |
| | | UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; |
| | | self.orientation = orientation; |
| | | if (UIDeviceOrientationIsLandscape(orientation)) { |
| | | if (self.bounds.size.width < self.bounds.size.height) { |
| | | [currentView.scrollview setZoomScale:1.0 animated:YES];//è¿å |
| | | } |
| | | [UIView animateWithDuration:kRotateAnimationDuration delay:0.0f options:UIViewAnimationOptionBeginFromCurrentState animations:^{ |
| | | self.transform = (orientation==UIDeviceOrientationLandscapeRight)?CGAffineTransformMakeRotation(M_PI*1.5):CGAffineTransformMakeRotation(M_PI/2); |
| | | if (iPhoneX) { |
| | | self.center = [UIApplication sharedApplication].keyWindow.center; |
| | | self.bounds = CGRectMake(0, 0, KAppHeight - kStatusBar_Height - kBottomSafeHeight, kAPPWidth); |
| | | } else { |
| | | self.bounds = CGRectMake(0, 0, KAppHeight, kAPPWidth); |
| | | } |
| | | [self setNeedsLayout]; |
| | | [self layoutIfNeeded]; |
| | | } completion:^(BOOL finished) { |
| | | |
| | | }]; |
| | | |
| | | }else if (orientation==UIDeviceOrientationPortrait){ |
| | | if (self.bounds.size.width > self.bounds.size.height) { |
| | | [currentView.scrollview setZoomScale:1.0 animated:YES];//è¿å |
| | | } |
| | | [UIView animateWithDuration:kRotateAnimationDuration delay:0.0f options:UIViewAnimationOptionBeginFromCurrentState animations:^{ |
| | | self.transform = (orientation==UIDeviceOrientationPortrait)?CGAffineTransformIdentity:CGAffineTransformMakeRotation(M_PI); |
| | | if (iPhoneX) { |
| | | self.bounds = CGRectMake(0, 0, kAPPWidth, KAppHeight - kStatusBar_Height - kBottomSafeHeight); |
| | | } else { |
| | | self.bounds = CGRectMake(0, 0, kAPPWidth, KAppHeight); |
| | | } |
| | | |
| | | [self setNeedsLayout]; |
| | | [self layoutIfNeeded]; |
| | | } completion:^(BOOL finished) { |
| | | |
| | | }]; |
| | | |
| | | } |
| | | } |
| | | |
| | | - (void)showFirstImage |
| | | { |
| | | self.userInteractionEnabled = NO; |
| | | if (_photoBrowserStyle == HZPhotoBrowserStyleDefault) { |
| | | UIView *sourceView = self.sourceImagesContainerView.subviews[self.currentImageIndex]; |
| | | CGRect rect = [self.sourceImagesContainerView convertRect:sourceView.frame toView:self]; |
| | | UIImageView *tempView = [[UIImageView alloc] init]; |
| | | tempView.frame = rect; |
| | | tempView.image = [self placeholderImageForIndex:self.currentImageIndex]; |
| | | [self addSubview:tempView]; |
| | | tempView.contentMode = UIViewContentModeScaleAspectFit; |
| | | |
| | | CGFloat placeImageSizeW = tempView.image.size.width; |
| | | CGFloat placeImageSizeH = tempView.image.size.height; |
| | | CGRect targetTemp; |
| | | CGFloat selfW = self.frame.size.width; |
| | | CGFloat selfH = self.frame.size.height; |
| | | |
| | | CGFloat placeHolderH = (placeImageSizeH * selfW)/placeImageSizeW; |
| | | if (placeHolderH <= selfH) { |
| | | targetTemp = CGRectMake(0, (selfH - placeHolderH) * 0.5 , selfW, placeHolderH); |
| | | } else {//å¾çé«åº¦>å±å¹é«åº¦ |
| | | targetTemp = CGRectMake(0, 0, selfW, placeHolderH); |
| | | } |
| | | //å
éèscrollview |
| | | _scrollView.hidden = YES; |
| | | _indexLabel.hidden = YES; |
| | | _saveButton.hidden = YES; |
| | | [UIView animateWithDuration:HZPhotoBrowserShowImageAnimationDuration animations:^{ |
| | | //å°ç¹å»ç临æ¶imageviewå¨ç»æ¾å¤§å°åç®æ imageview䏿 ·å¤§ |
| | | tempView.frame = targetTemp; |
| | | } completion:^(BOOL finished) { |
| | | //å¨ç»å®æåï¼å é¤ä¸´æ¶imageviewï¼è®©ç®æ imageviewæ¾ç¤º |
| | | _hasShowedFistView = YES; |
| | | [tempView removeFromSuperview]; |
| | | _scrollView.hidden = NO; |
| | | _indexLabel.hidden = NO; |
| | | _saveButton.hidden = NO; |
| | | self.userInteractionEnabled = YES; |
| | | }]; |
| | | } else { |
| | | _photoBrowserView.alpha = 0; |
| | | _contentView.alpha = 0; |
| | | [UIView animateWithDuration:0.2 animations:^{ |
| | | //å°ç¹å»ç临æ¶imageviewå¨ç»æ¾å¤§å°åç®æ imageview䏿 ·å¤§ |
| | | _photoBrowserView.alpha = 1; |
| | | _contentView.alpha = 1; |
| | | } completion:^(BOOL finished) { |
| | | _hasShowedFistView = YES; |
| | | self.userInteractionEnabled = YES; |
| | | }]; |
| | | } |
| | | } |
| | | |
| | | - (UIImage *)placeholderImageForIndex:(NSInteger)index |
| | | { |
| | | if (_photoBrowserStyle == HZPhotoBrowserStyleDefault) { |
| | | if ([self.delegate respondsToSelector:@selector(photoBrowser:placeholderImageForIndex:)]) { |
| | | return [self.delegate photoBrowser:self placeholderImageForIndex:index]; |
| | | } |
| | | } else { |
| | | return nil; |
| | | } |
| | | |
| | | return nil; |
| | | } |
| | | |
| | | - (NSURL *)highQualityImageURLForIndex:(NSInteger)index |
| | | { |
| | | if (_photoBrowserStyle == HZPhotoBrowserStyleDefault) { |
| | | if ([self.delegate respondsToSelector:@selector(photoBrowser:highQualityImageURLForIndex:)]) { |
| | | return [self.delegate photoBrowser:self highQualityImageURLForIndex:index]; |
| | | } |
| | | } else { |
| | | return [NSURL URLWithString:_imageArray[index]]; |
| | | } |
| | | return nil; |
| | | } |
| | | |
| | | |
| | | - (void)hidePhotoBrowser |
| | | { |
| | | [self prepareForHide]; |
| | | [self hideAnimation]; |
| | | } |
| | | |
| | | - (void)hideAnimation{ |
| | | self.userInteractionEnabled = NO; |
| | | CGRect targetTemp; |
| | | UIWindow *window = [UIApplication sharedApplication].keyWindow; |
| | | |
| | | UIView *sourceView = [self getSourceView]; |
| | | if (!sourceView) { |
| | | targetTemp = CGRectMake(window.center.x, window.center.y, 0, 0); |
| | | } |
| | | if (_photoBrowserStyle == HZPhotoBrowserStyleDefault) { |
| | | UIView *sourceView = [self getSourceView]; |
| | | targetTemp = [self.sourceImagesContainerView convertRect:sourceView.frame toView:self]; |
| | | } else { |
| | | //é»è®¤åå°å±å¹ä¸å¤® |
| | | targetTemp = CGRectMake(window.center.x, window.center.y, 0, 0); |
| | | } |
| | | self.window.windowLevel = UIWindowLevelNormal;//æ¾ç¤ºç¶ææ |
| | | [UIView animateWithDuration:HZPhotoBrowserHideImageAnimationDuration animations:^{ |
| | | if (_photoBrowserStyle == HZPhotoBrowserStyleDefault) { |
| | | _tempView.transform = CGAffineTransformInvert(self.transform); |
| | | } |
| | | _coverView.alpha = 0; |
| | | _tempView.frame = targetTemp; |
| | | } completion:^(BOOL finished) { |
| | | [self removeFromSuperview]; |
| | | [_tempView removeFromSuperview]; |
| | | [_contentView removeFromSuperview]; |
| | | _tempView = nil; |
| | | _contentView = nil; |
| | | sourceView.hidden = NO; |
| | | }]; |
| | | } |
| | | |
| | | - (UIView *)getSourceView{ |
| | | if (_currentImageIndex <= self.sourceImagesContainerView.subviews.count - 1) { |
| | | UIView *sourceView = self.sourceImagesContainerView.subviews[_currentImageIndex]; |
| | | return sourceView; |
| | | } |
| | | return nil; |
| | | } |
| | | |
| | | - (void)prepareForHide{ |
| | | [_contentView insertSubview:self.coverView belowSubview:self]; |
| | | _saveButton.hidden = YES; |
| | | _indexLabel.hidden = YES; |
| | | [self addSubview:self.tempView]; |
| | | _photoBrowserView.hidden = YES; |
| | | self.backgroundColor = [UIColor clearColor]; |
| | | _contentView.backgroundColor = [UIColor clearColor]; |
| | | UIView *view = [self getSourceView]; |
| | | view.hidden = YES; |
| | | } |
| | | |
| | | - (void)bounceToOrigin{ |
| | | self.userInteractionEnabled = NO; |
| | | [UIView animateWithDuration:HZPhotoBrowserHideImageAnimationDuration animations:^{ |
| | | self.tempView.transform = CGAffineTransformIdentity; |
| | | _coverView.alpha = 1; |
| | | } completion:^(BOOL finished) { |
| | | self.userInteractionEnabled = YES; |
| | | _saveButton.hidden = NO; |
| | | _indexLabel.hidden = NO; |
| | | [_tempView removeFromSuperview]; |
| | | [_coverView removeFromSuperview]; |
| | | _tempView = nil; |
| | | _coverView = nil; |
| | | _photoBrowserView.hidden = NO; |
| | | self.backgroundColor = HZPhotoBrowserBackgrounColor; |
| | | _contentView.backgroundColor = HZPhotoBrowserBackgrounColor; |
| | | UIView *view = [self getSourceView]; |
| | | view.hidden = NO; |
| | | }]; |
| | | } |
| | | |
| | | #pragma mark - scrollviewä»£çæ¹æ³ |
| | | - (void)scrollViewDidScroll:(UIScrollView *)scrollView |
| | | { |
| | | int index = (scrollView.contentOffset.x + _scrollView.bounds.size.width * 0.5) / _scrollView.bounds.size.width; |
| | | _indexLabel.text = [NSString stringWithFormat:@"%d/%ld", index + 1, (long)self.imageCount]; |
| | | long left = index - 1; |
| | | long right = index + 1; |
| | | left = left>0?left : 0; |
| | | right = right>self.imageCount?self.imageCount:right; |
| | | |
| | | for (long i = left; i < right; i++) { |
| | | [self setupImageOfImageViewForIndex:i]; |
| | | } |
| | | } |
| | | |
| | | //scrollviewç»ææ»å¨è°ç¨ |
| | | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView |
| | | { |
| | | int autualIndex = scrollView.contentOffset.x / _scrollView.bounds.size.width; |
| | | //设置å½å䏿 |
| | | self.currentImageIndex = autualIndex; |
| | | self.photoBrowserView = _scrollView.subviews[self.currentImageIndex]; |
| | | |
| | | //å°ä¸æ¯å½åimageviewç缩æ¾å
¨é¨è¿å (è¿ä¸ªæ¹æ³æäºåä½ï¼åæå¯ä»¥æ¹è¿) |
| | | for (HZPhotoBrowserView *view in _scrollView.subviews) { |
| | | if (view.imageview.tag != autualIndex) { |
| | | view.scrollview.zoomScale = 1.0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #pragma mark - tap |
| | | #pragma mark åå» |
| | | - (void)photoClick:(UITapGestureRecognizer *)recognizer |
| | | { |
| | | [self hidePhotoBrowser]; |
| | | } |
| | | |
| | | #pragma mark åå» |
| | | - (void)handleDoubleTap:(UITapGestureRecognizer *)recognizer |
| | | { |
| | | HZPhotoBrowserView *view = _scrollView.subviews[self.currentImageIndex]; |
| | | CGPoint touchPoint = [recognizer locationInView:self]; |
| | | if (view.scrollview.zoomScale <= 1.0) { |
| | | CGFloat scaleX = touchPoint.x + view.scrollview.contentOffset.x;//éè¦æ¾å¤§çå¾ççXç¹ |
| | | CGFloat sacleY = touchPoint.y + view.scrollview.contentOffset.y;//éè¦æ¾å¤§çå¾ççYç¹ |
| | | [view.scrollview zoomToRect:CGRectMake(scaleX, sacleY, 10, 10) animated:YES]; |
| | | } else { |
| | | [view.scrollview setZoomScale:1.0 animated:YES]; //è¿å |
| | | } |
| | | } |
| | | |
| | | #pragma mark é¿æ |
| | | - (void)didPan:(UIPanGestureRecognizer *)panGesture { |
| | | UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; |
| | | if (UIDeviceOrientationIsLandscape(orientation)) {//横å±ä¸å
许æå¨å¾ç |
| | | return; |
| | | } |
| | | //transPoint : ææå¨è§å¾ä¸ç§»å¨çä½ç½®ï¼x,yï¼åä¸ååå³ä¸ºæ£ï¼åä¸åå左为è´ã |
| | | //locationPoint ï¼ ææå¨è§å¾ä¸çä½ç½®ï¼x,yï¼å°±æ¯ææå¨è§å¾æ¬èº«åæ ç³»çä½ç½®ã |
| | | //velocityï¼ ææå¨è§å¾ä¸ç§»å¨çé度ï¼x,yï¼, æ£è´ä¹æ¯ä»£è¡¨æ¹åã |
| | | CGPoint transPoint = [panGesture translationInView:self]; |
| | | // CGPoint locationPoint = [panGesture locationInView:self]; |
| | | CGPoint velocity = [panGesture velocityInView:self];//é度 |
| | | |
| | | switch (panGesture.state) { |
| | | case UIGestureRecognizerStateBegan: |
| | | { |
| | | [self prepareForHide]; |
| | | } |
| | | break; |
| | | case UIGestureRecognizerStateChanged: |
| | | { |
| | | _saveButton.hidden = YES; |
| | | _indexLabel.hidden = YES; |
| | | double delt = 1 - fabs(transPoint.y) / self.frame.size.height; |
| | | delt = MAX(delt, 0); |
| | | double s = MAX(delt, 0.5); |
| | | CGAffineTransform translation = CGAffineTransformMakeTranslation(transPoint.x/s, transPoint.y/s); |
| | | CGAffineTransform scale = CGAffineTransformMakeScale(s, s); |
| | | self.tempView.transform = CGAffineTransformConcat(translation, scale); |
| | | self.coverView.alpha = delt; |
| | | } |
| | | break; |
| | | case UIGestureRecognizerStateEnded: |
| | | // case UIGestureRecognizerStateCancelled: |
| | | { |
| | | if (fabs(transPoint.y) > 220 || fabs(velocity.y) > 500) {//éåºå¾çæµè§å¨ |
| | | [self hideAnimation]; |
| | | } else {//åå°åæ¥çä½ç½® |
| | | [self bounceToOrigin]; |
| | | } |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | #pragma mark public methods |
| | | - (void)show |
| | | { |
| | | _contentView = [[UIView alloc] init]; |
| | | _contentView.backgroundColor = HZPhotoBrowserBackgrounColor; |
| | | |
| | | UIWindow *window = [UIApplication sharedApplication].keyWindow; |
| | | _contentView.center = window.center; |
| | | _contentView.bounds = window.bounds; |
| | | |
| | | if (iPhoneX) { |
| | | self.frame = CGRectMake(0, kStatusBar_Height,kAPPWidth,KAppHeight - kStatusBar_Height - kBottomSafeHeight); |
| | | } else { |
| | | self.frame = _contentView.bounds; |
| | | } |
| | | window.windowLevel = UIWindowLevelStatusBar+10.0f;//éèç¶ææ |
| | | [_contentView addSubview:self]; |
| | | |
| | | [window addSubview:_contentView]; |
| | | |
| | | [self performSelector:@selector(onDeviceOrientationChangeWithObserver) withObject:nil afterDelay:HZPhotoBrowserShowImageAnimationDuration + 0.2]; |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // HZPhotoBrowserConfig.h |
| | | // HZPhotoBrowser |
| | | // |
| | | // Created by huangzhenyu on 15-2-9. |
| | | // Copyright (c) 2015å¹´ huangzhenyu. All rights reserved. |
| | | // |
| | | |
| | | |
| | | typedef enum { |
| | | HZWaitingViewModeLoopDiagram, // ç¯å½¢ |
| | | HZWaitingViewModePieDiagram // 饼å |
| | | } HZWaitingViewMode; |
| | | |
| | | typedef enum { |
| | | HZPhotoBrowserStyleDefault, //å¤æç±»åï¼å¸¦æå¼¹ååä½ç½®å¨ç»ææ |
| | | HZPhotoBrowserStyleSimple // ç®åç±»å |
| | | } HZPhotoBrowserStyle; |
| | | |
| | | #define kMinZoomScale 0.6f |
| | | #define kMaxZoomScale 2.0f |
| | | |
| | | #define kAPPWidth [UIScreen mainScreen].bounds.size.width |
| | | #define KAppHeight [UIScreen mainScreen].bounds.size.height |
| | | |
| | | #define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO) |
| | | //ç¶ææ é«åº¦ï¼iphoneX->44 å
¶ä» 20 |
| | | #define kStatusBar_Height [UIApplication sharedApplication].statusBarFrame.size.height |
| | | //åºé¨å®å
¨è·ç¦» iphoneX->34 å
¶ä» 0 |
| | | #define kBottomSafeHeight (iPhoneX?34.0f:0.0f) |
| | | |
| | | // å¾çè·¯å¾ |
| | | #define HZPhotoBrowserSrc(file) [@"HZPhotoBrowser.bundle" stringByAppendingPathComponent:file] |
| | | #define HZPhotoBrowserImage(file) [UIImage imageNamed:HZPhotoBrowserSrc(file)] |
| | | |
| | | // å¾çä¿åæåæç¤ºæå |
| | | #define HZPhotoBrowserSaveImageSuccessText @" ä¿åæå " |
| | | |
| | | // å¾çä¿å失败æç¤ºæå |
| | | #define HZPhotoBrowserSaveImageFailText @" ä¿å失败 " |
| | | |
| | | // browserèæ¯é¢è² |
| | | #define HZPhotoBrowserBackgrounColor [UIColor colorWithRed:0 green:0 blue:0 alpha:1] |
| | | |
| | | // browserä¸å¾çé´çmargin |
| | | #define HZPhotoBrowserImageViewMargin 10 |
| | | |
| | | //横ç«å±åæ¢å¨ç»æ¶é¿ |
| | | #define kRotateAnimationDuration 0.35f |
| | | |
| | | // browser䏿¾ç¤ºå¾çå¨ç»æ¶é¿ |
| | | #define HZPhotoBrowserShowImageAnimationDuration 0.35f |
| | | |
| | | // browserä¸éèå¾çå¨ç»æ¶é¿ |
| | | #define HZPhotoBrowserHideImageAnimationDuration 0.35f |
| | | |
| | | // å¾çä¸è½½è¿åº¦æç¤ºè¿åº¦æ¾ç¤ºæ ·å¼ï¼HZWaitingViewModeLoopDiagram ç¯å½¢ï¼HZWaitingViewModePieDiagram 饼åï¼ |
| | | #define HZWaitingViewProgressMode HZWaitingViewModeLoopDiagram |
| | | |
| | | // å¾çä¸è½½è¿åº¦æç¤ºå¨èæ¯è² |
| | | #define HZWaitingViewBackgroundColor [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7] |
| | | //#define HZWaitingViewBackgroundColor [UIColor clearColor] |
| | | |
| | | // å¾çä¸è½½è¿åº¦æç¤ºå¨å
鍿§ä»¶é´çé´è· |
| | | #define HZWaitingViewItemMargin 10 |
| | | |
New file |
| | |
| | | // |
| | | // HZPhotoBrowserView.h |
| | | // HZPhotoBrowser |
| | | // |
| | | // Created by huangzhenyu on 15/5/7. |
| | | // Copyright (c) 2015å¹´ huangzhenyu. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | @interface HZPhotoBrowserView : UIView |
| | | @property (nonatomic,strong) UIScrollView *scrollview; |
| | | @property (nonatomic,strong) UIImageView *imageview; |
| | | @property (nonatomic, assign) CGFloat progress; |
| | | @property (nonatomic, assign) BOOL beginLoadingImage; |
| | | /**夿å¾çæ¯å¦å è½½æå*/ |
| | | @property (nonatomic, assign) BOOL hasLoadedImage; |
| | | @property (nonatomic,assign) CGSize zoomImageSize; |
| | | @property (nonatomic,assign) CGPoint scrollOffset; |
| | | @property (nonatomic, strong) void(^scrollViewDidScroll)(CGPoint offset); |
| | | @property (nonatomic,copy) void(^scrollViewWillEndDragging)(CGPoint velocity,CGPoint offset);//è¿åscrollViewæ»å¨é度 |
| | | @property (nonatomic,copy) void(^scrollViewDidEndDecelerating)(); |
| | | @property (nonatomic, assign) BOOL isFullWidthForLandScape; |
| | | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder; |
| | | @end |
New file |
| | |
| | | // |
| | | // HZPhotoBrowserView.m |
| | | // HZPhotoBrowser |
| | | // |
| | | // Created by huangzhenyu on 15/5/7. |
| | | // Copyright (c) 2015å¹´ huangzhenyu. All rights reserved. |
| | | // |
| | | |
| | | #import "HZPhotoBrowserView.h" |
| | | #import "HZWaitingView.h" |
| | | #import "UIImageView+WebCache.h" |
| | | |
| | | @interface HZPhotoBrowserView() <UIScrollViewDelegate> |
| | | @property (nonatomic,strong) HZWaitingView *waitingView; |
| | | @property (nonatomic, strong) NSURL *imageUrl; |
| | | @property (nonatomic, strong) UIImage *placeHolderImage; |
| | | @property (nonatomic, strong) UIButton *reloadButton; |
| | | @end |
| | | |
| | | @implementation HZPhotoBrowserView |
| | | #pragma mark recyle |
| | | - (instancetype)initWithFrame:(CGRect)frame |
| | | { |
| | | if (self = [super initWithFrame:frame]) { |
| | | [self addSubview:self.scrollview]; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)layoutSubviews |
| | | { |
| | | [super layoutSubviews]; |
| | | CGFloat selfW = self.bounds.size.width; |
| | | CGFloat selfH = self.bounds.size.height; |
| | | _waitingView.center = CGPointMake(selfW * 0.5, selfH * 0.5); |
| | | _scrollview.frame = self.bounds; |
| | | CGFloat reloadBtnW = 200; |
| | | CGFloat reloadBtnH = 40; |
| | | _reloadButton.frame = CGRectMake((selfW - reloadBtnW)*0.5, (selfH - reloadBtnH)*0.5, reloadBtnW, reloadBtnH); |
| | | [self adjustFrame]; |
| | | } |
| | | |
| | | #pragma mark getter setter |
| | | - (UIScrollView *)scrollview |
| | | { |
| | | if (!_scrollview) { |
| | | _scrollview = [[UIScrollView alloc] init]; |
| | | _scrollview.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height); |
| | | _scrollview.showsVerticalScrollIndicator = NO; |
| | | _scrollview.showsHorizontalScrollIndicator = NO; |
| | | [_scrollview addSubview:self.imageview]; |
| | | _scrollview.delegate = self; |
| | | _scrollview.clipsToBounds = YES; |
| | | } |
| | | return _scrollview; |
| | | } |
| | | |
| | | - (UIImageView *)imageview |
| | | { |
| | | if (!_imageview) { |
| | | _imageview = [[UIImageView alloc] init]; |
| | | _imageview.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height); |
| | | _imageview.userInteractionEnabled = YES; |
| | | } |
| | | return _imageview; |
| | | } |
| | | |
| | | - (void)setProgress:(CGFloat)progress |
| | | { |
| | | _progress = progress; |
| | | _waitingView.progress = progress; |
| | | } |
| | | |
| | | #pragma mark public methods |
| | | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder |
| | | { |
| | | if (_reloadButton) { |
| | | [_reloadButton removeFromSuperview]; |
| | | } |
| | | _imageUrl = url; |
| | | _placeHolderImage = placeholder; |
| | | //æ·»å è¿åº¦æç¤ºå¨ |
| | | HZWaitingView *waitingView = [[HZWaitingView alloc] init]; |
| | | waitingView.mode = HZWaitingViewModeLoopDiagram; |
| | | waitingView.center = CGPointMake(self.bounds.size.width * 0.5, self.bounds.size.height * 0.5); |
| | | self.waitingView = waitingView; |
| | | [self addSubview:waitingView]; |
| | | |
| | | //HZWebImageå è½½å¾ç |
| | | __weak __typeof(self)weakSelf = self; |
| | | [_imageview sd_setImageWithURL:url placeholderImage:placeholder options:SDWebImageRetryFailed progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { |
| | | __strong __typeof(weakSelf)strongSelf = weakSelf; |
| | | |
| | | //å¨ä¸»çº¿ç¨åUIæ´æ° |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | strongSelf.waitingView.progress = (CGFloat)receivedSize / expectedSize; |
| | | }); |
| | | |
| | | } completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { |
| | | __strong __typeof(weakSelf)strongSelf = weakSelf; |
| | | [_waitingView removeFromSuperview]; |
| | | |
| | | if (error) { |
| | | //å¾çå 载失败çå¤çï¼æ¤å¤å¯ä»¥èªå®ä¹åç§æä½ï¼...ï¼ |
| | | strongSelf.hasLoadedImage = NO;//å¾çå 载失败 |
| | | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | strongSelf.reloadButton = button; |
| | | button.layer.cornerRadius = 2; |
| | | button.clipsToBounds = YES; |
| | | // button.bounds = CGRectMake(0, 0, 200, 40); |
| | | // button.center = CGPointMake(self.bounds.size.height * 0.5, self.bounds.size.height * 0.5); |
| | | button.titleLabel.font = [UIFont systemFontOfSize:14]; |
| | | button.backgroundColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:0.3f]; |
| | | [button setTitle:@"å¾çå 载失败ï¼ç¹å»éæ°å è½½" forState:UIControlStateNormal]; |
| | | [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
| | | [button addTarget:strongSelf action:@selector(reloadImage) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | [self addSubview:button]; |
| | | return; |
| | | } |
| | | //å è½½æåéæ°è®¡ç®frame,è§£å³é¿å¾å¯è½æ¾ç¤ºä¸æ£ç¡®çé®é¢ |
| | | [self setNeedsLayout]; |
| | | strongSelf.hasLoadedImage = YES;//å¾çå è½½æå |
| | | }]; |
| | | } |
| | | |
| | | #pragma mark private methods |
| | | - (void)reloadImage |
| | | { |
| | | [self setImageWithURL:_imageUrl placeholderImage:_placeHolderImage]; |
| | | } |
| | | |
| | | - (void)adjustFrame |
| | | { |
| | | // CGRect frame = self.scrollview.frame; |
| | | CGRect frame = self.frame; |
| | | // NSLog(@"%@",NSStringFromCGRect(self.frame)); |
| | | if (self.imageview.image) { |
| | | CGSize imageSize = self.imageview.image.size;//è·å¾å¾ççsize |
| | | CGRect imageFrame = CGRectMake(0, 0, imageSize.width, imageSize.height); |
| | | if (_isFullWidthForLandScape) {//å¾ç宽度å§ç»==å±å¹å®½åº¦(æ°æµªå¾®åå°±æ¯è¿ç§ææ) |
| | | CGFloat ratio = frame.size.width/imageFrame.size.width; |
| | | imageFrame.size.height = imageFrame.size.height*ratio; |
| | | imageFrame.size.width = frame.size.width; |
| | | } else{ |
| | | if (frame.size.width<=frame.size.height) { |
| | | //ç«å±æ¶å |
| | | CGFloat ratio = frame.size.width/imageFrame.size.width; |
| | | imageFrame.size.height = imageFrame.size.height*ratio; |
| | | imageFrame.size.width = frame.size.width; |
| | | }else{ //横å±çæ¶å |
| | | CGFloat ratio = frame.size.height/imageFrame.size.height; |
| | | imageFrame.size.width = imageFrame.size.width*ratio; |
| | | imageFrame.size.height = frame.size.height; |
| | | } |
| | | } |
| | | |
| | | self.imageview.frame = imageFrame; |
| | | // NSLog(@"%@",NSStringFromCGRect(_scrollview.frame)); |
| | | // NSLog(@"%@",NSStringFromCGRect(self.imageview.frame)); |
| | | // self.scrollview.frame = self.imageview.frame; |
| | | self.scrollview.contentSize = self.imageview.frame.size; |
| | | self.imageview.center = [self centerOfScrollViewContent:self.scrollview]; |
| | | |
| | | //æ ¹æ®å¾ç大尿¾å°æå¤§ç¼©æ¾ç级ï¼ä¿è¯æå¤§ç¼©æ¾æ¶åï¼ä¸ä¼æé»è¾¹ |
| | | CGFloat maxScale = frame.size.height/imageFrame.size.height; |
| | | maxScale = frame.size.width/imageFrame.size.width>maxScale?frame.size.width/imageFrame.size.width:maxScale; |
| | | //è¶
è¿äºè®¾ç½®çæå¤§çæç®æ° |
| | | maxScale = maxScale>kMaxZoomScale?maxScale:kMaxZoomScale; |
| | | //åå§å |
| | | self.scrollview.minimumZoomScale = kMinZoomScale; |
| | | self.scrollview.maximumZoomScale = maxScale; |
| | | self.scrollview.zoomScale = 1.0f; |
| | | }else{ |
| | | frame.origin = CGPointZero; |
| | | self.imageview.frame = frame; |
| | | //éç½®å
å®¹å¤§å° |
| | | self.scrollview.contentSize = self.imageview.frame.size; |
| | | } |
| | | self.scrollview.contentOffset = CGPointZero; |
| | | self.zoomImageSize = self.imageview.frame.size; |
| | | } |
| | | |
| | | - (CGPoint)centerOfScrollViewContent:(UIScrollView *)scrollView |
| | | { |
| | | CGFloat offsetX = (scrollView.bounds.size.width > scrollView.contentSize.width)? |
| | | (scrollView.bounds.size.width - scrollView.contentSize.width) * 0.5 : 0.0; |
| | | CGFloat offsetY = (scrollView.bounds.size.height > scrollView.contentSize.height)? |
| | | (scrollView.bounds.size.height - scrollView.contentSize.height) * 0.5 : 0.0; |
| | | CGPoint actualCenter = CGPointMake(scrollView.contentSize.width * 0.5 + offsetX, |
| | | scrollView.contentSize.height * 0.5 + offsetY); |
| | | return actualCenter; |
| | | } |
| | | |
| | | #pragma mark UIScrollViewDelegate |
| | | - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView |
| | | { |
| | | return self.imageview; |
| | | } |
| | | |
| | | - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale{ |
| | | self.zoomImageSize = view.frame.size; |
| | | self.scrollOffset = scrollView.contentOffset; |
| | | } |
| | | |
| | | - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset{ |
| | | if(self.scrollViewWillEndDragging){ |
| | | self.scrollViewWillEndDragging(velocity, scrollView.contentOffset); |
| | | } |
| | | } |
| | | |
| | | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ |
| | | if (self.scrollViewDidEndDecelerating) { |
| | | self.scrollViewDidEndDecelerating(); |
| | | } |
| | | } |
| | | |
| | | - (void)scrollViewDidZoom:(UIScrollView *)scrollView //è¿éæ¯ç¼©æ¾è¿è¡æ¶è°æ´ |
| | | { |
| | | self.imageview.center = [self centerOfScrollViewContent:scrollView]; |
| | | } |
| | | |
| | | - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ |
| | | self.scrollOffset = scrollView.contentOffset; |
| | | if (self.scrollViewDidScroll) { |
| | | self.scrollViewDidScroll(self.scrollOffset); |
| | | } |
| | | } |
| | | @end |
New file |
| | |
| | | // |
| | | // HZWaitingView.h |
| | | // HZPhotoBrowser |
| | | // |
| | | // Created by huangzhenyu on 15-2-6. |
| | | // Copyright (c) 2015å¹´ huangzhenyu. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import "HZPhotoBrowserConfig.h" |
| | | |
| | | @interface HZWaitingView : UIView |
| | | |
| | | @property (nonatomic, assign) CGFloat progress; |
| | | @property (nonatomic, assign) int mode; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // HZWaitingView.m |
| | | // HZPhotoBrowser |
| | | // |
| | | // Created by huangzhenyu on 15-2-6. |
| | | // Copyright (c) 2015å¹´ huangzhenyu. All rights reserved. |
| | | // |
| | | |
| | | #import "HZWaitingView.h" |
| | | @implementation HZWaitingView |
| | | |
| | | |
| | | - (id)initWithFrame:(CGRect)frame |
| | | { |
| | | self = [super initWithFrame:frame]; |
| | | if (self) { |
| | | self.backgroundColor = HZWaitingViewBackgroundColor; |
| | | self.clipsToBounds = YES; |
| | | self.mode = HZWaitingViewModeLoopDiagram; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)setProgress:(CGFloat)progress |
| | | { |
| | | _progress = progress; |
| | | [self setNeedsDisplay]; |
| | | if (progress >= 1) { |
| | | [self removeFromSuperview]; |
| | | } |
| | | } |
| | | |
| | | - (void)setFrame:(CGRect)frame |
| | | { |
| | | //è®¾ç½®èæ¯å¾ä¸ºå |
| | | frame.size.width = 50; |
| | | frame.size.height = 50; |
| | | self.layer.cornerRadius = 25; |
| | | [super setFrame:frame]; |
| | | } |
| | | |
| | | - (void)drawRect:(CGRect)rect |
| | | { |
| | | CGContextRef ctx = UIGraphicsGetCurrentContext(); |
| | | |
| | | CGFloat xCenter = rect.size.width * 0.5; |
| | | CGFloat yCenter = rect.size.height * 0.5; |
| | | [[UIColor whiteColor] set]; |
| | | |
| | | switch (self.mode) { |
| | | case HZWaitingViewModePieDiagram: |
| | | { |
| | | CGFloat radius = MIN(rect.size.width * 0.5, rect.size.height * 0.5) - HZWaitingViewItemMargin; |
| | | |
| | | |
| | | CGFloat w = radius * 2 + HZWaitingViewItemMargin; |
| | | CGFloat h = w; |
| | | CGFloat x = (rect.size.width - w) * 0.5; |
| | | CGFloat y = (rect.size.height - h) * 0.5; |
| | | CGContextAddEllipseInRect(ctx, CGRectMake(x, y, w, h)); |
| | | CGContextFillPath(ctx); |
| | | |
| | | [HZWaitingViewBackgroundColor set]; |
| | | CGContextMoveToPoint(ctx, xCenter, yCenter); |
| | | CGContextAddLineToPoint(ctx, xCenter, 0); |
| | | CGFloat to = - M_PI * 0.5 + self.progress * M_PI * 2 + 0.001; // åå§å¼ |
| | | CGContextAddArc(ctx, xCenter, yCenter, radius, - M_PI * 0.5, to, 1); |
| | | CGContextClosePath(ctx); |
| | | |
| | | CGContextFillPath(ctx); |
| | | } |
| | | break; |
| | | |
| | | default: |
| | | { |
| | | CGContextSetLineWidth(ctx, 4); |
| | | CGContextSetLineCap(ctx, kCGLineCapRound); |
| | | CGFloat to = - M_PI * 0.5 + self.progress * M_PI * 2 + 0.05; // åå§å¼0.05 |
| | | CGFloat radius = MIN(rect.size.width, rect.size.height) * 0.5 - HZWaitingViewItemMargin; |
| | | CGContextAddArc(ctx, xCenter, yCenter, radius, - M_PI * 0.5, to, 0); |
| | | CGContextStrokePath(ctx); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // ALBaseController.h |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/23. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "MainBaseController.h" |
| | | |
| | | @interface ALBaseController : MainBaseController |
| | | |
| | | @property (nonatomic,strong)SJNoNetwork *noNetworkView; |
| | | |
| | | - (void)loadNoNetworkView; |
| | | - (void)loadData; |
| | | - (BOOL)homeIsShowNetWorkView; |
| | | |
| | | - (void)NetWorkStatesChange:(NSNotification *)sender; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // ALBaseController.m |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/23. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "ALBaseController.h" |
| | | |
| | | @interface ALBaseController () |
| | | |
| | | @end |
| | | |
| | | @implementation ALBaseController |
| | | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | |
| | | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(NetWorkStatesChange:) name:@"netWorkChangeEventNotification" object:nil]; |
| | | |
| | | [self .view addSubview:self.noNetworkView]; |
| | | |
| | | NSNotification *notice = [[NSNotification alloc]initWithName:@"netWorkChangeEventNotification" object:@([YTHsharedManger startManger].networkStatus) userInfo:nil]; |
| | | |
| | | [self NetWorkStatesChange:notice]; |
| | | } |
| | | |
| | | #pragma mark - ç½ç»ç¶æåçååéç¥æ¹æ³ |
| | | - (void)NetWorkStatesChange:(NSNotification *)sender { |
| | | |
| | | BOOL canThouth = [self checkNetCanUse]; |
| | | NSLog(@"canThouth:%c",canThouth); |
| | | [YTHsharedManger startManger].isCheckNetCanUse = 0; |
| | | NSDictionary *urlDic = [[NSUserDefaults standardUserDefaults]objectForKey:@"MainUrlArray"]; |
| | | BOOL urlRequest = NO; |
| | | if (urlDic == nil) { |
| | | urlRequest = YES; |
| | | } |
| | | int networkState = [[sender object] intValue]; |
| | | switch (networkState) { |
| | | case -1: { |
| | | //æªç¥ç½ç»ç¶æ |
| | | |
| | | ALToastCenter(@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | |
| | | } |
| | | break; |
| | | |
| | | case 0: |
| | | //没æç½ç» |
| | | self.noNetworkView.primtTitle.text = @"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"; |
| | | [self.noNetworkView.iconImage setImage:[UIImage imageNamed:@"æ ç½å ä½å¾"]]; |
| | | |
| | | // é¦é¡µç¹æ |
| | | if ([self homeIsShowNetWorkView]) { |
| | | |
| | | [self loadNoNetworkView]; |
| | | |
| | | } else { |
| | | |
| | | self.noNetworkView.hidden = YES; |
| | | } |
| | | |
| | | break; |
| | | |
| | | case 1: |
| | | //3Gæè
4Gï¼åæ£ç¨çæ¯æµé |
| | | |
| | | if (urlRequest) { |
| | | [self isJumpTaobao]; |
| | | } |
| | | self.noNetworkView.hidden = YES; |
| | | [self loadData]; |
| | | |
| | | break; |
| | | |
| | | case 2: |
| | | //WIFIç½ç» |
| | | if (canThouth) { |
| | | if (urlRequest) { |
| | | [self isJumpTaobao]; |
| | | } |
| | | |
| | | self.noNetworkView.hidden = YES; |
| | | [self loadData]; |
| | | |
| | | } else { |
| | | |
| | | [YTHsharedManger startManger].isCheckNetCanUse = -2; |
| | | |
| | | // é¦é¡µç¹æ |
| | | if ([self homeIsShowNetWorkView]) { |
| | | |
| | | self.noNetworkView.primtTitle.text = @"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"; |
| | | [self.noNetworkView.iconImage setImage:[UIImage imageNamed:@"ç½ç»é误"]]; |
| | | [self loadNoNetworkView]; |
| | | |
| | | } else { |
| | | |
| | | self.noNetworkView.hidden = YES; |
| | | [self loadData]; |
| | | } |
| | | } |
| | | break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | - (void)loadNoNetworkView{ |
| | | [self.view bringSubviewToFront:self.noNetworkView]; |
| | | self.noNetworkView.hidden = NO; |
| | | } |
| | | - (void)ClickConnectBtn:(UIButton *)sender{ |
| | | if (iOS10) { |
| | | NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; |
| | | if( [[UIApplication sharedApplication]canOpenURL:url] ) { |
| | | [[UIApplication sharedApplication]openURL:url options:@{}completionHandler:^(BOOL success) { |
| | | }]; |
| | | } |
| | | }else{ |
| | | NSURL *url= [NSURL URLWithString:@"prefs:root=com.haicaojie-ios"]; |
| | | if( [[UIApplication sharedApplication]canOpenURL:url] ) { |
| | | [[UIApplication sharedApplication]openURL:url]; |
| | | } |
| | | } |
| | | |
| | | } |
| | | - (SJNoNetwork *)noNetworkView{ |
| | | if (_noNetworkView) { |
| | | return _noNetworkView; |
| | | } |
| | | _noNetworkView = [[SJNoNetwork alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH)]; |
| | | _noNetworkView.backgroundColor = XYRBackgroundColor; |
| | | [_noNetworkView.connectBtn addTarget:self action:@selector(ClickConnectBtn:) forControlEvents:UIControlEventTouchUpInside]; |
| | | _noNetworkView.hidden = YES; |
| | | return _noNetworkView; |
| | | } |
| | | |
| | | - (void)loadData {} |
| | | |
| | | - (BOOL)homeIsShowNetWorkView { |
| | | |
| | | return NO; |
| | | } |
| | | |
| | | |
| | | - (void)dealloc{ |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| | | } |
| | | |
| | | - (void)didReceiveMemoryWarning { |
| | | [super didReceiveMemoryWarning]; |
| | | // Dispose of any resources that can be recreated. |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // MainBaseController.h |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/23. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import "SJNoNetwork.h" |
| | | |
| | | @interface MainBaseController : UIViewController |
| | | |
| | | - (NSString *)timestampChange:(NSString *)timeStr; |
| | | - (void)setBorderWithView:(UIView *)view top:(BOOL)top left:(BOOL)left bottom:(BOOL)bottom right:(BOOL)right borderColor:(UIColor *)color borderWidth:(CGFloat)width; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // MainBaseController.m |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/23. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "MainBaseController.h" |
| | | |
| | | @interface MainBaseController () |
| | | |
| | | @end |
| | | |
| | | @implementation MainBaseController |
| | | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | |
| | | self.view.backgroundColor=XYRBackgroundColor; |
| | | self.automaticallyAdjustsScrollViewInsets=NO; |
| | | UIImage *image = [UIImage imageNamed:@"F72A37B3-8434-44EE-A2BA-BDCEB598C99F"]; |
| | | //廿éæåå¯¼èªæ ä¸è¾¹çé»è¾¹ |
| | | [self.navigationController.navigationBar setShadowImage:image]; |
| | | UIButton *backbutton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | backbutton.frame=CGRectMake(0, 0, 30, 30); |
| | | [backbutton setImage:[UIImage imageNamed:@"第äºçè¿åæé®"] forState:UIControlStateNormal]; |
| | | [backbutton addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside]; |
| | | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backbutton]; |
| | | } |
| | | |
| | | - (void)back:(UIBarButtonItem*)item { |
| | | [self.navigationController popViewControllerAnimated:YES]; |
| | | } |
| | | |
| | | - (void)viewWillAppear:(BOOL)animated { |
| | | [super viewWillAppear:animated]; |
| | | |
| | | if (self.title.length > 0) { |
| | | [MobClick beginLogPageView:self.title]; |
| | | } else{ |
| | | [MobClick beginLogPageView:self.navigationItem.title]; |
| | | } |
| | | } |
| | | |
| | | - (void)viewWillDisappear:(BOOL)animated { |
| | | [super viewWillDisappear:animated]; |
| | | |
| | | if (self.title.length > 0) { |
| | | [MobClick endLogPageView:self.title]; |
| | | } else{ |
| | | [MobClick endLogPageView:self.navigationItem.title]; |
| | | } |
| | | } |
| | | |
| | | |
| | | //æ¯«ç§æ°æ¶é´æ³è½¬ |
| | | - (NSString *)timestampChange:(NSString *)timeStr{ |
| | | |
| | | long long time=[timeStr longLongValue]; |
| | | |
| | | NSDate *d = [[NSDate alloc]initWithTimeIntervalSince1970:time/1000.0]; |
| | | |
| | | NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; |
| | | |
| | | [formatter setDateFormat:@"yyyy/MM/dd HH:mm"]; |
| | | |
| | | NSString*timeString=[formatter stringFromDate:d]; |
| | | |
| | | return timeString; |
| | | } |
| | | //设置viewæä¸éçè¾¹æ¡ |
| | | - (void)setBorderWithView:(UIView *)view top:(BOOL)top left:(BOOL)left bottom:(BOOL)bottom right:(BOOL)right borderColor:(UIColor *)color borderWidth:(CGFloat)width |
| | | { |
| | | if (top) { |
| | | CALayer *layer = [CALayer layer]; |
| | | layer.frame = CGRectMake(0, 0, view.frame.size.width, width); |
| | | layer.backgroundColor = color.CGColor; |
| | | [view.layer addSublayer:layer]; |
| | | } |
| | | if (left) { |
| | | CALayer *layer = [CALayer layer]; |
| | | layer.frame = CGRectMake(0, 0, width, view.frame.size.height); |
| | | layer.backgroundColor = color.CGColor; |
| | | [view.layer addSublayer:layer]; |
| | | } |
| | | if (bottom) { |
| | | CALayer *layer = [CALayer layer]; |
| | | layer.frame = CGRectMake(0, view.frame.size.height - width, view.frame.size.width, width); |
| | | layer.backgroundColor = color.CGColor; |
| | | [view.layer addSublayer:layer]; |
| | | } |
| | | if (right) { |
| | | CALayer *layer = [CALayer layer]; |
| | | layer.frame = CGRectMake(view.frame.size.width - width, 0, width, view.frame.size.height); |
| | | layer.backgroundColor = color.CGColor; |
| | | [view.layer addSublayer:layer]; |
| | | } |
| | | } |
| | | |
| | | - (void)didReceiveMemoryWarning { |
| | | [super didReceiveMemoryWarning]; |
| | | // Dispose of any resources that can be recreated. |
| | | } |
| | | |
| | | @end |
| | |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import "SJNoNetwork.h" |
| | | #import "MainBaseController.h" |
| | | |
| | | @interface SJBaseViewController : UIViewController |
| | | @interface SJBaseViewController : MainBaseController |
| | | @property (nonatomic,strong)SJNoNetwork *noNetworkView; |
| | | |
| | | - (void)loadNoNetworkView; |
| | | - (BOOL)datasourceIsNull; |
| | | - (void)loadData; |
| | | |
| | | - (BOOL)homeIsShowNetWorkView; |
| | | -(void)NetWorkStatesChange:(NSNotification *)sender; |
| | | - (NSString *)timestampChange:(NSString *)timeStr; |
| | | - (void)setBorderWithView:(UIView *)view top:(BOOL)top left:(BOOL)left bottom:(BOOL)bottom right:(BOOL)right borderColor:(UIColor *)color borderWidth:(CGFloat)width; |
| | | |
| | | @end |
| | |
| | | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | self.view.backgroundColor=XYRBackgroundColor; |
| | | self.automaticallyAdjustsScrollViewInsets=NO; |
| | | UIImage *image = [UIImage imageNamed:@"F72A37B3-8434-44EE-A2BA-BDCEB598C99F"]; |
| | | //廿éæåå¯¼èªæ ä¸è¾¹çé»è¾¹ |
| | | [self.navigationController.navigationBar setShadowImage:image]; |
| | | UIButton *backbutton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | backbutton.frame=CGRectMake(0, 0, 30, 30); |
| | | [backbutton setImage:[UIImage imageNamed:@"第äºçè¿åæé®"] forState:UIControlStateNormal]; |
| | | [backbutton addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside]; |
| | | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backbutton]; |
| | | |
| | | |
| | | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(NetWorkStatesChange:) name:@"netWorkChangeEventNotification" object:nil]; |
| | | |
| | | [self .view addSubview:self.noNetworkView]; |
| | | // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkError:) name:@"networkError" object:nil]; |
| | | |
| | | |
| | | } |
| | | - (void)back:(UIBarButtonItem*)item { |
| | | [self.navigationController popViewControllerAnimated:YES]; |
| | | } |
| | | |
| | | //æ¯«ç§æ°æ¶é´æ³è½¬ |
| | | - (NSString *)timestampChange:(NSString *)timeStr{ |
| | | |
| | | long long time=[timeStr longLongValue]; |
| | | |
| | | NSDate *d = [[NSDate alloc]initWithTimeIntervalSince1970:time/1000.0]; |
| | | |
| | | NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; |
| | | |
| | | [formatter setDateFormat:@"yyyy/MM/dd HH:mm"]; |
| | | |
| | | NSString*timeString=[formatter stringFromDate:d]; |
| | | |
| | | return timeString; |
| | | } |
| | | //设置viewæä¸éçè¾¹æ¡ |
| | | - (void)setBorderWithView:(UIView *)view top:(BOOL)top left:(BOOL)left bottom:(BOOL)bottom right:(BOOL)right borderColor:(UIColor *)color borderWidth:(CGFloat)width |
| | | { |
| | | if (top) { |
| | | CALayer *layer = [CALayer layer]; |
| | | layer.frame = CGRectMake(0, 0, view.frame.size.width, width); |
| | | layer.backgroundColor = color.CGColor; |
| | | [view.layer addSublayer:layer]; |
| | | } |
| | | if (left) { |
| | | CALayer *layer = [CALayer layer]; |
| | | layer.frame = CGRectMake(0, 0, width, view.frame.size.height); |
| | | layer.backgroundColor = color.CGColor; |
| | | [view.layer addSublayer:layer]; |
| | | } |
| | | if (bottom) { |
| | | CALayer *layer = [CALayer layer]; |
| | | layer.frame = CGRectMake(0, view.frame.size.height - width, view.frame.size.width, width); |
| | | layer.backgroundColor = color.CGColor; |
| | | [view.layer addSublayer:layer]; |
| | | } |
| | | if (right) { |
| | | CALayer *layer = [CALayer layer]; |
| | | layer.frame = CGRectMake(view.frame.size.width - width, 0, width, view.frame.size.height); |
| | | layer.backgroundColor = color.CGColor; |
| | | [view.layer addSublayer:layer]; |
| | | } |
| | | } |
| | | - (void)viewWillAppear:(BOOL)animated{ |
| | | - (void)viewWillAppear:(BOOL)animated { |
| | | [super viewWillAppear:animated]; |
| | | |
| | | NSNotification *notice = [[NSNotification alloc]initWithName:@"netWorkChangeEventNotification" object:@([YTHsharedManger startManger].networkStatus) userInfo:nil]; |
| | | |
| | | [self NetWorkStatesChange:notice]; |
| | | if (self.title.length > 0) { |
| | | [MobClick beginLogPageView:self.title]; |
| | | } else{ |
| | | [MobClick beginLogPageView:self.navigationItem.title]; |
| | | NSLog(@"%@",self.navigationItem.title); |
| | | } |
| | | } |
| | | |
| | | - (void)viewWillDisappear:(BOOL)animated{ |
| | | - (void)viewWillDisappear:(BOOL)animated { |
| | | [super viewWillDisappear:animated]; |
| | | if (self.title.length > 0) { |
| | | [MobClick endLogPageView:self.title]; |
| | | } else{ |
| | | [MobClick endLogPageView:self.navigationItem.title]; |
| | | } |
| | | |
| | | } |
| | | |
| | | #pragma mark - ç½ç»ç¶æåçååéç¥æ¹æ³ |
| | | -(void)NetWorkStatesChange:(NSNotification *)sender{ |
| | | BOOL canThouth = [self checkNetCanUse]; |
| | | NSLog(@"%c",canThouth); |
| | | NSLog(@"canThouth:%c",canThouth); |
| | | [YTHsharedManger startManger].isCheckNetCanUse = 0; |
| | | NSDictionary *urlDic = [[NSUserDefaults standardUserDefaults]objectForKey:@"MainUrlArray"]; |
| | | BOOL urlRequest = NO; |
| | |
| | | [_noNetworkView setHidden:YES]; |
| | | } |
| | | |
| | | // é¦é¡µç¹æ |
| | | if ([self homeIsShowNetWorkView]) { |
| | | |
| | | [self loadNoNetworkView]; |
| | | NSLog(@"%d",[self datasourceIsNull]); |
| | | |
| | | } else { |
| | | |
| | | [_noNetworkView setHidden:YES]; |
| | | } |
| | | |
| | | |
| | | break; |
| | | |
| | | case 1: |
| | | //3Gæè
4Gï¼åæ£ç¨çæ¯æµé |
| | | // [self.scrollPageView setHidden:NO]; |
| | | |
| | | [self isJumpTaobao]; |
| | | if (urlRequest) { |
| | | [self isJumpTaobao]; |
| | |
| | | |
| | | case 2: |
| | | //WIFIç½ç» |
| | | |
| | | // é¦é¡µç¹æ |
| | | if ([self homeIsShowNetWorkView]) { |
| | | |
| | | [self loadNoNetworkView]; |
| | | NSLog(@"%d",[self datasourceIsNull]); |
| | | |
| | | } else { |
| | | |
| | | [_noNetworkView setHidden:YES]; |
| | | [self loadData]; |
| | | } |
| | | |
| | | |
| | | |
| | | if (canThouth) { |
| | | if (urlRequest) { |
| | | [self isJumpTaobao]; |
| | |
| | | if (iOS10) { |
| | | NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; |
| | | if( [[UIApplication sharedApplication]canOpenURL:url] ) { |
| | | [[UIApplication sharedApplication]openURL:url options:@{}completionHandler:^(BOOL success) { |
| | | [[UIApplication sharedApplication]openURL:url options:@{}completionHandler:^(BOOL success) { |
| | | }]; |
| | | } |
| | | }else{ |
| | |
| | | - (BOOL)datasourceIsNull{ |
| | | return YES; |
| | | } |
| | | |
| | | - (BOOL)homeIsShowNetWorkView { |
| | | |
| | | return NO; |
| | | } |
| | | |
| | | |
| | | - (void)dealloc{ |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| | |
| | | // Copyright © 2017年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "ALBaseController.h" |
| | | |
| | | @interface classificationViewController : SJBaseViewController |
| | | @interface classificationViewController : ALBaseController |
| | | |
| | | @end |
| | |
| | | |
| | | @property (nonatomic, assign) NSInteger page; |
| | | |
| | | @property (nonatomic,strong)SJNoNetwork *noNetworkViews; |
| | | /// ç½ç»è¿æ¥å¼å¸¸ |
| | | @property (nonatomic, strong) ALAnomalyNetWorkView *anomalyView; |
| | | |
| | | @end |
| | | |
| | | @implementation classificationViewController |
| | |
| | | self.automaticallyAdjustsScrollViewInsets = NO; |
| | | |
| | | [self.navigationController setNavigationBarHidden:YES animated:animated]; |
| | | |
| | | } |
| | | |
| | | -(void)viewWillDisappear:(BOOL)animated { |
| | | [super viewWillDisappear:animated]; |
| | | |
| | | [self.navigationController setNavigationBarHidden:NO animated:animated]; |
| | | |
| | | } |
| | | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | // self.view.backgroundColor=XYRBackgroundColor; |
| | | |
| | | [self.view addSubview:self.noNetworkViews]; |
| | | [self.view addSubview:self.anomalyView]; |
| | | |
| | | //[self.view addSubview:self.anomalyView]; |
| | | self.view.backgroundColor = SJColor(108, 239, 250, 1); |
| | | |
| | | self.page = 1; |
| | |
| | | //è¯·æ±æ°æ® |
| | | [self LoadCacheData]; |
| | | |
| | | [[NSNotificationCenter defaultCenter] addObserver:self |
| | | selector:@selector(NetWorkStatesChange:) |
| | | name:@"netWorkChangeEventNotification" |
| | | object:nil]; |
| | | |
| | | // NSNotification *notice = [[NSNotification alloc]initWithName:@"netWorkChangeEventNotification" object:@([YTHsharedManger startManger].networkStatus) userInfo:nil]; |
| | | // |
| | | // [self NetWorkStatesChange:notice]; |
| | | } |
| | | |
| | | - (void)loadData { |
| | | [super loadData]; |
| | | |
| | | if (self.GoodsData.count == 0 || !self.GoodsData) { |
| | | |
| | | [self loadDataSource]; |
| | | - (void)ClickConnectBtn:(UIButton *)sender{ |
| | | if (iOS10) { |
| | | NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; |
| | | if( [[UIApplication sharedApplication]canOpenURL:url] ) { |
| | | [[UIApplication sharedApplication]openURL:url options:@{}completionHandler:^(BOOL success) { |
| | | }]; |
| | | } |
| | | }else{ |
| | | NSURL *url= [NSURL URLWithString:@"prefs:root=com.haicaojie-ios"]; |
| | | if( [[UIApplication sharedApplication]canOpenURL:url] ) { |
| | | [[UIApplication sharedApplication]openURL:url]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | - (BOOL)datasourceIsNull { |
| | | #pragma mark - ç½ç»ç¶æåçååéç¥æ¹æ³ |
| | | - (void)NetWorkStatesChange:(NSNotification *)sender { |
| | | |
| | | if (self.GoodsData.count == 0) { |
| | | |
| | | return YES; |
| | | |
| | | } else { |
| | | |
| | | return NO; |
| | | } |
| | | } |
| | | BOOL canThouth = [self checkNetCanUse]; |
| | | |
| | | [YTHsharedManger startManger].isCheckNetCanUse = 0; |
| | | |
| | | - (BOOL)homeIsShowNetWorkView { |
| | | |
| | | if (self.GoodsData.count == 0) { |
| | | |
| | | return YES; |
| | | |
| | | } else { |
| | | |
| | | return NO; |
| | | int networkState = [[sender object] intValue]; |
| | | switch (networkState) { |
| | | case -1: |
| | | //æªç¥ç½ç»ç¶æ |
| | | |
| | | if (self.GoodsData.count == 0) { |
| | | |
| | | self.noNetworkViews.hidden = YES; |
| | | self.anomalyView.hidden = NO; |
| | | |
| | | } else { |
| | | |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | ALToastCenter(@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | } |
| | | |
| | | break; |
| | | |
| | | case 0: |
| | | |
| | | [self LoadCacheData]; |
| | | |
| | | if (self.GoodsData.count == 0) { |
| | | |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = NO; |
| | | |
| | | } else { |
| | | |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | } |
| | | |
| | | break; |
| | | |
| | | case 1: { |
| | | //3Gæè
4Gï¼åæ£ç¨çæ¯æµé |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | if (self.GoodsData.count == 0) { |
| | | |
| | | [self loadDataSource]; |
| | | } |
| | | } |
| | | break; |
| | | |
| | | case 2: { |
| | | //WIFIç½ç» |
| | | |
| | | if (canThouth) { |
| | | |
| | | if (self.GoodsData.count == 0) { |
| | | |
| | | [self loadDataSource]; |
| | | } |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | } else { |
| | | |
| | | [YTHsharedManger startManger].isCheckNetCanUse = -2; |
| | | |
| | | if (self.GoodsData.count == 0) { |
| | | |
| | | self.anomalyView.hidden = NO; |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | } else { |
| | | |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | } |
| | | } |
| | | |
| | | } |
| | | break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | - (void)LoadCacheData { |
| | | |
| | | |
| | | self.plist.dataName = @"taoBaoCoupons"; |
| | | if ([self.plist readFile][0]) { |
| | | |
| | | |
| | | self.GoodsData = [self.plist readFile][0]; |
| | | |
| | | |
| | | [self getAddView]; |
| | | |
| | | |
| | | } else { |
| | | |
| | | |
| | | [self loadDataSource]; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | -(void)loadDataSource { |
| | | |
| | | |
| | | [[YTHNetInterface startInterface] cancelAll]; |
| | | |
| | | |
| | | [[YTHNetInterface startInterface] getCouponListWithPage:[NSString stringWithFormat:@"%ld",(long)self.page] |
| | | Withblock:^(BOOL isSuccessful, id result, NSString *error) { |
| | | |
| | | |
| | | if (isSuccessful) { |
| | | |
| | | |
| | | NSDictionary *tempDic=(NSDictionary *)result; |
| | | |
| | | |
| | | NSMutableArray *tempArr = [[tempDic objectForKey:@"data"] objectForKey:@"taoBaoCoupons"]; |
| | | |
| | | |
| | | self.GoodsData = tempArr; |
| | | |
| | | |
| | | if (tempArr.count != 0 && self.page == 1) { |
| | | |
| | | |
| | | self.plist.dataName = @"taoBaoCoupons"; |
| | | [self.plist writeFileWithData:tempArr]; |
| | | } |
| | | |
| | | |
| | | [self getAddView]; |
| | | |
| | | |
| | | } else { |
| | | |
| | | |
| | | if (self.GoodsData.count != 0) { |
| | | |
| | | |
| | | [self getAddView]; |
| | | |
| | | |
| | | } |
| | | } |
| | | }]; |
| | |
| | | return _GoodsData; |
| | | } |
| | | |
| | | - (SJNoNetwork *)noNetworkViews { |
| | | if (_noNetworkViews) { |
| | | return _noNetworkViews; |
| | | } |
| | | _noNetworkViews = [[SJNoNetwork alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH)]; |
| | | _noNetworkViews.backgroundColor = XYRBackgroundColor; |
| | | [_noNetworkViews.connectBtn addTarget:self action:@selector(ClickConnectBtn:) forControlEvents:UIControlEventTouchUpInside]; |
| | | _noNetworkViews.hidden = YES; |
| | | return _noNetworkViews; |
| | | } |
| | | |
| | | - (ALAnomalyNetWorkView *)anomalyView { |
| | | |
| | | if (_anomalyView) { |
| | | return _anomalyView; |
| | | } |
| | | _anomalyView = [[ALAnomalyNetWorkView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH)]; |
| | | _anomalyView.backgroundColor = XYRBackgroundColor; |
| | | [_anomalyView.connectBtn addTarget:self |
| | | action:@selector(ClickConnectBtn:) |
| | | forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | _anomalyView.hidden = YES; |
| | | return _anomalyView; |
| | | } |
| | | |
| | | |
| | | @end |
| | |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import "ZJScrollPageView.h" |
| | | @interface RecommendCouponViewController : SJBaseViewController <ZJScrollPageViewChildVcDelegate> |
| | | #import "ALBaseController.h" |
| | | |
| | | @interface RecommendCouponViewController : ALBaseController <ZJScrollPageViewChildVcDelegate> |
| | | |
| | | @end |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | ååæ°æ®å è½½ |
| | | */ |
| | |
| | | |
| | | if (self.GoodsData.count != 0) { |
| | | |
| | | //self.adviceTableview.hidden = NO; |
| | | self.adviceTableview.hidden = YES; |
| | | self.adviceTableview.hidden = YES; |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | ALToastBottom(@"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | |
| | | } else { |
| | | |
| | | self.adviceTableview.hidden = NO; |
| | | self.adviceTableview.hidden = NO; |
| | | } |
| | | |
| | | } else { |
| | | |
| | | if (self.GoodsData.count != 0) { |
| | | |
| | | self.adviceTableview.hidden = YES; |
| | | self.adviceTableview.hidden = YES; |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | ALToastBottom(@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | |
| | | } else { |
| | | |
| | | self.adviceTableview.hidden = NO; |
| | | self.adviceTableview.hidden = NO; |
| | | } |
| | | } |
| | | } |
| | |
| | | </userDefinedRuntimeAttributes> |
| | | </view> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Â¥2.35" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eCv-3U-IAq"> |
| | | <rect key="frame" x="218" y="63" width="257" height="24"/> |
| | | <rect key="frame" x="223" y="63" width="257" height="24"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="24" id="uzt-d5-Q1f"/> |
| | | </constraints> |
| | |
| | | </constraints> |
| | | </imageView> |
| | | <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="è¿" translatesAutoresizingMaskIntoConstraints="NO" id="D79-Bg-REL"> |
| | | <rect key="frame" x="193" y="67" width="18" height="16"/> |
| | | <rect key="frame" x="193" y="69" width="25" height="13"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="18" id="Xlm-cZ-xaV"/> |
| | | <constraint firstAttribute="height" constant="16" id="xBv-Ca-XXG"/> |
| | | <constraint firstAttribute="width" constant="25" id="Xlm-cZ-xaV"/> |
| | | <constraint firstAttribute="height" constant="13" id="xBv-Ca-XXG"/> |
| | | </constraints> |
| | | </imageView> |
| | | </subviews> |
| | | <constraints> |
| | | <constraint firstItem="vRM-Ob-Sf1" firstAttribute="leading" secondItem="ap4-9J-XQX" secondAttribute="leading" id="0B8-sG-9r5"/> |
| | | <constraint firstItem="R8J-Da-h7i" firstAttribute="top" secondItem="vRM-Ob-Sf1" secondAttribute="bottom" constant="10" id="0q5-xv-AbN"/> |
| | | <constraint firstItem="D79-Bg-REL" firstAttribute="top" secondItem="vRM-Ob-Sf1" secondAttribute="top" constant="4" id="1xR-lT-HcF"/> |
| | | <constraint firstItem="D79-Bg-REL" firstAttribute="top" secondItem="vRM-Ob-Sf1" secondAttribute="top" constant="6" id="1xR-lT-HcF"/> |
| | | <constraint firstItem="7fb-Lg-x8N" firstAttribute="top" secondItem="ap4-9J-XQX" secondAttribute="top" constant="-3" id="4fi-fc-7F9"/> |
| | | <constraint firstItem="eCv-3U-IAq" firstAttribute="width" secondItem="H2p-sc-9uM" secondAttribute="width" multiplier="1:2" id="731-Km-c8U"/> |
| | | <constraint firstAttribute="bottom" secondItem="zj4-ms-34E" secondAttribute="bottom" id="7Dp-92-xN0"/> |
| | |
| | | <constraint firstItem="eCv-3U-IAq" firstAttribute="top" secondItem="vRM-Ob-Sf1" secondAttribute="top" id="bF6-6A-ePm"/> |
| | | <constraint firstItem="zj4-ms-34E" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="bKe-9E-iSS"/> |
| | | <constraint firstItem="vRM-Ob-Sf1" firstAttribute="top" secondItem="7fb-Lg-x8N" secondAttribute="bottom" constant="15" id="bV0-tV-MNv"/> |
| | | <constraint firstItem="eCv-3U-IAq" firstAttribute="leading" secondItem="vRM-Ob-Sf1" secondAttribute="trailing" constant="5" id="gaZ-yJ-gji"/> |
| | | <constraint firstItem="eCv-3U-IAq" firstAttribute="leading" secondItem="D79-Bg-REL" secondAttribute="trailing" constant="5" id="hpG-aU-try"/> |
| | | <constraint firstItem="v7z-QQ-ruB" firstAttribute="top" secondItem="ZXi-4S-nX3" secondAttribute="top" constant="5" id="joL-Bi-zKp"/> |
| | | <constraint firstItem="ap4-9J-XQX" firstAttribute="leading" secondItem="UE6-cB-IeF" secondAttribute="trailing" constant="10" id="kBG-hV-bGV"/> |
| | | <constraint firstItem="v7z-QQ-ruB" firstAttribute="leading" secondItem="ZXi-4S-nX3" secondAttribute="trailing" constant="3" id="kIS-eN-Cna"/> |
| | |
| | | <image name="å¸" width="52" height="18"/> |
| | | <image name="天ç«" width="50" height="24"/> |
| | | <image name="æ¢å
äº" width="75" height="75"/> |
| | | <image name="è¿" width="13" height="12"/> |
| | | <image name="è¿" width="25" height="13"/> |
| | | </resources> |
| | | </document> |
| | |
| | | } |
| | | |
| | | } |
| | | - (void)delayMethod{ |
| | | |
| | | } |
| | | |
| | | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { |
| | | [super setSelected:selected animated:animated]; |
| | | |
| | |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import "ALBaseController.h" |
| | | |
| | | @interface DynamicViewController : SJBaseViewController |
| | | @interface DynamicViewController : ALBaseController |
| | | |
| | | @end |
| | |
| | | #import "XHWebImageAutoSize.h" |
| | | #import "UIImageView+WebCache.h" |
| | | #import "ShonpingShareViewController.h" |
| | | #import "ALNetWorking.h" |
| | | |
| | | #import "HZPhotoBrowser.h" |
| | | |
| | | @interface DynamicViewController ()<UITableViewDelegate, UITableViewDataSource, |
| | | UIScrollViewDelegate, DynamicTableViewCellDelegate, HXEasyCustomShareViewDelegate, |
| | |
| | | NSInteger _Flag; |
| | | } |
| | | @property (nonatomic, strong) UITableView * tableview; |
| | | @property (nonatomic, strong) NSMutableArray * dataSource; |
| | | @property (nonatomic, strong) NSMutableArray *dataSource; |
| | | @property (nonatomic, strong) UIButton *topBtn; |
| | | @property (nonatomic, assign) float lastContentOffset; |
| | | @property (nonatomic, assign) NSInteger flag; |
| | |
| | | @property (nonatomic, strong) PlistFileOperator *plist; |
| | | |
| | | @property (nonatomic, assign) NSInteger page; |
| | | |
| | | @property (nonatomic,strong)SJNoNetwork *noNetworkViews; |
| | | |
| | | /// ç½ç»è¿æ¥å¼å¸¸ |
| | | @property (nonatomic, strong) ALAnomalyNetWorkView *anomalyView; |
| | | |
| | | @end |
| | | |
| | |
| | | [self.navigationController.navigationBar setShadowImage:image]; |
| | | |
| | | self.navigationController.navigationBar.titleTextAttributes=@{NSForegroundColorAttributeName:XYRMainColor,NSFontAttributeName:[UIFont boldSystemFontOfSize:17]}; |
| | | |
| | | [[NSNotificationCenter defaultCenter] addObserver:self |
| | | selector:@selector(NetWorkStatesChange:) |
| | | name:@"netWorkChangeEventNotification" |
| | | object:nil]; |
| | | } |
| | | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | |
| | |
| | | self.view.backgroundColor = XYRBackgroundColor; |
| | | [self.view addSubview:self.tableview]; |
| | | [self.view addSubview:self.topBtn]; |
| | | [self.view addSubview:self.noNetworkViews]; |
| | | [self.view addSubview:self.anomalyView]; |
| | | |
| | | self.page = 1; |
| | | |
| | | //è¯·æ±æ°æ® |
| | | [self LoadCacheData]; |
| | | } |
| | | |
| | | - (void)ClickConnectBtn:(UIButton *)sender{ |
| | | if (iOS10) { |
| | | NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; |
| | | if( [[UIApplication sharedApplication]canOpenURL:url] ) { |
| | | [[UIApplication sharedApplication]openURL:url options:@{}completionHandler:^(BOOL success) { |
| | | }]; |
| | | } |
| | | }else{ |
| | | NSURL *url= [NSURL URLWithString:@"prefs:root=com.haicaojie-ios"]; |
| | | if( [[UIApplication sharedApplication]canOpenURL:url] ) { |
| | | [[UIApplication sharedApplication]openURL:url]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #pragma mark - ç½ç»ç¶æåçååéç¥æ¹æ³ |
| | | -(void)NetWorkStatesChange:(NSNotification *)sender{ |
| | | |
| | | int networkState = [[sender object] intValue]; |
| | | switch (networkState) { |
| | | case -1: |
| | | //æªç¥ç½ç»ç¶æ |
| | | |
| | | if (self.dataSource.count == 0) { |
| | | |
| | | self.tableview.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | self.anomalyView.hidden = NO; |
| | | |
| | | } else { |
| | | |
| | | self.tableview.hidden = NO; |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | } |
| | | |
| | | break; |
| | | |
| | | case 0: |
| | | //没æç½ç» |
| | | if (self.dataSource.count == 0) { |
| | | |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = NO; |
| | | } |
| | | |
| | | break; |
| | | |
| | | case 1: { |
| | | //3Gæè
4Gï¼åæ£ç¨çæ¯æµé |
| | | |
| | | |
| | | if (self.dataSource.count == 0 || !self.dataSource) { |
| | | |
| | | [self getRecommendActivity]; |
| | | } |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | } |
| | | break; |
| | | |
| | | case 2: { |
| | | //WIFIç½ç» |
| | | |
| | | |
| | | |
| | | if (self.dataSource.count == 0 || !self.dataSource) { |
| | | |
| | | [self getRecommendActivity]; |
| | | } |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | } |
| | | break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | - (void)LoadCacheData { |
| | |
| | | } |
| | | } |
| | | |
| | | - (void)loadData { |
| | | [super loadData]; |
| | | |
| | | if (self.dataSource.count == 0) { |
| | | |
| | | [self getRecommendActivity]; |
| | | } |
| | | } |
| | | |
| | | - (BOOL)homeIsShowNetWorkView { |
| | | |
| | | |
| | | if (self.dataSource.count == 0) { |
| | | |
| | | return YES; |
| | | |
| | | } else { |
| | | |
| | | return NO; |
| | | } |
| | | } |
| | | |
| | | - (void)viewWillDisappear:(BOOL)animated{ |
| | | |
| | | [SVProgressHUD dismiss]; |
| | | |
| | | [[ALNetWorking startInterface] cancelAll]; |
| | | } |
| | | |
| | | /** |
| | |
| | | isMainOrDynamic:YES |
| | | success:^(NSDictionary *object) { |
| | | |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | self.tableview.hidden = NO; |
| | | |
| | | [self.tableview.mj_header endRefreshing]; |
| | |
| | | |
| | | if (self.dataSource.count == 0) { |
| | | |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = NO; |
| | | self.tableview.hidden = YES; |
| | | |
| | | } else { |
| | | |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | self.tableview.hidden = NO; |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | ALToastBottom(@"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | |
| | | } |
| | | |
| | | } else { |
| | | |
| | | |
| | | if (self.dataSource.count == 0) { |
| | | |
| | | self.tableview.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | self.anomalyView.hidden = NO; |
| | | |
| | | } else { |
| | | |
| | | self.tableview.hidden = NO; |
| | | self.anomalyView.hidden = YES; |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | |
| | | ALToastBottom(@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | } |
| | | |
| | | } |
| | | |
| | | }]; |
| | |
| | | NSMutableDictionary *dictionary = [SJNetwork CommonDictionarywithDic:dic]; |
| | | [YTHsharedManger startManger].isMainOrDynamic = YES; |
| | | |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"activity/addShareCount"] param:dictionary isMainOrDynamic:YES success:^(NSDictionary *object) { |
| | | // NSLog(@"%@",object); |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"activity/addShareCount"] |
| | | param:dictionary |
| | | success:^(NSDictionary *object) { |
| | | |
| | | } fail:^(id object) { |
| | | // NSLog(@"%@",object); |
| | | |
| | | |
| | | }]; |
| | | |
| | | } |
| | |
| | | |
| | | NSDictionary *dic = self.dataSource[_Flag]; |
| | | if ([dic[@"type"]integerValue] == 1 || [dic[@"type"]integerValue] == 2) { |
| | | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] == nil) { |
| | | [SVProgressHUD setContainerView:[UIApplication sharedApplication].delegate.window]; |
| | | [SVProgressHUD showInfoWithStatus:@"ç»å½åæè½å享"]; |
| | | if (!([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"])) { |
| | | |
| | | ALToastCenter(@"ç»å½åæè½å享"); |
| | | |
| | | //ç»å½çé¢ |
| | | LoginViewController *loginVC = [[LoginViewController alloc] init]; |
| | |
| | | return; |
| | | } |
| | | } |
| | | |
| | | [SVProgressHUD setContainerView:[UIApplication sharedApplication].delegate.window]; |
| | | [SVProgressHUD show]; |
| | | |
| | | [self activityAddShareCountWithID:dic[@"id"]]; |
| | | NSMutableArray *picArray = @[].mutableCopy; |
| | |
| | | NSDictionary *dictionary = [SJNetwork CommonDictionarywithDic:dic]; |
| | | [YTHsharedManger startManger].isMainOrDynamic = YES; |
| | | |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"activity/shareGoods"] |
| | | param:dictionary |
| | | isMainOrDynamic:YES success:^(NSDictionary *object) { |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"activity/shareGoods"] |
| | | param:dictionary |
| | | success:^(NSDictionary *object) { |
| | | |
| | | if ([object[@"code"]integerValue] == 0) { |
| | | |
| | |
| | | |
| | | if (((NSError *)object).code == -1009) { |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | |
| | | ALToastBottom(@"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | |
| | | } else { |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | |
| | | if (((NSError *)object).code != -999) { |
| | | |
| | | ALToastBottom(@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | } |
| | | } |
| | | }]; |
| | | } |
| | |
| | | activityVC.excludedActivityTypes = @[UIActivityTypePostToFacebook,UIActivityTypePostToTwitter,UIActivityTypeMessage,UIActivityTypeMail,UIActivityTypePrint,UIActivityTypeCopyToPasteboard,UIActivityTypeAssignToContact,UIActivityTypeSaveToCameraRoll,UIActivityTypeAddToReadingList,UIActivityTypePostToFlickr,UIActivityTypePostToVimeo,UIActivityTypePostToTencentWeibo,UIActivityTypeAirDrop,UIActivityTypeOpenInIBooks]; |
| | | [self presentViewController:activityVC animated:YES completion:^{ |
| | | [SVProgressHUD setContainerView:[UIApplication sharedApplication].delegate.window]; |
| | | [SVProgressHUD showSuccessWithStatus:@"ææ¬å
容å¤å¶æå"]; |
| | | |
| | | |
| | | [SVProgressHUD dismiss]; |
| | | ALToastCenter(@"ææ¬å
容å¤å¶æå"); |
| | | }]; |
| | | |
| | | } |
| | |
| | | @param activityId id |
| | | */ |
| | | - (void)activityinviteImgWirh:(NSString *)activityId{ |
| | | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] == nil) { |
| | | [SVProgressHUD setContainerView:[UIApplication sharedApplication].delegate.window]; |
| | | [SVProgressHUD showErrorWithStatus:@"请ç»å½ä¹ååè¯"]; |
| | | if (!([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"])) { |
| | | |
| | | [SVProgressHUD dismiss]; |
| | | ALToastBottom(@"ç»å½åæè½å享"); |
| | | |
| | | return; |
| | | } |
| | | NSMutableDictionary *dic = @{}.mutableCopy; |
| | |
| | | NSMutableDictionary *dictionary = [SJNetwork CommonDictionarywithDic:dic]; |
| | | [YTHsharedManger startManger].isMainOrDynamic = YES; |
| | | |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"activity/inviteImg"] param:dictionary isMainOrDynamic:YES success:^(NSDictionary *object) { |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"activity/inviteImg"] |
| | | param:dictionary |
| | | success:^(NSDictionary *object) { |
| | | |
| | | if ([object[@"code"]integerValue] == 0) { |
| | | [SVProgressHUD show]; |
| | | |
| | | NSDictionary *dic = object[@"data"]; |
| | | NSString *shareString =[NSString stringWithFormat:@"%@",dic[@"shareTitle"]]; |
| | | UIPasteboard*pasteboard = [UIPasteboard generalPasteboard]; |
| | |
| | | UIImage *image = [UIImage imageWithData:data]; |
| | | [array addObject:image]; |
| | | } |
| | | |
| | | [self wxShareWithArray:array]; |
| | | }else{ |
| | | |
| | | } else { |
| | | |
| | | [SVProgressHUD setContainerView:[UIApplication sharedApplication].delegate.window]; |
| | | [SVProgressHUD showErrorWithStatus:object[@"msg"]]; |
| | | } |
| | |
| | | |
| | | if (((NSError *)object).code == -1009) { |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | |
| | | ALToastBottom(@"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | |
| | | } else { |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | if (((NSError *)object).code != -999) { |
| | | |
| | | ALToastBottom(@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | } |
| | | } |
| | | }]; |
| | | } |
| | |
| | | if ([YTHsharedManger startManger].isDetailWebValue) { |
| | | SureWebViewController *webView=[[SureWebViewController alloc] init]; |
| | | [webView backClicked:^(NSString *string) { |
| | | // [self.navigationController popViewControllerAnimated:YES]; |
| | | |
| | | }]; |
| | | webView.goodsId=goodsID; |
| | | webView.canDownRefresh=YES; |
| | |
| | | _tableview .rowHeight = 95 + height111 + cell.labelHeight.constant + cell.imagesviewLayout.constant; |
| | | } |
| | | |
| | | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | button.frame = imageview.frame; |
| | | button.tag = indexPath.row; |
| | | [cell.imagesView addSubview:button]; |
| | | |
| | | [[[button rac_signalForControlEvents:UIControlEventTouchUpInside] takeUntil:cell.rac_prepareForReuseSignal] subscribeNext:^(UIButton *button) { |
| | | |
| | | HZPhotoBrowser *browser = [[HZPhotoBrowser alloc] init]; |
| | | browser.isFullWidthForLandScape = YES; |
| | | browser.isNeedLandscape = YES; |
| | | browser.currentImageIndex = 0; |
| | | browser.imageArray = array; |
| | | [browser show]; |
| | | }]; |
| | | } |
| | | |
| | | } else if (type == 3 && imageList.count == 0) { |
| | |
| | | return cell; |
| | | } |
| | | |
| | | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ |
| | | return KScreenW * 0.32; |
| | | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { |
| | | return 0.001; |
| | | } |
| | | |
| | | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ |
| | | UIView *view = [[UIView alloc]init]; |
| | | UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenW *0.32)]; |
| | | imageview.image = [UIImage imageNamed:@"DongtaiTop"]; |
| | | imageview.userInteractionEnabled = YES; |
| | | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(headerImageTaped:)]; |
| | | [imageview addGestureRecognizer:tap]; |
| | | [view addSubview:imageview]; |
| | | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { |
| | | UIView *view = [[UIView alloc] init]; |
| | | view.backgroundColor = XYRBackgroundColor; |
| | | return view; |
| | | } |
| | | |
| | | - (void)headerImageTaped:(UITapGestureRecognizer *)tap { |
| | | |
| | | ShonpingShareViewController *SureWebVC=[[ShonpingShareViewController alloc] init]; |
| | | SureWebVC.urlString=[YTHsharedManger startManger].membersUrl; |
| | | SureWebVC.hidesBottomBarWhenPushed=YES; |
| | | [self.navigationController pushViewController:SureWebVC animated:YES]; |
| | | } |
| | | |
| | | /** |
| | |
| | | error:&error]; |
| | | NSArray *arrayOfAllMatches = [regex matchesInString:string options:0 range:NSMakeRange(0, [string length])]; |
| | | |
| | | for (NSTextCheckingResult *match in arrayOfAllMatches){ |
| | | for (NSTextCheckingResult *match in arrayOfAllMatches) { |
| | | NSString* substringForMatch = [string substringWithRange:match.range]; |
| | | NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:string]; |
| | | [str addAttribute:NSForegroundColorAttributeName value:XYRMainColor range:match.range]; |
| | |
| | | if (_tableview) { |
| | | return _tableview; |
| | | } |
| | | _tableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KScreenW , KScreenH - 64 - kToolBarH) style:UITableViewStyleGrouped]; |
| | | _tableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KScreenW , KScreenH - kNavigationBarH - kStatusBarH - kToolBarH) |
| | | style:UITableViewStyleGrouped]; |
| | | _tableview.delegate = self; |
| | | _tableview.dataSource = self; |
| | | _tableview.separatorStyle = UITableViewCellSelectionStyleNone ; |
| | |
| | | _dataSource = [[NSMutableArray alloc] init]; |
| | | } |
| | | return _dataSource; |
| | | } |
| | | |
| | | - (SJNoNetwork *)noNetworkViews { |
| | | if (_noNetworkViews) { |
| | | return _noNetworkViews; |
| | | } |
| | | _noNetworkViews = [[SJNoNetwork alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH)]; |
| | | _noNetworkViews.backgroundColor = XYRBackgroundColor; |
| | | [_noNetworkViews.connectBtn addTarget:self action:@selector(ClickConnectBtn:) forControlEvents:UIControlEventTouchUpInside]; |
| | | _noNetworkViews.hidden = YES; |
| | | return _noNetworkViews; |
| | | } |
| | | |
| | | - (ALAnomalyNetWorkView *)anomalyView { |
| | | |
| | | if (_anomalyView) { |
| | | return _anomalyView; |
| | | } |
| | | _anomalyView = [[ALAnomalyNetWorkView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH)]; |
| | | _anomalyView.backgroundColor = XYRBackgroundColor; |
| | | [_anomalyView.connectBtn addTarget:self |
| | | action:@selector(ClickConnectBtn:) |
| | | forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | _anomalyView.hidden = YES; |
| | | return _anomalyView; |
| | | } |
| | | |
| | | - (void)didReceiveMemoryWarning { |
| | |
| | | // MineToolBarTableViewCell.h |
| | | // MIduo |
| | | // |
| | | // Created by apple on 2017/11/30. |
| | | // Copyright © 2017年 yeshi. All rights reserved. |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/20. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import "ZXButton.h" |
| | | |
| | | @interface MineToolBarTableViewCell : UITableViewCell |
| | | |
| | | @property (weak, nonatomic) IBOutlet ZXButton *orderBtn;//订å |
| | | @property (weak, nonatomic) IBOutlet ZXButton *collectBtn;//æ¶è |
| | | @property (weak, nonatomic) IBOutlet ZXButton *FootprintBtn;//足迹 |
| | | @property (weak, nonatomic) IBOutlet ZXButton *myTeamBtn;//æçéå |
| | | @property (nonatomic, strong) UIView *bgView; |
| | | |
| | | @property (nonatomic, strong) UIButton *clickButton; |
| | | |
| | | @end |
| | |
| | | // MineToolBarTableViewCell.m |
| | | // MIduo |
| | | // |
| | | // Created by apple on 2017/11/30. |
| | | // Copyright © 2017年 yeshi. All rights reserved. |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2018/8/20. |
| | | // Copyright © 2018年 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "MineToolBarTableViewCell.h" |
| | | |
| | | @interface MineToolBarTableViewCell () |
| | | |
| | | @property (nonatomic, strong) NSArray *imageArr; |
| | | |
| | | @property (nonatomic, strong) UIImageView *imagesView; |
| | | |
| | | @property (nonatomic, strong) UILabel *textsLabel; |
| | | |
| | | @end |
| | | |
| | | @implementation MineToolBarTableViewCell |
| | | |
| | |
| | | // Configure the view for the selected state |
| | | } |
| | | |
| | | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { |
| | | |
| | | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; |
| | | |
| | | if (self) { |
| | | |
| | | self.backgroundColor = [UIColor clearColor]; |
| | | |
| | | self.imageArr = @[@"订å", @"æ¶è", @"足迹"]; |
| | | |
| | | [self cellConfig]; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)cellConfig { |
| | | |
| | | [self.contentView addSubview:self.bgView]; |
| | | self.bgView.sd_layout |
| | | .leftSpaceToView(self.contentView, 10) |
| | | .topSpaceToView(self.contentView, 0) |
| | | .bottomSpaceToView(self.contentView, 0) |
| | | .widthIs(KScreenW - 20); |
| | | |
| | | for (int i = 0; i < self.imageArr.count; i++) { |
| | | |
| | | self.clickButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | self.clickButton.tag = 66 + i; |
| | | [self.bgView addSubview:self.clickButton]; |
| | | |
| | | self.clickButton.sd_layout |
| | | .leftSpaceToView(self.bgView, i * (self.bgView.size.width / 3)) |
| | | .topSpaceToView(self.bgView, 0) |
| | | .bottomSpaceToView(self.bgView, 0) |
| | | .widthIs(self.bgView.size.width / 3); |
| | | |
| | | self.imagesView = [[UIImageView alloc] init]; |
| | | self.imagesView.image = [UIImage imageNamed:self.imageArr[i]]; |
| | | [self.clickButton addSubview:self.imagesView]; |
| | | |
| | | self.imagesView.sd_layout |
| | | .topSpaceToView(self.clickButton, 10) |
| | | .centerXEqualToView(self.clickButton) |
| | | .widthIs(41) |
| | | .heightIs(41); |
| | | |
| | | self.textsLabel = [[UILabel alloc] init]; |
| | | self.textsLabel.text = self.imageArr[i]; |
| | | self.textsLabel.textAlignment = NSTextAlignmentCenter; |
| | | self.textsLabel.font = [UIFont systemFontOfSize:15.0]; |
| | | self.textsLabel.textColor = SJColor(102, 102, 102, 1.0); |
| | | [self.clickButton addSubview:self.textsLabel]; |
| | | self.textsLabel.sd_layout |
| | | .topSpaceToView(self.imagesView, 3) |
| | | .leftSpaceToView(self.clickButton, 0) |
| | | .rightSpaceToView(self.clickButton, 0) |
| | | .heightIs(20); |
| | | } |
| | | } |
| | | |
| | | - (UIView *)bgView { |
| | | |
| | | if (!_bgView) { |
| | | _bgView = [[UIView alloc] init]; |
| | | _bgView.backgroundColor = [UIColor whiteColor]; |
| | | _bgView.layer.masksToBounds = YES; |
| | | _bgView.layer.cornerRadius = 8.0; |
| | | } |
| | | return _bgView; |
| | | } |
| | | |
| | | @end |
| | |
| | | #import "ShonpingShareViewController.h" |
| | | #import "SJLoginTaoBao.h" |
| | | |
| | | #import "ShareAppView.h" |
| | | #import <ShareSDK/ShareSDK.h> |
| | | #import <ShareSDKUI/ShareSDK+SSUI.h> |
| | | |
| | | @interface MineViewController ()<UITableViewDelegate,UITableViewDataSource,LXAlertViewDelegate,UIScrollViewDelegate, LoginViewControllerDelegate>{ |
| | | UILabel *titleLabel; |
| | |
| | | @property (nonatomic, assign) BOOL isOrderClicked; |
| | | @property (nonatomic, assign) BOOL isSkip; |
| | | |
| | | @property (nonatomic, strong) ShareAppView *shareAppView; |
| | | |
| | | @end |
| | | |
| | | @implementation MineViewController |
| | |
| | | [super viewWillAppear:animated]; |
| | | |
| | | [MobClick beginLogPageView:@"æç"]; |
| | | |
| | | |
| | | self.navigationController.navigationBar.translucent = NO; |
| | | |
| | | if (_MineTableView) { |
| | |
| | | if([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]){ |
| | | |
| | | [self autoLogin]; |
| | | |
| | | |
| | | }else{ |
| | | |
| | | self.navigationItem.title=@""; |
| | |
| | | [_MineTableView reloadData]; |
| | | } |
| | | } |
| | | |
| | | |
| | | [self usergetusermoney]; |
| | | |
| | | |
| | | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]) { |
| | | |
| | | [self getMessage]; |
| | | [self getMessage]; |
| | | |
| | | } else { |
| | | |
| | |
| | | //廿éæåå¯¼èªæ ä¸è¾¹çé»è¾¹ |
| | | self.navigationController.navigationBar.titleTextAttributes=@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont boldSystemFontOfSize:17]}; |
| | | [self.navigationController setNavigationBarHidden:NO animated:animated]; |
| | | |
| | | |
| | | [self.navigationController.navigationBar setShadowImage:[UIImage new]]; |
| | | NSLog(@"%d",self.currentIsInBottom); |
| | | |
| | |
| | | [super viewWillDisappear:animated]; |
| | | //è®¾ç½®å¯¼èªæ é¢è² |
| | | self.navigationController.navigationBar.barTintColor = [UIColor whiteColor]; |
| | | |
| | | |
| | | //廿éæåå¯¼èªæ ä¸è¾¹çé»è¾¹ |
| | | self.navigationController.navigationBar.titleTextAttributes=@{NSForegroundColorAttributeName:XYRMainColor, |
| | | NSFontAttributeName:[UIFont boldSystemFontOfSize:17]}; |
| | | NSFontAttributeName:[UIFont boldSystemFontOfSize:17]}; |
| | | NSLog(@"%d",self.currentIsInBottom); |
| | | [MobClick endLogPageView:@"æç"]; |
| | | } |
| | |
| | | UITabBarController *baseTabBar = (UITabBarController *)[UIApplication sharedApplication].keyWindow.rootViewController; |
| | | [baseTabBar.tabBar hideBadgeOnItemIndex:3]; |
| | | } |
| | | |
| | | |
| | | } fail:^(id object) { |
| | | NSLog(@"%@",object); |
| | | }]; |
| | |
| | | */ |
| | | -(void)creatData |
| | | { |
| | | grounpData2 = [NSArray arrayWithObjects:@"订åç³è¯", @"ä¼åç¹æ", @"å
³äºæä»¬", nil]; |
| | | grounpData2 = [NSArray arrayWithObjects:@"订åç³è¯", @"å享APP", @"å
³äºæä»¬", nil]; |
| | | } |
| | | |
| | | /** |
| | | isShopCarWXLogin æ¯å¦æ¯ç¹å»è´ç©è½¦æè
订å微信ç»å½ç夿 |
| | | isShopCarWXLogin æ¯å¦æ¯ç¹å»è´ç©è½¦æè
订å微信ç»å½ç夿 |
| | | */ |
| | | - (void)boundTaoBao:(BOOL)isShopCarWXLogin isOrder:(BOOL)isOrder { |
| | | |
| | |
| | | NSMutableDictionary *dictionary = [SJNetwork CommonDictionarywithDic:dic]; |
| | | |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"user/bindTaoBao"] param:dictionary success:^(NSDictionary *object) { |
| | | |
| | | |
| | | if ([object[@"code"] integerValue] == 0) { |
| | | |
| | | if (isShopCarWXLogin) { |
| | |
| | | -(void) CreatNavigationBar{ |
| | | //设置æé® |
| | | UIView *messageView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 30, 30)]; |
| | | |
| | | |
| | | UIButton *messageButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | messageButton.frame = CGRectMake(0, 4, 25, 25); |
| | | [messageButton setBackgroundImage:[UIImage imageNamed:@"æç-æ¶æ¯ä¸å¿"] forState:UIControlStateNormal]; |
| | |
| | | [settingBtn setImage:[UIImage imageNamed:@"æç-设置"] forState:UIControlStateNormal]; |
| | | [settingBtn addTarget:self action:@selector(settingThisAPP:) forControlEvents:UIControlEventTouchUpInside]; |
| | | UIBarButtonItem *settingItem = [[UIBarButtonItem alloc]initWithCustomView:settingBtn]; |
| | | |
| | | |
| | | UILabel *WhiteLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 8, 10)]; |
| | | WhiteLabel.backgroundColor=[UIColor clearColor]; |
| | | UIBarButtonItem *WhiteBarItem=[[UIBarButtonItem alloc] initWithCustomView:WhiteLabel]; |
| | |
| | | _MineTableView.dataSource=self; |
| | | _MineTableView.tableFooterView=[UIView new]; |
| | | _MineTableView.separatorStyle = UITableViewCellSelectionStyleNone; |
| | | // _MineTableView.bounces = NO; |
| | | // _MineTableView.bounces = NO; |
| | | _MineTableView.estimatedRowHeight = 0; |
| | | _MineTableView.estimatedSectionHeaderHeight = 0; |
| | | _MineTableView.estimatedSectionFooterHeight = 0; |
| | |
| | | [_MineTableView registerNib:[UINib nibWithNibName:@"MineRedEnvelopesTableViewCell" bundle:nil] forCellReuseIdentifier:@"MineRedEnvelopesTableViewCell"]; |
| | | [_MineTableView registerNib:[UINib nibWithNibName:@"MineHelperTableViewCell" bundle:nil] forCellReuseIdentifier:@"MineHelperTableViewCell"]; |
| | | [_MineTableView registerNib:[UINib nibWithNibName:@"MineHeaderTableViewCell" bundle:nil] forCellReuseIdentifier:@"MineHeaderTableViewCell"]; |
| | | [_MineTableView registerNib:[UINib nibWithNibName:@"MineToolBarTableViewCell" bundle:nil] forCellReuseIdentifier:@"MineToolBarTableViewCell"]; |
| | | |
| | | [_MineTableView registerNib:[UINib nibWithNibName:@"MineThirdTableViewCell" bundle:nil] forCellReuseIdentifier:@"MineThirdTableViewCell"]; |
| | | |
| | | |
| | | [self.view addSubview:_MineTableView]; |
| | | } |
| | | } |
| | |
| | | [self boundTaoBao:NO isOrder:NO]; |
| | | } |
| | | }]; |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | [[YTHsharedManger startManger] unBindUserInfo:[userInfo objectForKey:@"id"] WithType:@"1" block:^(BOOL isSuccessful, NSDictionary *dic) { |
| | | if (isSuccessful) { |
| | | |
| | | |
| | | } |
| | | }]; |
| | | } |
| | |
| | | } fail:^(id object) { |
| | | |
| | | }]; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | [dic setObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] forKey:@"uid"]; |
| | | } |
| | | NSMutableDictionary *dictionary = [SJNetwork CommonDictionarywithDic:dic]; |
| | | |
| | | |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"push/uidBindDeviceToken"] param:dictionary success:^(NSDictionary *object) { |
| | | NSLog(@"%@",object); |
| | | } fail:^(id object) { |
| | |
| | | } |
| | | |
| | | /** |
| | | æ¶æ¯ |
| | | æ¶æ¯ |
| | | |
| | | @param sender sender |
| | | */ |
| | |
| | | |
| | | /** |
| | | ä½é¢ |
| | | |
| | | |
| | | @param sender sender |
| | | */ |
| | | - (void)yueButtonTaped:(UIButton *)sender{ |
| | |
| | | _primtWindow.hidden = NO; |
| | | [_primtWindow addSubview:self.primtView]; |
| | | if (sender.tag == 35) { |
| | | self.primtTitle.text = @"仿¥é¢ä¼°æ¶ç"; |
| | | self.primtContent.text = @"仿¥æ°å¢çææè®¢åé¢ä¼°æ¶ç"; |
| | | self.primtTitle.text = @"仿¥é¢ä¼°å享å¥é"; |
| | | self.primtContent.text = @"仿¥æ°å¢çå享订åé¢ä¼°å¥é"; |
| | | }else if(sender.tag == 36){ |
| | | self.primtTitle.text = @"æ¬æé¢ä¼°æ¶ç"; |
| | | self.primtContent.text = @"æ¬æå
产ççææè®¢åé¢ä¼°æ¶çï¼ä¼å¨è®¢å确认æ¶è´§åçæ¬¡æ25æ¥å转å
¥ä½ çä½é¢ï¼ä»¥å®é
转å
¥ä½é¢ä¸ºå"; |
| | | self.primtTitle.text = @"æ¬æé¢ä¼°å享å¥é"; |
| | | self.primtContent.text = @"æ¬æå
产ççææçå享订åé¢ä¼°å¥éï¼ä¼å¨è®¢å确认æ¶è´§åçæ¬¡æ25æ¥å转å
¥æ¨çä½é¢ï¼ä»¥å®é
转å
¥ä½é¢ä¸ºå"; |
| | | }else{ |
| | | self.primtTitle.text = @"䏿é¢ä¼°æ¶å
¥"; |
| | | self.primtContent.text = @"ä¸ä¸ªæå
确认æ¶è´§çè®¢åæ¶å
¥ï¼æ¯æ25æ¥ç»ç®åï¼å°èªå¨è½¬å
¥ä½ çä½é¢"; |
| | | self.primtTitle.text = @"䏿å享å¥é"; |
| | | self.primtContent.text = @"ä¸ä¸ªæå
确认æ¶è´§çå享订åå¥éä¼å¨æ¯æ25æ¥ç»ç®åï¼èªå¨è½¬å
¥æ¨çä½é¢"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | å¼¹åºä»æ¥ãæ¬æãä¸æä¿¡æ¯æç¤ºæ¡ |
| | | |
| | | |
| | | @param sender sender |
| | | */ |
| | | - (void)primtTaped:(UIButton *)sender{ |
| | |
| | | |
| | | /** |
| | | æ°ææ»ç¥ |
| | | |
| | | |
| | | @param sender sender |
| | | */ |
| | | - (void)noviceTaped:(UIButton *)sender{ |
| | |
| | | |
| | | /** |
| | | 帮å©ä¸å¿ |
| | | |
| | | |
| | | @param sender sender |
| | | */ |
| | | - (void)helpTaped:(UIButton *)sender{ |
| | |
| | | |
| | | /** |
| | | è系客æ |
| | | |
| | | |
| | | @param sender sender |
| | | */ |
| | | - (void)serviceTaped:(UIButton *)sender{ |
| | |
| | | ServiceViewController *serviceVC=[[ServiceViewController alloc] init]; |
| | | serviceVC.hidesBottomBarWhenPushed=YES; |
| | | [self.navigationController pushViewController:serviceVC animated:YES]; |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | è´ç©è½¦ |
| | | |
| | | |
| | | @param sender sender |
| | | */ |
| | | - (void)buyCarTaped:(UIButton *)sender { |
| | |
| | | æ£æµæ¯å¦ææBindæ·å®æç¤º |
| | | */ |
| | | - (void)detectionIsBindTaoBaoTips { |
| | | |
| | | |
| | | NSLog(@"sfafjilaskfjksajfhklasjfhklasjhfklahfjklash:%@",self.userInfo); |
| | | if (self.isOrderClicked) { |
| | | self.isOrderClicked = NO; |
| | | if(((NSString *)(self.userInfo[@"openid"])).length == 0 || [self.userInfo[@"openid"] isEqualToString:@""] || ![[ALBBSession sharedInstance] isLogin]){ |
| | | self.sJLoginTaoBao = [[SJLoginTaoBao alloc] initWithSearchStr:TAOBAO_ACCREDIT withIsSearch:NO]; |
| | | |
| | | self.sJLoginTaoBao.titleLabel.text = @"温馨æç¤º"; |
| | | |
| | | self.sJLoginTaoBao.hasIndex = ^(NSInteger index) { |
| | | |
| | | if (index == 790) {//ç¡®å® |
| | | |
| | | [self.sJLoginTaoBao dismiss]; |
| | | [self.overlayViewForTabBar removeFromSuperview]; |
| | | self.overlayViewForTabBar = nil; |
| | | [self LoginForTaoBao:YES]; |
| | | //ç»å½çé¢ |
| | | |
| | | } else if (index==791 || index == 792) {//å
³é |
| | | |
| | | [self.sJLoginTaoBao dismiss]; |
| | | [self.overlayViewForTabBar removeFromSuperview]; |
| | | self.overlayViewForTabBar = nil; |
| | | } |
| | | }; |
| | | |
| | | if(((NSString *)(self.userInfo[@"openid"])).length == 0 || [self.userInfo[@"openid"] isEqualToString:@""] || ![[ALBBSession sharedInstance] isLogin]){ |
| | | self.sJLoginTaoBao = [[SJLoginTaoBao alloc] initWithSearchStr:TAOBAO_ACCREDIT withIsSearch:NO]; |
| | | |
| | | self.sJLoginTaoBao.titleLabel.text = @"温馨æç¤º"; |
| | | |
| | | self.sJLoginTaoBao.hasIndex = ^(NSInteger index) { |
| | | |
| | | if (index == 790) {//ç¡®å® |
| | | |
| | | [self.sJLoginTaoBao dismiss]; |
| | | [self.overlayViewForTabBar removeFromSuperview]; |
| | | self.overlayViewForTabBar = nil; |
| | | [self LoginForTaoBao:YES]; |
| | | //ç»å½çé¢ |
| | | |
| | | } else if (index==791 || index == 792) {//å
³é |
| | | |
| | | [self.sJLoginTaoBao dismiss]; |
| | | [self.overlayViewForTabBar removeFromSuperview]; |
| | | self.overlayViewForTabBar = nil; |
| | | } |
| | | }; |
| | | |
| | | [self.sJLoginTaoBao show]; |
| | | if (self.isSkip) { |
| | | [[UIApplication sharedApplication].delegate.window addSubview:self.overlayViewForTabBar]; |
| | | } |
| | | }else{ |
| | | [self jumpOrder]; |
| | | } |
| | | if (self.isSkip) { |
| | | [[UIApplication sharedApplication].delegate.window addSubview:self.overlayViewForTabBar]; |
| | | } |
| | | }else{ |
| | | [self jumpOrder]; |
| | | } |
| | | |
| | | }else{ |
| | | if(((NSString *)(self.userInfo[@"openid"])).length == 0 || [self.userInfo[@"openid"] isEqualToString:@""] || ![[ALBBSession sharedInstance] isLogin]){ |
| | |
| | | |
| | | [[YTHsharedManger startManger] LogInForTaoBaoWith:self Withblock:^(BOOL isSuccessful, NSDictionary *dic) { |
| | | |
| | | [YTHsharedManger startManger].isminebound = NO; |
| | | [YTHsharedManger startManger].isminebound = NO; |
| | | |
| | | if (isSuccessful) { |
| | | if(((NSString *)(self.userInfo[@"openid"])).length == 0 || [self.userInfo[@"openid"] isEqualToString:@""]){ |
| | |
| | | } |
| | | |
| | | /** |
| | | 跳转è´ç©è½¦ |
| | | 跳转è´ç©è½¦ |
| | | */ |
| | | - (void)jumpShopping { |
| | | |
| | |
| | | } |
| | | |
| | | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ |
| | | |
| | | |
| | | return CGFLOAT_MIN; |
| | | } |
| | | |
| | |
| | | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ |
| | | [tableView deselectRowAtIndexPath:indexPath animated:YES]; |
| | | if (indexPath.section==0) { |
| | | |
| | | |
| | | }else if (indexPath.section==2){ |
| | | switch (indexPath.row) { |
| | | case 1:{ |
| | |
| | | |
| | | [self.navigationController pushViewController:loginVC animated:YES]; |
| | | } |
| | | |
| | | |
| | | }break; |
| | | // ä¼åç¹æ |
| | | case 2:{ |
| | | |
| | | ShonpingShareViewController *shonpingShareVc = [[ShonpingShareViewController alloc] init]; |
| | | case 2: {// å享APP |
| | | // ShonpingShareViewController *shonpingShareVc = [[ShonpingShareViewController alloc] init]; |
| | | // shonpingShareVc.urlString=[YTHsharedManger startManger].membersUrl; |
| | | // shonpingShareVc.hidesBottomBarWhenPushed = YES; |
| | | // [self.navigationController pushViewController:shonpingShareVc animated:YES]; |
| | | self.shareAppView = [[ShareAppView alloc] initShareAppView]; |
| | | |
| | | shonpingShareVc.urlString=[YTHsharedManger startManger].membersUrl; |
| | | shonpingShareVc.hidesBottomBarWhenPushed = YES; |
| | | __weak typeof(self) weakSelf = self; |
| | | self.shareAppView.haveIndex = ^(NSInteger index) { |
| | | |
| | | [weakSelf.shareAppView diss]; |
| | | weakSelf.shareAppView = nil; |
| | | |
| | | if (index == 0) { |
| | | |
| | | [weakSelf shareWebPageToPlatformType:UMSocialPlatformType_WechatSession withtype:SSDKPlatformSubTypeWechatSession]; |
| | | |
| | | } else if (index == 1) { |
| | | |
| | | [weakSelf shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine withtype:SSDKPlatformSubTypeWechatTimeline]; |
| | | |
| | | } else if (index == 2) { |
| | | |
| | | [weakSelf shareWebPageToPlatformType:UMSocialPlatformType_Sina withtype:SSDKPlatformTypeSinaWeibo]; |
| | | |
| | | } else if (index == 3) { |
| | | |
| | | [weakSelf shareWebPageToPlatformType:UMSocialPlatformType_QQ withtype:SSDKPlatformSubTypeQQFriend]; |
| | | |
| | | } else if (index == 4) { |
| | | |
| | | [weakSelf shareWebPageToPlatformType:UMSocialPlatformType_Qzone withtype:SSDKPlatformSubTypeQZone]; |
| | | } |
| | | |
| | | }; |
| | | |
| | | [self.navigationController pushViewController:shonpingShareVc animated:YES]; |
| | | [self.shareAppView show]; |
| | | |
| | | } |
| | | break; |
| | | case 5:{//å¸®å© |
| | | |
| | | case 5: {// å¸®å© |
| | | XYRWebViewController *SureWebVC=[[XYRWebViewController alloc] init]; |
| | | SureWebVC.url=[[NSUserDefaults standardUserDefaults] objectForKey:@"help"]; |
| | | SureWebVC.backToRedBag=^(){ |
| | |
| | | [self.navigationController pushViewController:SureWebVC animated:YES]; |
| | | } |
| | | break; |
| | | case 4:{ |
| | | |
| | | case 4: { |
| | | ServiceViewController *serviceVC=[[ServiceViewController alloc] init]; |
| | | serviceVC.hidesBottomBarWhenPushed=YES; |
| | | [self.navigationController pushViewController:serviceVC animated:YES]; |
| | | }break; |
| | | |
| | | case 3:{//å
³äºæä»¬ |
| | | case 3: {// å
³äºæä»¬ |
| | | XYRWebViewController *aboutWebVC=[[XYRWebViewController alloc] init]; |
| | | aboutWebVC.url=[[NSUserDefaults standardUserDefaults] objectForKey:@"about"]; |
| | | aboutWebVC.backToRedBag=^(){ |
| | |
| | | } |
| | | } |
| | | |
| | | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ |
| | | if (indexPath.section==0) { |
| | | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
| | | |
| | | if (indexPath.section == 0) { |
| | | |
| | | if (indexPath.row==0) { |
| | | |
| | | MineHeaderTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"MineHeaderTableViewCell"]; |
| | | NSMutableAttributedString *mineRedBagMessage=[NSMutableAttributedString new]; |
| | | cell.backgroundColor = [UIColor clearColor]; |
| | |
| | | cell.IDLabel.hidden = NO; |
| | | cell.gradeButton.hidden = NO; |
| | | } |
| | | |
| | | |
| | | [cell.gradeLabelImage setYthImageWithURL:[_userInfo objectForKey:@"rankNamePicture"] placeholderImage:[UIImage imageNamed:@""]]; |
| | | |
| | | |
| | | //ç«å³ç»å½æé® |
| | | { |
| | | [cell.login addTarget:self action:@selector(LoginWithTaoBao:) forControlEvents:UIControlEventTouchUpInside]; |
| | |
| | | nameString = [nameString removeSpace]; |
| | | [cell.login setTitle: nameString forState:UIControlStateSelected]; |
| | | [cell.login setTitleColor:SJColor(23, 94, 0, 1) forState:UIControlStateSelected]; |
| | | |
| | | |
| | | [cell.login setTintColor:[UIColor clearColor]]; |
| | | [cell.login setSelected:YES]; |
| | | [cell.imageLogin setSelected:YES]; |
| | |
| | | }else if (indexPath.section==1){ |
| | | if(indexPath.row==0){ |
| | | |
| | | MineToolBarTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"MineToolBarTableViewCell"]; |
| | | cell.accessoryType=UITableViewCellAccessoryNone; |
| | | [cell.orderBtn addTarget:self action:@selector(GoToOrder:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [cell.collectBtn addTarget:self action:@selector(GoTocollect:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [cell.FootprintBtn addTarget:self action:@selector(GoToFootprint:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [cell.myTeamBtn addTarget:self action:@selector(GotomyTeam:) forControlEvents:UIControlEventTouchUpInside]; |
| | | cell.backgroundColor = [UIColor clearColor]; |
| | | |
| | | |
| | | NSString *cellIden = @"mineToolBarTableViewCell"; |
| | | MineToolBarTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIden]; |
| | | |
| | | if (!cell) { |
| | | |
| | | cell = [[MineToolBarTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault |
| | | reuseIdentifier:cellIden]; |
| | | } |
| | | |
| | | [((UIButton *)[cell.bgView subviews][0]) addTarget:self action:@selector(GoToOrder:) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | [((UIButton *)[cell.bgView subviews][1]) addTarget:self action:@selector(GoTocollect:) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | [((UIButton *)[cell.bgView subviews][2]) addTarget:self action:@selector(GoToFootprint:) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | return cell; |
| | | } |
| | | }else if (indexPath.section==2){ |
| | | |
| | | } else if (indexPath.section==2) { |
| | | if (indexPath.row == 0) { |
| | | MineThirdTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"MineThirdTableViewCell"]; |
| | | |
| | | |
| | | [cell.noviceButton addTarget:self action:@selector(noviceTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [cell.helpButton addTarget:self action:@selector(helpTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [cell.servieveButton addTarget:self action:@selector(serviceTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [cell.buyCarButton addTarget:self action:@selector(buyCarTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | cell.backgroundColor = [UIColor clearColor]; |
| | | |
| | | |
| | | cell.accessoryType=UITableViewCellAccessoryNone; |
| | | cell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | return cell; |
| | |
| | | |
| | | #pragma mark --- 订å --- |
| | | - (void)GoToOrder:(UIButton *)sender { |
| | | |
| | | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] == nil) {//ç¨æ·æç»å½ |
| | | //ç»å½çé¢ |
| | | self.isOrderClicked = YES; |
| | | self.isSkip = YES; |
| | | LoginViewController *LoginVC=[[LoginViewController alloc] init]; |
| | | LoginVC.hidesBottomBarWhenPushed=YES; |
| | | LoginVC.delegate = self; |
| | | LoginVC.fromVc = self; |
| | | [self.navigationController pushViewController:LoginVC animated:YES]; |
| | | |
| | | } else { |
| | | //ç¨æ·ç»å½äºï¼ä½æ¯å¹¶æªç»å®æ·å® |
| | | self.isOrderClicked = YES; |
| | | self.isSkip = NO; |
| | | [self detectionIsBindTaoBaoTips]; |
| | | |
| | | } |
| | | |
| | | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] == nil) {//ç¨æ·æç»å½ |
| | | //ç»å½çé¢ |
| | | self.isOrderClicked = YES; |
| | | self.isSkip = YES; |
| | | LoginViewController *LoginVC=[[LoginViewController alloc] init]; |
| | | LoginVC.hidesBottomBarWhenPushed=YES; |
| | | LoginVC.delegate = self; |
| | | LoginVC.fromVc = self; |
| | | [self.navigationController pushViewController:LoginVC animated:YES]; |
| | | |
| | | } else { |
| | | //ç¨æ·ç»å½äºï¼ä½æ¯å¹¶æªç»å®æ·å® |
| | | self.isOrderClicked = YES; |
| | | self.isSkip = NO; |
| | | [self detectionIsBindTaoBaoTips]; |
| | | |
| | | } |
| | | } |
| | | |
| | | #pragma mark --- è¿å
¥æ¶èçé¢ --- |
| | |
| | | } |
| | | } |
| | | |
| | | #pragma mark --- 足迹 --- |
| | | /** |
| | | 足迹 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | éå |
| | | å享 |
| | | */ |
| | | - (void)GotomyTeam:(UIButton *)sender { |
| | | - (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType withtype:(SSDKPlatformType)shareType { |
| | | |
| | | if ([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]==nil) {//ç¨æ·æç»å½ |
| | | //ç»å½çé¢ |
| | | LoginViewController *loginVc = [[LoginViewController alloc] init]; |
| | | SSDKContentType type = SSDKContentTypeAuto; |
| | | |
| | | if (shareType == SSDKPlatformSubTypeWechatTimeline || shareType == SSDKPlatformSubTypeWechatSession) { |
| | | |
| | | loginVc.vcName = @"ShonpingShareViewController"; |
| | | loginVc.hidesBottomBarWhenPushed = YES; |
| | | loginVc.fromVc = self; |
| | | loginVc.delegate = self; |
| | | |
| | | [self.navigationController pushViewController:loginVc animated:YES]; |
| | | |
| | | } else { |
| | | |
| | | ShonpingShareViewController *SureWebVC=[[ShonpingShareViewController alloc] init]; |
| | | SureWebVC.urlString=[YTHsharedManger startManger].myTeamURL; |
| | | SureWebVC.hidesBottomBarWhenPushed=YES; |
| | | [self.navigationController pushViewController:SureWebVC animated:YES]; |
| | | if (![WXApi isWXAppInstalled]) { |
| | | ALToastCenter(@"微信æªå®è£
"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if ( SSDKPlatformSubTypeQQFriend == shareType || shareType == SSDKPlatformSubTypeQZone ) { |
| | | |
| | | if (![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"mqq://"]]) { |
| | | ALToastCenter(@"QQæªå®è£
"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | NSMutableDictionary *shareParams = [NSMutableDictionary dictionary]; |
| | | |
| | | [shareParams SSDKSetupShareParamsByText:@"大家æ¯å¦æ¯å¦ä¼ç²¾ç¥çååå£è¯´çè¯å°±åå¼å¾ä¹
" |
| | | images:@[@"notFound"] |
| | | url:[NSURL URLWithString:@"https://www.baidu.com"] |
| | | title:@"æµ·èè¡ä¸è½½å¦" |
| | | type:type]; |
| | | |
| | | //æçå¹³å°è¦å®¢æ·ç«¯å享éè¦å æ¤æ¹æ³ï¼ä¾å¦å¾®å |
| | | [shareParams SSDKEnableUseClientShare]; |
| | | //2ãå享ï¼å¯ä»¥å¼¹åºæä»¬çå享èååç¼è¾çé¢ï¼ |
| | | //è¿è¡å享 |
| | | [ShareSDK share:shareType //ä¼ å
¥å享çå¹³å°ç±»å |
| | | parameters:shareParams |
| | | onStateChanged:^(SSDKResponseState state, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error) { // åè°å¤ç....}]; |
| | | switch (state) { |
| | | case SSDKResponseStateSuccess: |
| | | { |
| | | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"å享æå" |
| | | message:nil |
| | | delegate:nil |
| | | cancelButtonTitle:@"ç¡®å®" |
| | | otherButtonTitles:nil]; |
| | | [alertView show]; |
| | | break; |
| | | } |
| | | case SSDKResponseStateFail: |
| | | { |
| | | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"å享失败" |
| | | message:[NSString stringWithFormat:@"%@",error] |
| | | delegate:nil |
| | | cancelButtonTitle:@"OK" |
| | | otherButtonTitles:nil, nil]; |
| | | [alert show]; |
| | | break; |
| | | } |
| | | default: |
| | | break; |
| | | } |
| | | }]; |
| | | } |
| | | - (UIView *)primtView{ |
| | | |
| | | - (UIView *)primtView { |
| | | if (_primtView) { |
| | | return _primtView; |
| | | } |
| | |
| | | [_primtView addSubview:button]; |
| | | return _primtView; |
| | | } |
| | | - (UIView *)overlayViewForTabBar{ |
| | | |
| | | - (UIView *)overlayViewForTabBar { |
| | | if (!_overlayViewForTabBar) { |
| | | _overlayViewForTabBar = [[UIView alloc]initWithFrame:CGRectMake(0, KScreenH-kToolBarH, KScreenW, kToolBarH)]; |
| | | |
| | |
| | | return _overlayViewForTabBar; |
| | | } |
| | | |
| | | /** |
| | | æ¸
é¤éç¥ |
| | | */ |
| | | - (void)dealloc{ |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| | | } |
| | |
| | | _primtWindow.hidden = NO; |
| | | [_primtWindow addSubview:self.primtView]; |
| | | if (sender.tag == 35) { |
| | | self.primtTitle.text = @"仿¥é¢ä¼°æ¶ç"; |
| | | self.primtContent.text = @"仿¥æ°å¢çææè®¢åé¢ä¼°æ¶ç"; |
| | | self.primtTitle.text = @"仿¥é¢ä¼°å享å¥é"; |
| | | self.primtContent.text = @"仿¥æ°å¢çå享订åé¢ä¼°å¥é"; |
| | | }else if(sender.tag == 36){ |
| | | self.primtTitle.text = @"æ¬æé¢ä¼°æ¶ç"; |
| | | self.primtContent.text = @"æ¬æå
产ççææè®¢åé¢ä¼°æ¶çï¼ä¼å¨è®¢å确认æ¶è´§åçæ¬¡æ25æ¥å转å
¥ä½ çä½é¢ï¼ä»¥å®é
转å
¥ä½é¢ä¸ºå"; |
| | | self.primtTitle.text = @"æ¬æé¢ä¼°å享å¥é"; |
| | | self.primtContent.text = @"æ¬æå
产ççææçå享订åé¢ä¼°å¥éï¼ä¼å¨è®¢å确认æ¶è´§åçæ¬¡æ25æ¥å转å
¥æ¨çä½é¢ï¼ä»¥å®é
转å
¥ä½é¢ä¸ºå"; |
| | | }else{ |
| | | self.primtTitle.text = @"䏿é¢ä¼°æ¶å
¥"; |
| | | self.primtContent.text = @"ä¸ä¸ªæå
确认æ¶è´§çè®¢åæ¶å
¥ï¼æ¯æ25æ¥ç»ç®åï¼å°èªå¨è½¬å
¥ä½ çä½é¢"; |
| | | self.primtTitle.text = @"䏿å享å¥é"; |
| | | self.primtContent.text = @"ä¸ä¸ªæå
确认æ¶è´§çå享订åå¥éä¼å¨æ¯æ25æ¥ç»ç®åï¼èªå¨è½¬å
¥æ¨çä½é¢"; |
| | | } |
| | | } |
| | | |
| | |
| | | _fanliLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 5, KScreenW / 2, 33)]; |
| | | _fanliLabel.textColor = [UIColor blackColor]; |
| | | _fanliLabel.font = [UIFont boldSystemFontOfSize:30]; |
| | | // _fanliLabel.text = [NSString stringWithFormat:@"%@",self.datasource[@"totalHongBao"]]; |
| | | // _fanliLabel.text = @"0"; |
| | | _fanliLabel.textAlignment = NSTextAlignmentCenter; |
| | | [buttomView addSubview:_fanliLabel]; |
| | | UILabel *fanLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_fanliLabel.frame) + 5, KScreenW / 2, 20)]; |
| | | fanLabel.textColor = SJColor(164, 164, 164, 1); |
| | | fanLabel.font = [UIFont systemFontOfSize:15]; |
| | | fanLabel.text = @"累计è¿å©(å
)"; |
| | | fanLabel.text = @"累计èªè´å¥é(å
)"; |
| | | fanLabel.textAlignment = NSTextAlignmentCenter; |
| | | [buttomView addSubview:fanLabel]; |
| | | |
| | | _accountLabel = [[UILabel alloc]initWithFrame:CGRectMake(KScreenW / 2 + 1, 5, KScreenW / 2, 33)]; |
| | | _accountLabel.textColor = [UIColor blackColor]; |
| | | _accountLabel.font = [UIFont boldSystemFontOfSize:30]; |
| | | // _accountLabel.text = [NSString stringWithFormat:@"%@",self.datasource[@"noOpenHongBao"]]; |
| | | // _accountLabel.text = @"0"; |
| | | _accountLabel.textAlignment = NSTextAlignmentCenter; |
| | | [buttomView addSubview:_accountLabel]; |
| | | |
| | | UILabel *accLabel = [[UILabel alloc]initWithFrame:CGRectMake(KScreenW / 2 + 1, CGRectGetMaxY(_accountLabel.frame) + 5, KScreenW / 2, 20)]; |
| | | accLabel.textColor = SJColor(164, 164, 164, 1); |
| | | accLabel.font = [UIFont systemFontOfSize:14]; |
| | | accLabel.text = @"æªå°è´¦è¿å©(å
)"; |
| | | accLabel.text = @"æªå°è´¦èªè´å¥é(å
)"; |
| | | accLabel.textAlignment = NSTextAlignmentCenter; |
| | | [buttomView addSubview:accLabel]; |
| | | UIView *buttomLineview = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(buttomView.frame) + 10, _fanliView.frame.size.width, 1)]; |
| | |
| | | _royaltiesedLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 5, KScreenW / 2, 33)]; |
| | | _royaltiesedLabel.textColor = [UIColor blackColor]; |
| | | _royaltiesedLabel.font = [UIFont boldSystemFontOfSize:30]; |
| | | // _royaltiesedLabel.text = [NSString stringWithFormat:@"%@",self.datasource[@"totalHongBao"]]; |
| | | // _royaltiesedLabel.text = @"0"; |
| | | _royaltiesedLabel.textAlignment = NSTextAlignmentCenter; |
| | | [_royaltiesView addSubview:_royaltiesedLabel]; |
| | | UILabel *leijiLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_royaltiesedLabel.frame) + 5, KScreenW / 2, 20)]; |
| | | leijiLabel.textColor = SJColor(164, 164, 164, 1); |
| | | leijiLabel.font = [UIFont systemFontOfSize:15]; |
| | | leijiLabel.text = @"累计ææ(å
)"; |
| | | leijiLabel.text = @"累计å享å¥é(å
)"; |
| | | leijiLabel.textAlignment = NSTextAlignmentCenter; |
| | | [_royaltiesView addSubview:leijiLabel]; |
| | | |
| | | _royaltiesLabel = [[UILabel alloc]initWithFrame:CGRectMake(KScreenW / 2 + 1, 5, KScreenW / 2, 33)]; |
| | | _royaltiesLabel.textColor = [UIColor blackColor]; |
| | | _royaltiesLabel.font = [UIFont boldSystemFontOfSize:30]; |
| | | // _royaltiesLabel.text = [NSString stringWithFormat:@"%@",self.datasource[@"noOpenHongBao"]]; |
| | | // _royaltiesLabel.text = @"0"; |
| | | _royaltiesLabel.textAlignment = NSTextAlignmentCenter; |
| | | [_royaltiesView addSubview:_royaltiesLabel]; |
| | | |
| | | UILabel *laijiedLabel = [[UILabel alloc]initWithFrame:CGRectMake(KScreenW / 2 + 1, CGRectGetMaxY(_royaltiesLabel.frame) + 5, KScreenW / 2, 20)]; |
| | | laijiedLabel.textColor = SJColor(164, 164, 164, 1); |
| | | laijiedLabel.font = [UIFont systemFontOfSize:14]; |
| | | laijiedLabel.text = @"æªå°è´¦ææ(å
)"; |
| | | laijiedLabel.text = @"æªå°è´¦å享å¥é"; |
| | | laijiedLabel.textAlignment = NSTextAlignmentCenter; |
| | | [_royaltiesView addSubview:laijiedLabel]; |
| | | UIView *leijibuttomLineview = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_royaltiesView.frame) + 10, _fanliView.frame.size.width, 1)]; |
| | |
| | | <rect key="frame" x="0.0" y="0.0" width="320" height="568"/> |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ä¸ååæ æ³è¿å©ï¼ä¸¢åï¼" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="W4r-DP-ekJ"> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ä¸ååæ å¥éï¼ä¸¢åï¼" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="W4r-DP-ekJ"> |
| | | <rect key="frame" x="20" y="110" width="300" height="25"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="25" id="Jug-3C-unu"/> |
| | |
| | | <action selector="submitTaped:" destination="-1" eventType="touchUpInside" id="hPd-ik-adb"/> |
| | | </connections> |
| | | </button> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ç¹å»â确认æ¯ä»âåï¼éçå¾
10åéæè½å¨âè¿å©è®¢åâ页é¢çå°è®°å½ã妿ªæè®°å½åå¯è¾å
¥è®¢åå·æäº¤ç³è¯ã" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="M81-g6-kNp"> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ç¹å»â确认æ¯ä»âåï¼éçå¾
10åéæè½å¨âèªè´è®¢åâ页é¢çå°è®°å½ã妿ªæè®°å½åå¯è¾å
¥è®¢åå·æäº¤ç³è¯ã" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="M81-g6-kNp"> |
| | | <rect key="frame" x="20" y="140" width="280" height="60"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="60" id="81M-md-8Dd"/> |
| | |
| | | } |
| | | |
| | | #pragma mark æ·»å è§å¾ |
| | | - (void)submitViews{ |
| | | - (void)submitViews { |
| | | //å¤é¢è§å¾ |
| | | UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; |
| | | titleView.backgroundColor = YTHColor(239, 239, 239); |
| | |
| | | custom.delegate = self; |
| | | custom.returnKeyType = UIReturnKeySearch;//æreturné®å为æç´¢ |
| | | custom.font = [UIFont systemFontOfSize:15]; |
| | | // [custom resignFirstResponder]; |
| | | |
| | | custom.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请è¾å
¥æç´¢å
容" attributes:@{NSForegroundColorAttributeName: YTHColor(178, 178, 178)}]; |
| | | [custom addTarget:self action:@selector(SearchValueChanged:) forControlEvents:UIControlEventAllEditingEvents];//æ·»å 宿¶çæ£æµå¼äºä»¶ |
| | |
| | | [titleView addSubview:view]; |
| | | [titleView addSubview:custom]; |
| | | |
| | | [custom becomeFirstResponder]; |
| | | |
| | | //æç´¢-æ¸
é¤æé® |
| | | UIButton *clearBtn = [[UIButton alloc] initWithFrame:CGRectMake(titleView.frame.size.width-30, 2.5, 25, 25)]; |
| | | [clearBtn setImage:[UIImage imageNamed:@"æç´¢-ç»æ-æ¸
é¤"] forState:UIControlStateNormal]; |
| | |
| | | return NO; |
| | | } |
| | | } |
| | | - (BOOL)homeIsShowNetWorkView{ |
| | | if (self.dataSearch.count == 0) { |
| | | return YES; |
| | | }else{ |
| | | return NO; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è¯·æ±æç´¢æ°æ® |
| | | */ |
| | |
| | | */ |
| | | -(void)search:(UIButton *)sender{ |
| | | if (self.searchField.Field.text.length == 0) { |
| | | [SVProgressHUD showErrorWithStatus:@"请è¾å
¥æç´¢å
容"]; |
| | | |
| | | ALToastCenter(@"请è¾å
¥æç´¢å
容") |
| | | return; |
| | | } |
| | | pagenumber = 0; |
| | |
| | | [_priceBtn setTag:606]; |
| | | _detailViewToTop.constant=45.0f; |
| | | self.isPriceTaped = YES; |
| | | // self.detailViewToTop.constant=0; |
| | | // self.backView.frame = self.detailCollectionView.frame; |
| | | [sender setImage:[UIImage imageNamed:@"ååº"] forState:UIControlStateSelected]; |
| | | Order=3; |
| | | [_detailCollectionView.mj_header beginRefreshing]; |
| | |
| | | maxPrice = temp; |
| | | } |
| | | } |
| | | |
| | | self.isPriceTaped = YES; |
| | | // self.detailViewToTop.constant=0; |
| | | // self.backView.frame = self.detailCollectionView.frame; |
| | | [_detailCollectionView.mj_header beginRefreshing]; |
| | | } |
| | | |
| | |
| | | [self.detailCollectionView reloadData]; |
| | | [self.detailCollectionView.mj_footer endRefreshing]; |
| | | [self.detailCollectionView.mj_header endRefreshing]; |
| | | }else{ |
| | | //æç¤ºç¨æ·å¤±è´¥ |
| | | // if (self->pagenumber ==0) { |
| | | // [self.dataSearch removeAllObjects]; |
| | | // [self.detailCollectionView reloadData]; |
| | | // } |
| | | |
| | | } else { |
| | | // æç¤ºç¨æ·å¤±è´¥ |
| | | |
| | | [self.detailCollectionView.mj_footer endRefreshing]; |
| | | [self.detailCollectionView.mj_header endRefreshing]; |
| | | |
| | |
| | | return _dataSearch.count; |
| | | } |
| | | |
| | | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ |
| | | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { |
| | | |
| | | recommendCollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"recommendCollectionViewCell" forIndexPath:indexPath]; |
| | | |
| | | cell.garyBgView.hidden = NO; |
| | | [cell.MaskedView setHidden:YES]; |
| | | NSDictionary *cellMessage=_dataSearch[indexPath.row]; |
| | | |
| | | NSDictionary *cellMessage = _dataSearch[indexPath.row]; |
| | | |
| | | [cell fillCells:cellMessage]; |
| | | |
| | | return cell; |
| | |
| | | -(void)viewWillAppear:(BOOL)animated{ |
| | | [super viewWillAppear:animated]; |
| | | |
| | | if (_collectionView) { |
| | | [self getOldSearch]; |
| | | } |
| | | [self getOldSearch]; |
| | | } |
| | | - (void)viewWillDisappear:(BOOL)animated{ |
| | | [super viewWillDisappear:animated]; |
| | | [_searchField.Field resignFirstResponder]; |
| | | |
| | | self.suggestTableview.hidden = YES; |
| | | } |
| | | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | |
| | | //å®å¶å¯¼èªæ |
| | | [self setNavgtionView]; |
| | | |
| | |
| | | |
| | | //æ·»å æç´¢å»ºè®®çtableview |
| | | [self addsuggestTableview]; |
| | | self.title = @"æç´¢"; |
| | | |
| | | //è¯·æ±æ°æ® |
| | | [self getData]; |
| | | if ([YTHsharedManger startManger].networkStatus != 0 && [YTHsharedManger startManger].networkStatus != -1 && [YTHsharedManger startManger].isCheckNetCanUse != -2) { |
| | | [self performSelector:@selector(delayMethod) withObject:nil afterDelay:0.6]; |
| | | } |
| | | [self getData]; |
| | | } |
| | | - (void)delayMethod{ |
| | | [self.searchField.Field becomeFirstResponder]; |
| | | |
| | | - (void)delayMethod { |
| | | |
| | | //[self.searchField.Field becomeFirstResponder]; |
| | | } |
| | | /** |
| | | * è®¾ç½®å¯¼èªæ |
| | | */ |
| | | - (void)setNavgtionView{ |
| | | - (void)setNavgtionView { |
| | | |
| | | self.title = @"æç´¢"; |
| | | |
| | | UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenW-115, 30)]; |
| | | titleView.backgroundColor=YTHColor(239, 239, 239); |
| | |
| | | _searchField = [[YTHSearchTextField alloc] initWithFrame:CGRectMake(20, 0, titleView.frame.size.width-20, titleView.frame.size.height)]; |
| | | _searchField.delegate = self; |
| | | _searchField.Field.placeholder = self.searchString; |
| | | _searchField.backgroundColor=[UIColor yellowColor]; |
| | | _searchField.backgroundColor = [UIColor yellowColor]; |
| | | |
| | | self.navigationItem.titleView = titleView; |
| | | [titleView addSubview:_searchField]; |
| | |
| | | self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc] initWithCustomView:searchBtn]; |
| | | |
| | | //èæ¯é¢è² |
| | | self.view.backgroundColor=[UIColor whiteColor];; |
| | | self.view.backgroundColor=[UIColor whiteColor]; |
| | | |
| | | if ([YTHsharedManger startManger].networkStatus != 0 && [YTHsharedManger startManger].networkStatus != -1 && [YTHsharedManger startManger].isCheckNetCanUse != -2) { |
| | | [self performSelector:@selector(delayMethod) withObject:nil afterDelay:0.6]; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æç´¢å»ºè®®çtableView |
| | | */ |
| | | -(void)addsuggestTableview{ |
| | | - (void)addsuggestTableview { |
| | | _suggestTableview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH-kNavigationBarH-kStatusBarH) style:UITableViewStyleGrouped]; |
| | | [_suggestTableview setBackgroundColor:[UIColor whiteColor]]; |
| | | _suggestTableview.delegate = self; |
| | |
| | | /** |
| | | æ·»å UICollectionView |
| | | */ |
| | | -(void)addSearchCollectionView{ |
| | | UICollectionViewLeftAlignedLayout *flow = [[UICollectionViewLeftAlignedLayout alloc]init]; |
| | | - (void)addSearchCollectionView { |
| | | |
| | | UICollectionViewLeftAlignedLayout *flow = [[UICollectionViewLeftAlignedLayout alloc] init]; |
| | | //æå®å¸å±æ¹å¼ä¸ºåç´ |
| | | flow.scrollDirection = UICollectionViewScrollDirectionVertical; |
| | | flow.minimumLineSpacing = 5;//æå°è¡é´è·(å½åç´å¸å±æ¶æ¯è¡é´è·ï¼å½æ°´å¹³å¸å±æ¶å¯ä»¥ç解为åé´è·) |
| | | flow.minimumInteritemSpacing = 10;//两个åå
æ ¼ä¹é´çæå°é´è· |
| | | |
| | | //å建CollectionViewå¹¶æå®å¸å±å¯¹è±¡ |
| | | _collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, KScreenW,KScreenH-kNavigationBarH-kStatusBarH) collectionViewLayout:flow]; |
| | | _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, KScreenW,KScreenH-kNavigationBarH-kStatusBarH) collectionViewLayout:flow]; |
| | | _collectionView.backgroundColor = [UIColor whiteColor]; |
| | | _collectionView.dataSource = self; |
| | | _collectionView.delegate = self; |
| | | _collectionView.delaysContentTouches=NO; |
| | | _collectionView.delaysContentTouches = NO; |
| | | [self.view addSubview:_collectionView]; |
| | | |
| | | //注åcell |
| | | [_collectionView registerNib:[UINib nibWithNibName:@"SearchCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:@"SearchCollectionViewCellID"]; |
| | | [_collectionView registerNib:[UINib nibWithNibName:@"SearchCollectionReusableView" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"SearchCollectionReusableViewID"]; |
| | | [_collectionView registerNib:[UINib nibWithNibName:@"ClearCollectionReusableView" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"ClearCollectionReusableViewID"]; |
| | | [_collectionView registerNib:[UINib nibWithNibName:@"SearchCollectionViewCell" bundle:nil] |
| | | forCellWithReuseIdentifier:@"SearchCollectionViewCellID"]; |
| | | |
| | | [_collectionView registerNib:[UINib nibWithNibName:@"SearchCollectionReusableView" bundle:nil] |
| | | forSupplementaryViewOfKind:UICollectionElementKindSectionHeader |
| | | withReuseIdentifier:@"SearchCollectionReusableViewID"]; |
| | | |
| | | [_collectionView registerNib:[UINib nibWithNibName:@"ClearCollectionReusableView" bundle:nil] |
| | | forSupplementaryViewOfKind:UICollectionElementKindSectionFooter |
| | | withReuseIdentifier:@"ClearCollectionReusableViewID"]; |
| | | } |
| | | |
| | | /** |
| | |
| | | - (void)loadData { |
| | | |
| | | [super loadData]; |
| | | if (self.dataHot.count == 0) { |
| | | |
| | | [self.dataHot removeAllObjects]; |
| | | |
| | | if (self.dataHot == 0) { |
| | | |
| | | [self.dataHot removeAllObjects]; |
| | | [self getHotSearch]; |
| | | } |
| | | |
| | | if (self.dataOld.count == 0) { |
| | | |
| | | [self.dataOld removeAllObjects]; |
| | | [self getHotSearch]; |
| | | [self getOldSearch]; |
| | | } |
| | | } |
| | | |
| | | - (BOOL)datasourceIsNull{ |
| | | |
| | | if (self.dataHot.count == 0) { |
| | | return YES; |
| | | }else{ |
| | | |
| | | } else { |
| | | |
| | | return NO; |
| | | } |
| | | } |
| | | - (BOOL)homeIsShowNetWorkView{ |
| | | |
| | | - (BOOL)homeIsShowNetWorkView { |
| | | |
| | | if (self.dataHot.count == 0) { |
| | | return YES; |
| | | }else{ |
| | | |
| | | } else { |
| | | |
| | | return NO; |
| | | } |
| | | } |
| | |
| | | */ |
| | | - (void)getData{ |
| | | [self getHotSearch]; |
| | | [self getOldSearch]; |
| | | //[self getOldSearch]; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * çé¨æç´¢ |
| | | */ |
| | | - (void)getHotSearch{ |
| | | - (void)getHotSearch { |
| | | |
| | | [[YTHNetInterface startInterface] getHotSearchWithblock:^(BOOL isSuccessful, id result, NSString *error) { |
| | | |
| | | if (isSuccessful) { |
| | | NSDictionary *dic = (NSDictionary *)result; |
| | | if (!self.dataHot) { |
| | | self.dataHot = [[NSMutableArray alloc] initWithCapacity:0]; |
| | | } |
| | | |
| | | NSDictionary *dic = (NSDictionary *)result; |
| | | |
| | | self.dataHot = [[dic objectForKey:@"data"] objectForKey:@"hotSearchList"]; |
| | | |
| | | int i=arc4random()%self.dataHot.count; |
| | | self.searchField.Field.placeholder=[self.dataHot[i] objectForKey:@"name"]; |
| | | |
| | | //å·æ°çé¨æç´¢ |
| | | // [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]]; |
| | | int i= arc4random()%self.dataHot.count; |
| | | self.searchField.Field.placeholder = [self.dataHot[i] objectForKey:@"name"]; |
| | | [self.collectionView reloadData]; |
| | | |
| | | }else{ |
| | | //æ¾ç¤ºç½ç»è¿æ¥å¤±è´¥ |
| | | NSLog(@"ç½ç»è¿æ¥å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | }]; |
| | |
| | | /** |
| | | * åå²æç´¢ ä»ç½ç»è·å åæ¶æ¬å°ä¹ä¼ç¼åæ°æ® |
| | | */ |
| | | - (void)getOldSearch{ |
| | | - (void)getOldSearch { |
| | | |
| | | [[YTHNetInterface startInterface] getHistorySearchWithblock:^(BOOL isSuccessful, id result, NSString *error) { |
| | | if (isSuccessful) { |
| | | NSDictionary *dic = (NSDictionary *)result; |
| | | if (!self.dataOld) { |
| | | self.dataOld = [[NSMutableArray alloc] initWithCapacity:0]; |
| | | } |
| | | |
| | | NSDictionary *dic = (NSDictionary *)result; |
| | | |
| | | self.dataOld = [[NSMutableArray alloc] initWithCapacity:0]; |
| | | |
| | | self.dataOld = [[dic objectForKey:@"data"] objectForKey:@"historySearchList"]; |
| | | |
| | | // å·æ°åå²æç´¢ |
| | | // [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]]; |
| | | [self.collectionView reloadData]; |
| | | |
| | | }else{ |
| | | //æ¾ç¤ºç½ç»è¿æ¥å¤±è´¥ |
| | | NSLog(@"ç½ç»è¿æ¥å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | }]; |
| | |
| | | */ |
| | | -(void)ClearHistorys:(UIButton *)sender{ |
| | | [[YTHNetInterface startInterface] getClearHistorySearchWithblock:^(BOOL isSuccessful, id result, NSString *error) { |
| | | |
| | | if (isSuccessful) { |
| | | [self.dataOld removeAllObjects]; |
| | | [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]]; |
| | | }else{ |
| | | NSLog(@"ç½ç»è¿æ¥å¤±è´¥ï¼"); |
| | | |
| | | } else { |
| | | //æ¾ç¤ºç½ç»è¿æ¥å¤±è´¥ |
| | | } |
| | | }]; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å 餿²çéçæä»¶ |
| | | * |
| | | * @param filePath è¦å é¤çæä»¶ |
| | | */ |
| | | -(void)deleteFile:(NSString *)filePath { |
| | | NSFileManager* fileManager=[NSFileManager defaultManager]; |
| | | BOOL blHave=[fileManager fileExistsAtPath:filePath]; |
| | | if (!blHave) { |
| | | NSLog(@"no have"); |
| | | return ; |
| | | }else { |
| | | NSLog(@"have"); |
| | | BOOL blDele= [fileManager removeItemAtPath:filePath error:nil]; |
| | | if (blDele) { |
| | | NSLog(@"dele success"); |
| | | }else { |
| | | NSLog(@"dele fail"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | - (void)getSuggestSearchWithKey:(NSString *)text{ |
| | | [[YTHNetInterface startInterface] getsuggestsearchKW:text Withblock:^(BOOL isSuccessful, id result, NSString *error) { |
| | | if (isSuccessful) { |
| | | |
| | | if (!self.suggestSearch) { |
| | | |
| | | self.suggestSearch = [[NSMutableArray alloc]initWithCapacity:0]; |
| | | } |
| | | |
| | | self.suggestSearch = [result objectForKey:@"data"]; |
| | | for (int i =0; i <self.suggestSearch.count; i++){ |
| | | NSLog(@"%@",[self.suggestSearch objectAtIndex:i]); |
| | | } |
| | | |
| | | [self.suggestTableview reloadData]; |
| | | |
| | | }else{ |
| | |
| | | if (textField.text.length>0) { |
| | | [self getSuggestSearchWithKey:textField.text]; |
| | | _suggestTableview.hidden = NO; |
| | | NSLog(@"ææ°æ®"); |
| | | |
| | | }else{ |
| | | _suggestTableview.hidden = YES; |
| | | NSLog(@"æ æ°æ®"); |
| | | } |
| | | } |
| | | |
| | | - (BOOL)YTHSearchField:(YTHSearchTextField *)searchField textFieldShouldReturn:(UITextField *)textField{ |
| | | NSLog(@"ç¹å»äºé®çæç´¢"); |
| | | - (BOOL)YTHSearchField:(YTHSearchTextField *)searchField textFieldShouldReturn:(UITextField *)textField { |
| | | |
| | | // if (textField.text.length>0) { |
| | | [self searchCotol:textField.text]; |
| | | // } |
| | | return YES; |
| | | } |
| | | |
| | | - (void)YTHSearchField:(YTHSearchTextField *)searchField clearClik:(UIButton *)btn{//ç¹å»æ¸
é¤æé® |
| | | - (void)YTHSearchField:(YTHSearchTextField *)searchField clearClik:(UIButton *)btn {//ç¹å»æ¸
é¤æé® |
| | | self.suggestTableview.hidden = YES; |
| | | self.collectionView.hidden=NO; |
| | | [self getOldSearch]; |
| | |
| | | } |
| | | } |
| | | |
| | | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ |
| | | SearchCollectionViewCell *Cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"SearchCollectionViewCellID" forIndexPath:indexPath]; |
| | | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { |
| | | |
| | | SearchCollectionViewCell *Cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"SearchCollectionViewCellID" |
| | | forIndexPath:indexPath]; |
| | | |
| | | Cell.backgroundColor = SJColor(239, 239, 239, 1); |
| | | |
| | | if (indexPath.section==0) {//çé¨æç´¢çcell |
| | | Cell.searchCellText.text=[_dataHot[indexPath.row] objectForKey:@"name"]; |
| | | Cell.searchCellText.textAlignment=NSTextAlignmentCenter; |
| | | Cell.layer.cornerRadius = Cell.frame.size.height / 2; |
| | | Cell.layer.masksToBounds = YES; |
| | | // Cell.layer.cornerRadius = 4.0f; |
| | | // Cell.contentView.layer.cornerRadius = 4.0f; |
| | | |
| | | Cell.lengths.constant=0.0f; |
| | | }else{ |
| | | |
| | | } else { |
| | | //åå²æç´¢çcell |
| | | NSString *searchString = [_dataOld[indexPath.row] objectForKey:@"name"]; |
| | | Cell.searchCellText.text=[NSString stringWithFormat:@" %@",[searchString removeSpace]]; |
| | | Cell.searchCellText.textAlignment=NSTextAlignmentLeft; |
| | | // Cell.searchCellText.backgroundColor=[UIColor whiteColor]; |
| | | |
| | | Cell.searchCellText.text = [NSString stringWithFormat:@" %@",[searchString removeSpace]]; |
| | | Cell.searchCellText.textAlignment = NSTextAlignmentLeft; |
| | | Cell.searchLayout.constant = 6; |
| | | Cell.lengths.constant = 10.0; |
| | | Cell.searchCellText.layer.cornerRadius = 15; |
| | | Cell.searchCellText.layer.masksToBounds = YES; |
| | | // Cell.layer.cornerRadius = Cell.frame.size.height / 2; |
| | | // Cell.layer.masksToBounds = YES; |
| | | |
| | | Cell.backgroundColor = [UIColor whiteColor]; |
| | | } |
| | | return Cell; |
| | |
| | | |
| | | //æ·»å æ¸
é¤æé® |
| | | UIButton *clearBtn=[[UIButton alloc] init]; |
| | | |
| | | clearBtn.backgroundColor=[UIColor whiteColor]; |
| | | // clearBtn.backgroundColor = SJColor(239, 239, 239, 1); |
| | | clearBtn.titleLabel.font=[UIFont systemFontOfSize:15]; |
| | | |
| | | [clearBtn addTarget:self action:@selector(ClearHistorys:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [clearBtn setTitle:@"æ¸
é¤åå²è®°å½" forState:UIControlStateNormal]; |
| | | [clearBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; |
| | | |
| | | // clearBtn.layer.cornerRadius = clearBtn.frame.size.height / 2; |
| | | // clearBtn.layer.masksToBounds = YES; |
| | | |
| | | [ClearV addSubview:clearBtn]; |
| | | |
| | | [clearBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
| | |
| | | return YES; |
| | | } |
| | | |
| | | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ |
| | | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { |
| | | |
| | | SearchCollectionViewCell *Cell=(SearchCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath]; |
| | | self.searchField.Field.text=[Cell.searchCellText.text removeSpace]; |
| | | NSLog(@"%@",self.searchField.Field.text); |
| | | if (_searchField.Field.text.length>0) { |
| | | |
| | | if (_searchField.Field.text.length > 0) { |
| | | |
| | | [self searchCotol:_searchField.Field.text]; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | - (NSMutableArray *)dataHot { |
| | | |
| | | if (!_dataHot) { |
| | | _dataHot = [[NSMutableArray alloc] init]; |
| | | } |
| | | return _dataHot; |
| | | } |
| | | |
| | | - (NSMutableArray *)dataOld { |
| | | |
| | | if (!_dataOld) { |
| | | _dataOld = [[NSMutableArray alloc] init]; |
| | | } |
| | | return _dataOld; |
| | | } |
| | | |
| | | @end |
| | |
| | | #import "SJTipView.h" |
| | | @interface OrderViewController ()<UIGestureRecognizerDelegate,UIWebViewDelegate,UITableViewDelegate,UITableViewDataSource> |
| | | { |
| | | BOOL _isFanliOrder; // æ¯è¿å©è®¢åè¿æ¯ææè®¢å |
| | | BOOL _isFanliOrder; // æ¯èªè´è®¢åè¿æ¯å享订å |
| | | UIButton *loginBtn;//æªç»å½ææªç»å®æ¶çç»å½æé®ï¼è¦å¨ç¨æ·ç»å½çæ¶åéè |
| | | UILabel *tipLabel;//æªç»å½ææªç»å®æ¶çæç¤ºè¯ï¼è¦å¨ç¨æ·ç»å½çæ¶åéè |
| | | |
| | |
| | | - (SJTipView *)orderTipView{ |
| | | if (!_orderTipView) { |
| | | _orderTipView = [[SJTipView alloc] initWithFrame:CGRectMake(0,CGRectGetMaxY(self.topView.frame) , KScreenW, 84)]; |
| | | _orderTipView.TipLabel.text = @"è¿å©è®¢åæ¯10åéæ´æ°ä¸æ¬¡ï¼è¯·ç¨åå·æ°"; |
| | | _orderTipView.TipLabel.text = @"èªè´è®¢åæ¯10åéæ´æ°ä¸æ¬¡ï¼è¯·ç¨åå·æ°"; |
| | | [_orderTipView.closeBtn addTarget:self action:@selector(ordercloseTip:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _orderTipView; |
| | |
| | | } |
| | | |
| | | /** |
| | | è¿å©è®¢åé项 |
| | | èªè´è®¢åé项 |
| | | |
| | | @param sender è¿å©æé® |
| | | @param sender èªè´æé® |
| | | */ |
| | | - (void)fanliTaped:(UIButton *)sender{ |
| | | if (![[NSUserDefaults standardUserDefaults] boolForKey:@"ordercloseTip"]) { |
| | |
| | | } |
| | | |
| | | /** |
| | | ææè®¢åé项 |
| | | å享订åé项 |
| | | |
| | | @param sender æææé® |
| | | @param sender å享æé® |
| | | */ |
| | | - (void)tichengTaped:(UIButton *)sender{ |
| | | if (![[NSUserDefaults standardUserDefaults] boolForKey:@"ordercloseTip"]) { |
| | |
| | | |
| | | if (state == -1 || state == 4) { |
| | | // cell.fanliLabel.text = [NSString stringWithFormat:@"è¿å©Â¥%.2f",[dic[@"fanMoney"]doubleValue]]; |
| | | cell.fanliLabel.text = [NSString stringWithFormat:@"è¿å©Â¥%@",dic[@"fanMoney"]]; |
| | | cell.fanliLabel.text = [NSString stringWithFormat:@"å¥éÂ¥%@",dic[@"fanMoney"]]; |
| | | |
| | | NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:cell.fanliLabel.text]; |
| | | [str setAttributes:@{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleNone]} range:NSMakeRange(0,3)];//**iOS 8éè¦å ä¸è¿å¥** |
| | |
| | | |
| | | cell.fanliLabel.attributedText = str; |
| | | }else{ |
| | | cell.fanliLabel.text = [NSString stringWithFormat:@"è¿å©Â¥%@",dic[@"fanMoney"]]; |
| | | cell.fanliLabel.text = [NSString stringWithFormat:@"å¥éÂ¥%@",dic[@"fanMoney"]]; |
| | | // cell.fanliLabel.text = [NSString stringWithFormat:@"è¿å©Â¥%@",dic[@"fanMoney"]]; |
| | | NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:cell.fanliLabel.text]; |
| | | [str addAttribute:NSForegroundColorAttributeName value:XYRMainColor range:NSMakeRange(3,cell.fanliLabel.text.length - 3)]; |
| | |
| | | } |
| | | _fanliButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | _fanliButton.frame = CGRectMake(0, 10, KScreenW / 3, 30); |
| | | [_fanliButton setTitle:@"è¿å©è®¢å" forState:UIControlStateNormal]; |
| | | [_fanliButton setTitle:@"èªè´è®¢å" forState:UIControlStateNormal]; |
| | | [_fanliButton setTitleColor:SJColor(51, 51, 51, 1) forState:UIControlStateNormal]; |
| | | [_fanliButton setTitleColor:XYRMainColor forState:UIControlStateSelected]; |
| | | [_fanliButton addTarget:self action:@selector(fanliTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | |
| | | } |
| | | _unitButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | _unitButton.frame = CGRectMake(CGRectGetMaxX(_fanliButton.frame), 10, KScreenW / 3, 30); |
| | | [_unitButton setTitle:@"ææè®¢å" forState:UIControlStateNormal]; |
| | | [_unitButton setTitle:@"å享订å" forState:UIControlStateNormal]; |
| | | [_unitButton setTitleColor:SJColor(51, 51, 51, 1) forState:UIControlStateNormal]; |
| | | [_unitButton setTitleColor:XYRMainColor forState:UIControlStateSelected]; |
| | | [_unitButton addTarget:self action:@selector(tichengTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | |
| | | } |
| | | shareImage.image = [UIImage imageNamed:@"detailShare"]; |
| | | [self addSubview:shareImage]; |
| | | UILabel *sharelabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(shareImage.frame) + 8 , 7, 50, 18)]; |
| | | UILabel *sharelabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(shareImage.frame) + 8 , 6, 65, 18)]; |
| | | if (KScreenW < 375) { |
| | | sharelabel.frame = CGRectMake(CGRectGetMaxX(shareImage.frame) + 5 , 3, 50, 22); |
| | | sharelabel.frame = CGRectMake(CGRectGetMaxX(shareImage.frame) + 5 , 2, 65, 22); |
| | | shareImage.bounds = CGRectMake(0, 0, 15, 14); |
| | | }else if(KScreenW > 375){ |
| | | shareImage.frame = CGRectMake(CGRectGetMinX(self.shareButton.frame) + (KScreenW - KScreenW / 5) / 4 - 30 , 8, 19, 17); |
| | | sharelabel.frame = CGRectMake(CGRectGetMaxX(shareImage.frame) + 10 , 8, 50, 22); |
| | | sharelabel.frame = CGRectMake(CGRectGetMaxX(shareImage.frame) + 10 , 7, 65, 22); |
| | | } |
| | | |
| | | // sharelabel.textAlignment = NSTextAlignmentCenter; |
| | | sharelabel.text = @"å享èµ"; |
| | | sharelabel.font = [UIFont boldSystemFontOfSize:16]; |
| | | sharelabel.text = @"å享å¥é"; |
| | | sharelabel.font = [UIFont boldSystemFontOfSize:15]; |
| | | sharelabel.textColor = XYRMainColor; |
| | | [self addSubview:sharelabel]; |
| | | _moneyLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(self.shareButton.frame), CGRectGetMaxY(sharelabel.frame) , self.shareButton.frame.size.width, 18)]; |
| | | _moneyLabel.font = [UIFont systemFontOfSize:16]; |
| | | _moneyLabel.font = [UIFont systemFontOfSize:15]; |
| | | _moneyLabel.textAlignment = NSTextAlignmentCenter; |
| | | _moneyLabel.text = @""; |
| | | _moneyLabel.textColor = XYRMainColor; |
| | |
| | | TipLabel.font = [UIFont systemFontOfSize:14.0f]; |
| | | TipLabel.textAlignment = NSTextAlignmentCenter; |
| | | TipLabel.numberOfLines = 0; |
| | | TipLabel.text = @"è´ç©è½¦æä½æç¤ºï¼å¿
é¡»ç¹å»è¿å
¥æ¯ä¸ªå忥çç¡®ä¿æè¿å©ï¼åç»ç®ä¸åã"; |
| | | TipLabel.text = @"è´ç©è½¦æä½æç¤ºï¼å¿
é¡»ç¹å»è¿å
¥æ¯ä¸ªå忥çç¡®ä¿æå¥éï¼åç»ç®ä¸åã"; |
| | | [_tipView addSubview:TipLabel]; |
| | | |
| | | UIButton *closeBtn=[[UIButton alloc] initWithFrame:CGRectMake((KScreenW-100)/2, 70, 100, 24)]; |
| | |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import "ZJScrollPageView.h" |
| | | @interface ListViewController : SJBaseViewController<ZJScrollPageViewChildVcDelegate> |
| | | #import "ALBaseController.h" |
| | | |
| | | @interface ListViewController : ALBaseController<ZJScrollPageViewChildVcDelegate> |
| | | |
| | | @property (nonatomic ,strong) NSString *GCname; |
| | | @property (nonatomic ,strong) NSString *GCid; |
| | |
| | | } |
| | | } |
| | | |
| | | - (BOOL)datasourceIsNull { |
| | | |
| | | |
| | | if (_ClassificationData.count == 0) { |
| | | |
| | | return YES; |
| | | |
| | | } else { |
| | | |
| | | return NO; |
| | | } |
| | | } |
| | | |
| | | - (BOOL)homeIsShowNetWorkView { |
| | | |
| | | |
| | |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import "ALBaseController.h" |
| | | |
| | | @interface NEWHomeViewController : SJBaseViewController |
| | | @interface NEWHomeViewController : ALBaseController |
| | | |
| | | @end |
| | |
| | | #import "ScanHelper.h" |
| | | #import "CodeFieldViewController.h" |
| | | #import "MineMessageViewController.h" |
| | | #import "SearchTip.h" |
| | | #import "SearchCouponView.h" |
| | | |
| | | |
| | | @interface NEWHomeViewController ()<ZJScrollPageViewDelegate> { |
| | |
| | | @property (nonatomic , strong) NSMutableArray *goodsClassification;//è·åä¸çº§åç±»æ°æ® |
| | | @property (nonatomic , strong) NSMutableArray *ClassificationName;//ä¸çº§åç±»çåç§° |
| | | @property (nonatomic ,strong) GuessYouLike *buttomView; |
| | | @property (nonatomic ,strong) SearchTip *SearchTips; //æç´¢å»ºè®® |
| | | @property (nonatomic ,strong) SearchCouponView *SearchTips; //æç´¢å»ºè®® |
| | | @property (nonatomic, strong)NSDictionary *buttomSource; |
| | | @property (nonatomic, strong) NSString *pasteboardStr; |
| | | |
| | |
| | | |
| | | @param notice ç²è´´æ¿å
容 |
| | | */ |
| | | - (void)guessYouLike:(NSNotification *)notice{ |
| | | - (void)guessYouLike:(NSNotification *)notice { |
| | | NSLog(@"%@",notice.object); |
| | | NSMutableDictionary *dic = @{}.mutableCopy; |
| | | [dic setObject:notice.object forKey:@"text"]; |
| | |
| | | [self.buttomView.image setYthImageWithURL:self.buttomSource[@"tbImgs"][0] placeholderImage:[UIImage imageNamed:@"ååé»è®¤å¾ç"]]; |
| | | [self.buttomView.enterButton addTarget:self action:@selector(enterTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [self.buttomView.closeButton addTarget:self action:@selector(closeTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | }else if(type == 2){ |
| | | |
| | | } else if (type == 2) { |
| | | |
| | | self.pasteboardStr = object[@"data"][@"data"][@"title"]; |
| | | self.SearchTips=[[SearchTip alloc] initWithSearchStr: self.pasteboardStr withIsSearch:YES]; |
| | | __weak typeof(self)weakSelf = self; |
| | | |
| | | self.SearchTips = [[SearchCouponView alloc] initWithSearchStr:self.pasteboardStr]; |
| | | |
| | | __weak typeof(self) weakSelf = self; |
| | | self.SearchTips.hasIndex = ^(NSInteger index) { |
| | | if (index==790) {//å»æç´¢ |
| | | |
| | | if (index == 791) { |
| | | |
| | | [weakSelf.SearchTips dismiss]; |
| | | weakSelf.SearchTips=nil; |
| | | UIViewController *controller = [weakSelf topViewController ]; |
| | | weakSelf.SearchTips = nil; |
| | | |
| | | UIViewController *controller = [weakSelf topViewController]; |
| | | searchDetailViewController *sresult = [[searchDetailViewController alloc] init]; |
| | | sresult.searchString = weakSelf.pasteboardStr; |
| | | sresult.hidesBottomBarWhenPushed = YES; |
| | | |
| | | [controller.navigationController pushViewController:sresult animated:YES]; |
| | | }else if(index==791){//å
³é |
| | | |
| | | } else if(index == 790){ |
| | | |
| | | [weakSelf.SearchTips dismiss]; |
| | | weakSelf.SearchTips=nil; |
| | | weakSelf.SearchTips = nil; |
| | | } |
| | | }; |
| | | [self.SearchTips show]; |
| | | } |
| | | } |
| | | |
| | | } fail:^(id object) { |
| | | NSLog(@"%@",object); |
| | | }]; |
| | |
| | | [SearchImage setImage:[UIImage imageNamed:@"æç´¢ç²è²"]]; |
| | | [titleView addSubview:SearchImage]; |
| | | |
| | | UILabel *tipLabel=[[UILabel alloc] initWithFrame:CGRectMake(45, 0, KScreenW-105, 40)]; |
| | | UILabel *tipLabel=[[UILabel alloc] initWithFrame:CGRectMake(35, 0, KScreenW-105, 40)]; |
| | | tipLabel.backgroundColor=[UIColor clearColor]; |
| | | tipLabel.text=@"ç²è´´å®è´æ é¢ï¼å
é¢å¸è¿è¿å©"; |
| | | tipLabel.text=@"ç²è´´å®è´æ é¢ï¼æç´¢åå伿 å¸"; |
| | | tipLabel.textColor=YTHColor(169, 169, 169); |
| | | tipLabel.font=[UIFont systemFontOfSize:16.0f]; |
| | | if (KScreenW < 375) { |
| | |
| | | NSArray *array = object[@"data"][@"systemClientParamsList"]; |
| | | [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"MainUrlArray"]; |
| | | NSDictionary *dic = @{@"info":array}; |
| | | |
| | | [[NSUserDefaults standardUserDefaults] setObject:dic forKey:@"MainUrlArray"]; |
| | | |
| | | for (NSInteger index = 0; index < array.count; index ++) { |
| | | |
| | | NSDictionary *dic = array[index]; |
| | | |
| | | NSLog(@"%@",dic[@"name"]); |
| | | |
| | | if ([dic[@"key"] compare:@"weex_file_newer"] == 0) { |
| | | |
| | | } |
| | | |
| | | if ([dic[@"key"] compare:@"newuser"] == 0) { |
| | | |
| | | [YTHsharedManger startManger].isNewUser = [dic[@"value"] integerValue]; |
| | | } |
| | | |
| | | if ([dic[@"key"] compare:@"web_newer"] == 0) { |
| | | [YTHsharedManger startManger].weexUrlString = [NSString stringWithFormat:@"%@", dic[@"value"]]; |
| | | } |
| | | |
| | | if ([dic[@"key"] compare:@"invite_url"] == 0) { |
| | | [YTHsharedManger startManger].membersUrl = [NSString stringWithFormat:@"%@", dic[@"value"]]; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | - (BOOL)datasourceIsNull { |
| | | |
| | | |
| | | if (_goodsClassification.count == 0) { |
| | | |
| | | return YES; |
| | | |
| | | } else { |
| | | |
| | | return NO; |
| | | } |
| | | } |
| | | |
| | | - (BOOL)homeIsShowNetWorkView { |
| | | |
| | | |
| | |
| | | |
| | | if (isSuccessful) { |
| | | |
| | | |
| | | |
| | | NSDictionary *dic = (NSDictionary *)result; |
| | | [self->_ClassificationName removeAllObjects]; |
| | | self.ClassificationName = nil; |
| | |
| | | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *labelLayout; |
| | | - (void)fillCells:(NSDictionary *)dic; |
| | | |
| | | /// å¾çä¸ç°è²èæ¯ |
| | | @property (weak, nonatomic) IBOutlet UIView *garyBgView; |
| | | /// å¾çä¸ç°è²èæ¯çlabelï¼åºéºåå |
| | | @property (weak, nonatomic) IBOutlet UILabel *storeLabel; |
| | | @end |
| | |
| | | */ |
| | | - (void)fillCells:(NSDictionary *)dic{ |
| | | [self.goodsPic setYthImageWithURL:[dic objectForKey:@"pictUrl"] placeholderImage:[UIImage imageNamed:@"ååé»è®¤å¾ç"]]; |
| | | self.layer.borderColor=XYRBackgroundColor.CGColor; |
| | | self.layer.borderColor = XYRBackgroundColor.CGColor; |
| | | self.layer.borderWidth=2; |
| | | |
| | | self.shopType=[dic objectForKey:@"shopType"]; |
| | | self.TBtitle=[dic objectForKey:@"title"]; |
| | | self.titleLabel.textColor = SJColor(98, 98, 98, 1); |
| | | // cell.titleLabel.textColor = [UIColor redColor]; |
| | | self.titleLabel.font = [UIFont systemFontOfSize:12]; |
| | | if (KScreenW == 375) { |
| | | self.titleLabel.font = [UIFont systemFontOfSize:14]; |
| | |
| | | }else if([_shopType intValue]==2){ |
| | | typeString = @"天ç«ä»·"; |
| | | } |
| | | self.storeLabel.text = dic[@"shopTitle"]; |
| | | self.PromotionLabel.text = [NSString stringWithFormat:@"%@:Â¥%@", typeString, dic[@"zkPrice"]]; |
| | | self.PromotionLabel.textColor = SJColor(153, 153, 153, 1); |
| | | self.titleLabel.textColor = SJColor(51, 51, 51, 1); |
| | |
| | | <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="è¿" translatesAutoresizingMaskIntoConstraints="NO" id="BwQ-NX-he1"> |
| | | <rect key="frame" x="8" y="5" width="18" height="16"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="16" id="JgF-7Q-C3g"/> |
| | | <constraint firstAttribute="width" constant="18" id="ej3-JJ-TGT"/> |
| | | <constraint firstAttribute="height" constant="13" id="JgF-7Q-C3g"/> |
| | | <constraint firstAttribute="width" constant="25" id="ej3-JJ-TGT"/> |
| | | </constraints> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="æé:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bbQ-3v-6GK"> |
| | |
| | | </subviews> |
| | | <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | <constraints> |
| | | <constraint firstItem="BwQ-NX-he1" firstAttribute="top" secondItem="Vvu-9W-mD3" secondAttribute="top" constant="5" id="2na-Zh-h3G"/> |
| | | <constraint firstItem="BwQ-NX-he1" firstAttribute="top" secondItem="Vvu-9W-mD3" secondAttribute="top" constant="9" id="2na-Zh-h3G"/> |
| | | <constraint firstItem="xDZ-BW-bzu" firstAttribute="top" secondItem="bbQ-3v-6GK" secondAttribute="bottom" constant="4" id="95U-ej-8Du"/> |
| | | <constraint firstItem="bbQ-3v-6GK" firstAttribute="leading" secondItem="Btc-L3-CVA" secondAttribute="trailing" constant="4" id="Cs4-sQ-eeQ"/> |
| | | <constraint firstAttribute="trailing" secondItem="xDZ-BW-bzu" secondAttribute="trailing" constant="10" id="OLP-bN-hkc"/> |
| | |
| | | <constraint firstAttribute="trailing" secondItem="bbQ-3v-6GK" secondAttribute="trailing" constant="8" id="rdd-1q-PnL"/> |
| | | <constraint firstItem="xiz-pp-du9" firstAttribute="width" secondItem="Vvu-9W-mD3" secondAttribute="width" multiplier="1:2" id="sDz-dz-ZNz"/> |
| | | <constraint firstItem="BwQ-NX-he1" firstAttribute="leading" secondItem="Vvu-9W-mD3" secondAttribute="leading" constant="8" id="sSt-oG-0RS"/> |
| | | </constraints> |
| | | </view> |
| | | <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xGN-0S-IMT"> |
| | | <rect key="frame" x="0.0" y="143" width="222" height="25"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="æµè¯åæ¢å¤èè¤åå¾åå" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zN4-kS-z4L"> |
| | | <rect key="frame" x="10" y="5" width="202" height="15"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="13"/> |
| | | <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | <color key="backgroundColor" white="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="25" id="CgM-2e-z3P"/> |
| | | <constraint firstAttribute="trailing" secondItem="zN4-kS-z4L" secondAttribute="trailing" constant="10" id="If7-g6-G5V"/> |
| | | <constraint firstAttribute="bottom" secondItem="zN4-kS-z4L" secondAttribute="bottom" constant="5" id="cAY-00-BhH"/> |
| | | <constraint firstItem="zN4-kS-z4L" firstAttribute="leading" secondItem="xGN-0S-IMT" secondAttribute="leading" constant="10" id="p69-8A-fae"/> |
| | | <constraint firstItem="zN4-kS-z4L" firstAttribute="top" secondItem="xGN-0S-IMT" secondAttribute="top" constant="5" id="yCq-Sl-YzK"/> |
| | | </constraints> |
| | | </view> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="B0Z-VT-E8D"> |
| | |
| | | <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> |
| | | <constraints> |
| | | <constraint firstItem="dwb-x1-yD2" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="8" id="38X-Fp-jKY"/> |
| | | <constraint firstAttribute="trailing" secondItem="xGN-0S-IMT" secondAttribute="trailing" id="3g5-Uu-xdf"/> |
| | | <constraint firstItem="QPF-po-I2k" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="8" id="6CM-b9-yLs"/> |
| | | <constraint firstItem="WTa-K0-8y6" firstAttribute="top" secondItem="dwb-x1-yD2" secondAttribute="bottom" constant="5" id="96B-Ac-ofJ"/> |
| | | <constraint firstItem="xGN-0S-IMT" firstAttribute="bottom" secondItem="dwb-x1-yD2" secondAttribute="bottom" id="9Ja-v4-1bN"/> |
| | | <constraint firstItem="Vvu-9W-mD3" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="FDe-R0-Oe1"/> |
| | | <constraint firstItem="dwb-x1-yD2" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="8" id="Hb3-Ha-1Ef"/> |
| | | <constraint firstItem="QPF-po-I2k" firstAttribute="top" secondItem="dwb-x1-yD2" secondAttribute="bottom" constant="6" id="I9x-Ab-xdA"/> |
| | |
| | | <constraint firstAttribute="trailing" secondItem="B0Z-VT-E8D" secondAttribute="trailing" id="Ruh-dp-wvS"/> |
| | | <constraint firstAttribute="trailing" secondItem="Vvu-9W-mD3" secondAttribute="trailing" id="SI4-53-fLd"/> |
| | | <constraint firstAttribute="bottom" secondItem="B0Z-VT-E8D" secondAttribute="bottom" id="ToQ-Ya-9Ek"/> |
| | | <constraint firstItem="xGN-0S-IMT" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="Wic-tA-fTj"/> |
| | | <constraint firstAttribute="trailing" secondItem="WTa-K0-8y6" secondAttribute="trailing" constant="8" id="fJh-Ka-a9k"/> |
| | | <constraint firstAttribute="trailing" secondItem="dwb-x1-yD2" secondAttribute="trailing" constant="8" id="iyd-Gd-VIp"/> |
| | | <constraint firstAttribute="bottom" secondItem="Vvu-9W-mD3" secondAttribute="bottom" id="qPx-tX-QcG"/> |
| | |
| | | <outlet property="YHQ1" destination="ceg-86-5sX" id="YRb-Es-AKY"/> |
| | | <outlet property="YHQ2" destination="vUn-xn-UrF" id="Ugh-s5-nD3"/> |
| | | <outlet property="fanPriceLabel" destination="Btc-L3-CVA" id="RU3-Yn-z9s"/> |
| | | <outlet property="garyBgView" destination="xGN-0S-IMT" id="6iw-qH-6Ic"/> |
| | | <outlet property="goodsPic" destination="dwb-x1-yD2" id="RMw-dg-yB7"/> |
| | | <outlet property="imageH" destination="IFe-EB-eSc" id="lvW-J6-JB0"/> |
| | | <outlet property="labelImage" destination="QPF-po-I2k" id="mEC-fw-zBN"/> |
| | |
| | | <outlet property="quanMoneyLabel" destination="tKP-sG-z3A" id="twE-ah-ff1"/> |
| | | <outlet property="quanView" destination="RK9-Tt-xac" id="MIW-8O-WbG"/> |
| | | <outlet property="quanViewLayout" destination="CpL-a4-u00" id="2b8-wj-vVe"/> |
| | | <outlet property="storeLabel" destination="zN4-kS-z4L" id="yU5-gf-V55"/> |
| | | <outlet property="titleLabel" destination="WTa-K0-8y6" id="0WD-dv-dJY"/> |
| | | <outlet property="totalPriceLabel" destination="xiz-pp-du9" id="sZe-1t-cJs"/> |
| | | <outlet property="youhuiquan" destination="Dxb-wm-Cly" id="jTM-hq-hsB"/> |
| | |
| | | <image name="满å2" width="5" height="19"/> |
| | | <image name="满å3" width="5" height="19"/> |
| | | <image name="足迹æªéä¸" width="25" height="25"/> |
| | | <image name="足迹éä¸" width="25" height="25"/> |
| | | <image name="è¿" width="13" height="12"/> |
| | | <image name="足迹éä¸" width="24" height="24"/> |
| | | <image name="è¿" width="25" height="13"/> |
| | | </resources> |
| | | </document> |
| | |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import "ZJScrollPageView.h" |
| | | |
| | | #import "searchViewController.h" //æç´¢çé¢ |
| | | #import "ALBaseController.h" |
| | | |
| | | @interface recommendViewController : SJBaseViewController<ZJScrollPageViewChildVcDelegate> |
| | | @interface recommendViewController : ALBaseController<ZJScrollPageViewChildVcDelegate> |
| | | |
| | | @end |
| | |
| | | //注åç¹å»tabbaritemçéç¥æ¶é´(主è¦åè½ï¼å½tabBarViewcontrolleræ¾ç¤ºé¦é¡µæ¶ï¼ç¹å»é¦é¡µtabBarï¼å®ç°åå°é¡¶é¨çåè½ï¼ç±»ä¼¼æ·å®) |
| | | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tabBarSeleted) name:@"HomeViewController" object:nil]; |
| | | //æ¯å¦æ¾ç¤ºæ°äººçº¢å
çå¼¹çª |
| | | if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"newuser"] intValue]==0) { |
| | | [self ShowNewUser]; |
| | | if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"newuser"] intValue] == 0) { |
| | | |
| | | }else{ |
| | | if ([YTHsharedManger startManger].isNewUser == 0) { |
| | | |
| | | [self ShowNewUser]; |
| | | } |
| | | |
| | | } else { |
| | | |
| | | [self getPasteboard]; |
| | | } |
| | | |
| | | [self.navigationController.navigationBar setShadowImage:[UIImage new]]; |
| | | |
| | | } |
| | |
| | | /** |
| | | æ¾ç¤ºæ°äººçº¢å
|
| | | */ |
| | | -(void)ShowNewUser{ |
| | | - (void)ShowNewUser { |
| | | //夿å½åç¨æ·æ¯å¦ç»å½ |
| | | BOOL bor = [[NSUserDefaults standardUserDefaults] boolForKey:@"islogined"]; |
| | | NSLog(@"%ld",self.navigationController.viewControllers.count); |
| | |
| | | |
| | | } |
| | | |
| | | - (BOOL)datasourceIsNull { |
| | | |
| | | |
| | | if (self.dataBanner.count == 0) { |
| | | |
| | | return YES; |
| | | |
| | | } else { |
| | | |
| | | return NO; |
| | | } |
| | | } |
| | | |
| | | - (BOOL)homeIsShowNetWorkView { |
| | | |
| | | |
| | |
| | | |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | |
| | | ALToastBottom(@"ç½ç»æªè¿æ¥ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | } |
| | | |
| | | } else { |
| | |
| | | |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | [CustomProgressHUD showNormal:@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"]; |
| | | ALToastBottom(@"ç½ç»è¿æ¥å¼å¸¸ï¼è¯·æ£æµç½ç»è®¾ç½®"); |
| | | } |
| | | |
| | | } |
| | | |
| | | //å è½½ä¿éæ æ°æ® |
| | |
| | | } |
| | | |
| | | //cell被ç¹å»çå¤çæ¹æ³ |
| | | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ |
| | | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { |
| | | |
| | | NSLog(@"%ld,%ld",indexPath.section,indexPath.row); |
| | | |
| | | [collectionView deselectItemAtIndexPath:indexPath animated:YES]; |
| | | if (indexPath.section==0) { |
| | | NSDictionary *tempDic = _HonestList[indexPath.row]; |
| | | NSString *Type = [tempDic objectForKey:@"type"]; |
| | | |
| | | if ([Type intValue]==4) {//è°ç½é¡µè§å¾ |
| | | ShonpingShareViewController *SureWebVC=[[ShonpingShareViewController alloc] init]; |
| | | SureWebVC.urlString=[YTHsharedManger startManger].membersUrl; |
| | | SureWebVC.hidesBottomBarWhenPushed=YES; |
| | | [self.navigationController pushViewController:SureWebVC animated:YES]; |
| | | }else{ |
| | | if ([Type intValue] == 4) {//è°ç½é¡µè§å¾ |
| | | // ShonpingShareViewController *SureWebVC=[[ShonpingShareViewController alloc] init]; |
| | | // SureWebVC.urlString=[YTHsharedManger startManger].membersUrl; |
| | | // SureWebVC.hidesBottomBarWhenPushed=YES; |
| | | // [self.navigationController pushViewController:SureWebVC animated:YES]; |
| | | // |
| | | } else { |
| | | |
| | | NSString *controller = tempDic[@"jumpDetail"][@"controller"]; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ |
| | | if(indexPath.section==0){ |
| | | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { |
| | | |
| | | if (indexPath.section == 0) { |
| | | |
| | | TCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TCollectionViewCell" forIndexPath:indexPath]; |
| | | NSDictionary *temp = _HonestList[indexPath.row]; |
| | | [cell.cellicon setYthImageWithURL:[temp objectForKey:@"picture"] placeholderImage:[UIImage imageNamed:@"ååé»è®¤å¾ç"]]; |
| | | cell.cellName.text=[temp objectForKey:@"name"]; |
| | | cell.backgroundColor = [UIColor whiteColor]; |
| | | |
| | | if (indexPath.row == 3) { |
| | | self.imageViewGif.frame = CGRectMake(cell.frame.size.width - 45, 5, 45, 20); |
| | | [cell addSubview:self.imageViewGif]; |
| | | } |
| | | |
| | | return cell; |
| | | }else if(indexPath.section==1){ |
| | | |
| | | } else if (indexPath.section == 1) { |
| | | |
| | | TopicCollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"TopicCollectionViewCell" forIndexPath:indexPath]; |
| | | NSDictionary *item=_dataspecial[indexPath.row]; |
| | | [cell.Pic setYthImageWithURL:[item objectForKey:@"picture"] placeholderImage:[UIImage imageNamed:@"é»è®¤banner"]]; |
| | | return cell; |
| | | }else{ |
| | | |
| | | } else { |
| | | |
| | | if (indexPath.row==0) { |
| | | SectionTopicCollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"SectionTopicCollectionViewCell" forIndexPath:indexPath]; |
| | | |
| | |
| | | [cell.image setYthImageWithURL:[sectionTopDic objectForKey:@"picUrl"] placeholderImage:[UIImage imageNamed:@"é»è®¤banner"]]; |
| | | |
| | | return cell; |
| | | }else{ |
| | | |
| | | } else { |
| | | recommendCollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"recommendCollectionViewCell" forIndexPath:indexPath]; |
| | | [cell.MaskedView setHidden:YES]; |
| | | NSArray *SectionItem=[_datasection[indexPath.section-2] objectForKey:@"recommendSectionGoodsList"]; |