Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
882284fd
Commit
882284fd
authored
May 09, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善个人中心--格利支付功能流程(待接口完善)即可完成
parent
cf73f295
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
270 additions
and
142 deletions
+270
-142
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Model/GeliPayInfoModel.swift
GeliBusinessPlatform/Model/GeliPayInfoModel.swift
+2
-4
GeliBusinessPlatform/Other/HUD/PKHUD/PKHUDSquareBaseView.swift
...usinessPlatform/Other/HUD/PKHUD/PKHUDSquareBaseView.swift
+18
-3
GeliBusinessPlatform/Other/Web/WebViewController.swift
GeliBusinessPlatform/Other/Web/WebViewController.swift
+2
-1
GeliBusinessPlatform/ViewController/个人中心/PersonCenterViewController.swift
...form/ViewController/个人中心/PersonCenterViewController.swift
+1
-2
GeliBusinessPlatform/ViewController/换绑支付账号(绑定,换绑)/BindViewController.swift
...orm/ViewController/换绑支付账号(绑定,换绑)/BindViewController.swift
+61
-40
GeliBusinessPlatform/ViewController/换绑支付账号(绑定,换绑)/BindViewController.xib
...tform/ViewController/换绑支付账号(绑定,换绑)/BindViewController.xib
+0
-0
GeliBusinessPlatform/ViewController/支付账号(设置,修改)/BindStepTwoViewController.swift
...iewController/支付账号(设置,修改)/BindStepTwoViewController.swift
+70
-19
GeliBusinessPlatform/ViewController/支付账号(设置,修改)/BindStepTwoViewController.xib
.../ViewController/支付账号(设置,修改)/BindStepTwoViewController.xib
+9
-22
GeliBusinessPlatform/ViewController/支付账号(设置,修改)/PayViewController.swift
...atform/ViewController/支付账号(设置,修改)/PayViewController.swift
+90
-49
GeliBusinessPlatform/ViewController/支付账号(设置,修改)/PayViewController.xib
...Platform/ViewController/支付账号(设置,修改)/PayViewController.xib
+17
-2
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
882284fd
No preview for this file type
GeliBusinessPlatform/Model/GeliPayInfoModel.swift
View file @
882284fd
...
...
@@ -26,15 +26,13 @@ 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"
]
}
}
GeliBusinessPlatform/Other/HUD/PKHUD/PKHUDSquareBaseView.swift
View file @
882284fd
...
...
@@ -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
)
{
super
.
init
(
frame
:
PKHUDSquareBaseView
.
defaultSquareBaseViewFrame
)
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,8 +85,14 @@ 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))
imageView
.
frame
=
CGRect
(
origin
:
CGPoint
(
x
:
originX
,
y
:
15
),
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
))
...
...
GeliBusinessPlatform/Other/Web/WebViewController.swift
View file @
882284fd
...
...
@@ -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
...
...
GeliBusinessPlatform/ViewController/个人中心/PersonCenterViewController.swift
View file @
882284fd
...
...
@@ -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
)
张图片,分别如下:"
)
...
...
GeliBusinessPlatform/ViewController/换绑支付账号(绑定,换绑)/BindViewController.swift
View file @
882284fd
...
...
@@ -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
=
"换绑支付账号"
if
isNewBind
{
navbar
.
title
=
"绑定支付账户"
}
else
{
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
{
topPinkHeight
.
constant
=
44
}
else
{
pinkView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalTo
(
NavCGRect
.
height
)
make
.
left
.
right
.
equalTo
(
0
)
make
.
height
.
equalTo
(
22.5
)
}
topInputView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalTo
(
NavCGRect
.
height
+
32.5
)
make
.
left
.
right
.
equalTo
(
0
)
make
.
height
.
equalTo
(
50
)
}
submitBtn
.
titleString
=
"绑定支付账户"
topPinkHeight
.
constant
=
44
-
38
}
// Do any additional setup after loading the view.
}
//MARK: -绑定、获取验证码、忘记手机号码方法
@IBAction
func
registerPayAccountAction
(
_
sender
:
Any
)
{
print
(
"注册支付账号"
)
}
@IBAction
func
getCodeAction
(
_
sender
:
Any
)
{
print
(
"获取验证码"
)
}
@IBAction
func
forgetPhoneNumAction
(
_
sender
:
Any
)
{
print
(
"忘记手机号码"
)
}
@IBAction
func
submitBindingAction
(
_
sender
:
Any
)
{
print
(
"确认绑定账号"
)
}
//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
:
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
}
}
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
(
"确认绑定账号"
)
}
}
GeliBusinessPlatform/ViewController/换绑支付账号(绑定,换绑)/BindViewController.xib
View file @
882284fd
This diff is collapsed.
Click to expand it.
GeliBusinessPlatform/ViewController/支付账号(设置,修改)/BindStepTwoViewController.swift
View file @
882284fd
...
...
@@ -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
()
navbar
.
title
=
"绑定支付账户"
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
if
inputTF
.
text
?
.
count
==
0
{
// Do any additional setup after loading the view.
}
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
// 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.
@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
@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
()
}
}
}
GeliBusinessPlatform/ViewController/支付账号(设置,修改)/BindStepTwoViewController.xib
View file @
882284fd
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
5702
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
6096
"
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=
"1
5704
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
6086
"
/>
<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=
"3
27"
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=
"3
90.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"
/>
...
...
GeliBusinessPlatform/ViewController/支付账号(设置,修改)/PayViewController.swift
View file @
882284fd
...
...
@@ -9,8 +9,8 @@
import
UIKit
import
LGButton
class
PayViewController
:
BaseViewController
{
class
PayViewController
:
BaseViewController
,
GeliAlertViewDelegate
{
@IBOutlet
weak
var
enterBtnFrameBtn
:
UIButton
!
@IBOutlet
weak
var
enterBtn
:
LGButton
!
@IBOutlet
weak
var
changeBindBtn
:
UIButton
!
...
...
@@ -20,49 +20,32 @@ 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
self
.
passBtn
.
isHidden
=
true
self
.
changeBindBtn
.
isHidden
=
true
}
}
else
{
}
geliPayInfo
([
"user_token"
:
UserToken
as
Any
],
success
:
{
(
data
)
in
let
dataM
=
data
as!
GeliPayInfoModel
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
)
make
.
left
.
right
.
equalTo
(
0
)
...
...
@@ -71,20 +54,78 @@ class PayViewController: BaseViewController {
// Do any additional setup after loading the view.
}
//MARK: -方法
@IBAction
func
bindAction
(
_
sender
:
Any
)
{
print
(
"换绑账号"
)
}
@IBAction
func
passwordAction
(
_
sender
:
UIButton
)
{
if
sender
.
titleLabel
?
.
text
==
"修改支付密码"
{
print
(
"修改支付密码"
)
}
else
{
print
(
"设置支付密码"
)
@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
enterInGLPayAction
(
_
sender
:
Any
)
{
print
(
"进入格利支付"
)
}
}
@IBAction
func
passwordAction
(
_
sender
:
UIButton
)
{
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
)
}
}
GeliBusinessPlatform/ViewController/支付账号(设置,修改)/PayViewController.xib
View file @
882284fd
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
5702
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
6096
"
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=
"1
5704
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
6086
"
/>
<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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment