diff --git a/ProductApp/ProductApp.xcodeproj/project.pbxproj b/ProductApp/ProductApp.xcodeproj/project.pbxproj index 9a0dd92..8716b90 100644 --- a/ProductApp/ProductApp.xcodeproj/project.pbxproj +++ b/ProductApp/ProductApp.xcodeproj/project.pbxproj @@ -124,6 +124,21 @@ CAB2AB512D9250960022C535 /* AlimamaShuHeiTi.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CAB2AB502D9250960022C535 /* AlimamaShuHeiTi.ttf */; }; CAB2AB552D9285060022C535 /* DuanXinViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CAB2AB542D9285060022C535 /* DuanXinViewController.m */; }; CAB2AB592D9285A90022C535 /* DuanXinView.m in Sources */ = {isa = PBXBuildFile; fileRef = CAB2AB582D9285A90022C535 /* DuanXinView.m */; }; + CACFDB0F2DACA5A20070C65A /* HuaShuSJQViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB0E2DACA5A20070C65A /* HuaShuSJQViewController.m */; }; + CACFDB132DACA62D0070C65A /* HuaShuSJQView.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB122DACA62D0070C65A /* HuaShuSJQView.m */; }; + CACFDB172DACAAB50070C65A /* HuaShuSJQCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB162DACAAB50070C65A /* HuaShuSJQCollectionViewCell.m */; }; + CACFDB1B2DACDFD40070C65A /* MoNiShiPingHCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB1A2DACDFD40070C65A /* MoNiShiPingHCViewController.m */; }; + CACFDB1F2DACDFFF0070C65A /* MoNiShiPingHCView.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB1E2DACDFFF0070C65A /* MoNiShiPingHCView.m */; }; + CACFDB232DACE28C0070C65A /* MoNiShiPingHCCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB222DACE28C0070C65A /* MoNiShiPingHCCollectionViewCell.m */; }; + CACFDB272DACF0FB0070C65A /* MoNiShiPingHCCLViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB262DACF0FB0070C65A /* MoNiShiPingHCCLViewController.m */; }; + CACFDB2B2DACF1420070C65A /* MoNiShiPingHCCLView.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB2A2DACF1420070C65A /* MoNiShiPingHCCLView.m */; }; + CACFDB4C2DACF2C90070C65A /* WMPlayer.bundle in Resources */ = {isa = PBXBuildFile; fileRef = CACFDB472DACF2C90070C65A /* WMPlayer.bundle */; }; + CACFDB4D2DACF2C90070C65A /* WMPlayerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB4A2DACF2C90070C65A /* WMPlayerModel.m */; }; + CACFDB4E2DACF2C90070C65A /* UIViewController+ShouldAutorotate.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB402DACF2C90070C65A /* UIViewController+ShouldAutorotate.m */; }; + CACFDB4F2DACF2C90070C65A /* WMLightView.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB452DACF2C90070C65A /* WMLightView.m */; }; + CACFDB502DACF2C90070C65A /* FastForwardView.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB432DACF2C90070C65A /* FastForwardView.m */; }; + CACFDB512DACF2C90070C65A /* WMPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB482DACF2C90070C65A /* WMPlayer.m */; }; + CACFDB542DACF8E90070C65A /* MoNiShiPingHCCLDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = CACFDB532DACF8E90070C65A /* MoNiShiPingHCCLDetailView.m */; }; CAE016F42D94EAA1004777D4 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CAE016F32D94EAA1004777D4 /* LoginViewController.m */; }; CAE016F82D94EB71004777D4 /* LoginView.m in Sources */ = {isa = PBXBuildFile; fileRef = CAE016F72D94EB71004777D4 /* LoginView.m */; }; CAE016FB2D94F63B004777D4 /* LoginWXView.m in Sources */ = {isa = PBXBuildFile; fileRef = CAE016FA2D94F63B004777D4 /* LoginWXView.m */; }; @@ -511,6 +526,35 @@ CAB2AB542D9285060022C535 /* DuanXinViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DuanXinViewController.m; sourceTree = ""; }; CAB2AB572D9285A90022C535 /* DuanXinView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DuanXinView.h; sourceTree = ""; }; CAB2AB582D9285A90022C535 /* DuanXinView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DuanXinView.m; sourceTree = ""; }; + CACFDB0D2DACA5A20070C65A /* HuaShuSJQViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HuaShuSJQViewController.h; sourceTree = ""; }; + CACFDB0E2DACA5A20070C65A /* HuaShuSJQViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HuaShuSJQViewController.m; sourceTree = ""; }; + CACFDB112DACA62D0070C65A /* HuaShuSJQView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HuaShuSJQView.h; sourceTree = ""; }; + CACFDB122DACA62D0070C65A /* HuaShuSJQView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HuaShuSJQView.m; sourceTree = ""; }; + CACFDB152DACAAB50070C65A /* HuaShuSJQCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HuaShuSJQCollectionViewCell.h; sourceTree = ""; }; + CACFDB162DACAAB50070C65A /* HuaShuSJQCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HuaShuSJQCollectionViewCell.m; sourceTree = ""; }; + CACFDB192DACDFD40070C65A /* MoNiShiPingHCViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MoNiShiPingHCViewController.h; sourceTree = ""; }; + CACFDB1A2DACDFD40070C65A /* MoNiShiPingHCViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MoNiShiPingHCViewController.m; sourceTree = ""; }; + CACFDB1D2DACDFFF0070C65A /* MoNiShiPingHCView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MoNiShiPingHCView.h; sourceTree = ""; }; + CACFDB1E2DACDFFF0070C65A /* MoNiShiPingHCView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MoNiShiPingHCView.m; sourceTree = ""; }; + CACFDB212DACE28C0070C65A /* MoNiShiPingHCCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MoNiShiPingHCCollectionViewCell.h; sourceTree = ""; }; + CACFDB222DACE28C0070C65A /* MoNiShiPingHCCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MoNiShiPingHCCollectionViewCell.m; sourceTree = ""; }; + CACFDB252DACF0FB0070C65A /* MoNiShiPingHCCLViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MoNiShiPingHCCLViewController.h; sourceTree = ""; }; + CACFDB262DACF0FB0070C65A /* MoNiShiPingHCCLViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MoNiShiPingHCCLViewController.m; sourceTree = ""; }; + CACFDB292DACF1420070C65A /* MoNiShiPingHCCLView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MoNiShiPingHCCLView.h; sourceTree = ""; }; + CACFDB2A2DACF1420070C65A /* MoNiShiPingHCCLView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MoNiShiPingHCCLView.m; sourceTree = ""; }; + CACFDB3F2DACF2C90070C65A /* UIViewController+ShouldAutorotate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIViewController+ShouldAutorotate.h"; sourceTree = ""; }; + CACFDB402DACF2C90070C65A /* UIViewController+ShouldAutorotate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+ShouldAutorotate.m"; sourceTree = ""; }; + CACFDB422DACF2C90070C65A /* FastForwardView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FastForwardView.h; sourceTree = ""; }; + CACFDB432DACF2C90070C65A /* FastForwardView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FastForwardView.m; sourceTree = ""; }; + CACFDB442DACF2C90070C65A /* WMLightView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WMLightView.h; sourceTree = ""; }; + CACFDB452DACF2C90070C65A /* WMLightView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WMLightView.m; sourceTree = ""; }; + CACFDB462DACF2C90070C65A /* WMPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WMPlayer.h; sourceTree = ""; }; + CACFDB472DACF2C90070C65A /* WMPlayer.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = WMPlayer.bundle; sourceTree = ""; }; + CACFDB482DACF2C90070C65A /* WMPlayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WMPlayer.m; sourceTree = ""; }; + CACFDB492DACF2C90070C65A /* WMPlayerModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WMPlayerModel.h; sourceTree = ""; }; + CACFDB4A2DACF2C90070C65A /* WMPlayerModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WMPlayerModel.m; sourceTree = ""; }; + CACFDB522DACF8E90070C65A /* MoNiShiPingHCCLDetailView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MoNiShiPingHCCLDetailView.h; sourceTree = ""; }; + CACFDB532DACF8E90070C65A /* MoNiShiPingHCCLDetailView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MoNiShiPingHCCLDetailView.m; sourceTree = ""; }; CAE016F22D94EAA1004777D4 /* LoginViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = ""; }; CAE016F32D94EAA1004777D4 /* LoginViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = ""; }; CAE016F62D94EB71004777D4 /* LoginView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginView.h; sourceTree = ""; }; @@ -1402,6 +1446,8 @@ CAB2AB442D9242B70022C535 /* 首页 */ = { isa = PBXGroup; children = ( + CACFDB182DACDFB90070C65A /* 模拟视频 */, + CACFDB0C2DACA5900070C65A /* 话术升阶器 */, CA9934EC2D9CCCB300E3F6CB /* 黑屏页面和模拟主页 */, CA2A7EA62D9B80EC0006CD05 /* 模拟来电 */, CA2A7E9E2D9B7B510006CD05 /* 转账提示音 */, @@ -1465,6 +1511,112 @@ path = view; sourceTree = ""; }; + CACFDB0C2DACA5900070C65A /* 话术升阶器 */ = { + isa = PBXGroup; + children = ( + CACFDB142DACAAA80070C65A /* cell */, + CACFDB102DACA61C0070C65A /* view */, + CACFDB0D2DACA5A20070C65A /* HuaShuSJQViewController.h */, + CACFDB0E2DACA5A20070C65A /* HuaShuSJQViewController.m */, + ); + path = "话术升阶器"; + sourceTree = ""; + }; + CACFDB102DACA61C0070C65A /* view */ = { + isa = PBXGroup; + children = ( + CACFDB112DACA62D0070C65A /* HuaShuSJQView.h */, + CACFDB122DACA62D0070C65A /* HuaShuSJQView.m */, + ); + path = view; + sourceTree = ""; + }; + CACFDB142DACAAA80070C65A /* cell */ = { + isa = PBXGroup; + children = ( + CACFDB152DACAAB50070C65A /* HuaShuSJQCollectionViewCell.h */, + CACFDB162DACAAB50070C65A /* HuaShuSJQCollectionViewCell.m */, + ); + path = cell; + sourceTree = ""; + }; + CACFDB182DACDFB90070C65A /* 模拟视频 */ = { + isa = PBXGroup; + children = ( + CACFDB242DACF0DD0070C65A /* 视频处理 */, + CACFDB202DACE27D0070C65A /* cell */, + CACFDB1C2DACDFF40070C65A /* view */, + CACFDB192DACDFD40070C65A /* MoNiShiPingHCViewController.h */, + CACFDB1A2DACDFD40070C65A /* MoNiShiPingHCViewController.m */, + ); + path = "模拟视频"; + sourceTree = ""; + }; + CACFDB1C2DACDFF40070C65A /* view */ = { + isa = PBXGroup; + children = ( + CACFDB1D2DACDFFF0070C65A /* MoNiShiPingHCView.h */, + CACFDB1E2DACDFFF0070C65A /* MoNiShiPingHCView.m */, + ); + path = view; + sourceTree = ""; + }; + CACFDB202DACE27D0070C65A /* cell */ = { + isa = PBXGroup; + children = ( + CACFDB212DACE28C0070C65A /* MoNiShiPingHCCollectionViewCell.h */, + CACFDB222DACE28C0070C65A /* MoNiShiPingHCCollectionViewCell.m */, + ); + path = cell; + sourceTree = ""; + }; + CACFDB242DACF0DD0070C65A /* 视频处理 */ = { + isa = PBXGroup; + children = ( + CACFDB282DACF1370070C65A /* view */, + CACFDB252DACF0FB0070C65A /* MoNiShiPingHCCLViewController.h */, + CACFDB262DACF0FB0070C65A /* MoNiShiPingHCCLViewController.m */, + ); + path = "视频处理"; + sourceTree = ""; + }; + CACFDB282DACF1370070C65A /* view */ = { + isa = PBXGroup; + children = ( + CACFDB292DACF1420070C65A /* MoNiShiPingHCCLView.h */, + CACFDB2A2DACF1420070C65A /* MoNiShiPingHCCLView.m */, + CACFDB522DACF8E90070C65A /* MoNiShiPingHCCLDetailView.h */, + CACFDB532DACF8E90070C65A /* MoNiShiPingHCCLDetailView.m */, + ); + path = view; + sourceTree = ""; + }; + CACFDB412DACF2C90070C65A /* Category */ = { + isa = PBXGroup; + children = ( + CACFDB3F2DACF2C90070C65A /* UIViewController+ShouldAutorotate.h */, + CACFDB402DACF2C90070C65A /* UIViewController+ShouldAutorotate.m */, + ); + path = Category; + sourceTree = ""; + }; + CACFDB4B2DACF2C90070C65A /* WMPlayer */ = { + isa = PBXGroup; + children = ( + CACFDB412DACF2C90070C65A /* Category */, + CACFDB422DACF2C90070C65A /* FastForwardView.h */, + CACFDB432DACF2C90070C65A /* FastForwardView.m */, + CACFDB442DACF2C90070C65A /* WMLightView.h */, + CACFDB452DACF2C90070C65A /* WMLightView.m */, + CACFDB462DACF2C90070C65A /* WMPlayer.h */, + CACFDB472DACF2C90070C65A /* WMPlayer.bundle */, + CACFDB482DACF2C90070C65A /* WMPlayer.m */, + CACFDB492DACF2C90070C65A /* WMPlayerModel.h */, + CACFDB4A2DACF2C90070C65A /* WMPlayerModel.m */, + ); + path = WMPlayer; + sourceTree = ""; + }; CAE016F12D94EA92004777D4 /* login */ = { isa = PBXGroup; children = ( @@ -1759,6 +1911,7 @@ CB489E1A2744A0BC00DA044A /* BaseControl */ = { isa = PBXGroup; children = ( + CACFDB4B2DACF2C90070C65A /* WMPlayer */, CAE017042D951F70004777D4 /* TTTAttributedLabel */, CA3CD5D42D913FF5002707C1 /* zfbSdk */, CBD422B228DAF2E800C32440 /* JhtBannerScrollView */, @@ -2448,6 +2601,7 @@ CB489FC32744A0BD00DA044A /* loading2@2x.png in Resources */, CB489FBD2744A0BD00DA044A /* loading3@3x.png in Resources */, CA3CD5FA2D9140D5002707C1 /* Pay_Public_go@2x.png in Resources */, + CACFDB4C2DACF2C90070C65A /* WMPlayer.bundle in Resources */, CA3CD5FB2D9140D5002707C1 /* Pay_Public_余额抵扣.png in Resources */, CA3CD5FC2D9140D5002707C1 /* Pau_Public_X@2x.png in Resources */, CA3CD5FD2D9140D5002707C1 /* Pay_Public_QianWang@2x.png in Resources */, @@ -2570,6 +2724,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + CACFDB4D2DACF2C90070C65A /* WMPlayerModel.m in Sources */, + CACFDB4E2DACF2C90070C65A /* UIViewController+ShouldAutorotate.m in Sources */, + CACFDB4F2DACF2C90070C65A /* WMLightView.m in Sources */, + CACFDB502DACF2C90070C65A /* FastForwardView.m in Sources */, + CACFDB512DACF2C90070C65A /* WMPlayer.m in Sources */, CA0351B32D964D96002D3F98 /* YouHuiQuanDuiHuanListView.m in Sources */, CA0351B42D964D96002D3F98 /* YouHuiQuanViewController.m in Sources */, CA0351B52D964D96002D3F98 /* YouHuiQuanDuiHuanView.m in Sources */, @@ -2584,6 +2743,7 @@ CA0351CD2D964E13002D3F98 /* ZJCollectionView.m in Sources */, CA0351CE2D964E13002D3F98 /* ZJSegmentStyle.m in Sources */, CA0351CF2D964E13002D3F98 /* ZJTitleView.m in Sources */, + CACFDB232DACE28C0070C65A /* MoNiShiPingHCCollectionViewCell.m in Sources */, CA0351D02D964E13002D3F98 /* ZJScrollPageView.m in Sources */, CA0351D12D964E13002D3F98 /* UIViewController+ZJScrollPageController.m in Sources */, CA0351D22D964E13002D3F98 /* UIView+ZJFrame.m in Sources */, @@ -2627,6 +2787,7 @@ CA3CD5A72D913D27002707C1 /* PayOrderModel.m in Sources */, CA3CD5A82D913D27002707C1 /* UserUploadModel.m in Sources */, CA3CD5A92D913D27002707C1 /* UserLoginModel.m in Sources */, + CACFDB1B2DACDFD40070C65A /* MoNiShiPingHCViewController.m in Sources */, CA3CD5AA2D913D27002707C1 /* UserCodeModel.m in Sources */, CA3CD5AB2D913D27002707C1 /* UserConfigModel.m in Sources */, CA3CD5AC2D913D27002707C1 /* M3u8Model.m in Sources */, @@ -2654,6 +2815,7 @@ CA3CD60F2D9140D5002707C1 /* PayPublicYouHuiLogListViewCell.m in Sources */, CA3CD6102D9140D5002707C1 /* PayPublicYouHuiLogListView.m in Sources */, CA3CD6112D9140D5002707C1 /* PayPublicView.m in Sources */, + CACFDB1F2DACDFFF0070C65A /* MoNiShiPingHCView.m in Sources */, CA2A7EA52D9B7BDD0006CD05 /* ZhuanZhangTSYView.m in Sources */, CA3CD6122D9140D5002707C1 /* PayPublicYouHuiView.m in Sources */, CA9934EF2D9CCD8E00E3F6CB /* MoNiLaiDianShowView.m in Sources */, @@ -2665,6 +2827,7 @@ CA589DC32D97C02600D85384 /* DuanXinShowMainHomeView.m in Sources */, CB489F512744A0BD00DA044A /* PGJSearchView.m in Sources */, CB489F7A2744A0BD00DA044A /* FSTextView.m in Sources */, + CACFDB0F2DACA5A20070C65A /* HuaShuSJQViewController.m in Sources */, CA03519C2D964841002D3F98 /* GuanYuWoMenViewController.m in Sources */, CA1EADB02D9A65C70008907A /* ShiPinDianHuaShowView.m in Sources */, CAB2AB592D9285A90022C535 /* DuanXinView.m in Sources */, @@ -2690,6 +2853,7 @@ CB489F772744A0BD00DA044A /* WYCamaImageTools.m in Sources */, CA3CD5BA2D913D3E002707C1 /* PayManager.m in Sources */, CA3CD5BB2D913D3E002707C1 /* VistaInAppPurchaseManager.m in Sources */, + CACFDB172DACAAB50070C65A /* HuaShuSJQCollectionViewCell.m in Sources */, CB489FB42744A0BD00DA044A /* CXDatePickerView.m in Sources */, CA1EADA92D9A3DED0008907A /* ShiPinDianHuaViewController.m in Sources */, CB489F7B2744A0BD00DA044A /* UIImageView+VideoImageView.m in Sources */, @@ -2740,6 +2904,7 @@ CB489F642744A0BD00DA044A /* DAYNavigationBar.m in Sources */, CBD422B928DAF2E800C32440 /* JhtBannerScrollView.m in Sources */, CA0351E92D9675D2002D3F98 /* HuiYuanZXGoodsView.m in Sources */, + CACFDB132DACA62D0070C65A /* HuaShuSJQView.m in Sources */, CB489FB82744A0BD00DA044A /* HXLoadingHUD.m in Sources */, CB489FA82744A0BD00DA044A /* XLProgressView.m in Sources */, CA0351982D964530002D3F98 /* ZhangHuGuanLiTableViewCell.m in Sources */, @@ -2748,12 +2913,14 @@ CAE016FE2D94F645004777D4 /* LoginAppleView.m in Sources */, CB489FD82744A30000DA044A /* PGGMovieLineSetView.m in Sources */, CB489F4D2744A0BD00DA044A /* AddressListAlterView.m in Sources */, + CACFDB272DACF0FB0070C65A /* MoNiShiPingHCCLViewController.m in Sources */, CB489F5A2744A0BD00DA044A /* YQLocationTransform.m in Sources */, CB489F782744A0BD00DA044A /* NSBundle+DAUtils.m in Sources */, CB489F4C2744A0BD00DA044A /* AddressListUrlAlterView.m in Sources */, CBD422BD28DAF34B00C32440 /* IndexSectionView.m in Sources */, CA0351A32D964926002D3F98 /* PeiZhiShowView.m in Sources */, CB489FAF2744A0BD00DA044A /* FSActionSheetConfig.m in Sources */, + CACFDB2B2DACF1420070C65A /* MoNiShiPingHCCLView.m in Sources */, CB489FB52744A0BD00DA044A /* HYTimePickerView.m in Sources */, CA1EADAD2D9A3E8B0008907A /* ShiPinDianHuaView.m in Sources */, CB489F722744A0BD00DA044A /* MCTabBarController.m in Sources */, @@ -2762,6 +2929,7 @@ CAE0171F2D95379B004777D4 /* ImageCollectionViewCell.m in Sources */, CAE017202D95379B004777D4 /* YiJianFanKuiController.m in Sources */, CA1EADBB2D9A91080008907A /* YuYinDianHuaShowView.m in Sources */, + CACFDB542DACF8E90070C65A /* MoNiShiPingHCCLDetailView.m in Sources */, CAE0170C2D952EA2004777D4 /* MainMyUserView.m in Sources */, CB489F732744A0BD00DA044A /* BaseViewController.m in Sources */, CA3CD5792D913CFA002707C1 /* TimeTools.m in Sources */, diff --git a/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate b/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate index 69edb72..05fe474 100644 Binary files a/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate and b/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_bofang.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_bofang.imageset/Contents.json new file mode 100644 index 0000000..c452fe9 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_bofang.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 43068@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 43068@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_bofang.imageset/组 43068@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_bofang.imageset/组 43068@2x.png new file mode 100644 index 0000000..37717de Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_bofang.imageset/组 43068@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_bofang.imageset/组 43068@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_bofang.imageset/组 43068@3x.png new file mode 100644 index 0000000..457c0ea Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_bofang.imageset/组 43068@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_下载到相册.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_下载到相册.imageset/Contents.json new file mode 100644 index 0000000..d88756a --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_下载到相册.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 43049@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 43049@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_下载到相册.imageset/组 43049@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_下载到相册.imageset/组 43049@2x.png new file mode 100644 index 0000000..6c0bfa6 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_下载到相册.imageset/组 43049@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_下载到相册.imageset/组 43049@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_下载到相册.imageset/组 43049@3x.png new file mode 100644 index 0000000..77f9760 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_下载到相册.imageset/组 43049@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_分享至微信.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_分享至微信.imageset/Contents.json new file mode 100644 index 0000000..1dd48b2 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_分享至微信.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 43049@2x(2).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 43049@3x(2).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_分享至微信.imageset/组 43049@2x(2).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_分享至微信.imageset/组 43049@2x(2).png new file mode 100644 index 0000000..28f7210 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_分享至微信.imageset/组 43049@2x(2).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_分享至微信.imageset/组 43049@3x(2).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_分享至微信.imageset/组 43049@3x(2).png new file mode 100644 index 0000000..4af7c16 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_分享至微信.imageset/组 43049@3x(2).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_重新录制.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_重新录制.imageset/Contents.json new file mode 100644 index 0000000..7365f4a --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_重新录制.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 43049@2x(1).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 43049@3x(1).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_重新录制.imageset/组 43049@2x(1).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_重新录制.imageset/组 43049@2x(1).png new file mode 100644 index 0000000..461fc29 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_重新录制.imageset/组 43049@2x(1).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_重新录制.imageset/组 43049@3x(1).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_重新录制.imageset/组 43049@3x(1).png new file mode 100644 index 0000000..107f09b Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/模拟视频/sphc_重新录制.imageset/组 43049@3x(1).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_FaceTime.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_FaceTime.imageset/Contents.json new file mode 100644 index 0000000..1f7f5f4 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_FaceTime.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45426@2x(3).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45426@3x(3).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_FaceTime.imageset/组 45426@2x(3).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_FaceTime.imageset/组 45426@2x(3).png new file mode 100644 index 0000000..7635c7c Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_FaceTime.imageset/组 45426@2x(3).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_FaceTime.imageset/组 45426@3x(3).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_FaceTime.imageset/组 45426@3x(3).png new file mode 100644 index 0000000..a5710b9 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_FaceTime.imageset/组 45426@3x(3).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_免提.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_免提.imageset/Contents.json new file mode 100644 index 0000000..040d06c --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_免提.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45426@2x(4).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45426@3x(4).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_免提.imageset/组 45426@2x(4).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_免提.imageset/组 45426@2x(4).png new file mode 100644 index 0000000..717adb3 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_免提.imageset/组 45426@2x(4).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_免提.imageset/组 45426@3x(4).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_免提.imageset/组 45426@3x(4).png new file mode 100644 index 0000000..6eb1445 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_免提.imageset/组 45426@3x(4).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_拨号键盘.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_拨号键盘.imageset/Contents.json new file mode 100644 index 0000000..68398de --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_拨号键盘.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45426@2x(2).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45426@3x(2).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_拨号键盘.imageset/组 45426@2x(2).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_拨号键盘.imageset/组 45426@2x(2).png new file mode 100644 index 0000000..e0899b7 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_拨号键盘.imageset/组 45426@2x(2).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_拨号键盘.imageset/组 45426@3x(2).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_拨号键盘.imageset/组 45426@3x(2).png new file mode 100644 index 0000000..cd3c443 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_拨号键盘.imageset/组 45426@3x(2).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_接听.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_接听.imageset/Contents.json new file mode 100644 index 0000000..5d7c31a --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_接听.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45426@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45426@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_接听.imageset/组 45426@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_接听.imageset/组 45426@2x.png new file mode 100644 index 0000000..31abab5 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_接听.imageset/组 45426@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_接听.imageset/组 45426@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_接听.imageset/组 45426@3x.png new file mode 100644 index 0000000..4006c4c Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_接听.imageset/组 45426@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_添加通话.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_添加通话.imageset/Contents.json new file mode 100644 index 0000000..734485f --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_添加通话.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45426@2x(1).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45426@3x(1).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_添加通话.imageset/组 45426@2x(1).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_添加通话.imageset/组 45426@2x(1).png new file mode 100644 index 0000000..6b49988 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_添加通话.imageset/组 45426@2x(1).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_添加通话.imageset/组 45426@3x(1).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_添加通话.imageset/组 45426@3x(1).png new file mode 100644 index 0000000..2e005ad Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_添加通话.imageset/组 45426@3x(1).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_通讯录.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_通讯录.imageset/Contents.json new file mode 100644 index 0000000..27623b6 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_通讯录.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45426@2x(5).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45426@3x(5).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_通讯录.imageset/组 45426@2x(5).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_通讯录.imageset/组 45426@2x(5).png new file mode 100644 index 0000000..0966c69 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_通讯录.imageset/组 45426@2x(5).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_通讯录.imageset/组 45426@3x(5).png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_通讯录.imageset/组 45426@3x(5).png new file mode 100644 index 0000000..296d232 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_通讯录.imageset/组 45426@3x(5).png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_静音.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_静音.imageset/Contents.json new file mode 100644 index 0000000..5d7c31a --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_静音.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45426@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45426@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_静音.imageset/组 45426@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_静音.imageset/组 45426@2x.png new file mode 100644 index 0000000..70addd3 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_静音.imageset/组 45426@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_静音.imageset/组 45426@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_静音.imageset/组 45426@3x.png new file mode 100644 index 0000000..ea1f1e3 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/电话来电/dh_静音.imageset/组 45426@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_copy.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_copy.imageset/Contents.json new file mode 100644 index 0000000..7b6156b --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_copy.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "容器@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "容器@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_copy.imageset/容器@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_copy.imageset/容器@2x.png new file mode 100644 index 0000000..b4639e5 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_copy.imageset/容器@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_copy.imageset/容器@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_copy.imageset/容器@3x.png new file mode 100644 index 0000000..55bd873 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_copy.imageset/容器@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_互联网黑话.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_互联网黑话.imageset/Contents.json new file mode 100644 index 0000000..6d19822 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_互联网黑话.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45793@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45793@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_互联网黑话.imageset/组 45793@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_互联网黑话.imageset/组 45793@2x.png new file mode 100644 index 0000000..08f93be Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_互联网黑话.imageset/组 45793@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_互联网黑话.imageset/组 45793@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_互联网黑话.imageset/组 45793@3x.png new file mode 100644 index 0000000..7586a39 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_互联网黑话.imageset/组 45793@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_体制内风格.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_体制内风格.imageset/Contents.json new file mode 100644 index 0000000..4c99da2 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_体制内风格.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45795@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45795@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_体制内风格.imageset/组 45795@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_体制内风格.imageset/组 45795@2x.png new file mode 100644 index 0000000..0c98444 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_体制内风格.imageset/组 45795@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_体制内风格.imageset/组 45795@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_体制内风格.imageset/组 45795@3x.png new file mode 100644 index 0000000..bd5172e Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_体制内风格.imageset/组 45795@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_商业精英.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_商业精英.imageset/Contents.json new file mode 100644 index 0000000..76901dd --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_商业精英.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45791@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45791@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_商业精英.imageset/组 45791@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_商业精英.imageset/组 45791@2x.png new file mode 100644 index 0000000..475b102 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_商业精英.imageset/组 45791@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_商业精英.imageset/组 45791@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_商业精英.imageset/组 45791@3x.png new file mode 100644 index 0000000..9b3bfbf Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_商业精英.imageset/组 45791@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_学术权威.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_学术权威.imageset/Contents.json new file mode 100644 index 0000000..3821225 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_学术权威.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45792@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45792@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_学术权威.imageset/组 45792@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_学术权威.imageset/组 45792@2x.png new file mode 100644 index 0000000..c4b1454 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_学术权威.imageset/组 45792@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_学术权威.imageset/组 45792@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_学术权威.imageset/组 45792@3x.png new file mode 100644 index 0000000..4fbcf06 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_学术权威.imageset/组 45792@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_文艺哲学.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_文艺哲学.imageset/Contents.json new file mode 100644 index 0000000..bc24f37 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_文艺哲学.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45794@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45794@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_文艺哲学.imageset/组 45794@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_文艺哲学.imageset/组 45794@2x.png new file mode 100644 index 0000000..a18cd16 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_文艺哲学.imageset/组 45794@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_文艺哲学.imageset/组 45794@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_文艺哲学.imageset/组 45794@3x.png new file mode 100644 index 0000000..87b0720 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_文艺哲学.imageset/组 45794@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_科技极客.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_科技极客.imageset/Contents.json new file mode 100644 index 0000000..c6cdf1b --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_科技极客.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45796@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45796@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_科技极客.imageset/组 45796@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_科技极客.imageset/组 45796@2x.png new file mode 100644 index 0000000..0cceaa5 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_科技极客.imageset/组 45796@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_科技极客.imageset/组 45796@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_科技极客.imageset/组 45796@3x.png new file mode 100644 index 0000000..815361d Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_科技极客.imageset/组 45796@3x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_金融投行.imageset/Contents.json b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_金融投行.imageset/Contents.json new file mode 100644 index 0000000..43267c1 --- /dev/null +++ b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_金融投行.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "组 45797@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 45797@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_金融投行.imageset/组 45797@2x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_金融投行.imageset/组 45797@2x.png new file mode 100644 index 0000000..ede1400 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_金融投行.imageset/组 45797@2x.png differ diff --git a/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_金融投行.imageset/组 45797@3x.png b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_金融投行.imageset/组 45797@3x.png new file mode 100644 index 0000000..a04b6b5 Binary files /dev/null and b/ProductApp/ProductApp/Assets.xcassets/mainHome/话术升阶器/hssj_金融投行.imageset/组 45797@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/Category/UIViewController+ShouldAutorotate.h b/ProductApp/ProductApp/BaseControl/WMPlayer/Category/UIViewController+ShouldAutorotate.h new file mode 100644 index 0000000..2dfe39b --- /dev/null +++ b/ProductApp/ProductApp/BaseControl/WMPlayer/Category/UIViewController+ShouldAutorotate.h @@ -0,0 +1,25 @@ +// +// UIViewController+ShouldAutorotate.h +// PlayerDemo +// +// Created by zhengwenming on 2018/6/10. +// Copyright © 2018年 DS-Team. All rights reserved. +// + +#import + +@interface UIViewController (ShouldAutorotate) + +@end + +@interface UITabBarController (ShouldAutorotate) + +@end + +@interface UINavigationController (ShouldAutorotate) + +@end + +@interface UIAlertController (ShouldAutorotate) + +@end diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/Category/UIViewController+ShouldAutorotate.m b/ProductApp/ProductApp/BaseControl/WMPlayer/Category/UIViewController+ShouldAutorotate.m new file mode 100644 index 0000000..e4aaa60 --- /dev/null +++ b/ProductApp/ProductApp/BaseControl/WMPlayer/Category/UIViewController+ShouldAutorotate.m @@ -0,0 +1,123 @@ +// +// UIViewController+ShouldAutorotate.m +// PlayerDemo +// +// Created by zhengwenming on 2018/6/10. +// Copyright © 2018年 DS-Team. All rights reserved. +// + +#import "UIViewController+ShouldAutorotate.h" +#import +@implementation UIViewController (ShouldAutorotate) +// 是否支持自动转屏 +- (BOOL)shouldAutorotate { + return NO; +} +// 支持哪些屏幕方向 +- (UIInterfaceOrientationMask)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskPortrait; +} +// 默认的屏幕方向(当前ViewController必须是通过模态出来的UIViewController(模态带导航的无效)方式展现出来的,才会调用这个方法) +- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { + return UIInterfaceOrientationPortrait; +} +- (UIStatusBarStyle)preferredStatusBarStyle { + return UIStatusBarStyleDefault; +} +- (BOOL)prefersStatusBarHidden { + return NO; +} +@end + + +@implementation UITabBarController (ShouldAutorotate) ++ (void)load { + SEL selectors[] = { + @selector(selectedIndex) + }; + for (NSUInteger index = 0; index < sizeof(selectors) / sizeof(SEL); ++index) { + SEL originalSelector = selectors[index]; + SEL swizzledSelector = NSSelectorFromString([@"wm_" stringByAppendingString:NSStringFromSelector(originalSelector)]); + Method originalMethod = class_getInstanceMethod(self, originalSelector); + Method swizzledMethod = class_getInstanceMethod(self, swizzledSelector); + if (class_addMethod(self, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { + class_replaceMethod(self, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } + } +} + +- (NSInteger)wm_selectedIndex { + NSInteger index = [self wm_selectedIndex]; + if (index > self.viewControllers.count){ + return 0; + } + return index; +} +// 是否支持自动转屏 +- (BOOL)shouldAutorotate { + UIViewController *vc = self.viewControllers[self.selectedIndex]; + if ([vc isKindOfClass:UINavigationController.class]) { + UINavigationController *nav = (UINavigationController *)vc; + return [nav.topViewController shouldAutorotate]; + } else { + return [vc shouldAutorotate]; + } +} +// 支持哪些屏幕方向 +- (UIInterfaceOrientationMask)supportedInterfaceOrientations { + UIViewController *vc = self.viewControllers[self.selectedIndex]; + if ([vc isKindOfClass:UINavigationController.class]) { + UINavigationController *nav = (UINavigationController *)vc; + return [nav.topViewController supportedInterfaceOrientations]; + } else { + return [vc supportedInterfaceOrientations]; + } +} +// 默认的屏幕方向(当前ViewController必须是通过模态出来的UIViewController(模态带导航的无效)方式展现出来的,才会调用这个方法) +- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { + UIViewController *vc = self.viewControllers[self.selectedIndex]; + if ([vc isKindOfClass:UINavigationController.class]) { + UINavigationController *nav = (UINavigationController *)vc; + return [nav.topViewController preferredInterfaceOrientationForPresentation]; + } else { + return [vc preferredInterfaceOrientationForPresentation]; + } +} +@end + +@implementation UINavigationController (ShouldAutorotate) +// 是否支持自动转屏 +- (BOOL)shouldAutorotate { + return [self.topViewController shouldAutorotate]; +} +// 支持哪些屏幕方向 +- (UIInterfaceOrientationMask)supportedInterfaceOrientations { + return [self.topViewController supportedInterfaceOrientations]; +} +// 默认的屏幕方向(当前ViewController必须是通过模态出来的UIViewController(模态带导航的无效)方式展现出来的,才会调用这个方法) +- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { + return [self.topViewController preferredInterfaceOrientationForPresentation]; +} +- (UIViewController *)childViewControllerForStatusBarStyle { + return self.topViewController; +} +- (UIViewController *)childViewControllerForStatusBarHidden { + return self.topViewController; +} + +@end + +@implementation UIAlertController (ShouldAutorotate) +#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 +- (NSUInteger)supportedInterfaceOrientations; { + return UIInterfaceOrientationMaskAll; +} +#else +- (UIInterfaceOrientationMask)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskAll; +} +#endif +@end + diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/FastForwardView.h b/ProductApp/ProductApp/BaseControl/WMPlayer/FastForwardView.h new file mode 100644 index 0000000..ca9809b --- /dev/null +++ b/ProductApp/ProductApp/BaseControl/WMPlayer/FastForwardView.h @@ -0,0 +1,14 @@ +// +// FastForwardView.h +// WMPlayer +// +// Created by 郑文明 on 16/10/26. +// Copyright © 2016年 郑文明. All rights reserved. +// + +#import + +@interface FastForwardView : UIView +@property (strong, nonatomic) UIImageView *stateImageView; +@property (strong, nonatomic) UILabel *timeLabel; +@end diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/FastForwardView.m b/ProductApp/ProductApp/BaseControl/WMPlayer/FastForwardView.m new file mode 100644 index 0000000..8b2611e --- /dev/null +++ b/ProductApp/ProductApp/BaseControl/WMPlayer/FastForwardView.m @@ -0,0 +1,40 @@ +// +// FastForwardView.m +// WMPlayer +// +// Created by 郑文明 on 16/10/26. +// Copyright © 2016年 郑文明. All rights reserved. +// + +#import "FastForwardView.h" +#import "Masonry.h" + +@implementation FastForwardView +- (instancetype)init{ + self = [super init]; + if (self) { + self.backgroundColor = [UIColor colorWithRed:0/256.0f green:0/256.0f blue:0/256.0f alpha:0.8]; + self.layer.cornerRadius = 4; + self.layer.masksToBounds = YES; + + self.stateImageView = [UIImageView new]; + self.stateImageView.image = [UIImage imageNamed:@"progress_icon_r"]; + [self addSubview:self.stateImageView]; + [self.stateImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self).offset(10); + make.centerX.mas_equalTo(self); + }]; + + self.timeLabel = [UILabel new]; + self.timeLabel.font = [UIFont systemFontOfSize:15.f]; + self.timeLabel.textAlignment = NSTextAlignmentCenter; + self.timeLabel.textColor = [UIColor whiteColor]; + [self addSubview:self.timeLabel]; + [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(self).offset(-10); + make.centerX.mas_equalTo(self); + }]; + } + return self; +} +@end diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMLightView.h b/ProductApp/ProductApp/BaseControl/WMPlayer/WMLightView.h new file mode 100644 index 0000000..c9cb2f2 --- /dev/null +++ b/ProductApp/ProductApp/BaseControl/WMPlayer/WMLightView.h @@ -0,0 +1,18 @@ +// +// WMLightView.h +// WMPlayer +// +// Created by 郑文明 on 16/10/26. +// Copyright © 2016年 郑文明. All rights reserved. +// + +#import + +@interface WMLightView : UIView +@property (strong, nonatomic) UIView *lightBackView; +@property (strong, nonatomic) UIImageView *centerLightIV; + +@property (nonatomic, strong) NSMutableArray * lightViewArr; + ++ (instancetype)sharedLightView; +@end diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMLightView.m b/ProductApp/ProductApp/BaseControl/WMPlayer/WMLightView.m new file mode 100644 index 0000000..1999422 --- /dev/null +++ b/ProductApp/ProductApp/BaseControl/WMPlayer/WMLightView.m @@ -0,0 +1,143 @@ +// +// WMLightView.m +// WMPlayer +// +// Created by 郑文明 on 16/10/26. +// Copyright © 2016年 郑文明. All rights reserved. +// + +#import "WMLightView.h" +#import "WMPlayer.h" +#define LIGHT_VIEW_COUNT 16 + +@interface WMLightView () +@property (nonatomic, strong) NSTimer *timer; + +@end + +@implementation WMLightView ++ (instancetype)sharedLightView{ + WMLightView *lightView = [[WMLightView alloc] init]; + lightView.backgroundColor = [UIColor whiteColor]; + return lightView; +} +- (instancetype)init +{ + self = [super init]; + if (self) { + self.frame = CGRectMake(([UIScreen mainScreen].bounds.size.width) * 0.5, ([UIScreen mainScreen].bounds.size.height) * 0.5, 155, 155); + self.layer.cornerRadius = 10; + + { + UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 5, self.bounds.size.width, 30)]; + titleLabel.font = [UIFont boldSystemFontOfSize:16.0]; + titleLabel.textColor = [UIColor colorWithRed:0.25f green:0.22f blue:0.21f alpha:1.00f]; + titleLabel.textAlignment = NSTextAlignmentCenter; + titleLabel.text = @"亮度"; + [self addSubview:titleLabel]; + } + + + { + self.centerLightIV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 79, 76)]; + self.centerLightIV.image = [UIImage imageNamed:[@"WMPlayer.bundle" stringByAppendingPathComponent:@"play_new_brightness_day"]]; + self.centerLightIV.center = CGPointMake(155 * 0.5, 155 * 0.5); + [self addSubview:self.centerLightIV]; + } + + + + { + self.lightBackView = [[UIView alloc]initWithFrame:CGRectMake(13, 132, self.bounds.size.width - 26, 7)]; + self.lightBackView .backgroundColor = [UIColor colorWithRed:65.0/255.0 green:67.0/255.0 blue:70.0/255.0 alpha:1.0]; + [self addSubview:self.lightBackView ]; + } + + + self.lightViewArr = [NSMutableArray arrayWithCapacity:16]; + CGFloat wiew_width = (self.lightBackView.bounds.size.width - 17) / 16; + CGFloat wiew_Height = 5; + CGFloat wiew_Y = 1; + for (int i = 0; i < LIGHT_VIEW_COUNT; i++) { + CGFloat wiew_X = i * (wiew_width + 1) + 1; + UIView * view = [[UIView alloc] initWithFrame:CGRectMake(wiew_X, wiew_Y, wiew_width, wiew_Height)]; + view.backgroundColor = [UIColor whiteColor]; + [self.lightViewArr addObject:view]; + [self.lightBackView addSubview:view]; + } + + [self updateLongView:[UIScreen mainScreen].brightness]; + + + //通知 + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(onOrientationDidChange:) + name:UIDeviceOrientationDidChangeNotification + object:nil]; + + //KVO + [[UIScreen mainScreen] addObserver:self + forKeyPath:@"brightness" + options:NSKeyValueObservingOptionNew context:NULL]; + self.alpha = 0.0; + } + return self; +} +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(id)object + change:(NSDictionary *)change + context:(void *)context { + + CGFloat sound = [change[@"new"] floatValue]; + if (self.alpha == 0.0) { + self.alpha = 1.0; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self hideLightView]; + }); + } + + [self updateLongView:sound]; +} + +- (void)onOrientationDidChange:(NSNotification *)notify { + self.alpha = 0.0; +} +- (void)hideLightView{ + if (self.alpha == 1.0) { + [UIView animateWithDuration:0.8 animations:^{ + self.alpha = 0.0; + } completion:^(BOOL finished) { + + }]; + } +} +#pragma mark - Update View +- (void)updateLongView:(CGFloat)sound { + CGFloat stage = 1 / 15.0; + NSInteger level = sound / stage; + + for (int i = 0; i < self.lightViewArr.count; i++) { + UIView *aView = self.lightViewArr[i]; + if (i <= level) { + aView.hidden = NO; + } else { + aView.hidden = YES; + } + } + [self setNeedsLayout]; + +} +- (void)layoutSubviews { + [super layoutSubviews]; + self.transform = [WMPlayer getCurrentDeviceOrientation]; + self.transform = CGAffineTransformIdentity; + self.center = [UIApplication sharedApplication].keyWindow.center; +} +- (void)dealloc { + self.lightViewArr = nil; + self.lightBackView = nil; + NSLog(@"WMLightView dealloc"); + [[UIScreen mainScreen] removeObserver:self forKeyPath:@"brightness"]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} +@end diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/bottom_shadow.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/bottom_shadow.png new file mode 100644 index 0000000..e67cb36 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/bottom_shadow.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/close@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/close@2x.png new file mode 100644 index 0000000..a8171f9 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/close@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/close@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/close@3x.png new file mode 100644 index 0000000..27e02d5 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/close@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/dot@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/dot@2x.png new file mode 100644 index 0000000..6cfb5e7 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/dot@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/dot@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/dot@3x.png new file mode 100644 index 0000000..7c57a53 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/dot@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/fullscreen@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/fullscreen@2x.png new file mode 100644 index 0000000..769afae Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/fullscreen@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/fullscreen@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/fullscreen@3x.png new file mode 100644 index 0000000..c68b2ce Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/fullscreen@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/nonfullscreen@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/nonfullscreen@2x.png new file mode 100644 index 0000000..45274a4 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/nonfullscreen@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/nonfullscreen@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/nonfullscreen@3x.png new file mode 100644 index 0000000..e83f58c Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/nonfullscreen@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_day.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_day.png new file mode 100644 index 0000000..6022ff7 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_day.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_day@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_day@2x.png new file mode 100644 index 0000000..245d1cc Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_day@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_night.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_night.png new file mode 100644 index 0000000..8dab846 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_night.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_night@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_night@2x.png new file mode 100644 index 0000000..6e27950 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/play_new_brightness_night@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_next@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_next@2x.png new file mode 100644 index 0000000..b1154ad Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_next@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_next@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_next@3x.png new file mode 100644 index 0000000..1342995 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_next@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_pause@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_pause@2x.png new file mode 100644 index 0000000..76bc03c Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_pause@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_pause@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_pause@3x.png new file mode 100644 index 0000000..6a77281 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_pause@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_play@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_play@2x.png new file mode 100644 index 0000000..f4fcb76 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_play@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_play@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_play@3x.png new file mode 100644 index 0000000..ee25603 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_ctrl_icon_play@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_download@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_download@2x.png new file mode 100644 index 0000000..056aa92 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_download@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_download@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_download@3x.png new file mode 100644 index 0000000..6343b12 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_download@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_fullscreen@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_fullscreen@2x.png new file mode 100644 index 0000000..57334f9 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_fullscreen@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_fullscreen@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_fullscreen@3x.png new file mode 100644 index 0000000..e1c4c2c Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_fullscreen@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_lock@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_lock@2x.png new file mode 100644 index 0000000..a7878d7 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_lock@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_lock@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_lock@3x.png new file mode 100644 index 0000000..943b6d7 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_lock@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_nav_back@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_nav_back@2x.png new file mode 100644 index 0000000..d1cbe10 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_nav_back@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_nav_back@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_nav_back@3x.png new file mode 100644 index 0000000..6c42618 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_nav_back@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_unlock@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_unlock@2x.png new file mode 100644 index 0000000..6c5ae2f Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_unlock@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_unlock@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_unlock@3x.png new file mode 100644 index 0000000..c0c1643 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_icon_unlock@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_pause@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_pause@2x.png new file mode 100644 index 0000000..96bbe41 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_pause@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_pause@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_pause@3x.png new file mode 100644 index 0000000..6e22811 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/player_pause@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_l@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_l@2x.png new file mode 100644 index 0000000..a2f7d33 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_l@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_l@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_l@3x.png new file mode 100644 index 0000000..1f4e89b Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_l@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_r@2x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_r@2x.png new file mode 100644 index 0000000..d6d5dd5 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_r@2x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_r@3x.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_r@3x.png new file mode 100644 index 0000000..0f313be Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/progress_icon_r@3x.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/top_shadow.png b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/top_shadow.png new file mode 100644 index 0000000..1a3cfd2 Binary files /dev/null and b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.bundle/top_shadow.png differ diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.h b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.h new file mode 100644 index 0000000..3882cb4 --- /dev/null +++ b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.h @@ -0,0 +1,185 @@ +/*! + @header WMPlayer.h + + @abstract 作者Github地址:https://github.com/zhengwenming + 作者CSDN博客地址:http://blog.csdn.net/wenmingzheng + + @author Created by zhengwenming on 16/1/24 + + @version 1.00 16/1/24 Creation(版本信息) + + Copyright © 2016年 郑文明. All rights reserved. + */ + +#import +#import +#import +#import "WMPlayerModel.h" +#import "FastForwardView.h" +#import "WMLightView.h" + +//****************************枚举******************************* +// 播放器的几种状态 +typedef NS_ENUM(NSInteger, WMPlayerState) { + WMPlayerStateFailed, // 播放失败 + WMPlayerStateBuffering, // 缓冲中 + WMPlayerStatePlaying, // 播放中 + WMPlayerStateStopped, //暂停播放 + WMPlayerStateFinished, //完成播放 + WMPlayerStatePause, // 打断播放 +}; +// playerLayer的填充模式(默认:等比例填充,直到一个维度到达区域边界) +typedef NS_ENUM(NSInteger, WMPlayerLayerGravity) { + WMPlayerLayerGravityResize, // 非均匀模式。两个维度完全填充至整个视图区域 + WMPlayerLayerGravityResizeAspect, // 等比例填充,直到一个维度到达区域边界 + WMPlayerLayerGravityResizeAspectFill // 等比例填充,直到填充满整个视图区域,其中一个维度的部分区域会被裁剪 +}; +// 枚举值,包含播放器左上角的返回按钮的类型 +typedef NS_ENUM(NSInteger, BackBtnStyle){ + BackBtnStyleClose,//关闭(X) + BackBtnStylePop //pop箭头<- +}; + +//手势操作的类型 +typedef NS_ENUM(NSUInteger,WMControlType) { + WMControlTypeDefault,//无任何操作 + WMControlTypeProgress,//视频进度调节操作 + WMControlTypeVoice,//声音调节操作 + WMControlTypeLight//屏幕亮度调节操作 +} ; + + + +@class WMPlayer; +@protocol WMPlayerDelegate +@optional +//点击播放暂停按钮代理方法 +-(void)wmplayer:(WMPlayer *)wmplayer clickedPlayOrPauseButton:(UIButton *)playOrPauseBtn; +//点击关闭按钮代理方法 +-(void)wmplayer:(WMPlayer *)wmplayer clickedCloseButton:(UIButton *)backBtn; +//点击全屏按钮代理方法 +-(void)wmplayer:(WMPlayer *)wmplayer clickedFullScreenButton:(UIButton *)fullScreenBtn; +//点击锁定🔒按钮的方法 +-(void)wmplayer:(WMPlayer *)wmplayer clickedLockButton:(UIButton *)lockBtn; +//单击WMPlayer的代理方法 +-(void)wmplayer:(WMPlayer *)wmplayer singleTaped:(UITapGestureRecognizer *)singleTap; +//双击WMPlayer的代理方法 +-(void)wmplayer:(WMPlayer *)wmplayer doubleTaped:(UITapGestureRecognizer *)doubleTap; +//WMPlayer的的操作栏隐藏和显示 +-(void)wmplayer:(WMPlayer *)wmplayer isHiddenTopAndBottomView:(BOOL )isHidden; +//播放失败的代理方法 +-(void)wmplayerFailedPlay:(WMPlayer *)wmplayer WMPlayerStatus:(WMPlayerState)state; +//准备播放的代理方法 +-(void)wmplayerReadyToPlay:(WMPlayer *)wmplayer WMPlayerStatus:(WMPlayerState)state; +//播放完毕的代理方法 +-(void)wmplayerFinishedPlay:(WMPlayer *)wmplayer; + +///长按 +-(void)wmplayerlongPress:(WMPlayer *)wmplayer; +@end + + +@interface WMPlayer : UIView + +/** + 自定义属性 + */ +@property (nonatomic, copy) NSString *type; +/** + 播放器对应的model + */ +@property (nonatomic,strong) WMPlayerModel *playerModel; +/** + 返回按钮的样式 + */ +@property (nonatomic, assign) BackBtnStyle backBtnStyle; +/** + BOOL值判断当前的状态,开发者要自己维护次BOOL值 + */ +@property (nonatomic,assign) BOOL isFullscreen; +/** + 播放速率(倍速播放,支持0.5、1.0、1.25、1.5、2.0) + */ +@property (nonatomic,assign) CGFloat rate; + + +@property (nonatomic,assign,readonly) BOOL prefersStatusBarHidden; +/** + 播放器的代理 + */ +@property (nonatomic, weak)id delegate; +/** + 是否开启音量手势 + */ +@property (nonatomic,assign) BOOL enableVolumeGesture; +/** + 是否开启后台播放模式 + */ +@property (nonatomic,assign) BOOL enableBackgroundMode; +/** + 是否开启快进手势 + */ +@property (nonatomic,assign) BOOL enableFastForwardGesture; +/** + 是否静音 + */ +@property (nonatomic,assign) BOOL muted; +/** + 设置playerLayer的填充模式 + */ +@property (nonatomic, assign) WMPlayerLayerGravity playerLayerGravity; +//是否是锁定屏幕旋转状态 +@property (nonatomic,assign,readonly) BOOL isLockScreen; + + +/** + 自定义实例化方法初始化方式(-方法) + + @param playerModel 播放model + @return 播放器实例 + */ +-(instancetype)initPlayerModel:(WMPlayerModel *)playerModel; + +/** + 自定义类方法+初始化方式(+方法) + + @param playerModel 播放model + @return 播放器实例 + */ ++(instancetype)playerWithModel:(WMPlayerModel *)playerModel; + +/** + 播放 + */ +- (void)play; + +/** + 暂停 + */ +- (void)pause; + +/** + 获取正在播放的时间点 + + @return double的一个时间点 + */ +- (double)currentTime; + +/** + 重置播放器,然后切换下一个播放资源 + */ +- (void )resetWMPlayer; + +/** + 版本号 + + @return 当前版本号 + */ ++(NSString *)version; +//获取当前的旋转状态 ++(CGAffineTransform)getCurrentDeviceOrientation; ++(BOOL)IsiPhoneX; +///底部是否显示 +-(void)bottomViewShow:(BOOL)isshow; +@end + diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.m b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.m new file mode 100644 index 0000000..7dc19a4 --- /dev/null +++ b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayer.m @@ -0,0 +1,1545 @@ +/*! + @header WMPlayer.m + + @abstract 作者Github地址:https://github.com/zhengwenming + 作者CSDN博客地址:http://blog.csdn.net/wenmingzheng + + @author Created by zhengwenming on 16/1/24 + + @version 2.0.0 16/1/24 Creation(版本信息) + + Copyright © 2016年 郑文明. All rights reserved. + */ + + +#import "sys/utsname.h" +#import "WMPlayer.h" +#import "Masonry.h" +#import "UIImageView+VideoImageView.h" +#import "AppDelegate.h" + +//****************************宏********************************* +#define WMPlayerSrcName(file) [@"WMPlayer.bundle" stringByAppendingPathComponent:file] +#define WMPlayerFrameworkSrcName(file) [@"Frameworks/WMPlayer.framework/WMPlayer.bundle" stringByAppendingPathComponent:file] +#define WMPlayerImage(file) [UIImage imageNamed:WMPlayerSrcName(file)] ? :[UIImage imageNamed:WMPlayerFrameworkSrcName(file)] + + + +//整个屏幕代表的时间 +#define TotalScreenTime 90 +#define LeastDistance 15 + +static void *PlayViewCMTimeValue = &PlayViewCMTimeValue; +static void *PlayViewStatusObservationContext = &PlayViewStatusObservationContext; + +@interface WMPlayer () +//顶部&底部操作工具栏 +@property (nonatomic,retain) UIImageView *topView,*bottomView; +//是否初始化了播放器 +@property (nonatomic,assign) BOOL isInitPlayer; +//用来判断手势是否移动过 +@property (nonatomic,assign) BOOL hasMoved; +//总时间 +@property (nonatomic,assign)CGFloat totalTime; +//记录触摸开始时的视频播放的时间 +@property (nonatomic,assign)CGFloat touchBeginValue; +//记录触摸开始亮度 +@property (nonatomic,assign)CGFloat touchBeginLightValue; +//记录触摸开始的音量 +@property (nonatomic,assign) CGFloat touchBeginVoiceValue; +//记录touch开始的点 +@property (nonatomic,assign) CGPoint touchBeginPoint; +//手势控制的类型,用来判断当前手势是在控制进度?声音?亮度? +@property (nonatomic,assign) WMControlType controlType; +//格式化时间(懒加载防止多次重复初始化) +@property (nonatomic,strong) NSDateFormatter *dateFormatter; +//监听播放起状态的监听者 +@property (nonatomic,strong) id playbackTimeObserver; +//视频进度条的单击手势&播放器的单击手势 +@property (nonatomic,strong) UITapGestureRecognizer *progressTap,*singleTap; +//是否正在拖曳进度条 +@property (nonatomic,assign) BOOL isDragingSlider; +//BOOL值判断操作栏是否隐藏 +@property (nonatomic,assign) BOOL isHiddenTopAndBottomView; +//BOOL值判断操作栏是否隐藏 +@property (nonatomic,assign) BOOL hiddenStatusBar; +//是否被系统暂停 +@property (nonatomic,assign) BOOL isPauseBySystem; +//播放器状态 +@property (nonatomic,assign) WMPlayerState state; +//wmPlayer内部一个UIView,所有的控件统一管理在此view中 +@property (nonatomic,strong) UIView *contentView; +//这个用来显示滑动屏幕时的时间 +@property (nonatomic,strong) FastForwardView * FF_View; +//显示播放时间的UILabel+加载失败的UILabel+播放视频的title +@property (nonatomic,strong) UILabel *leftTimeLabel,*rightTimeLabel,*titleLabel,*loadFailedLabel; +//控制全屏和播放暂停按钮 +@property (nonatomic,strong) UIButton *fullScreenBtn,*playOrPauseBtn,*lockBtn,*backBtn,*rateBtn; +//进度滑块&声音滑块 +@property (nonatomic,strong) UISlider *progressSlider,*volumeSlider; +//显示缓冲进度和底部的播放进度 +@property (nonatomic,strong) UIProgressView *loadingProgress,*bottomProgress; +//菊花(加载框) +@property (nonatomic,strong) UIActivityIndicatorView *loadingView; +//当前播放的item +@property (nonatomic,retain) AVPlayerItem *currentItem; +//playerLayer,可以修改frame +@property (nonatomic,retain) AVPlayerLayer *playerLayer; +//播放器player +@property (nonatomic,retain) AVPlayer *player; +//播放资源路径URL +@property (nonatomic,strong) NSURL *videoURL; +//播放资源 +@property (nonatomic,strong) AVURLAsset *urlAsset; +//跳到time处播放 +@property (nonatomic,assign) double seekTime; +//视频填充模式 +@property (nonatomic, copy) NSString *videoGravity; + +///中间的暂停图片 +@property (nonatomic , strong) UIImageView *imgvCenter ; + +///视频第一帧 +@property (nonatomic , strong) UIImageView *imgvFirst; + +@end + + +@implementation WMPlayer +- (instancetype)initWithCoder:(NSCoder *)coder{ + self = [super initWithCoder:coder]; + if (self) { + [self initWMPlayer]; + } + return self; +} +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if (self) { + [self initWMPlayer]; + } + return self; +} +-(instancetype)initPlayerModel:(WMPlayerModel *)playerModel{ + self = [super init]; + if (self) { + self.playerModel = playerModel; + if(playerModel.videoURL) + { + [self.imgvFirst videoImageWithvideoURL:playerModel.videoURL atTime:0.1]; + } + } + return self; +} ++(instancetype)playerWithModel:(WMPlayerModel *)playerModel{ + WMPlayer *player = [[WMPlayer alloc] initPlayerModel:playerModel]; + return player; +} +- (NSDateFormatter *)dateFormatter { + if (!_dateFormatter) { + _dateFormatter = [[NSDateFormatter alloc] init]; + _dateFormatter.timeZone = [NSTimeZone timeZoneWithName:@"GMT"]; + } + return _dateFormatter; +} +- (NSString *)videoGravity { + if (!_videoGravity) { + _videoGravity = AVLayerVideoGravityResizeAspect; + } + return _videoGravity; +} +-(UIImageView *)imgvFirst +{ + if(!_imgvFirst) + { + _imgvFirst = [[UIImageView alloc] init]; + [_imgvFirst setContentMode:UIViewContentModeScaleAspectFit]; + } + return _imgvFirst; +} +///自定义属性 +- (void)setType:(NSString *)type { + _type = type; + if ([_type isEqualToString:@"1"]) { + [self.playOrPauseBtn setImage:WMPlayerImage(@"") forState:UIControlStateNormal]; + [self.playOrPauseBtn setImage:WMPlayerImage(@"") forState:UIControlStateSelected]; + self.playOrPauseBtn.userInteractionEnabled = NO; + }else { + [self.playOrPauseBtn setImage:WMPlayerImage(@"player_ctrl_icon_pause") forState:UIControlStateNormal]; + [self.playOrPauseBtn setImage:WMPlayerImage(@"player_ctrl_icon_play") forState:UIControlStateSelected]; + self.playOrPauseBtn.userInteractionEnabled = YES; + } + + if ([_type isEqualToString:@"1"]) { + [self.backBtn setImage:WMPlayerImage(@"") forState:UIControlStateNormal]; + [self.backBtn setImage:WMPlayerImage(@"") forState:UIControlStateSelected]; + self.backBtn.hidden = YES; + }else { + [self.backBtn setImage:WMPlayerImage(@"close.png") forState:UIControlStateNormal]; + [self.backBtn setImage:WMPlayerImage(@"close.png") forState:UIControlStateSelected]; + self.backBtn.hidden = NO; + } + if ([_type isEqualToString:@"1"]) { + [self.fullScreenBtn setImage:WMPlayerImage(@"") forState:UIControlStateNormal]; + [self.fullScreenBtn setImage:WMPlayerImage(@"") forState:UIControlStateSelected]; + self.fullScreenBtn.userInteractionEnabled = NO; + }else { + [self.fullScreenBtn setImage:WMPlayerImage(@"player_icon_fullscreen") forState:UIControlStateNormal]; + [self.fullScreenBtn setImage:WMPlayerImage(@"player_icon_fullscreen") forState:UIControlStateSelected]; + self.fullScreenBtn.userInteractionEnabled = YES; + } +} +-(void)initWMPlayer{ + NSError *setCategoryErr = nil; + NSError *activationErr = nil; + [[AVAudioSession sharedInstance] + setCategory: AVAudioSessionCategoryPlayback + error: &setCategoryErr]; + [[AVAudioSession sharedInstance] + setActive: YES + error: &activationErr]; + //wmplayer内部的一个view,用来管理子视图 + self.contentView = [UIView new]; + self.contentView.backgroundColor = [UIColor blackColor]; + [self addSubview:self.contentView]; + self.backgroundColor = [UIColor blackColor]; + + + [self.contentView addSubview:self.imgvFirst]; + [self.imgvFirst mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.contentView); + }]; + + //创建fastForwardView,快进⏩和快退的view + self.FF_View = [[FastForwardView alloc] init]; + self.FF_View.hidden = YES; + [self.contentView addSubview:self.FF_View]; + + [[UIApplication sharedApplication].keyWindow addSubview:[WMLightView sharedLightView]]; + //设置默认值 + self.enableVolumeGesture = YES; + self.enableFastForwardGesture = YES; + + //小菊花 + self.loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; + [self.contentView addSubview:self.loadingView]; + [self.loadingView startAnimating]; + + //topView + self.topView = [[UIImageView alloc]initWithImage:WMPlayerImage(@"top_shadow")]; + self.topView.userInteractionEnabled = YES; + [self.contentView addSubview:self.topView]; + + //bottomView + self.bottomView = [[UIImageView alloc]initWithImage:WMPlayerImage(@"bottom_shadow")]; + self.bottomView.userInteractionEnabled = YES; + [self.contentView addSubview:self.bottomView]; + + //playOrPauseBtn + self.playOrPauseBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + self.playOrPauseBtn.showsTouchWhenHighlighted = YES; + [self.playOrPauseBtn addTarget:self action:@selector(PlayOrPause:) forControlEvents:UIControlEventTouchUpInside]; + + [self.bottomView addSubview:self.playOrPauseBtn]; + if ([_type isEqualToString:@"1"]) { + [self.playOrPauseBtn setImage:WMPlayerImage(@"") forState:UIControlStateNormal]; + [self.playOrPauseBtn setImage:WMPlayerImage(@"") forState:UIControlStateSelected]; + self.playOrPauseBtn.userInteractionEnabled = NO; + }else { + [self.playOrPauseBtn setImage:WMPlayerImage(@"player_ctrl_icon_pause") forState:UIControlStateNormal]; + [self.playOrPauseBtn setImage:WMPlayerImage(@"player_ctrl_icon_play") forState:UIControlStateSelected]; + self.playOrPauseBtn.userInteractionEnabled = YES; + } + self.playOrPauseBtn.selected = YES;//默认状态,即默认是不自动播放 + + MPVolumeView *volumeView = [[MPVolumeView alloc]init]; + for (UIControl *view in volumeView.subviews) { + if ([view.superclass isSubclassOfClass:[UISlider class]]) { + self.volumeSlider = (UISlider *)view; + } + } + + self.loadingProgress = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault]; + self.loadingProgress.progressTintColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.5]; + self.loadingProgress.trackTintColor = [UIColor clearColor]; + [self.bottomView addSubview:self.loadingProgress]; + [self.loadingProgress setProgress:0.0 animated:NO]; + [self.bottomView sendSubviewToBack:self.loadingProgress]; + + //slider + self.progressSlider = [UISlider new]; + self.progressSlider.minimumValue = 0.0; + self.progressSlider.maximumValue = 1.0; + [self.progressSlider setThumbImage:WMPlayerImage(@"dot") forState:UIControlStateNormal]; + self.progressSlider.minimumTrackTintColor = [UIColor greenColor]; + self.progressSlider.maximumTrackTintColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.5]; + self.progressSlider.backgroundColor = [UIColor clearColor]; + self.progressSlider.value = 0.0;//指定初始值 + //进度条的拖拽事件 + [self.progressSlider addTarget:self action:@selector(stratDragSlide:) forControlEvents:UIControlEventValueChanged]; + //进度条的点击事件 + [self.progressSlider addTarget:self action:@selector(updateProgress:) forControlEvents:UIControlEventTouchUpInside]; + //给进度条添加单击手势 + self.progressTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(actionTapGesture:)]; + self.progressTap.delegate = self; + [self.progressSlider addGestureRecognizer:self.progressTap]; + [self.bottomView addSubview:self.progressSlider]; + + self.bottomProgress = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault]; + self.bottomProgress.trackTintColor = [UIColor clearColor]; + self.bottomProgress.progressTintColor = [UIColor greenColor]; + self.bottomProgress.alpha = 0; + [self.contentView addSubview:self.bottomProgress]; + + //fullScreenBtn + self.fullScreenBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + self.fullScreenBtn.showsTouchWhenHighlighted = YES; + [self.fullScreenBtn addTarget:self action:@selector(fullScreenAction:) forControlEvents:UIControlEventTouchUpInside]; + [self.bottomView addSubview:self.fullScreenBtn]; + if ([_type isEqualToString:@"1"]) { + [self.fullScreenBtn setImage:WMPlayerImage(@"") forState:UIControlStateNormal]; + [self.fullScreenBtn setImage:WMPlayerImage(@"") forState:UIControlStateSelected]; + self.fullScreenBtn.userInteractionEnabled = NO; + }else { + [self.fullScreenBtn setImage:WMPlayerImage(@"player_icon_fullscreen") forState:UIControlStateNormal]; + [self.fullScreenBtn setImage:WMPlayerImage(@"player_icon_fullscreen") forState:UIControlStateSelected]; + self.fullScreenBtn.userInteractionEnabled = YES; + } + + //lockBtn + self.lockBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + self.lockBtn.showsTouchWhenHighlighted = YES; + [self.lockBtn addTarget:self action:@selector(lockAction:) forControlEvents:UIControlEventTouchUpInside]; + [self.lockBtn setImage:WMPlayerImage(@"player_icon_unlock") forState:UIControlStateNormal]; + [self.lockBtn setImage:WMPlayerImage(@"player_icon_lock") forState:UIControlStateSelected]; + self.lockBtn.hidden = YES; + [self.contentView addSubview:self.lockBtn]; + + //leftTimeLabel显示左边的时间进度 + self.leftTimeLabel = [UILabel new]; + self.leftTimeLabel.textAlignment = NSTextAlignmentRight; + self.leftTimeLabel.textColor = [UIColor whiteColor]; + self.leftTimeLabel.font = [UIFont systemFontOfSize:11]; + [self.bottomView addSubview:self.leftTimeLabel]; + self.leftTimeLabel.text = [self convertTime:0.0];//设置默认值 + + //rightTimeLabel显示右边的总时间 + self.rightTimeLabel = [UILabel new]; + self.rightTimeLabel.textAlignment = NSTextAlignmentLeft; + self.rightTimeLabel.textColor = [UIColor whiteColor]; + self.rightTimeLabel.font = [UIFont systemFontOfSize:11]; + [self.bottomView addSubview:self.rightTimeLabel]; + self.rightTimeLabel.text = [self convertTime:0.0];//设置默认值 + + //backBtn + self.backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + self.backBtn.showsTouchWhenHighlighted = YES; + + [self.backBtn addTarget:self action:@selector(colseTheVideo:) forControlEvents:UIControlEventTouchUpInside]; + [self.topView addSubview:self.backBtn]; + if ([_type isEqualToString:@"1"]) { + [self.backBtn setImage:WMPlayerImage(@"") forState:UIControlStateNormal]; + [self.backBtn setImage:WMPlayerImage(@"") forState:UIControlStateSelected]; + self.backBtn.hidden = YES; + }else { + [self.backBtn setImage:WMPlayerImage(@"close.png") forState:UIControlStateNormal]; + [self.backBtn setImage:WMPlayerImage(@"close.png") forState:UIControlStateSelected]; + self.backBtn.hidden = NO; + } + //rateBtn + self.rateBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + [self.rateBtn addTarget:self action:@selector(switchRate:) forControlEvents:UIControlEventTouchUpInside]; + [self.rateBtn setTitle:@"1.0X" forState:UIControlStateNormal]; + [self.rateBtn setTitle:@"1.0X" forState:UIControlStateSelected]; + [self.topView addSubview:self.rateBtn]; + self.rateBtn.hidden = YES; + + //titleLabel + self.titleLabel = [UILabel new]; + self.titleLabel.textColor = [UIColor whiteColor]; + self.titleLabel.numberOfLines = 1; + self.titleLabel.font = [UIFont systemFontOfSize:15.0]; + [self.topView addSubview:self.titleLabel]; + + //加载失败的提示label + self.loadFailedLabel = [UILabel new]; + self.loadFailedLabel.textColor = [UIColor lightGrayColor]; + self.loadFailedLabel.textAlignment = NSTextAlignmentCenter; + self.loadFailedLabel.text = @"视频加载失败"; + self.loadFailedLabel.hidden = YES; + [self.contentView addSubview:self.loadFailedLabel]; + +// [self addSubview:self.imgvFirst]; +// [self.imgvFirst mas_makeConstraints:^(MASConstraintMaker *make) { +// make.edges.equalTo(self); +// }]; + + UIImageView *imgvCenter = [[UIImageView alloc] init]; + [imgvCenter setImage:WMPlayerImage(@"player_pause.png")]; + [self addSubview:imgvCenter]; + [imgvCenter mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.equalTo(self); + make.width.height.offset(50); + }]; + [imgvCenter setHidden:YES]; + _imgvCenter = imgvCenter; + [imgvCenter setUserInteractionEnabled:YES]; + UIButton *btcenter = [[UIButton alloc] init]; + [imgvCenter addSubview:btcenter]; + [btcenter mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(imgvCenter); + }]; + [btcenter addTarget:self action:@selector(startCenterAction) forControlEvents:UIControlEventTouchUpInside]; + + //添加子控件的默认约束 + [self addUIControlConstraints]; + + // 单击的 Recognizer + self.singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; + self.singleTap.numberOfTapsRequired = 1; // 单击 + self.singleTap.numberOfTouchesRequired = 1; + self.singleTap.delegate = self; + [self.contentView addGestureRecognizer:self.singleTap]; + + ///长按 + UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressTap:)]; +// longPress.minimumPressDuration = 1.0; + longPress.delegate = self; + [self.contentView addGestureRecognizer:longPress]; + +// // 双击的 Recognizer +// UITapGestureRecognizer* doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)]; +// doubleTap.numberOfTouchesRequired = 1; //手指数 +// doubleTap.numberOfTapsRequired = 2; // 双击 +// doubleTap.delegate = self; +// // 解决点击当前view时候响应其他控件事件 +// [self.singleTap setDelaysTouchesBegan:YES]; +// [doubleTap setDelaysTouchesBegan:YES]; +// [self.singleTap requireGestureRecognizerToFail:doubleTap];//如果双击成立,则取消单击手势(双击的时候不会走单击事件) +// [self.contentView addGestureRecognizer:doubleTap]; + +} +#pragma mark - Gesture Delegate +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { + if ([touch.view isKindOfClass:[UIControl class]]) { + return NO; + } + return YES; +} +//添加控件的约束 +-(void)addUIControlConstraints{ + [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(UIEdgeInsetsMake(0, 0, 0, 0)); + }]; + [self.FF_View mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.equalTo(self.contentView); + make.size.mas_equalTo(CGSizeMake(120, 70)); + }]; + [self.loadingView mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.equalTo(self.contentView); + }]; + [self.topView mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.top.equalTo(self.contentView); + make.height.mas_equalTo([WMPlayer IsiPhoneX]?90:70); + }]; + [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.bottom.equalTo(self.contentView); + make.height.mas_equalTo(50); + }]; + [self.lockBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.equalTo(self.contentView).offset(15); + make.centerY.mas_equalTo(self.contentView); + }]; + [self.playOrPauseBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.equalTo(self.bottomView); + make.leading.equalTo(self.bottomView).offset(10); + }]; + [self.leftTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) { +// make.leading.equalTo(self.bottomView).offset(50); + make.left.equalTo(self.playOrPauseBtn.mas_right).offset(10); + make.width.offset(40); + make.centerY.equalTo(self.bottomView); + }]; + [self.rightTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) { +// make.trailing.equalTo(self.bottomView).offset(-50); +// make.top.equalTo(self.bottomView.mas_centerY).with.offset(8); + + make.width.offset(40); + make.centerY.equalTo(self.bottomView); + make.right.equalTo(self.bottomView).offset(-35); + + }]; + [self.loadingProgress mas_makeConstraints:^(MASConstraintMaker *make) { +// make.leading.equalTo(self.leftTimeLabel.mas_leading).offset(4); +// make.trailing.equalTo(self.rightTimeLabel.mas_trailing).offset(-4); + make.centerY.equalTo(self.bottomView); + make.left.equalTo(self.leftTimeLabel.mas_right).offset(10); + make.right.equalTo(self.rightTimeLabel.mas_left).offset(-10); + }]; + [self.progressSlider mas_makeConstraints:^(MASConstraintMaker *make) { +// make.leading.equalTo(self.leftTimeLabel.mas_leading).offset(4); +// make.trailing.equalTo(self.rightTimeLabel.mas_trailing).offset(-4); +// make.centerY.equalTo(self.bottomView).offset(-1); +// make.height.mas_equalTo(30); + make.centerY.equalTo(self.bottomView); + make.left.equalTo(self.leftTimeLabel.mas_right).offset(10); + make.right.equalTo(self.rightTimeLabel.mas_left).offset(-10); + }]; + [self.bottomProgress mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.mas_offset(0); + make.bottom.mas_offset(0); + }]; +// [self.fullScreenBtn setHidden:YES]; + [self.fullScreenBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.equalTo(self.bottomView); + make.trailing.equalTo(self.bottomView).offset(-10); + }]; + [self.rateBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.equalTo(self.topView); + make.trailing.equalTo(self.topView).offset(-10); + make.size.mas_equalTo(CGSizeMake(60, 30)); + }]; + [self.backBtn setHidden:YES]; + [self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.equalTo(self.topView).offset(8); + make.size.mas_equalTo(CGSizeMake(self.backBtn.currentImage.size.width+6, self.backBtn.currentImage.size.height+4)); + make.centerY.equalTo(self.titleLabel); + }]; + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.backBtn.mas_trailing).offset(50); + make.trailing.equalTo(self.topView).offset(-50); + make.center.equalTo(self.topView); + make.top.equalTo(self.topView); + }]; + [self.loadFailedLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.equalTo(self.contentView); + }]; +} +-(void)setRate:(CGFloat)rate{ + _rate = rate; + self.player.rate = rate; + self.state = WMPlayerStatePlaying; + self.playOrPauseBtn.selected = NO; + if(rate==1.25){ + [self.rateBtn setTitle:[NSString stringWithFormat:@"%.2fX",rate] forState:UIControlStateNormal]; + [self.rateBtn setTitle:[NSString stringWithFormat:@"%.2fX",rate] forState:UIControlStateSelected]; + }else{ + [self.rateBtn setTitle:[NSString stringWithFormat:@"%.1fX",rate] forState:UIControlStateNormal]; + [self.rateBtn setTitle:[NSString stringWithFormat:@"%.1fX",rate] forState:UIControlStateSelected]; + } +} +//切换速度 +-(void)switchRate:(UIButton *)rateBtn{ + CGFloat rate = [rateBtn.currentTitle floatValue]; + if(rate==0.5){ + rate+=0.5; + }else if(rate==1.0){ + rate+=0.25; + }else if(rate==1.25){ + rate+=0.25; + }else if(rate==1.5){ + rate+=0.5; + }else if(rate==2){ + rate=0.5; + } + self.rate = rate; +} +#pragma mark +#pragma mark - layoutSubviews +-(void)layoutSubviews{ + [super layoutSubviews]; + self.playerLayer.frame = self.contentView.bounds; +} +#pragma mark +#pragma mark 进入后台 +- (void)appDidEnterBackground:(NSNotification*)note{ + if (self.state==WMPlayerStateFinished) { + return; + }else if (self.state==WMPlayerStateStopped) {//如果已经人为的暂停了 + self.isPauseBySystem = NO; + }else if(self.state==WMPlayerStatePlaying){ + if (self.enableBackgroundMode) { + self.playerLayer.player = nil; + [self.playerLayer removeFromSuperlayer]; + self.rate = [self.rateBtn.currentTitle floatValue]; + }else{ + self.isPauseBySystem = YES; + [self pause]; + self.state = WMPlayerStatePause; + } + } +} +#pragma mark +#pragma mark 进入前台 +- (void)appWillEnterForeground:(NSNotification*)note{ + if (self.state==WMPlayerStateFinished) { + if (self.enableBackgroundMode) { + self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player]; + self.playerLayer.frame = self.contentView.bounds; + self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspect; + [self.contentView.layer insertSublayer:self.playerLayer atIndex:0]; + }else{ + return; + } + }else if(self.state==WMPlayerStateStopped){ + return; + }else if(self.state==WMPlayerStatePause){ + if (self.isPauseBySystem) { + self.isPauseBySystem = NO; + [self play]; + [self.imgvCenter setHidden:YES]; + } + }else if(self.state==WMPlayerStatePlaying){ + if (self.enableBackgroundMode) { + self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player]; + self.playerLayer.frame = self.contentView.bounds; + self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspect; + [self.contentView.layer insertSublayer:self.playerLayer atIndex:0]; + [self.player play]; + self.rate = [self.rateBtn.currentTitle floatValue]; + }else{ + return; + } + } +} +//视频进度条的点击事件 +- (void)actionTapGesture:(UITapGestureRecognizer *)sender { + CGPoint touchLocation = [sender locationInView:self.progressSlider]; + CGFloat value = (self.progressSlider.maximumValue - self.progressSlider.minimumValue) * (touchLocation.x/self.progressSlider.frame.size.width); + [self.progressSlider setValue:value animated:YES]; + self.bottomProgress.progress = self.progressSlider.value; + + [self.player seekToTime:CMTimeMakeWithSeconds(self.progressSlider.value, self.currentItem.currentTime.timescale)]; + if (self.player.rate != 1.f) { + self.playOrPauseBtn.selected = NO; + [self.player play]; + } +} +#pragma mark +#pragma mark - 点击锁定🔒屏幕旋转 +-(void)lockAction:(UIButton *)sender{ + sender.selected = !sender.selected; + self.isLockScreen = sender.selected; + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayer:clickedLockButton:)]) { + [self.delegate wmplayer:self clickedLockButton:sender]; + } +} +#pragma mark +#pragma mark - 全屏按钮点击func +-(void)fullScreenAction:(UIButton *)sender{ + sender.selected = !sender.selected; + + AppDelegate *appdel = (AppDelegate*)[[UIApplication sharedApplication] delegate]; + appdel.allowOrentitaionRotation = sender.selected; + + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayer:clickedFullScreenButton:)]) { + [self.delegate wmplayer:self clickedFullScreenButton:sender]; + } +} +#pragma mark +#pragma mark - 关闭按钮点击func +-(void)colseTheVideo:(UIButton *)sender{ + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayer:clickedCloseButton:)]) { + [self.delegate wmplayer:self clickedCloseButton:sender]; + } +} +//获取视频长度 +- (double)duration{ + AVPlayerItem *playerItem = self.player.currentItem; + if (playerItem.status == AVPlayerItemStatusReadyToPlay){ + return CMTimeGetSeconds([[playerItem asset] duration]); + }else{ + return 0.f; + } +} +//获取视频当前播放的时间 +- (double)currentTime{ + if (self.player) { + return CMTimeGetSeconds([self.player currentTime]); + }else{ + return 0.0; + } +} + +-(void)startCenterAction +{ + [self play]; + self.rate = [self.rateBtn.currentTitle floatValue]; + [self.imgvCenter setHidden:YES]; +} +#pragma mark +#pragma mark - PlayOrPause +- (void)PlayOrPause:(UIButton *)sender{ + [self.imgvFirst setHidden:YES]; + if (self.state==WMPlayerStateStopped||self.state==WMPlayerStateFailed) { + [self play]; + self.rate = [self.rateBtn.currentTitle floatValue]; + [self.imgvCenter setHidden:YES]; + } else if(self.state==WMPlayerStatePlaying){ + [self pause]; + [self.imgvCenter setHidden:NO]; + }else if(self.state ==WMPlayerStateFinished){ + self.rate = [self.rateBtn.currentTitle floatValue]; + }else if(self.state==WMPlayerStatePause){ + + self.rate = [self.rateBtn.currentTitle floatValue]; + } + if ([self.delegate respondsToSelector:@selector(wmplayer:clickedPlayOrPauseButton:)]) { + [self.delegate wmplayer:self clickedPlayOrPauseButton:sender]; + } +} +//播放 +-(void)play{ + if (self.isInitPlayer == NO) { + [self creatWMPlayerAndReadyToPlay]; + self.playOrPauseBtn.selected = NO; + }else{ + if (self.state==WMPlayerStateStopped||self.state ==WMPlayerStatePause) { + self.state = WMPlayerStatePlaying; + self.playOrPauseBtn.selected = NO; + [self.player play]; + }else if(self.state ==WMPlayerStateFinished){ + NSLog(@"fffff"); + } + } +} +//暂停 +-(void)pause{ + if (self.state==WMPlayerStatePlaying) { + self.state = WMPlayerStateStopped; + } + [self.player pause]; + self.playOrPauseBtn.selected = YES; + [self.imgvCenter setHidden:NO]; +} +-(void)setPrefersStatusBarHidden:(BOOL)prefersStatusBarHidden{ + _prefersStatusBarHidden = prefersStatusBarHidden; +} +#pragma mark +#pragma mark - 单击手势方法 +- (void)handleSingleTap:(UITapGestureRecognizer *)sender{ +// if (self.isLockScreen) { +// if (self.lockBtn.alpha) { +// self.lockBtn.alpha = 0.0; +// self.prefersStatusBarHidden = self.hiddenStatusBar = YES; +// }else{ +// self.lockBtn.alpha = 1.0; +// self.prefersStatusBarHidden = self.hiddenStatusBar = NO; +// [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hiddenLockBtn) object:nil]; +// [self performSelector:@selector(hiddenLockBtn) withObject:nil afterDelay:5.0]; +// } +// }else{ +// +// } +// if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayer:singleTaped:)]) { +// [self.delegate wmplayer:self singleTaped:sender]; +// } +// if (self.isLockScreen) { +// return; +// } +// [self dismissControlView]; +// [UIView animateWithDuration:0.5 animations:^{ +// if (self.bottomView.alpha == 0.0) { +// [self showControlView]; +// }else{ +// [self hiddenControlView]; +// } +// } completion:^(BOOL finish){ +// +// }]; + + + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayer:singleTaped:)]) { + [self.delegate wmplayer:self singleTaped:sender]; + } + if (self.isLockScreen) { + return; + } + [self PlayOrPause:self.playOrPauseBtn]; + [self showControlView]; + +} +#pragma mark - 长按 +-(void)longPressTap:(UILongPressGestureRecognizer *)longTap +{ + if(longTap.state == UIGestureRecognizerStateBegan) + { + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayerlongPress:)]) { + [self.delegate wmplayerlongPress:self]; + } + } + +} + +#pragma mark - 双击手势方法 +- (void)handleDoubleTap:(UITapGestureRecognizer *)doubleTap{ + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayer:doubleTaped:)]) { + [self.delegate wmplayer:self doubleTaped:doubleTap]; + } + if (self.isLockScreen) { + return; + } + [self PlayOrPause:self.playOrPauseBtn]; + [self showControlView]; +} + +-(void)setCurrentItem:(AVPlayerItem *)playerItem{ + if (_currentItem==playerItem) { + return; + } + if (_currentItem) { + [[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:_currentItem]; + [_currentItem removeObserver:self forKeyPath:@"status"]; + [_currentItem removeObserver:self forKeyPath:@"loadedTimeRanges"]; + [_currentItem removeObserver:self forKeyPath:@"playbackBufferEmpty"]; + [_currentItem removeObserver:self forKeyPath:@"playbackLikelyToKeepUp"]; + [_currentItem removeObserver:self forKeyPath:@"duration"]; + _currentItem = nil; + } + _currentItem = playerItem; + if (_currentItem) { + [_currentItem addObserver:self + forKeyPath:@"status" + options:NSKeyValueObservingOptionNew + context:PlayViewStatusObservationContext]; + + [_currentItem addObserver:self forKeyPath:@"loadedTimeRanges" options:NSKeyValueObservingOptionNew context:PlayViewStatusObservationContext]; + // 缓冲区空了,需要等待数据 + [_currentItem addObserver:self forKeyPath:@"playbackBufferEmpty" options: NSKeyValueObservingOptionNew context:PlayViewStatusObservationContext]; + // 缓冲区有足够数据可以播放了 + [_currentItem addObserver:self forKeyPath:@"playbackLikelyToKeepUp" options: NSKeyValueObservingOptionNew context:PlayViewStatusObservationContext]; + + [_currentItem addObserver:self forKeyPath:@"duration" options:NSKeyValueObservingOptionNew context:PlayViewStatusObservationContext]; + + [self.player replaceCurrentItemWithPlayerItem:_currentItem]; + // 添加视频播放结束通知 + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(moviePlayDidEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:_currentItem]; + } +} +//设置静音 +- (void)setMuted:(BOOL)muted{ + _muted = muted; + self.player.muted = muted; +} +//设置playerLayer的填充模式 +- (void)setPlayerLayerGravity:(WMPlayerLayerGravity)playerLayerGravity { + _playerLayerGravity = playerLayerGravity; + switch (playerLayerGravity) { + case WMPlayerLayerGravityResize: + self.playerLayer.videoGravity = AVLayerVideoGravityResize; + self.videoGravity = AVLayerVideoGravityResize; + break; + case WMPlayerLayerGravityResizeAspect: + self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspect; + self.videoGravity = AVLayerVideoGravityResizeAspect; + break; + case WMPlayerLayerGravityResizeAspectFill: + self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill; + self.videoGravity = AVLayerVideoGravityResizeAspectFill; + break; + default: + break; + } +} +-(void)setIsLockScreen:(BOOL)isLockScreen{ + _isLockScreen = isLockScreen; + self.prefersStatusBarHidden = self.hiddenStatusBar = isLockScreen; + if (isLockScreen) { + [self hiddenControlView]; + }else{ + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hiddenLockBtn) object:nil]; + [self showControlView]; + [self dismissControlView]; + } +} +//重写playerModel的setter方法,处理自己的逻辑 +-(void)setPlayerModel:(WMPlayerModel *)playerModel{ + if (_playerModel==playerModel) { + return; + } + _playerModel = playerModel; + self.isPauseBySystem = NO; + self.seekTime = playerModel.seekTime; + self.titleLabel.text = playerModel.title; + if(playerModel.playerItem){ + self.currentItem = playerModel.playerItem; + }else{ + self.videoURL = playerModel.videoURL; + } + if (self.isInitPlayer) { + self.state = WMPlayerStateBuffering; + }else{ + self.state = WMPlayerStateStopped; + [self.loadingView stopAnimating]; + } +} +-(void)creatWMPlayerAndReadyToPlay{ + self.isInitPlayer = YES; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:nil]; + //设置player的参数 + if(self.currentItem){ + self.player = [AVPlayer playerWithPlayerItem:self.currentItem]; + }else{ + self.urlAsset = [AVURLAsset assetWithURL:self.videoURL]; + + +// NSMutableDictionary* headers = [NSMutableDictionary dictionary]; +// [headers setObject:@"bytes=0-"forKey:@"Range"]; +// self.urlAsset = [AVURLAsset URLAssetWithURL:self.videoURL options:@{AVURLAssetReferenceRestrictionsKey: headers}];// 初始化 + + + + self.currentItem = [AVPlayerItem playerItemWithAsset:self.urlAsset]; + self.player = [AVPlayer playerWithPlayerItem:self.currentItem]; + } + +// self.urlAsset = [AVURLAsset assetWithURL:self.videoURL]; +// self.currentItem = [AVPlayerItem playerItemWithAsset:self.urlAsset]; +// self.player = [AVPlayer playerWithPlayerItem:self.currentItem]; + //ios10新添加的属性,如果播放不了,可以试试打开这个代码 +// if ([self.player respondsToSelector:@selector(automaticallyWaitsToMinimizeStalling)]) { +// self.player.automaticallyWaitsToMinimizeStalling = YES; +// } + self.player.usesExternalPlaybackWhileExternalScreenIsActive=YES; + //AVPlayerLayer + self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player]; + //WMPlayer视频的默认填充模式,AVLayerVideoGravityResizeAspect + self.playerLayer.frame = self.contentView.layer.bounds; + self.playerLayer.videoGravity = self.videoGravity; + [self.contentView.layer insertSublayer:self.playerLayer atIndex:0]; + self.state = WMPlayerStateBuffering; + //监听播放状态 + [self initTimer]; + [self.player play]; +} ++(BOOL)IsiPhoneX{ + struct utsname systemInfo; + uname(&systemInfo); + NSString *platform = [NSString stringWithCString: systemInfo.machine encoding:NSASCIIStringEncoding]; + if([platform isEqualToString:@"i386"]||[platform isEqualToString:@"x86_64"]){//模拟器 + return ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO); + }else{//真机 + if([platform isEqualToString:@"iPhone10,3"]||[platform isEqualToString:@"iPhone10,6"]) { + return YES; + } + return NO; + } +} +///底部是否显示 +-(void)bottomViewShow:(BOOL)isshow +{ + [self.bottomView setHidden:!isshow]; + if(isshow==NO) + { + [self.imgvCenter mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.height.offset(20); + }]; + } + else + { + [self.imgvCenter mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.height.offset(50); + }]; + } +} +//是否全屏 +-(void)setIsFullscreen:(BOOL)isFullscreen{ + _isFullscreen = isFullscreen; + self.rateBtn.hidden = self.lockBtn.hidden = !isFullscreen; + self.fullScreenBtn.selected= isFullscreen; + if (!isFullscreen) { + self.bottomProgress.alpha = 0.0; + } + if ([WMPlayer IsiPhoneX]) { + if (self.isFullscreen) { + [self.contentView mas_remakeConstraints:^(MASConstraintMaker *make) { +// make.edges.mas_equalTo(UIEdgeInsetsMake(0, 70, 0, 70)); + make.edges.mas_equalTo(UIEdgeInsetsMake(0, 0, 0, 0)); + }]; + [self.bottomView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.bottom.equalTo(self.contentView); + make.height.mas_equalTo(90); + }]; + }else{ + [self.contentView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(UIEdgeInsetsMake(0, 0, 0, 0)); + }]; + [self.bottomView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.bottom.equalTo(self.contentView); + make.height.mas_equalTo(50); + }]; + } + } + else + { + if (self.isFullscreen) { + [self.contentView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(UIEdgeInsetsMake(0, 0, 0, 0)); + }]; + [self.bottomView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.bottom.equalTo(self.contentView); + make.height.mas_equalTo(90); + }]; + }else{ + [self.contentView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(UIEdgeInsetsMake(0, 0, 0, 0)); + }]; + [self.bottomView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.bottom.equalTo(self.contentView); + make.height.mas_equalTo(50); + }]; + } + } + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + self.playerLayer.frame = self.contentView.layer.bounds; +// NSLog(@"ccc = %@",NSStringFromCGRect(self.contentView.layer.bounds)); + }); +} +-(void)setBackBtnStyle:(BackBtnStyle)backBtnStyle{ + _backBtnStyle = backBtnStyle; + if (backBtnStyle==BackBtnStylePop) { + [self.backBtn setImage:WMPlayerImage(@"player_icon_nav_back.png") forState:UIControlStateNormal]; + [self.backBtn setImage:WMPlayerImage(@"player_icon_nav_back.png") forState:UIControlStateSelected]; + }else{ + [self.backBtn setImage:WMPlayerImage(@"close.png") forState:UIControlStateNormal]; + [self.backBtn setImage:WMPlayerImage(@"close.png") forState:UIControlStateSelected]; + } +} +-(void)setIsHiddenTopAndBottomView:(BOOL)isHiddenTopAndBottomView{ + _isHiddenTopAndBottomView = isHiddenTopAndBottomView; + self.prefersStatusBarHidden = isHiddenTopAndBottomView; +} +//设置播放的状态 +- (void)setState:(WMPlayerState)state{ + _state = state; + // 控制菊花显示、隐藏 + if (state == WMPlayerStateBuffering) { + [self.loadingView startAnimating]; + }else if(state == WMPlayerStatePlaying){ + [self.loadingView stopAnimating]; + }else if(state == WMPlayerStatePause){ + [self.loadingView stopAnimating]; + }else{ + [self.loadingView stopAnimating]; + } +} +#pragma mark +#pragma mark--播放完成 +- (void)moviePlayDidEnd:(NSNotification *)notification { + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayerFinishedPlay:)]) { + [self.delegate wmplayerFinishedPlay:self]; + } + [self.player seekToTime:kCMTimeZero toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero completionHandler:^(BOOL finished) { + if (finished) { + if (self.isLockScreen) { + [self lockAction:self.lockBtn]; + }else{ + [self showControlView]; + } + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + self.state = WMPlayerStateFinished; + self.bottomProgress.progress = 0; + self.playOrPauseBtn.selected = YES; + }); + } + }]; +} +//显示操作栏view +-(void)showControlView{ + [UIView animateWithDuration:0.5 animations:^{ + self.bottomView.alpha = 1.0; + self.topView.alpha = 1.0; + self.lockBtn.alpha = 1.0; + self.bottomProgress.alpha = 0.f; + self.isHiddenTopAndBottomView = NO; + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayer:isHiddenTopAndBottomView:)]) { + [self.delegate wmplayer:self isHiddenTopAndBottomView:self.isHiddenTopAndBottomView]; + } + } completion:^(BOOL finish){ + + }]; +} +-(void)hiddenLockBtn{ + self.lockBtn.alpha = 0.0; + self.prefersStatusBarHidden = self.hiddenStatusBar = YES; + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayer:singleTaped:)]) { + [self.delegate wmplayer:self singleTaped:self.singleTap]; + } +} +//隐藏操作栏view +-(void)hiddenControlView{ +// [UIView animateWithDuration:0.5 animations:^{ +// self.bottomView.alpha = 0.0; +// self.topView.alpha = 0.0; +// if (self.isFullscreen) { +// self.bottomProgress.alpha = 1.0; +// }else{ +// self.bottomProgress.alpha = 0.f; +// } +// if (self.isLockScreen) { +// //5s hiddenLockBtn +// [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hiddenLockBtn) object:nil]; +// [self performSelector:@selector(hiddenLockBtn) withObject:nil afterDelay:5.0]; +// }else{ +// self.lockBtn.alpha = 0.0; +// } +// +// self.isHiddenTopAndBottomView = YES; +// if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayer:isHiddenTopAndBottomView:)]) { +// [self.delegate wmplayer:self isHiddenTopAndBottomView:self.isHiddenTopAndBottomView]; +// } +// } completion:^(BOOL finish){ +// +// }]; +} +#pragma mark +#pragma mark--开始拖曳sidle +- (void)stratDragSlide:(UISlider *)slider{ + self.isDragingSlider = YES; +} +#pragma mark +#pragma mark - 播放进度 +- (void)updateProgress:(UISlider *)slider{ + self.isDragingSlider = NO; + [self.player seekToTime:CMTimeMakeWithSeconds(slider.value, self.currentItem.currentTime.timescale)]; +} +-(void)dismissControlView{ + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(autoDismissControlView) object:nil]; + [self performSelector:@selector(autoDismissControlView) withObject:nil afterDelay:5.0]; +} +#pragma mark +#pragma mark KVO +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ + /* AVPlayerItem "status" property value observer. */ + if (context == PlayViewStatusObservationContext){ + if ([keyPath isEqualToString:@"status"]) { + AVPlayerStatus status = [[change objectForKey:NSKeyValueChangeNewKey] integerValue]; + switch (status){ + case AVPlayerItemStatusUnknown:{ + [self.loadingProgress setProgress:0.0 animated:NO]; + self.state = WMPlayerStateBuffering; + [self.loadingView startAnimating]; + } + break; + case AVPlayerItemStatusReadyToPlay:{ + /* Once the AVPlayerItem becomes ready to play, i.e. + [playerItem status] == AVPlayerItemStatusReadyToPlay, + its duration can be fetched from the item. */ + if (self.state==WMPlayerStateStopped||self.state==WMPlayerStatePause) { + + }else{ + //5s dismiss controlView + [self dismissControlView]; + self.state=WMPlayerStatePlaying; + } + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayerReadyToPlay:WMPlayerStatus:)]) { + [self.delegate wmplayerReadyToPlay:self WMPlayerStatus:WMPlayerStatePlaying]; + } + [self.loadingView stopAnimating]; + if (self.seekTime) { + [self seekToTimeToPlay:self.seekTime]; + } + if (self.muted) { + self.player.muted = self.muted; + } + if (self.state==WMPlayerStateStopped||self.state==WMPlayerStatePause) { + + }else{ + self.rate = [self.rateBtn.currentTitle floatValue]; + } + } + break; + + case AVPlayerItemStatusFailed:{ + self.state = WMPlayerStateFailed; + if (self.delegate&&[self.delegate respondsToSelector:@selector(wmplayerFailedPlay:WMPlayerStatus:)]) { + [self.delegate wmplayerFailedPlay:self WMPlayerStatus:WMPlayerStateFailed]; + } + NSError *error = [self.player.currentItem error]; + if (error) { + self.loadFailedLabel.hidden = NO; + [self bringSubviewToFront:self.loadFailedLabel]; + //here + [self.loadingView stopAnimating]; + } + NSLog(@"视频加载失败===%@",error.description); + } + break; + } + }else if ([keyPath isEqualToString:@"duration"]) { + if ((CGFloat)CMTimeGetSeconds(self.currentItem.duration) != self.totalTime) { + self.totalTime = (CGFloat)CMTimeGetSeconds(self.currentItem.duration); + if(self.totalTime>0) + { + self.progressSlider.maximumValue = self.totalTime; + } + if (self.state==WMPlayerStateStopped||self.state==WMPlayerStatePause) { + + }else{ + self.state = WMPlayerStatePlaying; + } + } + }else if ([keyPath isEqualToString:@"loadedTimeRanges"]) { + // 计算缓冲进度 + NSTimeInterval timeInterval = [self availableDuration]; + CMTime duration = self.currentItem.duration; + CGFloat totalDuration = CMTimeGetSeconds(duration); + //缓冲颜色 + self.loadingProgress.progressTintColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.7]; + [self.loadingProgress setProgress:timeInterval / totalDuration animated:NO]; + } else if ([keyPath isEqualToString:@"playbackBufferEmpty"]) { + [self.loadingView startAnimating]; + // 当缓冲是空的时候 + if (self.currentItem.playbackBufferEmpty) { + NSLog(@"%s WMPlayerStateBuffering",__FUNCTION__); + [self loadedTimeRanges]; + } + }else if ([keyPath isEqualToString:@"playbackLikelyToKeepUp"]) { + //here + [self.loadingView stopAnimating]; + // 当缓冲好的时候 + if (self.currentItem.playbackLikelyToKeepUp && self.state == WMPlayerStateBuffering){ + NSLog(@"55555%s WMPlayerStatePlaying",__FUNCTION__); + if (self.state==WMPlayerStateStopped||self.state==WMPlayerStatePause) { + + }else{ + self.state = WMPlayerStatePlaying; + } + } + } + } +} +//缓冲回调 +- (void)loadedTimeRanges{ + if (self.state==WMPlayerStatePause) { + + }else{ + self.state = WMPlayerStateBuffering; + } + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + if (self.state==WMPlayerStatePlaying||self.state==WMPlayerStateFinished) { + + }else{ + [self play]; + } + [self.loadingView stopAnimating]; + }); +} + +#pragma mark +#pragma mark autoDismissControlView +-(void)autoDismissControlView{ + [self hiddenControlView];//隐藏操作栏 +} +#pragma mark - 定时器 +-(void)initTimer{ + __weak typeof(self) weakSelf = self; + self.playbackTimeObserver = [self.player addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(1.0, NSEC_PER_SEC) queue:dispatch_get_main_queue() /* If you pass NULL, the main queue is used. */ + usingBlock:^(CMTime time){ + [weakSelf syncScrubber]; + }]; +} +- (void)syncScrubber{ + CMTime playerDuration = [self playerItemDuration]; + if (CMTIME_IS_INVALID(playerDuration)){ + self.progressSlider.minimumValue = 0.0; + self.bottomProgress.progress = 0.0; + return; + } + long long nowTime = self.currentItem.currentTime.value/self.currentItem.currentTime.timescale; + self.leftTimeLabel.text = [self convertTime:nowTime]; + self.rightTimeLabel.text = [self convertTime:self.totalTime]; + if (self.isDragingSlider==YES) {//拖拽slider中,不更新slider的值 + + }else if(self.isDragingSlider==NO){ + CGFloat value = (self.progressSlider.maximumValue - self.progressSlider.minimumValue) * nowTime / self.totalTime + self.progressSlider.minimumValue; + self.progressSlider.value = value; + [self.bottomProgress setProgress:nowTime/(self.totalTime) animated:YES]; + } +} +//seekTime跳到time处播放 +- (void)seekToTimeToPlay:(double)seekTime{ + if (self.player&&self.player.currentItem.status == AVPlayerItemStatusReadyToPlay) { + if (seekTime>=self.totalTime) { + seekTime = 0.0; + } + if (seekTime<0) { + seekTime=0.0; + } +// int32_t timeScale = self.player.currentItem.asset.duration.timescale; + //currentItem.asset.duration.timescale计算的时候严重堵塞主线程,慎用 + /* A timescale of 1 means you can only specify whole seconds to seek to. The timescale is the number of parts per second. Use 600 for video, as Apple recommends, since it is a product of the common video frame rates like 50, 60, 25 and 24 frames per second*/ + __weak typeof(self) weakSelf = self; + + [self.player seekToTime:CMTimeMakeWithSeconds(seekTime, self.currentItem.currentTime.timescale) toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero completionHandler:^(BOOL finished) { + weakSelf.seekTime = 0; + }]; + } +} +- (CMTime)playerItemDuration{ + AVPlayerItem *playerItem = self.currentItem; + if (playerItem.status == AVPlayerItemStatusReadyToPlay){ + return([playerItem duration]); + } + return(kCMTimeInvalid); +} +- (NSString *)convertTime:(float)second{ + NSDate *d = [NSDate dateWithTimeIntervalSince1970:second]; + if (second/3600 >= 1) { + [[self dateFormatter] setDateFormat:@"HH:mm:ss"]; + } else { + [[self dateFormatter] setDateFormat:@"mm:ss"]; + } + return [[self dateFormatter] stringFromDate:d]; +} +//计算缓冲进度 +- (NSTimeInterval)availableDuration { + NSArray *loadedTimeRanges = [_currentItem loadedTimeRanges]; + CMTimeRange timeRange = [loadedTimeRanges.firstObject CMTimeRangeValue];// 获取缓冲区域 + float startSeconds = CMTimeGetSeconds(timeRange.start); + float durationSeconds = CMTimeGetSeconds(timeRange.duration); + NSTimeInterval result = startSeconds + durationSeconds;// 计算缓冲总进度 + return result; +} +#pragma mark +#pragma mark - touches +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ + //这个是用来判断, 如果有多个手指点击则不做出响应 + UITouch * touch = (UITouch *)touches.anyObject; + if (touches.count > 1 || [touch tapCount] > 1 || event.allTouches.count > 1) { + return; + } +// 这个是用来判断, 手指点击的是不是本视图, 如果不是则不做出响应 + if (![[(UITouch *)touches.anyObject view] isEqual:self.contentView] && ![[(UITouch *)touches.anyObject view] isEqual:self]) { + return; + } + [super touchesBegan:touches withEvent:event]; + + //触摸开始, 初始化一些值 + self.hasMoved = NO; + self.touchBeginValue = self.progressSlider.value; + //位置 + self.touchBeginPoint = [touches.anyObject locationInView:self]; + //亮度 + self.touchBeginLightValue = [UIScreen mainScreen].brightness; + //声音 + self.touchBeginVoiceValue = self.volumeSlider.value; +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ + UITouch * touch = (UITouch *)touches.anyObject; + if (touches.count > 1 || [touch tapCount] > 1 || event.allTouches.count > 1) { + return; + } + if (![[(UITouch *)touches.anyObject view] isEqual:self.contentView] && ![[(UITouch *)touches.anyObject view] isEqual:self]) { + return; + } + [super touchesMoved:touches withEvent:event]; + + + //如果移动的距离过于小, 就判断为没有移动 + CGPoint tempPoint = [touches.anyObject locationInView:self]; + if (fabs(tempPoint.x - self.touchBeginPoint.x) < LeastDistance && fabs(tempPoint.y - self.touchBeginPoint.y) < LeastDistance) { + return; + } + self.hasMoved = YES; + //如果还没有判断出使什么控制手势, 就进行判断 + //滑动角度的tan值 + float tan = fabs(tempPoint.y - _touchBeginPoint.y)/fabs(tempPoint.x - self.touchBeginPoint.x); + if (tan < 1/sqrt(3)) { //当滑动角度小于30度的时候, 进度手势 + self.controlType = WMControlTypeProgress; + }else if(tan > sqrt(3)){ //当滑动角度大于60度的时候, 声音和亮度 + //判断是在屏幕的左半边还是右半边滑动, 左侧控制为亮度, 右侧控制音量 + if (self.touchBeginPoint.x < self.bounds.size.width/2) { + self.controlType = WMControlTypeLight; + }else{ + self.controlType = WMControlTypeVoice; + } + }else{ //如果是其他角度则不是任何控制 + self.controlType = WMControlTypeDefault; + return; + } + if (self.controlType == WMControlTypeProgress) { //如果是进度手势 + if (self.enableFastForwardGesture) { + float value = [self moveProgressControllWithTempPoint:tempPoint]; + [self timeValueChangingWithValue:value]; + } + }else if(self.controlType == WMControlTypeVoice){ //如果是音量手势 + if (self.isFullscreen) {//全屏的时候才开启音量的手势调节 + if (self.enableVolumeGesture) { + //根据触摸开始时的音量和触摸开始时的点去计算出现在滑动到的音量 + float voiceValue = self.touchBeginVoiceValue - ((tempPoint.y - self.touchBeginPoint.y)/self.bounds.size.height); + //判断控制一下, 不能超出 0~1 + if (voiceValue < 0) { + self.volumeSlider.value = 0; + }else if(voiceValue > 1){ + self.volumeSlider.value = 1; + }else{ + self.volumeSlider.value = voiceValue; + } + } + }else{ + return; + } + }else if(self.controlType == WMControlTypeLight){ //如果是亮度手势 + if (self.isFullscreen) { + //根据触摸开始时的亮度, 和触摸开始时的点来计算出现在的亮度 + float tempLightValue = self.touchBeginLightValue - ((tempPoint.y - _touchBeginPoint.y)/self.bounds.size.height); + if (tempLightValue < 0) { + tempLightValue = 0; + }else if(tempLightValue > 1){ + tempLightValue = 1; + } + // 控制亮度的方法 + [UIScreen mainScreen].brightness = tempLightValue; + // 实时改变现实亮度进度的view + NSLog(@"亮度调节 = %f",tempLightValue); + }else{ + + } + } +} +-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{ + [super touchesCancelled:touches withEvent:event]; + //判断是否移动过, + if (self.hasMoved) { + if (_controlType == WMControlTypeProgress) { //进度控制就跳到响应的进度 + CGPoint tempPoint = [touches.anyObject locationInView:self]; + // if ([self.delegate respondsToSelector:@selector(seekToTheTimeValue:)]) { + if (self.enableFastForwardGesture) { + float value = [self moveProgressControllWithTempPoint:tempPoint]; + // [self.delegate seekToTheTimeValue:value]; + [self seekToTimeToPlay:value]; + } + // } + self.FF_View.hidden = YES; + }else if (_controlType == WMControlTypeLight){//如果是亮度控制, 控制完亮度还要隐藏显示亮度的view + } + }else{ + } +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ + self.FF_View.hidden = YES; + [super touchesEnded:touches withEvent:event]; + //判断是否移动过, + if (self.hasMoved) { + if (self.controlType == WMControlTypeProgress) { //进度控制就跳到响应的进度 + // if ([self.delegate respondsToSelector:@selector(seekToTheTimeValue:)]) { + if (self.enableFastForwardGesture) { + CGPoint tempPoint = [touches.anyObject locationInView:self]; + float value = [self moveProgressControllWithTempPoint:tempPoint]; + [self seekToTimeToPlay:value]; + self.FF_View.hidden = YES; + } + }else if (_controlType == WMControlTypeLight){//如果是亮度控制, 控制完亮度还要隐藏显示亮度的view + } + }else{ + + } +} +#pragma mark - 用来控制移动过程中计算手指划过的时间 +-(float)moveProgressControllWithTempPoint:(CGPoint)tempPoint{ + //90代表整个屏幕代表的时间 + float tempValue = self.touchBeginValue + TotalScreenTime * ((tempPoint.x - self.touchBeginPoint.x)/([UIScreen mainScreen].bounds.size.width)); + if (tempValue > [self duration]) { + tempValue = [self duration]; + }else if (tempValue < 0){ + tempValue = 0.0f; + } + return tempValue; +} + +#pragma mark - 用来显示时间的view在时间发生变化时所作的操作 +-(void)timeValueChangingWithValue:(float)value{ + if (value > self.touchBeginValue) { + self.FF_View.stateImageView.image = WMPlayerImage(@"progress_icon_r"); + }else if(value < self.touchBeginValue){ + self.FF_View.stateImageView.image = WMPlayerImage(@"progress_icon_l"); + } + self.FF_View.hidden = NO; + self.FF_View.timeLabel.text = [NSString stringWithFormat:@"%@/%@", [self convertTime:value], [self convertTime:self.totalTime]]; + self.leftTimeLabel.text = [self convertTime:value]; +} + +NSString * calculateTimeWithTimeFormatter(long long timeSecond){ + NSString * theLastTime = nil; + if (timeSecond < 60) { + theLastTime = [NSString stringWithFormat:@"00:%.2lld", timeSecond]; + }else if(timeSecond >= 60 && timeSecond < 3600){ + theLastTime = [NSString stringWithFormat:@"%.2lld:%.2lld", timeSecond/60, timeSecond%60]; + }else if(timeSecond >= 3600){ + theLastTime = [NSString stringWithFormat:@"%.2lld:%.2lld:%.2lld", timeSecond/3600, timeSecond%3600/60, timeSecond%60]; + } + return theLastTime; +} +//重置播放器 +-(void )resetWMPlayer{ + self.currentItem = nil; + self.isInitPlayer = NO; + self.bottomProgress.progress = 0; + _playerModel = nil; + self.seekTime = 0; + // 移除通知 + [[NSNotificationCenter defaultCenter] removeObserver:self]; + // 暂停 + [self pause]; + self.progressSlider.value = 0; + self.bottomProgress.progress = 0; + self.loadingProgress.progress = 0; + self.leftTimeLabel.text = self.rightTimeLabel.text = [self convertTime:0.0];//设置默认值 + // 移除原来的layer + [self.playerLayer removeFromSuperlayer]; + // 替换PlayerItem为nil + [self.player replaceCurrentItemWithPlayerItem:nil]; + // 把player置为nil + self.player = nil; +} +-(void)dealloc{ + for (UIView *aLightView in [UIApplication sharedApplication].keyWindow.subviews) { + if ([aLightView isKindOfClass:[WMLightView class]]) { + [aLightView removeFromSuperview]; + } + } + NSLog(@"WMPlayer dealloc"); + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [self.player.currentItem cancelPendingSeeks]; + [self.player.currentItem.asset cancelLoading]; + [self.player pause]; + [self.player removeTimeObserver:self.playbackTimeObserver]; + + //移除观察者 + [_currentItem removeObserver:self forKeyPath:@"status"]; + [_currentItem removeObserver:self forKeyPath:@"loadedTimeRanges"]; + [_currentItem removeObserver:self forKeyPath:@"playbackBufferEmpty"]; + [_currentItem removeObserver:self forKeyPath:@"playbackLikelyToKeepUp"]; + [_currentItem removeObserver:self forKeyPath:@"duration"]; + _currentItem = nil; + + [self.playerLayer removeFromSuperlayer]; + [self.player replaceCurrentItemWithPlayerItem:nil]; + self.player = nil; + self.playOrPauseBtn = nil; + self.playerLayer = nil; +} + +//获取当前的旋转状态 ++(CGAffineTransform)getCurrentDeviceOrientation{ + //状态条的方向已经设置过,所以这个就是你想要旋转的方向 + UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; + //根据要进行旋转的方向来计算旋转的角度 + if (orientation ==UIInterfaceOrientationPortrait) { + return CGAffineTransformIdentity; + }else if (orientation ==UIInterfaceOrientationLandscapeLeft){ + return CGAffineTransformMakeRotation(-M_PI_2); + }else if(orientation ==UIInterfaceOrientationLandscapeRight){ + return CGAffineTransformMakeRotation(M_PI_2); + } + return CGAffineTransformIdentity; +} +//版本号 ++(NSString *)version{ + return @"5.0.0"; +} +@end diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayerModel.h b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayerModel.h new file mode 100644 index 0000000..109b1b3 --- /dev/null +++ b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayerModel.h @@ -0,0 +1,22 @@ +// +// WMPlayerModel.h +// +// +// Created by zhengwenming on 2018/4/26. +// + +#import +#import +#import + +@interface WMPlayerModel : NSObject +//视频标题 +@property (nonatomic, copy) NSString *title; +//视频的URL,本地路径or网络路径http +@property (nonatomic, strong) NSURL *videoURL; +//videoURL和playerItem二选一 +@property (nonatomic, strong) AVPlayerItem *playerItem; +//跳到seekTime处播放 +@property (nonatomic, assign) double seekTime; +@property (nonatomic, strong) NSIndexPath *indexPath; +@end diff --git a/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayerModel.m b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayerModel.m new file mode 100644 index 0000000..3027d0d --- /dev/null +++ b/ProductApp/ProductApp/BaseControl/WMPlayer/WMPlayerModel.m @@ -0,0 +1,11 @@ +// +// WMPlayerModel.m +// +// +// Created by zhengwenming on 2018/4/26. +// + +#import "WMPlayerModel.h" + +@implementation WMPlayerModel +@end diff --git a/ProductApp/ProductApp/ProductMain/首页/view/MainHomeView.m b/ProductApp/ProductApp/ProductMain/首页/view/MainHomeView.m index c70c82b..7355b53 100644 --- a/ProductApp/ProductApp/ProductMain/首页/view/MainHomeView.m +++ b/ProductApp/ProductApp/ProductMain/首页/view/MainHomeView.m @@ -433,12 +433,20 @@ break; case 1: { - + if(DEBUG) + { + UIViewController *vc = [NSClassFromString(@"HuaShuSJQViewController") new]; + [self.viewController.navigationController pushViewController:vc animated:YES]; + } } break; case 2: { - + if(DEBUG) + { + UIViewController *vc = [NSClassFromString(@"MoNiShiPingHCViewController") new]; + [self.viewController.navigationController pushViewController:vc animated:YES]; + } } break; case 3: diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟来电/view/MoNiLaiDianShowView.m b/ProductApp/ProductApp/ProductMain/首页/模拟来电/view/MoNiLaiDianShowView.m index 88413d6..37ceeaf 100644 --- a/ProductApp/ProductApp/ProductMain/首页/模拟来电/view/MoNiLaiDianShowView.m +++ b/ProductApp/ProductApp/ProductMain/首页/模拟来电/view/MoNiLaiDianShowView.m @@ -31,7 +31,18 @@ [vc refShowStateBar:YES]; }); - [self setBackgroundColor:RGBCOLOR(245, 245, 245)]; + [self setBackgroundColor:RGBCOLOR(245, 245, 245)];///0, 0, 0, 0.5 + + UIImageView *imgvback = [[UIImageView alloc] init]; + [imgvback setImage:[UIImage imageNamed:@"ios_back"]]; + [self addSubview:imgvback]; + [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; + UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + toolbar.barStyle = UIBarStyleBlack; + [imgvback addSubview:toolbar]; + UILabel *lbname = [[UILabel alloc] init]; [lbname setTextColor:[UIColor whiteColor]]; @@ -65,6 +76,79 @@ ///接听 -(void)drawJieTing { + [self.viewwjt removeFromSuperview]; + + UIView *viewjt = [[UIView alloc] init]; + [viewjt setBackgroundColor:[UIColor clearColor]]; + [self addSubview:viewjt]; + [viewjt mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; + + UILabel *lbtime = [[UILabel alloc] init]; + [lbtime setText:@"00:00"]; + [lbtime setTextColor:[UIColor whiteColor]]; + [lbtime setTextAlignment:NSTextAlignmentCenter]; + [lbtime setFont:[UIFont fontWithName:@"PingFangSC-Medium" size:18]]; + [self addSubview:lbtime]; + [lbtime mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.offset(NavHeight + 90); + make.height.offset(40); + make.centerX.equalTo(self); + }]; + [Tools startTimerWithStartTime:1000 isCountDown:YES result:^(NSInteger tag) { + NSInteger temp = 1000-tag; + lbtime.text = [self getSecTime:temp]; + }]; + + + UIButton *btgd = [[UIButton alloc] init]; + [btgd setImage:[UIImage imageNamed:@"spth_挂断"] forState:UIControlStateNormal]; + [viewjt addSubview:btgd]; + [btgd mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(viewjt); + make.width.offset(72); + make.height.offset(72); + make.bottom.equalTo(viewjt).offset(-TabHeight-20); + }]; + [btgd setTag:0]; + [btgd addTarget:self action:@selector(funcAction:) forControlEvents:UIControlEventTouchUpInside]; + + UIView *viewson = [[UIView alloc] init]; + [viewson setBackgroundColor:[UIColor clearColor]]; + [viewjt addSubview:viewson]; + [viewson mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.equalTo(viewjt); + make.centerY.equalTo(viewjt).offset(KMagrinTop+20); + }]; + NSArray *arrtemp = @[@"静音",@"拨号键盘",@"免提",@"添加通话",@"FaceTime",@"通讯录"]; + float fj_w = (UISCREEN_WIDTH-240-72)/2.0; + for(int i = 0 ; i < 2; i++) + { + for(int j = 0 ; j < 3; j++) + { + UIButton *btitem = [[UIButton alloc] init]; + [btitem setTitle:arrtemp[i*3+j] forState:UIControlStateNormal]; + [btitem setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [btitem.titleLabel setFont:[UIFont systemFontOfSize:16]]; + [btitem setImage:[UIImage imageNamed:[NSString stringWithFormat:@"dh_%@",arrtemp[i*3+j]]] forState:UIControlStateNormal]; + [viewson addSubview:btitem]; + [btitem mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(32+(80+fj_w)*j); + make.top.offset(130*i); + make.width.offset(80); + make.height.offset(130); + }]; + [btitem setIconInTopWithSpacing:10]; + if(i*3+j==4) + { + [btitem setTitleColor:RGBACOLOR(255, 255, 255, 0.3) forState:UIControlStateNormal]; + [viewson mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(btitem); + }]; + } + } + } } @@ -97,7 +181,7 @@ [btgd addTarget:self action:@selector(funcAction:) forControlEvents:UIControlEventTouchUpInside]; UIButton *btjt = [[UIButton alloc] init]; - [btjt setImage:[UIImage imageNamed:@"spth_接听"] forState:UIControlStateNormal]; + [btjt setImage:[UIImage imageNamed:@"dh_接听"] forState:UIControlStateNormal]; [viewwjt addSubview:btjt]; [btjt mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(viewwjt).offset(-60); @@ -137,6 +221,29 @@ }]; [btxx setIconInTopWithSpacing:8]; } +-(NSString *)getSecTime:(NSInteger)itemp +{ + NSString *strback = @"00:00"; + if(itemp>0) + { + NSInteger ifen = itemp/60; + NSInteger imiao = itemp%60; + strback = [NSString stringWithFormat:@"%ld",ifen]; + if(ifen<10) + { + strback = [NSString stringWithFormat:@"0%ld",ifen]; + } + if(imiao<10) + { + strback = [NSString stringWithFormat:@"%@:0%ld",strback,imiao]; + } + else + { + strback = [NSString stringWithFormat:@"%@:%ld",strback,imiao]; + } + } + return strback; +} -(void)setType:(int)type { @@ -156,15 +263,17 @@ {///挂断 ///播放声音 - DuanXinShowMainHomeView *view = [[DuanXinShowMainHomeView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; - [self.superview addSubview:view]; - [self removeFromSuperview]; + exit(0); + +// DuanXinShowMainHomeView *view = [[DuanXinShowMainHomeView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; +// [self.superview addSubview:view]; +// [self removeFromSuperview]; } break; case 1: {///接听 -// [self drawJieTing]; + [self drawJieTing]; } break; default: diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/MoNiShiPingHCViewController.h b/ProductApp/ProductApp/ProductMain/首页/模拟视频/MoNiShiPingHCViewController.h new file mode 100644 index 0000000..a0af28a --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/MoNiShiPingHCViewController.h @@ -0,0 +1,16 @@ +// +// MoNiShiPingHCViewController.h +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "BaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MoNiShiPingHCViewController : BaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/MoNiShiPingHCViewController.m b/ProductApp/ProductApp/ProductMain/首页/模拟视频/MoNiShiPingHCViewController.m new file mode 100644 index 0000000..7a650dd --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/MoNiShiPingHCViewController.m @@ -0,0 +1,40 @@ +// +// MoNiShiPingHCViewController.m +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "MoNiShiPingHCViewController.h" +#import "MoNiShiPingHCView.h" + + +@interface MoNiShiPingHCViewController () + +@end + +@implementation MoNiShiPingHCViewController +- (UIStatusBarStyle)preferredStatusBarStyle { + return UIStatusBarStyleDefault; +} +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [self.navigationController setNavigationBarHidden:YES animated:animated]; + [self showNaviGationView:YES]; + [self.navigationView setTitle:@"模拟视频" titleColor:RGBCOLOR(60, 60, 60)]; + [self.navigationView setBackgroundColor:RGBCOLOR(242, 242, 242)]; +} +- (void)viewDidLoad { + [super viewDidLoad]; + [self.view setBackgroundColor:RGBCOLOR(242, 242, 242)]; + + MoNiShiPingHCView *view = [[MoNiShiPingHCView alloc] init]; + [self.view addSubview:view]; + [view mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.equalTo(self.view); + make.top.offset(NavHeight); + }]; +} + + +@end diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/cell/MoNiShiPingHCCollectionViewCell.h b/ProductApp/ProductApp/ProductMain/首页/模拟视频/cell/MoNiShiPingHCCollectionViewCell.h new file mode 100644 index 0000000..ee8cadc --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/cell/MoNiShiPingHCCollectionViewCell.h @@ -0,0 +1,18 @@ +// +// MoNiShiPingHCCollectionViewCell.h +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MoNiShiPingHCCollectionViewCell : UICollectionViewCell +/// +@property (nonatomic , strong) baseInfoModel *model; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/cell/MoNiShiPingHCCollectionViewCell.m b/ProductApp/ProductApp/ProductMain/首页/模拟视频/cell/MoNiShiPingHCCollectionViewCell.m new file mode 100644 index 0000000..a06718c --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/cell/MoNiShiPingHCCollectionViewCell.m @@ -0,0 +1,94 @@ +// +// MoNiShiPingHCCollectionViewCell.m +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "MoNiShiPingHCCollectionViewCell.h" + +@interface MoNiShiPingHCCollectionViewCell () +/// +@property (nonatomic , strong) UIImageView *imgvback; +@property (nonatomic , strong) UIImageView *imgvselect; +@property (nonatomic , strong) UILabel *lbname; + +@end + +@implementation MoNiShiPingHCCollectionViewCell +-(id)initWithFrame:(CGRect)frame +{ + if(self = [super initWithFrame:frame]) + { + UIView *viewback = [[UIView alloc] init]; + [viewback setBackgroundColor:[UIColor clearColor]]; + [self.contentView addSubview:viewback]; + [viewback mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; + + + UIImageView *imgvback = [[UIImageView alloc] init]; + [viewback addSubview:imgvback]; + [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.equalTo(viewback); + make.bottom.equalTo(viewback).offset(-44); + }]; + [imgvback.layer setMasksToBounds:YES]; + [imgvback.layer setCornerRadius:10]; + [imgvback.layer setBorderWidth:1]; + [imgvback.layer setBorderColor:[UIColor clearColor].CGColor]; + _imgvback = imgvback; + + UIImageView *imgvbf = [[UIImageView alloc] init]; + [imgvbf setImage:[UIImage imageNamed:@"sphc_bofang"]]; + [imgvback addSubview:imgvbf]; + [imgvbf mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.offset(50); + make.center.equalTo(imgvback); + }]; + + UIImageView *imgvselect = [[UIImageView alloc] init]; + [imgvselect setImage:[UIImage imageNamed:@"zz_wx_select"]]; + [imgvback addSubview:imgvselect]; + [imgvselect mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.offset(20); + make.right.bottom.equalTo(imgvback); + }]; + _imgvselect = imgvselect; + + UILabel *lbname = [[UILabel alloc] init]; + [lbname setText:@"法拉利 豪华车库上车"]; + [lbname setTextColor:RGBCOLOR(26, 26, 26)]; + [lbname setTextAlignment:NSTextAlignmentCenter]; + [lbname setFont:[UIFont systemFontOfSize:14]]; + [viewback addSubview:lbname]; + [lbname mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.equalTo(viewback); + make.top.equalTo(imgvback.mas_bottom); + }]; + _lbname = lbname; + + } + return self; +} + +-(void)setModel:(baseInfoModel *)model +{ + _model = model; + self.imgvselect.hidden = !model.select; + if(!model.select) + { + [self.imgvback.layer setBorderColor:[UIColor clearColor].CGColor]; + [self.lbname setTextColor:RGBCOLOR(26, 26, 26)]; + } + else + { + [self.imgvback.layer setBorderColor:RGBCOLOR(119, 140, 245).CGColor]; + [self.lbname setTextColor:RGBCOLOR(92, 117, 248)]; + } + + +} + +@end diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/view/MoNiShiPingHCView.h b/ProductApp/ProductApp/ProductMain/首页/模拟视频/view/MoNiShiPingHCView.h new file mode 100644 index 0000000..2401744 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/view/MoNiShiPingHCView.h @@ -0,0 +1,16 @@ +// +// MoNiShiPingHCView.h +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MoNiShiPingHCView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/view/MoNiShiPingHCView.m b/ProductApp/ProductApp/ProductMain/首页/模拟视频/view/MoNiShiPingHCView.m new file mode 100644 index 0000000..71617b0 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/view/MoNiShiPingHCView.m @@ -0,0 +1,137 @@ +// +// MoNiShiPingHCView.m +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "MoNiShiPingHCView.h" +#import "MoNiShiPingHCCollectionViewCell.h" +#import "MoNiShiPingHCCLViewController.h" + + +@interface MoNiShiPingHCView () +/// +@property (nonatomic , strong) UICollectionView *collect; + +/// +@property (nonatomic , strong) NSMutableArray *arrdata; + +@end + +@implementation MoNiShiPingHCView + +-(id)initWithFrame:(CGRect)frame +{ + if(self = [super initWithFrame:frame]) + { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 0; + layout.minimumInteritemSpacing = 0; + UICollectionView *collect = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + [collect setDelegate:self]; + [collect setDataSource:self]; + [collect setBackgroundColor:[UIColor clearColor]]; + [self addSubview:collect]; + [collect mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(0); + make.right.equalTo(self).offset(0); + make.top.offset(10); + make.height.equalTo(self).offset(-TabHeight-20); + }]; + [collect setTag:1]; + [collect registerClass:[MoNiShiPingHCCollectionViewCell class] forCellWithReuseIdentifier:@"MoNiShiPingHCCollectionViewCell"]; + _collect = collect; + + UIView *viewbottom = [[UIView alloc] init]; + [viewbottom setBackgroundColor:[UIColor whiteColor]]; + [self addSubview:viewbottom]; + [viewbottom mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.equalTo(self); + make.height.offset(TabHeight+20); + }]; + [self drawBottomView:viewbottom]; + [self getdata]; + + } + return self; +} +-(void)drawBottomView:(UIView *)view +{ + UIButton *btok = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH-32, 46)]; + [btok setTitle:@"开始模拟" forState:UIControlStateNormal]; + [btok setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [btok.titleLabel setFont:[UIFont systemFontOfSize:15]]; + [btok.layer setMasksToBounds:YES]; + [btok.layer setCornerRadius:23]; + [view addSubview:btok]; + [btok mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(16); + make.top.offset(9); + make.right.equalTo(view).offset(-16); + make.height.offset(46); + }]; + [btok addTarget:self action:@selector(okAction) forControlEvents:UIControlEventTouchUpInside]; + [Tools changedView:btok colors:@[(id)RGBCOLOR(119, 140, 245).CGColor,(id)RGBCOLOR(166, 121, 244).CGColor] startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)]; +} +-(void)getdata +{ + self.arrdata = [NSMutableArray new]; + NSArray *arrt = @[@"商业精英",@"学术权威",@"互联网黑话",@"文艺哲学",@"体制内风格",@"科技极客",@"金融投行"]; + for(NSString *str in arrt) + { + baseInfoModel *model = [baseInfoModel new]; + model.title = str; + [self.arrdata addObject:model]; + if(self.arrdata.count==1) + { + model.select = YES; + } + } +} +-(void)okAction +{ + MoNiShiPingHCCLViewController *vc = [MoNiShiPingHCCLViewController new]; + [self.viewController.navigationController pushViewController:vc animated:YES]; +} +#pragma mark - UICollectionView +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section +{ + return self.arrdata.count; +} +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath +{ + MoNiShiPingHCCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MoNiShiPingHCCollectionViewCell" forIndexPath:indexPath]; + cell.model = self.arrdata[indexPath.row]; + return cell; +} +//定义每个section的间距 +- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{ + + return UIEdgeInsetsMake(0, 16, 0, 16); +} +//纵向cell间距 +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{ + return 10; +} +//cell 间距 +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout ForSectionAtIndex:(NSInteger)section{ + return 10; +} +// 定义每个UICollectionViewCell 的大小 +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath +{ + return CGSizeMake((UISCREEN_WIDTH-42)/2.0, ((UISCREEN_WIDTH-42)/2.0)*240/167.0+44); +} +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath +{ + for(baseInfoModel *model in self.arrdata) + { + model.select = NO; + } + baseInfoModel *model = self.arrdata[indexPath.row]; + model.select = YES; + [self.collect reloadData]; +} + +@end diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/MoNiShiPingHCCLViewController.h b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/MoNiShiPingHCCLViewController.h new file mode 100644 index 0000000..0ab04c7 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/MoNiShiPingHCCLViewController.h @@ -0,0 +1,16 @@ +// +// MoNiShiPingHCCLViewController.h +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "BaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MoNiShiPingHCCLViewController : BaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/MoNiShiPingHCCLViewController.m b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/MoNiShiPingHCCLViewController.m new file mode 100644 index 0000000..55ac5f8 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/MoNiShiPingHCCLViewController.m @@ -0,0 +1,40 @@ +// +// MoNiShiPingHCCLViewController.m +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "MoNiShiPingHCCLViewController.h" +#import "MoNiShiPingHCCLView.h" + + +@interface MoNiShiPingHCCLViewController () + +@end + +@implementation MoNiShiPingHCCLViewController + +- (UIStatusBarStyle)preferredStatusBarStyle { + return UIStatusBarStyleDefault; +} +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [self.navigationController setNavigationBarHidden:YES animated:animated]; + [self showNaviGationView:YES]; + [self.navigationView setTitle:@"模拟视频" titleColor:RGBCOLOR(60, 60, 60)]; + [self.navigationView setBackgroundColor:[UIColor whiteColor]]; +} +- (void)viewDidLoad { + [super viewDidLoad]; + [self.view setBackgroundColor:[UIColor whiteColor]]; + + MoNiShiPingHCCLView *view = [[MoNiShiPingHCCLView alloc] init]; + [self.view addSubview:view]; + [view mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.equalTo(self.view); + make.top.offset(NavHeight); + }]; +} + +@end diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLDetailView.h b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLDetailView.h new file mode 100644 index 0000000..047e2ae --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLDetailView.h @@ -0,0 +1,16 @@ +// +// MoNiShiPingHCCLDetailView.h +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MoNiShiPingHCCLDetailView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLDetailView.m b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLDetailView.m new file mode 100644 index 0000000..0cdd9ae --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLDetailView.m @@ -0,0 +1,88 @@ +// +// MoNiShiPingHCCLDetailView.m +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "MoNiShiPingHCCLDetailView.h" +#import "WMPlayer.h" + +@interface MoNiShiPingHCCLDetailView () +@property (nonatomic , strong) WMPlayer *player; +@end +@implementation MoNiShiPingHCCLDetailView + +-(id)initWithFrame:(CGRect)frame +{ + if(self = [super initWithFrame:frame]) + { + [self setBackgroundColor:[UIColor blackColor]]; + + [self addSubview:self.player]; + [self.player mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.equalTo(self); + make.bottom.equalTo(self).offset(-TabHeight-60); + }]; + + UIButton *btback = [[UIButton alloc] init]; + [btback setImage:[UIImage imageNamed:@"返回白"] forState:UIControlStateNormal]; + [self addSubview:btback]; + [btback mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.offset(KMagrinTop); + make.height.offset(40); + make.left.offset(10); + make.width.offset(50); + }]; + [btback addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside]; + + float f_w = (UISCREEN_WIDTH-60)/3.0; + NSArray *arrt = @[@"重新录制",@"分享至微信",@"下载到相册"]; + for(int i = 0 ; i < arrt.count; i++) + { + UIButton *btitem = [[UIButton alloc] init]; + [btitem setTitle:arrt[i] forState:UIControlStateNormal]; + [btitem setTitleColor:RGBACOLOR(255, 255, 255, 0.5) forState:UIControlStateNormal]; + [btitem.titleLabel setFont:[UIFont systemFontOfSize:12]]; + [btitem setImage:[UIImage imageNamed:[NSString stringWithFormat:@"sphc_%@",arrt[i]]] forState:UIControlStateNormal]; + [self addSubview:btitem]; + [btitem mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(self).offset(-TabHeight+30); + make.left.offset(30+f_w*i); + make.width.offset(f_w); + make.height.offset(80); + }]; + [btitem setIconInTopWithSpacing:10]; + [btitem setTag:i]; + [btitem addTarget:self action:@selector(itemAction:) forControlEvents:UIControlEventTouchUpInside]; + } + + } + return self; +} +-(void)backAction +{ + [self.player pause]; + [self removeFromSuperview]; +} +-(void)itemAction:(UIButton *)sender +{ + +} + +-(WMPlayer *)player +{ + if(!_player) + { + NSString *strtemp = [[UserInfoModel shareModel].config objectForKey:@"client.course.playback"]; + WMPlayerModel *model = [[WMPlayerModel alloc] init]; + model.videoURL = [NSURL URLWithString:strtemp]; + + WMPlayer *player = [[WMPlayer alloc] initPlayerModel:model]; + _player = player; + } + return _player; +} + + +@end diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLView.h b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLView.h new file mode 100644 index 0000000..5da283c --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLView.h @@ -0,0 +1,16 @@ +// +// MoNiShiPingHCCLView.h +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MoNiShiPingHCCLView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLView.m b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLView.m new file mode 100644 index 0000000..55c7964 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/模拟视频/视频处理/view/MoNiShiPingHCCLView.m @@ -0,0 +1,168 @@ +// +// MoNiShiPingHCCLView.m +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "MoNiShiPingHCCLView.h" +#import "WMPlayer.h" +#import "MoNiShiPingHCCLDetailView.h" + + +@interface MoNiShiPingHCCLView () + +@property (nonatomic , strong) WMPlayer *player; +@end + +@implementation MoNiShiPingHCCLView + +-(id)initWithFrame:(CGRect)frame +{ + if(self = [super initWithFrame:frame]) + { + UIScrollView *scvback = [[UIScrollView alloc] init]; + [self addSubview:scvback]; + [scvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.offset(0); + make.width.equalTo(self); + make.height.equalTo(self); + }]; + + [scvback addSubview:self.player]; + [self.player mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.width.top.equalTo(scvback); + make.height.offset(200); + }]; + + UIView *viewex = [[UIView alloc] init]; + [viewex setBackgroundColor:RGBCOLOR(235, 235, 235)]; + [scvback addSubview:viewex]; + [viewex mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.offset(184); + make.left.offset(16); + make.top.equalTo(self.player.mas_bottom).offset(14); + make.right.equalTo(self.player).offset(-16); + }]; + [viewex.layer setMasksToBounds:YES]; + [viewex.layer setCornerRadius:6]; + [self drawexView:viewex]; + + UIButton *btly = [[UIButton alloc] init]; + [btly setBackgroundColor:[UIColor redColor]]; +// [btly setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal]; + [scvback addSubview:btly]; + [btly mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.offset(100); + make.centerX.equalTo(viewex); + make.top.equalTo(viewex.mas_bottom).offset(50); + }]; + [btly addTarget:self action:@selector(startAction) forControlEvents:UIControlEventTouchUpInside]; + + UILabel *lbstart = [[UILabel alloc] init]; + [lbstart setText:@"点击开始录音"]; + [lbstart setTextColor:RGBCOLOR(26, 26, 26)]; + [lbstart setTextAlignment:NSTextAlignmentCenter]; + [lbstart setFont:[UIFont systemFontOfSize:15]]; + [scvback addSubview:lbstart]; + [lbstart mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(btly.mas_bottom).offset(12); + make.centerX.equalTo(btly); + }]; + + UILabel *lbtstitle = [[UILabel alloc] init]; + [lbtstitle setText:@"温馨提示:"]; + [lbtstitle setTextColor:RGBCOLOR(102, 102, 102)]; + [lbtstitle setTextAlignment:NSTextAlignmentLeft]; + [lbtstitle setFont:[UIFont systemFontOfSize:14]]; + [scvback addSubview:lbtstitle]; + [lbtstitle mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(lbstart.mas_bottom).offset(50); + make.left.offset(65); + }]; + + UILabel *lbts = [[UILabel alloc] init]; + [lbts setText:@"1、点击后开始播放视频并且录音,请在恰当的环境录制拟真度更高;\n\n2、视频播放完会自动停止录音无需点击停止;\n\n3、完成后可浏览或者下载保存至本地相册;"]; + [lbts setTextColor:RGBCOLOR(153, 153, 153)]; + [lbts setTextAlignment:NSTextAlignmentLeft]; + [lbts setFont:[UIFont systemFontOfSize:12]]; + [lbts setNumberOfLines:0]; + [scvback addSubview:lbts]; + [lbts mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(lbtstitle); + make.top.equalTo(lbtstitle.mas_bottom).offset(10); + make.width.offset(UISCREEN_WIDTH-130); + }]; + + [scvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(lbts).offset(30); + }]; + } + return self; +} +-(void)drawexView:(UIView *)view +{ + NSArray *arrt = @[@"“在哪儿呀,兄弟”",@"“定位发我”",@"“马上到”",@"“马上到”",@"“马上到”"]; + for(int i =0; i < arrt.count; i++) + { + UILabel *lbitem = [[UILabel alloc] init]; + [lbitem setText:arrt[i]]; + [lbitem setTextColor:RGBCOLOR(2, 117, 248)]; + [lbitem setTextAlignment:NSTextAlignmentCenter]; + [lbitem setFont:[UIFont systemFontOfSize:14]]; + [view addSubview:lbitem]; + [lbitem mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.equalTo(view); + make.top.offset(156/5.0*i); + make.height.offset(156/5.0); + }]; + } + + UIView *viewback = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH-32, 156)]; + [viewback setBackgroundColor:[UIColor clearColor]]; + [view addSubview:viewback]; + [Tools changedView:viewback colors:@[(id)RGBACOLOR(242, 242, 242,1).CGColor,(id)RGBACOLOR(242, 242, 242,0).CGColor,(id)RGBACOLOR(242, 242, 242,1).CGColor] startPoint:CGPointMake(0, 0) endPoint:CGPointMake(0, 1)]; + + CAGradientLayer *layer = [CAGradientLayer layer]; + layer.startPoint = CGPointMake(0, 0); + layer.endPoint = CGPointMake(0, 1); + layer.colors = @[(id)RGBACOLOR(242, 242, 242,1).CGColor,(id)RGBACOLOR(242, 242, 242,0).CGColor,(id)RGBACOLOR(242, 242, 242,1).CGColor]; + layer.locations = @[@0.01f,@0.5f,@0.99f]; + layer.frame = viewback.layer.bounds; + [viewback.layer insertSublayer:layer atIndex:0]; + + + UILabel *lbck = [[UILabel alloc] init]; + [lbck setText:@"参考台词"]; + [lbck setTextColor:RGBCOLOR(102, 102, 102)]; + [lbck setTextAlignment:NSTextAlignmentCenter]; + [lbck setFont:[UIFont systemFontOfSize:12]]; + [lbck setBackgroundColor:RGBCOLOR(235, 235, 235)]; + [view addSubview:lbck]; + [lbck mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.equalTo(view); + make.height.offset(28.5); + }]; +} + +-(WMPlayer *)player +{ + if(!_player) + { + NSString *strtemp = [[UserInfoModel shareModel].config objectForKey:@"client.course.playback"]; + WMPlayerModel *model = [[WMPlayerModel alloc] init]; + model.videoURL = [NSURL URLWithString:strtemp]; + + WMPlayer *player = [[WMPlayer alloc] initPlayerModel:model]; + _player = player; + } + return _player; +} + +-(void)startAction +{ + MoNiShiPingHCCLDetailView *view = [[MoNiShiPingHCCLDetailView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + [[UIApplication sharedApplication].delegate.window addSubview:view]; +} + +@end diff --git a/ProductApp/ProductApp/ProductMain/首页/话术升阶器/HuaShuSJQViewController.h b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/HuaShuSJQViewController.h new file mode 100644 index 0000000..ee23cc6 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/HuaShuSJQViewController.h @@ -0,0 +1,16 @@ +// +// HuaShuSJQViewController.h +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "BaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface HuaShuSJQViewController : BaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/话术升阶器/HuaShuSJQViewController.m b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/HuaShuSJQViewController.m new file mode 100644 index 0000000..cb9626f --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/HuaShuSJQViewController.m @@ -0,0 +1,39 @@ +// +// HuaShuSJQViewController.m +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "HuaShuSJQViewController.h" +#import "HuaShuSJQView.h" + +@interface HuaShuSJQViewController () + +@end + +@implementation HuaShuSJQViewController +- (UIStatusBarStyle)preferredStatusBarStyle { + return UIStatusBarStyleDefault; +} +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [self.navigationController setNavigationBarHidden:YES animated:animated]; + [self showNaviGationView:YES]; + [self.navigationView setTitle:@"话术升阶器" titleColor:RGBCOLOR(60, 60, 60)]; + [self.navigationView setBackgroundColor:RGBCOLOR(242, 242, 242)]; +} +- (void)viewDidLoad { + [super viewDidLoad]; + [self.view setBackgroundColor:RGBCOLOR(242, 242, 242)]; + + HuaShuSJQView *view = [[HuaShuSJQView alloc] init]; + [self.view addSubview:view]; + [view mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.equalTo(self.view); + make.top.offset(NavHeight); + }]; +} + + +@end diff --git a/ProductApp/ProductApp/ProductMain/首页/话术升阶器/cell/HuaShuSJQCollectionViewCell.h b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/cell/HuaShuSJQCollectionViewCell.h new file mode 100644 index 0000000..f487340 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/cell/HuaShuSJQCollectionViewCell.h @@ -0,0 +1,17 @@ +// +// HuaShuSJQCollectionViewCell.h +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface HuaShuSJQCollectionViewCell : UICollectionViewCell +/// +@property (nonatomic , strong) baseInfoModel *model; +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/话术升阶器/cell/HuaShuSJQCollectionViewCell.m b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/cell/HuaShuSJQCollectionViewCell.m new file mode 100644 index 0000000..aa40c80 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/cell/HuaShuSJQCollectionViewCell.m @@ -0,0 +1,71 @@ +// +// HuaShuSJQCollectionViewCell.m +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "HuaShuSJQCollectionViewCell.h" + +@interface HuaShuSJQCollectionViewCell () +/// +@property (nonatomic , strong) UIImageView *imgvback; +/// +@property (nonatomic , strong) UILabel *lbname; +/// +@property (nonatomic , strong) UIImageView *imgvselect; + +@end + +@implementation HuaShuSJQCollectionViewCell +-(id)initWithFrame:(CGRect)frame +{ + if(self = [super initWithFrame:frame]) + { + UIView *viewback = [[UIView alloc] init]; + [viewback setBackgroundColor:[UIColor whiteColor]]; + [self.contentView addSubview:viewback]; + [viewback mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; + + UIImageView *imgvback = [[UIImageView alloc] init]; + [viewback addSubview:imgvback]; + [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(viewback); + }]; + [imgvback.layer setMasksToBounds:YES]; + [imgvback.layer setCornerRadius:9]; + _imgvback = imgvback; + + UILabel *lbname = [[UILabel alloc] init]; + [lbname setText:@""]; + [lbname setTextColor:[UIColor whiteColor]]; + [lbname setTextAlignment:NSTextAlignmentCenter]; + [lbname setFont:[UIFont fontWithName:@"AlimamaShuHeiTi-Bold" size:14]]; + [viewback addSubview:lbname]; + [lbname mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.equalTo(viewback); + make.left.right.equalTo(viewback); + }]; + _lbname = lbname; + + UIImageView *imgvselect = [[UIImageView alloc] init]; + [imgvselect setImage:[UIImage imageNamed:@"zz_wx_select"]]; + [viewback addSubview:imgvselect]; + [imgvselect mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.offset(20); + make.right.bottom.equalTo(viewback); + }]; + _imgvselect = imgvselect; + } + return self; +} +-(void)setModel:(baseInfoModel *)model +{ + _model = model; + self.lbname.text = model.title; + self.imgvselect.hidden = !model.select; + self.imgvback.image = [UIImage imageNamed:[NSString stringWithFormat:@"hssj_%@",model.title]]; +} +@end diff --git a/ProductApp/ProductApp/ProductMain/首页/话术升阶器/view/HuaShuSJQView.h b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/view/HuaShuSJQView.h new file mode 100644 index 0000000..b5b0ce1 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/view/HuaShuSJQView.h @@ -0,0 +1,16 @@ +// +// HuaShuSJQView.h +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface HuaShuSJQView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/话术升阶器/view/HuaShuSJQView.m b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/view/HuaShuSJQView.m new file mode 100644 index 0000000..a64ce2d --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/首页/话术升阶器/view/HuaShuSJQView.m @@ -0,0 +1,319 @@ +// +// HuaShuSJQView.m +// ProductApp +// +// Created by 工作 on 2025/4/14. +// + +#import "HuaShuSJQView.h" +#import "HuaShuSJQCollectionViewCell.h" +#import "FSTextView.h" + + + +@interface HuaShuSJQView () +/// +@property (nonatomic , strong) UICollectionView *collect; +/// +@property (nonatomic , strong) UIButton *btok; +/// +@property (nonatomic , strong) FSTextView *textView; + +/// +@property (nonatomic , strong) UIView *viewinfo; +/// +@property (nonatomic , strong) UILabel *lbinfo; + +/// +@property (nonatomic , strong) NSMutableArray *arrdata; + +@end + +@implementation HuaShuSJQView + +-(id)initWithFrame:(CGRect)frame +{ + if(self = [super initWithFrame:frame]) + { + UIScrollView *scvback = [[UIScrollView alloc] init]; + [self addSubview:scvback]; + [scvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.offset(0); + make.width.equalTo(self); + make.height.equalTo(self).offset(-NavHeight-20); + }]; + + UIView *viewfg = [[UIView alloc] init]; + [viewfg setBackgroundColor:[UIColor whiteColor]]; + [scvback addSubview:viewfg]; + [viewfg mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.width.equalTo(scvback); + make.height.offset(153); + }]; + [self drawFGView:viewfg]; + + UIView *viewhs = [[UIView alloc] init]; + [viewhs setBackgroundColor:[UIColor whiteColor]]; + [scvback addSubview:viewhs]; + [viewhs mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.width.equalTo(scvback); + make.top.equalTo(viewfg.mas_bottom); + make.height.offset(147); + }]; + [self drawHSView:viewhs]; + + UIView *viewinfo = [[UIView alloc] init]; + [viewinfo setBackgroundColor:[UIColor whiteColor]]; + [scvback addSubview:viewinfo]; + [viewinfo mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.width.equalTo(scvback); + make.top.equalTo(viewhs.mas_bottom).offset(12); + }]; + [viewinfo setHidden:YES]; + _viewinfo = viewinfo; + [self drawInfoView:viewinfo]; + + [scvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(viewinfo.mas_bottom).offset(20); + }]; + + UIView *viewbottom = [[UIView alloc] init]; + [viewbottom setBackgroundColor:[UIColor whiteColor]]; + [self addSubview:viewbottom]; + [viewbottom mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.equalTo(self); + make.height.offset(TabHeight+20); + }]; + [self drawBottomView:viewbottom]; + + [self getdata]; + } + return self; +} + +-(void)drawInfoView:(UIView *)view +{ + UILabel *lbname = [[UILabel alloc] init]; + [lbname setText:@"升阶话术"]; + [lbname setTextColor:RGBCOLOR(102, 102, 102)]; + [lbname setTextAlignment:NSTextAlignmentLeft]; + [lbname setFont:[UIFont systemFontOfSize:15]]; + [view addSubview:lbname]; + [lbname mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.offset(16); + }]; + + UIButton *btcopy = [[UIButton alloc] init]; + [btcopy setTitle:@"复制" forState:UIControlStateNormal]; + [btcopy setTitleColor:RGBCOLOR(153, 153, 153) forState:UIControlStateNormal]; + [btcopy.titleLabel setFont:[UIFont systemFontOfSize:12]]; + [btcopy setImage:[UIImage imageNamed:@"hssj_copy"] forState:UIControlStateNormal]; + [view addSubview:btcopy]; + [btcopy mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.equalTo(lbname); + make.right.equalTo(view).offset(-16); + make.height.offset(30); + make.width.offset(50); + }]; + [btcopy setIconInLeft]; + [btcopy addTarget:self action:@selector(copyinfoAction) forControlEvents:UIControlEventTouchUpInside]; + + UILabel *lbinfo = [[UILabel alloc] init]; + [lbinfo setText:@""]; + [lbinfo setTextColor:RGBCOLOR(26, 26, 26)]; + [lbinfo setTextAlignment:NSTextAlignmentLeft]; + [lbinfo setFont:[UIFont systemFontOfSize:15]]; + [lbinfo setNumberOfLines:0]; + [view addSubview:lbinfo]; + [lbinfo mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(16); + make.right.equalTo(view).offset(-16); + make.top.equalTo(lbname.mas_bottom).offset(10); + }]; + _lbinfo = lbinfo; + + [view mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(lbinfo).offset(20); + }]; +} + +-(void)drawBottomView:(UIView *)view +{ + UIButton *btok = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH-32, 46)]; + [btok setTitle:@"开始升阶" forState:UIControlStateNormal]; + [btok setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [btok.titleLabel setFont:[UIFont systemFontOfSize:15]]; + [btok.layer setMasksToBounds:YES]; + [btok.layer setCornerRadius:23]; + [view addSubview:btok]; + [btok mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(16); + make.top.offset(9); + make.right.equalTo(view).offset(-16); + make.height.offset(46); + }]; + [btok addTarget:self action:@selector(okAction) forControlEvents:UIControlEventTouchUpInside]; + [Tools changedView:btok colors:@[(id)RGBCOLOR(119, 140, 245).CGColor,(id)RGBCOLOR(166, 121, 244).CGColor] startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)]; + _btok = btok; +} + +-(void)drawHSView:(UIView *)view +{ + UILabel *lbname = [[UILabel alloc] init]; + [lbname setText:@"*日常话术"]; + [lbname setTextColor:RGBCOLOR(102, 102, 102)]; + [lbname setTextAlignment:NSTextAlignmentLeft]; + [lbname setFont:[UIFont systemFontOfSize:15]]; + [view addSubview:lbname]; + [lbname mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.offset(16); + }]; + lbname.attributedText = [Tools arrstring:lbname.text andstart:0 andend:1 andfont:[UIFont systemFontOfSize:15] andcolor:RGBCOLOR(255, 38, 38)]; + + FSTextView *textView = [[FSTextView alloc] init]; + [textView setTextColor:RGBCOLOR(26, 26, 26)]; + [textView setTextAlignment:NSTextAlignmentLeft]; + [textView setFont:[UIFont systemFontOfSize:15]]; + [textView setPlaceholder:@"请输入自己的日常话术"]; + [view addSubview:textView]; + [textView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(10); + make.top.equalTo(lbname.mas_bottom).offset(10); + make.right.equalTo(view).offset(-10); + make.height.offset(90); + }]; + [textView setMaxLength:500]; + _textView = textView; + + UILabel *lbnumber = [[UILabel alloc] init]; + [lbnumber setText:@"(0/500)"]; + [lbnumber setTextColor:RGBCOLOR(153, 153, 153)]; + [lbnumber setTextAlignment:NSTextAlignmentLeft]; + [lbnumber setFont:[UIFont systemFontOfSize:10]]; + [view addSubview:lbnumber]; + [lbnumber mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(lbname.mas_right); + make.centerY.equalTo(lbname); + }]; + [textView addTextDidChangeHandler:^(FSTextView *textView) { + [lbnumber setText:[NSString stringWithFormat:@"(%ld/500)",textView.text.length]]; + lbnumber.attributedText = [Tools arrstring:lbnumber.text andstart:1 andend:(int)lbnumber.text.length-6 andfont:[UIFont systemFontOfSize:10] andcolor:RGBCOLOR(51, 51, 51)]; + }]; + + +} +-(void)drawFGView:(UIView *)view +{ + UILabel *lbname = [[UILabel alloc] init]; + [lbname setText:@"*选择风格"]; + [lbname setTextColor:RGBCOLOR(102, 102, 102)]; + [lbname setTextAlignment:NSTextAlignmentLeft]; + [lbname setFont:[UIFont systemFontOfSize:15]]; + [view addSubview:lbname]; + [lbname mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.offset(16); + }]; + lbname.attributedText = [Tools arrstring:lbname.text andstart:0 andend:1 andfont:[UIFont systemFontOfSize:15] andcolor:RGBCOLOR(255, 38, 38)]; + + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 0; + layout.minimumInteritemSpacing = 0; + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + UICollectionView *collect = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; +// [collect setScrollEnabled:NO]; + [collect setDelegate:self]; + [collect setDataSource:self]; + [collect setBackgroundColor:[UIColor clearColor]]; + [view addSubview:collect]; + [collect mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(0); + make.right.equalTo(view).offset(0); + make.top.equalTo(lbname.mas_bottom).offset(12); + make.height.offset(88); + }]; + [collect setShowsHorizontalScrollIndicator:NO]; + [collect setTag:1]; + [collect registerClass:[HuaShuSJQCollectionViewCell class] forCellWithReuseIdentifier:@"HuaShuSJQCollectionViewCell"]; + _collect = collect; + + UIView *viewline = [[UIView alloc] init]; + [viewline setBackgroundColor:RGBCOLOR(238, 238, 238)]; + [view addSubview:viewline]; + [viewline mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(16); + make.right.equalTo(view).offset(-16); + make.bottom.equalTo(view); + make.height.offset(1); + }]; + +} + +-(void)getdata +{ + self.arrdata = [NSMutableArray new]; + NSArray *arrt = @[@"商业精英",@"学术权威",@"互联网黑话",@"文艺哲学",@"体制内风格",@"科技极客",@"金融投行"]; + for(NSString *str in arrt) + { + baseInfoModel *model = [baseInfoModel new]; + model.title = str; + [self.arrdata addObject:model]; + if(self.arrdata.count==1) + { + model.select = YES; + } + } +} +-(void)okAction +{ + [self.viewinfo setHidden:NO]; + self.lbinfo.text = @"我投身于资源循环利用领域,专注于废品回收业务。目前,日常运营的日收益稳定在50左右,部分时段凭借精准的市场洞察和高效的业务执行,能将日营收提升至70。"; + [self.btok setTitle:@"重新升阶" forState:UIControlStateNormal]; + +} +-(void)copyinfoAction +{ + UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; + pasteboard.string = self.lbinfo.text; + [HXHud showMessage:@"复制成功" afterDelayType:0]; +} +#pragma mark - UICollectionView +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section +{ + return self.arrdata.count; +} +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath +{ + HuaShuSJQCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HuaShuSJQCollectionViewCell" forIndexPath:indexPath]; + cell.model = self.arrdata[indexPath.row]; + return cell; +} +//定义每个section的间距 +- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{ + + return UIEdgeInsetsMake(0, 16, 0, 0); +} +//纵向cell间距 +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{ + return 10; +} +//cell 间距 +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout ForSectionAtIndex:(NSInteger)section{ + return 10; +} +// 定义每个UICollectionViewCell 的大小 +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath +{ + return CGSizeMake(88, 88); +} +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath +{ + for(baseInfoModel *model in self.arrdata) + { + model.select = NO; + } + baseInfoModel *model = self.arrdata[indexPath.row]; + model.select = YES; + [self.collect reloadData]; +} + +@end