Commit 9bc764766d089dc64c52bc3084e51fd61b56ddc6

Authored by 左丞
2 parents 9d367c56 aa722845
Exists in newLive

Merge branch 'newLive' of http://git.shunzhi.net/iosgroup/newlive into newLive

Showing 55 changed files with 1010 additions and 74 deletions   Show diff stats
YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj
... ... @@ -146,6 +146,10 @@
146 146 BF6977981E2DEC98006FA934 /* userId.png in Resources */ = {isa = PBXBuildFile; fileRef = BF6977951E2DEC98006FA934 /* userId.png */; };
147 147 BF6977991E2DEC98006FA934 /* userPassword.png in Resources */ = {isa = PBXBuildFile; fileRef = BF6977961E2DEC98006FA934 /* userPassword.png */; };
148 148 BF7722F31ED283D400226D44 /* FilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7722F21ED283D400226D44 /* FilterViewController.swift */; };
  149 + BF7722F71ED3C3CD00226D44 /* FilterView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BF7722F61ED3C3CD00226D44 /* FilterView.xib */; };
  150 + BF7722F91ED3C3E900226D44 /* FilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7722F81ED3C3E900226D44 /* FilterView.swift */; };
  151 + BF7722FC1ED3C54B00226D44 /* FilterCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7722FA1ED3C54B00226D44 /* FilterCollectionViewCell.swift */; };
  152 + BF7722FD1ED3C54B00226D44 /* FilterCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BF7722FB1ED3C54B00226D44 /* FilterCollectionViewCell.xib */; };
149 153 BF7B75961E305A6D0011D5C7 /* MJRefreshAutoFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B756A1E305A6D0011D5C7 /* MJRefreshAutoFooter.m */; };
150 154 BF7B75971E305A6D0011D5C7 /* MJRefreshBackFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B756C1E305A6D0011D5C7 /* MJRefreshBackFooter.m */; };
151 155 BF7B75981E305A6D0011D5C7 /* MJRefreshComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B756E1E305A6D0011D5C7 /* MJRefreshComponent.m */; };
... ... @@ -472,6 +476,10 @@
472 476 BF6977951E2DEC98006FA934 /* userId.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = userId.png; sourceTree = "<group>"; };
473 477 BF6977961E2DEC98006FA934 /* userPassword.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = userPassword.png; sourceTree = "<group>"; };
474 478 BF7722F21ED283D400226D44 /* FilterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterViewController.swift; sourceTree = "<group>"; };
  479 + BF7722F61ED3C3CD00226D44 /* FilterView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FilterView.xib; sourceTree = "<group>"; };
  480 + BF7722F81ED3C3E900226D44 /* FilterView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterView.swift; sourceTree = "<group>"; };
  481 + BF7722FA1ED3C54B00226D44 /* FilterCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterCollectionViewCell.swift; sourceTree = "<group>"; };
  482 + BF7722FB1ED3C54B00226D44 /* FilterCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FilterCollectionViewCell.xib; sourceTree = "<group>"; };
475 483 BF7B75691E305A6D0011D5C7 /* MJRefreshAutoFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshAutoFooter.h; sourceTree = "<group>"; };
476 484 BF7B756A1E305A6D0011D5C7 /* MJRefreshAutoFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshAutoFooter.m; sourceTree = "<group>"; };
477 485 BF7B756B1E305A6D0011D5C7 /* MJRefreshBackFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshBackFooter.h; sourceTree = "<group>"; };
... ... @@ -638,6 +646,7 @@
638 646 59AE3DFA1ECECD7D003E2C62 /* LiveInforViewController.swift */,
639 647 59AE3DFC1ECED5B1003E2C62 /* MoivePlayerViewController.swift */,
640 648 597185B41ECA990C00D7F478 /* Resource.storyboard */,
  649 + BF7722F51ED3C3A500226D44 /* View */,
641 650 );
642 651 path = Resource;
643 652 sourceTree = "<group>";
... ... @@ -1070,6 +1079,17 @@
1070 1079 path = SVProgressHUD;
1071 1080 sourceTree = "<group>";
1072 1081 };
  1082 + BF7722F51ED3C3A500226D44 /* View */ = {
  1083 + isa = PBXGroup;
  1084 + children = (
  1085 + BF7722F81ED3C3E900226D44 /* FilterView.swift */,
  1086 + BF7722F61ED3C3CD00226D44 /* FilterView.xib */,
  1087 + BF7722FA1ED3C54B00226D44 /* FilterCollectionViewCell.swift */,
  1088 + BF7722FB1ED3C54B00226D44 /* FilterCollectionViewCell.xib */,
  1089 + );
  1090 + path = View;
  1091 + sourceTree = "<group>";
  1092 + };
