Commit 10e85a736b84cf8fe009937053370f9b1eb43956
Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode
# Conflicts: # Podfile
Showing
10 changed files
with
135 additions
and
20 deletions
Podfile
| ... | ... | @@ -53,9 +53,6 @@ target 'metaCode' do |
| 53 | 53 | pod 'ZFPlayer/ijkplayer', :git => 'https://gitee.com/mirrors/ZFPlayer.git' |
| 54 | 54 | #分享 |
| 55 | 55 | pod 'CNLiveShareToolKit' |
| 56 | -# pod 'CNLiveTencentopenapi', :git => 'https://github.com/CNLiveiOSTeam/CNLiveTencentopenapi.git' | |
| 57 | -# pod 'CNLiveTencentopenapi' | |
| 58 | -# pod 'WechatOpenSDK' | |
| 59 | 56 | #网家家输入组件 |
| 60 | 57 | pod 'CNLiveCustomUI/CNLiveContentToolTextView' |
| 61 | 58 | #业务工具库 | ... | ... |
metaCode/Classes/Main/HomePage/ViewModel/CNLiveDownSlideViewModel.swift
| ... | ... | @@ -28,6 +28,10 @@ class CNLiveDownSlideViewModel:NSObject{ |
| 28 | 28 | param.setValue(pageId, forKey: "pageId") |
| 29 | 29 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 30 | 30 | CNLiveNetworking.setupShowDataResult(false) |
| 31 | + let custom_param = NSMutableDictionary() | |
| 32 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 33 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 34 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 31 | 35 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseCMSUrl+"/contentApi/getPage", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 32 | 36 | hiddenLoading() |
| 33 | 37 | if (error == nil) { | ... | ... |
metaCode/Classes/Main/HomePage/ViewModel/CNLiveShopConsoleViewModel.swift
| ... | ... | @@ -18,6 +18,10 @@ class CNLiveShopConsoleViewModel: NSObject { |
| 18 | 18 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 19 | 19 | CNLiveNetworking.setupShowDataResult(false) |
| 20 | 20 | CNLiveNetworking.setupDSRequest(true) |
| 21 | + let custom_param = NSMutableDictionary() | |
| 22 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 23 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 24 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 21 | 25 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/isSellerNew", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 22 | 26 | hiddenLoading() |
| 23 | 27 | if (error == nil) { | ... | ... |
metaCode/Classes/Main/HomePage/ViewModel/CNLiveShopDetailViewModel.swift
| ... | ... | @@ -21,6 +21,10 @@ class CNLiveShopDetailViewModel:NSObject{ |
| 21 | 21 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 22 | 22 | CNLiveNetworking.setupShowDataResult(false) |
| 23 | 23 | CNLiveNetworking.setupDSRequest(true) |
| 24 | + let custom_param = NSMutableDictionary() | |
| 25 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 26 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 27 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 24 | 28 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/index", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 25 | 29 | hiddenLoading() |
| 26 | 30 | if (error == nil) { | ... | ... |
metaCode/Classes/Main/HomePage/ViewModel/GoodsManager/CNLiveShopGoodListViewModel.swift
| ... | ... | @@ -36,6 +36,10 @@ class CNLiveShopGoodListViewModel:NSObject{ |
| 36 | 36 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 37 | 37 | CNLiveNetworking.setupShowDataResult(false) |
| 38 | 38 | CNLiveNetworking.setupDSRequest(true) |
| 39 | + let custom_param = NSMutableDictionary() | |
| 40 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 41 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 42 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 39 | 43 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjBUrl+"/api/v1/getGoodsList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 40 | 44 | hiddenLoading() |
| 41 | 45 | if (error == nil) { |
| ... | ... | @@ -71,6 +75,10 @@ class CNLiveShopGoodListViewModel:NSObject{ |
| 71 | 75 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 72 | 76 | CNLiveNetworking.setupShowDataResult(false) |
| 73 | 77 | CNLiveNetworking.setupDSRequest(true) |
| 78 | + let custom_param = NSMutableDictionary() | |
| 79 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 80 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 81 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 74 | 82 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjBUrl+"/api/v1/getGoodsList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 75 | 83 | hiddenLoading() |
| 76 | 84 | if (error == nil) { |
| ... | ... | @@ -134,6 +142,10 @@ class CNLiveShopGoodListViewModel:NSObject{ |
| 134 | 142 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 135 | 143 | CNLiveNetworking.setupShowDataResult(false) |
| 136 | 144 | CNLiveNetworking.setupDSRequest(true) |
| 145 | + let custom_param = NSMutableDictionary() | |
| 146 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 147 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 148 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 137 | 149 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/goodsAdd", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 138 | 150 | hiddenLoading() |
| 139 | 151 | let res = (result as! Dictionary<String, Any>)["code"] as! String |
| ... | ... | @@ -190,6 +202,10 @@ class CNLiveShopGoodListViewModel:NSObject{ |
| 190 | 202 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 191 | 203 | CNLiveNetworking.setupShowDataResult(false) |
| 192 | 204 | CNLiveNetworking.setupDSRequest(true) |
| 205 | + let custom_param = NSMutableDictionary() | |
| 206 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 207 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 208 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 193 | 209 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/goodsEdit", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 194 | 210 | hiddenLoading() |
| 195 | 211 | let res = (result as! Dictionary<String, Any>)["code"] as! String |
| ... | ... | @@ -215,6 +231,10 @@ class CNLiveShopGoodListViewModel:NSObject{ |
| 215 | 231 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 216 | 232 | CNLiveNetworking.setupShowDataResult(false) |
| 217 | 233 | CNLiveNetworking.setupDSRequest(true) |
| 234 | + let custom_param = NSMutableDictionary() | |
| 235 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 236 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 237 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 218 | 238 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjBUrl+"/api/v1/goodsInfo", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 219 | 239 | hiddenLoading() |
| 220 | 240 | if (error == nil) { |
| ... | ... | @@ -245,6 +265,10 @@ class CNLiveShopGoodListViewModel:NSObject{ |
| 245 | 265 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 246 | 266 | CNLiveNetworking.setupShowDataResult(false) |
| 247 | 267 | CNLiveNetworking.setupDSRequest(true) |
| 268 | + let custom_param = NSMutableDictionary() | |
| 269 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 270 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 271 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 248 | 272 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/goodsEditAttr", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 249 | 273 | hiddenLoading() |
| 250 | 274 | if (error == nil) { |
| ... | ... | @@ -267,6 +291,10 @@ class CNLiveShopGoodListViewModel:NSObject{ |
| 267 | 291 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 268 | 292 | CNLiveNetworking.setupShowDataResult(false) |
| 269 | 293 | CNLiveNetworking.setupDSRequest(true) |
| 294 | + let custom_param = NSMutableDictionary() | |
| 295 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 296 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 297 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 270 | 298 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/changeGoodsState", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 271 | 299 | hiddenLoading() |
| 272 | 300 | if (error == nil) { |
| ... | ... | @@ -289,6 +317,10 @@ class CNLiveShopGoodListViewModel:NSObject{ |
| 289 | 317 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 290 | 318 | CNLiveNetworking.setupShowDataResult(false) |
| 291 | 319 | CNLiveNetworking.setupDSRequest(true) |
| 320 | + let custom_param = NSMutableDictionary() | |
| 321 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 322 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 323 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 292 | 324 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjBUrl+"/api/v1/getGroup", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 293 | 325 | hiddenLoading() |
| 294 | 326 | if (error == nil) { |
| ... | ... | @@ -318,6 +350,10 @@ class CNLiveShopGoodListViewModel:NSObject{ |
| 318 | 350 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 319 | 351 | CNLiveNetworking.setupShowDataResult(false) |
| 320 | 352 | CNLiveNetworking.setupDSRequest(true) |
| 353 | + let custom_param = NSMutableDictionary() | |
| 354 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 355 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 356 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 321 | 357 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjBUrl+"/api/v1/cateList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 322 | 358 | hiddenLoading() |
| 323 | 359 | if (error == nil) { | ... | ... |
metaCode/Classes/Main/HomePage/ViewModel/ShopClassify/CNLiveShopClassilyViewModel.swift
| ... | ... | @@ -26,6 +26,11 @@ class CNLiveShopClassilyViewModel: BaseModel{ |
| 26 | 26 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 27 | 27 | CNLiveNetworking.setupShowDataResult(false) |
| 28 | 28 | CNLiveNetworking.setupDSRequest(true) |
| 29 | + let custom_param = NSMutableDictionary() | |
| 30 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 31 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 32 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 33 | + | |
| 29 | 34 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/addCate", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 30 | 35 | hiddenLoading() |
| 31 | 36 | if (error == nil) { |
| ... | ... | @@ -46,6 +51,11 @@ class CNLiveShopClassilyViewModel: BaseModel{ |
| 46 | 51 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 47 | 52 | CNLiveNetworking.setupShowDataResult(false) |
| 48 | 53 | CNLiveNetworking.setupDSRequest(true) |
| 54 | + let custom_param = NSMutableDictionary() | |
| 55 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 56 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 57 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 58 | + | |
| 49 | 59 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjBUrl+"/api/v1/cateList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 50 | 60 | hiddenLoading() |
| 51 | 61 | if (error == nil) { |
| ... | ... | @@ -74,6 +84,11 @@ class CNLiveShopClassilyViewModel: BaseModel{ |
| 74 | 84 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 75 | 85 | CNLiveNetworking.setupShowDataResult(false) |
| 76 | 86 | CNLiveNetworking.setupDSRequest(true) |
| 87 | + let custom_param = NSMutableDictionary() | |
| 88 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 89 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 90 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 91 | + | |
| 77 | 92 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/editCate", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 78 | 93 | hiddenLoading() |
| 79 | 94 | if (error == nil) { |
| ... | ... | @@ -94,6 +109,11 @@ class CNLiveShopClassilyViewModel: BaseModel{ |
| 94 | 109 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 95 | 110 | CNLiveNetworking.setupShowDataResult(false) |
| 96 | 111 | CNLiveNetworking.setupDSRequest(true) |
| 112 | + let custom_param = NSMutableDictionary() | |
| 113 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 114 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 115 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 116 | + | |
| 97 | 117 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/delCate", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 98 | 118 | hiddenLoading() |
| 99 | 119 | if (error == nil) { | ... | ... |
metaCode/Classes/Main/HomePage/ViewModel/ShopCoupon/CNLiveShopCouponViewModel.swift
| ... | ... | @@ -129,7 +129,11 @@ class CNLiveShopCouponViewModel:NSObject{ |
| 129 | 129 | param.setValue(receiveNum, forKey: "receive_number") |
| 130 | 130 | param.setValue(totalNum, forKey: "num") |
| 131 | 131 | param.setValue(goodsId, forKey: "goods_id") |
| 132 | - | |
| 132 | + let custom_param = NSMutableDictionary() | |
| 133 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 134 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 135 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 136 | + | |
| 133 | 137 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 134 | 138 | CNLiveNetworking.setupShowDataResult(false) |
| 135 | 139 | CNLiveNetworking.setupDSRequest(true) |
| ... | ... | @@ -150,6 +154,11 @@ class CNLiveShopCouponViewModel:NSObject{ |
| 150 | 154 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 151 | 155 | CNLiveNetworking.setupShowDataResult(false) |
| 152 | 156 | CNLiveNetworking.setupDSRequest(true) |
| 157 | + let custom_param = NSMutableDictionary() | |
| 158 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 159 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 160 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 161 | + | |
| 153 | 162 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjBUrl+"/api/v1/shopCouponList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 154 | 163 | hiddenLoading() |
| 155 | 164 | if (error == nil) { |
| ... | ... | @@ -170,6 +179,11 @@ class CNLiveShopCouponViewModel:NSObject{ |
| 170 | 179 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 171 | 180 | CNLiveNetworking.setupShowDataResult(false) |
| 172 | 181 | CNLiveNetworking.setupDSRequest(true) |
| 182 | + let custom_param = NSMutableDictionary() | |
| 183 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 184 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 185 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 186 | + | |
| 173 | 187 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/editCouponAttr", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 174 | 188 | hiddenLoading() |
| 175 | 189 | if (error == nil) { |
| ... | ... | @@ -207,6 +221,11 @@ class CNLiveShopCouponViewModel:NSObject{ |
| 207 | 221 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 208 | 222 | CNLiveNetworking.setupShowDataResult(false) |
| 209 | 223 | CNLiveNetworking.setupDSRequest(true) |
| 224 | + let custom_param = NSMutableDictionary() | |
| 225 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 226 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 227 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 228 | + | |
| 210 | 229 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/editCoupon", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 211 | 230 | hiddenLoading() |
| 212 | 231 | if (error == nil) { |
| ... | ... | @@ -230,6 +249,11 @@ class CNLiveShopCouponViewModel:NSObject{ |
| 230 | 249 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 231 | 250 | CNLiveNetworking.setupShowDataResult(false) |
| 232 | 251 | CNLiveNetworking.setupDSRequest(true) |
| 252 | + let custom_param = NSMutableDictionary() | |
| 253 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 254 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 255 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 256 | + | |
| 233 | 257 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/delCoupon", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 234 | 258 | hiddenLoading() |
| 235 | 259 | if (error == nil) { | ... | ... |
metaCode/Classes/Main/HomePages/Controller/AuthController/CNLiveAuthViewController.swift
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | // |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | - | |
| 9 | +import MJRefresh | |
| 10 | 10 | class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITableViewDataSource{ |
| 11 | 11 | |
| 12 | 12 | //下滑tableview背景颜色 |
| ... | ... | @@ -62,9 +62,9 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 62 | 62 | override func viewDidLoad() { |
| 63 | 63 | super.viewDidLoad() |
| 64 | 64 | self.view.backgroundColor = .white |
| 65 | -// self.view.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) | |
| 66 | 65 | view.addSubview(tableView) |
| 67 | 66 | tableView.frame = CGRect(x: 0, y: KStatusBarHeight, width: KSreenWidth, height: KSreenHeight-DownSlideBottomViewHeight-KStatusBarHeight) |
| 67 | + self.addRefreshView() | |
| 68 | 68 | self.getHomePageConfigListApi() |
| 69 | 69 | } |
| 70 | 70 | |
| ... | ... | @@ -282,6 +282,11 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 282 | 282 | return 0 |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | + func addRefreshView() { | |
| 286 | + tableView.mj_header = MJRefreshNormalHeader.init(refreshingBlock: {[weak self] in | |
| 287 | + self!.getHomePageConfigListApi() | |
| 288 | + }) | |
| 289 | + } | |
| 285 | 290 | //MARK: - 获取首页配置 |
| 286 | 291 | func getHomePageConfigListApi(){ |
| 287 | 292 | CNLiveHomePageViewModel.requestGetHomePageConfigList{ result, status in |
| ... | ... | @@ -317,6 +322,7 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 317 | 322 | //隐藏在追短剧cell |
| 318 | 323 | self.isHaveDuanJU = false |
| 319 | 324 | } |
| 325 | + self.tableView.mj_header?.endRefreshing() | |
| 320 | 326 | self.tableView.reloadData() |
| 321 | 327 | |
| 322 | 328 | }else{ |
| ... | ... | @@ -343,7 +349,7 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 343 | 349 | } |
| 344 | 350 | } |
| 345 | 351 | self.dataArray.addObjects(from: newDataArray as! [Any]) |
| 346 | - | |
| 352 | + self.tableView.mj_header?.endRefreshing() | |
| 347 | 353 | self.tableView.reloadData() |
| 348 | 354 | }else if (status == .failed){ |
| 349 | 355 | // self.NetApiStatus = .apiError | ... | ... |
metaCode/Classes/Main/HomePages/ViewModel/CNLiveHomePageViewModel.swift
| ... | ... | @@ -15,6 +15,10 @@ class CNLiveHomePageViewModel:NSObject{ |
| 15 | 15 | let param = NSMutableDictionary() |
| 16 | 16 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 17 | 17 | CNLiveNetworking.setupShowDataResult(false) |
| 18 | + let custom_param = NSMutableDictionary() | |
| 19 | + custom_param.setValue(APPId, forKey: "appId") | |
| 20 | + custom_param.setValue(APPKey, forKey: "appKey") | |
| 21 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 18 | 22 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseMCUrl+"/commonApi/homePageConfigList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 19 | 23 | hiddenLoading() |
| 20 | 24 | if (error == nil) { |
| ... | ... | @@ -41,6 +45,10 @@ class CNLiveHomePageViewModel:NSObject{ |
| 41 | 45 | |
| 42 | 46 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 43 | 47 | CNLiveNetworking.setupShowDataResult(false) |
| 48 | + let custom_param = NSMutableDictionary() | |
| 49 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 50 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 51 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 44 | 52 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseCMSUrl+"/contentApi/albumCollect", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 45 | 53 | hiddenLoading() |
| 46 | 54 | if (error == nil) { |
| ... | ... | @@ -61,9 +69,12 @@ class CNLiveHomePageViewModel:NSObject{ |
| 61 | 69 | let param = NSMutableDictionary() |
| 62 | 70 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") |
| 63 | 71 | param.setValue("\(page)", forKey: "page") |
| 64 | - | |
| 65 | 72 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 66 | 73 | CNLiveNetworking.setupShowDataResult(false) |
| 74 | + let custom_param = NSMutableDictionary() | |
| 75 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 76 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 77 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 67 | 78 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseCMSUrl+"/contentApi/myAlbum", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 68 | 79 | hiddenLoading() |
| 69 | 80 | if (error == nil) { |
| ... | ... | @@ -98,6 +109,10 @@ class CNLiveHomePageViewModel:NSObject{ |
| 98 | 109 | // param.setValue("10", forKey: "pageSize") |
| 99 | 110 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 100 | 111 | CNLiveNetworking.setupShowDataResult(false) |
| 112 | + let custom_param = NSMutableDictionary() | |
| 113 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 114 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 115 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 101 | 116 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseCMSUrl+"/contentApi/getBlockContents", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 102 | 117 | hiddenLoading() |
| 103 | 118 | if (error == nil) { |
| ... | ... | @@ -122,6 +137,11 @@ class CNLiveHomePageViewModel:NSObject{ |
| 122 | 137 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") |
| 123 | 138 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 124 | 139 | CNLiveNetworking.setupShowDataResult(false) |
| 140 | + let custom_param = NSMutableDictionary() | |
| 141 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 142 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 143 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 144 | + | |
| 125 | 145 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseCMSUrl+"/contentApi/getAlbumMsg", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 126 | 146 | hiddenLoading() |
| 127 | 147 | if (error == nil) { |
| ... | ... | @@ -149,6 +169,11 @@ class CNLiveHomePageViewModel:NSObject{ |
| 149 | 169 | |
| 150 | 170 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 151 | 171 | CNLiveNetworking.setupShowDataResult(false) |
| 172 | + let custom_param = NSMutableDictionary() | |
| 173 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 174 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 175 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 176 | + | |
| 152 | 177 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseCMSUrl+"/ugcApi/albumList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 153 | 178 | hiddenLoading() |
| 154 | 179 | if (error == nil) { |
| ... | ... | @@ -159,15 +184,6 @@ class CNLiveHomePageViewModel:NSObject{ |
| 159 | 184 | let dataMdl = newDictionaryToModel(dataDic , CNLiveAlbumListBaseModel.self) |
| 160 | 185 | resultBlock(dataMdl,.success) |
| 161 | 186 | |
| 162 | -// let dataDic = resp["data"] as! Dictionary<String, Any> | |
| 163 | -// let dataList = dataDic["list"] as! Array<Any> | |
| 164 | -// var listArr = Array<Any>() | |
| 165 | -// for listDic in dataList{ | |
| 166 | -// let dataMdl = newDictionaryToModel(listDic as! [String : Any], CNLiveAlbumListModel.self) | |
| 167 | -// listArr.append(dataMdl) | |
| 168 | -// } | |
| 169 | -// | |
| 170 | -// resultBlock(listArr,.success) | |
| 171 | 187 | }else{ |
| 172 | 188 | resultBlock(NSNull(),.failed) |
| 173 | 189 | } |
| ... | ... | @@ -183,13 +199,13 @@ class CNLiveHomePageViewModel:NSObject{ |
| 183 | 199 | param.setValue(prdId, forKey: "prdId") |
| 184 | 200 | param.setValue("apple", forKey: "frmId") |
| 185 | 201 | param.setValue(CNLiveHomePageViewModel.getRandomOrderId(), forKey: "srvOrderId") |
| 186 | - let customParam = NSMutableDictionary() | |
| 187 | - customParam.setValue(APPId, forKey: "appId") | |
| 188 | - customParam.setValue(APPKey, forKey: "appKey") | |
| 189 | 202 | |
| 190 | 203 | CNLiveNetworking.setupShowResult(true) |
| 191 | 204 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 192 | 205 | CNLiveNetworking.setupShowDataResult(false) |
| 206 | + let customParam = NSMutableDictionary() | |
| 207 | + customParam.setValue(APPId, forKey: "appId") | |
| 208 | + customParam.setValue(APPKey, forKey: "appKey") | |
| 193 | 209 | CNLiveNetworking.setupCustomParam(customParam as? [String : String]) |
| 194 | 210 | CNLiveNetworking.requestNetwork(with: .POST, urlString: "\(CNLiveEnvironmentManager.shared.img_token_url)/pom/orderVideoByPoint", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 195 | 211 | hiddenLoading() | ... | ... |
metaCode/Classes/Main/Util/CNLiveCommonManager.swift
| ... | ... | @@ -35,6 +35,10 @@ class CNLiveCommonManager: NSObject{ |
| 35 | 35 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 36 | 36 | CNLiveNetworking.setupShowDataResult(false) |
| 37 | 37 | CNLiveNetworking.setupDSRequest(true) |
| 38 | + let custom_param = NSMutableDictionary() | |
| 39 | + custom_param.setValue(APPId_wjj, forKey: "appId") | |
| 40 | + custom_param.setValue(APPKey_wjj, forKey: "appKey") | |
| 41 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 38 | 42 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjBUrl+"/Api/Index3/get_time", param: nil, cacheType: .networkOnly) { task, result, error in |
| 39 | 43 | if error == nil{ |
| 40 | 44 | let res = (result as! NSDictionary) | ... | ... |