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
b142b254
Commit
b142b254
authored
Jun 16, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add currency select
parent
68a4164f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
209 additions
and
3 deletions
+209
-3
project.pbxproj
iCemarose.xcodeproj/project.pbxproj
+12
-0
Main.storyboard
iCemarose/Base.lproj/Main.storyboard
+0
-0
KWMUserDao.h
iCemarose/Class/Model/DAO/KWMUserDao.h
+2
-0
KWMUserDao.m
iCemarose/Class/Model/DAO/KWMUserDao.m
+18
-0
KWMSelectCurrencyCell.h
iCemarose/Class/UI/Mine/Cell/KWMSelectCurrencyCell.h
+15
-0
KWMSelectCurrencyCell.m
iCemarose/Class/UI/Mine/Cell/KWMSelectCurrencyCell.m
+34
-0
KWMMineVC.m
iCemarose/Class/UI/Mine/KWMMineVC.m
+4
-0
KWMSelectCurrencyVC.h
iCemarose/Class/UI/Mine/KWMSelectCurrencyVC.h
+13
-0
KWMSelectCurrencyVC.m
iCemarose/Class/UI/Mine/KWMSelectCurrencyVC.m
+104
-0
KWMCollectionCell.h
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.h
+1
-0
KWMNewVC.m
iCemarose/Class/UI/Product/KWMNewVC.m
+1
-0
KWMCurrencyUtil.m
iCemarose/Class/Util/KWMCurrencyUtil.m
+5
-3
No files found.
iCemarose.xcodeproj/project.pbxproj
View file @
b142b254
...
@@ -67,6 +67,8 @@
...
@@ -67,6 +67,8 @@
80F82E611D704E34008B470B
/* KWMBrandCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
80F82E5F1D704E34008B470B
/* KWMBrandCell.m */
;
};
80F82E611D704E34008B470B
/* KWMBrandCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
80F82E5F1D704E34008B470B
/* KWMBrandCell.m */
;
};
80F82E621D704E34008B470B
/* KWMBrandCell.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
80F82E601D704E34008B470B
/* KWMBrandCell.xib */
;
};
80F82E621D704E34008B470B
/* KWMBrandCell.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
80F82E601D704E34008B470B
/* KWMBrandCell.xib */
;
};
80FBF7E18C063DB9E8DC7502
/* libPods-iCemarose.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
450DA8BB947651E9A9B38BEB
/* libPods-iCemarose.a */
;
};
80FBF7E18C063DB9E8DC7502
/* libPods-iCemarose.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
450DA8BB947651E9A9B38BEB
/* libPods-iCemarose.a */
;
};
9B01488B1EF3B5330056D937
/* KWMSelectCurrencyVC.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9B01488A1EF3B5330056D937
/* KWMSelectCurrencyVC.m */
;
};
9B01488E1EF3B8760056D937
/* KWMSelectCurrencyCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9B01488D1EF3B8760056D937
/* KWMSelectCurrencyCell.m */
;
};
9B0F56B81ECD3424009FC5FE
/* UIViewController+AppearLog.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9B0F56B71ECD3424009FC5FE
/* UIViewController+AppearLog.m */
;
};
9B0F56B81ECD3424009FC5FE
/* UIViewController+AppearLog.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9B0F56B71ECD3424009FC5FE
/* UIViewController+AppearLog.m */
;
};
9B166F511ED6DBCF003E9F03
/* KWMHttpUtil.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9B166F501ED6DBCF003E9F03
/* KWMHttpUtil.m */
;
};
9B166F511ED6DBCF003E9F03
/* KWMHttpUtil.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9B166F501ED6DBCF003E9F03
/* KWMHttpUtil.m */
;
};
9B18C11F1EF1270A001DD59B
/* BUYProductVariant+Currency.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9B18C11E1EF1270A001DD59B
/* BUYProductVariant+Currency.m */
;
};
9B18C11F1EF1270A001DD59B
/* BUYProductVariant+Currency.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9B18C11E1EF1270A001DD59B
/* BUYProductVariant+Currency.m */
;
};
...
@@ -412,6 +414,10 @@
...
@@ -412,6 +414,10 @@
80F82E5E1D704E34008B470B
/* KWMBrandCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
KWMBrandCell.h
;
sourceTree
=
"<group>"
;
};
80F82E5E1D704E34008B470B
/* KWMBrandCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
KWMBrandCell.h
;
sourceTree
=
"<group>"
;
};
80F82E5F1D704E34008B470B
/* KWMBrandCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMBrandCell.m
;
sourceTree
=
"<group>"
;
};
80F82E5F1D704E34008B470B
/* KWMBrandCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMBrandCell.m
;
sourceTree
=
"<group>"
;
};
80F82E601D704E34008B470B
/* KWMBrandCell.xib */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.xib
;
path
=
KWMBrandCell.xib
;
sourceTree
=
"<group>"
;
};
80F82E601D704E34008B470B
/* KWMBrandCell.xib */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.xib
;
path
=
KWMBrandCell.xib
;
sourceTree
=
"<group>"
;
};
9B0148891EF3B5330056D937
/* KWMSelectCurrencyVC.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
KWMSelectCurrencyVC.h
;
sourceTree
=
"<group>"
;
};
9B01488A1EF3B5330056D937
/* KWMSelectCurrencyVC.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMSelectCurrencyVC.m
;
sourceTree
=
"<group>"
;
};
9B01488C1EF3B8750056D937
/* KWMSelectCurrencyCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
KWMSelectCurrencyCell.h
;
sourceTree
=
"<group>"
;
};
9B01488D1EF3B8760056D937
/* KWMSelectCurrencyCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMSelectCurrencyCell.m
;
sourceTree
=
"<group>"
;
};
9B0F56B61ECD3424009FC5FE
/* UIViewController+AppearLog.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"UIViewController+AppearLog.h"
;
sourceTree
=
"<group>"
;
};
9B0F56B61ECD3424009FC5FE
/* UIViewController+AppearLog.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"UIViewController+AppearLog.h"
;
sourceTree
=
"<group>"
;
};
9B0F56B71ECD3424009FC5FE
/* UIViewController+AppearLog.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"UIViewController+AppearLog.m"
;
sourceTree
=
"<group>"
;
};
9B0F56B71ECD3424009FC5FE
/* UIViewController+AppearLog.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"UIViewController+AppearLog.m"
;
sourceTree
=
"<group>"
;
};
9B166F4F1ED6DBCF003E9F03
/* KWMHttpUtil.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
KWMHttpUtil.h
;
sourceTree
=
"<group>"
;
};
9B166F4F1ED6DBCF003E9F03
/* KWMHttpUtil.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
KWMHttpUtil.h
;
sourceTree
=
"<group>"
;
};
...
@@ -1305,6 +1311,8 @@
...
@@ -1305,6 +1311,8 @@
C06665111D767A0A00F02EF4
/* KWMContactUsVC.m */
,
C06665111D767A0A00F02EF4
/* KWMContactUsVC.m */
,
C03A05041E35DC5800BAA889
/* KWMNewGiftCardVC.h */
,
C03A05041E35DC5800BAA889
/* KWMNewGiftCardVC.h */
,
C03A05051E35DC5800BAA889
/* KWMNewGiftCardVC.m */
,
C03A05051E35DC5800BAA889
/* KWMNewGiftCardVC.m */
,
9B0148891EF3B5330056D937
/* KWMSelectCurrencyVC.h */
,
9B01488A1EF3B5330056D937
/* KWMSelectCurrencyVC.m */
,
);
);
path
=
Mine
;
path
=
Mine
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -1708,6 +1716,8 @@
...
@@ -1708,6 +1716,8 @@
C05910911E34A729002990B3
/* KWMNewGiftCardCell.h */
,
C05910911E34A729002990B3
/* KWMNewGiftCardCell.h */
,
C05910921E34A729002990B3
/* KWMNewGiftCardCell.m */
,
C05910921E34A729002990B3
/* KWMNewGiftCardCell.m */
,
C05910931E34A729002990B3
/* KWMNewGiftCardCell.xib */
,
C05910931E34A729002990B3
/* KWMNewGiftCardCell.xib */
,
9B01488C1EF3B8750056D937
/* KWMSelectCurrencyCell.h */
,
9B01488D1EF3B8760056D937
/* KWMSelectCurrencyCell.m */
,
);
);
path
=
Cell
;
path
=
Cell
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -2179,6 +2189,7 @@
...
@@ -2179,6 +2189,7 @@
C0F5867A1E24F820001248E2
/* KWMDoubleTitleView.m in Sources */
,
C0F5867A1E24F820001248E2
/* KWMDoubleTitleView.m in Sources */
,
8091DFBB1D6EC1DD0020519C
/* KWMThreeView.m in Sources */
,
8091DFBB1D6EC1DD0020519C
/* KWMThreeView.m in Sources */
,
C0DD53371EE55190002D1E0C
/* KWMLoadingView.m in Sources */
,
C0DD53371EE55190002D1E0C
/* KWMLoadingView.m in Sources */
,
9B01488E1EF3B8760056D937
/* KWMSelectCurrencyCell.m in Sources */
,
C03120B01EF2B26B00E49EFA
/* KWMPayUtil.m in Sources */
,
C03120B01EF2B26B00E49EFA
/* KWMPayUtil.m in Sources */
,
9BE61CFB1ECD56E70031D21E
/* KWMDictioaryResult.m in Sources */
,
9BE61CFB1ECD56E70031D21E
/* KWMDictioaryResult.m in Sources */
,
C034E6D81D6AEF1B006EE129
/* KWMImageUtil.m in Sources */
,
C034E6D81D6AEF1B006EE129
/* KWMImageUtil.m in Sources */
,
...
@@ -2317,6 +2328,7 @@
...
@@ -2317,6 +2328,7 @@
C0DD533B1EE55190002D1E0C
/* KWMSuperLoadingView.m in Sources */
,
C0DD533B1EE55190002D1E0C
/* KWMSuperLoadingView.m in Sources */
,
C034E85D1D6B10A0006EE129
/* PBConst.m in Sources */
,
C034E85D1D6B10A0006EE129
/* PBConst.m in Sources */
,
C0CCB3D11EEA765B00BC2FB8
/* KWMNormalFilterTab.m in Sources */
,
C0CCB3D11EEA765B00BC2FB8
/* KWMNormalFilterTab.m in Sources */
,
9B01488B1EF3B5330056D937
/* KWMSelectCurrencyVC.m in Sources */
,
C0CC140F1D7926DF007B5986
/* KWMBeforePayVC.m in Sources */
,
C0CC140F1D7926DF007B5986
/* KWMBeforePayVC.m in Sources */
,
C034E8441D6B10A0006EE129
/* NSObject+Extend.m in Sources */
,
C034E8441D6B10A0006EE129
/* NSObject+Extend.m in Sources */
,
80A611B21D6DB0EC00709E09
/* KWMShopCartVC.m in Sources */
,
80A611B21D6DB0EC00709E09
/* KWMShopCartVC.m in Sources */
,
...
...
iCemarose/Base.lproj/Main.storyboard
View file @
b142b254
This diff is collapsed.
Click to expand it.
iCemarose/Class/Model/DAO/KWMUserDao.h
View file @
b142b254
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
*/
*/
@interface
KWMUserDao
:
NSObject
@interface
KWMUserDao
:
NSObject
@property
(
nonatomic
,
strong
)
NSString
*
currencyCode
;
+
(
KWMUserDao
*
)
shareDao
;
+
(
KWMUserDao
*
)
shareDao
;
-
(
BOOL
)
checkSession
;
-
(
BOOL
)
checkSession
;
-
(
KWMUser
*
)
loginUser
;
-
(
KWMUser
*
)
loginUser
;
...
...
iCemarose/Class/Model/DAO/KWMUserDao.m
View file @
b142b254
...
@@ -26,6 +26,7 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
...
@@ -26,6 +26,7 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
@interface
KWMUserDao
()
@interface
KWMUserDao
()
@end
@end
@implementation
KWMUserDao
{
@implementation
KWMUserDao
{
...
@@ -40,6 +41,8 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
...
@@ -40,6 +41,8 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
BOOL
isLogingChat
;
BOOL
isLogingChat
;
}
}
@synthesize
currencyCode
=
_currencyCode
;
+
(
KWMUserDao
*
)
shareDao
{
+
(
KWMUserDao
*
)
shareDao
{
static
KWMUserDao
*
_userDao
=
nil
;
static
KWMUserDao
*
_userDao
=
nil
;
static
dispatch_once_t
oncePredicate
;
static
dispatch_once_t
oncePredicate
;
...
@@ -434,5 +437,20 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
...
@@ -434,5 +437,20 @@ static NSString *kwmKeySavedAccountPassword = @"savedAccountPassword";
}
}
}
}
-
(
NSString
*
)
currencyCode
{
if
(
!
_currencyCode
)
{
_currencyCode
=
[[
NSUserDefaults
standardUserDefaults
]
stringForKey
:
@"_current_currency_code"
];
if
(
!
_currencyCode
)
{
_currencyCode
=
[
@"zh"
isEqualToString
:[[
NSLocale
currentLocale
]
languageCode
]]
?
@"CNY"
:
@"EUR"
;
}
}
return
_currencyCode
;
}
-
(
void
)
setCurrencyCode
:
(
NSString
*
)
currencyCode
{
_currencyCode
=
currencyCode
;
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
currencyCode
forKey
:
@"_current_currency_code"
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
}
@end
@end
iCemarose/Class/UI/Mine/Cell/KWMSelectCurrencyCell.h
0 → 100644
View file @
b142b254
//
// KWMSelectCurrencyCell.h
// iCemarose
//
// Created by lee on 2017/6/16.
// Copyright © 2017年 kollway. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
KWMSelectCurrencyCell
:
UITableViewCell
-
(
void
)
fillData
:(
NSString
*
)
name
;
@end
iCemarose/Class/UI/Mine/Cell/KWMSelectCurrencyCell.m
0 → 100644
View file @
b142b254
//
// KWMSelectCurrencyCell.m
// iCemarose
//
// Created by lee on 2017/6/16.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "KWMSelectCurrencyCell.h"
@interface
KWMSelectCurrencyCell
()
@property
(
nonatomic
,
weak
)
IBOutlet
UILabel
*
title
;
@end
@implementation
KWMSelectCurrencyCell
-
(
void
)
awakeFromNib
{
[
super
awakeFromNib
];
// Initialization code
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
-
(
void
)
fillData
:
(
NSString
*
)
name
{
self
.
title
.
text
=
name
;
}
@end
iCemarose/Class/UI/Mine/KWMMineVC.m
View file @
b142b254
...
@@ -81,6 +81,10 @@
...
@@ -81,6 +81,10 @@
self
.
title
=
@"我的"
;
self
.
title
=
@"我的"
;
}
}
-
(
IBAction
)
onClickCurrency
:
(
id
)
sender
{
[
self
performSegueWithIdentifier
:
@"MeToCurrency"
sender
:
nil
];
}
-
(
void
)
onClickOrder
:
(
id
)
sender
{
-
(
void
)
onClickOrder
:
(
id
)
sender
{
if
(
!
_user
.
status
)
{
if
(
!
_user
.
status
)
{
//登录
//登录
...
...
iCemarose/Class/UI/Mine/KWMSelectCurrencyVC.h
0 → 100644
View file @
b142b254
//
// KWMSelectCurrencyVC.h
// iCemarose
//
// Created by lee on 2017/6/16.
// Copyright © 2017年 kollway. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
KWMSelectCurrencyVC
:
UITableViewController
@end
iCemarose/Class/UI/Mine/KWMSelectCurrencyVC.m
0 → 100644
View file @
b142b254
//
// KWMSelectCurrencyVC.m
// iCemarose
//
// Created by lee on 2017/6/16.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "KWMSelectCurrencyVC.h"
#import "KWMSelectCurrencyCell.h"
#import "KWMUserDao.h"
@interface
KWMSelectCurrencyVC
()
@property
(
nonatomic
,
strong
)
NSArray
*
titles
;
@property
(
nonatomic
,
strong
)
NSArray
*
codes
;
@end
@implementation
KWMSelectCurrencyVC
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
_titles
=
@[
@"人民币"
,
@"Euro"
];
_codes
=
@[
@"CNY"
,
@"EUR"
];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
titles
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
KWMSelectCurrencyCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"CurrencyCell"
forIndexPath
:
indexPath
];
[
cell
fillData
:
self
.
titles
[
indexPath
.
row
]];
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
[[
KWMUserDao
shareDao
]
setCurrencyCode
:
self
.
codes
[
indexPath
.
row
]];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.h
View file @
b142b254
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#import "Buy/Buy.h"
#import "Buy/Buy.h"
@interface
KWMCollectionCell
:
UICollectionViewCell
@interface
KWMCollectionCell
:
UICollectionViewCell
@property
(
weak
,
nonatomic
)
IBOutlet
UIImageView
*
ivCollectionCell
;
@property
(
weak
,
nonatomic
)
IBOutlet
UIImageView
*
ivCollectionCell
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
lbBrand
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
lbBrand
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
lbDiscount
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
lbDiscount
;
...
...
iCemarose/Class/UI/Product/KWMNewVC.m
View file @
b142b254
...
@@ -100,6 +100,7 @@ static NSString * idStr = @"KWMNewGoodsCell";
...
@@ -100,6 +100,7 @@ static NSString * idStr = @"KWMNewGoodsCell";
}
}
[
_searchBar
resumeView
];
[
_searchBar
resumeView
];
_vBackground
.
hidden
=
YES
;
_vBackground
.
hidden
=
YES
;
[
self
.
tbvNewGoods
reloadData
];
}
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
[
super
viewWillDisappear
:
animated
];
...
...
iCemarose/Class/Util/KWMCurrencyUtil.m
View file @
b142b254
...
@@ -44,7 +44,8 @@
...
@@ -44,7 +44,8 @@
// NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
// NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
// return [language isEqualToString:@"zh-CN"] ? @"CNY" : @"EUR"; // @"EUR"
// return [language isEqualToString:@"zh-CN"] ? @"CNY" : @"EUR"; // @"EUR"
// TODO: 这里应该写到设置中 设置中来设置CurrencyCode
// TODO: 这里应该写到设置中 设置中来设置CurrencyCode
return
[
@"zh"
isEqualToString
:[[
NSLocale
currentLocale
]
languageCode
]]
?
@"CNY"
:
@"EUR"
;
// return [@"zh" isEqualToString:[[NSLocale currentLocale] languageCode]] ? @"CNY" : @"EUR";
return
[[
KWMUserDao
shareDao
]
currencyCode
];
}
}
-
(
NSString
*
)
priceFormattedByCurrencyCode
:
(
NSDecimalNumber
*
)
price
{
-
(
NSString
*
)
priceFormattedByCurrencyCode
:
(
NSDecimalNumber
*
)
price
{
...
@@ -59,14 +60,15 @@
...
@@ -59,14 +60,15 @@
//- (NSString *)
//- (NSString *)
-
(
NSString
*
)
fixFormatted
:
(
NSString
*
)
price
{
-
(
NSString
*
)
fixFormatted
:
(
NSString
*
)
price
{
return
[
price
stringByReplacingOccurrencesOfString
:[
NSString
stringWithFormat
:
@"%@00"
,[
self
numberFormatter
].
currencyDecimalSeparator
]
withString
:
@""
];
// return [price stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%@00",[self numberFormatter].currencyDecimalSeparator] withString:@""];
return
price
;
}
}
-
(
NSDecimalNumber
*
)
calcPriceByCurrencyCode
:
(
NSDecimalNumber
*
)
price
{
-
(
NSDecimalNumber
*
)
calcPriceByCurrencyCode
:
(
NSDecimalNumber
*
)
price
{
if
([[
self
getCurrencyCode
]
isEqualToString
:
@"CNY"
])
{
if
([[
self
getCurrencyCode
]
isEqualToString
:
@"CNY"
])
{
NSDecimalNumber
*
rate
=
[[
KWMUserDao
shareDao
]
exchangeRate
];
NSDecimalNumber
*
rate
=
[[
KWMUserDao
shareDao
]
exchangeRate
];
price
=
[
NSDecimalNumber
decimalNumberWithString
:
@
(
ceil
([[
rate
decimalNumberByMultiplyingBy
:
price
]
decimalNumberByMultiplyingBy
:[
NSDecimalNumber
decimalNumberWithString
:
@"1.03"
]].
doubleValue
)).
stringValue
];
price
=
[
[
rate
decimalNumberByMultiplyingBy
:
price
]
decimalNumberByMultiplyingBy
:[
NSDecimalNumber
decimalNumberWithString
:
@"1.03"
]
];
}
}
return
price
;
return
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