Commit 01c5e518bbed923410db960547921d1301032377
1 parent
9938271f
部分幼教需求
Showing
3 changed files
with
87 additions
and
3 deletions
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideViewController.swift
| @@ -241,4 +241,21 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa | @@ -241,4 +241,21 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa | ||
| 241 | } | 241 | } |
| 242 | // | 242 | // |
| 243 | } | 243 | } |
| 244 | + //MARK: - 幼教中国获取 我的课程 | ||
| 245 | + func getYjzgMyCurriculumApi() | ||
| 246 | + { | ||
| 247 | +// showLoading(message: "") | ||
| 248 | + CNLiveDownSlideViewModel.getYjzgMyCurriculum(page: 1) { result, status in | ||
| 249 | + hiddenLoading() | ||
| 250 | + if status == .success{ | ||
| 251 | + let albumBaseModel = result as! CNLiveAlbumBaseModel | ||
| 252 | + | ||
| 253 | + }else if (status == .failed){ | ||
| 254 | +// self.NetApiStatus = .apiError | ||
| 255 | + }else if (status == .noNetwork){ | ||
| 256 | + | ||
| 257 | +// self.NetApiStatus = .notNetwork | ||
| 258 | + } | ||
| 259 | + } | ||
| 260 | + } | ||
| 244 | } | 261 | } |
metaCode/Classes/Main/HomePage/ViewModel/CNLiveDownSlideViewModel.swift
| @@ -53,4 +53,32 @@ class CNLiveDownSlideViewModel:NSObject{ | @@ -53,4 +53,32 @@ class CNLiveDownSlideViewModel:NSObject{ | ||
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | + /// 获取下滑页-幼教原生页面-我的课程数据 | ||
| 57 | + static func getYjzgMyCurriculum(page:NSInteger,resultBlock: @escaping downSlideResultBlock) { | ||
| 58 | + let param = NSMutableDictionary() | ||
| 59 | + param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") | ||
| 60 | + param.setValue("\(page)", forKey: "page") | ||
| 61 | +// param.setValue("10", forKey: "pageSize") | ||
| 62 | + CNLiveNetworking.setAllowRequestDefaultArgument(true) | ||
| 63 | + CNLiveNetworking.setupShowDataResult(false) | ||
| 64 | + let custom_param = NSMutableDictionary() | ||
| 65 | + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId_wjj, forKey: "appId") | ||
| 66 | + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 67 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | ||
| 68 | + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseCMSUrl+"/contentApi/yjzgMyCurriculum", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in | ||
| 69 | + hiddenLoading() | ||
| 70 | + if (error == nil) { | ||
| 71 | + let resp = result as! NSDictionary | ||
| 72 | + let errorCode = "\(resp["errorCode"] ?? "0")" | ||
| 73 | + if (errorCode == "0") { | ||
| 74 | + let dataDic = resp["data"] as! Dictionary<String, Any> | ||
| 75 | + let dataMdl = newDictionaryToModel(dataDic , CNLiveAlbumBaseModel.self) | ||
| 76 | + resultBlock(dataMdl,.success) | ||
| 77 | + } | ||
| 78 | + else{ | ||
| 79 | + resultBlock(NSNull(),.failed) | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + } | ||
| 56 | } | 84 | } |
metaCode/Classes/Main/Util/CNLiveDownSlideTool.swift
| @@ -25,7 +25,7 @@ class CNLiveDownSlideTool:NSObject{ | @@ -25,7 +25,7 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 25 | let webVC = CNWebViewController() | 25 | let webVC = CNWebViewController() |
| 26 | webVC.url = URL(string: (contentMdl.thirdUrl)!) | 26 | webVC.url = URL(string: (contentMdl.thirdUrl)!) |
| 27 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | 27 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) |
| 28 | - }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum) || (contentMdl.model == kCNDownSlideContentsModelModelAlbum_video){ | 28 | + }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum){ |
| 29 | 29 | ||
| 30 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" | 30 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" |
| 31 | let queryItem = URLQueryItem(name: "aid", value: contentMdl.contentId) | 31 | let queryItem = URLQueryItem(name: "aid", value: contentMdl.contentId) |
| @@ -36,6 +36,19 @@ class CNLiveDownSlideTool:NSObject{ | @@ -36,6 +36,19 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 36 | let webVC = CNWebViewController() | 36 | let webVC = CNWebViewController() |
| 37 | webVC.url = regURL | 37 | webVC.url = regURL |
| 38 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | 38 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) |
| 39 | + }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum_video){ | ||
| 40 | + let urlString = "http://wjjh5.cnlive.com/cnYjzgAlbumVideo.html" | ||
| 41 | + let queryItem = URLQueryItem(name: "aid", value: contentMdl.contentId) | ||
| 42 | + let queryItem1 = URLQueryItem(name: "title", value: contentMdl.title) | ||
| 43 | + let queryItem2 = URLQueryItem(name: "channelName", value: "yjzg") | ||
| 44 | + let queryItem3 = URLQueryItem(name: "isShowTitle", value: "true") | ||
| 45 | + let queryItem4 = URLQueryItem(name: "isWjjReport", value: "true") | ||
| 46 | + let urlComponents = NSURLComponents(string: urlString) | ||
| 47 | + urlComponents!.queryItems = [queryItem, queryItem1] | ||
| 48 | + let regURL = urlComponents?.url | ||
| 49 | + let webVC = CNWebViewController() | ||
| 50 | + webVC.url = regURL | ||
| 51 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | ||
| 39 | }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum_ugc){ | 52 | }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum_ugc){ |
| 40 | 53 | ||
| 41 | //短剧-跳转短剧播放页 | 54 | //短剧-跳转短剧播放页 |
| @@ -75,7 +88,7 @@ class CNLiveDownSlideTool:NSObject{ | @@ -75,7 +88,7 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 75 | let webVC = CNWebViewController() | 88 | let webVC = CNWebViewController() |
| 76 | webVC.url = URL(string: (albumModel.thirdUrl)) | 89 | webVC.url = URL(string: (albumModel.thirdUrl)) |
| 77 | controller.navigationController?.pushViewController(webVC, animated: pushAnimated) | 90 | controller.navigationController?.pushViewController(webVC, animated: pushAnimated) |
| 78 | - }else if (albumModel.model == kCNDownSlideContentsModelModelAlbum) || (albumModel.model == kCNDownSlideContentsModelModelAlbum_video){ | 91 | + }else if albumModel.model == kCNDownSlideContentsModelModelAlbum{ |
| 79 | 92 | ||
| 80 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" | 93 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" |
| 81 | let queryItem = URLQueryItem(name: "aid", value: albumModel.contentId) | 94 | let queryItem = URLQueryItem(name: "aid", value: albumModel.contentId) |
| @@ -86,6 +99,19 @@ class CNLiveDownSlideTool:NSObject{ | @@ -86,6 +99,19 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 86 | let webVC = CNWebViewController() | 99 | let webVC = CNWebViewController() |
| 87 | webVC.url = regURL | 100 | webVC.url = regURL |
| 88 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | 101 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) |
| 102 | + }else if (albumModel.model == kCNDownSlideContentsModelModelAlbum_video){ | ||
| 103 | + let urlString = "http://wjjh5.cnlive.com/cnYjzgAlbumVideo.html" | ||
| 104 | + let queryItem = URLQueryItem(name: "aid", value: albumModel.contentId) | ||
| 105 | + let queryItem1 = URLQueryItem(name: "title", value: albumModel.title) | ||
| 106 | + let queryItem2 = URLQueryItem(name: "channelName", value: "yjzg") | ||
| 107 | + let queryItem3 = URLQueryItem(name: "isShowTitle", value: "true") | ||
| 108 | + let queryItem4 = URLQueryItem(name: "isWjjReport", value: "true") | ||
| 109 | + let urlComponents = NSURLComponents(string: urlString) | ||
| 110 | + urlComponents!.queryItems = [queryItem, queryItem1] | ||
| 111 | + let regURL = urlComponents?.url | ||
| 112 | + let webVC = CNWebViewController() | ||
| 113 | + webVC.url = regURL | ||
| 114 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | ||
| 89 | }else if (albumModel.model == kCNDownSlideContentsModelModelAlbum_ugc){ | 115 | }else if (albumModel.model == kCNDownSlideContentsModelModelAlbum_ugc){ |
| 90 | //短剧-跳转短剧播放页 | 116 | //短剧-跳转短剧播放页 |
| 91 | navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: albumModel.contentId), animated: pushAnimated) | 117 | navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: albumModel.contentId), animated: pushAnimated) |
| @@ -127,7 +153,7 @@ class CNLiveDownSlideTool:NSObject{ | @@ -127,7 +153,7 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 127 | let webVC = CNWebViewController() | 153 | let webVC = CNWebViewController() |
| 128 | webVC.url = URL(string: (contentMdl.thirdUrl)!) | 154 | webVC.url = URL(string: (contentMdl.thirdUrl)!) |
| 129 | viewController.navigationController?.pushViewController(webVC, animated: true) | 155 | viewController.navigationController?.pushViewController(webVC, animated: true) |
| 130 | - }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum) || (contentMdl.model == kCNDownSlideContentsModelModelAlbum_video){ | 156 | + }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum){ |
| 131 | 157 | ||
| 132 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" | 158 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" |
| 133 | let queryItem = URLQueryItem(name: "aid", value: contentMdl.contentId) | 159 | let queryItem = URLQueryItem(name: "aid", value: contentMdl.contentId) |
| @@ -138,6 +164,19 @@ class CNLiveDownSlideTool:NSObject{ | @@ -138,6 +164,19 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 138 | let webVC = CNWebViewController() | 164 | let webVC = CNWebViewController() |
| 139 | webVC.url = regURL | 165 | webVC.url = regURL |
| 140 | viewController.navigationController?.pushViewController(webVC, animated: true) | 166 | viewController.navigationController?.pushViewController(webVC, animated: true) |
| 167 | + }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum_video){ | ||
| 168 | + let urlString = "http://wjjh5.cnlive.com/cnYjzgAlbumVideo.html" | ||
| 169 | + let queryItem = URLQueryItem(name: "aid", value: contentMdl.contentId) | ||
| 170 | + let queryItem1 = URLQueryItem(name: "title", value: contentMdl.title) | ||
| 171 | + let queryItem2 = URLQueryItem(name: "channelName", value: "yjzg") | ||
| 172 | + let queryItem3 = URLQueryItem(name: "isShowTitle", value: "true") | ||
| 173 | + let queryItem4 = URLQueryItem(name: "isWjjReport", value: "true") | ||
| 174 | + let urlComponents = NSURLComponents(string: urlString) | ||
| 175 | + urlComponents!.queryItems = [queryItem, queryItem1] | ||
| 176 | + let regURL = urlComponents?.url | ||
| 177 | + let webVC = CNWebViewController() | ||
| 178 | + webVC.url = regURL | ||
| 179 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | ||
| 141 | }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum_ugc){ | 180 | }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum_ugc){ |
| 142 | //短剧-跳转短剧播放页 | 181 | //短剧-跳转短剧播放页 |
| 143 | navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: contentMdl.contentId!), animated: pushAnimated) | 182 | navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: contentMdl.contentId!), animated: pushAnimated) |