Commit f97a7c29 authored by 曹云霄's avatar 曹云霄

OSS附件上传测试完成

parent d9083b55
...@@ -82,6 +82,11 @@ ...@@ -82,6 +82,11 @@
self.topView.viewModel = self.viewModel; self.topView.viewModel = self.viewModel;
//根据当前单据状态显示底部按钮 //根据当前单据状态显示底部按钮
[self.tableView reloadData]; [self.tableView reloadData];
dispatch_async(dispatch_get_main_queue(), ^{
NSMutableArray *arrIndexs = [self.viewModel closeAll];
[self.tableView deleteRowsAtIndexPaths:arrIndexs withRowAnimation:UITableViewRowAnimationFade];
});
//进行中的单据才显示保存按钮 //进行中的单据才显示保存按钮
if (self.viewModel.state.type == PatrolExamStateProcessing) { if (self.viewModel.state.type == PatrolExamStateProcessing) {
UIBarButtonItem *save = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStyleDone target:self action:@selector(actionSave)]; UIBarButtonItem *save = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStyleDone target:self action:@selector(actionSave)];
...@@ -114,11 +119,6 @@ ...@@ -114,11 +119,6 @@
} failure:^(id errorValue) { } failure:^(id errorValue) {
[IBTLoadingView showTextOnly:errorValue]; [IBTLoadingView showTextOnly:errorValue];
}]; }];
}else {
dispatch_async(dispatch_get_main_queue(), ^{
NSMutableArray *arrIndexs = [self.viewModel closeAll];
[self.tableView deleteRowsAtIndexPaths:arrIndexs withRowAnimation:UITableViewRowAnimationFade];
});
}; };
//统一刷新 //统一刷新
self.viewModel.blockReloadData = ^{ self.viewModel.blockReloadData = ^{
......
...@@ -141,22 +141,18 @@ ...@@ -141,22 +141,18 @@
NSString *nsRegisterCode = self.m_containerView.m_cCodeTextF.text; NSString *nsRegisterCode = self.m_containerView.m_cCodeTextF.text;
NSString *nsUserName = self.m_containerView.m_userNameTextF.text; NSString *nsUserName = self.m_containerView.m_userNameTextF.text;
NSString *nsPassword = self.m_containerView.m_passwordTextF.text; NSString *nsPassword = self.m_containerView.m_passwordTextF.text;
WS(weakSelf);
void (^succ)(id) = ^(id data) { void (^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil]; [IBTLoadingView hideHUDWithText:nil];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance]; ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
userUtil.bAutoLogin = @([_m_containerView isAutoLogin]); userUtil.bAutoLogin = @([_m_containerView isAutoLogin]);
[userUtil saveArchive]; [userUtil saveArchive];
ICRAppViewControllerManager *mgr = [ICRAppViewControllerManager getAppViewControllerManager]; ICRAppViewControllerManager *mgr = [ICRAppViewControllerManager getAppViewControllerManager];
[mgr openMainFrame]; [mgr openMainFrame];
//极光别名 //极光别名
NSSet *setTags = [NSSet setWithArray:@[ @"" ]]; NSSet *setTags = [NSSet setWithArray:@[ @"" ]];
[APService setTags:setTags alias:userUtil.f_user_uuid callbackSelector:nil object:nil]; [APService setTags:setTags alias:userUtil.f_user_uuid callbackSelector:nil object:nil];
[weakSelf getAppOption];
}; };
void (^fail)(id) = ^(NSError *data) { void (^fail)(id) = ^(NSError *data) {
...@@ -167,42 +163,39 @@ ...@@ -167,42 +163,39 @@
[httpCtrl doLoginWithUserName:nsUserName password:nsPassword registerCode:nsRegisterCode success:succ failure:fail]; [httpCtrl doLoginWithUserName:nsUserName password:nsPassword registerCode:nsRegisterCode success:succ failure:fail];
} }
///** /**
// *在地图View将要启动定位时,会调用此函数 获取App配置项
// *@param mapView 地图View */
// */ - (void)getAppOption
//- (void)willStartLocatingUser {
//{
// NSLog(@"start locate"); NSString *string = @"{\"accessKey\":\"LTAIiRWdyPrLTinG\",\"secretKey\":\"nWBZDNaGf6CWL8FhQt0eJB8Y0xpUOd\",\"endPoint\":\"oss-cn-shanghai.aliyuncs.com\",\"bucketName\":\"total-gomore\", \"region\":\"oss-cn-shanghai\",\"imgEndpoint\":\"total-gomore.img-cn-shanghai.aliyuncs.com\", \"width\":\"200\", \"height\":\"200\"}";
//
//} AccountConfigModel_uploadType *uploadType = [[AccountConfigModel_uploadType alloc] initWithString:string error:nil];
//- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation if ([uploadType.ossType isEqualToString:@"COS"]) {
//{ uploadType.type = @"COS";
// NSLog(@"didUpdateUserLocation lat %f,long %f",userLocation.location.coordinate.latitude,userLocation.location.coordinate.longitude); }else {
// self.coordinateX = userLocation.location.coordinate.latitude; uploadType.type = @"OSS";
// self.coordinateY = userLocation.location.coordinate.longitude; }
// BMKReverseGeoCodeOption *reverseGeocodeSearchOption = [[BMKReverseGeoCodeOption alloc]init]; AccountConfigModel *configModel = [AccountConfigModel new];
// CLLocationCoordinate2D pt = (CLLocationCoordinate2D){_coordinateX, _coordinateY}; configModel.uploadType = uploadType;
// reverseGeocodeSearchOption.reverseGeoPoint = pt; kUser.configModel = configModel;
// BOOL flag = [_geocodesearch reverseGeoCode:reverseGeocodeSearchOption];
// if(flag) // [RequestManager request_OptionSuccess:^(id returnValue) {
// { // if ([[self class] verifyData:returnValue]) {
// // if (![[BaseViewModel formatData:returnValue] isKindOfClass:[NSNull class]]) {
// NSLog(@"反geo检索发送成功"); // AccountConfigModel *configModel = [[AccountConfigModel alloc] initWithDictionary:returnValue error:nil];
// } // [configModel analysisConfigModel];
// else // kUser.configModel = configModel;
// { // }
// NSLog(@"反geo检索发送失败"); // return;
// } // }
// // [IBTLoadingView showTextOnly:[BaseViewModel messageData:returnValue]];
// [self.locService stopUserLocationService]; // } failure:^(id errorValue) {
//} // [IBTLoadingView showTextOnly:errorValue];
//-(void) onGetReverseGeoCodeResult:(BMKGeoCodeSearch *)searcher result:(BMKReverseGeoCodeResult *)result errorCode:(BMKSearchErrorCode)error // }];
//{ }
// if (error == 0) {
// //CLog(@"%@%@",result.location,result.address);
// }
//}
#pragma mark - TextObserver #pragma mark - TextObserver
- (void)inputTextEditChanged:(NSNotification *)obj - (void)inputTextEditChanged:(NSNotification *)obj
{ {
......
...@@ -43,7 +43,9 @@ ...@@ -43,7 +43,9 @@
self.storeType = storeType; self.storeType = storeType;
//是否启用OSS //是否启用OSS
}else if ([item.optionKey isEqualToString:@"enableoss"]) { }else if ([item.optionKey isEqualToString:@"enableoss"]) {
AccountConfigModel_uploadType *uploadType = [[AccountConfigModel_uploadType alloc] initWithString:item.optionValue error:nil]; NSString *string = @"{\"accessKey\":\"LTAIiRWdyPrLTinG\",\"secretKey\":\"nWBZDNaGf6CWL8FhQt0eJB8Y0xpUOd\",\"endPoint\":\"oss-cn-shanghai.aliyuncs.com\",\"bucketName\":\"total-gomore\", \"region\":\"oss-cn-shanghai\",\"imgEndpoint\":\"total-gomore.img-cn-shanghai.aliyuncs.com\", \"width\":\"200\", \"height\":\"200\"}";
AccountConfigModel_uploadType *uploadType = [[AccountConfigModel_uploadType alloc] initWithString:string error:nil];
if ([uploadType.ossType isEqualToString:@"COS"]) { if ([uploadType.ossType isEqualToString:@"COS"]) {
uploadType.type = @"COS"; uploadType.type = @"COS";
}else { }else {
......
...@@ -15,7 +15,7 @@ NSString *const SYSTIME = @"systime/time"; ...@@ -15,7 +15,7 @@ NSString *const SYSTIME = @"systime/time";
//登录 //登录
NSString *const LOGIN = @"user/login"; NSString *const LOGIN = @"user/login";
//第三方上传配置信息 //第三方上传配置信息
NSString *const UPLOADCONFIG = @"option/getall"; NSString *const UPLOADCONFIG = @"vipatrol/plan/option/getall";
//自检匹配门店坐标级别 //自检匹配门店坐标级别
NSString *const STORECOORDLEVEL = @"option/get/enableStoreLocationCheck"; NSString *const STORECOORDLEVEL = @"option/get/enableStoreLocationCheck";
//待办(首页) //待办(首页)
......
...@@ -117,7 +117,6 @@ ...@@ -117,7 +117,6 @@
[cameraViewController restoreFullScreenMode]; [cameraViewController restoreFullScreenMode];
[self.vc dismissViewControllerAnimated:YES completion:nil]; [self.vc dismissViewControllerAnimated:YES completion:nil];
if (self.viewModel.arrPics.count + 1 > self.viewModel.maxPictureNumber) { if (self.viewModel.arrPics.count + 1 > self.viewModel.maxPictureNumber) {
// ShowDefaultErrorView([NSString stringWithFormat:@"最多添加%ld张照片",self.viewModel.maxPictureNumber], nil);
[IBTLoadingView showTextOnly:[NSString stringWithFormat:@"最多添加%.0f张照片",self.viewModel.maxPictureNumber]]; [IBTLoadingView showTextOnly:[NSString stringWithFormat:@"最多添加%.0f张照片",self.viewModel.maxPictureNumber]];
return; return;
} }
......
...@@ -95,8 +95,8 @@ ...@@ -95,8 +95,8 @@
NSMutableArray *attachmentArray = [NSMutableArray array]; NSMutableArray *attachmentArray = [NSMutableArray array];
for (int i=0; i<array.count; i++) { for (int i=0; i<array.count; i++) {
PostAttachmentModel *attachmentModel = array[i]; PostAttachmentModel *attachmentModel = array[i];
kUser.configModel.uploadType.imagePath = [NSString stringWithFormat:@"%@/image/%@",kUser.f_enterprise_code,attachmentModel.entityType]; kUser.configModel.uploadType.imagePath = [NSString stringWithFormat:@"%@/image/%@",kUser.f_authenticode,attachmentModel.entityType];
kUser.configModel.uploadType.videoPath = [NSString stringWithFormat:@"%@/video/%@",kUser.f_enterprise_code,attachmentModel.entityType]; kUser.configModel.uploadType.videoPath = [NSString stringWithFormat:@"%@/video/%@",kUser.f_authenticode,attachmentModel.entityType];
switch (attachmentModel.attachmentType) { switch (attachmentModel.attachmentType) {
case ATTACHMENT_VIDEO: case ATTACHMENT_VIDEO:
{ {
......
...@@ -59,14 +59,25 @@ ...@@ -59,14 +59,25 @@
} }
+ (void)showProgressLabel:(NSString *)text { + (void)showProgressLabel:(NSString *)text {
IBTLoadingView *hud = [[self class] showHUDWithText:text inView:[[self class] hudShowWindow]]; if (![NSThread isMainThread]) {
hud.mode = MBProgressHUDModeIndeterminate; dispatch_async(dispatch_get_main_queue(), ^{
IBTLoadingView *hud = [[self class] showHUDWithText:text inView:[[self class] hudShowWindow]];
hud.mode = MBProgressHUDModeIndeterminate;
});
}else {
IBTLoadingView *hud = [[self class] showHUDWithText:text inView:[[self class] hudShowWindow]];
hud.mode = MBProgressHUDModeIndeterminate;
}
} }
+ (void)hideHUDWithText:(NSString *)text { + (void)hideHUDWithText:(NSString *)text {
if (![NSThread isMainThread]) {
[[self class] hideHUDForView:[[self class] hudShowWindow] withText:text]; dispatch_async(dispatch_get_main_queue(), ^{
[[self class] hideHUDForView:[[self class] hudShowWindow] withText:text];
});
}else {
[[self class] hideHUDForView:[[self class] hudShowWindow] withText:text];
}
} }
+ (void)showProgressLabel:(NSString *)text + (void)showProgressLabel:(NSString *)text
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "loding.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loding@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "loding@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -60,7 +60,7 @@ CGSizeMake((ScreenSize.width - 30) / 2.0, (ScreenSize.width - 120) / 2.0) ...@@ -60,7 +60,7 @@ CGSizeMake((ScreenSize.width - 30) / 2.0, (ScreenSize.width - 120) / 2.0)
/** /**
* 友好图片 * 友好图片
*/ */
#define KNODATAIMAGE TCImage(@"圆角矩形-3-副本") #define KNODATAIMAGE TCImage(@"loading")
/** /**
......
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