From 69c7c256d8475191cb24fe417e375024c5429b35 Mon Sep 17 00:00:00 2001 From: 葛建军 Date: Wed, 17 May 2017 17:22:14 +0800 Subject: [PATCH] no message --- YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj | 258 ++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate | Bin 39096 -> 0 bytes YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.h | 21 --------------------- YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.m | 733 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.xib | 325 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/Aliv/CustomScrollView.swift | 150 ------------------------------------------------------------------------------------------------------------------------------------------------------ YouerLiveVideo/YouerLiveVideo/Aliv/LiveVideoViewController.swift | 56 -------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/Aliv/MessageTableViewCell.swift | 27 --------------------------- YouerLiveVideo/YouerLiveVideo/Aliv/MessageTableViewCell.xib | 52 ---------------------------------------------------- YouerLiveVideo/YouerLiveVideo/AliveVideoPlayer/AlivcInforViewController.swift | 150 ------------------------------------------------------------------------------------------------------------------------------------------------------ YouerLiveVideo/YouerLiveVideo/AliveVideoPlayer/MoivePlayerViewController.swift | 966 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ YouerLiveVideo/YouerLiveVideo/AppDelegate.swift | 2 +- YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard | 711 ++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/YouerLiveVideo-Bridging-Header.h | 1 - YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/AttentionTableViewCell.swift | 59 ----------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/AttentionTableViewCell.xib | 99 --------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/HomeTableViewCell.swift | 79 ------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/HomeTableViewCell.xib | 205 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/LiveTitleView.swift | 105 --------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/LiveTitleView.xib | 76 ---------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/liveTitleCollectionCell.swift | 22 ---------------------- YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/liveTitleCollectionCell.xib | 55 ------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/HomeDetailViewController.swift | 308 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/HomeViewController.swift | 35 ----------------------------------- YouerLiveVideo/YouerLiveVideo/controller/HotMoreViewController.swift | 114 ------------------------------------------------------------------------------------------------------------------ YouerLiveVideo/YouerLiveVideo/controller/Live/Live.storyboard | 2074 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/Live/LiveVideoSettingShareViewController.swift | 216 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ YouerLiveVideo/YouerLiveVideo/controller/Live/LiveVideoSettingViewController.swift | 436 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/Live/PassWordView.swift | 61 ------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/Live/PassWordView.xib | 36 ------------------------------------ YouerLiveVideo/YouerLiveVideo/controller/LiveRoomDetailViewController.swift | 57 --------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/LiveTypeListViewController.swift | 135 --------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/MainViewController.swift | 94 ---------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/MoreViewController.swift | 69 --------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/MyViewController.swift | 87 --------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LiveListViewController.swift | 220 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LiveRoomsViewController.swift | 259 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LoginViewController.swift | 145 ------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/UserCenter/MyAttentionViewController.swift | 67 ------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/UserCenter/PersonalSettingViewController.swift | 238 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/UserCenter/RegisterViewController.swift | 173 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controller/UserCenter/User.storyboard | 1490 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controllers/NavigationViewController.swift | 75 --------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/LoginViewController.swift | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/PersonalSettingViewController.swift | 238 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard | 1490 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ YouerLiveVideo/YouerLiveVideo/util/ClassModel.swift | 129 --------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/util/PassWordView.swift | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ YouerLiveVideo/YouerLiveVideo/util/PassWordView.xib | 36 ++++++++++++++++++++++++++++++++++++ YouerLiveVideo/YouerLiveVideo/util/network.swift | 122 ++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/util/utiles.swift | 11 ----------- 52 files changed, 2224 insertions(+), 10722 deletions(-) delete mode 100644 YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.h delete mode 100644 YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.m delete mode 100644 YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.xib delete mode 100644 YouerLiveVideo/YouerLiveVideo/Aliv/CustomScrollView.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/Aliv/LiveVideoViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/Aliv/MessageTableViewCell.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/Aliv/MessageTableViewCell.xib delete mode 100644 YouerLiveVideo/YouerLiveVideo/AliveVideoPlayer/AlivcInforViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/AliveVideoPlayer/MoivePlayerViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/AttentionTableViewCell.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/AttentionTableViewCell.xib delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/HomeTableViewCell.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/HomeTableViewCell.xib delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/LiveTitleView.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/LiveTitleView.xib delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/liveTitleCollectionCell.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/liveTitleCollectionCell.xib delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HomeDetailViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HomeViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/HotMoreViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/Live/Live.storyboard delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/Live/LiveVideoSettingShareViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/Live/LiveVideoSettingViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/Live/PassWordView.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/Live/PassWordView.xib delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/LiveRoomDetailViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/LiveTypeListViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/MainViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/MoreViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/MyViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LiveListViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LiveRoomsViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LoginViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/UserCenter/MyAttentionViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/UserCenter/PersonalSettingViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/UserCenter/RegisterViewController.swift delete mode 100644 YouerLiveVideo/YouerLiveVideo/controller/UserCenter/User.storyboard delete mode 100644 YouerLiveVideo/YouerLiveVideo/controllers/NavigationViewController.swift create mode 100644 YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/LoginViewController.swift create mode 100644 YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/PersonalSettingViewController.swift create mode 100644 YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift create mode 100644 YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard delete mode 100644 YouerLiveVideo/YouerLiveVideo/util/ClassModel.swift create mode 100644 YouerLiveVideo/YouerLiveVideo/util/PassWordView.swift create mode 100644 YouerLiveVideo/YouerLiveVideo/util/PassWordView.xib diff --git a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj index ce1f391..099f01e 100644 --- a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj +++ b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj @@ -14,12 +14,8 @@ 5904FC511ECA8B8C00E631FF /* TVStationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5904FC4B1ECA8B8C00E631FF /* TVStationViewController.swift */; }; 5904FC531ECA8BB500E631FF /* MicroCourse.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5904FC521ECA8BB500E631FF /* MicroCourse.storyboard */; }; 5904FC551ECA8BCB00E631FF /* HomePage.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5904FC541ECA8BCB00E631FF /* HomePage.storyboard */; }; - 5904FC591ECA8C0000E631FF /* UserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5904FC581ECA8C0000E631FF /* UserViewController.swift */; }; - 5904FC5B1ECA8C0900E631FF /* User.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5904FC5A1ECA8C0900E631FF /* User.storyboard */; }; 5904FC5D1ECA8ED400E631FF /* HomePageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5904FC5C1ECA8ED400E631FF /* HomePageViewController.swift */; }; 5904FC611ECA930D00E631FF /* MViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5904FC601ECA930D00E631FF /* MViewController.swift */; }; - 5906A0741E349FA500D2D814 /* PassWordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5906A0731E349FA500D2D814 /* PassWordView.swift */; }; - 5906A0761E349FB400D2D814 /* PassWordView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5906A0751E349FB400D2D814 /* PassWordView.xib */; }; 5960263B1DD94D3100C6B5E8 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5960263A1DD94D3100C6B5E8 /* libsqlite3.tbd */; }; 5960263D1DD94D5E00C6B5E8 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5960263C1DD94D5E00C6B5E8 /* libc++.tbd */; }; 5960263F1DD94D7D00C6B5E8 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5960263E1DD94D7D00C6B5E8 /* ImageIO.framework */; }; @@ -29,7 +25,6 @@ 596026501DDD469200C6B5E8 /* RiverRunCommentManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5960264C1DDD469200C6B5E8 /* RiverRunCommentManager.m */; }; 596026511DDD469200C6B5E8 /* RiverRunCommentUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 5960264E1DDD469200C6B5E8 /* RiverRunCommentUtil.m */; }; 597185B51ECA990C00D7F478 /* Resource.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 597185B41ECA990C00D7F478 /* Resource.storyboard */; }; - 59893BDF1E2C53E1004E7F81 /* AlivcInforViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59893BDE1E2C53E1004E7F81 /* AlivcInforViewController.swift */; }; 598A0E531E51941300273AB8 /* libNIMSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 598A0E4D1E51941300273AB8 /* libNIMSDK.a */; }; 598A0E541E51941300273AB8 /* libaacplus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 598A0E4F1E51941300273AB8 /* libaacplus.a */; }; 598A0E551E51941300273AB8 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 598A0E501E51941300273AB8 /* libcrypto.a */; }; @@ -52,10 +47,8 @@ 599B2CE11DE52F7E00B4F7FD /* UMShareMenuSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 599B2CCE1DE52F7E00B4F7FD /* UMShareMenuSelectionView.m */; }; 599B2CE21DE52F7E00B4F7FD /* UMSocialShareScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 599B2CD01DE52F7E00B4F7FD /* UMSocialShareScrollView.m */; }; 599B2CE31DE52F7E00B4F7FD /* UMSocialUIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 599B2CD21DE52F7E00B4F7FD /* UMSocialUIManager.m */; }; - 59A8731C1DDD9E0600BAC7FC /* CustomScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59A8731B1DDD9E0500BAC7FC /* CustomScrollView.swift */; }; 59BA13251E25CF2B00540DE0 /* AliyunPlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59BA13241E25CF2B00540DE0 /* AliyunPlayerSDK.framework */; }; 59BA13271E25CF4B00540DE0 /* AliyunPlayerSDK.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 59BA13241E25CF2B00540DE0 /* AliyunPlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 59BA132D1E25D14F00540DE0 /* MoivePlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59BA132C1E25D14F00540DE0 /* MoivePlayerViewController.swift */; }; 59BA13311E25D1C000540DE0 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 59BA13301E25D1C000540DE0 /* Reachability.m */; }; 59BA13451E25D8DB00540DE0 /* movieBackward.png in Resources */ = {isa = PBXBuildFile; fileRef = 59BA13321E25D8DB00540DE0 /* movieBackward.png */; }; 59BA13471E25D8DB00540DE0 /* movieBackwardSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 59BA13341E25D8DB00540DE0 /* movieBackwardSelected.png */; }; @@ -67,7 +60,6 @@ 59BA13571E25D8DB00540DE0 /* video_num_front@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 59BA13441E25D8DB00540DE0 /* video_num_front@2x.png */; }; 59C25B491ECAD643009FF276 /* MoreTVStationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59C25B481ECAD643009FF276 /* MoreTVStationViewController.swift */; }; 59C25B4B1ECAD84C009FF276 /* TVStationInforViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59C25B4A1ECAD84C009FF276 /* TVStationInforViewController.swift */; }; - 59C25B4D1ECAFAFC009FF276 /* NavigationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59C25B4C1ECAFAFC009FF276 /* NavigationViewController.swift */; }; 59DB1C781E792E5900EA2FC4 /* 开始直播.png in Resources */ = {isa = PBXBuildFile; fileRef = 59DB1C771E792E5900EA2FC4 /* 开始直播.png */; }; 59DB1C7A1E793DA700EA2FC4 /* 标签.png in Resources */ = {isa = PBXBuildFile; fileRef = 59DB1C791E793DA700EA2FC4 /* 标签.png */; }; 59DB1C7C1E793E0E00EA2FC4 /* 视窗.png in Resources */ = {isa = PBXBuildFile; fileRef = 59DB1C7B1E793E0E00EA2FC4 /* 视窗.png */; }; @@ -84,11 +76,6 @@ 59F8016E1DD2E5F1000A78B0 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59F8016D1DD2E5F1000A78B0 /* SystemConfiguration.framework */; }; 59F801701DD2E5FB000A78B0 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59F8016F1DD2E5FB000A78B0 /* CoreTelephony.framework */; }; 59F801851DD45EDC000A78B0 /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59F801841DD45EDC000A78B0 /* Photos.framework */; }; - 59F801971DD567C7000A78B0 /* AlivcLiveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59F801941DD567C7000A78B0 /* AlivcLiveViewController.m */; }; - 59F801981DD567C7000A78B0 /* AlivcLiveViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 59F801951DD567C7000A78B0 /* AlivcLiveViewController.xib */; }; - 59F801991DD567C7000A78B0 /* LiveVideoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59F801961DD567C7000A78B0 /* LiveVideoViewController.swift */; }; - 59F801A21DD567D8000A78B0 /* MyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59F8019B1DD567D8000A78B0 /* MyViewController.swift */; }; - 59F801A61DD567D8000A78B0 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59F8019F1DD567D8000A78B0 /* MainViewController.swift */; }; 59F801AB1DD57253000A78B0 /* ZSDSetPasswordView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59F801AA1DD57253000A78B0 /* ZSDSetPasswordView.m */; }; BF25DFE21DDAA36A003EC0C1 /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF25DFA01DDAA36A003EC0C1 /* AFError.swift */; }; BF25DFE31DDAA36A003EC0C1 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF25DFA21DDAA36A003EC0C1 /* Alamofire.swift */; }; @@ -149,8 +136,6 @@ BF6977971E2DEC98006FA934 /* loginBackGround.png in Resources */ = {isa = PBXBuildFile; fileRef = BF6977941E2DEC98006FA934 /* loginBackGround.png */; }; BF6977981E2DEC98006FA934 /* userId.png in Resources */ = {isa = PBXBuildFile; fileRef = BF6977951E2DEC98006FA934 /* userId.png */; }; BF6977991E2DEC98006FA934 /* userPassword.png in Resources */ = {isa = PBXBuildFile; fileRef = BF6977961E2DEC98006FA934 /* userPassword.png */; }; - BF69779B1E2DEFCF006FA934 /* LiveListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF69779A1E2DEFCF006FA934 /* LiveListViewController.swift */; }; - BF7B271E1E2F022E00BCF13D /* MyAttentionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7B271D1E2F022E00BCF13D /* MyAttentionViewController.swift */; }; BF7B75961E305A6D0011D5C7 /* MJRefreshAutoFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B756A1E305A6D0011D5C7 /* MJRefreshAutoFooter.m */; }; BF7B75971E305A6D0011D5C7 /* MJRefreshBackFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B756C1E305A6D0011D5C7 /* MJRefreshBackFooter.m */; }; BF7B75981E305A6D0011D5C7 /* MJRefreshComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B756E1E305A6D0011D5C7 /* MJRefreshComponent.m */; }; @@ -171,42 +156,25 @@ BF7B75A71E305A6D0011D5C7 /* UIScrollView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B75911E305A6D0011D5C7 /* UIScrollView+MJExtension.m */; }; BF7B75A81E305A6D0011D5C7 /* UIScrollView+MJRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B75931E305A6D0011D5C7 /* UIScrollView+MJRefresh.m */; }; BF7B75A91E305A6D0011D5C7 /* UIView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B75951E305A6D0011D5C7 /* UIView+MJExtension.m */; }; - BF7B75AE1E309F230011D5C7 /* AttentionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7B75AC1E309F230011D5C7 /* AttentionTableViewCell.swift */; }; - BF7B75AF1E309F230011D5C7 /* AttentionTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BF7B75AD1E309F230011D5C7 /* AttentionTableViewCell.xib */; }; - BF7B75B11E31E3200011D5C7 /* LiveTypeListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7B75B01E31E3200011D5C7 /* LiveTypeListViewController.swift */; }; - BF8A4C551DE02CE300F99896 /* MessageTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF8A4C531DE02CE300F99896 /* MessageTableViewCell.swift */; }; - BF8A4C561DE02CE300F99896 /* MessageTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BF8A4C541DE02CE300F99896 /* MessageTableViewCell.xib */; }; - BF9D41251E29C17100719535 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF9D41241E29C17100719535 /* HomeViewController.swift */; }; - BF9D41271E29C20500719535 /* HomeDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF9D41261E29C20500719535 /* HomeDetailViewController.swift */; }; - BFB716B51E28AF4E00C5C516 /* LiveVideoSettingShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB716B31E28AF4E00C5C516 /* LiveVideoSettingShareViewController.swift */; }; - BFB716B61E28AF4E00C5C516 /* LiveVideoSettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB716B41E28AF4E00C5C516 /* LiveVideoSettingViewController.swift */; }; - BFB716C11E28AF8B00C5C516 /* Live.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFB716C01E28AF8B00C5C516 /* Live.storyboard */; }; - BFB716C81E28B5F200C5C516 /* LiveRoomsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB716C31E28B5F200C5C516 /* LiveRoomsViewController.swift */; }; - BFB716C91E28B5F200C5C516 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB716C41E28B5F200C5C516 /* LoginViewController.swift */; }; - BFB716CA1E28B5F200C5C516 /* PersonalSettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB716C51E28B5F200C5C516 /* PersonalSettingViewController.swift */; }; - BFB716CB1E28B5F200C5C516 /* RegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB716C61E28B5F200C5C516 /* RegisterViewController.swift */; }; - BFB716CC1E28B5F200C5C516 /* User.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFB716C71E28B5F200C5C516 /* User.storyboard */; }; BFBB83A91ECAE35E008B404B /* LeadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83A81ECAE35E008B404B /* LeadViewController.swift */; }; BFBB83D11ECBEB4E008B404B /* JYScrollItem.m in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83CC1ECBEB4E008B404B /* JYScrollItem.m */; }; BFBB83D21ECBEB4E008B404B /* JYScrollItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83CE1ECBEB4E008B404B /* JYScrollItemModel.m */; }; BFBB83D31ECBEB4E008B404B /* JYScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83D01ECBEB4E008B404B /* JYScrollView.m */; }; + BFBB83D61ECC4446008B404B /* PassWordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83D41ECC4446008B404B /* PassWordView.swift */; }; + BFBB83D71ECC4446008B404B /* PassWordView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BFBB83D51ECC4446008B404B /* PassWordView.xib */; }; + BFBB83E31ECC445D008B404B /* User.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFBB83D91ECC445D008B404B /* User.storyboard */; }; + BFBB83E61ECC445D008B404B /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83DD1ECC445D008B404B /* LoginViewController.swift */; }; + BFBB83E81ECC445D008B404B /* PersonalSettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83DF1ECC445D008B404B /* PersonalSettingViewController.swift */; }; + BFBB83E91ECC445D008B404B /* RegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83E01ECC445D008B404B /* RegisterViewController.swift */; }; + BFBB83EA1ECC445D008B404B /* User.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFBB83E11ECC445D008B404B /* User.storyboard */; }; + BFBB83EB1ECC445D008B404B /* UserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83E21ECC445D008B404B /* UserViewController.swift */; }; BFC076781E3445F3008BAC79 /* DownLoad.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFC076771E3445F3008BAC79 /* DownLoad.swift */; }; - BFD1CB4C1E2C657B009D8A42 /* HomeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFD1CB461E2C657B009D8A42 /* HomeTableViewCell.swift */; }; - BFD1CB4D1E2C657B009D8A42 /* HomeTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BFD1CB471E2C657B009D8A42 /* HomeTableViewCell.xib */; }; - BFD1CB4E1E2C657B009D8A42 /* liveTitleCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFD1CB481E2C657B009D8A42 /* liveTitleCollectionCell.swift */; }; - BFD1CB4F1E2C657B009D8A42 /* liveTitleCollectionCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BFD1CB491E2C657B009D8A42 /* liveTitleCollectionCell.xib */; }; - BFD1CB501E2C657B009D8A42 /* LiveTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFD1CB4A1E2C657B009D8A42 /* LiveTitleView.swift */; }; - BFD1CB511E2C657B009D8A42 /* LiveTitleView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BFD1CB4B1E2C657B009D8A42 /* LiveTitleView.xib */; }; - BFD1CB531E2C66FA009D8A42 /* MoreViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFD1CB521E2C66FA009D8A42 /* MoreViewController.swift */; }; - BFD1CB551E2CA527009D8A42 /* HotMoreViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFD1CB541E2CA527009D8A42 /* HotMoreViewController.swift */; }; BFDA8F331DDE88ED00F0C4E4 /* XSTLiveManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDA8F321DDE88ED00F0C4E4 /* XSTLiveManager.swift */; }; BFDFDEB01DD55B710040F102 /* AlivcLiveVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFDFDEAF1DD55B710040F102 /* AlivcLiveVideo.framework */; }; BFDFDEC11DD55BC90040F102 /* UIView+Toast.m in Sources */ = {isa = PBXBuildFile; fileRef = BFDFDEBB1DD55BC90040F102 /* UIView+Toast.m */; }; BFDFDED01DD55C0D0040F102 /* account.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDFDEC81DD55C0D0040F102 /* account.swift */; }; - BFDFDED11DD55C0D0040F102 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDFDEC91DD55C0D0040F102 /* ClassModel.swift */; }; BFDFDED21DD55C0D0040F102 /* network.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDFDECA1DD55C0D0040F102 /* network.swift */; }; BFDFDED31DD55C0D0040F102 /* utiles.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDFDECB1DD55C0D0040F102 /* utiles.swift */; }; - BFDFDF091DD56C430040F102 /* LiveRoomDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDFDF081DD56C430040F102 /* LiveRoomDetailViewController.swift */; }; BFF5F4711DD5AA5C00D33B89 /* attach_file.png in Resources */ = {isa = PBXBuildFile; fileRef = BFF5F45B1DD5AA5C00D33B89 /* attach_file.png */; }; BFF5F4721DD5AA5C00D33B89 /* defphoto.png in Resources */ = {isa = PBXBuildFile; fileRef = BFF5F45C1DD5AA5C00D33B89 /* defphoto.png */; }; BFF5F4751DD5AA5C00D33B89 /* left.png in Resources */ = {isa = PBXBuildFile; fileRef = BFF5F45F1DD5AA5C00D33B89 /* left.png */; }; @@ -250,12 +218,8 @@ 5904FC4B1ECA8B8C00E631FF /* TVStationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TVStationViewController.swift; sourceTree = ""; }; 5904FC521ECA8BB500E631FF /* MicroCourse.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MicroCourse.storyboard; sourceTree = ""; }; 5904FC541ECA8BCB00E631FF /* HomePage.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = HomePage.storyboard; sourceTree = ""; }; - 5904FC581ECA8C0000E631FF /* UserViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserViewController.swift; sourceTree = ""; }; - 5904FC5A1ECA8C0900E631FF /* User.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = User.storyboard; sourceTree = ""; }; 5904FC5C1ECA8ED400E631FF /* HomePageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomePageViewController.swift; sourceTree = ""; }; 5904FC601ECA930D00E631FF /* MViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MViewController.swift; sourceTree = ""; }; - 5906A0731E349FA500D2D814 /* PassWordView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PassWordView.swift; path = ../controller/Live/PassWordView.swift; sourceTree = ""; }; - 5906A0751E349FB400D2D814 /* PassWordView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = PassWordView.xib; path = ../controller/Live/PassWordView.xib; sourceTree = ""; }; 5960263A1DD94D3100C6B5E8 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; 5960263C1DD94D5E00C6B5E8 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; 5960263E1DD94D7D00C6B5E8 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; @@ -268,7 +232,6 @@ 5960264D1DDD469200C6B5E8 /* RiverRunCommentUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RiverRunCommentUtil.h; sourceTree = ""; }; 5960264E1DDD469200C6B5E8 /* RiverRunCommentUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RiverRunCommentUtil.m; sourceTree = ""; }; 597185B41ECA990C00D7F478 /* Resource.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Resource.storyboard; sourceTree = ""; }; - 59893BDE1E2C53E1004E7F81 /* AlivcInforViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlivcInforViewController.swift; sourceTree = ""; }; 598A0E121E51941300273AB8 /* NIMChatroom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NIMChatroom.h; sourceTree = ""; }; 598A0E131E51941300273AB8 /* NIMChatroomEnterRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NIMChatroomEnterRequest.h; sourceTree = ""; }; 598A0E141E51941300273AB8 /* NIMChatroomMember.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NIMChatroomMember.h; sourceTree = ""; }; @@ -367,9 +330,7 @@ 599B2CD01DE52F7E00B4F7FD /* UMSocialShareScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UMSocialShareScrollView.m; sourceTree = ""; }; 599B2CD11DE52F7E00B4F7FD /* UMSocialUIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UMSocialUIManager.h; sourceTree = ""; }; 599B2CD21DE52F7E00B4F7FD /* UMSocialUIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UMSocialUIManager.m; sourceTree = ""; }; - 59A8731B1DDD9E0500BAC7FC /* CustomScrollView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomScrollView.swift; sourceTree = ""; }; 59BA13241E25CF2B00540DE0 /* AliyunPlayerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AliyunPlayerSDK.framework; path = YouerLiveVideo/lib/AliyunPlayerSDK.framework; sourceTree = ""; }; - 59BA132C1E25D14F00540DE0 /* MoivePlayerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoivePlayerViewController.swift; sourceTree = ""; }; 59BA132F1E25D1C000540DE0 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = ""; }; 59BA13301E25D1C000540DE0 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = ""; }; 59BA13321E25D8DB00540DE0 /* movieBackward.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = movieBackward.png; sourceTree = ""; }; @@ -382,7 +343,6 @@ 59BA13441E25D8DB00540DE0 /* video_num_front@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "video_num_front@2x.png"; sourceTree = ""; }; 59C25B481ECAD643009FF276 /* MoreTVStationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoreTVStationViewController.swift; sourceTree = ""; }; 59C25B4A1ECAD84C009FF276 /* TVStationInforViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TVStationInforViewController.swift; sourceTree = ""; }; - 59C25B4C1ECAFAFC009FF276 /* NavigationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationViewController.swift; sourceTree = ""; }; 59DB1C771E792E5900EA2FC4 /* 开始直播.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "开始直播.png"; sourceTree = ""; }; 59DB1C791E793DA700EA2FC4 /* 标签.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "标签.png"; sourceTree = ""; }; 59DB1C7B1E793E0E00EA2FC4 /* 视窗.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "视窗.png"; sourceTree = ""; }; @@ -402,12 +362,6 @@ 59F8016F1DD2E5FB000A78B0 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; 59F801721DD2E6B9000A78B0 /* YouerLiveVideo-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YouerLiveVideo-Bridging-Header.h"; sourceTree = ""; }; 59F801841DD45EDC000A78B0 /* Photos.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Photos.framework; path = System/Library/Frameworks/Photos.framework; sourceTree = SDKROOT; }; - 59F801931DD567C7000A78B0 /* AlivcLiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlivcLiveViewController.h; sourceTree = ""; }; - 59F801941DD567C7000A78B0 /* AlivcLiveViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlivcLiveViewController.m; sourceTree = ""; }; - 59F801951DD567C7000A78B0 /* AlivcLiveViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AlivcLiveViewController.xib; sourceTree = ""; }; - 59F801961DD567C7000A78B0 /* LiveVideoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveVideoViewController.swift; sourceTree = ""; }; - 59F8019B1DD567D8000A78B0 /* MyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyViewController.swift; sourceTree = ""; }; - 59F8019F1DD567D8000A78B0 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; 59F801A91DD57253000A78B0 /* ZSDSetPasswordView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZSDSetPasswordView.h; sourceTree = ""; }; 59F801AA1DD57253000A78B0 /* ZSDSetPasswordView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZSDSetPasswordView.m; sourceTree = ""; }; BF25DFA01DDAA36A003EC0C1 /* AFError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AFError.swift; sourceTree = ""; }; @@ -497,8 +451,6 @@ BF6977941E2DEC98006FA934 /* loginBackGround.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = loginBackGround.png; sourceTree = ""; }; BF6977951E2DEC98006FA934 /* userId.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = userId.png; sourceTree = ""; }; BF6977961E2DEC98006FA934 /* userPassword.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = userPassword.png; sourceTree = ""; }; - BF69779A1E2DEFCF006FA934 /* LiveListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveListViewController.swift; sourceTree = ""; }; - BF7B271D1E2F022E00BCF13D /* MyAttentionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyAttentionViewController.swift; sourceTree = ""; }; BF7B75691E305A6D0011D5C7 /* MJRefreshAutoFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshAutoFooter.h; sourceTree = ""; }; BF7B756A1E305A6D0011D5C7 /* MJRefreshAutoFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshAutoFooter.m; sourceTree = ""; }; BF7B756B1E305A6D0011D5C7 /* MJRefreshBackFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshBackFooter.h; sourceTree = ""; }; @@ -539,21 +491,6 @@ BF7B75931E305A6D0011D5C7 /* UIScrollView+MJRefresh.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+MJRefresh.m"; sourceTree = ""; }; BF7B75941E305A6D0011D5C7 /* UIView+MJExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+MJExtension.h"; sourceTree = ""; }; BF7B75951E305A6D0011D5C7 /* UIView+MJExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+MJExtension.m"; sourceTree = ""; }; - BF7B75AC1E309F230011D5C7 /* AttentionTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttentionTableViewCell.swift; sourceTree = ""; }; - BF7B75AD1E309F230011D5C7 /* AttentionTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AttentionTableViewCell.xib; sourceTree = ""; }; - BF7B75B01E31E3200011D5C7 /* LiveTypeListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveTypeListViewController.swift; sourceTree = ""; }; - BF8A4C531DE02CE300F99896 /* MessageTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessageTableViewCell.swift; sourceTree = ""; }; - BF8A4C541DE02CE300F99896 /* MessageTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MessageTableViewCell.xib; sourceTree = ""; }; - BF9D41241E29C17100719535 /* HomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; - BF9D41261E29C20500719535 /* HomeDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeDetailViewController.swift; sourceTree = ""; }; - BFB716B31E28AF4E00C5C516 /* LiveVideoSettingShareViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveVideoSettingShareViewController.swift; sourceTree = ""; }; - BFB716B41E28AF4E00C5C516 /* LiveVideoSettingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveVideoSettingViewController.swift; sourceTree = ""; }; - BFB716C01E28AF8B00C5C516 /* Live.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Live.storyboard; sourceTree = ""; }; - BFB716C31E28B5F200C5C516 /* LiveRoomsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveRoomsViewController.swift; sourceTree = ""; }; - BFB716C41E28B5F200C5C516 /* LoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; - BFB716C51E28B5F200C5C516 /* PersonalSettingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonalSettingViewController.swift; sourceTree = ""; }; - BFB716C61E28B5F200C5C516 /* RegisterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegisterViewController.swift; sourceTree = ""; }; - BFB716C71E28B5F200C5C516 /* User.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = User.storyboard; sourceTree = ""; }; BFBB83A81ECAE35E008B404B /* LeadViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LeadViewController.swift; sourceTree = ""; }; BFBB83CB1ECBEB4E008B404B /* JYScrollItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JYScrollItem.h; sourceTree = ""; }; BFBB83CC1ECBEB4E008B404B /* JYScrollItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JYScrollItem.m; sourceTree = ""; }; @@ -561,24 +498,22 @@ BFBB83CE1ECBEB4E008B404B /* JYScrollItemModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JYScrollItemModel.m; sourceTree = ""; }; BFBB83CF1ECBEB4E008B404B /* JYScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JYScrollView.h; sourceTree = ""; }; BFBB83D01ECBEB4E008B404B /* JYScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JYScrollView.m; sourceTree = ""; }; + BFBB83D41ECC4446008B404B /* PassWordView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PassWordView.swift; sourceTree = ""; }; + BFBB83D51ECC4446008B404B /* PassWordView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PassWordView.xib; sourceTree = ""; }; + BFBB83D91ECC445D008B404B /* User.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = User.storyboard; sourceTree = ""; }; + BFBB83DD1ECC445D008B404B /* LoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; + BFBB83DF1ECC445D008B404B /* PersonalSettingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonalSettingViewController.swift; sourceTree = ""; }; + BFBB83E01ECC445D008B404B /* RegisterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegisterViewController.swift; sourceTree = ""; }; + BFBB83E11ECC445D008B404B /* User.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = User.storyboard; sourceTree = ""; }; + BFBB83E21ECC445D008B404B /* UserViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserViewController.swift; sourceTree = ""; }; BFC076771E3445F3008BAC79 /* DownLoad.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownLoad.swift; sourceTree = ""; }; - BFD1CB461E2C657B009D8A42 /* HomeTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeTableViewCell.swift; sourceTree = ""; }; - BFD1CB471E2C657B009D8A42 /* HomeTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeTableViewCell.xib; sourceTree = ""; }; - BFD1CB481E2C657B009D8A42 /* liveTitleCollectionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = liveTitleCollectionCell.swift; sourceTree = ""; }; - BFD1CB491E2C657B009D8A42 /* liveTitleCollectionCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = liveTitleCollectionCell.xib; sourceTree = ""; }; - BFD1CB4A1E2C657B009D8A42 /* LiveTitleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveTitleView.swift; sourceTree = ""; }; - BFD1CB4B1E2C657B009D8A42 /* LiveTitleView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LiveTitleView.xib; sourceTree = ""; }; - BFD1CB521E2C66FA009D8A42 /* MoreViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoreViewController.swift; sourceTree = ""; }; - BFD1CB541E2CA527009D8A42 /* HotMoreViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HotMoreViewController.swift; sourceTree = ""; }; BFDA8F321DDE88ED00F0C4E4 /* XSTLiveManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XSTLiveManager.swift; sourceTree = ""; }; BFDFDEAF1DD55B710040F102 /* AlivcLiveVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AlivcLiveVideo.framework; sourceTree = ""; }; BFDFDEBA1DD55BC90040F102 /* UIView+Toast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Toast.h"; sourceTree = ""; }; BFDFDEBB1DD55BC90040F102 /* UIView+Toast.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Toast.m"; sourceTree = ""; }; BFDFDEC81DD55C0D0040F102 /* account.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = account.swift; sourceTree = ""; }; - BFDFDEC91DD55C0D0040F102 /* ClassModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; BFDFDECA1DD55C0D0040F102 /* network.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = network.swift; sourceTree = ""; }; BFDFDECB1DD55C0D0040F102 /* utiles.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = utiles.swift; sourceTree = ""; }; - BFDFDF081DD56C430040F102 /* LiveRoomDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveRoomDetailViewController.swift; sourceTree = ""; }; BFE1C7991E23686C0007B16B /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = ""; }; BFE1C79A1E23686C0007B16B /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = ""; }; BFF5F45B1DD5AA5C00D33B89 /* attach_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = attach_file.png; sourceTree = ""; }; @@ -646,12 +581,11 @@ children = ( BFBB83A81ECAE35E008B404B /* LeadViewController.swift */, 5904FC601ECA930D00E631FF /* MViewController.swift */, - 59C25B4C1ECAFAFC009FF276 /* NavigationViewController.swift */, 5904FC431ECA8B8C00E631FF /* HomePage */, 5904FC441ECA8B8C00E631FF /* MicroCourse */, 5904FC461ECA8B8C00E631FF /* Resource */, 5904FC481ECA8B8C00E631FF /* TVStation */, - 5904FC4C1ECA8B8C00E631FF /* User */, + BFBB83D81ECC445D008B404B /* User */, ); path = controllers; sourceTree = ""; @@ -695,15 +629,6 @@ path = TVStation; sourceTree = ""; }; - 5904FC4C1ECA8B8C00E631FF /* User */ = { - isa = PBXGroup; - children = ( - 5904FC581ECA8C0000E631FF /* UserViewController.swift */, - 5904FC5A1ECA8C0900E631FF /* User.storyboard */, - ); - path = User; - sourceTree = ""; - }; 596026391DD94D3100C6B5E8 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -954,15 +879,6 @@ path = Resource; sourceTree = ""; }; - 59BA132B1E25D14F00540DE0 /* AliveVideoPlayer */ = { - isa = PBXGroup; - children = ( - 59BA132C1E25D14F00540DE0 /* MoivePlayerViewController.swift */, - 59893BDE1E2C53E1004E7F81 /* AlivcInforViewController.swift */, - ); - path = AliveVideoPlayer; - sourceTree = ""; - }; 59BA132E1E25D1C000540DE0 /* Reach */ = { isa = PBXGroup; children = ( @@ -994,11 +910,8 @@ children = ( 59F8014E1DD2C7AD000A78B0 /* AppDelegate.swift */, 59F801521DD2C7AD000A78B0 /* Main.storyboard */, - 59F8019A1DD567D8000A78B0 /* controller */, 5904FC421ECA8B8C00E631FF /* controllers */, BFDA8F311DDE87E800F0C4E4 /* NIM */, - 59F801921DD567C7000A78B0 /* Aliv */, - 59BA132B1E25D14F00540DE0 /* AliveVideoPlayer */, 596026481DDD469200C6B5E8 /* DanmakuLib */, BFDFDEC71DD55C0D0040F102 /* util */, BFDFDEB11DD55BC90040F102 /* lib */, @@ -1013,38 +926,6 @@ path = YouerLiveVideo; sourceTree = ""; }; - 59F801921DD567C7000A78B0 /* Aliv */ = { - isa = PBXGroup; - children = ( - 59F801931DD567C7000A78B0 /* AlivcLiveViewController.h */, - 59F801941DD567C7000A78B0 /* AlivcLiveViewController.m */, - 59F801951DD567C7000A78B0 /* AlivcLiveViewController.xib */, - 59F801961DD567C7000A78B0 /* LiveVideoViewController.swift */, - 59A8731B1DDD9E0500BAC7FC /* CustomScrollView.swift */, - BF8A4C531DE02CE300F99896 /* MessageTableViewCell.swift */, - BF8A4C541DE02CE300F99896 /* MessageTableViewCell.xib */, - ); - path = Aliv; - sourceTree = ""; - }; - 59F8019A1DD567D8000A78B0 /* controller */ = { - isa = PBXGroup; - children = ( - 59F8019F1DD567D8000A78B0 /* MainViewController.swift */, - BF9D41241E29C17100719535 /* HomeViewController.swift */, - BF9D41261E29C20500719535 /* HomeDetailViewController.swift */, - BFD1CB521E2C66FA009D8A42 /* MoreViewController.swift */, - BFD1CB541E2CA527009D8A42 /* HotMoreViewController.swift */, - BF7B75B01E31E3200011D5C7 /* LiveTypeListViewController.swift */, - 59F8019B1DD567D8000A78B0 /* MyViewController.swift */, - BFDFDF081DD56C430040F102 /* LiveRoomDetailViewController.swift */, - BFD1CB451E2C657B009D8A42 /* HomeCellAndTitleView */, - BFB716B21E28AF4E00C5C516 /* Live */, - BFB716C21E28B5F200C5C516 /* UserCenter */, - ); - path = controller; - sourceTree = ""; - }; BF25DF9F1DDAA36A003EC0C1 /* Alamofire */ = { isa = PBXGroup; children = ( @@ -1249,30 +1130,6 @@ path = Header; sourceTree = ""; }; - BFB716B21E28AF4E00C5C516 /* Live */ = { - isa = PBXGroup; - children = ( - BFB716B31E28AF4E00C5C516 /* LiveVideoSettingShareViewController.swift */, - BFB716B41E28AF4E00C5C516 /* LiveVideoSettingViewController.swift */, - BFB716C01E28AF8B00C5C516 /* Live.storyboard */, - ); - path = Live; - sourceTree = ""; - }; - BFB716C21E28B5F200C5C516 /* UserCenter */ = { - isa = PBXGroup; - children = ( - BF69779A1E2DEFCF006FA934 /* LiveListViewController.swift */, - BF7B271D1E2F022E00BCF13D /* MyAttentionViewController.swift */, - BFB716C41E28B5F200C5C516 /* LoginViewController.swift */, - BFB716C51E28B5F200C5C516 /* PersonalSettingViewController.swift */, - BFB716C61E28B5F200C5C516 /* RegisterViewController.swift */, - BFB716C71E28B5F200C5C516 /* User.storyboard */, - BFB716C31E28B5F200C5C516 /* LiveRoomsViewController.swift */, - ); - path = UserCenter; - sourceTree = ""; - }; BFBB83C91ECBEB4E008B404B /* Carousel */ = { isa = PBXGroup; children = ( @@ -1294,19 +1151,25 @@ path = JYScrollBanner; sourceTree = ""; }; - BFD1CB451E2C657B009D8A42 /* HomeCellAndTitleView */ = { + BFBB83D81ECC445D008B404B /* User */ = { isa = PBXGroup; children = ( - BFD1CB461E2C657B009D8A42 /* HomeTableViewCell.swift */, - BFD1CB471E2C657B009D8A42 /* HomeTableViewCell.xib */, - BFD1CB481E2C657B009D8A42 /* liveTitleCollectionCell.swift */, - BFD1CB491E2C657B009D8A42 /* liveTitleCollectionCell.xib */, - BFD1CB4A1E2C657B009D8A42 /* LiveTitleView.swift */, - BFD1CB4B1E2C657B009D8A42 /* LiveTitleView.xib */, - BF7B75AC1E309F230011D5C7 /* AttentionTableViewCell.swift */, - BF7B75AD1E309F230011D5C7 /* AttentionTableViewCell.xib */, - ); - path = HomeCellAndTitleView; + BFBB83D91ECC445D008B404B /* User.storyboard */, + BFBB83E21ECC445D008B404B /* UserViewController.swift */, + BFBB83DA1ECC445D008B404B /* UserCenter */, + ); + path = User; + sourceTree = ""; + }; + BFBB83DA1ECC445D008B404B /* UserCenter */ = { + isa = PBXGroup; + children = ( + BFBB83DD1ECC445D008B404B /* LoginViewController.swift */, + BFBB83DF1ECC445D008B404B /* PersonalSettingViewController.swift */, + BFBB83E01ECC445D008B404B /* RegisterViewController.swift */, + BFBB83E11ECC445D008B404B /* User.storyboard */, + ); + path = UserCenter; sourceTree = ""; }; BFDA8F311DDE87E800F0C4E4 /* NIM */ = { @@ -1362,12 +1225,11 @@ BFDFDEC71DD55C0D0040F102 /* util */ = { isa = PBXGroup; children = ( - 5906A0731E349FA500D2D814 /* PassWordView.swift */, - 5906A0751E349FB400D2D814 /* PassWordView.xib */, + BFBB83D41ECC4446008B404B /* PassWordView.swift */, + BFBB83D51ECC4446008B404B /* PassWordView.xib */, 59F801A91DD57253000A78B0 /* ZSDSetPasswordView.h */, 59F801AA1DD57253000A78B0 /* ZSDSetPasswordView.m */, BFDFDEC81DD55C0D0040F102 /* account.swift */, - BFDFDEC91DD55C0D0040F102 /* ClassModel.swift */, BFDFDECA1DD55C0D0040F102 /* network.swift */, BFDFDECB1DD55C0D0040F102 /* utiles.swift */, BFC076771E3445F3008BAC79 /* DownLoad.swift */, @@ -1504,14 +1366,11 @@ BF6977921E2DEAF1006FA934 /* arrow.png in Resources */, 59BA13571E25D8DB00540DE0 /* video_num_front@2x.png in Resources */, BF6977971E2DEC98006FA934 /* loginBackGround.png in Resources */, - BFD1CB4F1E2C657B009D8A42 /* liveTitleCollectionCell.xib in Resources */, BFF5F4791DD5AA5C00D33B89 /* 分享.png in Resources */, BFF5F47C1DD5AA5C00D33B89 /* 收拢.png in Resources */, - BFB716C11E28AF8B00C5C516 /* Live.storyboard in Resources */, BFF5F4721DD5AA5C00D33B89 /* defphoto.png in Resources */, 5904FC531ECA8BB500E631FF /* MicroCourse.storyboard in Resources */, BFF5F4751DD5AA5C00D33B89 /* left.png in Resources */, - BFD1CB511E2C657B009D8A42 /* LiveTitleView.xib in Resources */, BFF5F48E1DD5B7CA00D33B89 /* Info-iOS.plist in Resources */, BFF5F47A1DD5AA5C00D33B89 /* 封面上传.png in Resources */, BF7B75A41E305A6D0011D5C7 /* MJRefresh.bundle in Resources */, @@ -1520,7 +1379,6 @@ BF6977991E2DEC98006FA934 /* userPassword.png in Resources */, 59F8015C1DD2C7AE000A78B0 /* LaunchScreen.storyboard in Resources */, BF3E4A7A1E2F30B700D90659 /* 直播-最热.png in Resources */, - 5906A0761E349FB400D2D814 /* PassWordView.xib in Resources */, 59BA13471E25D8DB00540DE0 /* movieBackwardSelected.png in Resources */, BFF5F47D1DD5AA5C00D33B89 /* 暂停.png in Resources */, BFF5F4781DD5AA5C00D33B89 /* 全屏.png in Resources */, @@ -1539,32 +1397,29 @@ BFF5F4761DD5AA5C00D33B89 /* psb.jpg in Resources */, 59BA13451E25D8DB00540DE0 /* movieBackward.png in Resources */, BF25DFE51DDAA36A003EC0C1 /* Info-tvOS.plist in Resources */, - BFD1CB4D1E2C657B009D8A42 /* HomeTableViewCell.xib in Resources */, BF6977881E2DC264006FA934 /* 我的关注.png in Resources */, 599B2CD51DE52F7E00B4F7FD /* TencentOpenApi_IOS_Bundle.bundle in Resources */, + BFBB83EA1ECC445D008B404B /* User.storyboard in Resources */, 597185B51ECA990C00D7F478 /* Resource.storyboard in Resources */, BF25DFE61DDAA36A003EC0C1 /* Info.plist in Resources */, BFF5F4771DD5AA5C00D33B89 /* 上传头像.png in Resources */, 5904FC501ECA8B8C00E631FF /* TVStation.storyboard in Resources */, BF3E4A771E2F30B700D90659 /* 观看人数.png in Resources */, 599B2CDF1DE52F7E00B4F7FD /* UMSocialSDKResources.bundle in Resources */, - 5904FC5B1ECA8C0900E631FF /* User.storyboard in Resources */, BFF5F4901DD5B7CA00D33B89 /* Info-tvOS.plist in Resources */, - BFB716CC1E28B5F200C5C516 /* User.storyboard in Resources */, BFF5F4711DD5AA5C00D33B89 /* attach_file.png in Resources */, 599B2CD81DE52F7E00B4F7FD /* WeiboSDK.bundle in Resources */, BF3E4A791E2F30B700D90659 /* 上传封面.png in Resources */, 59DB1C781E792E5900EA2FC4 /* 开始直播.png in Resources */, - 59F801981DD567C7000A78B0 /* AlivcLiveViewController.xib in Resources */, - BF7B75AF1E309F230011D5C7 /* AttentionTableViewCell.xib in Resources */, - BF8A4C561DE02CE300F99896 /* MessageTableViewCell.xib in Resources */, BF69778A1E2DC264006FA934 /* 直播历史.png in Resources */, BF25E0171DDAAF73003EC0C1 /* SVProgressHUD.bundle in Resources */, 59F801541DD2C7AD000A78B0 /* Main.storyboard in Resources */, + BFBB83E31ECC445D008B404B /* User.storyboard in Resources */, BFF5F47B1DD5AA5C00D33B89 /* 摄像头翻转.png in Resources */, 5904FC551ECA8BCB00E631FF /* HomePage.storyboard in Resources */, BFF5F47E1DD5AA5C00D33B89 /* 横屏.png in Resources */, 59BA13561E25D8DB00540DE0 /* video_num_bg@2x.png in Resources */, + BFBB83D71ECC4446008B404B /* PassWordView.xib in Resources */, 59DB1C7E1E793E6A00EA2FC4 /* 首页.png in Resources */, BF6977871E2DC264006FA934 /* 我的充值.png in Resources */, BF69778B1E2DC264006FA934 /* 直播列表.png in Resources */, @@ -1599,17 +1454,16 @@ buildActionMask = 2147483647; files = ( BF7B75A21E305A6D0011D5C7 /* MJRefreshNormalHeader.m in Sources */, - 59F801991DD567C7000A78B0 /* LiveVideoViewController.swift in Sources */, BF7B75991E305A6D0011D5C7 /* MJRefreshFooter.m in Sources */, 59F801571DD2C7AE000A78B0 /* YouerLiveVideo.xcdatamodeld in Sources */, 59BA13311E25D1C000540DE0 /* Reachability.m in Sources */, + BFBB83EB1ECC445D008B404B /* UserViewController.swift in Sources */, 5904FC4E1ECA8B8C00E631FF /* ResourceViewController.swift in Sources */, BFBB83D11ECBEB4E008B404B /* JYScrollItem.m in Sources */, BF25DFEB1DDAA36A003EC0C1 /* Request.swift in Sources */, BF7B759F1E305A6D0011D5C7 /* MJRefreshBackNormalFooter.m in Sources */, BFBB83D21ECBEB4E008B404B /* JYScrollItemModel.m in Sources */, 599B2CE01DE52F7E00B4F7FD /* UMShareMenuItem.m in Sources */, - BFD1CB531E2C66FA009D8A42 /* MoreViewController.swift in Sources */, BF7B75A31E305A6D0011D5C7 /* MJRefreshStateHeader.m in Sources */, 599B2CE21DE52F7E00B4F7FD /* UMSocialShareScrollView.m in Sources */, BF25E0161DDAAF73003EC0C1 /* SVProgressAnimatedView.m in Sources */, @@ -1624,35 +1478,26 @@ 59C25B491ECAD643009FF276 /* MoreTVStationViewController.swift in Sources */, 5904FC511ECA8B8C00E631FF /* TVStationViewController.swift in Sources */, BFBB83D31ECBEB4E008B404B /* JYScrollView.m in Sources */, + BFBB83E81ECC445D008B404B /* PersonalSettingViewController.swift in Sources */, BF25E0081DDAA36A003EC0C1 /* UIView+WebCache.m in Sources */, 5904FC5D1ECA8ED400E631FF /* HomePageViewController.swift in Sources */, BFBB83A91ECAE35E008B404B /* LeadViewController.swift in Sources */, - BF8A4C551DE02CE300F99896 /* MessageTableViewCell.swift in Sources */, - BFD1CB4C1E2C657B009D8A42 /* HomeTableViewCell.swift in Sources */, BF7B759C1E305A6D0011D5C7 /* MJRefreshAutoNormalFooter.m in Sources */, 5904FC4F1ECA8B8C00E631FF /* SearchTVStationListViewController.swift in Sources */, - BF7B75AE1E309F230011D5C7 /* AttentionTableViewCell.swift in Sources */, BFC076781E3445F3008BAC79 /* DownLoad.swift in Sources */, BF25DFE71DDAA36A003EC0C1 /* MultipartFormData.swift in Sources */, BF25DFF71DDAA36A003EC0C1 /* MKAnnotationView+WebCache.m in Sources */, BF25DFFB1DDAA36A003EC0C1 /* SDImageCacheConfig.m in Sources */, - BFB716B61E28AF4E00C5C516 /* LiveVideoSettingViewController.swift in Sources */, - BFB716B51E28AF4E00C5C516 /* LiveVideoSettingShareViewController.swift in Sources */, - BFDFDF091DD56C430040F102 /* LiveRoomDetailViewController.swift in Sources */, 5904FC4D1ECA8B8C00E631FF /* MicroCourseViewController.swift in Sources */, - 59A8731C1DDD9E0600BAC7FC /* CustomScrollView.swift in Sources */, + BFBB83E61ECC445D008B404B /* LoginViewController.swift in Sources */, BF25DFE21DDAA36A003EC0C1 /* AFError.swift in Sources */, BF25DFEF1DDAA36A003EC0C1 /* ServerTrustPolicy.swift in Sources */, BF25E0061DDAA36A003EC0C1 /* UIImageView+HighlightedWebCache.m in Sources */, BF25DFE41DDAA36A003EC0C1 /* DispatchQueue+Alamofire.swift in Sources */, BF25DFE81DDAA36A003EC0C1 /* NetworkReachabilityManager.swift in Sources */, BF25DFF31DDAA36A003EC0C1 /* Timeline.swift in Sources */, - 59893BDF1E2C53E1004E7F81 /* AlivcInforViewController.swift in Sources */, - BFB716C91E28B5F200C5C516 /* LoginViewController.swift in Sources */, - 59F801971DD567C7000A78B0 /* AlivcLiveViewController.m in Sources */, BF25DFFE1DDAA36A003EC0C1 /* SDWebImageDownloader.m in Sources */, BF7B75A51E305A6D0011D5C7 /* MJRefreshConst.m in Sources */, - BF9D41271E29C20500719535 /* HomeDetailViewController.swift in Sources */, BF7B759B1E305A6D0011D5C7 /* MJRefreshAutoGifFooter.m in Sources */, BF7B75A81E305A6D0011D5C7 /* UIScrollView+MJRefresh.m in Sources */, BF25E0021DDAA36A003EC0C1 /* UIButton+WebCache.m in Sources */, @@ -1660,15 +1505,10 @@ BF25DFF81DDAA36A003EC0C1 /* NSData+ImageContentType.m in Sources */, BF25E0151DDAAF73003EC0C1 /* SVIndefiniteAnimatedView.m in Sources */, BFF5F4921DD5B7CA00D33B89 /* SwiftyJSON.swift in Sources */, - BFDFDED11DD55C0D0040F102 /* ClassModel.swift in Sources */, BF7B75A91E305A6D0011D5C7 /* UIView+MJExtension.m in Sources */, - BF7B271E1E2F022E00BCF13D /* MyAttentionViewController.swift in Sources */, - 59F801A61DD567D8000A78B0 /* MainViewController.swift in Sources */, BF25DFEE1DDAA36A003EC0C1 /* Result.swift in Sources */, - BF7B75B11E31E3200011D5C7 /* LiveTypeListViewController.swift in Sources */, BFDFDED21DD55C0D0040F102 /* network.swift in Sources */, 599B2CE11DE52F7E00B4F7FD /* UMShareMenuSelectionView.m in Sources */, - 59C25B4D1ECAFAFC009FF276 /* NavigationViewController.swift in Sources */, BF25DFFF1DDAA36A003EC0C1 /* SDWebImageDownloaderOperation.m in Sources */, BF25DFF01DDAA36A003EC0C1 /* SessionDelegate.swift in Sources */, BF25DFE31DDAA36A003EC0C1 /* Alamofire.swift in Sources */, @@ -1678,20 +1518,15 @@ 596026501DDD469200C6B5E8 /* RiverRunCommentManager.m in Sources */, BF7B759A1E305A6D0011D5C7 /* MJRefreshHeader.m in Sources */, BF7B75A61E305A6D0011D5C7 /* NSBundle+MJRefresh.m in Sources */, - 59BA132D1E25D14F00540DE0 /* MoivePlayerViewController.swift in Sources */, 5960264F1DDD469200C6B5E8 /* CommentTextLayer.m in Sources */, BFDFDED01DD55C0D0040F102 /* account.swift in Sources */, - 5904FC591ECA8C0000E631FF /* UserViewController.swift in Sources */, - BF9D41251E29C17100719535 /* HomeViewController.swift in Sources */, - BFD1CB551E2CA527009D8A42 /* HotMoreViewController.swift in Sources */, - BF69779B1E2DEFCF006FA934 /* LiveListViewController.swift in Sources */, 59C25B4B1ECAD84C009FF276 /* TVStationInforViewController.swift in Sources */, BF25DFF51DDAA36A003EC0C1 /* MBProgressHUD.m in Sources */, - BFD1CB501E2C657B009D8A42 /* LiveTitleView.swift in Sources */, BF25E0191DDAAF73003EC0C1 /* SVRadialGradientLayer.m in Sources */, BF25E0001DDAA36A003EC0C1 /* SDWebImageManager.m in Sources */, BF25E0011DDAA36A003EC0C1 /* SDWebImagePrefetcher.m in Sources */, BF7B75A71E305A6D0011D5C7 /* UIScrollView+MJExtension.m in Sources */, + BFBB83D61ECC4446008B404B /* PassWordView.swift in Sources */, BF7B75971E305A6D0011D5C7 /* MJRefreshBackFooter.m in Sources */, BF7B75981E305A6D0011D5C7 /* MJRefreshComponent.m in Sources */, BF25DFEA1DDAA36A003EC0C1 /* ParameterEncoding.swift in Sources */, @@ -1702,22 +1537,17 @@ 5904FC611ECA930D00E631FF /* MViewController.swift in Sources */, BF25DFF61DDAA36A003EC0C1 /* FLAnimatedImageView+WebCache.m in Sources */, BF7B759D1E305A6D0011D5C7 /* MJRefreshAutoStateFooter.m in Sources */, - 5906A0741E349FA500D2D814 /* PassWordView.swift in Sources */, BF25E0071DDAA36A003EC0C1 /* UIImageView+WebCache.m in Sources */, BF25DFE91DDAA36A003EC0C1 /* Notifications.swift in Sources */, BF25DFF21DDAA36A003EC0C1 /* TaskDelegate.swift in Sources */, - BFB716C81E28B5F200C5C516 /* LiveRoomsViewController.swift in Sources */, BF7B75A11E305A6D0011D5C7 /* MJRefreshGifHeader.m in Sources */, 599B2CE31DE52F7E00B4F7FD /* UMSocialUIManager.m in Sources */, - BFB716CB1E28B5F200C5C516 /* RegisterViewController.swift in Sources */, BF25DFF91DDAA36A003EC0C1 /* NSImage+WebCache.m in Sources */, - BFB716CA1E28B5F200C5C516 /* PersonalSettingViewController.swift in Sources */, 59F8014F1DD2C7AD000A78B0 /* AppDelegate.swift in Sources */, BF25DFED1DDAA36A003EC0C1 /* ResponseSerialization.swift in Sources */, BF25E0031DDAA36A003EC0C1 /* UIImage+GIF.m in Sources */, - 59F801A21DD567D8000A78B0 /* MyViewController.swift in Sources */, + BFBB83E91ECC445D008B404B /* RegisterViewController.swift in Sources */, 596026511DDD469200C6B5E8 /* RiverRunCommentUtil.m in Sources */, - BFD1CB4E1E2C657B009D8A42 /* liveTitleCollectionCell.swift in Sources */, BF25DFF11DDAA36A003EC0C1 /* SessionManager.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate index 5aa9cf2..d77a839 100644 Binary files a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate and b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.h b/YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.h deleted file mode 100644 index 8afb31d..0000000 --- a/YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// AlivcLiveViewController.h -// DevAlivcLiveVideo -// -// Created by lyz on 16/3/21. -// Copyright © 2016年 Alivc. All rights reserved. -// - -#import -@interface AlivcLiveViewController : UIViewController - -@property (weak, nonatomic) IBOutlet UITextView *textView; -@property (nonatomic, assign) BOOL isScreenHorizontal; -@property (strong,nonatomic) id liveDetail; -@property (strong,nonatomic) NSString * userNameString; -@property (assign, nonatomic) NSInteger definition; -@property (assign, nonatomic) BOOL isApplyChat; -@property (assign, nonatomic) NSTimeInterval endTimer; -- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil url:(NSString *)url; - -@end diff --git a/YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.m b/YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.m deleted file mode 100644 index 26f706b..0000000 --- a/YouerLiveVideo/YouerLiveVideo/Aliv/AlivcLiveViewController.m +++ /dev/null @@ -1,733 +0,0 @@ -// -// AlivcLiveViewController.m -// DevAlivcLiveVideo -// -// Created by yly on 16/3/21. -// Copyright © 2016年 Alivc. All rights reserved. -// - -#import "AlivcLiveViewController.h" -#import -#import -#import -#import "RiverRunCommentUtil.h" -#import "RiverRunCommentManager.h" -#import "YouerLiveVideo-Swift.h" - -@interface AlivcLiveViewController () -@property (weak, nonatomic) IBOutlet UIView *definitionView; -@property (weak, nonatomic) IBOutlet UIView *sendWordView; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *sendWordBottomSpace; - -@property (weak, nonatomic) IBOutlet UITextField *messageStrText; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *userPhotoHeight; -@property (weak, nonatomic) IBOutlet UIButton *skinBtn; -@property (nonatomic, strong) CTCallCenter *callCenter; -@property (weak, nonatomic) IBOutlet UIButton *setCaptureBtn; -@property (weak, nonatomic) IBOutlet UITableView *chatTableView; -@property (weak, nonatomic) IBOutlet UIView *subtitleLocationView; -@property (weak, nonatomic) IBOutlet UIButton *subTitleStart; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *shareBtnHeight; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *shareBtnTopSpace; - -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *chatTableViewHeight; - -@property (strong, nonatomic) NSMutableArray *commentArray; -@property (strong, nonatomic) NSTimer *commentTimer; -@property (strong, nonatomic) NSTimer *stopTimer; -@property (strong, nonatomic) RiverRunCommentManager *manager; -@property CGFloat commentNUM; -@property (weak, nonatomic) IBOutlet UILabel *userName; -@property (weak, nonatomic) IBOutlet UILabel *roomActivePersonNumber; -@property (weak, nonatomic) IBOutlet UILabel *roomName; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *sendWordHeight; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *fullScreenBtnHeight; - -@property (strong, nonatomic) NSMutableArray * messageArr; -@property (assign, nonatomic) NSInteger activeNum; -@property (assign, nonatomic) CGAffineTransform transFront; -@property (assign, nonatomic) CGAffineTransform transBack; - -@end - -@implementation AlivcLiveViewController{ - AlivcLiveSession *_liveSession; - NSString *_url; - NSTimer *_timer; - UITableView * actionTableView; - NSFileHandle *_handle; - AVCaptureDevicePosition _currentPosition; - NSUInteger _last; - NSMutableArray *_logArray; - - CGFloat _lastPinchDistance; - - BOOL _isCTCallStateDisconnected; - NSArray * definitionArr; - LiveDetail * infor; -} - -// 返回状态栏的样式 -- (UIStatusBarStyle)preferredStatusBarStyle -{ - return UIStatusBarStyleLightContent; -} - -- (BOOL)prefersStatusBarHidden -{ - return YES; // 返回NO表示要显示,返回YES将hiden -} - -- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil url:(NSString *)url{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - _url = url; - return self; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - [[[NIMSDK sharedSDK] chatManager] addDelegate:self]; - [[XSTLiveManager shareXSTLiveManager] enterLiveWithRoomId:[_liveDetail f_RoomId] completion:^( BOOL succ, NIMChatroom * room, NIMChatroomMember * member) { - if (!succ) { - [self dismissViewControllerAnimated:YES completion:nil]; - } - }]; - if (!_isApplyChat) { - _chatTableView.hidden = YES; - _sendWordView.hidden = YES; - _sendWordHeight.constant = 0; - } - - AppDelegate * appdelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; - appdelegate.blockRotation = YES; - _shareBtnTopSpace.constant = 0; - _shareBtnHeight.constant = 0; - infor = (LiveDetail *)_liveDetail; - _roomName.text = infor.f_LiveName; - _userName.text = _userNameString; - _messageArr = [[NSMutableArray alloc] init]; - self.view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1.00f]; - - [_chatTableView setBackgroundColor:[[UIColor groupTableViewBackgroundColor] colorWithAlphaComponent:1]]; - [self.view sendSubviewToBack:_subtitleLocationView]; - - _commentTimer = [NSTimer timerWithTimeInterval:0.1f - target:self selector:@selector(commentTimerFired) - userInfo:nil repeats:YES]; - _commentNUM = 0; - _stopTimer = [NSTimer timerWithTimeInterval:60 - target:self selector:@selector(isStopPlay) - userInfo:nil repeats:YES]; - [[NSRunLoop currentRunLoop] addTimer:_commentTimer forMode:NSRunLoopCommonModes]; - [[NSRunLoop currentRunLoop] addTimer:_stopTimer forMode:NSRunLoopCommonModes]; - _commentArray = [[NSMutableArray alloc] init]; - _manager = [[RiverRunCommentManager alloc]initWithComments:_commentArray delegate:self andPresentView:self.view videoSize:_subtitleLocationView.bounds.size screenSize:_subtitleLocationView.bounds.size isLandscape:[[UIApplication sharedApplication] statusBarOrientation]]; - - if (_isScreenHorizontal) { - _chatTableViewHeight.constant = 0; - CGSize size = CGSizeMake([[UIScreen mainScreen] bounds].size.height, _subtitleLocationView.bounds.size.width-100); - _manager = [[RiverRunCommentManager alloc]initWithComments:_commentArray delegate:self andPresentView:self.view videoSize:size screenSize:size isLandscape:[[UIApplication sharedApplication] statusBarOrientation]]; - } - - - [_manager start]; - - - _sendWordView.backgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.5]; - _logArray = [NSMutableArray array]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appResignActive) name:UIApplicationWillResignActiveNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyBoardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil]; - UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGesture:)]; - [self.view addGestureRecognizer:gesture]; - - UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchGesture:)]; - [self.view addGestureRecognizer:pinch]; - - // _timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timeUpdate) userInfo:nil repeats:YES]; - - [self testPushCapture]; - // NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:@"log.txt"]; - // [[NSFileManager defaultManager] removeItemAtPath:path error:nil]; - // [[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil]; - // _handle = [NSFileHandle fileHandleForWritingAtPath:path]; - // -} - --(void)isStopPlay{ - NSTimeInterval date = [[[NSDate alloc] init] timeIntervalSince1970]; - if (_endTimer - date < 60) { - if (date >= _endTimer) { - [self closePlayer]; - }else{ - [self.view makeToast:@"直播时间即将结束,请您做好准备" duration:5 position:CSToastPositionCenter]; - } - } -} - --(void)viewWillAppear:(BOOL)animated{ - [super viewWillAppear:animated]; - // [self.navigationController setNavigationBarHidden:NO]; - [[XSTLiveManager shareXSTLiveManager] fetchLiveInfoWithRoomId:[_liveDetail f_RoomId] completion:^(BOOL suc, NIMChatroom * room) { - if (suc) { - self.activeNum = [room onlineUserCount]; - self.roomActivePersonNumber.text = [NSString stringWithFormat:@"在线人数:%ld",self.activeNum]; - } - }]; - - // CGAffineTransform transform; - // if (_isScreenHorizontal && _liveSession.devicePosition == AVCaptureDevicePositionFront){ - // transform = CGAffineTransformMakeRotation(-M_PI_2); - // }else{ - // transform = CGAffineTransformMakeRotation(0); - // } - // [_liveSession previewView].transform = transform; - // [[_liveSession previewView] layoutSubviews]; - - // if (_isScreenHorizontal){ - // [self.navigationController setNavigationBarHidden:YES]; - // CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI/2); - // self.view.transform = transform; - // self.view.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width); - // [self.view layoutSubviews]; - // CGAffineTransform transforms = CGAffineTransformMakeRotation(-M_PI/2); - // [_liveSession previewView].transform = transforms; - // [_liveSession previewView].frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width); - // - // [[_liveSession previewView] layoutSubviews]; - // } -} - -- (CGFloat)willShowComments:(BOOL)seek { - return _commentNUM; -} - --(void)commentTimerFired -{ - _commentNUM+=0.1; -} - -- (NSArray*)createVideoComment:(NIMMessage *)message { - NSMutableArray *videoComments = [NSMutableArray array]; - NSInteger vpos = 200; - - NSDictionary *commentInfo = @{ - @"vpos": @(vpos), - @"body": [message text], - @"position": @([RiverRunCommentUtil commentPosition:[RiverRunCommentUtil getRandomPosition]]), - @"fontSize": @([RiverRunCommentUtil commentSize:[RiverRunCommentUtil getRandomFontSize]]), - @"color": @"0xffffff", - @"duration":@(3.f), - }; - [videoComments addObject:commentInfo]; - return videoComments; -} - --(void)onRecvMessages:(NSArray *)messages{ - BOOL isScroll = NO; - if ([_chatTableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:_messageArr.count-1 inSection:0]]){ - isScroll = YES; - } - for (NIMMessage * message in messages) { - if (message.messageType == NIMMessageTypeNotification){ - if ([((NIMChatroomNotificationContent *)((NIMNotificationObject *)message.messageObject).content).notifyExt containsString:@"name"]){ - self.activeNum = self.activeNum+1; - }else{ - self.activeNum = self.activeNum-1; - } - self.roomActivePersonNumber.text = [NSString stringWithFormat:@"在线人数:%ld",self.activeNum]; - } - if ([[[message session] sessionId] isEqualToString:[_liveDetail f_RoomId]]&&message.text != nil){ - [_messageArr addObject:message]; - if (!_subTitleStart.isSelected){ - [_manager.comments addObjectsFromArray:[self createVideoComment:message]] ; - } - } - } - [_chatTableView reloadData]; - if (isScroll) { - [_chatTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForItem:_messageArr.count-1 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; - } - - -} - --(void)sendMessage:(NIMMessage *)message didCompleteWithError:(NSError *)error{ - if (error == nil){ - if (!_subTitleStart.isSelected){ - [_manager.comments addObjectsFromArray:[self createVideoComment:message]] ; - } - [_messageArr addObject:message]; - [_chatTableView reloadData]; - _messageStrText.text = @""; - [_chatTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForItem:_messageArr.count-1 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; - }else{ - - } -} - -- (IBAction)sendMessage:(id)sender { - [[XSTLiveManager shareXSTLiveManager] sendMessageWithStr:_messageStrText.text roomId:[_liveDetail f_RoomId] completion:^(BOOL suc) { - }]; -} -/* --(void)previewViewTrans{ - if (_setCaptureBtn.isSelected){ - [_liveSession previewView].transform = _transFront; - }else{ - [_liveSession previewView].transform = _transBack; - } -} -*/ --(void)keyBoardWillChangeFrame:(NSNotification*)noti{ - NSDictionary * dic = noti.userInfo; - CGRect rect = [[dic objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; - [UIView animateWithDuration:0.25 animations:^{ - self.sendWordBottomSpace.constant = [UIScreen mainScreen].bounds.size.height - rect.origin.y; - [self.sendWordView layoutIfNeeded]; - }]; -} -- (IBAction)expressionBtnClickAction:(UIButton*)sender { - if (sender.isSelected){ - [UIView animateWithDuration:0.25 animations:^{ - self.sendWordBottomSpace.constant = 216; - [self.sendWordView layoutIfNeeded]; - }]; - }else{ - [UIView animateWithDuration:0.25 animations:^{ - self.sendWordBottomSpace.constant = 0; - [self.sendWordView layoutIfNeeded]; - }]; - } -} - --(BOOL)textFieldShouldReturn:(UITextField *)textField{ - [textField resignFirstResponder]; - return YES; -} - -- (void)timeUpdate{ - AlivcLDebugInfo *i = [_liveSession dumpDebugInfo]; - NSDate *date = [NSDate dateWithTimeIntervalSince1970:i.connectStatusChangeTime]; - - NSMutableString *msg = [[NSMutableString alloc] init]; - [msg appendFormat:@"周期性延迟(%0.2fms)\n",i.cycleDelay]; - [msg appendFormat:@"bitrate(%zd) 当前buffer视频帧数(%zd)\n",[_liveSession alivcLiveVideoBitRate] ,_liveSession.dumpDebugInfo.localBufferVideoCount]; - [msg appendFormat:@" 所有编码帧数(%zd) 所有发送帧数(%zd)\n",i.encodeFrameCount, i.pushFrameCount]; - [msg appendFormat:@"编码帧数%0.2f 编码速度%0.2fKB/s 当前上传速度%0.2fKB/s\n", i.fps,i.encodeSpeed, i.speed/1024]; - [msg appendFormat:@"本地buffer大小%lluB 当前上传数据大小(%lluB) status(%zd) %@",i.localBufferSize, i.pushSize, i.connectStatus, date]; - [msg appendFormat:@" 编码耗时%0.2fms\n",i.localDelay]; - [msg appendFormat:@"当前输出流Video:%zd\n当前输出流audio pts:%zd\n", i.currentVideoPTS,i.currentAudioPTS]; - - // NSLog(@"%@", msg); - - // _textView.text = msg; - // _textView.text = @"正在直播"; - [_logArray addObject:msg]; - - // NSLog(@"%@", i.eventArray); -} - -- (void)tapGesture:(UITapGestureRecognizer *)gesture{ - CGPoint point = [gesture locationInView:self.view]; - CGPoint percentPoint = CGPointZero; - percentPoint.x = point.x / CGRectGetWidth(self.view.bounds); - percentPoint.y = point.y / CGRectGetHeight(self.view.bounds); - [_liveSession alivcLiveVideoFocusAtAdjustedPoint:percentPoint autoFocus:YES]; - -} - -- (void)pinchGesture:(UIPinchGestureRecognizer *)gesture { - - if (_currentPosition == AVCaptureDevicePositionFront) { - return; - } - - if (gesture.numberOfTouches != 2) { - return; - } - CGPoint p1 = [gesture locationOfTouch:0 inView:self.view]; - CGPoint p2 = [gesture locationOfTouch:1 inView:self.view]; - CGFloat dx = (p2.x - p1.x); - CGFloat dy = (p2.y - p1.y); - CGFloat dist = sqrt(dx*dx + dy*dy); - if (gesture.state == UIGestureRecognizerStateBegan) { - _lastPinchDistance = dist; - } - - CGFloat change = dist - _lastPinchDistance; - // change = change / (CGRectGetWidth(self.view.bounds) * 0.5) * 2.0; - // - [_liveSession alivcLiveVideoZoomCamera:(change / 1000 )]; - -} - -- (void)viewDidAppear:(BOOL)animated{ - [super viewDidAppear:animated]; -} - --(void)viewWillDisappear:(BOOL)animated{ - [self destroySession]; - [[[NIMSDK sharedSDK] chatManager] removeDelegate:self]; - [[XSTLiveManager shareXSTLiveManager] removeLiveWithRoomId:[_liveDetail f_RoomId] completion:^(BOOL suc) { - if (suc) { - - } - }]; -} - -- (void)appResignActive{ - [self destroySession]; - - // 监听电话 - _callCenter = [[CTCallCenter alloc] init]; - _isCTCallStateDisconnected = NO; - _callCenter.callEventHandler = ^(CTCall* call) { - if ([call.callState isEqualToString:CTCallStateDisconnected]) - { - _isCTCallStateDisconnected = YES; - } - else if([call.callState isEqualToString:CTCallStateConnected]) - - { - _callCenter = nil; - } - }; - -} - -- (void)appBecomeActive{ - - if (_isCTCallStateDisconnected) { - sleep(2); - } - - [self testPushCapture]; - [self supportedInterfaceOrientations]; -} - -- (void)testPushCapture{ - - AlivcLConfiguration *configuration = [[AlivcLConfiguration alloc] init]; - configuration.url = [NSString stringWithFormat:@"rtmp://video-center.alivecdn.com/LiveVod/S%@?vhost=live.on168.com.cn",_url]; - if (_definition == 0) { - configuration.videoSize = CGSizeMake(360, 640);// 横屏状态宽高不需要互换 - configuration.videoBitRate = 400 * 1000; - }else if (_definition == 1){ - configuration.videoSize = CGSizeMake(480, 640*4/3);// 横屏状态宽高不需要互换 - configuration.videoBitRate = 800 * 1000; - }else if (_definition == 2){ - configuration.videoSize = CGSizeMake(720, 1280);// 横屏状态宽高不需要互换 - configuration.videoBitRate = 1500 * 1000; - } - configuration.videoMaxBitRate = 1500 * 1000; - configuration.videoMinBitRate = 400 * 1000; - configuration.audioBitRate = 96 * 1000; - configuration.fps = 20; - configuration.preset = AVCaptureSessionPresetiFrame1280x720; - configuration.screenOrientation = _isScreenHorizontal; - configuration.reconnectTimeout = 5; - if (_currentPosition) { - configuration.position = _currentPosition; - } else { - configuration.position = AVCaptureDevicePositionBack; - _currentPosition = AVCaptureDevicePositionBack; - } -// if (_isScreenHorizontal){ -// _setCaptureBtn.hidden = YES; -// -// } - - _liveSession = [[AlivcLiveSession alloc] initWithConfiguration:configuration]; - _liveSession.delegate = self; - [_liveSession setEnableSkin:YES]; - [_liveSession alivcLiveVideoStartPreview]; - _liveSession.devicePosition = _currentPosition; - [_liveSession alivcLiveVideoUpdateConfiguration:^(AlivcLConfiguration *configuration) { - configuration.videoMaxBitRate = 1500 * 1000; - configuration.videoBitRate = 600 * 1000; - configuration.videoMinBitRate = 400 * 1000; - configuration.audioBitRate = 64 * 1000; - configuration.fps = 20; - }]; - [_liveSession alivcLiveVideoConnectServer]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [self.view insertSubview:[_liveSession previewView] atIndex:0]; - }); - -} - --(BOOL)shouldAutorotate{ - return YES; -} - --(UIInterfaceOrientationMask)supportedInterfaceOrientations{ - if (_isScreenHorizontal){ - CGAffineTransform transform = CGAffineTransformMakeRotation(-M_PI/2); - [_liveSession previewView].transform = transform; - // CGRect rect = [_liveSession previewView].frame; - CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; - CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height; - CGFloat width = screenWidth>screenHeight?screenWidth:screenHeight; - CGFloat height = screenWidth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/Aliv/CustomScrollView.swift b/YouerLiveVideo/YouerLiveVideo/Aliv/CustomScrollView.swift deleted file mode 100644 index 9d0d3ff..0000000 --- a/YouerLiveVideo/YouerLiveVideo/Aliv/CustomScrollView.swift +++ /dev/null @@ -1,150 +0,0 @@ -// -// CustomScrollView.swift -// YouerLiveVideo -// -// Created by 左丞 on 16/11/17. -// Copyright © 2016年 左丞. All rights reserved. -// - -import UIKit - -class CustomScrollView:UIView,UIScrollViewDelegate{ - var expressionScrollView: UIScrollView! - var expressionPage: UIPageControl! - var EXPRESSION_SCROLL_VIEW_TAG:Int = 1000 - var MOREFUCTION_SCROLL_VIEW_TAG:Int = 1001 - ///pragma mark - UIScrollViewDelegate - override init(frame: CGRect) { - super.init(frame: frame) - expressionScrollView = UIScrollView(frame: CGRect(x:0, y:0, width:frame.size.width, height:180)) - expressionScrollView.showsHorizontalScrollIndicator = false - expressionScrollView.isPagingEnabled = true - expressionScrollView.delegate = self - expressionPage = UIPageControl(frame: CGRect(x:0, y:180, width:frame.size.width, height:frame.size.height - 180)) - expressionPage.center = CGPoint(x:getScreenWidth()/2, y:180 + (216 - 180)/2) - expressionPage.addTarget(self, action: #selector(CustomScrollView.pageTurn(_:)), for: UIControlEvents.touchUpInside) - expressionPage.currentPageIndicatorTintColor = Theme.topBarColor() - expressionPage.pageIndicatorTintColor = UIColor.black - expressionPage.numberOfPages = 0 - self.backgroundColor = UIColor.white - self.addSubview(expressionScrollView) - self.addSubview(expressionPage) - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { - - if scrollView.tag == EXPRESSION_SCROLL_VIEW_TAG || scrollView.tag == MOREFUCTION_SCROLL_VIEW_TAG { - //更新UIPageControl的当前页 - let offset = scrollView.contentOffset; - let bounds = scrollView.frame; - expressionPage.currentPage = Int(offset.x/bounds.size.width) - } - } - - @IBAction func pageTurn(_ sender: AnyObject) { - //令UIScrollView做出相应的滑动显示 - - let viewSize = expressionPage.frame.size - expressionScrollView.setContentOffset(CGPoint(x:CGFloat(sender.currentPage) * viewSize.width, y:0), animated: true) - } -} - - -class ExpressionView: CustomScrollView,UIPageViewControllerDelegate { - var delegate:ExpressionViewDelegate! - var pageNumber:Int = 7 - var expressionArray:[String]! - override init(frame: CGRect) { - super.init(frame: frame) - initExpressins() - } - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - - func initExpressins(){ - let row:Int = 4 - let column = 7 - var number = 0 - expressionArray = ["😄","😊","😃","☺","😏","😍","😘","😚","😳","😌","😆","😁","😉","😜","😝","😀","😙","😛","😴","😟","😬","😒","😅","😓","😥","😔","😞","😖","😨","😰","😣","😢","😭","😂","😲","😱","😠","😡","😤","😪","😋","😷","😎","😵","😈","👿","😇","👽","❤","💔","💕","💞","💘","💖","✨","🌟","💫","💥","💢","❗","❓","❕","❔","💤","💨","💦","🎵","🔥","👍","👎","👌","👊","✊","✌","👋","👇","👈","👉","🙌","🙏","👆","👏","💪","🏃","👫","👪","👬","👭","🙆","🙅","💁","🙋","👰","🙎","🙍","🙇","💏","💑","👶","👦","👧","👨","👩","👴","👵","👱","🙈","🙉","🙊","💋","💧","👂","👀","👃","👅","💌","☕","🍵","🍶","🍼","🍺","🍸","🍷","🍴","🍕","🍔","🍟","🍗","🍖","🍚","🍜","🍲","🍢","🍡","🍳","🍞","🍩","🍮","🍦","🍨","🍧","🎂","🍪","🍫","🍬","🍭","🍯","🍎","🍏","🍊","🍋","🍒","🍇","🍉","🍓","🍑","🍈","🍌","🍐","🍍","🍠","🍆","🍅","🌽","1⃣","2⃣","3⃣","4⃣","5⃣","6⃣","7⃣","8⃣","9⃣","0⃣","🔟","#⃣","◀","▶","🔼","↩","⬆","⬇","⬅","➡","↗","↖","↘","↙","⏫","⏬","🔤"] - pageNumber = (expressionArray.count-1)/row/column + 1 - expressionPage.numberOfPages = pageNumber - expressionScrollView.tag = EXPRESSION_SCROLL_VIEW_TAG - expressionScrollView.contentSize = CGSize(width: expressionScrollView.frame.size.width*CGFloat(pageNumber), height: 0) - - let width:CGFloat = (UIScreen.main.bounds.width - 40)/7 - for p:Int in 0 ..< pageNumber { - let pageOrginX = CGFloat(p)*expressionScrollView.frame.size.width - for j:Int in 0 ..< row { - let row_y = 15 + 40 * CGFloat(j) - for i:Int in 0 ..< column { - let column_x = 20 + width * CGFloat(i) - if number > expressionArray.count{ - break - } - if j != row - 1 || i != column - 1 { - let btn = UIButton(frame: CGRect(x: pageOrginX+column_x, y: row_y, width: width, height: 30)) - btn.tag = number - btn.backgroundColor = UIColor.clear - btn.titleLabel?.font = UIFont.systemFont(ofSize: 30) - btn.setTitle(expressionArray[number], for: .normal) - btn.addTarget(self, action: #selector(ExpressionView.putExpress(_:)), for: UIControlEvents.touchUpInside) - expressionScrollView.addSubview(btn) - number += 1 - } - } - } - let delBtn = UIButton(frame: CGRect(x:pageOrginX+UIScreen.main.bounds.width - 20 - width, y:137, width:width, height:35)) - delBtn.setImage(UIImage(named: "emoji_delete"), for: UIControlState.normal) - delBtn.addTarget(self, action: #selector(ExpressionView.backspaceText(_:)), for: UIControlEvents.touchUpInside) - expressionScrollView.addSubview(delBtn) - } - let sendBtn = UIButton() - sendBtn.frame = CGRect(x:self.frame.size.width-width*2, y:self.frame.size.height-40, width:60, height:30) - sendBtn.backgroundColor = Theme.topBarColor() - sendBtn.setTitle("发送", for: UIControlState.normal) - sendBtn.layer.cornerRadius = 5 - sendBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13) - sendBtn.addTarget(self, action: #selector(ExpressionView.emojiSendBtn(_:)), for: UIControlEvents.touchUpInside) - self.addSubview(sendBtn) - } - - func initMoreFudation(){ - - } - - func putExpress(_ sender:AnyObject){ - let button_tag = sender as! UIButton - if delegate != nil { - // delegate.emojiBtnInput(button_tag.tag) - delegate.emojiBtnInput(emoji: expressionArray[button_tag.tag]) - } - } - - func backspaceText(_ sender:AnyObject){ - if delegate != nil { - delegate.backSpaceText() - } - } - - func emojiSendBtn(_ sender:AnyObject){ - if delegate != nil { - delegate.sendMessage() - } - } -} - -///MARK: - 表情的协议 -protocol ExpressionViewDelegate : NSObjectProtocol { - // func emojiBtnInput(emojiTag:Int) - func emojiBtnInput(emoji:String) - - func backSpaceText() - func sendMessage() -} - diff --git a/YouerLiveVideo/YouerLiveVideo/Aliv/LiveVideoViewController.swift b/YouerLiveVideo/YouerLiveVideo/Aliv/LiveVideoViewController.swift deleted file mode 100644 index bb9f7cc..0000000 --- a/YouerLiveVideo/YouerLiveVideo/Aliv/LiveVideoViewController.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// LiveVideoViewController.swift -// YouerLiveVideo -// -// Created by 左丞 on 16/11/9. -// Copyright © 2016年 左丞. All rights reserved. -// - -import UIKit -import CoreTelephony -class LiveVideoViewController: UIViewController { - - var callCenter:CTCallCenter! - var liveSession:AlivcLiveSession! - var url:String! - var timer:Timer! - var handle:FileHandle! - var currentPosition:AVCaptureDevicePosition! - var last:Int! - var logArray:NSMutableArray! - var lastPinchDistance:CGFloat! - var isCTCallStateDisconnected:Bool! - - override var preferredStatusBarStyle : UIStatusBarStyle { - return .default - } - - override var prefersStatusBarHidden:Bool{ - return true - } - - override func viewDidLoad() { - super.viewDidLoad() - logArray = NSMutableArray() - - // Do any additional setup after loading the view. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. - } - */ - -} - diff --git a/YouerLiveVideo/YouerLiveVideo/Aliv/MessageTableViewCell.swift b/YouerLiveVideo/YouerLiveVideo/Aliv/MessageTableViewCell.swift deleted file mode 100644 index cd27bef..0000000 --- a/YouerLiveVideo/YouerLiveVideo/Aliv/MessageTableViewCell.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// MessageTableViewCell.swift -// TableViewCellTest -// -// Created by 葛建军 on 16/11/19. -// Copyright © 2016年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class MessageTableViewCell: UITableViewCell { - @IBOutlet var personImageView: UIImageView! - @IBOutlet var contentLabel: UILabel! - @IBOutlet var contentHeight: NSLayoutConstraint! - @IBOutlet var contentWidth: NSLayoutConstraint! - override func awakeFromNib() { - super.awakeFromNib() - // Initialization code - } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - - // Configure the view for the selected state - } - -} diff --git a/YouerLiveVideo/YouerLiveVideo/Aliv/MessageTableViewCell.xib b/YouerLiveVideo/YouerLiveVideo/Aliv/MessageTableViewCell.xib deleted file mode 100644 index 74fb58f..0000000 --- a/YouerLiveVideo/YouerLiveVideo/Aliv/MessageTableViewCell.xib +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/AliveVideoPlayer/AlivcInforViewController.swift b/YouerLiveVideo/YouerLiveVideo/AliveVideoPlayer/AlivcInforViewController.swift deleted file mode 100644 index 7875220..0000000 --- a/YouerLiveVideo/YouerLiveVideo/AliveVideoPlayer/AlivcInforViewController.swift +++ /dev/null @@ -1,150 +0,0 @@ -// -// AlivcInforViewController.swift -// YouerLiveVideo -// -// Created by 左丞 on 17/1/16. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class AlivcInforViewController: UIViewController { - - - @IBOutlet weak var contentView: UIView! - @IBOutlet weak var scrollView: UIScrollView! - @IBOutlet weak var alivcInfor: UILabel! - @IBOutlet weak var remainBtn: UIButton! - @IBOutlet weak var userNum: UILabel! - @IBOutlet weak var nickName: UILabel! - @IBOutlet weak var image: UIImageView! - - @IBOutlet weak var contentheight: NSLayoutConstraint! - @IBOutlet weak var fileLine: UILabel!//直播上方的一条线 - @IBOutlet weak var alivcAccessories: UIView! - var liveDetail:LiveDetail! - var fileArr:[FileInfor] = [] - override func viewDidLoad() { - super.viewDidLoad() - if liveDetail.f_IsAttention == 1{ - remainBtn.setTitle("已关注", for: .normal) - } - nickName.text = "昵称 : " + liveDetail.f_RealName - alivcInfor.text = JSON.fromString(jsonString: liveDetail.f_Description)!.dictionaryValue["announcement"]!.stringValue - userNum.text = "帐号 : " + liveDetail.f_Account - image.sd_setImage(with: URL(string: liveDetail.f_HeadIcon), placeholderImage: #imageLiteral(resourceName: "default_userRoom")) - image.layer.cornerRadius = image.frame.size.width/2 - image.layer.masksToBounds = true - creatAlivcAccessoriesView() -// image - - // Do any additional setup after loading the view. - } - @IBAction func isActionClick(_ sender: UIButton) { - if !NIMSDK.shared().loginManager.isLogined(){ - AppDelegate.instance().window?.makeToast("请您先登录!") - return - } - var isAttention = 0 - var str = "是否确认取消关注" - if liveDetail.f_IsAttention == 0{ - isAttention = 1 - str = "是否确认关注" - } - - let alert = UIAlertController(title: nil, message: str, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "确定", style: .default, handler: { (action) in - AppDelegate.instance().httpServer.setIsAction(parameters: ["F_OrganizeId":self.liveDetail.f_OrganizeId as AnyObject,"F_Action":isAttention as AnyObject]) { (str, error) in - if error == nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - if isAttention == 1{ - self.remainBtn.setTitle("已关注", for: .normal) - }else{ - self.remainBtn.setTitle("+ 关注", for: .normal) - } - self.liveDetail.f_IsAttention = isAttention - }else{ - self.view.makeToast("关注失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - } - else{ - self.view.makeToast("关注失败:\(error?.localizedFailureReason)") - } - } - })) - alert.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil)) - self.present(alert, animated: false, completion: nil) - - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - } - - func creatAlivcAccessoriesView(){ - let des = JSON.fromString(jsonString: liveDetail.f_Description)!["attachFiles"].arrayValue - for item in des{ - fileArr.append(FileInfor(json: item)) - } - if fileArr.count == 0{ - fileLine.isHidden = true - alivcAccessories.isHidden = true - }else{ - fileLine.isHidden = false - alivcAccessories.isHidden = false - for i in 0.. AliVcAccesskey! { - let accessKey = AliVcAccesskey() - accessKey.accessKeyId = accessKeyID - accessKey.accessKeySecret = accessKeySecret - return accessKey - } - override func viewDidLoad() { - super.viewDidLoad() - mSourceURL = URL(string:creatAlivcURLString(sid: liveDetail.f_Sid)) - userName.text = liveDetail.f_RealName - userImage.sd_setImage(with: URL(string: liveDetail.f_HeadIcon), placeholderImage: #imageLiteral(resourceName: "default_userRoom")) - NIMSDK.shared().chatManager.add(self) - scrollHeight.constant = 100 - btnFlagLabel.frame = CGRect(x: 0, y: 28, width: (getScreenWidth()-2)/3, height: 4) - scrollViewContanctWidth.constant = getScreenWidth()*3 - scrollView.isPagingEnabled = true - scrollView.showsHorizontalScrollIndicator = false - scrollView.showsVerticalScrollIndicator = false - - AliVcMediaPlayer.setAccessKeyDelegate(self) - NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.becomeActive), name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.resignActive), name: NSNotification.Name.UIApplicationWillResignActive, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.keyboardFrrameChange(noti:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil) - - playMoive() - changeMPlayFrame() - mPlayer.scalingMode = scalingModeAspectFit - commentTimer = Timer(timeInterval: 0.1, target: self, selector: #selector(MoivePlayerViewController.commentTimerFired), userInfo: nil, repeats: true) - commentNUM = 0 - RunLoop.current.add(commentTimer, forMode: .commonModes) - manager = RiverRunCommentManager(comments: commentArray, delegate: self, andPresent: sunTitleView) - manager.start() - self.view.sendSubview(toBack: sunTitleView) - - NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.networkStateChange), name: NSNotification.Name.reachabilityChanged, object: nil) - conn = Reachability.forInternetConnection() - conn.startNotifier() - toolsCreat() - let parameters:Dictionary=["LiveId":liveDetail.f_Id as AnyObject] - AppDelegate.instance().httpServer.postLiveComment(parameters: parameters) { (str, error) in - if error==nil { - - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - for item in json.contentData().arrayValue{ - self.leaveMessageArr.append(Comment(json: item)) - } - self.leaveMessageArr.sort(by: { (l1, l2) -> Bool in - return l1.f_CreatorTime < l2.f_CreatorTime - }) - self.leaveMessageTableView.reloadData() - if self.leaveMessageArr.count > 0{ - self.leaveMessageTableView.scrollToRow(at: IndexPath(row: self.leaveMessageArr.count-1, section: 0), at: .bottom, animated: false) - } - }, failHandler: { (error) in - self.view.makeToast("获取留言失败:\(error.localizedDescription)") - }) - } - } - } - - XSTLiveManager.shareXSTLiveManager().enterLive(roomId: liveDetail.f_RoomId, completion: { - succ,room,member in - if !succ{ - self.sendWord.placeholder = "请您先登录,在发送消息" - self.sendWord.isUserInteractionEnabled = false - - }else{ - self.activePersonNum = room!.onlineUserCount - self.activeNum.text = "\(room!.onlineUserCount)" - } - }) - XSTLiveManager.shareXSTLiveManager().fetchLiveInfo(roomId: liveDetail.f_RoomId, completion: { suc , room in - if suc { - } - }) - sendWordView.frame = CGRect(x: 0, y: getScreenHeight()-50, width: getScreenWidth(), height: 50) - - - // Do any additional setup after loading the view. - } - - func toolsCreat(){ - sendWordView = UIView(frame: CGRect(x: 0, y: getScreenHeight()-50, width: getScreenWidth(), height: 50)) - sendWordView.backgroundColor = UIColor.lightGray.withAlphaComponent(0.7) - self.view.insertSubview(sendWordView, belowSubview: shareView) -// presentView = UIButton(frame: CGRect(x: sendWordView.frame.size.width-42, y: 8, width: 34, height: 34)) -// presentView.setImage(#imageLiteral(resourceName: "礼物数量.png").withRenderingMode(.alwaysTemplate), for: .normal) -// presentView.tintColor = Theme.topBarColor() -// -// presentView.backgroundColor = UIColor.white -// presentView.layer.cornerRadius = 5 -// presentView.layer.masksToBounds = true -// presentView.addTarget(self, action: #selector(MoivePlayerViewController.presentBtnClick), for: .touchUpInside) -// sendWordView.addSubview(presentView) - -// recharge = UIButton(frame: CGRect(x: presentView.frame.origin.x - 58, y: 8, width: 50, height: 34)) -// recharge.backgroundColor = UIColor.white -// recharge.setTitle("充值", for: .normal) -// recharge.titleLabel?.font = UIFont.systemFont(ofSize: 15) -// recharge.setTitleColor(Theme.topBarColor(), for: .normal) -// -// recharge.layer.cornerRadius = 5 -// recharge.layer.masksToBounds = true -// -// recharge.addTarget(self, action: #selector(MoivePlayerViewController.rechargeBtnClick), for: .touchUpInside) -// sendWordView.addSubview(recharge) -// -// sendWord = UITextField(frame: CGRect(x: 8, y: 8, width: recharge.frame.origin.x - 16, height: 34)) - sendWord = UITextField(frame: CGRect(x: 8, y: 8, width: getScreenWidth() - 16 - 76, height: 34)) - - sendWord.delegate = self - sendWord.returnKeyType = .send - sendWord.layer.cornerRadius = 5 - sendWord.placeholder = "请输入聊天内容" - sendWord.backgroundColor = UIColor.white - sendWord.font = UIFont.systemFont(ofSize: 15) - sendWord.layer.masksToBounds = true - sendWord.layer.borderColor = UIColor.lightGray.cgColor - sendWord.layer.borderWidth = 1 - sendWordView.addSubview(sendWord) - - sendWordBtn = UIButton(frame: CGRect(x: sendWord.frame.maxX + 8, y: 8, width: 60, height: 34)) - sendWordBtn.backgroundColor = Theme.topBarColor() - sendWordBtn.setTitle("发 送", for: .normal) - sendWordBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15) - sendWordBtn.setTitleColor(UIColor.white, for: .normal) - - sendWordBtn.layer.cornerRadius = 5 - sendWordBtn.layer.masksToBounds = true - - sendWordBtn.addTarget(self, action: #selector(MoivePlayerViewController.sendmessage(_:)), for: .touchUpInside) - sendWordView.addSubview(sendWordBtn) - - - } - // 返回状态栏的样式 - override var preferredStatusBarStyle: UIStatusBarStyle{ - return UIStatusBarStyle.lightContent - } - - func rechargeBtnClick(){ - AppDelegate.instance().window?.makeToast("敬请期待...") - } - - func presentBtnClick(){ - AppDelegate.instance().window?.makeToast("敬请期待...") - } - - override func viewWillDisappear(_ animated: Bool) { - super.viewWillDisappear(animated) - if timer != nil{ - timer.invalidate() - timer = nil - } - XSTLiveManager.shareXSTLiveManager().removeLive(roomId: liveDetail.f_RoomId, completion: { - succ in - - }) - } - - override func viewDidAppear(_ animated: Bool) { - super.viewDidAppear(animated) - AppDelegate.instance().blockRotation = true - systemBrightness = UIScreen.main.brightness - } - - override func viewDidDisappear(_ animated: Bool) { - super.viewDidDisappear(animated) - UIScreen.main.brightness = systemBrightness - } - - func keyboardFrrameChange(noti:NSNotification){ - self.view.insertSubview(sendWordView, belowSubview: shareView) - sendWordView.frame.origin.x = 0 - sendWordView.frame.origin.y = getScreenHeight() - 50 - let userinfor = noti.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue - let rect = userinfor!.cgRectValue - UIView.animate(withDuration: 0.25, animations: { - self.sendWordView.frame.origin.y = getScreenHeight() - rect.size.height - 50 - }, completion: { finsh in - if rect.origin.y != getScreenHeight(){ - self.displayAllBtn() - } - }) - } - - func becomeActive(){ - EnterForeGroundPlayVideo() - - } - - func resignActive(){ - EnterBackGroundPauseVideo() - } - - func EnterBackGroundPauseVideo(){ - if mPlayer != nil && !mPaused { - mPlayer.pause() - } - UIScreen.main.brightness = systemBrightness - } - - func EnterForeGroundPlayVideo(){ - if mPlayer != nil && !mPaused { - mPlayer.play() - - } - UIScreen.main.brightness = systemBrightness - } - - func networkStateChange(){ - if mSourceURL != nil && mSourceURL.isFileURL{ - checkNetworkState() - } - } - - func checkNetworkState(){ - let wifi = Reachability.forLocalWiFi() - conn = Reachability.forInternetConnection() - if wifi?.currentReachabilityStatus() != NotReachable{ - NSLog("有wifi") - }else if conn.currentReachabilityStatus() != NotReachable{ - NSLog("使用手机自带网络进行上网") - }else{ - NSLog("没有网络") - } - } - func displayAllBtn(){ - for i in 0...4{ - self.view.viewWithTag(200+i)?.isHidden = false - } - sendWordView.isHidden = false - if timer != nil{ - timer.invalidate() - timer = nil - } - if self.sendWordView.frame.origin.y == getScreenHeight()-50{ - timer = Timer.scheduledTimer(timeInterval: 3, target: self, selector: #selector(MoivePlayerViewController.hiddenAllBtn), userInfo: nil, repeats: false) - } - } - - func hiddenAllBtn(){ - for i in 0...4{ - self.view.viewWithTag(200+i)?.isHidden = true - } - if screenHorizontalBtn.isSelected{ - sendWordView.isHidden = true - } - } - - func setupControls(){ - mPlayerView = UIView(frame: CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenHeight())) - mPlayerView.backgroundColor = UIColor.clear - self.view.insertSubview(mPlayerView, at: 0) - //缓冲指示 - activityBackgroundView = UIView() - activityBackgroundView.backgroundColor = UIColor.black.withAlphaComponent(0.5) - activityBackgroundView.alpha = 0 - activityBackgroundView.center = mPlayerView.center - activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge) - activityIndicator.hidesWhenStopped = true - activityIndicator.center = mPlayerView.center - activityIndicator.alpha = 0 - - } - - func playMoive(){ - if mSourceURL == nil{ - return - } - setupControls() - mPlayer = AliVcMediaPlayer() - mPlayer.create(mPlayerView) - mPlayer.view.isUserInteractionEnabled = true - addPlayerObserver() - mPlayer.mediaType = MediaType_AUTO - mPlayer.timeout = 25000 - mPlayer.dropBufferDuration = 8000 - mPlayer.scalingMode = scalingModeAspectFitWithCropping - isReplay = false - - var err = mPlayer.prepare(toPlay: mSourceURL) - if err != ALIVC_SUCCESS{ - activityBackgroundView.removeFromSuperview() - activityIndicator.removeFromSuperview() - return - } - err = mPlayer.play() - if err != ALIVC_SUCCESS{ - return - } - showLoadingIndicators() - - } - - func replayMoive(){ - mPlayer.prepare(toPlay: mSourceURL) - isReplay = false - mPlayer.play() - } - - var scroolPage:CGFloat=0 - @IBAction func isHorScreenClickAction(_ sender: UIButton) { - sendWord.resignFirstResponder() - screenHorizontalBtn.isSelected = !screenHorizontalBtn.isSelected - scrollviewLocalView.isHidden = screenHorizontalBtn.isSelected - if screenHorizontalBtn.isSelected{ - scroolPage = scrollView.contentOffset.x - screenHorizontalBtn.setBackgroundImage(#imageLiteral(resourceName: "screen_part"), for: .normal) - displayAllBtn() - UIApplication.shared.statusBarOrientation = .landscapeRight - UIApplication.shared.keyWindow?.transform = CGAffineTransform(rotationAngle: CGFloat(M_PI_2)) - UIApplication.shared.keyWindow?.frame = CGRect(x: 0, y: 0, width: getScreenHeight(), height: getScreenWidth()) - }else{ - screenHorizontalBtn.setBackgroundImage(#imageLiteral(resourceName: "screen_full"), for: .normal) - UIApplication.shared.statusBarOrientation = .portrait - UIApplication.shared.keyWindow?.transform = CGAffineTransform(rotationAngle: 0) - UIApplication.shared.keyWindow?.frame = CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenHeight()) - scrollView.contentOffset.x = scroolPage - } - changeMPlayFrame() - sendWordView.frame = CGRect(x: 0, y: getScreenHeight()-50, width: getScreenWidth(), height: 50) -// presentView.frame.origin.x = sendWordView.frame.size.width - 42 -// recharge.frame.origin.x = presentView.frame.origin.x - 58 -// sendWord.frame.size.width = recharge.frame.origin.x - 16 - sendWord.frame.size.width = getScreenWidth() - 76 - sendWordBtn.frame.origin.x = sendWord.frame.maxX + 8 - - if isSendChatMessage != 1{ - self.view.insertSubview(sendWordView, belowSubview: shareView) - } - } - - override var shouldAutorotate: Bool{ - return false - } - - @IBAction func subTitleCloseClickAction(_ sender: UIButton) { - displayAllBtn() - sender.isSelected = !sender.isSelected - subtitleOff = sender.isSelected - if !sender.isSelected{ - sender.setBackgroundImage(#imageLiteral(resourceName: "subTitle_on"), for: .normal) - }else{ - sender.setBackgroundImage(#imageLiteral(resourceName: "subTitle_off"), for: .normal) - } - subTitleClickAction(isOff: sender.isSelected) - } - - @IBAction func cancleKeyboaed(_ sender: Any) { - self.view.endEditing(true) - self.sendWordView.frame.origin.y = getScreenHeight() - (self.sendWordView.superview!.frame.size.height - self.sendWordView.frame.maxY) - 50 - if isSendChatMessage != 1{ - self.view.insertSubview(sendWordView, belowSubview: shareView) - } - UIView.animate(withDuration: 0.25, animations: { - self.sendWordView.frame.origin.y = getScreenHeight() - 50 - self.shareViewBottom.constant = -120 - self.view.layer.layoutIfNeeded() - }, completion: { finsh in - self.displayAllBtn() - }) - } - - @IBAction func subTitleTapClickAction(_ sender: Any) { - cancleKeyboaed(sender) - } - - @IBAction func backBtnClickAction(_ sender: UIButton) { - if screenHorizontalBtn.isSelected{ - isHorScreenClickAction(screenHorizontalBtn) - displayAllBtn() - }else{ - UIApplication.shared.statusBarOrientation = .portrait - UIApplication.shared.keyWindow?.transform = CGAffineTransform(rotationAngle: 0) - UIApplication.shared.keyWindow?.frame = CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenHeight()) - - AppDelegate.instance().blockRotation = false - if mPlayer != nil{ - mPlayer.destroy() - } - removePlayerObserver() - mPlayer = nil - mSourceURL = nil - self.dismiss(animated: true, completion: nil) - } - } - - var subtitleOff:Bool = false - @IBAction func playPauseClickAction(_ sender: UIButton) { - displayAllBtn() - if sender.isSelected{ - sender.setBackgroundImage(#imageLiteral(resourceName: "starLive"), for: .normal) - if isReplay { - mPlayer.prepare(toPlay: mSourceURL) - isReplay = false - } - subTitleClickAction(isOff: subtitleOff); - mPlayer.play() - mPaused = false - mPlayer.muteMode = false - }else{ - sender.setBackgroundImage(#imageLiteral(resourceName: "暂停.png"), for: .normal) - subTitleClickAction(isOff: true); - mPlayer.pause() - mPaused = true - } - sender.isSelected = !sender.isSelected - // self.perform(#selector(MoivePlayerViewController.hideControls(com)), with: nil, afterDelay: fadeDelay) - - } - - @IBAction func shareBtnClick(_ sender: UIButton) { - displayAllBtn() - UIView.animate(withDuration: 0.25, animations: { - self.shareViewBottom.constant = 0 - self.view.layer.layoutIfNeeded() - }) - } - - @IBAction func shareTapGestrueClick(_ sender: UITapGestureRecognizer) { - var platformType:UMSocialPlatformType! - var text:String = "大家快来观看,\(AppDelegate.instance().accountManager.name())正在直播" - switch sender.view!.tag { - case 300://微信朋友圈 - platformType=UMSocialPlatformType.wechatTimeLine - break - case 301://微信 - platformType=UMSocialPlatformType.wechatSession - text = "\(AppDelegate.instance().accountManager.name())给您分享了一个直播,快来看啊" - break - case 302://QQ空间 - platformType=UMSocialPlatformType.qzone - - break - case 303://新浪微博 - platformType=UMSocialPlatformType.sina - //要求text加url - break - case 304://QQ - platformType=UMSocialPlatformType.QQ - text = "\(AppDelegate.instance().accountManager.name())给您分享了一个直播,快来看啊" - break - default: - break - } - var title:String = liveDetail.f_LiveName - if liveDetail.f_LiveName.characters.count > 8{ - title = (liveDetail.f_LiveName as NSString).substring(to: 7)+"..." - } - shareUrl(text: text, url: "http://www.sxspy.net/MZhiBo/Index?LiveId="+liveDetail.f_Id, VC: self, image: #imageLiteral(resourceName: "subTitle_on"), platformType: platformType,title:title) - } - - - - func textFieldShouldReturn(_ textField: UITextField) -> Bool { - textField.resignFirstResponder() - UIView.animate(withDuration: 0.25, animations: { - self.sendWordView.frame.origin.y = getScreenHeight() - 50 - }, completion: { finsh in - self.displayAllBtn() - }) - sendMessage() - return false - } - - func sendMessage(){ - if sendWord.text != ""&&sendWord.text?.replacingOccurrences(of:" " , with: "") != ""{ - if isSendChatMessage == 0{ - XSTLiveManager.shareXSTLiveManager().sendMessage(str: sendWord.text!, roomId: liveDetail.f_RoomId, completion: {succ in - if !succ{ - AppDelegate.instance().window?.makeToast("消息发送失败") - } - }) - }else{//发送留言 - AppDelegate.instance().httpServer.getLiveUserComment(parameters: ["LiveId":liveDetail.f_Id as AnyObject,"CommentDetail":sendWord.text! as AnyObject], completionHandler: { (str, error) in - if error == nil && JSON.fromString(jsonString: str)!["status"].intValue == 1{ - AppDelegate.instance().window?.makeToast("留言成功") - let com = Comment() - com.f_RealName = AppDelegate.instance().accountManager.name() - com.f_HeadIcon = AppDelegate.instance().accountManager.photo() - com.f_CreatorUserId = AppDelegate.instance().accountManager.userid - com.f_CreatorTime = currentTime() - com.liveId = self.liveDetail.f_Id - com.commentDetail = self.sendWord.text! - self.leaveMessageArr.append(com) - self.sendWord.text = "" - self.leaveMessageTableView.insertRows(at: [IndexPath(item: self.leaveMessageArr.count - 1, section: 0)], with: .bottom) - self.leaveMessageTableView.scrollToRow(at: IndexPath(item: self.leaveMessageArr.count-1, section: 0), at: .bottom, animated: true) - - }else{ - AppDelegate.instance().window?.makeToast("留言失败:\(error?.localizedDescription)") - } - }) - } - }else{ - if isSendChatMessage == 0{ - AppDelegate.instance().window?.makeToast("不能发送内容为空消息") - }else{ - AppDelegate.instance().window?.makeToast("不能发送内容为空留言") - } - } - } - - @IBAction func sendmessage(_ sender: UIButton) { - sendMessage() - } - - @IBAction func sendLeavemessagemessage(_ sender: UIButton) { - - } - - func onRecvMessages(_ messages: [NIMMessage]) { - for message in messages { - if message.messageType == NIMMessageType.notification{ - if message.messageType == NIMMessageType.notification{ - - if let name = ((message.messageObject as! NIMNotificationObject).content as! NIMChatroomNotificationContent).notifyExt { - if name != "name"+AppDelegate.instance().accountManager.name(){ - self.activePersonNum = self.activePersonNum+1 - } - }else{ - self.activePersonNum = self.activePersonNum-1 - } - self.activeNum.text = "在线人数:\(self.activePersonNum)" - } - } - - if message.session?.sessionId == liveDetail.f_RoomId && message.text != nil{ - messageArr.append(message) - chatTableView.insertRows(at: [IndexPath(row: messageArr.count-1, section: 0)], with: .middle) - chatTableView.scrollToRow(at: IndexPath(item: messageArr.count-1, section: 0), at: .bottom, animated: true) - if !subtitleOff{ - manager.comments.addObjects(from: self.createVideoComment(message: message)) - } - } - } - } - - func send(_ message: NIMMessage, didCompleteWithError error: Error?) { - if error == nil{ - if !subtitleOff{ - manager.comments.addObjects(from: self.createVideoComment(message: message)) - } - messageArr.append(message) - chatTableView.insertRows(at: [IndexPath(row: messageArr.count-1, section: 0)], with: .bottom) - sendWord.text = "" - chatTableView.scrollToRow(at: IndexPath(item: messageArr.count-1, section: 0), at: .bottom, animated: true) - }else{ - - } - } - - func showLoadingIndicators(){ - self.view.addSubview(activityBackgroundView) - self.view.addSubview(activityIndicator) - activityIndicator.startAnimating() - UIView.animate(withDuration: 0.2, animations: { - self.activityBackgroundView.alpha = 1 - self.activityIndicator.alpha = 1 - }) - } - - func hideLoadingIndicators(){ - UIView.animate(withDuration: 0.2, delay: 0, options: .layoutSubviews, animations: { - self.activityBackgroundView.alpha = 0 - self.activityIndicator.alpha = 0 - - }) { (finish) in - self.activityBackgroundView.removeFromSuperview() - self.activityIndicator.removeFromSuperview() - - } - } - - func changeMPlayFrame(){ - if mPlayer != nil && mPlayer.videoWidth != 0{ - let widthbi = CGFloat(mPlayer.videoWidth)/getScreenWidth() - let heightBi = CGFloat(mPlayer.videoHeight)/getScreenHeight() - if widthbi < heightBi || getScreenWidth()>getScreenHeight(){ - mPlayerView.frame = CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenHeight()) - }else{ - mPlayerView.frame = CGRect(x: 0, y: 0, width: getScreenWidth(), height: CGFloat(ceil(CGFloat(mPlayer.videoHeight)/widthbi))) - } - - let height = getScreenHeight() - mPlayerView.frame.size.height - if height > 100{ - scrollHeight.constant = height - }else{ - scrollHeight.constant = 50 - } - }else{ - mPlayerView.frame = CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenWidth()/5*3) - let height = getScreenHeight() - mPlayerView.frame.size.height - if height > 100{ - scrollHeight.constant = height - }else{ - scrollHeight.constant = 50 - } - } - mPlayer.view = mPlayerView - activityIndicator.center = mPlayerView.center - activityBackgroundView.center = mPlayerView.center - } - - func OnVideoPrepared(noti:Notification){ - timer = Timer.scheduledTimer(timeInterval: 3, target: self, selector: #selector(MoivePlayerViewController.hiddenAllBtn), userInfo: nil, repeats: false) - changeMPlayFrame() - hideLoadingIndicators() - } - - func OnVideoError(noti:Notification){ - isReplay = true - var error_msg = "未知的错误" - let error_code:AliVcMovieErrorCode = mPlayer.errorCode - switch error_code { - case ALIVC_ERR_FUNCTION_DENIED: - error_msg = "未授权" - case ALIVC_ERR_ILLEGALSTATUS: - error_msg = "非法的播放流程" - case ALIVC_ERR_INVALID_INPUTFILE: - error_msg = " 主播还未开播..." - hideLoadingIndicators() - case ALIVC_ERR_NO_INPUTFILE: - error_msg = "无输入文件" - hideLoadingIndicators() - case ALIVC_ERR_NO_NETWORK: - error_msg = "网络连接失败" - case ALIVC_ERR_NO_SUPPORT_CODEC: - error_msg = "不支持的视频编码格式" - hideLoadingIndicators() - case ALIVC_ERR_NO_VIEW: - error_msg = "无显示窗口" - hideLoadingIndicators() - case ALIVC_ERR_NO_MEMORY: - error_msg = "内存不足" - case ALIVC_ERR_DOWNLOAD_TIMEOUT: - error_msg = "网络超时" - case ALIVC_ERR_UNKOWN: - error_msg = "未知错误" - default: - break; - } - if error_code > 500||error_code == ALIVC_ERR_FUNCTION_DENIED{ - mPlayer.reset() - let alertView = UIAlertController(title: nil, message: error_msg, preferredStyle: .alert) - alertView.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil)) - self.present(alertView, animated: true, completion: nil) - } - if error_code == ALIVC_ERR_DOWNLOAD_TIMEOUT{ - mPlayer.pause() - let alertView = UIAlertController(title: nil, message: error_msg, preferredStyle: .alert) - alertView.addAction(UIAlertAction(title: "等待", style: .cancel, handler: nil)) - alertView.addAction(UIAlertAction(title: "重新连接", style: .default, handler: { (action) in - self.mPlayer.stop() - self.showLoadingIndicators() - self.isReplay = true -// replay() - })) - self.present(alertView, animated: true, completion: nil) - - } - - } - - func OnVideoFinish(noti:Notification){ - isReplay = true - - } - - func OnSeekDone(noti:Notification){ - - } - - func OnStartCache(noti:Notification){ - showLoadingIndicators() - } - - func OnEndCache(noti:Notification){ - hideLoadingIndicators() - } - - - func addPlayerObserver(){ - NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnVideoPrepared(noti:)), name: NSNotification.Name.AliVcMediaPlayerLoadDidPrepared, object: mPlayer) - NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnVideoError(noti:)), name: NSNotification.Name.AliVcMediaPlayerPlaybackError, object: mPlayer) - NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnVideoFinish(noti:)), name: NSNotification.Name.AliVcMediaPlayerPlaybackDidFinish, object: mPlayer) - NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnSeekDone(noti:)), name: NSNotification.Name.AliVcMediaPlayerSeekingDidFinish, object: mPlayer) - NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnStartCache(noti:)), name: NSNotification.Name.AliVcMediaPlayerStartCaching, object: mPlayer) - NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnEndCache(noti:)), name: NSNotification.Name.AliVcMediaPlayerEndCaching, object: mPlayer) - - } - - func removePlayerObserver(){ - NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerLoadDidPrepared, object: mPlayer) - NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerPlaybackError, object: mPlayer) - NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerPlaybackDidFinish, object: mPlayer) - NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerSeekingDidFinish, object: mPlayer) - NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerStartCaching, object: mPlayer) - NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerEndCaching, object: mPlayer) - } - - func willShowComments(_ seek: Bool) -> CGFloat { - return commentNUM - } - - - func commentTimerFired(){ - commentNUM = 0.1+commentNUM - } - - func createVideoComment(message:NIMMessage)->[Any]{ - var videoComments:[Any] = [] - let vpos:CGFloat = 200 - let commentInfo:[NSString:AnyObject] = ["vpos": vpos as AnyObject, - "body": message.text! as AnyObject, - "position": RiverRunCommentUtil.commentPosition(RiverRunCommentUtil.getRandomPosition()) as AnyObject, - "fontSize": RiverRunCommentUtil.commentSize(RiverRunCommentUtil.getRandomFontSize()) as AnyObject, - "color": "0x000000" as AnyObject, - "duration":3 as AnyObject] - videoComments.append(commentInfo) - return videoComments - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - //弹幕开关 - func subTitleClickAction(isOff:Bool){ - manager.deleteAllCommentLayer() - manager.comments.removeAllObjects() - if isOff{ - manager.stop() - }else{ - manager.start() - } - } - - // MARK: - tableViewDelegate - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - if tableView == chatTableView{ - return messageArr.count - }else{ - return leaveMessageArr.count - } - } - - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - var str:String! - if tableView == chatTableView{ - str = messageArr[indexPath.row].remoteExt!["name"] as! String + " : " + messageArr[indexPath.row].text! - }else{ - str = leaveMessageArr[indexPath.row].f_RealName + " : " + leaveMessageArr[indexPath.row].commentDetail - } - return (str as NSString).boundingRect(with: CGSize(width: getScreenWidth()-44, height: CGFloat(MAXFLOAT)), options: .usesLineFragmentOrigin, attributes: [NSFontAttributeName:UIFont.systemFont(ofSize: 13)], context: nil).size.height + 40 - - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - if tableView == chatTableView{ - let item = messageArr[indexPath.row] - let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! ChatCell - cell.backgroundColor = UIColor.clear - cell.context.text = item.remoteExt!["name"] as! String + " : " + item.text! - cell.context.numberOfLines = 0 - cell.context.sizeToFit() - if let imageName = NIMSDK.shared().userManager.userInfo(item.from!)?.userInfo?.avatarUrl{ - cell.userImage.sd_setImage(with: URL(string:imageName), placeholderImage: #imageLiteral(resourceName: "default_userRoom")) - }else{ - cell.userImage.image = #imageLiteral(resourceName: "default_userRoom") - } - cell.timeLabel.text = makeTimeIntervalToString(time: item.timestamp) - return cell - }else{ - let item = leaveMessageArr[indexPath.row] - let cell = tableView.dequeueReusableCell(withIdentifier: "cell1", for: indexPath) as! LeaveMessageCell - cell.userImage.sd_setImage(with: URL(string:item.f_HeadIcon), placeholderImage: #imageLiteral(resourceName: "default_userRoom")) - cell.context.text = item.f_RealName + " : " + item.commentDetail! - cell.context.numberOfLines = 0 - cell.context.sizeToFit() - cell.timeLabel.text = item.f_CreatorTime - return cell - } - } - - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if segue.identifier == "inforScroll"{ - let vc = segue.destination as! AlivcInforViewController - vc.liveDetail = liveDetail - self.present(vc, animated: false, completion: nil) - } - } - - @IBOutlet weak var btnFlagLabel: UILabel! - func scrollViewDidScroll(_ scrollView: UIScrollView) { - if scrollView.classForCoder != UITableView.classForCoder(){ - sendWord.resignFirstResponder() - if !screenHorizontalBtn.isSelected { - sendWordView.frame.origin.y = scrollView.frame.size.height - 50 - sendWordPlaceholder(isChat: scrollView.contentOffset.x < getScreenWidth()) - let x = Int(scrollView.contentOffset.x) - let width = Int(getScreenWidth()) - var num = 0 - if x%width > width/2{ - num = x/width + 1 - }else{ - num = x/width - } - isSendChatMessage = num - UIView.animate(withDuration: 0.2, animations: { - self.btnFlagLabel.frame.origin.x = self.getBtnFlagLabelOrightX(num: CGFloat(num)) - }) - }else{ - scrollView.contentOffset.x = CGFloat(isSendChatMessage)*getScreenHeight() - } - } - } - - @IBAction func chatBtnClick(_ sender: UIButton) { - sendWord.resignFirstResponder() - sendWordView.frame.origin.y = scrollView.frame.size.height - 50 - sendWordPlaceholder(isChat: sender.tag == 1000) - isSendChatMessage = sender.tag - 1000 - UIView.animate(withDuration: 0.2, animations: { - self.btnFlagLabel.frame.origin.x = self.getBtnFlagLabelOrightX(num: CGFloat(sender.tag-1000)) - self.scrollView.contentOffset.x = getScreenWidth() * CGFloat(sender.tag-1000) - }) - } - - func sendWordPlaceholder(isChat:Bool){ - if isChat{ - chatLocalView.addSubview(sendWordView) - sendWord.placeholder = "请输入聊天内容" - }else{ - leaveMessageLocalView.addSubview(sendWordView) - sendWord.placeholder = "请输入留言信息" - } - if !sendWord.isUserInteractionEnabled { - self.sendWord.placeholder = "请您先登录,在发送消息" - } - } - - func getBtnFlagLabelOrightX(num:CGFloat)->CGFloat{ - return num+num*((getScreenWidth()-2)/3) - } - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. - } - */ - -} - -class LeaveMessageCell: UITableViewCell { - - @IBOutlet weak var userImage: UIImageView! - @IBOutlet weak var timeLabel: UILabel! - @IBOutlet weak var context: UILabel! - override func awakeFromNib() { - userImage.layer.cornerRadius = userImage.frame.size.height/2 - userImage.layer.masksToBounds = true - } -} - -class ChatCell: UITableViewCell { - - @IBOutlet weak var userImage: UIImageView! - @IBOutlet weak var timeLabel: UILabel! - @IBOutlet weak var context: UILabel! - override func awakeFromNib() { - userImage.layer.cornerRadius = userImage.frame.size.height/2 - userImage.layer.masksToBounds = true - } -} - -class Comment { - var f_CreatorUserId:String! - var f_CreatorTime:String! - var commentDetail:String! - var liveId:String! - var f_HeadIcon:String! - var f_RealName:String! - var f_NickName:String! - init(json:JSON){ - f_CreatorUserId = json["f_CreatorUserId"].stringValue - f_CreatorTime = allTimeStringComp(str:json["f_CreatorTime"].stringValue) - commentDetail = json["commentDetail"].stringValue - liveId = json["liveId"].stringValue - f_HeadIcon = json["f_HeadIcon"].stringValue - f_RealName = json["f_RealName"].stringValue - f_NickName = json["f_NickName"].stringValue - } - init(){ - - } -} diff --git a/YouerLiveVideo/YouerLiveVideo/AppDelegate.swift b/YouerLiveVideo/YouerLiveVideo/AppDelegate.swift index a1f7168..5459c72 100644 --- a/YouerLiveVideo/YouerLiveVideo/AppDelegate.swift +++ b/YouerLiveVideo/YouerLiveVideo/AppDelegate.swift @@ -20,7 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate,NIMLoginManagerDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { httpServer.accountManager=accountManager accountManager.setTokenInfo(tokenInfo: accountManager.loadToken()) - setShareSDKSetting() +// setShareSDKSetting() setNIMSDKRegister() return true } diff --git a/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard b/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard index cd005fa..d9717f2 100644 --- a/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard +++ b/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard @@ -156,7 +156,7 @@ - + @@ -218,7 +218,7 @@ - + @@ -490,49 +490,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -551,673 +513,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1342,13 +637,11 @@ - - diff --git a/YouerLiveVideo/YouerLiveVideo/YouerLiveVideo-Bridging-Header.h b/YouerLiveVideo/YouerLiveVideo/YouerLiveVideo-Bridging-Header.h index 8c30ef2..9f0d13e 100644 --- a/YouerLiveVideo/YouerLiveVideo/YouerLiveVideo-Bridging-Header.h +++ b/YouerLiveVideo/YouerLiveVideo/YouerLiveVideo-Bridging-Header.h @@ -10,7 +10,6 @@ #define YouerLiveVideo_Bridging_Header_h #import #import -#import "AlivcLiveViewController.h" #import "UIView+Toast.h" #import "ZSDSetPasswordView.h" #import diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/AttentionTableViewCell.swift b/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/AttentionTableViewCell.swift deleted file mode 100644 index ae92692..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/AttentionTableViewCell.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// AttentionTableViewCell.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/19. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class AttentionTableViewCell: UITableViewCell { - @IBOutlet var iconImage: UIImageView! - @IBOutlet var personNameLabel: UILabel! - @IBOutlet var titleLabel: UILabel! - @IBOutlet var personNumberLabel: UILabel! - @IBOutlet var attentionBtn: UIButton! - var organizeSchool:OrganizeListSchool! - var superVC:UIViewController! - override func awakeFromNib() { - super.awakeFromNib() - } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - } - - @IBAction func attentionAction(_ sender: UIButton) { - SVProgressHUD.show(withStatus: "加载中...") - SVProgressHUD.setDefaultMaskType(.black) - let parameters:Dictionary=["F_OrganizeId":organizeSchool.f_Id as AnyObject,"F_Action":0 as AnyObject] - AppDelegate.instance().httpServer.setIsAction(parameters: parameters, completionHandler: { (str, error) in - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - (self.superVC as! MyAttentionViewController).getActSchoolList() - }, failHandler: { (error) in - AppDelegate.instance().window?.makeToast("取消关注失败:\(error.localizedDescription)") - }) - }else{ - AppDelegate.instance().window?.makeToast("取消关注失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - AppDelegate.instance().window?.makeToast("取消关注失败:\(error!.description)") - } - }) - } - - func setupWith(item:OrganizeListSchool,isMy:Bool){ - if isMy { - attentionBtn.isHidden=false - }else{ - attentionBtn.isHidden=true - } - organizeSchool=item - personNameLabel.text=item.f_FullName - personNumberLabel.text="\(item.f_Views)人正在观看" - } -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/AttentionTableViewCell.xib b/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/AttentionTableViewCell.xib deleted file mode 100644 index 011b538..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/AttentionTableViewCell.xib +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/HomeTableViewCell.swift b/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/HomeTableViewCell.swift deleted file mode 100644 index 0e9b3dc..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/HomeTableViewCell.swift +++ /dev/null @@ -1,79 +0,0 @@ -// -// HomeTableViewCell.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/14. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class HomeTableViewCell: UITableViewCell { - @IBOutlet var personIcon: UIImageView! - @IBOutlet var titleLabel: UILabel! - @IBOutlet var timeLabel: UILabel! - @IBOutlet var detailView: UIView! - @IBOutlet var numberPeople: UILabel! - @IBOutlet var numberCare: UILabel! - @IBOutlet var passLabel: UILabel! - @IBOutlet var liveimageView: UIImageView! - @IBOutlet var tagLabel: UILabel! - - @IBOutlet weak var rommNameLabel: UILabel! - let formatte=DateFormatter() - override func awakeFromNib() { - super.awakeFromNib() - tagLabel.layer.cornerRadius = 5 - tagLabel.layer.masksToBounds=true - tagLabel.layer.borderWidth=1.0 - tagLabel.layer.borderColor=Theme.topBarColor().cgColor - formatte.dateFormat="yyyy-MM-dd HH:mm:ss" - } - func setUpWith(item:LiveDetail){ - passLabel.isHidden=true - detailView.isHidden=true - personIcon.sd_setImage(with: URL(string:item.f_HeadIcon), placeholderImage: UIImage(named:"defphoto")) - titleLabel.text=item.f_RealName - timeLabel.text=formatte.string(from: Date(timeIntervalSince1970: JSON.fromString(jsonString: item.f_Description)!["starttime"].doubleValue/1000 as TimeInterval)) - liveimageView.sd_setImage(with: URL(string:item.f_LiveImg), placeholderImage: UIImage(named:"placeholder")) - tagLabel.text=" "+item.f_CategoryName+" " - rommNameLabel.text = item.f_LiveName - } - func setUpWith(type:LivesType,item:LiveDetail){ - personIcon.sd_setImage(with: URL(string:item.f_HeadIcon), placeholderImage: UIImage(named:"defphoto")) - titleLabel.text=item.f_LiveName - timeLabel.text=formatte.string(from: Date(timeIntervalSince1970: JSON.fromString(jsonString: item.f_Description)!["starttime"].doubleValue/1000 as TimeInterval)) - liveimageView.sd_setImage(with: URL(string:item.f_LiveImg), placeholderImage: UIImage(named:"placeholder")) - tagLabel.text=item.f_CategoryName - switch type { - case LivesType.liveList://直播列表 - passLabel.isHidden=false - detailView.isHidden=true - if item.f_IsExamine==1 { - passLabel.backgroundColor=Theme.topBarColor() - passLabel.text="已通过" - }else if item.f_IsExamine==2 { - passLabel.backgroundColor=UIColor.gray - passLabel.text="未通过" - }else{ - passLabel.backgroundColor=UIColor.gray - passLabel.text="待审核" - } - break - case LivesType.liveHistory://直播历史 - passLabel.isHidden=true - detailView.isHidden=false - //多少人观看,多少人关注 - break - default: - passLabel.isHidden=true - detailView.isHidden=false - } - } - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - - // Configure the view for the selected state - } - -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/HomeTableViewCell.xib b/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/HomeTableViewCell.xib deleted file mode 100644 index 1d45a4a..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/HomeTableViewCell.xib +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/LiveTitleView.swift b/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/LiveTitleView.swift deleted file mode 100644 index c023fa4..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/LiveTitleView.swift +++ /dev/null @@ -1,105 +0,0 @@ -// -// LiveTitleView.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/14. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class LiveTitleView: UIView,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout { - var typeCollectionView: UICollectionView! - var superViewController:HomeDetailViewController! - var liveTypeArray:[LiveType]=[] - var type:String="Live" - override func awakeFromNib() { - super.awakeFromNib() - let flowLayout = UICollectionViewFlowLayout() - flowLayout.scrollDirection=UICollectionViewScrollDirection.vertical - flowLayout.minimumLineSpacing = 0 - flowLayout.minimumInteritemSpacing = 0 - flowLayout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) - - typeCollectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenWidth()/2), collectionViewLayout: flowLayout) - typeCollectionView.showsVerticalScrollIndicator = false - typeCollectionView.showsHorizontalScrollIndicator = false - typeCollectionView.delegate = self; - typeCollectionView.dataSource = self; - typeCollectionView.backgroundColor = UIColor.white - typeCollectionView.register(UINib(nibName: "liveTitleCollectionCell", bundle: nil), forCellWithReuseIdentifier: "liveTitleCollectionCell") - self.addSubview(typeCollectionView) - getLiveTypeList() - } - func getLiveTypeList(){ - AppDelegate.instance().httpServer.postLiveType(type: type) { (str, error) in - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.liveTypeArray=LiveType.getAllLiveType(j: json) - self.typeCollectionView.reloadData() - }, failHandler: { (error) in - NSLog("获取分类列表失败:\(error.localizedDescription)") - }) - }else{ - NSLog("获取分类列表失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - NSLog("获取分类列表失败失败:\(error!.description)") - } - } - } - //MARK: - UICollectionViewDelegateFlowLayout - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: getScreenWidth()/4, height: getScreenWidth()/4) - } - //MARK: - UICollectionViewDelegate,UICollectionViewDataSource - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - if liveTypeArray.count>7{ - return 8 - } - return liveTypeArray.count - } - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell=collectionView.dequeueReusableCell(withReuseIdentifier: "liveTitleCollectionCell", for: indexPath) as! liveTitleCollectionCell - //对cell 内进行赋值 - if liveTypeArray.count <= 7{ - cell.setUpWith(type: liveTypeArray[indexPath.row]) - }else{ - if indexPath.row==7 { - cell.imageView.image=UIImage(named: "moreClass") - cell.titleLabel.text="更多分类" - }else{ - cell.setUpWith(type: liveTypeArray[indexPath.row]) - } - } - return cell - } - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - let item=liveTypeArray[indexPath.row] - if liveTypeArray.count <= 7{ - let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "LiveTypeListViewController") as! LiveTypeListViewController - vc.isType=true - vc.F_LiveType=item.f_Id - vc.title=item.f_LiveTypeName - self.superViewController.navigationController!.pushViewController(vc, animated: true) - }else{ - if indexPath.row==7 { - let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "MoreViewController") as! MoreViewController - vc.type=type - self.superViewController.navigationController!.pushViewController(vc, animated: true) - }else{ - let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "LiveTypeListViewController") as! LiveTypeListViewController - vc.isType=true - vc.F_LiveType=item.f_Id - vc.title=item.f_LiveTypeName - self.superViewController.navigationController!.pushViewController(vc, animated: true) - } - } - } - - @IBAction func selectMoreAction(_ sender: UIButton) { - let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "HotMoreViewController") as! HotMoreViewController - self.superViewController.navigationController!.pushViewController(vc, animated: true) - } -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/LiveTitleView.xib b/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/LiveTitleView.xib deleted file mode 100644 index e8d6fbe..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/LiveTitleView.xib +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/liveTitleCollectionCell.swift b/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/liveTitleCollectionCell.swift deleted file mode 100644 index 35564d4..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/liveTitleCollectionCell.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// liveTitleCollectionCell.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/14. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class liveTitleCollectionCell: UICollectionViewCell { - @IBOutlet var imageView: UIImageView! - @IBOutlet var titleLabel: UILabel! - override func awakeFromNib() { - super.awakeFromNib() - imageView.layer.cornerRadius=(getScreenWidth()/4-45)/2 - } - func setUpWith(type:LiveType){ - imageView.sd_setImage(with: URL(string: type.f_Img), placeholderImage: UIImage(named: "defphoto")) - titleLabel.text=type.f_LiveTypeName - } -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/liveTitleCollectionCell.xib b/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/liveTitleCollectionCell.xib deleted file mode 100644 index 95fafaa..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HomeCellAndTitleView/liveTitleCollectionCell.xib +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HomeDetailViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/HomeDetailViewController.swift deleted file mode 100644 index 5a00a82..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HomeDetailViewController.swift +++ /dev/null @@ -1,308 +0,0 @@ -// -// HomeDetailViewController.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/14. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class HomeDetailViewController: UIViewController,UIScrollViewDelegate,UITableViewDataSource,UITableViewDelegate,PassWordEnterViewDelegate { - - @IBOutlet var menuScrollView: UIScrollView! - - @IBOutlet var scrollView: UIScrollView! - - var menuBgView:UIView! - let menuArray:[String]=["推荐","直播","学校"]//****,"点播" - var recIndex:Int=0 - var liveIndex:Int=0 - var menuBtnArray:[UIButton]=[] - var refreshButton:UIButton? - var tableViewArray:[UITableView]=[] - var refreshTableView:UITableView! //需要刷新的TableView - var allLives:[Int:[LiveDetail]]=Dictionary()//前三个的所有数据 - var allSchoolList:[OrganizeListSchool]=[]//最后一个学校列表 - let menuButtonWidth=getScreenWidth()/3 //****4 - var passWordView:PassWordView! - override func viewDidLoad() { - super.viewDidLoad() - passWordView = Bundle.main.loadNibNamed("PassWordView", owner: nil, options: nil)?[0] as! PassWordView - passWordView.delegate = self - - self.edgesForExtendedLayout=[] - menuScrollView.contentSize=CGSize(width: getScreenWidth(), height: 49) - for i in 0.. ()){ - var LiveName:String="" - var index:Int=0 - var size:Int=10 - switch tag { - case 0: - //点击了推荐 - LiveName="Rec" - index=recIndex - break - case 1: - //点击了直播热门 - LiveName="Hot" - index=liveIndex - break - case 2: - //点击了学校 - LiveName="Org" - size=Int.max - break - default: break - //点击了学校 - } - let parameters:Dictionary=["PageIndex":index as AnyObject,"PageSize":size as AnyObject,"WhatLive":LiveName as AnyObject] - AppDelegate.instance().httpServer.getLive(parameters: parameters, completionHandler: { (str, error) in - var success:Bool=true - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - success=true - let lives=LiveDetail.getAllLives(j: json) - let oldLives=self.allLives[tag] - if lives.count>0{ - if tag==0{ - self.recIndex=self.recIndex+1 - }else if tag==1{ - self.liveIndex=self.liveIndex+1 - } - } - if index != 0{ - self.allLives.updateValue(oldLives!+lives, forKey: tag) - }else{ - self.allLives.updateValue(lives, forKey: tag) - } - }, failHandler: { (error) in - success=false - AppDelegate.instance().window?.makeToast("获取列表失败:\(error.localizedDescription)") - }) - }else{ - success=false - AppDelegate.instance().window?.makeToast("获取列表失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - success=false - AppDelegate.instance().window?.makeToast("获取列表失败:\(error!.description)") - } - completionHandler(success) - }) - } - func refreshSchoolList(tag:Int){ - AppDelegate.instance().httpServer.postLiveOrganizeList(type:"All") { (str, error) in - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.allSchoolList=OrganizeListSchool.getAllSchool(j: json) - self.tableViewArray[tag].reloadData() - }, failHandler: { (error) in - NSLog("获取学校列表失败:\(error.localizedDescription)") - }) - }else{ - NSLog("获取学校列表失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - NSLog("获取学校列表失败:\(error!.description)") - } - } - } - // MARK: - 刷新某个指定的TableView - func refreshTableView(tag:Int){ - //第一次在这里加载数据 - if tag==2{ - if allSchoolList.count==0{ - refreshSchoolList(tag: tag) - } - }else{ - if allLives[tag]?.count==0{ - refreshLivesAction(tag: tag,completionHandler: { (success) in - if success { - self.tableViewArray[tag].reloadData() - } - }) - } - } - - if refreshButton != nil{ - refreshButton!.setTitleColor(UIColor.black, for: UIControlState.normal) - refreshButton=menuBtnArray[tag] - refreshButton!.setTitleColor(Theme.topBarColor(), for: UIControlState.normal) - }else{ - refreshButton=menuBtnArray[0] - refreshButton!.setTitleColor(Theme.topBarColor(), for: UIControlState.normal) - } - refreshTableView=tableViewArray[tag] - var frame=refreshTableView.frame - frame.origin.x=UIScreen.main.bounds.size.width*CGFloat(tag) - refreshTableView.frame=frame -// refreshTableView.reloadData() - } - func changeView(x:CGFloat){ - let xx=x*(menuButtonWidth/UIScreen.main.bounds.size.width) - menuBgView.frame=CGRect(x: xx, y: menuBgView.frame.origin.y, width: menuBgView.frame.size.width, height: 5) - } - // MARK: - UIScrollViewDelegate - func scrollViewDidScroll(_ scrollView: UIScrollView) { - //只要滚动了就会触发 - if !scrollView.isKind(of: UITableView.classForCoder()) { - changeView(x: scrollView.contentOffset.x) - } - } - func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { - //减速停止了时执行,手触摸时执行执行 - if !scrollView.isKind(of: UITableView.classForCoder()) { - let xx=scrollView.contentOffset.x*(menuButtonWidth/UIScreen.main.bounds.size.width)-menuButtonWidth - menuScrollView.scrollRectToVisible(CGRect(x: xx, y: 0, width: UIScreen.main.bounds.size.width, height: menuScrollView.frame.size.height), animated: true) - let i=Int(scrollView.contentOffset.x/UIScreen.main.bounds.size.width) - self.refreshTableView(tag: i) - } - } - var selectLiv:LiveDetail! - // MARK: - UITableViewDataSource,UITableViewDelegate - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - if tableView.tag==2{ - let item=allSchoolList[indexPath.row] - let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "LiveTypeListViewController") as! LiveTypeListViewController - vc.isType=false - vc.F_OrganizeId=item.f_Id - vc.title=item.f_FullName - self.navigationController!.pushViewController(vc, animated: true) - }else{ - selectLiv=allLives[tableView.tag]![indexPath.row] - let dic = JSON.fromString(jsonString: selectLiv.f_Description)! - if dic["Public"].boolValue{ - persentToMoivePlayer(from: self, liv: selectLiv) - }else{ - passWordView.passWord = dic["roompasswd"].stringValue - passWordView.zsdView.clearUpPassword() - passWordView.zsdView.passwordTextField.becomeFirstResponder() - self.view.addSubview(passWordView) - } - } - - } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - if tableView.tag==2{ - return allSchoolList.count - } - return allLives[tableView.tag]!.count - } - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - if tableView.tag==2{ - return 80 - } - return 331 - //return 70+getScreenWidth()/2 - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - if tableView.tag==2{ - let cell=tableView.dequeueReusableCell(withIdentifier: "AttentionTableViewCell") as! AttentionTableViewCell - cell.setupWith(item: allSchoolList[indexPath.row],isMy: false) - cell.superVC=self - return cell - } - let cell=tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! HomeTableViewCell - cell.setUpWith(item: allLives[tableView.tag]![indexPath.row]) - return cell - } - - func passwordView(_ password: String!) { - passWordView.zsdView.passwordTextField.resignFirstResponder() - persentToMoivePlayer(from: self, liv: selectLiv) - passWordView.removeFromSuperview() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HomeViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/HomeViewController.swift deleted file mode 100644 index 3bb6b95..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HomeViewController.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// HomeViewController.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/14. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class HomeViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - - // Do any additional setup after loading the view. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. - } - */ - -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/HotMoreViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/HotMoreViewController.swift deleted file mode 100644 index 537b422..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/HotMoreViewController.swift +++ /dev/null @@ -1,114 +0,0 @@ -// -// HotMoreViewController.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/16. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class HotMoreViewController: UIViewController,UITableViewDelegate,UITableViewDataSource,PassWordEnterViewDelegate { - var hotLives:[LiveDetail]=[] - var index:Int=0 - @IBOutlet var tableView: UITableView! - var passWordView:PassWordView! - override func viewDidLoad() { - super.viewDidLoad() - passWordView = Bundle.main.loadNibNamed("PassWordView", owner: nil, options: nil)?[0] as! PassWordView - passWordView.delegate = self - - tableView.register(UINib(nibName: "HomeTableViewCell", bundle: nil), forCellReuseIdentifier: "cell") - let header=MJRefreshNormalHeader(refreshingBlock: { - self.index=0 - self.getHotLiveList { (success) in - self.tableView.mj_header.endRefreshing() - } - }) - header?.lastUpdatedTimeLabel.isHidden=true - tableView.mj_header=header - tableView.mj_footer=MJRefreshBackNormalFooter(refreshingBlock: { - self.getHotLiveList { (success) in - self.tableView.mj_footer.endRefreshing() - } - }) - getHotLiveList { (success) in - } - } - func getHotLiveList(completionHandler:@escaping (Bool) -> ()){ - SVProgressHUD.show(withStatus: "加载中...") - SVProgressHUD.setDefaultMaskType(.black) - let parameters:Dictionary=["PageIndex":index as AnyObject,"PageSize":10 as AnyObject,"WhatLive":"Hot" as AnyObject] - AppDelegate.instance().httpServer.getLive(parameters: parameters, completionHandler: { (str, error) in - var success:Bool=true - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - success=true - let hotLive=LiveDetail.getAllLives(j: json) - if hotLive.count>0{ - self.index+=1 - if self.index==1 { - self.hotLives=hotLive - }else{ - self.hotLives+=hotLive - } - } - self.tableView.reloadData() - }, failHandler: { (error) in - success=false - AppDelegate.instance().window?.makeToast("获取列表失败:\(error.localizedDescription)") - }) - }else{ - success=false - AppDelegate.instance().window?.makeToast("获取列表失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - success=false - AppDelegate.instance().window?.makeToast("获取列表失败:\(error!.description)") - } - completionHandler(success) - }) - } - var selectLiv:LiveDetail! - - // MARK: - UITableViewDataSource,UITableViewDelegate - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - selectLiv=hotLives[indexPath.row] - let dic = JSON.fromString(jsonString: selectLiv.f_Description)! - if dic["Public"].boolValue{ - persentToMoivePlayer(from: self, liv: selectLiv) - }else{ - - passWordView.passWord = dic["roompasswd"].stringValue - passWordView.zsdView.clearUpPassword() - passWordView.zsdView.passwordTextField.becomeFirstResponder() - self.view.addSubview(passWordView) - } - - } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return hotLives.count - } - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - // return 70+getScreenWidth()/2 - return 331 - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell=tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! HomeTableViewCell - cell.setUpWith(item: hotLives[indexPath.row]) - return cell - } - func passwordView(_ password: String!) { - passWordView.zsdView.passwordTextField.resignFirstResponder() - persentToMoivePlayer(from: self, liv: selectLiv) - passWordView.removeFromSuperview() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - - -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/Live/Live.storyboard b/YouerLiveVideo/YouerLiveVideo/controller/Live/Live.storyboard deleted file mode 100644 index a972780..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/Live/Live.storyboard +++ /dev/null @@ -1,2074 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/controller/Live/LiveVideoSettingShareViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/Live/LiveVideoSettingShareViewController.swift deleted file mode 100644 index 2016126..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/Live/LiveVideoSettingShareViewController.swift +++ /dev/null @@ -1,216 +0,0 @@ -// -// LiveVideoSettingShareViewController.swift -// YouerLiveVideo -// -// Created by 左丞 on 16/11/14. -// Copyright © 2016年 左丞. All rights reserved. -// - -import UIKit - -class LiveVideoSettingShareViewController: UIViewController,UITableViewDelegate,UITableViewDataSource,UIGestureRecognizerDelegate { - var definitionArr:[String] = ["标准","流畅","高清"] - var actionTableView:UITableView! - var actionTableViewLocationView:UIView! - var definition:Int=1 - - @IBOutlet weak var userPhotoHeight: NSLayoutConstraint! - @IBOutlet weak var definitionSelectImage: UIImageView! - @IBOutlet weak var definitionLabel: UILabel! - @IBOutlet weak var roomName: UILabel! - @IBOutlet weak var userPhoto: UIImageView! - @IBOutlet weak var isScreenHorizontalBtn: UIButton! - @IBOutlet weak var shareView: UIView! - @IBOutlet weak var titleImage: UIImageView! - var liveDetail:LiveDetail! - override func viewDidLoad() { - super.viewDidLoad() - shareView.backgroundColor = UIColor.white.withAlphaComponent(0.7) - titleImage.sd_setImage(with: NSURL(string: liveDetail.f_LiveImg) as URL?, placeholderImage: #imageLiteral(resourceName: "defphoto.png")) - titleImage.contentMode = .scaleAspectFill - titleImage.layer.masksToBounds = true - roomName.text = liveDetail.f_LiveName - userPhoto.image = #imageLiteral(resourceName: "default_userRoom") - } - - override func viewWillAppear(_ animated: Bool) { -// if isScreenHorizontalBtn.isSelected{ -// self.navigationController?.isNavigationBarHidden = true -// }else{ -// self.navigationController?.isNavigationBarHidden = false -// } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - @IBAction func definitionSelectClickAction(_ sender: Any) { - let view = (sender as! UIGestureRecognizer).view! - creatSelectTableView() - definitionSelectImage.image = #imageLiteral(resourceName: "top_image") - actionTableView.frame = CGRect(x: view.frame.origin.x, y: view.frame.maxY, width: 100, height: 132) - } - - func creatSelectTableView(){ - if actionTableViewLocationView == nil{ - actionTableViewLocationView = UIView(frame: UIScreen.main.bounds) - actionTableViewLocationView.backgroundColor = UIColor.black.withAlphaComponent(0.7) - let gesture = UITapGestureRecognizer(target: self, action: #selector(LiveVideoSettingShareViewController.cancleActionTableView)) - gesture.delegate = self - actionTableViewLocationView.addGestureRecognizer(gesture) - actionTableView = UITableView(frame: CGRect(x: 0, y: 0, width: 100, height: 132), style: .plain); - actionTableView.layer.borderColor = UIColor.orange.cgColor - actionTableView.layer.borderWidth = 1 - actionTableView.layer.cornerRadius = 5 - actionTableView.layer.masksToBounds = true - actionTableView.delegate = self - actionTableView.dataSource = self - actionTableViewLocationView.addSubview(actionTableView) - self.view.addSubview(actionTableViewLocationView) - }else{ - self.view.addSubview(actionTableViewLocationView) - } - } - - func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool{ - if touch.view!.superview!.isKind(of: UITableViewCell.classForCoder()){ - return false - }else{ - return true - } - } - - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - definitionLabel.text = definitionArr[indexPath.row] - definition = indexPath.row - cancleActionTableView() - } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return definitionArr.count - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - var cell = tableView.dequeueReusableCell(withIdentifier: "cell") - if cell == nil{ - cell = UITableViewCell(style: .default, reuseIdentifier: "cell") - } - cell!.textLabel?.text = definitionArr[indexPath.row] - return cell! - } - - func cancleActionTableView(){ - actionTableViewLocationView.removeFromSuperview() - definitionSelectImage.image = #imageLiteral(resourceName: "botoom_image") - } - - @IBAction func shareClickAction(_ sender: UITapGestureRecognizer) { - var platformType:UMSocialPlatformType! - var text:String = "大家快来观看,\(AppDelegate.instance().accountManager.name())正在直播" - switch sender.view!.tag { - case 100://微信朋友圈 - platformType=UMSocialPlatformType.wechatTimeLine - break - case 101://微信 - platformType=UMSocialPlatformType.wechatSession - text = "\(AppDelegate.instance().accountManager.name())给您分享了一个直播,快来看啊" - break - case 102://QQ空间 - platformType=UMSocialPlatformType.qzone - - break - case 103://新浪微博 - platformType=UMSocialPlatformType.sina - //要求text加url - break - case 104://QQ - platformType=UMSocialPlatformType.QQ - text = "\(AppDelegate.instance().accountManager.name())给您分享了一个直播,快来看啊" - break - default: - break - } - var title:String = liveDetail.f_LiveName - if liveDetail.f_LiveName.characters.count > 8{ - title = (liveDetail.f_LiveName as NSString).substring(to: 7)+"..." - } - shareUrl(text: text, url: "http://www.sxspy.net/MZhiBo/Index?LiveId="+liveDetail.f_Id, VC: self, image: titleImage.image!, platformType: platformType,title:title) - } - - @IBAction func startLive(_ sender: Any) { - let formatte=DateFormatter() - formatte.dateFormat="yyyy-MM-dd HH:mm" - //开始直播按钮 - switch aliveIsStartOrEnd() { - case 1: - self.view.makeToast("开始时间:\(formatte.string(from: Date(timeIntervalSince1970: JSON.fromString(jsonString: liveDetail.f_Description)!["starttime"].doubleValue/1000 as TimeInterval)))") - case 2: - self.view.makeToast("直播已结束") - - case 3: - let vc = AlivcLiveViewController(nibName: "AlivcLiveViewController", bundle: nil, url: liveDetail.f_Sid) -// vc!.isScreenHorizontal = isScreenHorizontalBtn.isSelected - vc!.isScreenHorizontal = true - vc!.liveDetail = liveDetail - vc!.title = AppDelegate.instance().accountManager.name()+"的直播间" - vc!.userNameString = AppDelegate.instance().accountManager.name() - vc!.definition = definition; - vc!.endTimer = JSON.fromString(jsonString: liveDetail.f_Description)!["endtime"].doubleValue/1000 as TimeInterval - vc!.isApplyChat = JSON.fromString(jsonString: liveDetail.f_Description)!["interactive"].boolValue - // self.navigationController?.isNavigationBarHidden = false - self.present(vc!, animated: true, completion: nil) - - - default: - break - } - } - - @IBAction func isScreenHorizontalBtnClickAction(_ sender: Any) { - isScreenHorizontalBtn.isSelected = !isScreenHorizontalBtn.isSelected - isScreenHorizontalBtn.setBackgroundImage(#imageLiteral(resourceName: "竖屏.png"), for: .normal) - -// var transform = CGAffineTransform(rotationAngle: 0) -// self.view.frame = CGRect(x:0, y:0, width:getScreenWidth(),height:getScreenHeight()) -// self.navigationController?.isNavigationBarHidden = false - if isScreenHorizontalBtn.isSelected{ - isScreenHorizontalBtn.setBackgroundImage(#imageLiteral(resourceName: "横屏.png"), for: .normal) -// self.navigationController?.isNavigationBarHidden = true -// transform = CGAffineTransform(rotationAngle: (CGFloat)(M_PI_2)) -// self.view.frame = CGRect(x:0, y:0, width:getScreenHeight(),height:getScreenWidth()) - } -// self.view.transform = transform; -// self.view.layoutSubviews() - } - - func aliveIsStartOrEnd()->Int{//0:未开始,1:已结束,2:正在直播 - let formatte=DateFormatter() - formatte.dateFormat="yyyy-MM-dd HH:mm" - //开始直播按钮 - let nowDate=Date() - let resultStart=nowDate.compare(Date(timeIntervalSince1970: JSON.fromString(jsonString: liveDetail.f_Description)!["starttime"].doubleValue/1000 as TimeInterval)) - let resultEnd=nowDate.compare(Date(timeIntervalSince1970: JSON.fromString(jsonString: liveDetail.f_Description)!["endtime"].doubleValue/1000 as TimeInterval)) - if resultStart == ComparisonResult.orderedAscending{ - //还未到开始时间 - return 1 - }else if resultEnd == ComparisonResult.orderedDescending{ - //已经结束 - return 2 - }else{ - //可以正常直播 - return 3 - } - } - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. - } - */ - -} - diff --git a/YouerLiveVideo/YouerLiveVideo/controller/Live/LiveVideoSettingViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/Live/LiveVideoSettingViewController.swift deleted file mode 100644 index d609fcf..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/Live/LiveVideoSettingViewController.swift +++ /dev/null @@ -1,436 +0,0 @@ -// -// LiveVideoSettingViewController.swift -// YouerLiveVideo -// -// Created by 左丞 on 16/11/10. -// Copyright © 2016年 左丞. All rights reserved. -// - -import UIKit - -class LiveVideoSettingViewController: UIViewController,UIImagePickerControllerDelegate,UINavigationControllerDelegate,ZSDSetPasswordViewDelegate,UITextViewDelegate,UITableViewDelegate,UITableViewDataSource{ - @IBOutlet var defaultImage: UIImageView! - @IBOutlet var applyLiveBtn: UIButton! - @IBOutlet weak var addFiledBtn: UIButton! - @IBOutlet var isRecord: UISwitch! //是否录制 - @IBOutlet weak var isEveryOneCouldSpeak: UISwitch!//是否支持互动 - @IBOutlet weak var isLookOfEveryone: UISwitch!//是否公开 - @IBOutlet weak var startTime: UIButton! - var startDate:Date? - @IBOutlet weak var allTimeOfLive: UIButton! - var endDate:Date? - @IBOutlet var hiddenAnnouncementLabel: UILabel! - @IBOutlet weak var groupAnnouncement: UITextView! - @IBOutlet weak var liveImage: UIImageView! //直播间封面 - - @IBOutlet weak var hiddenLiveNameLabel: UILabel! - @IBOutlet weak var liveNameLabel: UITextView!//直播间名称 - @IBOutlet var categoryLabel: UILabel! //直播间分类 - @IBOutlet weak var accessoryView: UIView! - @IBOutlet var documentTableView: UITableView! - var documentArray:[FileInfor]=[] - @IBOutlet var documentTableViewHeight: NSLayoutConstraint! - @IBOutlet weak var scrollViewContentSizeY: NSLayoutConstraint! - var passWord:String! - var isSetPassWord:Bool = false - var fileImage:String=""//上传后的照片 - var liveDetail:LiveDetail?//若是修改直播间信息则有这个参数 - var category:String="" //分类ID - var categoryName:String="" //分类名称 - override func viewDidLoad() { - super.viewDidLoad() - applyLiveBtn.layer.borderWidth = 1 - applyLiveBtn.layer.borderColor = UIColor.groupTableViewBackground.cgColor - addFiledBtn.layer.cornerRadius = 5 - addFiledBtn.layer.masksToBounds = true - NotificationCenter.default.addObserver(self, selector: #selector(LiveVideoSettingViewController.KeyboardWillChangeFrame(_:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil) - var defaultHeight:CGFloat=616+100//有附件了 +50 - if let item = liveDetail { - category=item.f_Category - categoryName=item.f_CategoryName - if item.f_IsExamine==0{ //未审核 - applyLiveBtn.setTitle("修改直播", for: UIControlState.normal) - }else{//item.f_IsExamine=2 未通过 - defaultHeight=586 - self.view.isUserInteractionEnabled=false - applyLiveBtn.isHidden=true - } - fileImage=item.f_LiveImg - defaultImage.sd_setImage(with: URL(string: item.f_LiveImg), placeholderImage: UIImage(named:"default")) - liveNameLabel.text=item.f_LiveName - if let json=JSON.fromString(jsonString: item.f_Description){ - hiddenAnnouncementLabel.isHidden=true - groupAnnouncement.text=json["announcement"].stringValue - let formatte=DateFormatter() - formatte.dateFormat="yyyy-MM-dd HH:mm" - startDate=Date(timeIntervalSince1970: json["starttime"].doubleValue/1000 as TimeInterval) - self.startTime.setTitle("\(formatte.string(from: startDate!))", for: .normal) - endDate=Date(timeIntervalSince1970: json["endtime"].doubleValue/1000 as TimeInterval) - self.allTimeOfLive.setTitle("\(formatte.string(from: endDate!))", for: .normal) - if json["record"] != nil{ - isRecord.isOn=json["record"].boolValue - }else{ - isRecord.isOn=true - } - isLookOfEveryone.isOn=json["Public"].boolValue - if !isLookOfEveryone.isOn { - if self.zsdView != nil { - self.zsdView.passwordTextField.text=json["roompasswd"].stringValue - }else{ - passWord=json["roompasswd"].stringValue - } - } - isEveryOneCouldSpeak.isOn=json["interactive"].boolValue - let doc = json["attachFiles"].arrayValue - for item in doc{ - documentArray.append(FileInfor(json: item)) - } - if documentArray.count>0 { - accessoryView.isHidden=false - documentTableViewHeight.constant=CGFloat(documentArray.count)*44 - defaultHeight=defaultHeight+(CGFloat(documentArray.count)*44+50) - } - } - } - if defaultHeight >= getScreenHeight()-64{ - scrollViewContentSizeY.constant = defaultHeight - }else{ - scrollViewContentSizeY.constant = getScreenHeight()-64 - } - } - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - categoryLabel.text=categoryName - } - func KeyboardWillChangeFrame(_ noti:NSNotification){ - if isSetPassWord{ - let info = noti.userInfo - let endFrame = info![UIKeyboardFrameEndUserInfoKey] as! NSValue - let dur = info![UIKeyboardAnimationDurationUserInfoKey] - UIView.animate(withDuration: dur as! TimeInterval, animations: { () -> Void in - self.zsdView.frame.origin.y = (endFrame.cgRectValue.origin.y - 100)/2 - }) - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - // MARK: - 点击直播封面设置按钮 - @IBAction func liveImageTapAction(_ sender: AnyObject) { - self.view.endEditing(true) - let action=UIAlertController(title:nil,message:nil,preferredStyle:.actionSheet) - let cameraAction=UIAlertAction(title: "拍照", style: UIAlertActionStyle.default) { (action) in - if cameraOrPhotPermissions(1, view: self.view){ - let vc = UIImagePickerController() - vc.delegate = self - vc.sourceType = .camera - self.present(vc, animated: true, completion: nil) - } - } - let photoAction=UIAlertAction(title: "从相册选择", style: UIAlertActionStyle.default) { (action) in - if cameraOrPhotPermissions(0, view: self.view){ - let vc = UIImagePickerController() - vc.delegate = self - vc.sourceType = .photoLibrary - self.present(vc, animated: true, completion: nil) - } - } - let cancleAction=UIAlertAction(title: "取消", style: UIAlertActionStyle.cancel) { (action) in - } - action.addAction(cameraAction) - action.addAction(photoAction) - action.addAction(cancleAction) - self.present(action, animated: true, completion: nil) - } - // MARK: - 选择图片 - func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { - picker.dismiss(animated: true, completion: { () -> Void in - var oimage = info[UIImagePickerControllerOriginalImage] as? UIImage - oimage = oimage!.imageScaledToScale() - let filePath=FilesManager.imageFilePath(String(format:"%f.jpg",Date().timeIntervalSince1970)) - try? UIImageJPEGRepresentation(oimage!,0.7)!.write(to: URL(fileURLWithPath: filePath), options: [.atomic]) - self.defaultImage.image = oimage - self.updateImage(file: filePath) - }) - } - func updateImage(file:String){ - SVProgressHUD.show(withStatus: "图片上传中...") - SVProgressHUD.setDefaultMaskType(.black) - AppDelegate.instance().httpServer.uploadFile(file: NSURL(fileURLWithPath: file)) { (str, error) in - SVProgressHUD.dismiss() - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - let str=json.contentData().arrayValue[0].stringValue - self.fileImage=str - }, failHandler: { (error) in - self.fileImage="" - self.view.makeToast("图片上传失败:\(error.localizedDescription)") - }) - } - } - // MARK: - 点击直播分类选择分类 - @IBAction func selectCategoryAction(_ sender: UIButton) { - let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "MoreViewController") as! MoreViewController - vc.superVC=self - self.navigationController!.pushViewController(vc, animated: true) - } - // MARK: - 点击开始时间选择按钮 - @IBAction func startTimeClickAction(_ sender: AnyObject) { - self.view.endEditing(true) - let datePicker=UIDatePicker() - datePicker.datePickerMode=UIDatePickerMode.dateAndTime - datePicker.date = Date(timeIntervalSinceNow: 60) - datePicker.frame=CGRect(x: 0,y: 40,width: 270,height: 150) - let alertController=UIAlertController(title: "请选择\n\n\n\n\n\n",message: nil,preferredStyle: .alert) - let callActionHandler = { (action:UIAlertAction!) -> Void in - let result = datePicker.date.compare(Date()) - if result == ComparisonResult.orderedAscending { - self.view.makeToast("请选择正确开始时间") - self.startTime.setTitle("请选择", for: .normal) - self.startDate=nil - return - } - let formatte=DateFormatter() - formatte.dateFormat="yyyy-MM-dd HH:mm" - print("\(formatte.string(from: datePicker.date))") - self.startTime.setTitle("\(formatte.string(from: datePicker.date))", for: .normal) - self.startDate=datePicker.date - } - let cancelAction=UIAlertAction(title: "取消",style: .default, handler: nil) - let action=UIAlertAction(title: "确定",style: .default, handler: callActionHandler) - alertController.view.addSubview(datePicker) - alertController.addAction(cancelAction) - alertController.addAction(action) - self.present(alertController, animated: true, completion: nil) - } - // MARK: - 点击结束时间选择按钮 - @IBAction func allTimeClickAction(_ sender: AnyObject) { - self.view.endEditing(true) - let datePicker=UIDatePicker() - datePicker.datePickerMode=UIDatePickerMode.dateAndTime - if startDate == nil{ - datePicker.date = Date(timeIntervalSinceNow: 4*60*60) - }else{ - datePicker.date = Date(timeInterval: 4*60*60, since: startDate!) - } - datePicker.frame=CGRect(x: 0,y: 40,width: 270,height: 150) - let locale = Locale(identifier: "zh_CH") - datePicker.locale = locale - let alertController=UIAlertController(title: "请选择\n\n\n\n\n\n",message: nil,preferredStyle: .alert) - let callActionHandler = { (action:UIAlertAction!) -> Void in - if let start=self.startDate{ - let result = datePicker.date.compare(start) - if result == ComparisonResult.orderedAscending { - self.view.makeToast("请选择正确结束时间") - self.allTimeOfLive.setTitle("请选择", for: .normal) - self.endDate=nil - return - }else if datePicker.date.timeIntervalSince(start)>4*60*60 { - self.view.makeToast("直播时长最大为4小时") - return - } - let formatte=DateFormatter() - formatte.dateFormat="yyyy-MM-dd HH:mm" - self.allTimeOfLive.setTitle("\(formatte.string(from: datePicker.date))", for: .normal) - self.endDate=datePicker.date - }else{ - self.view.makeToast("请选择正确开始时间") - } - } - let cancelAction=UIAlertAction(title: "取消",style: .default, handler: nil) - let action=UIAlertAction(title: "确定",style: .default, handler: callActionHandler) - alertController.view.addSubview(datePicker) - alertController.addAction(cancelAction) - alertController.addAction(action) - self.present(alertController, animated: true, completion: nil) - } - // MARK: - 文档TableViewDelegate,TableViewDataSource - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - //点击文档下载并打开 - let item=documentArray[indexPath.row] - let down=DownLoad.share - down.superVC=self - down.downLoadWithUrl(url: item.url) - } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return documentArray.count - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let item=documentArray[indexPath.row] - let cell=tableView.dequeueReusableCell(withIdentifier: "documentTableViewCell", for: indexPath) as! documentTableViewCell - cell.iconImageView.image=UIImage(named: selectImageFromString(string: item.name)) - cell.titleLabel.text=item.name - return cell - } - // MARK: - 底部申请直播按钮 - @IBAction func applyLiveBtnClickAction(_ sender: AnyObject) { - //申请直播 - if liveNameLabel.text == ""{ - AppDelegate.instance().window?.makeToast("直播间名字不能为空") - return - } - if category=="" { - AppDelegate.instance().window?.makeToast("直播间分类不能为空") - return - } - if fileImage == ""{ - AppDelegate.instance().window?.makeToast("直播间封面图片不能为空") - return - } - if startDate == nil || endDate == nil{ - AppDelegate.instance().window?.makeToast("直播间开始结束时间不能为空") - return - } - var loadText:String="" - var parameters:Dictionary - if liveDetail != nil { - loadText="修改直播" - parameters=["f_Id":liveDetail!.f_Id as AnyObject,"f_LiveName":liveNameLabel.text! as AnyObject,"f_LiveImg":fileImage as AnyObject,"f_Description":toJSON() as AnyObject,"f_Category":category as AnyObject] - }else{ - loadText="申请直播" - parameters=["f_LiveName":liveNameLabel.text! as AnyObject,"f_LiveImg":fileImage as AnyObject,"f_Description":toJSON() as AnyObject,"f_Category":category as AnyObject] - } - SVProgressHUD.show(withStatus: "\(loadText)...") - SVProgressHUD.setDefaultMaskType(.black) - if liveDetail != nil { - AppDelegate.instance().httpServer.postUpdateLive(parameters: parameters) { (str, error) in - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.navigationController!.popViewController(animated: true) - AppDelegate.instance().window?.makeToast("修改直播成功,请等待审核") - }, failHandler: { (error) in - self.view.makeToast("修改直播失败:\(error.localizedDescription)") - }) - }else{ - self.view.makeToast("修改直播失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - self.view.makeToast("修改直播失败:\(error!.description)") - } - } - }else{ - AppDelegate.instance().httpServer.postCreateLive(parameters: parameters) { (str, error) in - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.navigationController!.popToRootViewController(animated: true) - AppDelegate.instance().window?.makeToast("申请直播成功,请等待审核") - }, failHandler: { (error) in - self.view.makeToast("申请直播失败:\(error.localizedDescription)") - }) - }else{ - self.view.makeToast("申请直播失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - self.view.makeToast("申请直播失败:\(error!.description)") - } - } - } - } - func toJSON()->String{ - var info=Dictionary() - info["announcement"]=groupAnnouncement.text as AnyObject?//公告 - info["starttime"]=(startDate?.timeIntervalSince1970)!*1000 as AnyObject?//毫秒单位 long类型 - info["endtime"]=(endDate?.timeIntervalSince1970)!*1000 as AnyObject?//结束时间 long类型 - info["record"]=isRecord.isOn as AnyObject? //是否录制 - info["Public"]=isLookOfEveryone.isOn as AnyObject? //是否公开 - info["interactive"]=isEveryOneCouldSpeak.isOn as AnyObject? //是否互动 - if !isLookOfEveryone.isOn { - info["roompasswd"] = self.zsdView != nil ? self.zsdView.passwordTextField.text! as AnyObject? : passWord as AnyObject? //房间密码 - } - if documentArray.count>0 { - info["attachFiles"]=JSON.fromString(jsonString: liveDetail!.f_Description)!["attachFiles"].stringValue as AnyObject - } - return JSON(info).rawString() ?? "{}" - } - @IBAction func addFileClickAction(_ sender: AnyObject) { - - } - var zsdView:ZSDSetPasswordView! - var zsdbackView:UIView! - @IBAction func lookOfEveryoneBtnClickAction(_ sender: AnyObject) { - let switchs = sender as! UISwitch - isSetPassWord = true - if !switchs.isOn{ - if zsdbackView == nil{ - creatZSDView() - }else{ - zsdView.clearUpPassword() - zsdView.fieldBecomeFirstResponder() - self.view.addSubview(zsdbackView) - } - } - - } - - func creatZSDView(){ - let zsdViewWidth :CGFloat = 200 - zsdbackView = UIView(frame: UIScreen.main.bounds) - zsdbackView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(LiveVideoSettingViewController.cancleZSDView))) - zsdbackView.backgroundColor = UIColor.black.withAlphaComponent(0.7) - zsdView = ZSDSetPasswordView(frame: CGRect(x: (getScreenWidth()-zsdViewWidth)/2, y: 0, width: zsdViewWidth, height: 90)) - zsdView.delegate = self - zsdView.layer.masksToBounds = true - zsdView.layer.cornerRadius = 5 - zsdView.fieldBecomeFirstResponder() - let title = UILabel(frame: CGRect(x: (zsdViewWidth - 100)/2, y: 5, width: 100, height: 30)) - title.text = "请输入密码" - zsdView.addSubview(title) - zsdbackView.addSubview(zsdView) - self.view.addSubview(zsdbackView) - } - - func passwordView(_ passwordView: ZSDSetPasswordView!, inputPassword password: String!) { - passWord = password - removeZSDView() - } - - func cancleZSDView(){ - if passWord == nil||passWord.characters.count < 4{ - isLookOfEveryone.isOn = true - } - removeZSDView() - } - - func removeZSDView(){ - isSetPassWord = false - zsdView.passwordTextField.resignFirstResponder() - zsdbackView.removeFromSuperview() - - } - - func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { - if text == "\n"{ - textView.resignFirstResponder() - return false - } - return true - } - func textViewDidChange(_ textView: UITextView) { - var num = 40 - var str = "直播间名字字数不能超过40字" - if textView == liveNameLabel{ - hiddenLiveNameLabel.isHidden=(textView.text.characters.count > 0) - }else{ - num = 200 - str = "公告字数不能超过200字" - hiddenAnnouncementLabel.isHidden=(textView.text.characters.count > 0) - } - if textView.text.characters.count > num{ - textView.text = (textView.text as NSString).substring(to: num) - textView.resignFirstResponder() - let alert = UIAlertController(title: "提示", message: str, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil)) - self.present(alert, animated: true, completion: nil) - } - } - -} -class documentTableViewCell: UITableViewCell { - @IBOutlet var iconImageView: UIImageView! - @IBOutlet var titleLabel: UILabel! -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/Live/PassWordView.swift b/YouerLiveVideo/YouerLiveVideo/controller/Live/PassWordView.swift deleted file mode 100644 index 1d9d509..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/Live/PassWordView.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// PassWordView.swift -// YouerLiveVideo -// -// Created by 左丞 on 17/1/22. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class PassWordView: UIView ,ZSDSetPasswordViewDelegate{ - - @IBOutlet weak var zsdView: ZSDSetPasswordView! - var superVC:UIViewController! - var passWord:String! - var delegate:PassWordEnterViewDelegate! - /* - // Only override draw() if you perform custom drawing. - // An empty implementation adve rsely affects performance during animation. - override func draw(_ rect: CGRect) { - // Drawing code - } - */ - override func awakeFromNib() { - NotificationCenter.default.addObserver(self, selector: #selector(PassWordView.KeyboardWillChangeFrame(_:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil) - zsdView.delegate = self - - zsdView.frame = CGRect(x: (getScreenWidth()-200)/2, y: 0, width: 200, height: 90) - zsdView.layer.masksToBounds = true - zsdView.layer.cornerRadius = 5 - zsdView.fieldBecomeFirstResponder() - - let title = UILabel(frame: CGRect(x: (200 - 100)/2, y: 5, width: 100, height: 30)) - title.text = "请输入密码" - zsdView.addSubview(title) - self.addSubview(zsdView) - } - - func KeyboardWillChangeFrame(_ noti:NSNotification){ - let info = noti.userInfo - let endFrame = info![UIKeyboardFrameEndUserInfoKey] as! NSValue - let dur = info![UIKeyboardAnimationDurationUserInfoKey] - UIView.animate(withDuration: dur as! TimeInterval, animations: { () -> Void in - self.zsdView.frame.origin.y = (endFrame.cgRectValue.origin.y - 100)/2 - }) - } - - @IBAction func tapClick(_ sender: Any) { - self.removeFromSuperview() - } - - func passwordView(_ passwordView: ZSDSetPasswordView!, inputPassword password: String!) { - if delegate != nil{ - delegate.passwordView(password) - } - } -} - -public protocol PassWordEnterViewDelegate : NSObjectProtocol { - func passwordView(_ password: String!) -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/Live/PassWordView.xib b/YouerLiveVideo/YouerLiveVideo/controller/Live/PassWordView.xib deleted file mode 100644 index 894e3c7..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/Live/PassWordView.xib +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/controller/LiveRoomDetailViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/LiveRoomDetailViewController.swift deleted file mode 100644 index 77b2c18..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/LiveRoomDetailViewController.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// LiveRoomDetailViewController.swift -// YouerLiveVideo -// -// Created by 葛建军 on 16/11/11. -// Copyright © 2016年 左丞. All rights reserved. -// - -import UIKit - -class LiveRoomDetailViewController: UIViewController { - @IBOutlet var personIcon: UIImageView! - @IBOutlet var personNameLabel: UILabel! - @IBOutlet var startTimeLabel: UILabel! - @IBOutlet var coverImage: UIImageView! - @IBOutlet var imageH: NSLayoutConstraint! - @IBOutlet var announcementLabel: UILabel! - @IBOutlet var startDetailTimeLabel: UILabel! - @IBOutlet var endDetailTimeLabel: UILabel! - @IBOutlet var isPublic: UILabel! - @IBOutlet var isInteractive: UILabel! - @IBOutlet var isExamineLabel: UILabel! - @IBOutlet var scrollContentViewH: NSLayoutConstraint! - @IBOutlet var attachViewH: NSLayoutConstraint!//附件所在View的高度 - var item:LiveDetail!//直播间详情 - let formatte=DateFormatter() - override func viewDidLoad() { - super.viewDidLoad() - attachViewH.constant=0 - formatte.dateFormat="yyyy-MM-dd HH:mm:ss" - personNameLabel.text=AppDelegate.instance().accountManager.name() - startTimeLabel.text=formatte.string(from: Date(timeIntervalSince1970: JSON.fromString(jsonString: item.f_Description)!["starttime"].doubleValue/1000 as TimeInterval)) - coverImage.sd_setImage(with: URL(string:item.f_LiveImg), placeholderImage: UIImage(named:"icon")) - announcementLabel.text=JSON.fromString(jsonString: item.f_Description)!["announcement"].stringValue - startDetailTimeLabel.text=formatte.string(from: Date(timeIntervalSince1970: JSON.fromString(jsonString: item.f_Description)!["starttime"].doubleValue/1000 as TimeInterval)) - endDetailTimeLabel.text=formatte.string(from: Date(timeIntervalSince1970: JSON.fromString(jsonString: item.f_Description)!["endtime"].doubleValue/1000 as TimeInterval)) - isPublic.text = JSON.fromString(jsonString: item.f_Description)!["Public"].boolValue ? "是" : "否" - isInteractive.text = JSON.fromString(jsonString: item.f_Description)!["interactive"].boolValue ? "是" : "否" - isExamineLabel.text = item.f_IsExamine==0 ? "待审核" : "审核未通过" - imageH.constant=getScreenWidth() - scrollContentViewH.constant=50+imageH.constant+250 - } - @IBAction func backAction(_ sender: UIBarButtonItem) { - self.navigationController!.popViewController(animated: true) - } - - - - - - - - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/LiveTypeListViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/LiveTypeListViewController.swift deleted file mode 100644 index 7cbe403..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/LiveTypeListViewController.swift +++ /dev/null @@ -1,135 +0,0 @@ -// -// LiveTypeListViewController.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/20. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class LiveTypeListViewController: UIViewController,UITableViewDelegate,UITableViewDataSource ,PassWordEnterViewDelegate{ - var isType:Bool=true //Typ分类的,Org机构的 - var F_OrganizeId:String="" - var F_LiveType:String="" - var Lives:[LiveDetail]=[] - var index:Int=0 - @IBOutlet var tableView: UITableView! - var passWordView:PassWordView! - override func viewDidLoad() { - super.viewDidLoad() - passWordView = Bundle.main.loadNibNamed("PassWordView", owner: nil, options: nil)?[0] as! PassWordView - passWordView.delegate = self - tableView.register(UINib(nibName: "HomeTableViewCell", bundle: nil), forCellReuseIdentifier: "cell") - let header=MJRefreshNormalHeader(refreshingBlock: { - self.index=0 - self.getHotLiveList { (success) in - self.tableView.mj_header.endRefreshing() - } - }) - header?.lastUpdatedTimeLabel.isHidden=true - tableView.mj_header=header - tableView.mj_footer=MJRefreshBackNormalFooter(refreshingBlock: { - self.getHotLiveList { (success) in - self.tableView.mj_footer.endRefreshing() - } - }) - getHotLiveList { (success) in - } - } - func getHotLiveList(completionHandler:@escaping (Bool) -> ()){ - SVProgressHUD.show(withStatus: "加载中...") - SVProgressHUD.setDefaultMaskType(.black) - var parameters:Dictionary=[:] - var name:String="" - if isType { - name="分类" - parameters=["PageIndex":index as AnyObject,"PageSize":10 as AnyObject,"WhatLive":"Typ" as AnyObject,"F_LiveType":F_LiveType as AnyObject] - }else{ - name="学校" - parameters=["PageIndex":index as AnyObject,"PageSize":10 as AnyObject,"WhatLive":"Org" as AnyObject,"F_OrganizeId":F_OrganizeId as AnyObject] - } - AppDelegate.instance().httpServer.getLive(parameters: parameters, completionHandler: { (str, error) in - var success:Bool=true - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - success=true - let lives=LiveDetail.getAllLives(j: json) - if lives.count>0{ - self.index+=1 - if self.index==1 { - self.Lives=lives - }else{ - self.Lives+=lives - } - } - self.tableView.reloadData() - }, failHandler: { (error) in - success=false - AppDelegate.instance().window?.makeToast("获取\(name)列表失败:\(error.localizedDescription)") - }) - }else{ - success=false - AppDelegate.instance().window?.makeToast("获取\(name)列表失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - success=false - AppDelegate.instance().window?.makeToast("获取\(name)列表失败:\(error!.description)") - } - completionHandler(success) - }) - } - var selectLiv:LiveDetail! - - // MARK: - UITableViewDataSource,UITableViewDelegate - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - selectLiv=Lives[indexPath.row] - let dic = JSON.fromString(jsonString: selectLiv.f_Description)! - if dic["Public"].boolValue{ - persentToMoivePlayer(from: self, liv: selectLiv) - }else{ - passWordView.passWord = dic["roompasswd"].stringValue - passWordView.zsdView.clearUpPassword() - passWordView.zsdView.passwordTextField.becomeFirstResponder() - self.view.addSubview(passWordView) - } - - } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return Lives.count - } - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - //return 70+getScreenWidth()/2 - return 331 - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell=tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! HomeTableViewCell - cell.setUpWith(item: Lives[indexPath.row]) - return cell - } - - func passwordView(_ password: String!) { - passWordView.zsdView.passwordTextField.resignFirstResponder() - persentToMoivePlayer(from: self, liv: selectLiv) - passWordView.removeFromSuperview() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. - } - */ - -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/MainViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/MainViewController.swift deleted file mode 100644 index eaf1805..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/MainViewController.swift +++ /dev/null @@ -1,94 +0,0 @@ -// -// MainViewController.swift -// XSTLive -// -// Created by 葛建军 on 16/11/9. -// Copyright © 2016年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class MainViewController: UITabBarController,UITabBarControllerDelegate { - var button:UIButton! - override func viewDidLoad() { - super.viewDidLoad() - let backButton=UIBarButtonItem() - backButton.title="返回" - self.navigationItem.backBarButtonItem=backButton - self.title="教育视频云" - self.configTheme() - self.tabBar.tintColor = Theme.topBarColor() - tabBar.barTintColor = UIColor.white - // 添加突出按钮 -// addCenterButtonWithImage(UIImage(named: "开始直播")!, selectedImage: UIImage(named: "psb.jpg")!) - // UITabBarControllerDelegate 指定为自己 - self.delegate = self - //指定当前页——中间页 - self.selectedIndex = 0 - //设点button状态 -// button.isSelected = true - - let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 30, height: 30)) - imageView.image = UIImage(named: "icon") - self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: imageView) - //1消息 2通讯录 3动态 4我的 storyboard里设置selectedImage没用,这里设置下,顺便排个序 - let items=tabBar.items - tabBar.tintColor = Theme.topBarColor() - for item in items!{ - switch item.tag{ - case 1: - item.selectedImage=UIImage(named:"视窗")!.withRenderingMode(UIImageRenderingMode.alwaysTemplate) - case 2: - item.selectedImage=UIImage(named:"首页")!.withRenderingMode(UIImageRenderingMode.alwaysTemplate) - default: - break - } - } - } -// // MARK: - addCenterButton -// func addCenterButtonWithImage(_ buttonImage:UIImage,selectedImage:UIImage){ -// button = UIButton(type: UIButtonType.custom) -// button.addTarget(self, action: #selector(MainViewController.pressChange(_:)), for: UIControlEvents.touchUpInside) -// button.autoresizingMask = [.flexibleRightMargin,.flexibleLeftMargin,.flexibleTopMargin,.flexibleBottomMargin] -// // 设定button大小为适应图片 -// button.frame = CGRect(x: 0.0, y: 0.0, width: 75,height: 75)//buttonImage.size.width, buttonImage.size.height) -// button.setImage(buttonImage, for: UIControlState()) -//// button.setImage(selectedImage, forState: UIControlState.Selected) -// // 这个比较恶心 去掉选中button时候的阴影 -// button.adjustsImageWhenHighlighted = false -// /* -// * 核心代码:设置button的center 和 tabBar的 center 做对齐操作, 同时做出相对的上浮 -// */ -// var center = self.tabBar.center -// center.y = center.y - self.tabBar.frame.size.height/2 -// button.center = center -// self.view.addSubview(button) -// } - //点击中间按钮 -// func pressChange(_ sender:UIButton){ -// buildLiveAction() -// } - - override var shouldAutorotate: Bool{ - return false - } - -// //创建直播间或者登录账号 -// func buildLiveAction(){ -// if AppDelegate.instance().accountManager.isOnline() { -// let vc = UIStoryboard(name: "Live", bundle: nil).instantiateViewController(withIdentifier: "LiveVideoSettingViewControllerVC") as! LiveVideoSettingViewController -// vc.title = "直播设置" -// self.navigationController?.pushViewController(vc, animated: true) -// }else{ -// let vc = UIStoryboard(name: "User", bundle: nil).instantiateViewController(withIdentifier: "LoginViewControllerVC") as! LoginViewController -// self.present(vc.wrapWithNavigationController(), animated: true, completion: nil) -// } -// } - // MARK: - TabBar Delegate - func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) { - } - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/MoreViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/MoreViewController.swift deleted file mode 100644 index 052eccb..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/MoreViewController.swift +++ /dev/null @@ -1,69 +0,0 @@ -// -// MoreViewController.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/16. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class MoreViewController: UIViewController,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout { - var superVC:LiveVideoSettingViewController? - var liveTypeArray:[LiveType]=[] - var type:String="Live" - @IBOutlet var collectionView: UICollectionView! - override func viewDidLoad() { - super.viewDidLoad() - collectionView.register(UINib(nibName: "liveTitleCollectionCell", bundle: nil), forCellWithReuseIdentifier: "liveTitleCollectionCell") - getLiveTypeList() - } - func getLiveTypeList(){ - AppDelegate.instance().httpServer.postLiveType(type: type) { (str, error) in - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.liveTypeArray=LiveType.getAllLiveType(j: json) - self.collectionView.reloadData() - }, failHandler: { (error) in - NSLog("获取分类列表失败:\(error.localizedDescription)") - }) - }else{ - NSLog("获取分类列表失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - NSLog("获取分类列表失败失败:\(error!.description)") - } - } - } - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - //MARK: - UICollectionViewDelegateFlowLayout - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: getScreenWidth()/4, height: getScreenWidth()/4) - } - //MARK: - UICollectionViewDelegate,UICollectionViewDataSource - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return liveTypeArray.count - } - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell=collectionView.dequeueReusableCell(withReuseIdentifier: "liveTitleCollectionCell", for: indexPath) as! liveTitleCollectionCell - cell.setUpWith(type: liveTypeArray[indexPath.row]) - return cell - } - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - let item=liveTypeArray[indexPath.row] - if superVC != nil { - self.superVC!.category=item.f_Id - self.superVC!.categoryName=item.f_LiveTypeName - self.navigationController!.popViewController(animated: true) - return - } - let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "LiveTypeListViewController") as! LiveTypeListViewController - vc.isType=true - vc.F_LiveType=item.f_Id - vc.title=item.f_LiveTypeName - self.navigationController!.pushViewController(vc, animated: true) - } -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/MyViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/MyViewController.swift deleted file mode 100644 index 2288a03..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/MyViewController.swift +++ /dev/null @@ -1,87 +0,0 @@ -// -// MyViewController.swift -// XSTLive -// -// Created by 葛建军 on 16/11/9. -// Copyright © 2016年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class MyViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { - var dataSet:[Live]=[Live(image:"直播列表",name:"直播列表",url:"直播列表的地址",type: LivesType.liveList),Live(image:"直播历史",name:"直播历史",url:"直播历史的地址",type: LivesType.liveHistory),Live(image:"我的关注",name:"我的关注",url:"关注地址",type: LivesType.other)]//,Live(image:"观看历史",name:"观看历史",url:"观看历史的地址",type: LivesType.watchHistory),Live(image:"我的充值",name:"我的充值",url:"处理充值",type: LivesType.other) - @IBOutlet var userView: UIView! - @IBOutlet var nouserLabel: UILabel! - @IBOutlet var iconImage: UIImageView! - @IBOutlet var nameLabel: UILabel! - @IBOutlet var numberLabel: UILabel! - @IBOutlet var tableView: UITableView! - override func viewDidLoad() { - super.viewDidLoad() - NotificationCenter.default.addObserver(self, selector: #selector(MyViewController.refreshUser), name: NSNotification.Name(rawValue: "refreshFirstVC"), object: nil) - } - override func viewWillAppear(_ animated: Bool) { - refreshUser() - } - func refreshUser(){ - if !AppDelegate.instance().accountManager.isOnline() { - userView.isHidden=true - nouserLabel.isHidden=false - iconImage.image=UIImage(named:"defphoto") - }else{ - userView.isHidden=false - nouserLabel.isHidden=true - iconImage.sd_setImage(with: URL(string: AppDelegate.instance().accountManager.photo()), placeholderImage: UIImage(named:"defphoto")) - nameLabel.text="昵称:"+AppDelegate.instance().accountManager.name() - numberLabel.text="账号:"+AppDelegate.instance().accountManager.phone() - } - } - - @IBAction func photoImageTapAction(_ sender: AnyObject) { - if !AppDelegate.instance().accountManager.isOnline(){ - let vc = UIStoryboard(name: "User", bundle: nil).instantiateViewController(withIdentifier: "LoginViewControllerVC") as! LoginViewController - self.present(vc.wrapWithNavigationController(), animated: true, completion: nil) - }else{ - //设置页面 - let vc = UIStoryboard(name: "User", bundle: nil).instantiateViewController(withIdentifier: "PersonalSettingViewControllerVC") as! PersonalSettingViewController - self.navigationController!.pushViewController(vc, animated: true) - } - } - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - - // MARK: -UITableViewDelegate UITableViewDataSource - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return dataSet.count - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! MyTableViewCell - let list=dataSet[(indexPath as NSIndexPath).row] - cell.titleImage.image=UIImage(named: "\(list.image)") - cell.titleLabel.text=list.name - return cell - } - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - if AppDelegate.instance().accountManager.isOnline() { - let list=dataSet[(indexPath as NSIndexPath).row] - if indexPath.row==0 || indexPath.row==1{ - let liveRoomsVC=Story.instantiateViewControllerWithIdentifier("LiveListViewController", storyName: "User") as! LiveListViewController - liveRoomsVC.type=list.type - liveRoomsVC.title=list.name - self.navigationController?.pushViewController(liveRoomsVC, animated: true) - }else if indexPath.row==2{ - let schoolAttentionVC=Story.instantiateViewControllerWithIdentifier("MyAttentionViewController", storyName: "User") as! MyAttentionViewController - self.navigationController?.pushViewController(schoolAttentionVC, animated: true) - }else{ - AppDelegate.instance().window?.makeToast("\(list.name)") - } - }else{ - AppDelegate.instance().window?.makeToast("请先登录") - } - } -} -class MyTableViewCell: UITableViewCell { - @IBOutlet var titleImage: UIImageView! - @IBOutlet var titleLabel: UILabel! -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LiveListViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LiveListViewController.swift deleted file mode 100644 index a7ed568..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LiveListViewController.swift +++ /dev/null @@ -1,220 +0,0 @@ -// -// LiveListViewController.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/17. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit -enum LivesType:Int { - case liveList //直播列表 - case liveHistory //直播历史 - case watchHistory //观看历史 - case other //其他 -} -class LiveListViewController: UIViewController,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UITableViewDelegate,UITableViewDataSource { - @IBOutlet var iconImage: UIImageView! - @IBOutlet var nameLabel: UILabel! - @IBOutlet var numberLabel: UILabel! - var type:LivesType! - @IBOutlet var titleCollectionView: UICollectionView! - @IBOutlet var titleViewHeight: NSLayoutConstraint! - var titleDataSet:[String]=["全部","审核通过","审核未通过","待审核"] - @IBOutlet var liveListTableView: UITableView! - var allListRoom:[LiveDetail]=[] - var roomListDataSet:[LiveDetail]=[] - var currentType:Int=0//测试改变顶部状态时 - override func viewDidLoad() { - super.viewDidLoad() - liveListTableView.register(UINib(nibName: "HomeTableViewCell", bundle: nil), forCellReuseIdentifier: "cell") - } - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - refreshUser() - getListWithType() - } - //MARK: - 刷新个人信息 - func refreshUser(){ - //顶部collectionView的展示与否 - if type==LivesType.liveList{ - titleViewHeight.constant=40 - }else{ - titleViewHeight.constant=0 - } - //这里必然在线,不用判断是否在线 - iconImage.sd_setImage(with: URL(string: AppDelegate.instance().accountManager.photo()), placeholderImage: UIImage(named:"defphoto")) - nameLabel.text="昵称:"+AppDelegate.instance().accountManager.name() - numberLabel.text="账号:"+AppDelegate.instance().accountManager.phone() - } - //MARK: - 刷新直播列表信息 - func getListWithType(){ - SVProgressHUD.show(withStatus: "加载中...") - SVProgressHUD.setDefaultMaskType(.black) - //清空数据 - switch type.hashValue { - case 0: - let parameters:Dictionary=["PageIndex":0 as AnyObject,"PageSize":INT32_MAX as AnyObject,"WhatLive":"My" as AnyObject] - AppDelegate.instance().httpServer.getLive(parameters: parameters, completionHandler: { (str, error) in - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.allListRoom=LiveDetail.getAllLives(j: json) - self.roomListDataSet=self.allListRoom - self.liveListTableView.reloadData() - }, failHandler: { (error) in - self.view.makeToast("获取直播列表失败:\(error.localizedDescription)") - }) - }else{ - self.view.makeToast("获取直播列表失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - self.view.makeToast("获取直播列表失败:\(error!.description)") - } - }) - break - case 1: - let parameters:Dictionary=["PageIndex":0 as AnyObject,"PageSize":INT32_MAX as AnyObject,"WhatLive":"My" as AnyObject] - AppDelegate.instance().httpServer.getLive(parameters: parameters, completionHandler: { (str, error) in - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - for item in LiveDetail.getAllLives(j: json){ - if item.f_IsExamine==1{ - self.allListRoom.append(item) - } - } - self.roomListDataSet=self.allListRoom - self.liveListTableView.reloadData() - }, failHandler: { (error) in - self.view.makeToast("获取直播列表失败:\(error.localizedDescription)") - }) - }else{ - self.view.makeToast("获取直播列表失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - self.view.makeToast("获取直播列表失败:\(error!.description)") - } - }) -// AppDelegate.instance().httpServer.getPlayHistory(completionHandler: { (str, error) in -// SVProgressHUD.dismiss() -// if error == nil&&JSON.fromString(jsonString: str)!["issuccess"].intValue == 1{ -// //处理数据{"issuccess":1,"data":[{"name":"直播历史1"},{"name":"直播历史2"}]} -// }else{ -// self.view.makeToast("获取直播历史失败") -// } -// }) - break - case 2: - AppDelegate.instance().httpServer.getLiveHistory(completionHandler: { (str, error) in - SVProgressHUD.dismiss() - if error == nil&&JSON.fromString(jsonString: str)!["issuccess"].intValue == 1{ - //处理数据{"issuccess":1,"data":[{"name":"直播历史1"},{"name":"直播历史2"}]} - }else{ - self.view.makeToast("获取观看历史失败") - } - - }) - break - default: - break - } - } - // MARK: - UITableViewDataSource,UITableViewDelegate - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return roomListDataSet.count - } - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - //return 70+getScreenWidth()/2 - return 331 - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell=tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! HomeTableViewCell - cell.setUpWith(type: type,item: roomListDataSet[indexPath.row]) - return cell - } - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let item=roomListDataSet[indexPath.row] - if type==LivesType.liveList{ - if item.f_IsExamine == 1{ - let vc = UIStoryboard(name: "Live", bundle: nil).instantiateViewController(withIdentifier: "LiveVideoSettingShareViewControllerVC") as! LiveVideoSettingShareViewController - vc.liveDetail = item - vc.title = "直播分享" - self.navigationController?.pushViewController(vc, animated: true) - return - } - let vc = Story.instantiateViewControllerWithIdentifier("LiveVideoSettingViewControllerVC", storyName: "Live") as! LiveVideoSettingViewController - vc.title = "直播设置" - vc.liveDetail=item - self.navigationController?.pushViewController(vc, animated: true) - -// let vc=Story.instantiateViewControllerWithIdentifier("LiveRoomDetailViewController", storyName: "Main") as! LiveRoomDetailViewController -// vc.item=item -// self.navigationController?.pushViewController(vc, animated: true) - return - } - } - // MARK: - UICollectionViewDelegate - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return titleDataSet.count - } - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: getScreenWidth()/4, height: 40) - } - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell=collectionView.dequeueReusableCell(withReuseIdentifier: "selectCell", for: indexPath) as! selectTypeCell - cell.titleLabel.text=titleDataSet[(indexPath as NSIndexPath).row] - if indexPath.row==currentType{ - cell.titleLabel.textColor=Theme.topBarColor() - cell.currentLabel.isHidden=false - }else{ - cell.titleLabel.textColor=UIColor.black - cell.currentLabel.isHidden=true - } - if (indexPath as NSIndexPath).row==3{ - cell.lineLabel.isHidden=true - }else{ - cell.lineLabel.isHidden=false - } - return cell - } - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - var array:[LiveDetail]=[] - var type:Int=0 - switch titleDataSet[indexPath.row] { - case "全部": - type = -1 - array=self.allListRoom - case "审核通过": - type=1 - case "审核未通过": - type=2 - case "待审核": - type=0 - default: - type=0 - } - for item in self.allListRoom { - if item.f_IsExamine==type{ - array.append(item) - } - } - self.roomListDataSet=array - currentType=indexPath.row - self.titleCollectionView.reloadData() - self.liveListTableView.reloadData() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - - -} -class selectTypeCell: UICollectionViewCell { - @IBOutlet var titleLabel: UILabel! - @IBOutlet var lineLabel: UILabel! - @IBOutlet var currentLabel: UILabel! -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LiveRoomsViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LiveRoomsViewController.swift deleted file mode 100644 index 3bbefbb..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LiveRoomsViewController.swift +++ /dev/null @@ -1,259 +0,0 @@ -// -// LiveRoomsViewController.swift -// XSTLive -// -// Created by 葛建军 on 16/11/10. -// Copyright © 2016年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class LiveRoomsViewController: UIViewController,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout { - @IBOutlet var iconImage: UIImageView! - @IBOutlet var nameLabel: UILabel! - @IBOutlet var numberLabel: UILabel! - var type:LivesType! - @IBOutlet var titleCollectionView: UICollectionView! - @IBOutlet var titleViewHeight: NSLayoutConstraint! - var titleDataSet:[String]=["全部","审核通过","审核未通过","待审核"] - @IBOutlet var roomListCollectionView: UICollectionView! - var allListRoom:[LiveDetail]=[] - var roomListDataSet:[LiveDetail]=[] - var currentType:Int=0//测试改变顶部状态时 - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - } - override func viewDidLoad() { - super.viewDidLoad() - refreshUser() - getListWithType() - } - func refreshUser(){ - //顶部collectionView的展示与否 - if type==LivesType.liveList{ - titleViewHeight.constant=50 - }else{ - titleViewHeight.constant=0 - } - //这里必然在线,不用判断是否在线 - iconImage.sd_setImage(with: URL(string: AppDelegate.instance().accountManager.photo()), placeholderImage: UIImage(named:"defphoto")) - nameLabel.text=AppDelegate.instance().accountManager.name() - numberLabel.isHidden=false - numberLabel.text="账号: "+AppDelegate.instance().accountManager.phone() - } - func getListWithType(){ - SVProgressHUD.show(withStatus: "加载中...") - SVProgressHUD.setDefaultMaskType(.black) - //清空数据 - switch type.hashValue { - case 0: - let parameters:Dictionary=["PageIndex":0 as AnyObject,"PageSize":10 as AnyObject,"WhatLive":"My" as AnyObject] - AppDelegate.instance().httpServer.getLive(parameters: parameters, completionHandler: { (str, error) in - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - for j in json["data"].arrayValue { - self.allListRoom.append(LiveDetail(j:j)) - } - self.roomListDataSet=self.allListRoom - self.roomListCollectionView.reloadData() - }, failHandler: { (error) in - self.view.makeToast("获取直播列表失败失败:\(error.localizedDescription)") - }) - }else{ - self.view.makeToast("获取直播列表失败失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - self.view.makeToast("获取直播列表失败失败:\(error!.description)") - } - }) - break - case 1: - - break - case 2: - - break - default: - break - } - } - @IBAction func backAction(_ sender: UIBarButtonItem) { - self.navigationController!.popViewController(animated: true) - } - - // MARK: - UICollectionViewDelegate - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - if collectionView==roomListCollectionView{ - return roomListDataSet.count - }else{ - return titleDataSet.count - } - } - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - var width:CGFloat! - var height:CGFloat! - if collectionView==roomListCollectionView{ - width=(getScreenWidth()-4)/2 - height=width+30 - }else{ - width=getScreenWidth()/4 - height=50 - } - return CGSize(width: width, height: height) - } - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - if collectionView==roomListCollectionView{ - let formatte=DateFormatter() - formatte.dateFormat="yyyy-MM-dd HH:mm:ss" - let item=roomListDataSet[indexPath.row] - let cell=collectionView.dequeueReusableCell(withReuseIdentifier: "roomListCell", for: indexPath) as! roomLiveDetailCell -// XSTLiveManager.shareXSTLiveManager().fetchLiveMembers(roomId: item.f_RoomId, completion: { (success, members) in -// if success { -// cell.personNumberLabel.text=" \(members.count)" -// }else{ -// cell.personNumberLabel.text=" 0" -// } -// }) - cell.backgroundImage.sd_setImage(with: URL(string:item.f_LiveImg), placeholderImage: UIImage(named:"icon")) - cell.nameLabel.text=item.f_LiveName - cell.timeLabel.text=formatte.string(from: Date(timeIntervalSince1970: JSON.fromString(jsonString: item.f_Description)!["starttime"].doubleValue/1000 as TimeInterval)) - if type==LivesType.liveList{ - cell.passLabel.isHidden=false - cell.pageLabel.isHidden=true - if item.f_IsExamine==1 { - cell.passLabel.backgroundColor=UIColor.groupTableViewBackground - cell.passLabel.textColor=UIColor.gray - cell.passLabel.text="通过" - }else if item.f_IsExamine==2 { - cell.passLabel.backgroundColor=Theme.topBarColor() - cell.passLabel.textColor=UIColor.white - cell.passLabel.text="未通过" - }else{ - cell.passLabel.backgroundColor=UIColor.groupTableViewBackground - cell.passLabel.textColor=UIColor.gray - cell.passLabel.text="待审核" - } - }else if type==LivesType.liveHistory{ - cell.passLabel.isHidden=true - cell.pageLabel.isHidden=false - cell.pageLabel.text=" 直播历史\((indexPath as NSIndexPath).row+1) " - }else if type==LivesType.watchHistory{ - cell.passLabel.isHidden=true - cell.pageLabel.isHidden=false - cell.pageLabel.text=" 观看历史\((indexPath as NSIndexPath).row+1) " - } - return cell - }else{ - let cell=collectionView.dequeueReusableCell(withReuseIdentifier: "selectCell", for: indexPath) as! selectTypeCell - cell.titleLabel.text=titleDataSet[(indexPath as NSIndexPath).row] - if indexPath.row==currentType{ - cell.titleLabel.textColor=Theme.topBarColor() - }else{ - cell.titleLabel.textColor=UIColor.black - } - if (indexPath as NSIndexPath).row==3{ - cell.lineLabel.isHidden=true - }else{ - cell.lineLabel.isHidden=false - } - return cell - } - } - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - if collectionView==roomListCollectionView{ - let item=roomListDataSet[indexPath.row] - if type==LivesType.liveList{ - if item.f_IsExamine == 1{ - let vc = UIStoryboard(name: "Live", bundle: nil).instantiateViewController(withIdentifier: "LiveVideoSettingShareViewControllerVC") as! LiveVideoSettingShareViewController - vc.liveDetail = item - vc.title = "直播分享" - self.navigationController?.pushViewController(vc, animated: true) - return - } - let vc=Story.instantiateViewControllerWithIdentifier("LiveRoomDetailViewController", storyName: "Main") as! LiveRoomDetailViewController - vc.item=item - self.navigationController?.pushViewController(vc, animated: true) - return - } - }else{ - var array:[LiveDetail]=[] - var type:Int=0 - switch titleDataSet[indexPath.row] { - case "全部": - type = -1 - array=self.allListRoom - case "审核通过": - type=1 - case "审核未通过": - type=2 - case "待审核": - type=0 - default: - type=0 - } - for item in self.allListRoom { - if item.f_IsExamine==type{ - array.append(item) - } - } - self.roomListDataSet=array - currentType=indexPath.row - self.titleCollectionView.reloadData() - self.roomListCollectionView.reloadData() - } - } - - - @IBAction func showAlertMenu(_ sender: UILongPressGestureRecognizer) { - let p=sender.location(in: sender.view) - if let indexPath=self.roomListCollectionView.indexPathForItem(at: p){ - let cell=self.roomListCollectionView.cellForItem(at: indexPath) as! roomLiveDetailCell - cell.becomeFirstResponder() - if sender.state==UIGestureRecognizerState.began{ - let menu=UIMenuController.shared - let item=indexUIMenuItem(title:"拷贝",action:#selector(LiveRoomsViewController.copyAction(_:))) - item.indexPath=indexPath - menu.menuItems=[item] - menu.setTargetRect(cell.bounds, in: cell) - menu.arrowDirection=UIMenuControllerArrowDirection.down - menu.update() - menu.isMenuVisible=true } - } - } - override var canBecomeFirstResponder : Bool { - return true - } - func copyAction(_ item:UIMenuController){ - let alert=AlertController.creatAlert("拷贝\(((item.menuItems![0] as! indexUIMenuItem).indexPath! as NSIndexPath).row+1)号房间") - self.present(alert, animated: true, completion: nil) - } - - - - - - - - - - - - - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } -} -class roomLiveDetailCell: UICollectionViewCell { - - @IBOutlet var backgroundImage: UIImageView! - @IBOutlet var passLabel: UILabel! - @IBOutlet var pageLabel: UILabel! - @IBOutlet var nameLabel: UILabel! - @IBOutlet var personNumberLabel: UILabel! - @IBOutlet var timeLabel: UILabel! - - -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LoginViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LoginViewController.swift deleted file mode 100644 index de07e5c..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/LoginViewController.swift +++ /dev/null @@ -1,145 +0,0 @@ -// -// LoginViewController.swift -// YouerLiveVideo -// -// Created by 左丞 on 16/11/11. -// Copyright © 2016年 左丞. All rights reserved. -// - -import UIKit - -class LoginViewController: UIViewController,UITextFieldDelegate { - @IBOutlet var changeViewTop: NSLayoutConstraint! - @IBOutlet var phoneNumberTextField: UITextField! - @IBOutlet var passwordTextField: UITextField! - override func viewDidLoad() { - super.viewDidLoad() - let numberPlaceholder=NSMutableAttributedString(string: "请输入11位数的手机号码") - numberPlaceholder.addAttribute(NSForegroundColorAttributeName, value: UIColor.white, range: NSMakeRange(0, 12)) - phoneNumberTextField.attributedPlaceholder=numberPlaceholder - phoneNumberTextField.tintColor=Theme.topBarColor() - let passwordPlaceholder=NSMutableAttributedString(string: "请输入6位以上的密码") - passwordPlaceholder.addAttribute(NSForegroundColorAttributeName, value: UIColor.white, range: NSMakeRange(0, 10)) - passwordTextField.attributedPlaceholder=passwordPlaceholder - passwordTextField.tintColor=Theme.topBarColor() - - NotificationCenter.default.addObserver(self, selector: #selector(LoginViewController.refreshUser), name: NSNotification.Name(rawValue: "refreshLoginUser"), object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(LoginViewController.keyboardWIllChange), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil) -// let leftbtn = UIBarButtonItem(title: "返回", style: .plain, target: self, action: #selector(LoginViewController.back)) -// self.navigationItem.title = "登录" -// self.navigationItem.leftBarButtonItem = leftbtn - changeViewTop.constant=(getScreenHeight()-64-220)/3 - } - //点击页面回收键盘 - @IBAction func touchAction(_ sender: AnyObject) { - self.view.endEditing(true)//回收键盘 - } - override var preferredStatusBarStyle: UIStatusBarStyle{ - return UIStatusBarStyle.lightContent - } - //输入密码点击return回收键盘 - func textFieldShouldReturn(_ textField: UITextField) -> Bool { - textField.resignFirstResponder() - return true - } - //注册完了后自动填充账号 - func refreshUser(noti:Notification){ - phoneNumberTextField.text = "\(noti.object!)" - } - //点击登录按钮 - @IBAction func loginBtnClickAction(_ sender: Any) { - self.view.endEditing(true) - if phoneNumberTextField.text!.isMobilePhoneNumber() { - SVProgressHUD.show(withStatus: "登录...") - SVProgressHUD.setDefaultMaskType(.black) - let parameters:Dictionary=["grant_type":"password" as AnyObject,"username":phoneNumberTextField.text! as AnyObject,"password":passwordTextField.text! as AnyObject] - AppDelegate.instance().httpServer.login(parameters: parameters) { (str, error) in - let json=JSON.fromString(jsonString: str) - if let ret=json{ - let er=ret["error"].string - if let errorStr=er{ - SVProgressHUD.dismiss() - let Strings=errorStr.components(separatedBy:":") - if Strings.count >= 2 { - switch Strings[1] { - //用户关联多个身份,请使用学事号登录:100 - case "101"://用户认证身份不存在:101 - AppDelegate.instance().window?.makeToast("用户认证身份不存在,请进行账号激活。") - break - //用户帐号或密码错误:102 - case "103":// 用户不存在:103 - AppDelegate.instance().window?.makeToast("该号码不存在,请联系客服400-826-2468") - break - default: - AppDelegate.instance().window?.makeToast("\(errorStr)") - break - } - }else{ - AppDelegate.instance().window?.makeToast("\(errorStr)") - } - }else if ret["access_token"].stringValue != ""{ - AppDelegate.instance().accountManager.setTokenInfo(tokenInfo: ret) - AppDelegate.instance().accountManager.saveToken(tokenInfo: ret) - AppDelegate.instance().accountManager.refreshUserInfo(completionHandler: { (finish) in - if finish{ - self.loadUserInfo() - }else{ - AppDelegate.instance().window?.makeToast("身份获取失败") - SVProgressHUD.dismiss() - } - }) - }else{ - SVProgressHUD.dismiss() - AppDelegate.instance().window?.makeToast("登录失败,请稍后重试") - } - }else{ - SVProgressHUD.dismiss() - AppDelegate.instance().window?.makeToast("登录失败") - } - } - }else{ - self.view.makeToast("请输入正确手机号") - } - } - func loadUserInfo(){ - XSTLiveManager.shareXSTLiveManager().login(userId: self.phoneNumberTextField.text!, completion: { (success) in - if !success{ - AppDelegate.instance().window?.makeToast("聊天服务登录失败,请连接网络重试") - SVProgressHUD.dismiss() - }else{ - SVProgressHUD.dismiss() - self.back() - } - }) - } - func back(){ - self.dismiss(animated: true, completion: nil) - LeadViewController.instance.removeAll() - LeadViewController.instance.showMain() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - //点击注册按钮 - @IBAction func registerBtnClickAction(_ sender: AnyObject) { - let vc = UIStoryboard(name: "User", bundle: nil).instantiateViewController(withIdentifier: "RegisterViewControllerVC") as! RegisterViewController - vc.title = "注册" - self.navigationController?.pushViewController(vc, animated: true) - } - //键盘监听 - func keyboardWIllChange(noti: NSNotification){ - let userInfo:NSDictionary=noti.userInfo! as NSDictionary - let endFrame=(userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue - if endFrame?.origin.y==getScreenHeight() { - changeViewTop.constant=(getScreenHeight()-64-220)/3 - }else{ - let y = (getScreenHeight()-64-220)/3+CGFloat(64+220) - if (endFrame?.origin.y)! < y { - changeViewTop.constant=getScreenHeight()-64-(endFrame?.size.height)!-220 - } - } - } - -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/MyAttentionViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/MyAttentionViewController.swift deleted file mode 100644 index 390decb..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/MyAttentionViewController.swift +++ /dev/null @@ -1,67 +0,0 @@ -// -// MyAttentionViewController.swift -// YouerLiveVideo -// -// Created by 葛建军 on 17/1/18. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class MyAttentionViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { - var allSchool:[OrganizeListSchool]=[] - @IBOutlet var tableView: UITableView! - override func viewDidLoad() { - super.viewDidLoad() - tableView.register(UINib(nibName: "AttentionTableViewCell", bundle: nil), forCellReuseIdentifier: "AttentionTableViewCell") - getActSchoolList() - } - func getActSchoolList(){ - SVProgressHUD.show(withStatus: "加载中...") - SVProgressHUD.setDefaultMaskType(.black) - AppDelegate.instance().httpServer.postLiveOrganizeList(type:"Act") { (str, error) in - if error==nil { - SVProgressHUD.dismiss() - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.allSchool=OrganizeListSchool.getAllSchool(j: json) - self.tableView.reloadData() - }, failHandler: { (error) in - NSLog("获取关注学校失败:\(error.localizedDescription)") - }) - }else{ - NSLog("获取关注学校失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - NSLog("获取关注学校失败:\(error!.description)") - } - } - } - // MARK: - UITableViewDelegate,UITableViewDataSource - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return allSchool.count - } - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return 80 - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell=tableView.dequeueReusableCell(withIdentifier: "AttentionTableViewCell") as! AttentionTableViewCell - cell.setupWith(item: allSchool[indexPath.row],isMy: true) - cell.superVC=self - return cell - } - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let item=allSchool[indexPath.row] - let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "LiveTypeListViewController") as! LiveTypeListViewController - vc.isType=false - vc.F_OrganizeId=item.f_Id - vc.title=item.f_FullName - self.navigationController!.pushViewController(vc, animated: true) - } - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - - -} - diff --git a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/PersonalSettingViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/PersonalSettingViewController.swift deleted file mode 100644 index 049827f..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/PersonalSettingViewController.swift +++ /dev/null @@ -1,238 +0,0 @@ -// -// PersonalSettingViewController.swift -// YouerLiveVideo -// -// Created by 左丞 on 16/11/12. -// Copyright © 2016年 左丞. All rights reserved. -// - -import UIKit - -class PersonalSettingViewController: UIViewController ,UITableViewDelegate,UITableViewDataSource,UINavigationControllerDelegate,UIImagePickerControllerDelegate{ - @IBOutlet weak var userSettingTableView: UITableView! - @IBOutlet var rightBarBtn: UIBarButtonItem! - @IBOutlet var loginoutBtn: UIButton! - var titleArr:[String] = ["头像","昵称","手机号(账号)"]//["头像","账号","昵称","性别"] - var user:Contact! - var isUserActivity:Bool=false - override func viewDidLoad() { - super.viewDidLoad() - user = Contact() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - switch indexPath.row { - case 0: - let sheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) - sheet.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil)) - sheet.addAction(UIAlertAction(title: "拍照", style: .default, handler: { (action) in - if cameraOrPhotPermissions(1, view: self.view){ - let vc = UIImagePickerController() - vc.delegate = self - vc.sourceType = .camera - self.present(vc, animated: true, completion: nil) - }else{ - - } - self.userSettingTableView.reloadData() - })) - sheet.addAction(UIAlertAction(title: "从相册选择", style: .default, handler: { (action) in - if cameraOrPhotPermissions(1, view: self.view){ - let vc = UIImagePickerController() - vc.delegate = self - vc.sourceType = .photoLibrary - self.present(vc, animated: true, completion: nil) - }else{ - - } - self.userSettingTableView.reloadData() - })) - self.present(sheet, animated: true, completion: nil) - break - case 1: - let alert = UIAlertController(title: "修改昵称", message: "", preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "确定", style: .default, handler: { (action) in - if alert.textFields![0].text == ""{ - return - } - if (alert.textFields![0].text?.characters.count)!>15{ - self.user.nickName = (alert.textFields![0].text! as NSString).substring(to: 15) - }else{ - self.user.nickName = alert.textFields![0].text - } - self.userSettingTableView.reloadData() - })) - alert.addAction(UIAlertAction(title: "取消", style: .default, handler: nil)) - alert.addTextField { (text) in - text.placeholder = "请输入昵称,且不能超过15个字符" - } - self.present(alert, animated: true, completion: nil) - break - case 3: - let sheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) - sheet.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil)) - sheet.addAction(UIAlertAction(title: "男", style: .default, handler: { (action) in - self.user.userSex = "男" - self.userSettingTableView.reloadData() - })) - sheet.addAction(UIAlertAction(title: "女", style: .default, handler: { (action) in - self.user.userSex = "女" - self.userSettingTableView.reloadData() - })) - self.present(sheet, animated: true, completion: nil) - break - default: - break - } - } - - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return titleArr.count - } - - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return 44 - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! PersonalSettingCell - cell.nameTitleLabel.text = titleArr[indexPath.row] - cell.nameLabelRightSpace.constant = 8 - cell.imagePhoto.isHidden = true - cell.namelabel.isHidden = false - cell.rightArrow.isHidden = false - cell.isUserInteractionEnabled = true - if isUserActivity { - cell.isUserInteractionEnabled=true - }else{ - cell.isUserInteractionEnabled=false - } - switch indexPath.row { - case 0: - cell.imagePhoto.isHidden = false - cell.namelabel.isHidden = true - cell.imagePhoto.sd_setImage(with: URL(string: user.imageURL), placeholderImage: UIImage(named: "defphoto")) - break - case 1: - cell.namelabel.text = user.nickName//AppDelegate.instance().accountManager.name() - break - case 2: - cell.nameLabelRightSpace.constant = -10 - cell.rightArrow.isHidden = true - cell.isUserInteractionEnabled = false - cell.namelabel.text = user.userId//AppDelegate.instance().accountManager.phone() - break - case 3: - cell.namelabel.text = user.userSex - break - - default: - break - } - return cell - } - - func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { - picker.dismiss(animated: true, completion: { () -> Void in - var oimage = info[UIImagePickerControllerOriginalImage] as? UIImage - oimage = oimage!.imageScaledToScale() - let filePath=FilesManager.imageFilePath(String(format:"%f.jpg",Date().timeIntervalSince1970)) - try? UIImageJPEGRepresentation(oimage!,0.5)!.write(to: URL(fileURLWithPath: filePath), options: [.atomic]) - self.updateImage(file: filePath) - }) - } - func updateImage(file:String){ - SVProgressHUD.show(withStatus: "图片上传中...") - SVProgressHUD.setDefaultMaskType(.black) - AppDelegate.instance().httpServer.uploadFile(file: NSURL(fileURLWithPath: file)) { (str, error) in - SVProgressHUD.dismiss() - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - let str=json.contentData().arrayValue[0].stringValue - self.user.imageURL=str - }, failHandler: { (error) in - self.user.imageURL="" - self.view.makeToast("图片上传失败:\(error.localizedDescription)") - }) - self.userSettingTableView.reloadData() - } - } - // MARK: - 退出登录按钮点击事件 - @IBAction func ExsitBtnClickAction(_ sender: Any) { - AppDelegate.instance().accountManager.logOut() - } - // MARK: - 完成按钮点击事件 - @IBAction func finishAction(_ sender: UIBarButtonItem) { - if isUserActivity { - //需要新的接口来修改个人信息 - SVProgressHUD.show(withStatus: "修改个人信息...") - SVProgressHUD.setDefaultMaskType(.black) - let parameters:Dictionary=["f_RealName":self.user.nickName as AnyObject,"f_HeadIcon":self.user.imageURL as AnyObject] - AppDelegate.instance().httpServer.updataUserInfo(parameters: parameters, completionHandler: { (str, error) in - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - //把账号信息存储下来,暂时这样修改。若以后个人信息中有其他元素,需加新的接口来更新个人信息。 - // var dic=Setting.getUserInfo()?.dictionaryValue["data"]?.dictionaryObject - // _=dic?.updateValue(self.user.nickName, forKey: "f_RealName") - // _=dic?.updateValue(self.user.imageURL, forKey: "f_HeadIcon") - // let userInfo:Dictionary=["status":1 as AnyObject,"data":dic as AnyObject] - // AppDelegate.instance().accountManager.rawUserInfo=JSON(userInfo) - // _=Setting.saveUserInfo(JSON(userInfo).rawString()) - XSTLiveManager.shareXSTLiveManager().setUpPersonInfo(name: self.user.nickName, icon: self.user.imageURL) - AppDelegate.instance().window?.makeToast("修改个人信息成功") - self.rightBarBtn.title="修改" - self.isUserActivity=false - self.loginoutBtn.isHidden=false - self.userSettingTableView.reloadData() - AppDelegate.instance().accountManager.refreshUserInfo(completionHandler: { (finish) in - if !finish{ - AppDelegate.instance().window?.makeToast("身份获取失败") - } - }) - }else{ - self.view.makeToast("修改个人信息失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - self.view.makeToast("修改个人信息失败:\(error!.description)") - } - }) - }else{ - self.rightBarBtn.title="保存" - self.isUserActivity=true - self.loginoutBtn.isHidden=true - self.userSettingTableView.reloadData() - } - } - -} - -class PersonalSettingCell: UITableViewCell { - - - @IBOutlet weak var nameLabelRightSpace: NSLayoutConstraint! - - @IBOutlet weak var rightArrow: UIImageView! - @IBOutlet weak var namelabel: UILabel! - @IBOutlet weak var imagePhoto: UIImageView! - @IBOutlet weak var nameTitleLabel: UILabel! - - -} - -class Contact { - var nickName:String! - var userId:String! - var userSex:String! - var imageURL:String! - init() { - nickName = AppDelegate.instance().accountManager.name() - userId = AppDelegate.instance().accountManager.phone() - userSex = "男" - imageURL = AppDelegate.instance().accountManager.photo() - } -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/RegisterViewController.swift b/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/RegisterViewController.swift deleted file mode 100644 index d9d2bc9..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/RegisterViewController.swift +++ /dev/null @@ -1,173 +0,0 @@ -// -// RegisterViewController.swift -// YouerLiveVideo -// -// Created by 左丞 on 16/11/9. -// Copyright © 2016年 左丞. All rights reserved. -// - -import UIKit - -class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,UITextFieldDelegate{ - - - @IBOutlet weak var sendVerificationCode: UIButton! - @IBOutlet var nikeNameTextFiled: UITextField! //昵称 - @IBOutlet var passwordTextField: UITextField! //输入密码 - @IBOutlet var confirmPasswordTextField: UITextField!//确认密码 - @IBOutlet weak var phoneNumber: UITextField! - @IBOutlet weak var inputVerificationCode: UITextField!//验证码 - @IBOutlet weak var registerBtn: UIButton! - @IBOutlet weak var nickNameLabel: UILabel! - @IBOutlet weak var sendPhotoImage: UIImageView! - var iconImage: UIImage? - var name: String="" - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view. - } - - @IBAction func touchAction(_ sender: AnyObject) { - self.view.endEditing(true)//回收键盘 - } - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - func textFieldShouldReturn(_ textField: UITextField) -> Bool { - textField.resignFirstResponder() - return true - } - - @IBAction func sendVerificationCodeClickAction(_ sender: AnyObject) {//发验证码 - self.view.endEditing(true) - if nikeNameTextFiled.text!.characters.count<11{ - if passwordTextField.text!.characters.count>=6 && passwordTextField.text!.characters.count<=8 && confirmPasswordTextField.text!.characters.count>=6 && confirmPasswordTextField.text!.characters.count<=8{ - if passwordTextField.text!==confirmPasswordTextField.text!{ - if (phoneNumber.text?.isMobilePhoneNumber())! { - SVProgressHUD.show(withStatus: "获取验证码...") - SVProgressHUD.setDefaultMaskType(.black) - AppDelegate.instance().httpServer.getChangePhoneCaptcha(mobile: phoneNumber.text!, completionHandler: { (str, error) in - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.view.makeToast("验证码发送成功") - self.nikeNameTextFiled.isUserInteractionEnabled=false - self.phoneNumber.isUserInteractionEnabled=false - self.passwordTextField.isUserInteractionEnabled=false - self.confirmPasswordTextField.isUserInteractionEnabled=false - }, failHandler: { (error) in - self.view.makeToast("验证码发送失败:\(error.localizedDescription)") - }) - }else{ - self.view.makeToast("验证码发送失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - self.view.makeToast("验证码发送失败:\(error!.description)") - } - }) - }else{ - self.view.makeToast("请输入正确手机号") - } - }else{ - self.view.makeToast("两次输入密码不一致") - } - }else{ - self.view.makeToast("密码必须为6-8位字符或者数字") - } - }else{ - self.view.makeToast("昵称必须小于11位") - } - } - - @IBAction func registerBtnAction(_ sender: AnyObject) {//注册 - if inputVerificationCode.text!.characters.count == 4{ - SVProgressHUD.show(withStatus: "注册...") - SVProgressHUD.setDefaultMaskType(.black) - let parameters:Dictionary=["f_Account":phoneNumber.text! as AnyObject,"f_UserPassword":passwordTextField.text! as AnyObject,"f_RealName": (nikeNameTextFiled.text!=="" ? phoneNumber.text! : nikeNameTextFiled.text!) as AnyObject,"f_MobilePhone":phoneNumber.text! as AnyObject,"f_VerCode":inputVerificationCode.text! as AnyObject] - AppDelegate.instance().httpServer.getCreateUser(parameters: parameters) { (str, error) in - SVProgressHUD.dismiss() - self.nikeNameTextFiled.isUserInteractionEnabled=true - self.phoneNumber.isUserInteractionEnabled=true - self.passwordTextField.isUserInteractionEnabled=true - self.confirmPasswordTextField.isUserInteractionEnabled=true - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.navigationController!.popToRootViewController(animated: true) - AppDelegate.instance().window?.makeToast("注册成功") - NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshLoginUser"), object: self.phoneNumber.text!) - //是否登录 - }, failHandler: { (error) in - self.view.makeToast("注册失败:\(error.localizedDescription)") - }) - }else{ - self.view.makeToast("注册失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - self.view.makeToast("注册失败:\(error!.description)") - } - } - }else{ - self.view.makeToast("验证码必须是四位数字") - } - } - - - @IBAction func loginBtnClickAction(_ sender: AnyObject) { - self.navigationController!.popViewController(animated: false) - } - - @IBAction func nickNameSetTapAction(_ sender: AnyObject) { - let alert = UIAlertController(title: "设置昵称", message: "", preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "取消", style: .destructive, handler: nil)) - alert.addAction(UIAlertAction(title: "确定", style: .default, handler: { (action) in - if alert.textFields![0].text == ""{ - return - } - self.name = alert.textFields![0].text! - self.nickNameLabel.text = alert.textFields![0].text - })) - - alert.addTextField { (text) in - text.placeholder = "请输入昵称" - } - self.present(alert, animated: true, completion: nil) - } - - @IBAction func sendPhotoImageTapAction(_ sender: AnyObject) { - if cameraOrPhotPermissions(0, view: self.view){ - let vc = UIImagePickerController() - vc.delegate = self - vc.sourceType = .photoLibrary - self.present(vc, animated: true, completion: nil) - }else{ - - } - } - - func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { - picker.dismiss(animated: true, completion: { () -> Void in - var oimage = info[UIImagePickerControllerOriginalImage] as? UIImage - oimage = oimage!.imageScaledToScale() - let filePath=FilesManager.imageFilePath(String(format:"%f.jpg",Date().timeIntervalSince1970)) - try? UIImageJPEGRepresentation(oimage!,0.5)!.write(to: URL(fileURLWithPath: filePath), options: [.atomic]) - self.sendPhotoImage.layer.masksToBounds = true - self.sendPhotoImage.layer.cornerRadius = 25 - self.sendPhotoImage.image = oimage - self.iconImage = oimage - }) - } - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. - } - */ - -} diff --git a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/User.storyboard b/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/User.storyboard deleted file mode 100644 index 0067c76..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controller/UserCenter/User.storyboard +++ /dev/null @@ -1,1490 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/NavigationViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/NavigationViewController.swift deleted file mode 100644 index 1f3ae03..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controllers/NavigationViewController.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// NavigationViewController.swift -// YouerLiveVideo -// -// Created by 左丞 on 2017/5/16. -// Copyright © 2017年 左丞. All rights reserved. -// - -import UIKit - -class NavigationViewController: UINavigationController { - - override func viewDidLoad() { - super.viewDidLoad() - UINavigationBar.appearance().tintColor = UIColor(red: 23/255.0, green: 70/255.0, blue: 151/255.0, alpha:1.0) - // 设置naviBar背景图片 - UINavigationBar.appearance().setBackgroundImage(UIImage(named: "navigationbarBackgroundWhite"), for: UIBarMetrics.default) - // 设置title的字体 - UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor(red: 23/255.0, green: 70/255.0, blue: 151/255.0, alpha:1.0)] - // UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName:UIFont.systemFont(ofSize: 20)] - self.interactivePopGestureRecognizer?.delegate = nil - - // Do any additional setup after loading the view. - } - - // MARK: - private method - func setBackBarButtonItem() -> UIBarButtonItem { - let backButton = UIButton.init(type: .custom) - backButton.setImage(UIImage(named: "setting_back"), for: .normal) - backButton.sizeToFit() - backButton.contentEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0) - backButton.addTarget(self, action: #selector(NavigationViewController.backClick), for: .touchUpInside) - return UIBarButtonItem.init(customView: backButton) - } - - // 设置导航栏右边按钮 - func setRightButton() -> UIBarButtonItem { - - let searchItem = UIButton.init(type: .custom) - searchItem.setImage(UIImage(named: "searchbutton_nor"), for: .normal) - searchItem.sizeToFit() - searchItem.frame.size = CGSize(width: 30, height: 30) - searchItem.contentHorizontalAlignment = .right - searchItem.addTarget(self, action: #selector(NavigationViewController.searchClick), for: .touchUpInside) - return UIBarButtonItem.init(customView: searchItem) - } - - // 点击右边的添加或搜索 - func searchClick() { - let searchvc = SearchViewController() - self.pushViewController(searchvc, animated: true) - } - - /// 返回 - func backClick() { - self.popViewController(animated: true) - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. - } - */ - -} diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/LoginViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/LoginViewController.swift new file mode 100644 index 0000000..de07e5c --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/LoginViewController.swift @@ -0,0 +1,145 @@ +// +// LoginViewController.swift +// YouerLiveVideo +// +// Created by 左丞 on 16/11/11. +// Copyright © 2016年 左丞. All rights reserved. +// + +import UIKit + +class LoginViewController: UIViewController,UITextFieldDelegate { + @IBOutlet var changeViewTop: NSLayoutConstraint! + @IBOutlet var phoneNumberTextField: UITextField! + @IBOutlet var passwordTextField: UITextField! + override func viewDidLoad() { + super.viewDidLoad() + let numberPlaceholder=NSMutableAttributedString(string: "请输入11位数的手机号码") + numberPlaceholder.addAttribute(NSForegroundColorAttributeName, value: UIColor.white, range: NSMakeRange(0, 12)) + phoneNumberTextField.attributedPlaceholder=numberPlaceholder + phoneNumberTextField.tintColor=Theme.topBarColor() + let passwordPlaceholder=NSMutableAttributedString(string: "请输入6位以上的密码") + passwordPlaceholder.addAttribute(NSForegroundColorAttributeName, value: UIColor.white, range: NSMakeRange(0, 10)) + passwordTextField.attributedPlaceholder=passwordPlaceholder + passwordTextField.tintColor=Theme.topBarColor() + + NotificationCenter.default.addObserver(self, selector: #selector(LoginViewController.refreshUser), name: NSNotification.Name(rawValue: "refreshLoginUser"), object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(LoginViewController.keyboardWIllChange), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil) +// let leftbtn = UIBarButtonItem(title: "返回", style: .plain, target: self, action: #selector(LoginViewController.back)) +// self.navigationItem.title = "登录" +// self.navigationItem.leftBarButtonItem = leftbtn + changeViewTop.constant=(getScreenHeight()-64-220)/3 + } + //点击页面回收键盘 + @IBAction func touchAction(_ sender: AnyObject) { + self.view.endEditing(true)//回收键盘 + } + override var preferredStatusBarStyle: UIStatusBarStyle{ + return UIStatusBarStyle.lightContent + } + //输入密码点击return回收键盘 + func textFieldShouldReturn(_ textField: UITextField) -> Bool { + textField.resignFirstResponder() + return true + } + //注册完了后自动填充账号 + func refreshUser(noti:Notification){ + phoneNumberTextField.text = "\(noti.object!)" + } + //点击登录按钮 + @IBAction func loginBtnClickAction(_ sender: Any) { + self.view.endEditing(true) + if phoneNumberTextField.text!.isMobilePhoneNumber() { + SVProgressHUD.show(withStatus: "登录...") + SVProgressHUD.setDefaultMaskType(.black) + let parameters:Dictionary=["grant_type":"password" as AnyObject,"username":phoneNumberTextField.text! as AnyObject,"password":passwordTextField.text! as AnyObject] + AppDelegate.instance().httpServer.login(parameters: parameters) { (str, error) in + let json=JSON.fromString(jsonString: str) + if let ret=json{ + let er=ret["error"].string + if let errorStr=er{ + SVProgressHUD.dismiss() + let Strings=errorStr.components(separatedBy:":") + if Strings.count >= 2 { + switch Strings[1] { + //用户关联多个身份,请使用学事号登录:100 + case "101"://用户认证身份不存在:101 + AppDelegate.instance().window?.makeToast("用户认证身份不存在,请进行账号激活。") + break + //用户帐号或密码错误:102 + case "103":// 用户不存在:103 + AppDelegate.instance().window?.makeToast("该号码不存在,请联系客服400-826-2468") + break + default: + AppDelegate.instance().window?.makeToast("\(errorStr)") + break + } + }else{ + AppDelegate.instance().window?.makeToast("\(errorStr)") + } + }else if ret["access_token"].stringValue != ""{ + AppDelegate.instance().accountManager.setTokenInfo(tokenInfo: ret) + AppDelegate.instance().accountManager.saveToken(tokenInfo: ret) + AppDelegate.instance().accountManager.refreshUserInfo(completionHandler: { (finish) in + if finish{ + self.loadUserInfo() + }else{ + AppDelegate.instance().window?.makeToast("身份获取失败") + SVProgressHUD.dismiss() + } + }) + }else{ + SVProgressHUD.dismiss() + AppDelegate.instance().window?.makeToast("登录失败,请稍后重试") + } + }else{ + SVProgressHUD.dismiss() + AppDelegate.instance().window?.makeToast("登录失败") + } + } + }else{ + self.view.makeToast("请输入正确手机号") + } + } + func loadUserInfo(){ + XSTLiveManager.shareXSTLiveManager().login(userId: self.phoneNumberTextField.text!, completion: { (success) in + if !success{ + AppDelegate.instance().window?.makeToast("聊天服务登录失败,请连接网络重试") + SVProgressHUD.dismiss() + }else{ + SVProgressHUD.dismiss() + self.back() + } + }) + } + func back(){ + self.dismiss(animated: true, completion: nil) + LeadViewController.instance.removeAll() + LeadViewController.instance.showMain() + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + //点击注册按钮 + @IBAction func registerBtnClickAction(_ sender: AnyObject) { + let vc = UIStoryboard(name: "User", bundle: nil).instantiateViewController(withIdentifier: "RegisterViewControllerVC") as! RegisterViewController + vc.title = "注册" + self.navigationController?.pushViewController(vc, animated: true) + } + //键盘监听 + func keyboardWIllChange(noti: NSNotification){ + let userInfo:NSDictionary=noti.userInfo! as NSDictionary + let endFrame=(userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue + if endFrame?.origin.y==getScreenHeight() { + changeViewTop.constant=(getScreenHeight()-64-220)/3 + }else{ + let y = (getScreenHeight()-64-220)/3+CGFloat(64+220) + if (endFrame?.origin.y)! < y { + changeViewTop.constant=getScreenHeight()-64-(endFrame?.size.height)!-220 + } + } + } + +} diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/PersonalSettingViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/PersonalSettingViewController.swift new file mode 100644 index 0000000..049827f --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/PersonalSettingViewController.swift @@ -0,0 +1,238 @@ +// +// PersonalSettingViewController.swift +// YouerLiveVideo +// +// Created by 左丞 on 16/11/12. +// Copyright © 2016年 左丞. All rights reserved. +// + +import UIKit + +class PersonalSettingViewController: UIViewController ,UITableViewDelegate,UITableViewDataSource,UINavigationControllerDelegate,UIImagePickerControllerDelegate{ + @IBOutlet weak var userSettingTableView: UITableView! + @IBOutlet var rightBarBtn: UIBarButtonItem! + @IBOutlet var loginoutBtn: UIButton! + var titleArr:[String] = ["头像","昵称","手机号(账号)"]//["头像","账号","昵称","性别"] + var user:Contact! + var isUserActivity:Bool=false + override func viewDidLoad() { + super.viewDidLoad() + user = Contact() + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + switch indexPath.row { + case 0: + let sheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) + sheet.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil)) + sheet.addAction(UIAlertAction(title: "拍照", style: .default, handler: { (action) in + if cameraOrPhotPermissions(1, view: self.view){ + let vc = UIImagePickerController() + vc.delegate = self + vc.sourceType = .camera + self.present(vc, animated: true, completion: nil) + }else{ + + } + self.userSettingTableView.reloadData() + })) + sheet.addAction(UIAlertAction(title: "从相册选择", style: .default, handler: { (action) in + if cameraOrPhotPermissions(1, view: self.view){ + let vc = UIImagePickerController() + vc.delegate = self + vc.sourceType = .photoLibrary + self.present(vc, animated: true, completion: nil) + }else{ + + } + self.userSettingTableView.reloadData() + })) + self.present(sheet, animated: true, completion: nil) + break + case 1: + let alert = UIAlertController(title: "修改昵称", message: "", preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "确定", style: .default, handler: { (action) in + if alert.textFields![0].text == ""{ + return + } + if (alert.textFields![0].text?.characters.count)!>15{ + self.user.nickName = (alert.textFields![0].text! as NSString).substring(to: 15) + }else{ + self.user.nickName = alert.textFields![0].text + } + self.userSettingTableView.reloadData() + })) + alert.addAction(UIAlertAction(title: "取消", style: .default, handler: nil)) + alert.addTextField { (text) in + text.placeholder = "请输入昵称,且不能超过15个字符" + } + self.present(alert, animated: true, completion: nil) + break + case 3: + let sheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) + sheet.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil)) + sheet.addAction(UIAlertAction(title: "男", style: .default, handler: { (action) in + self.user.userSex = "男" + self.userSettingTableView.reloadData() + })) + sheet.addAction(UIAlertAction(title: "女", style: .default, handler: { (action) in + self.user.userSex = "女" + self.userSettingTableView.reloadData() + })) + self.present(sheet, animated: true, completion: nil) + break + default: + break + } + } + + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return titleArr.count + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 44 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! PersonalSettingCell + cell.nameTitleLabel.text = titleArr[indexPath.row] + cell.nameLabelRightSpace.constant = 8 + cell.imagePhoto.isHidden = true + cell.namelabel.isHidden = false + cell.rightArrow.isHidden = false + cell.isUserInteractionEnabled = true + if isUserActivity { + cell.isUserInteractionEnabled=true + }else{ + cell.isUserInteractionEnabled=false + } + switch indexPath.row { + case 0: + cell.imagePhoto.isHidden = false + cell.namelabel.isHidden = true + cell.imagePhoto.sd_setImage(with: URL(string: user.imageURL), placeholderImage: UIImage(named: "defphoto")) + break + case 1: + cell.namelabel.text = user.nickName//AppDelegate.instance().accountManager.name() + break + case 2: + cell.nameLabelRightSpace.constant = -10 + cell.rightArrow.isHidden = true + cell.isUserInteractionEnabled = false + cell.namelabel.text = user.userId//AppDelegate.instance().accountManager.phone() + break + case 3: + cell.namelabel.text = user.userSex + break + + default: + break + } + return cell + } + + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { + picker.dismiss(animated: true, completion: { () -> Void in + var oimage = info[UIImagePickerControllerOriginalImage] as? UIImage + oimage = oimage!.imageScaledToScale() + let filePath=FilesManager.imageFilePath(String(format:"%f.jpg",Date().timeIntervalSince1970)) + try? UIImageJPEGRepresentation(oimage!,0.5)!.write(to: URL(fileURLWithPath: filePath), options: [.atomic]) + self.updateImage(file: filePath) + }) + } + func updateImage(file:String){ + SVProgressHUD.show(withStatus: "图片上传中...") + SVProgressHUD.setDefaultMaskType(.black) + AppDelegate.instance().httpServer.uploadFile(file: NSURL(fileURLWithPath: file)) { (str, error) in + SVProgressHUD.dismiss() + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in + let str=json.contentData().arrayValue[0].stringValue + self.user.imageURL=str + }, failHandler: { (error) in + self.user.imageURL="" + self.view.makeToast("图片上传失败:\(error.localizedDescription)") + }) + self.userSettingTableView.reloadData() + } + } + // MARK: - 退出登录按钮点击事件 + @IBAction func ExsitBtnClickAction(_ sender: Any) { + AppDelegate.instance().accountManager.logOut() + } + // MARK: - 完成按钮点击事件 + @IBAction func finishAction(_ sender: UIBarButtonItem) { + if isUserActivity { + //需要新的接口来修改个人信息 + SVProgressHUD.show(withStatus: "修改个人信息...") + SVProgressHUD.setDefaultMaskType(.black) + let parameters:Dictionary=["f_RealName":self.user.nickName as AnyObject,"f_HeadIcon":self.user.imageURL as AnyObject] + AppDelegate.instance().httpServer.updataUserInfo(parameters: parameters, completionHandler: { (str, error) in + SVProgressHUD.dismiss() + if error==nil { + if JSON.fromString(jsonString: str)!["status"].intValue == 1{ + //把账号信息存储下来,暂时这样修改。若以后个人信息中有其他元素,需加新的接口来更新个人信息。 + // var dic=Setting.getUserInfo()?.dictionaryValue["data"]?.dictionaryObject + // _=dic?.updateValue(self.user.nickName, forKey: "f_RealName") + // _=dic?.updateValue(self.user.imageURL, forKey: "f_HeadIcon") + // let userInfo:Dictionary=["status":1 as AnyObject,"data":dic as AnyObject] + // AppDelegate.instance().accountManager.rawUserInfo=JSON(userInfo) + // _=Setting.saveUserInfo(JSON(userInfo).rawString()) + XSTLiveManager.shareXSTLiveManager().setUpPersonInfo(name: self.user.nickName, icon: self.user.imageURL) + AppDelegate.instance().window?.makeToast("修改个人信息成功") + self.rightBarBtn.title="修改" + self.isUserActivity=false + self.loginoutBtn.isHidden=false + self.userSettingTableView.reloadData() + AppDelegate.instance().accountManager.refreshUserInfo(completionHandler: { (finish) in + if !finish{ + AppDelegate.instance().window?.makeToast("身份获取失败") + } + }) + }else{ + self.view.makeToast("修改个人信息失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") + } + }else{ + self.view.makeToast("修改个人信息失败:\(error!.description)") + } + }) + }else{ + self.rightBarBtn.title="保存" + self.isUserActivity=true + self.loginoutBtn.isHidden=true + self.userSettingTableView.reloadData() + } + } + +} + +class PersonalSettingCell: UITableViewCell { + + + @IBOutlet weak var nameLabelRightSpace: NSLayoutConstraint! + + @IBOutlet weak var rightArrow: UIImageView! + @IBOutlet weak var namelabel: UILabel! + @IBOutlet weak var imagePhoto: UIImageView! + @IBOutlet weak var nameTitleLabel: UILabel! + + +} + +class Contact { + var nickName:String! + var userId:String! + var userSex:String! + var imageURL:String! + init() { + nickName = AppDelegate.instance().accountManager.name() + userId = AppDelegate.instance().accountManager.phone() + userSex = "男" + imageURL = AppDelegate.instance().accountManager.photo() + } +} diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift new file mode 100644 index 0000000..d9d2bc9 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift @@ -0,0 +1,173 @@ +// +// RegisterViewController.swift +// YouerLiveVideo +// +// Created by 左丞 on 16/11/9. +// Copyright © 2016年 左丞. All rights reserved. +// + +import UIKit + +class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,UITextFieldDelegate{ + + + @IBOutlet weak var sendVerificationCode: UIButton! + @IBOutlet var nikeNameTextFiled: UITextField! //昵称 + @IBOutlet var passwordTextField: UITextField! //输入密码 + @IBOutlet var confirmPasswordTextField: UITextField!//确认密码 + @IBOutlet weak var phoneNumber: UITextField! + @IBOutlet weak var inputVerificationCode: UITextField!//验证码 + @IBOutlet weak var registerBtn: UIButton! + @IBOutlet weak var nickNameLabel: UILabel! + @IBOutlet weak var sendPhotoImage: UIImageView! + var iconImage: UIImage? + var name: String="" + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } + + @IBAction func touchAction(_ sender: AnyObject) { + self.view.endEditing(true)//回收键盘 + } + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + func textFieldShouldReturn(_ textField: UITextField) -> Bool { + textField.resignFirstResponder() + return true + } + + @IBAction func sendVerificationCodeClickAction(_ sender: AnyObject) {//发验证码 + self.view.endEditing(true) + if nikeNameTextFiled.text!.characters.count<11{ + if passwordTextField.text!.characters.count>=6 && passwordTextField.text!.characters.count<=8 && confirmPasswordTextField.text!.characters.count>=6 && confirmPasswordTextField.text!.characters.count<=8{ + if passwordTextField.text!==confirmPasswordTextField.text!{ + if (phoneNumber.text?.isMobilePhoneNumber())! { + SVProgressHUD.show(withStatus: "获取验证码...") + SVProgressHUD.setDefaultMaskType(.black) + AppDelegate.instance().httpServer.getChangePhoneCaptcha(mobile: phoneNumber.text!, completionHandler: { (str, error) in + SVProgressHUD.dismiss() + if error==nil { + if JSON.fromString(jsonString: str)!["status"].intValue == 1{ + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in + self.view.makeToast("验证码发送成功") + self.nikeNameTextFiled.isUserInteractionEnabled=false + self.phoneNumber.isUserInteractionEnabled=false + self.passwordTextField.isUserInteractionEnabled=false + self.confirmPasswordTextField.isUserInteractionEnabled=false + }, failHandler: { (error) in + self.view.makeToast("验证码发送失败:\(error.localizedDescription)") + }) + }else{ + self.view.makeToast("验证码发送失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") + } + }else{ + self.view.makeToast("验证码发送失败:\(error!.description)") + } + }) + }else{ + self.view.makeToast("请输入正确手机号") + } + }else{ + self.view.makeToast("两次输入密码不一致") + } + }else{ + self.view.makeToast("密码必须为6-8位字符或者数字") + } + }else{ + self.view.makeToast("昵称必须小于11位") + } + } + + @IBAction func registerBtnAction(_ sender: AnyObject) {//注册 + if inputVerificationCode.text!.characters.count == 4{ + SVProgressHUD.show(withStatus: "注册...") + SVProgressHUD.setDefaultMaskType(.black) + let parameters:Dictionary=["f_Account":phoneNumber.text! as AnyObject,"f_UserPassword":passwordTextField.text! as AnyObject,"f_RealName": (nikeNameTextFiled.text!=="" ? phoneNumber.text! : nikeNameTextFiled.text!) as AnyObject,"f_MobilePhone":phoneNumber.text! as AnyObject,"f_VerCode":inputVerificationCode.text! as AnyObject] + AppDelegate.instance().httpServer.getCreateUser(parameters: parameters) { (str, error) in + SVProgressHUD.dismiss() + self.nikeNameTextFiled.isUserInteractionEnabled=true + self.phoneNumber.isUserInteractionEnabled=true + self.passwordTextField.isUserInteractionEnabled=true + self.confirmPasswordTextField.isUserInteractionEnabled=true + if error==nil { + if JSON.fromString(jsonString: str)!["status"].intValue == 1{ + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in + self.navigationController!.popToRootViewController(animated: true) + AppDelegate.instance().window?.makeToast("注册成功") + NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshLoginUser"), object: self.phoneNumber.text!) + //是否登录 + }, failHandler: { (error) in + self.view.makeToast("注册失败:\(error.localizedDescription)") + }) + }else{ + self.view.makeToast("注册失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") + } + }else{ + self.view.makeToast("注册失败:\(error!.description)") + } + } + }else{ + self.view.makeToast("验证码必须是四位数字") + } + } + + + @IBAction func loginBtnClickAction(_ sender: AnyObject) { + self.navigationController!.popViewController(animated: false) + } + + @IBAction func nickNameSetTapAction(_ sender: AnyObject) { + let alert = UIAlertController(title: "设置昵称", message: "", preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "取消", style: .destructive, handler: nil)) + alert.addAction(UIAlertAction(title: "确定", style: .default, handler: { (action) in + if alert.textFields![0].text == ""{ + return + } + self.name = alert.textFields![0].text! + self.nickNameLabel.text = alert.textFields![0].text + })) + + alert.addTextField { (text) in + text.placeholder = "请输入昵称" + } + self.present(alert, animated: true, completion: nil) + } + + @IBAction func sendPhotoImageTapAction(_ sender: AnyObject) { + if cameraOrPhotPermissions(0, view: self.view){ + let vc = UIImagePickerController() + vc.delegate = self + vc.sourceType = .photoLibrary + self.present(vc, animated: true, completion: nil) + }else{ + + } + } + + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { + picker.dismiss(animated: true, completion: { () -> Void in + var oimage = info[UIImagePickerControllerOriginalImage] as? UIImage + oimage = oimage!.imageScaledToScale() + let filePath=FilesManager.imageFilePath(String(format:"%f.jpg",Date().timeIntervalSince1970)) + try? UIImageJPEGRepresentation(oimage!,0.5)!.write(to: URL(fileURLWithPath: filePath), options: [.atomic]) + self.sendPhotoImage.layer.masksToBounds = true + self.sendPhotoImage.layer.cornerRadius = 25 + self.sendPhotoImage.image = oimage + self.iconImage = oimage + }) + } + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard new file mode 100644 index 0000000..0067c76 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard @@ -0,0 +1,1490 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YouerLiveVideo/YouerLiveVideo/util/ClassModel.swift b/YouerLiveVideo/YouerLiveVideo/util/ClassModel.swift deleted file mode 100644 index aba4127..0000000 --- a/YouerLiveVideo/YouerLiveVideo/util/ClassModel.swift +++ /dev/null @@ -1,129 +0,0 @@ -// -// ClassModel.swift -// XSTLive -// -// Created by 葛建军 on 16/11/9. -// Copyright © 2016年 HANGZHOUTEAM. All rights reserved. -// - -import Foundation -//首页的列表model -class Live: NSObject { - var image:String = "" - var name:String = "" - var url:String = "" - var type:LivesType - init(image:String,name:String,url:String,type:LivesType) { - self.image=image - self.name=name - self.url = url - self.type=type - } -} -//每个直播 model -class LiveDetail:NSObject { - /* - 直播房间数据: - "f_Id": "string", - "f_LiveName": "string", - "f_LiveImg": "string", - "f_Description": "string", - "f_Sid": "string", - "f_CreatorUserId": "string", - "f_RoomId": "string", - "isExamine": 0, - “isAttention”: 0没关注1关注。这个是新加的,表示自己是否关注了这个房间创建者所在的学校,为什么这么设计详情问王金森 - “school”:学校id,用来关注 - “userName” 昵称 - “account” 账号 - “userImage” 头像 - “category” 所属分类 - “count” 现在有多少人在看(如果有这个数据的话) - */ - // var f_MobilePhone:String="" //创建直播间时要用到云信id来创建聊天室 - var f_Id:String="" //直播间ID - var f_LiveName:String="" //直播间名称 - var f_LiveImg:String="" //直播间标题图片 - var f_Description:String="" //直播间内容JSON字符串 - var f_Category:String="" //所属分类 - var f_CategoryName:String=""//所属分类名称 - var f_CreatorUserId:String=""//直播间创建人ID - var f_Sid:String="" // - var f_RoomId:String="" //返回的聊天室ID - var f_IsExamine:Int=0 //直播间审核是否通过 0 未审核 1 审核通过 2 未通过 - var f_IsAttention:Int=0 //是否录制 - var f_Account:String="" // - var f_RealName:String="" // - var f_NickName:String="" // - var f_HeadIcon:String="" // - var f_OrganizeId:String="" - init(j:JSON) { - self.f_Id=j["f_Id"].stringValue - self.f_LiveName=j["f_LiveName"].stringValue - self.f_LiveImg=j["f_LiveImg"].stringValue - self.f_Description=j["f_Description"].stringValue - self.f_Category=j["f_Category"].stringValue - self.f_CategoryName=j["f_CategoryName"].stringValue - self.f_CreatorUserId=j["f_CreatorUserId"].stringValue - self.f_Sid=j["f_Sid"].stringValue - self.f_RoomId=j["f_RoomId"].stringValue - self.f_IsExamine=j["f_IsExamine"].intValue - self.f_IsAttention=j["f_IsAttention"].intValue - self.f_Account=j["f_Account"].stringValue - self.f_RealName=j["f_RealName"].stringValue - self.f_NickName=j["f_NickName"].stringValue - self.f_HeadIcon=j["f_HeadIcon"].stringValue - self.f_OrganizeId=j["f_OrganizeId"].stringValue - } - static func getAllLives(j:JSON) -> [LiveDetail] { - var allLiveRoom:[LiveDetail]=[] - for json in j["data"].arrayValue { - allLiveRoom.append(LiveDetail(j:json)) - } - return allLiveRoom - } - override init() { - - } -} -//首页中直播和点播顶部分类 直播Live,点播Video -class LiveType:NSObject { - var f_Id:String="" //分类ID - var f_SortCode:String="" //分类 - var f_LiveTypeName:String="" //分类名称 - var f_Img:String="" //分类图标 - init(j:JSON) { - self.f_Id=j["f_Id"].stringValue - self.f_SortCode=j["f_SortCode"].stringValue - self.f_LiveTypeName=j["f_LiveTypeName"].stringValue - self.f_Img=j["f_Img"].stringValue - } - static func getAllLiveType(j:JSON) -> [LiveType] { - var allLiveType:[LiveType]=[] - for json in j["data"].arrayValue { - allLiveType.append(LiveType(j:json)) - } - return allLiveType - } -} -//我的关注的学校列表 All 所有的,Act我关注的 -class OrganizeListSchool:NSObject { - var f_Id:String="" //学校ID - var f_FullName:String="" //学校 - var f_ShortName:String="" //学校名称 - var f_Views:String="" //学校图标 - init(j:JSON) { - self.f_Id=j["f_Id"].stringValue - self.f_FullName=j["f_FullName"].stringValue - self.f_ShortName=j["f_ShortName"].stringValue - self.f_Views=j["f_Views"].stringValue - } - static func getAllSchool(j:JSON) -> [OrganizeListSchool] { - var allSchoolList:[OrganizeListSchool]=[] - for json in j["data"].arrayValue { - allSchoolList.append(OrganizeListSchool(j:json)) - } - return allSchoolList - } -} - diff --git a/YouerLiveVideo/YouerLiveVideo/util/PassWordView.swift b/YouerLiveVideo/YouerLiveVideo/util/PassWordView.swift new file mode 100644 index 0000000..1d9d509 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/util/PassWordView.swift @@ -0,0 +1,61 @@ +// +// PassWordView.swift +// YouerLiveVideo +// +// Created by 左丞 on 17/1/22. +// Copyright © 2017年 左丞. All rights reserved. +// + +import UIKit + +class PassWordView: UIView ,ZSDSetPasswordViewDelegate{ + + @IBOutlet weak var zsdView: ZSDSetPasswordView! + var superVC:UIViewController! + var passWord:String! + var delegate:PassWordEnterViewDelegate! + /* + // Only override draw() if you perform custom drawing. + // An empty implementation adve rsely affects performance during animation. + override func draw(_ rect: CGRect) { + // Drawing code + } + */ + override func awakeFromNib() { + NotificationCenter.default.addObserver(self, selector: #selector(PassWordView.KeyboardWillChangeFrame(_:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil) + zsdView.delegate = self + + zsdView.frame = CGRect(x: (getScreenWidth()-200)/2, y: 0, width: 200, height: 90) + zsdView.layer.masksToBounds = true + zsdView.layer.cornerRadius = 5 + zsdView.fieldBecomeFirstResponder() + + let title = UILabel(frame: CGRect(x: (200 - 100)/2, y: 5, width: 100, height: 30)) + title.text = "请输入密码" + zsdView.addSubview(title) + self.addSubview(zsdView) + } + + func KeyboardWillChangeFrame(_ noti:NSNotification){ + let info = noti.userInfo + let endFrame = info![UIKeyboardFrameEndUserInfoKey] as! NSValue + let dur = info![UIKeyboardAnimationDurationUserInfoKey] + UIView.animate(withDuration: dur as! TimeInterval, animations: { () -> Void in + self.zsdView.frame.origin.y = (endFrame.cgRectValue.origin.y - 100)/2 + }) + } + + @IBAction func tapClick(_ sender: Any) { + self.removeFromSuperview() + } + + func passwordView(_ passwordView: ZSDSetPasswordView!, inputPassword password: String!) { + if delegate != nil{ + delegate.passwordView(password) + } + } +} + +public protocol PassWordEnterViewDelegate : NSObjectProtocol { + func passwordView(_ password: String!) +} diff --git a/YouerLiveVideo/YouerLiveVideo/util/PassWordView.xib b/YouerLiveVideo/YouerLiveVideo/util/PassWordView.xib new file mode 100644 index 0000000..894e3c7 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/util/PassWordView.xib @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YouerLiveVideo/YouerLiveVideo/util/network.swift b/YouerLiveVideo/YouerLiveVideo/util/network.swift index 68519cc..9ace16c 100644 --- a/YouerLiveVideo/YouerLiveVideo/util/network.swift +++ b/YouerLiveVideo/YouerLiveVideo/util/network.swift @@ -90,28 +90,24 @@ final class KHttp{ final class HTTPServer{ static let HOST="http://60.190.202.49:8096/swagger/ui/index#"//"https://zbapi.myjxt.com"//"http://60.190.202.49:8096/swagger/ui/index#" - static let HOSTOLD="https://newapi.myjxt.com"//"http://60.190.202.49:8081" - static let URL_UPLOAD_FILE=HOSTOLD+"/api/Resource/UploadFile" //上传图片 static let URL_OAUTH_TOKEN=HOST+"/OAuth/Token" //登录 - static let URL_CHANGEPHONECAPTCHA=HOST+"/api/Live/SendVerCode" //获取验证码 - static let URL_LIVECREATEUSER=HOST+"/api/Live/AppCreateUser" //注册 - static let URL_LIVEUSERINFO=HOST+"/api/Live/UserInfo" //更新本地个人信息 - static let URL_LIVEUPDATEUSER=HOST+"/api/Live/APPUpdateUser" //修改个人信息 - static let URL_LIVEISACTION=HOST+"/api/Live/IsAction" //关注或取消关注 - static let URL_LIVECOMMENT=HOST+"/api/Live/Comment" //留言列表 - static let URL_LIVEUSERCOMMENT=HOST+"/api/Live/UserComment" //用户留言 - - static let URL_LIVELIST=HOST+"/api/Live/LiveList" //直播列表 Hot热门,Rec推荐,My我创建的,Org机构的 学校第二层显示 - static let URL_LIVEOLIVETYPE=HOST+"/api/Live/LiveType" //首页中直播和点播顶部分类Live 直播分类,Video 点播分类 - - static let URL_LIVECREATELIVE=HOST+"/api/Live/CreateLive" //创建直播间 - static let URL_LIVEUPDATELIVE=HOST+"/api/Live/UpdateLive" //修改直播间信息 - - static let URL_LIVEORGANIZELIST=HOST+"/api/Live/OrganizeList" //我的关注的学校列表 All 所有的,Act我关注的 - - + static let URL_ACCOUNTPHONECAPTCHA=HOST+"/api/Account/PhoneCaptcha" //获取验证码 + static let URL_ACCOUNTCREATEUSER=HOST+"/api/Account/CreateUser" //游客注册 + static let URL_ACCOUNTUPDATEPASSWORD=HOST+"/api/Account/UpdatePassword" //重设密码 + static let URL_ACCOUNTCURRENTINFO=HOST+"/api/Account/CurrentInfo" //获取当前登陆用户的信息 + static let URL_ACCOUNTACTIVATEACCOUNT=HOST+"/api/Account/ActivateAccount"//激活账号 + static let URL_ACCOUNTUPDATEUSER=HOST+"/api/Account/Updateuser" //修改用户信息 + static let URL_ACCOUNTADDUSER=HOST+"/api/Account/AddUser" // + + static let URL_COMMONGETCOURSEWAREVERSIONS=HOST+"/api/Common/GetCourseWareVersions" //获取所有的教材版本 + static let URL_COMMONGETSUBJECTS=HOST+"/api/Common/GetSubjects" //获取学科 + static let URL_COMMONGETSCHOOLTYPES=HOST+"/api/Common/GetSchoolTypes" //获取学段 + static let URL_COMMONGETLUNBOLIST=HOST+"/api/Common/GetLunboList" //获取轮播图 + static let URL_COMMONGETGRADES=HOST+"/api/Common/GetGrades" //根据学段获取年级 + static let URL_COMMONGETCOURSEWAVES=HOST+"/api/Common/GetCourseWaves" //获取教材 + static let URL_UPLOAD_FILE=HOST+"/api/Common/UploadFile" //文件上传接口,接受图片(gif,jpg,jpeg,png,bmp)、视频(flv,mp4)、音频(mp3,aac) static let PLAYHISTORY=HOST+"/appfake_war_exploded/playhistory" //直播历史 static let LIVEHISTORY=HOST+"/appfake_war_exploded/livehistory" //观看历史 @@ -158,86 +154,36 @@ final class HTTPServer{ } //获取验证码 func getChangePhoneCaptcha(mobile:String,completionHandler:@escaping (String?, NSError?) -> Void){ - KHttp.POST(url: HTTPServer.URL_CHANGEPHONECAPTCHA+"?F_MobilePhone=\(mobile)",parameters:["F_MobilePhone":mobile as AnyObject],headers:["Authorization":token!], completionHandler: completionHandler) + KHttp.GET(url: HTTPServer.URL_ACCOUNTPHONECAPTCHA,parameters:["mobile":mobile as AnyObject],headers:["Authorization":token!], completionHandler: completionHandler) } - //注册 + //游客注册 func getCreateUser(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.POST(url: HTTPServer.URL_LIVECREATEUSER, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) - } - - //更新本地个人信息 - func uplocalUserInfo(completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.POST(url: HTTPServer.URL_LIVEUSERINFO, headers:["Authorization":token!], completionHandler: completionHandler) + KHttp.POST(url: HTTPServer.URL_ACCOUNTCREATEUSER, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) } - //修改个人信息 - func updataUserInfo(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.POST(url: HTTPServer.URL_LIVEUPDATEUSER, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + //重设密码 + func getUpdatePassword(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_ACCOUNTUPDATEPASSWORD, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) } - //关注或取消关注 - func setIsAction(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.GET(url: HTTPServer.URL_LIVEISACTION, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + //获取当前登陆用户的信息 + func getCurrentInfo(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_ACCOUNTCURRENTINFO, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) } - //留言列表 - func postLiveComment(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ -// KHttp.POST(url: HTTPServer.URL_LIVECOMMENT, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) - KHttp.POST(url: HTTPServer.URL_LIVECOMMENT+"?LiveId=\(parameters!["LiveId"]!)", parameters: nil,headers:["Authorization":token!], completionHandler: completionHandler) - + //激活账号 + func postActivateAccount(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.POST(url: HTTPServer.URL_ACCOUNTACTIVATEACCOUNT, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) } - //用户留言 - func getLiveUserComment(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.GET(url: HTTPServer.URL_LIVEUSERCOMMENT, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + //修改用户信息 + func postUpdateUser(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.POST(url: HTTPServer.URL_ACCOUNTUPDATEUSER, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) } - //MARK:-首页直播信息 - //直播列表 Hot热门,Rec推荐,My我创建的,Org机构的 学校第二层显示 - func getLive(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.GET(url: HTTPServer.URL_LIVELIST, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) - } - //首页中直播和点播顶部分类Live 直播分类,Video 点播分类 - func postLiveType(type: String,completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.POST(url: HTTPServer.URL_LIVEOLIVETYPE+"?F_Type=\(type)",headers:["Authorization":token!], completionHandler: completionHandler) - } - //MARK:-直播间我的 - //创建直播间 - func postCreateLive(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.POST(url: HTTPServer.URL_LIVECREATELIVE, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) - } - //修改直播间信息 - func postUpdateLive(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.POST(url: HTTPServer.URL_LIVEUPDATELIVE, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) - } - //我的关注的学校列表 All 所有的,Act我关注的 - func postLiveOrganizeList(type: String,completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.POST(url: HTTPServer.URL_LIVEORGANIZELIST+"?WhatType=\(type)",headers:["Authorization":token!], completionHandler: completionHandler) - /* - let url=NSURL(string: HTTPServer.URL_GROUP_TEACHERLIST+"?GroupId=\(groupid)") - let request:NSMutableURLRequest=NSMutableURLRequest(URL: url!) - request.HTTPMethod = "GET" - request.setValue(token, forHTTPHeaderField: "Authorization") - request.setValue(KHttp.getSign(),forHTTPHeaderField: "sign") - //以后用Session - let config=NSURLSessionConfiguration.defaultSessionConfiguration() - let session=NSURLSession(configuration: config, delegate: URLSessionVC.share, delegateQueue: nil) - let dataTask=session.dataTaskWithRequest(request) { (data, response, sessionError) in - if sessionError==nil{ - completionHandler(NSString(data: data!, encoding: NSUTF8StringEncoding) as? String,nil) - }else{ - completionHandler("",sessionError) - } - } - dataTask.resume() - */ + // + func getAddUser(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_ACCOUNTADDUSER, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) } - //直播历史 - func getPlayHistory(completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.POST(url: HTTPServer.PLAYHISTORY,headers:["Authorization":token!], completionHandler: completionHandler) - } - //观看历史 - func getLiveHistory(completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.POST(url: HTTPServer.LIVEHISTORY,headers:["Authorization":token!], completionHandler: completionHandler) - } + } let SERVER_MESSAGE=393939 diff --git a/YouerLiveVideo/YouerLiveVideo/util/utiles.swift b/YouerLiveVideo/YouerLiveVideo/util/utiles.swift index 1964189..9b48ca5 100644 --- a/YouerLiveVideo/YouerLiveVideo/util/utiles.swift +++ b/YouerLiveVideo/YouerLiveVideo/util/utiles.swift @@ -400,15 +400,4 @@ func selectImageFromString(string:String)->String{ return "icon" } -func persentToMoivePlayer(from:UIViewController,liv:LiveDetail){ - let endDate = JSON.fromString(jsonString: liv.f_Description)!["endtime"].doubleValue/1000 as TimeInterval - if Date().timeIntervalSince1970 < endDate{ - let vc = UIStoryboard(name: "Live", bundle: nil).instantiateViewController(withIdentifier: "MoivePlayerViewControllerVC") as! MoivePlayerViewController - vc.liveDetail = liv - from.present(vc, animated: true, completion: nil) - }else{ - AppDelegate.instance().window?.makeToast("直播已经结束", duration: 2, position: CSToastPositionCenter) - } - -} -- libgit2 0.21.0