Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ios1x
Overview
Overview
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
cemarose
ios1x
Commits
24c0de27
Commit
24c0de27
authored
7 years ago
by
houweibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,编辑地址页面,tf为无边框模式时,输入中文会导致文字下沉的问题。
2,完善筛选页面。 3,修复添加优惠码时的崩溃问题。
parent
a1f26c03
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
113 additions
and
43 deletions
+113
-43
Brand.storyboard
iCemarose/Class/UI/Brand/Brand.storyboard
+6
-6
KWMBrandCaramelVC.m
iCemarose/Class/UI/Brand/KWMBrandCaramelVC.m
+4
-1
KWMBaseVC.m
iCemarose/Class/UI/KWMBaseVC.m
+70
-31
KWMEditAddressVC.m
iCemarose/Class/UI/ShopCart/KWMEditAddressVC.m
+11
-0
ShopCart.storyboard
iCemarose/Class/UI/ShopCart/ShopCart.storyboard
+0
-0
KWMNormalFilterView.h
iCemarose/Class/View/FilterView/KWMNormalFilterView.h
+2
-0
KWMNormalFilterView.m
iCemarose/Class/View/FilterView/KWMNormalFilterView.m
+15
-1
KWMNormalFilterView.xib
iCemarose/Class/View/FilterView/KWMNormalFilterView.xib
+4
-3
Header-Prefix.h
iCemarose/Header-Prefix.h
+1
-1
No files found.
iCemarose/Class/UI/Brand/Brand.storyboard
View file @
24c0de27
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"1212
0"
systemVersion=
"16E195
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"1212
1"
systemVersion=
"16F73
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
</device>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1208
8
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1208
9
"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<scenes>
...
...
@@ -112,6 +112,10 @@
<constraint
firstItem=
"R23-SN-2Bb"
firstAttribute=
"centerY"
secondItem=
"evT-5t-rty"
secondAttribute=
"centerY"
id=
"w2g-0d-F8E"
/>
</constraints>
</view>
<view
hidden=
"YES"
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Cy8-TS-7aW"
customClass=
"KWMNormalFilterView"
>
<rect
key=
"frame"
x=
"0.0"
y=
"94"
width=
"375"
height=
"573"
/>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"calibratedWhite"
/>
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"hDa-nl-Tlr"
customClass=
"KWMNormalFilterTab"
>
<rect
key=
"frame"
x=
"0.0"
y=
"64"
width=
"375"
height=
"30"
/>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"calibratedWhite"
/>
...
...
@@ -119,10 +123,6 @@
<constraint
firstAttribute=
"height"
constant=
"30"
id=
"HK4-OE-vEa"
/>
</constraints>
</view>
<view
hidden=
"YES"
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Cy8-TS-7aW"
customClass=
"KWMNormalFilterView"
>
<rect
key=
"frame"
x=
"0.0"
y=
"94"
width=
"375"
height=
"573"
/>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"calibratedWhite"
/>
</view>
</subviews>
<color
key=
"backgroundColor"
red=
"0.95686274509803915"
green=
"0.96078431372549022"
blue=
"0.96862745098039216"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<constraints>
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Brand/KWMBrandCaramelVC.m
View file @
24c0de27
...
...
@@ -214,8 +214,11 @@ static NSString *idStr = @"KWMBrandCaramelCell";
#pragma mark -- KWMNormalFilterTabDelegate
-
(
void
)
kwm_onClickTab
:
(
KWMFilterMode
)
filterMode
isExpandView
:
(
BOOL
)
isExpand
{
self
.
filterView
.
hidden
=
!
isExpand
;
self
.
filterView
.
filterMode
=
filterMode
;
if
(
isExpand
){
[
self
.
filterView
show
];
}
self
.
filterView
.
hidden
=
!
isExpand
;
}
#pragma mark -- KWMBrandCaramelCellDelegate
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/KWMBaseVC.m
View file @
24c0de27
...
...
@@ -291,40 +291,71 @@
-
(
void
)
showError
:
(
NSError
*
)
error
{
if
([
error
.
domain
isEqualToString
:
NSURLErrorDomain
])
{
[
self
showToast
:
@"网络已断开,请重新连接"
];
// [self showToast:@"请求数据失败"];
return
;
}
// NSDictionary *userInfo = [error userInfo];
// if (userInfo != nil) {
// NSNumber *errorCodeKey = [userInfo objectForKey:@"_kCFStreamErrorCodeKey"];
// if (errorCodeKey.intValue == 8) {
// [self showToast:@"网络已断开,请重新连接"];
// return;
// }
// }
NSArray
<
BUYError
*>
*
errors
=
[
BUYError
errorsFromCheckoutJSON
:
error
.
userInfo
];
if
([
self
checkBuyErrors
:
errors
]){
if
(
!
error
.
userInfo
){
return
;
}
errors
=
[
BUYError
errorsFromSignUpJSON
:
error
.
userInfo
];
if
([
self
checkBuyErrors
:
errors
]){
if
([
self
isCheckOutError
:
error
]){
return
;
}
NSString
*
toast
=
[
self
getErrorMessage
:
error
];
if
(
!
[
KWMStringUtil
isEmpty
:
toast
]){
[
self
showToast
:
toast
];
if
([
self
isSignUpError
:
error
]){
return
;
}
if
([
self
isNormalError
:
error
]){
return
;
}
toast
=
[
self
getErrorMessage2
:
error
];
//如果并不是shopify error,则正常吐司。
[
self
showToast
:[
error
localizedDescription
]];
}
-
(
BOOL
)
isCheckOutError
:
(
NSError
*
)
error
{
//虽然errorsFromCheckoutJSON里面有判断了,但为了保险起见,还是加上判断
NSDictionary
*
errorsDictionary
=
error
.
userInfo
[
@"errors"
];
if
(
!
errorsDictionary
||
!
[
errorsDictionary
isKindOfClass
:[
NSDictionary
class
]]){
return
NO
;
}
NSDictionary
*
customerDictionary
=
errorsDictionary
[
@"checkout"
];
if
(
!
customerDictionary
||
!
[
customerDictionary
isKindOfClass
:[
NSDictionary
class
]]){
return
NO
;
}
NSArray
<
BUYError
*>
*
errors
=
[
BUYError
errorsFromCheckoutJSON
:
error
.
userInfo
];
// 现在下单时不会报quantity错误了。所以这段代码注释
// if(errors && errors.count > 0){
// NSString *quantityRemainingMessage = [errors.firstObject quantityRemainingMessage];
// }
if
([
self
checkBuyErrors
:
errors
]){
return
YES
;
}
return
NO
;
}
-
(
BOOL
)
isSignUpError
:
(
NSError
*
)
error
{
NSDictionary
*
errorsDictionary
=
error
.
userInfo
[
@"errors"
];
if
(
!
errorsDictionary
||
!
[
errorsDictionary
isKindOfClass
:[
NSDictionary
class
]]){
return
NO
;
}
NSDictionary
*
customerDictionary
=
errorsDictionary
[
@"customer"
];
if
(
!
customerDictionary
||
!
[
customerDictionary
isKindOfClass
:[
NSDictionary
class
]]){
return
NO
;
}
NSArray
<
BUYError
*>
*
errors
=
[
BUYError
errorsFromSignUpJSON
:
error
.
userInfo
];
if
([
self
checkBuyErrors
:
errors
]){
return
YES
;
}
return
NO
;
}
-
(
BOOL
)
isNormalError
:
(
NSError
*
)
error
{
NSString
*
toast
=
[
self
getErrorMessage
:
error
];
if
(
!
[
KWMStringUtil
isEmpty
:
toast
]){
if
(
toast
!=
nil
&&
[
toast
isEqualToString
:
@"Unidentified customer"
]){
if
([
toast
isEqualToString
:
@"Unidentified customer"
]){
toast
=
@"登录已失效,请重新登录"
;
}
[
self
showToast
:
toast
];
return
;
return
YES
;
}
[
self
showToast
:[
error
localizedDescription
]];
return
NO
;
}
//判断buyerror是否有效,有效则吐司错误
...
...
@@ -350,18 +381,26 @@
return
NO
;
}
//获取key为message的错误信息
//获取key为message
/error
的错误信息
-
(
NSString
*
)
getErrorMessage
:
(
NSError
*
)
error
{
return
[
self
getErrorMessageForKey
:
@"message =
\"
"
error
:
error
];
}
//获取key为error的错误信息
-
(
NSString
*
)
getErrorMessage2
:
(
NSError
*
)
error
{
return
[
self
getErrorMessageForKey
:
@"error =
\"
"
error
:
error
];
NSString
*
errorString
;
errorString
=
[
self
getErrorMessageForKey
:
@"message =
\"
"
error
:
error
];
if
(
!
[
KWMStringUtil
isEmpty
:
errorString
]){
return
errorString
;
}
errorString
=
[
self
getErrorMessageForKey
:
@"error =
\"
"
error
:
error
];
if
(
!
[
KWMStringUtil
isEmpty
:
errorString
]){
return
errorString
;
}
errorString
=
[
self
getErrorMessageForKey
:
@"errors =
\"
"
error
:
error
];
if
(
!
[
KWMStringUtil
isEmpty
:
errorString
]){
return
errorString
;
}
return
@""
;
}
-
(
NSString
*
)
getErrorMessageForKey
:
(
NSString
*
)
key
error
:
(
NSError
*
)
error
{
NSString
*
errorString
=
[
self
dictionaryTo
Json
:
error
.
userInfo
];
NSString
*
errorString
=
[
self
dictionaryTo
String
:
error
.
userInfo
];
NSRange
startRange
=
[
errorString
rangeOfString
:
key
];
if
(
startRange
.
location
!=
NSNotFound
)
{
NSString
*
errorString2
=
[
errorString
substringFromIndex
:
startRange
.
location
+
startRange
.
length
];
...
...
@@ -378,13 +417,13 @@
}
//字典转换为字符串
-
(
NSString
*
)
dictionaryTo
Json
:
(
NSDictionary
*
)
dic
{
-
(
NSString
*
)
dictionaryTo
String
:
(
NSDictionary
*
)
dic
{
NSString
*
a
=
[
NSString
stringWithFormat
:
@"%@"
,
dic
];
return
a
;
}
-
(
BOOL
)
hasError
:
(
id
)
result
{
NSInteger
code
=
-
1
;
NSString
*
message
;
if
([
result
isKindOfClass
:[
KWMRequestResult
class
]])
{
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/ShopCart/KWMEditAddressVC.m
View file @
24c0de27
...
...
@@ -45,6 +45,17 @@
-
(
void
)
initTextField
{
//http://www.cocoachina.com/bbs/read.php?tid-250044-page-8.html #78
//tf为无边框模式时,输入中文会导致文字下沉的问题。
self
.
tfName
.
borderStyle
=
UITextBorderStyleNone
;
self
.
tfPhone
.
borderStyle
=
UITextBorderStyleNone
;
self
.
tfCountry
.
borderStyle
=
UITextBorderStyleNone
;
self
.
tfProvince
.
borderStyle
=
UITextBorderStyleNone
;
self
.
tfCity
.
borderStyle
=
UITextBorderStyleNone
;
self
.
tfAddress
.
borderStyle
=
UITextBorderStyleNone
;
self
.
tfAddressDetail
.
borderStyle
=
UITextBorderStyleNone
;
self
.
tfZip
.
borderStyle
=
UITextBorderStyleNone
;
self
.
tfName
.
delegate
=
self
;
self
.
tfPhone
.
delegate
=
self
;
self
.
tfCountry
.
delegate
=
self
;
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/ShopCart/ShopCart.storyboard
View file @
24c0de27
This diff is collapsed.
Click to expand it.
iCemarose/Class/View/FilterView/KWMNormalFilterView.h
View file @
24c0de27
...
...
@@ -19,4 +19,6 @@
@property
(
nonatomic
)
BUYCollectionSort
selectedSort
;
-
(
void
)
show
;
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/View/FilterView/KWMNormalFilterView.m
View file @
24c0de27
...
...
@@ -14,7 +14,9 @@
@property
(
weak
,
nonatomic
)
IBOutlet
KWMFilterView
*
filterView
;
@property
(
weak
,
nonatomic
)
IBOutlet
NSLayoutConstraint
*
heightFilter
;
@property
(
weak
,
nonatomic
)
IBOutlet
NSLayoutConstraint
*
heightFilter
;
@property
(
weak
,
nonatomic
)
IBOutlet
NSLayoutConstraint
*
marginTopFilter
;
-
(
IBAction
)
onClickBlank
:(
id
)
sender
;
...
...
@@ -70,5 +72,17 @@
self
.
hidden
=
YES
;
}
-
(
void
)
show
{
if
(
self
.
hidden
){
self
.
marginTopFilter
.
constant
=
-
self
.
heightFilter
.
constant
;
self
.
hidden
=
NO
;
[
self
layoutIfNeeded
];
[
UIView
animateWithDuration
:
self
.
filterMode
==
ModeFilter
?
0
.
5
:
0
.
25
animations
:
^
{
self
.
marginTopFilter
.
constant
=
0
;
[
self
layoutIfNeeded
];
}];
}
}
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/View/FilterView/KWMNormalFilterView.xib
View file @
24c0de27
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1212
0"
systemVersion=
"16E195
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1212
1"
systemVersion=
"16F73
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
</device>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1208
8
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1208
9
"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<objects>
...
...
@@ -13,6 +13,7 @@
<connections>
<outlet
property=
"filterView"
destination=
"AFM-lg-PjC"
id=
"pNw-rv-IvA"
/>
<outlet
property=
"heightFilter"
destination=
"6KX-Dg-66z"
id=
"Wo3-eH-eHC"
/>
<outlet
property=
"marginTopFilter"
destination=
"SiA-l8-az5"
id=
"Azb-Jh-GQP"
/>
<outlet
property=
"vContent"
destination=
"iN0-l3-epB"
id=
"7BZ-YQ-Bpg"
/>
</connections>
</placeholder>
...
...
@@ -32,7 +33,7 @@
<outletCollection
property=
"gestureRecognizers"
destination=
"XTx-4h-dka"
appends=
"YES"
id=
"BFR-eg-lnB"
/>
</connections>
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"AFM-lg-PjC"
customClass=
"KWMFilterView"
>
<view
c
lipsSubviews=
"YES"
c
ontentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"AFM-lg-PjC"
customClass=
"KWMFilterView"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"300"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<constraints>
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Header-Prefix.h
View file @
24c0de27
...
...
@@ -62,7 +62,7 @@
#define Cemarose_KEY @"4a119ac523d53c98bbd2983b798a0d53"
//
//
//
////测试
//#define TestModel @"YES"
//
...
...
This diff is collapsed.
Click to expand it.
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