Commit 257e980a authored by lujunye's avatar lujunye

桥接MJRefresh,添加Demo

parent f290a33a
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
E00D85EB244561FE00F5F816 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E00D85E9244561FE00F5F816 /* LaunchScreen.storyboard */; }; E00D85EB244561FE00F5F816 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E00D85E9244561FE00F5F816 /* LaunchScreen.storyboard */; };
E00D85F6244561FE00F5F816 /* GeliBusinessPlatformTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E00D85F5244561FE00F5F816 /* GeliBusinessPlatformTests.swift */; }; E00D85F6244561FE00F5F816 /* GeliBusinessPlatformTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E00D85F5244561FE00F5F816 /* GeliBusinessPlatformTests.swift */; };
E00D8601244561FE00F5F816 /* GeliBusinessPlatformUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E00D8600244561FE00F5F816 /* GeliBusinessPlatformUITests.swift */; }; E00D8601244561FE00F5F816 /* GeliBusinessPlatformUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E00D8600244561FE00F5F816 /* GeliBusinessPlatformUITests.swift */; };
E01C26B12446989700ADCC70 /* Interface_Z.plist in Resources */ = {isa = PBXBuildFile; fileRef = E01C26B02446989700ADCC70 /* Interface_Z.plist */; };
E01C26B62446AF3100ADCC70 /* DemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E01C26B42446AF3100ADCC70 /* DemoViewController.swift */; };
E01C26B72446AF3100ADCC70 /* DemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E01C26B52446AF3100ADCC70 /* DemoViewController.xib */; };
E09B03A12445AF7100211A51 /* Define.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03A02445AF7100211A51 /* Define.swift */; }; E09B03A12445AF7100211A51 /* Define.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03A02445AF7100211A51 /* Define.swift */; };
E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03A22445AF9500211A51 /* NetworkRequest.swift */; }; E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03A22445AF9500211A51 /* NetworkRequest.swift */; };
E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03A52445B04D00211A51 /* BaseViewController.swift */; }; E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03A52445B04D00211A51 /* BaseViewController.swift */; };
...@@ -65,6 +68,10 @@ ...@@ -65,6 +68,10 @@
E00D85FC244561FE00F5F816 /* GeliBusinessPlatformUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GeliBusinessPlatformUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; E00D85FC244561FE00F5F816 /* GeliBusinessPlatformUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GeliBusinessPlatformUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
E00D8600244561FE00F5F816 /* GeliBusinessPlatformUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeliBusinessPlatformUITests.swift; sourceTree = "<group>"; }; E00D8600244561FE00F5F816 /* GeliBusinessPlatformUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeliBusinessPlatformUITests.swift; sourceTree = "<group>"; };
E00D8602244561FE00F5F816 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; E00D8602244561FE00F5F816 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E01C26B02446989700ADCC70 /* Interface_Z.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Interface_Z.plist; sourceTree = "<group>"; };
E01C26B42446AF3100ADCC70 /* DemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = "<group>"; };
E01C26B52446AF3100ADCC70 /* DemoViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DemoViewController.xib; sourceTree = "<group>"; };
E01C26BA2446D68500ADCC70 /* Bridge_Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Bridge_Header.h; sourceTree = "<group>"; };
E09B03A02445AF7100211A51 /* Define.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Define.swift; sourceTree = "<group>"; }; E09B03A02445AF7100211A51 /* Define.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Define.swift; sourceTree = "<group>"; };
E09B03A22445AF9500211A51 /* NetworkRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkRequest.swift; sourceTree = "<group>"; }; E09B03A22445AF9500211A51 /* NetworkRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkRequest.swift; sourceTree = "<group>"; };
E09B03A52445B04D00211A51 /* BaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseViewController.swift; sourceTree = "<group>"; }; E09B03A52445B04D00211A51 /* BaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseViewController.swift; sourceTree = "<group>"; };
...@@ -149,6 +156,7 @@ ...@@ -149,6 +156,7 @@
E00D85DD244561FD00F5F816 /* GeliBusinessPlatform */ = { E00D85DD244561FD00F5F816 /* GeliBusinessPlatform */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E01C26B32446AEF800ADCC70 /* DEMO */,
E09B03B32445B19400211A51 /* Interface */, E09B03B32445B19400211A51 /* Interface */,
E09B03AD2445B0BA00211A51 /* ViewController */, E09B03AD2445B0BA00211A51 /* ViewController */,
E09B03AC2445B0B200211A51 /* View */, E09B03AC2445B0B200211A51 /* View */,
...@@ -190,6 +198,15 @@ ...@@ -190,6 +198,15 @@
path = GeliBusinessPlatformUITests; path = GeliBusinessPlatformUITests;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
E01C26B32446AEF800ADCC70 /* DEMO */ = {
isa = PBXGroup;
children = (
E01C26B42446AF3100ADCC70 /* DemoViewController.swift */,
E01C26B52446AF3100ADCC70 /* DemoViewController.xib */,
);
path = DEMO;
sourceTree = "<group>";
};
E09B039E2445AEF800211A51 /* Appdelegate */ = { E09B039E2445AEF800211A51 /* Appdelegate */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -205,6 +222,7 @@ ...@@ -205,6 +222,7 @@
E09B03C72445BF9300211A51 /* SwiftNotice.swift */, E09B03C72445BF9300211A51 /* SwiftNotice.swift */,
E09B03A22445AF9500211A51 /* NetworkRequest.swift */, E09B03A22445AF9500211A51 /* NetworkRequest.swift */,
E09B03A02445AF7100211A51 /* Define.swift */, E09B03A02445AF7100211A51 /* Define.swift */,
E01C26BA2446D68500ADCC70 /* Bridge_Header.h */,
); );
path = Define; path = Define;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -257,6 +275,7 @@ ...@@ -257,6 +275,7 @@
E09B03B32445B19400211A51 /* Interface */ = { E09B03B32445B19400211A51 /* Interface */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E01C26B02446989700ADCC70 /* Interface_Z.plist */,
); );
path = Interface; path = Interface;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -396,7 +415,9 @@ ...@@ -396,7 +415,9 @@
E09B03B72445B85A00211A51 /* LoginViewController.xib in Resources */, E09B03B72445B85A00211A51 /* LoginViewController.xib in Resources */,
E09B03BC2445B94800211A51 /* RegisterViewController.xib in Resources */, E09B03BC2445B94800211A51 /* RegisterViewController.xib in Resources */,
E09B03C12445B96500211A51 /* FgPassViewController.xib in Resources */, E09B03C12445B96500211A51 /* FgPassViewController.xib in Resources */,
E01C26B72446AF3100ADCC70 /* DemoViewController.xib in Resources */,
E00D85EB244561FE00F5F816 /* LaunchScreen.storyboard in Resources */, E00D85EB244561FE00F5F816 /* LaunchScreen.storyboard in Resources */,
E01C26B12446989700ADCC70 /* Interface_Z.plist in Resources */,
E00D85E8244561FE00F5F816 /* Preview Assets.xcassets in Resources */, E00D85E8244561FE00F5F816 /* Preview Assets.xcassets in Resources */,
E00D85E5244561FE00F5F816 /* Assets.xcassets in Resources */, E00D85E5244561FE00F5F816 /* Assets.xcassets in Resources */,
); );
...@@ -476,6 +497,7 @@ ...@@ -476,6 +497,7 @@
E09B03C02445B96500211A51 /* FgPassViewController.swift in Sources */, E09B03C02445B96500211A51 /* FgPassViewController.swift in Sources */,
E09B03AB2445B0A300211A51 /* LoginModel.swift in Sources */, E09B03AB2445B0A300211A51 /* LoginModel.swift in Sources */,
E09B03C82445BF9300211A51 /* SwiftNotice.swift in Sources */, E09B03C82445BF9300211A51 /* SwiftNotice.swift in Sources */,
E01C26B62446AF3100ADCC70 /* DemoViewController.swift in Sources */,
E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */, E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */,
E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */, E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */,
); );
...@@ -654,6 +676,7 @@ ...@@ -654,6 +676,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = GeliBusinessPlatform.GeliBusinessPlatform; PRODUCT_BUNDLE_IDENTIFIER = GeliBusinessPlatform.GeliBusinessPlatform;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
"SWIFT_OBJC_BRIDGING_HEADER[arch=*]" = "$(SRCROOT)/GeliBusinessPlatform/Define/Bridge_Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<key>GeliBusinessPlatform.xcscheme_^#shared#^_</key> <key>GeliBusinessPlatform.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>18</integer> <integer>10</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "4EFF3422-0342-402A-BFF0-17B15851B3EC"
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
uuid = "61B97D92-F859-4C21-8015-389C91785DC8"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "1"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
...@@ -10,11 +10,15 @@ import UIKit ...@@ -10,11 +10,15 @@ import UIKit
import SwiftyJSON import SwiftyJSON
import ObjectMapper import ObjectMapper
import Alamofire import Alamofire
import IQKeyboardManagerSwift
class BaseViewController: UIViewController { class BaseViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
self.navigationController?.navigationBar.isHidden = true self.navigationController?.navigationBar.isHidden = true
IQKeyboardManager.shared.shouldPlayInputClicks = true
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.shouldResignOnTouchOutside = true
} }
override func viewDidLoad() { override func viewDidLoad() {
......
//
// DemoViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/15.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
import SkeletonView
import ViewAnimator
class DemoViewController: BaseViewController {
//MARK: -ViewAnimate方法
func animate(animations: [Animation],
reversed: Bool = false,
initialAlpha: CGFloat = 0.0,
finalAlpha: CGFloat = 1.0,
delay: Double = 0,
duration: TimeInterval = ViewAnimatorConfig.duration,
usingSpringWithDamping dampingRatio: CGFloat = ViewAnimatorConfig.springDampingRatio,
initialSpringVelocity velocity: CGFloat = ViewAnimatorConfig.initialSpringVelocity,
completion: (() -> Void)? = nil){
}
@IBOutlet weak var btn: UIButton!
@IBOutlet weak var textView: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
//桥接mjrefresh
let tbv = UITableView()
tbv.mj_header = MJRefreshHeader(refreshingBlock: {
})
//viewanimation动画效果
let animationBottom = AnimationType.from(direction: .right, offset: 300.0)
//调用方法,启动动画效果
btn.animate(animations: [animationBottom], reversed: false, initialAlpha: 0, finalAlpha: 1, delay: 0, duration: 3, usingSpringWithDamping: 5, initialSpringVelocity: CGFloat(UIView.AnimationOptions(rawValue: 1).rawValue), options: UIView.AnimationOptions(rawValue: 0)) {
}
textView.animate(animations: [animationBottom], reversed: false, initialAlpha: 0, finalAlpha: 1, delay: 0.5, duration: 3, usingSpringWithDamping: 5, initialSpringVelocity: CGFloat(UIView.AnimationOptions(rawValue: 1).rawValue), options: UIView.AnimationOptions(rawValue: 0)) {
}
//启动view动画
//xib设置textView加载,lastLine Fill Percent40,lineCorner 8
self.textView.showSkeleton()
//启动带效果动画
//带颜色
// self.btn.showSkeleton(usingColor:UIColor(named: "主色调")!, transition: .crossDissolve(0.25))
//不带颜色
self.btn.showSkeleton(transition: .crossDissolve(0.25))
DispatchQueue.main.asyncAfter(deadline: .now() + 4) {
//停止view动画
self.textView?.hideSkeleton()
//带效果动画
self.btn.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.25))
}
// Do any additional setup after loading the view.
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DemoViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="btn" destination="pC1-h6-KAt" id="pNC-YY-Qel"/>
<outlet property="textView" destination="3Ky-Y2-Xpu" id="Kb8-WI-0nK"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pC1-h6-KAt">
<rect key="frame" x="20" y="177" width="46" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isSkeletonable" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="skeletonCornerRadius">
<real key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</button>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="3Ky-Y2-Xpu">
<rect key="frame" x="12" y="209" width="240" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
<color key="textColor" systemColor="labelColor" cocoaTouchSystemColor="darkTextColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isSkeletonable" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="skeletonCornerRadius">
<real key="value" value="10"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="lastLineFillPercent">
<integer key="value" value="40"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="linesCornerRadius">
<integer key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</textView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="108.69565217391305" y="145.98214285714286"/>
</view>
</objects>
</document>
//
// Bridge_Header.h
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/15.
// Copyright © 2020 junye lu. All rights reserved.
//
#ifndef Bridge_Header_h
#define Bridge_Header_h
#import "MJRefresh.h"
#endif /* Bridge_Header_h */
...@@ -29,7 +29,7 @@ let systemVersion = (UIDevice.current.systemVersion as String) ...@@ -29,7 +29,7 @@ let systemVersion = (UIDevice.current.systemVersion as String)
//online //online
let SERVERCE_ImageHost = "https://api.laigewan.com/upload/images/" let SERVERCE_ImageHost = "https://api.laigewan.com/upload/images/"
let SERVERCE_HOST = "https://api.laigewan.com/api/" let SERVERCE_HOST = "http://a.gelifood.com/apia"
//视图常量 //视图常量
let IS_IPHONE_X = __CGSizeEqualToSize(CGSize(width: 375.0, height: 812.0),UIScreen.main.bounds.size ) || __CGSizeEqualToSize(CGSize(width: 812.0, height: 375.0),UIScreen.main.bounds.size)||__CGSizeEqualToSize(CGSize(width: 414.0, height: 896.0),UIScreen.main.bounds.size ) || __CGSizeEqualToSize(CGSize(width: 896.0, height: 414.0),UIScreen.main.bounds.size) let IS_IPHONE_X = __CGSizeEqualToSize(CGSize(width: 375.0, height: 812.0),UIScreen.main.bounds.size ) || __CGSizeEqualToSize(CGSize(width: 812.0, height: 375.0),UIScreen.main.bounds.size)||__CGSizeEqualToSize(CGSize(width: 414.0, height: 896.0),UIScreen.main.bounds.size ) || __CGSizeEqualToSize(CGSize(width: 896.0, height: 414.0),UIScreen.main.bounds.size)
...@@ -116,21 +116,19 @@ func RGB(r:CGFloat,g:CGFloat,b:CGFloat)->UIColor{ ...@@ -116,21 +116,19 @@ func RGB(r:CGFloat,g:CGFloat,b:CGFloat)->UIColor{
func isTelNumber(num:NSString)->Bool func isTelNumber(num:NSString)->Bool
{ {
// let mobile = "^1(3[0-9]|5[0-35-9]|8[025-9])\\d{8}$" var mobile = "^1(3[0-9]|5[0-35-9]|8[025-9])\\d{8}$"
// let CM = "^1(34[0-8]|(3[5-9]|5[017-9]|8[278])\\d)\\d{7}$" var CM = "^1(34[0-8]|(3[5-9]|5[017-9]|8[278])\\d)\\d{7}$"
// let CU = "^1(3[0-2]|5[256]|8[56])\\d{8}$" var CU = "^1(3[0-2]|5[256]|8[56])\\d{8}$"
// let CT = "^1((33|53|8[09])[0-9]|349)\\d{7}$" var CT = "^1((33|53|8[09])[0-9]|349)\\d{7}$"
// let regextestmobile = NSPredicate(format: "SELF MATCHES %@",mobile) var regextestmobile = NSPredicate(format: "SELF MATCHES %@",mobile)
// let regextestcm = NSPredicate(format: "SELF MATCHES %@",CM ) var regextestcm = NSPredicate(format: "SELF MATCHES %@",CM )
// let regextestcu = NSPredicate(format: "SELF MATCHES %@" ,CU) var regextestcu = NSPredicate(format: "SELF MATCHES %@" ,CU)
// let regextestct = NSPredicate(format: "SELF MATCHES %@" ,CT) var regextestct = NSPredicate(format: "SELF MATCHES %@" ,CT)
// if ((regextestmobile.evaluate(with: num) == true) if ((regextestmobile.evaluate(with: num) == true)
// || (regextestcm.evaluate(with: num) == true) || (regextestcm.evaluate(with: num) == true)
// || (regextestct.evaluate(with: num) == true) || (regextestct.evaluate(with: num) == true)
// || (regextestcu.evaluate(with: num) == true)) || (regextestcu.evaluate(with: num) == true))
{
if num.length == 11 {
// {
return true return true
} }
else else
......
...@@ -90,7 +90,7 @@ extension NetworkRequest { ...@@ -90,7 +90,7 @@ extension NetworkRequest {
let dicstr:String = dic?[url] as! String let dicstr:String = dic?[url] as! String
let allUrl = SERVERCE_HOST + dicstr let allUrl = SERVERCE_HOST + "/" + dicstr
print(allUrl) print(allUrl)
print(params) print(params)
...@@ -118,21 +118,22 @@ extension NetworkRequest { ...@@ -118,21 +118,22 @@ extension NetworkRequest {
}else if json["code"].intValue == 999 { }else if json["code"].intValue == 999 {
print("uid错误") print("uid错误")
let alt = UIAlertView(title: "提示", message: json["message"].stringValue, delegate: nil, cancelButtonTitle: "确定")
alt.show() // let alt = UIAlertView(title: "提示", message: json["message"].stringValue, delegate: nil, cancelButtonTitle: "确定")
// alt.show()
failture(DogError.DataInvalidError) failture(DogError.DataInvalidError)
}else{ }else{
let alt = UIAlertView(title: "提示", message: json["message"].stringValue, delegate: nil, cancelButtonTitle: "确定")
alt.show() // let alt = UIAlertView(title: "提示", message: json["message"].stringValue, delegate: nil, cancelButtonTitle: "确定")
// alt.show()
failture(DogError.DataInvalidError) failture(DogError.DataInvalidError)
} }
case .failure(let error): case .failure(let error):
SwiftNotice.clear() SwiftNotice.clear()
//
let alt = UIAlertView(title: "提示", message: "网络错误", delegate: nil, cancelButtonTitle: "确定") // let alt = UIAlertView(title: "提示", message: "网络错误", delegate: nil, cancelButtonTitle: "确定")
// alt.show()
failture(error) failture(error)
print("error:\(error)") print("error:\(error)")
} }
......
...@@ -56,5 +56,22 @@ ...@@ -56,5 +56,22 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>我们需要通过您同意使用相机,才能获取回收柜的二维码相关数据</string>
<key>NSContactsUsageDescription</key>
<string>我们需要通过您同意使用通讯录,才能访问您的好友列表</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>我们需要通过您同意获取地理位置,查询周边回收柜的相关数据</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>我们需要通过您同意获取地理位置,查询周边回收柜的相关数据</string>
<key>NSMicrophoneUsageDescription</key>
<string>我们需要通过您同意使用麦克风,才能与你进行语音交流</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>我们需要通过您同意使用相册,才能修改头像</string>
</dict> </dict>
</plist> </plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>登录</key>
<string>Auth/sendAuth</string>
</dict>
</plist>
...@@ -7,3 +7,33 @@ ...@@ -7,3 +7,33 @@
// //
import Foundation import Foundation
import ObjectMapper
class LoginModel: Mappable {
var code:Int?
var message : String?
var data : UserIdModel?
required init?( map: Map) {
}
func mapping(map: Map) {
code <- map["code"]
message <- map["message"]
data <- map["data"]
}
}
class UserIdModel: Mappable {
var user_id : String?
var user_qrcode:String?
required init?( map: Map) {
}
func mapping(map: Map) {
user_id <- map["user_id"]
user_qrcode <- map["user_qrcode"]
}
}
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
// //
import UIKit import UIKit
import SnapKit
@objc protocol NavBarViewDelegate { @objc protocol NavBarViewDelegate {
@objc optional func backAction() @objc optional func backAction()
@objc optional func rightBtnClick() @objc optional func rightBtnClick()
...@@ -34,7 +36,7 @@ class NavBarView: BaseView { ...@@ -34,7 +36,7 @@ class NavBarView: BaseView {
rightBtn.setTitle(rightTitle, for: .normal) rightBtn.setTitle(rightTitle, for: .normal)
rightBtn.titleLabel?.font = setFont(15) rightBtn.titleLabel?.font = setFont(15)
rightBtn.sizeToFit() rightBtn.sizeToFit()
rightBtn.setTitleColor(UIColor.black, for: UIControlState(rawValue: 0)) rightBtn.setTitleColor(UIColor.black, for: UIControl.State(rawValue: 0))
rightBtn.snp.makeConstraints { (make) in rightBtn.snp.makeConstraints { (make) in
make.right.equalTo(-12) make.right.equalTo(-12)
make.bottom.equalTo(-14) make.bottom.equalTo(-14)
......
...@@ -7,18 +7,36 @@ ...@@ -7,18 +7,36 @@
// //
import UIKit import UIKit
import Alamofire
import CryptoSwift
class LoginViewController: BaseViewController {
class LoginViewController: BaseViewController {
@IBAction func forgetPasswordAction(_ sender: Any) { //MARK: -跳转忘记密码,注册,登录
let vc = FgPassViewController() @IBAction func LoginAction(_ sender: Any) {
let vc = DemoViewController()
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
}
@IBAction func forgetPasswordAction(_ sender: Any) {
// let vc = FgPassViewController()
// self.navigationController?.pushViewController(vc, animated: true)
} }
@IBAction func registerAction(_ sender: Any) { @IBAction func registerAction(_ sender: Any) {
let vc = RegisterViewController()
self.navigationController?.pushViewController(vc, animated: true) // let vc = RegisterViewController()
// self.navigationController?.pushViewController(vc, animated: true)
}
//MARK: - 输入账号、密码
@IBOutlet weak var phoneTF: UITextField!
@IBOutlet weak var passTF: UITextField!
//MARK: - viewWillAppear
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
} }
override func viewDidLoad() { override func viewDidLoad() {
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LoginViewController" customModule="GeliBusinessPlatform" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LoginViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections> <connections>
<outlet property="passTF" destination="2h0-gB-bEZ" id="bZI-m4-SQY"/>
<outlet property="phoneTF" destination="hly-0Q-Ewv" id="6fR-Fc-Qbe"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
</placeholder> </placeholder>
...@@ -33,10 +35,30 @@ ...@@ -33,10 +35,30 @@
<action selector="registerAction:" destination="-1" eventType="touchUpInside" id="XTb-OE-pq9"/> <action selector="registerAction:" destination="-1" eventType="touchUpInside" id="XTb-OE-pq9"/>
</connections> </connections>
</button> </button>
<textField opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hly-0Q-Ewv">
<rect key="frame" x="42" y="188" width="323" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KgH-nz-Xhb">
<rect key="frame" x="192" y="398" width="31" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="登录"/>
<connections>
<action selector="LoginAction:" destination="-1" eventType="touchUpInside" id="dZj-4g-QWv"/>
</connections>
</button>
<textField opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="2h0-gB-bEZ">
<rect key="frame" x="49" y="285" width="308" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="133" y="102"/> <point key="canvasLocation" x="131.8840579710145" y="101.78571428571428"/>
</view> </view>
</objects> </objects>
</document> </document>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -21,7 +21,12 @@ ...@@ -21,7 +21,12 @@
<key>Dollar.xcscheme_^#shared#^_</key> <key>Dollar.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>10</integer> <integer>11</integer>
</dict>
<key>ESTabBarController-swift.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>12</integer>
</dict> </dict>
<key>ESTabBarController.xcscheme_^#shared#^_</key> <key>ESTabBarController.xcscheme_^#shared#^_</key>
<dict> <dict>
...@@ -45,7 +50,7 @@ ...@@ -45,7 +50,7 @@
<key>Kingfisher.xcscheme_^#shared#^_</key> <key>Kingfisher.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>12</integer> <integer>13</integer>
</dict> </dict>
<key>MJRefresh.xcscheme</key> <key>MJRefresh.xcscheme</key>
<dict> <dict>
...@@ -78,22 +83,27 @@ ...@@ -78,22 +83,27 @@
<key>Realm.xcscheme_^#shared#^_</key> <key>Realm.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>13</integer> <integer>14</integer>
</dict> </dict>
<key>RealmSwift.xcscheme_^#shared#^_</key> <key>RealmSwift.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>14</integer> <integer>15</integer>
</dict> </dict>
<key>SkeletonView.xcscheme_^#shared#^_</key> <key>SkeletonView.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>15</integer> <integer>16</integer>
</dict>
<key>SnapKit.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>17</integer>
</dict> </dict>
<key>SwiftDate.xcscheme_^#shared#^_</key> <key>SwiftDate.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>16</integer> <integer>18</integer>
</dict> </dict>
<key>SwifterSwift.xcscheme</key> <key>SwifterSwift.xcscheme</key>
<dict> <dict>
...@@ -112,7 +122,7 @@ ...@@ -112,7 +122,7 @@
<key>ViewAnimator.xcscheme_^#shared#^_</key> <key>ViewAnimator.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>17</integer> <integer>19</integer>
</dict> </dict>
</dict> </dict>
<key>SuppressBuildableAutocreation</key> <key>SuppressBuildableAutocreation</key>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment