Commit 7e1951964c1be4ff1e5e9e699d4516cbebad19f7

Authored by liushiyu
1 parent 398862a1

店铺信息提交

Showing 32 changed files with 1338 additions and 90 deletions
... ... @@ -64,7 +64,7 @@ end
64 64 post_install do |installer|
65 65 installer.pods_project.targets.each do |target|
66 66 target.build_configurations.each do |config|
67   - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
  67 + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
68 68 end
69 69 end
70 70 end
... ...
metaCode.xcodeproj/project.pbxproj
... ... @@ -38,6 +38,8 @@
38 38 7963989D2A260E6200D045EB /* CNLiveBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963989C2A260E6200D045EB /* CNLiveBaseViewController.swift */; };
39 39 79656E382AAEBA8E00119A61 /* CNLiveMineInputViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79656E372AAEBA8E00119A61 /* CNLiveMineInputViewController.swift */; };
40 40 7978A8432A396632007C86B8 /* CNLiveMineViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7978A8422A396632007C86B8 /* CNLiveMineViewModel.swift */; };
  41 + 79803E272AD68D3100F05F68 /* CNLiveMineShopViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79803E262AD68D3100F05F68 /* CNLiveMineShopViewController.swift */; };
  42 + 79803E292AD6991200F05F68 /* CNLiveMineInputMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79803E282AD6991200F05F68 /* CNLiveMineInputMessageView.swift */; };
41 43 7987BF3D2A497644000A1ABC /* CNLiveMineQuestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7987BF3C2A497644000A1ABC /* CNLiveMineQuestViewController.swift */; };
42 44 7989B5C52A4BDC6000A19B10 /* CNLiveMineEarnViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7989B5C42A4BDC6000A19B10 /* CNLiveMineEarnViewController.swift */; };
43 45 7989B5C72A4BDC7200A19B10 /* CNLiveMineEarnListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7989B5C62A4BDC7200A19B10 /* CNLiveMineEarnListViewController.swift */; };
... ... @@ -148,6 +150,8 @@
148 150 7963989C2A260E6200D045EB /* CNLiveBaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CNLiveBaseViewController.swift; sourceTree = "<group>"; };
149 151 79656E372AAEBA8E00119A61 /* CNLiveMineInputViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineInputViewController.swift; sourceTree = "<group>"; };
150 152 7978A8422A396632007C86B8 /* CNLiveMineViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineViewModel.swift; sourceTree = "<group>"; };
  153 + 79803E262AD68D3100F05F68 /* CNLiveMineShopViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineShopViewController.swift; sourceTree = "<group>"; };
  154 + 79803E282AD6991200F05F68 /* CNLiveMineInputMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineInputMessageView.swift; sourceTree = "<group>"; };
151 155 7987BF3C2A497644000A1ABC /* CNLiveMineQuestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineQuestViewController.swift; sourceTree = "<group>"; };
152 156 7989B5C42A4BDC6000A19B10 /* CNLiveMineEarnViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineEarnViewController.swift; sourceTree = "<group>"; };
153 157 7989B5C62A4BDC7200A19B10 /* CNLiveMineEarnListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineEarnListViewController.swift; sourceTree = "<group>"; };
... ... @@ -343,6 +347,7 @@
343 347 793CAF512A58FCA200882EF4 /* CNLiveMineExchangeViewController.swift */,
344 348 79656E372AAEBA8E00119A61 /* CNLiveMineInputViewController.swift */,
345 349 7905BB482AB0588B0089BC50 /* CNLiveMineAuthResultViewController.swift */,
  350 + 79803E262AD68D3100F05F68 /* CNLiveMineShopViewController.swift */,
346 351 );
347 352 path = Controller;
348 353 sourceTree = "<group>";
... ... @@ -476,6 +481,7 @@
476 481 798A44E92A30135D00815935 /* CNLiveMineBodyListView.swift */,
477 482 798A44F12A30674200815935 /* CNLiveMineSubBodyListView.swift */,
478 483 79F4B11B2A33036E00993C03 /* CNLiveMineInfoAlertView.swift */,
  484 + 79803E282AD6991200F05F68 /* CNLiveMineInputMessageView.swift */,
479 485 );
480 486 path = View;
481 487 sourceTree = "<group>";
... ... @@ -951,7 +957,9 @@
951 957 798A44E82A30134400815935 /* CNLiveMineHeaderView.swift in Sources */,
952 958 7C49312D2A2DB9FA000E44B4 /* UITabBar+CNLiveExtensions.swift in Sources */,
953 959 790D019A2A2DCAE400C5978D /* CNLiveViewController.swift in Sources */,
  960 + 79803E272AD68D3100F05F68 /* CNLiveMineShopViewController.swift in Sources */,
954 961 79A68C4C2A26EA6000DC3B43 /* (null) in Sources */,
  962 + 79803E292AD6991200F05F68 /* CNLiveMineInputMessageView.swift in Sources */,
955 963 79282A462A2F457D00B5F8CF /* CNLiveMineViewController.swift in Sources */,
956 964 798A44F02A305BC200815935 /* UIButton+CNLiveExtensions.swift in Sources */,
957 965 );
... ...
metaCode/Classes/Common/Base/CNLiveBaseTabBarViewController.swift
... ... @@ -38,6 +38,9 @@ class CNLiveBaseTabBarViewController: UITabBarController
38 38  
39 39 override func viewWillAppear(_ animated: Bool) {
40 40 super.viewWillAppear(animated)
  41 +
  42 + self.selectedIndex = 1
  43 +
41 44 }
42 45 override func viewDidAppear(_ animated: Bool) {
43 46 super.viewDidAppear(animated)
... ...
metaCode/Classes/Common/Util/CNLiveCommonQiniuTool.swift
... ... @@ -57,6 +57,7 @@ class UploadManager: NSObject {
57 57 CNLiveNetworking.setupShowResult(true)
58 58 CNLiveNetworking.setAllowRequestDefaultArgument(true)
59 59 CNLiveNetworking.setupShowDataResult(false)
  60 + CNLiveNetworking.setupSignRequestKey(APPKey_wjj)
60 61 CNLiveNetworking.requestNetwork(with: .POST, urlString: "\(CNLiveEnvironmentManager.shared.img_token_url)/vod_epg/getUploadAuthForApp", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
61 62 hiddenLoading()
62 63 if (error == nil) {
... ... @@ -109,7 +110,7 @@ class UploadManager: NSObject {
109 110 /// 设置图片名称
110 111 /// - Returns: 图片名
111 112 static private func createImageFileName() -> String {
112   - let imageName = "802/mateCode/img/\(NSDate().string(withFormat: "yyyy/MM/dd") ?? "0000")/\(arc4random()).jpg"
  113 + let imageName = "802/mateCode/img/\(NSDate().string(withFormat: "yyyy/MM/dd") )/\(arc4random()).jpg"
113 114 return imageName
114 115 }
115 116 }
... ...
metaCode/Classes/Environment/CNLiveEnvironment.swift
... ... @@ -15,6 +15,10 @@ let APPKey: String = CNLiveEnvironmentManager.shared.appKey
15 15 let APPId_wjj: String = CNLiveEnvironmentManager.shared.appId_wjj
16 16 ///网家家应用的APPKey
17 17 let APPKey_wjj: String = CNLiveEnvironmentManager.shared.appKey_wjj
  18 +///网家家B端应用的APPID
  19 +let APPId_wjj_b: String = CNLiveEnvironmentManager.shared.appId_wjj_b
  20 +///网家家B端应用的APPKey
  21 +let APPKey_wjj_b: String = CNLiveEnvironmentManager.shared.appKey_wjj_b
18 22 ///当前应用的登录请求域名
19 23 let APPLoginHost: String! = CNLiveEnvironmentManager.shared.loginHost
20 24 ///当前应用的Secret
... ... @@ -23,9 +27,12 @@ let APPSecret: String = CNLiveEnvironmentManager.shared.appSecret
23 27 let APPBaseMCUrl: String = CNLiveEnvironmentManager.shared.base_mc_url
24 28 /// 网家家内接口
25 29 let APPBaseWjjUrl: String = CNLiveEnvironmentManager.shared.base_wjj_url
  30 +/// 网家家B端内接口
  31 +let APPBaseWjjBUrl: String = CNLiveEnvironmentManager.shared.base_wjj_b_url
26 32 /// 网家家内电商接口
27 33 let APPBaseWjjShopUrl: String = CNLiveEnvironmentManager.shared.base_mjj_shop_url
28 34  
  35 +
29 36 ///当前APP的环境
30 37 let APPCurrentEnvironment: CNLiveEnvironment = CNLiveEnvironmentManager.shared.currentEnvironment
31 38  
... ... @@ -57,12 +64,16 @@ class CNLiveEnvironmentManager: NSObject{
57 64 var appId_wjj: String
58 65 var appKey_wjj: String
59 66 var appSecret: String
  67 + var appId_wjj_b: String
  68 + var appKey_wjj_b: String
60 69 ///登录接口域名
61 70 var loginHost: String
62 71 /// 码云项目的主域名
63 72 var base_mc_url: String
64 73 /// 网家家域名请求
65 74 var base_wjj_url: String
  75 + /// 网家家B端接口
  76 + var base_wjj_b_url: String
66 77 /// 获取IM token 请求域名
67 78 var img_token_url: String
68 79 /// 网家家电商域名请求
... ... @@ -81,9 +92,12 @@ class CNLiveEnvironmentManager: NSObject{
81 92 self.appKey_wjj = ""
82 93 self.loginHost = ""
83 94 self.appSecret = ""
  95 + self.appId_wjj_b = ""
  96 + self.appKey_wjj_b = ""
84 97 self.base_mc_url = ""
85 98 self.img_token_url = ""
86 99 self.base_wjj_url = ""
  100 + self.base_wjj_b_url = ""
87 101 self.base_mjj_shop_url = ""
88 102 self.currentEnvironment = .development
89 103 }
... ... @@ -117,10 +131,13 @@ class CNLiveEnvironmentManager: NSObject{
117 131 self.appKey = "ae3a7ad3e4b9beb7cfe2078db648ebb89aa249ca2e82ac"
118 132 self.appId_wjj = "769_jetj7bq525"
119 133 self.appKey_wjj = "0d57b045ec0c3988a682d94c644e66b9b8e0d2b8ef937d"
  134 + self.appId_wjj_b = "769_jnjxdh3w53"
  135 + self.appKey_wjj_b = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpeLgK0vk5POU5PQ"
120 136 self.appSecret = "3cc9f12db322a3d3656012ef929604cf6d6847471535f9"
121 137 self.loginHost = "https://api.cnlive.com"
122 138 self.img_token_url = "https://api.cnlive.com/open/api2"
123 139 self.base_mc_url = "https://metacode.cnlive.com/api"
  140 + self.base_wjj_b_url = "https://managemall.cnlive.com:8080"
124 141 self.base_wjj_url = "https://apiwjj.cnlive.com"
125 142 self.base_mjj_shop_url = "https://manageshop.cnlive.com"
126 143 }
... ... @@ -130,10 +147,13 @@ class CNLiveEnvironmentManager: NSObject{
130 147 self.appKey = "ae3a7ad3e4b9beb7cfe2078db648ebb89aa249ca2e82ac"
131 148 self.appId_wjj = "769_jetj7bq525"
132 149 self.appKey_wjj = "0d57b045ec0c3988a682d94c644e66b9b8e0d2b8ef937d"
  150 + self.appId_wjj_b = "769_jnjxdh3w53"
  151 + self.appKey_wjj_b = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpeLgK0vk5POU5PQ"
133 152 self.appSecret = "3cc9f12db322a3d3656012ef929604cf6d6847471535f9"
134 153 self.loginHost = "https://api.cnlive.com"
135 154 self.img_token_url = "https://api.cnlive.com/open/api2"
136 155 self.base_mc_url = "https://metacode.cnlive.com/api"
  156 + self.base_wjj_b_url = "https://managemall.cnlive.com:8080"
137 157 self.base_wjj_url = "https://apiwjj.cnlive.com"
138 158 self.base_mjj_shop_url = "https://manageshop.cnlive.com"
139 159 }
... ... @@ -143,10 +163,13 @@ class CNLiveEnvironmentManager: NSObject{
143 163 self.appKey = "064f392f84dfe7bbe9f1eabeda53ea02044213019b0406"
144 164 self.appId_wjj = "769_jetj7bq525"
145 165 self.appKey_wjj = "0d57b045ec0c3988a682d94c644e66b9b8e0d2b8ef937d"
  166 + self.appId_wjj_b = "769_jnjxdh3w53"
  167 + self.appKey_wjj_b = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpeLgK0vk5POU5PQ"
146 168 self.appSecret = "68b5cc42fbdb466d56c2e22b00b1494feec8149f9dd32e"
147 169 self.loginHost = "https://api.cnlive.com"
148 170 self.img_token_url = "https://api.cnlive.com/open/api2"
149 171 self.base_mc_url = "https://metacode.cnlive.com/api"
  172 + self.base_wjj_b_url = "https://managemall.cnlive.com:8080"
150 173 self.base_wjj_url = "https://apiwjj.cnlive.com"
151 174 self.base_mjj_shop_url = "https://manageshop.cnlive.com"
152 175 }
... ...
metaCode/Classes/Extensions/NSString+CNLiveExtensions.swift
... ... @@ -35,4 +35,25 @@ extension NSString {
35 35 }
36 36 return false;
37 37 }
  38 +
  39 + /// 时间戳转字符串
  40 + /// - Parameter dateFormat: 时间格式
  41 + /// - Returns: 返回
  42 + func timeStrChangeTotimeInterval(dateFormat:String?) -> String {
  43 + if !self.isNotBlank() {
  44 + return ""
  45 + }
  46 + let format = DateFormatter.init()
  47 + format.dateStyle = .medium
  48 + format.timeStyle = .short
  49 + format.locale = Locale(identifier: "zh_CN")
  50 + format.timeZone = TimeZone(abbreviation: "UTC+8:00")
  51 + if dateFormat == nil {
  52 + format.dateFormat = "yyyy-MM-dd HH:mm:ss"
  53 + }else{
  54 + format.dateFormat = dateFormat
  55 + }
  56 + let date = format.date(from: self as String)
  57 + return "\(Int(date!.timeIntervalSince1970))"
  58 + }
38 59 }
... ...
metaCode/Classes/Main/MinePage/Controller/CNLiveInfoShowViewController.swift
... ... @@ -12,6 +12,7 @@ enum ListShowInfoType {
12 12 case service
13 13 case privacy
14 14 case yinsi
  15 + case safety
15 16 }
16 17  
17 18 class CNLiveInfoShowViewController: CNLiveBaseViewController, WKNavigationDelegate, WKUIDelegate {
... ... @@ -64,6 +65,9 @@ class CNLiveInfoShowViewController: CNLiveBaseViewController, WKNavigationDelega
64 65 case .yinsi:
65 66 titleName = "隐私协议"
66 67 attrString = "https://wjjh5.cnlive.com/yuanmaYszc.html"
  68 + case .safety:
  69 + titleName = "内容安全协议"
  70 + attrString = "https://wjj.ys1.cnliveimg.com/term/cnBNraqxy.html "
67 71 case .none:
68 72 break
69 73 }
... ...
metaCode/Classes/Main/MinePage/Controller/CNLiveMineAddInfoViewController.swift
... ... @@ -68,23 +68,14 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel
68 68 return copyButton
69 69 }()
70 70  
71   - var is_sort: Bool!
72 71 var pageNum: NSInteger
73 72 var network_type: CNLiveMineResponseType!
74 73 var _show_type:CNLiveMineInfoShowType!
75 74 init(show_type:CNLiveMineInfoShowType) {
76   - self.is_sort = false
77 75 self.pageNum = 1
78 76 super.init(nibName:nil, bundle:nil)
79 77 _show_type = show_type
80 78 }
81   -
82   - override func viewWillDisappear(_ animated: Bool) {
83   - super.viewWillDisappear(animated)
84   - if self.is_sort {
85   - NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthSortNotificationResult, object: nil)
86   - }
87   - }
88 79  
89 80 required init?(coder: NSCoder) {
90 81 fatalError("init(coder:) has not been implemented")
... ... @@ -214,7 +205,7 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel
214 205 for item in self.dataArray {
215 206 let authModel = item as! StandListModel
216 207 if authModel.auth {
217   - is_sort = true
  208 + NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthSortNotificationResult, object: nil)
218 209 break
219 210 }
220 211 }
... ... @@ -332,7 +323,11 @@ extension CNLiveMineAddInfoViewController {
332 323 showMessage(message: "您已添加此身份,请直接使用")
333 324 return
334 325 }
335   - self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: listModel), animated: true)
  326 + if listModel.id == 9 {
  327 + self.navigationController?.pushViewController(CNLiveMineShopViewController.init(showType: .one, listModel: listModel, tempArray: []), animated: true)
  328 + } else {
  329 + self.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: listModel), animated: true)
  330 + }
