Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
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
张杰
Opple-iOS
Commits
a3e5a2ea
Commit
a3e5a2ea
authored
Nov 23, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改项说明:去掉所有length判断,它可能导致崩溃
parent
c1aa50ee
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
26 deletions
+21
-26
LoginViewController.m
Class/Login/LoginViewController.m
+11
-16
ProductLibraryViewController.m
Class/ProductLibraryViewController.m
+4
-4
RebateDetailsViewController.m
Class/RebateDetailsViewController.m
+1
-1
SettlementViewController.m
Class/SettlementViewController.m
+1
-1
ShoppingViewController.m
Class/Shoppingcart/ShoppingViewController.m
+2
-2
UserViewController.m
Class/UserViewController.m
+2
-2
No files found.
Class/Login/LoginViewController.m
View file @
a3e5a2ea
...
@@ -137,10 +137,10 @@
...
@@ -137,10 +137,10 @@
-
(
IBAction
)
LoginButtonClick
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
LoginButtonClick
:
(
UIButton
*
)
sender
{
if
(
self
.
userName
.
text
.
length
==
0
)
{
if
(
[[
self
class
]
isBlankString
:
self
.
userName
.
text
]
)
{
[
self
ErrorMBProgressView
:
@"用户名不能为空"
];
[
self
ErrorMBProgressView
:
@"用户名不能为空"
];
return
;
return
;
}
else
if
(
self
.
passWord
.
text
.
length
==
0
)
}
else
if
(
[[
self
class
]
isBlankString
:
self
.
passWord
.
text
]
)
{
{
[
self
ErrorMBProgressView
:
@"密码不能为空"
];
[
self
ErrorMBProgressView
:
@"密码不能为空"
];
return
;
return
;
...
@@ -297,7 +297,7 @@
...
@@ -297,7 +297,7 @@
-
(
IBAction
)
ForgotpasswordButtonClick
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
ForgotpasswordButtonClick
:
(
UIButton
*
)
sender
{
self
.
identityView
=
[[[
NSBundle
mainBundle
]
loadNibNamed
:
@"authenticateView"
owner
:
self
options
:
nil
]
firstObject
];
self
.
identityView
=
[[[
NSBundle
mainBundle
]
loadNibNamed
:
@"authenticateView"
owner
:
self
options
:
nil
]
firstObject
];
//判断登陆界面是否已经输入了用户名,如果有则直接引用,否则报错
//判断登陆界面是否已经输入了用户名,如果有则直接引用,否则报错
if
(
self
.
userName
.
text
.
length
!=
0
)
{
if
(
!
[[
self
class
]
isBlankString
:
self
.
userName
.
text
]
)
{
self
.
identityView
.
userName
.
text
=
self
.
userName
.
text
;
self
.
identityView
.
userName
.
text
=
self
.
userName
.
text
;
}
else
{
}
else
{
...
@@ -323,7 +323,7 @@
...
@@ -323,7 +323,7 @@
{
{
WS
(
weakSelf
);
WS
(
weakSelf
);
NSString
*
inputPhoneNumber
=
self
.
identityView
.
bindingPhoneNumber
.
text
;
NSString
*
inputPhoneNumber
=
self
.
identityView
.
bindingPhoneNumber
.
text
;
if
(
inputPhoneNumber
.
length
==
0
)
{
if
(
[[
self
class
]
isBlankString
:
inputPhoneNumber
]
)
{
[
self
ErrorMBProgressView
:
@"手机号不能为空"
];
[
self
ErrorMBProgressView
:
@"手机号不能为空"
];
return
;
return
;
}
}
...
@@ -385,7 +385,7 @@
...
@@ -385,7 +385,7 @@
-
(
void
)
NextButtonClick
-
(
void
)
NextButtonClick
{
{
// 验证码必须填写
// 验证码必须填写
if
(
self
.
identityView
.
verificationCode
.
text
.
length
==
0
)
{
if
(
[[
self
class
]
isBlankString
:
self
.
identityView
.
verificationCode
.
text
]
)
{
[
self
ErrorMBProgressView
:
@"验证码不能为空"
];
[
self
ErrorMBProgressView
:
@"验证码不能为空"
];
return
;
return
;
...
@@ -410,19 +410,14 @@
...
@@ -410,19 +410,14 @@
#pragma mark -修改密码
#pragma mark -修改密码
-
(
void
)
ChangPassWordRequest
-
(
void
)
ChangPassWordRequest
{
{
if
(
self
.
resetPasswordView
.
newpass
.
text
.
length
==
0
)
{
if
([[
self
class
]
isBlankString
:
self
.
resetPasswordView
.
newpass
.
text
])
{
[
self
ErrorMBProgressView
:
@"新密码为空"
];
return
;
[
self
ErrorMBProgressView
:
@"新密码为空"
];
}
return
;
if
([[
self
class
]
isBlankString
:
self
.
resetPasswordView
.
confirmNewpass
.
text
]){
}
else
if
(
self
.
resetPasswordView
.
confirmNewpass
.
text
.
length
==
0
)
[
self
ErrorMBProgressView
:
@"确认密码为空"
];
return
;
{
[
self
ErrorMBProgressView
:
@"确认密码为空"
];
return
;
}
}
if
(
!
[
self
.
resetPasswordView
.
newpass
.
text
isEqualToString
:
self
.
resetPasswordView
.
confirmNewpass
.
text
])
{
if
(
!
[
self
.
resetPasswordView
.
newpass
.
text
isEqualToString
:
self
.
resetPasswordView
.
confirmNewpass
.
text
])
{
[
self
ErrorMBProgressView
:
@"两次密码不相同"
];
return
;
[
self
ErrorMBProgressView
:
@"两次密码不相同"
];
return
;
}
}
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
//重置密码接口
//重置密码接口
...
...
Class/ProductLibraryViewController.m
View file @
a3e5a2ea
...
@@ -641,16 +641,16 @@
...
@@ -641,16 +641,16 @@
page
.
rows
=
10
;
page
.
rows
=
10
;
page
.
page
=
1
;
page
.
page
=
1
;
condition
.
page
=
page
;
condition
.
page
=
page
;
if
(
styleCode
.
length
!=
0
)
{
if
(
!
[[
self
class
]
isBlankString
:
styleCode
]
)
{
condition
.
styleEquals
=
styleCode
;
condition
.
styleEquals
=
styleCode
;
}
}
if
(
categoriesCode
.
length
!=
0
)
{
if
(
!
[[
self
class
]
isBlankString
:
categoriesCode
]
)
{
condition
.
categoryEquals
=
categoriesCode
;
condition
.
categoryEquals
=
categoriesCode
;
}
}
if
(
spaceCode
.
length
!=
0
)
{
if
(
!
[[
self
class
]
isBlankString
:
spaceCode
]
)
{
condition
.
spaceEquals
=
spaceCode
;
condition
.
spaceEquals
=
spaceCode
;
}
}
if
(
materialCode
.
length
!=
0
)
{
if
(
!
[[
self
class
]
isBlankString
:
materialCode
]
)
{
condition
.
materialEqueals
=
materialCode
;
condition
.
materialEqueals
=
materialCode
;
}
}
if
(
!
[
priceTitle
isEqualToString
:
@"全部"
])
{
if
(
!
[
priceTitle
isEqualToString
:
@"全部"
])
{
...
...
Class/RebateDetailsViewController.m
View file @
a3e5a2ea
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
-
(
IBAction
)
rebateButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
rebateButtonClickAction
:
(
UIButton
*
)
sender
{
WS
(
weakSelf
);
WS
(
weakSelf
);
if
(
!
[
self
.
inputRebateTextField
.
text
length
])
{
if
(
[[
self
class
]
isBlankString
:
self
.
inputRebateTextField
.
text
])
{
[
self
SHOWPrompttext
:
@"请输入提现金额"
];
return
;
[
self
SHOWPrompttext
:
@"请输入提现金额"
];
return
;
}
}
if
([
self
.
inputRebateTextField
.
text
floatValue
]
>
self
.
rebateAmount
)
{
if
([
self
.
inputRebateTextField
.
text
floatValue
]
>
self
.
rebateAmount
)
{
...
...
Class/SettlementViewController.m
View file @
a3e5a2ea
...
@@ -218,7 +218,7 @@
...
@@ -218,7 +218,7 @@
if
([
self
.
payTypeButton
.
currentTitle
isEqualToString
:
@"现金、支票、转账、刷卡"
]
&&
!
self
.
payTreasureButton
.
selected
&&
!
self
.
WeixiPayButton
.
selected
)
{
if
([
self
.
payTypeButton
.
currentTitle
isEqualToString
:
@"现金、支票、转账、刷卡"
]
&&
!
self
.
payTreasureButton
.
selected
&&
!
self
.
WeixiPayButton
.
selected
)
{
[
self
ErrorMBProgressView
:
@"请选择一种支付方式"
];
[
self
ErrorMBProgressView
:
@"请选择一种支付方式"
];
}
else
if
([
self
.
invoiceType
.
currentTitle
isEqualToString
:
@"公司发票"
]
&&
self
.
invoiceHeader
.
text
.
length
==
0
)
}
else
if
([
self
.
invoiceType
.
currentTitle
isEqualToString
:
@"公司发票"
]
&&
[[
self
class
]
isBlankString
:
self
.
invoiceHeader
.
text
]
)
{
{
[
self
ErrorMBProgressView
:
@"请输入发票抬头"
];
[
self
ErrorMBProgressView
:
@"请输入发票抬头"
];
}
else
}
else
...
...
Class/Shoppingcart/ShoppingViewController.m
View file @
a3e5a2ea
...
@@ -149,7 +149,7 @@
...
@@ -149,7 +149,7 @@
return
;
return
;
}
}
Shoppersmanager
*
user
=
[
Shoppersmanager
manager
];
Shoppersmanager
*
user
=
[
Shoppersmanager
manager
];
if
([
self
.
textField
.
text
integerValue
]
<
[
user
.
Shoppers
.
lowestDiscount
integerValue
]
&&
self
.
textField
.
text
.
length
)
if
([
self
.
textField
.
text
integerValue
]
<
[
user
.
Shoppers
.
lowestDiscount
integerValue
]
&&
!
[[
self
class
]
isBlankString
:
self
.
textField
.
text
]
)
{
{
[
self
SHOWPrompttext
:
@"当前价格低于你的价格权限!"
];
[
self
SHOWPrompttext
:
@"当前价格低于你的价格权限!"
];
self
.
textField
.
text
=
nil
;
self
.
textField
.
text
=
nil
;
...
@@ -175,7 +175,7 @@
...
@@ -175,7 +175,7 @@
if
(
self
.
textField
.
text
.
length
==
2
)
{
if
(
self
.
textField
.
text
.
length
==
2
)
{
return
NO
;
return
NO
;
}
}
if
(
self
.
textField
.
text
.
length
==
0
&&
[
number
isEqualToString
:
@"0"
])
if
(
[[
self
class
]
isBlankString
:
self
.
textField
.
text
]
&&
[
number
isEqualToString
:
@"0"
])
{
{
if
([
number
isEqualToString
:
@"0"
]){
if
([
number
isEqualToString
:
@"0"
]){
return
NO
;
return
NO
;
...
...
Class/UserViewController.m
View file @
a3e5a2ea
...
@@ -260,12 +260,12 @@
...
@@ -260,12 +260,12 @@
-
(
IBAction
)
switchUserButtonClick
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
switchUserButtonClick
:
(
UIButton
*
)
sender
{
if
(
self
.
userName
.
text
.
length
==
0
)
{
if
(
[[
self
class
]
isBlankString
:
self
.
userName
.
text
]
)
{
[
self
ErrorMBProgressView
:
@"用户名不能为空"
];
[
self
ErrorMBProgressView
:
@"用户名不能为空"
];
return
;
return
;
}
}
if
(
self
.
passWord
.
text
.
length
==
0
)
{
if
(
[[
self
class
]
isBlankString
:
self
.
passWord
.
text
]
)
{
[
self
ErrorMBProgressView
:
@"密码不能为空"
];
[
self
ErrorMBProgressView
:
@"密码不能为空"
];
return
;
return
;
...
...
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