1073 1093 BF7B75671E305A6D0011D5C7 /* MJRefresh */ = {
1074 1094 isa = PBXGroup;
1075 1095 children = (
... ... @@ -1430,6 +1450,7 @@
1430 1450 599B2CDB1DE52F7E00B4F7FD /* read_me.txt in Resources */,
1431 1451 59BA13551E25D8DB00540DE0 /* video_brightness_bg@2x.png in Resources */,
1432 1452 59BA13491E25D8DB00540DE0 /* movieForward.png in Resources */,
  1453 + BF7722FD1ED3C54B00226D44 /* FilterCollectionViewCell.xib in Resources */,
1433 1454 BFF5F4801DD5AA5C00D33B89 /* 竖屏.png in Resources */,
1434 1455 599B2CDC1DE52F7E00B4F7FD /* README.txt in Resources */,
1435 1456 BFF5F4811DD5AA5C00D33B89 /* 编辑.png in Resources */,
... ... @@ -1446,6 +1467,7 @@
1446 1467 5904FC501ECA8B8C00E631FF /* TVStation.storyboard in Resources */,
1447 1468 BF3E4A771E2F30B700D90659 /* 观看人数.png in Resources */,
1448 1469 599B2CDF1DE52F7E00B4F7FD /* UMSocialSDKResources.bundle in Resources */,
  1470 + BF7722F71ED3C3CD00226D44 /* FilterView.xib in Resources */,
1449 1471 BFF5F4901DD5B7CA00D33B89 /* Info-tvOS.plist in Resources */,
1450 1472 BFF5F4711DD5AA5C00D33B89 /* attach_file.png in Resources */,
1451 1473 599B2CD81DE52F7E00B4F7FD /* WeiboSDK.bundle in Resources */,
... ... @@ -1496,6 +1518,7 @@
1496 1518 BF7B75A21E305A6D0011D5C7 /* MJRefreshNormalHeader.m in Sources */,
1497 1519 BF7B75991E305A6D0011D5C7 /* MJRefreshFooter.m in Sources */,
1498 1520 59F801571DD2C7AE000A78B0 /* YouerLiveVideo.xcdatamodeld in Sources */,
  1521 + BF7722F91ED3C3E900226D44 /* FilterView.swift in Sources */,
1499 1522 595071031ED02C140056E078 /* ExcellentTVViewController.swift in Sources */,
1500 1523 59BA13311E25D1C000540DE0 /* Reachability.m in Sources */,
1501 1524 BFBB83EB1ECC445D008B404B /* UserViewController.swift in Sources */,
... ... @@ -1592,6 +1615,7 @@
1592 1615 599B2CE31DE52F7E00B4F7FD /* UMSocialUIManager.m in Sources */,
1593 1616 BF25DFF91DDAA36A003EC0C1 /* NSImage+WebCache.m in Sources */,
1594 1617 BF8E52EE1ECFD16000E472E8 /* RankingTableViewController.swift in Sources */,
  1618 + BF7722FC1ED3C54B00226D44 /* FilterCollectionViewCell.swift in Sources */,
1595 1619 59F8014F1DD2C7AD000A78B0 /* AppDelegate.swift in Sources */,
1596 1620 BF7722F31ED283D400226D44 /* FilterViewController.swift in Sources */,
1597 1621 BF25DFED1DDAA36A003EC0C1 /* ResponseSerialization.swift in Sources */,
... ...
YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/Manger.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
YouerLiveVideo/YouerLiveVideo/AppDelegate.swift
... ... @@ -40,20 +40,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate,NIMLoginManagerDelegate {
40 40 }
41 41  
42 42 func applicationDidBecomeActive(_ application: UIApplication) {
43   - let userId = AppDelegate.instance().accountManager.id()
44   - let phone = AppDelegate.instance().accountManager.phone()
45   - if userId != ""{
46   - NIMSDK.shared().loginManager.autoLogin(phone, token: phone.md5().uppercased())
47   - }
48   - if let step = self.step {
49   - if userId != "" && step == NIMLoginStep.loginFailed{//( step == NIMLoginStep.LinkFailed ||
50   - XSTLiveManager.shareXSTLiveManager().login(userId: phone, completion: { (success) -> Void in
51   - if !success {
52   - self.accountManager.cleanUserInfoAndPoptoRootVC()
53   - }
54   - })
55   - }
56   - }
  43 +// let userId = AppDelegate.instance().accountManager.id()
  44 +// let phone = AppDelegate.instance().accountManager.phone()
  45 +// if userId != ""{
  46 +// NIMSDK.shared().loginManager.autoLogin(phone, token: phone.md5().uppercased())
  47 +// }
  48 +// if let step = self.step {
  49 +// if userId != "" && step == NIMLoginStep.loginFailed{//( step == NIMLoginStep.LinkFailed ||
  50 +// XSTLiveManager.shareXSTLiveManager().login(userId: phone, completion: { (success) -> Void in
  51 +// if !success {
  52 +// self.accountManager.cleanUserInfoAndPoptoRootVC()
  53 +// }
  54 +// })
  55 +// }
  56 +// }
57 57  
58 58  
59 59 // 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.
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/Contents.json 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +{
  2 + "info" : {
  3 + "version" : 1,
  4 + "author" : "xcode"
  5 + }
  6 +}
0 7 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/Contents.json 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +{
  2 + "info" : {
  3 + "version" : 1,
  4 + "author" : "xcode"
  5 + }
  6 +}
0 7 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_courseList.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "资源.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_courseList.imageset/资源.png 0 → 100644

1.9 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_hotcourse.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "热门微课.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_hotcourse.imageset/热门微课.png 0 → 100644

1.21 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_ranking.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "排行.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_ranking.imageset/排行.png 0 → 100644

1.07 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_television.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "图标_28.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/HomePage/homepage_television.imageset/图标_28.png 0 → 100644

1.47 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_back.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "返回.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_back.imageset/返回.png 0 → 100644

1.3 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_courseList.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "图标_24.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_courseList.imageset/图标_24.png 0 → 100644

1.9 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_download.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "下载数量.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_download.imageset/下载数量.png 0 → 100644

1.12 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_homepage.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "底栏1.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_homepage.imageset/底栏1.png 0 → 100644

1.58 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_hotcourse.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "图标_30.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_hotcourse.imageset/图标_30.png 0 → 100644

1.56 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_microcourse.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "底栏3.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_microcourse.imageset/底栏3.png 0 → 100644

1.22 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_more.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "更多.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_more.imageset/更多.png 0 → 100644

1.36 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_open.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "展开.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_open.imageset/展开.png 0 → 100644

1.36 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_ranking.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "图标_22.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_ranking.imageset/图标_22.png 0 → 100644

1.08 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_resource.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "底栏2.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_resource.imageset/底栏2.png 0 → 100644

2.02 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_setting.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "设置.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_setting.imageset/设置.png 0 → 100644

2.28 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_tvstation.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "底栏4.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_tvstation.imageset/底栏4.png 0 → 100644

1.39 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_user.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "底栏5.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_user.imageset/底栏5.png 0 → 100644

1.68 KB

YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_watchcount.imageset/Contents.json 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "观看数量.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
YouerLiveVideo/YouerLiveVideo/Assets.xcassets/z_NewIcon/icon_watchcount.imageset/观看数量.png 0 → 100644

1.43 KB

YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard
... ... @@ -124,7 +124,7 @@
124 124 <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
125 125 </state>
126 126 </button>
127   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="ds9-Gw-nOf">
  127 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_download" translatesAutoresizingMaskIntoConstraints="NO" id="ds9-Gw-nOf">
128 128 <rect key="frame" x="297" y="90.5" width="20" height="20"/>
129 129 <constraints>
130 130 <constraint firstAttribute="width" secondItem="ds9-Gw-nOf" secondAttribute="height" multiplier="1:1" id="Mto-fo-vVR"/>
... ... @@ -273,16 +273,16 @@
273 273 <constraint firstAttribute="height" constant="15" id="mtL-aK-O9I"/>
274 274 </constraints>
275 275 </view>
276   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="tc9-OD-L9x">
  276 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="homepage_ranking" translatesAutoresizingMaskIntoConstraints="NO" id="tc9-OD-L9x">
277 277 <rect key="frame" x="15" y="30" width="20" height="20"/>
278 278 <constraints>
279 279 <constraint firstAttribute="height" constant="20" id="dzU-2e-0A0"/>
280 280 <constraint firstAttribute="width" constant="20" id="jeW-Q1-Yqy"/>
281 281 </constraints>
282 282 </imageView>
283   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="gpI-zw-6qq">
  283 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_more" translatesAutoresizingMaskIntoConstraints="NO" id="gpI-zw-6qq">
284 284 <rect key="frame" x="352" y="32.5" width="8" height="15"/>
285   - <color key="backgroundColor" red="0.10980392160000001" green="0.63529411759999999" blue="1" alpha="1" colorSpace="calibratedRGB"/>
  285 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
286 286 <constraints>
287 287 <constraint firstAttribute="width" constant="8" id="X2b-MK-4bQ"/>
288 288 <constraint firstAttribute="height" constant="15" id="ZkK-Yr-R26"/>
... ... @@ -380,14 +380,14 @@
380 380 <constraint firstAttribute="height" constant="15" id="cu9-3U-16R"/>
381 381 </constraints>
382 382 </view>
383   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="JfT-qO-w2b">
  383 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="homepage_hotcourse" translatesAutoresizingMaskIntoConstraints="NO" id="JfT-qO-w2b">
384 384 <rect key="frame" x="15" y="30" width="20" height="20"/>
385 385 <constraints>
386 386 <constraint firstAttribute="width" constant="20" id="gju-0Y-vbI"/>
387 387 <constraint firstAttribute="height" constant="20" id="upC-qc-OXv"/>
388 388 </constraints>
389 389 </imageView>
390   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="QcE-wo-WjW">
  390 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_more" translatesAutoresizingMaskIntoConstraints="NO" id="QcE-wo-WjW">
391 391 <rect key="frame" x="352" y="32.5" width="8" height="15"/>
392 392 <constraints>
393 393 <constraint firstAttribute="width" constant="8" id="6rP-92-fox"/>
... ... @@ -453,7 +453,7 @@
453 453 <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
454 454 <nil key="highlightedColor"/>
455 455 </label>
456   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="Ah6-9S-zUX">
  456 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_watchcount" translatesAutoresizingMaskIntoConstraints="NO" id="Ah6-9S-zUX">
457 457 <rect key="frame" x="154" y="167" width="12" height="8"/>
458 458 <constraints>
459 459 <constraint firstAttribute="width" constant="12" id="Gst-KJ-hy2"/>
... ... @@ -527,14 +527,14 @@
527 527 <constraint firstAttribute="height" constant="15" id="zk7-4f-Srd"/>
528 528 </constraints>
529 529 </view>
530   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="UWk-5A-PEj">
  530 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="homepage_courseList" translatesAutoresizingMaskIntoConstraints="NO" id="UWk-5A-PEj">
531 531 <rect key="frame" x="15" y="30" width="20" height="20"/>
532 532 <constraints>
533 533 <constraint firstAttribute="width" constant="20" id="c35-8L-oxO"/>
534 534 <constraint firstAttribute="height" constant="20" id="iOy-11-gMR"/>
535 535 </constraints>
536 536 </imageView>
537   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="Tib-Fm-A1U">
  537 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_more" translatesAutoresizingMaskIntoConstraints="NO" id="Tib-Fm-A1U">
538 538 <rect key="frame" x="352" y="32.5" width="8" height="15"/>
539 539 <constraints>
540 540 <constraint firstAttribute="height" constant="15" id="5ek-5S-7Cb"/>
... ... @@ -600,7 +600,7 @@
600 600 <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
601 601 <nil key="highlightedColor"/>
602 602 </label>
603   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="j8z-Dm-5mL">
  603 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_download" translatesAutoresizingMaskIntoConstraints="NO" id="j8z-Dm-5mL">
604 604 <rect key="frame" x="100" y="220" width="8" height="8"/>
605 605 <constraints>
606 606 <constraint firstAttribute="width" constant="8" id="f5p-Mv-Ylo"/>
... ... @@ -684,14 +684,14 @@
684 684 <constraint firstAttribute="height" constant="15" id="8kZ-Qb-uv0"/>
685 685 </constraints>
686 686 </view>
687   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="NyS-EO-TLP">
  687 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="homepage_television" translatesAutoresizingMaskIntoConstraints="NO" id="NyS-EO-TLP">
688 688 <rect key="frame" x="15" y="30" width="20" height="20"/>
689 689 <constraints>
690 690 <constraint firstAttribute="width" constant="20" id="3VH-BC-Dg6"/>
691 691 <constraint firstAttribute="height" constant="20" id="FB0-l5-0Jp"/>
692 692 </constraints>
693 693 </imageView>
694   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="TE2-1P-sZs">
  694 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_more" translatesAutoresizingMaskIntoConstraints="NO" id="TE2-1P-sZs">
695 695 <rect key="frame" x="352" y="32.5" width="8" height="15"/>
696 696 <constraints>
697 697 <constraint firstAttribute="height" constant="15" id="EJo-or-6w8"/>
... ... @@ -1206,7 +1206,7 @@
1206 1206 <scene sceneID="Ztv-WN-7iK">
1207 1207 <objects>
1208 1208 <navigationController title="资源" automaticallyAdjustsScrollViewInsets="NO" id="oPL-zE-5ud" sceneMemberID="viewController">
1209   - <tabBarItem key="tabBarItem" title="资源" image="首页.png" id="H9f-Lc-mQs"/>
  1209 + <tabBarItem key="tabBarItem" title="资源" image="icon_resource" id="H9f-Lc-mQs"/>
1210 1210 <toolbarItems/>
1211 1211 <navigationBar key="navigationBar" contentMode="scaleToFill" id="Ca3-cq-bcD">
1212 1212 <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
... ... @@ -1225,7 +1225,7 @@
1225 1225 <scene sceneID="cuR-qn-3H2">
1226 1226 <objects>
1227 1227 <navigationController title="微课" automaticallyAdjustsScrollViewInsets="NO" id="B6F-S8-zbX" sceneMemberID="viewController">
1228   - <tabBarItem key="tabBarItem" title="微课" image="首页.png" id="6vI-fw-Oos"/>
  1228 + <tabBarItem key="tabBarItem" title="微课" image="icon_microcourse" id="6vI-fw-Oos"/>
1229 1229 <toolbarItems/>
1230 1230 <navigationBar key="navigationBar" contentMode="scaleToFill" id="gzA-MB-3BR">
1231 1231 <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
... ... @@ -1244,7 +1244,7 @@
1244 1244 <scene sceneID="zf3-SG-nOb">
1245 1245 <objects>
1246 1246 <navigationController title="电视台" automaticallyAdjustsScrollViewInsets="NO" id="eeQ-qi-Oqc" sceneMemberID="viewController">
1247   - <tabBarItem key="tabBarItem" title="电视台" image="首页.png" id="Aq8-EP-9iB"/>
  1247 + <tabBarItem key="tabBarItem" title="电视台" image="icon_tvstation" id="Aq8-EP-9iB"/>
1248 1248 <toolbarItems/>
1249 1249 <navigationBar key="navigationBar" contentMode="scaleToFill" id="zos-0a-mzB">
1250 1250 <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
... ... @@ -1263,7 +1263,7 @@
1263 1263 <scene sceneID="CWh-n7-nxi">
1264 1264 <objects>
1265 1265 <navigationController title="用户" automaticallyAdjustsScrollViewInsets="NO" id="Lq6-19-raF" sceneMemberID="viewController">
1266   - <tabBarItem key="tabBarItem" title="用户" image="首页.png" id="xsr-8R-tgo"/>
  1266 + <tabBarItem key="tabBarItem" title="用户" image="icon_user" id="xsr-8R-tgo"/>
1267 1267 <toolbarItems/>
1268 1268 <navigationBar key="navigationBar" contentMode="scaleToFill" id="aYo-eQ-QLv">
1269 1269 <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
... ... @@ -1390,7 +1390,7 @@
1390 1390 <scene sceneID="axA-Q8-m9h">
1391 1391 <objects>
1392 1392 <navigationController title="教育视频云" automaticallyAdjustsScrollViewInsets="NO" id="ZF0-NB-klP" sceneMemberID="viewController">
1393   - <tabBarItem key="tabBarItem" title="首页" image="首页.png" id="JKA-ml-vLX"/>
  1393 + <tabBarItem key="tabBarItem" title="首页" image="icon_homepage" id="JKA-ml-vLX"/>
1394 1394 <toolbarItems/>
1395 1395 <navigationBar key="navigationBar" contentMode="scaleToFill" id="Xg7-jx-ngw">
1396 1396 <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
... ... @@ -1518,7 +1518,7 @@
1518 1518 <action selector="pushDetailVC:" destination="IlC-3c-gI6" eventType="touchUpInside" id="3BZ-om-ppg"/>
1519 1519 </connections>
1520 1520 </button>
1521   - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="anY-xC-gfl">
  1521 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_watchcount" translatesAutoresizingMaskIntoConstraints="NO" id="anY-xC-gfl">
1522 1522 <rect key="frame" x="297" y="91" width="20" height="20"/>
1523 1523 <constraints>
1524 1524 <constraint firstAttribute="width" constant="20" id="FKY-fi-PSd"/>
... ... @@ -1639,10 +1639,21 @@
1639 1639 <image name="default_userRoom" width="19" height="17"/>
1640 1640 <image name="defphoto.png" width="256" height="256"/>
1641 1641 <image name="divshadow.png" width="771" height="13"/>
  1642 + <image name="homepage_courseList" width="20" height="20"/>
  1643 + <image name="homepage_hotcourse" width="20" height="20"/>
  1644 + <image name="homepage_ranking" width="20" height="20"/>
  1645 + <image name="homepage_television" width="20" height="20"/>
1642 1646 <image name="icon" width="512" height="512"/>
1643 1647 <image name="icon.png" width="80" height="80"/>
  1648 + <image name="icon_download" width="8" height="8"/>
  1649 + <image name="icon_homepage" width="25" height="25"/>
  1650 + <image name="icon_microcourse" width="25" height="25"/>
  1651 + <image name="icon_more" width="8" height="14"/>
  1652 + <image name="icon_resource" width="25" height="25"/>
  1653 + <image name="icon_tvstation" width="25" height="25"/>
  1654 + <image name="icon_user" width="25" height="25"/>
  1655 + <image name="icon_watchcount" width="12" height="7"/>
1644 1656 <image name="starLive" width="22" height="22"/>
1645 1657 <image name="视窗.png" width="31" height="31"/>
1646   - <image name="首页.png" width="31" height="31"/>
1647 1658 </resources>
1648 1659 </document>
... ...
YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift
... ... @@ -60,10 +60,6 @@ class MainHomeTableViewController: UITableViewController {
60 60 }
61 61 }
62 62 }
63   - //右上角搜索按钮点击方法
64   - @IBAction func rightBarButtonAction(_ sender: UIBarButtonItem) {
65   -
66   - }
67 63  
68 64  
69 65 override func didReceiveMemoryWarning() {
... ... @@ -112,10 +108,10 @@ class MainHomeTableViewController: UITableViewController {
112 108 }
113 109 */
114 110 override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
115   - NSLog("点击了第\(indexPath.row)个cell")
116 111 if indexPath.row==0{
117 112 //排行
118 113 let vc = UIStoryboard(name: "HomePage", bundle: nil).instantiateViewController(withIdentifier: "RankingTableViewController") as! RankingTableViewController
  114 + vc.openIndexAry=[0,4]
119 115 self.navigationController?.pushViewController(vc, animated: true)
120 116 }
121 117 }
... ... @@ -148,10 +144,18 @@ class InLineModel: NSObject {
148 144 }
149 145 class HomeFirstTableViewCell: UITableViewCell,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
150 146 func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
151   - if indexPath.row==0{
152   - //点击进入学校 appRootViewController()
153   - }else{
154   - //点击进入教师
  147 + if appRootViewController().childViewControllers.count>0 {
  148 + if indexPath.row==0{
  149 + //点击进入学校
  150 + let vc = UIStoryboard(name: "HomePage", bundle: nil).instantiateViewController(withIdentifier: "RankingTableViewController") as! RankingTableViewController
  151 + vc.openIndexAry=[0]
  152 + ((appRootViewController().childViewControllers[0] as! MViewController).selectedViewController as! UINavigationController).pushViewController(vc, animated: true)
  153 + }else{
  154 + //点击进入教师
  155 + let vc = UIStoryboard(name: "HomePage", bundle: nil).instantiateViewController(withIdentifier: "RankingTableViewController") as! RankingTableViewController
  156 + vc.openIndexAry=[4]
  157 + ((appRootViewController().childViewControllers[0] as! MViewController).selectedViewController as! UINavigationController).pushViewController(vc, animated: true)
  158 + }
155 159 }
156 160 }
157 161 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
... ...
YouerLiveVideo/YouerLiveVideo/controllers/HomePage/RankingTableViewController.swift
... ... @@ -229,9 +229,9 @@ class RankingTableViewController: UITableViewController {
229 229 }
230 230 cell.titleLabel.text=ary[indexPath.row]
231 231 if openIndexAry.contains(indexPath.row){
232   - cell.titleImageView.image=UIImage(named: "botoom_image")
  232 + cell.titleImageView.image=UIImage(named: "icon_open")
233 233 }else{
234   - cell.titleImageView.image=UIImage(named: "top_image")
  234 + cell.titleImageView.image=UIImage(named: "icon_more")
235 235 }
236 236 cell.subTableView.reloadData()
237 237 return cell
... ...
YouerLiveVideo/YouerLiveVideo/controllers/Resource/FilterViewController.swift
... ... @@ -7,28 +7,224 @@
7 7 //
8 8  
9 9 import UIKit
10   -
11   -class FilterViewController: UIViewController {
12   -
  10 +class FilterViewController: UIViewController,FilterViewDelegate {
  11 + @IBOutlet var scrollContentView: UIStackView!
  12 + var nameAry:[String]=["学段","年级","学科","教材"]
  13 + var dataSchoolSection:[SchoolSection]=[]
  14 + var dataGrade:[Grade]=[]
  15 + var dataSubject:[Subject]=[]
  16 +
  17 + var type=FilterParameter()
13 18 override func viewDidLoad() {
14 19 super.viewDidLoad()
15   -// AppDelegate.instance().httpServer.postResourceList(parameters: <#T##[String : AnyObject]?#>, completionHandler: <#T##(String?, NSError?) -> ()#>)
  20 + self.configTheme()
  21 + self.navigationItem.title="筛选"
  22 + getSchoolSection()
  23 +// NotificationCenter.default.addObserver(self, selector: #selector(RegisterVC.keyboardWIllChange), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil)
  24 +// NotificationCenter.default.post(name: NSNotification.Name(rawValue: "loginOutSuccess"), object: nil)
16 25 }
17 26  
  27 + @IBAction func dismissAction(_ sender: UIBarButtonItem) {
  28 + self.dismiss(animated: true, completion: nil)
  29 + }
  30 + func setupFilterView(index:Int,arry:[filterModel]){
  31 + let filterView=scrollContentView.subviews[index] as! FilterView
  32 + if arry.count>0{
  33 + filterView.selected = 0
  34 + switch index {
  35 + case 2:
  36 + //年级
  37 + type.grade=arry[0].f_Id
  38 + case 3:
  39 + //学科
  40 + type.subject=arry[0].f_Id
  41 + default:
  42 + break
  43 + }
  44 + }else{
  45 + filterView.selected = -1
  46 + if index==2{
  47 + type.grade=nil
  48 + }
  49 + }
  50 +
  51 + filterView.isOpen=false
  52 + filterView.changeItems(array: arry)
  53 + filterView.constraints.last!.constant=60+(getScreenWidth()-80)/12
  54 + filterView.collectionView.reloadData()
  55 + }
  56 + @IBAction func determineAction(_ sender: UIButton) {
  57 + // AppDelegate.instance().httpServer.postResourceList(parameters: <#T##[String : AnyObject]?#>, completionHandler: <#T##(String?, NSError?) -> ()#>)
  58 + }
  59 + //请求年级 并添加控件
  60 + func getSchoolSection(){
  61 + SVProgressHUD.show(withStatus: "获取学段...")
  62 + SVProgressHUD.setDefaultMaskType(.black)
  63 + AppDelegate.instance().httpServer.getSchoolTypes { (str, error) in
  64 + SVProgressHUD.dismiss()
  65 + if error==nil {
  66 + if JSON.fromString(jsonString: str)!["status"].intValue == 1{
  67 + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in
  68 + for item in JSON.fromString(jsonString: str)!["data"].arrayValue {
  69 + self.dataSchoolSection.append(SchoolSection(j: item))
  70 + }
  71 + }, failHandler: { (error) in
  72 + self.view.makeToast("获取学段失败:\(error.localizedDescription)")
  73 + })
  74 + }else{
  75 + self.view.makeToast("获取学段失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)")
  76 + }
  77 + }else{
  78 + self.view.makeToast("获取学段失败:\(error!.description)")
  79 + }
  80 + let filterView=Bundle.main.loadNibNamed("FilterView", owner: nil, options: nil)![0] as! FilterView
  81 + filterView.frame.size=CGSize(width: getScreenWidth(), height: 60+(getScreenWidth()-80)/12)
  82 + filterView.delegate=self
  83 + filterView.tag=0
  84 + filterView.setUpWithItems(title: self.nameAry[0], array: self.dataSchoolSection)
  85 + if self.dataSchoolSection.count>0{
  86 + filterView.selected=0
  87 + self.type.schoolSection=self.dataSchoolSection[0].f_Id
  88 + }
  89 + self.scrollContentView.addArrangedSubview(filterView)
  90 + filterView.translatesAutoresizingMaskIntoConstraints=false
  91 + filterView.addConstraint(NSLayoutConstraint(item: filterView, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1.0, constant: 60+(getScreenWidth()-80)/12))
  92 + for i in 1..<3{
  93 + let filterView=Bundle.main.loadNibNamed("FilterView", owner: nil, options: nil)![0] as! FilterView
  94 + filterView.frame.size=CGSize(width: getScreenWidth(), height: 60+(getScreenWidth()-80)/12)
  95 + filterView.delegate=self
  96 + filterView.tag=i
  97 + filterView.setUpWithItems(title: self.nameAry[i], array: [])
  98 + self.scrollContentView.addArrangedSubview(filterView)
  99 + filterView.translatesAutoresizingMaskIntoConstraints=false
  100 + filterView.addConstraint(NSLayoutConstraint(item: filterView, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1.0, constant: 60+(getScreenWidth()-80)/12))
  101 + }
  102 + if self.dataSchoolSection.count>0{
  103 + self.getGradeWithSchoolSectionID(id: self.dataSchoolSection[0].f_Id, index: 2)
  104 + }
  105 + self.getSubjects(index: 3)
  106 + }
  107 + }
  108 + func selectCurrentCount(index: Int,tag:Int) {
  109 + switch tag {
  110 + case 0:
  111 + type.schoolSection=dataSchoolSection[index].f_Id
  112 + getGradeWithSchoolSectionID(id: dataSchoolSection[index].f_Id, index: 2)
  113 + case 1:
  114 + type.grade=dataGrade[index].f_Id
  115 + case 2:
  116 + type.subject=dataSubject[index].f_Id
  117 + case 3: break
  118 +
  119 + default: break
  120 +
  121 + }
  122 + }
  123 + //请求年级 并刷新
  124 + func getGradeWithSchoolSectionID(id:String,index:Int){
  125 + SVProgressHUD.show(withStatus: "获取年级...")
  126 + SVProgressHUD.setDefaultMaskType(.black)
  127 + AppDelegate.instance().httpServer.getGrades(parameters: ["schooltypeid":id as AnyObject]) { (str, error) in
  128 + SVProgressHUD.dismiss()
  129 + self.dataGrade.removeAll()
  130 + if error==nil {
  131 + if JSON.fromString(jsonString: str)!["status"].intValue == 1{
  132 + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in
  133 + for item in JSON.fromString(jsonString: str)!["data"].arrayValue {
  134 + self.dataGrade.append(Grade(j: item))
  135 + }
  136 + }, failHandler: { (error) in
  137 + self.view.makeToast("获取年级失败:\(error.localizedDescription)")
  138 + })
  139 + }else{
  140 + self.view.makeToast("获取年级失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)")
  141 + }
  142 + }else{
  143 + self.view.makeToast("获取年级失败:\(error!.description)")
  144 + }
  145 + self.setupFilterView(index: index, arry: self.dataGrade)
  146 + }
  147 + }
  148 + //请求学科 并刷新
  149 + func getSubjects(index:Int){
  150 + SVProgressHUD.show(withStatus: "获取学科...")
  151 + SVProgressHUD.setDefaultMaskType(.black)
  152 + AppDelegate.instance().httpServer.getSubjects { (str, error) in
  153 + SVProgressHUD.dismiss()
  154 + self.dataSubject.removeAll()
  155 + if error==nil {
  156 + if JSON.fromString(jsonString: str)!["status"].intValue == 1{
  157 + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in
  158 + for item in JSON.fromString(jsonString: str)!["data"].arrayValue {
  159 + self.dataSubject.append(Subject(j: item))
  160 + }
  161 + }, failHandler: { (error) in
  162 + self.view.makeToast("获取学科失败:\(error.localizedDescription)")
  163 + })
  164 + }else{
  165 + self.view.makeToast("获取学科失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)")
  166 + }
  167 + }else{
  168 + self.view.makeToast("获取学科失败:\(error!.description)")
  169 + }
  170 + self.setupFilterView(index: index, arry: self.dataSubject)
  171 + }
  172 + }
18 173 override func didReceiveMemoryWarning() {
19 174 super.didReceiveMemoryWarning()
20   - // Dispose of any resources that can be recreated.
21 175 }
22   -
23   -
24   - /*
25   - // MARK: - Navigation
26   -
27   - // In a storyboard-based application, you will often want to do a little preparation before navigation
28   - override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
29   - // Get the new view controller using segue.destinationViewController.
30   - // Pass the selected object to the new view controller.
  176 + // MARK: - 销毁通知
  177 + deinit {
  178 + NotificationCenter.default.removeObserver(self)
  179 + }
  180 +}
  181 +class FilterParameter:NSObject {
  182 + var schoolSection:String? //学段
  183 + var grade:String? //年级
  184 + var subject:String? //学科
  185 + var materials:String? //教材
  186 + override init() {
  187 +
  188 + }
  189 +}
  190 +class filterModel:NSObject{
  191 + var f_Id:String=""
  192 + var f_DeleteMark:Bool=false
  193 + var f_CreatorTime:String=""
  194 + var f_CreatorUserId:String=""
  195 + var f_LastModifyTime:String=""
  196 + var f_LastModifyUserId:String=""
  197 + var f_DeleteTime:String=""
  198 + var f_DeleteUserId:String=""
  199 + init(j:JSON) {
  200 + f_Id=j["f_Id"].stringValue
  201 + f_DeleteMark=j["f_DeleteMark"].boolValue
  202 + f_CreatorTime=j["f_CreatorTime"].stringValue
  203 + f_CreatorUserId=j["f_CreatorUserId"].stringValue
  204 + f_LastModifyTime=j["f_LastModifyTime"].stringValue
  205 + f_LastModifyUserId=j["f_LastModifyUserId"].stringValue
  206 + f_DeleteTime=j["f_DeleteTime"].stringValue
  207 + f_DeleteUserId=j["f_DeleteUserId"].stringValue
  208 + }
  209 +}
  210 +class SchoolSection: filterModel {
  211 + var f_SchoolType:String=""
  212 + override init(j:JSON) {
  213 + super.init(j: j)
  214 + f_SchoolType=j["f_SchoolType"].stringValue
  215 + }
  216 +}
  217 +class Grade: filterModel {
  218 + var f_GradeName:String=""
  219 + override init(j:JSON) {
  220 + super.init(j: j)
  221 + f_GradeName=j["f_GradeName"].stringValue
  222 + }
  223 +}
  224 +class Subject: filterModel {
  225 + var f_SubjectName:String=""
  226 + override init(j:JSON) {
  227 + super.init(j: j)
  228 + f_SubjectName=j["f_SubjectName"].stringValue
31 229 }
32   - */
33   -
34 230 }
... ...
YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard
... ... @@ -9,10 +9,10 @@
9 9 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10 10 </dependencies>
11 11 <scenes>
12   - <!--Filter View Controller-->
  12 + <!--筛选-->
