Commit 320400d4 authored by 哈南's avatar 哈南

Merge branch 'master' of https://gitee.com/gomore/total

# Conflicts:
#	total/Info.plist
parents 849685d3 cc4a6ac8
......@@ -3582,7 +3582,7 @@
3506ECBD1BA00E3400897EBE = {
CreatedOnToolsVersion = 6.4;
DevelopmentTeam = W54V2VB863;
ProvisioningStyle = Automatic;
ProvisioningStyle = Manual;
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 1;
......@@ -4280,8 +4280,8 @@
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_ENTITLEMENTS = total/total.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer: jie zhang (9V9955H2BK)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = W54V2VB863;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -4298,8 +4298,8 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomoe.total;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE = "6191b2a0-c443-4299-bfd2-2107e96949af";
PROVISIONING_PROFILE_SPECIFIER = "Total Fabu";
SWIFT_OBJC_BRIDGING_HEADER = "total/total-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
......@@ -4316,8 +4316,8 @@
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_ENTITLEMENTS = total/total.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer: jie zhang (9V9955H2BK)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = W54V2VB863;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -4334,8 +4334,8 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomoe.total;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE = "6191b2a0-c443-4299-bfd2-2107e96949af";
PROVISIONING_PROFILE_SPECIFIER = "Total Fabu";
SWIFT_OBJC_BRIDGING_HEADER = "total/total-Bridging-Header.h";
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
......
......@@ -43,21 +43,20 @@
self.btnReference.hidden = cellModel.question.attachmentUrls.count == 0;
}
}
if (cellModel.viewModel.detail.temp) {
[self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg_red") forState:UIControlStateNormal];
[self.btnAtt setImage:TCImage(@"patrol_exam_camera_red") forState:UIControlStateNormal];
if (self.cellModel.answer.resultAttachments.count > 0) {
NSString *title = [NSString stringWithFormat:@"附件(%lu)",self.cellModel.answer.resultAttachments.count];
[self.btnAtt setTitle:title forState:UIControlStateNormal];
[self.btnAtt setTitleColor:ICR_TINTCOLOR forState:UIControlStateNormal];
[self.btnAtt setImage:TCImage(@"patrol_exam_camera") forState:UIControlStateNormal];
[self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg") forState:UIControlStateNormal];
}else {
[self.btnAtt setTitle:@"附件" forState:UIControlStateNormal];
[self.btnAtt setTitleColor:RGBA(227, 12, 53, 1) forState:UIControlStateNormal];
}
}else {
// if (cellModel.viewModel.detail.temp) {
// [self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg_red") forState:UIControlStateNormal];
// [self.btnAtt setImage:TCImage(@"patrol_exam_camera_red") forState:UIControlStateNormal];
// if (self.cellModel.answer.resultAttachments.count > 0) {
// NSString *title = [NSString stringWithFormat:@"附件(%lu)",self.cellModel.answer.resultAttachments.count];
// [self.btnAtt setTitle:title forState:UIControlStateNormal];
// [self.btnAtt setTitleColor:ICR_TINTCOLOR forState:UIControlStateNormal];
// [self.btnAtt setImage:TCImage(@"patrol_exam_camera") forState:UIControlStateNormal];
// [self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg") forState:UIControlStateNormal];
// }else {
// [self.btnAtt setTitle:@"附件" forState:UIControlStateNormal];
// [self.btnAtt setTitleColor:RGBA(227, 12, 53, 1) forState:UIControlStateNormal];
// }
// }else {
if (photoType(cellModel.question.photoType) != PHOTO_TYPE_NO) {
[self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg_red") forState:UIControlStateNormal];
[self.btnAtt setImage:TCImage(@"patrol_exam_camera_red") forState:UIControlStateNormal];
......@@ -85,7 +84,7 @@
[self.btnAtt setTitleColor:RGBA(128, 128, 128, 1) forState:UIControlStateNormal];
}
}
}
// }
}
- (IBAction)actionStandard:(UIButton *)sender {
......@@ -100,7 +99,6 @@
if (sender.isSelected && self.cellModel.viewModel.state.type != PatrolExamStateProcessing) {
return;
}
PatrolAttachmentViewController *attVC = [PatrolAttachmentViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_PATROLINSPECT];
attVC.cellModel = self.cellModel;
PicViewModel *picVM = [PicViewModel new];
......
......@@ -164,7 +164,7 @@
[self.cellModel.viewModel httpSubmitAnswerWithAction:(AnswerSubmitActionSave) complete:^(BOOL isSuccess) {
[IBTLoadingView hideHUDWithText:nil];
if (isSuccess) {
self.cellModel.viewModel.blockReHttp();
self.cellModel.viewModel.blockReHttp(self.cellModel.question);
[self popViewControllerAnimated:YES];
}else{
[IBTLoadingView showTextOnly:@"上传失败"];
......
......@@ -22,6 +22,8 @@
#import "BaseNavigationViewController.h"
#import "InspectionTableViewController.h"
#import "AirplaneModeViewController.h"
#import "ZJPatrolDetail.h"
@interface PatrolExamViewController () <UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet PatrolExamTopView *topView;
......@@ -74,7 +76,8 @@
[self.tableView registerClass:[PatrolExamStarCell class] forCellReuseIdentifier:@"PatrolExamStarCell"];
[self.btnSubmit setTitle:@"确认提交" forState:UIControlStateNormal];
@weakify(self);
self.viewModel.blockReHttp = ^{
//上传附件后刷新列表
[self.viewModel setBlockReHttp:^(ZJPatrolDetail_questions *question) {
@strongify(self);
//加载详情
[IBTLoadingView showProgressLabel:@"加载中"];
......@@ -85,8 +88,17 @@
//根据当前单据状态显示底部按钮
self.btnSubmit.hidden = self.viewModel.state.type != PatrolExamStateProcessing;
[self.tableView reloadData];
for (NSInteger i = 0; i < self.viewModel.arrCellData.count; i++) {
PatrolExamCellViewModel *vm = self.viewModel.arrCellData[i];
if ([vm.question.uuid isEqualToString:question.uuid]) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:(UITableViewScrollPositionMiddle) animated:NO];
break;
}
}
}];
};
}];
//状态是0,弹出开始答题提示
if (self.viewModel.state.type == PatrolExamStateUnStart) {
[RequestManager request_BeginPatrolPlanAnswer:self.viewModel.plan.uuid storeUuid:self.viewModel.storeResult.store_uuid selectedStoreUuid:@"" longtitude:kUser.longitude latitute:kUser.latitude success:^(id returnValue) {
......@@ -363,20 +375,17 @@
}
}
}
for (NSInteger i = 0; i < self.viewModel.arrCellData.count; i++) {
for (NSInteger i = 0; i <self.viewModel.arrCellData.count; i++) {
PatrolExamCellViewModel *vm = self.viewModel.arrCellData[i];
if (photoType(vm.question.photoType) != PHOTO_TYPE_NO) {
if ([questionArray containsObject:vm.question.uuid]) {
if ([questionArray containsObject:vm.question.uuid]) {
if (photoType(vm.question.photoType) != PHOTO_TYPE_NO) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:(UITableViewScrollPositionMiddle) animated:YES];
[IBTLoadingView showTextOnly:@"您有检查的项目未拍照"];
return;
}
}
}
if (questionArray.count) {
[IBTLoadingView showTextOnly:@"您有检查的项目未拍照"];
return;
}
}
@weakify(self);
NSMutableArray *answerArray = [NSMutableArray array];
......
......@@ -68,6 +68,7 @@ typedef NS_ENUM(NSInteger, ExamCellType) {
*/
@property (strong, nonatomic) NSString *category;
@property (weak, nonatomic) PatrolExamViewModel *viewModel;
@property (assign, nonatomic) NSInteger level;
......
......@@ -22,7 +22,7 @@ typedef NS_ENUM(NSInteger, AnswerSubmitAction) {
@property (strong, nonatomic) ZJPatrolDetail_results *result;
@property (nonatomic, copy) void (^blockReloadData)(void);
@property (nonatomic, copy) void (^blockAnswerAction)(void);
@property (nonatomic, copy) void (^blockReHttp)(void);
@property (nonatomic, copy) void (^blockReHttp)(ZJPatrolDetail_questions *question);
/**
飞行模式
*/
......
......@@ -95,14 +95,13 @@ static UILabel *stringLabel = nil;
}
//获取问题题目
for (ZJPatrolDetail_questions *questions in detail.questions) {
//如果等于临时
if (detail.temp) {
if ([questions.photoType isEqualToString:@"no"]) {
questions.photoType = @"all";
}
}
// //如果等于临时
// if (detail.temp) {
// if ([questions.photoType isEqualToString:@"no"]) {
// questions.photoType = @"all";
// }
// }
if ([questions.category isEqualToString:category]) {
//问题题目
PatrolExamCellViewModel *titleModel = [PatrolExamCellViewModel modelWithType:ExamCellTypeQuestion viewModel:self];
titleModel.question = questions;
......
......@@ -103,9 +103,6 @@
#pragma mark - TZImagePickerController
- (void)pushImagePickerController {
switch (self.type) {
case PHOTO_TYPE_NO:
ShowDefaultErrorView(@"此分类不用拍照", nil);
break;
case PHOTO_TYPE_ONLYPHOTO:
{
DBCameraViewController *cameraVc = [DBCameraViewController initWithDelegate:self];
......@@ -128,6 +125,7 @@
});
}
break;
case PHOTO_TYPE_NO:
case PHOTO_TYPE_ALL:
{
DBCameraViewController *cameraController = [DBCameraViewController initWithDelegate:self];
......@@ -157,7 +155,7 @@
[IBTLoadingView showTextOnly:[NSString stringWithFormat:@"最多添加%.0f张照片",self.viewModel.maxPictureNumber]];
return;
}
UIImage *newImage = [image rescaleImageToSize:CGSizeMake(ScreenSize.width, ScreenSize.width * 4 / 3)];
UIImage *newImage = [image rescaleImageToPX:1080];
NSDictionary *fontDict = @{NSForegroundColorAttributeName:[UIColor yellowColor],NSFontAttributeName:[UIFont systemFontOfSize:17]};
UIImage *waterImage = [newImage imageWaterMarkWithString:self.remarkString point:CGPointMake(20, newImage.size.height - 20) attribute:fontDict];
NSString *imageName = [self saveImageToLocal:waterImage];
......
......@@ -203,21 +203,18 @@ typedef NS_ENUM(NSInteger,ATTACHMENT_LOCATION){
//#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:7580/total-server/rest" //
//#define HTTP_LOCAL_BASE_URL @"http://218.244.151.129:7580"
//正式环境
//#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:7080/total-server/rest"
//#define HTTP_LOCAL_BASE_URL @"http://139.196.39.77:7080"
//测试环境
//测试环境 测试VI检查、VI抽查、VI检查结果模块使用
//#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:8180/total-server/rest"
//#define HTTP_LOCAL_BASE_URL @"http://139.196.39.77:8180"
//
//测试VI检查、VI抽查、VI检查结果模块使用
//#define VIHTTP_REST_API_BASE_URL @"http://139.196.39.77:8280/total-server/rest"
//#define VIHTTP_LOCAL_BASE_URL @"http://139.196.39.77:8280"
//正式VI检查、VI抽查、VI检查结果模块使用
//#define VIHTTP_REST_API_BASE_URL @"http://139.196.39.77:7280/total-server/rest"
//#define VIHTTP_LOCAL_BASE_URL @"http://139.196.39.77:7280"
//正式环境 正式VI检查、VI抽查、VI检查结果模块使用
#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:7080/total-server/rest"
#define HTTP_LOCAL_BASE_URL @"http://139.196.39.77:7080"
#define VIHTTP_REST_API_BASE_URL @"http://139.196.39.77:7280/total-server/rest"
#define VIHTTP_LOCAL_BASE_URL @"http://139.196.39.77:7280"
//开发环境
//#define HTTP_LOCAL_BASE_URL @"http://192.168.1.176:8083"
......@@ -225,13 +222,11 @@ typedef NS_ENUM(NSInteger,ATTACHMENT_LOCATION){
//#define VIHTTP_REST_API_BASE_URL @"http://192.168.1.176:8083/total-server/rest"
//#define VIHTTP_LOCAL_BASE_URL @"http://192.168.1.176:8083"
//外网映射开发环境
#define HTTP_LOCAL_BASE_URL @"http://dev.gomoretech.com"
#define HTTP_REST_API_BASE_URL @"http://dev.gomoretech.com/total-server/rest"
//
//外网映射开发环境 VI检查、VI抽查、VI检查结果模块使用
#define VIHTTP_REST_API_BASE_URL @"http://dev.gomoretech.com/total-server/rest"
#define VIHTTP_LOCAL_BASE_URL @"http://dev.gomoretech.com"
//外网映射开发环境 外网映射开发环境 VI检查、VI抽查、VI检查结果模块使用
//#define HTTP_LOCAL_BASE_URL @"http://dev.gomoretech.com"
//#define HTTP_REST_API_BASE_URL @"http://dev.gomoretech.com/total-server/rest"
//#define VIHTTP_REST_API_BASE_URL @"http://dev.gomoretech.com/total-server/rest"
//#define VIHTTP_LOCAL_BASE_URL @"http://dev.gomoretech.com"
#define HTTP_WEATHER_URL @"http://apis.baidu.com/heweather/weather/free"
//refreshUpdateDate
......
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