Commit 51667527 authored by Sandy's avatar Sandy

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

parent de8aac08
This diff is collapsed.
......@@ -63,6 +63,7 @@
<constraints>
<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 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="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"/>
......@@ -86,9 +87,10 @@
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="nN0-rt-cNW"/>
<exclude reference="CZW-j3-3fO"/>
<exclude reference="DRA-Wo-4yR"/>
<exclude reference="aSi-VQ-cSz"/>
<exclude reference="nN0-rt-cNW"/>
</mask>
</variation>
</view>
......@@ -229,7 +231,7 @@
<outlet property="labelState" destination="nyc-Bh-qZx" id="A7V-bB-9BO"/>
<outlet property="viewExpress" destination="9bs-ar-XXb" id="rCv-CW-UTd"/>
</connections>
<point key="canvasLocation" x="333" y="231"/>
<point key="canvasLocation" x="396" y="231"/>
</view>
</objects>
<resources>
......
......@@ -99,7 +99,7 @@
- (NSDictionary *)getGoodsParams
{
UserInfo *info = [UserInfo shareInstance];
UserInfoReseller *info = [UserInfo shareInstance].reseller;
NSDictionary *param = @{
@"operCtx": @{
......@@ -118,7 +118,7 @@
- (NSDictionary *)getRemoveGoodsParams
{
UserInfo *info = [UserInfo shareInstance];
UserInfoReseller *info = [UserInfo shareInstance].reseller;
NSDictionary *param = @{
@"operCtx": @{
......@@ -137,8 +137,8 @@
- (void)setUpWebView
{
UserInfo *userInfo = [UserInfo shareInstance];
NSString *urlStr = [NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/1/.html", userInfo.webShopBaseUrl, userInfo.shop.uuid, self.model.uuid];
UserInfoReseller *userInfo = [UserInfo shareInstance].reseller;
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)];
NSURL *url = [NSURL URLWithString:urlStr];
self.webView = webView;
......
......@@ -244,9 +244,9 @@
NSDictionary *params = @{@"defintion" : @{@"probePages" : @0,
@"orders" : @[@{@"field" : self.field,
@"direction" : self.direction}],
@"conditions" : @[@{@"parameters" : @[info.domain],
@"conditions" : @[@{@"parameters" : @[kDomain],
@"operation" : @"domain equals"},
@{@"parameters" : @[@[[UserInfo shareInstance].shop.uuid]],
@{@"parameters" : @[@[[UserInfo shareInstance].reseller.shop.uuid]],
@"operation" : @"shop uuid equals"},
@{@"parameters" : @[self.searchText],
@"operation" : self.condition}],
......
......@@ -104,7 +104,7 @@
@{@"operation" : @"createInfo.time between",
@"parameters" : @[self.customerCreateDate, [NSNull null]]},
@{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]}
@"parameters" : @[[UserInfo shareInstance].reseller.uuid]}
,
@{@"operation" : @"consumer mobilephone equals",
@"parameters" : @[_phoneNo]}
......@@ -121,7 +121,7 @@
@{@"operation" : @"createInfo.time between",
@"parameters" : @[self.customerCreateDate, [NSNull null]]},
@{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]}
@"parameters" : @[[UserInfo shareInstance].reseller.uuid]}
],
@"orders" : @[@{@"field" : self.field,
@"direction" : self.direction}],
......
......@@ -90,7 +90,7 @@
NSDictionary *myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameters" : @[kDomain]},
@{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]},
@"parameters" : @[[UserInfo shareInstance].reseller.uuid]},
@{@"operation" : @"consumer uuid equals",
@"parameters" : @[self.customer.consumer.uuid]}],
@"orders" : @[@{@"field" : @"createInfo.time",
......
......@@ -124,7 +124,7 @@
[super viewWillAppear:animated];
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) {
if ([responseObject[@"code"] isEqualToNumber:@0]) {
......
......@@ -34,7 +34,7 @@
- (void)setUpdata {
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) {
[weakSelf.shopModel updateWithDictionary:responseObject[@"shop"]];
}else{
......
......@@ -27,7 +27,7 @@
}
- (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];
WKWebView *webView = [WKWebView new];
webView.navigationDelegate = self;
......
......@@ -19,7 +19,7 @@
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];
WKWebView *webView = [WKWebView new];
......
......@@ -169,7 +169,7 @@
@"direction" : self.direction}],
@"conditions" : @[@{@"parameters" : @[kDomain],
@"operation" : @"domain equals"},
@{@"parameters" : @[@[[UserInfo shareInstance].shop.uuid]],
@{@"parameters" : @[@[[UserInfo shareInstance].reseller.shop.uuid]],
@"operation" : @"shop uuid equals"},
@{@"parameters" : @[@""],
@"operation" : self.condition}],
......@@ -299,9 +299,9 @@
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain,
@"operator" : @{@"id" : [UserInfo shareInstance].uuid,
@"fullName" : [UserInfo shareInstance].name}},
@"shopUuid" : [UserInfo shareInstance].shop.uuid,
@"operator" : @{@"id" : [UserInfo shareInstance].reseller.uuid,
@"fullName" : [UserInfo shareInstance].reseller.name}},
@"shopUuid" : [UserInfo shareInstance].reseller.shop.uuid,
@"listGoodsUuid" : arrGoodsUuid};
WS(weakSelf)
[[HTTPCilent shareCilent] POST:questUrl parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
......
......@@ -50,7 +50,7 @@
- (void)setUpTotalData {
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 *bonus = responseObject[@"commissionTotal"];
......@@ -67,7 +67,7 @@
NSDictionary *params = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]},
@"parameters" : @[[UserInfo shareInstance].reseller.uuid]},
@{@"operation" : @"domain equals",
@"parameters" : @[kDomain]}],
@"orders" : @[@{@"direction" : @"desc",
......
......@@ -43,7 +43,6 @@
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 0;
[MBProgressHUD showHUDAddedTo:kWindow animated:YES];
[weakSelf.arrDatas removeAllObjects];
[weakSelf setUpData];
}];
......@@ -67,6 +66,7 @@
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"order/query" parameters:[self getParams] success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:kWindow];
[weakSelf.arrDatas removeAllObjects];
[weakSelf.tableView.mj_header endRefreshing];
for (NSDictionary *dic in responseObject[@"queryResult"]) {
......@@ -87,6 +87,7 @@
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:kWindow];
[weakSelf.tableView.mj_header endRefreshing];
[weakSelf.tableView.mj_footer endRefreshing];
}];
......@@ -104,18 +105,38 @@
orderState = [NSNull null];
}
NSDictionary *myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameters" : @[kDomain]},
@{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]},
@{@"operation" : @"order state equals",
@"parameters" : @[orderState]}],
@"orders" : @[@{@"field" : @"createInfo.time",
@"direction" : @"desc"}],
@"pageSize" : @(kPageSize),
@"page" : @(self.page),
@"probePages" : @0},
@"fetchParts" : @[@"string"]};
NSDictionary *myDictionary;
if ([self.orderTag isEqualToString:@"待支付"]) {
myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameters" : @[kDomain]},
@{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].reseller.uuid]},
@{@"operation" : @"my unpay order",
@"parameters" : @[[UserInfo shareInstance].consumer.uuid]},
@{@"operation" : @"order state equals",
@"parameters" : @[orderState]}],
@"orders" : @[@{@"field" : @"createInfo.time",
@"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;
}
......
......@@ -20,7 +20,7 @@
[super viewDidLoad];
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64)];
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]]];
self.webView = webView;
......
......@@ -19,7 +19,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
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)];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl]]];
self.webView = webView;
......
......@@ -36,7 +36,7 @@
[super viewDidLoad];
self.buttonBac.imageView.contentMode = UIViewContentModeScaleAspectFit;
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.
}
......@@ -57,7 +57,7 @@
- (void)setUpdata {
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) {
[weakSelf.shopModel updateWithDictionary:responseObject[@"shop"]];
......@@ -191,7 +191,7 @@
- (NSDictionary *)getParamsWithImageUrl:(NSString *)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 *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain,
......
......@@ -38,8 +38,8 @@
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain,
@"operator" : @{@"id" : user.uuid,
@"fullName" : user.name}},
@"operator" : @{@"id" : user.reseller.uuid,
@"fullName" : user.reseller.name}},
@"shop" : dicShop};
......
......@@ -22,7 +22,7 @@
}
- (IBAction)safeIntroductionAction:(id)sender {
[self.view endEditing:YES];
UserInfo *user = [UserInfo shareInstance];
UserInfoReseller *user = [UserInfo shareInstance].reseller;
self.shopModel.internalBaseClassDescription = self.textViewInstroduction.text;
......
......@@ -68,10 +68,9 @@
if ([responseObject[@"code"] isEqualToNumber:@0]) {
UserInfo *info = [UserInfo shareInstance];
[info updateWithDictionary:responseObject[@"reseller"]];
info.webShopBaseUrl = responseObject[@"appConfig"][@"webShopBaseUrl"];
[info updateModelObjectWithDictionary:responseObject];
[MobClick profileSignInWithPUID:info.code];
[MobClick profileSignInWithPUID:info.reseller.code];
BaseViewController *baseVC = [[BaseViewController alloc] init];
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[weakSelf presentViewController:baseVC animated:YES completion:nil];
......
......@@ -41,14 +41,13 @@
if ([responseObject[@"code"] isEqualToNumber:@0]) {
UserInfo *info = [UserInfo shareInstance];
[info updateWithDictionary:responseObject[@"reseller"]];
info.webShopBaseUrl = responseObject[@"appConfig"][@"webShopBaseUrl"];
[info updateModelObjectWithDictionary:responseObject];
[[NSUserDefaults standardUserDefaults] setObject:weakSelf.phoneNumberTextFiled.text forKey:@"userName"];
[[NSUserDefaults standardUserDefaults] setObject:[weakSelf.passwordTextFiled.text MD5String] forKey:@"passWord"];
[MobClick profileSignInWithPUID:info.code];
[MobClick profileSignInWithPUID:info.reseller.code];
BaseViewController *baseVC = [[BaseViewController alloc] init];
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[weakSelf presentViewController:baseVC animated:YES completion:^{
......
......@@ -37,9 +37,9 @@
return;
}
UserInfo *info = [UserInfo shareInstance];
UserInfoReseller *info = [UserInfo shareInstance].reseller;
[MBProgressHUD Javen_showMessage:@"修改中" onView:self.view];
NSDictionary *params = @{@"operCtx" : [info getOperCtx],
NSDictionary *params = @{@"operCtx" : [[UserInfo shareInstance] getOperCtx],
@"uuid" : info.uuid,
@"oldPassword" : [self.labelOldPassword.text MD5String],
@"newPassword" : [self.labelNewPassword.text MD5String],
......@@ -80,8 +80,7 @@
if ([responseObject[@"code"] isEqualToNumber:@0]) {
UserInfo *info = [UserInfo shareInstance];
[info updateWithDictionary:responseObject[@"reseller"]];
info.webShopBaseUrl = responseObject[@"appConfig"][@"webShopBaseUrl"];
[info updateModelObjectWithDictionary:responseObject];
}else{
......
......@@ -42,8 +42,8 @@
NSDictionary *reseller = [resellerModel dictionaryRepresentation];
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain,
@"operator" : @{@"id" : user.uuid,
@"fullName" : user.name}},
@"operator" : @{@"id" : user.reseller.uuid,
@"fullName" : user.reseller.name}},
@"reseller" : reseller};
return params;
}
......
......@@ -41,7 +41,7 @@
- (void)setUpdata {
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) {
if ([responseObject[@"code"] isEqualToNumber:@0]) {
......@@ -108,7 +108,7 @@
- (void)getReseller{
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]) {
weakSelf.reseller = [JavenResellerBigModel modelObjectWithDictionary:responseObject[@"reseller"]];
......
......@@ -19,7 +19,7 @@
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]];
WKWebView *webView = [WKWebView new];
......
......@@ -44,7 +44,7 @@
- (void)setUpdata {
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)) {
......
......@@ -108,7 +108,7 @@
}
- (NSDictionary *)getParamsWithReseller:(JavenResellerBigModel *)resellerModel {
UserInfo *user = [UserInfo shareInstance];
UserInfoReseller *user = [UserInfo shareInstance].reseller;
NSDictionary *reseller = [resellerModel dictionaryRepresentation];
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain,
......
......@@ -102,7 +102,7 @@
}
- (NSDictionary *)getParamsWithReseller:(JavenResellerBigModel *)resellerModel {
UserInfo *user = [UserInfo shareInstance];
UserInfoReseller *user = [UserInfo shareInstance].reseller;
NSDictionary *reseller = [resellerModel dictionaryRepresentation];
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain,
......
......@@ -99,7 +99,7 @@
- (void)getReseller{
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]) {
weakSelf.reseller = [JavenResellerBigModel modelObjectWithDictionary:responseObject[@"reseller"]];
[weakSelf.tableView reloadData];
......
......@@ -221,7 +221,7 @@
NSDictionary *myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameters" : @[kDomain]},
@{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]},
@"parameters" : @[[UserInfo shareInstance].reseller.uuid]},
@{@"operation" : @"action equals",
@"parameters" : self.state},
@{@"operation" : self.confirmed,
......
......@@ -40,9 +40,9 @@
}
- (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.title = @"设置";
......@@ -210,7 +210,7 @@
//生成上传图片URL的参数
- (NSDictionary *)getParamsWithReseller:(JavenResellerBigModel *)resellerModel {
// resellerModel.ownerOrg = nil;
UserInfo *user = [UserInfo shareInstance];
UserInfoReseller *user = [UserInfo shareInstance].reseller;
NSDictionary *reseller = [resellerModel dictionaryRepresentation];
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : kDomain,
......@@ -260,7 +260,7 @@
- (void)setUpdata {
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]) {
weakSelf.reseller = [JavenResellerBigModel modelObjectWithDictionary:responseObject[@"reseller"]];
......
......@@ -19,7 +19,7 @@
self.isShowNavigationBar = NO;
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];
UIWebView *webView = [UIWebView new];
......
......@@ -41,6 +41,7 @@
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
CLog(@"POST success!-------->\n%@", [parameters mj_JSONString]);
[self.manager POST:URLString parameters:parameters progress:^(NSProgress * _Nonnull uploadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
......
......@@ -14,7 +14,7 @@
+ (void)startCustomerServices:(UIViewController *)vc {
//企业编号,必填
UserInfo *resellerInfo = [UserInfo shareInstance];
UserInfoReseller *resellerInfo = [UserInfo shareInstance].reseller;
NSString *sysNumber=@"1e5947ae875f4a11af054f153c9422ee";
......
......@@ -107,7 +107,8 @@
/** 邀请合伙人 */
- (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]];
}
......@@ -122,7 +123,7 @@
if (kIsResponseSuccess(responseObject)) {
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)
{
......
......@@ -9,7 +9,6 @@
#import "UserInfoBaseClass.h"
#import "JavenShopModel.h"
@interface UserInfo : UserInfoBaseClass
@property (nonatomic, copy) NSString *webShopBaseUrl;
+ (UserInfo *)shareInstance;
- (NSDictionary *)getOperCtx;
......
......@@ -23,9 +23,9 @@
- (NSDictionary *)getOperCtx
{
NSDictionary *dic = @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : self.domain,
@"operator" : @{@"id" : [UserInfo shareInstance].uuid,
@"fullName" : [UserInfo shareInstance].name}};
@"domain" : self.reseller.domain,
@"operator" : @{@"id" : [UserInfo shareInstance].reseller.uuid,
@"fullName" : [UserInfo shareInstance].reseller.name}};
return dic;
}
......@@ -34,10 +34,10 @@
{
NSDictionary *myDictionary = @{@"operCtx" : @{@"time" : @0,
@"domain" : @"string",
@"operator" : @{@"id" : [UserInfo shareInstance].uuid,
@"fullName" : [UserInfo shareInstance].name}},
@"operator" : @{@"id" : [UserInfo shareInstance].reseller.uuid,
@"fullName" : [UserInfo shareInstance].reseller.name}},
@"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) {
......
//
// 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
//
// Created by Z on 16/5/11
// Created by 杰 张 on 16/7/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "UserInfoOwnerOrg.h"
#import "UserInfoLastModifyInfo.h"
#import "UserInfoSocialContact.h"
#import "UserInfoCertificate.h"
#import "UserInfoBaseClass.h"
#import "UserInfoConsumer.h"
#import "UserInfoShop.h"
#import "UserInfoPasswordControl.h"
#import "UserInfoRoles.h"
#import "UserInfoPostalAddresses.h"
#import "UserInfoBankCards.h"
#import "UserInfoLastModifyInfo.h"
#import "UserInfoReseller.h"
#import "UserInfoIdCard.h"
#import "UserInfoReferrer.h"
#import "UserInfoShop.h"
#import "UserInfoCertificate.h"
#import "UserInfoOperator.h"
#import "UserInfoCreateInfo.h"
#import "UserInfoOwnerOrg.h"
#import "UserInfoAppConfig.h"
#import "UserInfoLoginControl.h"
@class UserInfoOwnerOrg, UserInfoLastModifyInfo, UserInfoSocialContact, UserInfoCertificate, UserInfoPasswordControl, UserInfoPostalAddresses, UserInfoIdCard, UserInfoReferrer, UserInfoShop, UserInfoCreateInfo, UserInfoLoginControl;
@interface UserInfoBaseClass : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) double birthday;
@property (nonatomic, strong) NSString *portrait;
@property (nonatomic, strong) UserInfoOwnerOrg *ownerOrg;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, strong) NSString *telephone;
@property (nonatomic, strong) NSString *mobilephone;
@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;
@property (nonatomic, assign) double code;
@property (nonatomic, strong) NSString *message;
@property (nonatomic, strong) NSString *sessionId;
@property (nonatomic, strong) UserInfoAppConfig *appConfig;
@property (nonatomic, strong) UserInfoConsumer *consumer;
@property (nonatomic, strong) UserInfoReseller *reseller;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (instancetype)updateWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
- (instancetype)updateModelObjectWithDictionary:(NSDictionary *)dict;
@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
//
// Created by Z on 16/5/11
// Created by 杰 张 on 16/7/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
......@@ -11,8 +11,9 @@
@interface UserInfoOwnerOrg : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *extra;
@property (nonatomic, strong) NSString *uuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
......
//
// UserInfoOwnerOrg.m
//
// Created by Z on 16/5/11
// Created by 杰 张 on 16/7/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoOwnerOrg.h"
NSString *const kUserInfoOwnerOrgName = @"name";
NSString *const kUserInfoOwnerOrgCode = @"code";
NSString *const kUserInfoOwnerOrgName = @"name";
NSString *const kUserInfoOwnerOrgExtra = @"extra";
NSString *const kUserInfoOwnerOrgUuid = @"uuid";
......@@ -21,8 +22,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
@implementation UserInfoOwnerOrg
@synthesize name = _name;
@synthesize code = _code;
@synthesize name = _name;
@synthesize extra = _extra;
@synthesize uuid = _uuid;
......@@ -38,8 +40,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
// 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.name = [self objectOrNilForKey:kUserInfoOwnerOrgName 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];
}
......@@ -51,8 +54,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.name forKey:kUserInfoOwnerOrgName];
[mutableDict setValue:self.code forKey:kUserInfoOwnerOrgCode];
[mutableDict setValue:self.name forKey:kUserInfoOwnerOrgName];
[mutableDict setValue:self.extra forKey:kUserInfoOwnerOrgExtra];
[mutableDict setValue:self.uuid forKey:kUserInfoOwnerOrgUuid];
return [NSDictionary dictionaryWithDictionary:mutableDict];
......@@ -77,8 +81,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
{
self = [super init];
self.name = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgName];
self.code = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgCode];
self.name = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgName];
self.extra = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgExtra];
self.uuid = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgUuid];
return self;
}
......@@ -86,8 +91,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_name forKey:kUserInfoOwnerOrgName];
[aCoder encodeObject:_code forKey:kUserInfoOwnerOrgCode];
[aCoder encodeObject:_name forKey:kUserInfoOwnerOrgName];
[aCoder encodeObject:_extra forKey:kUserInfoOwnerOrgExtra];
[aCoder encodeObject:_uuid forKey:kUserInfoOwnerOrgUuid];
}
......@@ -97,8 +103,9 @@ NSString *const kUserInfoOwnerOrgUuid = @"uuid";
if (copy) {
copy.name = [self.name 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];
}
......
//
// 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