Commit 51667527 authored by Sandy's avatar Sandy

修改登录信息model、订单详情界面调整

parent de8aac08
This diff is collapsed.
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
<constraints> <constraints>
<constraint firstItem="J01-8B-y5r" firstAttribute="centerY" secondItem="Xru-fq-ja3" secondAttribute="centerY" id="1yq-ND-DOX"/> <constraint firstItem="J01-8B-y5r" firstAttribute="centerY" secondItem="Xru-fq-ja3" secondAttribute="centerY" id="1yq-ND-DOX"/>
<constraint firstAttribute="trailing" secondItem="rM9-W2-1PT" secondAttribute="trailing" constant="8" id="2TA-EB-U6d"/> <constraint firstAttribute="trailing" secondItem="rM9-W2-1PT" secondAttribute="trailing" constant="8" id="2TA-EB-U6d"/>
<constraint firstItem="rM9-W2-1PT" firstAttribute="top" secondItem="6Vh-Et-vJt" secondAttribute="bottom" constant="4" id="6oc-ZA-803"/>
<constraint firstItem="6Vh-Et-vJt" firstAttribute="top" secondItem="Xru-fq-ja3" secondAttribute="bottom" constant="8" id="7Xk-JU-bqo"/> <constraint firstItem="6Vh-Et-vJt" firstAttribute="top" secondItem="Xru-fq-ja3" secondAttribute="bottom" constant="8" id="7Xk-JU-bqo"/>
<constraint firstItem="v7R-er-zaD" firstAttribute="leading" secondItem="6Vh-Et-vJt" secondAttribute="trailing" constant="2" id="CNp-I7-IEP"/> <constraint firstItem="v7R-er-zaD" firstAttribute="leading" secondItem="6Vh-Et-vJt" secondAttribute="trailing" constant="2" id="CNp-I7-IEP"/>
<constraint firstItem="rM9-W2-1PT" firstAttribute="centerY" secondItem="OeX-RE-d2m" secondAttribute="centerY" id="CZW-j3-3fO"/> <constraint firstItem="rM9-W2-1PT" firstAttribute="centerY" secondItem="OeX-RE-d2m" secondAttribute="centerY" id="CZW-j3-3fO"/>
...@@ -86,9 +87,10 @@ ...@@ -86,9 +87,10 @@
</constraints> </constraints>
<variation key="default"> <variation key="default">
<mask key="constraints"> <mask key="constraints">
<exclude reference="nN0-rt-cNW"/>
<exclude reference="CZW-j3-3fO"/> <exclude reference="CZW-j3-3fO"/>
<exclude reference="DRA-Wo-4yR"/>
<exclude reference="aSi-VQ-cSz"/> <exclude reference="aSi-VQ-cSz"/>
<exclude reference="nN0-rt-cNW"/>
</mask> </mask>
</variation> </variation>
</view> </view>
...@@ -229,7 +231,7 @@ ...@@ -229,7 +231,7 @@
<outlet property="labelState" destination="nyc-Bh-qZx" id="A7V-bB-9BO"/> <outlet property="labelState" destination="nyc-Bh-qZx" id="A7V-bB-9BO"/>
<outlet property="viewExpress" destination="9bs-ar-XXb" id="rCv-CW-UTd"/> <outlet property="viewExpress" destination="9bs-ar-XXb" id="rCv-CW-UTd"/>
</connections> </connections>
<point key="canvasLocation" x="333" y="231"/> <point key="canvasLocation" x="396" y="231"/>
</view> </view>
</objects> </objects>
<resources> <resources>
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
- (NSDictionary *)getGoodsParams - (NSDictionary *)getGoodsParams
{ {
UserInfo *info = [UserInfo shareInstance]; UserInfoReseller *info = [UserInfo shareInstance].reseller;
NSDictionary *param = @{ NSDictionary *param = @{
@"operCtx": @{ @"operCtx": @{
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
- (NSDictionary *)getRemoveGoodsParams - (NSDictionary *)getRemoveGoodsParams
{ {
UserInfo *info = [UserInfo shareInstance]; UserInfoReseller *info = [UserInfo shareInstance].reseller;
NSDictionary *param = @{ NSDictionary *param = @{
@"operCtx": @{ @"operCtx": @{
...@@ -137,8 +137,8 @@ ...@@ -137,8 +137,8 @@
- (void)setUpWebView - (void)setUpWebView
{ {
UserInfo *userInfo = [UserInfo shareInstance]; UserInfoReseller *userInfo = [UserInfo shareInstance].reseller;
NSString *urlStr = [NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/1/.html", userInfo.webShopBaseUrl, userInfo.shop.uuid, self.model.uuid]; NSString *urlStr = [NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/1/.html", [UserInfo shareInstance].appConfig.webShopBaseUrl, userInfo.shop.uuid, self.model.uuid];
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 67)]; WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 67)];
NSURL *url = [NSURL URLWithString:urlStr]; NSURL *url = [NSURL URLWithString:urlStr];
self.webView = webView; self.webView = webView;
......
...@@ -244,9 +244,9 @@ ...@@ -244,9 +244,9 @@
NSDictionary *params = @{@"defintion" : @{@"probePages" : @0, NSDictionary *params = @{@"defintion" : @{@"probePages" : @0,
@"orders" : @[@{@"field" : self.field, @"orders" : @[@{@"field" : self.field,
@"direction" : self.direction}], @"direction" : self.direction}],
@"conditions" : @[@{@"parameters" : @[info.domain], @"conditions" : @[@{@"parameters" : @[kDomain],
@"operation" : @"domain equals"}, @"operation" : @"domain equals"},
@{@"parameters" : @[@[[UserInfo shareInstance].shop.uuid]], @{@"parameters" : @[@[[UserInfo shareInstance].reseller.shop.uuid]],
@"operation" : @"shop uuid equals"}, @"operation" : @"shop uuid equals"},
@{@"parameters" : @[self.searchText], @{@"parameters" : @[self.searchText],
@"operation" : self.condition}], @"operation" : self.condition}],
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
@{@"operation" : @"createInfo.time between", @{@"operation" : @"createInfo.time between",
@"parameters" : @[self.customerCreateDate, [NSNull null]]}, @"parameters" : @[self.customerCreateDate, [NSNull null]]},
@{@"operation" : @"reseller uuid equals", @{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]} @"parameters" : @[[UserInfo shareInstance].reseller.uuid]}
, ,
@{@"operation" : @"consumer mobilephone equals", @{@"operation" : @"consumer mobilephone equals",
@"parameters" : @[_phoneNo]} @"parameters" : @[_phoneNo]}
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
@{@"operation" : @"createInfo.time between", @{@"operation" : @"createInfo.time between",
@"parameters" : @[self.customerCreateDate, [NSNull null]]}, @"parameters" : @[self.customerCreateDate, [NSNull null]]},
@{@"operation" : @"reseller uuid equals", @{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]} @"parameters" : @[[UserInfo shareInstance].reseller.uuid]}
], ],
@"orders" : @[@{@"field" : self.field, @"orders" : @[@{@"field" : self.field,
@"direction" : self.direction}], @"direction" : self.direction}],
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
NSDictionary *myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals", NSDictionary *myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameters" : @[kDomain]}, @"parameters" : @[kDomain]},
@{@"operation" : @"reseller uuid equals", @{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]}, @"parameters" : @[[UserInfo shareInstance].reseller.uuid]},
@{@"operation" : @"consumer uuid equals", @{@"operation" : @"consumer uuid equals",
@"parameters" : @[self.customer.consumer.uuid]}], @"parameters" : @[self.customer.consumer.uuid]}],
@"orders" : @[@{@"field" : @"createInfo.time", @"orders" : @[@{@"field" : @"createInfo.time",
......
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
[super viewWillAppear:animated]; [super viewWillAppear:animated];
WS(weakSelf) WS(weakSelf)
NSString *strGetResseller = [NSString stringWithFormat:@"commission/getAccount/%@", [UserInfo shareInstance].uuid]; NSString *strGetResseller = [NSString stringWithFormat:@"commission/getAccount/%@", [UserInfo shareInstance].reseller.uuid];
[[HTTPCilent shareCilent] GET:strGetResseller parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] GET:strGetResseller parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] isEqualToNumber:@0]) { if ([responseObject[@"code"] isEqualToNumber:@0]) {
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
- (void)setUpdata { - (void)setUpdata {
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"shop/get/%@", [UserInfo shareInstance].shop.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"shop/get/%@", [UserInfo shareInstance].reseller.shop.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
if (weakSelf.shopModel) { if (weakSelf.shopModel) {
[weakSelf.shopModel updateWithDictionary:responseObject[@"shop"]]; [weakSelf.shopModel updateWithDictionary:responseObject[@"shop"]];
}else{ }else{
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
} }
- (void)setUpWebView { - (void)setUpWebView {
NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/visit.html", [UserInfo shareInstance].webShopBaseUrl]; NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/visit.html", [UserInfo shareInstance].appConfig.webShopBaseUrl];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl] cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:10]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl] cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:10];
WKWebView *webView = [WKWebView new]; WKWebView *webView = [WKWebView new];
webView.navigationDelegate = self; webView.navigationDelegate = self;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
self.title = @"新营养部落分销政策概述"; self.title = @"新营养部落分销政策概述";
NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/abcShare.html", [UserInfo shareInstance].webShopBaseUrl]; NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/abcShare.html", [UserInfo shareInstance].appConfig.webShopBaseUrl];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl] cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:10]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl] cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:10];
WKWebView *webView = [WKWebView new]; WKWebView *webView = [WKWebView new];
......
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
@"direction" : self.direction}], @"direction" : self.direction}],
@"conditions" : @[@{@"parameters" : @[kDomain], @"conditions" : @[@{@"parameters" : @[kDomain],
@"operation" : @"domain equals"}, @"operation" : @"domain equals"},
@{@"parameters" : @[@[[UserInfo shareInstance].shop.uuid]], @{@"parameters" : @[@[[UserInfo shareInstance].reseller.shop.uuid]],
@"operation" : @"shop uuid equals"}, @"operation" : @"shop uuid equals"},
@{@"parameters" : @[@""], @{@"parameters" : @[@""],
@"operation" : self.condition}], @"operation" : self.condition}],
...@@ -299,9 +299,9 @@ ...@@ -299,9 +299,9 @@
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber], NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain, @"domain" : kDomain,
@"operator" : @{@"id" : [UserInfo shareInstance].uuid, @"operator" : @{@"id" : [UserInfo shareInstance].reseller.uuid,
@"fullName" : [UserInfo shareInstance].name}}, @"fullName" : [UserInfo shareInstance].reseller.name}},
@"shopUuid" : [UserInfo shareInstance].shop.uuid, @"shopUuid" : [UserInfo shareInstance].reseller.shop.uuid,
@"listGoodsUuid" : arrGoodsUuid}; @"listGoodsUuid" : arrGoodsUuid};
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] POST:questUrl parameters:params success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] POST:questUrl parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
- (void)setUpTotalData { - (void)setUpTotalData {
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"reseller/team/getTeamInfo/%@", [UserInfo shareInstance].uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"reseller/team/getTeamInfo/%@", [UserInfo shareInstance].reseller.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
NSNumber *teamNums = responseObject[@"memberCount"]; NSNumber *teamNums = responseObject[@"memberCount"];
NSNumber *bonus = responseObject[@"commissionTotal"]; NSNumber *bonus = responseObject[@"commissionTotal"];
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
NSDictionary *params = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"reseller uuid equals", NSDictionary *params = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]}, @"parameters" : @[[UserInfo shareInstance].reseller.uuid]},
@{@"operation" : @"domain equals", @{@"operation" : @"domain equals",
@"parameters" : @[kDomain]}], @"parameters" : @[kDomain]}],
@"orders" : @[@{@"direction" : @"desc", @"orders" : @[@{@"direction" : @"desc",
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 0; weakSelf.page = 0;
[MBProgressHUD showHUDAddedTo:kWindow animated:YES]; [MBProgressHUD showHUDAddedTo:kWindow animated:YES];
[weakSelf.arrDatas removeAllObjects];
[weakSelf setUpData]; [weakSelf setUpData];
}]; }];
...@@ -67,6 +66,7 @@ ...@@ -67,6 +66,7 @@
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"order/query" parameters:[self getParams] success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] POST:@"order/query" parameters:[self getParams] success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:kWindow]; [MBProgressHUD hideHUDForView:kWindow];
[weakSelf.arrDatas removeAllObjects];
[weakSelf.tableView.mj_header endRefreshing]; [weakSelf.tableView.mj_header endRefreshing];
for (NSDictionary *dic in responseObject[@"queryResult"]) { for (NSDictionary *dic in responseObject[@"queryResult"]) {
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
} }
} failure:^(NSURLSessionDataTask *task, NSError *error) { } failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:kWindow];
[weakSelf.tableView.mj_header endRefreshing]; [weakSelf.tableView.mj_header endRefreshing];
[weakSelf.tableView.mj_footer endRefreshing]; [weakSelf.tableView.mj_footer endRefreshing];
}]; }];
...@@ -104,18 +105,38 @@ ...@@ -104,18 +105,38 @@
orderState = [NSNull null]; orderState = [NSNull null];
} }
NSDictionary *myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals", NSDictionary *myDictionary;
@"parameters" : @[kDomain]}, if ([self.orderTag isEqualToString:@"待支付"]) {
@{@"operation" : @"reseller uuid equals", myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameters" : @[[UserInfo shareInstance].uuid]}, @"parameters" : @[kDomain]},
@{@"operation" : @"order state equals", @{@"operation" : @"reseller uuid equals",
@"parameters" : @[orderState]}], @"parameters" : @[[UserInfo shareInstance].reseller.uuid]},
@"orders" : @[@{@"field" : @"createInfo.time", @{@"operation" : @"my unpay order",
@"direction" : @"desc"}], @"parameters" : @[[UserInfo shareInstance].consumer.uuid]},
@"pageSize" : @(kPageSize), @{@"operation" : @"order state equals",
@"page" : @(self.page), @"parameters" : @[orderState]}],
@"probePages" : @0}, @"orders" : @[@{@"field" : @"createInfo.time",
@"fetchParts" : @[@"string"]}; @"direction" : @"desc"}],
@"pageSize" : @(kPageSize),
@"page" : @(self.page),
@"probePages" : @0},
@"fetchParts" : @[@"string"]};
}else{
myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameters" : @[kDomain]},
@{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].reseller.uuid]},
@{@"operation" : @"order state equals",
@"parameters" : @[orderState]}],
@"orders" : @[@{@"field" : @"createInfo.time",
@"direction" : @"desc"}],
@"pageSize" : @(kPageSize),
@"page" : @(self.page),
@"probePages" : @0},
@"fetchParts" : @[@"string"]};
}
return myDictionary; return myDictionary;
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
[super viewDidLoad]; [super viewDidLoad];
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64)]; WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64)];
UserInfo *user = [UserInfo shareInstance]; UserInfo *user = [UserInfo shareInstance];
NSString *url = [NSString stringWithFormat:@"%@Wap/orderDetail/id/%@/shop_id/%@/mobile/%@.html",user.webShopBaseUrl,self.model.billNumber,self.model.shop.uuid,user.mobilephone]; NSString *url = [NSString stringWithFormat:@"%@Wap/orderDetail/id/%@/shop_id/%@/mobile/%@.html",user.appConfig.webShopBaseUrl,self.model.billNumber,self.model.shop.uuid,user.reseller.mobilephone];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]]; [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
self.webView = webView; self.webView = webView;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
UserInfo *userInfo = [UserInfo shareInstance]; UserInfo *userInfo = [UserInfo shareInstance];
NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/index_shop/shop_id/%@/mobile/%@.html", userInfo.webShopBaseUrl, userInfo.shop.uuid, userInfo.mobilephone]; NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/index_shop/shop_id/%@/mobile/%@.html", userInfo.appConfig.webShopBaseUrl, userInfo.reseller.shop.uuid, userInfo.reseller.mobilephone];
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64)]; WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64)];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl]]]; [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl]]];
self.webView = webView; self.webView = webView;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
[super viewDidLoad]; [super viewDidLoad];
self.buttonBac.imageView.contentMode = UIViewContentModeScaleAspectFit; self.buttonBac.imageView.contentMode = UIViewContentModeScaleAspectFit;
UserInfo *userInfo = [UserInfo shareInstance]; UserInfo *userInfo = [UserInfo shareInstance];
self.urlStr = [NSString stringWithFormat:@"%@Wap/index_shop/shop_id/%@.html", userInfo.webShopBaseUrl, userInfo.shop.uuid]; self.urlStr = [NSString stringWithFormat:@"%@Wap/index_shop/shop_id/%@.html", userInfo.appConfig.webShopBaseUrl, userInfo.reseller.shop.uuid];
// Do any additional setup after loading the view from its nib. // Do any additional setup after loading the view from its nib.
} }
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
- (void)setUpdata { - (void)setUpdata {
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"shop/get/%@", [UserInfo shareInstance].shop.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"shop/get/%@", [UserInfo shareInstance].reseller.shop.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
if (weakSelf.shopModel) { if (weakSelf.shopModel) {
[weakSelf.shopModel updateWithDictionary:responseObject[@"shop"]]; [weakSelf.shopModel updateWithDictionary:responseObject[@"shop"]];
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
- (NSDictionary *)getParamsWithImageUrl:(NSString *)imageUrl { - (NSDictionary *)getParamsWithImageUrl:(NSString *)imageUrl {
self.shopModel.pictures = [NSString stringWithFormat:@"http://o93sl2fym.bkt.clouddn.com/%@", imageUrl]; self.shopModel.pictures = [NSString stringWithFormat:@"http://o93sl2fym.bkt.clouddn.com/%@", imageUrl];
UserInfo *user = [UserInfo shareInstance]; UserInfoReseller *user = [UserInfo shareInstance].reseller;
NSDictionary *dicShop = [self.shopModel dictionaryRepresentation]; NSDictionary *dicShop = [self.shopModel dictionaryRepresentation];
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber], NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain, @"domain" : kDomain,
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber], NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain, @"domain" : kDomain,
@"operator" : @{@"id" : user.uuid, @"operator" : @{@"id" : user.reseller.uuid,
@"fullName" : user.name}}, @"fullName" : user.reseller.name}},
@"shop" : dicShop}; @"shop" : dicShop};
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
} }
- (IBAction)safeIntroductionAction:(id)sender { - (IBAction)safeIntroductionAction:(id)sender {
[self.view endEditing:YES]; [self.view endEditing:YES];
UserInfo *user = [UserInfo shareInstance]; UserInfoReseller *user = [UserInfo shareInstance].reseller;
self.shopModel.internalBaseClassDescription = self.textViewInstroduction.text; self.shopModel.internalBaseClassDescription = self.textViewInstroduction.text;
......
...@@ -68,10 +68,9 @@ ...@@ -68,10 +68,9 @@
if ([responseObject[@"code"] isEqualToNumber:@0]) { if ([responseObject[@"code"] isEqualToNumber:@0]) {
UserInfo *info = [UserInfo shareInstance]; UserInfo *info = [UserInfo shareInstance];
[info updateWithDictionary:responseObject[@"reseller"]]; [info updateModelObjectWithDictionary:responseObject];
info.webShopBaseUrl = responseObject[@"appConfig"][@"webShopBaseUrl"];
[MobClick profileSignInWithPUID:info.code]; [MobClick profileSignInWithPUID:info.reseller.code];
BaseViewController *baseVC = [[BaseViewController alloc] init]; BaseViewController *baseVC = [[BaseViewController alloc] init];
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[weakSelf presentViewController:baseVC animated:YES completion:nil]; [weakSelf presentViewController:baseVC animated:YES completion:nil];
......
...@@ -41,14 +41,13 @@ ...@@ -41,14 +41,13 @@
if ([responseObject[@"code"] isEqualToNumber:@0]) { if ([responseObject[@"code"] isEqualToNumber:@0]) {
UserInfo *info = [UserInfo shareInstance]; UserInfo *info = [UserInfo shareInstance];
[info updateWithDictionary:responseObject[@"reseller"]]; [info updateModelObjectWithDictionary:responseObject];
info.webShopBaseUrl = responseObject[@"appConfig"][@"webShopBaseUrl"];
[[NSUserDefaults standardUserDefaults] setObject:weakSelf.phoneNumberTextFiled.text forKey:@"userName"]; [[NSUserDefaults standardUserDefaults] setObject:weakSelf.phoneNumberTextFiled.text forKey:@"userName"];
[[NSUserDefaults standardUserDefaults] setObject:[weakSelf.passwordTextFiled.text MD5String] forKey:@"passWord"]; [[NSUserDefaults standardUserDefaults] setObject:[weakSelf.passwordTextFiled.text MD5String] forKey:@"passWord"];
[MobClick profileSignInWithPUID:info.code]; [MobClick profileSignInWithPUID:info.reseller.code];
BaseViewController *baseVC = [[BaseViewController alloc] init]; BaseViewController *baseVC = [[BaseViewController alloc] init];
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[weakSelf presentViewController:baseVC animated:YES completion:^{ [weakSelf presentViewController:baseVC animated:YES completion:^{
......
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
return; return;
} }
UserInfo *info = [UserInfo shareInstance]; UserInfoReseller *info = [UserInfo shareInstance].reseller;
[MBProgressHUD Javen_showMessage:@"修改中" onView:self.view]; [MBProgressHUD Javen_showMessage:@"修改中" onView:self.view];
NSDictionary *params = @{@"operCtx" : [info getOperCtx], NSDictionary *params = @{@"operCtx" : [[UserInfo shareInstance] getOperCtx],
@"uuid" : info.uuid, @"uuid" : info.uuid,
@"oldPassword" : [self.labelOldPassword.text MD5String], @"oldPassword" : [self.labelOldPassword.text MD5String],
@"newPassword" : [self.labelNewPassword.text MD5String], @"newPassword" : [self.labelNewPassword.text MD5String],
...@@ -80,8 +80,7 @@ ...@@ -80,8 +80,7 @@
if ([responseObject[@"code"] isEqualToNumber:@0]) { if ([responseObject[@"code"] isEqualToNumber:@0]) {
UserInfo *info = [UserInfo shareInstance]; UserInfo *info = [UserInfo shareInstance];
[info updateWithDictionary:responseObject[@"reseller"]]; [info updateModelObjectWithDictionary:responseObject];
info.webShopBaseUrl = responseObject[@"appConfig"][@"webShopBaseUrl"];
}else{ }else{
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
NSDictionary *reseller = [resellerModel dictionaryRepresentation]; NSDictionary *reseller = [resellerModel dictionaryRepresentation];
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber], NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain, @"domain" : kDomain,
@"operator" : @{@"id" : user.uuid, @"operator" : @{@"id" : user.reseller.uuid,
@"fullName" : user.name}}, @"fullName" : user.reseller.name}},
@"reseller" : reseller}; @"reseller" : reseller};
return params; return params;
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
- (void)setUpdata { - (void)setUpdata {
WS(weakSelf) WS(weakSelf)
NSString *strGetResseller = [NSString stringWithFormat:@"commission/getAccount/%@", [UserInfo shareInstance].uuid]; NSString *strGetResseller = [NSString stringWithFormat:@"commission/getAccount/%@", [UserInfo shareInstance].reseller.uuid];
[[HTTPCilent shareCilent] GET:strGetResseller parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] GET:strGetResseller parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] isEqualToNumber:@0]) { if ([responseObject[@"code"] isEqualToNumber:@0]) {
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
- (void)getReseller{ - (void)getReseller{
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"reseller/get/%@", [UserInfo shareInstance].uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"reseller/get/%@", [UserInfo shareInstance].reseller.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] isEqualToNumber:@0]) { if ([responseObject[@"code"] isEqualToNumber:@0]) {
weakSelf.reseller = [JavenResellerBigModel modelObjectWithDictionary:responseObject[@"reseller"]]; weakSelf.reseller = [JavenResellerBigModel modelObjectWithDictionary:responseObject[@"reseller"]];
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
self.title = @"帮助"; self.title = @"帮助";
NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/helpVisit.html", [UserInfo shareInstance].webShopBaseUrl]; NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/helpVisit.html", [UserInfo shareInstance].appConfig.webShopBaseUrl];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:inviteWebUrl]]; NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:inviteWebUrl]];
WKWebView *webView = [WKWebView new]; WKWebView *webView = [WKWebView new];
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
- (void)setUpdata { - (void)setUpdata {
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"commission/getAccount/%@", [UserInfo shareInstance].uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"commission/getAccount/%@", [UserInfo shareInstance].reseller.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
if (kIsResponseSuccess(responseObject)) { if (kIsResponseSuccess(responseObject)) {
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
} }
- (NSDictionary *)getParamsWithReseller:(JavenResellerBigModel *)resellerModel { - (NSDictionary *)getParamsWithReseller:(JavenResellerBigModel *)resellerModel {
UserInfo *user = [UserInfo shareInstance]; UserInfoReseller *user = [UserInfo shareInstance].reseller;
NSDictionary *reseller = [resellerModel dictionaryRepresentation]; NSDictionary *reseller = [resellerModel dictionaryRepresentation];
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber], NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain, @"domain" : kDomain,
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
} }
- (NSDictionary *)getParamsWithReseller:(JavenResellerBigModel *)resellerModel { - (NSDictionary *)getParamsWithReseller:(JavenResellerBigModel *)resellerModel {
UserInfo *user = [UserInfo shareInstance]; UserInfoReseller *user = [UserInfo shareInstance].reseller;
NSDictionary *reseller = [resellerModel dictionaryRepresentation]; NSDictionary *reseller = [resellerModel dictionaryRepresentation];
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber], NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain, @"domain" : kDomain,
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
- (void)getReseller{ - (void)getReseller{
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"reseller/get/%@", [UserInfo shareInstance].uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"reseller/get/%@", [UserInfo shareInstance].reseller.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] isEqualToNumber:@0]) { if ([responseObject[@"code"] isEqualToNumber:@0]) {
weakSelf.reseller = [JavenResellerBigModel modelObjectWithDictionary:responseObject[@"reseller"]]; weakSelf.reseller = [JavenResellerBigModel modelObjectWithDictionary:responseObject[@"reseller"]];
[weakSelf.tableView reloadData]; [weakSelf.tableView reloadData];
......
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
NSDictionary *myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals", NSDictionary *myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameters" : @[kDomain]}, @"parameters" : @[kDomain]},
@{@"operation" : @"reseller uuid equals", @{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]}, @"parameters" : @[[UserInfo shareInstance].reseller.uuid]},
@{@"operation" : @"action equals", @{@"operation" : @"action equals",
@"parameters" : self.state}, @"parameters" : self.state},
@{@"operation" : self.confirmed, @{@"operation" : self.confirmed,
......
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
} }
- (void)setDefaults { - (void)setDefaults {
if ([UserInfo shareInstance].mobilephone.length > 10) { if ([UserInfo shareInstance].reseller.mobilephone.length > 10) {
NSString *cutPhoneNumber = [[UserInfo shareInstance].mobilephone substringWithRange:NSMakeRange(7, 4)]; NSString *cutPhoneNumber = [[UserInfo shareInstance].reseller.mobilephone substringWithRange:NSMakeRange(7, 4)];
self.phoneNumber.text = [NSString stringWithFormat:@"手机号码(%@)", cutPhoneNumber]; self.phoneNumber.text = [NSString stringWithFormat:@"手机号码(%@)", cutPhoneNumber];
} }
self.title = @"设置"; self.title = @"设置";
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
//生成上传图片URL的参数 //生成上传图片URL的参数
- (NSDictionary *)getParamsWithReseller:(JavenResellerBigModel *)resellerModel { - (NSDictionary *)getParamsWithReseller:(JavenResellerBigModel *)resellerModel {
// resellerModel.ownerOrg = nil; // resellerModel.ownerOrg = nil;
UserInfo *user = [UserInfo shareInstance]; UserInfoReseller *user = [UserInfo shareInstance].reseller;
NSDictionary *reseller = [resellerModel dictionaryRepresentation]; NSDictionary *reseller = [resellerModel dictionaryRepresentation];
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber], NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain, @"domain" : kDomain,
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
- (void)setUpdata { - (void)setUpdata {
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"reseller/get/%@", [UserInfo shareInstance].uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"reseller/get/%@", [UserInfo shareInstance].reseller.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] isEqualToNumber:@0]) { if ([responseObject[@"code"] isEqualToNumber:@0]) {
weakSelf.reseller = [JavenResellerBigModel modelObjectWithDictionary:responseObject[@"reseller"]]; weakSelf.reseller = [JavenResellerBigModel modelObjectWithDictionary:responseObject[@"reseller"]];
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
self.isShowNavigationBar = NO; self.isShowNavigationBar = NO;
UserInfo *userInfo = [UserInfo shareInstance]; UserInfo *userInfo = [UserInfo shareInstance];
NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/index_shop/shop_id/%@/mobile/%@.html", userInfo.webShopBaseUrl, userInfo.shop.uuid, userInfo.mobilephone]; NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/index_shop/shop_id/%@/mobile/%@.html", userInfo.appConfig.webShopBaseUrl, userInfo.reseller.shop.uuid, userInfo.reseller.mobilephone];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl] cachePolicy:(NSURLRequestReloadRevalidatingCacheData) timeoutInterval:10.0f]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl] cachePolicy:(NSURLRequestReloadRevalidatingCacheData) timeoutInterval:10.0f];
UIWebView *webView = [UIWebView new]; UIWebView *webView = [UIWebView new];
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{ {
CLog(@"POST success!-------->\n%@", [parameters mj_JSONString]);
[self.manager POST:URLString parameters:parameters progress:^(NSProgress * _Nonnull uploadProgress) { [self.manager POST:URLString parameters:parameters progress:^(NSProgress * _Nonnull uploadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
+ (void)startCustomerServices:(UIViewController *)vc { + (void)startCustomerServices:(UIViewController *)vc {
//企业编号,必填 //企业编号,必填
UserInfo *resellerInfo = [UserInfo shareInstance]; UserInfoReseller *resellerInfo = [UserInfo shareInstance].reseller;
NSString *sysNumber=@"1e5947ae875f4a11af054f153c9422ee"; NSString *sysNumber=@"1e5947ae875f4a11af054f153c9422ee";
......
...@@ -107,7 +107,8 @@ ...@@ -107,7 +107,8 @@
/** 邀请合伙人 */ /** 邀请合伙人 */
- (void)invitePartner - (void)invitePartner
{ {
NSString *urlStr = [NSString stringWithFormat:@"%@ShopUser/gpregister/invitationCode/%@.html", [UserInfo shareInstance].webShopBaseUrl, [UserInfo shareInstance].invitationCode];
NSString *urlStr = [NSString stringWithFormat:@"%@ShopUser/gpregister/invitationCode/%@.html", [UserInfo shareInstance].appConfig.webShopBaseUrl, [UserInfo shareInstance].reseller.invitationCode];
[self showWithTitle:@"欢迎加入新营养部落,一起共创健康未来。" content:@"在新营养部落开店,享受自由健康生活,免费游览欧洲北美。" url:urlStr image:[UIImage appIcon]]; [self showWithTitle:@"欢迎加入新营养部落,一起共创健康未来。" content:@"在新营养部落开店,享受自由健康生活,免费游览欧洲北美。" url:urlStr image:[UIImage appIcon]];
} }
...@@ -122,7 +123,7 @@ ...@@ -122,7 +123,7 @@
if (kIsResponseSuccess(responseObject)) { if (kIsResponseSuccess(responseObject)) {
NSString *description = responseObject[@"goodsBrand"][@"description"]; NSString *description = responseObject[@"goodsBrand"][@"description"];
NSString *url = [NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/0/.html", [UserInfo shareInstance].webShopBaseUrl, [UserInfo shareInstance].shop.uuid, model.uuid]; NSString *url = [NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/0/.html", [UserInfo shareInstance].appConfig.webShopBaseUrl, [UserInfo shareInstance].reseller.shop.uuid, model.uuid];
if (description && description.length > 0 && model.name.length > 0) if (description && description.length > 0 && model.name.length > 0)
{ {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#import "UserInfoBaseClass.h" #import "UserInfoBaseClass.h"
#import "JavenShopModel.h" #import "JavenShopModel.h"
@interface UserInfo : UserInfoBaseClass @interface UserInfo : UserInfoBaseClass
@property (nonatomic, copy) NSString *webShopBaseUrl;
+ (UserInfo *)shareInstance; + (UserInfo *)shareInstance;
- (NSDictionary *)getOperCtx; - (NSDictionary *)getOperCtx;
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
- (NSDictionary *)getOperCtx - (NSDictionary *)getOperCtx
{ {
NSDictionary *dic = @{@"time" : [[NSDate date] timeStampNumber], NSDictionary *dic = @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : self.domain, @"domain" : self.reseller.domain,
@"operator" : @{@"id" : [UserInfo shareInstance].uuid, @"operator" : @{@"id" : [UserInfo shareInstance].reseller.uuid,
@"fullName" : [UserInfo shareInstance].name}}; @"fullName" : [UserInfo shareInstance].reseller.name}};
return dic; return dic;
} }
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
{ {
NSDictionary *myDictionary = @{@"operCtx" : @{@"time" : @0, NSDictionary *myDictionary = @{@"operCtx" : @{@"time" : @0,
@"domain" : @"string", @"domain" : @"string",
@"operator" : @{@"id" : [UserInfo shareInstance].uuid, @"operator" : @{@"id" : [UserInfo shareInstance].reseller.uuid,
@"fullName" : [UserInfo shareInstance].name}}, @"fullName" : [UserInfo shareInstance].reseller.name}},
@"goodsUuid" : uuid, @"goodsUuid" : uuid,
@"shopUuid" : [UserInfo shareInstance].shop.uuid}; @"shopUuid" : [UserInfo shareInstance].reseller.shop.uuid};
[[HTTPCilent shareCilent] POST:@"shop/shopGoodsExists" parameters:myDictionary success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] POST:@"shop/shopGoodsExists" parameters:myDictionary success:^(NSURLSessionDataTask *task, id responseObject) {
......
//
// UserInfoAppConfig.h
//
// Created by 杰 张 on 16/7/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UserInfoAppConfig : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *webShopBaseUrl;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// UserInfoAppConfig.m
//
// Created by 杰 张 on 16/7/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoAppConfig.h"
NSString *const kUserInfoAppConfigWebShopBaseUrl = @"webShopBaseUrl";
@interface UserInfoAppConfig ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation UserInfoAppConfig
@synthesize webShopBaseUrl = _webShopBaseUrl;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.webShopBaseUrl = [self objectOrNilForKey:kUserInfoAppConfigWebShopBaseUrl fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.webShopBaseUrl forKey:kUserInfoAppConfigWebShopBaseUrl];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.webShopBaseUrl = [aDecoder decodeObjectForKey:kUserInfoAppConfigWebShopBaseUrl];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_webShopBaseUrl forKey:kUserInfoAppConfigWebShopBaseUrl];
}
- (id)copyWithZone:(NSZone *)zone
{
UserInfoAppConfig *copy = [[UserInfoAppConfig alloc] init];
if (copy) {
copy.webShopBaseUrl = [self.webShopBaseUrl copyWithZone:zone];
}
return copy;
}
@end
// //
// UserInfoBaseClass.h // UserInfoBaseClass.h
// //
// Created by Z on 16/5/11 // Created by 杰 张 on 16/7/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved. // Copyright (c) 2016 __MyCompanyName__. All rights reserved.
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "UserInfoOwnerOrg.h" #import "UserInfoBaseClass.h"
#import "UserInfoLastModifyInfo.h" #import "UserInfoConsumer.h"
#import "UserInfoSocialContact.h" #import "UserInfoShop.h"
#import "UserInfoCertificate.h"
#import "UserInfoPasswordControl.h" #import "UserInfoPasswordControl.h"
#import "UserInfoRoles.h" #import "UserInfoBankCards.h"
#import "UserInfoPostalAddresses.h" #import "UserInfoLastModifyInfo.h"
#import "UserInfoReseller.h"
#import "UserInfoIdCard.h" #import "UserInfoIdCard.h"
#import "UserInfoReferrer.h" #import "UserInfoCertificate.h"
#import "UserInfoShop.h" #import "UserInfoOperator.h"
#import "UserInfoCreateInfo.h" #import "UserInfoCreateInfo.h"
#import "UserInfoOwnerOrg.h"
#import "UserInfoAppConfig.h"
#import "UserInfoLoginControl.h" #import "UserInfoLoginControl.h"
@class UserInfoOwnerOrg, UserInfoLastModifyInfo, UserInfoSocialContact, UserInfoCertificate, UserInfoPasswordControl, UserInfoPostalAddresses, UserInfoIdCard, UserInfoReferrer, UserInfoShop, UserInfoCreateInfo, UserInfoLoginControl;
@interface UserInfoBaseClass : NSObject <NSCoding, NSCopying> @interface UserInfoBaseClass : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) double birthday; @property (nonatomic, assign) double code;
@property (nonatomic, strong) NSString *portrait; @property (nonatomic, strong) NSString *message;
@property (nonatomic, strong) UserInfoOwnerOrg *ownerOrg; @property (nonatomic, strong) NSString *sessionId;
@property (nonatomic, strong) NSString *code; @property (nonatomic, strong) UserInfoAppConfig *appConfig;
@property (nonatomic, strong) NSString *telephone; @property (nonatomic, strong) UserInfoConsumer *consumer;
@property (nonatomic, strong) NSString *mobilephone; @property (nonatomic, strong) UserInfoReseller *reseller;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) UserInfoLastModifyInfo *lastModifyInfo;
@property (nonatomic, strong) UserInfoSocialContact *socialContact;
@property (nonatomic, strong) UserInfoCertificate *certificate;
@property (nonatomic, assign) double version;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *invitationCode;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) UserInfoPasswordControl *passwordControl;
@property (nonatomic, strong) NSString *gender;
@property (nonatomic, strong) NSArray *roles;
@property (nonatomic, strong) UserInfoPostalAddresses *postalAddresses;
@property (nonatomic, strong) UserInfoIdCard *idCard;
@property (nonatomic, strong) UserInfoReferrer *referrer;
@property (nonatomic, strong) UserInfoShop *shop;
@property (nonatomic, strong) UserInfoCreateInfo *createInfo;
@property (nonatomic, assign) double order;
@property (nonatomic, strong) UserInfoLoginControl *loginControl;
@property (nonatomic, strong) NSString *internalBaseClassDescription;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict; - (instancetype)initWithDictionary:(NSDictionary *)dict;
- (instancetype)updateWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation; - (NSDictionary *)dictionaryRepresentation;
- (instancetype)updateModelObjectWithDictionary:(NSDictionary *)dict;
@end @end
//
// UserInfoConsumer.h
//
// Created by 杰 张 on 16/7/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class UserInfoOwnerOrg, UserInfoLastModifyInfo, UserInfoPasswordControl, UserInfoCreateInfo, UserInfoLoginControl;
@interface UserInfoConsumer : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) id birthday;
@property (nonatomic, assign) id portrait;
@property (nonatomic, strong) UserInfoOwnerOrg *ownerOrg;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, assign) id telephone;
@property (nonatomic, strong) NSString *mobilephone;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) UserInfoLastModifyInfo *lastModifyInfo;
@property (nonatomic, assign) id socialContact;
@property (nonatomic, assign) double version;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) UserInfoPasswordControl *passwordControl;
@property (nonatomic, assign) id idCard;
@property (nonatomic, strong) NSString *gender;
@property (nonatomic, assign) id postalAddresses;
@property (nonatomic, strong) UserInfoCreateInfo *createInfo;
@property (nonatomic, assign) double order;
@property (nonatomic, strong) UserInfoLoginControl *loginControl;
@property (nonatomic, assign) id consumerDescription;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
This diff is collapsed.
// //
// UserInfoOwnerOrg.h // UserInfoOwnerOrg.h
// //
// Created by Z on 16/5/11 // Created by 杰 张 on 16/7/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved. // Copyright (c) 2016 __MyCompanyName__. All rights reserved.
// //
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
@interface UserInfoOwnerOrg : NSObject <NSCoding, NSCopying> @interface UserInfoOwnerOrg : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *code; @property (nonatomic, strong) NSString *code;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *extra;
@property (nonatomic, strong) NSString *uuid; @property (nonatomic, strong) NSString *uuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
......
// //
// UserInfoOwnerOrg.m // UserInfoOwnerOrg.m
// //
// Created by Z on 16/5/11 // Created by 杰 张 on 16/7/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved. // Copyright (c) 2016 __MyCompanyName__. All rights reserved.
// //
#import "UserInfoOwnerOrg.h" #import "UserInfoOwnerOrg.h"
NSString *const kUserInfoOwnerOrgName = @"name";
NSString *const kUserInfoOwnerOrgCode = @"code"; NSString *const kUserInfoOwnerOrgCode = @"code";
NSString *const kUserInfoOwnerOrgName = @"name";
NSString *const kUserInfoOwnerOrgExtra = @"extra";
NSString *const kUserInfoOwnerOrgUuid = @"uuid"; NSString *const kUserInfoOwnerOrgUuid = @"uuid";
...@@ -21,8 +22,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid"; ...@@ -21,8 +22,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
@implementation UserInfoOwnerOrg @implementation UserInfoOwnerOrg
@synthesize name = _name;
@synthesize code = _code; @synthesize code = _code;
@synthesize name = _name;
@synthesize extra = _extra;
@synthesize uuid = _uuid; @synthesize uuid = _uuid;
...@@ -38,8 +40,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid"; ...@@ -38,8 +40,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
// This check serves to make sure that a non-NSDictionary object // This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing. // passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) { if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.name = [self objectOrNilForKey:kUserInfoOwnerOrgName fromDictionary:dict];
self.code = [self objectOrNilForKey:kUserInfoOwnerOrgCode fromDictionary:dict]; self.code = [self objectOrNilForKey:kUserInfoOwnerOrgCode fromDictionary:dict];
self.name = [self objectOrNilForKey:kUserInfoOwnerOrgName fromDictionary:dict];
self.extra = [self objectOrNilForKey:kUserInfoOwnerOrgExtra fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kUserInfoOwnerOrgUuid fromDictionary:dict]; self.uuid = [self objectOrNilForKey:kUserInfoOwnerOrgUuid fromDictionary:dict];
} }
...@@ -51,8 +54,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid"; ...@@ -51,8 +54,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
- (NSDictionary *)dictionaryRepresentation - (NSDictionary *)dictionaryRepresentation
{ {
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.name forKey:kUserInfoOwnerOrgName];
[mutableDict setValue:self.code forKey:kUserInfoOwnerOrgCode]; [mutableDict setValue:self.code forKey:kUserInfoOwnerOrgCode];
[mutableDict setValue:self.name forKey:kUserInfoOwnerOrgName];
[mutableDict setValue:self.extra forKey:kUserInfoOwnerOrgExtra];
[mutableDict setValue:self.uuid forKey:kUserInfoOwnerOrgUuid]; [mutableDict setValue:self.uuid forKey:kUserInfoOwnerOrgUuid];
return [NSDictionary dictionaryWithDictionary:mutableDict]; return [NSDictionary dictionaryWithDictionary:mutableDict];
...@@ -77,8 +81,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid"; ...@@ -77,8 +81,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
{ {
self = [super init]; self = [super init];
self.name = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgName];
self.code = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgCode]; self.code = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgCode];
self.name = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgName];
self.extra = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgExtra];
self.uuid = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgUuid]; self.uuid = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgUuid];
return self; return self;
} }
...@@ -86,8 +91,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid"; ...@@ -86,8 +91,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
- (void)encodeWithCoder:(NSCoder *)aCoder - (void)encodeWithCoder:(NSCoder *)aCoder
{ {
[aCoder encodeObject:_name forKey:kUserInfoOwnerOrgName];
[aCoder encodeObject:_code forKey:kUserInfoOwnerOrgCode]; [aCoder encodeObject:_code forKey:kUserInfoOwnerOrgCode];
[aCoder encodeObject:_name forKey:kUserInfoOwnerOrgName];
[aCoder encodeObject:_extra forKey:kUserInfoOwnerOrgExtra];
[aCoder encodeObject:_uuid forKey:kUserInfoOwnerOrgUuid]; [aCoder encodeObject:_uuid forKey:kUserInfoOwnerOrgUuid];
} }
...@@ -97,8 +103,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid"; ...@@ -97,8 +103,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
if (copy) { if (copy) {
copy.name = [self.name copyWithZone:zone];
copy.code = [self.code copyWithZone:zone]; copy.code = [self.code copyWithZone:zone];
copy.name = [self.name copyWithZone:zone];
copy.extra = [self.extra copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone]; copy.uuid = [self.uuid copyWithZone:zone];
} }
......
//
// UserInfoReseller.h
//
// Created by 杰 张 on 16/7/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class UserInfoOwnerOrg, UserInfoLastModifyInfo, UserInfoCertificate, UserInfoPasswordControl, UserInfoIdCard, UserInfoShop, UserInfoCreateInfo, UserInfoLoginControl;
@interface UserInfoReseller : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *birthday;
@property (nonatomic, strong) NSString *portrait;
@property (nonatomic, strong) UserInfoOwnerOrg *ownerOrg;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, assign) id telephone;
@property (nonatomic, strong) NSString *mobilephone;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) UserInfoLastModifyInfo *lastModifyInfo;
@property (nonatomic, assign) id socialContact;
@property (nonatomic, strong) UserInfoCertificate *certificate;
@property (nonatomic, assign) double version;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *invitationCode;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) UserInfoPasswordControl *passwordControl;
@property (nonatomic, strong) NSString *gender;
@property (nonatomic, assign) id referrer;
@property (nonatomic, assign) id postalAddresses;
@property (nonatomic, strong) UserInfoIdCard *idCard;
@property (nonatomic, strong) UserInfoShop *shop;
@property (nonatomic, strong) UserInfoCreateInfo *createInfo;
@property (nonatomic, assign) double order;
@property (nonatomic, strong) UserInfoLoginControl *loginControl;
@property (nonatomic, strong) NSString *resellerDescription;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
This diff is collapsed.
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