336 331 }
337 332 }
338 333 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
... ... @@ -359,14 +354,16 @@ extension CNLiveMineAddInfoViewController {
359 354 func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath,
360 355 to destinationIndexPath: IndexPath) {
361 356 objc_sync_enter(self)
362   - is_sort = true
363   - swap(&dataArray[sourceIndexPath.row], &dataArray[destinationIndexPath.row])
364   - let tempArray = NSMutableArray()
365   - for model in dataArray {
366   - let m = model as! MineAuthListModel
367   - tempArray.add(m.identityId)
  357 + if dataArray.count > 1 {
  358 + NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthSortNotificationResult, object: nil)
  359 + swap(&dataArray[sourceIndexPath.row], &dataArray[destinationIndexPath.row])
  360 + let tempArray = NSMutableArray()
  361 + for model in dataArray {
  362 + let m = model as! MineAuthListModel
  363 + tempArray.add(m.identityId)
  364 + }
  365 + StandSortManager.insertSortData(indexs: tempArray)
368 366 }
369   - StandSortManager.insertSortData(indexs: tempArray)
370 367 objc_sync_exit(self)
371 368 }
372 369 }
... ...
metaCode/Classes/Main/MinePage/Controller/CNLiveMineAuthResultViewController.swift
... ... @@ -6,9 +6,11 @@
6 6 //
7 7  
8 8 import Foundation
  9 +import SnapKit
