Commit 4e9f4814126bbe067ee2a3c242c4683012453119
1 parent
50bf41b0
添加启动图
Showing
7 changed files
with
72 additions
and
18 deletions
metaCode/Classes/Main/LoginPage/ViewModel/CNLiveLoginViewModel.swift
metaCode/Classes/Main/MinePage/Controller/CNLiveInputFeedBackViewController.swift
| ... | ... | @@ -59,7 +59,10 @@ class CNLiveInputFeedBackViewController: CNLiveBaseViewController, UITextViewDel |
| 59 | 59 | }() |
| 60 | 60 | |
| 61 | 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 | 66 | pView.backgroundColor = .clear |
| 64 | 67 | return pView |
| 65 | 68 | }() |
| ... | ... | @@ -109,11 +112,12 @@ class CNLiveInputFeedBackViewController: CNLiveBaseViewController, UITextViewDel |
| 109 | 112 | } |
| 110 | 113 | |
| 111 | 114 | override func viewWillAppear(_ animated: Bool) { |
| 112 | - navigationBarHidden = false | |
| 115 | + | |
| 113 | 116 | } |
| 114 | 117 | |
| 115 | 118 | override func viewDidLoad() { |
| 116 | 119 | super.viewDidLoad() |
| 120 | + navigationBarHidden = false | |
| 117 | 121 | switch _show_type { |
| 118 | 122 | case .problem: |
| 119 | 123 | titleName = "问题反馈" |
| ... | ... | @@ -208,6 +212,7 @@ class CNLiveInputFeedBackViewController: CNLiveBaseViewController, UITextViewDel |
| 208 | 212 | } |
| 209 | 213 | } |
| 210 | 214 | |
| 215 | + | |
| 211 | 216 | extension CNLiveInputFeedBackViewController { |
| 212 | 217 | func textViewDidEndEditing(_ textView: UITextView) { |
| 213 | 218 | if textView.text.lengthOfBytes(using: .utf8) < 1 { | ... | ... |
metaCode/Classes/Main/MinePage/View/CNLiveMineHeaderView.swift
| ... | ... | @@ -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 | 143 | class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { |
| 144 | 144 | |
| 145 | 145 | lazy var imageView01: UIImageView = { |
| 146 | 146 | let imageView = UIImageView.init() |
| 147 | 147 | imageView.backgroundColor = .white |
| 148 | 148 | imageView.image = UIImage(named: "mine_sub_quest_addd_image") |
| 149 | - imageView.contentMode = .scaleAspectFit | |
| 149 | + imageView.contentMode = .scaleAspectFill | |
| 150 | 150 | imageView.isUserInteractionEnabled = true |
| 151 | 151 | imageView.tag = 1000 |
| 152 | 152 | imageView.layer.cornerRadius = 7 |
| 153 | 153 | imageView.layer.masksToBounds = true |
| 154 | + imageView.clipsToBounds = true | |
| 154 | 155 | let tapGes = UITapGestureRecognizer.init(target: self, action: #selector(touchImageAction)) |
| 155 | 156 | imageView.addGestureRecognizer(tapGes) |
| 156 | 157 | return imageView |
| ... | ... | @@ -160,10 +161,11 @@ class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { |
| 160 | 161 | let imageView = UIImageView.init() |
| 161 | 162 | imageView.backgroundColor = .white |
| 162 | 163 | imageView.image = UIImage(named: "mine_sub_quest_addd_image") |
| 163 | - imageView.contentMode = .scaleAspectFit | |
| 164 | + imageView.contentMode = .scaleAspectFill | |
| 164 | 165 | imageView.isUserInteractionEnabled = true |
| 165 | 166 | imageView.tag = 1001 |
| 166 | 167 | imageView.isHidden = true |
| 168 | + imageView.clipsToBounds = true | |
| 167 | 169 | imageView.layer.cornerRadius = 7 |
| 168 | 170 | imageView.layer.masksToBounds = true |
| 169 | 171 | let tapGes = UITapGestureRecognizer.init(target: self, action: #selector(touchImageAction)) |
| ... | ... | @@ -175,10 +177,11 @@ class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { |
| 175 | 177 | let imageView = UIImageView.init() |
| 176 | 178 | imageView.backgroundColor = .white |
| 177 | 179 | imageView.image = UIImage(named: "mine_sub_quest_addd_image") |
| 178 | - imageView.contentMode = .scaleAspectFit | |
| 180 | + imageView.contentMode = .scaleAspectFill | |
| 179 | 181 | imageView.isUserInteractionEnabled = true |
| 180 | 182 | imageView.tag = 1002 |
| 181 | 183 | imageView.isHidden = true |
| 184 | + imageView.clipsToBounds = true | |
| 182 | 185 | imageView.layer.cornerRadius = 7 |
| 183 | 186 | imageView.layer.masksToBounds = true |
| 184 | 187 | let tapGes = UITapGestureRecognizer.init(target: self, action: #selector(touchImageAction)) |
| ... | ... | @@ -196,12 +199,13 @@ class MinePhotoUploadView: UIView, PhotoPickerControllerDelegate { |
| 196 | 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 | 205 | super.init(frame: frame) |
| 203 | 206 | backgroundColor = .white |
| 204 | 207 | |
| 208 | + _resutBlock = resutBlock | |
| 205 | 209 | addSubview(imageView01) |
| 206 | 210 | imageView01.snp.makeConstraints { make in |
| 207 | 211 | make.size.height.equalTo((KSreenWidth - 40)/3) |
| ... | ... | @@ -254,13 +258,16 @@ extension MinePhotoUploadView { |
| 254 | 258 | if temp_imageView == imageView01 { |
| 255 | 259 | imageView02.isHidden = false |
| 256 | 260 | selectedImages.replaceObject(at: 0, with: image) |
| 261 | + _resutBlock!("1") | |
| 257 | 262 | } |
| 258 | 263 | if temp_imageView == imageView02 { |
| 259 | 264 | imageView03.isHidden = false |
| 260 | 265 | selectedImages.replaceObject(at: 1, with: image) |
| 266 | + _resutBlock!("2") | |
| 261 | 267 | } |
| 262 | 268 | if temp_imageView == imageView03 { |
| 263 | 269 | selectedImages.replaceObject(at: 2, with: image) |
| 270 | + _resutBlock!("3") | |
| 264 | 271 | } |
| 265 | 272 | }else { |
| 266 | 273 | print("failed") | ... | ... |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
| ... | ... | @@ -119,7 +119,7 @@ class CNLiveMineViewModel: NSObject { |
| 119 | 119 | //当前时间大于最大允许时间则表明当前access_token已经过期需要重新请求 |
| 120 | 120 | if CNLiveMineViewModel.timeStamp > NSNumber(string: UserInfoManager.shared.userInfo.expires_in)?.intValue ?? 0 { |
| 121 | 121 | let param = NSMutableDictionary.init() |
| 122 | - param.setValue("802_li40qhp922", forKey: "appId") | |
| 122 | + param.setValue(APPId, forKey: "appId") | |
| 123 | 123 | param.setValue("3cc9f12db322a3d3656012ef929604cf6d6847471535f9", forKey: "secret") |
| 124 | 124 | showLoading(message: "") |
| 125 | 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 | 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 | 8 | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| 7 | 9 | </dependencies> |
| 8 | 10 | <scenes> |
| ... | ... | @@ -10,16 +12,36 @@ |
| 10 | 12 | <scene sceneID="EHf-IW-A2E"> |
| 11 | 13 | <objects> |
| 12 | 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 | 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 | 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 | 34 | </view> |
| 19 | 35 | </viewController> |
| 20 | 36 | <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> |
| 21 | 37 | </objects> |
| 22 | - <point key="canvasLocation" x="53" y="375"/> | |
| 38 | + <point key="canvasLocation" x="52.671755725190835" y="374.64788732394368"/> | |
| 23 | 39 | </scene> |
| 24 | 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 | 47 | </document> | ... | ... |