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
4ad67998
Commit
4ad67998
authored
Jun 20, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u exchange rate|UI issue
parent
db4977fb
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
55 additions
and
30 deletions
+55
-30
AppDelegate.m
iCemarose/AppDelegate.m
+2
-2
KWMExchangeRateResult.h
iCemarose/Class/Api/Cemarose/KWMExchangeRateResult.h
+7
-1
KWMExchangeRateResult.m
iCemarose/Class/Api/Cemarose/KWMExchangeRateResult.m
+15
-9
KWMAPIManager.m
iCemarose/Class/Api/KWMAPIManager.m
+11
-7
KWMUserDao.m
iCemarose/Class/Model/DAO/KWMUserDao.m
+10
-4
KWMBrandCaramelCell.m
iCemarose/Class/UI/Brand/Cell/KWMBrandCaramelCell.m
+2
-0
KWMMainVC.m
iCemarose/Class/UI/KWMMainVC.m
+3
-4
KWMCollectionCell.m
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.m
+3
-2
Header-Prefix.h
iCemarose/Header-Prefix.h
+2
-1
No files found.
iCemarose/AppDelegate.m
View file @
4ad67998
...
@@ -30,8 +30,8 @@
...
@@ -30,8 +30,8 @@
-
(
BOOL
)
application
:
(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:
(
NSDictionary
*
)
launchOptions
{
-
(
BOOL
)
application
:
(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:
(
NSDictionary
*
)
launchOptions
{
[
NSThread
sleepForTimeInterval
:
1
];
//
[NSThread sleepForTimeInterval:1];
[
_window
makeKeyAndVisible
];
//
[_window makeKeyAndVisible];
//UI: Appearance
//UI: Appearance
[[
UIApplication
sharedApplication
]
setStatusBarStyle
:
UIStatusBarStyleLightContent
];
[[
UIApplication
sharedApplication
]
setStatusBarStyle
:
UIStatusBarStyleLightContent
];
...
...
iCemarose/Class/Api/Cemarose/KWMExchangeRateResult.h
View file @
4ad67998
...
@@ -10,6 +10,12 @@
...
@@ -10,6 +10,12 @@
@interface
KWMExchangeRateResult
:
KWMCemaroseResult
@interface
KWMExchangeRateResult
:
KWMCemaroseResult
@property
(
nonatomic
)
NSNumber
*
exchangeRate
;
//@property (nonatomic) NSNumber* exchangeRate;
@property
(
nonatomic
,
strong
)
NSString
*
status
;
@property
(
nonatomic
,
strong
)
NSNumber
*
code
;
@property
(
nonatomic
,
strong
)
NSDictionary
*
message
;
@property
(
nonatomic
,
strong
)
NSString
*
currency
;
@property
(
nonatomic
,
strong
)
NSString
*
name
;
@property
(
nonatomic
,
strong
)
NSDecimalNumber
*
exchange_rate
;
@end
@end
iCemarose/Class/Api/Cemarose/KWMExchangeRateResult.m
View file @
4ad67998
...
@@ -13,15 +13,21 @@
...
@@ -13,15 +13,21 @@
-
(
instancetype
)
initWithDictionary
:(
NSDictionary
*
)
dict
-
(
instancetype
)
initWithDictionary
:(
NSDictionary
*
)
dict
modelClass
:(
Class
)
modelClass
modelClass
:(
Class
)
modelClass
error
:(
NSError
**
)
err
{
error
:(
NSError
**
)
err
{
if
(
dict
)
{
// if (dict) {
NSArray
*
dataArray
=
(
NSArray
*
)
dict
;
// NSArray *dataArray = (NSArray *)dict;
if
(
dataArray
&&
dataArray
.
count
>
0
){
// if(dataArray && dataArray.count>0){
NSDictionary
*
exchangedata
=
[
dataArray
objectAtIndex
:
0
];
// NSDictionary *exchangedata = [dataArray objectAtIndex:0];
if
(
exchangedata
[
@"CNY"
]){
// if(exchangedata[@"CNY"]){
self
.
exchangeRate
=
[
exchangedata
objectForKey
:
@"CNY"
];
// self.exchangeRate = [exchangedata objectForKey:@"CNY"];
}
// }
}
// }
}
// }
self
.
status
=
dict
[
@"status"
];
self
.
code
=
dict
[
@"code"
];
self
.
message
=
dict
[
@"message"
];
self
.
currency
=
self
.
message
[
@"currency"
];
self
.
name
=
self
.
message
[
@"name"
];
self
.
exchange_rate
=
self
.
message
[
@"exchange_rate"
];
return
self
;
return
self
;
}
}
...
...
iCemarose/Class/Api/KWMAPIManager.m
View file @
4ad67998
...
@@ -650,15 +650,19 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
...
@@ -650,15 +650,19 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
-
(
NSURLSessionDataTask
*
)
getExchangeRate
:
(
NSDictionary
*
)
parameters
-
(
NSURLSessionDataTask
*
)
getExchangeRate
:
(
NSDictionary
*
)
parameters
success
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
KWMExchangeRateResult
*
result
))
success
success
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
KWMExchangeRateResult
*
result
))
success
failure
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
NSError
*
error
))
failure
{
failure
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
NSError
*
error
))
failure
{
NSString
*
apiPath
=
@"https://ogbgohpla.qnssl.com/App.Currency.json"
;
#if DEBUG
NSString
*
apiPath
=
@"https://liang.tofnews.com/app/exchange/rate"
;
#else
NSString
*
apiPath
=
@"https://apps.cemarose.com/app/exchange/rate"
;
#endif
// NSString *sign = [KWMStringUtil MD5:[KWMStringUtil BASE64:@"currency=EUR&key=bd3f58f5cd3d7a217ac8c8e655ab52f8"]];
// NSLog(@"rate sign: %@",sign);
// NSDictionary *params = @{@"currency":@"EUR",@"sign":sign};
NSDictionary
*
params
=
@{
@"currency"
:
@"EUR"
,
@"sign"
:
@"665d9716511eb11f68a1a7a862ed2ddd"
};
NSTimeInterval
interval
=
[[
NSDate
date
]
timeIntervalSince1970
]
/
100
;
return
[
self
startSessionTask
:
KWMHTTPMethodPOST
long
long
time
=
interval
;
apiPath
=
[[
NSString
alloc
]
initWithFormat
:
@"%@?_=%llu"
,
apiPath
,
time
];
return
[
self
startSessionTask
:
KWMHTTPMethodGET
apiPath
:
apiPath
apiPath
:
apiPath
parameters
:
param
eter
s
parameters
:
params
result
:
[
KWMExchangeRateResult
class
]
result
:
[
KWMExchangeRateResult
class
]
model
:
nil
model
:
nil
success
:
success
success
:
success
...
...
iCemarose/Class/Model/DAO/KWMUserDao.m
View file @
4ad67998
...
@@ -39,6 +39,7 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
...
@@ -39,6 +39,7 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
BOOL
isSkipLoginChat
;
BOOL
isSkipLoginChat
;
BOOL
isLoginedChat
;
BOOL
isLoginedChat
;
BOOL
isLogingChat
;
BOOL
isLogingChat
;
NSDecimalNumber
*
_exchangeRate
;
}
}
@synthesize
currencyCode
=
_currencyCode
;
@synthesize
currencyCode
=
_currencyCode
;
...
@@ -206,6 +207,7 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
...
@@ -206,6 +207,7 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
if
(
exchangeRate
==
nil
){
if
(
exchangeRate
==
nil
){
return
;
return
;
}
}
_exchangeRate
=
[
NSDecimalNumber
decimalNumberWithDecimal
:
exchangeRate
.
decimalValue
];
NSString
*
exchangeString
=
exchangeRate
.
stringValue
;
NSString
*
exchangeString
=
exchangeRate
.
stringValue
;
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
[
defaults
setObject
:
exchangeString
forKey
:
kwmKeyExchangeRate
];
[
defaults
setObject
:
exchangeString
forKey
:
kwmKeyExchangeRate
];
...
@@ -213,14 +215,18 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
...
@@ -213,14 +215,18 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
}
}
-
(
NSDecimalNumber
*
)
exchangeRate
{
-
(
NSDecimalNumber
*
)
exchangeRate
{
if
(
!
_exchangeRate
)
{
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
NSString
*
exchageRateString
=
[
defaults
objectForKey
:
kwmKeyExchangeRate
];
NSString
*
exchageRateString
=
[
defaults
objectForKey
:
kwmKeyExchangeRate
];
// NSNumber *rate = [KWMStringUtil stringToNumber:exchageRateString];
// NSNumber *rate = [KWMStringUtil stringToNumber:exchageRateString];
// return rate;
// return rate;
if
([
KWMStringUtil
isEmpty
:
exchageRateString
])
{
if
([
KWMStringUtil
isEmpty
:
exchageRateString
])
{
return
[
NSDecimalNumber
decimalNumberWithString
:
ExchangeRateString
];
_exchangeRate
=
[
NSDecimalNumber
decimalNumberWithString
:
ExchangeRateString
];
}
else
{
_exchangeRate
=
[
NSDecimalNumber
decimalNumberWithString
:
exchageRateString
];
}
}
return
[
NSDecimalNumber
decimalNumberWithString
:
exchageRateString
];
}
return
_exchangeRate
;
}
}
-
(
void
)
saveCollectionCache
:
(
NSArray
*
)
products
collectionId
:
(
NSNumber
*
)
collectionId
tags
:
(
NSArray
*
)
tags
{
-
(
void
)
saveCollectionCache
:
(
NSArray
*
)
products
collectionId
:
(
NSNumber
*
)
collectionId
tags
:
(
NSArray
*
)
tags
{
...
...
iCemarose/Class/UI/Brand/Cell/KWMBrandCaramelCell.m
View file @
4ad67998
...
@@ -219,11 +219,13 @@
...
@@ -219,11 +219,13 @@
if
(
isLeft
)
{
if
(
isLeft
)
{
self
.
priceLeft
.
constant
=
0
;
self
.
priceLeft
.
constant
=
0
;
self
.
lbDiscountLeft
.
hidden
=
YES
;
self
.
lbDiscountLeft
.
hidden
=
YES
;
self
.
lbDiscountLeft
.
text
=
nil
;
// self.lbPriceLeft.text = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring: price]];
// self.lbPriceLeft.text = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring: price]];
self
.
lbPriceLeft
.
text
=
price
.
priceValueFormatted
;
self
.
lbPriceLeft
.
text
=
price
.
priceValueFormatted
;
}
else
{
}
else
{
self
.
priceRight
.
constant
=
0
;
self
.
priceRight
.
constant
=
0
;
self
.
lbDiscountRight
.
hidden
=
YES
;
self
.
lbDiscountRight
.
hidden
=
YES
;
self
.
lbDiscountRight
.
text
=
nil
;
// self.lbPriceRight.text = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:price]];
// self.lbPriceRight.text = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:price]];
self
.
lbPriceRight
.
text
=
price
.
priceValueFormatted
;
self
.
lbPriceRight
.
text
=
price
.
priceValueFormatted
;
}
}
...
...
iCemarose/Class/UI/KWMMainVC.m
View file @
4ad67998
...
@@ -53,7 +53,6 @@
...
@@ -53,7 +53,6 @@
}
}
}
}
-
(
void
)
initSplash
{
-
(
void
)
initSplash
{
...
@@ -196,12 +195,12 @@
...
@@ -196,12 +195,12 @@
-
(
void
)
requestExchangeRateApi
{
-
(
void
)
requestExchangeRateApi
{
void
(
^
failure
)(
NSURLSessionDataTask
*
,
NSError
*
)
=
^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
){
void
(
^
failure
)(
NSURLSessionDataTask
*
,
NSError
*
)
=
^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
){
NSLog
(
@"%@"
,
error
);
};
};
void
(
^
success
)(
NSURLSessionDataTask
*
,
KWMExchangeRateResult
*
)
=
^
(
NSURLSessionDataTask
*
task
,
KWMExchangeRateResult
*
result
){
void
(
^
success
)(
NSURLSessionDataTask
*
,
KWMExchangeRateResult
*
)
=
^
(
NSURLSessionDataTask
*
task
,
KWMExchangeRateResult
*
result
){
if
(
result
){
if
(
result
){
NSNumber
*
exchangeRate
=
result
.
exchangeRate
;
//
NSNumber *exchangeRate = result.exchangeRate;
[[
KWMUserDao
shareDao
]
saveExchangeRate
:
exchangeR
ate
];
[[
KWMUserDao
shareDao
]
saveExchangeRate
:
result
.
exchange_r
ate
];
}
}
};
};
[[
KWMAPIManager
sharedManager
]
getExchangeRate
:
nil
success
:
success
failure
:
failure
];
[[
KWMAPIManager
sharedManager
]
getExchangeRate
:
nil
success
:
success
failure
:
failure
];
...
...
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.m
View file @
4ad67998
...
@@ -39,14 +39,14 @@
...
@@ -39,14 +39,14 @@
if
(
productVariant
==
nil
){
if
(
productVariant
==
nil
){
return
;
return
;
}
}
self
.
lbPrice
.
hidden
=
NO
;
self
.
priceSpace
.
constant
=
4
;
// self.discountLeft.constant = 5;
// self.discountLeft.constant = 5;
// self.lbPrice.textAlignment = NSTextAlignmentRight;
// self.lbPrice.textAlignment = NSTextAlignmentRight;
// self.lbDiscount.textAlignment = NSTextAlignmentLeft;
// self.lbDiscount.textAlignment = NSTextAlignmentLeft;
NSString
*
priceString
,
*
discountStr
;
NSString
*
priceString
,
*
discountStr
;
if
(
productVariant
.
compareAtPrice
)
{
if
(
productVariant
.
compareAtPrice
)
{
self
.
lbPrice
.
hidden
=
NO
;
self
.
priceSpace
.
constant
=
4
;
// priceString = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:productVariant.compareAtPrice]];
// priceString = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:productVariant.compareAtPrice]];
priceString
=
productVariant
.
compareAtPriceFormatted
;
priceString
=
productVariant
.
compareAtPriceFormatted
;
NSDictionary
*
attribtDic
=
@{
NSStrikethroughStyleAttributeName
:
[
NSNumber
numberWithInteger
:
NSUnderlineStyleSingle
]};
NSDictionary
*
attribtDic
=
@{
NSStrikethroughStyleAttributeName
:
[
NSNumber
numberWithInteger
:
NSUnderlineStyleSingle
]};
...
@@ -54,6 +54,7 @@
...
@@ -54,6 +54,7 @@
self
.
lbPrice
.
attributedText
=
attribtStr
;
self
.
lbPrice
.
attributedText
=
attribtStr
;
}
else
{
}
else
{
self
.
lbPrice
.
hidden
=
YES
;
self
.
lbPrice
.
hidden
=
YES
;
self
.
lbPrice
.
text
=
nil
;
self
.
priceSpace
.
constant
=
0
;
self
.
priceSpace
.
constant
=
0
;
// self.discountLeft.constant = -28;
// self.discountLeft.constant = -28;
// self.lbDiscount.textAlignment = NSTextAlignmentCenter;
// self.lbDiscount.textAlignment = NSTextAlignmentCenter;
...
...
iCemarose/Header-Prefix.h
View file @
4ad67998
...
@@ -94,7 +94,8 @@
...
@@ -94,7 +94,8 @@
//默认欧元汇率,如果安装后第一次请求最新汇率数据失败,会使用该汇率显示价格
//默认欧元汇率,如果安装后第一次请求最新汇率数据失败,会使用该汇率显示价格
//#define ExchangeRate 7.6625
//#define ExchangeRate 7.6625
#define ExchangeRateString @"7.6625"
//#define ExchangeRateString @"7.6625"
#define ExchangeRateString @"8.0"
//品牌图片url
//品牌图片url
#define Burberry @"https://cdn.shopify.com/s/files/1/1089/5284/collections/Burberry_Childrenswear_Campaign_July_2016_001.jpg?v=1473238213"
#define Burberry @"https://cdn.shopify.com/s/files/1/1089/5284/collections/Burberry_Childrenswear_Campaign_July_2016_001.jpg?v=1473238213"
...
...
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