Commit 81737d082b003f4c6ea1319a01d2533bb73ac34b
1 parent
b930da17
更改相关 key
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 | 668 | let param = NSMutableDictionary() |
| 669 | 669 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "uid") |
| 670 | 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 | 673 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 674 | 674 | CNLiveNetworking.setupShowDataResult(false) |
| 675 | 675 | CNLiveNetworking.setupDSRequest(true) |
| ... | ... | @@ -720,11 +720,11 @@ class CNLiveMineViewModel: NSObject { |
| 720 | 720 | let param = NSMutableDictionary() |
| 721 | 721 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") |
| 722 | 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 | 725 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 726 | 726 | CNLiveNetworking.setupShowDataResult(false) |
| 727 | - CNLiveNetworking.setupSignRequestKey(APPKey_wjj) | |
| 727 | + CNLiveNetworking.setupSignRequestKey(CNLiveEnvironmentManager.shared.appKey_wjj) | |
| 728 | 728 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 729 | 729 | CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjUrl+"/Daren/integral/getTasks.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in |
| 730 | 730 | hiddenLoading() |
| ... | ... | @@ -774,11 +774,11 @@ class CNLiveMineViewModel: NSObject { |
| 774 | 774 | param.setValue("10", forKey: "pageSize") |
| 775 | 775 | param.setValue("\(page)", forKey: "pageNo") |
| 776 | 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 | 779 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 780 | 780 | CNLiveNetworking.setupShowDataResult(false) |
| 781 | - CNLiveNetworking.setupSignRequestKey(APPKey_wjj) | |
| 781 | + CNLiveNetworking.setupSignRequestKey(CNLiveEnvironmentManager.shared.appKey_wjj) | |
| 782 | 782 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 783 | 783 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjUrl+"/Daren/transaction/getTransactionRecord.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in |
| 784 | 784 | hiddenLoading() |
| ... | ... | @@ -819,11 +819,11 @@ class CNLiveMineViewModel: NSObject { |
| 819 | 819 | param.setValue("10", forKey: "pageSize") |
| 820 | 820 | param.setValue("\(page)", forKey: "pageNo") |
| 821 | 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 | 824 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 825 | 825 | CNLiveNetworking.setupShowDataResult(false) |
| 826 | - CNLiveNetworking.setupSignRequestKey(APPKey_wjj) | |
| 826 | + CNLiveNetworking.setupSignRequestKey(CNLiveEnvironmentManager.shared.appKey_wjj) | |
| 827 | 827 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 828 | 828 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjUrl+"/Daren/integral/myIntegralRecord.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in |
| 829 | 829 | hiddenLoading() |
| ... | ... | @@ -856,11 +856,11 @@ class CNLiveMineViewModel: NSObject { |
| 856 | 856 | let param = NSMutableDictionary() |
| 857 | 857 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") |
| 858 | 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 | 861 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 862 | 862 | CNLiveNetworking.setupShowDataResult(false) |
| 863 | - CNLiveNetworking.setupSignRequestKey(APPKey_wjj) | |
| 863 | + CNLiveNetworking.setupSignRequestKey(CNLiveEnvironmentManager.shared.appKey_wjj) | |
| 864 | 864 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 865 | 865 | CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjUrl+"/Daren/integral/checkIn.action", param: (param as! [AnyHashable : Any]), cacheType: .networkOnly) { task, result, error in |
| 866 | 866 | hiddenLoading() |
| ... | ... | @@ -891,8 +891,8 @@ class CNLiveMineViewModel: NSObject { |
| 891 | 891 | let param = NSMutableDictionary() |
| 892 | 892 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "uid") |
| 893 | 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 | 896 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 897 | 897 | CNLiveNetworking.setupShowDataResult(false) |
| 898 | 898 | CNLiveNetworking.setupDSRequest(true) |
| ... | ... | @@ -927,8 +927,8 @@ class CNLiveMineViewModel: NSObject { |
| 927 | 927 | /// - resultBlock: 返回 |
| 928 | 928 | static func requestApplyShopUserInAction(paramDict: NSDictionary,resultBlock: @escaping resultNewsBlock) { |
| 929 | 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 | 932 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 933 | 933 | CNLiveNetworking.setupShowDataResult(false) |
| 934 | 934 | CNLiveNetworking.setupDSRequest(true) |
| ... | ... | @@ -962,8 +962,8 @@ class CNLiveMineViewModel: NSObject { |
| 962 | 962 | let param = NSMutableDictionary() |
| 963 | 963 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "uid") |
| 964 | 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 | 967 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 968 | 968 | CNLiveNetworking.setupShowDataResult(false) |
| 969 | 969 | CNLiveNetworking.setupDSRequest(true) |
| ... | ... | @@ -998,8 +998,8 @@ class CNLiveMineViewModel: NSObject { |
| 998 | 998 | let param = NSMutableDictionary() |
| 999 | 999 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "loginSid") |
| 1000 | 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 | 1003 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 1004 | 1004 | CNLiveNetworking.setupShowDataResult(false) |
| 1005 | 1005 | CNLiveNetworking.setupSignRequestKey(APPKey_wjj) | ... | ... |
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoCommentListView.swift
| ... | ... | @@ -129,16 +129,17 @@ class CNLiveShortVideoCommentListView: UIView, UITableViewDelegate, UITableViewD |
| 129 | 129 | self.tableView.mj_footer?.endRefreshing() |
| 130 | 130 | } |
| 131 | 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 | 136 | let hasNextPage = (result as! ShortVideoHomeCommentModel).hasNext! |
| 134 | 137 | if !hasNextPage { |
| 135 | 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 | 143 | } else { |
| 143 | 144 | if self.tableView.mj_footer != nil { |
| 144 | 145 | self.tableView.mj_footer?.endRefreshing() |
| ... | ... | @@ -174,8 +175,7 @@ class CNLiveShortVideoCommentListView: UIView, UITableViewDelegate, UITableViewD |
| 174 | 175 | |
| 175 | 176 | videoId = pid |
| 176 | 177 | contentSid = toSid |
| 177 | - addRefreshView() | |
| 178 | - requestDataSource() | |
| 178 | +// requestDataSource() | |
| 179 | 179 | addSubview(grayMaskView) |
| 180 | 180 | grayMaskView.snp.makeConstraints { make in |
| 181 | 181 | make.edges.equalToSuperview() |
| ... | ... | @@ -223,6 +223,8 @@ class CNLiveShortVideoCommentListView: UIView, UITableViewDelegate, UITableViewD |
| 223 | 223 | make.top.equalTo(lineLabel.snp.bottom) |
| 224 | 224 | make.bottom.equalTo(sendButton.snp.top).offset(-5) |
| 225 | 225 | } |
| 226 | + addRefreshView() | |
| 227 | + self.tableView.mj_header?.beginRefreshing() | |
| 226 | 228 | } |
| 227 | 229 | |
| 228 | 230 | required init?(coder: NSCoder) { | ... | ... |
metaCode/Classes/Main/VideoPage/ViewModel/CNLiveShortVideoViewModel.swift
| ... | ... | @@ -11,9 +11,6 @@ import QMUIKit |
| 11 | 11 | typealias resultShortVideoBlock = (_ result: Any,_ respStatue :CNLiveMineResponseType) -> Void |
| 12 | 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 | 15 | /// - Parameters: |
| 19 | 16 | /// - aid: 专辑 id |
| ... | ... | @@ -26,8 +23,8 @@ class CNLiveShortVideoViewModel: NSObject { |
| 26 | 23 | param.setValue("10", forKey: "pageSize") |
| 27 | 24 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") |
| 28 | 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 | 28 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 32 | 29 | CNLiveNetworking.setupShowDataResult(false) |
| 33 | 30 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| ... | ... | @@ -92,8 +89,8 @@ class CNLiveShortVideoViewModel: NSObject { |
| 92 | 89 | param.setValue(aid, forKey: "aid") |
| 93 | 90 | param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") |
| 94 | 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 | 94 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 98 | 95 | CNLiveNetworking.setupShowDataResult(false) |
| 99 | 96 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | ... | ... |