13 13 <scene sceneID="Rmv-Eo-NBi">
14 14 <objects>
15   - <viewController storyboardIdentifier="FilterViewController" hidesBottomBarWhenPushed="YES" id="J51-bf-ysq" customClass="FilterViewController" customModule="YouerLiveVideo" customModuleProvider="target" sceneMemberID="viewController">
  15 + <viewController storyboardIdentifier="FilterViewController" title="筛选" automaticallyAdjustsScrollViewInsets="NO" hidesBottomBarWhenPushed="YES" id="J51-bf-ysq" customClass="FilterViewController" customModule="YouerLiveVideo" customModuleProvider="target" sceneMemberID="viewController">
16 16 <layoutGuides>
17 17 <viewControllerLayoutGuide type="top" id="8Fm-xC-jSr"/>
18 18 <viewControllerLayoutGuide type="bottom" id="bXh-Wr-qy6"/>
... ... @@ -20,13 +20,64 @@
20 20 <view key="view" contentMode="scaleToFill" id="ao2-Oa-iAS">
21 21 <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
22 22 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
  23 + <subviews>
  24 + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IYF-5b-c3m">
  25 + <rect key="frame" x="0.0" y="64" width="375" height="603"/>
  26 + <subviews>
  27 + <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="KvN-Pb-Nub">
  28 + <rect key="frame" x="0.0" y="0.0" width="375" height="1"/>
  29 + <subviews>
  30 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="65A-no-dyJ">
  31 + <rect key="frame" x="0.0" y="0.0" width="375" height="1"/>
  32 + <constraints>
  33 + <constraint firstAttribute="height" constant="1" id="xkQ-5h-BMe"/>
  34 + </constraints>
  35 + <fontDescription key="fontDescription" type="system" pointSize="17"/>
  36 + <nil key="textColor"/>
  37 + <nil key="highlightedColor"/>
  38 + </label>
  39 + </subviews>
  40 + <color key="backgroundColor" red="0.98431372549999996" green="0.53333333329999999" blue="0.16078431369999999" alpha="1" colorSpace="calibratedRGB"/>
  41 + <constraints>
  42 + <constraint firstAttribute="trailing" secondItem="65A-no-dyJ" secondAttribute="trailing" id="54Y-dd-gNq"/>
  43 + <constraint firstItem="65A-no-dyJ" firstAttribute="top" secondItem="KvN-Pb-Nub" secondAttribute="top" id="ATk-pq-QJJ"/>
  44 + <constraint firstItem="65A-no-dyJ" firstAttribute="leading" secondItem="KvN-Pb-Nub" secondAttribute="leading" id="l5s-Ax-axE"/>
  45 + </constraints>
  46 + </stackView>
  47 + </subviews>
  48 + <constraints>
  49 + <constraint firstItem="KvN-Pb-Nub" firstAttribute="leading" secondItem="IYF-5b-c3m" secondAttribute="leading" id="09s-Vs-jBg"/>
  50 + <constraint firstItem="KvN-Pb-Nub" firstAttribute="width" secondItem="IYF-5b-c3m" secondAttribute="width" id="5wf-4c-5Xd"/>
  51 + <constraint firstItem="KvN-Pb-Nub" firstAttribute="top" secondItem="IYF-5b-c3m" secondAttribute="top" id="LQM-Ax-Q3o"/>
  52 + <constraint firstItem="KvN-Pb-Nub" firstAttribute="centerX" secondItem="IYF-5b-c3m" secondAttribute="centerX" id="QaL-zJ-Vej"/>
  53 + <constraint firstAttribute="trailing" secondItem="KvN-Pb-Nub" secondAttribute="trailing" id="sRO-Ai-dtq"/>
  54 + <constraint firstAttribute="bottom" secondItem="KvN-Pb-Nub" secondAttribute="bottom" id="ygU-WM-4eC"/>
  55 + </constraints>
  56 + </scrollView>
  57 + </subviews>
23 58 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
  59 + <constraints>
  60 + <constraint firstItem="bXh-Wr-qy6" firstAttribute="top" secondItem="IYF-5b-c3m" secondAttribute="bottom" id="4Fj-ek-MrC"/>
  61 + <constraint firstItem="IYF-5b-c3m" firstAttribute="leading" secondItem="ao2-Oa-iAS" secondAttribute="leading" id="Gw1-De-QXC"/>
  62 + <constraint firstAttribute="trailing" secondItem="IYF-5b-c3m" secondAttribute="trailing" id="lOu-N7-px1"/>
  63 + <constraint firstItem="IYF-5b-c3m" firstAttribute="top" secondItem="8Fm-xC-jSr" secondAttribute="bottom" id="r8a-fu-6SW"/>
  64 + </constraints>
24 65 </view>
  66 + <navigationItem key="navigationItem" title="筛选" id="XhF-gh-xmO">
  67 + <barButtonItem key="rightBarButtonItem" title="取消" id="sh5-cw-Jab">
  68 + <connections>
  69 + <action selector="dismissAction:" destination="J51-bf-ysq" id="nh3-AE-6cX"/>
  70 + </connections>
  71 + </barButtonItem>
  72 + </navigationItem>
25 73 <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
  74 + <connections>
  75 + <outlet property="scrollContentView" destination="KvN-Pb-Nub" id="NiI-XK-4DK"/>
  76 + </connections>
26 77 </viewController>
27 78 <placeholder placeholderIdentifier="IBFirstResponder" id="ocM-s7-Wga" userLabel="First Responder" sceneMemberID="firstResponder"/>
28 79 </objects>
29   - <point key="canvasLocation" x="-737" y="266"/>
  80 + <point key="canvasLocation" x="-738.39999999999998" y="265.81709145427288"/>
30 81 </scene>
31 82 <!--Live Infor View Controller-->
32 83 <scene sceneID="QrF-a4-VNS">
... ...
YouerLiveVideo/YouerLiveVideo/controllers/Resource/ResourceViewController.swift
... ... @@ -107,7 +107,7 @@ class ResourceViewController: UIViewController,UITableViewDelegate,UITableViewDa
107 107 // MARK: - 跳转到筛选
108 108 @IBAction func jumpFilterVCAction(_ sender: UIButton) {
109 109 let vc = UIStoryboard(name: "Resource", bundle: nil).instantiateViewController(withIdentifier: "FilterViewController") as! FilterViewController
110   - self.navigationController?.pushViewController(vc, animated: true)
  110 + self.present(vc.wrapWithNavigationController(), animated: true, completion: nil)
111 111 }
112 112  
113 113 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
... ...
YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterCollectionViewCell.swift 0 → 100644
... ... @@ -0,0 +1,19 @@
  1 +//
  2 +// FilterCollectionViewCell.swift
  3 +// YouerLiveVideo
  4 +//
  5 +// Created by 葛建军 on 17/5/23.
  6 +// Copyright © 2017年 左丞. All rights reserved.
  7 +//
  8 +
  9 +import UIKit
  10 +
  11 +class FilterCollectionViewCell: UICollectionViewCell {
  12 +
  13 + @IBOutlet var titleLabel: UILabel!
  14 + override func awakeFromNib() {
  15 + super.awakeFromNib()
  16 + // Initialization code
  17 + }
  18 +
  19 +}
... ...
YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterCollectionViewCell.xib 0 → 100644
... ... @@ -0,0 +1,48 @@
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
  3 + <device id="retina4_7" orientation="portrait">
  4 + <adaptation id="fullscreen"/>
  5 + </device>
  6 + <dependencies>
  7 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
  8 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
  9 + </dependencies>
  10 + <objects>
  11 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
  12 + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
  13 + <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="identifier" id="gTV-IL-0wX" customClass="FilterCollectionViewCell" customModule="YouerLiveVideo" customModuleProvider="target">
  14 + <rect key="frame" x="0.0" y="0.0" width="120" height="40"/>
  15 + <autoresizingMask key="autoresizingMask"/>
  16 + <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
  17 + <rect key="frame" x="0.0" y="0.0" width="120" height="40"/>
  18 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
  19 + <subviews>
  20 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="小学" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="F0D-46-jda">
  21 + <rect key="frame" x="0.0" y="0.0" width="120" height="40"/>
  22 + <color key="backgroundColor" red="0.10980392160000001" green="0.63529411759999999" blue="1" alpha="1" colorSpace="calibratedRGB"/>
  23 + <fontDescription key="fontDescription" type="system" pointSize="15"/>
  24 + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
  25 + <nil key="highlightedColor"/>
  26 + <userDefinedRuntimeAttributes>
  27 + <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
  28 + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
  29 + <integer key="value" value="5"/>
  30 + </userDefinedRuntimeAttribute>
  31 + </userDefinedRuntimeAttributes>
  32 + </label>
  33 + </subviews>
  34 + </view>
  35 + <constraints>
  36 + <constraint firstItem="F0D-46-jda" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="33t-wF-LMs"/>
  37 + <constraint firstAttribute="trailing" secondItem="F0D-46-jda" secondAttribute="trailing" id="M5r-RT-2BD"/>
  38 + <constraint firstAttribute="bottom" secondItem="F0D-46-jda" secondAttribute="bottom" id="NdF-Eb-c7u"/>
  39 + <constraint firstItem="F0D-46-jda" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="TNg-FI-q5K"/>
  40 + </constraints>
  41 + <size key="customSize" width="122" height="38"/>
  42 + <connections>
  43 + <outlet property="titleLabel" destination="F0D-46-jda" id="CGy-n4-6ma"/>
  44 + </connections>
  45 + <point key="canvasLocation" x="-80" y="-77"/>
  46 + </collectionViewCell>
  47 + </objects>
  48 +</document>
