diff --git a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj index 559fe27..0927de4 100644 --- a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj +++ b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj @@ -140,6 +140,10 @@ BF6977981E2DEC98006FA934 /* userId.png in Resources */ = {isa = PBXBuildFile; fileRef = BF6977951E2DEC98006FA934 /* userId.png */; }; BF6977991E2DEC98006FA934 /* userPassword.png in Resources */ = {isa = PBXBuildFile; fileRef = BF6977961E2DEC98006FA934 /* userPassword.png */; }; BF7722F31ED283D400226D44 /* FilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7722F21ED283D400226D44 /* FilterViewController.swift */; }; + BF7722F71ED3C3CD00226D44 /* FilterView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BF7722F61ED3C3CD00226D44 /* FilterView.xib */; }; + BF7722F91ED3C3E900226D44 /* FilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7722F81ED3C3E900226D44 /* FilterView.swift */; }; + BF7722FC1ED3C54B00226D44 /* FilterCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7722FA1ED3C54B00226D44 /* FilterCollectionViewCell.swift */; }; + BF7722FD1ED3C54B00226D44 /* FilterCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BF7722FB1ED3C54B00226D44 /* FilterCollectionViewCell.xib */; }; 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 */; }; @@ -460,6 +464,10 @@ BF6977951E2DEC98006FA934 /* userId.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = userId.png; sourceTree = ""; }; BF6977961E2DEC98006FA934 /* userPassword.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = userPassword.png; sourceTree = ""; }; BF7722F21ED283D400226D44 /* FilterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterViewController.swift; sourceTree = ""; }; + BF7722F61ED3C3CD00226D44 /* FilterView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FilterView.xib; sourceTree = ""; }; + BF7722F81ED3C3E900226D44 /* FilterView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterView.swift; sourceTree = ""; }; + BF7722FA1ED3C54B00226D44 /* FilterCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterCollectionViewCell.swift; sourceTree = ""; }; + BF7722FB1ED3C54B00226D44 /* FilterCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FilterCollectionViewCell.xib; 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 = ""; }; @@ -626,6 +634,7 @@ 59AE3DFA1ECECD7D003E2C62 /* LiveInforViewController.swift */, 59AE3DFC1ECED5B1003E2C62 /* MoivePlayerViewController.swift */, 597185B41ECA990C00D7F478 /* Resource.storyboard */, + BF7722F51ED3C3A500226D44 /* View */, ); path = Resource; sourceTree = ""; @@ -1048,6 +1057,17 @@ path = SVProgressHUD; sourceTree = ""; }; + BF7722F51ED3C3A500226D44 /* View */ = { + isa = PBXGroup; + children = ( + BF7722F81ED3C3E900226D44 /* FilterView.swift */, + BF7722F61ED3C3CD00226D44 /* FilterView.xib */, + BF7722FA1ED3C54B00226D44 /* FilterCollectionViewCell.swift */, + BF7722FB1ED3C54B00226D44 /* FilterCollectionViewCell.xib */, + ); + path = View; + sourceTree = ""; + }; BF7B75671E305A6D0011D5C7 /* MJRefresh */ = { isa = PBXGroup; children = ( @@ -1404,6 +1424,7 @@ 599B2CDB1DE52F7E00B4F7FD /* read_me.txt in Resources */, 59BA13551E25D8DB00540DE0 /* video_brightness_bg@2x.png in Resources */, 59BA13491E25D8DB00540DE0 /* movieForward.png in Resources */, + BF7722FD1ED3C54B00226D44 /* FilterCollectionViewCell.xib in Resources */, BFF5F4801DD5AA5C00D33B89 /* 竖屏.png in Resources */, 599B2CDC1DE52F7E00B4F7FD /* README.txt in Resources */, BFF5F4811DD5AA5C00D33B89 /* 编辑.png in Resources */, @@ -1420,6 +1441,7 @@ 5904FC501ECA8B8C00E631FF /* TVStation.storyboard in Resources */, BF3E4A771E2F30B700D90659 /* 观看人数.png in Resources */, 599B2CDF1DE52F7E00B4F7FD /* UMSocialSDKResources.bundle in Resources */, + BF7722F71ED3C3CD00226D44 /* FilterView.xib in Resources */, BFF5F4901DD5B7CA00D33B89 /* Info-tvOS.plist in Resources */, BFF5F4711DD5AA5C00D33B89 /* attach_file.png in Resources */, 599B2CD81DE52F7E00B4F7FD /* WeiboSDK.bundle in Resources */, @@ -1470,6 +1492,7 @@ BF7B75A21E305A6D0011D5C7 /* MJRefreshNormalHeader.m in Sources */, BF7B75991E305A6D0011D5C7 /* MJRefreshFooter.m in Sources */, 59F801571DD2C7AE000A78B0 /* YouerLiveVideo.xcdatamodeld in Sources */, + BF7722F91ED3C3E900226D44 /* FilterView.swift in Sources */, 59BA13311E25D1C000540DE0 /* Reachability.m in Sources */, BFBB83EB1ECC445D008B404B /* UserViewController.swift in Sources */, 5904FC4E1ECA8B8C00E631FF /* ResourceViewController.swift in Sources */, @@ -1560,6 +1583,7 @@ 599B2CE31DE52F7E00B4F7FD /* UMSocialUIManager.m in Sources */, BF25DFF91DDAA36A003EC0C1 /* NSImage+WebCache.m in Sources */, BF8E52EE1ECFD16000E472E8 /* RankingTableViewController.swift in Sources */, + BF7722FC1ED3C54B00226D44 /* FilterCollectionViewCell.swift in Sources */, 59F8014F1DD2C7AD000A78B0 /* AppDelegate.swift in Sources */, BF7722F31ED283D400226D44 /* FilterViewController.swift in Sources */, BF25DFED1DDAA36A003EC0C1 /* ResponseSerialization.swift in Sources */, 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 ef2c8b1..71dea3f 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/AppDelegate.swift b/YouerLiveVideo/YouerLiveVideo/AppDelegate.swift index b8cbf6b..91498aa 100644 --- a/YouerLiveVideo/YouerLiveVideo/AppDelegate.swift +++ b/YouerLiveVideo/YouerLiveVideo/AppDelegate.swift @@ -40,20 +40,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate,NIMLoginManagerDelegate { } func applicationDidBecomeActive(_ application: UIApplication) { - let userId = AppDelegate.instance().accountManager.id() - let phone = AppDelegate.instance().accountManager.phone() - if userId != ""{ - NIMSDK.shared().loginManager.autoLogin(phone, token: phone.md5().uppercased()) - } - if let step = self.step { - if userId != "" && step == NIMLoginStep.loginFailed{//( step == NIMLoginStep.LinkFailed || - XSTLiveManager.shareXSTLiveManager().login(userId: phone, completion: { (success) -> Void in - if !success { - self.accountManager.cleanUserInfoAndPoptoRootVC() - } - }) - } - } +// let userId = AppDelegate.instance().accountManager.id() +// let phone = AppDelegate.instance().accountManager.phone() +// if userId != ""{ +// NIMSDK.shared().loginManager.autoLogin(phone, token: phone.md5().uppercased()) +// } +// if let step = self.step { +// if userId != "" && step == NIMLoginStep.loginFailed{//( step == NIMLoginStep.LinkFailed || +// XSTLiveManager.shareXSTLiveManager().login(userId: phone, completion: { (success) -> Void in +// if !success { +// self.accountManager.cleanUserInfoAndPoptoRootVC() +// } +// }) +// } +// } // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_courseList.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_courseList.imageset/Contents.json new file mode 100644 index 0000000..8589a2a --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_courseList.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "资源.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_courseList.imageset/资源.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_courseList.imageset/资源.png new file mode 100644 index 0000000..5cd6c2e Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_courseList.imageset/资源.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_hotcourse.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_hotcourse.imageset/Contents.json new file mode 100644 index 0000000..28c0e08 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_hotcourse.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "热门微课.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_hotcourse.imageset/热门微课.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_hotcourse.imageset/热门微课.png new file mode 100644 index 0000000..372ab3a Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_hotcourse.imageset/热门微课.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_ranking.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_ranking.imageset/Contents.json new file mode 100644 index 0000000..4f0871a --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_ranking.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "排行.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_ranking.imageset/排行.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_ranking.imageset/排行.png new file mode 100644 index 0000000..3a01e41 Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_ranking.imageset/排行.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_television.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_television.imageset/Contents.json new file mode 100644 index 0000000..75e603d --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_television.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "图标_28.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_television.imageset/图标_28.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_television.imageset/图标_28.png new file mode 100644 index 0000000..049900c Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_television.imageset/图标_28.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_back.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_back.imageset/Contents.json new file mode 100644 index 0000000..8fce3ab --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "返回.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_back.imageset/返回.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_back.imageset/返回.png new file mode 100644 index 0000000..e8ba55c Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_back.imageset/返回.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_courseList.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_courseList.imageset/Contents.json new file mode 100644 index 0000000..9d5c020 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_courseList.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "图标_24.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_courseList.imageset/图标_24.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_courseList.imageset/图标_24.png new file mode 100644 index 0000000..5cd6c2e Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_courseList.imageset/图标_24.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_download.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_download.imageset/Contents.json new file mode 100644 index 0000000..06a7e69 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_download.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "下载数量.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_download.imageset/下载数量.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_download.imageset/下载数量.png new file mode 100644 index 0000000..af3a631 Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_download.imageset/下载数量.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_homepage.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_homepage.imageset/Contents.json new file mode 100644 index 0000000..88441e8 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_homepage.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "底栏1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_homepage.imageset/底栏1.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_homepage.imageset/底栏1.png new file mode 100644 index 0000000..c320261 Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_homepage.imageset/底栏1.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_hotcourse.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_hotcourse.imageset/Contents.json new file mode 100644 index 0000000..472b8e2 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_hotcourse.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "图标_30.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_hotcourse.imageset/图标_30.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_hotcourse.imageset/图标_30.png new file mode 100644 index 0000000..b1648a8 Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_hotcourse.imageset/图标_30.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_microcourse.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_microcourse.imageset/Contents.json new file mode 100644 index 0000000..a1b0447 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_microcourse.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "底栏3.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_microcourse.imageset/底栏3.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_microcourse.imageset/底栏3.png new file mode 100644 index 0000000..3342c5a Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_microcourse.imageset/底栏3.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_more.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_more.imageset/Contents.json new file mode 100644 index 0000000..494a6b1 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_more.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "更多.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_more.imageset/更多.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_more.imageset/更多.png new file mode 100644 index 0000000..b4c857b Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_more.imageset/更多.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_open.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_open.imageset/Contents.json new file mode 100644 index 0000000..861b0d3 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_open.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "展开.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_open.imageset/展开.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_open.imageset/展开.png new file mode 100644 index 0000000..9d359bb Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_open.imageset/展开.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_ranking.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_ranking.imageset/Contents.json new file mode 100644 index 0000000..e218268 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_ranking.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "图标_22.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_ranking.imageset/图标_22.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_ranking.imageset/图标_22.png new file mode 100644 index 0000000..5f69907 Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_ranking.imageset/图标_22.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_resource.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_resource.imageset/Contents.json new file mode 100644 index 0000000..d3c3295 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_resource.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "底栏2.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_resource.imageset/底栏2.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_resource.imageset/底栏2.png new file mode 100644 index 0000000..70da7fc Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_resource.imageset/底栏2.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_setting.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_setting.imageset/Contents.json new file mode 100644 index 0000000..22fdef8 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_setting.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "设置.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_setting.imageset/设置.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_setting.imageset/设置.png new file mode 100644 index 0000000..7f4cdee Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_setting.imageset/设置.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_tvstation.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_tvstation.imageset/Contents.json new file mode 100644 index 0000000..33950c1 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_tvstation.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "底栏4.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_tvstation.imageset/底栏4.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_tvstation.imageset/底栏4.png new file mode 100644 index 0000000..24ff4b2 Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_tvstation.imageset/底栏4.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_user.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_user.imageset/Contents.json new file mode 100644 index 0000000..df99e60 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_user.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "底栏5.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_user.imageset/底栏5.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_user.imageset/底栏5.png new file mode 100644 index 0000000..bc6fb7b Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_user.imageset/底栏5.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_watchcount.imageset/Contents.json b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_watchcount.imageset/Contents.json new file mode 100644 index 0000000..8a07374 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_watchcount.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "观看数量.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_watchcount.imageset/观看数量.png b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_watchcount.imageset/观看数量.png new file mode 100644 index 0000000..9609376 Binary files /dev/null and b/YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_watchcount.imageset/观看数量.png differ diff --git a/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard b/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard index a7e53c9..fbe7df4 100644 --- a/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard +++ b/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard @@ -124,7 +124,7 @@ - + @@ -273,16 +273,16 @@ - + - + - + @@ -380,14 +380,14 @@ - + - + @@ -453,7 +453,7 @@ - + @@ -527,14 +527,14 @@ - + - + @@ -600,7 +600,7 @@ - + @@ -684,14 +684,14 @@ - + - + @@ -1090,7 +1090,7 @@ - + @@ -1109,7 +1109,7 @@ - + @@ -1128,7 +1128,7 @@ - + @@ -1147,7 +1147,7 @@ - + @@ -1274,7 +1274,7 @@ - + @@ -1402,7 +1402,7 @@ - + @@ -1523,10 +1523,21 @@ + + + + + + + + + + + + - diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift index d2bd0d4..dda3788 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift @@ -60,10 +60,6 @@ class MainHomeTableViewController: UITableViewController { } } } - //右上角搜索按钮点击方法 - @IBAction func rightBarButtonAction(_ sender: UIBarButtonItem) { - - } override func didReceiveMemoryWarning() { @@ -112,10 +108,10 @@ class MainHomeTableViewController: UITableViewController { } */ override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - NSLog("点击了第\(indexPath.row)个cell") if indexPath.row==0{ //排行 let vc = UIStoryboard(name: "HomePage", bundle: nil).instantiateViewController(withIdentifier: "RankingTableViewController") as! RankingTableViewController + vc.openIndexAry=[0,4] self.navigationController?.pushViewController(vc, animated: true) } } @@ -148,10 +144,18 @@ class InLineModel: NSObject { } class HomeFirstTableViewCell: UITableViewCell,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout,UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - if indexPath.row==0{ - //点击进入学校 appRootViewController() - }else{ - //点击进入教师 + if appRootViewController().childViewControllers.count>0 { + if indexPath.row==0{ + //点击进入学校 + let vc = UIStoryboard(name: "HomePage", bundle: nil).instantiateViewController(withIdentifier: "RankingTableViewController") as! RankingTableViewController + vc.openIndexAry=[0] + ((appRootViewController().childViewControllers[0] as! MViewController).selectedViewController as! UINavigationController).pushViewController(vc, animated: true) + }else{ + //点击进入教师 + let vc = UIStoryboard(name: "HomePage", bundle: nil).instantiateViewController(withIdentifier: "RankingTableViewController") as! RankingTableViewController + vc.openIndexAry=[4] + ((appRootViewController().childViewControllers[0] as! MViewController).selectedViewController as! UINavigationController).pushViewController(vc, animated: true) + } } } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/RankingTableViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/RankingTableViewController.swift index dee3165..4a69343 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/RankingTableViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/RankingTableViewController.swift @@ -229,9 +229,9 @@ class RankingTableViewController: UITableViewController { } cell.titleLabel.text=ary[indexPath.row] if openIndexAry.contains(indexPath.row){ - cell.titleImageView.image=UIImage(named: "botoom_image") + cell.titleImageView.image=UIImage(named: "icon_open") }else{ - cell.titleImageView.image=UIImage(named: "top_image") + cell.titleImageView.image=UIImage(named: "icon_more") } cell.subTableView.reloadData() return cell diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/FilterViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/FilterViewController.swift index 9490798..a389d42 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/FilterViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/FilterViewController.swift @@ -7,28 +7,224 @@ // import UIKit - -class FilterViewController: UIViewController { - +class FilterViewController: UIViewController,FilterViewDelegate { + @IBOutlet var scrollContentView: UIStackView! + var nameAry:[String]=["学段","年级","学科","教材"] + var dataSchoolSection:[SchoolSection]=[] + var dataGrade:[Grade]=[] + var dataSubject:[Subject]=[] + + var type=FilterParameter() override func viewDidLoad() { super.viewDidLoad() -// AppDelegate.instance().httpServer.postResourceList(parameters: <#T##[String : AnyObject]?#>, completionHandler: <#T##(String?, NSError?) -> ()#>) + self.configTheme() + self.navigationItem.title="筛选" + getSchoolSection() +// NotificationCenter.default.addObserver(self, selector: #selector(RegisterVC.keyboardWIllChange), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil) +// NotificationCenter.default.post(name: NSNotification.Name(rawValue: "loginOutSuccess"), object: nil) } + @IBAction func dismissAction(_ sender: UIBarButtonItem) { + self.dismiss(animated: true, completion: nil) + } + func setupFilterView(index:Int,arry:[filterModel]){ + let filterView=scrollContentView.subviews[index] as! FilterView + if arry.count>0{ + filterView.selected = 0 + switch index { + case 2: + //年级 + type.grade=arry[0].f_Id + case 3: + //学科 + type.subject=arry[0].f_Id + default: + break + } + }else{ + filterView.selected = -1 + if index==2{ + type.grade=nil + } + } + + filterView.isOpen=false + filterView.changeItems(array: arry) + filterView.constraints.last!.constant=60+(getScreenWidth()-80)/12 + filterView.collectionView.reloadData() + } + @IBAction func determineAction(_ sender: UIButton) { + // AppDelegate.instance().httpServer.postResourceList(parameters: <#T##[String : AnyObject]?#>, completionHandler: <#T##(String?, NSError?) -> ()#>) + } + //请求年级 并添加控件 + func getSchoolSection(){ + SVProgressHUD.show(withStatus: "获取学段...") + SVProgressHUD.setDefaultMaskType(.black) + AppDelegate.instance().httpServer.getSchoolTypes { (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 JSON.fromString(jsonString: str)!["data"].arrayValue { + self.dataSchoolSection.append(SchoolSection(j: item)) + } + }, failHandler: { (error) in + self.view.makeToast("获取学段失败:\(error.localizedDescription)") + }) + }else{ + self.view.makeToast("获取学段失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") + } + }else{ + self.view.makeToast("获取学段失败:\(error!.description)") + } + let filterView=Bundle.main.loadNibNamed("FilterView", owner: nil, options: nil)![0] as! FilterView + filterView.frame.size=CGSize(width: getScreenWidth(), height: 60+(getScreenWidth()-80)/12) + filterView.delegate=self + filterView.tag=0 + filterView.setUpWithItems(title: self.nameAry[0], array: self.dataSchoolSection) + if self.dataSchoolSection.count>0{ + filterView.selected=0 + self.type.schoolSection=self.dataSchoolSection[0].f_Id + } + self.scrollContentView.addArrangedSubview(filterView) + filterView.translatesAutoresizingMaskIntoConstraints=false + filterView.addConstraint(NSLayoutConstraint(item: filterView, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1.0, constant: 60+(getScreenWidth()-80)/12)) + for i in 1..<3{ + let filterView=Bundle.main.loadNibNamed("FilterView", owner: nil, options: nil)![0] as! FilterView + filterView.frame.size=CGSize(width: getScreenWidth(), height: 60+(getScreenWidth()-80)/12) + filterView.delegate=self + filterView.tag=i + filterView.setUpWithItems(title: self.nameAry[i], array: []) + self.scrollContentView.addArrangedSubview(filterView) + filterView.translatesAutoresizingMaskIntoConstraints=false + filterView.addConstraint(NSLayoutConstraint(item: filterView, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1.0, constant: 60+(getScreenWidth()-80)/12)) + } + if self.dataSchoolSection.count>0{ + self.getGradeWithSchoolSectionID(id: self.dataSchoolSection[0].f_Id, index: 2) + } + self.getSubjects(index: 3) + } + } + func selectCurrentCount(index: Int,tag:Int) { + switch tag { + case 0: + type.schoolSection=dataSchoolSection[index].f_Id + getGradeWithSchoolSectionID(id: dataSchoolSection[index].f_Id, index: 2) + case 1: + type.grade=dataGrade[index].f_Id + case 2: + type.subject=dataSubject[index].f_Id + case 3: break + + default: break + + } + } + //请求年级 并刷新 + func getGradeWithSchoolSectionID(id:String,index:Int){ + SVProgressHUD.show(withStatus: "获取年级...") + SVProgressHUD.setDefaultMaskType(.black) + AppDelegate.instance().httpServer.getGrades(parameters: ["schooltypeid":id as AnyObject]) { (str, error) in + SVProgressHUD.dismiss() + self.dataGrade.removeAll() + if error==nil { + if JSON.fromString(jsonString: str)!["status"].intValue == 1{ + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in + for item in JSON.fromString(jsonString: str)!["data"].arrayValue { + self.dataGrade.append(Grade(j: item)) + } + }, failHandler: { (error) in + self.view.makeToast("获取年级失败:\(error.localizedDescription)") + }) + }else{ + self.view.makeToast("获取年级失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") + } + }else{ + self.view.makeToast("获取年级失败:\(error!.description)") + } + self.setupFilterView(index: index, arry: self.dataGrade) + } + } + //请求学科 并刷新 + func getSubjects(index:Int){ + SVProgressHUD.show(withStatus: "获取学科...") + SVProgressHUD.setDefaultMaskType(.black) + AppDelegate.instance().httpServer.getSubjects { (str, error) in + SVProgressHUD.dismiss() + self.dataSubject.removeAll() + if error==nil { + if JSON.fromString(jsonString: str)!["status"].intValue == 1{ + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in + for item in JSON.fromString(jsonString: str)!["data"].arrayValue { + self.dataSubject.append(Subject(j: item)) + } + }, failHandler: { (error) in + self.view.makeToast("获取学科失败:\(error.localizedDescription)") + }) + }else{ + self.view.makeToast("获取学科失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") + } + }else{ + self.view.makeToast("获取学科失败:\(error!.description)") + } + self.setupFilterView(index: index, arry: self.dataSubject) + } + } 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. + // MARK: - 销毁通知 + deinit { + NotificationCenter.default.removeObserver(self) + } +} +class FilterParameter:NSObject { + var schoolSection:String? //学段 + var grade:String? //年级 + var subject:String? //学科 + var materials:String? //教材 + override init() { + + } +} +class filterModel:NSObject{ + var f_Id:String="" + var f_DeleteMark:Bool=false + var f_CreatorTime:String="" + var f_CreatorUserId:String="" + var f_LastModifyTime:String="" + var f_LastModifyUserId:String="" + var f_DeleteTime:String="" + var f_DeleteUserId:String="" + init(j:JSON) { + f_Id=j["f_Id"].stringValue + f_DeleteMark=j["f_DeleteMark"].boolValue + f_CreatorTime=j["f_CreatorTime"].stringValue + f_CreatorUserId=j["f_CreatorUserId"].stringValue + f_LastModifyTime=j["f_LastModifyTime"].stringValue + f_LastModifyUserId=j["f_LastModifyUserId"].stringValue + f_DeleteTime=j["f_DeleteTime"].stringValue + f_DeleteUserId=j["f_DeleteUserId"].stringValue + } +} +class SchoolSection: filterModel { + var f_SchoolType:String="" + override init(j:JSON) { + super.init(j: j) + f_SchoolType=j["f_SchoolType"].stringValue + } +} +class Grade: filterModel { + var f_GradeName:String="" + override init(j:JSON) { + super.init(j: j) + f_GradeName=j["f_GradeName"].stringValue + } +} +class Subject: filterModel { + var f_SubjectName:String="" + override init(j:JSON) { + super.init(j: j) + f_SubjectName=j["f_SubjectName"].stringValue } - */ - } diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard index 3993fc8..d7ecf48 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard @@ -9,10 +9,10 @@ - + - + @@ -20,13 +20,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/ResourceViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/ResourceViewController.swift index d6d3bce..89d23e8 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/ResourceViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/ResourceViewController.swift @@ -107,7 +107,7 @@ class ResourceViewController: UIViewController,UITableViewDelegate,UITableViewDa // MARK: - 跳转到筛选 @IBAction func jumpFilterVCAction(_ sender: UIButton) { let vc = UIStoryboard(name: "Resource", bundle: nil).instantiateViewController(withIdentifier: "FilterViewController") as! FilterViewController - self.navigationController?.pushViewController(vc, animated: true) + self.present(vc.wrapWithNavigationController(), animated: true, completion: nil) } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterCollectionViewCell.swift b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterCollectionViewCell.swift new file mode 100644 index 0000000..ca5f2a7 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterCollectionViewCell.swift @@ -0,0 +1,19 @@ +// +// FilterCollectionViewCell.swift +// YouerLiveVideo +// +// Created by 葛建军 on 17/5/23. +// Copyright © 2017年 左丞. All rights reserved. +// + +import UIKit + +class FilterCollectionViewCell: UICollectionViewCell { + + @IBOutlet var titleLabel: UILabel! + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + +} diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterCollectionViewCell.xib b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterCollectionViewCell.xib new file mode 100644 index 0000000..fff2728 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterCollectionViewCell.xib @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterView.swift b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterView.swift new file mode 100644 index 0000000..735f335 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterView.swift @@ -0,0 +1,93 @@ +// +// FilterView.swift +// YouerLiveVideo +// +// Created by 葛建军 on 17/5/23. +// Copyright © 2017年 左丞. All rights reserved. +// + +import UIKit + +class FilterView: UIView,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout { + @IBOutlet var titleLabel: UILabel! + @IBOutlet var collectionView: UICollectionView! + var isOpen:Bool=false + var dataAry:[filterModel]=[] + var delegate:FilterViewDelegate! + var selected:Int = -1 + var numberLines:Int! + var cellWidth=(getScreenWidth()-80)/3 + var cellHeight=(getScreenWidth()-80)/12 + override func awakeFromNib() { + super.awakeFromNib() + collectionView.register(UINib(nibName: "FilterCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "identifier") + } + func setUpWithItems(title:String,array:[filterModel]) { + titleLabel.text=title + dataAry=array + numberLines = array.count%3 > 0 ? array.count/3+1 : array.count/3 + self.collectionView.reloadData() + } + func changeItems(array:[filterModel]){ + dataAry=array + numberLines = array.count%3 > 0 ? array.count/3+1 : array.count/3 + self.collectionView.reloadData() + } + @IBAction func openOrCloseAction(_ sender: UIButton) { + if isOpen { + isOpen=false + self.constraints.last!.constant=60+cellHeight + }else{ + if dataAry.count>3{ + isOpen=true + self.constraints.last!.constant=60+cellHeight+CGFloat(numberLines-1)*(cellHeight+10) + self.collectionView.reloadData() + } + } + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + return CGSize(width: cellWidth, height: cellHeight) + } + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell=collectionView.dequeueReusableCell(withReuseIdentifier: "identifier", for: indexPath) as! FilterCollectionViewCell + switch self.tag { + case 0: + cell.titleLabel.text=(dataAry as! [SchoolSection])[indexPath.row].f_SchoolType + case 1: + cell.titleLabel.text=(dataAry as! [Grade])[indexPath.row].f_GradeName + case 2: + cell.titleLabel.text=(dataAry as! [Subject])[indexPath.row].f_SubjectName + default: + cell.titleLabel.text="未知" + } + if indexPath.row==selected { + cell.titleLabel.backgroundColor=Theme.topBarColor() + cell.titleLabel.textColor=UIColor.white + }else{ + cell.titleLabel.backgroundColor=UIColor.groupTableViewBackground + cell.titleLabel.textColor=UIColor.black + } + return cell + } + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + if isOpen { + return dataAry.count + }else{ + if dataAry.count<4 { + return dataAry.count + }else{ + return 3 + } + } + } + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + if selected != indexPath.row { + selected=indexPath.row + self.delegate.selectCurrentCount(index: indexPath.row, tag: self.tag) + self.collectionView.reloadData() + } + } +} +protocol FilterViewDelegate { + func selectCurrentCount(index:Int,tag:Int) +} diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterView.xib b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterView.xib new file mode 100644 index 0000000..809327a --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterView.xib @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift index ffeac10..e9f5c0c 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift @@ -85,7 +85,7 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker if inputVerificationCode.text!.characters.count == 4{ SVProgressHUD.show(withStatus: "注册...") SVProgressHUD.setDefaultMaskType(.black) - let parameters:Dictionary=["account":phoneNumber.text! as AnyObject,"password":passwordTextField.text! as AnyObject,"vercode":inputVerificationCode.text! as AnyObject,"nickname": (nikeNameTextFiled.text!=="" ? phoneNumber.text! : nikeNameTextFiled.text!) as AnyObject] + let parameters:Dictionary=["account":phoneNumber.text! as AnyObject,"password":passwordTextField.text!.md5() as AnyObject,"vercode":inputVerificationCode.text! as AnyObject,"nickname": (nikeNameTextFiled.text!=="" ? phoneNumber.text! : nikeNameTextFiled.text!) as AnyObject] AppDelegate.instance().httpServer.getCreateUser(parameters: parameters) { (str, error) in SVProgressHUD.dismiss() self.nikeNameTextFiled.isUserInteractionEnabled=true @@ -95,7 +95,7 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker if error==nil { if JSON.fromString(jsonString: str)!["status"].intValue == 1{ httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.navigationController!.popToRootViewController(animated: true) + self.navigationController!.dismiss(animated: true, completion: nil) AppDelegate.instance().window?.makeToast("注册成功") NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshLoginUser"), object: self.phoneNumber.text!) //是否登录 diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard index 04df339..86e2b6b 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard @@ -78,7 +78,6 @@ - @@ -121,7 +120,6 @@ - @@ -551,7 +549,7 @@ - + @@ -561,6 +559,9 @@