9 10  
10 11 enum CNLiveMineAuthResultShowType {
11 12 case detail//认证身份详情界面
  13 + case detail_shop//店铺信息提交完成
12 14 case result_success//身份信息结果页成功
13 15 case result_failer//身份信息结果页失败
14 16 }
... ... @@ -17,16 +19,24 @@ class CNLiveMineAuthResultViewController: CNLiveBaseViewController {
17 19  
18 20 lazy var mainView: UIImageView = {
19 21 let mainView = UIImageView()
20   - mainView.backgroundColor = .white
21 22 mainView.contentMode = .scaleToFill
22   - mainView.isHidden = !(_show_type == .result_success || _show_type == .result_failer)
23   - mainView.image = UIImage(named: (_show_type == .result_success ? "mine_auth_result_header_success" : "mine_auth_result_header_failer"))
  23 + mainView.backgroundColor = .clear
  24 + if _show_type == .detail_shop {
  25 + mainView.image = UIImage(named: "mine_header_upload_result_info")
  26 + } else {
  27 + mainView.isHidden = !(_show_type == .result_success || _show_type == .result_failer)
  28 + mainView.image = UIImage(named: (_show_type == .result_success ? "mine_auth_result_header_success" : "mine_auth_result_header_failer"))
  29 + }
24 30 return mainView
25 31 }()
26 32  
27 33 lazy var tipName: UILabel = {
28 34 let tipName = UILabel.init()
29   - tipName.text = "资料审核中"
  35 + if _show_type == .detail_shop {
  36 + tipName.text = "恭喜您,提交成功"
  37 + } else {
  38 + tipName.text = "资料审核中"
  39 + }
30 40 tipName.font = BoldFont_18_Fit
31 41 tipName.textAlignment = .center
32 42 tipName.textColor = .black
... ... @@ -35,7 +45,11 @@ class CNLiveMineAuthResultViewController: CNLiveBaseViewController {
35 45  
36 46 lazy var tipDesc: UILabel = {
37 47 let tipDesc = UILabel.init()
38   - tipDesc.text = "请耐心等待,预计一分钟之内完成审核"
  48 + if _show_type == .detail_shop {
  49 + tipDesc.text = "请等待3个工作日,审核通过即可入驻平台!"
  50 + } else {
  51 + tipDesc.text = "请耐心等待,预计一分钟之内完成审核"
  52 + }
39 53 tipDesc.textColor = HexColor("#A9A9A9")
40 54 tipDesc.textAlignment = .center
41 55 tipDesc.font = Font_13
... ... @@ -44,10 +58,20 @@ class CNLiveMineAuthResultViewController: CNLiveBaseViewController {
44 58  
45 59 lazy var sendButton: UIButton = {
46 60 let sendButton = UIButton(type: .custom)
47   - sendButton.setTitle("确 定", for: .normal)
48   - sendButton.setTitleColor(.white, for: .normal)
49   - sendButton.titleLabel?.font = BoldFont_16_Fit
50   - sendButton.layer.cornerRadius = 20
  61 + if _show_type == .detail_shop {
  62 + sendButton.backgroundColor = .clear
  63 + sendButton.setTitle(" 我知道了 ", for: .normal)
  64 + sendButton.setTitleColor(HexColor("#609BFF"), for: .normal)
  65 + sendButton.titleLabel?.font = BoldFont_16_Fit
  66 + sendButton.layer.borderColor = HexColor("#609BFF")?.cgColor
  67 + sendButton.layer.borderWidth = 0.5
  68 + sendButton.layer.cornerRadius = 15
  69 + } else {
  70 + sendButton.layer.cornerRadius = 20
  71 + sendButton.setTitle("确 定", for: .normal)
  72 + sendButton.setTitleColor(.white, for: .normal)
  73 + sendButton.titleLabel?.font = BoldFont_16_Fit
  74 + }
51 75 sendButton.layer.masksToBounds = true
52 76 sendButton.addTarget(self, action: #selector(sendInfoActionMothod), for: .touchUpInside)
53 77 return sendButton
... ... @@ -63,7 +87,7 @@ class CNLiveMineAuthResultViewController: CNLiveBaseViewController {
63 87 var _status: UIStatusBarStyle! = .lightContent
64 88 var _listModel:StandListModel!
65 89 var _show_type:CNLiveMineAuthResultShowType!
66   - init(listModel:StandListModel,show_type:CNLiveMineAuthResultShowType) {
  90 + init(_ listModel:StandListModel,show_type:CNLiveMineAuthResultShowType) {
67 91 super.init(nibName:nil, bundle:nil)
68 92 _listModel = listModel
69 93 _show_type = show_type
... ... @@ -75,16 +99,28 @@ class CNLiveMineAuthResultViewController: CNLiveBaseViewController {
75 99  
76 100 override func viewWillAppear(_ animated: Bool) {
77 101 super.viewWillAppear(animated)
78   - if _show_type == .result_failer || _show_type == .result_success {
  102 + if _show_type == .detail_shop {
79 103 let tempArray = NSMutableArray.init()
80 104 self.navigationController?.viewControllers.forEach({ item in
81   - if (item.isKind(of: CNLiveMineInputViewController.self)) {
  105 + if (item.isKind(of: CNLiveMineShopViewController.self)) {
82 106 tempArray.remove(item)
83 107 }else{
84 108 tempArray.add(item)
85 109 }
86 110 })
87 111 self.navigationController?.viewControllers = tempArray as! [CNLiveBaseViewController]
  112 + } else {
  113 + if _show_type == .result_failer || _show_type == .result_success {
  114 + let tempArray = NSMutableArray.init()
  115 + self.navigationController?.viewControllers.forEach({ item in
  116 + if (item.isKind(of: CNLiveMineInputViewController.self)) {
  117 + tempArray.remove(item)
  118 + }else{
  119 + tempArray.add(item)
  120 + }
  121 + })
  122 + self.navigationController?.viewControllers = tempArray as! [CNLiveBaseViewController]
  123 + }
88 124 }
89 125 }
90 126  
... ... @@ -92,19 +128,33 @@ class CNLiveMineAuthResultViewController: CNLiveBaseViewController {
92 128 super.viewDidLoad()
93 129  
94 130 navigationBarHidden = false
95   - view.backgroundColor = .white
96   - topNavView.backgroundColor = .clear
97   - titleName = "添加\(_listModel.name!)"
98   - titleLabel.textColor = .white
99   - leftBtnWhite = true
100   - _status = .lightContent
101   - setNeedsStatusBarAppearanceUpdate()
102   -
103   -
  131 + if _show_type == .detail_shop {
  132 + view.backgroundColor = HexColor("#F7F8FA")
  133 + topNavView.backgroundColor = .clear
  134 + titleName = "提交成功"
  135 + titleLabel.textColor = .black
  136 + _status = .default
  137 + setNeedsStatusBarAppearanceUpdate()
  138 + } else {
  139 + view.backgroundColor = .white
  140 + topNavView.backgroundColor = .clear
  141 + titleName = "添加\(_listModel.name!)"
  142 + titleLabel.textColor = .white
  143 + leftBtnWhite = true
  144 + _status = .lightContent
  145 + setNeedsStatusBarAppearanceUpdate()
  146 + }
  147 +
104 148 view.insertSubview(mainView, belowSubview: topNavView)
105 149 mainView.snp.makeConstraints { make in
106   - make.left.top.right.equalToSuperview()
107   - make.height.equalTo(346)
  150 + if _show_type == .detail_shop {
  151 + make.centerX.equalToSuperview()
  152 + make.centerY.equalToSuperview().offset(-100)
  153 + make.size.equalTo(150)
  154 + } else {
  155 + make.left.top.right.equalToSuperview()
  156 + make.height.equalTo(346)
  157 + }
108 158 }
109 159 view.addSubview(tipName)
110 160 tipName.snp.makeConstraints { make in
... ... @@ -121,37 +171,48 @@ class CNLiveMineAuthResultViewController: CNLiveBaseViewController {
121 171 view.addSubview(sendButton)
122 172 sendButton.snp.makeConstraints { make in
123 173 make.centerX.equalToSuperview()
124   - make.top.equalTo(tipDesc.snp.bottom).offset(50)
125   - make.height.equalTo(40)
126   - make.width.equalTo(150)
127   - }
128   - view.addSubview(iDCardView)
129   - iDCardView.snp.makeConstraints { make in
130   - make.centerX.equalToSuperview()
131   - make.top.equalToSuperview().offset(get_system_nav_height()+30)
132   - make.height.equalTo((KSreenWidth-40) * 0.64)
133   - make.width.equalTo(KSreenWidth-40)
  174 + if _show_type == .detail_shop {
  175 + make.top.equalTo(tipDesc.snp.bottom).offset(20)
  176 + make.height.equalTo(30)
  177 + make.width.equalTo(100)
  178 + } else {
  179 + make.top.equalTo(tipDesc.snp.bottom).offset(50)
  180 + make.height.equalTo(40)
  181 + make.width.equalTo(150)
  182 + }
134 183 }
135   - sendButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 1),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
136 184  
137   - CNLiveMineViewModel.startKeepTimeWithStand(id: "\(_listModel.id)") { [weak self] result, respStatue in
138   - if respStatue == .success {
139   - let listBaseModel = result as! MineStandInfoBaseModel
140   - self?.titleLabel.textColor = .black
141   - self?.leftBtnWhite = false
142   - self?.mainView.isHidden = true
143   - self?.iDCardView.isHidden = false
144   - self?.iDCardView.idModel = self?._listModel
145   - self?.tipName.text = "恭喜您通过认证"
146   - self?.tipDesc.text = listBaseModel.name!.count > 0 ? "您已是\(listBaseModel.name ?? "")!" : "恭喜您通过认证"
147   - self?._status = .default
148   - self?.setNeedsStatusBarAppearanceUpdate()
149   - NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthNotificationSuccess, object: nil)
150   - }else{
151   - self?.iDCardView.isHidden = true
152   - self?.mainView.image = UIImage(named: "mine_auth_result_header_failer")
153   - self?.tipName.text = "审核失败"
154   - self?.tipDesc.text = "请您修改后重新提交"
  185 + if _show_type == .detail_shop {
  186 +
  187 + } else {
  188 + view.addSubview(iDCardView)
  189 + iDCardView.snp.makeConstraints { make in
  190 + make.centerX.equalToSuperview()
  191 + make.top.equalToSuperview().offset(get_system_nav_height()+30)
  192 + make.height.equalTo((KSreenWidth-40) * 0.64)
  193 + make.width.equalTo(KSreenWidth-40)
  194 + }
  195 + sendButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 1),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
  196 +
  197 + CNLiveMineViewModel.startKeepTimeWithStand(id: "\(_listModel.id)") { [weak self] result, respStatue in
  198 + if respStatue == .success {
  199 + let listBaseModel = result as! MineStandInfoBaseModel
  200 + self?.titleLabel.textColor = .black
  201 + self?.leftBtnWhite = false
  202 + self?.mainView.isHidden = true
  203 + self?.iDCardView.isHidden = false
  204 + self?.iDCardView.idModel = self?._listModel
  205 + self?.tipName.text = "恭喜您通过认证"
  206 + self?.tipDesc.text = listBaseModel.name!.count > 0 ? "您已是\(listBaseModel.name ?? "")!" : "恭喜您通过认证"
  207 + self?._status = .default
  208 + self?.setNeedsStatusBarAppearanceUpdate()
  209 + NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthNotificationSuccess, object: nil)
  210 + }else{
  211 + self?.iDCardView.isHidden = true
  212 + self?.mainView.image = UIImage(named: "mine_auth_result_header_failer")
  213 + self?.tipName.text = "审核失败"
  214 + self?.tipDesc.text = "请您修改后重新提交"
  215 + }
155 216 }
156 217 }
157 218 }
... ...
metaCode/Classes/Main/MinePage/Controller/CNLiveMineInputViewController.swift
... ... @@ -140,7 +140,7 @@ class CNLiveMineInputViewController : CNLiveBaseViewController, UITableViewDeleg
140 140 showMessage(message: "上传成功")
141 141 sendButton.stopAnimating()
142 142 DispatchQueue.main.asyncAfter(deadline: .now()+1) { [self] in
143   - self.navigationController?.pushViewController(CNLiveMineAuthResultViewController.init(listModel: _listModel,show_type: .result_success), animated: true)
  143 + self.navigationController?.pushViewController(CNLiveMineAuthResultViewController.init(_listModel,show_type: .result_success), animated: true)
144 144 }
145 145 }
146 146 }
... ... @@ -228,7 +228,7 @@ extension CNLiveMineInputViewController {
228 228 self.view.endEditing(true)
229 229 DispatchQueue.main.asyncAfter(deadline: .now()+0.5) {
230 230 MineStandListAlertView.showStandListView(infos: infoModel.children as NSArray,name: "选择\(infoModel.name ?? "")", show_type: show_type) {[weak self] text in
231   - infoModel.value = text
  231 + infoModel.value = text as? String
232 232 self?.tableView.reloadData()
233 233 let is_result = self?.inspectResult()
234 234 self?.setupWithSendBtnStatue(statue: is_result ?? true)
... ...
metaCode/Classes/Main/MinePage/Controller/CNLiveMineShopViewController.swift 0 → 100644
  1 +//
  2 +// CNLiveMineShopViewController.swift
  3 +// metaCode
  4 +//
  5 +// Created by open on 2023/10/11.
  6 +//
  7 +
  8 +import UIKit
  9 +import Foundation
  10 +import SnapKit
  11 +import APButton
  12 +
  13 +enum CNLiveMineShopResultShowType {
  14 + case one //营业执照
  15 + case two //法人身份证
  16 + case three //经营信息
  17 +}
  18 +class CNLiveMineShopViewController : CNLiveBaseViewController, UITextViewDelegate {
  19 +
  20 + lazy var mainScrollView: UIScrollView = {
  21 + let mainScrollView = UIScrollView.init(frame: CGRectMake(0, get_system_nav_height(), KSreenWidth, KSreenHeight - get_system_nav_height() - get_system_tabbar_ui_offsetHeight() - 70))
  22 + mainScrollView.backgroundColor = HexColor("#F7F8FA")
  23 + mainScrollView.showsHorizontalScrollIndicator = true
  24 + mainScrollView.isScrollEnabled = true
  25 + return mainScrollView
  26 + }()
  27 +
  28 + lazy var oneView: MineInputShopHeaderView = {
  29 + let oneView = MineInputShopHeaderView.init(frame: CGRectMake(10, 0, KSreenWidth - 20, 0), array: oneArray as! Array<Any>, showType: .one)
  30 + oneView.backgroundColor = HexColor("#F7F8FA")
  31 + return oneView
  32 + }()
  33 +
  34 + lazy var twoView: MineInputShopHeaderView = {
  35 + let twoView = MineInputShopHeaderView.init(frame: CGRectMake(10, 0, KSreenWidth - 20, 0), array: twoArray as! Array<Any>, showType: .two)
  36 + twoView.backgroundColor = HexColor("#F7F8FA")
  37 + return twoView
  38 + }()
  39 +
  40 + lazy var threeView: MineInputShopHeaderView = {
  41 + let threeView = MineInputShopHeaderView.init(frame: CGRectMake(10, 0, KSreenWidth - 20, 0), array: threeArray as! Array<Any>, showType: .three)
  42 + threeView.backgroundColor = HexColor("#F7F8FA")
  43 + return threeView
  44 + }()
  45 +
  46 + lazy var textView: UITextView = {
  47 + let attributedString = NSMutableAttributedString(string: "我同意并已阅读《中国网+内容安全协议》",
  48 + attributes: [.foregroundColor: HexColor("#999999") as Any, .font: Font_10])
  49 + let p_Range = NSRange(attributedString.string.range(of: "《中国网+内容安全协议》")!, in: attributedString.string)
  50 + attributedString.addAttribute(.link, value: "delegate://", range: p_Range)
  51 + let textView: UITextView = UITextView.init()
  52 + textView.backgroundColor = .clear
  53 + textView.isEditable = false
  54 + textView.isScrollEnabled = false
  55 + textView.delegate = self
  56 + textView.attributedText = attributedString
  57 + return textView
  58 + }()
  59 +
  60 + lazy var selectButton: HotButton = {
  61 + let selectButton = HotButton(type: .custom)
  62 + selectButton.backgroundColor = .clear
  63 + selectButton.setImage(UIImage(named: "Login_body_choose_btn_nomal"), for: .normal)
  64 + selectButton.setImage(UIImage(named: "Login_body_choose_btn_nomal"), for: .highlighted)
  65 + selectButton.setImage(UIImage(named: "Login_body_choose_btn_select"), for: .selected)
  66 + selectButton.contentMode = .scaleAspectFill
  67 + selectButton.addTarget(self, action: #selector(changeSelectBtnMothod), for: .touchUpInside)
  68 + return selectButton
  69 + }()
  70 +
  71 + lazy var nextButton: APButton = {
  72 + let nextButton = APButton()
  73 + nextButton.setTitleColor(.white, for: .normal)
  74 + nextButton.titleLabel?.font = BoldFont_16_Fit
  75 + nextButton.layer.cornerRadius = 20
  76 + nextButton.layer.masksToBounds = true
  77 + nextButton.activityIndicator.color = .white
  78 + nextButton.addTarget(self, action: #selector(sendInfoActionMothod), for: .touchUpInside)
  79 + return nextButton
  80 + }()
  81 +
  82 + var _listModel:StandListModel!
  83 + var _tempArray:NSMutableArray!
  84 + var _showType:CNLiveMineShopResultShowType!
  85 + init(showType: CNLiveMineShopResultShowType,listModel:StandListModel,tempArray:NSMutableArray) {
  86 + super.init(nibName:nil, bundle:nil)
  87 + _showType = showType
  88 + _listModel = listModel
  89 + _tempArray = tempArray
  90 + }
  91 +
  92 + /**
  93 + 1 大输入框
  94 + 2 小输入框
  95 + 3 下弹框时间选择
  96 + 4 开关按钮
  97 + 5 竖图带提示图片选择
  98 + */
  99 + lazy var oneArray: NSMutableArray = {
  100 + let dataArray = NSMutableArray()
  101 + let array : [NSMutableDictionary] = [["title":"*商户名称","placeholder":"请填写","subTitle":"若营业执照上的名称为空或为“无字号”,请填写“个体户+经营者姓名如:个体户张三","show_type":"1","content":"","key":"commercial_name"],
  102 + ["title":"*统一社会信用代码","placeholder":"请填写","subTitle":"","show_type":"2","content":"","key":"credit_code"],
  103 + ["title":"*注册地址","placeholder":"请填写","subTitle":"","show_type":"2","content":"","key":"registered_address"],
  104 + ["title":"*经营期限(开始)","placeholder":"请选择","subTitle":"","show_type":"3","content":"","key":"management_start_time"],
  105 + ["title":"*经营期限(结束)","placeholder":"请选择","subTitle":"","show_type":"3","content":"","key":"management_stop_time"],
  106 + ["title":"*长期经营","placeholder":"","subTitle":"","show_type":"4","content":"","key":""],
  107 + ["title":"*营业执照","placeholder":"","subTitle":"请上传营业执照图片,格式为JPG、PNG (图片大小不超过5M)","show_type":"5","content":"","key":"business_licence_img"],
  108 + ]
  109 + dataArray.addObjects(from: array)
  110 + return dataArray
  111 + }()
  112 +
  113 + /**
  114 + 6 单选
  115 + 7 身份证类型
  116 + */
  117 + lazy var twoArray: NSMutableArray = {
  118 + let dataArray = NSMutableArray()
  119 + let array : [NSMutableDictionary] = [["title":"*证件类型","placeholder":"身份证","subTitle":"","show_type":"6","content":"","key":""],
  120 + ["title":"*身份证正面","placeholder":"","subTitle":"(请拍摄本人身份证正面注意避免证件反光)","show_type":"7","content":"","key":"identification_card1_img"],
  121 + ["title":"*身份证反面","placeholder":"","subTitle":"(请拍摄本人身份证反面注意避免证件反光)","show_type":"7","content":"","key":"identification_card2_img"],
  122 + ["title":"*证件号码","placeholder":"请填写","subTitle":"","show_type":"2","content":"","key":"certificates_code"],
  123 + ["title":"*证件持有人姓名","placeholder":"请填写","subTitle":"","show_type":"2","content":"","key":"certificates_name"],
  124 + ["title":"*证件有效期(开始)","placeholder":"请选择","subTitle":"","show_type":"3","content":"","key":"identity_start_time"],
  125 + ["title":"*证件有效期(结束)","placeholder":"请选择","subTitle":"","show_type":"3","content":"","key":"identity_stop_time"],
  126 + ]
  127 + dataArray.addObjects(from: array)
  128 + return dataArray
  129 + }()
  130 +
  131 + /**
  132 + 8 正方图带提示图片选择
  133 + 9 下弹框类型选择
  134 + */
  135 + lazy var threeArray: NSMutableArray = {
  136 + let dataArray = NSMutableArray()
  137 + let array : [NSMutableDictionary] = [["title":"*店铺名称","placeholder":"请填写","subTitle":"","show_type":"2","content":"","key":"store_name"],
  138 + ["title":"*店铺电话","placeholder":"请填写","subTitle":"","show_type":"2","content":"","key":"service_phone"],
  139 + ["title":"*经营类目","placeholder":"请选择","subTitle":"","show_type":"9","content":"","key":"category_pid","category":"","dataArray":categoryArray as NSArray],
  140 + ["title":"*店铺LOGO","placeholder":"","subTitle":"请上传LOGO图片 (尺寸100*100,图片大小5M以内)","show_type":"5","content":"","key":"store_logo"],
  141 + ["title":"特殊资质","placeholder":"","subTitle":"","show_type":"5","content":"","key":"aptitude_images"],
  142 + ]
  143 + dataArray.addObjects(from: array)
  144 + return dataArray
  145 + }()
  146 +
  147 + required init?(coder: NSCoder) {
  148 + fatalError("init(coder:) has not been implemented")
  149 + }
  150 +
  151 + var is_agree : Bool = false //是否同意协议
  152 + var categoryArray: Array<NSDictionary>!
  153 + var temp_array: NSMutableArray = NSMutableArray.init()
  154 + override func viewDidLoad() {
  155 + super.viewDidLoad()
  156 +
  157 + navigationBarHidden = false
  158 + view.backgroundColor = HexColor("#F7F8FA")
  159 +
  160 + setupUI()
  161 +
  162 + }
  163 +
  164 + func setupUI() {
  165 + view.addSubview(mainScrollView)
  166 +
  167 + view.addSubview(nextButton)
  168 + nextButton.snp.makeConstraints { make in
  169 + make.centerX.equalToSuperview()
  170 + make.bottom.equalToSuperview().offset(-(get_system_tabbar_ui_offsetHeight()+10))
  171 + make.left.equalToSuperview().offset(10)
  172 + make.right.equalToSuperview().offset(-10)
  173 + make.height.equalTo(40)
  174 + }
  175 +
  176 + if _showType == .one {
  177 + titleName = "营业执照"
  178 + mainScrollView.addSubview(oneView)
  179 + nextButton.setTitle("下一步", for: .normal)
  180 + oneView.frame = CGRectMake(10, 10, KSreenWidth-20, CGFloat(oneView.temp_h+160))
  181 + mainScrollView.contentSize = CGSizeMake(KSreenWidth, CGFloat(oneView.temp_h+170))
  182 + nextButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 1),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
  183 + }
  184 + if _showType == .two {
  185 + titleName = "法人身份证"
  186 + temp_array.addObjects(from: _tempArray as! [Any])
  187 + mainScrollView.addSubview(twoView)
  188 + nextButton.setTitle("下一步", for: .normal)
  189 + twoView.frame = CGRectMake(10, 10, KSreenWidth-20, CGFloat(twoView.temp_h+160))
  190 + mainScrollView.contentSize = CGSizeMake(KSreenWidth, CGFloat(twoView.temp_h+10))
  191 + twoView.headerView.isHidden = true
  192 + twoView.titleLabel.isHidden = true
  193 + nextButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 1),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
  194 + }
  195 + if _showType == .three {
  196 + titleName = "经营信息"
  197 + temp_array.addObjects(from: _tempArray as! [Any])
  198 + showLoading(message: "")
  199 + CNLiveMineViewModel.requestApplyGroupInAction(resultBlock: { [self] result, respStatue in
  200 + if respStatue == .success {
  201 + categoryArray = result as? Array<NSDictionary>
  202 + mainScrollView.addSubview(threeView)
  203 + nextButton.setTitle("提 交", for: .normal)
  204 + threeView.frame = CGRectMake(10, 10, KSreenWidth-20, CGFloat(threeView.temp_h+160))
  205 + mainScrollView.frame = CGRectMake(0, get_system_nav_height(), KSreenWidth, KSreenHeight - get_system_nav_height() - get_system_tabbar_ui_offsetHeight() - 80)
  206 + mainScrollView.contentSize = CGSizeMake(KSreenWidth, CGFloat(threeView.temp_h+10))
  207 + threeView.headerView.isHidden = true
  208 + threeView.titleLabel.isHidden = true
  209 + view.addSubview(textView)
  210 + textView.snp.makeConstraints { make in
  211 + make.centerX.equalToSuperview()
  212 + make.bottom.equalTo(nextButton.snp.top).offset(-5)
  213 + }
  214 + view.addSubview(selectButton)
  215 + selectButton.snp.makeConstraints { make in
  216 + make.centerY.equalTo(textView)
  217 + make.right.equalTo(textView.snp.left)
  218 + make.size.equalTo(15)
  219 + }
  220 + setupWithSendBtnStatue(statue: false)
  221 + } else {
  222 +
  223 + }
  224 + })
  225 + }
  226 + }
  227 +
  228 + @objc func sendInfoActionMothod() {
  229 + if _showType == .one {
  230 + var image: UIImage!
  231 + var is_have_image: Bool! = false
  232 + var temp_dict: NSMutableDictionary!
  233 + for dict in oneArray {
  234 + let content = (dict as! Dictionary<String, Any>)["content"]
  235 + let title = (dict as! Dictionary<String, Any>)["title"]
  236 + let show_type = (dict as! Dictionary<String, Any>)["show_type"]
  237 + let index = (title! as! String).index((title! as! String).startIndex, offsetBy: 1)
  238 + if show_type as! String == "4" {
  239 + continue
  240 + }
  241 + if content is NSString {
  242 + if content as! String == "" {
  243 + showMessage(message: "\((title! as! String)[index...])不能为空")
  244 + return
  245 + }
  246 + }
  247 + if content is UIImage && content != nil{
  248 + image = content as? UIImage
  249 + temp_dict = dict as? NSMutableDictionary
  250 + }
  251 +
  252 + if title as! String == "*营业执照" && (content is NSString) && (content as! NSString).isNotBlank() {
  253 + is_have_image = true
  254 + }
  255 + }
  256 + if is_have_image {
  257 + temp_array.addObjects(from: oneArray as! [Any])
  258 + self.navigationController?.pushViewController(CNLiveMineShopViewController.init(showType: .two, listModel: _listModel, tempArray: temp_array), animated: true)
  259 + return
  260 + }
  261 + UploadManager.uploadImage(imageData: image.jpegData(compressionQuality: 1.0)! as NSData, progressBlock: {key, progress in
  262 + print("获取进度==>\(progress)")
  263 + }, successBlock: { [self] key,url in
  264 + hiddenLoading()
  265 + temp_dict.removeObject(forKey: "content")
  266 + temp_dict.setObject(url, forKey: "content" as NSCopying)
  267 + temp_array.addObjects(from: oneArray as! [Any])
  268 + self.navigationController?.pushViewController(CNLiveMineShopViewController.init(showType: .two, listModel: _listModel, tempArray: temp_array), animated: true)
  269 + })
  270 + }
  271 + if _showType == .two {
  272 + var image_one: UIImage!
  273 + var image_two: UIImage!
  274 + var is_have_image_one: Bool! = false
  275 + var is_have_image_two: Bool! = false
  276 + var temp_dict_one: NSMutableDictionary!
  277 + var temp_dict_two: NSMutableDictionary!
  278 + for dict in twoArray {
  279 + let content = (dict as! Dictionary<String, Any>)["content"]
  280 + let title = (dict as! Dictionary<String, Any>)["title"]
  281 + let show_type = (dict as! Dictionary<String, Any>)["show_type"]
  282 + let index = (title! as! String).index((title! as! String).startIndex, offsetBy: 1)
  283 + if show_type as! String == "6" {
  284 + continue
  285 + }
  286 + if content is NSString {
  287 + if content as! String == "" {
  288 + showMessage(message: "\((title! as! String)[index...])不能为空")
  289 + return
  290 + }
  291 + }
  292 + if content is UIImage && content != nil && title as! String == "*身份证正面" {
  293 + image_one = content as? UIImage
  294 + temp_dict_one = dict as? NSMutableDictionary
  295 + }
  296 + if content is UIImage && content != nil && title as! String == "*身份证反面" {
  297 + image_two = content as? UIImage
  298 + temp_dict_two = dict as? NSMutableDictionary
  299 + }
  300 + if title as! String == "*身份证正面" && content is NSString && (content as! NSString).isNotBlank() {
  301 + is_have_image_one = true
  302 + }
  303 + if title as! String == "*身份证反面" && content is NSString && (content as! NSString).isNotBlank() {
  304 + is_have_image_two = true
  305 + }
  306 + }
  307 + if is_have_image_one || is_have_image_two {
  308 + temp_array.addObjects(from: twoArray as! [Any])
  309 + self.navigationController?.pushViewController(CNLiveMineShopViewController.init(showType: .three, listModel: _listModel, tempArray: temp_array), animated: true)
  310 + return
  311 + }
  312 + UploadManager.uploadImage(imageData: image_one.jpegData(compressionQuality: 1.0)! as NSData, progressBlock: {key, progress in }, successBlock: { [self] key,url in
  313 + temp_dict_one.removeObject(forKey: "content")
  314 + temp_dict_one.setObject(url, forKey: "content" as NSCopying)
  315 + UploadManager.uploadImage(imageData: image_two.jpegData(compressionQuality: 1.0)! as NSData, progressBlock: {key, progress in }, successBlock: { [self] key,url in
  316 + hiddenLoading()
  317 + temp_dict_two.removeObject(forKey: "content")
  318 + temp_dict_two.setObject(url, forKey: "content" as NSCopying)
  319 + temp_array.addObjects(from: twoArray as! [Any])
  320 + self.navigationController?.pushViewController(CNLiveMineShopViewController.init(showType: .three, listModel: _listModel, tempArray: temp_array), animated: true)
  321 + })
  322 + })
  323 + }
  324 + if _showType == .three {
  325 + if !is_agree {
  326 + showMessage(message: "请先同意《中国网+内容安全协议》")
  327 + return
  328 + }
  329 + var image_one: UIImage!
  330 + var image_two: UIImage!
  331 + var temp_dict_one: NSMutableDictionary!
  332 + var temp_dict_two: NSMutableDictionary!
  333 + for dict in threeArray {
  334 + let content = (dict as! Dictionary<String, Any>)["content"]
  335 + let title = (dict as! Dictionary<String, Any>)["title"]
  336 + let index = (title! as! String).index((title! as! String).startIndex, offsetBy: 1)
  337 + if content is NSString {
  338 + if title as! String == "特殊资质" && content is NSString {} else {
  339 + if content as! String == "" {
  340 + showMessage(message: "\((title! as! String)[index...])不能为空")
  341 + return
  342 + }
  343 + }
  344 + }
  345 + if content is UIImage && content != nil && title as! String == "*店铺LOGO" {
  346 + image_one = content as? UIImage
  347 + temp_dict_one = dict as? NSMutableDictionary
  348 + }
  349 + if content is UIImage && content != nil && title as! String == "特殊资质" {
  350 + image_two = content as? UIImage
  351 + temp_dict_two = dict as? NSMutableDictionary
  352 + }
  353 + }
  354 + UploadManager.uploadImage(imageData: image_one.jpegData(compressionQuality: 1.0)! as NSData, progressBlock: {key, progress in }, successBlock: { [self] key,url in
  355 + temp_dict_one.removeObject(forKey: "content")
  356 + temp_dict_one.setObject(url, forKey: "content" as NSCopying)
  357 + if image_two == nil {
  358 + hiddenLoading()
  359 + temp_array.addObjects(from: threeArray as! [Any])
  360 + uploadWithMessage()
  361 + }else{
  362 + UploadManager.uploadImage(imageData: image_two.jpegData(compressionQuality: 1.0)! as NSData, progressBlock: {key, progress in }, successBlock: { [self] key,url in
  363 + hiddenLoading()
  364 + temp_dict_two.removeObject(forKey: "content")
  365 + temp_dict_two.setObject(url, forKey: "content" as NSCopying)
  366 + temp_array.addObjects(from: threeArray as! [Any])
  367 + uploadWithMessage()
  368 + })
  369 + }
  370 + })
  371 + }
  372 + }
  373 +
  374 + @objc func uploadWithMessage() {
  375 + let paramDict = NSMutableDictionary.init()
  376 + for dict in temp_array {
  377 + let content = (dict as! Dictionary<String, Any>)["content"]
  378 + let key = (dict as! Dictionary<String, Any>)["key"]
  379 + if (dict as! Dictionary<String, Any>)["category"] != nil {
  380 + let category = (dict as! Dictionary<String, Any>)["category"]
  381 + paramDict.addEntries(from: ["category":category as Any])
  382 + }
  383 + if key as! String != ""{
  384 + paramDict.addEntries(from: ["\(key ?? "")":content as Any])
  385 + }
  386 + }
  387 + paramDict.addEntries(from: ["uid":UserInfoManager.shared.userInfo.uid])
  388 + showLoading(message: "")
  389 + nextButton.startAnimating()
  390 + CNLiveMineViewModel.requestApplyShopUserInAction(paramDict: paramDict, resultBlock: { [self] result, respStatue in
  391 + nextButton.stopAnimating()
  392 + if respStatue == .success {
  393 + showMessage(message: "上传成功")
  394 + DispatchQueue.main.asyncAfter(deadline: .now()+1) { [self] in
  395 + self.navigationController?.pushViewController(CNLiveMineAuthResultViewController.init(StandListModel.init(), show_type: .detail_shop), animated: true)
  396 + }
  397 + }
  398 + })
  399 + }
  400 +
  401 + @objc func changeSelectBtnMothod(sender : UIButton) {
  402 + sender.isSelected = !sender.isSelected
  403 + is_agree = sender.isSelected
  404 + if is_agree {
  405 + nextButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 1),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
  406 + } else {
  407 + nextButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 0.3),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 0.3)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
  408 + }
  409 + }
  410 +
  411 + private func setupWithSendBtnStatue(statue: Bool) {
  412 + var alpha = 0.3
  413 + if statue {
  414 + alpha = 1
  415 + }
  416 + nextButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: alpha),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: alpha)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
  417 + }
  418 +}
  419 +extension CNLiveMineShopViewController {
  420 + func textView(_ textView: UITextView, shouldInteractWith textAttachment: NSTextAttachment, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
  421 + return false
  422 + }
  423 + func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
  424 + if URL.absoluteString == "delegate://" {
  425 + self.navigationController?.pushViewController(CNLiveInfoShowViewController.init(show_type: .safety, is_login: true), animated: true)
  426 + return false
  427 + }
  428 + return true
  429 + }
  430 +}
... ...
metaCode/Classes/Main/MinePage/View/CNLiveMineBodyListView.swift
... ... @@ -835,7 +835,7 @@ class MineBodyInputAuthCell: UITableViewCell, UITextFieldDelegate {
835 835 if (infoModel.value ?? "").count > 0 {
836 836 contentField.text = infoModel.value
837 837 }
838   - contentField.placeholder = "请输入\(infoModel.name ?? "")"
  838 + contentField.placeholder = "请输入\(infoModel.name ?? "")"//infoModel.sub_title?.count == 0 ? "请输入\(infoModel.name ?? "")" : infoModel.sub_title
839 839 line_label.isHidden = is_last
840 840 if infoModel.inputType == 2 {
841 841 contentField.keyboardType = .numberPad
... ...
metaCode/Classes/Main/MinePage/View/CNLiveMineInfoAlertView.swift
... ... @@ -9,7 +9,7 @@ import Foundation
9 9  
10 10  
11 11  
12   -typealias CloseGenderResultBlock = (_ text: String) ->Void
  12 +typealias CloseGenderResultBlock = (_ text: Any) ->Void
13 13 class MineInfoAlertView: UIView {
14 14  
15 15 lazy var tapGesture = UITapGestureRecognizer()
... ... @@ -544,6 +544,7 @@ class UpdataAlertView: UIView {
544 544  
545 545 enum CNLiveStandListAlertShowType {
546 546 case custom
  547 + case text
547 548 case date
548 549 }
549 550 class MineStandListAlertView: UIView, UIPickerViewDelegate, UIPickerViewDataSource {
... ... @@ -569,7 +570,11 @@ class MineStandListAlertView: UIView, UIPickerViewDelegate, UIPickerViewDataSour
569 570 pickerView.backgroundColor = .white
570 571 pickerView.delegate = self
571 572 pickerView.dataSource = self
572   - pickerView.isHidden = !(_show_type == .custom)
  573 + pickerView.isHidden = true
  574 + if !(_show_type == .custom) || !(_show_type == .text) {
  575 + pickerView.isHidden = false
  576 + }
  577 +
573 578 return pickerView
574 579 }()
575 580  
... ... @@ -630,7 +635,7 @@ class MineStandListAlertView: UIView, UIPickerViewDelegate, UIPickerViewDataSour
630 635 return closeButton
631 636 }()
632 637  
633   - var text: String?
  638 + var text: Any?
634 639 var _infos: NSArray?
635 640 var _show_type: CNLiveStandListAlertShowType?
636 641 var result: CloseGenderResultBlock?
... ... @@ -641,6 +646,8 @@ class MineStandListAlertView: UIView, UIPickerViewDelegate, UIPickerViewDataSour
641 646 _show_type = show_type//56842.5+7840.34
642 647 if _show_type == .custom {
643 648 text = (infos.firstObject as! MineStandInfoModel).name
  649 + } else if _show_type == .text {
  650 + text = infos.firstObject as? Dictionary<String, String>
644 651 }else{
645 652 let formatter = DateFormatter()
646 653 formatter.dateFormat = "yyyy-MM-dd"
... ... @@ -733,8 +740,15 @@ class MineStandListAlertView: UIView, UIPickerViewDelegate, UIPickerViewDataSour
733 740 }
734 741  
735 742 func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
736   - let infoModel = _infos![row] as! MineStandInfoModel
737   - return infoModel.name
  743 + if _show_type == .custom {
  744 + let infoModel = _infos![row] as! MineStandInfoModel
  745 + return infoModel.name
  746 + }
  747 + if _show_type == .text {
  748 + let dict = _infos![row] as? Dictionary<String, String>
  749 + return dict?["title"] ?? ""
  750 + }
  751 + return ""
738 752 }
739 753  
740 754 func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
... ... @@ -742,8 +756,13 @@ class MineStandListAlertView: UIView, UIPickerViewDelegate, UIPickerViewDataSour
742 756 }
743 757  
744 758 func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
745   - let infoModel = _infos![row] as! MineStandInfoModel
746   - text = infoModel.name ?? ""
  759 + if _show_type == .custom {
  760 + let infoModel = _infos![row] as! MineStandInfoModel
  761 + text = infoModel.name ?? ""
  762 + }
  763 + if _show_type == .text {
  764 + text = _infos![row] as? Dictionary<String, String>
  765 + }
747 766 }
748 767  
749 768 required init?(coder: NSCoder) {
... ...
metaCode/Classes/Main/MinePage/View/CNLiveMineInputMessageView.swift 0 → 100644
  1 +//
  2 +// CNLiveMineInputMessageView.swift
  3 +// metaCode
  4 +//
  5 +// Created by open on 2023/10/11.
  6 +//
  7 +
  8 +import Foundation
  9 +import SnapKit
  10 +import HXPHPicker
  11 +
  12 +typealias changeEndTimeResultBlock = (_ isOn: Bool) ->Void
  13 +/// 里面显示样式
  14 +class MineInputTextShopCustomView: UIView, UITextViewDelegate, UITextFieldDelegate, PhotoPickerControllerDelegate {
  15 +
  16 + lazy var nameLabel: UILabel = {
  17 + let nameLabel = UILabel.init()
  18 + nameLabel.backgroundColor = .white
  19 + nameLabel.textColor = .black
  20 + nameLabel.font = BoldFont_18_Fit
  21 + if _dict["title"] as! String != "特殊资质" {
  22 + let attribute = NSMutableAttributedString.init(string: _dict["title"] as! String)
  23 + attribute.addAttributes([NSAttributedString.Key.foregroundColor: HexColor("#FF725C")!], range: NSRange.init(location: 0, length: 1))
  24 + nameLabel.attributedText = attribute
  25 + } else {
  26 + nameLabel.text = _dict["title"] as? String
  27 + }
  28 +
  29 + return nameLabel
  30 + }()
  31 +
  32 + lazy var contentTextField: UITextField = {
  33 + let contentTextField = UITextField.init()
  34 + contentTextField.backgroundColor = .white
  35 + contentTextField.font = BoldFont_16_Fit
  36 + contentTextField.textAlignment = .right
  37 + contentTextField.delegate = self
  38 + contentTextField.isHidden = _dict["show_type"] as! String != "2"
  39 + contentTextField.keyboardType = .default
  40 + contentTextField.clearButtonMode = .whileEditing
  41 + contentTextField.placeholder = _dict["placeholder"] as? String
  42 + return contentTextField
  43 + }()
  44 +
  45 + lazy var contentTextView: UITextView = {
  46 + let contentTextView = UITextView.init()
  47 + contentTextView.backgroundColor = HexColor("#F7F8FA")
  48 + contentTextView.font = BoldFont_16_Fit
  49 + contentTextView.keyboardType = .default
  50 + contentTextView.text = _dict["subTitle"] as? String
  51 + contentTextView.textColor = UIColor.lightGray
  52 + contentTextView.delegate = self
  53 + contentTextView.isHidden = _dict["show_type"] as! String != "1"
  54 + return contentTextView
  55 + }()
  56 +
  57 + lazy var moreBtn: UIButton = {
  58 + let moreBtn = UIButton(type: .custom)
  59 + moreBtn.frame = CGRect(x: 0, y: 0, width: 70, height: 30)
  60 + moreBtn.setTitleColor(HexColor("#B4B4B4"), for: .normal)
  61 + moreBtn.titleLabel?.font = BoldFont_16_Fit
  62 + moreBtn.isHidden = true
  63 + moreBtn.setTitle(_dict["placeholder"] as? String, for: .normal)
  64 + if _dict["show_type"] as! String == "3" {
  65 + moreBtn.isHidden = false
  66 + }
  67 + if _dict["show_type"] as! String == "9" {
  68 + moreBtn.isHidden = false
  69 + }
  70 + moreBtn.setImage(UIImage(named: "mine_header_message_gray_more"), for: .normal)
  71 + moreBtn.setupButtonImageAndTitlePossitionWith(padding: 0, style: .right)
  72 + moreBtn.addTarget(self, action: #selector(checkInAction), for: .touchUpInside)
  73 + return moreBtn
  74 + }()
  75 +
  76 + lazy var switchView: UISwitch = {
  77 + let switchView = UISwitch.init()
  78 + switchView.isOn = false
  79 + switchView.onTintColor = HexColor("#609AFF")
  80 + switchView.isHidden = _dict["show_type"] as! String != "4"
  81 + switchView.addTarget(self, action: #selector(switchInAction), for: .valueChanged)
  82 + return switchView
  83 + }()
  84 +
  85 + lazy var bigImageBtn: UIButton = {
  86 + let bigImageBtn = UIButton(type: .custom)
  87 + bigImageBtn.isHidden = true
  88 + if _dict["show_type"] as! String == "7" {
  89 + bigImageBtn.isHidden = false
  90 + if _dict["title"] as! String == "*身份证正面" {
  91 + bigImageBtn.setImage(UIImage(named: "mine_header_icon_idcard_zhen"), for: .normal)
  92 + }
  93 + if _dict["title"] as! String == "*身份证反面" {
  94 + bigImageBtn.setImage(UIImage(named: "mine_header_icon_idcard_fan"), for: .normal)
  95 + }
  96 + }
  97 + if _dict["show_type"] as! String == "5" || _dict["show_type"] as! String == "8" {
  98 + bigImageBtn.isHidden = false
  99 + bigImageBtn.setImage(UIImage(named: "mine_header_icon_sellect"), for: .normal)
  100 + }
  101 + bigImageBtn.contentMode = .scaleAspectFit
  102 + bigImageBtn.backgroundColor = .white
  103 + bigImageBtn.layer.cornerRadius = 5
  104 + bigImageBtn.layer.masksToBounds = true
  105 + bigImageBtn.addTarget(self, action: #selector(selectInAction), for: .touchUpInside)
  106 + return bigImageBtn
  107 + }()
  108 +
  109 + lazy var changeBtn: UIButton = {
  110 + let changeBtn = UIButton(type: .custom)
  111 + changeBtn.backgroundColor = UIColor.init(white: 0, alpha: 0.5)
  112 + changeBtn.setTitle("更换", for: .normal)
  113 + changeBtn.setTitleColor(.white, for: .normal)
  114 + changeBtn.titleLabel?.font = Font_14_Fit
  115 + changeBtn.isHidden = true
  116 + changeBtn.addTarget(self, action: #selector(selectInAction), for: .touchUpInside)
  117 + return changeBtn
  118 + }()
  119 +
  120 + lazy var descLabel: UILabel = {
  121 + let descLabel = UILabel.init()
  122 + descLabel.textColor = HexColor("#B4B4B4")
  123 + descLabel.font = Font_14_Fit
  124 + descLabel.textAlignment = .left
  125 + descLabel.isHidden = true
  126 + if _dict["show_type"] as! String == "7" {
  127 + descLabel.isHidden = false
  128 + let attribute = NSMutableAttributedString.init(string: _dict["subTitle"] as! String)
  129 + attribute.addAttributes([NSAttributedString.Key.foregroundColor: HexColor("#FF725C")!], range: NSRange.init(location: 9, length: 2))
  130 + attribute.addAttributes([NSAttributedString.Key.font: BoldFont_16_Fit], range: NSRange.init(location: 9, length: 2))
  131 + descLabel.attributedText = attribute
  132 + }
  133 + if _dict["show_type"] as! String == "5" || _dict["show_type"] as! String == "8" {
  134 + descLabel.isHidden = false
  135 + descLabel.text = _dict["subTitle"] as? String
  136 + }
  137 + descLabel.numberOfLines = 0
  138 + descLabel.lineBreakMode = .byWordWrapping
  139 + return descLabel
  140 + }()
  141 +
  142 + lazy var selectView: UIView = {
  143 + let selectView = UIView.init()
  144 + selectView.backgroundColor = .white
  145 + selectView.isHidden = _dict["show_type"] as! String != "6"
  146 + selectView.layer.cornerRadius = 8
  147 + selectView.layer.masksToBounds = true
  148 + selectView.layer.borderColor = HexColor("#666666")?.cgColor
  149 + selectView.layer.borderWidth = 0.5
  150 + return selectView
  151 + }()
  152 +
  153 + lazy var selectButton : UIButton = {
  154 + let selectButton = UIButton(type: .custom)
  155 + selectButton.backgroundColor = HexColor("#F5A623")
  156 + selectButton.isHidden = _dict["show_type"] as! String != "6"
  157 + selectButton.layer.cornerRadius = 5
  158 + selectButton.layer.masksToBounds = true
  159 + selectButton.setImage(UIImage.imageWithColor(color: HexColor("#F5A623")!, size: CGSizeMake(5, 5)), for: .normal)
  160 + return selectButton
  161 + }()
  162 +
  163 + lazy var selectLabel : UILabel = {
  164 + let selectLabel = UILabel.init()
  165 + selectLabel.text = "身份证"
  166 + selectLabel.isHidden = _dict["show_type"] as! String != "6"
  167 + selectLabel.textColor = HexColor("#333333")
  168 + selectLabel.font = Font_16_Fit
  169 + selectLabel.textAlignment = .right
  170 + return selectLabel
  171 + }()
  172 +
  173 + lazy var bottem_line: UILabel = {
  174 + let bottem_line = UILabel.init()
  175 + bottem_line.backgroundColor = HexColor("#E6E6E6")
  176 + return bottem_line
  177 + }()
  178 +
  179 + var _dict: NSMutableDictionary!
  180 + var _resultBlock: changeEndTimeResultBlock!
  181 + init(frame: CGRect, dict: NSMutableDictionary, resultBlock: @escaping changeEndTimeResultBlock) {
  182 + super.init(frame: frame)
  183 + _dict = dict
  184 + _resultBlock = resultBlock
  185 +
  186 + addSubview(nameLabel)
  187 + nameLabel.snp.makeConstraints { make in
  188 + if _dict["show_type"] as! String == "1" ||
  189 + _dict["show_type"] as! String == "5" ||
  190 + _dict["show_type"] as! String == "7" ||
  191 + _dict["show_type"] as! String == "8" {
  192 + make.top.equalToSuperview().offset(10)
  193 + make.height.equalTo(25)
  194 + } else {
  195 + make.centerY.equalToSuperview()
  196 + }
  197 + make.left.equalToSuperview().offset(10)
  198 + }
  199 + addSubview(contentTextField)
  200 + contentTextField.snp.makeConstraints { make in
  201 + if _dict["show_type"] as! String == "1" {
  202 + make.top.equalToSuperview().offset(10)
  203 + make.height.equalTo(20)
  204 + } else {
  205 + make.centerY.equalToSuperview()
  206 + make.height.equalTo(40)
  207 + }
  208 + make.right.equalToSuperview().offset(-10)
  209 + make.left.equalTo(nameLabel.snp.right).offset(10)
  210 +
  211 + }
  212 + addSubview(bottem_line)
  213 + bottem_line.snp.makeConstraints { make in
  214 + make.centerX.equalToSuperview()
  215 + make.left.equalToSuperview().offset(10)
  216 + make.right.equalToSuperview().offset(-10)
  217 + make.height.equalTo(0.5)
  218 + make.bottom.equalToSuperview().offset(-0.5)
  219 + }
  220 +
  221 + addSubview(contentTextView)
  222 + contentTextView.snp.makeConstraints { make in
  223 + make.centerX.equalToSuperview()
  224 + make.left.equalToSuperview().offset(10)
  225 + make.right.equalToSuperview().offset(-10)
  226 + make.top.equalTo(nameLabel.snp.bottom).offset(10)
  227 + make.bottom.equalTo(bottem_line.snp.top).offset(10)
  228 + }
  229 +
  230 + addSubview(moreBtn)
  231 + moreBtn.snp.makeConstraints { make in
  232 + make.centerY.equalToSuperview()
  233 + make.right.equalToSuperview().offset(-10)
  234 + make.left.equalTo(nameLabel.snp.right).offset(10)
  235 + }
  236 +
  237 + addSubview(switchView)
  238 + switchView.snp.makeConstraints { make in
  239 + make.centerY.equalToSuperview()
  240 + make.right.equalToSuperview().offset(-10)
  241 + }
  242 +
  243 + addSubview(bigImageBtn)
  244 + bigImageBtn.snp.makeConstraints { make in
  245 + if _dict["show_type"] as! String == "7" {
  246 + make.top.equalTo(nameLabel.snp.bottom).offset(10)
  247 + make.left.equalToSuperview().offset(10)
  248 + make.right.bottom.equalToSuperview().offset(-10)
  249 + } else {
  250 + make.top.equalTo(nameLabel.snp.bottom).offset(10)
  251 + make.left.equalToSuperview().offset(10)
  252 + if _dict["show_type"] as! String == "5" {
  253 + make.bottom.equalToSuperview().offset(-10)
  254 + make.width.equalTo(100)
  255 + }
  256 + if _dict["show_type"] as! String == "8" {
  257 + make.size.equalTo(200)
  258 + }
  259 + }
  260 + }
  261 +
  262 + bigImageBtn.addSubview(changeBtn)
  263 + changeBtn.snp.makeConstraints { make in
  264 + make.left.right.bottom.equalToSuperview()
  265 + make.height.equalTo(30)
  266 + }
  267 +
  268 + addSubview(descLabel)
  269 + descLabel.snp.makeConstraints { make in
  270 + if _dict["show_type"] as! String == "7" {
  271 + make.centerY.equalTo(nameLabel)
  272 + make.left.equalTo(nameLabel.snp.right).offset(10)
  273 + make.right.equalToSuperview().offset(-10)
  274 + } else {
  275 + make.bottom.equalToSuperview().offset(-10)
  276 + make.left.equalTo(bigImageBtn.snp.right).offset(10)
  277 + make.right.equalToSuperview().offset(-10)
  278 + }
  279 + }
  280 +
  281 + addSubview(selectLabel)
  282 + selectLabel.snp.makeConstraints { make in
  283 + make.centerY.equalToSuperview()
  284 + make.right.equalToSuperview().offset(-10)
  285 + }
  286 +
  287 + addSubview(selectView)
  288 + selectView.snp.makeConstraints { make in
  289 + make.centerY.equalTo(nameLabel)
  290 + make.right.equalTo(selectLabel.snp.left).offset(-5)
  291 + make.size.equalTo(16)
  292 + }
  293 +
  294 + selectView.addSubview(selectButton)
  295 + selectButton.snp.makeConstraints { make in
  296 + make.top.left.equalToSuperview().offset(3)
  297 + make.size.equalTo(10)
  298 + }
  299 + }
  300 +
  301 + required init?(coder: NSCoder) {
  302 + fatalError("init(coder:) has not been implemented")
  303 + }
  304 +
  305 + func textViewDidBeginEditing(_ textView: UITextView) {
  306 + if textView.textColor == UIColor.lightGray {
  307 + textView.text = nil
  308 + textView.textColor = UIColor.black
  309 + }
  310 + }
  311 +
  312 + func textViewShouldEndEditing(_ textView: UITextView) -> Bool {
  313 + if textView.text.isEmpty {
  314 + textView.text = _dict["subTitle"] as? String
  315 + textView.textColor = UIColor.lightGray
  316 + } else {
  317 + _dict.setObject(textView.text ?? "", forKey: "content" as NSCopying)
  318 + }
  319 + return true
  320 + }
  321 +
  322 + func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
  323 + if !textField.text!.isEmpty {
  324 + _dict.setObject(textField.text ?? "", forKey: "content" as NSCopying)
  325 + }
  326 + return true
  327 + }
  328 +
  329 +
  330 +
  331 + @objc func checkInAction() {
  332 +
  333 + let title = (_dict["title"] as! String)
  334 + let index = title.index(title.startIndex, offsetBy: 1)
  335 + let dataArray = NSMutableArray.init()
  336 + if title == "*经营类目" {
  337 + dataArray.addObjects(from: _dict["dataArray"] as! [NSDictionary])
  338 + }
  339 + contentTextField.resignFirstResponder()
  340 + contentTextView.resignFirstResponder()
  341 + MineStandListAlertView.showStandListView(infos: dataArray, name:String(title[index...]), show_type:dataArray.count == 0 ? .date : .text, result: { [self] text in
  342 + if dataArray.count == 0 {
  343 + _dict.setObject((text as! NSString).timeStrChangeTotimeInterval(dateFormat: "yyyy-MM-dd"), forKey: "content" as NSCopying)
  344 + moreBtn.setTitle(text as? String, for: .normal)
  345 + } else {
  346 + let dict = text as! NSDictionary
  347 + _dict.setObject(dict["id"] as! String, forKey: "content" as NSCopying)
  348 + _dict.setObject(dict["title"] as! String, forKey: "category" as NSCopying)
  349 + moreBtn.setTitle(dict["title"] as? String, for: .normal)
  350 + }
  351 + moreBtn.setImage(UIImage(named: "mine_header_message_gray_more"), for: .normal)
  352 + moreBtn.setupButtonImageAndTitlePossitionWith(padding: 0, style: .right)
  353 + moreBtn.setTitleColor(UIColor.black, for: .normal)
  354 + })
  355 + }
  356 +
  357 + @objc func switchInAction(sender: UISwitch) {
  358 + _resultBlock(sender.isOn)
  359 + }
  360 +
  361 + @objc func selectInAction() {
  362 + contentTextField.resignFirstResponder()
  363 + contentTextView.resignFirstResponder()
  364 + var crop = PhotoCroppingConfiguration.init()
  365 + crop.isRoundCrop = true
  366 + let configuration = PhotoEditorConfiguration()
  367 + configuration.state = .cropping
  368 + configuration.cropping = crop
  369 + configuration.fixedCropState = true
  370 + let config = PhotoTools.getWXPickerConfig()
  371 + config.selectMode = .single
  372 + config.selectOptions = .photo
  373 + config.photoEditor = configuration
  374 + config.maximumSelectedPhotoCount = 1
  375 + let pickerController = PhotoPickerController(picker: config)
  376 + pickerController.pickerDelegate = self
  377 + pickerController.isOriginal = false
  378 + currentViewController()?.navigationController?.present(pickerController, animated: true, completion: nil)
  379 + }
  380 +
  381 +
  382 +
  383 + func pickerController(_ pickerController: PhotoPickerController,
  384 + didFinishSelection result: PickerResult) {
  385 + result.getImage { [self] (image, photoAsset, index) in
  386 + if let image = image {
  387 + _dict.setObject(image , forKey: "content" as NSCopying)
  388 + }else {
  389 + print("failed")
  390 + }
  391 + } completionHandler: { [self] (images) in
  392 + self.bigImageBtn.setImage(images.first, for: .normal)
  393 + if _dict["show_type"] as! String == "7" || _dict["show_type"] as! String == "5" || _dict["show_type"] as! String == "8" {
  394 + self.changeBtn.isHidden = false
  395 + }
  396 + }
  397 + }
  398 +}
  399 +
  400 +/// 顶部流程图显示
  401 +class MineInputShopHeaderView : UIView {
  402 +
  403 + lazy var headerView : UIImageView = {
  404 + let headerView = UIImageView.init()
  405 + headerView.backgroundColor = .white
  406 + headerView.image = UIImage(named: "mine_header_icon_flow")
  407 + headerView.contentMode = .scaleAspectFit
  408 + headerView.layer.masksToBounds = true
  409 + return headerView
  410 + }()
  411 +
  412 + lazy var titleLabel: UILabel = {
  413 + let titleLabel = UILabel.init()
  414 + titleLabel.text = "营业执照"
  415 + titleLabel.textColor = HexColor("#9D9D9D")
  416 + titleLabel.font = BoldFont_17_Fit
  417 + return titleLabel
  418 + }()
  419 +
  420 + var temp_h: Int! = 10
  421 + var temp_dict:NSMutableDictionary!
  422 + var _showType:CNLiveMineShopResultShowType!
  423 + var temp_contentView : MineInputTextShopCustomView!
  424 + init(frame: CGRect, array: Array<Any>, showType: CNLiveMineShopResultShowType) {
  425 + _showType = showType
  426 +
  427 + super.init(frame: frame)
  428 +
  429 + addSubview(headerView)
  430 + headerView.snp.makeConstraints { make in
  431 + make.top.equalToSuperview().offset(10)
  432 + make.left.right.equalToSuperview()
  433 + make.height.equalTo(100)
  434 + }
  435 +
  436 + addSubview(titleLabel)
  437 + titleLabel.snp.makeConstraints { make in
  438 + make.top.equalTo(headerView.snp.bottom).offset(20)
  439 + make.left.equalToSuperview().offset(10)
  440 + make.height.equalTo(20)
  441 + }
  442 +
  443 + for dic in array {
  444 + loadContentView(dic: dic as! NSMutableDictionary)
  445 + }
  446 + }
  447 +
  448 + func loadContentView(dic: NSMutableDictionary) {
  449 + var item_h = 60
  450 + if dic["show_type"]! as! String == "1" {
  451 + item_h = 150
  452 + } else if (dic["show_type"]! as! String == "5" || dic["show_type"]! as! String == "8") {
  453 + item_h = 200
  454 + } else if (dic["show_type"]! as! String == "7") {
  455 + item_h = 250
  456 + }
  457 + let contentView = MineInputTextShopCustomView.init(frame: CGRectZero, dict: dic, resultBlock: { [self] isOn in
  458 + if isOn {
  459 + temp_dict.setObject("-1", forKey: "content" as NSCopying)
  460 + temp_contentView.moreBtn.setTitle("长期", for: .normal)
  461 + temp_contentView.moreBtn.setImage(UIImage(named: "mine_header_message_gray_more"), for: .normal)
  462 + temp_contentView.moreBtn.setupButtonImageAndTitlePossitionWith(padding: 0, style: .right)
  463 + temp_contentView.moreBtn.setTitleColor(UIColor.black, for: .normal)
  464 + } else {
  465 + temp_dict.setObject("", forKey: "content" as NSCopying)
  466 + temp_contentView.moreBtn.setTitle("请选择", for: .normal)
  467 + temp_contentView.moreBtn.setImage(UIImage(named: "mine_header_message_gray_more"), for: .normal)
  468 + temp_contentView.moreBtn.setupButtonImageAndTitlePossitionWith(padding: 0, style: .right)
  469 + temp_contentView.moreBtn.setTitleColor(HexColor("#B4B4B4"), for: .normal)
  470 + }
  471 + })
  472 + contentView.backgroundColor = .white
  473 + addSubview(contentView)
  474 + contentView.snp.makeConstraints { make in
  475 + if _showType == .one {
  476 + make.top.equalTo(titleLabel.snp.bottom).offset(temp_h)
  477 + }
  478 + if _showType == .two || _showType == .three{
  479 + make.top.equalToSuperview().offset(temp_h)
  480 + }
  481 + make.left.right.equalToSuperview()
  482 + make.height.equalTo(item_h)
  483 + }
  484 + if dic["title"]! as! String == "*经营期限(结束)" {
  485 + temp_contentView = contentView
  486 + temp_dict = dic
  487 + }
  488 + temp_h += item_h
  489 + }
  490 +
  491 + required init?(coder: NSCoder) {
  492 + fatalError("init(coder:) has not been implemented")
  493 + }
  494 +}
... ...
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
... ... @@ -223,7 +223,8 @@ class MineStandInfoModel: BaseModel {
223 223 var authInfoId: Int = 0
224 224 var sort: Int = 0
225 225 var name: String?//卡片标签
226   - var inputType: Int = 0//1文本输入 2数字输入 3下拉选择 4后台生成时间 5后台生成编码 6头像类型
  226 + var sub_title: String?//报名项说明
  227 + var inputType: Int = 0//1 文本输入 2数字输入 3下拉选择 4认证时间 5认证编码 6正图 7小竖图 8大横图 9单选 10多选 11选项 12时间选择器 13主标题
227 228 var nonEmpty: Bool = false
228 229 var length: Int = 10
229 230 var children = [MineStandInfoModel]()
... ...
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
... ... @@ -447,6 +447,17 @@ class CNLiveMineViewModel: NSObject {
447 447 if resp["data"] is NSNull {
448 448 resultBlock(NSNull(),.failed)
449 449 } else {
  450 +
  451 +// do {
  452 +// let jsonData = try JSONSerialization.data(withJSONObject: resp, options: .prettyPrinted)
  453 +// if let jsonString = String(data: jsonData, encoding: .utf8) {
  454 +// print("===>"+jsonString)
  455 +// }
  456 +// } catch {
  457 +// print("error \(error)")
  458 +// }
  459 +
  460 +
450 461 let newsModel = dictionaryToModel(resp as! [String : Any], MineStandInfoBaseModel.self,"data") as! MineStandInfoBaseModel
451 462 if type == .nodate {
452 463 let tempArray = NSMutableArray()
... ... @@ -799,6 +810,78 @@ class CNLiveMineViewModel: NSObject {
799 810 }
800 811 }
801 812  
  813 + /// 获取一级分类类别
  814 + /// - Parameter resultBlock: 返回
  815 + static func requestApplyGroupInAction(resultBlock: @escaping resultNewsBlock) {
  816 + let param = NSMutableDictionary()
  817 + param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "uid")
  818 + let custom_param = NSMutableDictionary()
  819 + custom_param.setValue(APPId_wjj, forKey: "appId")
  820 + custom_param.setValue(APPKey_wjj, forKey: "appKey")
  821 + CNLiveNetworking.setAllowRequestDefaultArgument(true)
  822 + CNLiveNetworking.setupShowDataResult(false)
  823 + CNLiveNetworking.setupDSRequest(true)
  824 + CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
  825 + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseWjjBUrl+"/api/v1/getApplyGroup", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
  826 + hiddenLoading()
  827 + if (error == nil) {
  828 + let resp = result as! NSDictionary
  829 + let errorCode = "\(resp["code"] ?? "0")"
  830 + if (errorCode == "200") {
  831 + let data_dict = resp["data"] as! NSDictionary
  832 + resultBlock(data_dict["list"] as! Array<Dictionary<String, String>>,.success)
  833 + } else {
  834 + showMessage(message: resp["message"] as! String)
  835 + resultBlock(NSNull(),.failed)
  836 + }
  837 + } else {
  838 + if CNLiveNetworking.isNetworking() {
  839 + showMessage(message: "获取失败")
  840 + resultBlock(NSNull(),.failed)
  841 + } else {
  842 + showMessage(message: "似乎与网络断开链接")
  843 + resultBlock(NSNull(),.noNetwork)
  844 + }
  845 + }
  846 + }
  847 + }
  848 +
  849 + /// 商家申请提交
  850 + /// - Parameters:
  851 + /// - paramDict: 店铺信息
  852 + /// - resultBlock: 返回
  853 + static func requestApplyShopUserInAction(paramDict: NSDictionary,resultBlock: @escaping resultNewsBlock) {
  854 + let custom_param = NSMutableDictionary()
  855 + custom_param.setValue(APPId_wjj, forKey: "appId")
  856 + custom_param.setValue(APPKey_wjj, forKey: "appKey")
  857 + CNLiveNetworking.setAllowRequestDefaultArgument(true)
  858 + CNLiveNetworking.setupShowDataResult(false)
  859 + CNLiveNetworking.setupDSRequest(true)
  860 + CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
  861 + CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/api/v1/applyShopUser", param: paramDict as! [String : String], cacheType: .networkOnly) { task, result, error in
  862 + hiddenLoading()
  863 + if (error == nil) {
  864 + let resp = result as! NSDictionary
  865 + let errorCode = "\(resp["code"] ?? "0")"
  866 + if (errorCode == "200") {
  867 + resultBlock(resp,.success)
  868 + } else {
  869 + showMessage(message: resp["message"] as! String)
  870 + resultBlock(NSNull(),.failed)
  871 + }
  872 + } else {
  873 + if CNLiveNetworking.isNetworking() {
  874 + showMessage(message: "获取失败")
  875 + resultBlock(NSNull(),.failed)
  876 + } else {
  877 + showMessage(message: "似乎与网络断开链接")
  878 + resultBlock(NSNull(),.noNetwork)
  879 + }
  880 + }
  881 + }
  882 + }
  883 +
  884 +
802 885 /// 获取十位时间戳
803 886 static var timeStamp: Int {
804 887 let timeInterval: TimeInterval = NSDate().timeIntervalSince1970
... ...
metaCode/Classes/Other/AppDelegate.swift
... ... @@ -77,13 +77,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
77 77 CNLiveNetworking.setAllowRequestDefaultArgument(true)
78 78 CNLiveNetworking.setResponseSerializerType(.JSON)
79 79 CNLiveNetworking.setupBaseURL(APPLoginHost)
80   -
81   -
82   -
83 80 }
84   -
85   -
86   -
87   -
88 81 }
89 82  
... ...
metaCode/Supporting Files/Assets.xcassets/MinePage/mine_header_icon_flow.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "mine_header_icon_flow@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "mine_header_icon_flow@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_header_icon_flow.imageset/mine_header_icon_flow@2x.png 0 → 100644

30.1 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/mine_header_icon_flow.imageset/mine_header_icon_flow@3x.png 0 → 100644

62.6 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/mine_header_icon_idcard_fan.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "mine_header_icon_idcard_fan@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "mine_header_icon_idcard_fan@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_header_icon_idcard_fan.imageset/mine_header_icon_idcard_fan@2x.png 0 → 100644

36.9 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/mine_header_icon_idcard_fan.imageset/mine_header_icon_idcard_fan@3x.png 0 → 100644

75.1 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/mine_header_icon_idcard_zhen.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "mine_header_icon_idcard_zhen@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "mine_header_icon_idcard_zhen@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_header_icon_idcard_zhen.imageset/mine_header_icon_idcard_zhen@2x.png 0 → 100644

36 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/mine_header_icon_idcard_zhen.imageset/mine_header_icon_idcard_zhen@3x.png 0 → 100644

73.1 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/mine_header_icon_sellect.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "mine_header_icon_sellect@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "mine_header_icon_sellect@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_header_icon_sellect.imageset/mine_header_icon_sellect@2x.png 0 → 100644

4.09 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/mine_header_icon_sellect.imageset/mine_header_icon_sellect@3x.png 0 → 100644

9.68 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/mine_header_upload_result_info.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "mine_header_upload_result_info@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "mine_header_upload_result_info@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_header_upload_result_info.imageset/mine_header_upload_result_info@2x.png 0 → 100644

37.4 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/mine_header_upload_result_info.imageset/mine_header_upload_result_info@3x.png 0 → 100644

79.9 KB