Commit 4e9f4814126bbe067ee2a3c242c4683012453119
1 parent
50bf41b0
添加启动图
Showing
7 changed files
with
72 additions
and
18 deletions
metaCode/Classes/Main/LoginPage/ViewModel/CNLiveLoginViewModel.swift
| @@ -10,7 +10,6 @@ import YYCategories | @@ -10,7 +10,6 @@ import YYCategories | ||
| 10 | import CNLiveRequestBastKit | 10 | import CNLiveRequestBastKit |
| 11 | import HandyJSON | 11 | import HandyJSON |
| 12 | 12 | ||
| 13 | -import MJExtension | ||
| 14 | 13 | ||
| 15 | //验证码发送成功回调 | 14 | //验证码发送成功回调 |
| 16 | typealias resultCodeBlock = () -> Void | 15 | typealias resultCodeBlock = () -> Void |
metaCode/Classes/Main/MinePage/Controller/CNLiveInputFeedBackViewController.swift
| @@ -59,7 +59,10 @@ class CNLiveInputFeedBackViewController: CNLiveBaseViewController, UITextViewDel | @@ -59,7 +59,10 @@ class CNLiveInputFeedBackViewController: CNLiveBaseViewController, UITextViewDel | ||
| 59 | }() | 59 | }() |
| 60 | 60 | ||
| 61 | lazy var photoView: MinePhotoUploadView = { | 61 | lazy var photoView: MinePhotoUploadView = { |
| 62 | - let pView = MinePhotoUploadView.init(frame: .zero) | 62 | + let pView = MinePhotoUploadView.init(frame: .zero) { [self] index in |
| 63 | + let mString = NSMutableAttributedString(string: "上传截图 (选填 \(index)/3)") | ||
| 64 | + photoLabel.attributedText = mString | ||
| 65 | + } | ||
| 63 | pView.backgroundColor = .clear | 66 | pView.backgroundColor = .clear |
| 64 | return pView | 67 | return pView |
| 65 | }() | 68 | }() |
| @@ -109,11 +112,12 @@ class CNLiveInputFeedBackViewController: CNLiveBaseViewController, UITextViewDel | @@ -109,11 +112,12 @@ class CNLiveInputFeedBackViewController: CNLiveBaseViewController, UITextViewDel | ||
| 109 | } | 112 | } |
| 110 | 113 | ||
| 111 | override func viewWillAppear(_ animated: Bool) { | 114 | override func viewWillAppear(_ animated: Bool) { |
| 112 | - navigationBarHidden = false | 115 | + |
| 113 | } | 116 | } |
| 114 | 117 | ||
| 115 | override func viewDidLoad() { | 118 | override func viewDidLoad() { |
| 116 | super.viewDidLoad() | 119 | super.viewDidLoad() |
| 120 | + navigationBarHidden = false | ||
| 117 | switch _show_type { | 121 | switch _show_type { |
| 118 | case .problem: | 122 | case .problem: |
| 119 | titleName = "问题反馈" | 123 | titleName = "问题反馈" |
| @@ -208,6 +212,7 @@ class CNLiveInputFeedBackViewController: CNLiveBaseViewController, UITextViewDel | @@ -208,6 +212,7 @@ class CNLiveInputFeedBackViewController: CNLiveBaseViewController, UITextViewDel | ||
| 208 | } | 212 | } |
| 209 | } | 213 | } |
| 210 | 214 | ||
| 215 | + | ||
| 211 | extension CNLiveInputFeedBackViewController { | 216 | extension CNLiveInputFeedBackViewController { |
| 212 | func textViewDidEndEditing(_ textView: UITextView) { | 217 | func textViewDidEndEditing(_ textView: UITextView) { |
| 213 | if textView.text.lengthOfBytes(using: .utf8) < 1 { | 218 | if textView.text.lengthOfBytes(using: .utf8) < 1 { |
metaCode/Classes/Main/MinePage/View/CNLiveMineHeaderView.swift
| @@ -139,18 +139,19 @@ class MineAboutHeaderView: UIView { | @@ -139,18 +139,19 @@ class MineAboutHeaderView: UIView { | ||
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | 141 | ||
| 142 | -typealias ClickResultBlock = (_ array: NSMutableArray) ->Void | 142 | +typealias ClickResultBlock = (_ index: String) ->Void |
| 143 | class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { | 143 | class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { |
| 144 | 144 | ||
| 145 | lazy var imageView01: UIImageView = { | 145 | lazy var imageView01: UIImageView = { |
| 146 | let imageView = UIImageView.init() | 146 | let imageView = UIImageView.init() |
| 147 | imageView.backgroundColor = .white | 147 | imageView.backgroundColor = .white |
| 148 | imageView.image = UIImage(named: "mine_sub_quest_addd_image") | 148 | imageView.image = UIImage(named: "mine_sub_quest_addd_image") |
| 149 | - imageView.contentMode = .scaleAspectFit | 149 | + imageView.contentMode = .scaleAspectFill |
| 150 | imageView.isUserInteractionEnabled = true | 150 | imageView.isUserInteractionEnabled = true |
| 151 | imageView.tag = 1000 | 151 | imageView.tag = 1000 |
| 152 | imageView.layer.cornerRadius = 7 | 152 | imageView.layer.cornerRadius = 7 |
| 153 | imageView.layer.masksToBounds = true | 153 | imageView.layer.masksToBounds = true |
| 154 | + imageView.clipsToBounds = true | ||
| 154 | let tapGes = UITapGestureRecognizer.init(target: self, action: #selector(touchImageAction)) | 155 | let tapGes = UITapGestureRecognizer.init(target: self, action: #selector(touchImageAction)) |
| 155 | imageView.addGestureRecognizer(tapGes) | 156 | imageView.addGestureRecognizer(tapGes) |
| 156 | return imageView | 157 | return imageView |
| @@ -160,10 +161,11 @@ class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { | @@ -160,10 +161,11 @@ class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { | ||
| 160 | let imageView = UIImageView.init() | 161 | let imageView = UIImageView.init() |
| 161 | imageView.backgroundColor = .white | 162 | imageView.backgroundColor = .white |
| 162 | imageView.image = UIImage(named: "mine_sub_quest_addd_image") | 163 | imageView.image = UIImage(named: "mine_sub_quest_addd_image") |
| 163 | - imageView.contentMode = .scaleAspectFit | 164 | + imageView.contentMode = .scaleAspectFill |
| 164 | imageView.isUserInteractionEnabled = true | 165 | imageView.isUserInteractionEnabled = true |
| 165 | imageView.tag = 1001 | 166 | imageView.tag = 1001 |
| 166 | imageView.isHidden = true | 167 | imageView.isHidden = true |
| 168 | + imageView.clipsToBounds = true | ||
| 167 | imageView.layer.cornerRadius = 7 | 169 | imageView.layer.cornerRadius = 7 |
| 168 | imageView.layer.masksToBounds = true | 170 | imageView.layer.masksToBounds = true |
| 169 | let tapGes = UITapGestureRecognizer.init(target: self, action: #selector(touchImageAction)) | 171 | let tapGes = UITapGestureRecognizer.init(target: self, action: #selector(touchImageAction)) |
| @@ -175,10 +177,11 @@ class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { | @@ -175,10 +177,11 @@ class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { | ||
| 175 | let imageView = UIImageView.init() | 177 | let imageView = UIImageView.init() |
| 176 | imageView.backgroundColor = .white | 178 | imageView.backgroundColor = .white |
| 177 | imageView.image = UIImage(named: "mine_sub_quest_addd_image") | 179 | imageView.image = UIImage(named: "mine_sub_quest_addd_image") |
| 178 | - imageView.contentMode = .scaleAspectFit | 180 | + imageView.contentMode = .scaleAspectFill |
| 179 | imageView.isUserInteractionEnabled = true | 181 | imageView.isUserInteractionEnabled = true |
| 180 | imageView.tag = 1002 | 182 | imageView.tag = 1002 |
| 181 | imageView.isHidden = true | 183 | imageView.isHidden = true |
| 184 | + imageView.clipsToBounds = true | ||
| 182 | imageView.layer.cornerRadius = 7 | 185 | imageView.layer.cornerRadius = 7 |
| 183 | imageView.layer.masksToBounds = true | 186 | imageView.layer.masksToBounds = true |
| 184 | let tapGes = UITapGestureRecognizer.init(target: self, action: #selector(touchImageAction)) | 187 | let tapGes = UITapGestureRecognizer.init(target: self, action: #selector(touchImageAction)) |
| @@ -196,12 +199,13 @@ class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { | @@ -196,12 +199,13 @@ class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { | ||
| 196 | return tempArrray | 199 | return tempArrray |
| 197 | }() | 200 | }() |
| 198 | 201 | ||
| 199 | - var resutBlock : ClickResultBlock? | ||
| 200 | 202 | ||
| 201 | - override init(frame: CGRect) { | 203 | + var _resutBlock : ClickResultBlock? |
| 204 | + init(frame: CGRect, resutBlock: @escaping ClickResultBlock) { | ||
| 202 | super.init(frame: frame) | 205 | super.init(frame: frame) |
| 203 | backgroundColor = .white | 206 | backgroundColor = .white |
| 204 | 207 | ||
| 208 | + _resutBlock = resutBlock | ||
| 205 | addSubview(imageView01) | 209 | addSubview(imageView01) |
| 206 | imageView01.snp.makeConstraints { make in | 210 | imageView01.snp.makeConstraints { make in |
| 207 | make.size.height.equalTo((KSreenWidth - 40)/3) | 211 | make.size.height.equalTo((KSreenWidth - 40)/3) |
| @@ -254,13 +258,16 @@ extension MinePhotoUploadView { | @@ -254,13 +258,16 @@ extension MinePhotoUploadView { | ||
| 254 | if temp_imageView == imageView01 { | 258 | if temp_imageView == imageView01 { |
| 255 | imageView02.isHidden = false | 259 | imageView02.isHidden = false |
| 256 | selectedImages.replaceObject(at: 0, with: image) | 260 | selectedImages.replaceObject(at: 0, with: image) |
| 261 | + _resutBlock!("1") | ||
| 257 | } | 262 | } |
| 258 | if temp_imageView == imageView02 { | 263 | if temp_imageView == imageView02 { |
| 259 | imageView03.isHidden = false | 264 | imageView03.isHidden = false |
| 260 | selectedImages.replaceObject(at: 1, with: image) | 265 | selectedImages.replaceObject(at: 1, with: image) |
| 266 | + _resutBlock!("2") | ||
| 261 | } | 267 | } |
| 262 | if temp_imageView == imageView03 { | 268 | if temp_imageView == imageView03 { |
| 263 | selectedImages.replaceObject(at: 2, with: image) | 269 | selectedImages.replaceObject(at: 2, with: image) |
| 270 | + _resutBlock!("3") | ||
| 264 | } | 271 | } |
| 265 | }else { | 272 | }else { |
| 266 | print("failed") | 273 | print("failed") |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
| @@ -119,7 +119,7 @@ class CNLiveMineViewModel: NSObject { | @@ -119,7 +119,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 119 | //当前时间大于最大允许时间则表明当前access_token已经过期需要重新请求 | 119 | //当前时间大于最大允许时间则表明当前access_token已经过期需要重新请求 |
| 120 | if CNLiveMineViewModel.timeStamp > NSNumber(string: UserInfoManager.shared.userInfo.expires_in)?.intValue ?? 0 { | 120 | if CNLiveMineViewModel.timeStamp > NSNumber(string: UserInfoManager.shared.userInfo.expires_in)?.intValue ?? 0 { |
| 121 | let param = NSMutableDictionary.init() | 121 | let param = NSMutableDictionary.init() |
| 122 | - param.setValue("802_li40qhp922", forKey: "appId") | 122 | + param.setValue(APPId, forKey: "appId") |
| 123 | param.setValue("3cc9f12db322a3d3656012ef929604cf6d6847471535f9", forKey: "secret") | 123 | param.setValue("3cc9f12db322a3d3656012ef929604cf6d6847471535f9", forKey: "secret") |
| 124 | showLoading(message: "") | 124 | showLoading(message: "") |
| 125 | CNLiveNetworking.setAllowRequestDefaultArgument(false) | 125 | CNLiveNetworking.setAllowRequestDefaultArgument(false) |
metaCode/Supporting Files/Assets.xcassets/LaunchImageScreen.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "filename" : "LaunchImageScreen.png", | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "author" : "xcode", | ||
| 19 | + "version" : 1 | ||
| 20 | + } | ||
| 21 | +} |
metaCode/Supporting Files/Assets.xcassets/LaunchImageScreen.imageset/LaunchImageScreen.png
0 → 100644
541 KB
metaCode/Supporting Files/Base.lproj/LaunchScreen.storyboard
| 1 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
| 3 | + <device id="retina6_12" orientation="portrait" appearance="light"/> | ||
| 3 | <dependencies> | 4 | <dependencies> |
| 4 | - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> | ||
| 5 | - <capability name="Safe area layout guides" minToolsVersion="9.0"/> | 5 | + <deployment identifier="iOS"/> |
| 6 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/> | ||
| 7 | + <capability name="System colors in document resources" minToolsVersion="11.0"/> | ||
| 6 | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | 8 | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| 7 | </dependencies> | 9 | </dependencies> |
| 8 | <scenes> | 10 | <scenes> |
| @@ -10,16 +12,36 @@ | @@ -10,16 +12,36 @@ | ||
| 10 | <scene sceneID="EHf-IW-A2E"> | 12 | <scene sceneID="EHf-IW-A2E"> |
| 11 | <objects> | 13 | <objects> |
| 12 | <viewController id="01J-lp-oVM" sceneMemberID="viewController"> | 14 | <viewController id="01J-lp-oVM" sceneMemberID="viewController"> |
| 15 | + <layoutGuides> | ||
| 16 | + <viewControllerLayoutGuide type="top" id="AQe-8w-1dv"/> | ||
| 17 | + <viewControllerLayoutGuide type="bottom" id="8ZX-t7-A97"/> | ||
| 18 | + </layoutGuides> | ||
| 13 | <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | 19 | <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> |
| 14 | - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | 20 | + <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> |
| 15 | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | 21 | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| 16 | - <color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
| 17 | - <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> | 22 | + <subviews> |
| 23 | + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchImageScreen" translatesAutoresizingMaskIntoConstraints="NO" id="fg7-DY-Got"> | ||
| 24 | + <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> | ||
| 25 | + </imageView> | ||
| 26 | + </subviews> | ||
| 27 | + <color key="backgroundColor" systemColor="systemBackgroundColor"/> | ||
| 28 | + <constraints> | ||
| 29 | + <constraint firstAttribute="bottom" secondItem="fg7-DY-Got" secondAttribute="bottom" id="OZo-0h-6rD"/> | ||
| 30 | + <constraint firstAttribute="trailing" secondItem="fg7-DY-Got" secondAttribute="trailing" id="Uc5-q8-o2M"/> | ||
| 31 | + <constraint firstItem="fg7-DY-Got" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="lS8-Sn-Eno"/> | ||
| 32 | + <constraint firstItem="fg7-DY-Got" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="vn3-9b-mYR"/> | ||
| 33 | + </constraints> | ||
| 18 | </view> | 34 | </view> |
| 19 | </viewController> | 35 | </viewController> |
| 20 | <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | 36 | <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> |
| 21 | </objects> | 37 | </objects> |
| 22 | - <point key="canvasLocation" x="53" y="375"/> | 38 | + <point key="canvasLocation" x="52.671755725190835" y="374.64788732394368"/> |
| 23 | </scene> | 39 | </scene> |
| 24 | </scenes> | 40 | </scenes> |
| 41 | + <resources> | ||
| 42 | + <image name="LaunchImageScreen" width="621" height="1344"/> | ||
| 43 | + <systemColor name="systemBackgroundColor"> | ||
| 44 | + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
| 45 | + </systemColor> | ||
| 46 | + </resources> | ||
| 25 | </document> | 47 | </document> |