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
b1906ed2
Commit
b1906ed2
authored
Jan 09, 2018
by
houweibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
店家详情:根据选择的规格显示不同的价格
parent
27ec3fbb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
+19
-15
KWMFirstDetailView.m
iCemarose/Class/UI/NewProduct/Cell/KWMFirstDetailView.m
+17
-13
KWMStringUtil.m
iCemarose/Class/Util/KWMStringUtil.m
+2
-2
No files found.
iCemarose/Class/UI/NewProduct/Cell/KWMFirstDetailView.m
View file @
b1906ed2
...
...
@@ -10,6 +10,7 @@
#import "KWMImageUtil.h"
#import "KWMStringUtil.h"
#import "KWMPageControl.h"
#import "KWMUserDao.h"
//#import "YYWebImage/YYWebImage.h"
#import <SDCycleScrollView/SDCycleScrollView.h>
...
...
@@ -31,9 +32,6 @@
@property
(
nonatomic
,
weak
)
IBOutlet
UIView
*
freeShipping
;
//单位label
@property
(
nonatomic
,
weak
)
IBOutlet
UILabel
*
lbUnit
;
//@property(nonatomic,weak) IBOutlet KWMPageControl *pageControl;
@property
(
weak
,
nonatomic
)
IBOutlet
UIView
*
sizeGuideView
;
...
...
@@ -134,7 +132,7 @@
if
(
product
==
nil
){
return
;
}
self
.
isShowCNY
=
YES
;
self
.
isShowCNY
=
[[
KWMUserDao
shareDao
].
currencyCode
isEqualToString
:
@"CNY"
]
;
// self.isFirstScroll = YES;
// [self removeTimer];
self
.
product
=
product
;
...
...
@@ -210,13 +208,10 @@
self
.
lbOldPrice
.
hidden
=
YES
;
}
UITapGestureRecognizer
*
priceTap1
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
onClickPrice
:
)];
UITapGestureRecognizer
*
priceTap2
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
onClickPrice
:
)];
UITapGestureRecognizer
*
priceTap3
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
onClickPrice
:
)];
[
self
.
lbUnit
addGestureRecognizer
:
priceTap1
];
[
self
.
lbPrice
addGestureRecognizer
:
priceTap2
];
[
self
.
lbOldPrice
addGestureRecognizer
:
priceTap3
];
self
.
lbUnit
.
userInteractionEnabled
=
YES
;
self
.
lbPrice
.
userInteractionEnabled
=
YES
;
self
.
lbOldPrice
.
userInteractionEnabled
=
YES
;
self
.
freeShipping
.
hidden
=
[
product
.
tags
containsObject
:
@"not-return"
];
...
...
@@ -243,21 +238,29 @@
return
;
}
self
.
isShowCNY
=
!
self
.
isShowCNY
;
BUYProductVariant
*
productVariant
=
self
.
product
.
variants
.
firstObject
;
[
self
refreshPrice
];
}
-
(
void
)
refreshPrice
{
if
(
self
.
product
==
nil
||
!
self
.
product
.
variants
||
self
.
product
.
variants
.
count
==
0
){
return
;
}
BUYProductVariant
*
productVariant
=
self
.
product
.
variants
.
firstObject
;
if
(
self
.
variant
){
productVariant
=
self
.
variant
;
}
if
(
self
.
isShowCNY
){
self
.
lbUnit
.
text
=
@"¥"
;
self
.
lbPrice
.
text
=
[
KWMStringUtil
price
:
productVariant
.
price
];
if
(
productVariant
.
compareAtPrice
)
{
NSString
*
priceString
=
[
NSString
stringWithFormat
:
@"¥%@"
,[
KWMStringUtil
price
:
productVariant
.
compareAtPrice
]
];
NSString
*
priceString
=
[
KWMStringUtil
price
:
productVariant
.
compareAtPrice
];
NSDictionary
*
attribtDic
=
@{
NSStrikethroughStyleAttributeName
:
[
NSNumber
numberWithInteger
:
NSUnderlineStyleSingle
]};
NSMutableAttributedString
*
attribtStr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
priceString
attributes
:
attribtDic
];
self
.
lbOldPrice
.
attributedText
=
attribtStr
;
}
}
else
{
self
.
lbUnit
.
text
=
@"€"
;
self
.
lbPrice
.
text
=
productVariant
.
price
.
stringValue
;
self
.
lbPrice
.
text
=
[
NSString
stringWithFormat
:
@"€%.2f"
,
productVariant
.
price
.
floatValue
];
if
(
productVariant
.
compareAtPrice
)
{
NSString
*
priceString
=
[
NSString
stringWithFormat
:
@"€%
@"
,
productVariant
.
compareAtPrice
.
string
Value
];
NSString
*
priceString
=
[
NSString
stringWithFormat
:
@"€%
.2f"
,
productVariant
.
compareAtPrice
.
float
Value
];
NSDictionary
*
attribtDic
=
@{
NSStrikethroughStyleAttributeName
:
[
NSNumber
numberWithInteger
:
NSUnderlineStyleSingle
]};
NSMutableAttributedString
*
attribtStr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
priceString
attributes
:
attribtDic
];
self
.
lbOldPrice
.
attributedText
=
attribtStr
;
...
...
@@ -294,6 +297,7 @@
NSString
*
colorString
=
color
?[
NSString
stringWithFormat
:
@"%@ /"
,
color
.
title
]:
@""
;
self
.
lbVariant
.
text
=
[
NSString
stringWithFormat
:
@"已选择 %@ %@ / %ld"
,
colorString
,
variant
.
title
,
count
];
}
[
self
refreshPrice
];
}
-
(
void
)
setSizeGuideHidden
:
(
BOOL
)
sizeGuideHidden
{
...
...
iCemarose/Class/Util/KWMStringUtil.m
View file @
b1906ed2
...
...
@@ -497,7 +497,7 @@ static NSString *kEnglishNum = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu
// if(exchageRate == 0){
// exchageRate = ExchangeRate;
// }
CNYstring
=
[
NSString
stringWithFormat
:
@"%.
0
f"
,
price
.
floatValue
*
exchageRate
];
CNYstring
=
[
NSString
stringWithFormat
:
@"%.
2
f"
,
price
.
floatValue
*
exchageRate
];
// CNYstring = [NSString stringWithFormat:@"%.2f",price.floatValue];
return
CNYstring
;
...
...
@@ -505,7 +505,7 @@ static NSString *kEnglishNum = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu
+
(
NSString
*
)
price
:(
NSNumber
*
)
price
{
NSString
*
CNYstring
=
[
self
getEUR2CNYstring
:
price
];
return
[
NSString
stringWithFormat
:
@"
¥
%@"
,
CNYstring
];
return
[
NSString
stringWithFormat
:
@"
CN¥
%@"
,
CNYstring
];
}
+
(
NSArray
*
)
splitArray
:(
NSArray
*
)
array
withSubSize
:(
NSInteger
)
subSize
{
...
...
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