Commit 3e63dbf4a81ab6254db8166ba901cfa7970f5eda
Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode
Showing
3 changed files
with
36 additions
and
37 deletions
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
| @@ -668,8 +668,8 @@ class CNLiveMineViewModel: NSObject { | @@ -668,8 +668,8 @@ class CNLiveMineViewModel: NSObject { | ||
| 668 | let param = NSMutableDictionary() | 668 | let param = NSMutableDictionary() |
| 669 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "uid") | 669 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "uid") |
| 670 | let custom_param = NSMutableDictionary() | 670 | let custom_param = NSMutableDictionary() |
| 671 | - custom_param.setValue(APPId_wjj, forKey: "appId") | ||
| 672 | - custom_param.setValue(APPKey_wjj, forKey: "appKey") | 671 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 672 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 673 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 673 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 674 | CNLiveNetworking.setupShowDataResult(false) | 674 | CNLiveNetworking.setupShowDataResult(false) |
| 675 | CNLiveNetworking.setupDSRequest(true) | 675 | CNLiveNetworking.setupDSRequest(true) |
| @@ -720,11 +720,11 @@ class CNLiveMineViewModel: NSObject { | @@ -720,11 +720,11 @@ class CNLiveMineViewModel: NSObject { | ||
| 720 | let param = NSMutableDictionary() | 720 | let param = NSMutableDictionary() |
| 721 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") | 721 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") |
| 722 | let custom_param = NSMutableDictionary() | 722 | let custom_param = NSMutableDictionary() |
| 723 | - custom_param.setValue(APPId_wjj, forKey: "appId") | ||
| 724 | - custom_param.setValue(APPKey_wjj, forKey: "appKey") | 723 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 724 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 725 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 725 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 726 | CNLiveNetworking.setupShowDataResult(false) | 726 | CNLiveNetworking.setupShowDataResult(false) |
| 727 | - CNLiveNetworking.setupSignRequestKey(APPKey_wjj) | 727 | + CNLiveNetworking.setupSignRequestKey(CNLiveEnvironmentManager.shared.appKey_wjj) |
| 728 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | 728 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 729 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjUrl+"/Daren/integral/getTasks.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in | 729 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjUrl+"/Daren/integral/getTasks.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in |
| 730 | hiddenLoading() | 730 | hiddenLoading() |
| @@ -774,11 +774,11 @@ class CNLiveMineViewModel: NSObject { | @@ -774,11 +774,11 @@ class CNLiveMineViewModel: NSObject { | ||
| 774 | param.setValue("10", forKey: "pageSize") | 774 | param.setValue("10", forKey: "pageSize") |
| 775 | param.setValue("\(page)", forKey: "pageNo") | 775 | param.setValue("\(page)", forKey: "pageNo") |
| 776 | let custom_param = NSMutableDictionary() | 776 | let custom_param = NSMutableDictionary() |
| 777 | - custom_param.setValue(APPId_wjj, forKey: "appId") | ||
| 778 | - custom_param.setValue(APPKey_wjj, forKey: "appKey") | 777 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 778 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 779 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 779 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 780 | CNLiveNetworking.setupShowDataResult(false) | 780 | CNLiveNetworking.setupShowDataResult(false) |
| 781 | - CNLiveNetworking.setupSignRequestKey(APPKey_wjj) | 781 | + CNLiveNetworking.setupSignRequestKey(CNLiveEnvironmentManager.shared.appKey_wjj) |
| 782 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | 782 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 783 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjUrl+"/Daren/transaction/getTransactionRecord.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in | 783 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjUrl+"/Daren/transaction/getTransactionRecord.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in |
| 784 | hiddenLoading() | 784 | hiddenLoading() |
| @@ -819,11 +819,11 @@ class CNLiveMineViewModel: NSObject { | @@ -819,11 +819,11 @@ class CNLiveMineViewModel: NSObject { | ||
| 819 | param.setValue("10", forKey: "pageSize") | 819 | param.setValue("10", forKey: "pageSize") |
| 820 | param.setValue("\(page)", forKey: "pageNo") | 820 | param.setValue("\(page)", forKey: "pageNo") |
| 821 | let custom_param = NSMutableDictionary() | 821 | let custom_param = NSMutableDictionary() |
| 822 | - custom_param.setValue(APPId_wjj, forKey: "appId") | ||
| 823 | - custom_param.setValue(APPKey_wjj, forKey: "appKey") | 822 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 823 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 824 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 824 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 825 | CNLiveNetworking.setupShowDataResult(false) | 825 | CNLiveNetworking.setupShowDataResult(false) |
| 826 | - CNLiveNetworking.setupSignRequestKey(APPKey_wjj) | 826 | + CNLiveNetworking.setupSignRequestKey(CNLiveEnvironmentManager.shared.appKey_wjj) |
| 827 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | 827 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 828 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjUrl+"/Daren/integral/myIntegralRecord.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in | 828 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjUrl+"/Daren/integral/myIntegralRecord.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in |
| 829 | hiddenLoading() | 829 | hiddenLoading() |
| @@ -856,11 +856,11 @@ class CNLiveMineViewModel: NSObject { | @@ -856,11 +856,11 @@ class CNLiveMineViewModel: NSObject { | ||
| 856 | let param = NSMutableDictionary() | 856 | let param = NSMutableDictionary() |
| 857 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") | 857 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") |
| 858 | let custom_param = NSMutableDictionary() | 858 | let custom_param = NSMutableDictionary() |
| 859 | - custom_param.setValue(APPId_wjj, forKey: "appId") | ||
| 860 | - custom_param.setValue(APPKey_wjj, forKey: "appKey") | 859 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 860 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 861 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 861 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 862 | CNLiveNetworking.setupShowDataResult(false) | 862 | CNLiveNetworking.setupShowDataResult(false) |
| 863 | - CNLiveNetworking.setupSignRequestKey(APPKey_wjj) | 863 | + CNLiveNetworking.setupSignRequestKey(CNLiveEnvironmentManager.shared.appKey_wjj) |
| 864 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | 864 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 865 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjUrl+"/Daren/integral/checkIn.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in | 865 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjUrl+"/Daren/integral/checkIn.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in |
| 866 | hiddenLoading() | 866 | hiddenLoading() |
| @@ -891,8 +891,8 @@ class CNLiveMineViewModel: NSObject { | @@ -891,8 +891,8 @@ class CNLiveMineViewModel: NSObject { | ||
| 891 | let param = NSMutableDictionary() | 891 | let param = NSMutableDictionary() |
| 892 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "uid") | 892 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "uid") |
| 893 | let custom_param = NSMutableDictionary() | 893 | let custom_param = NSMutableDictionary() |
| 894 | - custom_param.setValue(APPId_wjj, forKey: "appId") | ||
| 895 | - custom_param.setValue(APPKey_wjj, forKey: "appKey") | 894 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 895 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 896 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 896 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 897 | CNLiveNetworking.setupShowDataResult(false) | 897 | CNLiveNetworking.setupShowDataResult(false) |
| 898 | CNLiveNetworking.setupDSRequest(true) | 898 | CNLiveNetworking.setupDSRequest(true) |
| @@ -927,8 +927,8 @@ class CNLiveMineViewModel: NSObject { | @@ -927,8 +927,8 @@ class CNLiveMineViewModel: NSObject { | ||
| 927 | /// - resultBlock: 返回 | 927 | /// - resultBlock: 返回 |
| 928 | static func requestApplyShopUserInAction(paramDict: NSDictionary,resultBlock: @escaping resultNewsBlock) { | 928 | static func requestApplyShopUserInAction(paramDict: NSDictionary,resultBlock: @escaping resultNewsBlock) { |
| 929 | let custom_param = NSMutableDictionary() | 929 | let custom_param = NSMutableDictionary() |
| 930 | - custom_param.setValue(APPId_wjj, forKey: "appId") | ||
| 931 | - custom_param.setValue(APPKey_wjj, forKey: "appKey") | 930 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 931 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 932 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 932 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 933 | CNLiveNetworking.setupShowDataResult(false) | 933 | CNLiveNetworking.setupShowDataResult(false) |
| 934 | CNLiveNetworking.setupDSRequest(true) | 934 | CNLiveNetworking.setupDSRequest(true) |
| @@ -962,8 +962,8 @@ class CNLiveMineViewModel: NSObject { | @@ -962,8 +962,8 @@ class CNLiveMineViewModel: NSObject { | ||
| 962 | let param = NSMutableDictionary() | 962 | let param = NSMutableDictionary() |
| 963 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "uid") | 963 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "uid") |
| 964 | let custom_param = NSMutableDictionary() | 964 | let custom_param = NSMutableDictionary() |
| 965 | - custom_param.setValue(APPId_wjj, forKey: "appId") | ||
| 966 | - custom_param.setValue(APPKey_wjj, forKey: "appKey") | 965 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 966 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 967 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 967 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 968 | CNLiveNetworking.setupShowDataResult(false) | 968 | CNLiveNetworking.setupShowDataResult(false) |
| 969 | CNLiveNetworking.setupDSRequest(true) | 969 | CNLiveNetworking.setupDSRequest(true) |
| @@ -998,8 +998,8 @@ class CNLiveMineViewModel: NSObject { | @@ -998,8 +998,8 @@ class CNLiveMineViewModel: NSObject { | ||
| 998 | let param = NSMutableDictionary() | 998 | let param = NSMutableDictionary() |
| 999 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "loginSid") | 999 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "loginSid") |
| 1000 | let custom_param = NSMutableDictionary() | 1000 | let custom_param = NSMutableDictionary() |
| 1001 | - custom_param.setValue(APPId_wjj, forKey: "appId") | ||
| 1002 | - custom_param.setValue(APPKey_wjj, forKey: "appKey") | 1001 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 1002 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 1003 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 1003 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 1004 | CNLiveNetworking.setupShowDataResult(false) | 1004 | CNLiveNetworking.setupShowDataResult(false) |
| 1005 | CNLiveNetworking.setupSignRequestKey(APPKey_wjj) | 1005 | CNLiveNetworking.setupSignRequestKey(APPKey_wjj) |
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoCommentListView.swift
| @@ -129,16 +129,17 @@ class CNLiveShortVideoCommentListView: UIView, UITableViewDelegate, UITableViewD | @@ -129,16 +129,17 @@ class CNLiveShortVideoCommentListView: UIView, UITableViewDelegate, UITableViewD | ||
| 129 | self.tableView.mj_footer?.endRefreshing() | 129 | self.tableView.mj_footer?.endRefreshing() |
| 130 | } | 130 | } |
| 131 | self.tableView.mj_header?.endRefreshing() | 131 | self.tableView.mj_header?.endRefreshing() |
| 132 | - self.tableView.reloadData() | 132 | + |
| 133 | + if self.tableView.mj_footer == nil { | ||
| 134 | + self.tableView.mj_footer = footerRefreshView | ||
| 135 | + } | ||
| 133 | let hasNextPage = (result as! ShortVideoHomeCommentModel).hasNext! | 136 | let hasNextPage = (result as! ShortVideoHomeCommentModel).hasNext! |
| 134 | if !hasNextPage { | 137 | if !hasNextPage { |
| 135 | self.tableView.mj_footer?.endRefreshingWithNoMoreData() | 138 | self.tableView.mj_footer?.endRefreshingWithNoMoreData() |
| 136 | - self.tableView.reloadData() | ||
| 137 | - } else { | ||
| 138 | - if self.tableView.mj_footer == nil { | ||
| 139 | - self.tableView.mj_footer = footerRefreshView | ||
| 140 | - } | ||
| 141 | } | 139 | } |
| 140 | + self.tableView.beginUpdates() | ||
| 141 | + self.tableView.reloadSections(IndexSet(integer: 0), with: .fade) | ||
| 142 | + self.tableView.endUpdates() | ||
| 142 | } else { | 143 | } else { |
| 143 | if self.tableView.mj_footer != nil { | 144 | if self.tableView.mj_footer != nil { |
| 144 | self.tableView.mj_footer?.endRefreshing() | 145 | self.tableView.mj_footer?.endRefreshing() |
| @@ -174,8 +175,7 @@ class CNLiveShortVideoCommentListView: UIView, UITableViewDelegate, UITableViewD | @@ -174,8 +175,7 @@ class CNLiveShortVideoCommentListView: UIView, UITableViewDelegate, UITableViewD | ||
| 174 | 175 | ||
| 175 | videoId = pid | 176 | videoId = pid |
| 176 | contentSid = toSid | 177 | contentSid = toSid |
| 177 | - addRefreshView() | ||
| 178 | - requestDataSource() | 178 | +// requestDataSource() |
| 179 | addSubview(grayMaskView) | 179 | addSubview(grayMaskView) |
| 180 | grayMaskView.snp.makeConstraints { make in | 180 | grayMaskView.snp.makeConstraints { make in |
| 181 | make.edges.equalToSuperview() | 181 | make.edges.equalToSuperview() |
| @@ -223,6 +223,8 @@ class CNLiveShortVideoCommentListView: UIView, UITableViewDelegate, UITableViewD | @@ -223,6 +223,8 @@ class CNLiveShortVideoCommentListView: UIView, UITableViewDelegate, UITableViewD | ||
| 223 | make.top.equalTo(lineLabel.snp.bottom) | 223 | make.top.equalTo(lineLabel.snp.bottom) |
| 224 | make.bottom.equalTo(sendButton.snp.top).offset(-5) | 224 | make.bottom.equalTo(sendButton.snp.top).offset(-5) |
| 225 | } | 225 | } |
| 226 | + addRefreshView() | ||
| 227 | + self.tableView.mj_header?.beginRefreshing() | ||
| 226 | } | 228 | } |
| 227 | 229 | ||
| 228 | required init?(coder: NSCoder) { | 230 | required init?(coder: NSCoder) { |
metaCode/Classes/Main/VideoPage/ViewModel/CNLiveShortVideoViewModel.swift
| @@ -11,9 +11,6 @@ import QMUIKit | @@ -11,9 +11,6 @@ import QMUIKit | ||
| 11 | typealias resultShortVideoBlock = (_ result: Any,_ respStatue :CNLiveMineResponseType) -> Void | 11 | typealias resultShortVideoBlock = (_ result: Any,_ respStatue :CNLiveMineResponseType) -> Void |
| 12 | class CNLiveShortVideoViewModel: NSObject { | 12 | class CNLiveShortVideoViewModel: NSObject { |
| 13 | 13 | ||
| 14 | - static let appId_c : String = APPId_wjj | ||
| 15 | - static let appKey_c : String = APPKey_wjj | ||
| 16 | - | ||
| 17 | /// 获取短视频数据 | 14 | /// 获取短视频数据 |
| 18 | /// - Parameters: | 15 | /// - Parameters: |
| 19 | /// - aid: 专辑 id | 16 | /// - aid: 专辑 id |
| @@ -26,8 +23,8 @@ class CNLiveShortVideoViewModel: NSObject { | @@ -26,8 +23,8 @@ class CNLiveShortVideoViewModel: NSObject { | ||
| 26 | param.setValue("10", forKey: "pageSize") | 23 | param.setValue("10", forKey: "pageSize") |
| 27 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") | 24 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") |
| 28 | let custom_param = NSMutableDictionary() | 25 | let custom_param = NSMutableDictionary() |
| 29 | - custom_param.setValue(appId_c, forKey: "appId") | ||
| 30 | - custom_param.setValue(appKey_c, forKey: "appKey") | 26 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 27 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 31 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 28 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 32 | CNLiveNetworking.setupShowDataResult(false) | 29 | CNLiveNetworking.setupShowDataResult(false) |
| 33 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | 30 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| @@ -92,8 +89,8 @@ class CNLiveShortVideoViewModel: NSObject { | @@ -92,8 +89,8 @@ class CNLiveShortVideoViewModel: NSObject { | ||
| 92 | param.setValue(aid, forKey: "aid") | 89 | param.setValue(aid, forKey: "aid") |
| 93 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") | 90 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") |
| 94 | let custom_param = NSMutableDictionary() | 91 | let custom_param = NSMutableDictionary() |
| 95 | - custom_param.setValue( appId_c, forKey: "appId") | ||
| 96 | - custom_param.setValue(appKey_c, forKey: "appKey") | 92 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId_wjj, forKey: "appId") |
| 93 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey_wjj, forKey: "appKey") | ||
| 97 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 94 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 98 | CNLiveNetworking.setupShowDataResult(false) | 95 | CNLiveNetworking.setupShowDataResult(false) |
| 99 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | 96 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |