Commit 6d6daa91 authored by lujunye's avatar lujunye

首页,绑定支付账号页面完成

parent 02cbef0a
......@@ -19,6 +19,8 @@
E01C26B62446AF3100ADCC70 /* DemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E01C26B42446AF3100ADCC70 /* DemoViewController.swift */; };
E01C26B72446AF3100ADCC70 /* DemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E01C26B52446AF3100ADCC70 /* DemoViewController.xib */; };
E088CC8D24470BF0000DAA8A /* CodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E088CC8C24470BF0000DAA8A /* CodeView.swift */; };
E088CC932447124D000DAA8A /* BindViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E088CC912447124D000DAA8A /* BindViewController.swift */; };
E088CC942447124D000DAA8A /* BindViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E088CC922447124D000DAA8A /* BindViewController.xib */; };
E09B03A12445AF7100211A51 /* Define.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03A02445AF7100211A51 /* Define.swift */; };
E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03A22445AF9500211A51 /* NetworkRequest.swift */; };
E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03A52445B04D00211A51 /* BaseViewController.swift */; };
......@@ -72,6 +74,8 @@
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>"; };
E088CC8C24470BF0000DAA8A /* CodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeView.swift; sourceTree = "<group>"; };
E088CC912447124D000DAA8A /* BindViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BindViewController.swift; sourceTree = "<group>"; };
E088CC922447124D000DAA8A /* BindViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BindViewController.xib; 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>"; };
E09B03A52445B04D00211A51 /* BaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseViewController.swift; sourceTree = "<group>"; };
......@@ -222,6 +226,15 @@
path = "验证码";
sourceTree = "<group>";
};
E088CC8E24470F84000DAA8A /* 换绑支付账号 */ = {
isa = PBXGroup;
children = (
E088CC912447124D000DAA8A /* BindViewController.swift */,
E088CC922447124D000DAA8A /* BindViewController.xib */,
);
path = "换绑支付账号";
sourceTree = "<group>";
};
E09B039E2445AEF800211A51 /* Appdelegate */ = {
isa = PBXGroup;
children = (
......@@ -271,6 +284,7 @@
E09B03AD2445B0BA00211A51 /* ViewController */ = {
isa = PBXGroup;
children = (
E088CC8E24470F84000DAA8A /* 换绑支付账号 */,
E09B03BD2445B95000211A51 /* 忘记密码 */,
E09B03AE2445B0C600211A51 /* 登录 */,
);
......@@ -420,6 +434,7 @@
E09B03B72445B85A00211A51 /* LoginViewController.xib in Resources */,
E09B03C12445B96500211A51 /* FgPassViewController.xib in Resources */,
E01C26B72446AF3100ADCC70 /* DemoViewController.xib in Resources */,
E088CC942447124D000DAA8A /* BindViewController.xib in Resources */,
E00D85EB244561FE00F5F816 /* LaunchScreen.storyboard in Resources */,
E01C26B12446989700ADCC70 /* Interface_Z.plist in Resources */,
E00D85E8244561FE00F5F816 /* Preview Assets.xcassets in Resources */,
......@@ -503,6 +518,7 @@
E01C26B62446AF3100ADCC70 /* DemoViewController.swift in Sources */,
E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */,
E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */,
E088CC932447124D000DAA8A /* BindViewController.swift in Sources */,
E088CC8D24470BF0000DAA8A /* CodeView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "banner@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "banner@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "guanbi@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "guanbi@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "xianshi @2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "xianshi @3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "srgb",
"components" : {
"red" : "0.949",
"alpha" : "1.000",
"blue" : "0.949",
"green" : "0.949"
}
}
}
]
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "srgb",
"components" : {
"red" : "0.929",
"alpha" : "1.000",
"blue" : "0.929",
"green" : "0.929"
}
}
}
]
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "srgb",
"components" : {
"red" : "1.000",
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000"
}
}
}
]
}
\ No newline at end of file
......@@ -26,6 +26,7 @@ class BaseViewController: UIViewController {
if IsOldIos() {
self.automaticallyAdjustsScrollViewInsets = false;
}
self.view.backgroundColor = UIColor(named: "app底色")
// Do any additional setup after loading the view.
}
......
......@@ -57,7 +57,7 @@ class BaseModel: Mappable {
var code:Int?
var message : String?
var data : Any?
required init?( map: Map) {
}
......@@ -76,14 +76,14 @@ class NetworkRequest {
//处理更细分的错误情况,错误类型须遵从Error协议
enum DogError : Error{
case DataInvalidError
}
extension NetworkRequest {
//MARK: - GET 请求
// let tools : NetworkRequest.shareInstance!
//MARK: - POST 请求
func postRequest<T:BaseMappable>(_ url:String,_ params:[String:Any],_ type:(_ t:DataResponse<T>)->(),success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()){
let paths = Bundle.main.path(forResource: "Interface_Z", ofType: "plist")
let dic = NSDictionary (contentsOfFile: (paths! as String))
......@@ -96,7 +96,7 @@ extension NetworkRequest {
print(params)
var request = URLRequest(url: URL(string: allUrl)!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("IOS",forHTTPHeaderField:"CLIENT_TYPE")
......@@ -105,7 +105,7 @@ extension NetworkRequest {
request.addValue("\(ver!)",forHTTPHeaderField:"CLIENT_VERSION")
request.timeoutInterval = 10
request.httpBody = try! JSONSerialization.data(withJSONObject: params, options: [])
Alamofire.request(request).responseJSON { (response) in
switch response.result {
......@@ -115,31 +115,27 @@ extension NetworkRequest {
SwiftNotice.clear()
if json["code"].intValue == 200 {
success(Mapper<T>().map(JSONObject: value))
}else if json["code"].intValue == 999 {
print("uid错误")
// let alt = UIAlertView(title: "提示", message: json["message"].stringValue, delegate: nil, cancelButtonTitle: "确定")
// alt.show()
SwiftNotice.showText(json["message"].stringValue)
failture(DogError.DataInvalidError)
}else{
SwiftNotice.showText(json["message"].stringValue)
// let alt = UIAlertView(title: "提示", message: json["message"].stringValue, delegate: nil, cancelButtonTitle: "确定")
// alt.show()
failture(DogError.DataInvalidError)
}
case .failure(let error):
SwiftNotice.clear()
//
// let alt = UIAlertView(title: "提示", message: "网络错误", delegate: nil, cancelButtonTitle: "确定")
// alt.show()
failture(error)
print("error:\(error)")
}
}
}
//MARK: - 照片上传
func uploadImage(url:String,image: UIImage, params: [String : String], success:@escaping (_ result: [String: Any])->(), failure:@escaping (_ error: Error)->()) {
let paths = Bundle.main.path(forResource: "Interface_Z", ofType: "plist")
......@@ -205,15 +201,15 @@ extension NetworkRequest {
success(Mapper<T>().map(JSONObject: value))
}else if json["code"].intValue == 999 {
NotificationCenter.default.post(name: Notification.Name(rawValue: "logout"), object: nil)
}else{
if json["code"].intValue == 500 {
success(Mapper<T>().map(JSONObject: value))
}else{
failture(DogError.DataInvalidError)
failture(DogError.DataInvalidError)
}
}
case .failure(let error):
......@@ -222,7 +218,7 @@ extension NetworkRequest {
}
}
}
}
......@@ -69,13 +69,14 @@ class CaptchaView: UIView {
// let bgImg = UIImage.init(named: "codeBgImg")
// self.backgroundColor = UIColor.init(patternImage: bgImg!)
self.backgroundColor = UIColor(named: "app底色")
//设置layer圆角半径
self.layer.cornerRadius = 5.0
//隐藏边界
self.layer.masksToBounds = false
self.layer.borderWidth = 1
self.layer.borderColor = UIColor.gray.cgColor
self.layer.borderColor = UIColor(named: "分界线颜色")?.cgColor
}
......
......@@ -73,6 +73,7 @@ class NavBarView: BaseView {
self.backgroundColor = UIColor.white
titleLbl = UILabel()
titleLbl.font = setFont(18)
titleLbl.textColor = UIColor(named: "标题字颜色")
titleLbl.textAlignment = .center
self.addSubview(titleLbl)
titleLbl.snp.makeConstraints { (make) in
......
//
// BindingViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/15.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class BindViewController: BaseViewController,NavBarViewDelegate {
@IBOutlet weak var accountTF: UITextField!
@IBOutlet weak var phoneTF: UITextField!
@IBOutlet weak var codeTF: UITextField!
@IBOutlet weak var topInputView: UIView!
//MARK: -绑定、获取验证码、忘记手机号码方法
@IBAction func getCodeAction(_ sender: Any) {
print("获取验证码")
}
@IBAction func forgetPhoneNumAction(_ sender: Any) {
print("忘记手机号码")
}
@IBAction func submitBindingAction(_ sender: Any) {
print("确认绑定账号")
}
override func viewDidLoad() {
super.viewDidLoad()
let navbar = NavBarView(frame: NavCGRect)
navbar.title = "换绑支付账号"
navbar.deleagte = self
self.view.addSubview(navbar)
topInputView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.equalTo(0)
make.height.equalTo(50)
}
// Do any additional setup after loading the view.
}
//MARK: -delegate方法
func backAction() {
self.navigationController?.popViewController(animated: true)
}
}
......@@ -9,7 +9,7 @@
import UIKit
import Alamofire
import CryptoSwift
import LGButton
class LoginViewController: BaseViewController {
......@@ -20,9 +20,15 @@ let vc = DemoViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
@IBAction func loginAction(_ sender: LGButton) {
@IBAction func shPassAction(_ sender: UIButton) {
sender.isSelected = !sender.isSelected
passTF.isSecureTextEntry = !sender.isSelected
}
@IBAction func loginAction(_ sender: Any) {
print("loginAction")
let vc = BindViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
//MARK: - 输入账号、密码、验证码
......@@ -34,7 +40,7 @@ self.navigationController?.pushViewController(vc, animated: true)
//MARK: - viewWillAppear
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.view.backgroundColor = UIColor(named:"白色背景色")
let codeV = CaptchaView(frame:codeView.bounds)
codeView.addSubview(codeV);
}
......@@ -43,7 +49,7 @@ self.navigationController?.pushViewController(vc, animated: true)
override func viewDidLoad() {
super.viewDidLoad()
passTF.isSecureTextEntry = true
}
......
......@@ -22,7 +22,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="AdE-4p-9iF">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="banner" translatesAutoresizingMaskIntoConstraints="NO" id="AdE-4p-9iF">
<rect key="frame" x="0.0" y="0.0" width="375" height="234"/>
<constraints>
<constraint firstAttribute="height" constant="234" id="tCW-CX-6JG">
......@@ -113,7 +113,7 @@
</constraints>
</view>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ipW-Al-eG6">
<rect key="frame" x="123.5" y="11" width="147" height="34"/>
<rect key="frame" x="123.5" y="11" width="66.5" height="34"/>
<constraints>
<constraint firstAttribute="height" constant="34" id="9Ek-gz-Qgx"/>
</constraints>
......@@ -121,36 +121,34 @@
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/>
</textField>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="pencil" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="Qlw-bX-fHQ">
<rect key="frame" x="305" y="20.5" width="17.5" height="15.5"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xgv-CB-GLZ">
<rect key="frame" x="285.5" y="-0.5" width="56.5" height="56.5"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xgv-CB-GLZ">
<rect key="frame" x="305.5" y="23" width="17" height="10"/>
<constraints>
<constraint firstAttribute="height" constant="56.5" id="Tjn-KO-sxc"/>
<constraint firstAttribute="width" constant="56.5" id="u4Q-Ub-HoS"/>
<constraint firstAttribute="height" constant="10" id="a0w-jl-rNH"/>
<constraint firstAttribute="width" constant="17" id="hRV-DN-5Um"/>
</constraints>
<state key="normal" title="Button"/>
<state key="normal" image="guanbi"/>
<state key="selected" image="xianshi "/>
<connections>
<action selector="shPassAction:" destination="-1" eventType="touchUpInside" id="S3P-pI-hyJ"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="xgv-CB-GLZ" firstAttribute="leading" secondItem="ipW-Al-eG6" secondAttribute="trailing" constant="15" id="21O-9S-VaC"/>
<constraint firstItem="ipW-Al-eG6" firstAttribute="centerY" secondItem="hAO-bO-280" secondAttribute="centerY" id="7dR-sK-Zsv"/>
<constraint firstItem="xgv-CB-GLZ" firstAttribute="centerY" secondItem="Qlw-bX-fHQ" secondAttribute="centerY" id="8lr-lb-ggX"/>
<constraint firstAttribute="trailing" secondItem="Mlw-Ng-8f9" secondAttribute="trailing" constant="42.5" id="94n-o3-G0v"/>
<constraint firstItem="hAO-bO-280" firstAttribute="top" secondItem="OaN-ws-ype" secondAttribute="top" id="Dqz-X5-I9k"/>
<constraint firstItem="ZCK-xJ-hVg" firstAttribute="leading" secondItem="hAO-bO-280" secondAttribute="trailing" constant="15" id="EA3-5Y-w5F"/>
<constraint firstAttribute="height" constant="56.5" id="KkC-6K-McV"/>
<constraint firstAttribute="bottom" secondItem="Mlw-Ng-8f9" secondAttribute="bottom" id="Kws-hY-wOc"/>
<constraint firstItem="ipW-Al-eG6" firstAttribute="leading" secondItem="ZCK-xJ-hVg" secondAttribute="trailing" constant="15" id="NDa-PU-i4w"/>
<constraint firstItem="Qlw-bX-fHQ" firstAttribute="centerY" secondItem="hAO-bO-280" secondAttribute="centerY" id="PNy-0h-IHU"/>
<constraint firstItem="ZCK-xJ-hVg" firstAttribute="centerY" secondItem="hAO-bO-280" secondAttribute="centerY" id="QWP-1w-Lxq"/>
<constraint firstItem="xgv-CB-GLZ" firstAttribute="centerX" secondItem="Qlw-bX-fHQ" secondAttribute="centerX" id="REv-SD-m6f"/>
<constraint firstAttribute="trailing" secondItem="Qlw-bX-fHQ" secondAttribute="trailing" constant="52.5" id="bcs-0x-hMp"/>
<constraint firstItem="xgv-CB-GLZ" firstAttribute="centerY" secondItem="ipW-Al-eG6" secondAttribute="centerY" id="nCm-Z6-wIR"/>
<constraint firstItem="Mlw-Ng-8f9" firstAttribute="top" secondItem="hAO-bO-280" secondAttribute="bottom" id="qTb-8R-WjZ"/>
<constraint firstItem="hAO-bO-280" firstAttribute="leading" secondItem="OaN-ws-ype" secondAttribute="leading" constant="52.5" id="uHI-YO-GLX"/>
<constraint firstItem="Mlw-Ng-8f9" firstAttribute="leading" secondItem="OaN-ws-ype" secondAttribute="leading" constant="42.5" id="vaj-M3-2ae"/>
<constraint firstAttribute="trailing" secondItem="xgv-CB-GLZ" secondAttribute="trailing" constant="52.5" id="x5U-vH-WGA"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZRL-RS-ju7">
......@@ -239,7 +237,7 @@
<userDefinedRuntimeAttribute type="string" keyPath="titleFontName" value="PingFang SC Medium"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="loginAction:" destination="-1" eventType="valueChanged" id="NKF-QG-WPi"/>
<action selector="loginAction:" destination="-1" eventType="touchUpInside" id="jlC-gq-qwQ"/>
</connections>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MQe-6S-qXS">
......@@ -280,18 +278,20 @@
</view>
</objects>
<resources>
<image name="pencil" catalog="system" width="64" height="56"/>
<image name="banner" width="750" height="468"/>
<image name="guanbi" width="37" height="18"/>
<image name="xianshi " width="37" height="24"/>
<namedColor name="分界线颜色">
<color red="0.65098039215686276" green="0.75686274509803919" blue="0.8784313725490196" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.65100002288818359" green="0.75700002908706665" blue="0.87800002098083496" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色上">
<color red="0.38823529411764707" green="0.62352941176470589" blue="0.90196078431372551" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色下">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
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