Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
红
红星美凯龙管理在线APP IOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
红星美凯龙管理在线APP IOS
Commits
d5c2a1ce
Commit
d5c2a1ce
authored
9 years ago
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成上传检查点
parent
ea559b8a
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
207 additions
and
89 deletions
+207
-89
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
AddQuestionViewController.m
...on/AddQuestion/ViewController/AddQuestionViewController.m
+36
-31
InspectDetailFooterView.h
...outh/Inspect/InspectDetail/View/InspectDetailFooterView.h
+2
-0
InspectDetailFooterView.m
...outh/Inspect/InspectDetail/View/InspectDetailFooterView.m
+0
-1
InspectUpLoadFootView.m
...fMouth/Inspect/InspectDetail/View/InspectUpLoadFootView.m
+1
-1
InspectNotUploadViewController.h
...ectDetail/ViewController/InspectNotUploadViewController.h
+4
-0
InspectNotUploadViewController.m
...ectDetail/ViewController/InspectNotUploadViewController.m
+85
-2
InspectListViewController.m
...ct/InspectList/ViewController/InspectListViewController.m
+1
-1
InspectSortTableCell.m
...rdOfMouth/Inspect/InspectTask/Cell/InspectSortTableCell.m
+1
-1
InspectDetailHeaderView.m
...fMouth/Inspect/InspectTask/View/InspectDetailHeaderView.m
+11
-2
InspectDetailView.h
.../WordOfMouth/Inspect/InspectTask/View/InspectDetailView.h
+1
-1
InspectDetailView.m
.../WordOfMouth/Inspect/InspectTask/View/InspectDetailView.m
+38
-35
InspectTaskViewController.m
...ct/InspectTask/ViewController/InspectTaskViewController.m
+11
-7
RankDetailHeaderView.m
...ordOfMouth/Ranking/RankDetail/View/RankDetailHeaderView.m
+1
-1
RankListHeaderView.m
...WordOfMouth/Ranking/RankingList/View/RankListHeaderView.m
+2
-2
LoginViewController.m
...Classes/Module/Login/ViewController/LoginViewController.m
+0
-3
HttpClient.h
redstar/Classes/Tools/HttpClient/HttpClient.h
+3
-0
HttpClient.m
redstar/Classes/Tools/HttpClient/HttpClient.m
+9
-0
Info.plist
redstar/Info.plist
+1
-1
No files found.
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
d5c2a1ce
No preview for this file type
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/Question/AddQuestion/ViewController/AddQuestionViewController.m
View file @
d5c2a1ce
...
...
@@ -14,7 +14,6 @@
#import "CommonFunc.h"
#import "HttpClient.h"
#import "RedStarTools.h"
#import <MBProgressHUD.h>
#define CATEGORYLIST @"服务", @"环境企划", @"环境物业", nil
...
...
@@ -27,7 +26,7 @@
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
AddQuestionFooterView
*
footerView
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
imageNameArray
;
@property
(
nonatomic
,
strong
)
NSArray
*
titleArray
;
@property
(
nonatomic
,
strong
)
NSString
*
imageMD5
;
...
...
@@ -64,7 +63,7 @@
UIBarButtonItem
*
backItem
=
[[
UIBarButtonItem
alloc
]
initWithCustomView
:
backBtn
];
self
.
navigationItem
.
leftBarButtonItem
=
backItem
;
self
.
imageNameArray
=
[
NSMutableArray
array
];
self
.
titleArray
=
[
NSArray
arrayWithObjects
:
@"选择对应专业组"
,
@"选择问题分类"
,
nil
];
...
...
@@ -95,11 +94,11 @@
[
alert
show
];
return
;
}
NSLog
(
@"_selectLabel.text = %@, _selectLabel2.text = %@ ,self.footerView.contentTextView.text ===%@, elf.footerView.titleTextView.text = %@"
,
_selectLabel
.
text
,
_selectLabel1
.
text
,
self
.
footerView
.
contentTextView
.
text
,
self
.
footerView
.
titleTextView
.
text
);
[[
RedStarTools
sharedInstance
]
loadLocalData
];
NSMutableArray
*
localData
=
[
RedStarTools
sharedInstance
].
localDatas
;
NSDictionary
*
parameters
;
if
(
localData
.
count
==
0
)
{
if
(
_imageNameArray
.
count
==
0
)
{
parameters
=
@{
@"category"
:
_selectLabel
.
text
,
@"group"
:
_selectLabel1
.
text
,
@"title"
:
self
.
footerView
.
contentTextView
.
text
,
...
...
@@ -107,13 +106,12 @@
};
}
else
{
NSMutableArray
*
imageArray
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
localData
.
count
;
i
++
)
{
NSString
*
imageName
=
[
NSString
stringWithFormat
:
@"%@"
,
localData
[
i
]
];
for
(
int
i
=
0
;
i
<
_imageNameArray
.
count
;
i
++
)
{
NSString
*
imageName
=
_imageNameArray
[
i
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
NSData
*
imageData
=
UIImageJPEGRepresentation
(
image
,
0
.
5
);
NSString
*
imageBase64
=
[
imageData
base64EncodedStringWithOptions
:
0
];
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionary
];
[
dict
setObject
:
imageBase64
forKey
:
@"fileContent"
];
[
dict
setObject
:
imageName
forKey
:
@"fileName"
];
...
...
@@ -128,14 +126,13 @@
@"attachments"
:
imageArray
};
}
NSLog
(
@"par = %@"
,
parameters
);
NSDate
*
date
=
[
NSDate
date
];
NSTimeZone
*
zone
=
[
NSTimeZone
systemTimeZone
];
NSInteger
interval
=
[
zone
secondsFromGMTForDate
:
date
];
NSDate
*
localeDate
=
[
date
dateByAddingTimeInterval
:
interval
];
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"YYYY-MM-dd+hh:mm:ss"
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
localeD
ate
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
d
ate
];
NSString
*
operId
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_code"
];
NSString
*
operName
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_name"
];
...
...
@@ -149,8 +146,7 @@
[
client
uploadNewQuestionWithParameters
:
parameters
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"上传 response= %@, error = %@"
,
response
,
error
);
if
(
response
[
@"success"
])
{
[
RedStarTools
sharedInstance
].
localDatas
=
[
NSMutableArray
array
];
[[
RedStarTools
sharedInstance
]
saveLocalData
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}
}];
...
...
@@ -161,8 +157,6 @@
// 返回上一页面
-
(
void
)
doBack
:
(
UIBarButtonItem
*
)
sender
{
[
RedStarTools
sharedInstance
].
localDatas
=
[
NSMutableArray
array
];
[[
RedStarTools
sharedInstance
]
saveLocalData
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
...
...
@@ -195,6 +189,21 @@
self
.
footerView
.
takePhotoView
.
frame
=
CGRectMake
(
0
,
170
,
kScreenWidth
,
k
*
btnH
+
(
k
+
1
)
*
marginY
);
self
.
footerView
.
height
=
self
.
footerView
.
takePhotoView
.
frame
.
size
.
height
+
220
;
NSString
*
imageName
=
_imageNameArray
[
button
.
superview
.
tag
-
1
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
NSFileManager
*
fileManager
=
[
NSFileManager
defaultManager
];
BOOL
blHave
=
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:
fullPath
];
if
(
!
blHave
)
{
return
;
}
else
{
BOOL
blDele
=
[
fileManager
removeItemAtPath
:
fullPath
error
:
nil
];
if
(
blDele
)
{
NSLog
(
@"dele success"
);
}
else
{
NSLog
(
@"dele fail"
);
}
}
}
-
(
void
)
createImagePicker
...
...
@@ -219,17 +228,16 @@
[
self
.
navigationController
pushViewController
:
checkVC
animated
:
YES
];
}
// 保存图片至沙盒
-
(
void
)
saveImage
:
(
UIButton
*
)
button
{
UIImage
*
currentImage
=
button
.
imageView
.
image
;
#pragma mark - 保存图片至沙盒
-
(
void
)
saveImage
:
(
UIImage
*
)
currentImage
{
NSData
*
imageData
=
UIImageJPEGRepresentation
(
currentImage
,
0
.
5
);
self
.
imageMD5
=
[
CommonFunc
md5Data
:
imageData
];
// 获取沙盒目录
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
_imageMD5
];
[[
RedStarTools
sharedInstance
].
localDatas
addObject
:
_imageMD5
];
[[
RedStarTools
sharedInstance
]
saveLocalData
];
NSString
*
imageName
=
[
CommonFunc
md5Data
:
imageData
];
[
_imageNameArray
addObject
:
imageName
];
// 获取沙盒目录
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
// 将图片写入文件
[
imageData
writeToFile
:
fullPath
atomically
:
NO
];
}
...
...
@@ -237,14 +245,11 @@
-
(
void
)
imagePickerController
:
(
UIImagePickerController
*
)
picker
didFinishPickingMediaWithInfo
:
(
NSDictionary
*
)
info
{
UIImage
*
image
=
[
info
objectForKey
:
UIImagePickerControllerOriginalImage
];
[
self
saveImage
:
image
];
// 创建一个新的控件
UIButton
*
newButton
=
[
self
.
footerView
.
takePhotoView
createButtonWithImage
:
image
];
[
newButton
addTarget
:
self
action
:
@selector
(
takePhotoShowPicture
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
// 保存图片至沙盒
[
self
saveImage
:
newButton
];
[
self
.
footerView
.
takePhotoView
insertSubview
:
newButton
atIndex
:
self
.
footerView
.
takePhotoView
.
subviews
.
count
-
1
];
[
self
.
footerView
.
takePhotoView
.
allImages
addObject
:
image
];
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/View/InspectDetailFooterView.h
View file @
d5c2a1ce
...
...
@@ -12,4 +12,6 @@
@interface
InspectDetailFooterView
:
UIView
@property
(
nonatomic
,
strong
)
TakePhotoView
*
takePhotoView
;
@property
(
nonatomic
,
strong
)
UIButton
*
reportBtn
;
@property
(
nonatomic
,
strong
)
UITextView
*
contentTextView
;
@end
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/View/InspectDetailFooterView.m
View file @
d5c2a1ce
...
...
@@ -38,7 +38,6 @@
@interface
InspectDetailFooterView
()
<
UITextViewDelegate
>
@property
(
nonatomic
,
strong
)
UILabel
*
pictureLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
introLabel
;
@property
(
nonatomic
,
strong
)
UITextView
*
contentTextView
;
@property
(
nonatomic
,
strong
)
UIImageView
*
backImageView2
;
@property
(
nonatomic
,
strong
)
UILabel
*
placeholderLabel2
;
@end
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/View/InspectUpLoadFootView.m
View file @
d5c2a1ce
...
...
@@ -19,7 +19,7 @@
self
=
[
super
init
];
if
(
self
)
{
self
.
backgroundColor
=
kSectionBackGroundColor
;
NSLog
(
@"answerAttachments.count = %ld referenceAttachments.count = %ld"
,
answerAttachments
.
count
,
referenceAttachments
.
count
);
NSLog
(
@"answerAttachments.count = %ld referenceAttachments.count = %ld"
,
(
unsigned
long
)
answerAttachments
.
count
,
(
unsigned
long
)
referenceAttachments
.
count
);
CGFloat
imageMaginX
=
20
;
CGFloat
imageMaginY
=
10
;
CGFloat
imageW
=
(
kScreenWidth
-
imageMaginX
*
3
)
/
2
;
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/ViewController/InspectNotUploadViewController.h
View file @
d5c2a1ce
...
...
@@ -12,4 +12,8 @@
@interface
InspectNotUploadViewController
:
UIViewController
@property
(
nonatomic
,
assign
)
int
questionCount
;
@property
(
nonatomic
,
strong
)
TaskModel
*
taskModel
;
@property
(
nonatomic
,
strong
)
NSString
*
store_uuid
;
@property
(
nonatomic
,
strong
)
NSString
*
uuid
;
// 口碑巡检uuid
@property
(
nonatomic
,
strong
)
NSString
*
praiseUuid
;
@property
(
nonatomic
,
strong
)
NSString
*
questionUuid
;
@end
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/ViewController/InspectNotUploadViewController.m
View file @
d5c2a1ce
...
...
@@ -10,7 +10,8 @@
#import "InspectNotUpLoadCell.h"
#import "CheckPicViewController.h"
#import "InspectDetailFooterView.h"
#import <MBProgressHUD.h>
#import "CommonFunc.h"
#import "HttpClient.h"
#define kInspectNotUploadCell @"InspectNotUploadCell"
...
...
@@ -18,6 +19,7 @@
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
InspectDetailFooterView
*
footerView
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
imageNameArray
;
@end
...
...
@@ -46,6 +48,9 @@
[
self
.
tableView
registerClass
:[
InspectNotUpLoadCell
class
]
forCellReuseIdentifier
:
kInspectNotUploadCell
];
self
.
tableView
.
tableFooterView
=
self
.
footerView
;
self
.
footerView
.
takePhotoView
.
delegate
=
self
;
[
self
.
footerView
.
reportBtn
addTarget
:
self
action
:
@selector
(
uploadTaskInfo
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
self
.
imageNameArray
=
[
NSMutableArray
array
];
}
...
...
@@ -55,6 +60,53 @@
}
#pragma mark - private Methods
-
(
void
)
uploadTaskInfo
:
(
UIButton
*
)
sender
{
NSMutableArray
*
imageArray
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
_imageNameArray
.
count
;
i
++
)
{
NSString
*
imageName
=
_imageNameArray
[
i
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
NSData
*
imageData
=
UIImageJPEGRepresentation
(
image
,
0
.
5
);
NSString
*
imageBase64
=
[
imageData
base64EncodedStringWithOptions
:
0
];
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionary
];
[
dict
setObject
:
imageBase64
forKey
:
@"fileContent"
];
[
dict
setObject
:
imageName
forKey
:
@"fileName"
];
[
dict
setObject
:
@
(
i
)
forKey
:
@"index"
];
[
imageArray
addObject
:
dict
];
}
NSDate
*
date
=
[
NSDate
date
];
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"YYYY-MM-dd+hh:mm:ss"
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
date
];
NSString
*
operId
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_code"
];
NSString
*
operName
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_name"
];
NSLog
(
@"self = %@, 1= %@, 2 = %@"
,
self
.
praiseUuid
,
self
.
store_uuid
,
self
.
questionUuid
);
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@%@?time=%@&operId=%@&operName=%@"
,
kRedStarURL
,
kUpLoadInspectResult
,
self
.
praiseUuid
,
dateString
,
operId
,
operName
];
url
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
NSLog
(
@"上传检查点url = %@"
,
url
);
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
NSDictionary
*
parameters
=
@{
@"questionUuid"
:
self
.
questionUuid
,
@"storeUuid"
:
self
.
store_uuid
,
@"remark"
:
self
.
footerView
.
contentTextView
.
text
,
@"attachments"
:
imageArray
};
NSLog
(
@"上传检查点parameters = %@"
,
parameters
);
[
httpClient
uploadInspectResultWithParameters
:
parameters
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"ressssss =%@ errorrrrr = %@"
,
response
,
error
);
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}];
}
// 返回上一页面
-
(
void
)
doBack
:
(
UIBarButtonItem
*
)
sender
{
...
...
@@ -64,6 +116,7 @@
#pragma mark - TakePhoto Delegate
-
(
void
)
deletePhoto
:
(
UIButton
*
)
button
{
NSLog
(
@"button -.tag === %ld"
,
(
long
)
button
.
superview
.
tag
);
// 从存放所有Image的数组里移除当前点击的Image
[
self
.
footerView
.
takePhotoView
.
allImages
removeObject
:[(
UIButton
*
)
button
.
superview
imageForState
:
UIControlStateNormal
]];
// 移除显示Image的Button
...
...
@@ -81,6 +134,21 @@
self
.
footerView
.
takePhotoView
.
frame
=
CGRectMake
(
0
,
40
,
kScreenWidth
,
k
*
btnH
+
(
k
+
1
)
*
marginY
);
self
.
footerView
.
height
=
self
.
footerView
.
takePhotoView
.
frame
.
size
.
height
+
220
;
NSString
*
imageName
=
_imageNameArray
[
button
.
superview
.
tag
-
1
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
NSFileManager
*
fileManager
=
[
NSFileManager
defaultManager
];
BOOL
blHave
=
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:
fullPath
];
if
(
!
blHave
)
{
return
;
}
else
{
BOOL
blDele
=
[
fileManager
removeItemAtPath
:
fullPath
error
:
nil
];
if
(
blDele
)
{
NSLog
(
@"dele success"
);
}
else
{
NSLog
(
@"dele fail"
);
}
}
}
-
(
void
)
createImagePicker
...
...
@@ -105,11 +173,26 @@
[
self
.
navigationController
pushViewController
:
checkVC
animated
:
YES
];
}
#pragma mark - 保存图片至沙盒
-
(
void
)
saveImage
:
(
UIImage
*
)
currentImage
{
NSData
*
imageData
=
UIImageJPEGRepresentation
(
currentImage
,
0
.
5
);
NSString
*
imageName
=
[
CommonFunc
md5Data
:
imageData
];
[
_imageNameArray
addObject
:
imageName
];
// 获取沙盒目录
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
// 将图片写入文件
[
imageData
writeToFile
:
fullPath
atomically
:
NO
];
}
#pragma mark - UIImagePickerController 代理方法
-
(
void
)
imagePickerController
:
(
UIImagePickerController
*
)
picker
didFinishPickingMediaWithInfo
:
(
NSDictionary
*
)
info
{
UIImage
*
image
=
[
info
objectForKey
:
UIImagePickerControllerOriginalImage
];
[
self
saveImage
:
image
];
// 创建一个新的控件
UIButton
*
newButton
=
[
self
.
footerView
.
takePhotoView
createButtonWithImage
:
image
];
[
newButton
addTarget
:
self
action
:
@selector
(
takePhotoShowPicture
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectList/ViewController/InspectListViewController.m
View file @
d5c2a1ce
...
...
@@ -123,7 +123,7 @@
NSDictionary
*
parameters
=
@{
@"userUuid"
:
@""
,
@"queryOrders"
:
@[@{
@"field"
:
@"lastModifyInfo"
}],
@"pageNumber"
:
@
(
0
),
@"pageSize"
:
@
(
1
0
)
@"pageSize"
:
@
(
2
0
)
};
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/Cell/InspectSortTableCell.m
View file @
d5c2a1ce
...
...
@@ -45,7 +45,7 @@
_task
=
task
;
if
(
task
.
state
==
0
)
{
self
.
stateLabel
.
textColor
=
kNavigationBarColor
;
self
.
stateLabel
.
textColor
=
[
UIColor
orangeColor
]
;
self
.
stateLabel
.
text
=
[
NSString
stringWithFormat
:
@"未上报"
];
}
else
if
(
task
.
state
==
1
)
{
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/View/InspectDetailHeaderView.m
View file @
d5c2a1ce
...
...
@@ -82,7 +82,12 @@
self
.
detailView
.
shopnameLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
store_name
];
self
.
detailView
.
startDateLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
beginDate
];
self
.
detailView
.
overDateLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
endDate
];
self
.
detailView
.
multiplier
=
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
;
if
(
taskDetail
.
questionCount
==
0
||
taskDetail
.
reportCount
==
0
)
{
self
.
detailView
.
multiplier
=
0
;
}
else
{
self
.
detailView
.
multiplier
=
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
;
}
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"yyyy-MM-dd"
];
...
...
@@ -108,7 +113,11 @@
if
([
taskDetail
.
state
isEqualToString
:
@"initial"
])
{
self
.
detailView
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"未处理 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
if
(
taskDetail
.
reportCount
==
0
||
taskDetail
.
questionCount
==
0
)
{
self
.
detailView
.
progressLabel
.
text
=
@"0%"
;
}
else
{
self
.
detailView
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"未处理 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
}
self
.
detailView
.
progressLabel
.
textColor
=
kProgressUnSettledColor
;
self
.
detailView
.
alreadyLabel
.
textColor
=
kProgressUnSettledColor
;
self
.
detailView
.
allLabel
.
textColor
=
kProgressUnSettledColor
;
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/View/InspectDetailView.h
View file @
d5c2a1ce
...
...
@@ -19,7 +19,7 @@
@property
(
nonatomic
,
strong
)
UILabel
*
allLabel
;
@property
(
nonatomic
,
assign
)
ProgressState
progressState
;
//
@property (nonatomic, assign) ProgressState progressState;
@property
(
nonatomic
,
assign
)
CGFloat
multiplier
;
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/View/InspectDetailView.m
View file @
d5c2a1ce
...
...
@@ -49,6 +49,7 @@
#pragma mark Private Methods
-
(
void
)
setup
{
self
.
upLineView
.
backgroundColor
=
kSeparateLineColor
;
self
.
downLineView
.
backgroundColor
=
kSeparateLineColor
;
...
...
@@ -66,40 +67,40 @@
self
.
arrowImageView
.
image
=
[
UIImage
imageNamed
:
@"grey-trilateral_down"
];
}
-
(
void
)
setProgressState
:
(
ProgressState
)
progressState
{
_progressState
=
progressState
;
if
(
_progressState
==
ProgressStateUnSettled
)
{
self
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"未处理 %f"
,
_multiplier
];;
self
.
progressLabel
.
textColor
=
kProgressUnSettledColor
;
self
.
alreadyLabel
.
textColor
=
kProgressUnSettledColor
;
self
.
allLabel
.
textColor
=
kProgressUnSettledColor
;
self
.
allView
.
backgroundColor
=
kProgressViewAllBackColor
;
UIImage
*
image
=
[
UIImage
imageNamed
:
@"progress-bar"
];
image
=
[
image
resizableImageWithCapInsets
:
UIEdgeInsetsZero
resizingMode
:
UIImageResizingModeTile
];
self
.
alreadyView
.
image
=
image
;
}
else
if
(
_progressState
==
ProgressStateDealWith
)
{
self
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"进行中 %f"
,
_multiplier
];
self
.
progressLabel
.
textColor
=
kProgressDealWithColor
;
self
.
alreadyLabel
.
textColor
=
kProgressDealWithColor
;
self
.
allLabel
.
textColor
=
kProgressDealWithColor
;
self
.
allView
.
backgroundColor
=
kProgressViewAllBackColor
;
UIImage
*
image
=
[
UIImage
imageNamed
:
@"progress-bar"
];
image
=
[
image
resizableImageWithCapInsets
:
UIEdgeInsetsZero
resizingMode
:
UIImageResizingModeTile
];
self
.
alreadyView
.
image
=
image
;
}
else
{
self
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"已过期 %f"
,
_multiplier
];
self
.
progressLabel
.
textColor
=
kProgressOverDueColor
;
self
.
alreadyLabel
.
textColor
=
kProgressOverDueColor
;
self
.
allLabel
.
textColor
=
kProgressOverDueColor
;
self
.
allView
.
backgroundColor
=
kProgressViewAllBackColor
;
UIImage
*
image
=
[
UIImage
imageNamed
:
@"progress-bar"
];
image
=
[
image
resizableImageWithCapInsets
:
UIEdgeInsetsZero
resizingMode
:
UIImageResizingModeTile
];
self
.
alreadyView
.
image
=
image
;
}
}
//
- (void)setProgressState:(ProgressState)progressState
//
{
//
_progressState = progressState;
//
if (_progressState == ProgressStateUnSettled) {
//
self.progressLabel.text = [NSString stringWithFormat:@"未处理 %f", _multiplier];;
//
self.progressLabel.textColor = kProgressUnSettledColor;
//
self.alreadyLabel.textColor = kProgressUnSettledColor;
//
self.allLabel.textColor = kProgressUnSettledColor;
//
self.allView.backgroundColor = kProgressViewAllBackColor;
//
UIImage *image = [UIImage imageNamed:@"progress-bar"];
//
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
//
self.alreadyView.image = image;
//
} else if (_progressState == ProgressStateDealWith) {
//
//
self.progressLabel.text = [NSString stringWithFormat:@"进行中 %f", _multiplier];
//
self.progressLabel.textColor = kProgressDealWithColor;
//
self.alreadyLabel.textColor = kProgressDealWithColor;
//
self.allLabel.textColor = kProgressDealWithColor;
//
self.allView.backgroundColor = kProgressViewAllBackColor;
//
UIImage *image = [UIImage imageNamed:@"progress-bar"];
//
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
//
self.alreadyView.image = image;
//
} else {
//
//
self.progressLabel.text = [NSString stringWithFormat:@"已过期 %f", _multiplier];
//
self.progressLabel.textColor = kProgressOverDueColor;
//
self.alreadyLabel.textColor = kProgressOverDueColor;
//
self.allLabel.textColor = kProgressOverDueColor;
//
self.allView.backgroundColor = kProgressViewAllBackColor;
//
UIImage *image = [UIImage imageNamed:@"progress-bar"];
//
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
//
self.alreadyView.image = image;
//
}
//
}
#pragma mark - lazy loading
-
(
UIView
*
)
upLineView
...
...
@@ -288,7 +289,9 @@
NSLayoutConstraint
*
overDateBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_alreadyView
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
allView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:-
1
];
[
self
.
allView
addConstraint
:
overDateBottom
];
NSLayoutConstraint
*
overDatewidth
=
[
NSLayoutConstraint
constraintWithItem
:
_alreadyView
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
allView
attribute
:
NSLayoutAttributeWidth
multiplier
:
self
.
multiplier
constant
:
0
];
NSLayoutConstraint
*
overDatewidth
=
[
NSLayoutConstraint
constraintWithItem
:
_alreadyView
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
allView
attribute
:
NSLayoutAttributeWidth
multiplier
:
self
.
multiplier
constant
:-
1
];
[
self
.
allView
addConstraint
:
overDatewidth
];
}
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/ViewController/InspectTaskViewController.m
View file @
d5c2a1ce
...
...
@@ -32,6 +32,7 @@
@property
(
nonatomic
,
strong
)
NSArray
*
taskData
;
@property
(
nonatomic
,
strong
)
InspectDetailHeaderView
*
detailHeaderView
;
@property
(
nonatomic
,
strong
)
TaskDetailModel
*
taskDetail
;
@end
@implementation
InspectTaskViewController
...
...
@@ -104,7 +105,7 @@
NSDictionary
*
dataDict
=
response
[
@"data"
];
TaskDetailModel
*
taskDetail
=
[
TaskDetailModel
taskDetailModelWithDict
:
dataDict
];
weakSelf
.
detailHeaderView
.
taskDetail
=
taskDetail
;
_taskDetail
=
taskDetail
;
NSArray
*
dataArray
=
dataDict
[
@"categories"
];
...
...
@@ -164,16 +165,19 @@
TaskGroup
*
taskGroup
=
_taskData
[
indexPath
.
section
];
TaskModel
*
task
=
taskGroup
.
answers
[
indexPath
.
row
];
if
(
task
.
readonly
)
{
InspectUploadedViewController
*
inspectVC
=
[[
InspectUploadedViewController
alloc
]
init
];
inspectVC
.
questionCount
=
taskGroup
.
questionCount
;
inspectVC
.
taskModel
=
task
;
[
self
.
navigationController
pushViewController
:
inspectVC
animated
:
YES
];
}
else
{
if
(
task
.
state
==
0
)
{
InspectNotUploadViewController
*
inspectNotVC
=
[[
InspectNotUploadViewController
alloc
]
init
];
inspectNotVC
.
questionCount
=
taskGroup
.
questionCount
;
inspectNotVC
.
taskModel
=
task
;
inspectNotVC
.
store_uuid
=
_taskDetail
.
store_uuid
;
inspectNotVC
.
praiseUuid
=
_taskDetail
.
uuid
;
inspectNotVC
.
questionUuid
=
task
.
uuid
;
[
self
.
navigationController
pushViewController
:
inspectNotVC
animated
:
YES
];
}
else
{
InspectUploadedViewController
*
inspectVC
=
[[
InspectUploadedViewController
alloc
]
init
];
inspectVC
.
questionCount
=
taskGroup
.
questionCount
;
inspectVC
.
taskModel
=
task
;
[
self
.
navigationController
pushViewController
:
inspectVC
animated
:
YES
];
}
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/View/RankDetailHeaderView.m
View file @
d5c2a1ce
...
...
@@ -52,7 +52,7 @@
{
_taskDetail
=
taskDetail
;
self
.
shopNameLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
store_name
];
self
.
rankDetailView
.
addressLabel
.
text
=
@"上海市真北路1108号"
;
self
.
rankDetailView
.
addressLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
storePath
]
;
self
.
rankDetailView
.
titleLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
name
];
self
.
rankDetailView
.
reportTimeLabel
.
text
=
@"上报时间"
;
self
.
rankDetailView
.
totalScoreLabel
.
text
=
@"总评分"
;
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/View/RankListHeaderView.m
View file @
d5c2a1ce
...
...
@@ -72,7 +72,7 @@
if
(
section
<
3
)
{
UIImageView
*
gradeImageView
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:[
NSString
stringWithFormat
:
@"medal_0%
l
d"
,
section
+
1
]]];
UIImageView
*
gradeImageView
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:[
NSString
stringWithFormat
:
@"medal_0%d"
,
section
+
1
]]];
[
self
addSubview
:
gradeImageView
];
_gradeImageView
=
gradeImageView
;
...
...
@@ -83,7 +83,7 @@
gradeLabel
.
textColor
=
kLightBlack
;
gradeLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
.
0
];
[
self
addSubview
:
gradeLabel
];
gradeLabel
.
text
=
[
NSString
stringWithFormat
:
@"第%
l
d名"
,
section
+
1
];
gradeLabel
.
text
=
[
NSString
stringWithFormat
:
@"第%d名"
,
section
+
1
];
_gradeLabel
=
gradeLabel
;
}
_section
=
section
;
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Login/ViewController/LoginViewController.m
View file @
d5c2a1ce
...
...
@@ -120,9 +120,6 @@
*/
-
(
void
)
loginButtonClick
:
(
UIButton
*
)
sender
{
self
.
rootTBC
=
[[
RootTabBarController
alloc
]
init
];
[
self
presentViewController
:
_rootTBC
animated
:
YES
completion
:
nil
];
if
(
self
.
loginView
.
usernameTextFiled
.
text
.
length
==
0
||
self
.
loginView
.
passwordTextFiled
.
text
.
length
==
0
)
{
UIAlertView
*
alertView
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"账号、密码不能为空"
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
[
alertView
show
];
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Tools/HttpClient/HttpClient.h
View file @
d5c2a1ce
...
...
@@ -49,4 +49,7 @@ typedef void (^completionBlock) (id response, NSError *error);
// 上传新问题
-
(
void
)
uploadNewQuestionWithParameters
:(
id
)
parameters
completion
:(
completionBlock
)
completion
;
// 上传新检查点
-
(
void
)
uploadInspectResultWithParameters
:(
id
)
parameters
completion
:(
completionBlock
)
completion
;
@end
This diff is collapsed.
Click to expand it.
redstar/Classes/Tools/HttpClient/HttpClient.m
View file @
d5c2a1ce
...
...
@@ -193,4 +193,13 @@
}];
}
-
(
void
)
uploadInspectResultWithParameters
:
(
id
)
parameters
completion
:
(
completionBlock
)
completion
{
[
self
postParameters
:
parameters
completion
:
^
(
id
response
,
NSError
*
error
)
{
if
(
completion
)
{
completion
(
response
,
error
);
}
}];
}
@end
This diff is collapsed.
Click to expand it.
redstar/Info.plist
View file @
d5c2a1ce
...
...
@@ -16,7 +16,7 @@
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
redstar
<
/string
>
<
string
>
红星管理在线
<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment