Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Car-iOS-Merchant
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张杰
Car-iOS-Merchant
Commits
042af6bd
Commit
042af6bd
authored
Jan 10, 2017
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加手表扫码登录功能
parent
8be817f7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
270 additions
and
13 deletions
+270
-13
project.pbxproj
Car.xcodeproj/project.pbxproj
+8
-0
Main.storyboard
Car/Base.lproj/Main.storyboard
+79
-6
BillListViewController.m
...deClass/LeftView/ViewControllers/BillListViewController.m
+1
-1
LeftTableViewController.m
...eClass/LeftView/ViewControllers/LeftTableViewController.m
+33
-2
ScanViewController.h
Car/CodeClass/LeftView/ViewControllers/ScanViewController.h
+5
-1
ScanViewController.m
Car/CodeClass/LeftView/ViewControllers/ScanViewController.m
+35
-3
WatchLoginViewController.h
...Class/LeftView/ViewControllers/WatchLoginViewController.h
+13
-0
WatchLoginViewController.m
...Class/LeftView/ViewControllers/WatchLoginViewController.m
+95
-0
URL.h
Car/URL.h
+1
-0
No files found.
Car.xcodeproj/project.pbxproj
View file @
042af6bd
...
@@ -58,6 +58,8 @@
...
@@ -58,6 +58,8 @@
8FC2BDC31E1285F700A879C1
/* CodeScan.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FC2BDC21E1285F700A879C1
/* CodeScan.bundle */
;
};
8FC2BDC31E1285F700A879C1
/* CodeScan.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FC2BDC21E1285F700A879C1
/* CodeScan.bundle */
;
};
8FC2BDC61E13847800A879C1
/* CardView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FC2BDC51E13847800A879C1
/* CardView.m */
;
};
8FC2BDC61E13847800A879C1
/* CardView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FC2BDC51E13847800A879C1
/* CardView.m */
;
};
8FC2BDC91E13884000A879C1
/* CardViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FC2BDC81E13884000A879C1
/* CardViewController.m */
;
};
8FC2BDC91E13884000A879C1
/* CardViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FC2BDC81E13884000A879C1
/* CardViewController.m */
;
};
8FCE61651E24C158004B536C
/* WatchLoginViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FCE61641E24C158004B536C
/* WatchLoginViewController.m */
;
};
8FCE61661E24C158004B536C
/* WatchLoginViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FCE61641E24C158004B536C
/* WatchLoginViewController.m */
;
};
8FED4FB91E1223D900591647
/* GuideViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FED4FB81E1223D900591647
/* GuideViewController.m */
;
};
8FED4FB91E1223D900591647
/* GuideViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FED4FB81E1223D900591647
/* GuideViewController.m */
;
};
8FED4FBC1E1246BC00591647
/* BillListViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FED4FBB1E1246BC00591647
/* BillListViewController.m */
;
};
8FED4FBC1E1246BC00591647
/* BillListViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FED4FBB1E1246BC00591647
/* BillListViewController.m */
;
};
8FED4FBF1E124BFE00591647
/* BillListTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FED4FBE1E124BFE00591647
/* BillListTableViewCell.m */
;
};
8FED4FBF1E124BFE00591647
/* BillListTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8FED4FBE1E124BFE00591647
/* BillListTableViewCell.m */
;
};
...
@@ -234,6 +236,8 @@
...
@@ -234,6 +236,8 @@
8FC2BDC51E13847800A879C1
/* CardView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CardView.m
;
sourceTree
=
"<group>"
;
};
8FC2BDC51E13847800A879C1
/* CardView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CardView.m
;
sourceTree
=
"<group>"
;
};
8FC2BDC71E13884000A879C1
/* CardViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CardViewController.h
;
sourceTree
=
"<group>"
;
};
8FC2BDC71E13884000A879C1
/* CardViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CardViewController.h
;
sourceTree
=
"<group>"
;
};
8FC2BDC81E13884000A879C1
/* CardViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CardViewController.m
;
sourceTree
=
"<group>"
;
};
8FC2BDC81E13884000A879C1
/* CardViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CardViewController.m
;
sourceTree
=
"<group>"
;
};
8FCE61631E24C158004B536C
/* WatchLoginViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
WatchLoginViewController.h
;
sourceTree
=
"<group>"
;
};
8FCE61641E24C158004B536C
/* WatchLoginViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
WatchLoginViewController.m
;
sourceTree
=
"<group>"
;
};
8FED4FB71E1223D900591647
/* GuideViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GuideViewController.h
;
sourceTree
=
"<group>"
;
};
8FED4FB71E1223D900591647
/* GuideViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GuideViewController.h
;
sourceTree
=
"<group>"
;
};
8FED4FB81E1223D900591647
/* GuideViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GuideViewController.m
;
sourceTree
=
"<group>"
;
};
8FED4FB81E1223D900591647
/* GuideViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GuideViewController.m
;
sourceTree
=
"<group>"
;
};
8FED4FBA1E1246BC00591647
/* BillListViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BillListViewController.h
;
sourceTree
=
"<group>"
;
};
8FED4FBA1E1246BC00591647
/* BillListViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BillListViewController.h
;
sourceTree
=
"<group>"
;
};
...
@@ -528,6 +532,8 @@
...
@@ -528,6 +532,8 @@
8FC2BD901E125F0500A879C1
/* ScanViewController.m */
,
8FC2BD901E125F0500A879C1
/* ScanViewController.m */
,
8FC2BDC71E13884000A879C1
/* CardViewController.h */
,
8FC2BDC71E13884000A879C1
/* CardViewController.h */
,
8FC2BDC81E13884000A879C1
/* CardViewController.m */
,
8FC2BDC81E13884000A879C1
/* CardViewController.m */
,
8FCE61631E24C158004B536C
/* WatchLoginViewController.h */
,
8FCE61641E24C158004B536C
/* WatchLoginViewController.m */
,
);
);
path
=
ViewControllers
;
path
=
ViewControllers
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -905,6 +911,7 @@
...
@@ -905,6 +911,7 @@
8FC2BD911E125F0500A879C1
/* ScanViewController.m in Sources */
,
8FC2BD911E125F0500A879C1
/* ScanViewController.m in Sources */
,
8FC2BDC61E13847800A879C1
/* CardView.m in Sources */
,
8FC2BDC61E13847800A879C1
/* CardView.m in Sources */
,
8FC2BDBD1E12840300A879C1
/* LBXScanViewController.m in Sources */
,
8FC2BDBD1E12840300A879C1
/* LBXScanViewController.m in Sources */
,
8FCE61651E24C158004B536C
/* WatchLoginViewController.m in Sources */
,
8FC2BDC91E13884000A879C1
/* CardViewController.m in Sources */
,
8FC2BDC91E13884000A879C1
/* CardViewController.m in Sources */
,
8F81056E1E110174009A2AB3
/* DateTextField.m in Sources */
,
8F81056E1E110174009A2AB3
/* DateTextField.m in Sources */
,
8F42C0001E0D255200A54D40
/* BaseViewController.m in Sources */
,
8F42C0001E0D255200A54D40
/* BaseViewController.m in Sources */
,
...
@@ -978,6 +985,7 @@
...
@@ -978,6 +985,7 @@
8FFE3DDE1E14AC6700BEB6A6
/* ScanViewController.m in Sources */
,
8FFE3DDE1E14AC6700BEB6A6
/* ScanViewController.m in Sources */
,
8FFE3DDF1E14AC6700BEB6A6
/* CardView.m in Sources */
,
8FFE3DDF1E14AC6700BEB6A6
/* CardView.m in Sources */
,
8FFE3DE01E14AC6700BEB6A6
/* LBXScanViewController.m in Sources */
,
8FFE3DE01E14AC6700BEB6A6
/* LBXScanViewController.m in Sources */
,
8FCE61661E24C158004B536C
/* WatchLoginViewController.m in Sources */
,
8FFE3DE11E14AC6700BEB6A6
/* CardViewController.m in Sources */
,
8FFE3DE11E14AC6700BEB6A6
/* CardViewController.m in Sources */
,
8FFE3DE21E14AC6700BEB6A6
/* DateTextField.m in Sources */
,
8FFE3DE21E14AC6700BEB6A6
/* DateTextField.m in Sources */
,
8FFE3DE31E14AC6700BEB6A6
/* BaseViewController.m in Sources */
,
8FFE3DE31E14AC6700BEB6A6
/* BaseViewController.m in Sources */
,
...
...
Car/Base.lproj/Main.storyboard
View file @
042af6bd
This diff is collapsed.
Click to expand it.
Car/CodeClass/LeftView/ViewControllers/BillListViewController.m
View file @
042af6bd
...
@@ -36,9 +36,9 @@
...
@@ -36,9 +36,9 @@
@"pageNumber"
:
@
(
self
.
page
),
@"pageNumber"
:
@
(
self
.
page
),
@"pageSize"
:
@
(
self
.
pageSize
)};
@"pageSize"
:
@
(
self
.
pageSize
)};
[
MBProgressHUD
j_loading
];
[
MBProgressHUD
j_loading
];
WS
(
weakSelf
);
[
kHttp
POST
:
kAccountQueryUrl
parameters
:
myDictionary
complete
:^
(
id
_Nullable
response
,
NSError
*
_Nullable
error
)
{
[
kHttp
POST
:
kAccountQueryUrl
parameters
:
myDictionary
complete
:^
(
id
_Nullable
response
,
NSError
*
_Nullable
error
)
{
[
MBProgressHUD
j_hideLoadingView
];
[
MBProgressHUD
j_hideLoadingView
];
WS
(
weakSelf
);
if
(
kRsSuccess
(
response
))
{
if
(
kRsSuccess
(
response
))
{
for
(
NSDictionary
*
dict
in
response
[
@"data"
][
@"records"
])
{
for
(
NSDictionary
*
dict
in
response
[
@"data"
][
@"records"
])
{
StationUserAcctHisEntity
*
model
=
[[
StationUserAcctHisEntity
alloc
]
initWithDictionary
:
dict
error
:
nil
];
StationUserAcctHisEntity
*
model
=
[[
StationUserAcctHisEntity
alloc
]
initWithDictionary
:
dict
error
:
nil
];
...
...
Car/CodeClass/LeftView/ViewControllers/LeftTableViewController.m
View file @
042af6bd
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
}
else
if
(
indexPath
.
row
==
1
)
{
//账户
}
else
if
(
indexPath
.
row
==
1
)
{
//账户
[
MBProgressHUD
j_textOnly
:
@"正在开发中~"
];
[
MBProgressHUD
j_textOnly
:
@"正在开发中~"
];
}
else
if
(
indexPath
.
row
==
2
)
{
//核销卡券
}
else
if
(
indexPath
.
row
==
2
)
{
//核销卡券
[
self
scan
View
];
[
self
scan
Card
];
}
else
if
(
indexPath
.
row
==
3
)
{
//修改密码
}
else
if
(
indexPath
.
row
==
3
)
{
//修改密码
ModifyPswTableViewController
*
modifyVC
=
[
ModifyPswTableViewController
viewControllerWithStoryBoardType
:
STORYBOARD_TYPE_MAIN
];
ModifyPswTableViewController
*
modifyVC
=
[
ModifyPswTableViewController
viewControllerWithStoryBoardType
:
STORYBOARD_TYPE_MAIN
];
...
@@ -67,10 +67,12 @@
...
@@ -67,10 +67,12 @@
}
else
if
(
indexPath
.
row
==
4
)
{
//退出登录
}
else
if
(
indexPath
.
row
==
4
)
{
//退出登录
[
kGlobal
.
sideSlipVC
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[
kGlobal
.
sideSlipVC
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
else
if
(
indexPath
.
row
==
5
){
[
self
scanWatchCode
];
}
}
}
}
-
(
void
)
scan
View
{
-
(
void
)
scan
Card
{
//设置扫码区域参数
//设置扫码区域参数
LBXScanViewStyle
*
style
=
[[
LBXScanViewStyle
alloc
]
init
];
LBXScanViewStyle
*
style
=
[[
LBXScanViewStyle
alloc
]
init
];
style
.
centerUpOffset
=
44
;
style
.
centerUpOffset
=
44
;
...
@@ -94,6 +96,35 @@
...
@@ -94,6 +96,35 @@
ScanViewController
*
vc
=
[
ScanViewController
new
];
ScanViewController
*
vc
=
[
ScanViewController
new
];
vc
.
style
=
style
;
vc
.
style
=
style
;
vc
.
type
=
scanTypeCard
;
[
kGlobal
.
mainNaVC
pushViewController
:
vc
animated
:
YES
];
}
-
(
void
)
scanWatchCode
{
//设置扫码区域参数
LBXScanViewStyle
*
style
=
[[
LBXScanViewStyle
alloc
]
init
];
style
.
centerUpOffset
=
44
;
style
.
photoframeAngleStyle
=
LBXScanViewPhotoframeAngleStyle_Inner
;
style
.
photoframeLineW
=
2
;
style
.
photoframeAngleW
=
18
;
style
.
photoframeAngleH
=
18
;
style
.
isNeedShowRetangle
=
YES
;
style
.
anmiationStyle
=
LBXScanViewAnimationStyle_LineMove
;
style
.
colorAngle
=
[
UIColor
colorWithRed
:
0
.
/
255
green
:
200
.
/
255
.
blue
:
20
.
/
255
.
alpha
:
1
.
0
];
//qq里面的线条图片
UIImage
*
imgLine
=
[
UIImage
imageNamed
:
@"CodeScan.bundle/qrcode_Scan_weixin_Line"
];
// imgLine = [self createImageWithColor:[UIColor colorWithRed:120/255. green:221/255. blue:71/255. alpha:1.0]];
style
.
animationImage
=
imgLine
;
ScanViewController
*
vc
=
[
ScanViewController
new
];
vc
.
style
=
style
;
vc
.
type
=
scanTypeLogin
;
//vc.isOpenInterestRect = YES;
//vc.isOpenInterestRect = YES;
[
kGlobal
.
mainNaVC
pushViewController
:
vc
animated
:
YES
];
[
kGlobal
.
mainNaVC
pushViewController
:
vc
animated
:
YES
];
}
}
...
...
Car/CodeClass/LeftView/ViewControllers/ScanViewController.h
View file @
042af6bd
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
#import "LBXScanViewController.h"
#import "LBXScanViewController.h"
typedef
NS_ENUM
(
NSInteger
,
scanType
)
{
scanTypeCard
,
scanTypeLogin
};
@interface
ScanViewController
:
LBXScanViewController
@interface
ScanViewController
:
LBXScanViewController
@property
(
nonatomic
,
assign
)
scanType
type
;
@end
@end
Car/CodeClass/LeftView/ViewControllers/ScanViewController.m
View file @
042af6bd
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#import "ScanViewController.h"
#import "ScanViewController.h"
#import "CardViewController.h"
#import "CardViewController.h"
#import "WatchLoginViewController.h"
@interface
ScanViewController
()
@interface
ScanViewController
()
@property
(
strong
,
nonatomic
)
UIButton
*
btnGoInput
;
@property
(
strong
,
nonatomic
)
UIButton
*
btnGoInput
;
@end
@end
...
@@ -23,7 +24,22 @@
...
@@ -23,7 +24,22 @@
-
(
void
)
viewDidAppear
:
(
BOOL
)
animated
{
-
(
void
)
viewDidAppear
:
(
BOOL
)
animated
{
[
super
viewDidAppear
:
animated
];
[
super
viewDidAppear
:
animated
];
[
self
btnGoInput
];
switch
(
self
.
type
)
{
case
scanTypeCard
:
{
[
self
btnGoInput
];
}
break
;
case
scanTypeLogin
:
{
}
break
;
default
:
break
;
}
}
}
-
(
UIButton
*
)
btnGoInput
{
-
(
UIButton
*
)
btnGoInput
{
...
@@ -49,13 +65,21 @@
...
@@ -49,13 +65,21 @@
[
self
goCardVCWithNumber
:
nil
];
[
self
goCardVCWithNumber
:
nil
];
}
}
/**
跳转核销卡券页面
*/
-
(
void
)
goCardVCWithNumber
:
(
NSString
*
)
number
{
-
(
void
)
goCardVCWithNumber
:
(
NSString
*
)
number
{
CardViewController
*
cardVC
=
[
CardViewController
viewControllerWithStoryBoardType
:
STORYBOARD_TYPE_MAIN
];
CardViewController
*
cardVC
=
[
CardViewController
viewControllerWithStoryBoardType
:
STORYBOARD_TYPE_MAIN
];
cardVC
.
cardNumber
=
number
;
cardVC
.
cardNumber
=
number
;
[
kGlobal
.
mainNaVC
pushViewController
:
cardVC
animated
:
YES
];
[
kGlobal
.
mainNaVC
pushViewController
:
cardVC
animated
:
YES
];
}
}
-
(
void
)
goWatchLoginWithUrl
:
(
NSString
*
)
url
{
WatchLoginViewController
*
loginVC
=
[
WatchLoginViewController
viewControllerWithStoryBoardType
:
STORYBOARD_TYPE_MAIN
];
loginVC
.
LoginUrl
=
url
;
[
kGlobal
.
mainNaVC
pushViewController
:
loginVC
animated
:
YES
];
}
#pragma mark -实现类继承该方法,作出对应处理
#pragma mark -实现类继承该方法,作出对应处理
-
(
void
)
scanResultWithArray
:
(
NSArray
<
LBXScanResult
*>
*
)
array
{
-
(
void
)
scanResultWithArray
:
(
NSArray
<
LBXScanResult
*>
*
)
array
{
...
@@ -87,10 +111,18 @@
...
@@ -87,10 +111,18 @@
[
LBXScanWrapper
systemVibrate
];
[
LBXScanWrapper
systemVibrate
];
//声音提醒
//声音提醒
[
LBXScanWrapper
systemSound
];
[
LBXScanWrapper
systemSound
];
[
self
goCardVCWithNumber
:
strResult
];
if
(
self
.
type
==
scanTypeCard
)
{
[
self
goCardVCWithNumber
:
strResult
];
}
else
if
(
self
.
type
==
scanTypeLogin
){
[
self
goWatchLoginWithUrl
:
strResult
];
}
}
}
//- (void)goWatchLoginViewWith
-
(
void
)
didReceiveMemoryWarning
{
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
// Dispose of any resources that can be recreated.
...
...
Car/CodeClass/LeftView/ViewControllers/WatchLoginViewController.h
0 → 100644
View file @
042af6bd
//
// WatchLoginViewController.h
// Car
//
// Created by Javen on 2017/1/10.
// Copyright © 2017年 上海勾芒信息科技. All rights reserved.
//
#import "BaseViewController.h"
@interface
WatchLoginViewController
:
BaseViewController
@property
(
strong
,
nonatomic
)
NSString
*
LoginUrl
;
@end
Car/CodeClass/LeftView/ViewControllers/WatchLoginViewController.m
0 → 100644
View file @
042af6bd
//
// WatchLoginViewController.m
// Car
//
// Created by Javen on 2017/1/10.
// Copyright © 2017年 上海勾芒信息科技. All rights reserved.
//
#import "WatchLoginViewController.h"
#import "HttpCilent.h"
@interface
WatchLoginViewController
()
@end
@implementation
WatchLoginViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
}
-
(
IBAction
)
actionLogin
:
(
id
)
sender
{
[
self
httpAllowLogin
];
}
-
(
void
)
httpAllowLogin
{
NSString
*
device
=
[
self
getStringAfter
:
@"deviceId="
string
:
self
.
LoginUrl
];
NSString
*
token
=
[
self
getStringAfter
:
@"token="
string
:
self
.
LoginUrl
];
WS
(
weakSelf
);
if
(
device
==
nil
||
token
==
nil
)
{
[
MBProgressHUD
j_error
:
@"设备信息异常!"
complete
:
^
{
[
weakSelf
.
navigationController
popViewControllerAnimated
:
YES
];
}];
}
NSDictionary
*
param
=
@{
@"deviceId"
:
device
,
@"token"
:
token
};
[
kHttp
GET
:
kWatchLogin
parameters
:
param
complete
:^
(
id
_Nullable
response
,
NSError
*
_Nullable
error
)
{
if
(
kRsSuccess
(
response
))
{
[
MBProgressHUD
j_success
:
@"登录成功!"
complete
:
^
{
//连续返回两级
long
index
=
[[
weakSelf
.
navigationController
viewControllers
]
indexOfObject
:
weakSelf
];
[
weakSelf
.
navigationController
popToViewController
:[
weakSelf
.
navigationController
.
viewControllers
objectAtIndex
:
index
-
2
]
animated
:
YES
];
}];
}
else
{
kShowRsMsg
(
response
);
}
}];
}
/**
从prefix后开始截取连续字符串(字符串中可包涵数字字母)
@param prefix 从哪里开始截取
@param string 需要截取的字符串
@return 截取后的字符串
*/
-
(
NSString
*
)
getStringAfter
:
(
NSString
*
)
prefix
string
:
(
NSString
*
)
string
{
NSString
*
grex
=
[
NSString
stringWithFormat
:
@"%@[a-z0-9A-Z]*"
,
prefix
];
NSRegularExpression
*
regex
=
[
NSRegularExpression
regularExpressionWithPattern
:
grex
options
:
NSRegularExpressionCaseInsensitive
error
:
nil
];
NSArray
*
matches
=
[
regex
matchesInString
:
string
options
:
0
range
:
NSMakeRange
(
0
,
[
string
length
])];
if
(
matches
.
count
==
1
)
{
NSTextCheckingResult
*
result
=
matches
[
0
];
NSString
*
tempString
=
[
string
substringWithRange
:
result
.
range
];
NSString
*
matchedString
=
[
tempString
componentsSeparatedByString
:
@"="
][
1
];
return
matchedString
;
}
CLog
(
@"无法匹配到prefix:%@
\n
string = %@"
,
prefix
,
string
);
return
nil
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
Car/URL.h
View file @
042af6bd
...
@@ -39,5 +39,6 @@ static NSString *const kAccountQueryUrl = @"account/query";
...
@@ -39,5 +39,6 @@ static NSString *const kAccountQueryUrl = @"account/query";
static
NSString
*
const
kRePrintUrl
=
@"printer/printRefuelBill"
;
static
NSString
*
const
kRePrintUrl
=
@"printer/printRefuelBill"
;
static
NSString
*
const
kGetTicketUrl
=
@"ticket/get?ticketNumber="
;
static
NSString
*
const
kGetTicketUrl
=
@"ticket/get?ticketNumber="
;
static
NSString
*
const
kCheckTicketUrl
=
@"ticket/check"
;
static
NSString
*
const
kCheckTicketUrl
=
@"ticket/check"
;
static
NSString
*
const
kWatchLogin
=
@"stationUser/token/send"
;
#endif
/* URL_h */
#endif
/* URL_h */
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