Commit 8ab74538712f915592fe2bc7235c12f926326928
1 parent
7c72a081
认证首页--个人认证,企业认证
Showing
2 changed files
with
92 additions
and
32 deletions
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNMainView.swift
| ... | ... | @@ -7,6 +7,8 @@ |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | 9 | import UIKit |
| 10 | +import Kingfisher | |
| 11 | + | |
| 10 | 12 | ///旋转动画时间 |
| 11 | 13 | let KTransformAnimationTime:CGFloat = 0.75; |
| 12 | 14 | |
| ... | ... | @@ -51,20 +53,43 @@ class CNFrontMainView : UIView{ |
| 51 | 53 | make.bottom.equalToSuperview() |
| 52 | 54 | } |
| 53 | 55 | |
| 54 | - frontDescContentView.addSubview(self.addStandBtn) | |
| 55 | - addStandBtn.snp.makeConstraints { make in | |
| 56 | - make.centerX.equalToSuperview() | |
| 57 | - make.bottom.equalToSuperview().offset(-30) | |
| 58 | - make.width.equalTo(150) | |
| 59 | - make.height.equalTo(39) | |
| 56 | + frontDescContentView.addSubview(self.upMoreGIF) | |
| 57 | + upMoreGIF.snp.makeConstraints { make in | |
| 58 | + make.top.equalToSuperview().offset(5) | |
| 59 | + make.right.equalToSuperview().offset(-self.width/2+24) | |
| 60 | + make.width.equalTo(48) | |
| 61 | + make.height.equalTo(30) | |
| 60 | 62 | } |
| 61 | - | |
| 63 | + | |
| 64 | + frontDescContentView.addSubview(self.personalStandBtn) | |
| 65 | + personalStandBtn.snp.makeConstraints { make in | |
| 66 | + make.right.equalToSuperview().offset(-self.width/2) | |
| 67 | + make.bottom.equalToSuperview().offset(-45) | |
| 68 | + make.width.equalTo(120) | |
| 69 | + make.height.equalTo(36) | |
| 70 | + } | |
| 71 | + frontDescContentView.addSubview(self.enterpriseStandBtn) | |
| 72 | + enterpriseStandBtn.snp.makeConstraints { make in | |
| 73 | + make.left.equalTo(self.personalStandBtn.snp.right) | |
| 74 | + make.bottom.equalToSuperview().offset(-45) | |
| 75 | + make.width.equalTo(120) | |
| 76 | + make.height.equalTo(36) | |
| 77 | + } | |
| 78 | + | |
| 79 | + frontDescContentView.addSubview(self.downMoreGIF) | |
| 80 | + downMoreGIF.snp.makeConstraints { make in | |
| 81 | + make.top.equalTo(self.personalStandBtn.snp.bottom).offset((45-30)/2.0) | |
| 82 | + make.centerX.equalTo(self.personalStandBtn.snp.right) | |
| 83 | + make.width.equalTo(96) | |
| 84 | + make.height.equalTo(30) | |
| 85 | + } | |
| 86 | + | |
| 62 | 87 | frontDescContentView.addSubview(self.textView) |
| 63 | 88 | textView.snp.makeConstraints { make in |
| 64 | 89 | make.top.equalToSuperview().offset(40) |
| 65 | 90 | make.left.equalToSuperview().offset(30) |
| 66 | 91 | make.right.equalToSuperview().offset(-30) |
| 67 | - make.bottom.equalTo(addStandBtn.snp.top).offset(-30) | |
| 92 | + make.bottom.equalTo(enterpriseStandBtn.snp.top).offset(-30) | |
| 68 | 93 | } |
| 69 | 94 | |
| 70 | 95 | return frontDescContentView |
| ... | ... | @@ -86,17 +111,41 @@ class CNFrontMainView : UIView{ |
| 86 | 111 | textView.backgroundColor = .clear |
| 87 | 112 | return textView |
| 88 | 113 | }() |
| 89 | - ///未认证-点击添加身份 按钮 | |
| 90 | - lazy var addStandBtn: UIButton = { | |
| 91 | - let addStandBtn = UIButton(type: .custom) | |
| 92 | - addStandBtn.clipsToBounds = true | |
| 93 | - addStandBtn.layer.cornerRadius = 19.5 | |
| 94 | - addStandBtn.backgroundColor = HexColor("#004FE0") | |
| 95 | - addStandBtn.setTitle("点击添加身份", for: .normal) | |
| 96 | - addStandBtn.setTitleColor(.white, for: .normal) | |
| 97 | - addStandBtn.titleLabel?.font = UIFont.init(name: "PingFangSC-Medium", size: 14) | |
| 98 | - addStandBtn.addTarget(self, action: #selector(addStandBtnAction), for: .touchUpInside) | |
| 99 | - return addStandBtn | |
| 114 | + | |
| 115 | + ///未认证-个人认证 按钮 | |
| 116 | + lazy var personalStandBtn: UIButton = { | |
| 117 | + let personalStandBtn = UIButton(type: .custom) | |
| 118 | + personalStandBtn.layer.cornerRadius = 19.5 | |
| 119 | + personalStandBtn.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner] | |
| 120 | + personalStandBtn.setTitle("个人认证", for: .normal) | |
| 121 | + personalStandBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) | |
| 122 | + personalStandBtn.titleLabel?.font = UIFont.init(name: "PingFangSC-Medium", size: 14) | |
| 123 | + personalStandBtn.addTarget(self, action: #selector(personalStandBtnAction), for: .touchUpInside) | |
| 124 | + return personalStandBtn | |
| 125 | + }() | |
| 126 | + ///未认证-企业认证 按钮 | |
| 127 | + lazy var enterpriseStandBtn: UIButton = { | |
| 128 | + let enterpriseStandBtn = UIButton(type: .custom) | |
| 129 | + enterpriseStandBtn.layer.cornerRadius = 19.5 | |
| 130 | + enterpriseStandBtn.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMaxXMaxYCorner] | |
| 131 | + enterpriseStandBtn.setTitle("企业认证", for: .normal) | |
| 132 | + enterpriseStandBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) | |
| 133 | + enterpriseStandBtn.titleLabel?.font = UIFont.init(name: "PingFangSC-Medium", size: 14) | |
| 134 | + enterpriseStandBtn.addTarget(self, action: #selector(enterpriseStandBtnAction), for: .touchUpInside) | |
| 135 | + return enterpriseStandBtn | |
| 136 | + }() | |
| 137 | + | |
| 138 | + //上滑更多Gif | |
| 139 | + lazy var upMoreGIF: UIImageView = { | |
| 140 | + let upMoreGIF = UIImageView() | |
| 141 | + upMoreGIF.frame = CGRect(x: self.width - 50, y: 0, width: 50, height: 30) | |
| 142 | + return upMoreGIF | |
| 143 | + }() | |
| 144 | + //下滑更多Gif | |
| 145 | + lazy var downMoreGIF: UIImageView = { | |
| 146 | + let downMoreGIF = UIImageView() | |
| 147 | + downMoreGIF.frame = CGRect(x: self.width - 50, y: 0, width: 96, height: 30) | |
| 148 | + return downMoreGIF | |
| 100 | 149 | }() |
| 101 | 150 | |
| 102 | 151 | ///已认证-前置视图卡片容器 |
| ... | ... | @@ -171,7 +220,14 @@ class CNFrontMainView : UIView{ |
| 171 | 220 | //显示textview 添加身份 |
| 172 | 221 | frontDescContentView.isHidden = false |
| 173 | 222 | textView.text = newValue!.description |
| 174 | - addStandBtn.backgroundColor = HexColor(newValue!.backgroundColor) | |
| 223 | + | |
| 224 | + //上滑 下滑引导gif | |
| 225 | + upMoreGIF.kf.setImage(with: URL(string: newValue!.upGuideImg)) | |
| 226 | + downMoreGIF.kf.setImage(with: URL(string: newValue!.downGuideImg)) | |
| 227 | + | |
| 228 | + //个人认证,企业认证 | |
| 229 | + personalStandBtn.backgroundColor = HexColor(newValue!.atPersonageColour) | |
| 230 | + enterpriseStandBtn.backgroundColor = HexColor(newValue!.backgroundColor) | |
| 175 | 231 | textViewBgImgView.kf.setImage(with: URL(string: _idModel!.descBackgroundImg), placeholder: UIImage(named: "homepage_desc_bgImg")) |
| 176 | 232 | } |
| 177 | 233 | } |
| ... | ... | @@ -183,7 +239,6 @@ class CNFrontMainView : UIView{ |
| 183 | 239 | self.frontTotolContentView.addSubview(self.frontDescContentView) |
| 184 | 240 | self.frontTotolContentView.addSubview(self.frontCardContentView) |
| 185 | 241 | |
| 186 | - | |
| 187 | 242 | self.makeConstraints() |
| 188 | 243 | } |
| 189 | 244 | func makeConstraints(){ |
| ... | ... | @@ -194,27 +249,29 @@ class CNFrontMainView : UIView{ |
| 194 | 249 | @objc func tapAction(){ |
| 195 | 250 | tapTransformAciton!() |
| 196 | 251 | } |
| 197 | - | |
| 198 | - @objc func addStandBtnAction() { | |
| 199 | - //跳转到添加身份页面 | |
| 200 | -// currentViewController()?.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _idModel!), animated: pushAnimated) | |
| 201 | -// DispatchQueue.main.asyncAfter(deadline: .now()+0.25){ | |
| 252 | + | |
| 253 | + @objc func personalStandBtnAction() { | |
| 254 | + //跳转到 个人认证页面 | |
| 255 | + self.pushStandVC() | |
| 256 | + } | |
| 257 | + @objc func enterpriseStandBtnAction() { | |
| 258 | + //跳转到 企业认证页面 | |
| 259 | + self.pushStandVC() | |
| 260 | + } | |
| 261 | + | |
| 262 | + func pushStandVC(){ | |
| 263 | + //跳转到 个人认证&企业认证 页面 | |
| 202 | 264 | if _idModel!.id == 9 { |
| 203 | 265 | showLoading(message: "") |
| 204 | 266 | CNLiveMineViewModel.requestApplyShopInfo { [weak self] result, respStatue in |
| 205 | 267 | |
| 206 | 268 | if respStatue == .success { |
| 207 | 269 | navigationViewController().pushViewController(CNLiveMineShopViewController.init(showType: .one, listModel: (self?.idModel)!, tempArray: []), animated: pushAnimated) |
| 208 | -// currentViewController()?.navigationController?.pushViewController(CNLiveMineShopViewController.init(showType: .one, listModel: (self?.idModel)!, tempArray: []), animated: pushAnimated) | |
| 209 | 270 | } |
| 210 | 271 | } |
| 211 | 272 | }else{ |
| 212 | 273 | navigationViewController().pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!), animated: pushAnimated) |
| 213 | -// currentViewController()?.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!), animated: pushAnimated) | |
| 214 | 274 | } |
| 215 | - | |
| 216 | -// } | |
| 217 | - | |
| 218 | 275 | } |
| 219 | 276 | } |
| 220 | 277 | ... | ... |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
| ... | ... | @@ -141,7 +141,10 @@ final class StandListModel: BaseModel {//, TableCodable { |
| 141 | 141 | var createTime: Int = 0//注册时间- |
| 142 | 142 | var enable: Bool = false//没用- |
| 143 | 143 | var backgroundImg: String = ""//首页背景图- |
| 144 | - var backgroundColor: String = ""//添加身份按钮背景色- | |
| 144 | + var upGuideImg: String = ""//顶部引导图GiF url- | |
| 145 | + var downGuideImg: String = ""//底部引导图GiF url- | |
| 146 | + var backgroundColor: String = kCNDownSlideBackgroundColorHex//企业认证按钮背景色- | |
| 147 | + var atPersonageColour: String = kCNDownSlideBackgroundColorHex//个人认证按钮背景色- | |
| 145 | 148 | var backgroundColour: String = ""//- |
| 146 | 149 | var description: String = ""//首页身份说明描述- |
| 147 | 150 | var descBackgroundImg: String = ""//首页文字背景图 | ... | ... |