... ...
YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterView.swift 0 → 100644
... ... @@ -0,0 +1,93 @@
  1 +//
  2 +// FilterView.swift
  3 +// YouerLiveVideo
  4 +//
  5 +// Created by 葛建军 on 17/5/23.
  6 +// Copyright © 2017年 左丞. All rights reserved.
  7 +//
  8 +
  9 +import UIKit
  10 +
  11 +class FilterView: UIView,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout {
  12 + @IBOutlet var titleLabel: UILabel!
  13 + @IBOutlet var collectionView: UICollectionView!
  14 + var isOpen:Bool=false
  15 + var dataAry:[filterModel]=[]
  16 + var delegate:FilterViewDelegate!
  17 + var selected:Int = -1
  18 + var numberLines:Int!
  19 + var cellWidth=(getScreenWidth()-80)/3
  20 + var cellHeight=(getScreenWidth()-80)/12
  21 + override func awakeFromNib() {
  22 + super.awakeFromNib()
  23 + collectionView.register(UINib(nibName: "FilterCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "identifier")
  24 + }
  25 + func setUpWithItems(title:String,array:[filterModel]) {
  26 + titleLabel.text=title
  27 + dataAry=array
  28 + numberLines = array.count%3 > 0 ? array.count/3+1 : array.count/3
  29 + self.collectionView.reloadData()
  30 + }
  31 + func changeItems(array:[filterModel]){
  32 + dataAry=array
  33 + numberLines = array.count%3 > 0 ? array.count/3+1 : array.count/3
  34 + self.collectionView.reloadData()
  35 + }
  36 + @IBAction func openOrCloseAction(_ sender: UIButton) {
  37 + if isOpen {
  38 + isOpen=false
  39 + self.constraints.last!.constant=60+cellHeight
  40 + }else{
  41 + if dataAry.count>3{
  42 + isOpen=true
  43 + self.constraints.last!.constant=60+cellHeight+CGFloat(numberLines-1)*(cellHeight+10)
  44 + self.collectionView.reloadData()
  45 + }
  46 + }
  47 + }
  48 + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
  49 + return CGSize(width: cellWidth, height: cellHeight)
  50 + }
  51 + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  52 + let cell=collectionView.dequeueReusableCell(withReuseIdentifier: "identifier", for: indexPath) as! FilterCollectionViewCell
  53 + switch self.tag {
  54 + case 0:
  55 + cell.titleLabel.text=(dataAry as! [SchoolSection])[indexPath.row].f_SchoolType
  56 + case 1:
  57 + cell.titleLabel.text=(dataAry as! [Grade])[indexPath.row].f_GradeName
  58 + case 2:
  59 + cell.titleLabel.text=(dataAry as! [Subject])[indexPath.row].f_SubjectName
  60 + default:
  61 + cell.titleLabel.text="未知"
  62 + }
  63 + if indexPath.row==selected {
  64 + cell.titleLabel.backgroundColor=Theme.topBarColor()
  65 + cell.titleLabel.textColor=UIColor.white
  66 + }else{
  67 + cell.titleLabel.backgroundColor=UIColor.groupTableViewBackground
  68 + cell.titleLabel.textColor=UIColor.black
  69 + }
  70 + return cell
  71 + }
  72 + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
  73 + if isOpen {
  74 + return dataAry.count
  75 + }else{
  76 + if dataAry.count<4 {
  77 + return dataAry.count
  78 + }else{
  79 + return 3
  80 + }
  81 + }
  82 + }
  83 + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
  84 + if selected != indexPath.row {
  85 + selected=indexPath.row
  86 + self.delegate.selectCurrentCount(index: indexPath.row, tag: self.tag)
  87 + self.collectionView.reloadData()
  88 + }
  89 + }
  90 +}
  91 +protocol FilterViewDelegate {
  92 + func selectCurrentCount(index:Int,tag:Int)
  93 +}
... ...
YouerLiveVideo/YouerLiveVideo/controllers/Resource/View/FilterView.xib 0 → 100644
... ... @@ -0,0 +1,98 @@
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
  3 + <device id="retina4_7" orientation="portrait">
  4 + <adaptation id="fullscreen"/>
  5 + </device>
  6 + <dependencies>
  7 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
  8 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
  9 + </dependencies>
  10 + <objects>
  11 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
  12 + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
  13 + <view clipsSubviews="YES" contentMode="scaleToFill" id="iN0-l3-epB" customClass="FilterView" customModule="YouerLiveVideo" customModuleProvider="target">
  14 + <rect key="frame" x="0.0" y="0.0" width="406" height="242"/>
  15 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
  16 + <subviews>
  17 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="学段" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uQz-xV-iAD">
  18 + <rect key="frame" x="20" y="10" width="33" height="20"/>
  19 + <fontDescription key="fontDescription" type="system" pointSize="16"/>
  20 + <nil key="textColor"/>
  21 + <nil key="highlightedColor"/>
  22 + </label>
  23 + <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="PUk-bf-FTI">
  24 + <rect key="frame" x="20" y="40" width="366" height="182"/>
  25 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
  26 + <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="0.0" id="CMD-Fw-Sjo">
  27 + <size key="itemSize" width="50" height="50"/>
  28 + <size key="headerReferenceSize" width="0.0" height="0.0"/>
  29 + <size key="footerReferenceSize" width="0.0" height="0.0"/>
  30 + <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
  31 + </collectionViewFlowLayout>
  32 + <connections>
  33 + <outlet property="dataSource" destination="iN0-l3-epB" id="ESV-a0-hCq"/>
  34 + <outlet property="delegate" destination="iN0-l3-epB" id="RXH-fJ-Hll"/>
  35 + </connections>
  36 + </collectionView>
  37 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cif-Vg-cMI">
  38 + <rect key="frame" x="336" y="0.0" width="50" height="34"/>
  39 + <subviews>
  40 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="全部" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xgp-Yj-rju">
  41 + <rect key="frame" x="0.0" y="0.0" width="42" height="34"/>
  42 + <fontDescription key="fontDescription" type="system" pointSize="13"/>
  43 + <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
  44 + <nil key="highlightedColor"/>
  45 + </label>
  46 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_more" translatesAutoresizingMaskIntoConstraints="NO" id="Yi5-oE-p54">
  47 + <rect key="frame" x="42" y="10" width="8" height="15"/>
  48 + <constraints>
  49 + <constraint firstAttribute="width" constant="8" id="8pU-3b-hVL"/>
  50 + <constraint firstAttribute="height" constant="15" id="YoR-To-kNi"/>
  51 + </constraints>
  52 + </imageView>
  53 + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vFg-ez-6yB">
  54 + <rect key="frame" x="0.0" y="0.0" width="50" height="34"/>
  55 + <connections>
  56 + <action selector="openOrCloseAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="enY-8P-rHR"/>
  57 + </connections>
  58 + </button>
  59 + </subviews>
  60 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
  61 + <constraints>
  62 + <constraint firstAttribute="bottom" secondItem="Xgp-Yj-rju" secondAttribute="bottom" id="5pX-4I-aV1"/>
  63 + <constraint firstAttribute="trailing" secondItem="vFg-ez-6yB" secondAttribute="trailing" id="8oA-tR-a9S"/>
  64 + <constraint firstAttribute="bottom" secondItem="vFg-ez-6yB" secondAttribute="bottom" id="8pE-Nx-jdY"/>
  65 + <constraint firstItem="Xgp-Yj-rju" firstAttribute="leading" secondItem="cif-Vg-cMI" secondAttribute="leading" id="Acg-vU-eDj"/>
  66 + <constraint firstItem="vFg-ez-6yB" firstAttribute="top" secondItem="cif-Vg-cMI" secondAttribute="top" id="EGn-rn-FhX"/>
  67 + <constraint firstItem="Yi5-oE-p54" firstAttribute="leading" secondItem="Xgp-Yj-rju" secondAttribute="trailing" id="EU8-pp-uj6"/>
  68 + <constraint firstItem="Yi5-oE-p54" firstAttribute="centerY" secondItem="cif-Vg-cMI" secondAttribute="centerY" id="dI6-h0-ve2"/>
  69 + <constraint firstAttribute="width" constant="50" id="gp7-jN-cTr"/>
  70 + <constraint firstItem="Xgp-Yj-rju" firstAttribute="top" secondItem="cif-Vg-cMI" secondAttribute="top" id="mKd-KO-MU9"/>
  71 + <constraint firstItem="vFg-ez-6yB" firstAttribute="leading" secondItem="cif-Vg-cMI" secondAttribute="leading" id="oQy-yz-nC5"/>
  72 + <constraint firstAttribute="trailing" secondItem="Yi5-oE-p54" secondAttribute="trailing" id="qP2-LK-MJS"/>
  73 + </constraints>
  74 + </view>
  75 + </subviews>
  76 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
  77 + <constraints>
  78 + <constraint firstItem="uQz-xV-iAD" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="5ZE-95-bk1"/>
  79 + <constraint firstAttribute="bottom" secondItem="PUk-bf-FTI" secondAttribute="bottom" constant="20" id="8xy-ni-fOt"/>
  80 + <constraint firstAttribute="trailing" secondItem="cif-Vg-cMI" secondAttribute="trailing" constant="20" id="DPa-oT-ZVi"/>
  81 + <constraint firstItem="PUk-bf-FTI" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" id="MAr-8E-ipy"/>
  82 + <constraint firstItem="PUk-bf-FTI" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="40" id="NkW-cH-ltZ"/>
  83 + <constraint firstAttribute="trailing" secondItem="PUk-bf-FTI" secondAttribute="trailing" constant="20" id="fwr-U1-zDh"/>
  84 + <constraint firstItem="uQz-xV-iAD" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" id="gNr-Pg-F54"/>
  85 + <constraint firstItem="cif-Vg-cMI" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="kKV-TT-4Ov"/>
  86 + </constraints>
  87 + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
  88 + <connections>
  89 + <outlet property="collectionView" destination="PUk-bf-FTI" id="lcH-DQ-bM9"/>
  90 + <outlet property="titleLabel" destination="uQz-xV-iAD" id="in8-lv-Coj"/>
  91 + </connections>
  92 + <point key="canvasLocation" x="4" y="-317"/>
  93 + </view>
  94 + </objects>
  95 + <resources>
  96 + <image name="icon_more" width="8" height="14"/>
  97 + </resources>
  98 +</document>
