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

OSS附件上传测试完成

parent d9083b55
......@@ -82,6 +82,11 @@
self.topView.viewModel = self.viewModel;
//根据当前单据状态显示底部按钮
[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) {
UIBarButtonItem *save = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStyleDone target:self action:@selector(actionSave)];
......@@ -114,11 +119,6 @@
} failure:^(id 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 = ^{
......
......@@ -141,22 +141,18 @@
NSString *nsRegisterCode = self.m_containerView.m_cCodeTextF.text;
NSString *nsUserName = self.m_containerView.m_userNameTextF.text;
NSString *nsPassword = self.m_containerView.m_passwordTextF.text;
WS(weakSelf);
void (^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
userUtil.bAutoLogin = @([_m_containerView isAutoLogin]);
[userUtil saveArchive];
ICRAppViewControllerManager *mgr = [ICRAppViewControllerManager getAppViewControllerManager];
[mgr openMainFrame];
//极光别名
NSSet *setTags = [NSSet setWithArray:@[ @"" ]];
[APService setTags:setTags alias:userUtil.f_user_uuid callbackSelector:nil object:nil];
[weakSelf getAppOption];
};
void (^fail)(id) = ^(NSError *data) {
......@@ -167,42 +163,39 @@
[httpCtrl doLoginWithUserName:nsUserName password:nsPassword registerCode:nsRegisterCode success:succ failure:fail];
}
///**
// *在地图View将要启动定位时,会调用此函数
// *@param mapView 地图View
// */
//- (void)willStartLocatingUser
//{
// NSLog(@"start locate");
//
//}
//- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
//{
// NSLog(@"didUpdateUserLocation lat %f,long %f",userLocation.location.coordinate.latitude,userLocation.location.coordinate.longitude);
// self.coordinateX = userLocation.location.coordinate.latitude;
// self.coordinateY = userLocation.location.coordinate.longitude;
// BMKReverseGeoCodeOption *reverseGeocodeSearchOption = [[BMKReverseGeoCodeOption alloc]init];
// CLLocationCoordinate2D pt = (CLLocationCoordinate2D){_coordinateX, _coordinateY};
// reverseGeocodeSearchOption.reverseGeoPoint = pt;
// BOOL flag = [_geocodesearch reverseGeoCode:reverseGeocodeSearchOption];
// if(flag)
// {
//
// NSLog(@"反geo检索发送成功");
// }
// else
// {
// NSLog(@"反geo检索发送失败");
// }
//
// [self.locService stopUserLocationService];
//}
//-(void) onGetReverseGeoCodeResult:(BMKGeoCodeSearch *)searcher result:(BMKReverseGeoCodeResult *)result errorCode:(BMKSearchErrorCode)error
//{
// if (error == 0) {
// //CLog(@"%@%@",result.location,result.address);
// }
//}
/**
获取App配置项
*/
- (void)getAppOption
{
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"]) {
uploadType.type = @"COS";
}else {
uploadType.type = @"OSS";
}
AccountConfigModel *configModel = [AccountConfigModel new];
configModel.uploadType = uploadType;
kUser.configModel = configModel;
// [RequestManager request_OptionSuccess:^(id returnValue) {
// if ([[self class] verifyData:returnValue]) {
// if (![[BaseViewModel formatData:returnValue] isKindOfClass:[NSNull class]]) {
// AccountConfigModel *configModel = [[AccountConfigModel alloc] initWithDictionary:returnValue error:nil];
// [configModel analysisConfigModel];
// kUser.configModel = configModel;
// }
// return;
// }
// [IBTLoadingView showTextOnly:[BaseViewModel messageData:returnValue]];
// } failure:^(id errorValue) {
// [IBTLoadingView showTextOnly:errorValue];
// }];
}
#pragma mark - TextObserver
- (void)inputTextEditChanged:(NSNotification *)obj
{
......
......@@ -43,7 +43,9 @@
self.storeType = storeType;
//是否启用OSS
}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"]) {
uploadType.type = @"COS";
}else {
......
......@@ -15,7 +15,7 @@ NSString *const SYSTIME = @"systime/time";
//登录
NSString *const LOGIN = @"user/login";
//第三方上传配置信息
NSString *const UPLOADCONFIG = @"option/getall";
NSString *const UPLOADCONFIG = @"vipatrol/plan/option/getall";
//自检匹配门店坐标级别
NSString *const STORECOORDLEVEL = @"option/get/enableStoreLocationCheck";
//待办(首页)
......
......@@ -117,7 +117,6 @@
[cameraViewController restoreFullScreenMode];
[self.vc dismissViewControllerAnimated:YES completion:nil];
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]];
return;
}
......
......@@ -95,8 +95,8 @@
NSMutableArray *attachmentArray = [NSMutableArray array];
for (int i=0; i<array.count; i++) {
PostAttachmentModel *attachmentModel = array[i];
kUser.configModel.uploadType.imagePath = [NSString stringWithFormat:@"%@/image/%@",kUser.f_enterprise_code,attachmentModel.entityType];
kUser.configModel.uploadType.videoPath = [NSString stringWithFormat:@"%@/video/%@",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_authenticode,attachmentModel.entityType];
switch (attachmentModel.attachmentType) {
case ATTACHMENT_VIDEO:
{
......
......@@ -59,14 +59,25 @@
}
+ (void)showProgressLabel:(NSString *)text {
IBTLoadingView *hud = [[self class] showHUDWithText:text inView:[[self class] hudShowWindow]];
hud.mode = MBProgressHUDModeIndeterminate;
if (![NSThread isMainThread]) {
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 {
[[self class] hideHUDForView:[[self class] hudShowWindow] withText:text];
if (![NSThread isMainThread]) {
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
......
{
"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)
/**
* 友好图片
*/
#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