Merge branch 'master' of ssh://193.112.35.168:29418/fanliquan
15个文件已删除
43个文件已修改
64个文件已添加
| | |
| | | 0D29AB56246C1BA90039B6F1 /* BalanceIncomeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D29AB55246C1BA90039B6F1 /* BalanceIncomeModel.m */; }; |
| | | 0D29AB59246C23860039B6F1 /* FundHistoryDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D29AB58246C23860039B6F1 /* FundHistoryDetailController.m */; }; |
| | | 0D29AB5C246C27930039B6F1 /* FundHistoryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D29AB5B246C27930039B6F1 /* FundHistoryCell.m */; }; |
| | | 0D2B2C6C247DFD1D003F27AE /* WPHGoodsdetailInfoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D2B2C6B247DFD1D003F27AE /* WPHGoodsdetailInfoCell.m */; }; |
| | | 0D2B2C71247E1C30003F27AE /* SNGoodsDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D2B2C70247E1C30003F27AE /* SNGoodsDetailController.m */; }; |
| | | 0D2B2C742480B2E3003F27AE /* WPHTransformView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D2B2C732480B2E3003F27AE /* WPHTransformView.m */; }; |
| | | 0D2B2C782480B519003F27AE /* SNTransformView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D2B2C772480B519003F27AE /* SNTransformView.m */; }; |
| | | 0D36185F243C1350005E3CD6 /* TeamDataStatisticsBodyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D36185E243C1350005E3CD6 /* TeamDataStatisticsBodyView.m */; }; |
| | | 0D3852DC247CAEBD00140E12 /* RecommendDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D3852DB247CAEBD00140E12 /* RecommendDetailController.m */; }; |
| | | 0D3852E1247CB0E400140E12 /* RecommendDetailHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D3852E0247CB0E400140E12 /* RecommendDetailHeaderView.m */; }; |
| | | 0D3852E4247CC51B00140E12 /* RecommendDetailFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D3852E3247CC51B00140E12 /* RecommendDetailFooterView.m */; }; |
| | | 0D3852E7247CEC3500140E12 /* SearchGoodsGuideCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D3852E6247CEC3500140E12 /* SearchGoodsGuideCell.m */; }; |
| | | 0D3852EA247CFEA200140E12 /* SearchDetailFilterWPHView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D3852E9247CFEA200140E12 /* SearchDetailFilterWPHView.m */; }; |
| | | 0D3852EE247D184600140E12 /* WPHGoodsDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D3852ED247D184600140E12 /* WPHGoodsDetailController.m */; }; |
| | | 0D4F8AFE247B5D060033DABB /* CZBMapNavgation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D4F8AF8247B5D050033DABB /* CZBMapNavgation.m */; }; |
| | | 0D4F8AFF247B5D060033DABB /* WHExteriorNavicationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D4F8AF9247B5D050033DABB /* WHExteriorNavicationController.m */; }; |
| | | 0D4F8B00247B5D060033DABB /* CZBInfoManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D4F8AFD247B5D050033DABB /* CZBInfoManager.m */; }; |
| | | 0D601D5E24285F2E0072CBA6 /* VipEquityView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D601D5D24285F2E0072CBA6 /* VipEquityView.m */; }; |
| | | 0D601DA22434267E0072CBA6 /* MyFansCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D601DA12434267D0072CBA6 /* MyFansCell.m */; }; |
| | | 0D601DA62434656A0072CBA6 /* TeamDetailMainController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D601DA52434656A0072CBA6 /* TeamDetailMainController.m */; }; |
| | |
| | | 2D0FAA0321B61A88001F12A6 /* CollectionGoodsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA0221B61A88001F12A6 /* CollectionGoodsModel.m */; }; |
| | | 2D0FAA0721B65455001F12A6 /* NewGoodsShareTopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA0621B65455001F12A6 /* NewGoodsShareTopView.m */; }; |
| | | 2D0FAA0A21B66562001F12A6 /* SingleFigureShareController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA0921B66562001F12A6 /* SingleFigureShareController.m */; }; |
| | | 2D0FAA0D21B66588001F12A6 /* MultipleFigureShareController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA0C21B66588001F12A6 /* MultipleFigureShareController.m */; }; |
| | | 2D0FAA1021B66B01001F12A6 /* SingleFigureShareSelectView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA0F21B66B01001F12A6 /* SingleFigureShareSelectView.m */; }; |
| | | 2D0FAA1321B67A50001F12A6 /* ShowShareView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA1221B67A50001F12A6 /* ShowShareView.m */; }; |
| | | 2D0FAA1721B680C5001F12A6 /* NewShareBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA1621B680C5001F12A6 /* NewShareBottomView.m */; }; |
| | |
| | | 2D20C987223A4FB4000ACA30 /* NoCouponNoRebateController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D20C986223A4FB4000ACA30 /* NoCouponNoRebateController.m */; }; |
| | | 2D222B1E20C77D7200D444C3 /* UIViewController+Tools.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D222B1D20C77D7100D444C3 /* UIViewController+Tools.mm */; }; |
| | | 2D223C3022E021CB00AF183E /* SearchDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D223C2F22E021CB00AF183E /* SearchDetailController.m */; }; |
| | | 2D223C3422E02AA700AF183E /* SearchDetailSelectView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D223C3322E02AA700AF183E /* SearchDetailSelectView.m */; }; |
| | | 2D223C3822E0478200AF183E /* SearchDetailFilterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D223C3722E0478200AF183E /* SearchDetailFilterView.m */; }; |
| | | 2D22585321E97B3E00A6E182 /* ThirdClassificationCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D22585221E97B3E00A6E182 /* ThirdClassificationCell.m */; }; |
| | | 2D229B3B2285640C0011AE8F /* HomeLimitedTimeSecondsKillView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D229B3A2285640C0011AE8F /* HomeLimitedTimeSecondsKillView.m */; }; |
| | |
| | | 2DB678FA21BA54B900B256AA /* SJShopMoreCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2DB678F821BA54B900B256AA /* SJShopMoreCell.xib */; }; |
| | | 2DB8149423BDF5A600E8B7D1 /* UILabel+AL.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB8149323BDF5A600E8B7D1 /* UILabel+AL.m */; }; |
| | | 2DB8DAA121241CAE0034CD7C /* InviteOneCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB8DAA021241CAE0034CD7C /* InviteOneCell.m */; }; |
| | | 2DBD8748223A086800187A6A /* GuideSearchCollCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBD8746223A086800187A6A /* GuideSearchCollCell.m */; }; |
| | | 2DBD8749223A086800187A6A /* GuideSearchCollCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2DBD8747223A086800187A6A /* GuideSearchCollCell.xib */; }; |
| | | 2DBFEAE921D0894B003CF104 /* OrderSearchViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBFEAE721D0894B003CF104 /* OrderSearchViewCell.m */; }; |
| | | 2DBFEAEA21D0894B003CF104 /* OrderSearchViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2DBFEAE821D0894B003CF104 /* OrderSearchViewCell.xib */; }; |
| | | 2DC056BC221550B300685D27 /* UMCustomSearch.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DC056B5221550B200685D27 /* UMCustomSearch.m */; }; |
| | |
| | | 0D29AB58246C23860039B6F1 /* FundHistoryDetailController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FundHistoryDetailController.m; sourceTree = "<group>"; }; |
| | | 0D29AB5A246C27930039B6F1 /* FundHistoryCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FundHistoryCell.h; sourceTree = "<group>"; }; |
| | | 0D29AB5B246C27930039B6F1 /* FundHistoryCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FundHistoryCell.m; sourceTree = "<group>"; }; |
| | | 0D2B2C6A247DFD1D003F27AE /* WPHGoodsdetailInfoCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WPHGoodsdetailInfoCell.h; sourceTree = "<group>"; }; |
| | | 0D2B2C6B247DFD1D003F27AE /* WPHGoodsdetailInfoCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WPHGoodsdetailInfoCell.m; sourceTree = "<group>"; }; |
| | | 0D2B2C6F247E1C30003F27AE /* SNGoodsDetailController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SNGoodsDetailController.h; sourceTree = "<group>"; }; |
| | | 0D2B2C70247E1C30003F27AE /* SNGoodsDetailController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SNGoodsDetailController.m; sourceTree = "<group>"; }; |
| | | 0D2B2C722480B2E3003F27AE /* WPHTransformView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WPHTransformView.h; sourceTree = "<group>"; }; |
| | | 0D2B2C732480B2E3003F27AE /* WPHTransformView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WPHTransformView.m; sourceTree = "<group>"; }; |
| | | 0D2B2C762480B519003F27AE /* SNTransformView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SNTransformView.h; sourceTree = "<group>"; }; |
| | | 0D2B2C772480B519003F27AE /* SNTransformView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SNTransformView.m; sourceTree = "<group>"; }; |
| | | 0D36185D243C1350005E3CD6 /* TeamDataStatisticsBodyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TeamDataStatisticsBodyView.h; sourceTree = "<group>"; }; |
| | | 0D36185E243C1350005E3CD6 /* TeamDataStatisticsBodyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TeamDataStatisticsBodyView.m; sourceTree = "<group>"; }; |
| | | 0D3852DA247CAEBD00140E12 /* RecommendDetailController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecommendDetailController.h; sourceTree = "<group>"; }; |
| | | 0D3852DB247CAEBD00140E12 /* RecommendDetailController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RecommendDetailController.m; sourceTree = "<group>"; }; |
| | | 0D3852DF247CB0E400140E12 /* RecommendDetailHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecommendDetailHeaderView.h; sourceTree = "<group>"; }; |
| | | 0D3852E0247CB0E400140E12 /* RecommendDetailHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RecommendDetailHeaderView.m; sourceTree = "<group>"; }; |
| | | 0D3852E2247CC51B00140E12 /* RecommendDetailFooterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecommendDetailFooterView.h; sourceTree = "<group>"; }; |
| | | 0D3852E3247CC51B00140E12 /* RecommendDetailFooterView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RecommendDetailFooterView.m; sourceTree = "<group>"; }; |
| | | 0D3852E5247CEC3500140E12 /* SearchGoodsGuideCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SearchGoodsGuideCell.h; sourceTree = "<group>"; }; |
| | | 0D3852E6247CEC3500140E12 /* SearchGoodsGuideCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SearchGoodsGuideCell.m; sourceTree = "<group>"; }; |
| | | 0D3852E8247CFEA200140E12 /* SearchDetailFilterWPHView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SearchDetailFilterWPHView.h; sourceTree = "<group>"; }; |
| | | 0D3852E9247CFEA200140E12 /* SearchDetailFilterWPHView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SearchDetailFilterWPHView.m; sourceTree = "<group>"; }; |
| | | 0D3852EC247D184600140E12 /* WPHGoodsDetailController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WPHGoodsDetailController.h; sourceTree = "<group>"; }; |
| | | 0D3852ED247D184600140E12 /* WPHGoodsDetailController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WPHGoodsDetailController.m; sourceTree = "<group>"; }; |
| | | 0D4F8AF8247B5D050033DABB /* CZBMapNavgation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CZBMapNavgation.m; sourceTree = "<group>"; }; |
| | | 0D4F8AF9247B5D050033DABB /* WHExteriorNavicationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WHExteriorNavicationController.m; sourceTree = "<group>"; }; |
| | | 0D4F8AFA247B5D050033DABB /* CZBInfoManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CZBInfoManager.h; sourceTree = "<group>"; }; |
| | | 0D4F8AFB247B5D050033DABB /* WHExteriorNavicationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WHExteriorNavicationController.h; sourceTree = "<group>"; }; |
| | | 0D4F8AFC247B5D050033DABB /* CZBMapNavgation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CZBMapNavgation.h; sourceTree = "<group>"; }; |
| | | 0D4F8AFD247B5D050033DABB /* CZBInfoManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CZBInfoManager.m; sourceTree = "<group>"; }; |
| | | 0D601D5C24285F2E0072CBA6 /* VipEquityView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VipEquityView.h; sourceTree = "<group>"; }; |
| | | 0D601D5D24285F2E0072CBA6 /* VipEquityView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VipEquityView.m; sourceTree = "<group>"; }; |
| | | 0D601DA02434267D0072CBA6 /* MyFansCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFansCell.h; sourceTree = "<group>"; }; |
| | |
| | | 2D0FAA0621B65455001F12A6 /* NewGoodsShareTopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NewGoodsShareTopView.m; sourceTree = "<group>"; }; |
| | | 2D0FAA0821B66562001F12A6 /* SingleFigureShareController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SingleFigureShareController.h; sourceTree = "<group>"; }; |
| | | 2D0FAA0921B66562001F12A6 /* SingleFigureShareController.m */ = {isa = PBXFileReference; indentWidth = 3; lastKnownFileType = sourcecode.c.objc; path = SingleFigureShareController.m; sourceTree = "<group>"; }; |
| | | 2D0FAA0B21B66588001F12A6 /* MultipleFigureShareController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MultipleFigureShareController.h; sourceTree = "<group>"; }; |
| | | 2D0FAA0C21B66588001F12A6 /* MultipleFigureShareController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MultipleFigureShareController.m; sourceTree = "<group>"; }; |
| | | 2D0FAA0E21B66B01001F12A6 /* SingleFigureShareSelectView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SingleFigureShareSelectView.h; sourceTree = "<group>"; }; |
| | | 2D0FAA0F21B66B01001F12A6 /* SingleFigureShareSelectView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SingleFigureShareSelectView.m; sourceTree = "<group>"; }; |
| | | 2D0FAA1121B67A50001F12A6 /* ShowShareView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShowShareView.h; sourceTree = "<group>"; }; |
| | |
| | | 2D222B1D20C77D7100D444C3 /* UIViewController+Tools.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "UIViewController+Tools.mm"; sourceTree = "<group>"; }; |
| | | 2D223C2E22E021CB00AF183E /* SearchDetailController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SearchDetailController.h; sourceTree = "<group>"; }; |
| | | 2D223C2F22E021CB00AF183E /* SearchDetailController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SearchDetailController.m; sourceTree = "<group>"; }; |
| | | 2D223C3222E02AA700AF183E /* SearchDetailSelectView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SearchDetailSelectView.h; sourceTree = "<group>"; }; |
| | | 2D223C3322E02AA700AF183E /* SearchDetailSelectView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SearchDetailSelectView.m; sourceTree = "<group>"; }; |
| | | 2D223C3622E0478200AF183E /* SearchDetailFilterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SearchDetailFilterView.h; sourceTree = "<group>"; }; |
| | | 2D223C3722E0478200AF183E /* SearchDetailFilterView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SearchDetailFilterView.m; sourceTree = "<group>"; }; |
| | | 2D22585121E97B3E00A6E182 /* ThirdClassificationCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ThirdClassificationCell.h; sourceTree = "<group>"; }; |
| | |
| | | 2DB8149323BDF5A600E8B7D1 /* UILabel+AL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UILabel+AL.m"; sourceTree = "<group>"; }; |
| | | 2DB8DA9F21241CAE0034CD7C /* InviteOneCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InviteOneCell.h; sourceTree = "<group>"; }; |
| | | 2DB8DAA021241CAE0034CD7C /* InviteOneCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InviteOneCell.m; sourceTree = "<group>"; }; |
| | | 2DBD8745223A086800187A6A /* GuideSearchCollCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GuideSearchCollCell.h; sourceTree = "<group>"; }; |
| | | 2DBD8746223A086800187A6A /* GuideSearchCollCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GuideSearchCollCell.m; sourceTree = "<group>"; }; |
| | | 2DBD8747223A086800187A6A /* GuideSearchCollCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GuideSearchCollCell.xib; sourceTree = "<group>"; }; |
| | | 2DBFEAE621D0894B003CF104 /* OrderSearchViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OrderSearchViewCell.h; sourceTree = "<group>"; }; |
| | | 2DBFEAE721D0894B003CF104 /* OrderSearchViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OrderSearchViewCell.m; sourceTree = "<group>"; }; |
| | | 2DBFEAE821D0894B003CF104 /* OrderSearchViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OrderSearchViewCell.xib; sourceTree = "<group>"; }; |
| | |
| | | path = Model; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 0D2B2C69247DFCEE003F27AE /* Cell */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 0D2B2C6A247DFD1D003F27AE /* WPHGoodsdetailInfoCell.h */, |
| | | 0D2B2C6B247DFD1D003F27AE /* WPHGoodsdetailInfoCell.m */, |
| | | 0D2B2C722480B2E3003F27AE /* WPHTransformView.h */, |
| | | 0D2B2C732480B2E3003F27AE /* WPHTransformView.m */, |
| | | ); |
| | | path = Cell; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 0D2B2C6D247E1AEE003F27AE /* SN */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 0D2B2C752480B4F8003F27AE /* View */, |
| | | 0D2B2C6F247E1C30003F27AE /* SNGoodsDetailController.h */, |
| | | 0D2B2C70247E1C30003F27AE /* SNGoodsDetailController.m */, |
| | | ); |
| | | path = SN; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 0D2B2C752480B4F8003F27AE /* View */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 0D2B2C762480B519003F27AE /* SNTransformView.h */, |
| | | 0D2B2C772480B519003F27AE /* SNTransformView.m */, |
| | | ); |
| | | path = View; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 0D3852DD247CB03700140E12 /* RecommendDetail */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 0D3852DE247CB05C00140E12 /* View */, |
| | | 0D3852DA247CAEBD00140E12 /* RecommendDetailController.h */, |
| | | 0D3852DB247CAEBD00140E12 /* RecommendDetailController.m */, |
| | | ); |
| | | path = RecommendDetail; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 0D3852DE247CB05C00140E12 /* View */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 0D3852DF247CB0E400140E12 /* RecommendDetailHeaderView.h */, |
| | | 0D3852E0247CB0E400140E12 /* RecommendDetailHeaderView.m */, |
| | | 0D3852E2247CC51B00140E12 /* RecommendDetailFooterView.h */, |
| | | 0D3852E3247CC51B00140E12 /* RecommendDetailFooterView.m */, |
| | | ); |
| | | path = View; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 0D3852EB247D17EF00140E12 /* WPH */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 0D2B2C69247DFCEE003F27AE /* Cell */, |
| | | 0D3852EC247D184600140E12 /* WPHGoodsDetailController.h */, |
| | | 0D3852ED247D184600140E12 /* WPHGoodsDetailController.m */, |
| | | ); |
| | | path = WPH; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 0D4F8AF7247B5D050033DABB /* CZBWebManager */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 0D4F8AFA247B5D050033DABB /* CZBInfoManager.h */, |
| | | 0D4F8AFD247B5D050033DABB /* CZBInfoManager.m */, |
| | | 0D4F8AFC247B5D050033DABB /* CZBMapNavgation.h */, |
| | | 0D4F8AF8247B5D050033DABB /* CZBMapNavgation.m */, |
| | | 0D4F8AFB247B5D050033DABB /* WHExteriorNavicationController.h */, |
| | | 0D4F8AF9247B5D050033DABB /* WHExteriorNavicationController.m */, |
| | | ); |
| | | path = CZBWebManager; |
| | | sourceTree = "<group>"; |
| | | }; |
| | | 0D601DA3243465310072CBA6 /* TeamDetail */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | |
| | | 0DEBAA9723F6855700CD7521 /* QuickShareChangeImageController.m */, |
| | | 2D0FAA0821B66562001F12A6 /* SingleFigureShareController.h */, |
| | | 2D0FAA0921B66562001F12A6 /* SingleFigureShareController.m */, |
| | | 2D0FAA0B21B66588001F12A6 /* MultipleFigureShareController.h */, |
| | | 2D0FAA0C21B66588001F12A6 /* MultipleFigureShareController.m */, |
| | | 2D3A83B6225DDE800001CAE1 /* ModifyTemplateController.h */, |
| | | 2D3A83B7225DDE800001CAE1 /* ModifyTemplateController.m */, |
| | | 2D783478215CBE6700D72B3F /* Cell */, |
| | |
| | | 18966C9620AD7F6A004CD297 /* åå详æ
*/ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 0D2B2C6D247E1AEE003F27AE /* SN */, |
| | | 0D3852EB247D17EF00140E12 /* WPH */, |
| | | 2D7EF8A822E9965700A9875E /* PDD */, |
| | | 2D8AE62D22E709BB0066A0D2 /* JD */, |
| | | 2D1C09662240E04500E43916 /* View */, |
| | |
| | | 18966C9B20AD7F6A004CD297 /* GDDetailTableViewCell.xib */, |
| | | 18966C9C20AD7F6A004CD297 /* GDetailView.h */, |
| | | 18966C9D20AD7F6A004CD297 /* GDetailView.m */, |
| | | 18966C9E20AD7F6A004CD297 /* GDrecomeTableViewCell.h */, |
| | | 18966C9F20AD7F6A004CD297 /* GDrecomeTableViewCell.m */, |
| | | 18966C9E20AD7F6A004CD297 /* GDrecomeTableViewCell.h */, |
| | | 18966CA020AD7F6A004CD297 /* GDrecomeTableViewCell.xib */, |
| | | 18966CA120AD7F6A004CD297 /* GoodDeTrViewController.h */, |
| | | 18966CA220AD7F6A004CD297 /* GoodDeTrViewController.m */, |
| | |
| | | 18AC538B1E5A9876006D1FDF /* lib */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 0D4F8AF7247B5D050033DABB /* CZBWebManager */, |
| | | 2DB5ED3D238516E4009B498C /* Player */, |
| | | 2D316B6F22D5C34200707CF3 /* FloatingWindow */, |
| | | 2D35665F22C9DFA500A86899 /* LaunchIntroduction */, |
| | |
| | | 18D4303F1E7A2CF20007CCB5 /* TableViewcell */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 2DBD8745223A086800187A6A /* GuideSearchCollCell.h */, |
| | | 2DBD8746223A086800187A6A /* GuideSearchCollCell.m */, |
| | | 2DBD8747223A086800187A6A /* GuideSearchCollCell.xib */, |
| | | 0D3852E5247CEC3500140E12 /* SearchGoodsGuideCell.h */, |
| | | 0D3852E6247CEC3500140E12 /* SearchGoodsGuideCell.m */, |
| | | 2D2D64EC22CCAABA00A9E9F8 /* GuideSearchVideoCell.h */, |
| | | 2D2D64ED22CCAABA00A9E9F8 /* GuideSearchVideoCell.m */, |
| | | 2D1A59A8224B733B003153A8 /* SearchSuggestTableViewCell.h */, |
| | |
| | | 2D0EF49421A7EC6D009A2FED /* View */, |
| | | 2D0EF49121A7E70B009A2FED /* RecommendRecordController.h */, |
| | | 2D0EF49221A7E70B009A2FED /* RecommendRecordController.m */, |
| | | 0D3852DD247CB03700140E12 /* RecommendDetail */, |
| | | ); |
| | | path = RecommendedRecord; |
| | | sourceTree = "<group>"; |
| | |
| | | 2D223C3122E02A7C00AF183E /* View */ = { |
| | | isa = PBXGroup; |
| | | children = ( |
| | | 2D223C3222E02AA700AF183E /* SearchDetailSelectView.h */, |
| | | 2D223C3322E02AA700AF183E /* SearchDetailSelectView.m */, |
| | | 0D3852E8247CFEA200140E12 /* SearchDetailFilterWPHView.h */, |
| | | 0D3852E9247CFEA200140E12 /* SearchDetailFilterWPHView.m */, |
| | | 2D223C3622E0478200AF183E /* SearchDetailFilterView.h */, |
| | | 2D223C3722E0478200AF183E /* SearchDetailFilterView.m */, |
| | | 2D2BDCF222E1580A001D3F6A /* SearchDetailConditionView.h */, |
| | |
| | | 18360AF9206C9F5E00F9EAB1 /* MineMessageTableViewCell.xib in Resources */, |
| | | 18966CA820AD7F6A004CD297 /* GDDetailTableViewCell.xib in Resources */, |
| | | 2D57D8A8213CD87C00DCF8D1 /* HZPhotoBrowser.bundle in Resources */, |
| | | 2DBD8749223A086800187A6A /* GuideSearchCollCell.xib in Resources */, |
| | | 2D4627DB21C7804400DB2D4F /* SJDynCShareController.xib in Resources */, |
| | | 2D68202E2276D18D002A8DC5 /* yw_1222.jpg in Resources */, |
| | | 2D10B0BB239E4F1200FE2BA9 /* å¼çº¢å
éå¸é³æ.mp3 in Resources */, |
| | |
| | | 2D8F4C5A2100672500198E06 /* SettingViewModel.m in Sources */, |
| | | 2D432CA523961BC0004FB8FB /* ALActivityViewController.m in Sources */, |
| | | 1892033E20BE51C6008C1045 /* LBXScanLineAnimation.m in Sources */, |
| | | 0D2B2C782480B519003F27AE /* SNTransformView.m in Sources */, |
| | | 18966CA620AD7F6A004CD297 /* ButtomCarView.m in Sources */, |
| | | 1845C462209C562D009C639B /* ZXSMSMMSResultParser.m in Sources */, |
| | | 1845C4E4209C562E009C639B /* ZXUPCEANExtension5Support.m in Sources */, |
| | |
| | | 2D138C542236401D0071D71C /* MQMessageFormViewService.m in Sources */, |
| | | 2D8B4B3A234C3CC000F9359C /* DynamicActivitieListCell.m in Sources */, |
| | | 2D138C2E2236401D0071D71C /* MQPreChatCells.m in Sources */, |
| | | 0D3852E4247CC51B00140E12 /* RecommendDetailFooterView.m in Sources */, |
| | | 2DCCAFCF221D272300AF017B /* WelfareCenterController.m in Sources */, |
| | | 2DAE2B3522703E6900791EEC /* BrandRebateContentCell.m in Sources */, |
| | | 2D186420219E6B070024BB53 /* AESCipher.m in Sources */, |
| | |
| | | 2D138BDF2236401C0071D71C /* MEIQIA_FBBitmapFontView.m in Sources */, |
| | | 1845C490209C562D009C639B /* ZXEncodeHints.m in Sources */, |
| | | 18AC53511E5A92B7006D1FDF /* BaseViewController.m in Sources */, |
| | | 0D2B2C6C247DFD1D003F27AE /* WPHGoodsdetailInfoCell.m in Sources */, |
| | | 2D16BCC621F021BF00F8421E /* MessageCountModel.m in Sources */, |
| | | 2D143DBB238F61990091719C /* InviteCodeInputView.m in Sources */, |
| | | 2D1E1F842313AF4500B0CEE9 /* BastTipPopCell.m in Sources */, |
| | |
| | | 18E7C7901EB9ABCC00A02A14 /* PraiseView.m in Sources */, |
| | | 2D0981EA23AC6157009842D0 /* CollegeBannerView.m in Sources */, |
| | | 1845C589209C6450009C639B /* MyQRViewController.m in Sources */, |
| | | 0D3852E1247CB0E400140E12 /* RecommendDetailHeaderView.m in Sources */, |
| | | 1845C459209C562D009C639B /* ZXExpandedProductResultParser.m in Sources */, |
| | | 1892034820BE51C6008C1045 /* ZXingWrapper.m in Sources */, |
| | | 2D223C3422E02AA700AF183E /* SearchDetailSelectView.m in Sources */, |
| | | 2D0DA44222F56FE600CE073E /* HomeFilterXFView.m in Sources */, |
| | | 2D243D2D228035DD0093F1E8 /* InviteMateriaListNormolCell.m in Sources */, |
| | | 2D138C152236401D0071D71C /* MQEvaluationCell.m in Sources */, |
| | |
| | | 2D20C987223A4FB4000ACA30 /* NoCouponNoRebateController.m in Sources */, |
| | | 1845C4C1209C562E009C639B /* ZXRSSExpandedDecodedNumeric.m in Sources */, |
| | | 181ECE271EF369BF00472224 /* ZJSegmentStyle.m in Sources */, |
| | | 0D3852EA247CFEA200140E12 /* SearchDetailFilterWPHView.m in Sources */, |
| | | 2D0D7E5422CDA977001BC15C /* WebMorePopView.m in Sources */, |
| | | 2D138C3F2236401D0071D71C /* MQTabInputContentView.m in Sources */, |
| | | 1892034720BE51C6008C1045 /* LBXZXCapture.m in Sources */, |
| | |
| | | 1845C488209C562D009C639B /* ZXIntArray.m in Sources */, |
| | | 2D435FC421EC6B6D004961C3 /* ShopDeShareView.m in Sources */, |
| | | 2D0BB32722BB164300EEB3FB /* RedEnvelopDetailController.m in Sources */, |
| | | 0D4F8AFF247B5D060033DABB /* WHExteriorNavicationController.m in Sources */, |
| | | 2DC86F0E21CB2B0200AABF53 /* NewOrderViewController.m in Sources */, |
| | | 2D0D29412254462900ECD3AA /* HomeBlockAreaView.m in Sources */, |
| | | 2D871B0322A0D56E00CE2788 /* NotLikePopView.m in Sources */, |
| | |
| | | 2DC056D2231CD30A006FD406 /* GoldTaskDateView.m in Sources */, |
| | | 180B16E01F009F320043B74D /* FSActionSheetItem.m in Sources */, |
| | | 2D15471D22B78939006B8A81 /* SpreadGDrecomeTableViewCell.m in Sources */, |
| | | 0D4F8B00247B5D060033DABB /* CZBInfoManager.m in Sources */, |
| | | 2D64E90022714F9A0047E0AD /* StoreContentModel.m in Sources */, |
| | | 2DB5ED3623851516009B498C /* OrderTopTipsView.m in Sources */, |
| | | 2D138C3D2236401D0071D71C /* MQButtonGroupBar.m in Sources */, |
| | | 2D1009DA23B7337C00099E16 /* CollegeSearchController.m in Sources */, |
| | | 1894E7F120B6C73E00C28F33 /* NSString+XHWebImageAutoSize.m in Sources */, |
| | | 0D3852EE247D184600140E12 /* WPHGoodsDetailController.m in Sources */, |
| | | 2D0D7E5722CDFF91001BC15C /* WebLoadProgressView.m in Sources */, |
| | | 1897D9C01E600E94003DF6FE /* ClearCollectionReusableView.m in Sources */, |
| | | 2D223C3022E021CB00AF183E /* SearchDetailController.m in Sources */, |
| | | 1845C4BE209C562E009C639B /* ZXRSSExpandedCurrentParsingState.m in Sources */, |
| | | 2D2DE43D230BF2F900042CE7 /* GoldExchangePopView.m in Sources */, |
| | | 0D4F8AFE247B5D060033DABB /* CZBMapNavgation.m in Sources */, |
| | | 2D4D89D0215DFC61009F820F /* NewGoodsShareContentModel.m in Sources */, |
| | | 2D38854F21D3362000731204 /* BalaDetailCell.m in Sources */, |
| | | 2D1131AA21A65E170089F95C /* CountMyTeamModel.m in Sources */, |
| | |
| | | 18AC53861E5A9840006D1FDF /* UIImage+YTH.m in Sources */, |
| | | 0DDEA058242303AE00A1DACE /* MineUpgradeMemberView.m in Sources */, |
| | | 2D871B0722A1255200CE2788 /* ActivityCommonTemplateController.m in Sources */, |
| | | 2D0FAA0D21B66588001F12A6 /* MultipleFigureShareController.m in Sources */, |
| | | 2D0FAA0321B61A88001F12A6 /* CollectionGoodsModel.m in Sources */, |
| | | 0D29AB20246AC9210039B6F1 /* GoodsRecommendModel.m in Sources */, |
| | | 0DEBAA9E23F6A2D700CD7521 /* QuickShareCommentaryView.m in Sources */, |
| | |
| | | 1892034320BE51C6008C1045 /* LBXScanView.m in Sources */, |
| | | 2D138BE02236401C0071D71C /* MEIQIA_FBSquareFont.m in Sources */, |
| | | 2D826745215B73B300FC2B20 /* NewMainInviteController.m in Sources */, |
| | | 0D2B2C742480B2E3003F27AE /* WPHTransformView.m in Sources */, |
| | | 2D2D64E822CC7D9400A9E9F8 /* BuyCheapGoodsHeaderTableViewCell.m in Sources */, |
| | | 2D14061823C859B300DF992C /* GuessLikeTurnToLinkPopView.m in Sources */, |
| | | 2D09062E230E9A7000E2D291 /* ExchangeInviteCodeCell.m in Sources */, |
| | |
| | | 2DF1FA4621252318007043AF /* InviteTwoCell.m in Sources */, |
| | | 1845C4FD209C562E009C639B /* ZXPDF417HighLevelEncoder.m in Sources */, |
| | | 1845C4BC209C562E009C639B /* ZXAnyAIDecoder.m in Sources */, |
| | | 0D2B2C71247E1C30003F27AE /* SNGoodsDetailController.m in Sources */, |
| | | 2D4E540B221A920C00FDC8BE /* NoSingleTicketCell.m in Sources */, |
| | | 1845C4A4209C562E009C639B /* ZXDataMatrixErrorCorrection.m in Sources */, |
| | | 2D35122321D1D9250072F4E2 /* OrdSResultController.m in Sources */, |
| | |
| | | 180B16E71F009F320043B74D /* XLPhotoBrowser.m in Sources */, |
| | | 1845C4CD209C562E009C639B /* ZXRSSPair.m in Sources */, |
| | | 2D39478D238E16DD00FE263C /* HomeProtocolView.m in Sources */, |
| | | 0D3852E7247CEC3500140E12 /* SearchGoodsGuideCell.m in Sources */, |
| | | 2D38855D21D37E2600731204 /* XFRedView.m in Sources */, |
| | | 2D8F9065231E49D40067B13D /* GolTaskDailySignModel.m in Sources */, |
| | | 0D1FD33324091DE500CAC2E0 /* DynamicManage.m in Sources */, |
| | | 2D138BE52236401D0071D71C /* MEIQIA_FBSquareFontView.m in Sources */, |
| | | 2D73492323B59F29008DBFC2 /* SJProLibView.m in Sources */, |
| | | 2DBD8748223A086800187A6A /* GuideSearchCollCell.m in Sources */, |
| | | 2D138C5A2236401D0071D71C /* MQMessageFormTextView.m in Sources */, |
| | | 1845C460209C562D009C639B /* ZXProductResultParser.m in Sources */, |
| | | 1845C46C209C562D009C639B /* ZXVCardResultParser.m in Sources */, |
| | |
| | | 2D138C4C2236401D0071D71C /* UIViewController+MQHieriachy.m in Sources */, |
| | | 1845C4FE209C562E009C639B /* ZXPDF417Common.m in Sources */, |
| | | 2D19A43C21BE0F830000B789 /* ALShareRecordCell.m in Sources */, |
| | | 0D3852DC247CAEBD00140E12 /* RecommendDetailController.m in Sources */, |
| | | 18AC53501E5A92B7006D1FDF /* BaseNavigationController.m in Sources */, |
| | | 2D138C262236401D0071D71C /* MQChatEmojize.m in Sources */, |
| | | 2D416AB2221D285F009DD366 /* RebateRewardDetailTwoCell.m in Sources */, |
| | |
| | | CODE_SIGN_IDENTITY = "Apple Development"; |
| | | CODE_SIGN_STYLE = Automatic; |
| | | COPY_PHASE_STRIP = YES; |
| | | CURRENT_PROJECT_VERSION = 81; |
| | | CURRENT_PROJECT_VERSION = 82; |
| | | DEPLOYMENT_POSTPROCESSING = NO; |
| | | DEVELOPMENT_TEAM = 748KKGQ5LW; |
| | | ENABLE_BITCODE = NO; |
| | |
| | | CODE_SIGN_IDENTITY = "Apple Development"; |
| | | CODE_SIGN_STYLE = Automatic; |
| | | COPY_PHASE_STRIP = YES; |
| | | CURRENT_PROJECT_VERSION = 81; |
| | | CURRENT_PROJECT_VERSION = 82; |
| | | DEPLOYMENT_POSTPROCESSING = NO; |
| | | DEVELOPMENT_TEAM = 748KKGQ5LW; |
| | | ENABLE_BITCODE = NO; |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <Scheme |
| | | LastUpgradeVersion = "1130" |
| | | LastUpgradeVersion = "1140" |
| | | version = "1.3"> |
| | | <BuildAction |
| | | parallelizeBuildables = "YES" |
| | |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | uuid = "D07D8A82-EAAF-4C52-9F0F-EC9EF903972D" |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/数据/ALWebView/ShonpingShareViewController.m" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "1237" |
| | | endingLineNumber = "1237" |
| | | landmarkName = "-webView:decidePolicyForNavigationAction:decisionHandler:" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | uuid = "0AC59403-C0FD-485A-9AA3-E89ED7E1E243" |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/数据/ALWebView/ShonpingShareViewController.m" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "1254" |
| | | endingLineNumber = "1254" |
| | | landmarkName = "-webView:decidePolicyForNavigationAction:decisionHandler:" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | uuid = "EA002B50-BD55-4F55-AA49-313BA0A3AE1F" |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/数据/ALWebView/ShonpingShareViewController.m" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "1246" |
| | | endingLineNumber = "1246" |
| | | landmarkName = "-webView:decidePolicyForNavigationAction:decisionHandler:" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | uuid = "691A85CE-3137-4DFB-AFF4-8A63E18D96E7" |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/数据/ALWebView/ShonpingShareViewController.m" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "1229" |
| | | endingLineNumber = "1229" |
| | | landmarkName = "-webView:decidePolicyForNavigationAction:decisionHandler:" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | <BreakpointProxy |
| | | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> |
| | | <BreakpointContent |
| | | uuid = "8366C1DA-5AB2-419F-942D-A090755A6512" |
| | | shouldBeEnabled = "Yes" |
| | | ignoreCount = "0" |
| | | continueAfterRunningActions = "No" |
| | | filePath = "MIduo/数据/lib/CZBWebManager/CZBInfoManager.m" |
| | | startingColumnNumber = "9223372036854775807" |
| | | endingColumnNumber = "9223372036854775807" |
| | | startingLineNumber = "66" |
| | | endingLineNumber = "66" |
| | | landmarkName = "-userContentController:didReceiveScriptMessage:" |
| | | landmarkType = "7"> |
| | | </BreakpointContent> |
| | | </BreakpointProxy> |
| | | </Breakpoints> |
| | | </Bucket> |
| | |
| | | |
| | | @end |
| | | |
| | | @implementation AppDelegate { NSTimer *connectionTimer; BOOL done; } |
| | | @implementation AppDelegate { |
| | | NSTimer *connectionTimer; BOOL doneNav; |
| | | |
| | | } |
| | | |
| | | -(void)timerFired:(NSTimer *)timer |
| | | { |
| | | done = YES; |
| | | - (void)timerFired:(NSTimer *)timer { |
| | | doneNav = YES; |
| | | } |
| | | |
| | | - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ |
| | |
| | | //2.é»è®¤æ¯æ²¡æå¼å¯ ä»
éåçº¿ç¨ ä¸»çº¿ç¨æ¯æ²¡ç¨ç |
| | | [runloop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; |
| | | } |
| | | while (!done); |
| | | while (!doneNav); |
| | | |
| | | [self loadViewsWithBor:YES]; |
| | | |
| | |
| | | PlistFileOperator *plist = [[PlistFileOperator alloc] init]; |
| | | plist.dataName = @"homeNavData"; |
| | | [plist writeFileWithData:object]; |
| | | [self seelpTime]; |
| | | [self seelpNavTime]; |
| | | }); |
| | | |
| | | } fail:^(id object) { |
| | | [self seelpTime]; |
| | | [self seelpNavTime]; |
| | | }]; |
| | | } |
| | | |
| | | - (void)seelpTime |
| | | { |
| | | - (void)seelpNavTime { |
| | | connectionTimer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired:) userInfo:nil repeats:NO]; |
| | | [[NSRunLoop currentRunLoop] addTimer:connectionTimer forMode:NSDefaultRunLoopMode]; |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "ic_share_sn@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "ic_share_sn@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "icon_share_wph@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "icon_share_wph@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "jump_img_sn@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "jump_img_sn@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "jump_img_wph@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "jump_img_wph@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "img æ·è´@2x.png", |
| | | "idiom" : "universal", |
| | | "filename" : "search_guide1@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "img æ·è´@3x.png", |
| | | "idiom" : "universal", |
| | | "filename" : "search_guide1@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "version" : 1, |
| | | "author" : "xcode" |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | | } |
| | |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "img æ·è´@2x-2.png", |
| | | "idiom" : "universal", |
| | | "filename" : "search_guide2@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "img æ·è´@3x-2.png", |
| | | "idiom" : "universal", |
| | | "filename" : "search_guide2@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "version" : 1, |
| | | "author" : "xcode" |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | | } |
| | |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "å¾ç æ·è´ 2@2x.png", |
| | | "idiom" : "universal", |
| | | "filename" : "search_guide3@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "å¾ç æ·è´ 2@3x.png", |
| | | "idiom" : "universal", |
| | | "filename" : "search_guide3@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "version" : 1, |
| | | "author" : "xcode" |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "search_guide4@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "search_guide4@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "search_guide5@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "search_guide5@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "icon_goodsDetail_hairCircle@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "icon_goodsDetail_hairCircle@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "icon_éååº æ·è´ 2@2x.png", |
| | | "idiom" : "universal", |
| | | "filename" : "icon_éååº@2x.png", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "icon_éååº æ·è´ 2@3x.png", |
| | | "idiom" : "universal", |
| | | "filename" : "icon_éååº@3x.png", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "version" : 1, |
| | | "author" : "xcode" |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "dynamic_oneclickbill@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "dynamic_oneclickbill@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "home_pop_sn@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "home_pop_sn@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "pop_home_wph@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "pop_home_wph@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | |
| | | <string>openapp.jdmobile</string> |
| | | <string>jdlogin</string> |
| | | <string>pinduoduo</string> |
| | | <string>baidumap</string> |
| | | <string>iosamap</string> |
| | | <string>qqmap</string> |
| | | </array> |
| | | <key>LSRequiresIPhoneOS</key> |
| | | <true/> |
| | |
| | | @property (nonatomic, nullable, copy) NSString *zkPrice; |
| | | /// æéé |
| | | @property (nonatomic, nullable, copy) NSString *salesCount; |
| | | /// ææ£ï¼å¯åä¼ååç¹æï¼ |
| | | @property (nonatomic, nullable, copy) NSString *discount; |
| | | /// 0å¨å® 1䏿¶ (2å·²å享-å享åº) |
| | | @property (nonatomic, assign) NSInteger state; |
| | | /// æ¶é´(æ¶èã足迹) |
| | |
| | | #import <WebKit/WebKit.h> |
| | | #import <sys/utsname.h> |
| | | #import <AdSupport/AdSupport.h> |
| | | #import "CZBInfoManager.h" |
| | | |
| | | #import "SAMKeychain.h" |
| | | #import <ShareSDK/ShareSDK.h> |
| | |
| | | self.webView.backgroundColor = XYRBackgroundColor; |
| | | self.webView.navigationDelegate = self; |
| | | self.webView.UIDelegate = self; |
| | | |
| | | [self.view addSubview:self.webView]; |
| | | |
| | | [self initProgressView]; |
| | |
| | | |
| | | - (void)initLoadWebView { |
| | | NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.urlString]]; |
| | | [self.webView loadRequest:request]; |
| | | [CZBInfoManager setUserAgent:@"blksIOS" webView:self.webView completion:^{ |
| | | [self.webView loadRequest:request]; |
| | | |
| | | }]; |
| | | [CZBInfoManager registerWebView:self.webView]; |
| | | |
| | | |
| | | } |
| | | |
| | | - (void)initProgressView { |
| | |
| | | return; |
| | | } |
| | | |
| | | BOOL isAllow = [CZBInfoManager webView:webView decidePolicyForNavigationAction:navigationAction]; |
| | | if (!isAllow) { |
| | | WKNavigationActionPolicy actionPolicy = isAllow ? WKNavigationActionPolicyAllow:WKNavigationActionPolicyCancel; |
| | | decisionHandler(actionPolicy); |
| | | return; |
| | | } |
| | | |
| | | if (![urlStr hasPrefix:@"http"]) { |
| | | decisionHandler(WKNavigationActionPolicyCancel); |
| | | return; |
| | |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if (navigationAction.targetFrame == nil) { |
| | | [webView loadRequest:navigationAction.request]; |
| | | } |
| | |
| | | } |
| | | |
| | | } else { |
| | | if (object) { |
| | | if (object && ![object isEqual:[NSNull null]]) { |
| | | return YES; |
| | | } |
| | | } |
| | |
| | | |
| | | } else if (goodsType == 3) { |
| | | [self pushAnyInterfaceController:@"PDDGoodsDetailController" parms:@{@"id":goodsId, @"from":from?:@"", @"goodsType":[NSString stringWithFormat:@"%ld",(long)goodsType]}]; |
| | | |
| | | } else if (goodsType == 4) { |
| | | [self pushAnyInterfaceController:@"WPHGoodsDetailController" parms:@{@"id":goodsId, @"from":from?:@"", @"goodsType":[NSString stringWithFormat:@"%ld",(long)goodsType]}]; |
| | | |
| | | } else if (goodsType == 5) { |
| | | [self pushAnyInterfaceController:@"SNGoodsDetailController" parms:@{@"id":goodsId, @"from":from?:@"", @"goodsType":[NSString stringWithFormat:@"%ld",(long)goodsType]}]; |
| | | } |
| | | } |
| | | |
| | |
| | | }]; |
| | | } |
| | | |
| | | - (void)Post:(NSString *)url param:(NSDictionary *)param timeOut:(NSTimeInterval)timeOut success:(NetBlock)successBlock fail:(ErrorBlock)errorBlock |
| | | { |
| | | - (void)Post:(NSString *)url param:(NSDictionary *)param timeOut:(NSTimeInterval)timeOut success:(NetBlock)successBlock fail:(ErrorBlock)errorBlock { |
| | | url= [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; |
| | | // AFSecurityPolicy *securityPolicy = [[AFSecurityPolicy alloc] init]; |
| | | // [securityPolicy setAllowInvalidCertificates:YES]; |
New file |
| | |
| | | // |
| | | // CZBInfoManager.h |
| | | // CZBWebProjectDemoForOC |
| | | // |
| | | // Created by è¾¹æºå³° on 2018/11/14. |
| | | // Copyright © 2018 czb365.com. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <WebKit/WebKit.h> |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @protocol CZBInfoManagerDelegate <NSObject> |
| | | |
| | | /** |
| | | CZBInfoManagerDelegateä»£çæ¹æ³,å®ç°ä»£çå¯å®å¶èªå·±çå¯¼èªæ¹æ³ |
| | | |
| | | @param startLat èµ·ç¹ç维度 |
| | | @param startLng èµ·ç¹çç»åº¦ |
| | | @param endLat ç»ç¹ç维度 |
| | | @param endLng ç»ç¹çç»åº¦ |
| | | */ |
| | | - (void)czbNavigation:(NSString *)startLat startLng:(NSString *)startLng endLat:(NSString *)endLat endLng:(NSString *)endLng; |
| | | |
| | | @end |
| | | |
| | | @interface CZBInfoManager : NSObject |
| | | /// åä¾å¯¹è±¡ |
| | | + (CZBInfoManager *)shared; |
| | | /// 代ç对象,妿éè¦å®å¶å¯¼èªæ¹æ³,å¨ä»£çä¸å®ç°å³å¯,å¦ä¸éè¦åæ éå®ç°,é»è®¤ä¼æå¼ææºä¸å®è£
çå°å¾è¿è¡å¯¼èª |
| | | @property (nonatomic, weak) id<CZBInfoManagerDelegate> delegate; |
| | | /// 注åwebviewåå¹³å°çscheme |
| | | + (void)registerWebView:(WKWebView *)webView; |
| | | |
| | | /** |
| | | 设置UA |
| | | |
| | | @param userAgent UA å使¹æ¼â¾³ç¼©å+IOS |
| | | @param webView WKWebView |
| | | @param completion å®æåæ |
| | | */ |
| | | + (void)setUserAgent:(NSString *)userAgent webView:(WKWebView *)webView completion:(void(^)(void))completion; |
| | | /// æ¯ä»è¿ç¨ä¸æ¦æªæ¯ä»ä¿¡æ¯ |
| | | + (BOOL)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction; |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // CZBInfoManager.m |
| | | // CZBWebProjectDemoForOC |
| | | // |
| | | // Created by è¾¹æºå³° on 2018/11/14. |
| | | // Copyright © 2018 czb365.com. All rights reserved. |
| | | // |
| | | |
| | | #import "CZBInfoManager.h" |
| | | #import "CZBMapNavgation.h" |
| | | |
| | | static NSString *mapNavigation = @"CZBMapNavi"; |
| | | static NSString *wechatPayConfig = @"CZBWXPayConfig"; |
| | | |
| | | @interface CZBInfoManager()<WKScriptMessageHandler> |
| | | @property (nonatomic, copy) NSMutableDictionary *czbExtraHead; |
| | | @end |
| | | |
| | | static CZBInfoManager *instance = nil; |
| | | @implementation CZBInfoManager |
| | | |
| | | + (CZBInfoManager *)shared { |
| | | if (instance == nil) { |
| | | instance = [[CZBInfoManager alloc] init]; |
| | | } |
| | | return instance; |
| | | } |
| | | |
| | | + (id)allocWithZone:(struct _NSZone*)zone { |
| | | if (instance == nil) { |
| | | instance = [super allocWithZone:zone]; |
| | | } |
| | | return instance; |
| | | } |
| | | |
| | | - (id)copyWithZone:(struct _NSZone *)zone { |
| | | return instance; |
| | | } |
| | | |
| | | - (NSMutableDictionary *)czbExtraHead { |
| | | if (!_czbExtraHead) { |
| | | _czbExtraHead = [NSMutableDictionary new]; |
| | | } |
| | | return _czbExtraHead; |
| | | } |
| | | |
| | | + (void)registerWebView:(WKWebView *)webView { |
| | | |
| | | [webView.configuration.userContentController addScriptMessageHandler:[CZBInfoManager shared] name:mapNavigation]; |
| | | [webView.configuration.userContentController addScriptMessageHandler:[CZBInfoManager shared] name:wechatPayConfig]; |
| | | NSString *js = [NSString stringWithFormat:@"window.czb = {setExtraInfoHead: function(key,value){window.webkit.messageHandlers.%@.postMessage({'key': key, 'value': value});},startNavigate: function(startLat,startLng,endLat,endLng){window.webkit.messageHandlers.%@.postMessage([''+startLat, ''+startLng, ''+endLat, ''+endLng]);}}", wechatPayConfig, mapNavigation]; |
| | | WKUserScript *script = [[WKUserScript alloc] initWithSource:js injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:true]; |
| | | [webView.configuration.userContentController addUserScript:script]; |
| | | } |
| | | |
| | | - (void)userContentController:(nonnull WKUserContentController *)userContentController didReceiveScriptMessage:(nonnull WKScriptMessage *)message { |
| | | if (message.name == wechatPayConfig && [message.body isKindOfClass:NSDictionary.class]) { |
| | | if (message.body[@"key"] != nil && message.body[@"value"] != nil) { |
| | | self.czbExtraHead[message.body[@"key"]] = message.body[@"value"]; |
| | | } |
| | | } else if (message.name == mapNavigation && [message.body isKindOfClass: NSArray.class]) { |
| | | NSArray *arr = (NSArray *)message.body; |
| | | if (arr.count < 4) { return; } |
| | | if (_delegate != nil) { |
| | | [_delegate czbNavigation:arr[0] startLng:arr[1] endLat:arr[2] endLng:arr[3]]; |
| | | }else{ |
| | | [CZBMapNavgation czbMapNavigation:arr[0] startLng:arr[1] endLat:arr[2] endLng:arr[3]]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | + (BOOL)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction { |
| | | if ([navigationAction.request.URL.absoluteString hasPrefix: @"weixin"]) { |
| | | if ([[UIApplication sharedApplication] canOpenURL:navigationAction.request.URL]) { |
| | | [[UIApplication sharedApplication] openURL:navigationAction.request.URL]; |
| | | return false; |
| | | } |
| | | } |
| | | if ([navigationAction.request.URL.absoluteString hasPrefix: @"alipay"]) { |
| | | |
| | | if ([[UIApplication sharedApplication] canOpenURL:navigationAction.request.URL]) { |
| | | [[UIApplication sharedApplication] openURL:navigationAction.request.URL]; |
| | | return false; |
| | | } |
| | | } |
| | | if ([CZBInfoManager shared].czbExtraHead.count > 0) { |
| | | NSMutableURLRequest *request = (NSMutableURLRequest *)navigationAction.request; |
| | | [[CZBInfoManager shared].czbExtraHead enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { |
| | | [request setValue:obj forHTTPHeaderField:key]; |
| | | }]; |
| | | [[CZBInfoManager shared].czbExtraHead removeAllObjects]; |
| | | [webView loadRequest:request]; |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | + (void)setUserAgent:(NSString *)userAgent webView:(WKWebView *)webView completion:(void(^)(void))completion { |
| | | if (@available(iOS 12.0, *)) { |
| | | NSString *baseAgent = [webView valueForKey:@"applicationNameForUserAgent"]; |
| | | NSString *newUserAgent = [NSString stringWithFormat:@"%@%@",baseAgent, userAgent]; |
| | | [webView setValue:newUserAgent forKey:@"applicationNameForUserAgent"]; |
| | | |
| | | completion(); |
| | | |
| | | } else { |
| | | [webView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError * _Nullable error) { |
| | | NSString *str = [NSString stringWithFormat:@"%@%@", result, userAgent]; |
| | | NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:str, @"UserAgent", nil]; |
| | | [[NSUserDefaults standardUserDefaults] registerDefaults:dictionary]; |
| | | |
| | | [[NSUserDefaults standardUserDefaults] synchronize]; |
| | | if (@available(iOS 9.0, *)) { |
| | | [webView setCustomUserAgent:str]; |
| | | } else { |
| | | [webView setValue:str forKey:@"applicationNameForUserAgent"]; |
| | | } |
| | | |
| | | completion(); |
| | | }]; |
| | | } |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // CZBMapNavgation.h |
| | | // CZBWebProjectDemoForOC |
| | | // |
| | | // Created by è¾¹æºå³° on 2018/11/14. |
| | | // Copyright © 2018 czb365.com. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @interface CZBMapNavgation : NSObject |
| | | |
| | | /** |
| | | ç½é¡µä¸ç导èªäºä»¶ |
| | | |
| | | @param startLat èµ·å§ä½ç½®çº¬åº¦ |
| | | @param startLng èµ·å§ä½ç½®ç»åº¦ |
| | | @param endLat ç®çå°çº¬åº¦ |
| | | @param endLng ç®çå°ç»åº¦ |
| | | */ |
| | | + (void)czbMapNavigation:(NSString *)startLat startLng:(NSString *)startLng endLat:(NSString *)endLat endLng:(NSString *)endLng; |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // CZBMapNavgation.m |
| | | // CZBWebProjectDemoForOC |
| | | // |
| | | // Created by è¾¹æºå³° on 2018/11/14. |
| | | // Copyright © 2018 czb365.com. All rights reserved. |
| | | // |
| | | |
| | | #import "CZBMapNavgation.h" |
| | | #import <CoreLocation/CoreLocation.h> |
| | | #import <WebKit/WebKit.h> |
| | | #import "WHExteriorNavicationController.h" |
| | | @implementation CZBMapNavgation |
| | | |
| | | + (void)czbMapNavigation:(NSString *)startLat startLng:(NSString *)startLng endLat:(NSString *)endLat endLng:(NSString *)endLng { |
| | | if (startLat.doubleValue == 0 || |
| | | startLng.doubleValue == 0 || |
| | | endLat.doubleValue == 0 || |
| | | endLng.doubleValue == 0) { |
| | | return; |
| | | } |
| | | //æ ¹æ®èµ·æ¢åæ ,å®ç°å¯¼èªä»£ç |
| | | CLLocationCoordinate2D fromCoord = CLLocationCoordinate2DMake(startLat.doubleValue, startLng.doubleValue); |
| | | CLLocationCoordinate2D toCoord = CLLocationCoordinate2DMake(endLat.doubleValue, endLng.doubleValue); |
| | | [WHExteriorNavicationController quickNavication:^(WHExteriorMapType type) { |
| | | switch (type) { |
| | | case appleMap: |
| | | [WHExteriorNavicationController openAppleMap:toCoord]; |
| | | break; |
| | | case tencentMap: |
| | | [WHExteriorNavicationController openTencentMap:toCoord origin:fromCoord mode:@"drive" coordType:@"2"]; |
| | | break; |
| | | case gaodeMap: |
| | | [WHExteriorNavicationController openGaodeMap:toCoord]; |
| | | break; |
| | | case baiduMap: |
| | | [WHExteriorNavicationController openBaiduMap:toCoord origin:fromCoord mode:@"driving" coordType:@"gcj02"]; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | }]; |
| | | } |
| | | @end |
New file |
| | |
| | | // |
| | | // WHExteriorNavicationController.h |
| | | // CZBWebProjectDemoForOC |
| | | // |
| | | // Created by è¾¹æºå³° on 2018/11/14. |
| | | // Copyright © 2018 czb365.com. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | #import <CoreLocation/CoreLocation.h> |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | |
| | | typedef NS_ENUM(NSInteger, WHExteriorMapType) { |
| | | baiduMap,//é»è®¤ä»0å¼å§ |
| | | gaodeMap, |
| | | appleMap, |
| | | tencentMap, |
| | | }; |
| | | |
| | | @interface WHExteriorNavicationController : NSObject |
| | | + (void)quickNavication:(void(^)(WHExteriorMapType))callBack; |
| | | + (void)openTencentMap:(CLLocationCoordinate2D)destination origin:(CLLocationCoordinate2D)origin mode:(NSString *)mode coordType:(NSString *)coordType; |
| | | + (void)openGaodeMap:(CLLocationCoordinate2D)destination; |
| | | + (void)openBaiduMap:(CLLocationCoordinate2D)destination origin:(CLLocationCoordinate2D)origin mode:(NSString *)mode coordType:(NSString *)coordType; |
| | | + (void)openAppleMap:(CLLocationCoordinate2D)destination; |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // WHExteriorNavicationController.m |
| | | // CZBWebProjectDemoForOC |
| | | // |
| | | // Created by è¾¹æºå³° on 2018/11/14. |
| | | // Copyright © 2018 czb365.com. All rights reserved. |
| | | // |
| | | |
| | | #import "WHExteriorNavicationController.h" |
| | | #import <CoreLocation/CoreLocation.h> |
| | | #import <MapKit/MapKit.h> |
| | | @interface WHExteriorNavicationController() |
| | | |
| | | @end |
| | | |
| | | @implementation WHExteriorNavicationController |
| | | |
| | | /// è·åæé¡¶å±çæ§å¶å¨å¹¶è¿å |
| | | /// |
| | | /// - Returns: è¿åç®åå¤äºpresentæé¡¶å±çæ§å¶å¨ |
| | | - (UIViewController *)aboveViewController { |
| | | UIViewController *aboveController = [UIApplication sharedApplication].keyWindow.rootViewController; |
| | | while (aboveController.presentedViewController != nil) { |
| | | aboveController = aboveController.presentedViewController; |
| | | } |
| | | return aboveController; |
| | | } |
| | | |
| | | /// æ ¹æ®ä¼ å
¥å°å¾ç±»å,夿æ¯å¦å®è£
å°å¾è½¯ä»¶ |
| | | /// |
| | | /// - Parameter mapType: å°å¾ç±»å |
| | | /// - Returns: å°å¾æ¯å¦å®è£
,boolå¼ |
| | | + (BOOL)canOpen:(WHExteriorMapType)mapType { |
| | | if (mapType == appleMap) { |
| | | return true; |
| | | } |
| | | NSArray *mapTypeArray = @[@"baidumap://", @"iosamap://", @"appleMap://", @"qqmap://"]; |
| | | NSURL *url = [[NSURL alloc] initWithString: mapTypeArray[mapType]]; |
| | | return [[UIApplication sharedApplication] canOpenURL:url]; |
| | | } |
| | | |
| | | /// æå¼è
¾è®¯å°å¾ è¿è¡å¯¼èª |
| | | /// |
| | | /// - Parameters: |
| | | /// - destination: ç®çå°åæ |
| | | /// - origin: èµ·å§ä½ç½®åæ ,å¿
é å¦åä¸è½å¼å§å¯¼èª |
| | | /// - mode: 驾驶模å¼,å
¬äº¤ï¼bus, 驾车ï¼driveï¼é»è®¤ï¼, æ¥è¡ï¼walkï¼ä»
éç¨ç§»å¨ç«¯ï¼ |
| | | /// - coordType: 1 GPSï¼é»è®¤ï¼; 2 è
¾è®¯åæ ,ç«æåæ |
| | | + (void)openTencentMap:(CLLocationCoordinate2D)destination origin:(CLLocationCoordinate2D)origin mode:(NSString *)mode coordType:(NSString *)coordType { |
| | | //model default drive coordType default 2 |
| | | if ([WHExteriorNavicationController canOpen:tencentMap]) { |
| | | |
| | | NSString *originValue = [NSString stringWithFormat:@"%lf,%lf", origin.latitude, origin.longitude]; |
| | | NSString *destinationValue = [NSString stringWithFormat:@"%lf,%lf", destination.latitude, destination.longitude]; |
| | | NSString *src = [[NSBundle mainBundle] infoDictionary][@"CFBundleDisplayName"]; |
| | | NSString *urlString = [NSString stringWithFormat:@"qqmap://map/routeplan?type=%@&fromcoord=%@&tocoord=%@&policy=0&referer=%@", mode, originValue, destinationValue, src]; |
| | | [WHExteriorNavicationController openMap:urlString]; |
| | | } else { |
| | | NSLog(@"æ æ³æå¼è
¾è®¯å°å¾"); |
| | | } |
| | | } |
| | | |
| | | /// æå¼é«å¾·å°å¾è¿è¡å¯¼èª |
| | | /// |
| | | /// - Parameters: |
| | | /// - destination: ç®çå°åæ |
| | | /// - origin: èµ·å§åæ |
| | | /// - mode: å¯¼èªæ¨¡å¼,驾车ï¼mode=car,å
¬äº¤:ï¼mode=busï¼æ¥è¡ï¼mode=walkï¼éªè¡ï¼mode=rideï¼ |
| | | /// - coordType: åæ ç³»ç±»å,åæ ç³»åæ°coordinate=gaode,表示é«å¾·åæ ï¼gcj02åæ ï¼ï¼coordinate=wgs84,表示wgs84åæ ï¼GPSåå§åæ ï¼ |
| | | + (void)openGaodeMap:(CLLocationCoordinate2D)destination { |
| | | if ([WHExteriorNavicationController canOpen:gaodeMap]) { |
| | | NSString *src = [[NSBundle mainBundle] infoDictionary][@"CFBundleDisplayName"]; |
| | | NSString *urlString = [NSString stringWithFormat:@"iosamap://navi?sourceApplication=%@&backScheme=&lat=%lf&lon=%lf&dev=0&style=2", src, destination.latitude, destination.longitude]; |
| | | [WHExteriorNavicationController openMap:urlString]; |
| | | } else { |
| | | NSLog(@"æ æ³æå¼é«å¾·å°å¾"); |
| | | } |
| | | } |
| | | /// æå¼ç¾åº¦å°å¾ è¿è¡å¯¼èª |
| | | /// |
| | | /// - Parameters: |
| | | /// - destination: ç®çå°åæ |
| | | /// - origin: èµ·å§ä½ç½®åæ |
| | | /// - mode: å¯¼èªæ¨¡å¼,åºå®ä¸ºtransitãdrivingï¼é»è®¤ï¼ãnavigationãwalkingï¼ridingåå«è¡¨ç¤ºå
¬äº¤ã驾车ã导èªãæ¥è¡åéªè¡ |
| | | /// - coordType: å
许çå¼ä¸ºbd09llãbd09mcãgcj02ãwgs84ï¼é»è®¤ï¼ãbd09ll表示ç¾åº¦ç»çº¬åº¦åæ ï¼bd09mc表示ç¾åº¦å¢¨å¡æåæ ï¼gcj02表示ç»è¿å½æµå±å å¯çåæ ï¼wgs84表示gpsè·åçåæ ã |
| | | + (void)openBaiduMap:(CLLocationCoordinate2D)destination origin:(CLLocationCoordinate2D)origin mode:(NSString *)mode coordType:(NSString *)coordType { |
| | | //model default driving coordType default gcj02 |
| | | if ([WHExteriorNavicationController canOpen:baiduMap]) { |
| | | NSString *originValue = [NSString stringWithFormat:@"%lf,%lf", origin.latitude, origin.longitude]; |
| | | NSString *destinationValue = [NSString stringWithFormat:@"%lf,%lf", destination.latitude, destination.longitude]; |
| | | NSString *src = [[NSBundle mainBundle] infoDictionary][@"CFBundleDisplayName"]; |
| | | NSString *urlString = [NSString stringWithFormat:@"baidumap://map/direction?origin=%@&destination=%@&mode=%@&src=%@&coord_type=%@", originValue, destinationValue, mode, src, coordType]; |
| | | [WHExteriorNavicationController openMap:urlString]; |
| | | } else { |
| | | NSLog(@"æ æ³æå¼ç¾åº¦å°å¾"); |
| | | } |
| | | } |
| | | /// æå¼è¹æå°å¾è¿è¡å¯¼èª |
| | | /// |
| | | /// - Parameters: |
| | | /// - destination: ç®çå°åæ |
| | | /// - mode: å¯¼èªæ¨¡å¼,MKLaunchOptionsDirectionsModeDriving, MKLaunchOptionsDirectionsModeWalking, MKLaunchOptionsDirectionsModeTransit |
| | | + (void)openAppleMap:(CLLocationCoordinate2D)destination { |
| | | if ([WHExteriorNavicationController canOpen:appleMap]) { |
| | | MKPlacemark *destinationPlaceMark = [[MKPlacemark alloc] initWithCoordinate:destination addressDictionary:nil]; |
| | | MKMapItem *destinationMapItem = [[MKMapItem alloc] initWithPlacemark:destinationPlaceMark]; |
| | | destinationMapItem.name = @"ç®çå°"; |
| | | MKMapItem *originLocation = [MKMapItem mapItemForCurrentLocation]; |
| | | originLocation.name = @"æçä½ç½®"; |
| | | [MKMapItem openMapsWithItems: @[originLocation, destinationMapItem] launchOptions:@{MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving, MKLaunchOptionsShowsTrafficKey: [NSNumber numberWithBool:true]}]; |
| | | } else { |
| | | NSLog(@"æ æ³æå¼è¹æå°å¾"); |
| | | } |
| | | } |
| | | |
| | | /// æ ¹æ®urlString, æå¼å¯¹åºçåºç¨ |
| | | + (void)openMap: (NSString *)urlString { |
| | | NSString *uString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; |
| | | NSURL *url = [[NSURL alloc] initWithString:uString]; |
| | | [UIApplication.sharedApplication openURL:url]; |
| | | } |
| | | |
| | | |
| | | + (void)quickNavication:(void(^)(WHExteriorMapType))callBack { |
| | | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; |
| | | if ([WHExteriorNavicationController canOpen:appleMap]) { |
| | | [alertController addAction:[UIAlertAction actionWithTitle:@"è¹æå°å¾" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { |
| | | callBack(appleMap); |
| | | }]]; |
| | | } |
| | | if ([WHExteriorNavicationController canOpen:baiduMap]) { |
| | | [alertController addAction:[UIAlertAction actionWithTitle:@"ç¾åº¦å°å¾" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { |
| | | callBack(baiduMap); |
| | | }]]; |
| | | } |
| | | if ([WHExteriorNavicationController canOpen:gaodeMap]) { |
| | | [alertController addAction:[UIAlertAction actionWithTitle:@"é«å¾·å°å¾" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { |
| | | callBack(gaodeMap); |
| | | }]]; |
| | | } |
| | | if ([WHExteriorNavicationController canOpen:tencentMap]) { |
| | | [alertController addAction:[UIAlertAction actionWithTitle:@"è
¾è®¯å°å¾" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { |
| | | callBack(tencentMap); |
| | | }]]; |
| | | } |
| | | [alertController addAction:[UIAlertAction actionWithTitle:@"åæ¶" style:UIAlertActionStyleCancel handler: nil]]; |
| | | [[[WHExteriorNavicationController new] aboveViewController] presentViewController:alertController animated:true completion:nil]; |
| | | } |
| | | @end |
| | |
| | | @property (nonatomic, strong, nullable) UILabel *titleLabel; |
| | | /// æç¤ºå
容 |
| | | @property (nonatomic, strong, nullable) UILabel *contentLabel; |
| | | |
| | | @property (nonatomic, strong, nullable) ALButton *buttnTborTm; |
| | | |
| | | |
| | | /// éæ©æç¤º |
| | | @property (nonatomic, strong, nullable) UILabel *selectLabel; |
| | | |
| | | @property (nonatomic, strong, nullable) UIView *leftLine; |
| | | @property (nonatomic, strong, nullable) UIView *rightLine; |
| | | |
| | | @property (nonatomic, strong, nullable) ALButton *taobaoButton; |
| | | @property (nonatomic, strong, nullable) UILabel *taobaoLabel; |
| | | @property (nonatomic, strong, nullable) ALButton *jingdongButton; |
| | | @property (nonatomic, strong, nullable) UILabel *jingdongLabel; |
| | | @property (nonatomic, strong, nullable) ALButton *pingduoduoButton; |
| | | @property (nonatomic, strong, nullable) UILabel *pingduoduoLabel; |
| | | |
| | | @property (nonatomic, strong, nullable) UIButton *taobaoSelectButton; |
| | | @property (nonatomic, strong, nullable) UIButton *jingdongSelectButton; |
| | | @property (nonatomic, strong, nullable) UIButton *pingduoduoSelectButton; |
| | | |
| | | @property (nonatomic, strong, nullable) NSArray *arrayImages; |
| | | @property (nonatomic, strong, nullable) NSArray *arrayTitles; |
| | | /// åæ¶æé® |
| | | @property (nonatomic, strong, nullable) UIButton *cancelButton; |
| | | |
| | |
| | | //[self.contentLabel setMaxNumberOfLinesToShow:3]; |
| | | self.contentLabel.text = self.searchString; |
| | | |
| | | [self.whiteView addSubview:self.buttnTborTm]; |
| | | self.buttnTborTm.sd_layout.leftSpaceToView(self.whiteView, 20).rightSpaceToView(self.whiteView, 20).topSpaceToView(self.contentLabel, 30).heightIs(35); |
| | | self.buttnTborTm.sd_cornerRadius = @17.5; |
| | | self.buttnTborTm.tag = 1; |
| | | |
| | | [self.buttnTborTm addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | [self.whiteView addSubview:self.selectLabel]; |
| | | self.selectLabel.sd_layout.topSpaceToView(self.contentLabel, 20).autoWidthRatio(0).autoHeightRatio(0).centerXEqualToView(self.whiteView); |
| | | self.selectLabel.sd_layout.topSpaceToView(self.buttnTborTm, 20).autoWidthRatio(0).autoHeightRatio(0).centerXEqualToView(self.whiteView); |
| | | [self.selectLabel setSingleLineAutoResizeWithMaxWidth:80]; |
| | | |
| | | [self.whiteView addSubview:self.leftLine]; |
| | |
| | | [self.whiteView addSubview:self.rightLine]; |
| | | self.rightLine.sd_layout.leftSpaceToView(self.selectLabel, 10).rightSpaceToView(self.whiteView, 20).centerYEqualToView(self.selectLabel).heightIs(0.5); |
| | | |
| | | CGFloat buttonWidth = (SCREEN_WIDTH - backgroundsViewMargainLeft_Right * 2)/3; |
| | | CGFloat buttonWidth = (SCREEN_WIDTH - backgroundsViewMargainLeft_Right * 2)/4; |
| | | |
| | | // æ·å®æé® |
| | | [self.whiteView addSubview:self.taobaoButton]; |
| | | self.taobaoButton.sd_layout.leftSpaceToView(self.whiteView, 0).topSpaceToView(self.selectLabel, 15).widthIs(buttonWidth).heightIs(40); |
| | | [self.whiteView addSubview:self.taobaoLabel]; |
| | | self.taobaoLabel.sd_layout.centerXEqualToView(self.taobaoButton).topSpaceToView(self.taobaoButton, 10).heightIs(11).widthIs(buttonWidth - 20); |
| | | // äº¬ä¸æé® |
| | | [self.whiteView addSubview:self.jingdongButton]; |
| | | self.jingdongButton.sd_layout.leftSpaceToView(self.taobaoButton, 0).topSpaceToView(self.selectLabel, 15).widthIs(buttonWidth).heightIs(40); |
| | | [self.whiteView addSubview:self.jingdongLabel]; |
| | | self.jingdongLabel.sd_layout.centerXEqualToView(self.jingdongButton).topSpaceToView(self.jingdongButton, 10).heightIs(11).widthIs(buttonWidth - 20); |
| | | // æ¼å¤å¤æé® |
| | | [self.whiteView addSubview:self.pingduoduoButton]; |
| | | self.pingduoduoButton.sd_layout.leftSpaceToView(self.jingdongButton, 0).topSpaceToView(self.selectLabel, 15).widthIs(buttonWidth).heightIs(40); |
| | | [self.whiteView addSubview:self.pingduoduoLabel]; |
| | | self.pingduoduoLabel.sd_layout.centerXEqualToView(self.pingduoduoButton).topSpaceToView(self.pingduoduoButton, 10).heightIs(11).widthIs(buttonWidth - 20); |
| | | for (int i = 0; i < self.arrayImages.count; i++) { |
| | | ALButton *button = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | button.tag = i + 2; |
| | | [self.whiteView addSubview:button]; |
| | | //button.backgroundColor = [UIColor redColor]; |
| | | |
| | | UIImageView *imageView = [[UIImageView alloc] init]; |
| | | imageView.image = ALIMAGE_NAMED(self.arrayImages[i]); |
| | | [button addSubview:imageView]; |
| | | |
| | | UILabel *label = [[UILabel alloc] init]; |
| | | label.text = self.arrayTitles[i]; |
| | | label.textColor = UIColorFromRGBValue(0x666666); |
| | | label.font = [UIFont systemFontOfSize:11]; |
| | | label.textAlignment = NSTextAlignmentCenter; |
| | | [button addSubview:label]; |
| | | |
| | | button.sd_layout.leftSpaceToView(self.whiteView, i*buttonWidth).topSpaceToView(self.selectLabel, 15).widthIs(buttonWidth).bottomEqualToView(self.whiteView); |
| | | |
| | | imageView.sd_layout.topSpaceToView(button, 0).centerXEqualToView(button).widthIs(40).heightIs(40); |
| | | |
| | | label.sd_layout.topSpaceToView(imageView, 10).leftSpaceToView(button, 0).rightSpaceToView(button, 0).heightIs(11); |
| | | |
| | | [button addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | |
| | | [self.whiteView addSubview:self.taobaoSelectButton]; |
| | | self.taobaoSelectButton.sd_layout.topSpaceToView(self.selectLabel, 15).centerXEqualToView(self.taobaoButton).widthIs(40).bottomSpaceToView(self.whiteView, 0); |
| | | |
| | | [self.whiteView addSubview:self.jingdongSelectButton]; |
| | | self.jingdongSelectButton.sd_layout.topSpaceToView(self.selectLabel, 15).centerXEqualToView(self.jingdongButton).widthIs(40).bottomSpaceToView(self.whiteView, 0); |
| | | |
| | | [self.whiteView addSubview:self.pingduoduoSelectButton]; |
| | | self.pingduoduoSelectButton.sd_layout.topSpaceToView(self.selectLabel, 15).centerXEqualToView(self.pingduoduoButton).widthIs(40).bottomSpaceToView(self.whiteView, 0); |
| | | |
| | | [self.selectLabel updateLayout]; |
| | | CGFloat whiteheight = 25 + [self getLabelHeightWithText:self.searchString width:(SCREEN_WIDTH - backgroundsViewMargainLeft_Right * 2) - 40 font:self.contentLabel.font.pointSize] + 20 + CGRectGetHeight(self.selectLabel.frame) + 15 + 40 + 10 + 11 + 15; |
| | | CGFloat whiteheight = 25 + [self getLabelHeightWithText:self.searchString width:(SCREEN_WIDTH - backgroundsViewMargainLeft_Right * 2) - 40 font:self.contentLabel.font.pointSize] + 20 + CGRectGetHeight(self.selectLabel.frame) + 30 + 35 + 15 + 40 + 10 + 11 + 15; |
| | | self.whiteView.frame = CGRectMake(0, CGRectGetMaxY(self.redimageView.frame), SCREEN_WIDTH - backgroundsViewMargainLeft_Right * 2, whiteheight); |
| | | |
| | | // åè§ |
| | |
| | | return _titleLabel; |
| | | } |
| | | |
| | | -(UILabel *)contentLabel |
| | | { |
| | | -(UILabel *)contentLabel { |
| | | if (!_contentLabel) { |
| | | _contentLabel = [[UILabel alloc] init]; |
| | | _contentLabel.textColor = UICOLOR_FROM_RGB(0x333333, 1.0); |
| | | _contentLabel.textAlignment = NSTextAlignmentLeft; |
| | | _contentLabel.font = [UIFont italicSystemFontOfSize:13]; |
| | | if (SCREEN_WIDTH < 375) { |
| | | _contentLabel.font = [UIFont boldSystemFontOfSize:11]; |
| | | } |
| | | } |
| | | return _contentLabel; |
| | | } |
| | | |
| | | - (ALButton *)buttnTborTm { |
| | | if (!_buttnTborTm) { |
| | | _buttnTborTm = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [_buttnTborTm setTitle:@"æ·å®/å¤©ç«æç´¢" forState:UIControlStateNormal]; |
| | | [_buttnTborTm setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
| | | _buttnTborTm.titleLabel.font = [UIFont systemFontOfSize:16]; |
| | | _buttnTborTm.backgroundColor = UIColorFromRGBValue(0xF10865); |
| | | } |
| | | return _buttnTborTm; |
| | | } |
| | | |
| | | - (UILabel *)selectLabel |
| | |
| | | return _rightLine; |
| | | } |
| | | |
| | | - (ALButton *)taobaoButton |
| | | { |
| | | if (!_taobaoButton) { |
| | | _taobaoButton = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [_taobaoButton setImage:ALIMAGE_NAMED(@"home_pop_taobao") forState:UIControlStateNormal]; |
| | | } |
| | | return _taobaoButton; |
| | | } |
| | | -(UILabel *)taobaoLabel |
| | | { |
| | | if (!_taobaoLabel) { |
| | | _taobaoLabel = [[UILabel alloc] init]; |
| | | _taobaoLabel.text = @"æ·å®"; |
| | | _taobaoLabel.textColor = UICOLOR_FROM_RGB(0x666666, 1.0); |
| | | _taobaoLabel.textAlignment = NSTextAlignmentCenter; |
| | | _taobaoLabel.font = [UIFont italicSystemFontOfSize:11]; |
| | | if (SCREEN_WIDTH < 375) { |
| | | _taobaoLabel.font = [UIFont boldSystemFontOfSize:9]; |
| | | } |
| | | } |
| | | return _taobaoLabel; |
| | | } |
| | | |
| | | - (ALButton *)jingdongButton |
| | | { |
| | | if (!_jingdongButton) { |
| | | _jingdongButton = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [_jingdongButton setImage:ALIMAGE_NAMED(@"home_pop_jingdong") forState:UIControlStateNormal]; |
| | | } |
| | | return _jingdongButton; |
| | | } |
| | | -(UILabel *)jingdongLabel |
| | | { |
| | | if (!_jingdongLabel) { |
| | | _jingdongLabel = [[UILabel alloc] init]; |
| | | _jingdongLabel.text = @"京ä¸"; |
| | | _jingdongLabel.textColor = UICOLOR_FROM_RGB(0x666666, 1.0); |
| | | _jingdongLabel.textAlignment = NSTextAlignmentCenter; |
| | | _jingdongLabel.font = [UIFont italicSystemFontOfSize:11]; |
| | | if (SCREEN_WIDTH < 375) { |
| | | _jingdongLabel.font = [UIFont boldSystemFontOfSize:9]; |
| | | } |
| | | } |
| | | return _jingdongLabel; |
| | | } |
| | | |
| | | - (ALButton *)pingduoduoButton |
| | | { |
| | | if (!_pingduoduoButton) { |
| | | _pingduoduoButton = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [_pingduoduoButton setImage:ALIMAGE_NAMED(@"home_pop_pingduoduo") forState:UIControlStateNormal]; |
| | | } |
| | | return _pingduoduoButton; |
| | | } |
| | | -(UILabel *)pingduoduoLabel |
| | | { |
| | | if (!_pingduoduoLabel) { |
| | | _pingduoduoLabel = [[UILabel alloc] init]; |
| | | _pingduoduoLabel.text = @"æ¼å¤å¤"; |
| | | _pingduoduoLabel.textColor = UICOLOR_FROM_RGB(0x666666, 1.0); |
| | | _pingduoduoLabel.textAlignment = NSTextAlignmentCenter; |
| | | _pingduoduoLabel.font = [UIFont italicSystemFontOfSize:11]; |
| | | if (SCREEN_WIDTH < 375) { |
| | | _pingduoduoLabel.font = [UIFont boldSystemFontOfSize:9]; |
| | | } |
| | | } |
| | | return _pingduoduoLabel; |
| | | } |
| | | |
| | | - (UIButton *)taobaoSelectButton |
| | | { |
| | | if (!_taobaoSelectButton) { |
| | | _taobaoSelectButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | _taobaoSelectButton.tag = 1; |
| | | [_taobaoSelectButton addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _taobaoSelectButton; |
| | | } |
| | | - (UIButton *)jingdongSelectButton |
| | | { |
| | | if (!_jingdongSelectButton) { |
| | | _jingdongSelectButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | _jingdongSelectButton.tag = 2; |
| | | [_jingdongSelectButton addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _jingdongSelectButton; |
| | | } |
| | | - (UIButton *)pingduoduoSelectButton |
| | | { |
| | | if (!_pingduoduoSelectButton) { |
| | | _pingduoduoSelectButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | _pingduoduoSelectButton.tag = 3; |
| | | [_pingduoduoSelectButton addTarget:self action:@selector(buttonAlert:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _pingduoduoSelectButton; |
| | | } |
| | | |
| | | - (UIButton *)cancelButton |
| | | { |
| | | if (!_cancelButton) { |
| | |
| | | return _cancelButton; |
| | | } |
| | | |
| | | - (NSArray *)arrayImages { |
| | | if (!_arrayImages) { |
| | | _arrayImages = @[@"home_pop_jingdong",@"home_pop_pingduoduo",@"home_pop_wph",@"home_pop_sn"]; |
| | | } |
| | | return _arrayImages; |
| | | } |
| | | |
| | | - (NSArray *)arrayTitles { |
| | | if (!_arrayTitles) { |
| | | _arrayTitles = @[@"京ä¸",@"æ¼å¤å¤",@"å¯åä¼",@"èå®"]; |
| | | } |
| | | return _arrayTitles; |
| | | } |
| | | |
| | | @end |
| | |
| | | - (void)titleMore:(NSIndexPath *)indexPath; |
| | | |
| | | - (void)commentMore:(HairBandsMultipleModel *)hairBandsMultipleModel indexPath:(NSIndexPath *)indexPath; |
| | | |
| | | /// åå |
| | | - (void)oneClickBilling:(HairBandsMultipleModel *)commentsModel; |
| | | |
| | | /// æ´»å¨è¯¦æ
|
| | | - (void)activityDetail:(NSString *)link; |
| | | @end |
| | |
| | | |
| | | @property (nonatomic, nullable, strong) ALButton *shareButton; |
| | | @property (nonatomic, nullable, strong) ALButton *buttonDown; |
| | | @property (nonatomic, nullable, strong) ALButton *buttonOneClickBilling; |
| | | |
| | | @property (nonatomic, nullable, strong) ALButton *buttonCopyRecommendedLanguage; |
| | | ///æ 颿´å¤ |
| | | @property (nonatomic, strong, nullable) ALButton *buttonTitle; |
| | |
| | | [self.contentView addSubview:self.shareButton]; |
| | | //åå¾ |
| | | [self.contentView addSubview:self.buttonDown]; |
| | | //åå |
| | | [self.contentView addSubview:self.buttonOneClickBilling]; |
| | | //æ é¢ |
| | | [self.contentView addSubview:self.viewTitle]; |
| | | |
| | |
| | | |
| | | self.buttonDown.sd_layout.rightSpaceToView(self.shareButton, 7).topSpaceToView(self.labelDate, 7).widthIs(80).heightIs(20); |
| | | self.buttonDown.sd_cornerRadius = @10; |
| | | |
| | | self.buttonOneClickBilling.sd_layout.rightSpaceToView(self.buttonDown, 7).topSpaceToView(self.labelDate, 7).widthIs(80).heightIs(20); |
| | | self.buttonOneClickBilling.sd_cornerRadius = @10; |
| | | // æ¨èè¯ |
| | | self.viewTitle.sd_layout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.shareButton, 3).rightSpaceToView(self.contentView, 15).heightIs(0); |
| | | self.viewTitle.sd_cornerRadius = @5; |
| | |
| | | // å°å¾ |
| | | self.viewNormol.sd_layout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewlarge, 11).rightSpaceToView(self.contentView, 15).heightIs(0); |
| | | |
| | | UIImage *imageJonin = ALIMAGE_NAMED(@"dynamic_coupon_join"), *imageOverdue = ALIMAGE_NAMED(@"dynamic_goods_overdue"); |
| | | UIImage *imageJonin = ALIMAGE_NAMED(@"dynamic_coupon_join"), *imageOverdue = ALIMAGE_NAMED(@"dynamic_goods_overdue"); |
| | | // æ´»å¨è¯¦æ
è¿å
¥ |
| | | self.viewActivityLink.sd_layout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewNormol, 6).rightSpaceToView(self.contentView, 15).heightIs(38); |
| | | self.viewActivityLink.sd_cornerRadius = @5; |
| | |
| | | |
| | | UITapGestureRecognizer *tapActivity = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTapActivity:)]; |
| | | [self.viewActivityLink addGestureRecognizer:tapActivity]; |
| | | |
| | | |
| | | // å¸ |
| | | self.viewCoupon.sd_layout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewActivityLink, 6).rightSpaceToView(self.contentView, 15).heightIs(56); |
| | | self.viewCoupon.sd_cornerRadius = @5; |
| | |
| | | } |
| | | |
| | | if ([self isHaveValue:arrayNormol]) { |
| | | self.viewActivityLink.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewNormol, 6).rightSpaceToView(self.contentView, 15).heightIs(38); |
| | | self.viewActivityLink.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewNormol, 6).rightSpaceToView(self.contentView, 15).heightIs(38); |
| | | |
| | | } else if ([self isHaveValue:arrayLarge]) { |
| | | self.viewActivityLink.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewlarge, 6).rightSpaceToView(self.contentView, 15).heightIs(38); |
| | |
| | | |
| | | if (isOpenActivityLogo) { |
| | | self.viewCoupon.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewActivityLink, 6).rightSpaceToView(self.contentView, 15).heightIs(56); |
| | | |
| | | |
| | | } else if (arrayNormol.count != 0) { |
| | | self.viewCoupon.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewNormol, 6).rightSpaceToView(self.contentView, 15).heightIs(56); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | if (model.goods) { |
| | | self.viewFooter.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewCoupon, 4).rightSpaceToView(self.contentView, 15).heightIs(allHeightFooter); |
| | | |
| | | } else if (isOpenActivityLogo) { |
| | | self.viewFooter.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewActivityLink, 7).rightSpaceToView(self.contentView, 15).heightIs(allHeightFooter); |
| | | |
| | | } else if ([self isHaveValue:arrayNormol]) { |
| | | self.viewFooter.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewNormol, 7).rightSpaceToView(self.contentView, 15).heightIs(allHeightFooter); |
| | | |
| | | } else if ([self isHaveValue:arrayLarge]) { |
| | | self.viewFooter.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewlarge, 7).rightSpaceToView(self.contentView, 15).heightIs(allHeightFooter); |
| | | |
| | | } else { |
| | | self.viewFooter.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewTitle, 7).rightSpaceToView(self.contentView, 15).heightIs(allHeightFooter); |
| | | } |
| | | if (model.goods) { |
| | | self.viewFooter.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewCoupon, 4).rightSpaceToView(self.contentView, 15).heightIs(allHeightFooter); |
| | | |
| | | } else if (isOpenActivityLogo) { |
| | | self.viewFooter.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewActivityLink, 7).rightSpaceToView(self.contentView, 15).heightIs(allHeightFooter); |
| | | |
| | | } else if ([self isHaveValue:arrayNormol]) { |
| | | self.viewFooter.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewNormol, 7).rightSpaceToView(self.contentView, 15).heightIs(allHeightFooter); |
| | | |
| | | } else if ([self isHaveValue:arrayLarge]) { |
| | | self.viewFooter.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewlarge, 7).rightSpaceToView(self.contentView, 15).heightIs(allHeightFooter); |
| | | |
| | | } else { |
| | | self.viewFooter.sd_resetLayout.leftSpaceToView(self.contentView, 59).topSpaceToView(self.viewTitle, 7).rightSpaceToView(self.contentView, 15).heightIs(allHeightFooter); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return _buttonDown; |
| | | } |
| | | |
| | | - (ALButton *)buttonOneClickBilling { |
| | | if (!_buttonOneClickBilling) { |
| | | _buttonOneClickBilling = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [_buttonOneClickBilling setImage:ALIMAGE_NAMED(@"dynamic_oneclickbill") forState:UIControlStateNormal]; |
| | | [_buttonOneClickBilling setTitle:@" ä¸é®åå" forState:UIControlStateNormal]; |
| | | [_buttonOneClickBilling setTitleColor:XYRMainColor forState:UIControlStateNormal]; |
| | | _buttonOneClickBilling.titleLabel.font = ([UIFont systemFontOfSize:(SCREEN_WIDTH < 375)?10:12]); |
| | | _buttonOneClickBilling.layer.masksToBounds = YES; |
| | | _buttonOneClickBilling.layer.borderColor = XYRMainColor.CGColor; |
| | | _buttonOneClickBilling.layer.borderWidth = 1; |
| | | } |
| | | return _buttonOneClickBilling; |
| | | } |
| | | |
| | | - (UIView *)viewTitle { |
| | | if (!_viewTitle) { |
| | | _viewTitle = UIView.cp_init; |
| | |
| | | } |
| | | } |
| | | |
| | | - (void)buttonTabEvent:(NSInteger)typeEvent { |
| | | if (![self isUserLogin]) { |
| | | [self onLoginVcName:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | self.view.userInteractionEnabled = NO; |
| | | if (typeEvent == 1) { |
| | | [self fetchTaoBaoAuthInfo:@"share" requestCount:1]; |
| | | |
| | | } else if (typeEvent == 2) { |
| | | [self fetchTaoBaoAuthInfo:@"down" requestCount:1]; |
| | | |
| | | } else if (typeEvent == 3) { |
| | | ALToastCenter(@"åå"); |
| | | self.view.userInteractionEnabled = YES; |
| | | } |
| | | } |
| | | |
| | | |
| | | #pragma mark --- UITableViewDelegate, UITableViewDataSource --- |
| | | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { |
| | |
| | | cell.delegate = self; |
| | | cell.shareButton.tag = indexPath.section+333; |
| | | cell.buttonDown.tag = indexPath.section+666; |
| | | cell.buttonOneClickBilling.tag = indexPath.section+999; |
| | | @weakify(self) |
| | | //å享 |
| | | [[[cell.shareButton rac_signalForControlEvents:UIControlEventTouchUpInside] takeUntil:cell.rac_prepareForReuseSignal] subscribeNext:^(UIButton *button) { |
| | | @strongify(self) |
| | | //[UMCustomDynamic umDynamic_single_share:self.name]; |
| | | self.clickIndex = button.tag-333; |
| | | if (![self isUserLogin]) { |
| | | [self onLoginVcName:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | self.view.userInteractionEnabled = NO; |
| | | [self fetchTaoBaoAuthInfo:@"share" requestCount:1]; |
| | | [self buttonTabEvent:1]; |
| | | }]; |
| | | //åå¾ |
| | | [[[cell.buttonDown rac_signalForControlEvents:UIControlEventTouchUpInside] takeUntil:cell.rac_prepareForReuseSignal] subscribeNext:^(UIButton *button) { |
| | | @strongify(self) |
| | | //[UMCustomDynamic umDynamic_single_share:self.name]; |
| | | |
| | | self.clickIndex = button.tag-666; |
| | | if (![self isUserLogin]) { |
| | | [self onLoginVcName:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | self.view.userInteractionEnabled = NO; |
| | | [self fetchTaoBaoAuthInfo:@"down" requestCount:1]; |
| | | [self buttonTabEvent:2]; |
| | | }]; |
| | | //åå |
| | | [[[cell.buttonOneClickBilling rac_signalForControlEvents:UIControlEventTouchUpInside] takeUntil:cell.rac_prepareForReuseSignal] subscribeNext:^(UIButton *button) { |
| | | @strongify(self) |
| | | self.clickIndex = button.tag-999; |
| | | [self buttonTabEvent:3]; |
| | | }]; |
| | | return cell; |
| | | } |
| | |
| | | } |
| | | |
| | | - (CGFloat)fetchTitleHeight { |
| | | UIImage *icomImage = nil; |
| | | if (self.goodsModel.shopType == 20 || self.goodsModel.shopType == 21) { |
| | | icomImage = ALIMAGE_NAMED(@"ic_share_jd"); |
| | | } else if (self.goodsModel.shopType == 30) { |
| | | icomImage = ALIMAGE_NAMED(@"ic_share_pdd"); |
| | | } |
| | | UIImage *icomImage = ALIMAGE_NAMED(@"ic_share_taobao"); |
| | | NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; |
| | | style.lineSpacing = 3; |
| | | // 坹齿¹å¼ |
| | |
| | | for (NSInteger index = 0; index < imageArray.count; index ++) { |
| | | UIImageView *imageView = [[UIImageView alloc] init]; |
| | | [self.scrollView addSubview:imageView]; |
| | | |
| | | [imageView setContentScaleFactor:[[UIScreen mainScreen] scale]]; |
| | | imageView.contentMode = UIViewContentModeScaleAspectFill; |
| | | imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight; |
| | | imageView.clipsToBounds = YES; |
| | | |
| | | imageView.userInteractionEnabled = YES; |
| | | imageView.backgroundColor = ImagePlaceholder_white; |
| | | [imageView sd_setFadeImageWithURL:[NSURL URLWithString:imageArray[index]] placeholderImage:nil options:SDWebImageRefreshCached]; |
| | |
| | | { |
| | | _model = model; |
| | | if (model) { |
| | | |
| | | if (!model.hasCoupon || (_from && [_from isEqualToString:@"miandan"])) { |
| | | self.taokoulingImageView.hidden = YES; |
| | | self.couponImage.hidden = YES; |
| | |
| | | [self.qianFuHaoLabel setSingleLineAutoResizeWithMaxWidth:30]; |
| | | |
| | | } else { |
| | | |
| | | self.taokoulingImageView.hidden = NO; |
| | | self.coupLabel.hidden = NO; |
| | | self.couponImage.hidden = NO; |
| | | self.quanTime.hidden = NO; |
| | | self.quanMoney .hidden = NO; |
| | | self.quanButton.hidden = NO; |
| | | |
| | | } |
| | | |
| | | NSArray *imageArray = model.imgList; |
| | |
| | | self.digitalLabel.text = [NSString stringWithFormat:@"%d/%lu",1 ,(unsigned long)imageArray.count]; |
| | | for (NSInteger index = 0; index < imageArray.count; index ++) { |
| | | UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(index * SCREEN_WIDTH, 0, SCREEN_WIDTH, _scrollView.frame.size.height)]; |
| | | |
| | | [image setContentScaleFactor:[[UIScreen mainScreen] scale]]; |
| | | image.contentMode = UIViewContentModeScaleAspectFill; |
| | | image.autoresizingMask = UIViewAutoresizingFlexibleHeight; |
| | | image.clipsToBounds = YES; |
| | | |
| | | image.userInteractionEnabled = YES; |
| | | image.backgroundColor = ImagePlaceholder_white; |
| | | [image sd_setFadeImageWithURL:[NSURL URLWithString:imageArray[index]] placeholderImage:nil options:SDWebImageRefreshCached]; |
| | |
| | | UIImage *icomImage = nil; |
| | | if (model.shopType == 20 || model.shopType == 21) { |
| | | icomImage = ALIMAGE_NAMED(@"ic_share_jd"); |
| | | |
| | | } else if (model.shopType == 30) { |
| | | icomImage = ALIMAGE_NAMED(@"ic_share_pdd"); |
| | | |
| | | } else if (model.shopType == 50) { |
| | | icomImage = ALIMAGE_NAMED(@"ic_share_sn"); |
| | | } |
| | | |
| | | self.labelImage.image = icomImage; |
| | |
| | | self.titleLabel.attributedText = attrText; |
| | | |
| | | NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; |
| | | CGFloat height = [self getSpaceLabelHeight:model.title withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 10]; |
| | | self.titleLabel.frame = CGRectMake(10, CGRectGetMinY(self.labelImage.frame) - 2, SCREEN_WIDTH - 10, height); |
| | | CGFloat height = [self getSpaceLabelHeight:model.title withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; |
| | | self.titleLabel.frame = CGRectMake(10, CGRectGetMinY(self.labelImage.frame) - 2, SCREEN_WIDTH - 20, height); |
| | | |
| | | // æ ç¾ |
| | | CGFloat gongyiLabelWidth = 0, baokuanLabelWidth = 0; |
| | |
| | | for (NSInteger index = 0; index < imageArray.count; index ++) { |
| | | UIImageView *imageView = [[UIImageView alloc] init]; |
| | | [self.scrollView addSubview:imageView]; |
| | | |
| | | [imageView setContentScaleFactor:[[UIScreen mainScreen] scale]]; |
| | | imageView.contentMode = UIViewContentModeScaleAspectFill; |
| | | imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight; |
| | | imageView.clipsToBounds = YES; |
| | | |
| | | imageView.userInteractionEnabled = YES; |
| | | imageView.backgroundColor = ImagePlaceholder_white; |
| | | [imageView sd_setFadeImageWithURL:[NSURL URLWithString:imageArray[index]] placeholderImage:nil options:SDWebImageRefreshCached]; |
| | |
| | | } else if (model.salesType == 4) { |
| | | salesString = @"æ»éé"; |
| | | } |
| | | self.labelSales.text = [NSString stringWithFormat:@"%@ %@",salesString, model.salesCount]; |
| | | if (model.shopType == 40) { |
| | | self.labelSales.hidden = YES; |
| | | |
| | | } else { |
| | | self.labelSales.text = [NSString stringWithFormat:@"%@ %@",salesString, model.salesCount]; |
| | | } |
| | | |
| | | CGFloat maxCouponHeight = 0; |
| | | //è¶
级ä¼åæè¿°---------------------------------------------------------------------------------------------------- |
| | |
| | | UIImage *icomImage = nil; |
| | | if (model.shopType == 20 || model.shopType == 21) { |
| | | icomImage = ALIMAGE_NAMED(@"ic_share_jd"); |
| | | |
| | | } else if (model.shopType == 30) { |
| | | icomImage = ALIMAGE_NAMED(@"ic_share_pdd"); |
| | | |
| | | } else if (model.shopType == 50) { |
| | | icomImage = ALIMAGE_NAMED(@"ic_share_sn"); |
| | | } |
| | | self.labelImage.image = icomImage; |
| | | self.labelImage.sd_resetLayout.leftSpaceToView(self.contentView, _spaceleft).topSpaceToView(self.labelOriginalPrice, 7 + maxCouponHeight).widthIs(icomImage.size.width).heightIs(icomImage.size.height); |
| | | |
| | | [ self.labelImage updateLayout]; |
| | | |
| | | |
| | | NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; |
| | | style.lineSpacing = 3; |
| | |
| | | } |
| | | |
| | | - (CGFloat)fetchTitleHeight { |
| | | UIImage *icomImage = nil; |
| | | if (self.goodsModel.shopType == 20 || self.goodsModel.shopType == 21) { |
| | | icomImage = ALIMAGE_NAMED(@"ic_share_jd"); |
| | | } else if (self.goodsModel.shopType == 30) { |
| | | icomImage = ALIMAGE_NAMED(@"ic_share_pdd"); |
| | | } |
| | | UIImage *icomImage = ALIMAGE_NAMED(@"ic_share_jd"); |
| | | NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; |
| | | style.lineSpacing = 3; |
| | | // 坹齿¹å¼ |
| | |
| | | |
| | | }]; |
| | | } |
| | | |
| | | - (void)jumpZJJingDong |
| | | { |
| | | [YTHsharedManger startManger].isEnterForeground = YES; |
| | | [self pushJingDong:YES jumpLink:self.goodsModel.couponInfo.link]; |
| | | } |
| | | |
| | | |
| | | #pragma mark- GDrecomeTableViewCellDelegate |
| | | - (void)cellClicked:(GDrecomeTableViewCell *)cell goodId:(NSString *)goodsID { |
| | |
| | | return size.height; |
| | | } |
| | | |
| | | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath |
| | | { |
| | | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { |
| | | if (indexPath.section == 0) { |
| | | // code == 2 åå䏿¶ |
| | | if (self.code == 2) { |
| | | return SCREEN_WIDTH; |
| | | } |
| | | NSInteger shopType = self.goodsModel.shopType; //10-æ·å® 11-å¤©ç« 20-äº¬ä¸ 30-æ¼å¤å¤ |
| | | UIImage *icomImage = nil; |
| | | if (shopType == 10) { |
| | | icomImage = [UIImage imageNamed:@"ic_share_taobao"]; |
| | | |
| | | } else if (shopType == 11) { |
| | | icomImage = [UIImage imageNamed:@"ic_share_tmall"]; |
| | | } |
| | | |
| | | UIImage *icomImage = [UIImage imageNamed:@"ic_share_pdd"]; |
| | | |
| | | NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; |
| | | style.lineSpacing = 3; |
| | | // 坹齿¹å¼ |
| | |
| | | style.firstLineHeadIndent = firstLineHeadIndentHeight; |
| | | |
| | | NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; |
| | | CGFloat height = [self getSpaceLabelHeight:[NSString stringWithFormat:@" %@",self.goodsModel.title] withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; |
| | | CGFloat height = [self getSpaceLabelHeight:[NSString stringWithFormat:@"%@",self.goodsModel.title] withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; |
| | | //æ¯å¦æè¶
级ä¼åè¿ |
| | | CGFloat maxCouponHeight = 0; |
| | | if (![self.from isEqualToString:@"miandan"]) {// æ¯å¦æ¯å
å |
New file |
| | |
| | | // |
| | | // SNGoodsDetailController.h |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/27. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "BaseViewController.h" |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @interface SNGoodsDetailController : BaseViewController |
| | | /// ååID |
| | | @property (nonatomic, copy) NSString *goodsID; |
| | | /// æ¥æº |
| | | @property (nonatomic, strong) NSString *from; |
| | | /// å¹³å° |
| | | @property (nonatomic, assign) NSInteger goodsType; |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // PDDGoodsDetailController.m |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2019/7/25. |
| | | // Copyright © 2019 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "SNGoodsDetailController.h" |
| | | #import "NewGoodsShareController.h" |
| | | #import "FootprintsViewController.h" |
| | | #import "SJSharedTableViewCell.h" |
| | | #import "shoppingCartViewController.h" |
| | | #import "MyRidiculeController.h" |
| | | #import "GraphicDetailsController.h" |
| | | #import "SearchDetailMainController.h" |
| | | // Views |
| | | #import "ButtomCarView.h" |
| | | #import "GoosStoreInfoView.h" |
| | | #import "GDetailView.h" |
| | | #import "SJShopScrollView.h" |
| | | #import "DetailWKWebview.h" |
| | | #import "GoodsDetailPopWinView.h" |
| | | #import "JDNOFanLiButtonView.h" |
| | | #import "WebLoadProgressView.h" |
| | | #import "SNTransformView.h" |
| | | // Cells |
| | | #import "JDGoodsHeaderTableViewCell.h" |
| | | #import "GDDetailTableViewCell.h" |
| | | #import "GDrecomeTableViewCell.h" |
| | | #import "NoShopTableViewCell.h" |
| | | // Tools |
| | | #import <JDSDK/JDKeplerSDK.h> |
| | | #import "NSString+AES256.h" |
| | | #import "UIImageView+WebCache.h" |
| | | #import "XHWebImageAutoSize.h" |
| | | #import <WebKit/WebKit.h> |
| | | #import <ShareSDK/ShareSDK.h> |
| | | #import <ShareSDKUI/ShareSDK+SSUI.h> |
| | | |
| | | @interface SNGoodsDetailController () <UITableViewDelegate, UITableViewDataSource, |
| | | GoodsHeaderTableViewCellDelegate, GDetailViewDelegate, ButtomCarViewDelegate, |
| | | GDrecomeTableViewCellDelegate, NewLoginViewDelegate,WKNavigationDelegate,WKUIDelegate, UIWebViewDelegate,SJRollingViewDelegate, InviteCodeControllerDelegate> |
| | | { |
| | | CGFloat contentOffsetY; |
| | | CGFloat oldContentOffsetY; |
| | | CGFloat newContentOffsetY; |
| | | BOOL isShowdetail; |
| | | } |
| | | |
| | | @property (nonatomic, strong) GDetailView *topView; |
| | | @property (nonatomic, strong) ButtomCarView *buttomView; |
| | | @property (nonatomic, nullable, strong) JDNOFanLiButtonView *noFanLiButtomView; |
| | | @property (nonatomic, strong) WKWebView *detailWebView; |
| | | @property (nonatomic, assign) CGFloat webHeight; |
| | | @property (nonatomic, strong) NSString *detailUrlString; |
| | | @property (nonatomic, strong) SNTransformView *transitionView; |
| | | @property (nonatomic, strong) UITableView *detailTableview; |
| | | @property (nonatomic, strong) UIButton * backButton; |
| | | @property (nonatomic, strong) UIButton * moreShareButton; |
| | | @property (nonatomic, strong) UIButton * blockBackButton; |
| | | @property (nonatomic, nullable, strong) GoodsDetailBaseModel *goodsModel; |
| | | @property (nonatomic, nullable, strong) NSDictionary *extraDictionary; |
| | | /// æ¯å¦æè¿å© |
| | | @property (nonatomic, assign) BOOL fanliValid; |
| | | /// æ¯å¦æå享 |
| | | @property (nonatomic, assign) BOOL shareValid; |
| | | |
| | | @property (nonatomic, strong) NSMutableArray *recommendArray; |
| | | @property (nonatomic, strong) NSMutableArray *likeArray; |
| | | |
| | | @property (nonatomic, assign) BOOL isClicked; |
| | | @property (nonatomic, strong) SJAliBaicun *alibaichuan; |
| | | @property (nonatomic, assign) NSInteger value; |
| | | @property (nonatomic, assign) NSInteger code; |
| | | @property (nonatomic, assign) BOOL native; |
| | | @property (nonatomic, assign) BOOL isNative; |
| | | @property (nonatomic, assign) CGFloat tableviewHeight; |
| | | |
| | | @property (nonatomic, assign) CGFloat tempWebHeight; |
| | | |
| | | @property (nonatomic,strong)NSString *shoppingUrl; |
| | | /// 4 æ£å¸¸ 1 æ 忬¢ãæ¨è 2 æ æ¨è 3 æ 忬¢ |
| | | @property (nonatomic,assign)NSInteger shopDetailType; |
| | | /// æ¯å¦éè¦å è½½è¿åº¦æ¡ |
| | | @property (nonatomic, assign) BOOL isProgressHud; |
| | | /// æ ¹æ®boolå¼å¤ææ¯å¦æ¶è |
| | | @property (nonatomic, assign) BOOL isCollection; |
| | | @property (nonatomic, assign) BOOL isCollectionBack; |
| | | /// æ¯å¦ç¹å»ç»éï¼ç¶æ ç»éææ²¡æå |
| | | @property (nonatomic, assign) NSInteger clickLoginStates; |
| | | /// å¯¼èªæ çä¸çç°çº¿ |
| | | //@property (nonatomic, strong) UIView *navGaryLine; |
| | | |
| | | //@property (nonatomic,strong) UIButton *ProLibraryBtn;//éååº |
| | | @property (nonatomic, strong) SJNoNetwork *noNetworkViews; |
| | | /// æªè¿æ¥ç½ç» |
| | | @property (nonatomic, assign) NSInteger netWorkCode; |
| | | |
| | | @property (nonatomic, assign) BOOL isRolling; |
| | | |
| | | @property (nonatomic, strong) SJShopScrollView *shopScrollView; |
| | | @property (nonatomic, strong) NSArray *shareUsersArray; |
| | | |
| | | @property (nonatomic, strong) SJSharedTableViewCell *shopview; |
| | | @property (nonatomic, strong) GDrecomeTableViewCell *likeCell; |
| | | @property (nonatomic, strong) GDrecomeTableViewCell *recomeCell; |
| | | ///补贴view |
| | | @property (nonatomic, nullable, strong) UILabel *labelSubsidy; |
| | | ///ä¸è§ç¬¦å· |
| | | @property (nonatomic, nullable, strong) UIImageView *imageViewSJ; |
| | | |
| | | @property (nonatomic, assign) BOOL storageState; |
| | | |
| | | /// æ·å®èçH5æ°æ® (authLink-æ·å®ææé¾æ¥,orderJS-ç¬å订åå è½½çjs代ç ï¼AESå å¯è¿çï¼,orderUrl-ç¬å订åå è½½ç龿¥) |
| | | @property (nonatomic, nullable, strong) NSDictionary *taoBaoAuthInfoDic; |
| | | /// å è½½çjsstring |
| | | @property (nonatomic, nullable, copy) NSString *jsString; |
| | | /// æ¥æºï¼share/zigouï¼ï¼ |
| | | @property (nonatomic, nullable, copy) NSString *source; |
| | | /// ç¬åå è½½çwebview |
| | | @property (nonatomic, strong) UIWebView *linkWebView; |
| | | |
| | | @property (nonatomic,assign)NSInteger type; |
| | | |
| | | @property (nonatomic, nullable, strong) GoodsDetailPopWinView *goodsDetailPopWinView; |
| | | /// æ°ææ»ç¥ |
| | | @property (nonatomic, copy) NSString *weex_file_newer; |
| | | |
| | | @property (nonatomic, nullable, strong) BaseTipArrPopView *baseTipArrPopView; |
| | | @property (nonatomic, nullable, strong) BaseTipsPopView *baseTipsPopView; |
| | | |
| | | @property (nonatomic, nullable, strong) UIScrollView *contentScrollView; |
| | | |
| | | /// å°é»æ¡ |
| | | @property (nonatomic, strong) SJRollingView *currentRollingView; |
| | | |
| | | @property (nonatomic, assign)BOOL isCopyTaokouling; |
| | | |
| | | @property (nonatomic, nullable, copy ) NSString *authLink; |
| | | @property (nonatomic, nullable, copy ) NSString *couponJumpLink; |
| | | @property (nonatomic, nullable, copy ) NSString *nativeCouponJumpLink; |
| | | @property (nonatomic, nullable, copy ) NSString *nativeJumpLink; |
| | | |
| | | @property (nonatomic, nullable, strong) WebLoadProgressView *webLoadProgressView; |
| | | @property (nonatomic, strong) NSTimer *webTimerDis; |
| | | |
| | | @property (nonatomic, assign) CGFloat lastContentOffest; |
| | | /// æ¯å¦ç¦»å¼è¿å½åè§å¾ |
| | | @property (nonatomic, assign) BOOL isLeavedNowView; |
| | | |
| | | @property (nonatomic, nullable, strong) FetchGoldcoinPopView *fetchGoldcoinPopView; |
| | | |
| | | @property (nonatomic, strong) UIView *backView; |
| | | |
| | | @property (nonatomic, strong) dispatch_source_t timers; |
| | | |
| | | @end |
| | | |
| | | @implementation SNGoodsDetailController |
| | | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | |
| | | self.navigationController.navigationBar.translucent = NO; |
| | | self.isLeavedNowView = NO; |
| | | |
| | | self.title = @"åå详æ
"; |
| | | [self fetchWeexFileNewer]; |
| | | |
| | | if (self.dataDictionary[@"paramsJSON"]) { |
| | | if (self.dataDictionary[@"paramsJSON"][@"id"]) { |
| | | self.goodsID = self.dataDictionary[@"paramsJSON"][@"id"]; |
| | | } |
| | | if (self.dataDictionary[@"paramsJSON"][@"from"]) { |
| | | self.from = self.dataDictionary[@"paramsJSON"][@"from"]; |
| | | } |
| | | if (self.dataDictionary[@"paramsJSON"][@"goodsType"]) { |
| | | self.goodsType = self.goodsType = [self.dataDictionary[@"goodsType"] integerValue]; |
| | | } |
| | | } |
| | | |
| | | if (self.dataDictionary) { |
| | | if (self.dataDictionary[@"id"]) { |
| | | self.goodsID = self.dataDictionary[@"id"]; |
| | | } |
| | | if (self.dataDictionary[@"from"]) { |
| | | self.from = self.dataDictionary[@"from"]; |
| | | } |
| | | |
| | | if (self.dataDictionary[@"goodsType"]) { |
| | | self.goodsType = [self.dataDictionary[@"goodsType"] integerValue]; |
| | | } |
| | | } |
| | | if (self.goodsType == 0) { |
| | | self.goodsType = 3; |
| | | } |
| | | |
| | | [UMCustomShop umDetailPDDEnter:self.from]; |
| | | |
| | | self.webHeight = 0.0; |
| | | self.navigationController.navigationBar.titleTextAttributes = |
| | | @{NSForegroundColorAttributeName:FLQNewNavigationTitleColor, |
| | | NSFontAttributeName:[UIFont boldSystemFontOfSize:FLQNewNavigationTitleFont]}; |
| | | |
| | | isShowdetail = YES; |
| | | |
| | | self.view.backgroundColor = XYRBackgroundColor; |
| | | |
| | | self.hidesBottomBarWhenPushed = YES; |
| | | |
| | | self.clickLoginStates = 0; |
| | | self.isProgressHud = YES; |
| | | |
| | | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(EnterForeground:) name:@"isEnterForeground" object:nil]; |
| | | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(EnterBackground:) name:@"isEnterBackground" object:nil]; |
| | | |
| | | [self initializeInterface]; |
| | | [self getOrderParseConfig]; |
| | | // å¦éèåºé¨è§å¾ |
| | | [self isHideBottomView]; |
| | | |
| | | [self isCanFetchGoldCofin];// 宿¶å¨è·åæ¯å¦è¦éå¸ |
| | | } |
| | | |
| | | - (void)isCanFetchGoldCofin |
| | | { |
| | | __block NSInteger times = 0; |
| | | @weakify(self) |
| | | dispatchTimer(self, 1.0, ^(dispatch_source_t _Nonnull timer) { |
| | | @strongify(self) |
| | | self.timers = timer; |
| | | times++; |
| | | if (times >= 10 && self.lastContentOffest > 0 && !self.isLeavedNowView) { |
| | | [self fetchBrowseGoldCofin]; |
| | | dispatch_source_cancel(timer); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | - (void)fetchBrowseGoldCofin |
| | | { |
| | | if (![ALUserInfoServiceManger fetchUID] || self.code == 2) { |
| | | return; |
| | | } |
| | | NSDictionary *tempDictionary = @{@"goodsId":self.goodsID,@"goodsType":[NSString stringWithFormat:@"%ld",(long)self.goodsType]}; |
| | | NSString *paramsStr = [NSString jsonStringWithDictionary:tempDictionary]; |
| | | NSDictionary *params = @{@"uid":[ALUserInfoServiceManger fetchUID],@"event":@"scanGoods",@"data":paramsStr}; |
| | | @weakify(self) |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"integral/pushEvent"] param:params success:^(NSDictionary *object) |
| | | { |
| | | @strongify(self) |
| | | if ([object[@"code"] integerValue] == 0) { |
| | | if (!self.isLeavedNowView) { |
| | | [self.fetchGoldcoinPopView show:object[@"data"][@"notify"]]; |
| | | } |
| | | } |
| | | |
| | | } fail:^(id object) {}]; |
| | | } |
| | | |
| | | /** |
| | | *æ¯å¦éèåºé¨è§å¾ |
| | | */ |
| | | - (void)isHideBottomView { |
| | | if (self.from && [self.from isEqualToString:@"miandan"]) { |
| | | self.buttomView.from = self.from; |
| | | } |
| | | } |
| | | |
| | | #pragma mark --- è·åæ°ææ»ç¥ --- |
| | | /** |
| | | * |
| | | * è·åæ°ææ»ç¥ |
| | | * |
| | | */ |
| | | - (void)fetchWeexFileNewer |
| | | { |
| | | NSArray *tempArr = [self fetchMainUrlArray]; |
| | | for (NSDictionary *dic in tempArr) { |
| | | if ([dic[@"key"] isEqualToString:@"weex_file_newer"]) { |
| | | self.weex_file_newer = dic[@"value"]; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | - (NSArray *)fetchMainUrlArray |
| | | { |
| | | return [[[NSUserDefaults standardUserDefaults] objectForKey:@"MainUrlArray"] objectForKey:@"info"]; |
| | | } |
| | | |
| | | - (void)getAppPageNotificationWithType:(NSString *)type |
| | | { |
| | | NSDictionary *dic = @{@"type":type}; |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"help/getAppPageNotification"] param:dic success:^(NSDictionary *object) { |
| | | @strongify(self) |
| | | |
| | | if ([object[@"code"]integerValue] == 0 && object[@"code"] != nil) { |
| | | NSDictionary *dic = object[@"data"]; |
| | | BOOL bor = [[NSUserDefaults standardUserDefaults]boolForKey:dic[@"md5"]]; |
| | | if (!bor) { |
| | | self.currentRollingView.dataSource = dic; |
| | | self.isRolling = YES; |
| | | self.currentRollingView.hidden = NO; |
| | | self.shopScrollView.frame = CGRectMake(10, kNavigationBarH + kStatusBarH + RollingViewHeight + 16, SCREEN_WIDTH * 0.75, 30); |
| | | } |
| | | } |
| | | } fail:^(id object) { |
| | | |
| | | }]; |
| | | } |
| | | |
| | | #pragma mark - SJRollingViewDelegate |
| | | - (void)closeRolling:(SJRollingView *)RollingView |
| | | { |
| | | self.currentRollingView.hidden = YES; |
| | | self.shopScrollView.frame = CGRectMake(10, CGRectGetMaxY(self.topView.frame) + 16, SCREEN_WIDTH * 0.75, 30); |
| | | } |
| | | |
| | | - (void)addNetWorkNotice |
| | | { |
| | | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(NetWorkStatesChange:) name:@"netWorkChangeEventNotification" object:nil]; |
| | | AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; |
| | | if (delegate.netWorkStatesCode == AFNetworkReachabilityStatusNotReachable) { |
| | | NSNotification * notice = [NSNotification notificationWithName:@"statesCode" object:@(delegate.netWorkStatesCode) userInfo:nil]; |
| | | [self NetWorkStatesChange:notice]; |
| | | |
| | | } else if (delegate.netWorkStatesCode == AFNetworkReachabilityStatusReachableViaWiFi){ |
| | | NSNotification * notice = [NSNotification notificationWithName:@"statesCode" object:@(delegate.netWorkStatesCode) userInfo:nil]; |
| | | [self NetWorkStatesChange:notice]; |
| | | |
| | | } else if (delegate.netWorkStatesCode == AFNetworkReachabilityStatusReachableViaWWAN) { |
| | | NSNotification * notice = [NSNotification notificationWithName:@"statesCode" object:@(delegate.netWorkStatesCode) userInfo:nil]; |
| | | [self NetWorkStatesChange:notice]; |
| | | |
| | | } else { |
| | | NSNotification * notice = [NSNotification notificationWithName:@"statesCode" object:@(delegate.netWorkStatesCode) userInfo:nil]; |
| | | [self NetWorkStatesChange:notice]; |
| | | } |
| | | } |
| | | |
| | | - (void)NetWorkStatesChange:(NSNotification *)sender |
| | | { |
| | | int networkState = [[sender object] intValue]; |
| | | |
| | | self.netWorkCode = networkState; |
| | | |
| | | switch (networkState) { |
| | | |
| | | case -1: { |
| | | |
| | | if (!self.goodsModel) { |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | | [self.noNetworkViews.iconImage setImage:ALIMAGE_NAMED(@"defaultPage_noNetWork")]; |
| | | self.noNetworkViews.hidden = NO; |
| | | |
| | | } else { |
| | | self.noNetworkViews.hidden = YES; |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | } |
| | | |
| | | break; |
| | | } |
| | | case 0: { // 没æç½ç» |
| | | |
| | | if (!self.goodsModel) { |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | | [self.noNetworkViews.iconImage setImage:ALIMAGE_NAMED(@"defaultPage_noNetWork")]; |
| | | self.noNetworkViews.hidden = NO; |
| | | |
| | | } else { |
| | | self.noNetworkViews.hidden = YES; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | case 1: { // 3Gæè
4Gï¼åæ£ç¨çæ¯æµé |
| | | |
| | | self.noNetworkViews.hidden = YES; |
| | | if (!self.goodsModel) { |
| | | [self getgoodsinfo]; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | case 2: { // WIFIç½ç» |
| | | |
| | | self.noNetworkViews.hidden = YES; |
| | | if (!self.goodsModel) { |
| | | [self getgoodsinfo]; |
| | | } |
| | | break; |
| | | } |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | - (void)viewWillAppear:(BOOL)animated |
| | | { |
| | | [super viewWillAppear:animated]; |
| | | [self.navigationController setNavigationBarHidden:YES animated:animated]; |
| | | [YTHsharedManger startManger].isEnterForeground = NO; |
| | | [self.shopScrollView showTimer]; |
| | | } |
| | | |
| | | - (void)viewWillDisappear:(BOOL)animated |
| | | { |
| | | [super viewWillDisappear:animated]; |
| | | [self.navigationController setNavigationBarHidden:NO animated:NO]; |
| | | [self.goodsDetailPopWinView dismiss]; |
| | | self.isProgressHud = NO; |
| | | [self hideTransitionView]; |
| | | self.isLeavedNowView = YES; |
| | | dispatch_source_cancel(self.timers); |
| | | [self.shopScrollView stopTimer]; |
| | | } |
| | | |
| | | - (void)EnterBackground:(NSNotification *)notice |
| | | { |
| | | self.isLeavedNowView = YES; |
| | | dispatch_source_cancel(self.timers); |
| | | } |
| | | |
| | | - (void)hideTransitionView |
| | | { |
| | | self.transitionView.hidden = YES; |
| | | [self.transitionView hiddenTransitionView]; |
| | | } |
| | | |
| | | - (void)initializeInterface { |
| | | [self.view addSubview:self.detailTableview]; |
| | | [self.view addSubview:self.topView]; |
| | | [self.view addSubview:self.moreShareButton]; |
| | | [self.view addSubview:self.buttomView]; |
| | | [self.view addSubview:self.noFanLiButtomView]; |
| | | // [self.view addSubview:self.navGaryLine]; |
| | | [self.view addSubview:self.currentRollingView]; |
| | | [self.view addSubview:self.shopScrollView]; |
| | | |
| | | UIImage *imgsj = ALIMAGE_NAMED(@"goodsdetail_sj"); |
| | | [self.view addSubview:self.imageViewSJ]; |
| | | self.imageViewSJ.sd_layout.bottomSpaceToView(self.buttomView, 0).rightSpaceToView(self.view, (SCREEN_WIDTH - 115) / 4).widthIs(imgsj.size.width).heightIs(imgsj.size.height); |
| | | |
| | | [self.view addSubview:self.labelSubsidy]; |
| | | self.labelSubsidy.sd_layout.rightSpaceToView(self.view, 8).bottomSpaceToView(self.imageViewSJ, 0).widthIs(140).heightIs(20); |
| | | self.labelSubsidy.sd_cornerRadius = @4; |
| | | |
| | | [self.view addSubview:self.backView]; |
| | | |
| | | [self.view addSubview:self.noNetworkViews]; |
| | | [self getAppPageNotificationWithType:@"goodsDetailPDD"]; |
| | | [self addNetWorkNotice]; |
| | | |
| | | [self.view addSubview:self.backButton]; |
| | | [self.view addSubview:self.blockBackButton]; |
| | | [self.view addSubview:self.transitionView]; |
| | | } |
| | | |
| | | #pragma mark å³ä¸è§æé® |
| | | - (void)moreshareClicked:(UIButton *)sender { |
| | | kPreventRepeatClickTime(0.5); |
| | | [UMCustomShop umDetail_right]; |
| | | |
| | | self.goodsDetailPopWinView = [[GoodsDetailPopWinView alloc] initGoodsDetailTopRightPopView:1]; |
| | | @weakify(self) |
| | | self.goodsDetailPopWinView.selectName = ^(NSString *type) { |
| | | @strongify(self) |
| | | if ([type isEqualToString:@"å¤å¶é¾æ¥"]) { |
| | | [UMCustomShop umDetail_goods_detail_more_btn:@"å¤å¶é¾æ¥"]; |
| | | [self.commonMethodManage setPasteboardContent:self.extraDictionary[@"h5Url"] title:@"龿¥å¤å¶æå"]; |
| | | |
| | | } else if ([type isEqualToString:@"帮å©ä¸å¿"]) { |
| | | [UMCustomShop umDetail_goods_detail_more_btn:@"帮å©ä¸å¿"]; |
| | | ShonpingShareViewController *shopVC = [[ShonpingShareViewController alloc]init]; |
| | | shopVC.urlString = [YTHsharedManger startManger].help; |
| | | [self.navigationController pushViewController:shopVC animated:YES]; |
| | | |
| | | } else if ([type isEqualToString:@"æ°ææ»ç¥"]) { |
| | | [UMCustomShop umDetail_goods_detail_more_btn:@"æ°ææ»ç¥"]; |
| | | NSString *newuserGL = nil; |
| | | if ([self isHaveValue:[YTHsharedManger startManger].gonglueCourceInfo[@"videoUrl"]]) { |
| | | newuserGL = [YTHsharedManger startManger].gonglueCourceInfo[@"videoUrl"]; |
| | | |
| | | } else { |
| | | newuserGL = [YTHsharedManger startManger].gonglueCourceInfo[@"txtImgUtl"]; |
| | | } |
| | | ShonpingShareViewController *shonpingShareVc = [[ShonpingShareViewController alloc] init]; |
| | | shonpingShareVc.urlString = newuserGL; |
| | | [self.navigationController pushViewController:shonpingShareVc animated:YES]; |
| | | |
| | | } else if ([type isEqualToString:@"è系客æ"]) { |
| | | [UMCustomShop umDetail_goods_detail_more_btn:@"è系客æ"]; |
| | | [CustomerServiceManage pushinitMQ:@"åå详æ
"]; |
| | | |
| | | } else if ([type isEqualToString:@"æè¦åæ§½"]) { |
| | | [UMCustomShop umDetail_goods_detail_more_btn:@"æè¦åæ§½"]; |
| | | @weakify(self) |
| | | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.11 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ |
| | | @strongify(self) |
| | | MyRidiculeController *myRidiculeVc = [[MyRidiculeController alloc] init]; |
| | | [self.navigationController pushViewController:myRidiculeVc animated:YES]; |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | [self.goodsDetailPopWinView show]; |
| | | } |
| | | |
| | | - (void)getOrderParseConfig { |
| | | // config/getOrderParseConfig |
| | | NSDictionary *dic = @{}; |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"config/getOrderParseConfig"] param:dic success:^(NSDictionary *object) { |
| | | if (object != nil && [object[@"code"]integerValue] == 0) { |
| | | self.taoBaoAuthInfoDic = object[@"data"]; |
| | | NSString *tempJs = object[@"data"][@"orderJS"]; |
| | | self.jsString = [tempJs aes256_decrypt:tempJs]; |
| | | } |
| | | } fail:^(id object) { |
| | | |
| | | }]; |
| | | } |
| | | |
| | | - (void)openButtonEvent { |
| | | |
| | | self.buttomView.shareButton.enabled = YES; |
| | | self.buttomView.buyButton.enabled = YES; |
| | | } |
| | | |
| | | #pragma mark --- WebViewDelegate --- |
| | | - (void)webViewDidStartLoad:(UIWebView *)webView |
| | | { |
| | | |
| | | } |
| | | |
| | | - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType |
| | | { |
| | | NSString *urlString = request.URL.absoluteString; |
| | | if ([urlString rangeOfString:@"yestv://taobaoorder"].location != NSNotFound) { |
| | | NSArray *array = [urlString componentsSeparatedByString:@"#"]; |
| | | NSString *tempJs = array[1]; |
| | | |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | if ([ALUserInfoServiceManger fetchUID]) { |
| | | [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; |
| | | } |
| | | if (tempJs) { |
| | | [params setObject:[tempJs des256_encrypt:tempJs] forKey:@"orderData"]; |
| | | } |
| | | [params setObject:@"unionAuth" forKey:@"source"]; |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"user/order/uploadParsedOrder"] param:params success:^(NSDictionary *object) |
| | | {} |
| | | fail:^(id object) {}]; |
| | | } |
| | | return YES; |
| | | } |
| | | |
| | | - (void)webViewDidFinishLoad:(UIWebView *)webView |
| | | { |
| | | [webView stringByEvaluatingJavaScriptFromString:self.jsString]; |
| | | } |
| | | |
| | | - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error |
| | | { |
| | | |
| | | } |
| | | |
| | | - (void)EnterForeground:(NSNotification *)notice |
| | | { |
| | | [YTHsharedManger startManger].isEnterForeground = NO; |
| | | self.transitionView .hidden = YES; |
| | | [self.transitionView hiddenTransitionView]; |
| | | } |
| | | |
| | | - (void)backTaped:(UIButton *)sender |
| | | { |
| | | // [[ALNetWorking startInterface] cancelAll]; |
| | | [self.view hideToastActivity]; |
| | | [self hideCustomActivityView]; |
| | | [self clearTimers]; |
| | | [self.navigationController popViewControllerAnimated:YES]; |
| | | } |
| | | |
| | | - (void)clearTimers |
| | | { |
| | | if (self.code != 2) { |
| | | JDGoodsHeaderTableViewCell * cell = (JDGoodsHeaderTableViewCell *)[self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; |
| | | [cell clearTimer]; |
| | | [self.shopScrollView clearTimer]; |
| | | [self.shopview clearTimer]; |
| | | } |
| | | } |
| | | #pragma mark --- ååä¿¡æ¯ --- |
| | | - (void)getgoodsinfo { |
| | | if (self.isProgressHud) { |
| | | [self showCustomActivityView]; |
| | | [self.view bringSubviewToFront:self.backButton]; |
| | | } |
| | | self.buttomView.hidden = YES; |
| | | [self getRecomeSource]; |
| | | |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | if ([ALUserInfoServiceManger fetchUID]) { |
| | | [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; |
| | | } |
| | | if (self.from) { |
| | | [params setObject:self.from forKey:@"from"]; |
| | | } else { |
| | | [params setObject:@"" forKey:@"from"]; |
| | | } |
| | | [params setObject:self.goodsID forKey:@"id"]; |
| | | |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"goods/getDetailSuning"] param:params success:^(NSDictionary *object) |
| | | { |
| | | @strongify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | self.detailTableview.hidden = NO; |
| | | if (object) { |
| | | self.code = [object[@"code"] integerValue]; |
| | | if (self.code == 2) { |
| | | self.backView.hidden = NO; |
| | | |
| | | } else { |
| | | self.detailTableview.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - self.tableviewHeight); |
| | | self.buttomView .hidden = NO; |
| | | } |
| | | |
| | | if (self.code == 0) { |
| | | self.extraDictionary = object[@"data"][@"extra"]; |
| | | self.fanliValid = [self.extraDictionary[@"fanliValid"] boolValue]; // æ¯å¦æè¿å© |
| | | self.shareValid = [self.extraDictionary[@"shareValid"] boolValue]; // æ¯å¦æå享 |
| | | self.isNative = [self.extraDictionary[@"isNative"] boolValue]; // æ¯å¦è·³è½¬åçAPP |
| | | self.detailUrlString = self.extraDictionary[@"detailUrl"]; // å¾æè¯¦æ
龿¥ |
| | | self.couponJumpLink = self.extraDictionary[@"couponJumpLink"]; |
| | | self.nativeCouponJumpLink = self.extraDictionary[@"nativeCouponJumpLink"]; |
| | | if ([self.extraDictionary[@"shareValid"] boolValue]) { |
| | | self.buttomView.hidden = NO; |
| | | |
| | | } else { |
| | | self.noFanLiButtomView.hidden = NO; |
| | | } |
| | | |
| | | self.shareUsersArray = self.extraDictionary[@"listShareUser"]; |
| | | self.shopview.dataSource = self.shareUsersArray; |
| | | self.shopScrollView.datasource = self.extraDictionary[@"listCouponUser"]; |
| | | |
| | | self.goodsModel = [GoodsDetailBaseModel yy_modelWithJSON:object[@"data"][@"goods"]]; |
| | | // æ¯å¦å å
¥åäº«åº |
| | | self.storageState = [self.extraDictionary[@"storage"] boolValue]; |
| | | |
| | | self.shopDetailType = 1; |
| | | self.topView.ButtonType = self.shopDetailType; |
| | | // æ¯å¦æ¶è |
| | | self.isCollection = [self.extraDictionary[@"collected"] boolValue]; |
| | | self.buttomView.isCollection = self.isCollection; |
| | | |
| | | [self.buttomView loadViewInfomation:self.goodsModel extraDic:self.extraDictionary]; |
| | | [self.noFanLiButtomView loadViewInfomation:self.goodsModel extraDic:self.extraDictionary]; |
| | | |
| | | self.alibaichuan = [[SJAliBaicun alloc] initWithDic:self.extraDictionary[@"tbPidInfo"]]; |
| | | |
| | | if ([self isHaveValue:self.goodsModel.moneyInfo.compositionInfo]) { |
| | | if ([YTHsharedManger startManger].iosonling == 0) { |
| | | self.labelSubsidy.hidden = NO; |
| | | self.imageViewSJ.hidden = NO; |
| | | self.labelSubsidy.text = self.goodsModel.moneyInfo.compositionInfo; |
| | | } |
| | | } |
| | | @weakify(self) |
| | | [UIView performWithoutAnimation:^{ |
| | | @strongify(self) |
| | | [self.detailTableview reloadData]; |
| | | }]; |
| | | |
| | | [self.detailTableview.mj_footer endRefreshingWithNoMoreData]; |
| | | } |
| | | } |
| | | [self hideCustomActivityView]; |
| | | }); |
| | | |
| | | } fail:^(id object) { |
| | | @strongify(self) |
| | | |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | |
| | | self.detailTableview.hidden = NO; |
| | | [self hideCustomActivityView]; |
| | | |
| | | NSError *error = (NSError *)object; |
| | | |
| | | if (error.code == -1009) { |
| | | if (self.goodsModel) { |
| | | self.noNetworkViews.hidden = YES; |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | |
| | | } else { |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | | [self.noNetworkViews.iconImage setImage:ALIMAGE_NAMED(@"defaultPage_noNetWork")]; |
| | | self.noNetworkViews.hidden = NO; |
| | | } |
| | | |
| | | } else { |
| | | |
| | | if (self.goodsModel) { |
| | | self.noNetworkViews.hidden = YES; |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | |
| | | } else { |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | | [self.noNetworkViews.iconImage setImage:ALIMAGE_NAMED(@"defaultPage_noNetWork")]; |
| | | self.noNetworkViews.hidden = NO; |
| | | } |
| | | } |
| | | }); |
| | | }]; |
| | | } |
| | | |
| | | - (void)getRecomeSource |
| | | { |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | [params setObject:self.goodsID forKey:@"id"]; |
| | | [params setObject:[NSString stringWithFormat:@"%ld",(long)self.goodsType] forKey:@"goodsType"]; |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"goods/getRecommendGoods"] param:params success:^(NSDictionary *object) |
| | | { |
| | | @strongify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | if ([object[@"code"]integerValue] == 0) { |
| | | [self.likeArray removeAllObjects]; |
| | | [self.recommendArray removeAllObjects]; |
| | | for (NSDictionary *dictionary in object[@"data"][@"listGuess"]) { |
| | | if ([self isHaveValue:dictionary]) { |
| | | [self.likeArray addObject:[GoodsDetailBaseModel yy_modelWithJSON:dictionary]]; |
| | | } |
| | | } |
| | | for (NSDictionary *dictionary in object[@"data"][@"listQuality"]) { |
| | | if ([self isHaveValue:dictionary]) { |
| | | [self.recommendArray addObject:[GoodsDetailBaseModel yy_modelWithJSON:dictionary]]; |
| | | } |
| | | } |
| | | self.likeCell.dataArray = self.likeArray; |
| | | self.likeCell.isGuess = YES; |
| | | self.recomeCell.dataArray = self.recommendArray; |
| | | self.recomeCell.isGuess = NO; |
| | | /// 4 æ£å¸¸ 1 æ 忬¢ãæ¨è 2 æ æ¨è 3 æ 忬¢ |
| | | if (self.likeArray.count != 0 && self.recommendArray.count != 0) { |
| | | self.shopDetailType = 4; |
| | | }else if(self.recommendArray.count != 0){ |
| | | self.shopDetailType = 3; |
| | | }else if(self.likeArray.count != 0 ){ |
| | | self.shopDetailType = 2; |
| | | }else{ |
| | | self.shopDetailType = 1; |
| | | } |
| | | self.topView.ButtonType = self.shopDetailType; |
| | | [self.detailTableview reloadData]; |
| | | } else { |
| | | self.shopDetailType = 1; |
| | | } |
| | | [self hideCustomActivityView]; |
| | | [self.detailTableview.mj_header endRefreshing]; |
| | | [self.detailTableview.mj_footer endRefreshing]; |
| | | }); |
| | | |
| | | } fail:^(id object) { |
| | | @strongify(self) |
| | | [self hideCustomActivityView]; |
| | | [self.detailTableview.mj_header endRefreshing]; |
| | | [self.detailTableview.mj_footer endRefreshing]; |
| | | self.shopDetailType = 1; |
| | | }]; |
| | | } |
| | | |
| | | #pragma mark - GoodsHeaderTableViewCellDelegate |
| | | - (void)closeRollView |
| | | { |
| | | self.isRolling = NO; |
| | | [self.detailTableview reloadData]; |
| | | } |
| | | - (void)taokoulingCopy |
| | | { |
| | | self.isCopyTaokouling = YES; |
| | | self.baseTipsPopView.buttonCount = 2; |
| | | self.baseTipsPopView.type = 1; |
| | | self.baseTipsPopView.buttonLeftString = @"å»ç»å½"; |
| | | self.baseTipsPopView.buttonRightString = @"å»é¢å¸"; |
| | | self.baseTipsPopView.titleString = @"温馨æç¤º"; |
| | | self.baseTipsPopView.contentString = @"æªç»å½æ è¿å©ï¼ç¡®å®å
è´¹é¢å¸?"; |
| | | [self.baseTipsPopView showView:nil]; |
| | | } |
| | | #pragma mark --- ç«å³é¢å --- |
| | | - (void)useQuanClicked:(JDGoodsHeaderTableViewCell *)cell { |
| | | if (![self socketReachabilityTest]) { |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | return; |
| | | } |
| | | |
| | | BOOL isFirst = [[NSUserDefaults standardUserDefaults] boolForKey:@"pddAddVerifiStatusFirst"]; |
| | | if (![ALUserInfoServiceManger fetchUID] && !isFirst ) { |
| | | self.isCopyTaokouling = NO; |
| | | self.baseTipsPopView.textIsCenter = YES; |
| | | self.baseTipsPopView.buttonCount = 2; |
| | | self.baseTipsPopView.type = 1; |
| | | self.baseTipsPopView.buttonLeftString = @"å»ç»å½"; |
| | | self.baseTipsPopView.buttonRightString = @"å»é¢å¸"; |
| | | self.baseTipsPopView.titleString = @"温馨æç¤º"; |
| | | self.baseTipsPopView.contentString = @"æªç»å½æ è¿å©ï¼ç¡®å®å
è´¹é¢å¸?"; |
| | | @weakify(self) |
| | | self.baseTipsPopView.leftTouchEvent = ^(NSInteger type) { |
| | | @strongify(self) |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return ; |
| | | } |
| | | |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self getSuNingLink]; |
| | | }; |
| | | |
| | | self.baseTipsPopView.rightTouchEvent = ^(NSInteger type) { |
| | | @strongify(self) |
| | | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"pddAddVerifiStatusFirst"]; |
| | | if (self.isCopyTaokouling) { |
| | | [UMCustomShop umDetail_copy_token]; |
| | | [self.commonMethodManage setPasteboardContent:self.goodsModel.couponInfo.token title:@"æ·å£ä»¤å¤å¶æå"]; |
| | | |
| | | } else { |
| | | JDGoodsHeaderTableViewCell * cell = (JDGoodsHeaderTableViewCell *)[self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; |
| | | [self useQuanClicked:cell]; |
| | | } |
| | | }; |
| | | [self.baseTipsPopView showView:nil]; |
| | | return; |
| | | } |
| | | |
| | | if(![ALUserInfoServiceManger fetchUID]){ |
| | | self.transitionView.contentLabel.text = @"æªç»å½æ è¿å©"; |
| | | self.transitionView.hidden = NO; |
| | | [self.transitionView showTransitionView]; |
| | | [self performSelector:@selector(jumpZJPingDuoDuo) withObject:nil/*å¯ä¼ ä»»æç±»ååæ°*/ afterDelay:0.5]; |
| | | |
| | | } else { |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return ; |
| | | } |
| | | |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | self.transitionView.contentLabel.text = @"è´ä¹°åæè¿å©ï¼å享åæå¥é"; |
| | | [self getSuNingLink]; |
| | | } |
| | | [UMCustomShop umDetail_buy]; |
| | | [UMCustomShop umDetail_coupon_click]; |
| | | } |
| | | |
| | | - (void)jumpZJPingDuoDuo { |
| | | [YTHsharedManger startManger].isEnterForeground = YES; |
| | | [self jumpSuNing:self.isNative jumpLink:self.couponJumpLink nativeJumpLink:self.nativeCouponJumpLink]; |
| | | } |
| | | |
| | | #pragma mark- GDrecomeTableViewCellDelegate |
| | | - (void)cellClicked:(GDrecomeTableViewCell *)cell goodId:(NSString *)goodsID { |
| | | PDDGoodsDetailController *goodDeTrVc = [[PDDGoodsDetailController alloc] init]; |
| | | goodDeTrVc.goodsID = goodsID; |
| | | goodDeTrVc.goodsType = 3; |
| | | [self.navigationController pushViewController:goodDeTrVc animated:YES]; |
| | | } |
| | | |
| | | - (void)touchMaxCoupon { |
| | | if ([self.goodsModel.otherInfo.rewardCoupon.jumpDetail[@"needLogin"] boolValue] && ![ALUserInfoServiceManger fetchUID]) {// 没æç»éå»ç»é |
| | | [self onLoginVcName:nil title:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self pushAnyInterfaceController:self.goodsModel.otherInfo.rewardCoupon.jumpDetail[@"controller"] parms:self.goodsModel.otherInfo.rewardCoupon.params]; |
| | | } |
| | | |
| | | - (void)touchFanLiBi { |
| | | [self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":self.goodsModel.moneyInfo.rateInfoHelpUrl?:@""}]; |
| | | } |
| | | |
| | | - (void)onLoginVcName:(NSString *)vcName title:(NSString *)title { |
| | | if (title) { |
| | | [JRToast showWithText:title bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | |
| | | } else { |
| | | [JRToast showWithText:@"请å
ç»å½æ¿æ å¿«çè´¦å·" bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | } |
| | | // ç»å½çé¢ |
| | | NewLoginViewController *loginVc = [[NewLoginViewController alloc] init]; |
| | | loginVc.delegate = self; |
| | | loginVc.rootVc = self; |
| | | loginVc.vcName = vcName; |
| | | [self.navigationController pushViewController:loginVc animated:YES]; |
| | | } |
| | | |
| | | - (void)onInviteVcName:(NSString *)vcName { |
| | | InviteCodeController *inviteCodeVc = [[InviteCodeController alloc] init]; |
| | | inviteCodeVc.delegates = self; |
| | | inviteCodeVc.rootController = self; |
| | | inviteCodeVc.type = vcName; |
| | | [self.navigationController pushViewController:inviteCodeVc animated:YES]; |
| | | } |
| | | |
| | | #pragma mark - ButtomViewDelegate |
| | | - (void)copyLinkClicked:(ButtomCarView *)view { |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self fetchCopyLink]; |
| | | } |
| | | |
| | | - (void)fetchCopyLink { |
| | | [self.view makeToastActivity:CSToastPositionCenter]; |
| | | self.buttomView.buttonCopuLink.enabled = YES; |
| | | ((UIImageView *)[self.buttomView.buttonCopuLink subviews][0]).alpha = 0.6; |
| | | ((UILabel *)[self.buttomView.buttonCopuLink subviews][1]).textColor = UIColorFromRGBValue(0x999999); |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | [params setObject:_goodsID forKey:@"goodsId"]; |
| | | [params setObject:self.from?:@"" forKey:@"source"]; |
| | | [params setObject:[NSString stringWithFormat:@"%ld",(long)self.goodsType] forKey:@"goodsType"]; |
| | | [params setObject:@YES forKey:@"needGoods"]; |
| | | if ([self isHaveValue:[ALUserInfoServiceManger fetchUID]]) { |
| | | [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; |
| | | } |
| | | @weakify(self) |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"share/createShareInfo"] param:params success:^(NSDictionary *object) { |
| | | @strongify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | self.buttomView.buttonCopuLink.enabled = YES; |
| | | ((UIImageView *)[self.buttomView.buttonCopuLink subviews][0]).alpha = 1; |
| | | ((UILabel *)[self.buttomView.buttonCopuLink subviews][1]).textColor = UIColorFromRGBValue(0x333333); |
| | | [self.view hideToastActivity]; |
| | | if ([self isHaveValue:object] && [object [@"code"] integerValue] == 0) { |
| | | [self.commonMethodManage setPasteboardContent:object[@"data"][@"commentText"] title:@"龿¥å¤å¶æå"]; |
| | | |
| | | } else { |
| | | if (object[@"msg"]) { |
| | | ALToastCenter(object[@"msg"]); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } fail:^(id object) { |
| | | @strongify(self) |
| | | [self.view hideToastActivity]; |
| | | self.buttomView.buttonCopuLink.enabled = YES; |
| | | ((UIImageView *)[self.buttomView.buttonCopuLink subviews][0]).alpha = 1; |
| | | ((UILabel *)[self.buttomView.buttonCopuLink subviews][1]).textColor = UIColorFromRGBValue(0x333333); |
| | | }]; |
| | | } |
| | | |
| | | - (void)collectionClicked:(ButtomCarView *)view { |
| | | if (![self isHaveValue:[ALUserInfoServiceManger fetchUID]]) { |
| | | [self onLoginVcName:@"goodsDetailCollection" title:@"ç»å½åæè½æ¶èå¦"]; |
| | | return; |
| | | } |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self fecthAndPostCollection]; |
| | | } |
| | | |
| | | - (void)shareClicked:(ButtomCarView *)view { |
| | | [self shareOperationSteps]; |
| | | } |
| | | |
| | | - (void)shareOperationSteps { |
| | | if (![self socketReachabilityTest]) { |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | return; |
| | | } |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self jumpCreateShare]; |
| | | } |
| | | |
| | | - (void)jumpCreateShare { |
| | | [self.view makeToastActivity:CSToastPositionCenter]; |
| | | self.buttomView.shareButton.enabled = NO; |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | [params setObject:_goodsID forKey:@"goodsId"]; |
| | | [params setObject:self.from?:@"" forKey:@"source"]; |
| | | [params setObject:[NSString stringWithFormat:@"%ld",(long)self.goodsType] forKey:@"goodsType"]; |
| | | [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; |
| | | [params setObject:@YES forKey:@"needGoods"]; |
| | | @weakify(self) |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"share/createShareInfo"] param:params success:^(NSDictionary *object) |
| | | { |
| | | @strongify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | [self.view hideToastActivity]; |
| | | self.buttomView.shareButton.enabled = YES; |
| | | if ([object[@"code"] integerValue] == 0) { |
| | | if (!self.goodsModel) { |
| | | ALToastCenter(@"ååå è½½ä¸!"); |
| | | return; |
| | | } |
| | | NSDictionary *dataDictionary = @{@"goods" : self.goodsModel, @"share" : object[@"data"], @"goodsId" : [NSString stringWithFormat:@"%@",self.goodsID]}; |
| | | NewGoodsShareController *newGoodsShareVc = [[NewGoodsShareController alloc] init]; |
| | | newGoodsShareVc.dataDictionary = dataDictionary; |
| | | [self.navigationController pushViewController:newGoodsShareVc animated:YES]; |
| | | |
| | | } else { |
| | | [JRToast showWithText:object[@"msg"] bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | } |
| | | }); |
| | | |
| | | } fail:^(id object) { |
| | | @strongify(self) |
| | | [self.view hideToastActivity]; |
| | | self.buttomView.shareButton.enabled = YES; |
| | | }]; |
| | | } |
| | | #pragma mark --- é¢å¸è¿å©/ç«å³è´ä¹° --- |
| | | - (void)buyClicked:(ButtomCarView *)view { |
| | | self.isCopyTaokouling = NO; |
| | | self.transitionView.contentLabel.text = @"è´ä¹°åæè¿å©ï¼å享åæå¥é"; |
| | | |
| | | [UMCustomShop umDetail_buy]; |
| | | [UMCustomShop umDetail_buy_common]; |
| | | |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return ; |
| | | } |
| | | |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self getSuNingLink]; |
| | | } |
| | | |
| | | - (void)getSuNingLink { |
| | | NSDictionary *dic = @{@"uid":[ALUserInfoServiceManger fetchUID],@"id":self.goodsModel.goodsId,@"from" : @"goodsDetail",@"source":self.from?:@""}; |
| | | [self.view makeToastActivity:CSToastPositionCenter]; |
| | | |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"goods/getSuningLink"] param:dic success:^(NSDictionary *object) { |
| | | [self.view hideToastActivity]; |
| | | @strongify(self) |
| | | if ([object[@"code"] integerValue] == 0) { |
| | | self.native = [object[@"data"][@"native"] boolValue]; //æ¯å¦è·³è½¬åç |
| | | self.shoppingUrl = object[@"data"][@"jumpLink"]; |
| | | self.nativeJumpLink = object[@"data"][@"nativeJumpLink"]; |
| | | self.transitionView.hidden = NO; |
| | | [self.transitionView showTransitionView]; |
| | | [self performSelector:@selector(buySNGoods) withObject:nil/*å¯ä¼ ä»»æç±»ååæ°*/ afterDelay:0.5]; |
| | | |
| | | } else { |
| | | [JRToast showWithText:object[@"msg"] bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | } |
| | | |
| | | } fail:^(id object) { |
| | | [self.view hideToastActivity]; |
| | | |
| | | }]; |
| | | } |
| | | |
| | | - (void)buySNGoods { |
| | | if (self.goodsModel.hasCoupon) { |
| | | [UMCustomShop umDetail_buy_to_taobao:@"æå¸"]; |
| | | }else{ |
| | | [UMCustomShop umDetail_buy_to_taobao:@"æ å¸"]; |
| | | } |
| | | [self jumpSuNing:self.native jumpLink:self.shoppingUrl nativeJumpLink:self.nativeJumpLink]; |
| | | } |
| | | |
| | | - (void)jumpSuNing:(BOOL)native jumpLink:(NSString *)jumpLink nativeJumpLink:(NSString *)nativeJumpLink { |
| | | NSURL *url = [NSURL URLWithString:nativeJumpLink]; |
| | | if (native && [[UIApplication sharedApplication] canOpenURL:url]) { |
| | | [[UIApplication sharedApplication] openURL:url]; |
| | | [self hideTransitionView]; |
| | | |
| | | } else { |
| | | ShonpingShareViewController *shonpingShareVc = [[ShonpingShareViewController alloc] init]; |
| | | shonpingShareVc.urlString = jumpLink; |
| | | [self.navigationController pushViewController:shonpingShareVc animated:YES]; |
| | | } |
| | | } |
| | | |
| | | - (void)footprintTaped:(UIButton *)sender { |
| | | [UMCustomShop umDetail_footer]; |
| | | FootprintsViewController *footprintsVc = [[FootprintsViewController alloc] init]; |
| | | [self.navigationController pushViewController:footprintsVc animated:YES]; |
| | | } |
| | | |
| | | #pragma mark --- ç¹å»æ¶è --- |
| | | - (void)collectTaped:(UIButton *)sender { |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLogin:@"collection" tips:@"ç»å½åæè½æ¶èå¦"]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self fecthAndPostCollection]; |
| | | } |
| | | - (void)fecthAndPostCollection { |
| | | if (![self socketReachabilityTest]) { |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | return; |
| | | } |
| | | self.buttomView.buttonCollection.enabled = NO; |
| | | NSMutableDictionary *params = @{}.mutableCopy; |
| | | [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; |
| | | [params setObject:self.goodsModel.goodsId forKey:@"id"]; |
| | | [params setObject:[NSString stringWithFormat:@"%ld",(long)_goodsType] forKey:@"goodsType"]; |
| | | if (!self.isCollection) { |
| | | [params setObject:@"1" forKey:@"type"]; |
| | | |
| | | } else { |
| | | [params setObject:@"2" forKey:@"type"]; |
| | | } |
| | | |
| | | [[YTHNetInterface startInterface] cancelAll]; |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"consumer/collectionGoods"] param:params success:^(NSDictionary *object) { |
| | | @strongify(self) |
| | | NSInteger code = [object[@"code"] integerValue]; |
| | | if (code == 0) { |
| | | self.isCollection = !self.isCollection; |
| | | |
| | | if (self.isCollection) { |
| | | [UMCustomShop umDetail_collect]; |
| | | self.isCollection = YES; |
| | | |
| | | } else { |
| | | [UMCustomShop umDetail_collect_cancel]; |
| | | self.isCollection = NO; |
| | | } |
| | | self.buttomView.isCollection = self.isCollection; |
| | | [JRToast showWithText:object[@"data"] duration:1.2f]; |
| | | |
| | | } else { |
| | | [JRToast showWithText:object[@"msg"] duration:1.2f]; |
| | | } |
| | | self.buttomView.buttonCollection.enabled = YES; |
| | | |
| | | } fail:^(id object) { |
| | | self.buttomView.buttonCollection.enabled = YES; |
| | | }]; |
| | | } |
| | | |
| | | #pragma mark --- æ·»å åäº«åº --- |
| | | - (void)ProLibraryTaped:(UIButton *)sender { |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return ; |
| | | } |
| | | |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | sender.userInteractionEnabled = NO; |
| | | [self userStorageaddstorage]; |
| | | } |
| | | |
| | | - (void)userStorageaddstorage |
| | | { |
| | | NSDictionary *dic = @{@"uid":[ALUserInfoServiceManger fetchUID],@"id":self.goodsModel.goodsId,@"goodsType":[NSString stringWithFormat:@"%ld",(long)_goodsType]}; |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"shraeStorage/accordtorage"] param:dic success:^(NSDictionary *object) |
| | | { |
| | | @strongify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | JDGoodsHeaderTableViewCell *cell = [self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; |
| | | cell.ProLibraryBtn.userInteractionEnabled = YES; |
| | | if ([object[@"code"] integerValue] == 0) { |
| | | BOOL storageState = [object[@"data"][@"storageState"] boolValue]; |
| | | self.storageState = storageState; |
| | | if (storageState) { |
| | | [JRToast showWithText:@"æ·»å è³åäº«åºæå" bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | [UMCustomShop umDetail_joinXPK]; |
| | | cell.ProLibraryBtn.selected = YES; |
| | | |
| | | } else { |
| | | [JRToast showWithText:@"å·²ä»å享åºä¸å é¤" bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | [UMCustomShop umDetail_goods_detail_xpk_cancel]; |
| | | cell.ProLibraryBtn.selected = NO; |
| | | } |
| | | |
| | | } else { |
| | | [JRToast showWithText:object[@"msg"] bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | } |
| | | }); |
| | | |
| | | } fail:^(id object) { |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | JDGoodsHeaderTableViewCell *cell = [self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; |
| | | cell.ProLibraryBtn.userInteractionEnabled = YES; |
| | | }); |
| | | }]; |
| | | |
| | | } |
| | | |
| | | - (void)noticeMineBackEvent:(NSString *)vcName |
| | | { |
| | | [[NSNotificationCenter defaultCenter] postNotificationName:@"noticeMessageVcUpdateData" object:nil]; |
| | | [self.messageManger getMessage]; |
| | | [self getgoodsinfo]; |
| | | } |
| | | #pragma mark --- ç»å½ --- |
| | | - (void)onLogin:(NSString *)name tips:(NSString *)tips |
| | | { |
| | | [JRToast showWithText:tips?:@"请å
ç»å½æ¿æ å¿«çè´¦å·" bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | NewLoginViewController *loginVc = [[NewLoginViewController alloc] init]; |
| | | loginVc.rootVc = self; |
| | | loginVc.delegate = self; |
| | | loginVc.vcName = name; |
| | | loginVc.from = @"æ¼å¤å¤è¯¦æ
"; |
| | | [self.navigationController pushViewController:loginVc animated:YES]; |
| | | } |
| | | |
| | | #pragma mark - GDetailViewDelegate |
| | | - (void)backClicked:(GDetailView *)view |
| | | { |
| | | [self.navigationController popViewControllerAnimated:YES]; |
| | | } |
| | | |
| | | - (CGRect)setsecionFrame:(NSInteger)secion |
| | | { |
| | | CGRect frame = [self.detailTableview rectForHeaderInSection:secion]; |
| | | |
| | | CGFloat height = 66; |
| | | if (IS_IPHONE_X) { |
| | | height = 86; |
| | | } |
| | | CGRect frame1 = CGRectMake(frame.origin.x, frame.origin.y - height, frame.size.width, frame.size.height); |
| | | |
| | | return frame1; |
| | | } |
| | | |
| | | - (void)topButtonClicked:(GDetailView *)view sender:(UIButton *)sender |
| | | { |
| | | sender.selected = YES; |
| | | _isClicked = YES; |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(sender.frame) - 21, CGRectGetMaxY(sender.frame)-5, 40, 4); |
| | | if (sender == self.topView.goodButton) { |
| | | self.topView.alpha = 0; |
| | | self.topView.likeButton.selected = NO; |
| | | self.topView.detailButton.selected = NO; |
| | | self.topView.recommendButton.selected = NO; |
| | | NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; |
| | | [self.detailTableview scrollToRowAtIndexPath:indexPath |
| | | atScrollPosition:UITableViewScrollPositionTop animated:YES]; |
| | | } |
| | | |
| | | if (sender == self.topView.detailButton) { |
| | | self.topView.alpha = 1; |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.recommendButton.selected = NO; |
| | | self.topView.likeButton.selected = NO; |
| | | |
| | | if (self.code != 2) { |
| | | |
| | | CGRect frame = [self setsecionFrame:2]; |
| | | [_detailTableview setContentOffset:CGPointMake(frame.origin.x, frame.origin.y)]; |
| | | } |
| | | } |
| | | |
| | | if (sender == self.topView.likeButton) { |
| | | self.topView.alpha = 1; |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.detailButton.selected = NO; |
| | | self.topView.recommendButton.selected = NO; |
| | | |
| | | int selectI = 0; |
| | | |
| | | if (self.code == 2) { |
| | | |
| | | selectI = 1; |
| | | |
| | | } else { |
| | | |
| | | selectI = 3; |
| | | } |
| | | |
| | | CGRect frame = [self setsecionFrame:selectI]; |
| | | [_detailTableview setContentOffset:CGPointMake(frame.origin.x, frame.origin.y)]; |
| | | |
| | | |
| | | } |
| | | |
| | | if (sender == self.topView.recommendButton) { |
| | | self.topView.alpha = 1; |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.detailButton.selected = NO; |
| | | self.topView.likeButton.selected = NO; |
| | | |
| | | NSIndexPath *indexPath = nil; |
| | | |
| | | if (self.code == 2) { |
| | | NSInteger w = [self.detailTableview numberOfRowsInSection:1]; |
| | | if (w!=0) { |
| | | indexPath = [NSIndexPath indexPathForRow:0 inSection:1]; |
| | | } |
| | | |
| | | } else { |
| | | int i = 0; |
| | | if (_shopDetailType == 4) { |
| | | i = 4; |
| | | }else{ |
| | | i = 3; |
| | | } |
| | | CGRect frame = [self setsecionFrame:i]; |
| | | [_detailTableview setContentOffset:CGPointMake(frame.origin.x, frame.origin.y)]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | - (void)showShopDetail:(UIButton *)sender |
| | | { |
| | | [UMCustomShop umDetail_detail]; |
| | | |
| | | isShowdetail = !isShowdetail; |
| | | |
| | | [self.detailTableview reloadData]; |
| | | } |
| | | |
| | | #pragma mark - scrollViewDelegate |
| | | - (void)scrollViewDidScroll:(UIScrollView *)scrollView |
| | | { |
| | | if (scrollView.contentOffset.y > self.lastContentOffest) { |
| | | self.lastContentOffest = scrollView.contentOffset.y; |
| | | } |
| | | newContentOffsetY = scrollView.contentOffset.y; |
| | | if (newContentOffsetY > oldContentOffsetY && oldContentOffsetY > contentOffsetY) { // å䏿»å¨ |
| | | } else if (newContentOffsetY < oldContentOffsetY && oldContentOffsetY < contentOffsetY) {// å䏿»å¨ |
| | | |
| | | } else { |
| | | } |
| | | if (scrollView.dragging) { // ææ½ |
| | | |
| | | if ((scrollView.contentOffset.y - contentOffsetY) > 5.0f) { // åä¸ææ½ |
| | | self.topView.alpha = - (contentOffsetY - scrollView.contentOffset.y) / 150.0; |
| | | if ( scrollView.contentOffset.y > 150) { |
| | | self.topView.alpha = 1; |
| | | self.topView.navGaryLine.alpha = 1; |
| | | [_backButton setImage:[UIImage imageNamed:@"Left_back"] forState:UIControlStateNormal]; |
| | | |
| | | [_moreShareButton setImage:[UIImage imageNamed:@"æ´å¤___up"] forState:UIControlStateNormal]; |
| | | |
| | | }else |
| | | if (scrollView.contentOffset.y < 10) { |
| | | self.topView.alpha = 0; |
| | | self.topView.navGaryLine.alpha = 0; |
| | | [_backButton setImage:[UIImage imageNamed:@"left_back_around"] forState:UIControlStateNormal]; |
| | | [_moreShareButton setImage:[UIImage imageNamed:@"æ´å¤___"] forState:UIControlStateNormal]; |
| | | |
| | | } |
| | | } |
| | | else if ((contentOffsetY - scrollView.contentOffset.y) > 5.0f) |
| | | { // åä¸ææ½ |
| | | self.topView.alpha = 1/ ((contentOffsetY - scrollView.contentOffset.y) / 150.0); |
| | | if (scrollView.contentOffset.y < 10) { |
| | | //æ»å°é¡¶é¨æ´æ° |
| | | self.topView.alpha = 0; |
| | | self.topView.navGaryLine.alpha = 0; |
| | | [_backButton setImage:[UIImage imageNamed:@"left_back_around"] forState:UIControlStateNormal]; |
| | | [_moreShareButton setImage:[UIImage imageNamed:@"æ´å¤___"] forState:UIControlStateNormal]; |
| | | |
| | | } |
| | | if ( scrollView.contentOffset.y > 150) { |
| | | self.topView.alpha = 1; |
| | | [_backButton setImage:[UIImage imageNamed:@"Left_back"] forState:UIControlStateNormal]; |
| | | [_moreShareButton setImage:[UIImage imageNamed:@"æ´å¤___up"] forState:UIControlStateNormal]; |
| | | |
| | | self.topView.navGaryLine.alpha = 1; |
| | | } |
| | | |
| | | } else { |
| | | |
| | | } |
| | | } |
| | | |
| | | if (_isClicked) { |
| | | _isClicked = NO; |
| | | |
| | | } else { |
| | | NSIndexPath *indexpath = [self .detailTableview indexPathForRowAtPoint:CGPointMake(scrollView.contentOffset.x, scrollView.contentOffset.y)]; |
| | | if (indexpath.section == 0 && indexpath != nil) { |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.goodButton.frame) - 21, CGRectGetMaxY(self.topView.goodButton.frame)-5, 40, 4); |
| | | self.topView.goodButton.selected = YES; |
| | | self.topView.detailButton.selected = NO; |
| | | self.topView.recommendButton.selected = NO; |
| | | self.topView.likeButton.selected = NO; |
| | | } |
| | | |
| | | if (indexpath.section == 2 || (indexpath == nil && self.code != 2)) { |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.detailButton.frame) - 21, CGRectGetMaxY(self.topView.detailButton.frame)-5, 40, 4); |
| | | |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.detailButton.selected = YES; |
| | | self.topView.recommendButton.selected = NO; |
| | | self.topView.likeButton.selected = NO; |
| | | } |
| | | |
| | | if (indexpath.section == 3) { |
| | | if (_shopDetailType == 2 || _shopDetailType == 4) { |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.likeButton.frame) - 21, CGRectGetMaxY(self.topView.likeButton.frame)-5, 40, 4); |
| | | self.topView.likeButton.selected = YES; |
| | | self.topView.recommendButton.selected = NO; |
| | | }else{ |
| | | self.topView.likeButton.selected = NO; |
| | | self.topView.recommendButton.selected = YES; |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.recommendButton.frame) - 21, CGRectGetMaxY(self.topView.recommendButton.frame)-5, 40, 4); |
| | | |
| | | } |
| | | |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.detailButton.selected = NO; |
| | | } |
| | | if (indexpath.section == 4) { |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.recommendButton.frame) - 21, CGRectGetMaxY(self.topView.recommendButton.frame)-5, 40, 4); |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.detailButton.selected = NO; |
| | | self.topView.recommendButton.selected = YES; |
| | | self.topView.likeButton.selected = NO; |
| | | } |
| | | } |
| | | } |
| | | |
| | | - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView |
| | | { |
| | | _isClicked = NO; |
| | | } |
| | | |
| | | #pragma mark --- UITableViewDelegate,UITableViewDataSource ---- |
| | | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView |
| | | { |
| | | if (self.code == 2) { |
| | | |
| | | if (_shopDetailType == 2 || _shopDetailType == 3) { |
| | | return 2; |
| | | |
| | | } else if (_shopDetailType == 4) { |
| | | return 3; |
| | | |
| | | } else { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | switch (_shopDetailType) { |
| | | case 4: |
| | | { |
| | | return 5; |
| | | } break; |
| | | |
| | | case 1: |
| | | { |
| | | return 3; |
| | | } break; |
| | | |
| | | case 2: |
| | | { |
| | | return 4; |
| | | } break; |
| | | case 3: |
| | | { |
| | | return 4; |
| | | } break; |
| | | default: |
| | | break; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section |
| | | { |
| | | if (section == 0) { |
| | | return 1; |
| | | } |
| | | |
| | | if (section == 2) { |
| | | if (self.code == 2) { |
| | | if (self.recommendArray.count != 0) { |
| | | return 1; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | if (section == 1) { |
| | | if (self.code == 2) { |
| | | if (self.likeArray.count != 0) { |
| | | return 1; |
| | | } |
| | | |
| | | if (self.recommendArray.count != 0) { |
| | | return 1; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | if (section == 3 || section == 4 ) { |
| | | return 1; |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | - (CGFloat)getSpaceLabelHeight:(NSString *)str withAttrDict:(NSDictionary *)dict withWidth:(CGFloat)width { |
| | | CGSize size = [str boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:dict context:nil].size; |
| | | return size.height; |
| | | } |
| | | |
| | | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { |
| | | if (indexPath.section == 0) { |
| | | // code == 2 åå䏿¶ |
| | | if (self.code == 2) { |
| | | return SCREEN_WIDTH; |
| | | } |
| | | UIImage *icomImage = icomImage = [UIImage imageNamed:@"ic_share_sn"]; |
| | | NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; |
| | | style.lineSpacing = 3; |
| | | // 坹齿¹å¼ |
| | | style.alignment = NSTextAlignmentLeft; |
| | | // é¦è¡ç¼©è¿ |
| | | CGFloat firstLineHeadIndentHeight = 0; |
| | | |
| | | if ([self.goodsModel.title hasPrefix:@"ã"]) { |
| | | firstLineHeadIndentHeight = icomImage.size.width; |
| | | |
| | | } else { |
| | | firstLineHeadIndentHeight = icomImage.size.width + 8; |
| | | } |
| | | |
| | | style.firstLineHeadIndent = firstLineHeadIndentHeight; |
| | | |
| | | NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; |
| | | CGFloat height = [self getSpaceLabelHeight:[NSString stringWithFormat:@"%@",self.goodsModel.title] withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; |
| | | //æ¯å¦æè¶
级ä¼åè¿ |
| | | CGFloat maxCouponHeight = 0; |
| | | if (![self.from isEqualToString:@"miandan"]) {// æ¯å¦æ¯å
å |
| | | if ([ALUserInfoServiceManger fetchUserInfo]) {// æ¯å¦ç»é |
| | | if (![ALUserInfoServiceManger isMembership]) {// æ¯å¦æ¯ä¼å |
| | | if (self.goodsModel.otherInfo.rewardCoupon) { |
| | | maxCouponHeight = 50; |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | if (self.goodsModel.otherInfo.rewardCoupon) { |
| | | maxCouponHeight = 50; |
| | | } |
| | | } |
| | | } |
| | | //æ¯å¦ææ ç¾ |
| | | CGFloat labelsHeght = 0; |
| | | if ([self isHaveValue:self.goodsModel.labels]) { |
| | | labelsHeght = 22; |
| | | } |
| | | |
| | | CGFloat jianqu = 0; |
| | | if ([YTHsharedManger startManger].iosonling == 1) { |
| | | jianqu = 40; |
| | | } |
| | | |
| | | if (self.goodsModel.hasCoupon) { |
| | | if (self.goodsModel.couponInfo.token && ![self.goodsModel.couponInfo.token isEqualToString:@""]) { |
| | | return SCREEN_WIDTH + 245 + height + maxCouponHeight + labelsHeght - jianqu; |
| | | |
| | | } else { |
| | | return SCREEN_WIDTH + 205 + height + maxCouponHeight + labelsHeght - jianqu; |
| | | } |
| | | |
| | | } else { |
| | | return SCREEN_WIDTH + 117 + height + maxCouponHeight + labelsHeght - jianqu; |
| | | } |
| | | } |
| | | if (indexPath.section == 1) { |
| | | |
| | | if (self.code == 2) { |
| | | |
| | | if (self.likeArray.count != 0) { |
| | | |
| | | NSInteger height = self.likeArray.count / 2 ; |
| | | |
| | | if (self.likeArray.count % 2 != 0) { |
| | | |
| | | height = height + 1; |
| | | |
| | | } |
| | | |
| | | return height * ((SCREEN_WIDTH-30)/2+136); |
| | | } |
| | | |
| | | if (self.recommendArray.count != 0) { |
| | | |
| | | NSInteger height = self.recommendArray.count / 2 ; |
| | | |
| | | if (self.recommendArray.count % 2 != 0) { |
| | | |
| | | height = height + 1; |
| | | |
| | | } |
| | | |
| | | return height * ((SCREEN_WIDTH-30)/2+136); |
| | | } |
| | | |
| | | } else { |
| | | |
| | | if (self.shareUsersArray.count == 0) { |
| | | |
| | | return CGFLOAT_MIN; |
| | | |
| | | } else { |
| | | |
| | | return 62; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (indexPath.section == 2) { |
| | | |
| | | if (self.code == 2) { |
| | | |
| | | NSInteger height = self.recommendArray.count / 2 ; |
| | | if (self.recommendArray.count % 2 != 0) { |
| | | height = height +1; |
| | | } |
| | | return height * ((SCREEN_WIDTH-30)/2+136); |
| | | } |
| | | } |
| | | |
| | | CGFloat collectioncellheight = 305; |
| | | if (SCREEN_WIDTH < 375) { |
| | | collectioncellheight = 275; |
| | | |
| | | } else if (SCREEN_WIDTH > 375) { |
| | | collectioncellheight = 325; |
| | | } |
| | | |
| | | if (indexPath.section == 3) { |
| | | if (_shopDetailType == 2 || _shopDetailType == 4) { |
| | | NSInteger height = self.likeArray.count / 2; |
| | | |
| | | if (self.likeArray.count % 2 != 0) { |
| | | height = height + 1; |
| | | } |
| | | return height * collectioncellheight + 15; |
| | | |
| | | } else { |
| | | NSInteger height = self.recommendArray.count / 2 ; |
| | | |
| | | if (self.recommendArray.count % 2 != 0) { |
| | | height = height + 1; |
| | | } |
| | | return height * collectioncellheight + 15; |
| | | } |
| | | } |
| | | if (indexPath.section == 4) { |
| | | |
| | | NSInteger height = self.recommendArray.count / 2 ; |
| | | |
| | | if (self.recommendArray.count % 2 != 0) { |
| | | height = height + 1; |
| | | } |
| | | return height * collectioncellheight + 15; |
| | | } |
| | | return CGFLOAT_MIN; |
| | | } |
| | | |
| | | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath |
| | | { |
| | | if (indexPath.section == 0) { |
| | | if (self.code == 2) { |
| | | NSString *identifier = @"NoShopTableViewCell"; |
| | | NoShopTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; |
| | | if (!cell) { |
| | | cell = [[NoShopTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; |
| | | } |
| | | cell.NoImage.image = [UIImage imageNamed:@"没æåå"]; |
| | | cell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | return cell; |
| | | } |
| | | NSString *identifier = @"GoodsHeaderTableViewCell"; |
| | | JDGoodsHeaderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; |
| | | if (!cell) { |
| | | cell = [[JDGoodsHeaderTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; |
| | | } |
| | | cell.delegate = self; |
| | | cell.from = self.from; |
| | | cell.fanliValid = self.fanliValid; |
| | | cell.shareValid = self.shareValid; |
| | | cell.model = self.goodsModel; |
| | | |
| | | cell.storageState = self.storageState; |
| | | [cell.ProLibraryBtn addTarget:self action:@selector(ProLibraryTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | @weakify(self) |
| | | cell.touchCheckLike = ^{ |
| | | @strongify(self) |
| | | SearchDetailMainController *searchDetailMainVc = [[SearchDetailMainController alloc] init]; |
| | | searchDetailMainVc.goodsType = @"1"; |
| | | searchDetailMainVc.searchKey = self.goodsModel.title; |
| | | [self.navigationController pushViewController:searchDetailMainVc animated:YES]; |
| | | }; |
| | | |
| | | cell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | if (!self.goodsModel) { |
| | | CATransition *animation = [CATransition animation]; |
| | | animation.type = kCATransitionFade; |
| | | animation.duration = 0.4; |
| | | [cell.layer addAnimation:animation forKey:nil]; |
| | | cell.hidden = YES; |
| | | self.buttomView.hidden = YES; |
| | | |
| | | } else { |
| | | CATransition *animation = [CATransition animation]; |
| | | animation.type = kCATransitionFade; |
| | | animation.duration = 0.4; |
| | | [cell.layer addAnimation:animation forKey:nil]; |
| | | cell.hidden = NO; |
| | | self.buttomView.hidden = NO; |
| | | } |
| | | |
| | | return cell; |
| | | } |
| | | |
| | | if (indexPath.section == 2) { |
| | | if (self.code == 2) { |
| | | if (self.recommendArray.count != 0) { |
| | | if (!self.goodsModel) { |
| | | CATransition *animation = [CATransition animation]; |
| | | animation.type = kCATransitionFade; |
| | | animation.duration = 0.4; |
| | | [self.recomeCell.layer addAnimation:animation forKey:nil]; |
| | | self.recomeCell.hidden = YES; |
| | | |
| | | } else { |
| | | |
| | | CATransition *animation = [CATransition animation]; |
| | | animation.type = kCATransitionFade; |
| | | animation.duration = 0.4; |
| | | [self.recomeCell.layer addAnimation:animation forKey:nil]; |
| | | self.recomeCell.hidden = NO; |
| | | } |
| | | return self.recomeCell; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (indexPath.section == 1) { |
| | | |
| | | if (self.code == 2) { |
| | | if (self.likeArray != 0) { |
| | | return self.likeCell; |
| | | } |
| | | |
| | | if (self.recommendArray != 0) { |
| | | return self.recomeCell; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (indexPath.section == 3) { |
| | | |
| | | if (_shopDetailType == 2 || _shopDetailType == 4) { |
| | | return self.likeCell; |
| | | |
| | | } else { |
| | | return self.recomeCell; |
| | | } |
| | | |
| | | } else { |
| | | return self.recomeCell; |
| | | } |
| | | } |
| | | |
| | | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section |
| | | { |
| | | if (self.code == 2) { |
| | | return 46; |
| | | } |
| | | |
| | | if (section == 0 ) { |
| | | return CGFLOAT_MIN; |
| | | } |
| | | |
| | | if (section == 1) { |
| | | if (self.shareUsersArray.count == 0) { |
| | | return CGFLOAT_MIN; |
| | | } |
| | | return 62; |
| | | } |
| | | |
| | | if (section == 4 && _shopDetailType == 2) { |
| | | return CGFLOAT_MIN; |
| | | } |
| | | |
| | | return 46; |
| | | } |
| | | |
| | | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section |
| | | { |
| | | UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 45)]; |
| | | view.backgroundColor = [UIColor whiteColor]; |
| | | if (self.code == 2) { |
| | | if (section == 1) { |
| | | if (self.likeArray.count != 0) { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"çä½ åæ¬¢" imageName:@"detail_icon_忬¢"]; |
| | | return headerView; |
| | | } |
| | | if (self.recommendArray.count != 0) { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"ç¸å
³æ¨è" imageName:@"detail_icon_æ¨è"]; |
| | | return headerView; |
| | | } |
| | | } |
| | | if (section == 2) { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"ç¸å
³æ¨è" imageName:@"detail_icon_æ¨è"]; |
| | | return headerView; |
| | | } |
| | | } |
| | | if(section == 1) { |
| | | if (self.shareUsersArray.count != 0) { |
| | | return self.shopview; |
| | | } |
| | | } |
| | | |
| | | if (section == 2) { |
| | | UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(15, 0, SCREEN_WIDTH - 40, 45)]; |
| | | label.text = @"æ¥çå®è´è¯¦æ
"; |
| | | label.font = [UIFont systemFontOfSize:15]; |
| | | label.textColor = SJColor(68, 68, 68, 1); |
| | | [view addSubview:label]; |
| | | UIImageView *imageview = [[UIImageView alloc]init]; |
| | | imageview.frame = CGRectMake(SCREEN_WIDTH - 32 - 10, CGRectGetMidY(label.frame) - 11, 22, 22); |
| | | UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 44, SCREEN_WIDTH, 1)]; |
| | | lineView.backgroundColor = XYRBackgroundColor; |
| | | if (isShowdetail) { |
| | | imageview.image = [UIImage imageNamed:@"ç®å¤´åä¸"]; |
| | | lineView.hidden = NO; |
| | | }else{ |
| | | imageview.image = [UIImage imageNamed:@"ç®å¤´åå³"]; |
| | | lineView.hidden = YES; |
| | | } |
| | | [view addSubview:imageview]; |
| | | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | button.frame = label.frame; |
| | | [button addTarget:self action:@selector(showShopDetail:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [view addSubview:button]; |
| | | } |
| | | /// 4 æ£å¸¸ 1 æ 忬¢ãæ¨è 2 æ æ¨è 3 æ 忬¢ |
| | | |
| | | if (section == 3 ) { |
| | | if (_shopDetailType == 2 || _shopDetailType == 4) { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"çä½ åæ¬¢" imageName:@"detail_icon_忬¢"]; |
| | | return headerView; |
| | | |
| | | } else { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"ç¸å
³æ¨è" imageName:@"detail_icon_æ¨è"]; |
| | | return headerView; |
| | | } |
| | | } |
| | | if (section == 4) { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"ç¸å
³æ¨è" imageName:@"detail_icon_æ¨è"]; |
| | | return headerView; |
| | | } |
| | | return view; |
| | | } |
| | | - (UIView *)setHeaderViewWithTitle:(NSString *)title imageName:(NSString *)imageName |
| | | { |
| | | UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 45)]; |
| | | |
| | | view.backgroundColor = [UIColor whiteColor]; |
| | | UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH / 2 - 30, 0, 70, 45)]; |
| | | label.textAlignment = NSTextAlignmentCenter; |
| | | label.text = title; |
| | | label.textColor = XYRMainColor; |
| | | label.font = [UIFont systemFontOfSize:17]; |
| | | |
| | | [view addSubview:label]; |
| | | |
| | | UIImageView *leftImage = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMinX(label.frame) - 66, CGRectGetMidY(view.frame) - 1, 25, 1)]; |
| | | leftImage.image = [UIImage imageNamed:@"guodu_left"]; |
| | | [view addSubview:leftImage]; |
| | | |
| | | UIImageView *rightImage = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(label.frame) + 12, CGRectGetMinY(leftImage.frame), 25, 1)]; |
| | | rightImage.image = [UIImage imageNamed:@"guodu_right"]; |
| | | [view addSubview:rightImage]; |
| | | UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(leftImage.frame) + 12, CGRectGetMidY(leftImage.frame) - 9.5, 19, 19)]; |
| | | imageview.image = [UIImage imageNamed:imageName]; |
| | | [view addSubview:imageview]; |
| | | |
| | | return view; |
| | | } |
| | | |
| | | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section |
| | | { |
| | | if (section == 0) { |
| | | if (self.code == 2) { |
| | | return 10; |
| | | |
| | | } else { |
| | | CGFloat heightRecommend = 0.0; |
| | | if ([self isHaveValue:self.goodsModel.descriptions]) { |
| | | CGFloat heghtDescr = [self getLabelHeightWithText:self.goodsModel.descriptions width:SCREEN_WIDTH - 20 font:(SCREEN_WIDTH < 375)?10:12] + 37 + 15 + 20; |
| | | heightRecommend = heghtDescr; |
| | | |
| | | } else { |
| | | heightRecommend = 10; |
| | | } |
| | | return heightRecommend; |
| | | } |
| | | |
| | | } else { |
| | | if (section == 1) { |
| | | if (self.shareUsersArray.count == 0) { |
| | | return CGFLOAT_MIN; |
| | | } |
| | | } |
| | | if (section == 2) { |
| | | if (isShowdetail) { |
| | | if (self.webHeight > 50) { |
| | | return self.webHeight + 10; |
| | | |
| | | } else { |
| | | return 50; |
| | | } |
| | | |
| | | } else { |
| | | return 10; |
| | | } |
| | | } |
| | | return 10; |
| | | } |
| | | } |
| | | |
| | | - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section |
| | | { |
| | | if (section == 0) { |
| | | if (self.code == 2) { |
| | | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 10)]; |
| | | view.backgroundColor = XYRBackgroundColor; |
| | | return view; |
| | | |
| | | } else { |
| | | CGFloat heightRecommend = 0.0; |
| | | if ([self isHaveValue:self.goodsModel.descriptions]) { |
| | | CGFloat heghtDescr = [self getLabelHeightWithText:self.goodsModel.descriptions width:SCREEN_WIDTH - 20 font:(SCREEN_WIDTH < 375)?10:12] + 37 + 15 + 20; |
| | | heightRecommend = heghtDescr; |
| | | |
| | | } else { |
| | | heightRecommend = CGFLOAT_MIN; |
| | | } |
| | | GoosStoreInfoView *view = [[GoosStoreInfoView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, heightRecommend)]; |
| | | view.model = self.goodsModel; |
| | | return view; |
| | | } |
| | | |
| | | } else { |
| | | if (section == 2) { |
| | | if (isShowdetail) { |
| | | if (self.webHeight > 50) { |
| | | self.contentScrollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, self.webHeight + 10); |
| | | self.contentScrollView.backgroundColor = XYRBackgroundColor; |
| | | self.detailWebView.frame = CGRectMake(0, 0, SCREEN_WIDTH, self.webHeight); |
| | | [self.contentScrollView addSubview:self.detailWebView]; |
| | | |
| | | } else { |
| | | self.contentScrollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 50); |
| | | self.contentScrollView.backgroundColor = XYRBackgroundColor; |
| | | [self.webLoadProgressView removeFromSuperview]; |
| | | [self.contentScrollView addSubview:self.webLoadProgressView]; |
| | | } |
| | | return self.contentScrollView; |
| | | } |
| | | } |
| | | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 10)]; |
| | | view.backgroundColor = XYRBackgroundColor; |
| | | return view; |
| | | } |
| | | } |
| | | /** |
| | | * ç¹å»åºéº |
| | | */ |
| | | - (void)onClickStore |
| | | { |
| | | kPreventRepeatClickTime(0.5); |
| | | [UMCustomShop umGoods_detail_shop_detail]; |
| | | ShonpingShareViewController *shonpingShareVc = [[ShonpingShareViewController alloc] init]; |
| | | shonpingShareVc.navaTitle = self.goodsModel.shopInfo.shopName; |
| | | shonpingShareVc.urlString = self.goodsModel.shopInfo.shopLink; |
| | | [self.navigationController pushViewController:shonpingShareVc animated:YES]; |
| | | } |
| | | |
| | | #pragma mark --- getter --- |
| | | - (UITableView *)detailTableview |
| | | { |
| | | if (_detailTableview ) { |
| | | return _detailTableview; |
| | | } |
| | | _tableviewHeight = 50; |
| | | |
| | | if (IS_IPHONE_X) { |
| | | _tableviewHeight = 70; |
| | | } |
| | | _detailTableview = [[UITableView alloc ]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - _tableviewHeight) style:UITableViewStyleGrouped]; |
| | | _detailTableview.delegate = self; |
| | | _detailTableview.dataSource = self; |
| | | _detailTableview.rowHeight = 300; |
| | | _detailTableview.separatorStyle = UITableViewCellSelectionStyleNone; |
| | | _detailTableview.estimatedRowHeight = 0; |
| | | _detailTableview.estimatedSectionFooterHeight = 0; |
| | | _detailTableview.estimatedSectionHeaderHeight = 0; |
| | | _detailTableview.hidden = YES; |
| | | _detailTableview.backgroundColor = XYRBackgroundColor; |
| | | |
| | | @weakify(self) |
| | | MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ |
| | | @strongify(self) |
| | | [self.detailTableview.mj_footer endRefreshingWithNoMoreData]; |
| | | }]; |
| | | [footer setTitle:@"" forState:MJRefreshStateIdle]; |
| | | [footer setTitle:@"" forState:MJRefreshStatePulling]; |
| | | [footer setTitle:@"" forState:MJRefreshStateRefreshing]; |
| | | _detailTableview.mj_footer = footer; |
| | | |
| | | [_detailTableview registerNib:[UINib nibWithNibName:@"GDDetailTableViewCell" bundle:nil] forCellReuseIdentifier:@"GDDetailTableViewCell"]; |
| | | [_detailTableview registerNib:[UINib nibWithNibName:@"NoShopTableViewCell" bundle:nil] forCellReuseIdentifier:@"NoShopTableViewCell"]; |
| | | //è§£å³æ»å¨è§å¾é¡¶é¨ç©ºåºç¶ææ é«åº¦çé®é¢ |
| | | if (@available(iOS 11.0, *)) { |
| | | _detailTableview.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; |
| | | |
| | | } else { |
| | | if([UIViewController instancesRespondToSelector:@selector(edgesForExtendedLayout)]) { |
| | | self.edgesForExtendedLayout = UIRectEdgeNone; |
| | | } |
| | | } |
| | | return _detailTableview; |
| | | } |
| | | |
| | | - (GDetailView *)topView |
| | | { |
| | | if (_topView) { |
| | | return _topView; |
| | | } |
| | | NSInteger height = 0; |
| | | |
| | | _topView = [[GDetailView alloc]initWithFrame:CGRectMake(0, height, SCREEN_WIDTH , kNavigationBarH + kStatusBarH)]; |
| | | _topView.backgroundColor = FLQNewNavigationBarColor; |
| | | _topView.goodButton.selected = YES; |
| | | _topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.goodButton.frame) - 21, CGRectGetMaxY(self.topView.goodButton.frame)-5, 40, 4); |
| | | |
| | | _topView.delegate = self; |
| | | _topView.alpha = 0; |
| | | return _topView; |
| | | } |
| | | |
| | | - (ButtomCarView *)buttomView { |
| | | if (_buttomView) { |
| | | return _buttomView; |
| | | } |
| | | NSInteger height = 50; |
| | | if (IS_IPHONE_X) { |
| | | height = 70; |
| | | } |
| | | _buttomView = [[ButtomCarView alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT - height, SCREEN_WIDTH , height)]; |
| | | _buttomView.delegate = self; |
| | | return _buttomView; |
| | | } |
| | | |
| | | - (JDNOFanLiButtonView *)noFanLiButtomView |
| | | { |
| | | if (_noFanLiButtomView) { |
| | | return _noFanLiButtomView; |
| | | } |
| | | NSInteger height = IS_IPHONE_X? 70:50; |
| | | |
| | | _noFanLiButtomView = [[JDNOFanLiButtonView alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT - height, SCREEN_WIDTH , height)]; |
| | | _noFanLiButtomView.hidden = YES; |
| | | @weakify(self) |
| | | _noFanLiButtomView.onClickButtonEvent = ^(NSInteger type) { |
| | | @strongify(self) |
| | | if (type == 0) { |
| | | [self collectTaped:nil]; |
| | | |
| | | } else if (type == 1) { |
| | | [self buyClicked:nil]; |
| | | } |
| | | }; |
| | | return _noFanLiButtomView; |
| | | } |
| | | |
| | | - (SNTransformView *)transitionView { |
| | | if (_transitionView) { |
| | | return _transitionView; |
| | | } |
| | | _transitionView = [[SNTransformView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| | | _transitionView.hidden = YES; |
| | | return _transitionView; |
| | | } |
| | | |
| | | - (UIButton *)backButton |
| | | { |
| | | if (_backButton ) { |
| | | return _backButton; |
| | | } |
| | | _backButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | NSInteger height = 27; |
| | | if (IS_IPHONE_X) { |
| | | height = 47; |
| | | } |
| | | _backButton.frame = CGRectMake(20, height, 30, 30); |
| | | [_backButton setImage:[UIImage imageNamed:@"left_back_around"] forState:UIControlStateNormal]; |
| | | return _backButton; |
| | | } |
| | | |
| | | - (UIButton *)moreShareButton |
| | | { |
| | | if (_moreShareButton ) { |
| | | return _moreShareButton; |
| | | } |
| | | _moreShareButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | NSInteger height = 27; |
| | | if (IS_IPHONE_X) { |
| | | height = 47; |
| | | } |
| | | _moreShareButton.frame = CGRectMake(SCREEN_WIDTH - 20 - 30, height, 30, 30); |
| | | |
| | | [_moreShareButton setImage:[UIImage imageNamed:@"æ´å¤___"] forState:UIControlStateNormal]; |
| | | [_moreShareButton addTarget:self action:@selector(moreshareClicked:) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | return _moreShareButton; |
| | | } |
| | | |
| | | - (UIButton *)blockBackButton |
| | | { |
| | | if (!_blockBackButton ) { |
| | | _blockBackButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | _blockBackButton.frame = CGRectMake(0, 0, 70, kNavigationBarH + kStatusBarH); |
| | | [_blockBackButton addTarget:self action:@selector(backTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _blockBackButton; |
| | | } |
| | | |
| | | - (void)didReceiveMemoryWarning |
| | | { |
| | | [super didReceiveMemoryWarning]; |
| | | } |
| | | |
| | | - (void)dealloc { |
| | | [self.webTimerDis invalidate]; |
| | | self.webTimerDis = nil; |
| | | if (self.timers) { |
| | | dispatch_source_cancel(self.timers); |
| | | } |
| | | [[ALNetWorking startInterface] cancelAll]; |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| | | if (self.code != 2 && self.extraDictionary) { |
| | | [self.detailWebView removeObserver:self forKeyPath:@"scrollView.contentSize"]; |
| | | } |
| | | } |
| | | |
| | | - (SJNoNetwork *)noNetworkViews |
| | | { |
| | | if (_noNetworkViews) { |
| | | return _noNetworkViews; |
| | | } |
| | | _noNetworkViews = [[SJNoNetwork alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| | | _noNetworkViews.backgroundColor = XYRBackgroundColor; |
| | | [_noNetworkViews.connectBtn addTarget:self action:@selector(ClickConnectBtn:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [_noNetworkViews.buttonBack addTarget:self action:@selector(backTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | _noNetworkViews.hidden = YES; |
| | | _noNetworkViews.buttonBack.hidden = YES; |
| | | return _noNetworkViews; |
| | | } |
| | | |
| | | /** |
| | | ç¹å»èç½ |
| | | */ |
| | | - (void)ClickConnectBtn:(UIButton *)sender |
| | | { |
| | | if (iOS10) { |
| | | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] |
| | | options:@{} completionHandler:nil]; |
| | | } else { |
| | | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; |
| | | } |
| | | } |
| | | |
| | | - (SJShopScrollView *)shopScrollView |
| | | { |
| | | if (_shopScrollView) { |
| | | return _shopScrollView; |
| | | } |
| | | _shopScrollView = [[SJShopScrollView alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(self.topView.frame) + 16, SCREEN_WIDTH * 0.75, 30)]; |
| | | return _shopScrollView; |
| | | } |
| | | |
| | | - (SJRollingView *)currentRollingView |
| | | { |
| | | if (_currentRollingView) { |
| | | return _currentRollingView; |
| | | } |
| | | _currentRollingView = [[SJRollingView alloc]initWithFrame:CGRectMake(0, kNavigationBarH + kStatusBarH, SCREEN_WIDTH, RollingViewHeight)]; |
| | | _currentRollingView.hidden = YES; |
| | | _currentRollingView.delegate = self; |
| | | return _currentRollingView; |
| | | } |
| | | |
| | | - (SJSharedTableViewCell *)shopview |
| | | { |
| | | if (_shopview) { |
| | | return _shopview; |
| | | } |
| | | _shopview = [[SJSharedTableViewCell alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 62)]; |
| | | _shopview.backgroundColor = [UIColor whiteColor]; |
| | | return _shopview; |
| | | } |
| | | |
| | | - (GDrecomeTableViewCell *)likeCell |
| | | { |
| | | if (_likeCell) { |
| | | return _likeCell; |
| | | } |
| | | _likeCell = [[GDrecomeTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"GDrecomeTableViewCell"]; |
| | | _likeCell.delegate = self; |
| | | _likeCell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | return _likeCell; |
| | | } |
| | | - (GDrecomeTableViewCell *)recomeCell |
| | | { |
| | | if (_recomeCell) { |
| | | return _recomeCell; |
| | | } |
| | | _recomeCell = [[GDrecomeTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"GDrecomeTableViewCell"]; |
| | | _recomeCell.delegate = self; |
| | | _recomeCell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | return _recomeCell; |
| | | } |
| | | |
| | | - (UIView *)backView { |
| | | if (_backView) { |
| | | return _backView; |
| | | } |
| | | _backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| | | _backView.backgroundColor = UICOLOR_FROM_RGB(0xf3f3f3, 1.0); |
| | | |
| | | UIImage *image = nil; |
| | | NSString *string = nil; |
| | | |
| | | image = ALIMAGE_NAMED(@"defaultPage_noGoods"); |
| | | string = @"该ååå·²ç»ä¸æ¶äº~"; |
| | | |
| | | UIImageView *imageview = [[UIImageView alloc] init]; |
| | | imageview.image = image; |
| | | [_backView addSubview:imageview]; |
| | | _backView.hidden = YES; |
| | | |
| | | imageview.sd_layout.centerXEqualToView(_backView).centerYEqualToView(_backView).widthIs(image.size.width).heightIs(image.size.height); |
| | | |
| | | UILabel *label = [[UILabel alloc] init]; |
| | | label.textColor = UICOLOR_FROM_RGB(0x333333, 1.0); |
| | | label.font = [UIFont systemFontOfSize:15]; |
| | | label.textAlignment = NSTextAlignmentCenter; |
| | | label.text = string; |
| | | [_backView addSubview:label]; |
| | | |
| | | label.sd_layout.leftSpaceToView(_backView, 10).rightSpaceToView(_backView, 10).topSpaceToView(imageview, 20).autoHeightRatio(0); |
| | | |
| | | [label updateLayout]; |
| | | |
| | | CGFloat imageTopSpace = (SCREEN_HEIGHT - image.size.height - 20 - label.frame.size.height) / 2; |
| | | imageview.sd_resetLayout.centerXEqualToView(_backView).topSpaceToView(_backView, imageTopSpace).widthIs(image.size.width).heightIs(image.size.height); |
| | | |
| | | return _backView; |
| | | } |
| | | |
| | | - (void)setDetailUrlString:(NSString *)detailUrlString |
| | | { |
| | | _detailUrlString = detailUrlString; |
| | | [self.detailWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:detailUrlString]]]; |
| | | } |
| | | - (WKWebView *)detailWebView |
| | | { |
| | | if (_detailWebView) { |
| | | return _detailWebView; |
| | | } |
| | | _detailWebView = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 0)]; |
| | | _detailWebView.UIDelegate = self; |
| | | _detailWebView.navigationDelegate = self; |
| | | _detailWebView.scrollView.userInteractionEnabled = NO;//ç¦æ¢æ»å¨ï¼é²æ¢ä¸UITableViewå²çª |
| | | [_detailWebView addObserver:self forKeyPath:@"scrollView.contentSize" options:NSKeyValueObservingOptionNew context:nil]; |
| | | return _detailWebView; |
| | | } |
| | | |
| | | -(UIScrollView *)contentScrollView |
| | | { |
| | | if (!_contentScrollView) { |
| | | _contentScrollView = [[UIScrollView alloc]init]; |
| | | _contentScrollView.contentSize = CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT); |
| | | _contentScrollView.scrollEnabled = NO;//ç¦æ¢æ»å¨ï¼é²æ¢ä¸UITableViewå²çª |
| | | } |
| | | return _contentScrollView; |
| | | } |
| | | |
| | | - (WebLoadProgressView *)webLoadProgressView |
| | | { |
| | | if (!_webLoadProgressView) { |
| | | _webLoadProgressView = [[WebLoadProgressView alloc] init]; |
| | | _webLoadProgressView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 50); |
| | | } |
| | | return _webLoadProgressView; |
| | | } |
| | | |
| | | // 页é¢å¼å§å è½½æ¶è°ç¨ |
| | | - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation |
| | | { |
| | | @weakify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | @strongify(self) |
| | | self.webTimerDis = [NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(doSomethingDis) userInfo:nil repeats:NO]; |
| | | }); |
| | | } |
| | | |
| | | - (void)doSomethingDis { |
| | | [self.webLoadProgressView clearHideView]; |
| | | } |
| | | |
| | | // 页é¢å è½½å®æä¹åè°ç¨ |
| | | - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation |
| | | { |
| | | @weakify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | @strongify(self) |
| | | [self doSomethingDis]; |
| | | }); |
| | | } |
| | | |
| | | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context { |
| | | if (object == self.detailWebView && [keyPath isEqual:@"scrollView.contentSize"]) { |
| | | UIScrollView *scrollView = self.detailWebView.scrollView; |
| | | CGSize size = CGSizeMake(SCREEN_WIDTH, scrollView.contentSize.height); |
| | | if (size.height > self.tempWebHeight) { |
| | | self.tempWebHeight = size.height + 20; |
| | | self.webHeight = size.height + 20; |
| | | @weakify(self) |
| | | [UIView performWithoutAnimation:^{ |
| | | @strongify(self) |
| | | [self.detailTableview reloadData]; |
| | | }]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | - (NSMutableArray *)likeArray { |
| | | if (!_likeArray) { |
| | | _likeArray = [[NSMutableArray alloc] init]; |
| | | } |
| | | return _likeArray; |
| | | } |
| | | |
| | | - (NSMutableArray *)recommendArray { |
| | | if (!_recommendArray) { |
| | | _recommendArray = [[NSMutableArray alloc] init]; |
| | | } |
| | | return _recommendArray; |
| | | } |
| | | |
| | | - (BaseTipArrPopView *)baseTipArrPopView { |
| | | if (!_baseTipArrPopView) { |
| | | _baseTipArrPopView = [[BaseTipArrPopView alloc] init]; |
| | | } |
| | | return _baseTipArrPopView; |
| | | } |
| | | |
| | | - (BaseTipsPopView *)baseTipsPopView { |
| | | if (!_baseTipsPopView) { |
| | | _baseTipsPopView = [[BaseTipsPopView alloc] init]; |
| | | } |
| | | return _baseTipsPopView; |
| | | } |
| | | |
| | | - (FetchGoldcoinPopView *)fetchGoldcoinPopView { |
| | | if (!_fetchGoldcoinPopView) { |
| | | _fetchGoldcoinPopView = [[FetchGoldcoinPopView alloc] init]; |
| | | } |
| | | return _fetchGoldcoinPopView; |
| | | } |
| | | |
| | | - (UILabel *)labelSubsidy { |
| | | if (!_labelSubsidy) { |
| | | _labelSubsidy = [[UILabel alloc] init]; |
| | | _labelSubsidy.hidden = YES; |
| | | _labelSubsidy.textColor = UIColorFromRGBValue(0xE5005C); |
| | | _labelSubsidy.textAlignment = NSTextAlignmentCenter; |
| | | _labelSubsidy.font = [UIFont systemFontOfSize:10]; |
| | | _labelSubsidy.backgroundColor = UIColorFromRGBValue(0xFFE7F1); |
| | | } |
| | | return _labelSubsidy; |
| | | } |
| | | |
| | | - (UIImageView *)imageViewSJ { |
| | | if (!_imageViewSJ) { |
| | | _imageViewSJ = [[UIImageView alloc] init]; |
| | | _imageViewSJ.hidden = YES; |
| | | _imageViewSJ.image = ALIMAGE_NAMED(@"goodsdetail_sj"); |
| | | } |
| | | return _imageViewSJ; |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // SNTransformView.h |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/29. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @interface SNTransformView : UIView |
| | | |
| | | @property (nonatomic,strong)UIView *backView; |
| | | @property (nonatomic,strong)UIView *contentView; |
| | | @property (nonatomic,strong)UIImageView * fanImageview; |
| | | @property (nonatomic,strong)UIImageView * taoImageview; |
| | | @property (nonatomic,strong)UIImageView * jiantouImageview; |
| | | @property (nonatomic,strong)UIImageView * topImageView; |
| | | @property (nonatomic,strong)UILabel * titleLabel;//æç¤ºæ é¢ |
| | | @property (nonatomic,strong)UILabel * contentLabel;//æç¤ºå
容 |
| | | @property (nonatomic,assign)CGFloat contentFont; |
| | | - (void)dissMiss; |
| | | - (void)showTransitionView; |
| | | - (void)hiddenTransitionView; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // SNTransformView.m |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/29. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "SNTransformView.h" |
| | | #import "UIView+AZGradient.h" |
| | | #import "SJJumpRollView.h" |
| | | |
| | | #define gapLength 50 |
| | | @interface SNTransformView() |
| | | @property (nonatomic, strong) SJJumpRollView *rollView; |
| | | @end |
| | | |
| | | @implementation SNTransformView |
| | | |
| | | - (instancetype)initWithFrame:(CGRect)frame { |
| | | self = [super initWithFrame:frame]; |
| | | if (self) { |
| | | self.contentFont = 13; |
| | | if (SCREEN_WIDTH > 375) { |
| | | self.contentFont = 15; |
| | | }else if (SCREEN_WIDTH < 375){ |
| | | self.contentFont = 12; |
| | | } |
| | | |
| | | [self addSubview:self.backView]; |
| | | [self addSubview:self.contentView]; |
| | | |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)dissMiss { |
| | | [self removeFromSuperview]; |
| | | } |
| | | - (void)hiddenTransitionView { |
| | | [self.rollView hiddenumpRollView]; |
| | | } |
| | | - (void)showTransitionView { |
| | | [self.rollView showJumpRollView]; |
| | | } |
| | | #pragma mark - getter |
| | | - (UIView *)backView { |
| | | if (_backView) { |
| | | return _backView; |
| | | } |
| | | _backView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| | | _backView .backgroundColor = SJColor(0, 0, 0, 0.76); |
| | | return _backView; |
| | | } |
| | | - (UIView *)contentView { |
| | | if (_contentView) { |
| | | return _contentView; |
| | | } |
| | | _contentView = [[UIView alloc]initWithFrame:CGRectMake(gapLength, (self.size.height - 200) / 2, SCREEN_WIDTH - gapLength * 2, 221 * ((SCREEN_WIDTH - gapLength * 2) / 500) * 1.81)]; |
| | | _contentView.backgroundColor = [UIColor whiteColor]; |
| | | CGFloat cornerRadius = 16; |
| | | if (SCREEN_WIDTH > 375) { |
| | | cornerRadius = 19; |
| | | } |
| | | _contentView.layer.cornerRadius = cornerRadius; |
| | | _contentView.layer.masksToBounds = YES; |
| | | [_contentView addSubview:self.topImageView]; |
| | | [_contentView addSubview:self.rollView]; |
| | | [_contentView addSubview:self.titleLabel]; |
| | | [_contentView addSubview:self.contentLabel]; |
| | | return _contentView; |
| | | } |
| | | - (UIImageView *)fanImageview { |
| | | if (_fanImageview) { |
| | | return _fanImageview; |
| | | } |
| | | _fanImageview = [[UIImageView alloc]initWithFrame:CGRectMake(45, 55, 60, 60)]; |
| | | _fanImageview.image = [UIImage imageNamed:@"详æ
ââæ¿æ å¿«ç"]; |
| | | return _fanImageview; |
| | | } |
| | | |
| | | - (UIImageView *)jiantouImageview { |
| | | if (_jiantouImageview) { |
| | | return _jiantouImageview; |
| | | } |
| | | // |
| | | _jiantouImageview = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.fanImageview.frame) + 15, CGRectGetMinY(self.fanImageview.frame) + self.fanImageview.frame.size.height / 2 - 6.5, _contentView.frame.size.width - 240, 13)]; |
| | | _jiantouImageview.image = [UIImage imageNamed:@"详æ
ââç®å¤´"]; |
| | | return _jiantouImageview; |
| | | } |
| | | |
| | | //jump_img 500 * 221 |
| | | - (UIImageView *)topImageView { |
| | | if (_topImageView) { |
| | | return _topImageView; |
| | | } |
| | | _topImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, _contentView.frame.size.width, 221 * (_contentView.frame.size.width / 500))]; |
| | | _topImageView.image = [UIImage imageNamed:@"jump_img_sn"]; |
| | | return _topImageView; |
| | | } |
| | | - (UILabel *)titleLabel { |
| | | if (_titleLabel) { |
| | | return _titleLabel; |
| | | } |
| | | CGFloat height = 30; |
| | | if (SCREEN_WIDTH < 375) { |
| | | height = 25; |
| | | }else if(SCREEN_WIDTH > 375){ |
| | | height = 35; |
| | | } |
| | | _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.topImageView.frame) + height, _contentView.frame.size.width, 15)]; |
| | | _titleLabel.text = @"å
è´¹é¢å¸"; |
| | | _titleLabel.textColor = XYRMainColor; |
| | | _titleLabel.font = [UIFont boldSystemFontOfSize:_contentFont + 2]; |
| | | _titleLabel.textAlignment = NSTextAlignmentCenter; |
| | | return _titleLabel; |
| | | } |
| | | - (UILabel *)contentLabel { |
| | | if (_contentLabel) { |
| | | return _contentLabel; |
| | | } |
| | | _contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.titleLabel.frame) + 8, _contentView.frame.size.width, _contentFont)]; |
| | | _contentLabel.text = @"è´ä¹°åæè¿å©ï¼å享åæå¥é"; |
| | | _contentLabel.textColor = SJColor(1, 1, 1, 1); |
| | | _contentLabel.font = [UIFont systemFontOfSize:_contentFont]; |
| | | _contentLabel.textAlignment = NSTextAlignmentCenter; |
| | | return _contentLabel; |
| | | } |
| | | - (SJJumpRollView *)rollView { |
| | | if (_rollView) { |
| | | return _rollView; |
| | | } |
| | | _rollView = [[SJJumpRollView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.topImageView.frame), _contentView.frame.size.width, 10)]; |
| | | return _rollView; |
| | | } |
| | | |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WPHGoodsdetailInfoCell.h |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/27. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import "GoodsDetailBaseModel.h" |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | typedef void(^touchCheckLike)(void); |
| | | |
| | | @class WPHGoodsdetailInfoCell; |
| | | |
| | | @protocol WPHGoodsdetailInfoCellDelegate <NSObject> |
| | | - (void)useQuanClicked:(WPHGoodsdetailInfoCell *_Nonnull)cell ; |
| | | |
| | | - (void)touchMaxCoupon; |
| | | - (void)touchFanLiBi; |
| | | @end |
| | | |
| | | @interface WPHGoodsdetailInfoCell : UITableViewCell |
| | | |
| | | @property (nonatomic, nullable, strong) GoodsDetailBaseModel *model; |
| | | @property (nonatomic, assign) BOOL fanliValid; |
| | | @property (nonatomic, assign) BOOL shareValid; |
| | | |
| | | @property (nonatomic, nullable, strong)UIImageView *defaultImageView; |
| | | @property (nonatomic, nullable, strong)UIImageView * labelImage; |
| | | @property (nonatomic, nullable, strong)UILabel *titleLabel; |
| | | /// åä»·(天ç«/æ·å®) |
| | | @property (nonatomic, nullable, strong) UILabel *priceLabel; |
| | | /// å¸åä»·é± |
| | | @property (nonatomic, nullable, strong) UILabel *discountLabel; |
| | | /// éé |
| | | @property (nonatomic, nullable, strong) UILabel *salesLabel; |
| | | |
| | | @property (nonatomic, nullable, strong) UILabel *LabelFanliMoneyPlus; |
| | | |
| | | @property (nonatomic, nullable, strong) UIImageView *couponImage; |
| | | @property (nonatomic, nullable, strong) UILabel *quanMoney; |
| | | |
| | | @property (nonatomic, nullable, strong) UIButton *quanButton; |
| | | /// ç¸ä¼¼åå |
| | | @property (nonatomic, nullable, strong) ALButton *buttonSearch; |
| | | /// åå |
| | | @property (nonatomic, nullable, strong) ALButton *buttonHairCircle; |
| | | |
| | | @property (nonatomic, assign) BOOL storageState; |
| | | @property (nonatomic, nullable, copy) NSString *from; |
| | | @property (nonatomic, nullable, weak) id<WPHGoodsdetailInfoCellDelegate>delegate; |
| | | ///æç´¢ç¸ä¼¼ç©å |
| | | @property (nonatomic) touchCheckLike _Nullable touchCheckLike; |
| | | - (void)clearTimer; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // WPHGoodsdetailInfoCell.m |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/27. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "WPHGoodsdetailInfoCell.h" |
| | | #import "HZPhotoBrowser.h" |
| | | #import "CommonMethodManage.h" |
| | | #define LEAVENOTE 10 |
| | | |
| | | @interface WPHGoodsdetailInfoCell () <UIScrollViewDelegate, HZPhotoBrowserDelegate> |
| | | |
| | | @property (nonatomic, strong) UIScrollView *scrollView; |
| | | @property (nonatomic, strong) UILabel *coupLabel; |
| | | @property (nonatomic, strong) UILabel *fanLabel; |
| | | @property (nonatomic, strong) UILabel *digitalLabel; |
| | | @property (nonatomic, strong) UILabel *qianFuHaoLabel; |
| | | /// å
 |
| | | @property (nonatomic, strong) UILabel *gongyiLabel; |
| | | /// çæ¬¾ |
| | | @property (nonatomic, strong) UILabel *baokuanLabel; |
| | | /// è£
è½½å¾çæ°ç» |
| | | @property (nonatomic, strong) NSArray *array; |
| | | |
| | | @property (nonatomic, strong) NSTimer *timer; |
| | | /// ç¨æ¥å¤ææ¯å¦å·²ç»æå¼ |
| | | @property (nonatomic, strong) NSArray *flagImgArr; |
| | | |
| | | @property (nonatomic, nullable, strong) UIView *viewMaxCoupon; |
| | | @property (nonatomic, nullable, strong) UILabel *labelMaxDesc; |
| | | @property (nonatomic, nullable, strong) UILabel *labelMaxMoney; |
| | | @property (nonatomic, nullable, strong) UILabel *LabelmaxMoneyPlus; |
| | | @property (nonatomic, nullable, strong) UIImageView *imageViewRightArrow; |
| | | @property (nonatomic, nullable, strong) UIImageView *imageViewsuperMembers; |
| | | @property (nonatomic, nullable, strong) UILabel *labelShengJi; |
| | | |
| | | @property (nonatomic, nullable, strong) ALButton *buttonFanliBi; |
| | | @property (nonatomic, nullable, strong) UILabel *labelFanliBi; |
| | | |
| | | @property (nonatomic, strong, nullable) UIView *viewSXLine; |
| | | |
| | | @property (nonatomic, strong, nullable) CommonMethodManage *commonMethodManage; |
| | | |
| | | @property (nonatomic, assign) NSInteger indexPage; |
| | | @end |
| | | |
| | | @implementation WPHGoodsdetailInfoCell |
| | | |
| | | - (void)awakeFromNib { |
| | | [super awakeFromNib]; |
| | | // Initialization code |
| | | } |
| | | |
| | | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { |
| | | [super setSelected:selected animated:animated]; |
| | | |
| | | // 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 whiteColor]; |
| | | [self loadUI]; |
| | | } |
| | | return self; |
| | | } |
| | | - (void)loadUI |
| | | { |
| | | [self.contentView addSubview:self.scrollView]; |
| | | [self.contentView addSubview:self.digitalLabel]; |
| | | |
| | | [self.contentView addSubview:self.coupLabel]; |
| | | self.coupLabel.sd_layout.leftSpaceToView(self.contentView, LEAVENOTE).topSpaceToView(self.scrollView, 20).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.coupLabel setSingleLineAutoResizeWithMaxWidth:100]; |
| | | |
| | | [self.contentView addSubview:self.qianFuHaoLabel]; |
| | | self.qianFuHaoLabel.sd_layout.leftSpaceToView(self.coupLabel, 2).bottomEqualToView(self.coupLabel).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.qianFuHaoLabel setSingleLineAutoResizeWithMaxWidth:30]; |
| | | |
| | | [self.contentView addSubview:self.discountLabel]; |
| | | self.discountLabel.sd_layout.leftSpaceToView(self.qianFuHaoLabel, 5).bottomEqualToView(self.qianFuHaoLabel).autoWidthRatio(0).heightIs(21); |
| | | [self.discountLabel setSingleLineAutoResizeWithMaxWidth:100]; |
| | | |
| | | [self.contentView addSubview:self.fanLabel]; |
| | | self.fanLabel.sd_layout.leftSpaceToView(self.discountLabel, 10).bottomEqualToView(self.coupLabel).widthIs(0).heightIs(18); |
| | | |
| | | [self.contentView addSubview:self.gongyiLabel]; |
| | | self.gongyiLabel.sd_layout.leftSpaceToView(self.fanLabel, 10).bottomEqualToView(self.fanLabel).widthIs(0).heightIs(15); |
| | | self.gongyiLabel.sd_cornerRadius = @3; |
| | | |
| | | [self.contentView addSubview:self.baokuanLabel]; |
| | | self.baokuanLabel.sd_layout.leftSpaceToView(self.gongyiLabel, 5).bottomEqualToView(self.fanLabel).widthIs(0).heightIs(15); |
| | | self.baokuanLabel.sd_cornerRadius = @3; |
| | | |
| | | [self.contentView addSubview:self.priceLabel]; |
| | | self.priceLabel.sd_layout.leftSpaceToView(self.contentView, 10).topSpaceToView(self.qianFuHaoLabel, 10).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.priceLabel setSingleLineAutoResizeWithMaxWidth:200]; |
| | | |
| | | [self.contentView addSubview:self.LabelFanliMoneyPlus]; |
| | | self.LabelFanliMoneyPlus.sd_layout.leftSpaceToView(self.priceLabel, 30).bottomEqualToView(self.priceLabel).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.LabelFanliMoneyPlus setSingleLineAutoResizeWithMaxWidth:250]; |
| | | |
| | | [self.contentView addSubview:self.salesLabel]; |
| | | self.salesLabel.sd_layout.rightSpaceToView(self.contentView, 21).topSpaceToView(self.qianFuHaoLabel, 10).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.salesLabel setSingleLineAutoResizeWithMaxWidth:200]; |
| | | |
| | | //è¿å©æ¯ |
| | | [self.contentView addSubview:self.buttonFanliBi]; |
| | | self.buttonFanliBi.sd_layout.rightSpaceToView(self.contentView, 3).topSpaceToView(self.scrollView, 8).widthIs(16).heightIs(16); |
| | | |
| | | [self.contentView addSubview:self.labelFanliBi]; |
| | | self.labelFanliBi.sd_layout.rightSpaceToView(self.contentView, 21).topSpaceToView(self.buttonFanliBi, -3).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.labelFanliBi setSingleLineAutoResizeWithMaxWidth:200]; |
| | | |
| | | // è¶
级ä¼åView |
| | | [self.contentView addSubview:self.viewMaxCoupon]; |
| | | [self.viewMaxCoupon addSubview:self.imageViewsuperMembers]; |
| | | [self.viewMaxCoupon addSubview:self.labelMaxDesc]; |
| | | [self.viewMaxCoupon addSubview:self.labelMaxMoney]; |
| | | [self.viewMaxCoupon addSubview:self.imageViewRightArrow];; |
| | | [self.viewMaxCoupon addSubview:self.LabelmaxMoneyPlus]; |
| | | [self.viewMaxCoupon addSubview:self.labelShengJi]; |
| | | |
| | | self.viewMaxCoupon.sd_layout.leftSpaceToView(self.contentView, 0).rightSpaceToView(self.contentView, 0).topSpaceToView(self.priceLabel, 12).heightIs(30); |
| | | |
| | | UIImage *imagesuper_members = ALIMAGE_NAMED(@"goodsdetail_super_members"); |
| | | self.imageViewsuperMembers.sd_layout.leftSpaceToView(self.viewMaxCoupon, 10).centerYEqualToView(self.viewMaxCoupon).widthIs(imagesuper_members.size.width).heightIs(imagesuper_members.size.height); |
| | | |
| | | self.labelMaxDesc.sd_layout.leftSpaceToView(self.viewMaxCoupon, 10).centerYEqualToView(self.viewMaxCoupon).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.labelMaxDesc setSingleLineAutoResizeWithMaxWidth:200]; |
| | | |
| | | self.labelMaxMoney.sd_layout.leftSpaceToView(self.labelMaxDesc, 1).centerYEqualToView(self.viewMaxCoupon).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.labelMaxMoney setSingleLineAutoResizeWithMaxWidth:200]; |
| | | |
| | | self.LabelmaxMoneyPlus.sd_layout.leftSpaceToView(self.labelMaxMoney, 0).centerYEqualToView(self.viewMaxCoupon).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.LabelmaxMoneyPlus setSingleLineAutoResizeWithMaxWidth:250]; |
| | | |
| | | self.imageViewRightArrow.sd_layout.rightSpaceToView(self.viewMaxCoupon, 10).centerYEqualToView(self.viewMaxCoupon).widthIs(7).heightIs(12); |
| | | |
| | | self.labelShengJi.sd_layout.rightSpaceToView(self.imageViewRightArrow, 5).centerYEqualToView(self.viewMaxCoupon).widthIs(100).autoHeightRatio(0); |
| | | |
| | | self.viewMaxCoupon.userInteractionEnabled = YES; |
| | | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTouchMaxCoupon)]; |
| | | [self.viewMaxCoupon addGestureRecognizer:tap]; |
| | | |
| | | UIImage *image = [UIImage imageNamed:@"æ·å®"]; |
| | | [self.contentView addSubview:self.labelImage]; |
| | | self.labelImage.sd_layout.leftSpaceToView(self.contentView, 10).topSpaceToView(self.priceLabel, 15).widthIs(image.size.width).heightIs(image.size.height); |
| | | |
| | | [self.contentView addSubview:self.titleLabel]; |
| | | |
| | | [self.contentView addSubview:self.couponImage]; |
| | | [self.contentView addSubview:self.quanMoney]; |
| | | |
| | | [self.contentView addSubview:self.quanButton]; |
| | | [self.contentView addSubview:self.defaultImageView]; |
| | | |
| | | if ([YTHsharedManger startManger].iosonling == 0) { |
| | | [self.contentView addSubview:self.buttonSearch]; |
| | | [self.contentView addSubview:self.buttonHairCircle]; |
| | | [self.contentView addSubview:self.viewSXLine]; |
| | | } |
| | | self.viewSXLine.sd_layout.centerXEqualToView(self.contentView).centerYEqualToView(self.buttonHairCircle).widthIs(1).heightIs(15); |
| | | } |
| | | |
| | | - (void)onTouchMaxCoupon { |
| | | if (_delegate && [_delegate respondsToSelector:@selector(touchMaxCoupon)]) { |
| | | [_delegate touchMaxCoupon]; |
| | | } |
| | | } |
| | | |
| | | - (void)onTouchFanliBi { |
| | | if (_delegate && [_delegate respondsToSelector:@selector(touchFanLiBi)]) { |
| | | [_delegate touchFanLiBi]; |
| | | } |
| | | } |
| | | |
| | | - (void)onTouchSearchLike:(UIButton *)button { |
| | | !_touchCheckLike?:_touchCheckLike(); |
| | | } |
| | | |
| | | -(void)dealloc { |
| | | |
| | | [self.timer invalidate]; |
| | | self.timer = nil; |
| | | } |
| | | |
| | | - (void)clearTimer { |
| | | [self.timer invalidate]; |
| | | self.timer = nil; |
| | | } |
| | | |
| | | - (void)setStorageState:(BOOL)storageState { |
| | | _storageState = storageState; |
| | | if (storageState) { |
| | | self.buttonHairCircle.selected = YES; |
| | | |
| | | } else { |
| | | self.buttonHairCircle.selected = NO; |
| | | } |
| | | } |
| | | |
| | | - (void)setviewsFrameWithBor:(BOOL)bor |
| | | { |
| | | NSInteger width = 0; |
| | | if (SCREEN_WIDTH > 375) { |
| | | width = 13; |
| | | }else if (SCREEN_WIDTH == 375){ |
| | | width = 10; |
| | | }else{ |
| | | width = 8; |
| | | } |
| | | |
| | | if (_model.couponInfo.startTime) { |
| | | self.quanMoney.frame = CGRectMake(CGRectGetMinX(self.couponImage.frame) + width, CGRectGetMinY(self.couponImage.frame) + 7, self.couponImage.frame.size.width / 5 * 3, 26); |
| | | |
| | | } else { |
| | | self.quanMoney.frame = CGRectMake(CGRectGetMinX(self.couponImage.frame) + width, CGRectGetMinY(self.couponImage.frame) + ((self.couponImage.frame.size.height - 26) / 2), self.couponImage.frame.size.width / 5 * 3, 26); |
| | | } |
| | | self.quanButton.frame = CGRectMake(CGRectGetMaxX(self.quanMoney.frame), CGRectGetMinY(self.couponImage.frame), self.couponImage.frame.size.width / 5 * 2, self.couponImage.frame.size.height); |
| | | } |
| | | |
| | | - (void)setFrom:(NSString *)from { |
| | | _from = from; |
| | | } |
| | | |
| | | - (void)setFanliValid:(BOOL)fanliValid { |
| | | _fanliValid = fanliValid; |
| | | } |
| | | |
| | | - (void)setShareValid:(BOOL)shareValid { |
| | | _shareValid = shareValid; |
| | | } |
| | | |
| | | - (void)setModel:(GoodsDetailBaseModel *)model { |
| | | _model = model; |
| | | if (model) { |
| | | NSArray *imageArray = model.imgList; |
| | | self.array = imageArray; |
| | | self.scrollView.contentSize = CGSizeMake(SCREEN_WIDTH * imageArray.count, _scrollView.frame.size.height); |
| | | if (self.flagImgArr.count == imageArray.count) { |
| | | // 妿已ç»å è½½äºï¼ä¸éè¦å次å è½½ |
| | | } else { |
| | | self.digitalLabel.text = [NSString stringWithFormat:@"%d/%lu",1 ,(unsigned long)imageArray.count]; |
| | | for (NSInteger index = 0; index < imageArray.count; index ++) { |
| | | UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(index * SCREEN_WIDTH, 0, SCREEN_WIDTH, _scrollView.frame.size.height)]; |
| | | |
| | | [image setContentScaleFactor:[[UIScreen mainScreen] scale]]; |
| | | image.contentMode = UIViewContentModeScaleAspectFill; |
| | | image.autoresizingMask = UIViewAutoresizingFlexibleHeight; |
| | | image.clipsToBounds = YES; |
| | | |
| | | image.userInteractionEnabled = YES; |
| | | image.backgroundColor = ImagePlaceholder_white; |
| | | [image sd_setFadeImageWithURL:[NSURL URLWithString:imageArray[index]] placeholderImage:nil options:SDWebImageRefreshCached]; |
| | | |
| | | [_scrollView addSubview:image]; |
| | | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | button.frame = image.frame; |
| | | button.tag = 1234 + index; |
| | | [button addTarget:self action:@selector(imageButtonTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [_scrollView addSubview:button]; |
| | | } |
| | | // [self.timer invalidate]; |
| | | // self.timer = [NSTimer scheduledTimerWithTimeInterval:4 target:self selector:@selector(nextPage) userInfo:nil repeats:YES]; |
| | | } |
| | | self.flagImgArr = imageArray; |
| | | |
| | | self.discountLabel.text = [NSString stringWithFormat:@"%@",model.couponPrice]; |
| | | //shopType 10-æ·å® 11-å¤©ç« 20-äº¬ä¸ 30-æ¼å¤å¤ |
| | | NSString *salesString = nil; |
| | | if (model.salesType == 1) { |
| | | salesString = @"æé"; |
| | | |
| | | } else if (model.salesType == 4) { |
| | | salesString = @"æ»éé"; |
| | | } |
| | | //model.priceName |
| | | self.priceLabel.text = [NSString stringWithFormat:@"åä»· Â¥%@" ,model.zkPrice]; |
| | | |
| | | if ([self isHaveValue:model.salesCount]) { |
| | | self.salesLabel.text = [NSString stringWithFormat:@"%@ %@",salesString, model.salesCount]; |
| | | |
| | | } else { |
| | | self.salesLabel.hidden = YES; |
| | | } |
| | | |
| | | // è¿å© |
| | | NSString *fanString = [NSString stringWithFormat:@"è¿ %@",model.moneyInfo.fanliMoney]; |
| | | CGFloat fanLabelWidth = [self getWidthWithText:fanString height:18 font:12]; |
| | | self.fanLabel.text = fanString; |
| | | self.fanLabel.sd_resetLayout.leftSpaceToView(self.discountLabel, 10).bottomEqualToView(self.discountLabel).widthIs(roundf(fanLabelWidth + 20)).heightIs(18); |
| | | self.fanLabel.sd_cornerRadius = @3; |
| | | |
| | | self.LabelFanliMoneyPlus.text = model.otherInfo.fanliMoneyPlus; |
| | | self.LabelmaxMoneyPlus.text = model.otherInfo.rewardCoupon.maxMoneyPlus; |
| | | |
| | | CGFloat maxCouponHeight = 0; |
| | | if (![_from isEqualToString:@"miandan"]) {// æ¯å¦æ¯å
å |
| | | if ([ALUserInfoServiceManger fetchUserInfo]) {// æ¯å¦ç»é |
| | | if (![ALUserInfoServiceManger isMembership]) {// æ¯å¦æ¯ä¼å |
| | | if (_model.otherInfo.rewardCoupon) { |
| | | self.viewMaxCoupon.hidden = NO; |
| | | self.imageViewsuperMembers.hidden = NO; |
| | | self.labelShengJi.hidden = NO; |
| | | self.labelMaxDesc.sd_resetLayout.leftSpaceToView(self.imageViewsuperMembers, 5).centerYEqualToView(self.viewMaxCoupon).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.labelMaxDesc setSingleLineAutoResizeWithMaxWidth:200]; |
| | | self.labelMaxDesc.text = _model.otherInfo.rewardCoupon.desc; |
| | | self.labelMaxMoney.text = _model.otherInfo.rewardCoupon.maxMoney; |
| | | maxCouponHeight = 50; |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | if (_model.otherInfo.rewardCoupon) { |
| | | self.viewMaxCoupon.hidden = NO; |
| | | self.imageViewsuperMembers.hidden = NO; |
| | | self.labelShengJi.hidden = NO; |
| | | self.labelMaxDesc.sd_resetLayout.leftSpaceToView(self.imageViewsuperMembers, 5).centerYEqualToView(self.viewMaxCoupon).autoWidthRatio(0).autoHeightRatio(0); |
| | | [self.labelMaxDesc setSingleLineAutoResizeWithMaxWidth:200]; |
| | | self.labelMaxDesc.text = _model.otherInfo.rewardCoupon.desc; |
| | | self.labelMaxMoney.text = _model.otherInfo.rewardCoupon.maxMoney; |
| | | maxCouponHeight = 50; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //è¿å©æ¯ |
| | | if ([self isHaveValue:model.moneyInfo.rateInfoHelpUrl]) { |
| | | self.buttonFanliBi.hidden = NO; |
| | | } |
| | | if ([self isHaveValue:model.moneyInfo.rateInfo]) { |
| | | self.labelFanliBi.hidden = NO; |
| | | self.labelFanliBi.text = model.moneyInfo.rateInfo; |
| | | } |
| | | // é设logoå¾ç |
| | | UIImage *icomImage = ALIMAGE_NAMED(@"ic_share_wph"); |
| | | self.labelImage.image = icomImage; |
| | | self.labelImage.sd_resetLayout.leftSpaceToView(self.contentView, 10).topSpaceToView(self.priceLabel, 7 + maxCouponHeight).widthIs(icomImage.size.width).heightIs(icomImage.size.height); |
| | | [self.labelImage updateLayout]; |
| | | |
| | | // æ é¢ |
| | | NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; |
| | | style.lineSpacing = 3; |
| | | //坹齿¹å¼ |
| | | style.alignment = NSTextAlignmentLeft; |
| | | //é¦è¡ç¼©è¿ |
| | | CGFloat firstLineHeadIndentHeight = 0; |
| | | |
| | | if ([model.title hasPrefix:@"ã"]) { |
| | | firstLineHeadIndentHeight = icomImage.size.width; |
| | | |
| | | } else { |
| | | firstLineHeadIndentHeight = icomImage.size.width + 8; |
| | | } |
| | | style.firstLineHeadIndent = firstLineHeadIndentHeight; |
| | | |
| | | NSAttributedString *attrText = [[NSAttributedString alloc] initWithString:model.title attributes:@{NSParagraphStyleAttributeName:style}]; |
| | | self.titleLabel.attributedText = attrText; |
| | | |
| | | NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; |
| | | |
| | | CGFloat height = [self getSpaceLabelHeight:model.title withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; |
| | | self.titleLabel.frame = CGRectMake(10, CGRectGetMinY(self.labelImage.frame) - 2, SCREEN_WIDTH - 20, height); |
| | | |
| | | // æ ç¾ |
| | | CGFloat gongyiLabelWidth = 0, baokuanLabelWidth = 0; |
| | | if ([model.labels count] >= 1) { |
| | | if (model.labels[0]) { |
| | | self.gongyiLabel.text = model.labels[0].content; |
| | | self.gongyiLabel.textColor = [self hexColor:model.labels[0].color]; |
| | | [self setViewBorder:self.gongyiLabel width:1 color:[self hexColor:model.labels[0].color]]; |
| | | gongyiLabelWidth = [self getWidthWithText:model.labels[0].content height:15 font:9] + 5; |
| | | self.gongyiLabel.sd_resetLayout.leftSpaceToView(self.contentView, 10).topSpaceToView(self.titleLabel, 8.5).widthIs(gongyiLabelWidth).heightIs(15); |
| | | self.gongyiLabel.sd_cornerRadius = @3; |
| | | |
| | | } else { |
| | | self.gongyiLabel.hidden = YES; |
| | | } |
| | | |
| | | if ([model.labels count] >= 2) { |
| | | self.baokuanLabel.text = model.labels[1].content; |
| | | self.baokuanLabel.textColor = [self hexColor:model.labels[1].color]; |
| | | [self setViewBorder:self.baokuanLabel width:1 color:[self hexColor:model.labels[1].color]]; |
| | | baokuanLabelWidth = [self getWidthWithText:model.labels[1].content height:15 font:9] + 5; |
| | | self.baokuanLabel.sd_resetLayout.leftSpaceToView(self.gongyiLabel, 5).bottomEqualToView(self.gongyiLabel).widthIs(baokuanLabelWidth).heightIs(15); |
| | | self.baokuanLabel.sd_cornerRadius = @3; |
| | | |
| | | } else { |
| | | self.baokuanLabel.hidden = YES; |
| | | } |
| | | |
| | | } else { |
| | | self.gongyiLabel.hidden = YES; |
| | | self.baokuanLabel.hidden = YES; |
| | | } |
| | | |
| | | CGFloat sapceTop = 0; |
| | | if ([self isHaveValue:model.labels]) { |
| | | sapceTop = 22; |
| | | } |
| | | |
| | | self.couponImage.frame = CGRectMake(14 , CGRectGetMaxY(self.titleLabel.frame) + 20 + sapceTop, SCREEN_WIDTH - 14 * 2 , 64); |
| | | [self setviewsFrameWithBor:NO]; |
| | | |
| | | //æ¶èåº |
| | | self.buttonHairCircle.frame = CGRectMake(14, CGRectGetMaxY(self.couponImage.frame) + 15, (SCREEN_WIDTH - 28) / 2, 30); |
| | | self.buttonSearch.frame = CGRectMake(SCREEN_WIDTH - 14 - (SCREEN_WIDTH - 28) / 2, CGRectGetMaxY(self.couponImage.frame) + 15, (SCREEN_WIDTH - 28) / 2, 30); |
| | | |
| | | |
| | | self.quanMoney.text = [NSString stringWithFormat:@"%@",model.discount]; |
| | | } |
| | | } |
| | | |
| | | - (void)setViewBorder:(UIView *)view width:(CGFloat)width color:(UIColor *)color { |
| | | view.layer.masksToBounds = YES; |
| | | view.layer.borderWidth = 1; |
| | | view.layer.borderColor = color.CGColor; |
| | | } |
| | | |
| | | - (void)imageButtonTaped:(UIButton *)sender{ |
| | | NSInteger tag = sender.tag - 1234; |
| | | NSLog(@"%@",self.array[tag]); |
| | | // [self.timer setFireDate:[NSDate distantFuture]]; |
| | | //å¯å¨å¾çæµè§å¨ |
| | | HZPhotoBrowser *browser = [[HZPhotoBrowser alloc] init]; |
| | | browser.isFullWidthForLandScape = YES; |
| | | browser.isNeedLandscape = YES; |
| | | browser.sourceImagesContainerView = self; // åå¾çç¶æ§ä»¶ |
| | | browser.currentImageIndex = (int)tag; |
| | | browser.imageArray = self.array; |
| | | browser.imageCount = self.array.count; // å¾çæ»æ° |
| | | browser.delegate = self; |
| | | [browser show]; |
| | | |
| | | } |
| | | - (UIImage *)photoBrowser:(HZPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index |
| | | { |
| | | return [self.subviews[index] currentImage]; |
| | | } |
| | | |
| | | // è¿åé«è´¨éå¾ççurl |
| | | - (NSURL *)photoBrowser:(HZPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index |
| | | { |
| | | NSString *urlStr = [self.array[index] stringByReplacingOccurrencesOfString:@"thumbnail" withString:@"bmiddle"]; |
| | | return [NSURL URLWithString:urlStr]; |
| | | } |
| | | - (void)photoBrowser:(HZPhotoBrowser *)browser hideImages:(NSInteger)index{ |
| | | if (self.indexPage != index) { |
| | | if (index >= self.array.count) { |
| | | index = self.array.count - 1; |
| | | } |
| | | self.indexPage = (int)index; |
| | | |
| | | [self.scrollView setContentOffset:CGPointMake(self.frame.size.width * index, 0) animated:NO]; |
| | | } |
| | | |
| | | // [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(timerarter) object:nil]; |
| | | // [self performSelector:@selector(timerarter) withObject:nil afterDelay:4]; |
| | | } |
| | | |
| | | - (void)timerarter{ |
| | | // [self.timer setFireDate:[NSDate distantPast]]; |
| | | |
| | | } |
| | | //æ»å¨å°ä¸ä¸é¡µï¼è½®æã |
| | | -(void)nextPage{ |
| | | |
| | | if ((self.scrollView.contentOffset.x / SCREEN_WIDTH) < self.array.count - 1) { |
| | | self.indexPage ++; |
| | | [self.scrollView setContentOffset:CGPointMake(self.frame.size.width * self.indexPage, 0) animated:YES]; |
| | | |
| | | } else { |
| | | self.indexPage = 0; |
| | | [self.scrollView setContentOffset:CGPointMake(0, 0) animated:NO]; |
| | | } |
| | | } |
| | | |
| | | - (void)quanTaped:(UIButton *)sender{ |
| | | if (_delegate && [_delegate respondsToSelector:@selector(useQuanClicked:)]) { |
| | | [_delegate useQuanClicked:self]; |
| | | } |
| | | } |
| | | |
| | | #pragma mark - UIScrollViewDelegate |
| | | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { |
| | | NSInteger page = scrollView.contentOffset.x / SCREEN_WIDTH; |
| | | self.indexPage = (int)page; |
| | | self.digitalLabel.text = [NSString stringWithFormat:@"%ld/%lu",page + 1 ,(unsigned long)self.array.count]; |
| | | } |
| | | #pragma mark - getter |
| | | - (UIScrollView *)scrollView { |
| | | if (_scrollView) { |
| | | return _scrollView; |
| | | } |
| | | //å
³æè¹æçéè§æºå¶ |
| | | // self.automaticallyAdjustsScrollViewInsets = NO; |
| | | //åå§åæ»å¨è§å¾ |
| | | _scrollView = [[UIScrollView alloc]init]; |
| | | _scrollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_WIDTH); |
| | | // _scrollView.center = self.view.center; |
| | | _scrollView.backgroundColor = [UIColor whiteColor]; |
| | | //设置å
容页çå¤§å° |
| | | |
| | | // _scrollView.contentSize = CGSizeMake(SCREEN_WIDTH * 6, 300); |
| | | //å页æ¾ç¤º |
| | | _scrollView.pagingEnabled = YES; |
| | | //éèæ°´å¹³æ»å¨æ¡ |
| | | _scrollView.showsHorizontalScrollIndicator = YES; |
| | | //éèåç´æ»å¨æ¡ |
| | | _scrollView.showsHorizontalScrollIndicator = YES; |
| | | _scrollView.delegate = self; |
| | | return _scrollView; |
| | | } |
| | | |
| | | - (BOOL)canBecomeFirstResponder{ |
| | | return YES; |
| | | } |
| | | // å¤çé¿æäºä»¶ |
| | | - (void)longPre:(UILongPressGestureRecognizer *)recognizer { |
| | | [self.commonMethodManage setPasteboardContent:_model.title title:@"æ é¢å¤å¶æå"]; |
| | | } |
| | | |
| | | - (UILabel *)digitalLabel{ |
| | | if (_digitalLabel) { |
| | | return _digitalLabel; |
| | | } |
| | | _digitalLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.scrollView.frame) - LEAVENOTE - 42, self.scrollView.frame.size.height - 27 - LEAVENOTE, 42, 27)]; |
| | | _digitalLabel.backgroundColor = SJColor(0, 0, 0, 0.5); |
| | | _digitalLabel.textColor = [UIColor whiteColor]; |
| | | _digitalLabel.textAlignment = NSTextAlignmentCenter; |
| | | _digitalLabel.font = [UIFont boldSystemFontOfSize:13]; |
| | | _digitalLabel.layer.cornerRadius = _digitalLabel.frame.size.height / 2; |
| | | _digitalLabel.layer.masksToBounds = YES; |
| | | return _digitalLabel; |
| | | } |
| | | - (UIImageView *)labelImage { |
| | | if (_labelImage) { |
| | | return _labelImage; |
| | | } |
| | | _labelImage = [[UIImageView alloc] init]; |
| | | _labelImage.image = [UIImage imageNamed:@"æ·å®"]; |
| | | return _labelImage; |
| | | } |
| | | - (UILabel *)titleLabel{ |
| | | if (_titleLabel) { |
| | | return _titleLabel; |
| | | } |
| | | _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMinX(self.labelImage.frame), SCREEN_WIDTH - 10, 35)]; |
| | | _titleLabel.font = [UIFont systemFontOfSize:15]; |
| | | _titleLabel.numberOfLines = 0; |
| | | _titleLabel.textAlignment = NSTextAlignmentLeft; |
| | | _titleLabel.textColor = SJColor(0, 0, 0, 1); |
| | | _titleLabel.userInteractionEnabled = YES; |
| | | _titleLabel.lineBreakMode = NSLineBreakByCharWrapping; |
| | | UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPre:)]; |
| | | [_titleLabel addGestureRecognizer:longPress]; |
| | | return _titleLabel; |
| | | } |
| | | |
| | | - (UILabel *)priceLabel { |
| | | if (_priceLabel) { |
| | | return _priceLabel; |
| | | } |
| | | _priceLabel = [[UILabel alloc] init]; |
| | | _priceLabel.textColor = UIColorFromRGBValue(0x888888); |
| | | _priceLabel.font = [UIFont systemFontOfSize:13]; |
| | | _priceLabel.textAlignment = NSTextAlignmentLeft; |
| | | return _priceLabel; |
| | | } |
| | | |
| | | - (UILabel *)salesLabel { |
| | | if (_salesLabel) { |
| | | return _salesLabel; |
| | | } |
| | | _salesLabel = [[UILabel alloc] init]; |
| | | _salesLabel.textColor = UIColorFromRGBValue(0x888888); |
| | | _salesLabel.textAlignment = NSTextAlignmentRight; |
| | | _salesLabel.font = [UIFont systemFontOfSize:13]; |
| | | return _salesLabel; |
| | | } |
| | | - (UILabel *)coupLabel { |
| | | if (_coupLabel) { |
| | | return _coupLabel; |
| | | } |
| | | _coupLabel = [[UILabel alloc] init]; |
| | | _coupLabel.textColor = UIColorFromRGBValue(0xE5005C); |
| | | _coupLabel.text = @"æåä»·"; |
| | | _coupLabel.textAlignment = NSTextAlignmentLeft; |
| | | _coupLabel.font = [UIFont systemFontOfSize:12]; |
| | | return _coupLabel; |
| | | } |
| | | |
| | | - (UILabel *)qianFuHaoLabel { |
| | | if (!_qianFuHaoLabel) { |
| | | _qianFuHaoLabel = [[UILabel alloc] init]; |
| | | _qianFuHaoLabel.text = @"Â¥"; |
| | | _qianFuHaoLabel.textColor = XYRMainColor; |
| | | _qianFuHaoLabel.font = [UIFont boldSystemFontOfSize:12]; |
| | | _qianFuHaoLabel.textAlignment = NSTextAlignmentLeft; |
| | | } |
| | | return _qianFuHaoLabel; |
| | | } |
| | | |
| | | - (UILabel *)discountLabel{ |
| | | if (_discountLabel) { |
| | | return _discountLabel; |
| | | } |
| | | _discountLabel = [[UILabel alloc] init]; |
| | | _discountLabel.textColor = XYRMainColor; |
| | | _discountLabel.font = [UIFont boldSystemFontOfSize:23]; |
| | | _discountLabel.textAlignment = NSTextAlignmentLeft; |
| | | return _discountLabel; |
| | | } |
| | | |
| | | - (UILabel *)fanLabel{ |
| | | if (_fanLabel) { |
| | | return _fanLabel; |
| | | } |
| | | _fanLabel = [[UILabel alloc] init]; |
| | | _fanLabel.textColor = UIColorFromRGBValue(0xE5005C); |
| | | _fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE7F1); |
| | | _fanLabel.font = [UIFont systemFontOfSize:12]; |
| | | _fanLabel.textAlignment = NSTextAlignmentCenter; |
| | | return _fanLabel; |
| | | } |
| | | |
| | | - (UILabel *)gongyiLabel { |
| | | if (_gongyiLabel) { |
| | | return _gongyiLabel; |
| | | } |
| | | _gongyiLabel = [[UILabel alloc] init]; |
| | | _gongyiLabel.textColor = UIColorFromRGBValue(0xFE0014); |
| | | _gongyiLabel.font = [UIFont systemFontOfSize:9]; |
| | | _gongyiLabel.textAlignment = NSTextAlignmentCenter; |
| | | return _gongyiLabel; |
| | | } |
| | | |
| | | - (UILabel *)baokuanLabel { |
| | | if (_baokuanLabel) { |
| | | return _baokuanLabel; |
| | | } |
| | | _baokuanLabel = [[UILabel alloc] init]; |
| | | _baokuanLabel.textColor = UIColorFromRGBValue(0xFF9600); |
| | | _baokuanLabel.font = [UIFont systemFontOfSize:9]; |
| | | _baokuanLabel.textAlignment = NSTextAlignmentCenter; |
| | | return _baokuanLabel; |
| | | } |
| | | |
| | | - (UIImageView *)couponImage { |
| | | if (_couponImage) { |
| | | return _couponImage; |
| | | } |
| | | [self. priceLabel updateLayout]; |
| | | _couponImage = [[UIImageView alloc]initWithFrame:CGRectMake(14 , CGRectGetMaxY(self.scrollView.frame) + 140, SCREEN_WIDTH - 14 * 2 , 64)]; |
| | | _couponImage.image = [UIImage imageNamed:@"guodu_å¸"]; |
| | | return _couponImage; |
| | | } |
| | | |
| | | - (UILabel *)quanMoney { |
| | | if (_quanMoney) { |
| | | return _quanMoney; |
| | | } |
| | | NSInteger width = 0; |
| | | if (SCREEN_WIDTH > 375) { |
| | | width = 13; |
| | | }else if (SCREEN_WIDTH == 375){ |
| | | width = 10; |
| | | }else{ |
| | | width = 8; |
| | | } |
| | | _quanMoney = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(self.couponImage.frame) + width, CGRectGetMinY(self.couponImage.frame) + 15, self.couponImage.frame.size.width / 5 * 3, 26)]; |
| | | _quanMoney.font = [UIFont boldSystemFontOfSize:25]; |
| | | _quanMoney.textAlignment = NSTextAlignmentCenter; |
| | | _quanMoney.textColor = [UIColor whiteColor]; |
| | | return _quanMoney; |
| | | } |
| | | |
| | | - (UIButton *)quanButton { |
| | | if (_quanButton) { |
| | | return _quanButton; |
| | | } |
| | | _quanButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | |
| | | [_quanButton setTitle:@"ç«å³é¢å" forState:UIControlStateNormal]; |
| | | |
| | | _quanButton .frame = CGRectMake(CGRectGetMaxX(self.quanMoney.frame), CGRectGetMinY(self.couponImage.frame), self.couponImage.frame.size.width / 5 * 2, self.couponImage.frame.size.height); |
| | | _quanButton.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20); |
| | | _quanButton.titleLabel.font = [UIFont boldSystemFontOfSize:15]; |
| | | [_quanButton addTarget:self action:@selector(quanTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | return _quanButton; |
| | | } |
| | | - (UIImageView *)defaultImageView{ |
| | | if (_defaultImageView) { |
| | | return _defaultImageView; |
| | | } |
| | | _defaultImageView = [[UIImageView alloc]initWithFrame:self.scrollView.frame]; |
| | | _defaultImageView.image = [UIImage imageNamed:@"没æåå"]; |
| | | _defaultImageView.backgroundColor = [UIColor whiteColor]; |
| | | _defaultImageView.hidden = YES; |
| | | return _defaultImageView; |
| | | } |
| | | |
| | | - (ALButton *)buttonSearch { |
| | | if (!_buttonSearch) { |
| | | _buttonSearch = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | _buttonSearch.frame = CGRectMake(0, 0, (SCREEN_WIDTH - 28) / 2, 30); |
| | | [_buttonSearch setImage:ALIMAGE_NAMED(@"goodsDetail_search") forState:UIControlStateNormal]; |
| | | _buttonSearch.titleLabel.font = [UIFont systemFontOfSize:(SCREEN_WIDTH < 375)?12:14]; |
| | | [_buttonSearch setTitle:@" ç¸ä¼¼åå" forState:UIControlStateNormal]; |
| | | [_buttonSearch setTitleColor:UIColorFromRGBValue(0xE5005C) forState:UIControlStateNormal]; |
| | | [_buttonSearch addTarget:self action:@selector(onTouchSearchLike:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _buttonSearch; |
| | | } |
| | | |
| | | - (ALButton *)buttonHairCircle { |
| | | if (_buttonHairCircle) { |
| | | return _buttonHairCircle; |
| | | } |
| | | _buttonHairCircle = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | _buttonHairCircle.frame = CGRectMake(0, 0, (SCREEN_WIDTH - 28) / 2, 30); |
| | | [_buttonHairCircle setTitleColor:UIColorFromRGBValue(0xE5005C) forState:UIControlStateNormal]; |
| | | [_buttonHairCircle setImage:[UIImage imageNamed:@"icon_goodsDetail_hairCircle"] forState:UIControlStateNormal]; |
| | | [_buttonHairCircle setTitle:@" ä¸é®åå" forState:UIControlStateNormal]; |
| | | _buttonHairCircle.titleLabel.font = [UIFont systemFontOfSize:14]; |
| | | return _buttonHairCircle; |
| | | } |
| | | |
| | | - (UIView *)viewMaxCoupon |
| | | { |
| | | if (!_viewMaxCoupon) { |
| | | _viewMaxCoupon = [[UIView alloc] init]; |
| | | _viewMaxCoupon.backgroundColor = UICOLOR_FROM_RGB(0xFFF5F9, 1.0); |
| | | _viewMaxCoupon.hidden = YES; |
| | | } |
| | | return _viewMaxCoupon; |
| | | } |
| | | |
| | | - (UILabel *)labelMaxDesc |
| | | { |
| | | if (_labelMaxDesc) { |
| | | return _labelMaxDesc; |
| | | } |
| | | _labelMaxDesc = [[UILabel alloc] init]; |
| | | _labelMaxDesc.font = [UIFont systemFontOfSize:12]; |
| | | _labelMaxDesc.textAlignment = NSTextAlignmentLeft; |
| | | _labelMaxDesc.textColor = XYRMainColor; |
| | | if (SCREEN_WIDTH < 375) { |
| | | _labelMaxDesc.font = [UIFont systemFontOfSize:10]; |
| | | } |
| | | return _labelMaxDesc; |
| | | } |
| | | |
| | | - (UILabel *)LabelFanliMoneyPlus |
| | | { |
| | | if (!_LabelFanliMoneyPlus) { |
| | | _LabelFanliMoneyPlus = [[UILabel alloc] init]; |
| | | _LabelFanliMoneyPlus.font = [UIFont systemFontOfSize:13]; |
| | | _LabelFanliMoneyPlus.textAlignment = NSTextAlignmentLeft; |
| | | _LabelFanliMoneyPlus.textColor = UICOLOR_FROM_RGB(0x888888, 1.0); |
| | | if (SCREEN_WIDTH < 375) { |
| | | _LabelFanliMoneyPlus.font = [UIFont systemFontOfSize:11]; |
| | | } |
| | | } |
| | | return _LabelFanliMoneyPlus; |
| | | } |
| | | |
| | | - (UILabel *)LabelmaxMoneyPlus |
| | | { |
| | | if (!_LabelmaxMoneyPlus) { |
| | | _LabelmaxMoneyPlus = [[UILabel alloc] init]; |
| | | _LabelmaxMoneyPlus.font = [UIFont systemFontOfSize:12]; |
| | | _LabelmaxMoneyPlus.textAlignment = NSTextAlignmentLeft; |
| | | _LabelmaxMoneyPlus.textColor = UICOLOR_FROM_RGB(0x888888, 1.0); |
| | | if (SCREEN_WIDTH < 375) { |
| | | _LabelmaxMoneyPlus.font = [UIFont systemFontOfSize:10]; |
| | | } |
| | | } |
| | | return _LabelmaxMoneyPlus; |
| | | } |
| | | |
| | | - (UILabel *)labelMaxMoney |
| | | { |
| | | if (_labelMaxMoney) { |
| | | return _labelMaxMoney; |
| | | } |
| | | _labelMaxMoney = [[UILabel alloc] init]; |
| | | _labelMaxMoney.font = [UIFont systemFontOfSize:12]; |
| | | _labelMaxMoney.textAlignment = NSTextAlignmentLeft; |
| | | _labelMaxMoney.textColor = UICOLOR_FROM_RGB(0xE5005C, 1.0); |
| | | if (SCREEN_WIDTH < 375) { |
| | | _labelMaxMoney.font = [UIFont systemFontOfSize:10]; |
| | | } |
| | | return _labelMaxMoney; |
| | | } |
| | | |
| | | - (UILabel *)labelShengJi { |
| | | if (_labelShengJi) { |
| | | return _labelShengJi; |
| | | } |
| | | _labelShengJi = [[UILabel alloc] init]; |
| | | _labelShengJi.text = @"ç«å³å级"; |
| | | _labelShengJi.font = [UIFont systemFontOfSize:12]; |
| | | _labelShengJi.textAlignment = NSTextAlignmentRight; |
| | | _labelShengJi.hidden = YES; |
| | | _labelShengJi.textColor = UICOLOR_FROM_RGB(0xE5005C, 1.0); |
| | | if (SCREEN_WIDTH < 375) { |
| | | _labelShengJi.font = [UIFont systemFontOfSize:10]; |
| | | } |
| | | return _labelShengJi; |
| | | } |
| | | |
| | | - (UIImageView *)imageViewsuperMembers { |
| | | if (!_imageViewsuperMembers) { |
| | | _imageViewsuperMembers = [[UIImageView alloc] init]; |
| | | _imageViewsuperMembers.hidden = YES; |
| | | _imageViewsuperMembers.image = ALIMAGE_NAMED(@"goodsdetail_super_members"); |
| | | } |
| | | return _imageViewsuperMembers; |
| | | } |
| | | |
| | | - (UIImageView *)imageViewRightArrow { |
| | | if (!_imageViewRightArrow) { |
| | | _imageViewRightArrow = [[UIImageView alloc] init]; |
| | | _imageViewRightArrow.image = ALIMAGE_NAMED(@"goodsDetail_redRightArrow"); |
| | | } |
| | | return _imageViewRightArrow; |
| | | } |
| | | |
| | | - (ALButton *)buttonFanliBi { |
| | | if (!_buttonFanliBi) { |
| | | _buttonFanliBi = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [_buttonFanliBi setImage:ALIMAGE_NAMED(@"goodsinfo_fanli_?") forState:UIControlStateNormal]; |
| | | [_buttonFanliBi addTarget:self action:@selector(onTouchFanliBi) forControlEvents:UIControlEventTouchUpInside]; |
| | | _buttonFanliBi.hidden = YES; |
| | | } |
| | | return _buttonFanliBi; |
| | | } |
| | | |
| | | - (UILabel *)labelFanliBi { |
| | | if (!_labelFanliBi) { |
| | | _labelFanliBi = [[UILabel alloc] init]; |
| | | _labelFanliBi.hidden = YES; |
| | | _labelFanliBi.font = [UIFont systemFontOfSize:13]; |
| | | _labelFanliBi.textAlignment = NSTextAlignmentRight; |
| | | _labelFanliBi.textColor = UICOLOR_FROM_RGB(0x888888, 1.0); |
| | | if (SCREEN_WIDTH < 375) { |
| | | _labelFanliBi.font = [UIFont systemFontOfSize:11]; |
| | | } |
| | | } |
| | | return _labelFanliBi; |
| | | } |
| | | |
| | | - (UIView *)viewSXLine { |
| | | if (!_viewSXLine) { |
| | | _viewSXLine = [[UIView alloc] init]; |
| | | _viewSXLine.backgroundColor = UICOLOR_FROM_RGB(0xE0E0E0, 1.0); |
| | | } |
| | | return _viewSXLine; |
| | | } |
| | | |
| | | - (CommonMethodManage *)commonMethodManage { |
| | | if (!_commonMethodManage) { |
| | | _commonMethodManage = [[CommonMethodManage alloc] init]; |
| | | } |
| | | return _commonMethodManage; |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WPHTransformView.h |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/29. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @interface WPHTransformView : UIView |
| | | |
| | | @property (nonatomic,strong)UIView *backView; |
| | | @property (nonatomic,strong)UIView *contentView; |
| | | @property (nonatomic,strong)UIImageView * fanImageview; |
| | | @property (nonatomic,strong)UIImageView * taoImageview; |
| | | @property (nonatomic,strong)UIImageView * jiantouImageview; |
| | | @property (nonatomic,strong)UIImageView * topImageView; |
| | | @property (nonatomic,strong)UILabel * titleLabel;//æç¤ºæ é¢ |
| | | @property (nonatomic,strong)UILabel * contentLabel;//æç¤ºå
容 |
| | | @property (nonatomic,assign)CGFloat contentFont; |
| | | - (void)dissMiss; |
| | | - (void)showTransitionView; |
| | | - (void)hiddenTransitionView; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // WPHTransformView.m |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/29. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "WPHTransformView.h" |
| | | #import "UIView+AZGradient.h" |
| | | #import "SJJumpRollView.h" |
| | | |
| | | #define gapLength 50 |
| | | @interface WPHTransformView() |
| | | @property (nonatomic, strong) SJJumpRollView *rollView; |
| | | @end |
| | | |
| | | @implementation WPHTransformView |
| | | |
| | | - (instancetype)initWithFrame:(CGRect)frame { |
| | | self = [super initWithFrame:frame]; |
| | | if (self) { |
| | | self.contentFont = 13; |
| | | if (SCREEN_WIDTH > 375) { |
| | | self.contentFont = 15; |
| | | }else if (SCREEN_WIDTH < 375){ |
| | | self.contentFont = 12; |
| | | } |
| | | |
| | | [self addSubview:self.backView]; |
| | | [self addSubview:self.contentView]; |
| | | |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)dissMiss |
| | | { |
| | | [self removeFromSuperview]; |
| | | } |
| | | - (void)hiddenTransitionView |
| | | { |
| | | [self.rollView hiddenumpRollView]; |
| | | } |
| | | - (void)showTransitionView |
| | | { |
| | | [self.rollView showJumpRollView]; |
| | | } |
| | | #pragma mark - getter |
| | | - (UIView *)backView { |
| | | if (_backView) { |
| | | return _backView; |
| | | } |
| | | _backView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| | | _backView .backgroundColor = SJColor(0, 0, 0, 0.76); |
| | | return _backView; |
| | | } |
| | | - (UIView *)contentView { |
| | | if (_contentView) { |
| | | return _contentView; |
| | | } |
| | | _contentView = [[UIView alloc]initWithFrame:CGRectMake(gapLength, (self.size.height - 200) / 2, SCREEN_WIDTH - gapLength * 2, 221 * ((SCREEN_WIDTH - gapLength * 2) / 500) * 1.81)]; |
| | | _contentView.backgroundColor = [UIColor whiteColor]; |
| | | CGFloat cornerRadius = 16; |
| | | if (SCREEN_WIDTH > 375) { |
| | | cornerRadius = 19; |
| | | } |
| | | _contentView.layer.cornerRadius = cornerRadius; |
| | | _contentView.layer.masksToBounds = YES; |
| | | [_contentView addSubview:self.topImageView]; |
| | | [_contentView addSubview:self.rollView]; |
| | | [_contentView addSubview:self.titleLabel]; |
| | | [_contentView addSubview:self.contentLabel]; |
| | | return _contentView; |
| | | } |
| | | - (UIImageView *)fanImageview{ |
| | | if (_fanImageview) { |
| | | return _fanImageview; |
| | | } |
| | | _fanImageview = [[UIImageView alloc]initWithFrame:CGRectMake(45, 55, 60, 60)]; |
| | | _fanImageview.image = [UIImage imageNamed:@"详æ
ââæ¿æ å¿«ç"]; |
| | | return _fanImageview; |
| | | } |
| | | |
| | | - (UIImageView *)jiantouImageview{ |
| | | if (_jiantouImageview) { |
| | | return _jiantouImageview; |
| | | } |
| | | // |
| | | _jiantouImageview = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.fanImageview.frame) + 15, CGRectGetMinY(self.fanImageview.frame) + self.fanImageview.frame.size.height / 2 - 6.5, _contentView.frame.size.width - 240, 13)]; |
| | | _jiantouImageview.image = [UIImage imageNamed:@"详æ
ââç®å¤´"]; |
| | | return _jiantouImageview; |
| | | } |
| | | |
| | | //jump_img 500 * 221 |
| | | - (UIImageView *)topImageView { |
| | | if (_topImageView) { |
| | | return _topImageView; |
| | | } |
| | | _topImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, _contentView.frame.size.width, 221 * (_contentView.frame.size.width / 500))]; |
| | | _topImageView.image = [UIImage imageNamed:@"jump_img_wph"]; |
| | | return _topImageView; |
| | | } |
| | | - (UILabel *)titleLabel { |
| | | if (_titleLabel) { |
| | | return _titleLabel; |
| | | } |
| | | CGFloat height = 30; |
| | | if (SCREEN_WIDTH < 375) { |
| | | height = 25; |
| | | }else if(SCREEN_WIDTH > 375){ |
| | | height = 35; |
| | | } |
| | | _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.topImageView.frame) + height, _contentView.frame.size.width, 15)]; |
| | | _titleLabel.text = @"å
è´¹é¢å¸"; |
| | | _titleLabel.textColor = XYRMainColor; |
| | | _titleLabel.font = [UIFont boldSystemFontOfSize:_contentFont + 2]; |
| | | _titleLabel.textAlignment = NSTextAlignmentCenter; |
| | | return _titleLabel; |
| | | } |
| | | - (UILabel *)contentLabel { |
| | | if (_contentLabel) { |
| | | return _contentLabel; |
| | | } |
| | | _contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.titleLabel.frame) + 8, _contentView.frame.size.width, _contentFont)]; |
| | | _contentLabel.text = @"è´ä¹°åæè¿å©ï¼å享åæå¥é"; |
| | | _contentLabel.textColor = SJColor(1, 1, 1, 1); |
| | | _contentLabel.font = [UIFont systemFontOfSize:_contentFont]; |
| | | _contentLabel.textAlignment = NSTextAlignmentCenter; |
| | | return _contentLabel; |
| | | } |
| | | - (SJJumpRollView *)rollView { |
| | | if (_rollView) { |
| | | return _rollView; |
| | | } |
| | | _rollView = [[SJJumpRollView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.topImageView.frame), _contentView.frame.size.width, 10)]; |
| | | return _rollView; |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WPHGoodsDetailController.h |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "BaseViewController.h" |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @interface WPHGoodsDetailController : BaseViewController |
| | | /// ååID |
| | | @property (nonatomic, copy) NSString *goodsID; |
| | | /// æ¥æº |
| | | @property (nonatomic, strong) NSString *from; |
| | | /// å¹³å° |
| | | @property (nonatomic, assign) NSInteger goodsType; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // WPHGoodsDetailController.m |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "WPHGoodsDetailController.h" |
| | | #import "NewGoodsShareController.h" |
| | | #import "FootprintsViewController.h" |
| | | #import "SJSharedTableViewCell.h" |
| | | #import "shoppingCartViewController.h" |
| | | #import "MyRidiculeController.h" |
| | | #import "GraphicDetailsController.h" |
| | | #import "SearchDetailMainController.h" |
| | | // Views |
| | | #import "ButtomCarView.h" |
| | | #import "GoosStoreInfoView.h" |
| | | #import "GDetailView.h" |
| | | #import "SJShopScrollView.h" |
| | | #import "DetailWKWebview.h" |
| | | #import "GoodsDetailPopWinView.h" |
| | | #import "JDNOFanLiButtonView.h" |
| | | #import "WebLoadProgressView.h" |
| | | #import "WPHTransformView.h" |
| | | // Cells |
| | | #import "WPHGoodsdetailInfoCell.h" |
| | | #import "GDDetailTableViewCell.h" |
| | | #import "GDrecomeTableViewCell.h" |
| | | #import "NoShopTableViewCell.h" |
| | | // Tools |
| | | #import <JDSDK/JDKeplerSDK.h> |
| | | #import "NSString+AES256.h" |
| | | #import "UIImageView+WebCache.h" |
| | | #import "XHWebImageAutoSize.h" |
| | | #import <WebKit/WebKit.h> |
| | | #import <ShareSDK/ShareSDK.h> |
| | | #import <ShareSDKUI/ShareSDK+SSUI.h> |
| | | |
| | | @interface WPHGoodsDetailController ()<UITableViewDelegate, UITableViewDataSource, |
| | | WPHGoodsdetailInfoCellDelegate, GDetailViewDelegate, ButtomCarViewDelegate, |
| | | GDrecomeTableViewCellDelegate, NewLoginViewDelegate,WKNavigationDelegate,WKUIDelegate, UIWebViewDelegate,SJRollingViewDelegate, InviteCodeControllerDelegate> |
| | | { |
| | | CGFloat contentOffsetY; |
| | | CGFloat oldContentOffsetY; |
| | | CGFloat newContentOffsetY; |
| | | BOOL isShowdetail; |
| | | } |
| | | @property (nonatomic, strong) GDetailView *topView; |
| | | @property (nonatomic, strong) ButtomCarView *buttomView; |
| | | @property (nonatomic, nullable, strong) JDNOFanLiButtonView *noFanLiButtomView; |
| | | @property (nonatomic, strong) WKWebView *detailWebView; |
| | | @property (nonatomic, assign) CGFloat webHeight; |
| | | @property (nonatomic, strong) NSString *detailUrlString; |
| | | @property (nonatomic, strong) WPHTransformView *transitionView; |
| | | @property (nonatomic, strong) UITableView *detailTableview; |
| | | @property (nonatomic, strong) UIButton * backButton; |
| | | @property (nonatomic, strong) UIButton * moreShareButton; |
| | | @property (nonatomic, strong) UIButton * blockBackButton; |
| | | @property (nonatomic, nullable, strong) GoodsDetailBaseModel *goodsModel; |
| | | @property (nonatomic, nullable, strong) NSDictionary *extraDictionary; |
| | | /// æ¯å¦æè¿å© |
| | | @property (nonatomic, assign) BOOL fanliValid; |
| | | /// æ¯å¦æå享 |
| | | @property (nonatomic, assign) BOOL shareValid; |
| | | |
| | | @property (nonatomic, strong) NSMutableArray *recommendArray; |
| | | @property (nonatomic, strong) NSMutableArray *likeArray; |
| | | |
| | | @property (nonatomic, assign) BOOL isClicked; |
| | | @property (nonatomic, strong) SJAliBaicun *alibaichuan; |
| | | @property (nonatomic, assign) NSInteger value; |
| | | @property (nonatomic, assign) NSInteger code; |
| | | @property (nonatomic, assign) BOOL native; |
| | | @property (nonatomic, assign) BOOL isNative; |
| | | @property (nonatomic, assign) CGFloat tableviewHeight; |
| | | |
| | | @property (nonatomic, assign) CGFloat tempWebHeight; |
| | | |
| | | @property (nonatomic,strong)NSString *shoppingUrl; |
| | | /// 4 æ£å¸¸ 1 æ 忬¢ãæ¨è 2 æ æ¨è 3 æ 忬¢ |
| | | @property (nonatomic,assign)NSInteger shopDetailType; |
| | | /// æ¯å¦éè¦å è½½è¿åº¦æ¡ |
| | | @property (nonatomic, assign) BOOL isProgressHud; |
| | | /// æ ¹æ®boolå¼å¤ææ¯å¦æ¶è |
| | | @property (nonatomic, assign) BOOL isCollection; |
| | | @property (nonatomic, assign) BOOL isCollectionBack; |
| | | /// æ¯å¦ç¹å»ç»éï¼ç¶æ ç»éææ²¡æå |
| | | @property (nonatomic, assign) NSInteger clickLoginStates; |
| | | /// å¯¼èªæ çä¸çç°çº¿ |
| | | //@property (nonatomic, strong) UIView *navGaryLine; |
| | | |
| | | //@property (nonatomic,strong) UIButton *ProLibraryBtn;//éååº |
| | | @property (nonatomic, strong) SJNoNetwork *noNetworkViews; |
| | | /// æªè¿æ¥ç½ç» |
| | | @property (nonatomic, assign) NSInteger netWorkCode; |
| | | |
| | | @property (nonatomic, assign) BOOL isRolling; |
| | | |
| | | @property (nonatomic, strong) SJShopScrollView *shopScrollView; |
| | | @property (nonatomic, strong) NSArray *shareUsersArray; |
| | | |
| | | @property (nonatomic, strong) SJSharedTableViewCell *shopview; |
| | | @property (nonatomic, strong) GDrecomeTableViewCell *likeCell; |
| | | @property (nonatomic, strong) GDrecomeTableViewCell *recomeCell; |
| | | ///补贴view |
| | | @property (nonatomic, nullable, strong) UILabel *labelSubsidy; |
| | | ///ä¸è§ç¬¦å· |
| | | @property (nonatomic, nullable, strong) UIImageView *imageViewSJ; |
| | | |
| | | @property (nonatomic, assign) BOOL storageState; |
| | | |
| | | /// æ·å®èçH5æ°æ® (authLink-æ·å®ææé¾æ¥,orderJS-ç¬å订åå è½½çjs代ç ï¼AESå å¯è¿çï¼,orderUrl-ç¬å订åå è½½ç龿¥) |
| | | @property (nonatomic, nullable, strong) NSDictionary *taoBaoAuthInfoDic; |
| | | /// å è½½çjsstring |
| | | @property (nonatomic, nullable, copy) NSString *jsString; |
| | | /// æ¥æºï¼share/zigouï¼ï¼ |
| | | @property (nonatomic, nullable, copy) NSString *source; |
| | | /// ç¬åå è½½çwebview |
| | | @property (nonatomic, strong) UIWebView *linkWebView; |
| | | |
| | | @property (nonatomic,assign)NSInteger type; |
| | | |
| | | @property (nonatomic, nullable, strong) GoodsDetailPopWinView *goodsDetailPopWinView; |
| | | /// æ°ææ»ç¥ |
| | | @property (nonatomic, copy) NSString *weex_file_newer; |
| | | |
| | | @property (nonatomic, nullable, strong) BaseTipArrPopView *baseTipArrPopView; |
| | | @property (nonatomic, nullable, strong) BaseTipsPopView *baseTipsPopView; |
| | | |
| | | @property (nonatomic, nullable, strong) UIScrollView *contentScrollView; |
| | | |
| | | /// å°é»æ¡ |
| | | @property (nonatomic, strong) SJRollingView *currentRollingView; |
| | | |
| | | @property (nonatomic, nullable, copy ) NSString *authLink; |
| | | @property (nonatomic, nullable, copy ) NSString *couponJumpLink; |
| | | @property (nonatomic, nullable, copy ) NSString *nativeCouponJumpLink; |
| | | @property (nonatomic, nullable, copy ) NSString *nativeJumpLink; |
| | | |
| | | @property (nonatomic, nullable, strong) WebLoadProgressView *webLoadProgressView; |
| | | @property (nonatomic, strong) NSTimer *webTimerDis; |
| | | |
| | | @property (nonatomic, assign) CGFloat lastContentOffest; |
| | | /// æ¯å¦ç¦»å¼è¿å½åè§å¾ |
| | | @property (nonatomic, assign) BOOL isLeavedNowView; |
| | | |
| | | @property (nonatomic, nullable, strong) FetchGoldcoinPopView *fetchGoldcoinPopView; |
| | | |
| | | @property (nonatomic, strong) UIView *backView; |
| | | |
| | | @property (nonatomic, strong) dispatch_source_t timers; |
| | | |
| | | @end |
| | | |
| | | @implementation WPHGoodsDetailController |
| | | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | |
| | | self.navigationController.navigationBar.translucent = NO; |
| | | self.isLeavedNowView = NO; |
| | | |
| | | self.title = @"åå详æ
"; |
| | | [self fetchWeexFileNewer]; |
| | | |
| | | if (self.dataDictionary[@"paramsJSON"]) { |
| | | if (self.dataDictionary[@"paramsJSON"][@"id"]) { |
| | | self.goodsID = self.dataDictionary[@"paramsJSON"][@"id"]; |
| | | } |
| | | if (self.dataDictionary[@"paramsJSON"][@"from"]) { |
| | | self.from = self.dataDictionary[@"paramsJSON"][@"from"]; |
| | | } |
| | | if (self.dataDictionary[@"paramsJSON"][@"goodsType"]) { |
| | | self.goodsType = self.goodsType = [self.dataDictionary[@"goodsType"] integerValue]; |
| | | } |
| | | } |
| | | |
| | | if (self.dataDictionary) { |
| | | if (self.dataDictionary[@"id"]) { |
| | | self.goodsID = self.dataDictionary[@"id"]; |
| | | } |
| | | if (self.dataDictionary[@"from"]) { |
| | | self.from = self.dataDictionary[@"from"]; |
| | | } |
| | | |
| | | if (self.dataDictionary[@"goodsType"]) { |
| | | self.goodsType = [self.dataDictionary[@"goodsType"] integerValue]; |
| | | } |
| | | } |
| | | if (self.goodsType == 0) { |
| | | self.goodsType = 4; |
| | | } |
| | | |
| | | [UMCustomShop umDetailPDDEnter:self.from]; |
| | | |
| | | self.webHeight = 0.0; |
| | | self.navigationController.navigationBar.titleTextAttributes = |
| | | @{NSForegroundColorAttributeName:FLQNewNavigationTitleColor, |
| | | NSFontAttributeName:[UIFont boldSystemFontOfSize:FLQNewNavigationTitleFont]}; |
| | | |
| | | isShowdetail = YES; |
| | | |
| | | self.view.backgroundColor = XYRBackgroundColor; |
| | | |
| | | self.hidesBottomBarWhenPushed = YES; |
| | | |
| | | self.clickLoginStates = 0; |
| | | self.isProgressHud = YES; |
| | | |
| | | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(EnterForeground:) name:@"isEnterForeground" object:nil]; |
| | | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(EnterBackground:) name:@"isEnterBackground" object:nil]; |
| | | |
| | | [self initializeInterface]; |
| | | [self getOrderParseConfig]; |
| | | // å¦éèåºé¨è§å¾ |
| | | [self isHideBottomView]; |
| | | |
| | | [self isCanFetchGoldCofin];// 宿¶å¨è·åæ¯å¦è¦éå¸ |
| | | } |
| | | |
| | | - (void)isCanFetchGoldCofin |
| | | { |
| | | __block NSInteger times = 0; |
| | | @weakify(self) |
| | | dispatchTimer(self, 1.0, ^(dispatch_source_t _Nonnull timer) { |
| | | @strongify(self) |
| | | self.timers = timer; |
| | | times++; |
| | | if (times >= 10 && self.lastContentOffest > 0 && !self.isLeavedNowView) { |
| | | [self fetchBrowseGoldCofin]; |
| | | dispatch_source_cancel(timer); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | - (void)fetchBrowseGoldCofin |
| | | { |
| | | if (![ALUserInfoServiceManger fetchUID] || self.code == 2) { |
| | | return; |
| | | } |
| | | NSDictionary *tempDictionary = @{@"goodsId":self.goodsID,@"goodsType":[NSString stringWithFormat:@"%ld",(long)self.goodsType]}; |
| | | NSString *paramsStr = [NSString jsonStringWithDictionary:tempDictionary]; |
| | | NSDictionary *params = @{@"uid":[ALUserInfoServiceManger fetchUID],@"event":@"scanGoods",@"data":paramsStr}; |
| | | @weakify(self) |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"integral/pushEvent"] param:params success:^(NSDictionary *object) |
| | | { |
| | | @strongify(self) |
| | | if ([object[@"code"] integerValue] == 0) { |
| | | if (!self.isLeavedNowView) { |
| | | [self.fetchGoldcoinPopView show:object[@"data"][@"notify"]]; |
| | | } |
| | | } |
| | | |
| | | } fail:^(id object) {}]; |
| | | } |
| | | |
| | | /** |
| | | *æ¯å¦éèåºé¨è§å¾ |
| | | */ |
| | | - (void)isHideBottomView { |
| | | if (self.from && [self.from isEqualToString:@"miandan"]) { |
| | | self.buttomView.from = self.from; |
| | | } |
| | | } |
| | | |
| | | #pragma mark --- è·åæ°ææ»ç¥ --- |
| | | /** |
| | | * |
| | | * è·åæ°ææ»ç¥ |
| | | * |
| | | */ |
| | | - (void)fetchWeexFileNewer |
| | | { |
| | | NSArray *tempArr = [self fetchMainUrlArray]; |
| | | for (NSDictionary *dic in tempArr) { |
| | | if ([dic[@"key"] isEqualToString:@"weex_file_newer"]) { |
| | | self.weex_file_newer = dic[@"value"]; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | - (NSArray *)fetchMainUrlArray |
| | | { |
| | | return [[[NSUserDefaults standardUserDefaults] objectForKey:@"MainUrlArray"] objectForKey:@"info"]; |
| | | } |
| | | |
| | | - (void)getAppPageNotificationWithType:(NSString *)type |
| | | { |
| | | NSDictionary *dic = @{@"type":type}; |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"help/getAppPageNotification"] param:dic success:^(NSDictionary *object) { |
| | | @strongify(self) |
| | | |
| | | if ([object[@"code"]integerValue] == 0 && object[@"code"] != nil) { |
| | | NSDictionary *dic = object[@"data"]; |
| | | BOOL bor = [[NSUserDefaults standardUserDefaults]boolForKey:dic[@"md5"]]; |
| | | if (!bor) { |
| | | self.currentRollingView.dataSource = dic; |
| | | self.isRolling = YES; |
| | | self.currentRollingView.hidden = NO; |
| | | self.shopScrollView.frame = CGRectMake(10, kNavigationBarH + kStatusBarH + RollingViewHeight + 16, SCREEN_WIDTH * 0.75, 30); |
| | | } |
| | | } |
| | | } fail:^(id object) { |
| | | |
| | | }]; |
| | | } |
| | | |
| | | #pragma mark - SJRollingViewDelegate |
| | | - (void)closeRolling:(SJRollingView *)RollingView |
| | | { |
| | | self.currentRollingView.hidden = YES; |
| | | self.shopScrollView.frame = CGRectMake(10, CGRectGetMaxY(self.topView.frame) + 16, SCREEN_WIDTH * 0.75, 30); |
| | | } |
| | | |
| | | - (void)addNetWorkNotice |
| | | { |
| | | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(NetWorkStatesChange:) name:@"netWorkChangeEventNotification" object:nil]; |
| | | AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; |
| | | if (delegate.netWorkStatesCode == AFNetworkReachabilityStatusNotReachable) { |
| | | NSNotification * notice = [NSNotification notificationWithName:@"statesCode" object:@(delegate.netWorkStatesCode) userInfo:nil]; |
| | | [self NetWorkStatesChange:notice]; |
| | | |
| | | } else if (delegate.netWorkStatesCode == AFNetworkReachabilityStatusReachableViaWiFi){ |
| | | NSNotification * notice = [NSNotification notificationWithName:@"statesCode" object:@(delegate.netWorkStatesCode) userInfo:nil]; |
| | | [self NetWorkStatesChange:notice]; |
| | | |
| | | } else if (delegate.netWorkStatesCode == AFNetworkReachabilityStatusReachableViaWWAN) { |
| | | NSNotification * notice = [NSNotification notificationWithName:@"statesCode" object:@(delegate.netWorkStatesCode) userInfo:nil]; |
| | | [self NetWorkStatesChange:notice]; |
| | | |
| | | } else { |
| | | NSNotification * notice = [NSNotification notificationWithName:@"statesCode" object:@(delegate.netWorkStatesCode) userInfo:nil]; |
| | | [self NetWorkStatesChange:notice]; |
| | | } |
| | | } |
| | | |
| | | - (void)NetWorkStatesChange:(NSNotification *)sender { |
| | | int networkState = [[sender object] intValue]; |
| | | |
| | | self.netWorkCode = networkState; |
| | | |
| | | switch (networkState) { |
| | | |
| | | case -1: { |
| | | |
| | | if (!self.goodsModel) { |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | | [self.noNetworkViews.iconImage setImage:ALIMAGE_NAMED(@"defaultPage_noNetWork")]; |
| | | self.noNetworkViews.hidden = NO; |
| | | |
| | | } else { |
| | | self.noNetworkViews.hidden = YES; |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | } |
| | | |
| | | break; |
| | | } |
| | | case 0: { // 没æç½ç» |
| | | |
| | | if (!self.goodsModel) { |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | | [self.noNetworkViews.iconImage setImage:ALIMAGE_NAMED(@"defaultPage_noNetWork")]; |
| | | self.noNetworkViews.hidden = NO; |
| | | |
| | | } else { |
| | | self.noNetworkViews.hidden = YES; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | case 1: { // 3Gæè
4Gï¼åæ£ç¨çæ¯æµé |
| | | |
| | | self.noNetworkViews.hidden = YES; |
| | | if (!self.goodsModel) { |
| | | [self getgoodsinfo]; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | case 2: { // WIFIç½ç» |
| | | |
| | | self.noNetworkViews.hidden = YES; |
| | | if (!self.goodsModel) { |
| | | [self getgoodsinfo]; |
| | | } |
| | | break; |
| | | } |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | - (void)viewWillAppear:(BOOL)animated |
| | | { |
| | | [super viewWillAppear:animated]; |
| | | [self.navigationController setNavigationBarHidden:YES animated:animated]; |
| | | [YTHsharedManger startManger].isEnterForeground = NO; |
| | | [self.shopScrollView showTimer]; |
| | | } |
| | | |
| | | - (void)viewWillDisappear:(BOOL)animated |
| | | { |
| | | [super viewWillDisappear:animated]; |
| | | [self.navigationController setNavigationBarHidden:NO animated:NO]; |
| | | [self.goodsDetailPopWinView dismiss]; |
| | | self.isProgressHud = NO; |
| | | [self hideTransitionView]; |
| | | self.isLeavedNowView = YES; |
| | | dispatch_source_cancel(self.timers); |
| | | [self.shopScrollView stopTimer]; |
| | | } |
| | | |
| | | - (void)EnterBackground:(NSNotification *)notice |
| | | { |
| | | self.isLeavedNowView = YES; |
| | | dispatch_source_cancel(self.timers); |
| | | } |
| | | |
| | | - (void)hideTransitionView |
| | | { |
| | | self.transitionView.hidden = YES; |
| | | [self.transitionView hiddenTransitionView]; |
| | | } |
| | | |
| | | - (void)initializeInterface { |
| | | [self.view addSubview:self.detailTableview]; |
| | | [self.view addSubview:self.topView]; |
| | | [self.view addSubview:self.moreShareButton]; |
| | | [self.view addSubview:self.buttomView]; |
| | | [self.view addSubview:self.noFanLiButtomView]; |
| | | // [self.view addSubview:self.navGaryLine]; |
| | | [self.view addSubview:self.currentRollingView]; |
| | | [self.view addSubview:self.shopScrollView]; |
| | | |
| | | UIImage *imgsj = ALIMAGE_NAMED(@"goodsdetail_sj"); |
| | | [self.view addSubview:self.imageViewSJ]; |
| | | self.imageViewSJ.sd_layout.bottomSpaceToView(self.buttomView, 0).rightSpaceToView(self.view, (SCREEN_WIDTH - 115) / 4).widthIs(imgsj.size.width).heightIs(imgsj.size.height); |
| | | |
| | | [self.view addSubview:self.labelSubsidy]; |
| | | self.labelSubsidy.sd_layout.rightSpaceToView(self.view, 8).bottomSpaceToView(self.imageViewSJ, 0).widthIs(140).heightIs(20); |
| | | self.labelSubsidy.sd_cornerRadius = @4; |
| | | |
| | | [self.view addSubview:self.backView]; |
| | | |
| | | [self.view addSubview:self.noNetworkViews]; |
| | | [self getAppPageNotificationWithType:@"goodsDetailPDD"]; |
| | | [self addNetWorkNotice]; |
| | | |
| | | [self.view addSubview:self.backButton]; |
| | | [self.view addSubview:self.blockBackButton]; |
| | | [self.view addSubview:self.transitionView]; |
| | | } |
| | | |
| | | #pragma mark å³ä¸è§æé® |
| | | - (void)moreshareClicked:(UIButton *)sender { |
| | | kPreventRepeatClickTime(0.5); |
| | | [UMCustomShop umDetail_right]; |
| | | |
| | | self.goodsDetailPopWinView = [[GoodsDetailPopWinView alloc] initGoodsDetailTopRightPopView:1]; |
| | | @weakify(self) |
| | | self.goodsDetailPopWinView.selectName = ^(NSString *type) { |
| | | @strongify(self) |
| | | if ([type isEqualToString:@"å¤å¶é¾æ¥"]) { |
| | | [UMCustomShop umDetail_goods_detail_more_btn:@"å¤å¶é¾æ¥"]; |
| | | [self.commonMethodManage setPasteboardContent:self.extraDictionary[@"h5Url"] title:@"龿¥å¤å¶æå"]; |
| | | |
| | | } else if ([type isEqualToString:@"帮å©ä¸å¿"]) { |
| | | [UMCustomShop umDetail_goods_detail_more_btn:@"帮å©ä¸å¿"]; |
| | | ShonpingShareViewController *shopVC = [[ShonpingShareViewController alloc]init]; |
| | | shopVC.urlString = [YTHsharedManger startManger].help; |
| | | [self.navigationController pushViewController:shopVC animated:YES]; |
| | | |
| | | } else if ([type isEqualToString:@"æ°ææ»ç¥"]) { |
| | | [UMCustomShop umDetail_goods_detail_more_btn:@"æ°ææ»ç¥"]; |
| | | NSString *newuserGL = nil; |
| | | if ([self isHaveValue:[YTHsharedManger startManger].gonglueCourceInfo[@"videoUrl"]]) { |
| | | newuserGL = [YTHsharedManger startManger].gonglueCourceInfo[@"videoUrl"]; |
| | | |
| | | } else { |
| | | newuserGL = [YTHsharedManger startManger].gonglueCourceInfo[@"txtImgUtl"]; |
| | | } |
| | | ShonpingShareViewController *shonpingShareVc = [[ShonpingShareViewController alloc] init]; |
| | | shonpingShareVc.urlString = newuserGL; |
| | | [self.navigationController pushViewController:shonpingShareVc animated:YES]; |
| | | |
| | | } else if ([type isEqualToString:@"è系客æ"]) { |
| | | [UMCustomShop umDetail_goods_detail_more_btn:@"è系客æ"]; |
| | | [CustomerServiceManage pushinitMQ:@"åå详æ
"]; |
| | | |
| | | } else if ([type isEqualToString:@"æè¦åæ§½"]) { |
| | | [UMCustomShop umDetail_goods_detail_more_btn:@"æè¦åæ§½"]; |
| | | @weakify(self) |
| | | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.11 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ |
| | | @strongify(self) |
| | | MyRidiculeController *myRidiculeVc = [[MyRidiculeController alloc] init]; |
| | | [self.navigationController pushViewController:myRidiculeVc animated:YES]; |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | [self.goodsDetailPopWinView show]; |
| | | } |
| | | |
| | | - (void)getOrderParseConfig { |
| | | // config/getOrderParseConfig |
| | | NSDictionary *dic = @{}; |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"config/getOrderParseConfig"] param:dic success:^(NSDictionary *object) { |
| | | if (object != nil && [object[@"code"]integerValue] == 0) { |
| | | self.taoBaoAuthInfoDic = object[@"data"]; |
| | | NSString *tempJs = object[@"data"][@"orderJS"]; |
| | | self.jsString = [tempJs aes256_decrypt:tempJs]; |
| | | } |
| | | } fail:^(id object) { |
| | | |
| | | }]; |
| | | } |
| | | |
| | | - (void)openButtonEvent { |
| | | |
| | | self.buttomView.shareButton.enabled = YES; |
| | | self.buttomView.buyButton.enabled = YES; |
| | | } |
| | | |
| | | #pragma mark --- WebViewDelegate --- |
| | | - (void)webViewDidStartLoad:(UIWebView *)webView |
| | | { |
| | | |
| | | } |
| | | |
| | | - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType |
| | | { |
| | | NSString *urlString = request.URL.absoluteString; |
| | | if ([urlString rangeOfString:@"yestv://taobaoorder"].location != NSNotFound) { |
| | | NSArray *array = [urlString componentsSeparatedByString:@"#"]; |
| | | NSString *tempJs = array[1]; |
| | | |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | if ([ALUserInfoServiceManger fetchUID]) { |
| | | [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; |
| | | } |
| | | if (tempJs) { |
| | | [params setObject:[tempJs des256_encrypt:tempJs] forKey:@"orderData"]; |
| | | } |
| | | [params setObject:@"unionAuth" forKey:@"source"]; |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"user/order/uploadParsedOrder"] param:params success:^(NSDictionary *object) |
| | | {} |
| | | fail:^(id object) {}]; |
| | | } |
| | | return YES; |
| | | } |
| | | |
| | | - (void)webViewDidFinishLoad:(UIWebView *)webView |
| | | { |
| | | [webView stringByEvaluatingJavaScriptFromString:self.jsString]; |
| | | } |
| | | |
| | | - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error |
| | | { |
| | | |
| | | } |
| | | |
| | | - (void)EnterForeground:(NSNotification *)notice |
| | | { |
| | | [YTHsharedManger startManger].isEnterForeground = NO; |
| | | self.transitionView .hidden = YES; |
| | | [self.transitionView hiddenTransitionView]; |
| | | } |
| | | |
| | | - (void)backTaped:(UIButton *)sender |
| | | { |
| | | // [[ALNetWorking startInterface] cancelAll]; |
| | | [self.view hideToastActivity]; |
| | | [self hideCustomActivityView]; |
| | | [self clearTimers]; |
| | | [self.navigationController popViewControllerAnimated:YES]; |
| | | } |
| | | |
| | | - (void)clearTimers { |
| | | if (self.code != 2) { |
| | | WPHGoodsdetailInfoCell * cell = (WPHGoodsdetailInfoCell *)[self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; |
| | | [cell clearTimer]; |
| | | [self.shopScrollView clearTimer]; |
| | | [self.shopview clearTimer]; |
| | | } |
| | | } |
| | | #pragma mark --- ååä¿¡æ¯ --- |
| | | - (void)getgoodsinfo { |
| | | if (self.isProgressHud) { |
| | | [self showCustomActivityView]; |
| | | [self.view bringSubviewToFront:self.backButton]; |
| | | } |
| | | self.buttomView.hidden = YES; |
| | | [self getRecomeSource]; |
| | | |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | if ([ALUserInfoServiceManger fetchUID]) { |
| | | [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; |
| | | } |
| | | if (self.from) { |
| | | [params setObject:self.from forKey:@"from"]; |
| | | |
| | | } else { |
| | | [params setObject:@"" forKey:@"from"]; |
| | | } |
| | | [params setObject:self.goodsID forKey:@"id"]; |
| | | |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"goods/getDetailVIP"] param:params success:^(NSDictionary *object) |
| | | { |
| | | @strongify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | self.detailTableview.hidden = NO; |
| | | if (object) { |
| | | self.code = [object[@"code"] integerValue]; |
| | | if (self.code == 2) { |
| | | self.backView.hidden = NO; |
| | | |
| | | } else { |
| | | self.detailTableview.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - self.tableviewHeight); |
| | | self.buttomView .hidden = NO; |
| | | } |
| | | |
| | | if (self.code == 0) { |
| | | self.extraDictionary = object[@"data"][@"extra"]; |
| | | self.fanliValid = [self.extraDictionary[@"fanliValid"] boolValue]; // æ¯å¦æè¿å© |
| | | self.shareValid = [self.extraDictionary[@"shareValid"] boolValue]; // æ¯å¦æå享 |
| | | self.isNative = [self.extraDictionary[@"isNative"] boolValue]; // æ¯å¦è·³è½¬åçAPP |
| | | // self.detailUrlString = self.extraDictionary[@"detailUrl"]; // å¾æè¯¦æ
龿¥ |
| | | self.couponJumpLink = self.extraDictionary[@"couponJumpLink"]; |
| | | self.nativeCouponJumpLink = self.extraDictionary[@"nativeCouponJumpLink"]; |
| | | if ([self.extraDictionary[@"shareValid"] boolValue]) { |
| | | self.buttomView.hidden = NO; |
| | | |
| | | } else { |
| | | self.noFanLiButtomView.hidden = NO; |
| | | } |
| | | |
| | | self.shareUsersArray = self.extraDictionary[@"listShareUser"]; |
| | | self.shopview.dataSource = self.shareUsersArray; |
| | | self.shopScrollView.datasource = self.extraDictionary[@"listCouponUser"]; |
| | | |
| | | self.goodsModel = [GoodsDetailBaseModel yy_modelWithJSON:object[@"data"][@"goods"]]; |
| | | // è·åå¾æè¯¦æ
|
| | | [self fetchGraphicDetail:self.goodsModel.imgList]; |
| | | // æ¯å¦å å
¥åäº«åº |
| | | self.storageState = [self.extraDictionary[@"storage"] boolValue]; |
| | | |
| | | self.shopDetailType = 1; |
| | | self.topView.ButtonType = self.shopDetailType; |
| | | // æ¯å¦æ¶è |
| | | self.isCollection = [self.extraDictionary[@"collected"] boolValue]; |
| | | self.buttomView.isCollection = self.isCollection; |
| | | |
| | | [self.buttomView loadViewInfomation:self.goodsModel extraDic:self.extraDictionary]; |
| | | [self.noFanLiButtomView loadViewInfomation:self.goodsModel extraDic:self.extraDictionary]; |
| | | |
| | | self.alibaichuan = [[SJAliBaicun alloc] initWithDic:self.extraDictionary[@"tbPidInfo"]]; |
| | | |
| | | if ([self isHaveValue:self.goodsModel.moneyInfo.compositionInfo]) { |
| | | if ([YTHsharedManger startManger].iosonling == 0) { |
| | | self.labelSubsidy.hidden = NO; |
| | | self.imageViewSJ.hidden = NO; |
| | | self.labelSubsidy.text = self.goodsModel.moneyInfo.compositionInfo; |
| | | } |
| | | } |
| | | @weakify(self) |
| | | [UIView performWithoutAnimation:^{ |
| | | @strongify(self) |
| | | [self.detailTableview reloadData]; |
| | | }]; |
| | | |
| | | [self.detailTableview.mj_footer endRefreshingWithNoMoreData]; |
| | | } |
| | | } |
| | | [self hideCustomActivityView]; |
| | | }); |
| | | |
| | | } fail:^(id object) { |
| | | @strongify(self) |
| | | |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | |
| | | self.detailTableview.hidden = NO; |
| | | [self hideCustomActivityView]; |
| | | |
| | | NSError *error = (NSError *)object; |
| | | |
| | | if (error.code == -1009) { |
| | | if (self.goodsModel) { |
| | | self.noNetworkViews.hidden = YES; |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | |
| | | } else { |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | | [self.noNetworkViews.iconImage setImage:ALIMAGE_NAMED(@"defaultPage_noNetWork")]; |
| | | self.noNetworkViews.hidden = NO; |
| | | } |
| | | |
| | | } else { |
| | | |
| | | if (self.goodsModel) { |
| | | self.noNetworkViews.hidden = YES; |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | |
| | | } else { |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | | [self.noNetworkViews.iconImage setImage:ALIMAGE_NAMED(@"defaultPage_noNetWork")]; |
| | | self.noNetworkViews.hidden = NO; |
| | | } |
| | | } |
| | | }); |
| | | }]; |
| | | } |
| | | |
| | | - (void)getRecomeSource { |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | [params setObject:self.goodsID forKey:@"id"]; |
| | | [params setObject:[NSString stringWithFormat:@"%ld",(long)self.goodsType] forKey:@"goodsType"]; |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"goods/getRecommendGoods"] param:params success:^(NSDictionary *object) |
| | | { |
| | | @strongify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | if ([object[@"code"]integerValue] == 0) { |
| | | [self.likeArray removeAllObjects]; |
| | | [self.recommendArray removeAllObjects]; |
| | | for (NSDictionary *dictionary in object[@"data"][@"listGuess"]) { |
| | | if ([self isHaveValue:dictionary]) { |
| | | [self.likeArray addObject:[GoodsDetailBaseModel yy_modelWithJSON:dictionary]]; |
| | | } |
| | | } |
| | | for (NSDictionary *dictionary in object[@"data"][@"listQuality"]) { |
| | | if ([self isHaveValue:dictionary]) { |
| | | [self.recommendArray addObject:[GoodsDetailBaseModel yy_modelWithJSON:dictionary]]; |
| | | } |
| | | } |
| | | self.likeCell.dataArray = self.likeArray; |
| | | self.likeCell.isGuess = YES; |
| | | self.recomeCell.dataArray = self.recommendArray; |
| | | self.recomeCell.isGuess = NO; |
| | | /// 4 æ£å¸¸ 1 æ 忬¢ãæ¨è 2 æ æ¨è 3 æ 忬¢ |
| | | if (self.likeArray.count != 0 && self.recommendArray.count != 0) { |
| | | self.shopDetailType = 4; |
| | | }else if(self.recommendArray.count != 0){ |
| | | self.shopDetailType = 3; |
| | | }else if(self.likeArray.count != 0 ){ |
| | | self.shopDetailType = 2; |
| | | }else{ |
| | | self.shopDetailType = 1; |
| | | } |
| | | self.topView.ButtonType = self.shopDetailType; |
| | | [self.detailTableview reloadData]; |
| | | } else { |
| | | self.shopDetailType = 1; |
| | | } |
| | | [self hideCustomActivityView]; |
| | | [self.detailTableview.mj_header endRefreshing]; |
| | | [self.detailTableview.mj_footer endRefreshing]; |
| | | }); |
| | | |
| | | } fail:^(id object) { |
| | | @strongify(self) |
| | | [self hideCustomActivityView]; |
| | | [self.detailTableview.mj_header endRefreshing]; |
| | | [self.detailTableview.mj_footer endRefreshing]; |
| | | self.shopDetailType = 1; |
| | | }]; |
| | | } |
| | | //è·åå¾æè¯¦æ
|
| | | - (void)fetchGraphicDetail:(NSArray *)imgList { |
| | | NSMutableString *string = [[NSMutableString alloc] init]; |
| | | [string appendString:@"<!DOCTYPE html><html><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no\" />"]; |
| | | |
| | | [string appendString:@"<style>img{display:block;width:100%;height:auto;}</style><body>"]; |
| | | |
| | | for (NSString *img in imgList) { |
| | | [string appendString:[NSString stringWithFormat:@"\n <img src='%@'>",img]]; |
| | | } |
| | | [string appendString:@"</body>"]; |
| | | self.detailUrlString = string; |
| | | } |
| | | |
| | | #pragma mark - GoodsHeaderTableViewCellDelegate |
| | | - (void)closeRollView { |
| | | self.isRolling = NO; |
| | | [self.detailTableview reloadData]; |
| | | } |
| | | |
| | | #pragma mark --- ç«å³é¢å --- |
| | | - (void)useQuanClicked:(WPHGoodsdetailInfoCell *)cell { |
| | | if (![self socketReachabilityTest]) { |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | return; |
| | | } |
| | | |
| | | BOOL isFirst = [[NSUserDefaults standardUserDefaults] boolForKey:@"pddAddVerifiStatusFirst"]; |
| | | if (![ALUserInfoServiceManger fetchUID] && !isFirst ) { |
| | | self.baseTipsPopView.textIsCenter = YES; |
| | | self.baseTipsPopView.buttonCount = 2; |
| | | self.baseTipsPopView.type = 1; |
| | | self.baseTipsPopView.buttonLeftString = @"å»ç»å½"; |
| | | self.baseTipsPopView.buttonRightString = @"å»é¢å¸"; |
| | | self.baseTipsPopView.titleString = @"温馨æç¤º"; |
| | | self.baseTipsPopView.contentString = @"æªç»å½æ è¿å©ï¼ç¡®å®å
è´¹é¢å¸?"; |
| | | @weakify(self) |
| | | self.baseTipsPopView.leftTouchEvent = ^(NSInteger type) { |
| | | @strongify(self) |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return ; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self getWPHLink]; |
| | | }; |
| | | |
| | | self.baseTipsPopView.rightTouchEvent = ^(NSInteger type) { |
| | | @strongify(self) |
| | | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"pddAddVerifiStatusFirst"]; |
| | | WPHGoodsdetailInfoCell * cell = (WPHGoodsdetailInfoCell *)[self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; |
| | | [self useQuanClicked:cell]; |
| | | }; |
| | | [self.baseTipsPopView showView:nil]; |
| | | return; |
| | | } |
| | | |
| | | if(![ALUserInfoServiceManger fetchUID]){ |
| | | self.transitionView.contentLabel.text = @"æªç»å½æ è¿å©"; |
| | | self.transitionView.hidden = NO; |
| | | [self.transitionView showTransitionView]; |
| | | [self performSelector:@selector(jumpZJPingDuoDuo) withObject:nil/*å¯ä¼ ä»»æç±»ååæ°*/ afterDelay:0.5]; |
| | | |
| | | } else { |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return ; |
| | | } |
| | | |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | self.transitionView.contentLabel.text = @"è´ä¹°åæè¿å©ï¼å享åæå¥é"; |
| | | [self getWPHLink]; |
| | | } |
| | | [UMCustomShop umDetail_buy]; |
| | | [UMCustomShop umDetail_coupon_click]; |
| | | } |
| | | |
| | | - (void)jumpZJPingDuoDuo { |
| | | [YTHsharedManger startManger].isEnterForeground = YES; |
| | | [self jumpWPH:self.isNative jumpLink:self.couponJumpLink nativeJumpLink:self.nativeCouponJumpLink]; |
| | | } |
| | | |
| | | #pragma mark- GDrecomeTableViewCellDelegate |
| | | - (void)cellClicked:(GDrecomeTableViewCell *)cell goodId:(NSString *)goodsID { |
| | | PDDGoodsDetailController *goodDeTrVc = [[PDDGoodsDetailController alloc] init]; |
| | | goodDeTrVc.goodsID = goodsID; |
| | | goodDeTrVc.goodsType = 3; |
| | | [self.navigationController pushViewController:goodDeTrVc animated:YES]; |
| | | } |
| | | |
| | | - (void)touchMaxCoupon { |
| | | if ([self.goodsModel.otherInfo.rewardCoupon.jumpDetail[@"needLogin"] boolValue] && ![ALUserInfoServiceManger fetchUID]) {// 没æç»éå»ç»é |
| | | [self onLoginVcName:nil title:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self pushAnyInterfaceController:self.goodsModel.otherInfo.rewardCoupon.jumpDetail[@"controller"] parms:self.goodsModel.otherInfo.rewardCoupon.params]; |
| | | } |
| | | |
| | | - (void)touchFanLiBi { |
| | | [self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":self.goodsModel.moneyInfo.rateInfoHelpUrl?:@""}]; |
| | | } |
| | | |
| | | - (void)onLoginVcName:(NSString *)vcName title:(NSString *)title { |
| | | if (title) { |
| | | [JRToast showWithText:title bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | |
| | | } else { |
| | | [JRToast showWithText:@"请å
ç»å½æ¿æ å¿«çè´¦å·" bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | } |
| | | // ç»å½çé¢ |
| | | NewLoginViewController *loginVc = [[NewLoginViewController alloc] init]; |
| | | loginVc.delegate = self; |
| | | loginVc.rootVc = self; |
| | | loginVc.vcName = vcName; |
| | | [self.navigationController pushViewController:loginVc animated:YES]; |
| | | } |
| | | |
| | | - (void)onInviteVcName:(NSString *)vcName { |
| | | InviteCodeController *inviteCodeVc = [[InviteCodeController alloc] init]; |
| | | inviteCodeVc.delegates = self; |
| | | inviteCodeVc.rootController = self; |
| | | inviteCodeVc.type = vcName; |
| | | [self.navigationController pushViewController:inviteCodeVc animated:YES]; |
| | | } |
| | | |
| | | #pragma mark --- ButtomViewDelegate --- |
| | | // å¤å¶é¾æ¥ |
| | | - (void)copyLinkClicked:(ButtomCarView *)view { |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self fetchCopyLink]; |
| | | } |
| | | |
| | | - (void)fetchCopyLink { |
| | | [self.view makeToastActivity:CSToastPositionCenter]; |
| | | self.buttomView.buttonCopuLink.enabled = YES; |
| | | ((UIImageView *)[self.buttomView.buttonCopuLink subviews][0]).alpha = 0.6; |
| | | ((UILabel *)[self.buttomView.buttonCopuLink subviews][1]).textColor = UIColorFromRGBValue(0x999999); |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | [params setObject:_goodsID forKey:@"goodsId"]; |
| | | [params setObject:self.from?:@"" forKey:@"source"]; |
| | | [params setObject:[NSString stringWithFormat:@"%ld",(long)self.goodsType] forKey:@"goodsType"]; |
| | | [params setObject:@YES forKey:@"needGoods"]; |
| | | if ([self isHaveValue:[ALUserInfoServiceManger fetchUID]]) { |
| | | [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; |
| | | } |
| | | @weakify(self) |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"share/createShareInfo"] param:params success:^(NSDictionary *object) { |
| | | @strongify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | self.buttomView.buttonCopuLink.enabled = YES; |
| | | ((UIImageView *)[self.buttomView.buttonCopuLink subviews][0]).alpha = 1; |
| | | ((UILabel *)[self.buttomView.buttonCopuLink subviews][1]).textColor = UIColorFromRGBValue(0x333333); |
| | | [self.view hideToastActivity]; |
| | | if ([self isHaveValue:object] && [object [@"code"] integerValue] == 0) { |
| | | [self.commonMethodManage setPasteboardContent:object[@"data"][@"commentText"] title:@"龿¥å¤å¶æå"]; |
| | | |
| | | } else { |
| | | if (object[@"msg"]) { |
| | | ALToastCenter(object[@"msg"]); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } fail:^(id object) { |
| | | @strongify(self) |
| | | [self.view hideToastActivity]; |
| | | self.buttomView.buttonCopuLink.enabled = YES; |
| | | ((UIImageView *)[self.buttomView.buttonCopuLink subviews][0]).alpha = 1; |
| | | ((UILabel *)[self.buttomView.buttonCopuLink subviews][1]).textColor = UIColorFromRGBValue(0x333333); |
| | | }]; |
| | | } |
| | | // æ¶è |
| | | - (void)collectionClicked:(ButtomCarView *)view { |
| | | if (![self isHaveValue:[ALUserInfoServiceManger fetchUID]]) { |
| | | [self onLoginVcName:@"goodsDetailCollection" title:@"ç»å½åæè½æ¶èå¦"]; |
| | | return; |
| | | } |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self fecthAndPostCollection]; |
| | | } |
| | | |
| | | - (void)shareClicked:(ButtomCarView *)view { |
| | | [self shareOperationSteps]; |
| | | } |
| | | |
| | | - (void)shareOperationSteps { |
| | | if (![self socketReachabilityTest]) { |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | return; |
| | | } |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self jumpCreateShare]; |
| | | } |
| | | |
| | | - (void)jumpCreateShare { |
| | | [self.view makeToastActivity:CSToastPositionCenter]; |
| | | self.buttomView.shareButton.enabled = NO; |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | [params setObject:_goodsID forKey:@"goodsId"]; |
| | | [params setObject:self.from?:@"" forKey:@"source"]; |
| | | [params setObject:[NSString stringWithFormat:@"%ld",(long)self.goodsType] forKey:@"goodsType"]; |
| | | [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; |
| | | [params setObject:@YES forKey:@"needGoods"]; |
| | | @weakify(self) |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"share/createShareInfo"] param:params success:^(NSDictionary *object) |
| | | { |
| | | @strongify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | [self.view hideToastActivity]; |
| | | self.buttomView.shareButton.enabled = YES; |
| | | if ([object[@"code"] integerValue] == 0) { |
| | | if (!self.goodsModel) { |
| | | ALToastCenter(@"ååå è½½ä¸!"); |
| | | return; |
| | | } |
| | | NSDictionary *dataDictionary = @{@"goods" : self.goodsModel, @"share" : object[@"data"], @"goodsId" : [NSString stringWithFormat:@"%@",self.goodsID]}; |
| | | NewGoodsShareController *newGoodsShareVc = [[NewGoodsShareController alloc] init]; |
| | | newGoodsShareVc.dataDictionary = dataDictionary; |
| | | [self.navigationController pushViewController:newGoodsShareVc animated:YES]; |
| | | |
| | | } else { |
| | | [JRToast showWithText:object[@"msg"] bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | } |
| | | }); |
| | | |
| | | } fail:^(id object) { |
| | | @strongify(self) |
| | | [self.view hideToastActivity]; |
| | | self.buttomView.shareButton.enabled = YES; |
| | | }]; |
| | | } |
| | | #pragma mark --- ä¸åè¿ --- |
| | | - (void)buyClicked:(ButtomCarView *)view { |
| | | self.transitionView.contentLabel.text = @"è´ä¹°åæè¿å©ï¼å享åæå¥é"; |
| | | |
| | | [UMCustomShop umDetail_buy]; |
| | | [UMCustomShop umDetail_buy_common]; |
| | | |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return ; |
| | | } |
| | | |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self getWPHLink]; |
| | | } |
| | | |
| | | - (void)getWPHLink { |
| | | NSDictionary *dic = @{@"uid":[ALUserInfoServiceManger fetchUID],@"id":self.goodsModel.goodsId,@"from" : @"goodsDetail",@"source":self.from?:@""}; |
| | | [self.view makeToastActivity:CSToastPositionCenter]; |
| | | |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"goods/getVIPLink"] param:dic success:^(NSDictionary *object) { |
| | | [self.view hideToastActivity]; |
| | | @strongify(self) |
| | | if ([object[@"code"] integerValue] == 0) { |
| | | self.native = [object[@"data"][@"native"] boolValue]; //æ¯å¦è·³è½¬åç |
| | | self.shoppingUrl = object[@"data"][@"jumpLink"]; |
| | | self.nativeJumpLink = object[@"data"][@"nativeJumpLink"]; |
| | | self.transitionView.hidden = NO; |
| | | [self.transitionView showTransitionView]; |
| | | [self performSelector:@selector(buyWPHGoods) withObject:nil/*å¯ä¼ ä»»æç±»ååæ°*/ afterDelay:0.5]; |
| | | |
| | | } else { |
| | | [JRToast showWithText:object[@"msg"] bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | } |
| | | |
| | | } fail:^(id object) { |
| | | [self.view hideToastActivity]; |
| | | |
| | | }]; |
| | | } |
| | | |
| | | - (void)buyWPHGoods { |
| | | [self jumpWPH:self.native jumpLink:self.shoppingUrl nativeJumpLink:self.nativeJumpLink]; |
| | | } |
| | | |
| | | - (void)jumpWPH:(BOOL)native jumpLink:(NSString *)jumpLink nativeJumpLink:(NSString *)nativeJumpLink { |
| | | NSURL *url = [NSURL URLWithString:nativeJumpLink]; |
| | | if (native && [[UIApplication sharedApplication] canOpenURL:url]) { |
| | | [[UIApplication sharedApplication] openURL:url]; |
| | | [self hideTransitionView]; |
| | | |
| | | } else { |
| | | ShonpingShareViewController *shonpingShareVc = [[ShonpingShareViewController alloc] init]; |
| | | shonpingShareVc.urlString = jumpLink; |
| | | [self.navigationController pushViewController:shonpingShareVc animated:YES]; |
| | | } |
| | | } |
| | | |
| | | - (void)footprintTaped:(UIButton *)sender { |
| | | [UMCustomShop umDetail_footer]; |
| | | FootprintsViewController *footprintsVc = [[FootprintsViewController alloc] init]; |
| | | [self.navigationController pushViewController:footprintsVc animated:YES]; |
| | | } |
| | | |
| | | #pragma mark --- ç¹å»æ¶è --- |
| | | - (void)collectTaped:(UIButton *)sender { |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLogin:@"collection" tips:@"ç»å½åæè½æ¶èå¦"]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self fecthAndPostCollection]; |
| | | } |
| | | - (void)fecthAndPostCollection { |
| | | if (![self socketReachabilityTest]) { |
| | | [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | return; |
| | | } |
| | | self.buttomView.buttonCollection.enabled = NO; |
| | | NSMutableDictionary *params = @{}.mutableCopy; |
| | | [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; |
| | | [params setObject:self.goodsModel.goodsId forKey:@"id"]; |
| | | [params setObject:[NSString stringWithFormat:@"%ld",(long)_goodsType] forKey:@"goodsType"]; |
| | | if (!self.isCollection) { |
| | | [params setObject:@"1" forKey:@"type"]; |
| | | |
| | | } else { |
| | | [params setObject:@"2" forKey:@"type"]; |
| | | } |
| | | [[YTHNetInterface startInterface] cancelAll]; |
| | | @weakify(self) |
| | | [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"consumer/collectionGoods"] param:params success:^(NSDictionary *object) { |
| | | @strongify(self) |
| | | if ([self isHaveValue:object] && [object[@"code"] integerValue] == 0) { |
| | | self.isCollection = !self.isCollection; |
| | | if (self.isCollection) { |
| | | [UMCustomShop umDetail_collect]; |
| | | self.isCollection = YES; |
| | | |
| | | } else { |
| | | [UMCustomShop umDetail_collect_cancel]; |
| | | self.isCollection = NO; |
| | | } |
| | | self.buttomView.isCollection = self.isCollection; |
| | | [JRToast showWithText:object[@"data"] duration:1.2f]; |
| | | |
| | | } else { |
| | | [JRToast showWithText:object[@"msg"] duration:1.2f]; |
| | | } |
| | | self.buttomView.buttonCollection.enabled = YES; |
| | | |
| | | } fail:^(id object) { |
| | | self.buttomView.buttonCollection.enabled = YES; |
| | | }]; |
| | | } |
| | | |
| | | #pragma mark --- æ·»å åäº«åº --- |
| | | - (void)ProLibraryTaped:(UIButton *)sender { |
| | | if (![ALUserInfoServiceManger fetchUID]) { |
| | | [self onLoginVcName:nil title:nil]; |
| | | return ; |
| | | } |
| | | |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | sender.userInteractionEnabled = NO; |
| | | [self userStorageaddstorage]; |
| | | } |
| | | |
| | | - (void)userStorageaddstorage { |
| | | // NSDictionary *dic = @{@"uid":[ALUserInfoServiceManger fetchUID],@"id":self.goodsModel.goodsId,@"goodsType":[NSString stringWithFormat:@"%ld",(long)_goodsType]}; |
| | | // @weakify(self) |
| | | // [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"shraeStorage/accordtorage"] param:dic success:^(NSDictionary *object) |
| | | // { |
| | | // @strongify(self) |
| | | // dispatch_async(dispatch_get_main_queue(), ^{ |
| | | // WPHGoodsdetailInfoCell *cell = [self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; |
| | | // cell.buttonHairCircle.userInteractionEnabled = YES; |
| | | // if ([object[@"code"] integerValue] == 0) { |
| | | // BOOL storageState = [object[@"data"][@"storageState"] boolValue]; |
| | | // self.storageState = storageState; |
| | | // if (storageState) { |
| | | // [JRToast showWithText:@"æ·»å è³åäº«åºæå" bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | // [UMCustomShop umDetail_joinXPK]; |
| | | // cell.ProLibraryBtn.selected = YES; |
| | | // |
| | | // } else { |
| | | // [JRToast showWithText:@"å·²ä»å享åºä¸å é¤" bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | // [UMCustomShop umDetail_goods_detail_xpk_cancel]; |
| | | // cell.ProLibraryBtn.selected = NO; |
| | | // } |
| | | // |
| | | // } else { |
| | | // [JRToast showWithText:object[@"msg"] bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | // } |
| | | // }); |
| | | // |
| | | // } fail:^(id object) { |
| | | // dispatch_async(dispatch_get_main_queue(), ^{ |
| | | // WPHGoodsdetailInfoCell *cell = [self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; |
| | | // cell.buttonHairCircle.userInteractionEnabled = YES; |
| | | // }); |
| | | // }]; |
| | | |
| | | } |
| | | |
| | | - (void)noticeMineBackEvent:(NSString *)vcName |
| | | { |
| | | [[NSNotificationCenter defaultCenter] postNotificationName:@"noticeMessageVcUpdateData" object:nil]; |
| | | [self.messageManger getMessage]; |
| | | [self getgoodsinfo]; |
| | | } |
| | | #pragma mark --- ç»å½ --- |
| | | - (void)onLogin:(NSString *)name tips:(NSString *)tips |
| | | { |
| | | [JRToast showWithText:tips?:@"请å
ç»å½æ¿æ å¿«çè´¦å·" bottomOffset:kToolBarH + 15 duration:1.2f]; |
| | | NewLoginViewController *loginVc = [[NewLoginViewController alloc] init]; |
| | | loginVc.rootVc = self; |
| | | loginVc.delegate = self; |
| | | loginVc.vcName = name; |
| | | loginVc.from = @"æ¼å¤å¤è¯¦æ
"; |
| | | [self.navigationController pushViewController:loginVc animated:YES]; |
| | | } |
| | | |
| | | #pragma mark - GDetailViewDelegate |
| | | - (void)backClicked:(GDetailView *)view |
| | | { |
| | | [self.navigationController popViewControllerAnimated:YES]; |
| | | } |
| | | |
| | | - (CGRect)setsecionFrame:(NSInteger)secion |
| | | { |
| | | CGRect frame = [self.detailTableview rectForHeaderInSection:secion]; |
| | | |
| | | CGFloat height = 66; |
| | | if (IS_IPHONE_X) { |
| | | height = 86; |
| | | } |
| | | CGRect frame1 = CGRectMake(frame.origin.x, frame.origin.y - height, frame.size.width, frame.size.height); |
| | | |
| | | return frame1; |
| | | } |
| | | |
| | | - (void)topButtonClicked:(GDetailView *)view sender:(UIButton *)sender |
| | | { |
| | | sender.selected = YES; |
| | | _isClicked = YES; |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(sender.frame) - 21, CGRectGetMaxY(sender.frame)-5, 40, 4); |
| | | if (sender == self.topView.goodButton) { |
| | | self.topView.alpha = 0; |
| | | self.topView.likeButton.selected = NO; |
| | | self.topView.detailButton.selected = NO; |
| | | self.topView.recommendButton.selected = NO; |
| | | NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; |
| | | [self.detailTableview scrollToRowAtIndexPath:indexPath |
| | | atScrollPosition:UITableViewScrollPositionTop animated:YES]; |
| | | } |
| | | |
| | | if (sender == self.topView.detailButton) { |
| | | self.topView.alpha = 1; |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.recommendButton.selected = NO; |
| | | self.topView.likeButton.selected = NO; |
| | | |
| | | if (self.code != 2) { |
| | | |
| | | CGRect frame = [self setsecionFrame:2]; |
| | | [_detailTableview setContentOffset:CGPointMake(frame.origin.x, frame.origin.y)]; |
| | | } |
| | | } |
| | | |
| | | if (sender == self.topView.likeButton) { |
| | | self.topView.alpha = 1; |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.detailButton.selected = NO; |
| | | self.topView.recommendButton.selected = NO; |
| | | |
| | | int selectI = 0; |
| | | |
| | | if (self.code == 2) { |
| | | |
| | | selectI = 1; |
| | | |
| | | } else { |
| | | |
| | | selectI = 3; |
| | | } |
| | | |
| | | CGRect frame = [self setsecionFrame:selectI]; |
| | | [_detailTableview setContentOffset:CGPointMake(frame.origin.x, frame.origin.y)]; |
| | | |
| | | |
| | | } |
| | | |
| | | if (sender == self.topView.recommendButton) { |
| | | self.topView.alpha = 1; |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.detailButton.selected = NO; |
| | | self.topView.likeButton.selected = NO; |
| | | |
| | | NSIndexPath *indexPath = nil; |
| | | |
| | | if (self.code == 2) { |
| | | NSInteger w = [self.detailTableview numberOfRowsInSection:1]; |
| | | if (w!=0) { |
| | | indexPath = [NSIndexPath indexPathForRow:0 inSection:1]; |
| | | } |
| | | |
| | | } else { |
| | | int i = 0; |
| | | if (_shopDetailType == 4) { |
| | | i = 4; |
| | | }else{ |
| | | i = 3; |
| | | } |
| | | CGRect frame = [self setsecionFrame:i]; |
| | | [_detailTableview setContentOffset:CGPointMake(frame.origin.x, frame.origin.y)]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | - (void)showShopDetail:(UIButton *)sender |
| | | { |
| | | [UMCustomShop umDetail_detail]; |
| | | |
| | | isShowdetail = !isShowdetail; |
| | | |
| | | [self.detailTableview reloadData]; |
| | | } |
| | | |
| | | #pragma mark - scrollViewDelegate |
| | | - (void)scrollViewDidScroll:(UIScrollView *)scrollView |
| | | { |
| | | if (scrollView.contentOffset.y > self.lastContentOffest) { |
| | | self.lastContentOffest = scrollView.contentOffset.y; |
| | | } |
| | | newContentOffsetY = scrollView.contentOffset.y; |
| | | if (newContentOffsetY > oldContentOffsetY && oldContentOffsetY > contentOffsetY) { // å䏿»å¨ |
| | | } else if (newContentOffsetY < oldContentOffsetY && oldContentOffsetY < contentOffsetY) {// å䏿»å¨ |
| | | |
| | | } else { |
| | | } |
| | | if (scrollView.dragging) { // ææ½ |
| | | |
| | | if ((scrollView.contentOffset.y - contentOffsetY) > 5.0f) { // åä¸ææ½ |
| | | self.topView.alpha = - (contentOffsetY - scrollView.contentOffset.y) / 150.0; |
| | | if ( scrollView.contentOffset.y > 150) { |
| | | self.topView.alpha = 1; |
| | | self.topView.navGaryLine.alpha = 1; |
| | | [_backButton setImage:[UIImage imageNamed:@"Left_back"] forState:UIControlStateNormal]; |
| | | |
| | | [_moreShareButton setImage:[UIImage imageNamed:@"æ´å¤___up"] forState:UIControlStateNormal]; |
| | | |
| | | }else |
| | | if (scrollView.contentOffset.y < 10) { |
| | | self.topView.alpha = 0; |
| | | self.topView.navGaryLine.alpha = 0; |
| | | [_backButton setImage:[UIImage imageNamed:@"left_back_around"] forState:UIControlStateNormal]; |
| | | [_moreShareButton setImage:[UIImage imageNamed:@"æ´å¤___"] forState:UIControlStateNormal]; |
| | | |
| | | } |
| | | } |
| | | else if ((contentOffsetY - scrollView.contentOffset.y) > 5.0f) |
| | | { // åä¸ææ½ |
| | | self.topView.alpha = 1/ ((contentOffsetY - scrollView.contentOffset.y) / 150.0); |
| | | if (scrollView.contentOffset.y < 10) { |
| | | //æ»å°é¡¶é¨æ´æ° |
| | | self.topView.alpha = 0; |
| | | self.topView.navGaryLine.alpha = 0; |
| | | [_backButton setImage:[UIImage imageNamed:@"left_back_around"] forState:UIControlStateNormal]; |
| | | [_moreShareButton setImage:[UIImage imageNamed:@"æ´å¤___"] forState:UIControlStateNormal]; |
| | | |
| | | } |
| | | if ( scrollView.contentOffset.y > 150) { |
| | | self.topView.alpha = 1; |
| | | [_backButton setImage:[UIImage imageNamed:@"Left_back"] forState:UIControlStateNormal]; |
| | | [_moreShareButton setImage:[UIImage imageNamed:@"æ´å¤___up"] forState:UIControlStateNormal]; |
| | | |
| | | self.topView.navGaryLine.alpha = 1; |
| | | } |
| | | |
| | | } else { |
| | | |
| | | } |
| | | } |
| | | |
| | | if (_isClicked) { |
| | | _isClicked = NO; |
| | | |
| | | } else { |
| | | NSIndexPath *indexpath = [self .detailTableview indexPathForRowAtPoint:CGPointMake(scrollView.contentOffset.x, scrollView.contentOffset.y)]; |
| | | if (indexpath.section == 0 && indexpath != nil) { |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.goodButton.frame) - 21, CGRectGetMaxY(self.topView.goodButton.frame)-5, 40, 4); |
| | | self.topView.goodButton.selected = YES; |
| | | self.topView.detailButton.selected = NO; |
| | | self.topView.recommendButton.selected = NO; |
| | | self.topView.likeButton.selected = NO; |
| | | } |
| | | |
| | | if (indexpath.section == 2 || (indexpath == nil && self.code != 2)) { |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.detailButton.frame) - 21, CGRectGetMaxY(self.topView.detailButton.frame)-5, 40, 4); |
| | | |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.detailButton.selected = YES; |
| | | self.topView.recommendButton.selected = NO; |
| | | self.topView.likeButton.selected = NO; |
| | | } |
| | | |
| | | if (indexpath.section == 3) { |
| | | if (_shopDetailType == 2 || _shopDetailType == 4) { |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.likeButton.frame) - 21, CGRectGetMaxY(self.topView.likeButton.frame)-5, 40, 4); |
| | | self.topView.likeButton.selected = YES; |
| | | self.topView.recommendButton.selected = NO; |
| | | }else{ |
| | | self.topView.likeButton.selected = NO; |
| | | self.topView.recommendButton.selected = YES; |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.recommendButton.frame) - 21, CGRectGetMaxY(self.topView.recommendButton.frame)-5, 40, 4); |
| | | |
| | | } |
| | | |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.detailButton.selected = NO; |
| | | } |
| | | if (indexpath.section == 4) { |
| | | self.topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.recommendButton.frame) - 21, CGRectGetMaxY(self.topView.recommendButton.frame)-5, 40, 4); |
| | | self.topView.goodButton.selected = NO; |
| | | self.topView.detailButton.selected = NO; |
| | | self.topView.recommendButton.selected = YES; |
| | | self.topView.likeButton.selected = NO; |
| | | } |
| | | } |
| | | } |
| | | |
| | | - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView |
| | | { |
| | | _isClicked = NO; |
| | | } |
| | | |
| | | #pragma mark --- UITableViewDelegate,UITableViewDataSource ---- |
| | | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView |
| | | { |
| | | if (self.code == 2) { |
| | | |
| | | if (_shopDetailType == 2 || _shopDetailType == 3) { |
| | | return 2; |
| | | |
| | | } else if (_shopDetailType == 4) { |
| | | return 3; |
| | | |
| | | } else { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | switch (_shopDetailType) { |
| | | case 4: |
| | | { |
| | | return 5; |
| | | } break; |
| | | |
| | | case 1: |
| | | { |
| | | return 3; |
| | | } break; |
| | | |
| | | case 2: |
| | | { |
| | | return 4; |
| | | } break; |
| | | case 3: |
| | | { |
| | | return 4; |
| | | } break; |
| | | default: |
| | | break; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section |
| | | { |
| | | if (section == 0) { |
| | | return 1; |
| | | } |
| | | |
| | | if (section == 2) { |
| | | if (self.code == 2) { |
| | | if (self.recommendArray.count != 0) { |
| | | return 1; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | if (section == 1) { |
| | | if (self.code == 2) { |
| | | if (self.likeArray.count != 0) { |
| | | return 1; |
| | | } |
| | | |
| | | if (self.recommendArray.count != 0) { |
| | | return 1; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | if (section == 3 || section == 4 ) { |
| | | return 1; |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | - (CGFloat)getSpaceLabelHeight:(NSString *)str withAttrDict:(NSDictionary *)dict withWidth:(CGFloat)width { |
| | | CGSize size = [str boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:dict context:nil].size; |
| | | return size.height; |
| | | } |
| | | |
| | | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { |
| | | if (indexPath.section == 0) { |
| | | // code == 2 åå䏿¶ |
| | | if (self.code == 2) { |
| | | return SCREEN_WIDTH; |
| | | } |
| | | |
| | | UIImage *icomImage = [UIImage imageNamed:@"ic_share_wph"]; |
| | | |
| | | NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; |
| | | style.lineSpacing = 3; |
| | | // 坹齿¹å¼ |
| | | style.alignment = NSTextAlignmentLeft; |
| | | // é¦è¡ç¼©è¿ |
| | | CGFloat firstLineHeadIndentHeight = 0; |
| | | |
| | | if ([self.goodsModel.title hasPrefix:@"ã"]) { |
| | | firstLineHeadIndentHeight = icomImage.size.width; |
| | | |
| | | } else { |
| | | firstLineHeadIndentHeight = icomImage.size.width + 8; |
| | | } |
| | | |
| | | style.firstLineHeadIndent = firstLineHeadIndentHeight; |
| | | |
| | | NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; |
| | | CGFloat height = [self getSpaceLabelHeight:[NSString stringWithFormat:@"%@",self.goodsModel.title] withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; |
| | | //æ¯å¦æè¶
级ä¼åè¿ |
| | | CGFloat maxCouponHeight = 0; |
| | | if ([ALUserInfoServiceManger fetchUserInfo]) {// æ¯å¦ç»é |
| | | if (![ALUserInfoServiceManger isMembership]) {// æ¯å¦æ¯ä¼å |
| | | if (self.goodsModel.otherInfo.rewardCoupon) { |
| | | maxCouponHeight = 50; |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | if (self.goodsModel.otherInfo.rewardCoupon) { |
| | | maxCouponHeight = 50; |
| | | } |
| | | } |
| | | //æ¯å¦ææ ç¾ |
| | | CGFloat labelsHeght = 0; |
| | | if ([self isHaveValue:self.goodsModel.labels]) { |
| | | labelsHeght = 22; |
| | | } |
| | | |
| | | CGFloat jianqu = 0; |
| | | if ([YTHsharedManger startManger].iosonling == 1) { |
| | | jianqu = 40; |
| | | } |
| | | |
| | | return SCREEN_WIDTH + 205 + height + maxCouponHeight + labelsHeght - jianqu; |
| | | } |
| | | if (indexPath.section == 1) { |
| | | if (self.code == 2) { |
| | | if (self.likeArray.count != 0) { |
| | | NSInteger height = self.likeArray.count / 2 ; |
| | | if (self.likeArray.count % 2 != 0) { |
| | | height = height + 1; |
| | | } |
| | | |
| | | return height * ((SCREEN_WIDTH-30)/2+136); |
| | | } |
| | | |
| | | if (self.recommendArray.count != 0) { |
| | | NSInteger height = self.recommendArray.count / 2 ; |
| | | if (self.recommendArray.count % 2 != 0) { |
| | | height = height + 1; |
| | | |
| | | } |
| | | return height * ((SCREEN_WIDTH-30)/2+136); |
| | | } |
| | | |
| | | } else { |
| | | if (self.shareUsersArray.count == 0) { |
| | | return CGFLOAT_MIN; |
| | | |
| | | } else { |
| | | return 62; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (indexPath.section == 2) { |
| | | |
| | | if (self.code == 2) { |
| | | |
| | | NSInteger height = self.recommendArray.count / 2 ; |
| | | if (self.recommendArray.count % 2 != 0) { |
| | | height = height +1; |
| | | } |
| | | return height * ((SCREEN_WIDTH-30)/2+136); |
| | | } |
| | | } |
| | | |
| | | CGFloat collectioncellheight = 305; |
| | | if (SCREEN_WIDTH < 375) { |
| | | collectioncellheight = 275; |
| | | |
| | | } else if (SCREEN_WIDTH > 375) { |
| | | collectioncellheight = 325; |
| | | } |
| | | |
| | | if (indexPath.section == 3) { |
| | | if (_shopDetailType == 2 || _shopDetailType == 4) { |
| | | NSInteger height = self.likeArray.count / 2; |
| | | |
| | | if (self.likeArray.count % 2 != 0) { |
| | | height = height + 1; |
| | | } |
| | | return height * collectioncellheight + 15; |
| | | |
| | | } else { |
| | | NSInteger height = self.recommendArray.count / 2 ; |
| | | |
| | | if (self.recommendArray.count % 2 != 0) { |
| | | height = height + 1; |
| | | } |
| | | return height * collectioncellheight + 15; |
| | | } |
| | | } |
| | | if (indexPath.section == 4) { |
| | | |
| | | NSInteger height = self.recommendArray.count / 2 ; |
| | | |
| | | if (self.recommendArray.count % 2 != 0) { |
| | | height = height + 1; |
| | | } |
| | | return height * collectioncellheight + 15; |
| | | } |
| | | return CGFLOAT_MIN; |
| | | } |
| | | |
| | | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
| | | if (indexPath.section == 0) { |
| | | if (self.code == 2) { |
| | | NSString *identifier = @"NoShopTableViewCell"; |
| | | NoShopTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; |
| | | if (!cell) { |
| | | cell = [[NoShopTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; |
| | | } |
| | | cell.NoImage.image = [UIImage imageNamed:@"没æåå"]; |
| | | cell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | return cell; |
| | | } |
| | | NSString *identifier = @"WPHGoodsdetailInfoCell"; |
| | | WPHGoodsdetailInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; |
| | | if (!cell) { |
| | | cell = [[WPHGoodsdetailInfoCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; |
| | | } |
| | | cell.delegate = self; |
| | | cell.from = self.from; |
| | | cell.fanliValid = self.fanliValid; |
| | | cell.shareValid = self.shareValid; |
| | | cell.model = self.goodsModel; |
| | | |
| | | cell.storageState = self.storageState; |
| | | [cell.buttonHairCircle addTarget:self action:@selector(ProLibraryTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | @weakify(self) |
| | | cell.touchCheckLike = ^{ |
| | | @strongify(self) |
| | | SearchDetailMainController *searchDetailMainVc = [[SearchDetailMainController alloc] init]; |
| | | searchDetailMainVc.goodsType = @"1"; |
| | | searchDetailMainVc.searchKey = self.goodsModel.title; |
| | | [self.navigationController pushViewController:searchDetailMainVc animated:YES]; |
| | | }; |
| | | |
| | | cell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | if (!self.goodsModel) { |
| | | CATransition *animation = [CATransition animation]; |
| | | animation.type = kCATransitionFade; |
| | | animation.duration = 0.4; |
| | | [cell.layer addAnimation:animation forKey:nil]; |
| | | cell.hidden = YES; |
| | | self.buttomView.hidden = YES; |
| | | |
| | | } else { |
| | | CATransition *animation = [CATransition animation]; |
| | | animation.type = kCATransitionFade; |
| | | animation.duration = 0.4; |
| | | [cell.layer addAnimation:animation forKey:nil]; |
| | | cell.hidden = NO; |
| | | self.buttomView.hidden = NO; |
| | | } |
| | | |
| | | return cell; |
| | | } |
| | | |
| | | if (indexPath.section == 2) { |
| | | if (self.code == 2) { |
| | | if (self.recommendArray.count != 0) { |
| | | if (!self.goodsModel) { |
| | | CATransition *animation = [CATransition animation]; |
| | | animation.type = kCATransitionFade; |
| | | animation.duration = 0.4; |
| | | [self.recomeCell.layer addAnimation:animation forKey:nil]; |
| | | self.recomeCell.hidden = YES; |
| | | |
| | | } else { |
| | | |
| | | CATransition *animation = [CATransition animation]; |
| | | animation.type = kCATransitionFade; |
| | | animation.duration = 0.4; |
| | | [self.recomeCell.layer addAnimation:animation forKey:nil]; |
| | | self.recomeCell.hidden = NO; |
| | | } |
| | | return self.recomeCell; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (indexPath.section == 1) { |
| | | |
| | | if (self.code == 2) { |
| | | if (self.likeArray != 0) { |
| | | return self.likeCell; |
| | | } |
| | | |
| | | if (self.recommendArray != 0) { |
| | | return self.recomeCell; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (indexPath.section == 3) { |
| | | |
| | | if (_shopDetailType == 2 || _shopDetailType == 4) { |
| | | return self.likeCell; |
| | | |
| | | } else { |
| | | return self.recomeCell; |
| | | } |
| | | |
| | | } else { |
| | | return self.recomeCell; |
| | | } |
| | | } |
| | | |
| | | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section |
| | | { |
| | | if (self.code == 2) { |
| | | return 46; |
| | | } |
| | | |
| | | if (section == 0 ) { |
| | | return CGFLOAT_MIN; |
| | | } |
| | | |
| | | if (section == 1) { |
| | | if (self.shareUsersArray.count == 0) { |
| | | return CGFLOAT_MIN; |
| | | } |
| | | return 62; |
| | | } |
| | | |
| | | if (section == 4 && _shopDetailType == 2) { |
| | | return CGFLOAT_MIN; |
| | | } |
| | | |
| | | return 46; |
| | | } |
| | | |
| | | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section |
| | | { |
| | | UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 45)]; |
| | | view.backgroundColor = [UIColor whiteColor]; |
| | | if (self.code == 2) { |
| | | if (section == 1) { |
| | | if (self.likeArray.count != 0) { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"çä½ åæ¬¢" imageName:@"detail_icon_忬¢"]; |
| | | return headerView; |
| | | } |
| | | if (self.recommendArray.count != 0) { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"ç¸å
³æ¨è" imageName:@"detail_icon_æ¨è"]; |
| | | return headerView; |
| | | } |
| | | } |
| | | if (section == 2) { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"ç¸å
³æ¨è" imageName:@"detail_icon_æ¨è"]; |
| | | return headerView; |
| | | } |
| | | } |
| | | if(section == 1) { |
| | | if (self.shareUsersArray.count != 0) { |
| | | return self.shopview; |
| | | } |
| | | } |
| | | |
| | | if (section == 2) { |
| | | UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(15, 0, SCREEN_WIDTH - 40, 45)]; |
| | | label.text = @"æ¥çå®è´è¯¦æ
"; |
| | | label.font = [UIFont systemFontOfSize:15]; |
| | | label.textColor = SJColor(68, 68, 68, 1); |
| | | [view addSubview:label]; |
| | | UIImageView *imageview = [[UIImageView alloc]init]; |
| | | imageview.frame = CGRectMake(SCREEN_WIDTH - 32 - 10, CGRectGetMidY(label.frame) - 11, 22, 22); |
| | | UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 44, SCREEN_WIDTH, 1)]; |
| | | lineView.backgroundColor = XYRBackgroundColor; |
| | | if (isShowdetail) { |
| | | imageview.image = [UIImage imageNamed:@"ç®å¤´åä¸"]; |
| | | lineView.hidden = NO; |
| | | }else{ |
| | | imageview.image = [UIImage imageNamed:@"ç®å¤´åå³"]; |
| | | lineView.hidden = YES; |
| | | } |
| | | [view addSubview:imageview]; |
| | | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | button.frame = label.frame; |
| | | [button addTarget:self action:@selector(showShopDetail:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [view addSubview:button]; |
| | | } |
| | | /// 4 æ£å¸¸ 1 æ 忬¢ãæ¨è 2 æ æ¨è 3 æ 忬¢ |
| | | |
| | | if (section == 3 ) { |
| | | if (_shopDetailType == 2 || _shopDetailType == 4) { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"çä½ åæ¬¢" imageName:@"detail_icon_忬¢"]; |
| | | return headerView; |
| | | |
| | | } else { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"ç¸å
³æ¨è" imageName:@"detail_icon_æ¨è"]; |
| | | return headerView; |
| | | } |
| | | } |
| | | if (section == 4) { |
| | | UIView *headerView = [self setHeaderViewWithTitle:@"ç¸å
³æ¨è" imageName:@"detail_icon_æ¨è"]; |
| | | return headerView; |
| | | } |
| | | return view; |
| | | } |
| | | - (UIView *)setHeaderViewWithTitle:(NSString *)title imageName:(NSString *)imageName |
| | | { |
| | | UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 45)]; |
| | | |
| | | view.backgroundColor = [UIColor whiteColor]; |
| | | UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH / 2 - 30, 0, 70, 45)]; |
| | | label.textAlignment = NSTextAlignmentCenter; |
| | | label.text = title; |
| | | label.textColor = XYRMainColor; |
| | | label.font = [UIFont systemFontOfSize:17]; |
| | | |
| | | [view addSubview:label]; |
| | | |
| | | UIImageView *leftImage = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMinX(label.frame) - 66, CGRectGetMidY(view.frame) - 1, 25, 1)]; |
| | | leftImage.image = [UIImage imageNamed:@"guodu_left"]; |
| | | [view addSubview:leftImage]; |
| | | |
| | | UIImageView *rightImage = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(label.frame) + 12, CGRectGetMinY(leftImage.frame), 25, 1)]; |
| | | rightImage.image = [UIImage imageNamed:@"guodu_right"]; |
| | | [view addSubview:rightImage]; |
| | | UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(leftImage.frame) + 12, CGRectGetMidY(leftImage.frame) - 9.5, 19, 19)]; |
| | | imageview.image = [UIImage imageNamed:imageName]; |
| | | [view addSubview:imageview]; |
| | | |
| | | return view; |
| | | } |
| | | |
| | | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section |
| | | { |
| | | if (section == 0) { |
| | | if (self.code == 2) { |
| | | return 10; |
| | | |
| | | } else { |
| | | CGFloat heightRecommend = 0.0; |
| | | if ([self isHaveValue:self.goodsModel.descriptions]) { |
| | | CGFloat heghtDescr = [self getLabelHeightWithText:self.goodsModel.descriptions width:SCREEN_WIDTH - 20 font:(SCREEN_WIDTH < 375)?10:12] + 37 + 15 + 20; |
| | | heightRecommend = heghtDescr; |
| | | |
| | | } else { |
| | | heightRecommend = 10; |
| | | } |
| | | return heightRecommend; |
| | | } |
| | | |
| | | } else { |
| | | if (section == 1) { |
| | | if (self.shareUsersArray.count == 0) { |
| | | return CGFLOAT_MIN; |
| | | } |
| | | } |
| | | if (section == 2) { |
| | | if (isShowdetail) { |
| | | if (self.webHeight > 50) { |
| | | return self.webHeight + 10; |
| | | |
| | | } else { |
| | | return 50; |
| | | } |
| | | |
| | | } else { |
| | | return 10; |
| | | } |
| | | } |
| | | return 10; |
| | | } |
| | | } |
| | | |
| | | - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section |
| | | { |
| | | if (section == 0) { |
| | | if (self.code == 2) { |
| | | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 10)]; |
| | | view.backgroundColor = XYRBackgroundColor; |
| | | return view; |
| | | |
| | | } else { |
| | | CGFloat heightRecommend = 0.0; |
| | | if ([self isHaveValue:self.goodsModel.descriptions]) { |
| | | CGFloat heghtDescr = [self getLabelHeightWithText:self.goodsModel.descriptions width:SCREEN_WIDTH - 20 font:(SCREEN_WIDTH < 375)?10:12] + 37 + 15 + 20; |
| | | heightRecommend = heghtDescr; |
| | | |
| | | } else { |
| | | heightRecommend = CGFLOAT_MIN; |
| | | } |
| | | GoosStoreInfoView *view = [[GoosStoreInfoView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, heightRecommend)]; |
| | | view.model = self.goodsModel; |
| | | return view; |
| | | } |
| | | |
| | | } else { |
| | | if (section == 2) { |
| | | if (isShowdetail) { |
| | | if (self.webHeight > 50) { |
| | | self.contentScrollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, self.webHeight + 10); |
| | | self.contentScrollView.backgroundColor = XYRBackgroundColor; |
| | | self.detailWebView.frame = CGRectMake(0, 0, SCREEN_WIDTH, self.webHeight); |
| | | [self.contentScrollView addSubview:self.detailWebView]; |
| | | |
| | | } else { |
| | | self.contentScrollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 50); |
| | | self.contentScrollView.backgroundColor = XYRBackgroundColor; |
| | | [self.webLoadProgressView removeFromSuperview]; |
| | | [self.contentScrollView addSubview:self.webLoadProgressView]; |
| | | } |
| | | return self.contentScrollView; |
| | | } |
| | | } |
| | | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 10)]; |
| | | view.backgroundColor = XYRBackgroundColor; |
| | | return view; |
| | | } |
| | | } |
| | | /** |
| | | * ç¹å»åºéº |
| | | */ |
| | | - (void)onClickStore |
| | | { |
| | | kPreventRepeatClickTime(0.5); |
| | | [UMCustomShop umGoods_detail_shop_detail]; |
| | | ShonpingShareViewController *shonpingShareVc = [[ShonpingShareViewController alloc] init]; |
| | | shonpingShareVc.navaTitle = self.goodsModel.shopInfo.shopName; |
| | | shonpingShareVc.urlString = self.goodsModel.shopInfo.shopLink; |
| | | [self.navigationController pushViewController:shonpingShareVc animated:YES]; |
| | | } |
| | | |
| | | #pragma mark --- getter --- |
| | | - (UITableView *)detailTableview |
| | | { |
| | | if (_detailTableview ) { |
| | | return _detailTableview; |
| | | } |
| | | _tableviewHeight = 50; |
| | | |
| | | if (IS_IPHONE_X) { |
| | | _tableviewHeight = 70; |
| | | } |
| | | _detailTableview = [[UITableView alloc ]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - _tableviewHeight) style:UITableViewStyleGrouped]; |
| | | _detailTableview.delegate = self; |
| | | _detailTableview.dataSource = self; |
| | | _detailTableview.rowHeight = 300; |
| | | _detailTableview.separatorStyle = UITableViewCellSelectionStyleNone; |
| | | _detailTableview.estimatedRowHeight = 0; |
| | | _detailTableview.estimatedSectionFooterHeight = 0; |
| | | _detailTableview.estimatedSectionHeaderHeight = 0; |
| | | _detailTableview.hidden = YES; |
| | | _detailTableview.backgroundColor = XYRBackgroundColor; |
| | | |
| | | @weakify(self) |
| | | MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ |
| | | @strongify(self) |
| | | [self.detailTableview.mj_footer endRefreshingWithNoMoreData]; |
| | | }]; |
| | | [footer setTitle:@"" forState:MJRefreshStateIdle]; |
| | | [footer setTitle:@"" forState:MJRefreshStatePulling]; |
| | | [footer setTitle:@"" forState:MJRefreshStateRefreshing]; |
| | | _detailTableview.mj_footer = footer; |
| | | |
| | | [_detailTableview registerNib:[UINib nibWithNibName:@"GDDetailTableViewCell" bundle:nil] forCellReuseIdentifier:@"GDDetailTableViewCell"]; |
| | | [_detailTableview registerNib:[UINib nibWithNibName:@"NoShopTableViewCell" bundle:nil] forCellReuseIdentifier:@"NoShopTableViewCell"]; |
| | | //è§£å³æ»å¨è§å¾é¡¶é¨ç©ºåºç¶ææ é«åº¦çé®é¢ |
| | | if (@available(iOS 11.0, *)) { |
| | | _detailTableview.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; |
| | | |
| | | } else { |
| | | if([UIViewController instancesRespondToSelector:@selector(edgesForExtendedLayout)]) { |
| | | self.edgesForExtendedLayout = UIRectEdgeNone; |
| | | } |
| | | } |
| | | return _detailTableview; |
| | | } |
| | | |
| | | - (GDetailView *)topView |
| | | { |
| | | if (_topView) { |
| | | return _topView; |
| | | } |
| | | NSInteger height = 0; |
| | | |
| | | _topView = [[GDetailView alloc]initWithFrame:CGRectMake(0, height, SCREEN_WIDTH , kNavigationBarH + kStatusBarH)]; |
| | | _topView.backgroundColor = FLQNewNavigationBarColor; |
| | | _topView.goodButton.selected = YES; |
| | | _topView.lineView.frame = CGRectMake(CGRectGetMidX(self.topView.goodButton.frame) - 21, CGRectGetMaxY(self.topView.goodButton.frame)-5, 40, 4); |
| | | |
| | | _topView.delegate = self; |
| | | _topView.alpha = 0; |
| | | return _topView; |
| | | } |
| | | |
| | | - (ButtomCarView *)buttomView { |
| | | if (_buttomView) { |
| | | return _buttomView; |
| | | } |
| | | NSInteger height = 50; |
| | | if (IS_IPHONE_X) { |
| | | height = 70; |
| | | } |
| | | _buttomView = [[ButtomCarView alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT - height, SCREEN_WIDTH , height)]; |
| | | _buttomView.delegate = self; |
| | | return _buttomView; |
| | | } |
| | | |
| | | - (JDNOFanLiButtonView *)noFanLiButtomView |
| | | { |
| | | if (_noFanLiButtomView) { |
| | | return _noFanLiButtomView; |
| | | } |
| | | NSInteger height = IS_IPHONE_X? 70:50; |
| | | |
| | | _noFanLiButtomView = [[JDNOFanLiButtonView alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT - height, SCREEN_WIDTH , height)]; |
| | | _noFanLiButtomView.hidden = YES; |
| | | @weakify(self) |
| | | _noFanLiButtomView.onClickButtonEvent = ^(NSInteger type) { |
| | | @strongify(self) |
| | | if (type == 0) { |
| | | [self collectTaped:nil]; |
| | | |
| | | } else if (type == 1) { |
| | | [self buyClicked:nil]; |
| | | } |
| | | }; |
| | | return _noFanLiButtomView; |
| | | } |
| | | |
| | | - (WPHTransformView *)transitionView { |
| | | if (_transitionView) { |
| | | return _transitionView; |
| | | } |
| | | _transitionView = [[WPHTransformView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| | | _transitionView.hidden = YES; |
| | | return _transitionView; |
| | | } |
| | | |
| | | - (UIButton *)backButton { |
| | | if (_backButton ) { |
| | | return _backButton; |
| | | } |
| | | _backButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | NSInteger height = 27; |
| | | if (IS_IPHONE_X) { |
| | | height = 47; |
| | | } |
| | | _backButton.frame = CGRectMake(20, height, 30, 30); |
| | | [_backButton setImage:[UIImage imageNamed:@"left_back_around"] forState:UIControlStateNormal]; |
| | | return _backButton; |
| | | } |
| | | |
| | | - (UIButton *)moreShareButton |
| | | { |
| | | if (_moreShareButton ) { |
| | | return _moreShareButton; |
| | | } |
| | | _moreShareButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | NSInteger height = 27; |
| | | if (IS_IPHONE_X) { |
| | | height = 47; |
| | | } |
| | | _moreShareButton.frame = CGRectMake(SCREEN_WIDTH - 20 - 30, height, 30, 30); |
| | | |
| | | [_moreShareButton setImage:[UIImage imageNamed:@"æ´å¤___"] forState:UIControlStateNormal]; |
| | | [_moreShareButton addTarget:self action:@selector(moreshareClicked:) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | return _moreShareButton; |
| | | } |
| | | |
| | | - (UIButton *)blockBackButton { |
| | | if (!_blockBackButton ) { |
| | | _blockBackButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | _blockBackButton.frame = CGRectMake(0, 0, 70, kNavigationBarH + kStatusBarH); |
| | | [_blockBackButton addTarget:self action:@selector(backTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | return _blockBackButton; |
| | | } |
| | | |
| | | - (void)didReceiveMemoryWarning { |
| | | [super didReceiveMemoryWarning]; |
| | | } |
| | | |
| | | - (void)dealloc { |
| | | [self.webTimerDis invalidate]; |
| | | self.webTimerDis = nil; |
| | | if (self.timers) { |
| | | dispatch_source_cancel(self.timers); |
| | | } |
| | | [[ALNetWorking startInterface] cancelAll]; |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| | | if (self.code != 2 && self.extraDictionary) { |
| | | [self.detailWebView removeObserver:self forKeyPath:@"scrollView.contentSize"]; |
| | | } |
| | | } |
| | | |
| | | - (SJNoNetwork *)noNetworkViews { |
| | | if (_noNetworkViews) { |
| | | return _noNetworkViews; |
| | | } |
| | | _noNetworkViews = [[SJNoNetwork alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| | | _noNetworkViews.backgroundColor = XYRBackgroundColor; |
| | | [_noNetworkViews.connectBtn addTarget:self action:@selector(ClickConnectBtn:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [_noNetworkViews.buttonBack addTarget:self action:@selector(backTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | _noNetworkViews.hidden = YES; |
| | | _noNetworkViews.buttonBack.hidden = YES; |
| | | return _noNetworkViews; |
| | | } |
| | | |
| | | /** |
| | | ç¹å»èç½ |
| | | */ |
| | | - (void)ClickConnectBtn:(UIButton *)sender { |
| | | if (iOS10) { |
| | | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] |
| | | options:@{} completionHandler:nil]; |
| | | } else { |
| | | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; |
| | | } |
| | | } |
| | | |
| | | - (SJShopScrollView *)shopScrollView { |
| | | if (_shopScrollView) { |
| | | return _shopScrollView; |
| | | } |
| | | _shopScrollView = [[SJShopScrollView alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(self.topView.frame) + 16, SCREEN_WIDTH * 0.75, 30)]; |
| | | return _shopScrollView; |
| | | } |
| | | |
| | | - (SJRollingView *)currentRollingView { |
| | | if (_currentRollingView) { |
| | | return _currentRollingView; |
| | | } |
| | | _currentRollingView = [[SJRollingView alloc]initWithFrame:CGRectMake(0, kNavigationBarH + kStatusBarH, SCREEN_WIDTH, RollingViewHeight)]; |
| | | _currentRollingView.hidden = YES; |
| | | _currentRollingView.delegate = self; |
| | | return _currentRollingView; |
| | | } |
| | | |
| | | - (SJSharedTableViewCell *)shopview { |
| | | if (_shopview) { |
| | | return _shopview; |
| | | } |
| | | _shopview = [[SJSharedTableViewCell alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 62)]; |
| | | _shopview.backgroundColor = [UIColor whiteColor]; |
| | | return _shopview; |
| | | } |
| | | |
| | | - (GDrecomeTableViewCell *)likeCell { |
| | | if (_likeCell) { |
| | | return _likeCell; |
| | | } |
| | | _likeCell = [[GDrecomeTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"GDrecomeTableViewCell"]; |
| | | _likeCell.delegate = self; |
| | | _likeCell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | return _likeCell; |
| | | } |
| | | - (GDrecomeTableViewCell *)recomeCell { |
| | | if (_recomeCell) { |
| | | return _recomeCell; |
| | | } |
| | | _recomeCell = [[GDrecomeTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"GDrecomeTableViewCell"]; |
| | | _recomeCell.delegate = self; |
| | | _recomeCell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | return _recomeCell; |
| | | } |
| | | |
| | | - (UIView *)backView { |
| | | if (_backView) { |
| | | return _backView; |
| | | } |
| | | _backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| | | _backView.backgroundColor = UICOLOR_FROM_RGB(0xf3f3f3, 1.0); |
| | | |
| | | UIImage *image = nil; |
| | | NSString *string = nil; |
| | | |
| | | image = ALIMAGE_NAMED(@"defaultPage_noGoods"); |
| | | string = @"该ååå·²ç»ä¸æ¶äº~"; |
| | | |
| | | UIImageView *imageview = [[UIImageView alloc] init]; |
| | | imageview.image = image; |
| | | [_backView addSubview:imageview]; |
| | | _backView.hidden = YES; |
| | | |
| | | imageview.sd_layout.centerXEqualToView(_backView).centerYEqualToView(_backView).widthIs(image.size.width).heightIs(image.size.height); |
| | | |
| | | UILabel *label = [[UILabel alloc] init]; |
| | | label.textColor = UICOLOR_FROM_RGB(0x333333, 1.0); |
| | | label.font = [UIFont systemFontOfSize:15]; |
| | | label.textAlignment = NSTextAlignmentCenter; |
| | | label.text = string; |
| | | [_backView addSubview:label]; |
| | | |
| | | label.sd_layout.leftSpaceToView(_backView, 10).rightSpaceToView(_backView, 10).topSpaceToView(imageview, 20).autoHeightRatio(0); |
| | | |
| | | [label updateLayout]; |
| | | |
| | | CGFloat imageTopSpace = (SCREEN_HEIGHT - image.size.height - 20 - label.frame.size.height) / 2; |
| | | imageview.sd_resetLayout.centerXEqualToView(_backView).topSpaceToView(_backView, imageTopSpace).widthIs(image.size.width).heightIs(image.size.height); |
| | | |
| | | return _backView; |
| | | } |
| | | |
| | | - (void)setDetailUrlString:(NSString *)detailUrlString { |
| | | _detailUrlString = detailUrlString; |
| | | if ([self isHaveValue:detailUrlString]) { |
| | | [self.detailWebView loadHTMLString:detailUrlString baseURL:nil]; |
| | | } |
| | | } |
| | | - (WKWebView *)detailWebView |
| | | { |
| | | if (_detailWebView) { |
| | | return _detailWebView; |
| | | } |
| | | _detailWebView = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 0)]; |
| | | _detailWebView.UIDelegate = self; |
| | | _detailWebView.navigationDelegate = self; |
| | | _detailWebView.scrollView.userInteractionEnabled = NO;//ç¦æ¢æ»å¨ï¼é²æ¢ä¸UITableViewå²çª |
| | | [_detailWebView addObserver:self forKeyPath:@"scrollView.contentSize" options:NSKeyValueObservingOptionNew context:nil]; |
| | | return _detailWebView; |
| | | } |
| | | |
| | | -(UIScrollView *)contentScrollView |
| | | { |
| | | if (!_contentScrollView) { |
| | | _contentScrollView = [[UIScrollView alloc]init]; |
| | | _contentScrollView.contentSize = CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT); |
| | | _contentScrollView.scrollEnabled = NO;//ç¦æ¢æ»å¨ï¼é²æ¢ä¸UITableViewå²çª |
| | | } |
| | | return _contentScrollView; |
| | | } |
| | | |
| | | - (WebLoadProgressView *)webLoadProgressView |
| | | { |
| | | if (!_webLoadProgressView) { |
| | | _webLoadProgressView = [[WebLoadProgressView alloc] init]; |
| | | _webLoadProgressView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 50); |
| | | } |
| | | return _webLoadProgressView; |
| | | } |
| | | |
| | | // 页é¢å¼å§å è½½æ¶è°ç¨ |
| | | - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation |
| | | { |
| | | @weakify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | @strongify(self) |
| | | self.webTimerDis = [NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(doSomethingDis) userInfo:nil repeats:NO]; |
| | | }); |
| | | } |
| | | |
| | | - (void)doSomethingDis { |
| | | [self.webLoadProgressView clearHideView]; |
| | | } |
| | | |
| | | // 页é¢å è½½å®æä¹åè°ç¨ |
| | | - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation |
| | | { |
| | | @weakify(self) |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | @strongify(self) |
| | | [self doSomethingDis]; |
| | | }); |
| | | } |
| | | |
| | | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context { |
| | | if (object == self.detailWebView && [keyPath isEqual:@"scrollView.contentSize"]) { |
| | | UIScrollView *scrollView = self.detailWebView.scrollView; |
| | | CGSize size = CGSizeMake(SCREEN_WIDTH, scrollView.contentSize.height); |
| | | if (size.height > self.tempWebHeight) { |
| | | self.tempWebHeight = size.height + 20; |
| | | self.webHeight = size.height + 20; |
| | | @weakify(self) |
| | | [UIView performWithoutAnimation:^{ |
| | | @strongify(self) |
| | | [self.detailTableview reloadData]; |
| | | }]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | - (NSMutableArray *)likeArray { |
| | | if (!_likeArray) { |
| | | _likeArray = [[NSMutableArray alloc] init]; |
| | | } |
| | | return _likeArray; |
| | | } |
| | | |
| | | - (NSMutableArray *)recommendArray { |
| | | if (!_recommendArray) { |
| | | _recommendArray = [[NSMutableArray alloc] init]; |
| | | } |
| | | return _recommendArray; |
| | | } |
| | | |
| | | - (BaseTipArrPopView *)baseTipArrPopView { |
| | | if (!_baseTipArrPopView) { |
| | | _baseTipArrPopView = [[BaseTipArrPopView alloc] init]; |
| | | } |
| | | return _baseTipArrPopView; |
| | | } |
| | | |
| | | - (BaseTipsPopView *)baseTipsPopView { |
| | | if (!_baseTipsPopView) { |
| | | _baseTipsPopView = [[BaseTipsPopView alloc] init]; |
| | | } |
| | | return _baseTipsPopView; |
| | | } |
| | | |
| | | - (FetchGoldcoinPopView *)fetchGoldcoinPopView { |
| | | if (!_fetchGoldcoinPopView) { |
| | | _fetchGoldcoinPopView = [[FetchGoldcoinPopView alloc] init]; |
| | | } |
| | | return _fetchGoldcoinPopView; |
| | | } |
| | | |
| | | - (UILabel *)labelSubsidy { |
| | | if (!_labelSubsidy) { |
| | | _labelSubsidy = [[UILabel alloc] init]; |
| | | _labelSubsidy.hidden = YES; |
| | | _labelSubsidy.textColor = UIColorFromRGBValue(0xE5005C); |
| | | _labelSubsidy.textAlignment = NSTextAlignmentCenter; |
| | | _labelSubsidy.font = [UIFont systemFontOfSize:10]; |
| | | _labelSubsidy.backgroundColor = UIColorFromRGBValue(0xFFE7F1); |
| | | } |
| | | return _labelSubsidy; |
| | | } |
| | | |
| | | - (UIImageView *)imageViewSJ { |
| | | if (!_imageViewSJ) { |
| | | _imageViewSJ = [[UIImageView alloc] init]; |
| | | _imageViewSJ.hidden = YES; |
| | | _imageViewSJ.image = ALIMAGE_NAMED(@"goodsdetail_sj"); |
| | | } |
| | | return _imageViewSJ; |
| | | } |
| | | |
| | | @end |
| | |
| | | { |
| | | @strongify(self) |
| | | |
| | | if ([object[@"code"] integerValue] == 0) { |
| | | if ([self isHaveValue:object] && [object[@"code"] integerValue] == 0) { |
| | | self.model = [MoneyStatisticModel yy_modelWithJSON:object[@"data"]]; |
| | | [self.dataSourceArr removeAllObjects]; |
| | | if ([self isHaveValue:self.model.todayPredict]) { |
| | | [self.dataSourceArr addObject:self.model.todayPredict]; |
| | | } |
| | | |
| | | [self.dataSourceArr addObject:self.model.todayPredict]; |
| | | [self.dataSourceArr addObject:self.model.monthPredict]; |
| | | if ([self isHaveValue:self.model.monthPredict]) { |
| | | [self.dataSourceArr addObject:self.model.monthPredict]; |
| | | } |
| | | |
| | | @weakify(self) |
| | | [UIView performWithoutAnimation:^{ |
| | |
| | | } |
| | | |
| | | - (void)NetWorkStatesChange:(NSNotification *)sender { |
| | | |
| | | int networkState = [[sender object] intValue]; |
| | | |
| | | self.netWorkCode = networkState; |
| | | |
| | | switch (networkState) { |
| | | |
| | | case -1: { |
| | | if (self.dataSourceArr.count == 0 || !self.dataSourceArr) { |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | |
| | | @property (nonatomic, strong) UIView *quanView; |
| | | |
| | | @property (nonatomic, strong) UILabel *quanLabel; |
| | | /// ææ£ |
| | | @property (nonatomic, nullable, strong) UILabel *labelDisCount; |
| | | |
| | | @property (nonatomic, nullable, strong) UIImageView *imageViewStore; |
| | | @property (nonatomic, nullable, strong) UILabel *stroreLabel; |
| | |
| | | |
| | | [self.quanView addSubview:self.couponLabel]; |
| | | self.couponLabel.sd_layout.leftSpaceToView(self.quanLabel, 0).rightSpaceToView(self.quanView, 0).topSpaceToView(self.quanView, 0).bottomSpaceToView(self.quanView, 0); |
| | | |
| | | // ææ£ |
| | | [self.bgView addSubview:self.labelDisCount]; |
| | | self.labelDisCount.sd_layout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).heightIs(0).widthIs(18); |
| | | self.labelDisCount.sd_cornerRadius = @3; |
| | | |
| | | // è¿å©è§å¾ |
| | | [self.bgView addSubview:self.fanLabel]; |
| | |
| | | } else if (model.shopType == 30){ |
| | | [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_pdd"]]; |
| | | icomImage = [UIImage imageNamed:@"ic_share_pdd"]; |
| | | |
| | | } else if (model.shopType == 40){ |
| | | [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_wph"]]; |
| | | icomImage = [UIImage imageNamed:@"ic_share_wph"]; |
| | | |
| | | } else if (model.shopType == 50){ |
| | | [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_sn"]]; |
| | | icomImage = [UIImage imageNamed:@"ic_share_sn"]; |
| | | |
| | | } |
| | | self.typeImageView.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).topSpaceToView(self.bgView, 8).widthIs(icomImage.size.width).heightIs(icomImage.size.height); |
| | | |
| | |
| | | |
| | | self.titleLabel.attributedText = attributedString; |
| | | // è¿å© |
| | | NSString *fanLiString = nil; |
| | | self.fanLabel.textColor = UIColorFromRGBValue(0xE5005C); |
| | | self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE7F1); |
| | | NSString *fanLiString = [NSString stringWithFormat:@"è¿ %@",model.moneyInfo.fanliMoney]; |
| | | |
| | | if (model.moneyInfo.moneyType == 1) { |
| | | self.fanLabel.textColor = UIColorFromRGBValue(0xE5005C); |
| | | self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE7F1); |
| | | fanLiString = [NSString stringWithFormat:@"è¿ %@",model.moneyInfo.fanliMoney]; |
| | | |
| | | } else { |
| | | self.fanLabel.textColor = UIColorFromRGBValue(0xFF7800); |
| | | self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE5C5); |
| | | fanLiString = [NSString stringWithFormat:@"å¥ %@",model.moneyInfo.fanliMoney]; |
| | | } |
| | | |
| | | CGFloat fanLabelWidth = [self getWidthWithText:fanLiString height:18 font:self.fanLabel.font.pointSize]; |
| | | self.fanLabel.text = fanLiString; |
| | |
| | | |
| | | } else { |
| | | self.quanView.hidden = YES; |
| | | totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; |
| | | if (model.shopType == 40) { |
| | | totalPriceString = [NSString stringWithFormat:@"%@", model.couponPrice]; |
| | | |
| | | } else { |
| | | totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; |
| | | } |
| | | |
| | | self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); |
| | | } |
| | | |
| | | self.totalPriceLabel.text = totalPriceString; |
| | | |
| | | // ææ£ |
| | | if (model.shopType == 40) { |
| | | self.labelDisCount.hidden = NO; |
| | | self.salesLabel.hidden = YES; |
| | | |
| | | if ([self isHaveValue:model.discount]) { |
| | | |
| | | CGFloat discountLabellWidth = [self getWidthWithText:model.discount height:18 font:self.fanLabel.font.pointSize]; |
| | | self.labelDisCount.text = model.discount; |
| | | |
| | | self.labelDisCount.sd_layout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).heightIs(18).widthIs(roundf(discountLabellWidth + 16)); |
| | | |
| | | self.fanLabel.sd_resetLayout.leftSpaceToView(self.labelDisCount, 8).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); |
| | | |
| | | } else { |
| | | self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); |
| | | } |
| | | |
| | | } else { |
| | | self.labelDisCount.hidden = YES; |
| | | } |
| | | |
| | | // æé«è¿å© |
| | | NSString *stringMaxFan = model.moneyInfo.maxMoney; |
| | |
| | | maskLayer.path = maskPath.CGPath; |
| | | self.labelMaxFan.layer.mask = maskLayer; |
| | | }; |
| | | if (model.moneyInfo.maxMoney && ![model.moneyInfo.maxMoney isEqualToString:@""]) { |
| | | if (model.moneyInfo.maxMoney && ![model.moneyInfo.maxMoney isEqualToString:@""] && model.shopType != 40) { |
| | | self.imageSanJiao.hidden = NO; |
| | | self.labelMaxFan.hidden = NO; |
| | | |
| | |
| | | return _labelMaxFan; |
| | | } |
| | | |
| | | - (UILabel *)labelDisCount { |
| | | if (!_labelDisCount) { |
| | | _labelDisCount = [[UILabel alloc] init]; |
| | | _labelDisCount.textColor = UIColorFromRGBValue(0xFFFFFF); |
| | | _labelDisCount.font = [UIFont systemFontOfSize:12]; |
| | | _labelDisCount.textAlignment = NSTextAlignmentCenter; |
| | | _labelDisCount.backgroundColor = UIColorFromRGBValue(0xE5005C); |
| | | _labelDisCount.hidden = YES; |
| | | } |
| | | return _labelDisCount; |
| | | } |
| | | |
| | | @end |
| | |
| | | @property (nonatomic, strong) UIView *quanView; |
| | | |
| | | @property (nonatomic, strong) UILabel *quanLabel; |
| | | /// ææ£ |
| | | @property (nonatomic, nullable, strong) UILabel *labelDisCount; |
| | | |
| | | @property (nonatomic, nullable, strong) UIImageView *imageViewStore; |
| | | @property (nonatomic, nullable, strong) UILabel *stroreLabel; |
| | |
| | | |
| | | [self.quanView addSubview:self.couponLabel]; |
| | | self.couponLabel.sd_layout.leftSpaceToView(self.quanLabel, 0).rightSpaceToView(self.quanView, 0).topSpaceToView(self.quanView, 0).bottomSpaceToView(self.quanView, 0); |
| | | |
| | | // ææ£ |
| | | [self.bgView addSubview:self.labelDisCount]; |
| | | self.labelDisCount.sd_layout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).heightIs(0).widthIs(18); |
| | | self.labelDisCount.sd_cornerRadius = @3; |
| | | |
| | | // è¿å©è§å¾ |
| | | [self.bgView addSubview:self.fanLabel]; |
| | |
| | | } else if (model.shopType == 30){ |
| | | [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_pdd"]]; |
| | | icomImage = [UIImage imageNamed:@"ic_share_pdd"]; |
| | | |
| | | } else if (model.shopType == 40){ |
| | | [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_wph"]]; |
| | | icomImage = [UIImage imageNamed:@"ic_share_wph"]; |
| | | |
| | | } else if (model.shopType == 50){ |
| | | [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_sn"]]; |
| | | icomImage = [UIImage imageNamed:@"ic_share_sn"]; |
| | | |
| | | } |
| | | self.typeImageView.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).topSpaceToView(self.bgView, 8).widthIs(icomImage.size.width).heightIs(icomImage.size.height); |
| | | |
| | |
| | | |
| | | self.titleLabel.attributedText = attributedString; |
| | | // è¿å© |
| | | NSString *fanLiString = nil; |
| | | |
| | | if (model.moneyInfo.moneyType == 1) { |
| | | self.fanLabel.textColor = UIColorFromRGBValue(0xE5005C); |
| | | self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE7F1); |
| | | fanLiString = [NSString stringWithFormat:@"è¿ %@",model.moneyInfo.fanliMoney]; |
| | | |
| | | } else { |
| | | self.fanLabel.textColor = UIColorFromRGBValue(0xFF7800); |
| | | self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE5C5); |
| | | fanLiString = [NSString stringWithFormat:@"å¥ %@",model.moneyInfo.fanliMoney]; |
| | | } |
| | | NSString *fanLiString = fanLiString = [NSString stringWithFormat:@"è¿ %@",model.moneyInfo.fanliMoney]; |
| | | self.fanLabel.textColor = UIColorFromRGBValue(0xE5005C); |
| | | self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE7F1); |
| | | |
| | | CGFloat fanLabelWidth = [self getWidthWithText:fanLiString height:18 font:self.fanLabel.font.pointSize]; |
| | | self.fanLabel.text = fanLiString; |
| | |
| | | |
| | | } else { |
| | | self.quanView.hidden = YES; |
| | | totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; |
| | | if (model.shopType == 40) { |
| | | totalPriceString = [NSString stringWithFormat:@"%@", model.couponPrice]; |
| | | |
| | | } else { |
| | | totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; |
| | | } |
| | | self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); |
| | | } |
| | | |
| | | self.totalPriceLabel.text = totalPriceString; |
| | | |
| | | // ææ£ |
| | | if (model.shopType == 40) { |
| | | self.labelDisCount.hidden = NO; |
| | | self.salesLabel.hidden = YES; |
| | | |
| | | if ([self isHaveValue:model.discount]) { |
| | | |
| | | CGFloat discountLabellWidth = [self getWidthWithText:model.discount height:18 font:self.fanLabel.font.pointSize]; |
| | | self.labelDisCount.text = model.discount; |
| | | |
| | | self.labelDisCount.sd_layout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).heightIs(18).widthIs(roundf(discountLabellWidth + 16)); |
| | | |
| | | self.fanLabel.sd_resetLayout.leftSpaceToView(self.labelDisCount, 8).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); |
| | | |
| | | } else { |
| | | self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); |
| | | } |
| | | |
| | | } else { |
| | | self.labelDisCount.hidden = YES; |
| | | } |
| | | |
| | | // æé«è¿å© |
| | | NSString *stringMaxFan = model.moneyInfo.maxMoney; |
| | |
| | | maskLayer.path = maskPath.CGPath; |
| | | self.labelMaxFan.layer.mask = maskLayer; |
| | | }; |
| | | if (model.moneyInfo.maxMoney && ![model.moneyInfo.maxMoney isEqualToString:@""]) { |
| | | if (model.moneyInfo.maxMoney && ![model.moneyInfo.maxMoney isEqualToString:@""] && model.shopType != 40) { |
| | | self.imageSanJiao.hidden = NO; |
| | | self.labelMaxFan.hidden = NO; |
| | | |
| | |
| | | return _labelMaxFan; |
| | | } |
| | | |
| | | - (UILabel *)labelDisCount { |
| | | if (!_labelDisCount) { |
| | | _labelDisCount = [[UILabel alloc] init]; |
| | | _labelDisCount.textColor = UIColorFromRGBValue(0xFFFFFF); |
| | | _labelDisCount.font = [UIFont systemFontOfSize:12]; |
| | | _labelDisCount.textAlignment = NSTextAlignmentCenter; |
| | | _labelDisCount.backgroundColor = UIColorFromRGBValue(0xE5005C); |
| | | _labelDisCount.hidden = YES; |
| | | } |
| | | return _labelDisCount; |
| | | } |
| | | |
| | | @end |
| | |
| | | self = [super initWithFrame:frame]; |
| | | if (self) { |
| | | self.backgroundColor = XYRBackgroundColor; |
| | | self.arrayTitle = @[@"å享记å½",@"å享åº",@"龿¥è½¬æ¢"]; |
| | | self.arrayTitle = @[@"å享记å½",@"ä¸é®åå",@"龿¥è½¬æ¢"]; |
| | | self.arrayImages = @[@"icon_å享记å½",@"icon_éååº",@"mine_links_to_convert"]; |
| | | [self setuoViewConfig]; |
| | | } |
| | |
| | | view = nil; |
| | | } |
| | | if ([self isHaveValue:_tearcherLink]) { |
| | | self.arrayTitle = @[@"å享记å½",@"å享åº",@"龿¥è½¬æ¢",@"导å¸å¾®ä¿¡"]; |
| | | self.arrayTitle = @[@"å享记å½",@"ä¸é®åå",@"龿¥è½¬æ¢",@"导å¸å¾®ä¿¡"]; |
| | | self.arrayImages = @[@"icon_å享记å½",@"icon_éååº",@"mine_links_to_convert",@"mine_tutor"]; |
| | | |
| | | } else { |
| | | self.arrayTitle = @[@"å享记å½",@"å享åº",@"龿¥è½¬æ¢"]; |
| | | self.arrayTitle = @[@"å享记å½",@"ä¸é®åå",@"龿¥è½¬æ¢"]; |
| | | self.arrayImages = @[@"icon_å享记å½",@"icon_éååº",@"mine_links_to_convert"]; |
| | | } |
| | | CGFloat sizeFont = 13; |
| | |
| | | } |
| | | #pragma mark - MineSixCellCellDelegate(å享记å½ï¼å享åº) |
| | | - (void)MineSixCellOnCliclk:(MineSixCellCellType)type { |
| | | if (!self.isLogin) { |
| | | [self onLoginVcName:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | if (type == MineSixCellCellShareRecord) { |
| | | [UMCustomUser umUser_sharerecord]; |
| | | if (!self.isLogin) { |
| | | [self onLoginVcName:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self pushAnyInterfaceController:@"ALShareRecordController" parms:nil]; |
| | | } |
| | | if (type == MineSixCellCellSharedLibraries) { |
| | | [UMCustomUser umUser_XPK]; |
| | | if (!self.isLogin) { |
| | | [self onLoginVcName:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self pushAnyInterfaceController:@"SJProLibViewController" parms:nil]; |
| | | //[self pushAnyInterfaceController:@"SJProLibViewController" parms:nil]; |
| | | } |
| | | if (type == MineSixCellCellLinksToConvert) { |
| | | if (!self.isLogin) { |
| | | [self onLoginVcName:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":_convertLinkUrl?:@""}]; |
| | | } |
| | | if (type == MineSixCellCellTutor) { |
| | | if (!self.isLogin) { |
| | | [self onLoginVcName:nil]; |
| | | return; |
| | | } |
| | | // æ¯å¦æ¿æ´»é请åè½ |
| | | if (![ALUserInfoServiceManger isInvited]) { |
| | | [self onInviteVcName:nil]; |
| | | return; |
| | | } |
| | | [self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":_tearcherLink?:@""}]; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | [self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":newuserGL?:@""}]; |
| | | //[self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":@"http://192.168.1.66:8848/flqFront/AppInside/openVip/index.html"}]; |
| | | |
| | | } else if (index == 201) { |
| | | [UMCustomUser umUser_help]; |
| | | [self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":[YTHsharedManger startManger].help?:@""}]; |
| | | //[self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":[YTHsharedManger startManger].help?:@""}]; |
| | | |
| | | //[self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":@"http://192.168.1.114:8848/flqFront/AppInside/supVipManage/index.html"}]; |
| | | //[self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":@"http://192.168.1.122:8848/test/WKWebView.html"}]; |
| | | [self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":@"http://192.168.1.114:8848/flqFront/AppInside/cloudPushOrder/cloudPushOrderManage.html"}]; |
| | | //[self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":@"https://test-open.czb365.com/redirection/todo/?platformType=98645363&platformCode=17784739772"}]; |
| | | |
| | | } else if (index == 202) { |
| | | [UMCustomUser umUser_service]; |
New file |
| | |
| | | // |
| | | // RecommendDetailController.h |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "BaseViewController.h" |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @interface RecommendDetailController : BaseViewController |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // RecommendDetailController.m |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "RecommendDetailController.h" |
| | | #import "RecommendDetailHeaderView.h" |
| | | #import "RecommendDetailFooterView.h" |
| | | |
| | | @interface RecommendDetailController () |
| | | |
| | | @property (nonatomic, nullable, strong) UIScrollView *scrollView; |
| | | |
| | | @property (nonatomic, nullable, strong) RecommendDetailHeaderView *viewRecommendDetailHeader; |
| | | @property (nonatomic, assign) CGFloat heightRecommendDetailHeaderView; |
| | | |
| | | @property (nonatomic, nullable, strong) RecommendDetailFooterView *viewRecommendDetailFooter; |
| | | @property (nonatomic, assign) CGFloat heightRecommendDetailFooterView; |
| | | @end |
| | | |
| | | @implementation RecommendDetailController |
| | | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | [self setupDataConfig]; |
| | | [self setupNavConfig]; |
| | | [self setupViewConfig]; |
| | | } |
| | | |
| | | - (void)setupDataConfig { |
| | | CGFloat heightTitle = [self getLabelHeightWithText:@"主æ é¢ä¸»æ é¢ä¸»æ é¢ä¸»æ é¢ä¸»æ é¢ä¸»" width:SCREEN_WIDTH - 30 font:15]; |
| | | CGFloat heightDesc = [self getLabelHeightWithText:@"坿 é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ 坿 é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ " width:SCREEN_WIDTH - 30 font:12]; |
| | | |
| | | self.heightRecommendDetailHeaderView = 12 + heightTitle + 18 + 12 + 27 + heightDesc + 25; |
| | | self.heightRecommendDetailFooterView = IS_IPHONE_X?68:48; |
| | | } |
| | | |
| | | - (void)setupViewConfig { |
| | | |
| | | [self.view addSubview:self.scrollView]; |
| | | [self.scrollView addSubview:self.viewRecommendDetailHeader]; |
| | | |
| | | [self.view addSubview:self.viewRecommendDetailFooter]; |
| | | } |
| | | |
| | | - (void)setupNavConfig { |
| | | self.navigationController.navigationBar.translucent = NO; |
| | | self.navigationController.navigationBar.barTintColor = FLQNewNavigationBarColor; |
| | | self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:FLQNewNavigationTitleColor,NSFontAttributeName:[UIFont boldSystemFontOfSize:FLQNewNavigationTitleFont]}; |
| | | |
| | | self.title = @"æ´»å¨è¯¦æ
"; |
| | | self.view.backgroundColor = XYRBackgroundColor; |
| | | } |
| | | |
| | | - (RecommendDetailHeaderView *)viewRecommendDetailHeader { |
| | | if (!_viewRecommendDetailHeader) { |
| | | _viewRecommendDetailHeader = [[RecommendDetailHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, _heightRecommendDetailHeaderView)]; |
| | | } |
| | | return _viewRecommendDetailHeader; |
| | | } |
| | | |
| | | - (UIScrollView *)scrollView { |
| | | if (!_scrollView) { |
| | | _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - kNavigationBarH - kStatusBarH - _heightRecommendDetailFooterView)]; |
| | | } |
| | | return _scrollView; |
| | | } |
| | | |
| | | - (RecommendDetailFooterView *)viewRecommendDetailFooter { |
| | | if (!_viewRecommendDetailFooter) { |
| | | _viewRecommendDetailFooter = [[RecommendDetailFooterView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - _heightRecommendDetailFooterView - kNavigationBarH - kStatusBarH, SCREEN_WIDTH, _heightRecommendDetailFooterView)]; |
| | | } |
| | | return _viewRecommendDetailFooter; |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // RecommendDetailFooterView.h |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @interface RecommendDetailFooterView : UIView |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // RecommendDetailFooterView.m |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "RecommendDetailFooterView.h" |
| | | |
| | | @implementation RecommendDetailFooterView |
| | | |
| | | - (instancetype)initWithFrame:(CGRect)frame { |
| | | self = [super initWithFrame:frame]; |
| | | if (self) { |
| | | self.backgroundColor = [UIColor whiteColor]; |
| | | [self setupViewConfig]; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)setupViewConfig { |
| | | ALButton *button = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [button setTitle:@"ç«å³å享" forState:UIControlStateNormal]; |
| | | [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
| | | button.titleLabel.font = [UIFont systemFontOfSize:17]; |
| | | button.backgroundColor = UIColorFromRGBValue(0xE5005B); |
| | | [self addSubview:button]; |
| | | |
| | | button.sd_layout.topSpaceToView(self, 5).centerXEqualToView(self).widthIs(SCREEN_WIDTH - 48 * 2) .heightIs(38); |
| | | button.sd_cornerRadius = @19; |
| | | } |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // RecommendDetailHeaderView.h |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @interface RecommendDetailHeaderView : UIView |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // RecommendDetailHeaderView.m |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "RecommendDetailHeaderView.h" |
| | | #import "TopLeftLabel.h" |
| | | |
| | | @interface RecommendDetailHeaderView () |
| | | |
| | | @property (nonatomic, nullable, strong) TopLeftLabel *labelTitle; |
| | | |
| | | @property (nonatomic, nullable, strong) UILabel *labelNickName; |
| | | |
| | | @property (nonatomic, nullable, strong) UILabel *labelDate; |
| | | |
| | | @property (nonatomic, nullable, strong) UILabel *labelCount;; |
| | | |
| | | @property (nonatomic, nullable, strong) UIImageView *imageView; |
| | | |
| | | @property (nonatomic, nullable, strong) UILabel *labelDesc; |
| | | @end |
| | | |
| | | @implementation RecommendDetailHeaderView |
| | | |
| | | - (instancetype)initWithFrame:(CGRect)frame { |
| | | self = [super initWithFrame:frame]; |
| | | if (self) { |
| | | self.backgroundColor = [UIColor whiteColor]; |
| | | [self setupViewConfig]; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)setupViewConfig { |
| | | self.labelTitle = [[TopLeftLabel alloc] init]; |
| | | self.labelTitle.text = @"主æ é¢ä¸»æ é¢ä¸»æ é¢ä¸»æ é¢ä¸»æ é¢ä¸»"; |
| | | self.labelTitle.textAlignment = NSTextAlignmentLeft; |
| | | self.labelTitle.textColor = UIColorFromRGBValue(0x333333); |
| | | self.labelTitle.font = [UIFont systemFontOfSize:15]; |
| | | [self addSubview:self.labelTitle]; |
| | | |
| | | self.labelNickName = [[UILabel alloc] init]; |
| | | self.labelNickName.text = @"æ¿æ å°äº"; |
| | | self.labelNickName.textAlignment = NSTextAlignmentLeft; |
| | | self.labelNickName.textColor = UIColorFromRGBValue(0x000000); |
| | | self.labelNickName.font = [UIFont systemFontOfSize:12]; |
| | | [self addSubview:self.labelNickName]; |
| | | |
| | | self.labelDate = [[UILabel alloc] init]; |
| | | self.labelDate.text = @"2020.20.02 20:00"; |
| | | self.labelDate.textAlignment = NSTextAlignmentLeft; |
| | | self.labelDate.textColor = UIColorFromRGBValue(0x999999); |
| | | self.labelDate.font = [UIFont systemFontOfSize:12]; |
| | | [self addSubview:self.labelDate]; |
| | | |
| | | self.labelCount = [[UILabel alloc] init]; |
| | | self.labelCount.text = @"1.5ä¸"; |
| | | self.labelCount.textAlignment = NSTextAlignmentRight; |
| | | self.labelCount.textColor = UIColorFromRGBValue(0xA6A6A6); |
| | | self.labelCount.font = [UIFont systemFontOfSize:12]; |
| | | [self addSubview:self.labelCount]; |
| | | |
| | | self.imageView = [[UIImageView alloc] init]; |
| | | self.imageView.image = ALIMAGE_NAMED(@"recommendRecord_eyes"); |
| | | [self addSubview:self.imageView]; |
| | | |
| | | self.labelDesc = [[UILabel alloc] init]; |
| | | self.labelDesc.text = @"坿 é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ 坿 é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ é¢å¯æ "; |
| | | self.labelDesc.textAlignment = NSTextAlignmentLeft; |
| | | self.labelDesc.textColor = UIColorFromRGBValue(0x666666); |
| | | self.labelDesc.font = [UIFont systemFontOfSize:12]; |
| | | [self addSubview:self.labelDesc]; |
| | | |
| | | self.labelTitle.sd_layout.leftSpaceToView(self, 15).topSpaceToView(self, 10).rightSpaceToView(self, 10).autoHeightRatio(0); |
| | | self.labelTitle.sd_layout.maxHeightIs(38); |
| | | |
| | | self.labelNickName.sd_layout.leftSpaceToView(self, 15).topSpaceToView(self.labelTitle, 18).autoWidthRatio(0).heightIs(12); |
| | | self.labelNickName.sd_maxWidth = @150; |
| | | |
| | | self.labelDate.sd_layout.leftSpaceToView(self.labelNickName, 17).centerYEqualToView(self.labelNickName).autoWidthRatio(0).heightIs(12); |
| | | self.labelDate.sd_maxWidth = @150; |
| | | |
| | | self.labelCount.sd_layout.rightSpaceToView(self, 15).centerYEqualToView(self.labelNickName).autoWidthRatio(0).heightIs(12); |
| | | self.labelCount.sd_maxWidth = @100; |
| | | |
| | | self.imageView.sd_layout.rightSpaceToView(self.labelCount, 4).centerYEqualToView(self.labelNickName).widthIs(16).heightIs(13); |
| | | |
| | | self.labelDesc.sd_layout.leftSpaceToView(self, 15).topSpaceToView(self.labelNickName, 27).rightSpaceToView(self, 15).autoHeightRatio(0); |
| | | } |
| | | |
| | | @end |
| | |
| | | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
| | | // 鲿¢è¿ç»ç¹å»] |
| | | kPreventRepeatClickTime(0.5); |
| | | [UMCustomUser umUser_recommend_history_list_detail]; |
| | | [self fetchGoldCofin]; |
| | | NSString *pageClassName = ((RecommendHistoryModel *)self.dataSource[indexPath.section]).jumpDetail.controller; |
| | | [self jumpPage:pageClassName :((RecommendHistoryModel *)self.dataSource[indexPath.section]).params]; |
| | | //[UMCustomUser umUser_recommend_history_list_detail]; |
| | | //[self fetchGoldCofin]; |
| | | //NSString *pageClassName = ((RecommendHistoryModel *)self.dataSource[indexPath.section]).jumpDetail.controller; |
| | | //[self jumpPage:pageClassName :((RecommendHistoryModel *)self.dataSource[indexPath.section]).params]; |
| | | |
| | | [self pushAnyInterfaceController:@"RecommendDetailController" parms:nil]; |
| | | } |
| | | |
| | | #pragma mark - è¡¨æ ¼å°¾é¨é«åº¦ |
| | |
| | | #import "BrandRebateDetailController.h" |
| | | |
| | | // Views |
| | | //#import "SearchDetailSelectView.h" |
| | | #import "SearchDetailFilterView.h" |
| | | #import "SearchDetailFilterWPHView.h" |
| | | |
| | | #import "SearchDetailConditionView.h" |
| | | #import "SearchDetailFiltrPriceView.h" |
| | | |
| | |
| | | @property (nonatomic, nullable, strong) YTHSearchTextField *searchField; |
| | | /// çéè§å¾ |
| | | @property (nonatomic, nullable, strong) SearchDetailFilterView *searchDetailFilterView; |
| | | @property (nonatomic, nullable, strong) SearchDetailFilterWPHView *viewSearchDetailFilterWPH; |
| | | |
| | | @property (nonatomic, nullable, strong) SearchDetailConditionView *searchDetailConditionView; |
| | | |
| | |
| | | }; |
| | | |
| | | - (void)setupViewConfig { |
| | | [self.view addSubview:self.searchDetailFilterView]; |
| | | if ([_goodsType integerValue] == 4) { |
| | | [self.view addSubview:self.viewSearchDetailFilterWPH]; |
| | | |
| | | } else { |
| | | [self.view addSubview:self.searchDetailFilterView]; |
| | | } |
| | | |
| | | [self.view addSubview:self.searchDetailFiltrPriceView]; |
| | | [self.view addSubview:self.tableView]; |
| | | |
| | |
| | | - (void)resetSearchData:(NSString *)searchKey { |
| | | self.searchKey = searchKey; |
| | | [self resetDataCoing]; |
| | | [self resetDataWPHCoing]; |
| | | [self.tableView.mj_header beginRefreshing]; |
| | | } |
| | | |
| | |
| | | [self.searchDetailFilterView.priceButton addTarget:self action:@selector(onFilterGoods:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [self.searchDetailFilterView.rebatesButton addTarget:self action:@selector(onFilterGoods:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [self.searchDetailFilterView.filteringButton addTarget:self action:@selector(onFilterGoods:) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | self.viewSearchDetailFilterWPH.buttonSynthesis.tag = 700; |
| | | self.viewSearchDetailFilterWPH.buttonDiscount.tag = 701; |
| | | self.viewSearchDetailFilterWPH.priceButton.tag = 702; |
| | | |
| | | [self.viewSearchDetailFilterWPH.buttonSynthesis addTarget:self action:@selector(onFilterGoodsWPH:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [self.viewSearchDetailFilterWPH.buttonDiscount addTarget:self action:@selector(onFilterGoodsWPH:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [self.viewSearchDetailFilterWPH.priceButton addTarget:self action:@selector(onFilterGoodsWPH:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | |
| | | - (void)addNetWorkNotice { |
| | |
| | | [parms setObject:page forKey:@"page"]; |
| | | [parms setObject:goodsTypes forKey:@"goodsType"]; |
| | | |
| | | if (filter && ![filter isEqualToString:@""]) { |
| | | if ([self isHaveValue:filter]) { |
| | | [parms setObject:filter forKey:@"filter"]; |
| | | } |
| | | if (order) { |
| | |
| | | return; |
| | | } |
| | | [self resetDataCoing]; |
| | | [self resetDataWPHCoing]; |
| | | [self.tableView.mj_header beginRefreshing]; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | - (void)onFilterGoodsWPH:(UIButton *)button { |
| | | switch (button.tag) { |
| | | case 700: { |
| | | if (!button.selected) { |
| | | button.selected = YES; |
| | | self.viewSearchDetailFilterWPH.buttonDiscount.selected = NO; |
| | | self.viewSearchDetailFilterWPH.priceButton.selected = NO; |
| | | self.viewSearchDetailFilterWPH.priceButton.tag = 702; |
| | | [self hidePriceView]; |
| | | self.order = 0; |
| | | [self.tableView.mj_header beginRefreshing]; |
| | | } |
| | | |
| | | break; |
| | | } |
| | | case 701: { |
| | | if (!button.selected) { |
| | | button.selected = YES; |
| | | |
| | | self.viewSearchDetailFilterWPH.buttonSynthesis.selected = NO; |
| | | self.viewSearchDetailFilterWPH.priceButton.selected = NO; |
| | | self.viewSearchDetailFilterWPH.priceButton.tag = 702; |
| | | |
| | | [self hidePriceView]; |
| | | |
| | | self.order = 5; |
| | | [self.tableView.mj_header beginRefreshing]; |
| | | } |
| | | |
| | | break; |
| | | } |
| | | |
| | | case 702: { |
| | | button.selected = YES; |
| | | button.tag = 703; |
| | | self.viewSearchDetailFilterWPH.buttonSynthesis.selected = NO; |
| | | self.viewSearchDetailFilterWPH.buttonDiscount.selected = NO; |
| | | [button setImage:[UIImage imageNamed:@"ååº"] forState:UIControlStateSelected]; |
| | | |
| | | if ([self.goodsType integerValue] != 3) { // æ¼å¤å¤ä¸æ¯æè¾å
¥ä»·æ ¼ |
| | | [self showPriceView]; |
| | | } |
| | | |
| | | self.order = 3; |
| | | [self.tableView.mj_header beginRefreshing]; |
| | | break; |
| | | } |
| | | case 703: { |
| | | button.selected = YES; |
| | | button.tag = 702; |
| | | self.viewSearchDetailFilterWPH.buttonSynthesis.selected = NO; |
| | | self.viewSearchDetailFilterWPH.buttonDiscount.selected = NO; |
| | | [button setImage:[UIImage imageNamed:@"éåº"] forState:UIControlStateSelected]; |
| | | |
| | | if ([self.goodsType integerValue] != 3) { // æ¼å¤å¤ä¸æ¯æè¾å
¥ä»·æ ¼ |
| | | [self showPriceView]; |
| | | } |
| | | |
| | | self.order = 2; |
| | | [self.tableView.mj_header beginRefreshing]; |
| | | |
| | | break; |
| | | } |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | - (void)ClickConnectBtn:(UIButton *)sender { |
| | | if (iOS10) { |
| | | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] |
| | |
| | | [self hidePriceView]; |
| | | } |
| | | |
| | | - (void)resetDataWPHCoing { |
| | | self.page = 1; |
| | | self.order = 0; |
| | | |
| | | self.viewSearchDetailFilterWPH.buttonSynthesis.selected = YES; |
| | | |
| | | self.viewSearchDetailFilterWPH.buttonDiscount.selected = NO; |
| | | |
| | | self.viewSearchDetailFilterWPH.priceButton.selected = NO; |
| | | self.viewSearchDetailFilterWPH.priceButton.tag = 702; |
| | | |
| | | self.searchDetailConditionView.hidden = YES; |
| | | |
| | | [self.searchDetailConditionView resetDataConfig]; |
| | | [self hidePriceView]; |
| | | } |
| | | |
| | | - (void)showPriceView { |
| | | self.searchDetailFiltrPriceView.frame = CGRectMake(0, CGRectGetMaxY(self.searchDetailFilterView.frame), SCREEN_WIDTH, 45); |
| | | self.tableView.frame = CGRectMake(0, CGRectGetMaxY(self.searchDetailFiltrPriceView.frame), SCREEN_WIDTH, SCREEN_HEIGHT - kNavigationBarH - kStatusBarH - CGRectGetHeight(self.searchDetailFilterView.frame) - CGRectGetHeight(self.searchDetailFiltrPriceView.frame)); |
| | | if ([_goodsType integerValue] == 4) { |
| | | self.searchDetailFiltrPriceView.frame = CGRectMake(0, CGRectGetMaxY(self.viewSearchDetailFilterWPH.frame), SCREEN_WIDTH, 45); |
| | | self.tableView.frame = CGRectMake(0, CGRectGetMaxY(self.viewSearchDetailFilterWPH.frame), SCREEN_WIDTH, SCREEN_HEIGHT - kNavigationBarH - kStatusBarH - CGRectGetHeight(self.viewSearchDetailFilterWPH.frame) - CGRectGetHeight(self.searchDetailFiltrPriceView.frame)); |
| | | |
| | | |
| | | } else { |
| | | self.searchDetailFiltrPriceView.frame = CGRectMake(0, CGRectGetMaxY(self.searchDetailFilterView.frame), SCREEN_WIDTH, 45); |
| | | self.tableView.frame = CGRectMake(0, CGRectGetMaxY(self.searchDetailFiltrPriceView.frame), SCREEN_WIDTH, SCREEN_HEIGHT - kNavigationBarH - kStatusBarH - CGRectGetHeight(self.searchDetailFilterView.frame) - CGRectGetHeight(self.searchDetailFiltrPriceView.frame)); |
| | | } |
| | | |
| | | self.searchDetailFiltrPriceView.hidden = NO; |
| | | } |
| | | |
| | | - (void)hidePriceView { |
| | | self.searchDetailFiltrPriceView.frame = CGRectMake(0, CGRectGetMaxY(self.searchDetailFilterView.frame), SCREEN_WIDTH, 0); |
| | | self.tableView.frame = CGRectMake(0, CGRectGetMaxY(self.searchDetailFiltrPriceView.frame), SCREEN_WIDTH, SCREEN_HEIGHT - kNavigationBarH - kStatusBarH - CGRectGetHeight(self.searchDetailFilterView.frame) - CGRectGetHeight(self.searchDetailFiltrPriceView.frame)); |
| | | if ([_goodsType integerValue] == 4) { |
| | | self.searchDetailFiltrPriceView.frame = CGRectMake(0, CGRectGetMaxY(self.viewSearchDetailFilterWPH.frame), SCREEN_WIDTH, 0); |
| | | self.tableView.frame = CGRectMake(0, CGRectGetMaxY(self.searchDetailFiltrPriceView.frame), SCREEN_WIDTH, SCREEN_HEIGHT - kNavigationBarH - kStatusBarH - CGRectGetHeight(self.viewSearchDetailFilterWPH.frame) - CGRectGetHeight(self.searchDetailFiltrPriceView.frame)); |
| | | |
| | | } else { |
| | | self.searchDetailFiltrPriceView.frame = CGRectMake(0, CGRectGetMaxY(self.searchDetailFilterView.frame), SCREEN_WIDTH, 0); |
| | | self.tableView.frame = CGRectMake(0, CGRectGetMaxY(self.searchDetailFiltrPriceView.frame), SCREEN_WIDTH, SCREEN_HEIGHT - kNavigationBarH - kStatusBarH - CGRectGetHeight(self.searchDetailFilterView.frame) - CGRectGetHeight(self.searchDetailFiltrPriceView.frame)); |
| | | } |
| | | |
| | | self.searchDetailFiltrPriceView.hidden = YES; |
| | | self.maxPrice = nil; |
| | | self.minPrice = nil; |
| | |
| | | |
| | | |
| | | #pragma mark - getter - |
| | | - (SearchDetailFilterView *)searchDetailFilterView |
| | | { |
| | | - (SearchDetailFilterView *)searchDetailFilterView { |
| | | if (!_searchDetailFilterView) { |
| | | _searchDetailFilterView = [[SearchDetailFilterView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40)]; |
| | | } |
| | | return _searchDetailFilterView; |
| | | } |
| | | |
| | | - (SearchDetailFiltrPriceView *)searchDetailFiltrPriceView |
| | | { |
| | | - (SearchDetailFilterWPHView *)viewSearchDetailFilterWPH { |
| | | if (!_viewSearchDetailFilterWPH) { |
| | | _viewSearchDetailFilterWPH = [[SearchDetailFilterWPHView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40)]; |
| | | } |
| | | return _viewSearchDetailFilterWPH; |
| | | } |
| | | |
| | | - (SearchDetailFiltrPriceView *)searchDetailFiltrPriceView { |
| | | if (!_searchDetailFiltrPriceView) { |
| | | _searchDetailFiltrPriceView = [[SearchDetailFiltrPriceView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.searchDetailFilterView.frame), SCREEN_WIDTH, 0)]; |
| | | _searchDetailFiltrPriceView.delegate = self; |
| | |
| | | return _searchDetailFiltrPriceView; |
| | | } |
| | | |
| | | - (SearchDetailConditionView *)searchDetailConditionView |
| | | { |
| | | - (SearchDetailConditionView *)searchDetailConditionView { |
| | | if (!_searchDetailConditionView) { |
| | | _searchDetailConditionView = [[SearchDetailConditionView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.searchDetailFilterView.frame), SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| | | _searchDetailConditionView.hidden = YES; |
| | |
| | | [self loadDataSource]; |
| | | }]; |
| | | NSMutableArray *imagesArr = [NSMutableArray array]; |
| | | for (int i = 1; i < 13; i++) { |
| | | UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"up_%d",i]]; |
| | | [imagesArr addObject:image]; |
| | | } |
| | | [footer setImages:imagesArr forState:MJRefreshStateRefreshing]; |
| | | for (int i = 1; i < 13; i++) { |
| | | UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"up_%d",i]]; |
| | | [imagesArr addObject:image]; |
| | | } |
| | | [footer setImages:imagesArr forState:MJRefreshStateRefreshing]; |
| | | _tableView.mj_footer = footer; |
| | | } |
| | | return _tableView; |
| | |
| | | @property (nonatomic, nullable, strong) ALButton *priceButton; |
| | | /// è¿å©æ¯ |
| | | @property (nonatomic, nullable, strong) ALButton *rebatesButton; |
| | | /// å¡é |
| | | /// çé |
| | | @property (nonatomic, nullable, strong) ALButton *filteringButton; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // SearchDetailFilterWPHView.h |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @interface SearchDetailFilterWPHView : UIView |
| | | |
| | | /// 综å |
| | | @property (nonatomic, nullable, strong) ALButton *buttonSynthesis; |
| | | /// ææ£ |
| | | @property (nonatomic, nullable, strong) ALButton *buttonDiscount; |
| | | /// ä»·æ ¼ |
| | | @property (nonatomic, nullable, strong) ALButton *priceButton; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // SearchDetailFilterView.m |
| | | // MIduo |
| | | // |
| | | // Created by éåºè¿å°ç§ææéå
¬å¸ on 2019/7/18. |
| | | // Copyright © 2019 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "SearchDetailFilterWPHView.h" |
| | | |
| | | @interface SearchDetailFilterWPHView () |
| | | |
| | | @property (nonatomic, nullable, strong) UIView *garyView; |
| | | |
| | | @end |
| | | |
| | | @implementation SearchDetailFilterWPHView |
| | | |
| | | - (instancetype)initWithFrame:(CGRect)frame |
| | | { |
| | | self = [super initWithFrame:frame]; |
| | | if (self) { |
| | | self.backgroundColor = [UIColor whiteColor]; |
| | | [self viewConfig]; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)viewConfig { |
| | | |
| | | [self addSubview:self.buttonSynthesis]; |
| | | [self addSubview:self.buttonDiscount]; |
| | | [self addSubview:self.priceButton]; |
| | | |
| | | CGFloat dyWidth = (SCREEN_WIDTH > 375)?50:30; |
| | | |
| | | self.buttonSynthesis.sd_layout.leftSpaceToView(self, 30).topEqualToView(self).bottomEqualToView(self).widthIs((SCREEN_WIDTH-dyWidth*2)/3); |
| | | |
| | | self.buttonDiscount.sd_layout.leftSpaceToView(self.buttonSynthesis, 0).topEqualToView(self).bottomEqualToView(self).widthIs((SCREEN_WIDTH-dyWidth*2)/3); |
| | | |
| | | self.priceButton.sd_layout.leftSpaceToView(self.buttonDiscount, 0).topEqualToView(self).bottomEqualToView(self).widthIs((SCREEN_WIDTH-dyWidth*2)/3); |
| | | [_priceButton setTitleEdgeInsets:UIEdgeInsetsMake(0, -_priceButton.imageView.bounds.size.width, 0, _priceButton.imageView.bounds.size.width)]; |
| | | [_priceButton setImageEdgeInsets:UIEdgeInsetsMake(0, _priceButton.titleLabel.bounds.size.width, 0, -_priceButton.titleLabel.bounds.size.width)]; |
| | | |
| | | [self addSubview:self.garyView]; |
| | | self.garyView.sd_layout.leftEqualToView(self).bottomEqualToView(self).rightEqualToView(self).heightIs(0.5); |
| | | } |
| | | |
| | | - (ALButton *)buttonSynthesis { |
| | | if (!_buttonSynthesis) { |
| | | _buttonSynthesis = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [_buttonSynthesis setTitle:@"综å" forState:UIControlStateNormal]; |
| | | [_buttonSynthesis setTitleColor:UICOLOR_FROM_RGB(0x333333, 1.0) forState:UIControlStateNormal]; |
| | | [_buttonSynthesis setTitleColor:UICOLOR_FROM_RGB(0xE5005C, 1.0) forState:UIControlStateSelected]; |
| | | _buttonSynthesis.titleLabel.font = [UIFont systemFontOfSize:15]; |
| | | _buttonSynthesis.selected = YES; |
| | | } |
| | | return _buttonSynthesis; |
| | | } |
| | | |
| | | - (ALButton *)buttonDiscount { |
| | | if (!_buttonDiscount) { |
| | | _buttonDiscount = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [_buttonDiscount setTitle:@"ææ£" forState:UIControlStateNormal]; |
| | | [_buttonDiscount setTitleColor:UICOLOR_FROM_RGB(0x333333, 1.0) forState:UIControlStateNormal]; |
| | | [_buttonDiscount setTitleColor:UICOLOR_FROM_RGB(0xE5005C, 1.0) forState:UIControlStateSelected]; |
| | | _buttonDiscount.titleLabel.font = [UIFont systemFontOfSize:15]; |
| | | |
| | | } |
| | | return _buttonDiscount; |
| | | } |
| | | |
| | | - (ALButton *)priceButton { |
| | | if (!_priceButton) { |
| | | _priceButton = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [_priceButton setImage:ALIMAGE_NAMED(@"æåºæªéä¸") forState:UIControlStateNormal]; |
| | | [_priceButton setTitle:@"ä»·æ ¼ " forState:UIControlStateNormal]; |
| | | [_priceButton setTitleColor:UICOLOR_FROM_RGB(0x333333, 1.0) forState:UIControlStateNormal]; |
| | | [_priceButton setTitleColor:UICOLOR_FROM_RGB(0xE5005C, 1.0) forState:UIControlStateSelected]; |
| | | _priceButton.titleLabel.font = [UIFont systemFontOfSize:15]; |
| | | } |
| | | return _priceButton; |
| | | } |
| | | |
| | | - (UIView *)garyView |
| | | { |
| | | if (!_garyView) { |
| | | _garyView = [[UIView alloc] init]; |
| | | _garyView.backgroundColor = UICOLOR_FROM_RGB(0xe0e0e0, 1.0); |
| | | } |
| | | return _garyView; |
| | | } |
| | | |
| | | @end |
| | |
| | | [self.titleArray addObject:@{@"name":@"æ·å®"}]; |
| | | [self.titleArray addObject:@{@"name":@"京ä¸"}]; |
| | | [self.titleArray addObject:@{@"name":@"æ¼å¤å¤"}]; |
| | | [self.titleArray addObject:@{@"name":@"å¯åä¼"}]; |
| | | [self.titleArray addObject:@{@"name":@"èå®"}]; |
| | | |
| | | [self.contentArray addObject:@{@"goodsType":@"1"}]; |
| | | [self.contentArray addObject:@{@"goodsType":@"2"}]; |
| | | [self.contentArray addObject:@{@"goodsType":@"3"}]; |
| | | [self.contentArray addObject:@{@"goodsType":@"4"}]; |
| | | [self.contentArray addObject:@{@"goodsType":@"5"}]; |
| | | |
| | | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"searchdetailIsExpand"]; |
| | | |
| | |
| | | - (UIViewController<ZJScrollPageViewChildVcDelegate> *)childViewController:(UIViewController<ZJScrollPageViewChildVcDelegate> *)reuseViewController forIndex:(NSInteger)index { |
| | | UIViewController<ZJScrollPageViewChildVcDelegate> *childVc = reuseViewController; |
| | | if (!childVc) { |
| | | SearchDetailController *commonTemplateListVc = [[SearchDetailController alloc] init]; |
| | | commonTemplateListVc.searchKey = self.searchField.Field.text; |
| | | commonTemplateListVc.goodsType = self.contentArray[index][@"goodsType"]; |
| | | commonTemplateListVc.isSearchFrom = self.isSearchFrom; |
| | | [self.controllerArr addObject:commonTemplateListVc]; |
| | | childVc = commonTemplateListVc; |
| | | SearchDetailController *vc = [[SearchDetailController alloc] init]; |
| | | vc.searchKey = self.searchField.Field.text; |
| | | vc.goodsType = self.contentArray[index][@"goodsType"]; |
| | | vc.isSearchFrom = self.isSearchFrom; |
| | | [self.controllerArr addObject:vc]; |
| | | childVc = vc; |
| | | } |
| | | self.selectIndex = index + 1; |
| | | return childVc; |
New file |
| | |
| | | // |
| | | // SearchGoodsGuideCell.h |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @interface SearchGoodsGuideCell : UICollectionViewCell |
| | | |
| | | @property (nonatomic, nullable, strong) UIImageView *imageViewContent; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | // |
| | | // SearchGoodsGuideCell.m |
| | | // MIduo |
| | | // |
| | | // Created by aeline on 2020/5/26. |
| | | // Copyright © 2020 yeshi. All rights reserved. |
| | | // |
| | | |
| | | #import "SearchGoodsGuideCell.h" |
| | | |
| | | @interface SearchGoodsGuideCell () |
| | | |
| | | @end |
| | | |
| | | @implementation SearchGoodsGuideCell |
| | | |
| | | - (instancetype)initWithFrame:(CGRect)frame { |
| | | |
| | | self = [super initWithFrame:frame]; |
| | | if ( self ) { |
| | | self.contentView.backgroundColor = [UIColor whiteColor]; |
| | | [self cellConfig]; |
| | | } |
| | | return self; |
| | | } |
| | | |
| | | - (void)cellConfig{ |
| | | [self.contentView addSubview:self.imageViewContent]; |
| | | self.imageViewContent.sd_layout.leftSpaceToView(self.contentView, 20).rightSpaceToView(self.contentView, 20).topSpaceToView(self.contentView, 0).bottomSpaceToView(self.contentView, 0); |
| | | } |
| | | |
| | | #pragma mark --- getter --- |
| | | -(UIImageView *)imageViewContent { |
| | | if (!_imageViewContent) { |
| | | _imageViewContent = [[UIImageView alloc] init]; |
| | | _imageViewContent.backgroundColor = ImagePlaceholder_white; |
| | | } |
| | | return _imageViewContent; |
| | | } |
| | | @end |
| | |
| | | [self.titleArray addObject:@{@"name":@"æ·å®"}]; |
| | | [self.titleArray addObject:@{@"name":@"京ä¸"}]; |
| | | [self.titleArray addObject:@{@"name":@"æ¼å¤å¤"}]; |
| | | [self.titleArray addObject:@{@"name":@"å¯åä¼"}]; |
| | | [self.titleArray addObject:@{@"name":@"èå®"}]; |
| | | |
| | | [self.contentArray addObject:@{@"goodsType":@"1"}]; |
| | | [self.contentArray addObject:@{@"goodsType":@"2"}]; |
| | | [self.contentArray addObject:@{@"goodsType":@"3"}]; |
| | | [self.contentArray addObject:@{@"goodsType":@"4"}]; |
| | | [self.contentArray addObject:@{@"goodsType":@"5"}]; |
| | | } |
| | | |
| | | - (void)setupNavView { |
| | |
| | | } |
| | | |
| | | #pragma mark ------ click event ------ |
| | | - (void)cancelTaped:(UIButton *)sender |
| | | { |
| | | - (void)cancelTaped:(UIButton *)sender { |
| | | [self.navigationController popViewControllerAnimated:YES]; |
| | | } |
| | | |
| | | #pragma mark ------ privte method ------ |
| | | - (void)getSuggestSearchWithKey:(NSString *)text { |
| | | NSMutableDictionary *dictionaryMut = [[NSMutableDictionary alloc] init]; |
| | | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; |
| | | if ([self isHaveValue:text]) { |
| | | [dictionaryMut setValue:text forKey:@"kw"]; |
| | | [params setObject:text forKey:@"kw"]; |
| | | } |
| | | [dictionaryMut setValue:[NSString stringWithFormat:@"%ld",(long)self.selectIndex] forKey:@"goodsType"]; |
| | | [params setObject:[NSString stringWithFormat:@"%ld",(long)self.selectIndex] forKey:@"goodsType"]; |
| | | |
| | | @weakify(self) |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2, @"search/suggestSearch"] param:dictionaryMut success:^(NSDictionary *object) { |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2, @"search/suggestSearch"] param:params success:^(NSDictionary *object) { |
| | | @strongify(self) |
| | | if (object && [object[@"code"] integerValue] == 0) { |
| | | [self.arrayData removeAllObjects]; |
| | |
| | | * |
| | | * @param text è¾å
¥æ¡çå
容 |
| | | */ |
| | | - (void)searchCotol:(NSString *)text |
| | | { |
| | | - (void)searchCotol:(NSString *)text { |
| | | [_searchField.Field resignFirstResponder]; |
| | | SearchDetailMainController *sresult = [[SearchDetailMainController alloc] init]; |
| | | if (self.searchField.Field.text.length == 0 && _searchField.Field.placeholder.length == 0 ) { |
| | |
| | | |
| | | } else if (goodsTypes == 3) { |
| | | name = @"historyPDDSearchList"; |
| | | |
| | | } else if (goodsTypes == 4) { |
| | | name = @"historyWPHSearchList"; |
| | | |
| | | } else if (goodsTypes == 5) { |
| | | name = @"historySNSearchList"; |
| | | } |
| | | return name; |
| | | } |
| | | |
| | | - (void)delayMethod |
| | | { |
| | | - (void)delayMethod { |
| | | [self.searchField.Field becomeFirstResponder]; |
| | | } |
| | | |
| | | -(void)addsuggestTableview |
| | | { |
| | | -(void)addsuggestTableview { |
| | | _suggestTableview = [[UITableView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.topView.frame), SCREEN_WIDTH, SCREEN_HEIGHT - kNavigationBarH - kStatusBarH) style:UITableViewStyleGrouped]; |
| | | [_suggestTableview setBackgroundColor:[UIColor whiteColor]]; |
| | | _suggestTableview.delegate = self; |
| | |
| | | return _topView; |
| | | } |
| | | |
| | | - (UIView *)navGaryLine |
| | | { |
| | | - (UIView *)navGaryLine { |
| | | if (!_navGaryLine) { |
| | | _navGaryLine = [[UIView alloc] init]; |
| | | _navGaryLine.frame = CGRectMake(0, 45.5 + CGRectGetHeight(self.topView.frame), SCREEN_WIDTH, 0.5); |
| | |
| | | #import "SearchCollectionReusableView.h" |
| | | #import "GuideSearchVideoCell.h" |
| | | #import "ClearCollectionReusableView.h" |
| | | #import "GuideSearchCollCell.h" |
| | | #import "SearchGoodsGuideCell.h" |
| | | |
| | | @interface searchViewController ()<UICollectionViewDataSource,UICollectionViewDelegate> |
| | | |
| | |
| | | } |
| | | |
| | | - (void)NetWorkStatesChange:(NSNotification *)sender { |
| | | |
| | | int networkState = [[sender object] intValue]; |
| | | |
| | | switch (networkState) { |
| | | |
| | | case -1: { |
| | | |
| | | if (self.dataHot.count == 0) { |
| | | |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | | [self.noNetworkViews.iconImage setImage:ALIMAGE_NAMED(@"defaultPage_noNetWork")]; |
| | | self.noNetworkViews.hidden = NO; |
| | |
| | | self.noNetworkViews.hidden = YES; |
| | | ALToastBottom(NETWORK_CONNECT_ANOMALY); |
| | | } |
| | | |
| | | break; |
| | | } |
| | | case 0: { // 没æç½ç» |
| | | |
| | | if (self.dataHot.count == 0) { |
| | | |
| | | [self.view endEditing:YES]; |
| | | |
| | | self.noNetworkViews.primtTitle.text = NETWORK_CONNECT_ANOMALY; |
| | | [self.noNetworkViews.iconImage setImage:ALIMAGE_NAMED(@"defaultPage_noNetWork")]; |
| | | self.noNetworkViews.hidden = NO; |
| | |
| | | } |
| | | |
| | | case 1: { // 3Gæè
4Gï¼åæ£ç¨çæ¯æµé |
| | | |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | if (self.dataHot.count == 0) { |
| | | [self showSJCustomActivityView]; |
| | | |
| | |
| | | } |
| | | |
| | | case 2: { // WIFIç½ç» |
| | | |
| | | self.noNetworkViews.hidden = YES; |
| | | |
| | | if (self.dataHot.count == 0) { |
| | | [self showSJCustomActivityView]; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | - (void)addSearchCollectionView |
| | | { |
| | | - (void)addSearchCollectionView { |
| | | UICollectionViewLeftAlignedLayout *flow = [[UICollectionViewLeftAlignedLayout alloc] init]; |
| | | //æå®å¸å±æ¹å¼ä¸ºåç´ |
| | | flow.scrollDirection = UICollectionViewScrollDirectionVertical; |
| | |
| | | [_collectionView registerNib:[UINib nibWithNibName:@"SearchCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:@"SearchCollectionViewCellID"]; |
| | | [_collectionView registerClass:[SearchHistoryCollectionCell class] forCellWithReuseIdentifier:@"searchHistoryCollectionCell"]; |
| | | [_collectionView registerNib:[UINib nibWithNibName:@"GuideSearchCollCell" bundle:nil] forCellWithReuseIdentifier:@"GuideSearchCollCell"]; |
| | | |
| | | [_collectionView registerClass:[SearchGoodsGuideCell class] forCellWithReuseIdentifier:@"SearchGoodsGuideCell"]; |
| | | |
| | | [_collectionView registerNib:[UINib nibWithNibName:@"SearchCollectionReusableView" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"SearchCollectionReusableViewID"]; |
| | | [_collectionView registerNib:[UINib nibWithNibName:@"ClearCollectionReusableView" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"ClearCollectionReusableViewID"]; |
| | | [_collectionView registerClass:[GuideSearchVideoCell class] forCellWithReuseIdentifier:@"guideSearchVideoCell"]; |
| | |
| | | /** |
| | | * çé¨æç´¢ |
| | | */ |
| | | - (void)getHotSearch |
| | | { |
| | | - (void)getHotSearch { |
| | | NSDictionary *params = @{@"goodsType":_goodsType}; |
| | | @weakify(self) |
| | | [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP, @"search/gethotsearch"] param:params success:^(NSDictionary *object) { |
| | |
| | | |
| | | } else if ([self.goodsType integerValue] == 3) { |
| | | name = @"historyPDDSearchList"; |
| | | |
| | | } else if ([self.goodsType integerValue] == 4) { |
| | | name = @"historyWPHSearchList"; |
| | | |
| | | } else if ([self.goodsType integerValue] == 5) { |
| | | name = @"historySNSearchList"; |
| | | } |
| | | return name; |
| | | } |
| | |
| | | return cell; |
| | | |
| | | } else { |
| | | GuideSearchCollCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GuideSearchCollCell" forIndexPath:indexPath]; |
| | | if ([self.goodsType integerValue] == 1) { |
| | | cell.guideImageView.image = ALIMAGE_NAMED(@"search_guide1"); |
| | | |
| | | } else if ([self.goodsType integerValue] == 2) { |
| | | cell.guideImageView.image = ALIMAGE_NAMED(@"search_guide2"); |
| | | |
| | | } else if ([self.goodsType integerValue] == 3) { |
| | | cell.guideImageView.image = ALIMAGE_NAMED(@"search_guide3"); |
| | | } |
| | | SearchGoodsGuideCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"SearchGoodsGuideCell" forIndexPath:indexPath]; |
| | | NSString *imgStr = [NSString stringWithFormat:@"search_guide%@",_goodsType]; |
| | | UIImage *image = ALIMAGE_NAMED(imgStr); |
| | | cell.imageViewContent.image = image; |
| | | return cell; |
| | | } |
| | | } |
| | |
| | | return cell; |
| | | |
| | | } else { |
| | | GuideSearchCollCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GuideSearchCollCell" forIndexPath:indexPath]; |
| | | if ([self.goodsType integerValue] == 1) { |
| | | cell.guideImageView.image = ALIMAGE_NAMED(@"search_guide1"); |
| | | |
| | | } else if ([self.goodsType integerValue] == 2) { |
| | | cell.guideImageView.image = ALIMAGE_NAMED(@"search_guide2"); |
| | | |
| | | } else if ([self.goodsType integerValue] == 3) { |
| | | cell.guideImageView.image = ALIMAGE_NAMED(@"search_guide3"); |
| | | } |
| | | SearchGoodsGuideCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"SearchGoodsGuideCell" forIndexPath:indexPath]; |
| | | NSString *imgStr = [NSString stringWithFormat:@"search_guide%@",_goodsType]; |
| | | UIImage *image = ALIMAGE_NAMED(imgStr); |
| | | cell.imageViewContent.image = image; |
| | | return cell; |
| | | } |
| | | } |
| | |
| | | if ([self isHaveValue:[YTHsharedManger startManger].gonglueCourceInfo[@"videoUrl"]]) { |
| | | return CGSizeMake(SCREEN_WIDTH, 140.0/375.0*SCREEN_WIDTH + 10); |
| | | } |
| | | UIImage *image = ALIMAGE_NAMED(@"search_guide1"); |
| | | CGFloat height = image.size.height/image.size.width*SCREEN_WIDTH; |
| | | NSString *imgStr = [NSString stringWithFormat:@"search_guide%@",_goodsType]; |
| | | UIImage *image = image = ALIMAGE_NAMED(imgStr); |
| | | CGFloat height = image.size.height/image.size.width*(SCREEN_WIDTH - 40); |
| | | return CGSizeMake(SCREEN_WIDTH, height); |
| | | |
| | | } else { |
| | |
| | | } |
| | | |
| | | } else { |
| | | UIImage *image = ALIMAGE_NAMED(@"search_guide1"); |
| | | CGFloat height = image.size.height/image.size.width*SCREEN_WIDTH; |
| | | NSString *imgStr = [NSString stringWithFormat:@"search_guide%@",_goodsType]; |
| | | UIImage *image = image = ALIMAGE_NAMED(imgStr); |
| | | CGFloat height = image.size.height/image.size.width*(SCREEN_WIDTH - 40); |
| | | return CGSizeMake(SCREEN_WIDTH, height); |
| | | } |
| | | } |
| | |
| | | #import "NewGoodsShareController.h" |
| | | #import "QuickShareController.h" |
| | | #import "SingleFigureShareController.h" |
| | | #import "MultipleFigureShareController.h" |
| | | |
| | | // Vivews |
| | | #import "NewGoodsShareTopView.h" |
| | | |
| | |
| | | |
| | | @property (nonatomic, nullable, strong) QuickShareController *quickShareVc; |
| | | @property (nonatomic, nullable, strong) SingleFigureShareController *singleFigureShareVc; |
| | | @property (nonatomic, nullable, strong) MultipleFigureShareController *multipleFigureShareVc; |
| | | |
| | | @property (nonatomic, assign) CGFloat viewLindeX; |
| | | |
| | |
| | | } |
| | | |
| | | - (void)setupDataConfig { |
| | | self.viewLindeX = ((SCREEN_WIDTH / 3) - 85) / 2; |
| | | self.viewLindeX = ((SCREEN_WIDTH / 2) - 85) / 2; |
| | | } |
| | | |
| | | #pragma mark --- click_touch_event --- |
| | |
| | | @strongify(self) |
| | | self.newGoodsShareView.left_Buttom_View.frame = CGRectMake(self.viewLindeX, 48-2, 85, 2); |
| | | self.newGoodsShareView.single_figure_Button.selected = NO; |
| | | self.newGoodsShareView.multiple_figure_Button.selected = NO; |
| | | button.selected = YES; |
| | | }]; |
| | | [self setupQuickShareVcView]; |
| | |
| | | @weakify(self) |
| | | [UIView animateWithDuration:0.3 animations:^{ |
| | | @strongify(self) |
| | | self.newGoodsShareView.left_Buttom_View.frame = CGRectMake(self.viewLindeX + SCREEN_WIDTH / 3, 48 - 2, 85, 2); |
| | | |
| | | self.newGoodsShareView.left_Buttom_View.frame = CGRectMake(self.viewLindeX + SCREEN_WIDTH / 2, 48 - 2, 85, 2); |
| | | self.newGoodsShareView.buttonQuickShare.selected = NO; |
| | | self.newGoodsShareView.multiple_figure_Button.selected = NO; |
| | | button.selected = YES; |
| | | }]; |
| | | [self setupSingleFigureShareVcView]; |
| | | } |
| | | }]; |
| | | [[self.newGoodsShareView.multiple_figure_Button rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(UIButton *button) { |
| | | @strongify(self) |
| | | if (!button.selected) { |
| | | @weakify(self) |
| | | [UIView animateWithDuration:0.3 animations:^{ |
| | | @strongify(self) |
| | | self.newGoodsShareView.left_Buttom_View.frame = CGRectMake(self.viewLindeX + SCREEN_WIDTH / 3 * 2, 48 - 2, 85, 2); |
| | | |
| | | self.newGoodsShareView.buttonQuickShare.selected = NO; |
| | | self.newGoodsShareView.single_figure_Button.selected = NO; |
| | | button.selected = YES; |
| | | }]; |
| | | [self setupMultipleFigureShareVcView]; |
| | | } |
| | | }]; |
| | | } |
| | |
| | | |
| | | - (void)setupQuickShareVcView { |
| | | [self.singleFigureShareVc.view removeFromSuperview]; |
| | | [self.multipleFigureShareVc.view removeFromSuperview]; |
| | | if (!self.quickShareVc) { |
| | | self.quickShareVc = [[QuickShareController alloc] init]; |
| | | } |
| | |
| | | } |
| | | |
| | | - (void)setupSingleFigureShareVcView { |
| | | [self.multipleFigureShareVc.view removeFromSuperview]; |
| | | [self.quickShareVc.view removeFromSuperview]; |
| | | if (!self.singleFigureShareVc) { |
| | | self.singleFigureShareVc = [[SingleFigureShareController alloc] init]; |
| | |
| | | self.singleFigureShareVc.viewController = self; |
| | | self.singleFigureShareVc.pageViewHeight = self.pageView.size.height; |
| | | [self.pageView addSubview:self.singleFigureShareVc.view]; |
| | | } |
| | | |
| | | - (void)setupMultipleFigureShareVcView { |
| | | [self.singleFigureShareVc.view removeFromSuperview]; |
| | | [self.quickShareVc.view removeFromSuperview]; |
| | | if (!self.multipleFigureShareVc) { |
| | | self.multipleFigureShareVc = [[MultipleFigureShareController alloc] init]; |
| | | } |
| | | self.multipleFigureShareVc.resultDic = self.dataDictionary; |
| | | self.multipleFigureShareVc.viewController = self; |
| | | self.multipleFigureShareVc.pageViewHeight = self.pageView.size.height; |
| | | [self.pageView addSubview:self.multipleFigureShareVc.view]; |
| | | } |
| | | |
| | | - (void)navigationConfig { |
| | |
| | | |
| | | - (void)resetViewFrame { |
| | | self.singleFigureShareVc.pageViewHeight = self.pageView.size.height; |
| | | self.multipleFigureShareVc.pageViewHeight = self.pageView.size.height; |
| | | |
| | | [self.singleFigureShareVc resetViewFrame]; |
| | | [self.multipleFigureShareVc resetViewFrame]; |
| | | } |
| | | |
| | | #pragma mark --- getter --- |
| | |
| | | @property (nonatomic, nullable, strong) ALButton *buttonQuickShare; |
| | | /// åå¾æé® |
| | | @property (nonatomic, nullable, strong) ALButton *single_figure_Button; |
| | | /// å¤å¾æé® |
| | | @property (nonatomic, nullable, strong) ALButton *multiple_figure_Button; |
| | | |
| | | @end |
| | | |
| | |
| | | |
| | | - (void)setupView { |
| | | [self addSubview:self.buttonQuickShare]; |
| | | self.buttonQuickShare.sd_layout.leftEqualToView(self).centerYEqualToView(self).heightIs(30).widthIs(SCREEN_WIDTH / 3); |
| | | self.buttonQuickShare.sd_layout.leftEqualToView(self).centerYEqualToView(self).heightIs(30).widthIs(SCREEN_WIDTH / 2); |
| | | |
| | | [self addSubview:self.single_figure_Button]; |
| | | self.single_figure_Button.sd_layout.leftSpaceToView(self.buttonQuickShare, 0).centerYEqualToView(self).heightIs(30).widthIs(SCREEN_WIDTH / 3); |
| | | self.single_figure_Button.sd_layout.leftSpaceToView(self.buttonQuickShare, 0).centerYEqualToView(self).heightIs(30).widthIs(SCREEN_WIDTH / 2); |
| | | |
| | | [self addSubview:self.multiple_figure_Button]; |
| | | self.multiple_figure_Button.sd_layout.rightEqualToView(self).centerYEqualToView(self).heightIs(30).widthIs(SCREEN_WIDTH / 3); |
| | | |
| | | self.left_Buttom_View.frame = CGRectMake(((SCREEN_WIDTH / 3) - 85) / 2, 48 - 2, 85, 2); |
| | | self.left_Buttom_View.frame = CGRectMake(((SCREEN_WIDTH / 2) - 85) / 2, 48 - 2, 85, 2); |
| | | self.left_Buttom_View.layer.masksToBounds = YES; |
| | | self.left_Buttom_View.layer.cornerRadius = 1; |
| | | [self addSubview:self.left_Buttom_View]; |
| | |
| | | [_buttonQuickShare setTitle:@" å¿«æ·å享" forState:UIControlStateNormal]; |
| | | [_buttonQuickShare setTitleColor:UICOLOR_FROM_RGB(0x444444, 1.0) forState:UIControlStateNormal]; |
| | | [_buttonQuickShare setTitleColor:UICOLOR_FROM_RGB(0xE5005C, 1.0) forState:UIControlStateSelected]; |
| | | |
| | | _buttonQuickShare.titleLabel.font = [UIFont systemFontOfSize:15]; |
| | | if (SCREEN_WIDTH < 375) { |
| | | _buttonQuickShare.titleLabel.font = [UIFont systemFontOfSize:15 - DYFont]; |
| | | } |
| | | _buttonQuickShare.selected = YES; |
| | | } |
| | | return _buttonQuickShare; |
| | |
| | | [_single_figure_Button setTitle:@" åå¾å享" forState:UIControlStateNormal]; |
| | | [_single_figure_Button setTitleColor:UICOLOR_FROM_RGB(0x444444, 1.0) forState:UIControlStateNormal]; |
| | | [_single_figure_Button setTitleColor:UICOLOR_FROM_RGB(0xE5005C, 1.0) forState:UIControlStateSelected]; |
| | | |
| | | _single_figure_Button.titleLabel.font = [UIFont systemFontOfSize:15]; |
| | | if (SCREEN_WIDTH < 375) { |
| | | _single_figure_Button.titleLabel.font = [UIFont systemFontOfSize:15 - DYFont]; |
| | | } |
| | | |
| | | } |
| | | return _single_figure_Button; |
| | | } |
| | | |
| | | - (ALButton *)multiple_figure_Button { |
| | | if (!_multiple_figure_Button) { |
| | | _multiple_figure_Button = [ALButton buttonWithType:UIButtonTypeCustom]; |
| | | [_multiple_figure_Button setImage:ALIMAGE_NAMED(@"new_share_duotu_normol") forState:UIControlStateNormal]; |
| | | [_multiple_figure_Button setImage:ALIMAGE_NAMED(@"new_share_duotu_select") forState:UIControlStateSelected]; |
| | | |
| | | [_multiple_figure_Button setTitle:@" å¤å¾å享" forState:UIControlStateNormal]; |
| | | [_multiple_figure_Button setTitleColor:UICOLOR_FROM_RGB(0x444444, 1.0) forState:UIControlStateNormal]; |
| | | [_multiple_figure_Button setTitleColor:UICOLOR_FROM_RGB(0xE5005C, 1.0) forState:UIControlStateSelected]; |
| | | |
| | | _multiple_figure_Button.titleLabel.font = [UIFont systemFontOfSize:15]; |
| | | if (SCREEN_WIDTH < 375) { |
| | | _multiple_figure_Button.titleLabel.font = [UIFont systemFontOfSize:15 - DYFont]; |
| | | } |
| | | } |
| | | return _multiple_figure_Button; |
| | | } |
| | | |
| | | - (UIView *)left_Buttom_View { |
| | |
| | | _resultDic = resultDic; |
| | | if (resultDic) { |
| | | UIImage *imagesType = nil; |
| | | if (((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 10) {// 10-æ·å® 11-å¤©ç« 20-äº¬ä¸ 30-æ¼å¤å¤ |
| | | NSInteger shopType = ((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType; |
| | | |
| | | if (shopType == 10) {// 10-æ·å® 11-å¤©ç« 20-äº¬ä¸ 30-æ¼å¤å¤ |
| | | imagesType = [UIImage imageNamed:@"ic_share_taobao"]; |
| | | [self.typeImageView setImage:imagesType]; |
| | | |
| | | } else if (((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 11) { |
| | | } else if (shopType == 11) { |
| | | imagesType = [UIImage imageNamed:@"ic_share_tmall"]; |
| | | [self.typeImageView setImage:imagesType]; |
| | | |
| | | } else if (((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 20 || ((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 21) { |
| | | } else if (shopType == 20 || shopType == 21) { |
| | | imagesType = [UIImage imageNamed:@"ic_share_jd"]; |
| | | [self.typeImageView setImage:imagesType]; |
| | | |
| | | } else if (((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 30) { |
| | | } else if (shopType == 30) { |
| | | imagesType = [UIImage imageNamed:@"ic_share_pdd"]; |
| | | [self.typeImageView setImage:imagesType]; |
| | | self.typeImageView.sd_resetLayout.leftSpaceToView(self.scrollView, 11).topSpaceToView(self.imageView, 9).widthIs(imagesType.size.width).heightIs(imagesType.size.height); |
| | | |
| | | } else if (shopType == 40) { |
| | | imagesType = [UIImage imageNamed:@"ic_share_wph"]; |
| | | [self.typeImageView setImage:imagesType]; |
| | | |
| | | } else if (shopType == 50) { |
| | | imagesType = [UIImage imageNamed:@"ic_share_sn"]; |
| | | [self.typeImageView setImage:imagesType]; |
| | | } |
| | | self.typeImageView.sd_resetLayout.leftSpaceToView(self.scrollView, 11).topSpaceToView(self.imageView, 9).widthIs(imagesType.size.width).heightIs(imagesType.size.height); |
| | | |
| | | self.taobao_tianmall_Label.text = [NSString stringWithFormat:@"%@ ¥%@",((GoodsDetailBaseModel *)resultDic[@"goods"]).priceName,((GoodsDetailBaseModel *)resultDic[@"goods"]).zkPrice]; |
| | | |
| | | // æ é¢ |
| | | |
| | | NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; |
| | | style.lineSpacing = 6 - (self.titleLabel.font.lineHeight - self.titleLabel.font.pointSize); |
| | | style.lineSpacing = 3; |
| | | // 坹齿¹å¼ |
| | | style.alignment = NSTextAlignmentLeft; |
| | | // é¦è¡ç¼©è¿ |
| | |
| | | if (SCREEN_WIDTH > 375) { |
| | | self.titleLabel.sd_resetLayout.leftSpaceToView(self.scrollView, 11).topSpaceToView(self.imageView, 9).rightSpaceToView(self.scrollView, 5).heightIs(35); |
| | | } |
| | | |
| | | if (IS_IPHONE_X) { |
| | | self.titleLabel.sd_resetLayout.leftSpaceToView(self.scrollView, 11).topSpaceToView(self.imageView, 10.5).rightSpaceToView(self.scrollView, 5).heightIs(35); |
| | | } |
| | |
| | | NSString *totalPrice, *amount; |
| | | BOOL isCoupon = NO; |
| | | |
| | | if (((GoodsDetailBaseModel *)resultDic[@"goods"]).hasCoupon) { |
| | | if (((GoodsDetailBaseModel *)resultDic[@"goods"]).hasCoupon || shopType == 40) { |
| | | isCoupon = YES; |
| | | totalPrice = [NSString stringWithFormat:@"å¸åä»· ï¿¥%@",((GoodsDetailBaseModel *)resultDic[@"goods"]).couponPrice]; |
| | | NSString *string = @"å¸åä»·"; |
| | | if (shopType == 40) { |
| | | |
| | | string = @"æåä»·"; |
| | | } |
| | | totalPrice = [NSString stringWithFormat:@"%@ ï¿¥%@",string, ((GoodsDetailBaseModel *)resultDic[@"goods"]).couponPrice]; |
| | | amount = [NSString stringWithFormat:@"Â¥ %@",((GoodsDetailBaseModel *)resultDic[@"goods"]).couponInfo.amount]; |
| | | |
| | | } else { |
| | |
| | | } |
| | | self.totalPriceLabel.attributedText = numString; |
| | | // å
é® |
| | | if (((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 21) { |
| | | if (shopType == 21) { |
| | | self.packageMailLabel.text = @"èªè¥"; |
| | | |
| | | } else if (shopType == 40) { |
| | | isCoupon = NO; |
| | | self.packageMailLabel.font = [UIFont systemFontOfSize:12]; |
| | | self.packageMailLabel.textColor = UICOLOR_FROM_RGB(0xFFFFFF, 1.0); |
| | | self.packageMailLabel.backgroundColor = XYRMainColor; |
| | | |
| | | NSString *string = ((GoodsDetailBaseModel *)resultDic[@"goods"]).discount; |
| | | self.packageMailLabel.text = string; |
| | | CGFloat widthPackageMailLabel = [self getWidthWithText:string height:18 font:12]; |
| | | |
| | | self.packageMailLabel.sd_resetLayout.leftSpaceToView(self.scrollView, 12).bottomEqualToView(self.couponView).heightIs(18).widthIs(widthPackageMailLabel + 10); |
| | | |
| | | } else { |
| | | if (!((GoodsDetailBaseModel *)resultDic[@"goods"]).baoyou) { |
| | |
| | | } else if (((GoodsDetailBaseModel *)resultDic[@"goods"]).salesType == 4) { |
| | | salesString = @"æ»éé"; |
| | | } |
| | | self.salesLabel.text = [NSString stringWithFormat:@"%@ %@",salesString,((GoodsDetailBaseModel *)resultDic[@"goods"]).salesCount]; |
| | | if ([self isHaveValue:((GoodsDetailBaseModel *)resultDic[@"goods"]).salesCount]) { |
| | | self.salesLabel.text = [NSString stringWithFormat:@"%@ %@",salesString,((GoodsDetailBaseModel *)resultDic[@"goods"]).salesCount]; |
| | | } |
| | | |
| | | // æä¼æ å¸ |
| | | if (isCoupon) { |
| | | UIImage *imageCouponRight = [UIImage imageNamed:@"new_share_dantu_quan"]; |
| | | UIImage *imageCouponRight = [UIImage imageNamed:@"new_share_dantu_n"]; |
| | | CGFloat labelHeight = 11.0f; |
| | | if (SCREEN_WIDTH > 375) { |
| | | labelHeight = 11.0f + DYFont; |
| | |
| | | } else { |
| | | self.couponLabel.hidden = YES; |
| | | self.descCouponLabel.hidden = YES; |
| | | self.taobao_tianmall_Label.hidden = YES; |
| | | if (shopType != 40) {//䏿¯å¯åä¼åå |
| | | self.taobao_tianmall_Label.hidden = YES; |
| | | } |
| | | } |
| | | // æ·ç¤¼é |
| | | NSString *fanLiString = resultDic[@"share"][@"spreadMoney"]; |
| | |
| | | if (!_titleLabel) { |
| | | _titleLabel = [[YYLabel alloc] init]; |
| | | _titleLabel.font = [UIFont systemFontOfSize:13]; |
| | | if (SCREEN_WIDTH < 375) { |
| | | _titleLabel.font = [UIFont systemFontOfSize:11.0]; |
| | | } |
| | | _titleLabel.numberOfLines = 2; |
| | | _titleLabel.textColor = UIColorFromRGBValue(0x000000); |
| | | _titleLabel.textVerticalAlignment = YYTextVerticalAlignmentTop; |
| | |
| | | @property (nonatomic, strong) UIView *quanView; |
| | | |
| | | @property (nonatomic, strong) UILabel *quanLabel; |
| | | /// ææ£ |
| | | @property (nonatomic, nullable, strong) UILabel *labelDisCount; |
| | | |
| | | @property (nonatomic, nullable, strong) UIImageView *imageViewStore; |
| | | @property (nonatomic, nullable, strong) UILabel *stroreLabel; |
| | |
| | | |
| | | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { |
| | | [super setSelected:selected animated:animated]; |
| | | |
| | | // Configure the view for the selected state |
| | | } |
| | | |
| | | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { |
| | | |
| | | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; |
| | | |
| | | if (self) { |
| | | self.backgroundColor = XYRBackgroundColor; |
| | | self.selectionStyle = UITableViewCellSelectionStyleNone; |
| | |
| | | |
| | | [self.quanView addSubview:self.couponLabel]; |
| | | self.couponLabel.sd_layout.leftSpaceToView(self.quanLabel, 0).rightSpaceToView(self.quanView, 0).topSpaceToView(self.quanView, 0).bottomSpaceToView(self.quanView, 0); |
| | | |
| | | // ææ£ |
| | | [self.bgView addSubview:self.labelDisCount]; |
| | | self.labelDisCount.sd_layout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).heightIs(0).widthIs(18); |
| | | self.labelDisCount.sd_cornerRadius = @3; |
| | | |
| | | // è¿å©è§å¾ |
| | | [self.bgView addSubview:self.fanLabel]; |
| | |
| | | - (void)setIsHideGaryBgView:(BOOL)isHideGaryBgView { |
| | | //if (isHideGaryBgView) { |
| | | self.stroreLabel.hidden = NO; |
| | | |
| | | //} else { |
| | | // self.stroreLabel.hidden = YES; |
| | | //} |
| | | } |
| | | |
| | | - (void)setIsShowDelete:(BOOL)isShowDelete |
| | | { |
| | | - (void)setIsShowDelete:(BOOL)isShowDelete { |
| | | if (isShowDelete) { |
| | | self.deleteImageView.hidden = NO; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | - (void)setModel:(GoodsDetailBaseModel *)model |
| | | { |
| | | - (void)setModel:(GoodsDetailBaseModel *)model { |
| | | _model = model; |
| | | if (model) { |
| | | self.stroreLabel.text = model.shopInfo.shopName; |
| | |
| | | [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_pdd"]]; |
| | | icomImage = [UIImage imageNamed:@"ic_share_pdd"]; |
| | | |
| | | } else if (model.shopType == 40){ |
| | | [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_wph"]]; |
| | | icomImage = [UIImage imageNamed:@"ic_share_wph"]; |
| | | |
| | | } else if (model.shopType == 50){ |
| | | [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_sn"]]; |
| | | icomImage = [UIImage imageNamed:@"ic_share_sn"]; |
| | | } |
| | | self.typeImageView.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).topSpaceToView(self.bgView, 8).widthIs(icomImage.size.width).heightIs(icomImage.size.height); |
| | | |
| | |
| | | // 坹齿¹å¼ |
| | | style.alignment = NSTextAlignmentLeft; |
| | | // é¦è¡ç¼©è¿ |
| | | CGFloat firstLineHeadIndent = 0; |
| | | if ([model.title hasPrefix:@"ã"]) { |
| | | firstLineHeadIndent = icomImage.size.width + 1; |
| | | |
| | | } else { |
| | | firstLineHeadIndent = icomImage.size.width + 8; |
| | | } |
| | | CGFloat firstLineHeadIndent = 0; |
| | | if ([model.title hasPrefix:@"ã"]) { |
| | | firstLineHeadIndent = icomImage.size.width + 1; |
| | | |
| | | } else { |
| | | firstLineHeadIndent = icomImage.size.width + 8; |
| | | } |
| | | |
| | | style.firstLineHeadIndent = firstLineHeadIndent; |
| | | |
| | |
| | | |
| | | } else { |
| | | self.quanView.hidden = YES; |
| | | |
| | | totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; |
| | | if (model.shopType == 40) { |
| | | totalPriceString = [NSString stringWithFormat:@"%@", model.couponPrice]; |
| | | |
| | | } else { |
| | | totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; |
| | | } |
| | | self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); |
| | | } |
| | | self.totalPriceLabel.text = totalPriceString; |
| | | // ææ£ |
| | | if (model.shopType == 40) { |
| | | self.labelDisCount.hidden = NO; |
| | | self.salesLabel.hidden = YES; |
| | | |
| | | if ([self isHaveValue:model.discount]) { |
| | | |
| | | CGFloat discountLabellWidth = [self getWidthWithText:model.discount height:18 font:self.fanLabel.font.pointSize]; |
| | | self.labelDisCount.text = model.discount; |
| | | |
| | | self.labelDisCount.sd_layout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).heightIs(18).widthIs(roundf(discountLabellWidth + 16)); |
| | | |
| | | self.fanLabel.sd_resetLayout.leftSpaceToView(self.labelDisCount, 8).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); |
| | | |
| | | } else { |
| | | self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); |
| | | } |
| | | |
| | | } else { |
| | | self.labelDisCount.hidden = YES; |
| | | } |
| | | |
| | | |
| | | // æé«è¿å© |
| | | NSString *stringMaxFan = model.moneyInfo.maxMoney; |
| | |
| | | self.labelMaxFan.text = stringMaxFan; |
| | | |
| | | self.labelMaxFan.sd_resetLayout.leftSpaceToView(self.imageSanJiao, -1).bottomEqualToView(self.fanLabel).widthIs(roundf(labelMaxFanWidth + 10)).heightIs(18); |
| | | |
| | | if (!model.moneyInfo.maxMoney || [model.moneyInfo.maxMoney isEqualToString:@""]) { |
| | | self.imageSanJiao.hidden = YES; |
| | | self.labelMaxFan.hidden = YES; |
| | | } |
| | | |
| | | @weakify(self) |
| | | self.labelMaxFan.didFinishAutoLayoutBlock = ^(CGRect frame) { |
| | |
| | | maskLayer.path = maskPath.CGPath; |
| | | self.labelMaxFan.layer.mask = maskLayer; |
| | | }; |
| | | if (model.moneyInfo.maxMoney && ![model.moneyInfo.maxMoney isEqualToString:@""]) { |
| | | if (model.moneyInfo.maxMoney && ![model.moneyInfo.maxMoney isEqualToString:@""] && model.shopType != 40) { |
| | | self.imageSanJiao.hidden = NO; |
| | | self.labelMaxFan.hidden = NO; |
| | | |
| | |
| | | } |
| | | |
| | | - (UIImageView *)typeImageView { |
| | | |
| | | if (!_typeImageView) { |
| | | _typeImageView = [[UIImageView alloc] init]; |
| | | } |
| | |
| | | } |
| | | |
| | | - (YYLabel *)titleLabel { |
| | | |
| | | if (!_titleLabel) { |
| | | _titleLabel = [[YYLabel alloc] init]; |
| | | _titleLabel.font = [UIFont systemFontOfSize:13]; |
| | |
| | | return _fanLabel; |
| | | } |
| | | |
| | | - (UILabel *)labelDisCount { |
| | | if (!_labelDisCount) { |
| | | _labelDisCount = [[UILabel alloc] init]; |
| | | _labelDisCount.textColor = UIColorFromRGBValue(0xFFFFFF); |
| | | _labelDisCount.font = [UIFont systemFontOfSize:12]; |
| | | _labelDisCount.textAlignment = NSTextAlignmentCenter; |
| | | _labelDisCount.backgroundColor = UIColorFromRGBValue(0xE5005C); |
| | | _labelDisCount.hidden = YES; |
| | | } |
| | | return _labelDisCount; |
| | | } |
| | | |
| | | - (UILabel *)promoteRedEnvelopeLabel { |
| | | if (!_promoteRedEnvelopeLabel) { |
| | | _promoteRedEnvelopeLabel = [[UILabel alloc] init]; |
| | |
| | | isa = PBXProject; |
| | | attributes = { |
| | | LastSwiftUpdateCheck = 0930; |
| | | LastUpgradeCheck = 1130; |
| | | LastUpgradeCheck = 1140; |
| | | }; |
| | | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; |
| | | compatibilityVersion = "Xcode 3.2"; |
| | |
| | | isa = XCBuildConfiguration; |
| | | buildSettings = { |
| | | ALWAYS_SEARCH_USER_PATHS = NO; |
| | | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; |
| | | CLANG_ANALYZER_NONNULL = YES; |
| | | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; |
| | | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; |
| | |
| | | isa = XCBuildConfiguration; |
| | | buildSettings = { |
| | | ALWAYS_SEARCH_USER_PATHS = NO; |
| | | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; |
| | | CLANG_ANALYZER_NONNULL = YES; |
| | | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; |
| | | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; |
| | |
| | | <key>AFNetworking.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>1</integer> |
| | | <integer>2</integer> |
| | | </dict> |
| | | <key>CRBoxInputView.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>2</integer> |
| | | <integer>20</integer> |
| | | </dict> |
| | | <key>GPUImage.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>3</integer> |
| | | <integer>16</integer> |
| | | </dict> |
| | | <key>IQKeyboardManager.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>4</integer> |
| | | <integer>8</integer> |
| | | </dict> |
| | | <key>MBProgressHUD.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>6</integer> |
| | | <integer>9</integer> |
| | | </dict> |
| | | <key>MJRefresh.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>7</integer> |
| | | <integer>17</integer> |
| | | </dict> |
| | | <key>Masonry.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>5</integer> |
| | | <integer>3</integer> |
| | | </dict> |
| | | <key>Pods-MIduo.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>12</integer> |
| | | <integer>1</integer> |
| | | </dict> |
| | | <key>ReactiveCocoa.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>13</integer> |
| | | <integer>24</integer> |
| | | </dict> |
| | | <key>SAMKeychain.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>14</integer> |
| | | <integer>22</integer> |
| | | </dict> |
| | | <key>SDAutoLayout.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>15</integer> |
| | | <integer>27</integer> |
| | | </dict> |
| | | <key>SDWebImage.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>16</integer> |
| | | <integer>13</integer> |
| | | </dict> |
| | | <key>SVProgressHUD.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>17</integer> |
| | | <integer>12</integer> |
| | | </dict> |
| | | <key>TYSnapshotScroll.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>19</integer> |
| | | <integer>10</integer> |
| | | </dict> |
| | | <key>TZImagePickerController.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>20</integer> |
| | | <integer>11</integer> |
| | | </dict> |
| | | <key>Toast.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>18</integer> |
| | | <integer>19</integer> |
| | | </dict> |
| | | <key>UICollectionViewLeftAlignedLayout.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | |
| | | <key>UICountingLabel.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>22</integer> |
| | | <integer>23</integer> |
| | | </dict> |
| | | <key>YYCache.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>23</integer> |
| | | <integer>25</integer> |
| | | </dict> |
| | | <key>YYImage.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>24</integer> |
| | | <integer>18</integer> |
| | | </dict> |
| | | <key>YYModel.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>25</integer> |
| | | <integer>26</integer> |
| | | </dict> |
| | | <key>YYText.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>26</integer> |
| | | <integer>5</integer> |
| | | </dict> |
| | | <key>YYWebImage.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>27</integer> |
| | | <integer>6</integer> |
| | | </dict> |
| | | <key>mob_sharesdk-ShareSDK.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>8</integer> |
| | | <integer>14</integer> |
| | | </dict> |
| | | <key>mob_sharesdk-ShareSDK_JS_QQ.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>9</integer> |
| | | <integer>4</integer> |
| | | </dict> |
| | | <key>mob_sharesdk-ShareSDK_JS_SinaWeibo.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>10</integer> |
| | | <integer>7</integer> |
| | | </dict> |
| | | <key>mob_sharesdk-ShareSDK_JS_WeChat.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>11</integer> |
| | | <integer>15</integer> |
| | | </dict> |
| | | </dict> |
| | | </dict> |