Commit 4bfe3ea48d633080fadc96c38312c50204bbc56c
1 parent
aad74940
产品问题修改
Showing
24 changed files
with
364 additions
and
37 deletions
metaCode.xcodeproj/project.pbxproj
| @@ -178,6 +178,7 @@ | @@ -178,6 +178,7 @@ | ||
| 178 | 7978A8432A396632007C86B8 /* CNLiveMineViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7978A8422A396632007C86B8 /* CNLiveMineViewModel.swift */; }; | 178 | 7978A8432A396632007C86B8 /* CNLiveMineViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7978A8422A396632007C86B8 /* CNLiveMineViewModel.swift */; }; |
| 179 | 79803E272AD68D3100F05F68 /* CNLiveMineShopViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79803E262AD68D3100F05F68 /* CNLiveMineShopViewController.swift */; }; | 179 | 79803E272AD68D3100F05F68 /* CNLiveMineShopViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79803E262AD68D3100F05F68 /* CNLiveMineShopViewController.swift */; }; |
| 180 | 79803E292AD6991200F05F68 /* CNLiveMineInputMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79803E282AD6991200F05F68 /* CNLiveMineInputMessageView.swift */; }; | 180 | 79803E292AD6991200F05F68 /* CNLiveMineInputMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79803E282AD6991200F05F68 /* CNLiveMineInputMessageView.swift */; }; |
| 181 | + 79868B192B874294008E0F5C /* CNLiveSaveAuthStateDB.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79868B182B874293008E0F5C /* CNLiveSaveAuthStateDB.swift */; }; | ||
| 181 | 7987BF3D2A497644000A1ABC /* CNLiveMineQuestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7987BF3C2A497644000A1ABC /* CNLiveMineQuestViewController.swift */; }; | 182 | 7987BF3D2A497644000A1ABC /* CNLiveMineQuestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7987BF3C2A497644000A1ABC /* CNLiveMineQuestViewController.swift */; }; |
| 182 | 798916E92B04532D00D08302 /* CNLiveSavePointDB.swift in Sources */ = {isa = PBXBuildFile; fileRef = 798916E82B04532D00D08302 /* CNLiveSavePointDB.swift */; }; | 183 | 798916E92B04532D00D08302 /* CNLiveSavePointDB.swift in Sources */ = {isa = PBXBuildFile; fileRef = 798916E82B04532D00D08302 /* CNLiveSavePointDB.swift */; }; |
| 183 | 798916ED2B048E8200D08302 /* CNLiveShopTransViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 798916EC2B048E8200D08302 /* CNLiveShopTransViewController.swift */; }; | 184 | 798916ED2B048E8200D08302 /* CNLiveShopTransViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 798916EC2B048E8200D08302 /* CNLiveShopTransViewController.swift */; }; |
| @@ -441,6 +442,7 @@ | @@ -441,6 +442,7 @@ | ||
| 441 | 7978A8422A396632007C86B8 /* CNLiveMineViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineViewModel.swift; sourceTree = "<group>"; }; | 442 | 7978A8422A396632007C86B8 /* CNLiveMineViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineViewModel.swift; sourceTree = "<group>"; }; |
| 442 | 79803E262AD68D3100F05F68 /* CNLiveMineShopViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineShopViewController.swift; sourceTree = "<group>"; }; | 443 | 79803E262AD68D3100F05F68 /* CNLiveMineShopViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineShopViewController.swift; sourceTree = "<group>"; }; |
| 443 | 79803E282AD6991200F05F68 /* CNLiveMineInputMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineInputMessageView.swift; sourceTree = "<group>"; }; | 444 | 79803E282AD6991200F05F68 /* CNLiveMineInputMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineInputMessageView.swift; sourceTree = "<group>"; }; |
| 445 | + 79868B182B874293008E0F5C /* CNLiveSaveAuthStateDB.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CNLiveSaveAuthStateDB.swift; sourceTree = "<group>"; }; | ||
| 444 | 7987BF3C2A497644000A1ABC /* CNLiveMineQuestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineQuestViewController.swift; sourceTree = "<group>"; }; | 446 | 7987BF3C2A497644000A1ABC /* CNLiveMineQuestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineQuestViewController.swift; sourceTree = "<group>"; }; |
| 445 | 798916E82B04532D00D08302 /* CNLiveSavePointDB.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveSavePointDB.swift; sourceTree = "<group>"; }; | 447 | 798916E82B04532D00D08302 /* CNLiveSavePointDB.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveSavePointDB.swift; sourceTree = "<group>"; }; |
| 446 | 798916EC2B048E8200D08302 /* CNLiveShopTransViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopTransViewController.swift; sourceTree = "<group>"; }; | 448 | 798916EC2B048E8200D08302 /* CNLiveShopTransViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopTransViewController.swift; sourceTree = "<group>"; }; |
| @@ -1125,6 +1127,7 @@ | @@ -1125,6 +1127,7 @@ | ||
| 1125 | 79579CAA2AAAE905006E5B38 /* Database */ = { | 1127 | 79579CAA2AAAE905006E5B38 /* Database */ = { |
| 1126 | isa = PBXGroup; | 1128 | isa = PBXGroup; |
| 1127 | children = ( | 1129 | children = ( |
| 1130 | + 79868B182B874293008E0F5C /* CNLiveSaveAuthStateDB.swift */, | ||
| 1128 | 7C7C62F52A4D72E9007A912E /* CNLiveIdentityDB.swift */, | 1131 | 7C7C62F52A4D72E9007A912E /* CNLiveIdentityDB.swift */, |
| 1129 | 79BA085C2AB18E8300D01875 /* CNLiveSaveAuthDB.swift */, | 1132 | 79BA085C2AB18E8300D01875 /* CNLiveSaveAuthDB.swift */, |
| 1130 | 79EABB882AB4497700F3A4E2 /* CNLiveSaveStandDB.swift */, | 1133 | 79EABB882AB4497700F3A4E2 /* CNLiveSaveStandDB.swift */, |
| @@ -1883,6 +1886,7 @@ | @@ -1883,6 +1886,7 @@ | ||
| 1883 | 79A267832AF8D7BC0088D9F6 /* CNLiveShopBodyCustomView.swift in Sources */, | 1886 | 79A267832AF8D7BC0088D9F6 /* CNLiveShopBodyCustomView.swift in Sources */, |
| 1884 | 1917335E2B328495007BCC04 /* CNLiveCouponListTableViewCell.swift in Sources */, | 1887 | 1917335E2B328495007BCC04 /* CNLiveCouponListTableViewCell.swift in Sources */, |
| 1885 | 791C1C8C2AFB85F8003E6362 /* CNLiveShopBodyExpressView.swift in Sources */, | 1888 | 791C1C8C2AFB85F8003E6362 /* CNLiveShopBodyExpressView.swift in Sources */, |
| 1889 | + 79868B192B874294008E0F5C /* CNLiveSaveAuthStateDB.swift in Sources */, | ||
| 1886 | 790D019A2A2DCAE400C5978D /* CNLiveViewController.swift in Sources */, | 1890 | 790D019A2A2DCAE400C5978D /* CNLiveViewController.swift in Sources */, |
| 1887 | 191733192B10A05D007BCC04 /* CNLivePlayerProgressView.swift in Sources */, | 1891 | 191733192B10A05D007BCC04 /* CNLivePlayerProgressView.swift in Sources */, |
| 1888 | 79803E272AD68D3100F05F68 /* CNLiveMineShopViewController.swift in Sources */, | 1892 | 79803E272AD68D3100F05F68 /* CNLiveMineShopViewController.swift in Sources */, |
metaCode.xcodeproj/xcshareddata/xcschemes/metaCode.xcscheme
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<Scheme | ||
| 3 | + LastUpgradeVersion = "1430" | ||
| 4 | + version = "1.7"> | ||
| 5 | + <BuildAction | ||
| 6 | + parallelizeBuildables = "YES" | ||
| 7 | + buildImplicitDependencies = "YES"> | ||
| 8 | + <BuildActionEntries> | ||
| 9 | + <BuildActionEntry | ||
| 10 | + buildForTesting = "YES" | ||
| 11 | + buildForRunning = "YES" | ||
| 12 | + buildForProfiling = "YES" | ||
| 13 | + buildForArchiving = "YES" | ||
| 14 | + buildForAnalyzing = "YES"> | ||
| 15 | + <BuildableReference | ||
| 16 | + BuildableIdentifier = "primary" | ||
| 17 | + BlueprintIdentifier = "818163B72A25CFCC00579C86" | ||
| 18 | + BuildableName = "metaCode.app" | ||
| 19 | + BlueprintName = "metaCode" | ||
| 20 | + ReferencedContainer = "container:metaCode.xcodeproj"> | ||
| 21 | + </BuildableReference> | ||
| 22 | + </BuildActionEntry> | ||
| 23 | + </BuildActionEntries> | ||
| 24 | + </BuildAction> | ||
| 25 | + <TestAction | ||
| 26 | + buildConfiguration = "Debug" | ||
| 27 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| 28 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| 29 | + shouldUseLaunchSchemeArgsEnv = "YES" | ||
| 30 | + shouldAutocreateTestPlan = "YES"> | ||
| 31 | + <Testables> | ||
| 32 | + <TestableReference | ||
| 33 | + skipped = "NO"> | ||
| 34 | + <BuildableReference | ||
| 35 | + BuildableIdentifier = "primary" | ||
| 36 | + BlueprintIdentifier = "818163CD2A25CFCF00579C86" | ||
| 37 | + BuildableName = "metaCodeTests.xctest" | ||
| 38 | + BlueprintName = "metaCodeTests" | ||
| 39 | + ReferencedContainer = "container:metaCode.xcodeproj"> | ||
| 40 | + </BuildableReference> | ||
| 41 | + </TestableReference> | ||
| 42 | + <TestableReference | ||
| 43 | + skipped = "NO"> | ||
| 44 | + <BuildableReference | ||
| 45 | + BuildableIdentifier = "primary" | ||
| 46 | + BlueprintIdentifier = "818163D72A25CFCF00579C86" | ||
| 47 | + BuildableName = "metaCodeUITests.xctest" | ||
| 48 | + BlueprintName = "metaCodeUITests" | ||
| 49 | + ReferencedContainer = "container:metaCode.xcodeproj"> | ||
| 50 | + </BuildableReference> | ||
| 51 | + </TestableReference> | ||
| 52 | + </Testables> | ||
| 53 | + </TestAction> | ||
| 54 | + <LaunchAction | ||
| 55 | + buildConfiguration = "Debug" | ||
| 56 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| 57 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| 58 | + launchStyle = "0" | ||
| 59 | + useCustomWorkingDirectory = "NO" | ||
| 60 | + ignoresPersistentStateOnLaunch = "NO" | ||
| 61 | + debugDocumentVersioning = "YES" | ||
| 62 | + debugServiceExtension = "internal" | ||
| 63 | + allowLocationSimulation = "YES"> | ||
| 64 | + <BuildableProductRunnable | ||
| 65 | + runnableDebuggingMode = "0"> | ||
| 66 | + <BuildableReference | ||
| 67 | + BuildableIdentifier = "primary" | ||
| 68 | + BlueprintIdentifier = "818163B72A25CFCC00579C86" | ||
| 69 | + BuildableName = "metaCode.app" | ||
| 70 | + BlueprintName = "metaCode" | ||
| 71 | + ReferencedContainer = "container:metaCode.xcodeproj"> | ||
| 72 | + </BuildableReference> | ||
| 73 | + </BuildableProductRunnable> | ||
| 74 | + </LaunchAction> | ||
| 75 | + <ProfileAction | ||
| 76 | + buildConfiguration = "Debug" | ||
| 77 | + shouldUseLaunchSchemeArgsEnv = "YES" | ||
| 78 | + savedToolIdentifier = "" | ||
| 79 | + useCustomWorkingDirectory = "NO" | ||
| 80 | + debugDocumentVersioning = "YES"> | ||
| 81 | + <BuildableProductRunnable | ||
| 82 | + runnableDebuggingMode = "0"> | ||
| 83 | + <BuildableReference | ||
| 84 | + BuildableIdentifier = "primary" | ||
| 85 | + BlueprintIdentifier = "818163B72A25CFCC00579C86" | ||
| 86 | + BuildableName = "metaCode.app" | ||
| 87 | + BlueprintName = "metaCode" | ||
| 88 | + ReferencedContainer = "container:metaCode.xcodeproj"> | ||
| 89 | + </BuildableReference> | ||
| 90 | + </BuildableProductRunnable> | ||
| 91 | + </ProfileAction> | ||
| 92 | + <AnalyzeAction | ||
| 93 | + buildConfiguration = "Debug"> | ||
| 94 | + </AnalyzeAction> | ||
| 95 | + <ArchiveAction | ||
| 96 | + buildConfiguration = "Release" | ||
| 97 | + revealArchiveInOrganizer = "YES"> | ||
| 98 | + </ArchiveAction> | ||
| 99 | +</Scheme> |
metaCode/Classes/Config/CNLiveConfigUserInfo.swift
| @@ -241,14 +241,24 @@ class StandSortManager: NSObject { | @@ -241,14 +241,24 @@ class StandSortManager: NSObject { | ||
| 241 | if have_id_auths.count == 0 { | 241 | if have_id_auths.count == 0 { |
| 242 | //1.29 需求 如果第一次的时候没有进行排序,则把已经认证的放在第一位 | 242 | //1.29 需求 如果第一次的时候没有进行排序,则把已经认证的放在第一位 |
| 243 | let tempArray = NSMutableArray() | 243 | let tempArray = NSMutableArray() |
| 244 | - for item in stands.reverseObjectEnumerator().allObjects { | 244 | + var haveArray = Array<Any>() |
| 245 | + for item in stands { | ||
| 245 | let listModel = item as! StandListModel | 246 | let listModel = item as! StandListModel |
| 246 | if listModel.auth { | 247 | if listModel.auth { |
| 247 | - tempArray.insert(listModel, at: 0) | 248 | + //2.21 需求把已经认证的第一次展示的时候再通过认证的时间先后顺序进行排序 |
| 249 | +// tempArray.insert(listModel, at: 0) | ||
| 250 | + haveArray.append(listModel) | ||
| 248 | } else { | 251 | } else { |
| 252 | + //2.21 需求把未进行认证的第一次展示的时候根据后台返回的排序顺序进行排序,如果用户在进行了排序,则按照用户的排序为主 | ||
| 249 | tempArray.add(listModel) | 253 | tempArray.add(listModel) |
| 250 | } | 254 | } |
| 251 | } | 255 | } |
| 256 | + haveArray = haveArray.sorted (by: { (item01, item02) -> Bool in | ||
| 257 | + return (item01 as! StandListModel).createTime < (item02 as! StandListModel).createTime | ||
| 258 | + }) | ||
| 259 | + haveArray.forEach { item in | ||
| 260 | + tempArray.insert(item, at: 0) | ||
| 261 | + } | ||
| 252 | return tempArray | 262 | return tempArray |
| 253 | } | 263 | } |
| 254 | print("allList接口里面===>\(have_id_auths)") | 264 | print("allList接口里面===>\(have_id_auths)") |
metaCode/Classes/Config/Database/CNLiveSaveAuthStateDB.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveSavePointDB.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by open on 2023/11/15. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | + | ||
| 10 | +let CNLiveSaveAuthStateCacheKey = "kCNLiveSaveAuthStateCacheKey" | ||
| 11 | +class CNLiveSaveAuthStateDB: NSObject { | ||
| 12 | + | ||
| 13 | + static let shared = CNLiveSaveAuthStateDB.init() | ||
| 14 | + | ||
| 15 | + open func save(object: MineStandInfoBaseModel, key: String) { | ||
| 16 | + var temp_dic = NSMutableDictionary.init(contentsOfFile: userFileDir+"\(key)storage.plist") | ||
| 17 | + if (temp_dic == nil) { | ||
| 18 | + temp_dic = NSMutableDictionary.init() | ||
| 19 | + } | ||
| 20 | + temp_dic?.setObject((object.toJSON() ?? Dictionary()) as Dictionary, forKey: CNLiveSaveAuthStateCacheKey as NSCopying) | ||
| 21 | + temp_dic?.write(toFile: userFileDir+"\(key)storage.plist", atomically: true) | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + open func take(key: String) -> MineStandInfoBaseModel { | ||
| 25 | + let temp_dic = NSMutableDictionary.init(contentsOfFile: userFileDir+"\(key)storage.plist") | ||
| 26 | + if (temp_dic == nil) { | ||
| 27 | + return MineStandInfoBaseModel() | ||
| 28 | + } | ||
| 29 | + let resp = temp_dic?.object(forKey: CNLiveSaveAuthStateCacheKey) | ||
| 30 | + let listModel = dictionaryToModel(resp as! [String : Any], MineStandInfoBaseModel.self,"") as! MineStandInfoBaseModel | ||
| 31 | + return listModel | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + private lazy var userFileDir: String = { | ||
| 35 | + let userFileDir = NSString() | ||
| 36 | + var path: String = "" | ||
| 37 | + path = "\(fileDir)/userId_\(UserInfoManager.shared.userInfo.uid)/" | ||
| 38 | + let fileManager = FileManager.default | ||
| 39 | + var isDir: ObjCBool = false | ||
| 40 | + let exist: Bool = fileManager.fileExists(atPath: path, isDirectory: &isDir) | ||
| 41 | + if !(isDir.boolValue && exist) { | ||
| 42 | + do { | ||
| 43 | + try fileManager.createDirectory(atPath: path, withIntermediateDirectories: true) | ||
| 44 | + } catch { | ||
| 45 | + debugPrint("文件目录创建失败") | ||
| 46 | + return "" | ||
| 47 | + } | ||
| 48 | + } | ||
| 49 | + return path as String | ||
| 50 | + }() | ||
| 51 | + | ||
| 52 | + private lazy var fileDir: String = { | ||
| 53 | + let path = "\(NSHomeDirectory())/Documents/metaCode/saveAuthState" | ||
| 54 | + let fileManager = FileManager.default | ||
| 55 | + var isDir: ObjCBool = false | ||
| 56 | + let exist: Bool = fileManager.fileExists(atPath: path, isDirectory: &isDir) | ||
| 57 | + if !(isDir.boolValue && exist) { | ||
| 58 | + do { | ||
| 59 | + try fileManager.createDirectory(atPath: path, withIntermediateDirectories: true) | ||
| 60 | + } catch { | ||
| 61 | + debugPrint("文件目录创建失败") | ||
| 62 | + return "" | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + return path as String | ||
| 66 | + }() | ||
| 67 | +} |
metaCode/Classes/Environment/CNLiveEnvironment.swift
| @@ -21,7 +21,7 @@ let APPId_wjj_b: String = CNLiveMCEnvironmentManager.shared.appId_wjj_b | @@ -21,7 +21,7 @@ let APPId_wjj_b: String = CNLiveMCEnvironmentManager.shared.appId_wjj_b | ||
| 21 | ///网家家B端应用的APPKey | 21 | ///网家家B端应用的APPKey |
| 22 | let APPKey_wjj_b: String = CNLiveMCEnvironmentManager.shared.appKey_wjj_b | 22 | let APPKey_wjj_b: String = CNLiveMCEnvironmentManager.shared.appKey_wjj_b |
| 23 | ///当前应用的登录请求域名 | 23 | ///当前应用的登录请求域名 |
| 24 | -let APPLoginHost: String! = CNLiveMCEnvironmentManager.shared.loginHost | 24 | +let APPLoginHost: String = CNLiveMCEnvironmentManager.shared.loginHost |
| 25 | ///当前应用的Secret | 25 | ///当前应用的Secret |
| 26 | let APPSecret: String = CNLiveMCEnvironmentManager.shared.appSecret | 26 | let APPSecret: String = CNLiveMCEnvironmentManager.shared.appSecret |
| 27 | ///当前应用的部分请求接口 | 27 | ///当前应用的部分请求接口 |
metaCode/Classes/Main/LoginPage/ViewModel/CNLiveLoginViewModel.swift
| @@ -43,7 +43,8 @@ class CNLiveLoginViewModel : NSObject { | @@ -43,7 +43,8 @@ class CNLiveLoginViewModel : NSObject { | ||
| 43 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | 43 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 44 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 44 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 45 | CNLiveNetworking.setupShowDataResult(false) | 45 | CNLiveNetworking.setupShowDataResult(false) |
| 46 | - CNLiveNetworking.requestNetwork(with: .POST, urlString: APPLoginHost+"/open/api2/user/sendVerifyCode", param: param, cacheType: .networkOnly) { task, result, error in | 46 | + CNLiveNetworking.setupShowResult(true) |
| 47 | + CNLiveNetworking.requestNetwork(with: .POST, urlString: CNLiveMCEnvironmentManager.shared.loginHost+"/open/api2/user/sendVerifyCode", param: param, cacheType: .networkOnly) { task, result, error in | ||
| 47 | hiddenLoading() | 48 | hiddenLoading() |
| 48 | if (error == nil) { | 49 | if (error == nil) { |
| 49 | let resp = result as! NSDictionary | 50 | let resp = result as! NSDictionary |
metaCode/Classes/Main/MinePage/Controller/CNLiveMineAddInfoViewController.swift
| @@ -85,7 +85,7 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel | @@ -85,7 +85,7 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel | ||
| 85 | super.viewDidLoad() | 85 | super.viewDidLoad() |
| 86 | switch _show_type { | 86 | switch _show_type { |
| 87 | case .add: | 87 | case .add: |
| 88 | - titleName = "添加身份" | 88 | + titleName = "官方认证" |
| 89 | case .info: | 89 | case .info: |
| 90 | titleName = "身份信息" | 90 | titleName = "身份信息" |
| 91 | tableView.dragInteractionEnabled = true | 91 | tableView.dragInteractionEnabled = true |
| @@ -307,7 +307,7 @@ extension CNLiveMineAddInfoViewController { | @@ -307,7 +307,7 @@ extension CNLiveMineAddInfoViewController { | ||
| 307 | return MineStandInfoTableViewCell() | 307 | return MineStandInfoTableViewCell() |
| 308 | } | 308 | } |
| 309 | let authModel = dataArray[indexPath.row] as! MineAuthListModel | 309 | let authModel = dataArray[indexPath.row] as! MineAuthListModel |
| 310 | - cell.setupWithAuthDataSource(icon: authModel.icon!, name: authModel.name!,number: authModel.code!) | 310 | + cell.setupWithAuthDataSource(icon: authModel.icon!, name: authModel.name!,number: authModel.code!,identityId: "\(authModel.identityId)") |
| 311 | cell.userInteractionEnabledWhileDragging = false | 311 | cell.userInteractionEnabledWhileDragging = false |
| 312 | return cell | 312 | return cell |
| 313 | } | 313 | } |
metaCode/Classes/Main/MinePage/Controller/CNLiveMineAuthFormViewController.swift
| @@ -84,15 +84,43 @@ class CNLiveMineAuthFormViewController: CNLiveBaseViewController, UITableViewDel | @@ -84,15 +84,43 @@ class CNLiveMineAuthFormViewController: CNLiveBaseViewController, UITableViewDel | ||
| 84 | } | 84 | } |
| 85 | cell.clickBlock = {[weak self] view in | 85 | cell.clickBlock = {[weak self] view in |
| 86 | guard let self = self else { return } | 86 | guard let self = self else { return } |
| 87 | + showLoading(message: "") | ||
| 87 | let titleLabel = view.viewWithTag(1000) as! UILabel | 88 | let titleLabel = view.viewWithTag(1000) as! UILabel |
| 88 | if titleLabel.text == "个人认证" { | 89 | if titleLabel.text == "个人认证" { |
| 89 | - self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _listModel, authType: .person), animated: true) | 90 | + CNLiveMineViewModel.requestsStandInfo(identityId: "\(_listModel.id)", type: .nodate, authType: .person) {[self] result, respStatue in |
| 91 | + if respStatue == .success { | ||
| 92 | + let model = (result as! [MineStandInfoModel]).first | ||
| 93 | + if model?.inputType == 17 || model == nil { | ||
| 94 | + showMessage(message: "此权限对您暂未开放,请先到首页学习成长") | ||
| 95 | + return | ||
| 96 | + } | ||
| 97 | + self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: self._listModel, authType: .person), animated: true) | ||
| 98 | + } | ||
| 99 | + } | ||
| 90 | } | 100 | } |
| 91 | if titleLabel.text == "企业认证" { | 101 | if titleLabel.text == "企业认证" { |
| 92 | - self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _listModel, authType: .enterprise), animated: true) | 102 | + CNLiveMineViewModel.requestsStandInfo(identityId: "\(_listModel.id)", type: .nodate, authType: .enterprise) {[self] result, respStatue in |
| 103 | + if respStatue == .success { | ||
| 104 | + let model = (result as! [MineStandInfoModel]).first | ||
| 105 | + if model?.inputType == 17 || model == nil { | ||
| 106 | + showMessage(message: "此权限对您暂未开放,请先到首页学习成长") | ||
| 107 | + return | ||
| 108 | + } | ||
| 109 | + self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: self._listModel, authType: .enterprise), animated: true) | ||
| 110 | + } | ||
| 111 | + } | ||
| 93 | } | 112 | } |
| 94 | if titleLabel.text == "机构认证" { | 113 | if titleLabel.text == "机构认证" { |
| 95 | - self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _listModel, authType: .agency), animated: true) | 114 | + CNLiveMineViewModel.requestsStandInfo(identityId: "\(_listModel.id)", type: .nodate, authType: .agency) {[self] result, respStatue in |
| 115 | + if respStatue == .success { | ||
| 116 | + let model = (result as! [MineStandInfoModel]).first | ||
| 117 | + if model?.inputType == 17 || model == nil { | ||
| 118 | + showMessage(message: "此权限对您暂未开放,请先到首页学习成长") | ||
| 119 | + return | ||
| 120 | + } | ||
| 121 | + self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: self._listModel, authType: .agency), animated: true) | ||
| 122 | + } | ||
| 123 | + } | ||
| 96 | } | 124 | } |
| 97 | } | 125 | } |
| 98 | let obj = dataArray[indexPath.section] | 126 | let obj = dataArray[indexPath.section] |
metaCode/Classes/Main/MinePage/Controller/CNLiveMineAuthResultViewController.swift
| @@ -205,7 +205,7 @@ class CNLiveMineAuthResultViewController: CNLiveBaseViewController { | @@ -205,7 +205,7 @@ class CNLiveMineAuthResultViewController: CNLiveBaseViewController { | ||
| 205 | self?.iDCardView.isHidden = false | 205 | self?.iDCardView.isHidden = false |
| 206 | self?.iDCardView.idModel = self?._listModel | 206 | self?.iDCardView.idModel = self?._listModel |
| 207 | self?.tipName.text = "恭喜您通过认证" | 207 | self?.tipName.text = "恭喜您通过认证" |
| 208 | - self?.tipDesc.text = listBaseModel.name!.count > 0 ? "您已是\(listBaseModel.name ?? "")!" : "恭喜您通过认证" | 208 | + self?.tipDesc.text = listBaseModel.name.count > 0 ? "您已是\(listBaseModel.name)" : "恭喜您通过认证" |
| 209 | self?._status = .default | 209 | self?._status = .default |
| 210 | self?.setNeedsStatusBarAppearanceUpdate() | 210 | self?.setNeedsStatusBarAppearanceUpdate() |
| 211 | NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthNotificationSuccess, object: nil) | 211 | NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthNotificationSuccess, object: nil) |
metaCode/Classes/Main/MinePage/Controller/CNLiveMineViewController.swift
| @@ -39,7 +39,7 @@ class CNLiveMineViewController : CNLiveBaseViewController, UITableViewDelegate, | @@ -39,7 +39,7 @@ class CNLiveMineViewController : CNLiveBaseViewController, UITableViewDelegate, | ||
| 39 | dataArray.add([""]) | 39 | dataArray.add([""]) |
| 40 | let array01 : [Dictionary] = [["name":"我的身份","icon":"mine_header_icon_identity"]] | 40 | let array01 : [Dictionary] = [["name":"我的身份","icon":"mine_header_icon_identity"]] |
| 41 | dataArray.add(array01) | 41 | dataArray.add(array01) |
| 42 | - let array02 : [Dictionary] = [["name":"添加身份","icon":"mine_list_icon_add_identity"]] | 42 | + let array02 : [Dictionary] = [["name":"官方认证","icon":"mine_list_icon_add_identity"]] |
| 43 | dataArray.add(array02) | 43 | dataArray.add(array02) |
| 44 | let array03 : [Dictionary] = [["name":"帮助与反馈","icon":"mine_list_icon_help_feedback"], | 44 | let array03 : [Dictionary] = [["name":"帮助与反馈","icon":"mine_list_icon_help_feedback"], |
| 45 | ["name":"更多设置","icon":"mine_list_icon_set_more"]] | 45 | ["name":"更多设置","icon":"mine_list_icon_set_more"]] |
| @@ -50,7 +50,7 @@ class CNLiveMineViewController : CNLiveBaseViewController, UITableViewDelegate, | @@ -50,7 +50,7 @@ class CNLiveMineViewController : CNLiveBaseViewController, UITableViewDelegate, | ||
| 50 | ["name":"新增优惠券","icon":"mine_list_icon_help_feedback"], | 50 | ["name":"新增优惠券","icon":"mine_list_icon_help_feedback"], |
| 51 | ["name":"优惠券管理","icon":"mine_list_icon_help_feedback"], | 51 | ["name":"优惠券管理","icon":"mine_list_icon_help_feedback"], |
| 52 | ["name":"抖音短视频","icon":"mine_list_icon_help_feedback"]] | 52 | ["name":"抖音短视频","icon":"mine_list_icon_help_feedback"]] |
| 53 | -// dataArray.add(array04) | 53 | + dataArray.add(array04) |
| 54 | 54 | ||
| 55 | return dataArray | 55 | return dataArray |
| 56 | }() | 56 | }() |
metaCode/Classes/Main/MinePage/View/CNLiveMineHeaderView.swift
| @@ -274,7 +274,7 @@ extension MinePhotoUploadView { | @@ -274,7 +274,7 @@ extension MinePhotoUploadView { | ||
| 274 | }) | 274 | }) |
| 275 | } | 275 | } |
| 276 | if self!.temp_imageView == self!.imageView03 { | 276 | if self!.temp_imageView == self!.imageView03 { |
| 277 | - let uploadKey = UploadManager.uploadImage(imageData: image.jpegData(compressionQuality: 1.0)! as NSData, progressBlock: {key, progress in | 277 | + let _ = UploadManager.uploadImage(imageData: image.jpegData(compressionQuality: 1.0)! as NSData, progressBlock: {key, progress in |
| 278 | print("获取进度==>\(progress)") | 278 | print("获取进度==>\(progress)") |
| 279 | }, successBlock: { [weak self] key,url in | 279 | }, successBlock: { [weak self] key,url in |
| 280 | self!.selectedImages.replaceObject(at: 2, with: image) | 280 | self!.selectedImages.replaceObject(at: 2, with: image) |
metaCode/Classes/Main/MinePage/View/CNLiveMineSubBodyListView.swift
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | // | 6 | // |
| 7 | 7 | ||
| 8 | import Foundation | 8 | import Foundation |
| 9 | - | 9 | +import APButton |
| 10 | class MineInfoLListTableViewCell : UITableViewCell { | 10 | class MineInfoLListTableViewCell : UITableViewCell { |
| 11 | 11 | ||
| 12 | lazy var mainView: UIImageView = { | 12 | lazy var mainView: UIImageView = { |
| @@ -39,7 +39,7 @@ class MineInfoLListTableViewCell : UITableViewCell { | @@ -39,7 +39,7 @@ class MineInfoLListTableViewCell : UITableViewCell { | ||
| 39 | 39 | ||
| 40 | lazy var addBtn: UIButton = { | 40 | lazy var addBtn: UIButton = { |
| 41 | let addBtn = UIButton.init(type: .custom) | 41 | let addBtn = UIButton.init(type: .custom) |
| 42 | - addBtn.setTitle(" 去添加 ", for: .normal) | 42 | + addBtn.setTitle(" 去认证 ", for: .normal) |
| 43 | addBtn.setTitleColor(.white, for: .normal) | 43 | addBtn.setTitleColor(.white, for: .normal) |
| 44 | addBtn.backgroundColor = HexColor("#67C5FF") | 44 | addBtn.backgroundColor = HexColor("#67C5FF") |
| 45 | addBtn.titleLabel?.font = BoldFont_15 | 45 | addBtn.titleLabel?.font = BoldFont_15 |
| @@ -56,11 +56,11 @@ class MineInfoLListTableViewCell : UITableViewCell { | @@ -56,11 +56,11 @@ class MineInfoLListTableViewCell : UITableViewCell { | ||
| 56 | if is_auth { | 56 | if is_auth { |
| 57 | addBtn.backgroundColor = HexColor("#DCDCDC") | 57 | addBtn.backgroundColor = HexColor("#DCDCDC") |
| 58 | addBtn.setTitleColor(HexColor("#666666"), for: .normal) | 58 | addBtn.setTitleColor(HexColor("#666666"), for: .normal) |
| 59 | - addBtn.setTitle(" 已添加 ", for: .normal) | 59 | + addBtn.setTitle(" 已认证 ", for: .normal) |
| 60 | }else { | 60 | }else { |
| 61 | addBtn.backgroundColor = HexColor("#67C5FF") | 61 | addBtn.backgroundColor = HexColor("#67C5FF") |
| 62 | addBtn.setTitleColor(.white, for: .normal) | 62 | addBtn.setTitleColor(.white, for: .normal) |
| 63 | - addBtn.setTitle(" 去添加 ", for: .normal) | 63 | + addBtn.setTitle(" 去认证 ", for: .normal) |
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| 66 | 66 | ||
| @@ -130,6 +130,16 @@ class MineStandInfoTableViewCell: UITableViewCell { | @@ -130,6 +130,16 @@ class MineStandInfoTableViewCell: UITableViewCell { | ||
| 130 | return iconView | 130 | return iconView |
| 131 | }() | 131 | }() |
| 132 | 132 | ||
| 133 | + lazy var logoButton : APButton = { | ||
| 134 | + let button = APButton() | ||
| 135 | + button.layer.cornerRadius = adapt_length(length: 10) | ||
| 136 | + button.layer.masksToBounds = true | ||
| 137 | + button.isHidden = true | ||
| 138 | + button.backgroundColor = .clear | ||
| 139 | + button.activityIndicator.color = .gray | ||
| 140 | + return button | ||
| 141 | + }() | ||
| 142 | + | ||
| 133 | lazy var titleLabel: UILabel = { | 143 | lazy var titleLabel: UILabel = { |
| 134 | let titleLabel = UILabel.init() | 144 | let titleLabel = UILabel.init() |
| 135 | titleLabel.backgroundColor = .clear | 145 | titleLabel.backgroundColor = .clear |
| @@ -158,11 +168,34 @@ class MineStandInfoTableViewCell: UITableViewCell { | @@ -158,11 +168,34 @@ class MineStandInfoTableViewCell: UITableViewCell { | ||
| 158 | return timeLabel | 168 | return timeLabel |
| 159 | }() | 169 | }() |
| 160 | 170 | ||
| 161 | - public func setupWithAuthDataSource(icon: String, name: String,number: String) { | 171 | + public func setupWithAuthDataSource(icon: String, name: String,number: String,identityId: String) { |
| 162 | iconView.kf.indicatorType = .activity | 172 | iconView.kf.indicatorType = .activity |
| 163 | iconView.kf.setImage(with: URL(string: icon), placeholder: UIImage.imageWithColor(color: HexColor("#f9f9f9")!, size: CGSize(width: 50, height: 50))) | 173 | iconView.kf.setImage(with: URL(string: icon), placeholder: UIImage.imageWithColor(color: HexColor("#f9f9f9")!, size: CGSize(width: 50, height: 50))) |
| 164 | titleLabel.text = name | 174 | titleLabel.text = name |
| 165 | numberLabel.text = "编号:\(number)" | 175 | numberLabel.text = "编号:\(number)" |
| 176 | + logoButton.isHidden = false | ||
| 177 | + let infoModel = CNLiveSaveAuthStateDB.shared.take(key: identityId) | ||
| 178 | + if infoModel.name.isEmpty && infoModel.identityId == 0 { | ||
| 179 | + logoButton.startAnimating() | ||
| 180 | + DispatchQueue.global().async { | ||
| 181 | + CNLiveMineViewModel.requestsStandInfo(identityId: identityId, type: .havedate, authType: .agency) {[weak self] result, respStatue in | ||
| 182 | + guard let self = self else { return } | ||
| 183 | + logoButton.stopAnimating() | ||
| 184 | + let sub_infoModel = CNLiveSaveAuthStateDB.shared.take(key: identityId) | ||
| 185 | + if sub_infoModel.authInfos.count > 0 { | ||
| 186 | + logoButton.setImage(UIImage(named: "mine_form_auth_person_yellow"), for: .normal) | ||
| 187 | + } else { | ||
| 188 | + logoButton.setImage(UIImage(named: "mine_form_auth_enter_yellow"), for: .normal) | ||
| 189 | + } | ||
| 190 | + } | ||
| 191 | + } | ||
| 192 | + } else { | ||
| 193 | + if infoModel.authInfos.count > 0 { | ||
| 194 | + logoButton.setImage(UIImage(named: "mine_form_auth_person_yellow"), for: .normal) | ||
| 195 | + } else { | ||
| 196 | + logoButton.setImage(UIImage(named: "mine_form_auth_enter_yellow"), for: .normal) | ||
| 197 | + } | ||
| 198 | + } | ||
| 166 | } | 199 | } |
| 167 | 200 | ||
| 168 | public func setupWithMessageDataSource(icon: String, name: String,number: String, time: String) { | 201 | public func setupWithMessageDataSource(icon: String, name: String,number: String, time: String) { |
| @@ -188,6 +221,7 @@ class MineStandInfoTableViewCell: UITableViewCell { | @@ -188,6 +221,7 @@ class MineStandInfoTableViewCell: UITableViewCell { | ||
| 188 | mainView.addSubview(titleLabel) | 221 | mainView.addSubview(titleLabel) |
| 189 | mainView.addSubview(numberLabel) | 222 | mainView.addSubview(numberLabel) |
| 190 | mainView.addSubview(timeLabel) | 223 | mainView.addSubview(timeLabel) |
| 224 | + mainView.addSubview(logoButton) | ||
| 191 | 225 | ||
| 192 | setupConstraints() | 226 | setupConstraints() |
| 193 | } | 227 | } |
| @@ -211,12 +245,17 @@ class MineStandInfoTableViewCell: UITableViewCell { | @@ -211,12 +245,17 @@ class MineStandInfoTableViewCell: UITableViewCell { | ||
| 211 | titleLabel.snp.makeConstraints { make in | 245 | titleLabel.snp.makeConstraints { make in |
| 212 | make.centerY.equalToSuperview().offset(-15) | 246 | make.centerY.equalToSuperview().offset(-15) |
| 213 | make.left.equalTo(iconView.snp.right).offset(10) | 247 | make.left.equalTo(iconView.snp.right).offset(10) |
| 214 | - make.right.equalToSuperview().offset(-30) | 248 | +// make.right.equalToSuperview().offset(-30) |
| 215 | } | 249 | } |
| 216 | numberLabel.snp.makeConstraints { make in | 250 | numberLabel.snp.makeConstraints { make in |
| 217 | make.centerY.equalToSuperview().offset(15) | 251 | make.centerY.equalToSuperview().offset(15) |
| 218 | make.left.equalTo(iconView.snp.right).offset(10) | 252 | make.left.equalTo(iconView.snp.right).offset(10) |
| 219 | } | 253 | } |
| 254 | + logoButton.snp.makeConstraints { make in | ||
| 255 | + make.centerY.equalTo(titleLabel) | ||
| 256 | + make.left.equalTo(titleLabel.snp.right).offset(adapt_length(length: 5)) | ||
| 257 | + make.size.equalTo(adapt_length(length: 20)) | ||
| 258 | + } | ||
| 220 | } | 259 | } |
| 221 | 260 | ||
| 222 | required init?(coder: NSCoder) { | 261 | required init?(coder: NSCoder) { |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
| @@ -229,15 +229,15 @@ class MineStandInfoBaseModel: BaseModel { | @@ -229,15 +229,15 @@ class MineStandInfoBaseModel: BaseModel { | ||
| 229 | var authInfos = [MineStandInfoModel]()//个人认证 | 229 | var authInfos = [MineStandInfoModel]()//个人认证 |
| 230 | var enterpriseAuthInfos = [MineStandInfoModel]()//企业认证 | 230 | var enterpriseAuthInfos = [MineStandInfoModel]()//企业认证 |
| 231 | var agencyAuthInfos = [MineStandInfoModel]()//机构认证 | 231 | var agencyAuthInfos = [MineStandInfoModel]()//机构认证 |
| 232 | - var icon: String? | ||
| 233 | - var name: String? | 232 | + var icon: String = "" |
| 233 | + var name: String = "" | ||
| 234 | var identityId: Int = 0 | 234 | var identityId: Int = 0 |
| 235 | - var code: String? | ||
| 236 | - var cardImg: String? | 235 | + var code: String = "" |
| 236 | + var cardImg: String = "" | ||
| 237 | var authTime: Int = 0 | 237 | var authTime: Int = 0 |
| 238 | var userStatus: Int = 0 | 238 | var userStatus: Int = 0 |
| 239 | - var upPath: String? | ||
| 240 | - var downPath: String? | 239 | + var upPath: String = "" |
| 240 | + var downPath: String = "" | ||
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | class MineStandInfoModel: BaseModel { | 243 | class MineStandInfoModel: BaseModel { |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
| @@ -516,6 +516,7 @@ class CNLiveMineViewModel: NSObject { | @@ -516,6 +516,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 516 | }else if (type == .effect) { | 516 | }else if (type == .effect) { |
| 517 | resultBlock(newsModel,.success) | 517 | resultBlock(newsModel,.success) |
| 518 | }else { | 518 | }else { |
| 519 | + CNLiveSaveAuthStateDB.shared.save(object: newsModel, key: identityId) | ||
| 519 | if newsModel.authInfos.count > 0 { | 520 | if newsModel.authInfos.count > 0 { |
| 520 | let tempArray = NSMutableArray.init(array: newsModel.authInfos) | 521 | let tempArray = NSMutableArray.init(array: newsModel.authInfos) |
| 521 | resultBlock(tempArray,.success) | 522 | resultBlock(tempArray,.success) |
| @@ -652,8 +653,8 @@ class CNLiveMineViewModel: NSObject { | @@ -652,8 +653,8 @@ class CNLiveMineViewModel: NSObject { | ||
| 652 | CNLiveMineViewModel.requestsStandInfo(identityId: id, type: .effect, authType: authType) { result, respStatue in | 653 | CNLiveMineViewModel.requestsStandInfo(identityId: id, type: .effect, authType: authType) { result, respStatue in |
| 653 | if respStatue == .success { | 654 | if respStatue == .success { |
| 654 | let listBaseModel = result as! MineStandInfoBaseModel | 655 | let listBaseModel = result as! MineStandInfoBaseModel |
| 655 | - if listBaseModel.authTime > 0 || listBaseModel.code!.count > 0 { | ||
| 656 | - showMessage(message: listBaseModel.name!.count > 0 ? "恭喜您通过认证,您已是\(listBaseModel.name ?? "")" : "恭喜您通过认证") | 656 | + if listBaseModel.authTime > 0 || listBaseModel.code.count > 0 { |
| 657 | + showMessage(message: listBaseModel.name.count > 0 ? "恭喜您通过认证,您已是\(listBaseModel.name )" : "恭喜您通过认证") | ||
| 657 | resultBlock(listBaseModel, .success) | 658 | resultBlock(listBaseModel, .success) |
| 658 | NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthNotificationSuccess, object: nil) | 659 | NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthNotificationSuccess, object: nil) |
| 659 | } else { | 660 | } else { |
metaCode/Classes/Main/VideoPage/Controller/CNLiveShortVideoViewController.swift
| @@ -379,7 +379,7 @@ extension CNLiveShortVideoViewController { | @@ -379,7 +379,7 @@ extension CNLiveShortVideoViewController { | ||
| 379 | } | 379 | } |
| 380 | } | 380 | } |
| 381 | func listActionMethod(viewcell: CNLiveShortVideoListTableViewCell, button: UIButton) { | 381 | func listActionMethod(viewcell: CNLiveShortVideoListTableViewCell, button: UIButton) { |
| 382 | - CNLiveShortVideoContentListView.showVideoContentListView(title: viewcell.homeModel.albumMsgModel!.albumName,dataArray: dataArray, result: {[weak self] listModel in | 382 | + CNLiveShortVideoContentListView.showVideoContentListView(title: viewcell.homeModel.albumMsgModel!.albumName,dataArray: dataArray, episodeNow: viewcell.homeModel.albumMsgModel!.episodeNow, result: {[weak self] listModel in |
| 383 | guard let self = self else { return } | 383 | guard let self = self else { return } |
| 384 | let index = self.dataArray.index(of: listModel) as NSInteger | 384 | let index = self.dataArray.index(of: listModel) as NSInteger |
| 385 | self.playTheIndex(index: index) | 385 | self.playTheIndex(index: index) |
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoCommentListView.swift
| @@ -415,6 +415,19 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel | @@ -415,6 +415,19 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel | ||
| 415 | return replyButton | 415 | return replyButton |
| 416 | }() | 416 | }() |
| 417 | 417 | ||
| 418 | + lazy var deleteButton: UIButton = { | ||
| 419 | + let deleteButton = APButton() | ||
| 420 | + deleteButton.setTitleColor(.white, for: .normal) | ||
| 421 | + deleteButton.activityIndicator.color = .white | ||
| 422 | + deleteButton.backgroundColor = .clear | ||
| 423 | + deleteButton.isHidden = true | ||
| 424 | + deleteButton.setTitle("删除", for: .normal) | ||
| 425 | + deleteButton.setTitleColor(HexColor("#969696"), for: .normal) | ||
| 426 | + deleteButton.titleLabel?.font = medium_adapt_font(pointSize: 13) | ||
| 427 | + deleteButton.addTarget(self, action: #selector(replyMethod), for: .touchUpInside) | ||
| 428 | + return deleteButton | ||
| 429 | + }() | ||
| 430 | + | ||
| 418 | lazy var replyUnfoldButton: UIButton = { | 431 | lazy var replyUnfoldButton: UIButton = { |
| 419 | let button = QMUIButton() | 432 | let button = QMUIButton() |
| 420 | button.imagePosition = .right | 433 | button.imagePosition = .right |
| @@ -530,6 +543,13 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel | @@ -530,6 +543,13 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel | ||
| 530 | make.width.equalTo(40) | 543 | make.width.equalTo(40) |
| 531 | make.top.equalTo(commentLabel.snp.bottom).offset(10) | 544 | make.top.equalTo(commentLabel.snp.bottom).offset(10) |
| 532 | } | 545 | } |
| 546 | + contentView.addSubview(deleteButton) | ||
| 547 | + deleteButton.snp.makeConstraints { make in | ||
| 548 | + make.left.equalTo(replyButton.snp.right).offset(adapt_length(length: 5)) | ||
| 549 | + make.height.equalTo(20) | ||
| 550 | + make.width.equalTo(40) | ||
| 551 | + make.top.equalTo(commentLabel.snp.bottom).offset(10) | ||
| 552 | + } | ||
| 533 | contentView.addSubview(replyUnfoldButton) | 553 | contentView.addSubview(replyUnfoldButton) |
| 534 | replyUnfoldButton.snp.makeConstraints { make in | 554 | replyUnfoldButton.snp.makeConstraints { make in |
| 535 | make.top.equalTo(timeLabel.snp.bottom) | 555 | make.top.equalTo(timeLabel.snp.bottom) |
| @@ -557,10 +577,11 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel | @@ -557,10 +577,11 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel | ||
| 557 | } else { | 577 | } else { |
| 558 | replyUnfoldButton.isHidden = true | 578 | replyUnfoldButton.isHidden = true |
| 559 | } | 579 | } |
| 580 | + replyButton.setTitle("回复", for: .normal) | ||
| 560 | if ((contentSid == UserInfoManager.shared.userInfo.uid) || (commentData.uid == UserInfoManager.shared.userInfo.uid)) { | 581 | if ((contentSid == UserInfoManager.shared.userInfo.uid) || (commentData.uid == UserInfoManager.shared.userInfo.uid)) { |
| 561 | - replyButton.setTitle("删除", for: .normal) | 582 | + deleteButton.isHidden = false |
| 562 | } else { | 583 | } else { |
| 563 | - replyButton.setTitle("回复", for: .normal) | 584 | + deleteButton.isHidden = true |
| 564 | } | 585 | } |
| 565 | DispatchQueue.main.async {[weak self] in | 586 | DispatchQueue.main.async {[weak self] in |
| 566 | guard let self = self else { return } | 587 | guard let self = self else { return } |
| @@ -628,6 +649,7 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel | @@ -628,6 +649,7 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel | ||
| 628 | 649 | ||
| 629 | @objc func replyMethod(button: UIButton) { | 650 | @objc func replyMethod(button: UIButton) { |
| 630 | if button.titleLabel?.text == "回复" { | 651 | if button.titleLabel?.text == "回复" { |
| 652 | + let uid = commentModel == nil ? replyItemModel.fromSid : commentModel.uid | ||
| 631 | CNLiveContentToolTextView.showCommentViewForCustom(withCommType: .reply, fromNick: commentModel == nil ? replyItemModel.fromNick : commentModel.nick, firstRespFace: false, successBlcok: {[weak self] commentString, toolbarView in | 653 | CNLiveContentToolTextView.showCommentViewForCustom(withCommType: .reply, fromNick: commentModel == nil ? replyItemModel.fromNick : commentModel.nick, firstRespFace: false, successBlcok: {[weak self] commentString, toolbarView in |
| 632 | guard let self = self else { return } | 654 | guard let self = self else { return } |
| 633 | CNLiveShortVideoViewModel.requestCommentWithReply(commentId: self.commentModel.commentId!, comment: commentString ?? "", toSid: self.commentModel.uid!, fromSid: UserInfoManager.shared.userInfo.uid, level: "1") {[weak self] result, respStatue in | 655 | CNLiveShortVideoViewModel.requestCommentWithReply(commentId: self.commentModel.commentId!, comment: commentString ?? "", toSid: self.commentModel.uid!, fromSid: UserInfoManager.shared.userInfo.uid, level: "1") {[weak self] result, respStatue in |
| @@ -720,7 +742,6 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel | @@ -720,7 +742,6 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel | ||
| 720 | 742 | ||
| 721 | @objc func replyUnfoldMethod(button: UIButton) { | 743 | @objc func replyUnfoldMethod(button: UIButton) { |
| 722 | showLoading(message: "") | 744 | showLoading(message: "") |
| 723 | - print("这里点击的时候走了多少次") | ||
| 724 | let replyModel: ShortVideoHomeCommentRListItemModel = self.dataSource.lastObject as! ShortVideoHomeCommentRListItemModel | 745 | let replyModel: ShortVideoHomeCommentRListItemModel = self.dataSource.lastObject as! ShortVideoHomeCommentRListItemModel |
| 725 | CNLiveShortVideoViewModel.requestcommentWithReplyList(commentId: commentModel.commentId!, seqId: replyModel.seqId!) {[weak self] result, respStatue in | 746 | CNLiveShortVideoViewModel.requestcommentWithReplyList(commentId: commentModel.commentId!, seqId: replyModel.seqId!) {[weak self] result, respStatue in |
| 726 | guard let self = self else { return } | 747 | guard let self = self else { return } |
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoContentListView.swift
| @@ -111,9 +111,9 @@ class CNLiveShortVideoContentListView: UIView, UITableViewDelegate, UITableViewD | @@ -111,9 +111,9 @@ class CNLiveShortVideoContentListView: UIView, UITableViewDelegate, UITableViewD | ||
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | - func setupWithDataSource(title: String,dataArray: NSMutableArray) { | 114 | + func setupWithDataSource(title: String,dataArray: NSMutableArray,episodeNow: String) { |
| 115 | dataSource = dataArray | 115 | dataSource = dataArray |
| 116 | - titleLabel.text = title | 116 | + titleLabel.text = "\(title)·\(episodeNow)集" |
| 117 | self.tableView.reloadData() | 117 | self.tableView.reloadData() |
| 118 | } | 118 | } |
| 119 | 119 | ||
| @@ -129,11 +129,11 @@ class CNLiveShortVideoContentListView: UIView, UITableViewDelegate, UITableViewD | @@ -129,11 +129,11 @@ class CNLiveShortVideoContentListView: UIView, UITableViewDelegate, UITableViewD | ||
| 129 | removeFromSuperview() | 129 | removeFromSuperview() |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | - static public func showVideoContentListView(title: String,dataArray: NSMutableArray,result: @escaping CloseVideoListResultBlock) { | 132 | + static public func showVideoContentListView(title: String,dataArray: NSMutableArray,episodeNow: String ,result: @escaping CloseVideoListResultBlock) { |
| 133 | 133 | ||
| 134 | let pickerView = CNLiveShortVideoContentListView.init(frame: CGRect.zero) | 134 | let pickerView = CNLiveShortVideoContentListView.init(frame: CGRect.zero) |
| 135 | pickerView.resultBlock = result | 135 | pickerView.resultBlock = result |
| 136 | - pickerView.setupWithDataSource(title: title,dataArray: dataArray) | 136 | + pickerView.setupWithDataSource(title: title,dataArray: dataArray,episodeNow: episodeNow) |
| 137 | 137 | ||
| 138 | let delegate = UIApplication.shared.delegate as! AppDelegate | 138 | let delegate = UIApplication.shared.delegate as! AppDelegate |
| 139 | delegate.window?.addSubview(pickerView) | 139 | delegate.window?.addSubview(pickerView) |
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoListTableViewCell.swift
| @@ -47,6 +47,7 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | @@ -47,6 +47,7 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | ||
| 47 | lazy var tipsLabel: UILabel = { | 47 | lazy var tipsLabel: UILabel = { |
| 48 | let label = UILabel() | 48 | let label = UILabel() |
| 49 | label.textColor = UIColor.white | 49 | label.textColor = UIColor.white |
| 50 | + label.text = "当前内容需付费观看" | ||
| 50 | label.font = semibold_adapt_font(pointSize: 15) | 51 | label.font = semibold_adapt_font(pointSize: 15) |
| 51 | label.textAlignment = .center | 52 | label.textAlignment = .center |
| 52 | label.numberOfLines = 0 | 53 | label.numberOfLines = 0 |
| @@ -142,6 +143,12 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | @@ -142,6 +143,12 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | ||
| 142 | return payView | 143 | return payView |
| 143 | }() | 144 | }() |
| 144 | 145 | ||
| 146 | + lazy var grayMaskView: UIView = { | ||
| 147 | + let grayMaskView = UIView() | ||
| 148 | + grayMaskView.backgroundColor = UIColor.init(white: 0, alpha: 0.6) | ||
| 149 | + return grayMaskView | ||
| 150 | + }() | ||
| 151 | + | ||
| 145 | //控制器承载图 | 152 | //控制器承载图 |
| 146 | lazy var coverImageView: UIImageView = { | 153 | lazy var coverImageView: UIImageView = { |
| 147 | let coverImageView = UIImageView() | 154 | let coverImageView = UIImageView() |
| @@ -162,6 +169,7 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | @@ -162,6 +169,7 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | ||
| 162 | selectionStyle = .none | 169 | selectionStyle = .none |
| 163 | 170 | ||
| 164 | contentView.addSubview(coverImageView) | 171 | contentView.addSubview(coverImageView) |
| 172 | + contentView.addSubview(grayMaskView) | ||
| 165 | contentView.addSubview(shareBtn) | 173 | contentView.addSubview(shareBtn) |
| 166 | contentView.addSubview(commentBtn) | 174 | contentView.addSubview(commentBtn) |
| 167 | contentView.addSubview(likeBtn) | 175 | contentView.addSubview(likeBtn) |
| @@ -226,6 +234,7 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | @@ -226,6 +234,7 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | ||
| 226 | self.iconBtn.isHidden = true | 234 | self.iconBtn.isHidden = true |
| 227 | self.titleLabel.isHidden = true | 235 | self.titleLabel.isHidden = true |
| 228 | self.descLabel.isHidden = true | 236 | self.descLabel.isHidden = true |
| 237 | + self.grayMaskView.isHidden = false | ||
| 229 | self.tipsLabel.isHidden = false | 238 | self.tipsLabel.isHidden = false |
| 230 | self.payView.isHidden = false | 239 | self.payView.isHidden = false |
| 231 | } else { | 240 | } else { |
| @@ -236,6 +245,7 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | @@ -236,6 +245,7 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | ||
| 236 | self.iconBtn.isHidden = false | 245 | self.iconBtn.isHidden = false |
| 237 | self.titleLabel.isHidden = false | 246 | self.titleLabel.isHidden = false |
| 238 | self.descLabel.isHidden = false | 247 | self.descLabel.isHidden = false |
| 248 | + self.grayMaskView.isHidden = true | ||
| 239 | self.tipsLabel.isHidden = true | 249 | self.tipsLabel.isHidden = true |
| 240 | self.payView.isHidden = true | 250 | self.payView.isHidden = true |
| 241 | } | 251 | } |
| @@ -311,6 +321,9 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | @@ -311,6 +321,9 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | ||
| 311 | make.bottom.equalTo(listBtn.snp.top).offset(-10) | 321 | make.bottom.equalTo(listBtn.snp.top).offset(-10) |
| 312 | make.height.equalTo(165) | 322 | make.height.equalTo(165) |
| 313 | } | 323 | } |
| 324 | + grayMaskView.snp.makeConstraints { make in | ||
| 325 | + make.edges.equalToSuperview() | ||
| 326 | + } | ||
| 314 | } | 327 | } |
| 315 | 328 | ||
| 316 | 329 | ||
| @@ -331,8 +344,8 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | @@ -331,8 +344,8 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { | ||
| 331 | self.delegate.iconActionMethod(viewcell: self, button: button) | 344 | self.delegate.iconActionMethod(viewcell: self, button: button) |
| 332 | } | 345 | } |
| 333 | 346 | ||
| 334 | - @objc func faviMothod(button: UIButton) { | ||
| 335 | - self.delegate.faviActionMethod(viewcell: self, button: button as! APButton) | 347 | + @objc func faviMothod(button: APButton) { |
| 348 | + self.delegate.faviActionMethod(viewcell: self, button: button) | ||
| 336 | } | 349 | } |
| 337 | 350 | ||
| 338 | @objc func listMethod(button: UIButton) { | 351 | @objc func listMethod(button: UIButton) { |
metaCode/Supporting Files/Assets.xcassets/MinePage/mine_form_auth_enter_yellow.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "filename" : "mine_form_auth_enter_yellow@2x.png", | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "filename" : "mine_form_auth_enter_yellow@3x.png", | ||
| 14 | + "idiom" : "universal", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "author" : "xcode", | ||
| 20 | + "version" : 1 | ||
| 21 | + } | ||
| 22 | +} |
metaCode/Supporting Files/Assets.xcassets/MinePage/mine_form_auth_enter_yellow.imageset/mine_form_auth_enter_yellow@2x.png
0 → 100644
918 Bytes
metaCode/Supporting Files/Assets.xcassets/MinePage/mine_form_auth_enter_yellow.imageset/mine_form_auth_enter_yellow@3x.png
0 → 100644
1.59 KB
metaCode/Supporting Files/Assets.xcassets/MinePage/mine_form_auth_person_yellow.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "filename" : "mine_form_auth_person_yellow@2x.png", | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "filename" : "mine_form_auth_person_yellow@3x.png", | ||
| 14 | + "idiom" : "universal", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "author" : "xcode", | ||
| 20 | + "version" : 1 | ||
| 21 | + } | ||
| 22 | +} |
metaCode/Supporting Files/Assets.xcassets/MinePage/mine_form_auth_person_yellow.imageset/mine_form_auth_person_yellow@2x.png
0 → 100644
1018 Bytes
metaCode/Supporting Files/Assets.xcassets/MinePage/mine_form_auth_person_yellow.imageset/mine_form_auth_person_yellow@3x.png
0 → 100644
1.75 KB