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
9408a76a
Commit
9408a76a
authored
Aug 31, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix add bag bug, change add bag logic
parent
985d1cf9
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
11 deletions
+37
-11
KWMShoppingCart.m
iCemarose/Class/Model/KWMShoppingCart.m
+3
-1
KWMLastView.m
iCemarose/Class/UI/Guide/View/KWMLastView.m
+12
-3
KWMBaseVC.h
iCemarose/Class/UI/KWMBaseVC.h
+1
-1
KWMBaseVC.m
iCemarose/Class/UI/KWMBaseVC.m
+2
-2
KWMNewProductVC.m
iCemarose/Class/UI/NewProduct/KWMNewProductVC.m
+17
-3
KWMShopCartVC.m
iCemarose/Class/UI/ShopCart/KWMShopCartVC.m
+2
-1
No files found.
iCemarose/Class/Model/KWMShoppingCart.m
View file @
9408a76a
...
...
@@ -65,7 +65,9 @@
-
(
void
)
addTasksObject
:
(
NSURLSessionDataTask
*
)
object
{
if
(
self
.
tasks
.
lastObject
&&
[
self
.
tasks
.
lastObject
.
currentRequest
.
URL
.
absoluteString
isEqualToString
:
object
.
currentRequest
.
URL
.
absoluteString
]
&&
[
object
.
currentRequest
.
URL
.
absoluteString
isMatchedByRegex
:
@"cart.js$"
])
{
if
(
!
self
.
sync
)
return
;
if
(
!
self
.
sync
)
{
return
;
}
}
[
self
.
tasks
addObject
:
object
];
if
(
self
.
tasks
.
count
==
1
)
{
...
...
iCemarose/Class/UI/Guide/View/KWMLastView.m
View file @
9408a76a
...
...
@@ -34,13 +34,21 @@
}
-
(
void
)
animating
{
CABasicAnimation
*
textAnimation
=
[
self
getShowAnimation
];
[
self
.
lbText
.
layer
addAnimation
:
textAnimation
forKey
:
@"textAnimation"
];
// CABasicAnimation *textAnimation = [self getShowAnimation];
// [self.lbText.layer addAnimation:textAnimation forKey:@"textAnimation"];
self
.
lbText
.
alpha
=
0
;
self
.
btnEnter
.
alpha
=
0
;
[
UIView
animateWithDuration
:
1
.
5
animations
:
^
{
self
.
lbText
.
alpha
=
1
;
}];
[
UIView
animateWithDuration
:
1
.
5
delay
:
0
.
8
options
:
0
animations
:^
{
self
.
btnEnter
.
alpha
=
1
;
}
completion
:
nil
];
}
-
(
CABasicAnimation
*
)
getShowAnimation
{
CABasicAnimation
*
enterAnimation
=
[
CABasicAnimation
animationWithKeyPath
:
@"opacity"
];
enterAnimation
.
duration
=
3
.
0
f
;
enterAnimation
.
duration
=
1
.
5
f
;
enterAnimation
.
repeatCount
=
1
;
enterAnimation
.
delegate
=
self
;
enterAnimation
.
fromValue
=
[
NSNumber
numberWithDouble
:
0
.
0
f
];
...
...
@@ -58,6 +66,7 @@
self
.
lbText
.
alpha
=
1
.
0
;
[
self
.
lbText
.
layer
removeAllAnimations
];
CABasicAnimation
*
enterAnimation
=
[
self
getShowAnimation
];
enterAnimation
.
beginTime
=
0
;
[
self
.
btnEnter
.
layer
addAnimation
:
enterAnimation
forKey
:
@"enterAnimation"
];
}
}
...
...
iCemarose/Class/UI/KWMBaseVC.h
View file @
9408a76a
...
...
@@ -64,7 +64,7 @@
image
:(
UIImage
*
)
image
action
:(
SEL
)
action
;
-
(
void
)
showPresentation
:(
UIViewController
*
)
vc
size
:(
CGSize
)
size
tapOutsideClose
:(
BOOL
)
tapOutsideClose
style
:(
MZFormSheetPresentationTransitionStyle
)
style
;
-
(
MZFormSheetPresentationViewController
*
)
showPresentation
:(
UIViewController
*
)
vc
size
:(
CGSize
)
size
tapOutsideClose
:(
BOOL
)
tapOutsideClose
style
:(
MZFormSheetPresentationTransitionStyle
)
style
;
/**将URL转成UIImage*/
-
(
void
)
sd_setImageWithURL
:(
NSURL
*
)
url
placeholderImage
:(
UIImage
*
)
placeholder
options
:(
SDWebImageOptions
)
options
progress
:(
SDWebImageDownloaderProgressBlock
)
progressBlock
completed
:(
SDWebImageCompletionBlock
)
completedBlock
;
...
...
iCemarose/Class/UI/KWMBaseVC.m
View file @
9408a76a
...
...
@@ -535,7 +535,7 @@
return
[[
UIBarButtonItem
alloc
]
initWithCustomView
:
btnView
];
}
-
(
void
)
showPresentation
:
(
UIViewController
*
)
vc
size
:
(
CGSize
)
size
tapOutsideClose
:
(
BOOL
)
tapOutsideClose
style
:
(
MZFormSheetPresentationTransitionStyle
)
style
{
-
(
MZFormSheetPresentationViewController
*
)
showPresentation
:
(
UIViewController
*
)
vc
size
:
(
CGSize
)
size
tapOutsideClose
:
(
BOOL
)
tapOutsideClose
style
:
(
MZFormSheetPresentationTransitionStyle
)
style
{
MZFormSheetPresentationViewController
*
mz
=
[[
MZFormSheetPresentationViewController
alloc
]
initWithContentViewController
:
vc
];
mz
.
presentationController
.
shouldDismissOnBackgroundViewTap
=
tapOutsideClose
;
mz
.
presentationController
.
movementActionWhenKeyboardAppears
=
MZFormSheetActionWhenKeyboardAppearsCenterVertically
;
...
...
@@ -544,10 +544,10 @@
mz
.
presentationController
.
contentViewSize
=
size
;
}
mz
.
presentationController
.
shouldCenterVertically
=
YES
;
[
self
presentViewController
:
mz
animated
:
YES
completion
:
nil
];
return
mz
;
}
...
...
iCemarose/Class/UI/NewProduct/KWMNewProductVC.m
View file @
9408a76a
...
...
@@ -38,6 +38,9 @@
@property
(
weak
,
nonatomic
)
IBOutlet
NSLayoutConstraint
*
heightMidView
;
// 0 非自动 1 是加购 2 是立即购买
@property
(
assign
,
nonatomic
)
NSInteger
autoAddToBag
;
//颜色扩展字段
@property
(
nonatomic
)
KWMMetafield
*
colorMeterfield
;
...
...
@@ -213,9 +216,11 @@
}
-
(
IBAction
)
onClickComplete
:
(
UIButton
*
)
sender
{
BOOL
buyNow
=
sender
.
tag
==
1
;
BOOL
buyNow
=
sender
.
tag
==
1
||
self
.
autoAddToBag
==
2
;
if
(
!
self
.
variant
){
[
self
showToast
:
@"请选择商品"
];
// [self showToast:@"请选择商品"];
self
.
autoAddToBag
=
buyNow
?
2
:
1
;
[
self
kwm_onClickSizeBtn
];
return
;
}
[
self
showLoading
];
...
...
@@ -261,9 +266,11 @@
KWMUserModel
*
useModel
=
[
KWMUserModel
shareUser
];
if
(
!
useModel
.
status
)
{
//登录
dispatch_after
(
0
,
dispatch_get_main_queue
(),
^
{
KWMLoginVC
*
loginVc
=
(
KWMLoginVC
*
)[
KWMBaseVC
findControllerBy
:[
KWMLoginVC
kwmTag
]
fromStoryboard
:
@"Login"
];
UINavigationController
*
nav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
loginVc
];
[
self
presentViewController
:
nav
animated
:
YES
completion
:
nil
];
});
return
;
}
[
self
showLoading
];
...
...
@@ -312,7 +319,10 @@
[
variantsVC
setDefaultSelect
:
self
.
variant
color
:
self
.
color
count
:
self
.
count
];
}
CGSize
size
=
[
UIScreen
mainScreen
].
bounds
.
size
;
[
self
showPresentation
:
variantsVC
size
:
size
tapOutsideClose
:
YES
style
:
MZFormSheetPresentationTransitionStyleFade
];
MZFormSheetPresentationViewController
*
mz
=
[
self
showPresentation
:
variantsVC
size
:
size
tapOutsideClose
:
YES
style
:
MZFormSheetPresentationTransitionStyleSlideFromBottom
];
mz
.
didDismissContentViewControllerHandler
=
^
(
UIViewController
*
_Nonnull
contentViewController
)
{
self
.
autoAddToBag
=
0
;
};
}
-
(
void
)
kwm_sizeGuide
{
...
...
@@ -419,6 +429,10 @@
self
.
isLikeVariant
=
NO
;
[
self
requestWishList
];
if
(
self
.
autoAddToBag
)
{
[
self
onClickComplete
:
nil
];
self
.
autoAddToBag
=
0
;
}
}
#pragma mark - API BUYClient+Storefront
...
...
iCemarose/Class/UI/ShopCart/KWMShopCartVC.m
View file @
9408a76a
...
...
@@ -58,9 +58,10 @@
-
(
void
)
checkInStockAndRefresh
{
__weak
typeof
(
self
)
this
=
self
;
[
self
showLoading
];
[[
KWMShoppingCart
sharedInstance
]
setSync
:
YES
];
[[
KWMShoppingCart
sharedInstance
]
allItemsWithCallback
:
^
(
NSError
*
error
,
KWMCartResult
*
cart
)
{
[
this
refresh
];
[[
KWMShoppingCart
sharedInstance
]
setSync
:
NO
];
NSArray
*
ids
=
[
cart
.
items
rx_mapWithBlock
:
^
id
(
KWMShopCartModel
*
each
)
{
return
each
.
product_id
;
}];
...
...
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