... ...
YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift
... ... @@ -85,7 +85,7 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker
85 85 if inputVerificationCode.text!.characters.count == 4{
86 86 SVProgressHUD.show(withStatus: "注册...")
87 87 SVProgressHUD.setDefaultMaskType(.black)
88   - let parameters:Dictionary<String,AnyObject>=["account":phoneNumber.text! as AnyObject,"password":passwordTextField.text! as AnyObject,"vercode":inputVerificationCode.text! as AnyObject,"nickname": (nikeNameTextFiled.text!=="" ? phoneNumber.text! : nikeNameTextFiled.text!) as AnyObject]
  88 + let parameters:Dictionary<String,AnyObject>=["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]
89 89 AppDelegate.instance().httpServer.getCreateUser(parameters: parameters) { (str, error) in
90 90 SVProgressHUD.dismiss()
91 91 self.nikeNameTextFiled.isUserInteractionEnabled=true
... ... @@ -95,7 +95,7 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker
95 95 if error==nil {
96 96 if JSON.fromString(jsonString: str)!["status"].intValue == 1{
97 97 httpJsonResule(jsonString: str, error: error, successHandler: { (json) in
98   - self.navigationController!.popToRootViewController(animated: true)
  98 + self.navigationController!.dismiss(animated: true, completion: nil)
99 99 AppDelegate.instance().window?.makeToast("注册成功")
100 100 NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshLoginUser"), object: self.phoneNumber.text!)
101 101 //是否登录
... ...
YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard
... ... @@ -78,7 +78,6 @@
78 78 </imageView>
79 79 <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入账号" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="IzH-dB-I9H">
80 80 <rect key="frame" x="36" y="18.5" width="339" height="19"/>
81   - <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
82 81 <fontDescription key="fontDescription" type="system" pointSize="13"/>
83 82 <textInputTraits key="textInputTraits" keyboardType="numberPad"/>
84 83 <connections>
... ... @@ -121,7 +120,6 @@
121 120 </imageView>
122 121 <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入密码" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="nVn-EA-yWM">
123 122 <rect key="frame" x="36" y="18.5" width="339" height="19"/>
124   - <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
125 123 <fontDescription key="fontDescription" type="system" pointSize="13"/>
126 124 <textInputTraits key="textInputTraits" secureTextEntry="YES"/>
127 125 <connections>
... ... @@ -551,7 +549,7 @@
551 549 <nil key="highlightedColor"/>
552 550 </label>
553 551 <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入手机号码 " minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="nVJ-81-bXY">
554   - <rect key="frame" x="89" y="18.5" width="123.5" height="19"/>
  552 + <rect key="frame" x="89" y="19" width="177" height="19"/>
555 553 <fontDescription key="fontDescription" type="system" pointSize="15"/>
556 554 <textInputTraits key="textInputTraits" keyboardType="numberPad" returnKeyType="done"/>
557 555 <connections>
... ... @@ -561,6 +559,9 @@
561 559 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hwv-0n-dsf">
562 560 <rect key="frame" x="274" y="13" width="93" height="30"/>
563 561 <color key="backgroundColor" red="0.10980392160000001" green="0.63529411759999999" blue="1" alpha="1" colorSpace="calibratedRGB"/>
  562 + <constraints>
  563 + <constraint firstAttribute="width" constant="93" id="tn3-0t-fnt"/>
  564 + </constraints>
564 565 <fontDescription key="fontDescription" type="system" pointSize="15"/>
565 566 <state key="normal" title=" 发送验证码 ">
566 567 <color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
... ... @@ -586,6 +587,7 @@
586 587 <constraint firstAttribute="trailing" secondItem="hwv-0n-dsf" secondAttribute="trailing" constant="8" id="jCe-9b-HiL"/>
587 588 <constraint firstItem="hwv-0n-dsf" firstAttribute="centerY" secondItem="vkP-pb-ydp" secondAttribute="centerY" id="mgL-oA-0oG"/>
588 589 <constraint firstAttribute="trailing" secondItem="MEf-rE-fBh" secondAttribute="trailing" id="nEG-6h-NXY"/>
  590 + <constraint firstItem="hwv-0n-dsf" firstAttribute="leading" secondItem="nVJ-81-bXY" secondAttribute="trailing" constant="8" id="u7R-Pm-UM9"/>
589 591 <constraint firstAttribute="bottom" secondItem="MEf-rE-fBh" secondAttribute="bottom" id="y9Q-1X-3wy"/>
590 592 <constraint firstItem="nVJ-81-bXY" firstAttribute="leading" secondItem="ae8-Wz-CYH" secondAttribute="trailing" constant="8" id="zxS-jB-eC8"/>
591 593 </constraints>
... ... @@ -738,7 +740,7 @@
738 740 </connections>
739 741 </tapGestureRecognizer>
740 742 </objects>
741   - <point key="canvasLocation" x="-1446" y="1533"/>
  743 + <point key="canvasLocation" x="-1447.2" y="1532.3838080959522"/>
742 744 </scene>
743 745 <!--注册-->
744 746 <scene sceneID="fjB-PO-uzD">
... ...
YouerLiveVideo/YouerLiveVideo/util/network.swift
... ... @@ -228,12 +228,12 @@ final class HTTPServer{
228 228 KHttp.GET(url: HTTPServer.URL_COMMONGETCOURSEWAREVERSIONS, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler)
229 229 }
230 230 //获取学科
231   - func getSubjects(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){
232   - KHttp.GET(url: HTTPServer.URL_COMMONGETSUBJECTS, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler)
  231 + func getSubjects(completionHandler:@escaping (String?, NSError?) -> ()){
  232 + KHttp.GET(url: HTTPServer.URL_COMMONGETSUBJECTS, headers:["Authorization":token!], completionHandler: completionHandler)
233 233 }
234 234 //获取学段
235   - func getSchoolTypes(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){
236   - KHttp.GET(url: HTTPServer.URL_COMMONGETSCHOOLTYPES, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler)
  235 + func getSchoolTypes(completionHandler:@escaping (String?, NSError?) -> ()){
  236 + KHttp.GET(url: HTTPServer.URL_COMMONGETSCHOOLTYPES, headers:["Authorization":token!], completionHandler: completionHandler)
237 237 }
238 238 //获取轮播图 type:0-视频云前端轮播图 1-校园电视台轮播图
239 239 func getLunboList(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){
... ...