Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VirtualCard-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
APP
VirtualCard-iOS
Commits
66125a6f
Commit
66125a6f
authored
May 25, 2020
by
IOS-张 博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页和登录页调整
parent
33397f25
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
501 additions
and
29 deletions
+501
-29
project.pbxproj
VirtualPayment/VirtualPayment.xcodeproj/project.pbxproj
+28
-0
QGBindingCardCell.m
...Card/Function/QGCard/View/BindingCard/QGBindingCardCell.m
+6
-9
QGBindingCardSubCell.m
...d/Function/QGCard/View/BindingCard/QGBindingCardSubCell.m
+23
-10
QGCardViewController.m
...ard/Function/QGCard/ViewController/QGCardViewController.m
+11
-7
QGBindingVerifyCodeCell.h
...in/Function/QGBindingPhone/View/QGBindingVerifyCodeCell.h
+24
-0
QGBindingVerifyCodeCell.m
...in/Function/QGBindingPhone/View/QGBindingVerifyCodeCell.m
+99
-0
QGBindingPhoneViewController.h
...indingPhone/ViewController/QGBindingPhoneViewController.h
+17
-0
QGBindingPhoneViewController.m
...indingPhone/ViewController/QGBindingPhoneViewController.m
+283
-0
QGRegisterViewController.m
...erOrVerifyLogin/ViewController/QGRegisterViewController.m
+5
-3
QGMediatorClassHeader.h
...alPayment/QGUtils/QGTool/Mediator/QGMediatorClassHeader.h
+2
-0
QGMediatorClassTools.h
...ualPayment/QGUtils/QGTool/Mediator/QGMediatorClassTools.h
+1
-0
QGMediatorClassTools.m
...ualPayment/QGUtils/QGTool/Mediator/QGMediatorClassTools.m
+2
-0
No files found.
VirtualPayment/VirtualPayment.xcodeproj/project.pbxproj
View file @
66125a6f
...
...
@@ -358,6 +358,8 @@
9E2AEDBA2408C63E00FFA083
/* QGAuthAlertView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E2AEDB92408C63E00FFA083
/* QGAuthAlertView.m */
;
};
9E35683824776D8E00FB725B
/* QGLoginBottomView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E35683724776D8E00FB725B
/* QGLoginBottomView.m */
;
};
9E35683B2477B04100FB725B
/* QGCardBindingBottomView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E35683A2477B04100FB725B
/* QGCardBindingBottomView.m */
;
};
9E3568412477BDBC00FB725B
/* QGBindingPhoneViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E3568402477BDBC00FB725B
/* QGBindingPhoneViewController.m */
;
};
9E3568442477C33200FB725B
/* QGBindingVerifyCodeCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E3568432477C33200FB725B
/* QGBindingVerifyCodeCell.m */
;
};
9E4609B023B1E73E004FD96E
/* libz.tbd in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9EA79A7C2282AAFD00CDCB80
/* libz.tbd */
;
};
9E4609B123B1E748004FD96E
/* libsqlite3.tbd in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9EA79A7E2282AB0700CDCB80
/* libsqlite3.tbd */
;
};
9E4609B323B1E750004FD96E
/* JavaScriptCore.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E4609B223B1E750004FD96E
/* JavaScriptCore.framework */
;
};
...
...
@@ -1371,6 +1373,10 @@
9E35683724776D8E00FB725B
/* QGLoginBottomView.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
QGLoginBottomView.m
;
sourceTree
=
"<group>"
;
};
9E3568392477B04100FB725B
/* QGCardBindingBottomView.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
QGCardBindingBottomView.h
;
sourceTree
=
"<group>"
;
};
9E35683A2477B04100FB725B
/* QGCardBindingBottomView.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
QGCardBindingBottomView.m
;
sourceTree
=
"<group>"
;
};
9E35683F2477BDBC00FB725B
/* QGBindingPhoneViewController.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
QGBindingPhoneViewController.h
;
sourceTree
=
"<group>"
;
};
9E3568402477BDBC00FB725B
/* QGBindingPhoneViewController.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
QGBindingPhoneViewController.m
;
sourceTree
=
"<group>"
;
};
9E3568422477C33200FB725B
/* QGBindingVerifyCodeCell.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
QGBindingVerifyCodeCell.h
;
sourceTree
=
"<group>"
;
};
9E3568432477C33200FB725B
/* QGBindingVerifyCodeCell.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
QGBindingVerifyCodeCell.m
;
sourceTree
=
"<group>"
;
};
9E4609B223B1E750004FD96E
/* JavaScriptCore.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
JavaScriptCore.framework
;
path
=
System/Library/Frameworks/JavaScriptCore.framework
;
sourceTree
=
SDKROOT
;
};
9E4609B423B1E758004FD96E
/* WebKit.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
WebKit.framework
;
path
=
System/Library/Frameworks/WebKit.framework
;
sourceTree
=
SDKROOT
;
};
9E4609B623B1E75E004FD96E
/* CoreFoundation.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreFoundation.framework
;
path
=
System/Library/Frameworks/CoreFoundation.framework
;
sourceTree
=
SDKROOT
;
};
...
...
@@ -3633,10 +3639,30 @@
9E35683C2477BCBF00FB725B
/* QGBindingPhone */
=
{
isa
=
PBXGroup
;
children
=
(
9E35683E2477BD8600FB725B
/* View */
,
9E35683D2477BD4B00FB725B
/* ViewController */
,
);
path
=
QGBindingPhone
;
sourceTree
=
"<group>"
;
};
9E35683D2477BD4B00FB725B
/* ViewController */
=
{
isa
=
PBXGroup
;
children
=
(
9E35683F2477BDBC00FB725B
/* QGBindingPhoneViewController.h */
,
9E3568402477BDBC00FB725B
/* QGBindingPhoneViewController.m */
,
);
path
=
ViewController
;
sourceTree
=
"<group>"
;
};
9E35683E2477BD8600FB725B
/* View */
=
{
isa
=
PBXGroup
;
children
=
(
9E3568422477C33200FB725B
/* QGBindingVerifyCodeCell.h */
,
9E3568432477C33200FB725B
/* QGBindingVerifyCodeCell.m */
,
);
path
=
View
;
sourceTree
=
"<group>"
;
};
9E4609A223B1E673004FD96E
/* ByteDanceApm */
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -6034,6 +6060,7 @@
7F4C810F22CA02AA003B9D07
/* QGMessageCenterVC.m in Sources */
,
46440DD022BB2D7B0021346A
/* QGMonthSegmentView.m in Sources */
,
9E920BBA228570C0004B01D6
/* QGGradientShadowButton.m in Sources */
,
9E3568442477C33200FB725B
/* QGBindingVerifyCodeCell.m in Sources */
,
465A6EA4245AC9CF00BF924E
/* SAVisualizedSnapshotMessage.m in Sources */
,
9EA797C0227ED06500CDCB80
/* MASLayoutConstraint.m in Sources */
,
461B92DD24061C690010ADEA
/* QGMallSearchTipItemView.m in Sources */
,
...
...
@@ -6338,6 +6365,7 @@
7F4C80E622C9EBAA003B9D07
/* QGFeedbackAddImageTableViewCell.m in Sources */
,
462E005322C388370010C0E2
/* QGRepaymentGroupViewController.m in Sources */
,
9EB1DB6122C472A1008D28CE
/* QGIncreaseAmountCollectionViewCell.m in Sources */
,
9E3568412477BDBC00FB725B
/* QGBindingPhoneViewController.m in Sources */
,
9EB1D9DA22C0B9B4008D28CE
/* QGDeviceId.m in Sources */
,
9E26B6682293F07F00A15F9A
/* AsynchronousOperation.m in Sources */
,
9EBE24362431F1D9009C83A1
/* QGCardQuickEntranceCell.m in Sources */
,
...
...
VirtualPayment/VirtualPayment/QGClasses/Card/Function/QGCard/View/BindingCard/QGBindingCardCell.m
View file @
66125a6f
...
...
@@ -38,9 +38,9 @@
//collectionView
UICollectionViewFlowLayout
*
layout
=
[[
UICollectionViewFlowLayout
alloc
]
init
];
layout
.
minimumLineSpacing
=
0
;
layout
.
minimumLineSpacing
=
1
0
;
layout
.
minimumInteritemSpacing
=
0
;
layout
.
itemSize
=
CGSizeMake
((
MAINSCREEN_WIDTH
-
20
*
2
)
/
3
.
0
,
12
0
);
layout
.
itemSize
=
CGSizeMake
((
MAINSCREEN_WIDTH
-
20
*
2
-
10
*
2
)
/
3
.
0
,
9
0
);
layout
.
scrollDirection
=
UICollectionViewScrollDirectionHorizontal
;
self
.
collectionView
=
[[
UICollectionView
alloc
]
initWithFrame
:
CGRectZero
collectionViewLayout
:
layout
];
...
...
@@ -50,13 +50,10 @@
self
.
collectionView
.
delegate
=
self
;
[
self
.
contentView
addSubview
:
self
.
collectionView
];
[
self
.
collectionView
setShadowColor
:[
UIColor
shadowColor
]
shadowRadius
:
3
shadowOffset
:
CGSizeMake
(
0
,
1
)
cornerRadius
:
6
];
self
.
collectionView
.
layer
.
masksToBounds
=
NO
;
[
self
.
collectionView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
inset
(
20
);
make
.
top
.
mas_equalTo
(
titleLabel
.
mas_bottom
).
offset
(
14
);
make
.
height
.
mas_equalTo
(
12
0
);
make
.
height
.
mas_equalTo
(
9
0
);
}];
[
self
.
collectionView
registerClass
:[
QGBindingCardSubCell
class
]
forCellWithReuseIdentifier
:
NSStringFromClass
([
QGBindingCardSubCell
class
])];
...
...
@@ -83,15 +80,15 @@
NSString
*
titleStr
=
self
.
nameArray
[
indexPath
.
row
];
if
([
titleStr
isEqualToString
:
@"微信支付"
])
{
cell
.
titleLabel
.
text
Color
=
[
UIColor
colorWithHexString
:
@"56CD2F"
];
cell
.
titleLabel
.
background
Color
=
[
UIColor
colorWithHexString
:
@"56CD2F"
];
}
else
if
([
titleStr
isEqualToString
:
@"支付宝"
])
{
cell
.
titleLabel
.
text
Color
=
[
UIColor
colorWithHexString
:
@"42B0F4"
];
cell
.
titleLabel
.
background
Color
=
[
UIColor
colorWithHexString
:
@"42B0F4"
];
}
else
if
([
titleStr
isEqualToString
:
@"手机钱包"
])
{
cell
.
titleLabel
.
text
Color
=
[
UIColor
colorWithHexString
:
@"F66F56"
];
cell
.
titleLabel
.
background
Color
=
[
UIColor
colorWithHexString
:
@"F66F56"
];
}
cell
.
titleLabel
.
text
=
titleStr
;
...
...
VirtualPayment/VirtualPayment/QGClasses/Card/Function/QGCard/View/BindingCard/QGBindingCardSubCell.m
View file @
66125a6f
...
...
@@ -14,24 +14,37 @@
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
if
(
self
=
[
super
initWithFrame
:
frame
])
{
// self.backgroundColor = [UIColor moduleSeparatorColorF7F7];
//标题
self
.
titleLabel
=
[
UILabel
creatLabelWithSuperView
:
self
title
:
nil
titleFontSize
:
[
UIFont
qg_mediumFontOfSize
:
16
]
textColor
:
nil
alignment
:
NSTextAlignmentCenter
];
[
s
elf
.
titleLabel
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
inset
(
0
)
;
make
.
height
.
mas_equalTo
(
20
);
make
.
top
.
inset
(
1
2
);
UIView
*
shadowView
=
[
UIView
creatViewWithSuperView
:
self
backgroundColor
:[
UIColor
whiteColor
]
];
[
s
hadowView
setShadowColor
:[
UIColor
shadowColor
]
shadowRadius
:
3
shadowOffset
:
CGSizeMake
(
0
,
1
)
cornerRadius
:
6
];
shadowView
.
layer
.
masksToBounds
=
NO
;
[
shadowView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
top
.
bottom
.
inset
(
2
);
}];
//icon
self
.
iconImageView
=
[
UIImageView
creatImageViewWithSuperView
:
s
elf
imageName
:
@""
];
self
.
iconImageView
=
[
UIImageView
creatImageViewWithSuperView
:
s
hadowView
imageName
:
@""
];
[
self
.
iconImageView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
mas_equalTo
(
self
.
titleLabel
.
mas_bottom
).
offset
(
9
);
make
.
top
.
inset
(
10
);
make
.
centerX
.
offset
(
0
);
make
.
size
.
mas_equalTo
(
CGSizeMake
(
36
,
36
));
}];
//标题
self
.
titleLabel
=
[
UILabel
creatLabelWithSuperView
:
shadowView
title
:
nil
titleFontSize
:
[
UIFont
qg_mediumFontOfSize
:
16
]
textColor
:
[
UIColor
whiteColor
]
alignment
:
NSTextAlignmentCenter
];
[
self
.
titleLabel
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
width
.
mas_equalTo
(
70
);
make
.
centerX
.
offset
(
0
);
make
.
size
.
mas_equalTo
(
CGSizeMake
(
70
,
70
));
make
.
height
.
mas_equalTo
(
24
);
make
.
top
.
mas_equalTo
(
self
.
iconImageView
.
mas_bottom
).
offset
(
6
);
}];
self
.
titleLabel
.
layer
.
cornerRadius
=
3
;
self
.
titleLabel
.
clipsToBounds
=
YES
;
}
return
self
;
...
...
VirtualPayment/VirtualPayment/QGClasses/Card/Function/QGCard/ViewController/QGCardViewController.m
View file @
66125a6f
...
...
@@ -182,6 +182,8 @@
[
self
.
tableView
endHeaderRefreshWithBlock
:
nil
];
[
self
.
tableView
reloadData
];
//tableView在初始位置的时候
if
(
self
.
tableView
.
contentOffset
.
y
==
0
)
{
//底部绑卡是否展示
BOOL
hiddenBindingView
=
YES
;
//已激活二类户
...
...
@@ -189,6 +191,8 @@
hiddenBindingView
=
!
self
.
cardDataModel
.
blankNote
.
showCreditDesc
.
boolValue
;
}
self
.
bindingBottomView
.
hidden
=
hiddenBindingView
;
}
}
failure
:^
(
NSURLSessionDataTask
*
_Nonnull
task
,
NSError
*
_Nonnull
error
)
{
@strongify
(
self
);
...
...
@@ -679,7 +683,7 @@
break
;
//立即绑卡
case
6
:
heightForRow
=
1
7
5
;
heightForRow
=
1
4
5
;
break
;
default:
break
;
...
...
VirtualPayment/VirtualPayment/QGClasses/Login/Function/QGBindingPhone/View/QGBindingVerifyCodeCell.h
0 → 100644
View file @
66125a6f
//
// QGVerifyCodeCell.h
// VirtualPayment
//
// Created by 张博 on 2020/5/22.
// Copyright © 2020 bo.zhang. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
QGBindingVerifyCodeCell
:
UITableViewCell
/// 验证码按钮
@property
(
nonatomic
,
strong
,
readonly
)
UIButton
*
codeButton
;
/// 验证码改变
@property
(
nonatomic
,
copy
)
void
(
^
cellBlock
)
(
NSString
*
codeNumber
);
@end
NS_ASSUME_NONNULL_END
VirtualPayment/VirtualPayment/QGClasses/Login/Function/QGBindingPhone/View/QGBindingVerifyCodeCell.m
0 → 100644
View file @
66125a6f
//
// QGVerifyCodeCell.m
// VirtualPayment
//
// Created by 张博 on 2020/5/22.
// Copyright © 2020 bo.zhang. All rights reserved.
//
#import "QGBindingVerifyCodeCell.h"
#import "QGInputGroupView.h"
#import "QGBasicUITool.h"
@interface
QGBindingVerifyCodeCell
()
/// 验证码输入框
@property
(
nonatomic
,
strong
)
QGInputGroupView
*
codeInputView
;
/// 验证码按钮
@property
(
nonatomic
,
strong
,
readwrite
)
UIButton
*
codeButton
;
@end
@implementation
QGBindingVerifyCodeCell
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
if
(
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
])
{
self
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
//验证码
self
.
codeInputView
=
[[
QGInputGroupView
alloc
]
initWithType
:
InputViewTypeText
title
:
nil
placeHolder
:
@"请输入短信验证码"
];
[
self
.
codeInputView
.
textField
addTarget
:
self
action
:
@selector
(
textFieldChange
:
)
forControlEvents
:
UIControlEventEditingChanged
];
self
.
codeInputView
.
textField
.
keyboardType
=
UIKeyboardTypeNumberPad
;
[
self
.
contentView
addSubview
:
self
.
codeInputView
];
[
self
.
codeInputView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
.
contentView
).
offset
(
10
);
make
.
left
.
inset
(
40
);
make
.
right
.
inset
(
139
);
make
.
height
.
mas_equalTo
(
45
);
}];
//竖直分割线
UIView
*
segLineView
=
[
UIView
creatViewWithSuperView
:
self
.
contentView
backgroundColor
:[
UIColor
lineSeparatorColorDCDC
]];
[
segLineView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
size
.
mas_equalTo
(
CGSizeMake
(
0
.
5
,
36
));
make
.
centerY
.
mas_equalTo
(
self
.
codeInputView
);
make
.
left
.
mas_equalTo
(
self
.
codeInputView
.
mas_right
);
}];
//验证码按钮
self
.
codeButton
=
[
UIButton
creatButtonWithSuperView
:
self
.
contentView
title
:
@"获取验证码"
titleFont
:
[
UIFont
qg_lightFontOfSize
:
16
]
textColor
:
[
UIColor
textColor3333
]];
[
self
.
codeButton
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
mas_equalTo
(
segLineView
.
mas_right
);
make
.
height
.
mas_equalTo
(
36
);
make
.
right
.
inset
(
40
);
make
.
centerY
.
mas_equalTo
(
self
.
codeInputView
);
}];
//底部线条
UIView
*
underLine
=
[
UIView
creatViewWithSuperView
:
self
.
contentView
backgroundColor
:[
UIColor
lineSeparatorColorDCDC
]];
[
underLine
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
inset
(
40
);
make
.
top
.
equalTo
(
self
.
codeInputView
.
mas_bottom
).
offset
(
7
);
make
.
height
.
mas_equalTo
(
0
.
5
);
}];
}
return
self
;
}
-
(
void
)
textFieldChange
:(
UITextField
*
)
tx
{
tx
.
text
=
[
tx
.
text
stringByReplacingOccurrencesOfString
:
@""
withString
:
@""
];
if
(
tx
.
text
.
length
<=
11
)
{
if
(
self
.
cellBlock
)
{
self
.
cellBlock
(
tx
.
text
);
}
}
else
{
tx
.
text
=
[
tx
.
text
substringWithRange
:
NSMakeRange
(
0
,
11
)];
if
(
self
.
cellBlock
)
{
self
.
cellBlock
(
tx
.
text
);
}
}
}
-
(
void
)
setSelected
:(
BOOL
)
selected
animated
:(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
VirtualPayment/VirtualPayment/QGClasses/Login/Function/QGBindingPhone/ViewController/QGBindingPhoneViewController.h
0 → 100644
View file @
66125a6f
//
// QGBindingPhoneViewController.h
// VirtualPayment
//
// Created by 张博 on 2020/5/22.
// Copyright © 2020 bo.zhang. All rights reserved.
//
#import "QGLoginBaseTableViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface
QGBindingPhoneViewController
:
QGLoginBaseTableViewController
@end
NS_ASSUME_NONNULL_END
VirtualPayment/VirtualPayment/QGClasses/Login/Function/QGBindingPhone/ViewController/QGBindingPhoneViewController.m
0 → 100644
View file @
66125a6f
//
// QGBindingPhoneViewController.m
// VirtualPayment
//
// Created by 张博 on 2020/5/22.
// Copyright © 2020 bo.zhang. All rights reserved.
//
#import "QGBindingPhoneViewController.h"
//View
#import "QGLoginTableViewCell.h"
#import "QGLoginProtocolCell.h"
#import "QGLoginBottomBtnTableViewCell.h"
#import "QGBindingVerifyCodeCell.h"
//Tool
#import "QGCountDown.h"
#import "QGSendMessageCodeManger.h"
@interface
QGBindingPhoneViewController
()
///手机号
@property
(
nonatomic
,
copy
)
NSString
*
phoneString
;
///验证码
@property
(
nonatomic
,
copy
)
NSString
*
verifyCodeString
;
///登录按钮是否可点击的设置
@property
(
nonatomic
,
copy
)
void
(
^
changeButtonStatus
)
(
BOOL
ableClick
);
///是否已同意用户协议
@property
(
assign
,
nonatomic
)
BOOL
isSelect
;
///自定义tableView header
@property
(
nonatomic
,
strong
)
UIView
*
tableHeaderView
;
/// 验证码按钮
@property
(
nonatomic
,
strong
)
UIButton
*
codeButton
;
///自定义定时器
@property
(
nonatomic
,
strong
)
QGCountDown
*
countDownTimer
;
/// 倒计时剩余时间
@property
(
nonatomic
,
assign
)
NSInteger
residueTime
;
///获取短信验证码管理类
@property
(
nonatomic
,
strong
)
QGSendMessageCodeManger
*
sendVerifyCodeManger
;
@end
@implementation
QGBindingPhoneViewController
-
(
BOOL
)
checkParameters
:(
NSDictionary
*
)
param
{
return
YES
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
//初始化剩余时间60秒
self
.
residueTime
=
60
;
//自定义定时器初始化
self
.
countDownTimer
=
[[
QGCountDown
alloc
]
init
];
//初始化发送短信验证码管理类
self
.
sendVerifyCodeManger
=
[[
QGSendMessageCodeManger
alloc
]
init
];
self
.
tableView
.
bounces
=
NO
;
//设置tableview的header
UILabel
*
welcomeLabel
=
[
UIView
creatLabelWithSuperView
:
self
.
tableHeaderView
title
:
@"请绑定手机号"
titleFontSize
:
[
UIFont
qg_regularFontOfSize
:
30
]
textColor
:
[
UIColor
textColor3333
]
alignment
:
NSTextAlignmentLeft
];
[
welcomeLabel
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
left
.
equalTo
(
self
.
tableHeaderView
).
inset
(
40
);
make
.
top
.
equalTo
(
self
.
tableHeaderView
).
inset
(
48
);
make
.
height
.
mas_equalTo
(
30
);
}];
self
.
tableView
.
tableHeaderView
=
self
.
tableHeaderView
;
}
#pragma mark - UITableViewDataSource
-
(
NSInteger
)
tableView
:(
UITableView
*
)
tableView
numberOfRowsInSection
:(
NSInteger
)
section
{
return
4
;
}
-
(
UITableViewCell
*
)
tableView
:(
UITableView
*
)
tableView
cellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
switch
(
indexPath
.
row
)
{
//手机号输入框
case
0
:
{
QGLoginTableViewCell
*
cell
=
(
QGLoginTableViewCell
*
)[
self
getCellFromClassName
:
NSStringFromClass
([
QGLoginTableViewCell
class
])
dequeueTableView
:
tableView
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
@weakify
(
self
)
cell
.
phoneNumberinput
.
textField
.
text
=
self
.
phoneString
;
cell
.
cellBlock
=
^
(
NSString
*
phoneNumber
)
{
@strongify
(
self
)
self
.
phoneString
=
phoneNumber
;
if
(
self
.
callBackBlock
)
{
self
.
callBackBlock
(
LoginTag_QGLoginViewController_ChangePhoneNum
,
@{
@"phone"
:
self
.
phoneString
});
}
if
(
self
.
phoneString
.
isNumber
&&
self
.
phoneString
.
length
==
11
&&
!
[
NSString
isEmpty
:
self
.
verifyCodeString
])
{
//登录按钮可点击
self
.
changeButtonStatus
(
YES
);
}
else
{
//登录按钮不可点击
self
.
changeButtonStatus
(
NO
);
}
};
return
cell
;
}
break
;
//验证码输入框
case
1
:
{
QGBindingVerifyCodeCell
*
cell
=
(
QGBindingVerifyCodeCell
*
)[
self
getCellFromClassName
:
NSStringFromClass
([
QGBindingVerifyCodeCell
class
])
dequeueTableView
:
tableView
];
@weakify
(
self
);
cell
.
cellBlock
=
^
(
NSString
*
_Nonnull
codeNumber
)
{
@strongify
(
self
);
self
.
verifyCodeString
=
codeNumber
;
if
(
self
.
phoneString
.
isNumber
&&
self
.
phoneString
.
length
==
11
&&
!
[
NSString
isEmpty
:
self
.
verifyCodeString
])
{
//登录按钮可点击
self
.
changeButtonStatus
(
YES
);
}
else
{
//登录按钮不可点击
self
.
changeButtonStatus
(
NO
);
}
};
//验证码点击事件
[
cell
.
codeButton
touchUpInsideBlock
:
^
(
UIButton
*
_Nonnull
button
)
{
@strongify
(
self
);
[
self
codeButtonClick
];
}];
//标记按钮,用于计时器逻辑
self
.
codeButton
=
cell
.
codeButton
;
return
cell
;
}
break
;
//协议
case
2
:
{
QGLoginProtocolCell
*
cell
=
(
QGLoginProtocolCell
*
)[
self
getCellFromClassName
:
NSStringFromClass
([
QGLoginProtocolCell
class
])
dequeueTableView
:
tableView
];
cell
.
isAgree
=
self
.
isSelect
;
@weakify
(
self
);
//注册协议
cell
.
registerProtocolClick
=
^
{
@strongify
(
self
);
[
self
navigationToWeb
:
VCCRegisterAgreement
];
};
//隐私协议
cell
.
privacyProtocolClick
=
^
{
@strongify
(
self
);
[
self
navigationToWeb
:
VCCPrivacyAgreement
];
};
//同意协议
cell
.
agressClick
=
^
{
@strongify
(
self
);
self
.
isSelect
=
!
self
.
isSelect
;
};
return
cell
;
}
break
;
//登录按钮
case
3
:
{
QGLoginBottomBtnTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
NSStringFromClass
([
QGLoginBottomBtnTableViewCell
class
])];
if
(
!
cell
)
{
cell
=
[[
QGLoginBottomBtnTableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
NSStringFromClass
([
QGLoginBottomBtnTableViewCell
class
])
btnTitle
:
@"登录"
padding
:
40
];
}
@weakify
(
self
);
cell
.
cellBlock
=
^
(
UIButton
*
nextBtn
)
{
@strongify
(
self
);
//登录按钮点击事件
[
self
submitBtnClick
:
nextBtn
];
};
self
.
changeButtonStatus
=
^
(
BOOL
ableClick
)
{
[
cell
.
loginButton
setGradientButtonIsClickEnabled
:
ableClick
];
};
return
cell
;
}
break
;
}
return
[
UITableViewCell
new
];
}
#pragma mark - UITableViewDelegate
-
(
CGFloat
)
tableView
:(
UITableView
*
)
tableView
heightForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
2
)
{
return
[
QGLoginProtocolCell
cellHeight
];
}
else
if
(
indexPath
.
row
==
3
)
{
return
40
.
f
;
}
else
{
return
63
.
f
;
}
}
#pragma mark - Getter
-
(
UIView
*
)
tableHeaderView
{
if
(
!
_tableHeaderView
)
{
_tableHeaderView
=
[[
UIView
alloc
]
init
];
_tableHeaderView
.
backgroundColor
=
[
UIColor
whiteColor
];
_tableHeaderView
.
bounds
=
CGRectMake
(
0
,
0
,
MAINSCREEN_WIDTH
,
140
);
}
return
_tableHeaderView
;
}
#pragma mark - Action
//登录按钮点击提交用户名密码
-
(
void
)
submitBtnClick
:(
UIButton
*
)
sender
{
if
(
!
self
.
isSelect
)
{
[
QGHUDManager
showHud
:
@"请您仔细阅读并同意相关协议"
];
return
;
}
[
self
.
view
endEditing
:
YES
];
if
(
self
.
phoneString
.
length
!=
11
||
!
self
.
phoneString
.
isNumber
)
{
[
QGHUDManager
showHud
:
@"手机号格式不正确"
];
return
;
}
}
///验证码按钮点击事件
-
(
void
)
codeButtonClick
{
if
(
self
.
phoneString
.
length
!=
11
||
!
self
.
phoneString
.
isNumber
)
{
[
QGHUDManager
showHud
:
@"手机号格式不正确"
];
return
;
}
//控制按钮状态
self
.
codeButton
.
userInteractionEnabled
=
NO
;
[
self
.
codeButton
setTitleColor
:[
UIColor
textColor9999
]
forState
:
UIControlStateNormal
];
//开启定时器
[
self
fireTimer
];
//发送验证码
[
self
.
sendVerifyCodeManger
sendMessageCodeWithPhoneNumber
:
self
.
phoneString
success
:
nil
fail
:
nil
];
}
//启动定时器
-
(
void
)
fireTimer
{
[
self
.
countDownTimer
countDownWithPER_SECBlock
:
^
{
self
.
residueTime
--
;
if
(
self
.
residueTime
==
0
)
{
[
self
.
countDownTimer
destoryTimer
];
self
.
residueTime
=
60
;
[
self
.
codeButton
setTitle
:
@"重新发送"
forState
:
UIControlStateNormal
];
[
self
.
codeButton
setTitleColor
:[
UIColor
textColor3333
]
forState
:
UIControlStateNormal
];
self
.
codeButton
.
userInteractionEnabled
=
YES
;
}
else
{
[
self
.
codeButton
setTitle
:[
NSString
stringWithFormat
:
@"%lds"
,(
long
)
self
.
residueTime
]
forState
:
UIControlStateNormal
];
}
}];
}
@end
VirtualPayment/VirtualPayment/QGClasses/Login/Function/QGRegisterOrVerifyLogin/ViewController/QGRegisterViewController.m
View file @
66125a6f
...
...
@@ -274,10 +274,12 @@
/// 微信登录
-
(
void
)
signInWithWechat
{
//微信登录
[[
QGThirdPlatformService
shareInstance
]
wxAuthWithSuccess
:
^
(
NSDictionary
*
infoDic
)
{
[
Mediator
performTarget
:
ClassNameWithHeadType
(
QGHeaderTypeQGBindingPhoneViewController
)
parameters
:
nil
handlerBlock
:
nil
];
}];
//微信登录
// [[QGThirdPlatformService shareInstance] wxAuthWithSuccess:^(NSDictionary *infoDic) {
//
// }];
}
#pragma mark - Apple登录
...
...
VirtualPayment/VirtualPayment/QGUtils/QGTool/Mediator/QGMediatorClassHeader.h
View file @
66125a6f
...
...
@@ -52,6 +52,8 @@
//#import "QGCreditApplyViewController.h"
//#import "QGTransactionSetController.h"
//#import "QGMembershipCenterViewController.h"
//#import "QGBindingPhoneViewController.h"
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
...
...
VirtualPayment/VirtualPayment/QGUtils/QGTool/Mediator/QGMediatorClassTools.h
View file @
66125a6f
...
...
@@ -44,6 +44,7 @@ typedef enum : NSUInteger {
QGHeaderTypeQGCreditApplyViewController
,
QGHeaderTypeQGTransactionSetController
,
QGHeaderTypeQGMembershipCenterViewController
,
QGHeaderTypeQGBindingPhoneViewController
,
}
QGHeaderType
;
@interface
QGMediatorClassTools
:
NSObject
...
...
VirtualPayment/VirtualPayment/QGUtils/QGTool/Mediator/QGMediatorClassTools.m
View file @
66125a6f
...
...
@@ -102,6 +102,8 @@ NSString * ClassNameWithHeadType(QGHeaderType headerType)
return
@"QGTransactionSetController"
;
case
QGHeaderTypeQGMembershipCenterViewController
:
return
@"QGMembershipCenterViewController"
;
case
QGHeaderTypeQGBindingPhoneViewController
:
return
@"QGBindingPhoneViewController"
;
default:
return
nil
;
}
...
...
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