Commit ddae4359 by lee

修正价格显示问题

parent b142b254
......@@ -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;
......
......@@ -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]];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment