Commit 882284fd authored by 刘俊宏's avatar 刘俊宏

完善个人中心--格利支付功能流程(待接口完善)即可完成

parent cf73f295
......@@ -26,14 +26,12 @@ class GeliPayInfoModel: Mappable {
class GeliPayInfoDataModel: Mappable {
var gelipay_username : String? //支付账号
var status : Int? //状态:1已绑定格利支付且格利支付已绑卡,2已绑定格利支付且格利支付未绑卡,3未绑定格利支付
required init?( map: Map) {
}
func mapping(map: Map) {
gelipay_username <- map["gelipay_username"]
status <- map["status"]
}
......
......@@ -13,6 +13,7 @@ import UIKit
open class PKHUDSquareBaseView: UIView {
static let defaultSquareBaseViewFrame = CGRect(origin: CGPoint.zero, size: CGSize(width: 190, height: 126))
static let nodefaultSquareBaseViewFrame = CGRect(origin: CGPoint.zero, size: CGSize(width: 100, height: 100))
public override init(frame: CGRect) {
super.init(frame: frame)
......@@ -20,10 +21,18 @@ open class PKHUDSquareBaseView: UIView {
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
public init(image: UIImage? = nil, title: String? = nil, subtitle: String? = nil) {
if subtitle == nil && title == nil {
super.init(frame: PKHUDSquareBaseView.nodefaultSquareBaseViewFrame)
}else{
super.init(frame: PKHUDSquareBaseView.defaultSquareBaseViewFrame)
}
self.imageView.image = image
titleLabel.text = title
subtitleLabel.text = subtitle
......@@ -76,9 +85,15 @@ open class PKHUDSquareBaseView: UIView {
let threeQuarterHeight = CGFloat(ceilf(CFloat(viewHeight / 4.0 * 3.0)))
titleLabel.frame = CGRect(origin: CGPoint(x: originX, y: 0.0), size: CGSize(width: viewWidth, height: quarterHeight))
// imageView.frame = CGRect(origin: CGPoint(x: originX, y: quarterHeight), size: CGSize(width: viewWidth, height: halfHeight))
if subtitleLabel.text == nil && titleLabel.text == nil {
imageView.frame = CGRect(origin: CGPoint(x: originX, y: quarterHeight), size: CGSize(width: viewWidth, height: halfHeight))
}else{
imageView.frame = CGRect(origin: CGPoint(x: originX, y: 15), size: CGSize(width: viewWidth, height: halfHeight))
}
subtitleLabel.frame = CGRect(origin: CGPoint(x: originX, y: threeQuarterHeight - 10), size: CGSize(width: viewWidth, height: quarterHeight))
}
......
......@@ -23,9 +23,10 @@ class WebViewController: BaseViewController {
initInterface()
}
var urlStr:String? = ""
func initInterface() -> () {
let url = URL(string: "https://pay.gelifood.com/m/index.htm")
let url = URL(string: urlStr!)
let request = URLRequest.init(url: url!, cachePolicy: .reloadRevalidatingCacheData, timeoutInterval: 10)
wkWebView.navigationDelegate = self
......
......@@ -99,8 +99,7 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
self.navigationController?.pushViewController(vc, animated: true)
}else if indexPath.row == 2{
//权限设置-弹窗
// let vc = WebViewController()
// self.navigationController?.pushViewController(vc, animated: true)
_ = self.presentHGImagePicker(maxSelected:2) { (assets) in
//结果处理
print("共选择了\(assets.count)张图片,分别如下:")
......
......@@ -12,56 +12,77 @@ import LGButton
class BindViewController: BaseViewController {
@IBOutlet weak var submitBtn: LGButton!
@IBOutlet weak var pinkView: UIView!
@IBOutlet weak var accountTF: UITextField!
@IBOutlet weak var phoneTF: UITextField!
@IBOutlet weak var codeTF: UITextField!
@IBOutlet weak var topInputView: UIView!
@IBOutlet weak var codeBtn: UIButton!
@IBOutlet weak var topPinkHeight: NSLayoutConstraint!
var isNewBind = false
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "换绑支付账号"
self.view.addSubview(navbar)
if pinkView.isHidden {
topInputView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.equalTo(0)
make.height.equalTo(50)
}
submitBtn.titleString = "确认绑定支付账户"
if isNewBind {
navbar.title = "绑定支付账户"
}else{
pinkView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.equalTo(0)
make.height.equalTo(22.5)
navbar.title = "换绑支付账户"
}
topInputView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height+32.5)
make.left.right.equalTo(0)
make.height.equalTo(50)
}
submitBtn.titleString = "绑定支付账户"
self.view.addSubview(navbar)
if isNewBind {
topPinkHeight.constant = 44
}else{
topPinkHeight.constant = 44 - 38
}
// Do any additional setup after loading the view.
}
//MARK: -绑定、获取验证码、忘记手机号码方法
//MARK: -绑定、获取验证码
//
@IBAction func registerPayAccountAction(_ sender: Any) {
print("注册支付账号")
HUD.flash(.progress)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
locationGeliPay(["user_token":UserToken as Any,"type":"1"], success: { (data) in
HUD.hide(animated: true)
let dataM = data as! LocationGeliPayModel
let vc = WebViewController()
vc.urlStr = dataM.data?.url
self.navigationController?.pushViewController(vc, animated: true)
}) { (error) in
}
}
@IBAction func getCodeAction(_ sender: Any) {
@IBAction func getCodeAction(_ sender: UIButton) {
print("获取验证码")
sendSmsCaptcha(["phone":phoneTF.text as Any,"type":"5"], success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1 {
sender.isUserInteractionEnabled = false
sender.setTitle("60s", for: .normal);
Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(self.timeCounting), userInfo: nil, repeats: true);
}
}) { (error) in
}
@IBAction func forgetPhoneNumAction(_ sender: Any) {
print("忘记手机号码")
}
var timeCount:Int = 60
@objc func timeCounting(sender:Timer){
timeCount -= 1
codeBtn.setTitle("\(timeCount)"+"s", for: .normal)
if timeCount == 0{
codeBtn.setTitle("获取验证码", for: .normal)
codeBtn.isUserInteractionEnabled = true
timeCount = 60
sender.invalidate()
}
}
@IBAction func submitBindingAction(_ sender: Any) {
print("确认绑定账号")
}
}
<?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"/>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<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="BindViewController" customModule="GeliBusinessPlatform" customModuleProvider="target"/>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BindViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="accountTF" destination="ffm-Wf-cTs" id="OqY-l4-wn0"/>
<outlet property="codeBtn" destination="CmK-Hc-fnD" id="Vvl-l9-psO"/>
<outlet property="codeTF" destination="3oP-hI-HAZ" id="qPH-JV-Ez7"/>
<outlet property="phoneTF" destination="t65-xv-Q0b" id="AxS-fo-dgO"/>
<outlet property="submitBtn" destination="waH-iS-ZgL" id="wlO-QK-IJe"/>
<outlet property="topPinkHeight" destination="eTF-kI-nx8" id="CSh-dq-50H"/>
<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>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NLt-l1-671">
<rect key="frame" x="0.0" y="44" width="414" height="50"/>
<rect key="frame" x="0.0" y="82" width="414" height="50"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OsT-yM-MMu">
<rect key="frame" x="15" y="49" width="399" height="1"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="0Ta-R8-nvT"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="格利支付账号:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jOz-IM-jO5">
<rect key="frame" x="15" y="0.0" width="93" height="49"/>
<constraints>
<constraint firstAttribute="width" constant="93" id="cyZ-Lq-EkD"/>
</constraints>
<rect key="frame" x="15" y="17.333333333333329" width="93" height="15.666666666666664"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入格利支付账号" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ffm-Wf-cTs">
<rect key="frame" x="108" y="7.5" width="291" height="34"/>
<constraints>
<constraint firstAttribute="height" constant="34" id="xqs-jB-AOk"/>
</constraints>
<rect key="frame" x="279.33333333333331" y="16.333333333333329" width="119.66666666666669" height="17.333333333333329"/>
<color key="textColor" name="标题字颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/>
......@@ -45,89 +42,31 @@
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="ffm-Wf-cTs" firstAttribute="leading" secondItem="jOz-IM-jO5" secondAttribute="trailing" id="3c5-af-q0C"/>
<constraint firstItem="ffm-Wf-cTs" firstAttribute="centerY" secondItem="jOz-IM-jO5" secondAttribute="centerY" id="6pH-Co-9Kt"/>
<constraint firstAttribute="trailing" secondItem="OsT-yM-MMu" secondAttribute="trailing" id="7vi-ui-Dg0"/>
<constraint firstItem="jOz-IM-jO5" firstAttribute="top" secondItem="NLt-l1-671" secondAttribute="top" id="8ws-PX-fIP"/>
<constraint firstAttribute="bottom" secondItem="OsT-yM-MMu" secondAttribute="bottom" id="DKb-DP-xU6"/>
<constraint firstAttribute="height" constant="50" id="Lb6-U9-1no"/>
<constraint firstItem="jOz-IM-jO5" firstAttribute="leading" secondItem="NLt-l1-671" secondAttribute="leading" constant="15" id="mH3-To-f3k"/>
<constraint firstItem="OsT-yM-MMu" firstAttribute="top" secondItem="jOz-IM-jO5" secondAttribute="bottom" id="rUr-hk-Muj"/>
<constraint firstItem="OsT-yM-MMu" firstAttribute="leading" secondItem="NLt-l1-671" secondAttribute="leading" constant="15" id="xhX-8s-kOZ"/>
<constraint firstAttribute="trailing" secondItem="ffm-Wf-cTs" secondAttribute="trailing" constant="15" id="yUz-p0-Rkw"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="prG-Tn-Xbh">
<rect key="frame" x="0.0" y="44" width="414" height="22.5"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yHc-Xh-wxI">
<rect key="frame" x="0.0" y="0.0" width="414" height="22.5"/>
<color key="backgroundColor" name="未登录提示背景色"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="若未注册支付账户,点击立即注册" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XAt-Ap-9cj">
<rect key="frame" x="20" y="0.0" width="169" height="22.5"/>
<constraints>
<constraint firstAttribute="width" constant="169" id="VMH-xB-g3H"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="qianwang" translatesAutoresizingMaskIntoConstraints="NO" id="s7H-zf-9UI">
<rect key="frame" x="392" y="8" width="7" height="7"/>
<constraints>
<constraint firstAttribute="height" constant="7" id="SBq-t5-WG5"/>
<constraint firstAttribute="width" constant="7" id="vRf-z8-UgS"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="E4H-3t-feW">
<rect key="frame" x="0.0" y="0.0" width="414" height="22.5"/>
</button>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="E4H-3t-feW" secondAttribute="trailing" id="0TQ-Xv-pWj"/>
<constraint firstAttribute="trailing" secondItem="yHc-Xh-wxI" secondAttribute="trailing" id="9cJ-W5-B8s"/>
<constraint firstAttribute="bottom" secondItem="XAt-Ap-9cj" secondAttribute="bottom" id="Axp-YG-vK3"/>
<constraint firstItem="E4H-3t-feW" firstAttribute="leading" secondItem="prG-Tn-Xbh" secondAttribute="leading" id="IYw-fv-lQv"/>
<constraint firstItem="E4H-3t-feW" firstAttribute="top" secondItem="prG-Tn-Xbh" secondAttribute="top" id="JlB-sD-HGN"/>
<constraint firstAttribute="bottom" secondItem="yHc-Xh-wxI" secondAttribute="bottom" id="Ntl-Bm-y29"/>
<constraint firstItem="yHc-Xh-wxI" firstAttribute="leading" secondItem="prG-Tn-Xbh" secondAttribute="leading" id="O6J-aA-a2p"/>
<constraint firstItem="XAt-Ap-9cj" firstAttribute="top" secondItem="prG-Tn-Xbh" secondAttribute="top" id="cI0-Fr-7EK"/>
<constraint firstAttribute="height" constant="22.5" id="kSq-kt-DWD"/>
<constraint firstItem="XAt-Ap-9cj" firstAttribute="leading" secondItem="prG-Tn-Xbh" secondAttribute="leading" constant="20" id="lBM-jN-bo1"/>
<constraint firstItem="yHc-Xh-wxI" firstAttribute="top" secondItem="prG-Tn-Xbh" secondAttribute="top" id="rIV-cW-cvq"/>
<constraint firstItem="s7H-zf-9UI" firstAttribute="centerY" secondItem="XAt-Ap-9cj" secondAttribute="centerY" id="rqN-PP-bBH"/>
<constraint firstAttribute="trailing" secondItem="s7H-zf-9UI" secondAttribute="trailing" constant="15" id="yNb-Rv-cWO"/>
<constraint firstAttribute="bottom" secondItem="E4H-3t-feW" secondAttribute="bottom" id="yz8-rl-sQY"/>
<constraint firstItem="jOz-IM-jO5" firstAttribute="leading" secondItem="NLt-l1-671" secondAttribute="leading" constant="15" id="3Vf-0c-caJ"/>
<constraint firstItem="jOz-IM-jO5" firstAttribute="centerY" secondItem="NLt-l1-671" secondAttribute="centerY" id="E9N-w3-bvO"/>
<constraint firstAttribute="trailing" secondItem="ffm-Wf-cTs" secondAttribute="trailing" constant="15" id="Oa1-CQ-iKd"/>
<constraint firstItem="ffm-Wf-cTs" firstAttribute="centerY" secondItem="NLt-l1-671" secondAttribute="centerY" id="d0G-lM-G4U"/>
<constraint firstAttribute="height" constant="50" id="qS7-he-es3"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="leftAligned" value="YES"/>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KNo-tQ-dsg">
<rect key="frame" x="0.0" y="104" width="414" height="50"/>
<rect key="frame" x="0.0" y="147" width="414" height="50"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1x9-Pa-mWp">
<rect key="frame" x="15" y="49" width="399" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="g0H-fg-q7U"/>
<constraint firstAttribute="height" constant="1" id="60i-ly-nyS"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="格利支付手机号:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hcl-nQ-8fP">
<rect key="frame" x="15" y="0.0" width="110" height="49"/>
<constraints>
<constraint firstAttribute="width" constant="110" id="YlY-IS-raZ"/>
</constraints>
<rect key="frame" x="14.999999999999993" y="17.333333333333343" width="106.33333333333331" height="15.666666666666664"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入手机号码" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="t65-xv-Q0b">
<rect key="frame" x="125" y="7.5" width="274" height="34"/>
<constraints>
<constraint firstAttribute="height" constant="34" id="qOh-u3-0Al"/>
</constraints>
<rect key="frame" x="306" y="16.333333333333343" width="93" height="17.333333333333329"/>
<color key="textColor" name="标题字颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/>
......@@ -135,45 +74,37 @@
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="1x9-Pa-mWp" firstAttribute="leading" secondItem="KNo-tQ-dsg" secondAttribute="leading" constant="15" id="65n-MU-eCJ"/>
<constraint firstItem="Hcl-nQ-8fP" firstAttribute="leading" secondItem="KNo-tQ-dsg" secondAttribute="leading" constant="15" id="C82-MZ-M8F"/>
<constraint firstItem="Hcl-nQ-8fP" firstAttribute="top" secondItem="KNo-tQ-dsg" secondAttribute="top" id="CqC-c7-rvj"/>
<constraint firstAttribute="bottom" secondItem="1x9-Pa-mWp" secondAttribute="bottom" id="DO2-WD-ewm"/>
<constraint firstAttribute="trailing" secondItem="t65-xv-Q0b" secondAttribute="trailing" constant="15" id="Vx4-EV-UrG"/>
<constraint firstItem="t65-xv-Q0b" firstAttribute="leading" secondItem="Hcl-nQ-8fP" secondAttribute="trailing" id="Zi5-zH-Mce"/>
<constraint firstAttribute="height" constant="50" id="dbn-BC-hod"/>
<constraint firstItem="1x9-Pa-mWp" firstAttribute="top" secondItem="Hcl-nQ-8fP" secondAttribute="bottom" id="fqb-2a-i2Z"/>
<constraint firstItem="t65-xv-Q0b" firstAttribute="centerY" secondItem="Hcl-nQ-8fP" secondAttribute="centerY" id="iCx-8F-ToU"/>
<constraint firstAttribute="trailing" secondItem="1x9-Pa-mWp" secondAttribute="trailing" id="jVc-Di-hjs"/>
<constraint firstItem="1x9-Pa-mWp" firstAttribute="leading" secondItem="KNo-tQ-dsg" secondAttribute="leading" constant="15" id="2qt-o7-pwo"/>
<constraint firstAttribute="trailing" secondItem="1x9-Pa-mWp" secondAttribute="trailing" id="D4b-vj-uBC"/>
<constraint firstAttribute="height" constant="50" id="Dpd-wM-ZLy"/>
<constraint firstItem="t65-xv-Q0b" firstAttribute="centerY" secondItem="KNo-tQ-dsg" secondAttribute="centerY" id="WCH-tB-EIs"/>
<constraint firstItem="Hcl-nQ-8fP" firstAttribute="centerY" secondItem="KNo-tQ-dsg" secondAttribute="centerY" id="Zny-wU-brC"/>
<constraint firstAttribute="trailing" secondItem="t65-xv-Q0b" secondAttribute="trailing" constant="15" id="eLG-gr-kT6"/>
<constraint firstItem="Hcl-nQ-8fP" firstAttribute="leading" secondItem="KNo-tQ-dsg" secondAttribute="leading" constant="15" id="enV-DN-oAP"/>
<constraint firstAttribute="bottom" secondItem="1x9-Pa-mWp" secondAttribute="bottom" id="v9D-GO-mZN"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bCp-kS-a0t">
<rect key="frame" x="0.0" y="154" width="414" height="50"/>
<rect key="frame" x="0.0" y="197" width="414" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="验证码:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SjA-bd-foE">
<rect key="frame" x="15" y="0.0" width="54" height="50"/>
<constraints>
<constraint firstAttribute="width" constant="54" id="1cf-Xd-zDL"/>
</constraints>
<rect key="frame" x="15" y="17.333333333333343" width="54" height="15.666666666666664"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CmK-Hc-fnD">
<rect key="frame" x="319" y="0.0" width="80" height="50"/>
<constraints>
<constraint firstAttribute="width" constant="80" id="D0G-bA-CcS"/>
</constraints>
<rect key="frame" x="332" y="11" width="67" height="28"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="获取验证码">
<color key="titleColor" name="按钮渐变色下,字体颜色"/>
</state>
<connections>
<action selector="getCodeAction:" destination="-1" eventType="touchUpInside" id="JMG-Os-Onv"/>
</connections>
</button>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入验证码" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3oP-hI-HAZ">
<rect key="frame" x="69" y="8" width="235" height="34"/>
<constraints>
<constraint firstAttribute="height" constant="34" id="pxa-wr-z3b"/>
</constraints>
<rect key="frame" x="224.33333333333334" y="16.333333333333343" width="79.666666666666657" height="17.333333333333329"/>
<color key="textColor" name="标题字颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/>
......@@ -181,23 +112,20 @@
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="CmK-Hc-fnD" secondAttribute="trailing" constant="15" id="7Id-Lg-6TC"/>
<constraint firstAttribute="height" constant="50" id="BnX-tY-LG0"/>
<constraint firstItem="3oP-hI-HAZ" firstAttribute="centerY" secondItem="SjA-bd-foE" secondAttribute="centerY" id="Elg-zm-Zdd"/>
<constraint firstItem="CmK-Hc-fnD" firstAttribute="leading" secondItem="3oP-hI-HAZ" secondAttribute="trailing" constant="15" id="F2C-uT-r0Y"/>
<constraint firstItem="3oP-hI-HAZ" firstAttribute="leading" secondItem="SjA-bd-foE" secondAttribute="trailing" id="RMz-O8-uqX"/>
<constraint firstItem="CmK-Hc-fnD" firstAttribute="top" secondItem="bCp-kS-a0t" secondAttribute="top" id="Z0E-Zd-TF4"/>
<constraint firstItem="SjA-bd-foE" firstAttribute="top" secondItem="bCp-kS-a0t" secondAttribute="top" id="gv8-Ih-jrX"/>
<constraint firstAttribute="bottom" secondItem="CmK-Hc-fnD" secondAttribute="bottom" id="hMY-gs-rGu"/>
<constraint firstAttribute="bottom" secondItem="SjA-bd-foE" secondAttribute="bottom" id="xnE-sO-hSp"/>
<constraint firstItem="SjA-bd-foE" firstAttribute="leading" secondItem="bCp-kS-a0t" secondAttribute="leading" constant="15" id="z2W-Tk-UXt"/>
<constraint firstItem="SjA-bd-foE" firstAttribute="leading" secondItem="bCp-kS-a0t" secondAttribute="leading" constant="15" id="8cF-XK-Uuh"/>
<constraint firstAttribute="trailing" secondItem="3oP-hI-HAZ" secondAttribute="trailing" constant="110" id="Fsg-8Y-iXz"/>
<constraint firstItem="SjA-bd-foE" firstAttribute="centerY" secondItem="bCp-kS-a0t" secondAttribute="centerY" id="bYi-7O-cb0"/>
<constraint firstItem="3oP-hI-HAZ" firstAttribute="centerY" secondItem="bCp-kS-a0t" secondAttribute="centerY" id="dR0-TZ-WdO"/>
<constraint firstAttribute="height" constant="50" id="hua-5S-NOW"/>
<constraint firstAttribute="trailing" secondItem="CmK-Hc-fnD" secondAttribute="trailing" constant="15" id="nGk-2g-QKj"/>
<constraint firstItem="CmK-Hc-fnD" firstAttribute="centerY" secondItem="bCp-kS-a0t" secondAttribute="centerY" id="tCr-gC-zZX"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="waH-iS-ZgL" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="37.5" y="304" width="339" height="44"/>
<rect key="frame" x="37" y="357" width="340" height="44"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="QhC-kH-4kk"/>
<constraint firstAttribute="height" constant="44" id="9Lg-k6-2G2"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
......@@ -209,34 +137,64 @@
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="string" keyPath="titleString" value="确认绑定支付账户"/>
<userDefinedRuntimeAttribute type="string" keyPath="titleString" value="确定换绑支付账号"/>
<userDefinedRuntimeAttribute type="number" keyPath="titleFontSize">
<real key="value" value="17"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="submitBindingAction:" destination="-1" eventType="touchUpInside" id="0Ej-La-aA0"/>
</connections>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Sin-s1-YuG">
<rect key="frame" x="0.0" y="44" width="414" height="23"/>
<color key="backgroundColor" name="未登录提示背景色"/>
<constraints>
<constraint firstAttribute="height" constant="23" id="wUX-jF-fVP"/>
</constraints>
<connections>
<action selector="registerPayAccountAction:" destination="-1" eventType="touchUpInside" id="HUH-Uq-uyA"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="若未注册支付账号,点击立即注册。" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2o7-cm-d0i">
<rect key="frame" x="15" y="48.666666666666664" width="180" height="14"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="qianwang" translatesAutoresizingMaskIntoConstraints="NO" id="RXO-dr-lff">
<rect key="frame" x="395" y="51" width="9" height="9"/>
<constraints>
<constraint firstAttribute="width" constant="9" id="MNb-4e-qQK"/>
<constraint firstAttribute="height" constant="9" id="nfP-0i-Wle"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="NLt-l1-671" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="0Ku-L4-Tkc"/>
<constraint firstItem="prG-Tn-Xbh" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="0ur-Ua-dv0"/>
<constraint firstItem="NLt-l1-671" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="1OO-6W-Yef"/>
<constraint firstItem="KNo-tQ-dsg" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="DOi-22-uzY"/>
<constraint firstItem="waH-iS-ZgL" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="37.5" id="P4B-Jp-aPM"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="bCp-kS-a0t" secondAttribute="trailing" id="UOk-Tx-QwB"/>
<constraint firstItem="waH-iS-ZgL" firstAttribute="top" secondItem="bCp-kS-a0t" secondAttribute="bottom" constant="100" id="UjX-A0-vCe"/>
<constraint firstItem="bCp-kS-a0t" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="UvF-Pr-mil"/>
<constraint firstItem="KNo-tQ-dsg" firstAttribute="top" secondItem="NLt-l1-671" secondAttribute="bottom" constant="10" id="W4q-P7-j7d"/>
<constraint firstItem="prG-Tn-Xbh" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="WVR-Ex-lJM"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="KNo-tQ-dsg" secondAttribute="trailing" id="eXN-H3-sud"/>
<constraint firstItem="prG-Tn-Xbh" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="hGA-Ts-Psy"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="NLt-l1-671" secondAttribute="trailing" id="hRL-kU-JtX"/>
<constraint firstItem="bCp-kS-a0t" firstAttribute="top" secondItem="KNo-tQ-dsg" secondAttribute="bottom" id="hwk-HZ-g3B"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="waH-iS-ZgL" secondAttribute="trailing" constant="37.5" id="sBd-o3-rwa"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="RXO-dr-lff" secondAttribute="trailing" constant="10" id="45O-U2-WYu"/>
<constraint firstItem="Sin-s1-YuG" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="6Mk-vA-5wm"/>
<constraint firstItem="bCp-kS-a0t" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="CRb-wU-m3P"/>
<constraint firstItem="2o7-cm-d0i" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="Hrh-Ue-eVa"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="waH-iS-ZgL" secondAttribute="trailing" constant="37" id="M0u-0P-DOR"/>
<constraint firstItem="NLt-l1-671" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="O3G-yy-f1a"/>
<constraint firstItem="bCp-kS-a0t" firstAttribute="top" secondItem="KNo-tQ-dsg" secondAttribute="bottom" id="PI3-H5-xes"/>
<constraint firstItem="waH-iS-ZgL" firstAttribute="top" secondItem="bCp-kS-a0t" secondAttribute="bottom" constant="110" id="Urn-Gw-pOA"/>
<constraint firstItem="KNo-tQ-dsg" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="djT-xD-Amh"/>
<constraint firstItem="Sin-s1-YuG" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="eTF-kI-nx8"/>
<constraint firstItem="NLt-l1-671" firstAttribute="top" secondItem="Sin-s1-YuG" secondAttribute="bottom" constant="15" id="h02-RZ-ReG"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Sin-s1-YuG" secondAttribute="trailing" id="hBV-2q-yOe"/>
<constraint firstItem="2o7-cm-d0i" firstAttribute="centerY" secondItem="Sin-s1-YuG" secondAttribute="centerY" id="iJv-WX-Qdh"/>
<constraint firstItem="RXO-dr-lff" firstAttribute="centerY" secondItem="Sin-s1-YuG" secondAttribute="centerY" id="nBd-fd-Ya9"/>
<constraint firstItem="KNo-tQ-dsg" firstAttribute="top" secondItem="NLt-l1-671" secondAttribute="bottom" constant="15" id="sQM-yq-1tC"/>
<constraint firstItem="waH-iS-ZgL" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="37" id="wdD-tM-0hu"/>
<constraint firstItem="KNo-tQ-dsg" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="wvo-Vh-AMc"/>
<constraint firstItem="bCp-kS-a0t" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="xaJ-n5-MJA"/>
<constraint firstItem="NLt-l1-671" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="y2V-wc-VS4"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="131.8840579710145" y="112.5"/>
<point key="canvasLocation" x="-157.97101449275362" y="138.61607142857142"/>
</view>
</objects>
<resources>
......
......@@ -9,14 +9,25 @@
import UIKit
import LGButton
class BindStepTwoViewController: BaseViewController {
class BindStepTwoViewController: BaseViewController,UITextFieldDelegate {
var phoneStr : String
= ""
var isNewBind = false
@IBOutlet weak var accountLbl: UILabel!
@IBAction func getCodeAction(_ sender: Any) {
}
@IBAction func forgetPassAction(_ sender: Any) {
}
@IBOutlet weak var codeBtn: UIButton!
@IBAction func nextStep(_ sender: Any) {
HUD.flash(.progress)
verifyMmsCaptcha(["phone":phoneStr,"type":"4","code":inputTF.text! as String], success: { (data) in
HUD.hide(animated: true)
let vc = BindViewController()
vc.isNewBind = self.isNewBind
self.navigationController?.pushViewController(vc, animated: true)
}) { (error) in
}
}
......@@ -25,7 +36,11 @@ class BindStepTwoViewController: BaseViewController {
@IBOutlet weak var nextBtn: LGButton!
override func viewDidLoad() {
super.viewDidLoad()
if isNewBind {
navbar.title = "绑定支付账户"
}else{
navbar.title = "换绑支付账户"
}
self.view.addSubview(navbar)
topView.snp.makeConstraints { (make) in
......@@ -33,26 +48,62 @@ class BindStepTwoViewController: BaseViewController {
make.left.right.equalTo(0)
make.height.equalTo(99)
}
inputTF.delegate = self
self.accountLbl.text = phoneStr
nextBtn.alpha = 0.5
nextBtn.isUserInteractionEnabled = false
// Do any additional setup after loading the view.
}
if inputTF.text?.count == 0 {
func textFieldDidBeginEditing(_ textField: UITextField) {
changeBtnCanSelect (sender: textField)
}
func textFieldDidEndEditing(_ textField: UITextField) {
changeBtnCanSelect (sender: textField)
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
changeBtnCanSelect (sender: textField)
return true
}
func changeBtnCanSelect (sender:UITextField){
if sender.text?.count == 0 {
nextBtn.alpha = 0.5
nextBtn.isUserInteractionEnabled = false
}else{
nextBtn.alpha = 1
nextBtn.isUserInteractionEnabled = true
}
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
@IBAction func getCodeAction(_ sender: UIButton) {
// HUD.flash(.labeledSubSuccess(subtitle: "发送成功"),delay: 1.2)
sendSmsCaptcha(["phone":phoneStr,"type":"4"], success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1 {
sender.isUserInteractionEnabled = false
sender.setTitle("60s", for: .normal);
Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(self.timeCounting), userInfo: nil, repeats: true);
}
}) { (error) in
}
}
var timeCount:Int = 60
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
@objc func timeCounting(sender:Timer){
timeCount -= 1
codeBtn.setTitle("\(timeCount)"+"s", for: .normal)
if timeCount == 0{
codeBtn.setTitle("获取验证码", for: .normal)
codeBtn.isUserInteractionEnabled = true
timeCount = 60
sender.invalidate()
}
}
*/
}
<?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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......@@ -11,6 +11,7 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BindStepTwoViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="accountLbl" destination="LOM-aL-uSm" id="Ej4-uV-9bk"/>
<outlet property="codeBtn" destination="EMV-Hk-uFx" id="owq-4Z-BtV"/>
<outlet property="inputTF" destination="aZQ-or-Ekx" id="KKJ-ou-7WF"/>
<outlet property="nextBtn" destination="B7f-Hz-PLj" id="bNM-Qb-uaI"/>
<outlet property="topView" destination="qeZ-NG-WV9" id="wsf-Ri-WGg"/>
......@@ -35,11 +36,10 @@
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="155*****121" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LOM-aL-uSm">
<rect key="frame" x="327" y="15" width="72" height="18.5"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="7" translatesAutoresizingMaskIntoConstraints="NO" id="LOM-aL-uSm">
<rect key="frame" x="390.5" y="15" width="8.5" height="18.5"/>
<constraints>
<constraint firstAttribute="height" constant="18.5" id="2ii-aD-Dsg"/>
<constraint firstAttribute="width" constant="72" id="VuV-bl-LZv"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="灰色字体颜色"/>
......@@ -72,7 +72,7 @@
<color key="titleColor" name="按钮渐变色下,字体颜色"/>
</state>
<connections>
<action selector="getCodeAction:" destination="-1" eventType="touchUpInside" id="3p8-73-upu"/>
<action selector="getCodeAction:" destination="-1" eventType="touchUpInside" id="8iI-aZ-59X"/>
</connections>
</button>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入验证码" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="aZQ-or-Ekx">
......@@ -125,32 +125,19 @@
<userDefinedRuntimeAttribute type="number" keyPath="titleFontSize">
<real key="value" value="17"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="3"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="nextStep:" destination="-1" eventType="touchUpInside" id="gD6-ue-Bde"/>
</connections>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uVm-FH-axX">
<rect key="frame" x="149" y="297" width="116" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="dsT-sJ-mSF"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<state key="normal" title="忘记手机号码?">
<color key="titleColor" name="按钮渐变色下,字体颜色"/>
</state>
<connections>
<action selector="forgetPassAction:" destination="-1" eventType="touchUpInside" id="616-Hr-lW0"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="uVm-FH-axX" secondAttribute="trailing" constant="149" id="3GD-ax-jUC"/>
<constraint firstItem="B7f-Hz-PLj" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="37.5" id="GVf-nl-UKJ"/>
<constraint firstItem="uVm-FH-axX" firstAttribute="top" secondItem="B7f-Hz-PLj" secondAttribute="bottom" constant="10" id="HTH-CD-gj8"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="B7f-Hz-PLj" secondAttribute="trailing" constant="37.5" id="MkO-FJ-nuQ"/>
<constraint firstItem="uVm-FH-axX" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="149" id="REr-yi-BXA"/>
<constraint firstItem="B7f-Hz-PLj" firstAttribute="top" secondItem="qeZ-NG-WV9" secondAttribute="bottom" constant="100" id="Tzq-ar-jLH"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="qeZ-NG-WV9" secondAttribute="trailing" id="WtR-Xo-zsG"/>
<constraint firstItem="qeZ-NG-WV9" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="toL-CZ-eyt"/>
......
......@@ -9,7 +9,7 @@
import UIKit
import LGButton
class PayViewController: BaseViewController {
class PayViewController: BaseViewController ,GeliAlertViewDelegate{
@IBOutlet weak var enterBtnFrameBtn: UIButton!
@IBOutlet weak var enterBtn: LGButton!
......@@ -20,48 +20,31 @@ class PayViewController: BaseViewController {
@IBOutlet weak var accountLbl: UILabel!
@IBOutlet weak var userEnShowView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "支付账号"
self.view.addSubview(navbar)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
HUD.flash(.progress)
geliPayInfo(["user_token":UserToken as Any], success: { (data) in
let dataM = data as! GeliPayInfoModel
if dataM.data?.status == 3 {
if self.accountLbl.text == "未绑定支付账号" {
self.enterBtn.titleString = "绑定账号"
self.enterBtn.borderColor = UIColor(named: "按钮渐变色下,字体颜色")!
self.enterBtn.titleColor = UIColor(named: "按钮渐变色下,字体颜色")!
self.enterBtn.gradientEndColor = UIColor(named: "app底色")
self.enterBtn.gradientStartColor = UIColor(named: "app底色")
self.enterBtn.borderWidth = 1.5
if dataM.code == 2 {
self.enterBtnFrameBtn.isHidden = false
self.enterBtn.isHidden = true
self.passBtn.isHidden = true
self.changeBindBtn.isHidden = true
}
}else{
self.accountLbl.text = dataM.data?.gelipay_username
}
self.userEnShowView.isHidden = true
HUD.hide(animated: true)
}) { (error) in
}
if accountLbl.text == "未绑定支付账号" {
enterBtn.titleString = "绑定账号"
enterBtn.borderColor = UIColor(named: "按钮渐变色下,字体颜色")!
enterBtn.titleColor = UIColor(named: "按钮渐变色下,字体颜色")!
enterBtn.gradientEndColor = UIColor(named: "app底色")
enterBtn.gradientStartColor = UIColor(named: "app底色")
enterBtn.borderWidth = 1.5
passBtn.isHidden = true
changeBindBtn.isHidden = true
}
// if navbar.title == "支付账号" {
// passBtn.setTitle("修改支付密码", for: .normal)
// }else{
// passBtn.setTitle("设置支付密码", for: .normal)
// }
pinkView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
......@@ -74,17 +57,75 @@ class PayViewController: BaseViewController {
@IBAction func bindAction(_ sender: Any) {
print("换绑账号")
let UserToken = UserDefaults.standard.value(forKey: "user_token")
getShopAdministratorInfo(["user_token":UserToken as Any], success: { (data) in
let dataM = data as! ShopAdministratorInfoModel
if dataM.code != 2 {
//跳转下一页
let vc = BindStepTwoViewController()
vc.phoneStr = dataM.data?.mobile as! String
self.navigationController?.pushViewController(vc, animated: true)
}
}) { (error) in
}
}
@IBAction func passwordAction(_ sender: UIButton) {
if sender.titleLabel?.text == "修改支付密码" {
print("修改支付密码")
}else{
print("设置支付密码")
HUD.flash(.progress)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
locationGeliPay(["user_token":UserToken as Any,"type":"2"], success: { (data) in
HUD.hide(animated: true)
let dataM = data as! LocationGeliPayModel
let vc = WebViewController()
vc.urlStr = dataM.data?.url
self.navigationController?.pushViewController(vc, animated: true)
}) { (error) in
}
}
@IBAction func enterInGLPayAction(_ sender: Any) {
print("进入格利支付")
HUD.flash(.progress)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
locationGeliPay(["user_token":UserToken as Any,"type":"1"], success: { (data) in
HUD.hide(animated: true)
let dataM = data as! LocationGeliPayModel
let vc = WebViewController()
vc.urlStr = dataM.data?.url
self.navigationController?.pushViewController(vc, animated: true)
}) { (error) in
}
}
@IBAction func enterBindAction(_ sender: UIButton) {
print("未绑定--")
let UserToken = UserDefaults.standard.value(forKey: "user_token")
getShopAdministratorInfo(["user_token":UserToken as Any], success: { (data) in
let dataM = data as! ShopAdministratorInfoModel
if dataM.code != 2 {
//跳转下一页
let vc = BindStepTwoViewController()
vc.isNewBind = true
vc.phoneStr = dataM.data?.mobile as! String
self.navigationController?.pushViewController(vc, animated: true)
}else{
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = "020-81338860"
alertView.titileLbl.text = "亲爱的格利商户,您未绑定手机号,无法绑定格利账号,请联系:"
self.view.window?.addSubview(alertView)
}
}) { (error) in
}
}
func sureAction(sender: UIButton) {
UIApplication.shared.openURL(NSURL.init(string: "tel://020-81338860")! as URL)
}
}
<?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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......@@ -16,6 +16,7 @@
<outlet property="enterBtnFrameBtn" destination="4Jc-QV-Bqa" id="YLi-Cz-IgY"/>
<outlet property="passBtn" destination="aJE-2M-4y3" id="oWF-if-08i"/>
<outlet property="pinkView" destination="5ip-zi-hlC" id="Yt8-rj-o8p"/>
<outlet property="userEnShowView" destination="wuO-lu-ULv" id="oDa-Og-TmN"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
......@@ -180,7 +181,14 @@
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="enterBindAction:" destination="-1" eventType="touchUpInside" id="0wC-Il-XZZ"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wuO-lu-ULv">
<rect key="frame" x="0.0" y="0.0" width="414" height="862"/>
<color key="backgroundColor" name="app底色"/>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
......@@ -199,16 +207,23 @@
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="5ip-zi-hlC" secondAttribute="trailing" id="jaP-ca-fur"/>
<constraint firstItem="4Jc-QV-Bqa" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="37.5" id="mMt-4D-EFf"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="dpm-28-Ljh" secondAttribute="trailing" constant="37.5" id="p4a-ll-Ibx"/>
<constraint firstAttribute="trailing" secondItem="wuO-lu-ULv" secondAttribute="trailing" id="qrM-eG-7MH"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="wuO-lu-ULv" secondAttribute="bottom" id="rKC-00-5nJ"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="aJE-2M-4y3" secondAttribute="trailing" constant="37.5" id="shk-vI-E99"/>
<constraint firstItem="wuO-lu-ULv" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="vVV-EG-FPf"/>
<constraint firstItem="aJE-2M-4y3" firstAttribute="top" secondItem="dpm-28-Ljh" secondAttribute="bottom" constant="20" id="vlV-WR-Sjm"/>
<constraint firstItem="Rgd-rh-pDk" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="we4-rg-j6j"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Rgd-rh-pDk" secondAttribute="trailing" id="wiY-zs-sO1"/>
<constraint firstItem="wuO-lu-ULv" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="wmN-1e-553"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="131.8840579710145" y="112.5"/>
</view>
</objects>
<resources>
<namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色上">
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
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