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
ddae4359
Commit
ddae4359
authored
Jun 16, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正价格显示问题
parent
b142b254
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
5 deletions
+16
-5
KWMBrandCaramelCell.xib
iCemarose/Class/UI/Brand/Cell/KWMBrandCaramelCell.xib
+0
-0
KWMCollectionCell.m
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.m
+13
-5
KWMCollectionCell.xib
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.xib
+0
-0
KWMCurrencyUtil.m
iCemarose/Class/Util/KWMCurrencyUtil.m
+3
-0
No files found.
iCemarose/Class/UI/Brand/Cell/KWMBrandCaramelCell.xib
View file @
ddae4359
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.m
View file @
ddae4359
...
...
@@ -12,6 +12,12 @@
#import "KWMStringUtil.h"
#import "BUYProductVariant+Currency.h"
@interface
KWMCollectionCell
()
@property
(
nonatomic
,
weak
)
IBOutlet
NSLayoutConstraint
*
priceSpace
;
@end
@implementation
KWMCollectionCell
-
(
void
)
awakeFromNib
{
...
...
@@ -34,9 +40,10 @@
return
;
}
self
.
lbPrice
.
hidden
=
NO
;
self
.
discountLeft
.
constant
=
5
;
self
.
lbPrice
.
textAlignment
=
NSTextAlignmentRight
;
self
.
lbDiscount
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
priceSpace
.
constant
=
4
;
// self.discountLeft.constant = 5;
// self.lbPrice.textAlignment = NSTextAlignmentRight;
// self.lbDiscount.textAlignment = NSTextAlignmentLeft;
NSString
*
priceString
,
*
discountStr
;
if
(
productVariant
.
compareAtPrice
)
{
...
...
@@ -47,8 +54,9 @@
self
.
lbPrice
.
attributedText
=
attribtStr
;
}
else
{
self
.
lbPrice
.
hidden
=
YES
;
self
.
discountLeft
.
constant
=
-
28
;
self
.
lbDiscount
.
textAlignment
=
NSTextAlignmentCenter
;
self
.
priceSpace
.
constant
=
0
;
// self.discountLeft.constant = -28;
// self.lbDiscount.textAlignment = NSTextAlignmentCenter;
}
// discountStr = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:productVariant.price]];
discountStr
=
productVariant
.
priceFormatted
;
...
...
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.xib
View file @
ddae4359
This diff is collapsed.
Click to expand it.
iCemarose/Class/Util/KWMCurrencyUtil.m
View file @
ddae4359
...
...
@@ -48,12 +48,15 @@
return
[[
KWMUserDao
shareDao
]
currencyCode
];
}
-
(
NSString
*
)
priceFormattedByCurrencyCode
:
(
NSDecimalNumber
*
)
price
{
// return [[[self numberFormatter] stringFromNumber:[self calcPriceByCurrencyCode:self.price]] stringByReplacingOccurrencesOfRegex:@"\\.00" withString:@""];
// return [self fixFormatted:[[self numberFormatter] stringFromNumber:[NSDecimalNumber decimalNumberWithString:@"88888.88"]]];
return
[
self
fixFormatted
:[[
self
numberFormatter
]
stringFromNumber
:[
self
calcPriceByCurrencyCode
:
price
]]];
}
-
(
NSString
*
)
priceFormatted
:
(
NSDecimalNumber
*
)
price
{
// return [self fixFormatted:[[self numberFormatter] stringFromNumber:[NSDecimalNumber decimalNumberWithString:@"88888.88"]]];
return
[
self
fixFormatted
:[[
self
numberFormatter
]
stringFromNumber
:
price
]];
}
...
...
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