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
0fa012c4
Commit
0fa012c4
authored
Jan 28, 2016
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成图片缓存功能
parent
7653df0f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
96 additions
and
16 deletions
+96
-16
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Url.h
redstar/Classes/Macro/Url.h
+2
-2
LargePictureViewController.h
redstar/Classes/Module/Check/LargePictureViewController.h
+3
-2
LargePictureViewController.m
redstar/Classes/Module/Check/LargePictureViewController.m
+6
-1
OnLineResultViewController.m
...kOnLineResult/ViewController/OnLineResultViewController.m
+2
-0
QuestionDetailViewController.m
...stionDetail/ViewController/QuestionDetailViewController.m
+2
-0
InspectNotUploadViewController.m
...ectDetail/ViewController/InspectNotUploadViewController.m
+79
-11
InspectUploadedViewController.m
...pectDetail/ViewController/InspectUploadedViewController.m
+1
-0
RankDetailViewController.m
...king/RankDetail/ViewController/RankDetailViewController.m
+1
-0
No files found.
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
0fa012c4
No preview for this file type
redstar/Classes/Macro/Url.h
View file @
0fa012c4
...
...
@@ -10,10 +10,10 @@
#define Url_h
// url 测试环境
//
#define kRedStarURL @"http://218.244.151.129:7580/"
#define kRedStarURL @"http://218.244.151.129:7580/"
// 正式环境
#define kRedStarURL @"http://219.235.234.225:7580/"
//
#define kRedStarURL @"http://219.235.234.225:7580/"
// 最新正式环境
//#define kRedStarURL @"http://219.235.234.212:7580/"
...
...
redstar/Classes/Module/Check/LargePictureViewController.h
View file @
0fa012c4
...
...
@@ -10,7 +10,8 @@
typedef
NS_ENUM
(
NSInteger
,
PictureSaveMode
)
{
PictureNetWorkMode
=
0
,
PictureLocalMode
=
1
PictureLocalMode
=
1
,
PictureSpecialMode
=
2
};
@interface
LargePictureViewController
:
UIViewController
<
UIScrollViewDelegate
>
{
...
...
@@ -23,7 +24,7 @@ typedef NS_ENUM(NSInteger, PictureSaveMode) {
@property
(
nonatomic
,
strong
)
UIScrollView
*
imageScrollView
;
@property
(
nonatomic
,
assign
)
PictureSaveMode
pictureSaveMode
;
@property
(
nonatomic
,
strong
)
NSString
*
uuid
;
-
(
CGRect
)
zoomRectForScale
:(
float
)
scale
inView
:(
UIScrollView
*
)
scrollView
withCenter
:(
CGPoint
)
center
;
@end
redstar/Classes/Module/Check/LargePictureViewController.m
View file @
0fa012c4
...
...
@@ -63,8 +63,13 @@
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
imageview
.
image
=
image
;
}
else
{
}
else
if
(
self
.
pictureSaveMode
==
PictureNetWorkMode
)
{
[
imageview
sd_setImageWithURL
:
_allImageArray
[
i
]
placeholderImage
:[
UIImage
imageNamed
:
@"default_pic"
]];
}
else
{
NSString
*
imageName
=
_allImageArray
[
i
];
NSString
*
fullPath
=
[[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
_uuid
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
imageview
.
image
=
image
;
}
imageview
.
frame
=
CGRectMake
(
20
,
0
,
kScreenWidth
,
(
kScreenHeight
-
20
));
imageview
.
userInteractionEnabled
=
YES
;
...
...
redstar/Classes/Module/Function/OnLine/LookOnLineResult/ViewController/OnLineResultViewController.m
View file @
0fa012c4
...
...
@@ -167,6 +167,7 @@
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
imageView
.
tag
-
1116
;
largeVC
.
allImageArray
=
_allImageURL
;
largeVC
.
pictureSaveMode
=
PictureNetWorkMode
;
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
}
...
...
@@ -175,6 +176,7 @@
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
sender
.
tag
-
1117
;
largeVC
.
allImageArray
=
_allStoreImageURL
;
largeVC
.
pictureSaveMode
=
PictureNetWorkMode
;
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
}
...
...
redstar/Classes/Module/Function/Question/QuestionDetail/ViewController/QuestionDetailViewController.m
View file @
0fa012c4
...
...
@@ -278,6 +278,8 @@
UIImageView
*
imageView
=
(
UIImageView
*
)
sender
.
view
;
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
imageView
.
tag
-
1115
;
largeVC
.
pictureSaveMode
=
PictureNetWorkMode
;
largeVC
.
allImageArray
=
_allImageURL
;
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
}
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/ViewController/InspectNotUploadViewController.m
View file @
0fa012c4
...
...
@@ -35,7 +35,7 @@
@property
(
nonatomic
,
strong
)
NSMutableArray
*
imageNameArray
;
@property
(
nonatomic
,
strong
)
NSLayoutConstraint
*
tableBottom
;
@property
(
nonatomic
,
strong
)
NSLayoutConstraint
*
tableTop
;
@property
(
nonatomic
,
assign
)
int
rowNumber
;
@property
(
nonatomic
,
assign
)
NSInteger
rowNumber
;
@property
(
nonatomic
,
strong
)
UIButton
*
deleteButton
;
@end
...
...
@@ -70,6 +70,28 @@
self
.
imageNameArray
=
[
NSMutableArray
array
];
_rowNumber
=
2
;
self
.
view
.
backgroundColor
=
[
UIColor
colorWithRed
:
239
/
255
.
0
green
:
239
/
255
.
0
blue
:
239
/
255
.
0
alpha
:
239
/
255
.
0
];
NSFileManager
*
fileManager
=
[
NSFileManager
defaultManager
];
NSString
*
path
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:[
NSString
stringWithFormat
:
@"%@"
,
_taskModel
.
uuid
]];
if
([
fileManager
fileExistsAtPath
:
path
])
{
NSDirectoryEnumerator
*
myDirectoryEnumerator
=
[
fileManager
enumeratorAtPath
:
path
];
while
((
path
=
[
myDirectoryEnumerator
nextObject
])
!=
nil
)
{
if
(
!
[
_imageNameArray
containsObject
:
path
])
{
[
_imageNameArray
addObject
:
path
];
}
}
if
(
_imageNameArray
.
count
%
2
==
1
)
{
_rowNumber
=
_rowNumber
+
(
_imageNameArray
.
count
+
1
)
/
2
-
1
;
}
else
{
_rowNumber
=
_rowNumber
+
_imageNameArray
.
count
/
2
;
}
[
self
.
tableView
reloadData
];
}
}
...
...
@@ -101,7 +123,8 @@
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
sender
.
tag
-
kPhotoTag
;
largeVC
.
allImageArray
=
_imageNameArray
;
largeVC
.
pictureSaveMode
=
PictureLocalMode
;
largeVC
.
pictureSaveMode
=
PictureSpecialMode
;
largeVC
.
uuid
=
[
NSString
stringWithFormat
:
@"%@"
,
_taskModel
.
uuid
];
[
self
removeDeleteButton
];
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
...
...
@@ -168,10 +191,23 @@
[
_imageNameArray
addObject
:
imageName
];
// 获取沙盒目录
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
// 将图片写入文件
[
imageData
writeToFile
:
fullPath
atomically
:
NO
];
imageData
=
nil
;
// NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
NSString
*
path
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:[
NSString
stringWithFormat
:
@"%@"
,
_taskModel
.
uuid
]];
NSString
*
imagePath
=
[
path
stringByAppendingPathComponent
:
imageName
];
BOOL
bo
=
[[
NSFileManager
defaultManager
]
createDirectoryAtPath
:
path
withIntermediateDirectories
:
YES
attributes
:
nil
error
:
nil
];
if
(
bo
)
{
// 将图片写入文件
[
imageData
writeToFile
:
imagePath
atomically
:
NO
];
imageData
=
nil
;
}
else
{
NSFileManager
*
fileManager
=
[
NSFileManager
defaultManager
];
[
fileManager
removeItemAtPath
:
path
error
:
nil
];
}
}
#pragma mark - TableView Delegate/DataSource
...
...
@@ -205,6 +241,7 @@
}
return
cell
;
}
else
if
(
indexPath
.
row
==
_rowNumber
-
1
)
{
NSLog
(
@"index.row === %ld"
,
indexPath
.
row
);
if
((
_imageNameArray
.
count
+
1
)
%
2
==
0
)
{
NSString
*
identifier
=
[
NSString
stringWithFormat
:
@"InspectaddPicCell"
];
InspectPicAddCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
identifier
];
...
...
@@ -212,7 +249,11 @@
cell
=
[[
InspectPicAddCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
identifier
];
}
NSString
*
imageName
=
_imageNameArray
[
_imageNameArray
.
count
-
1
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
//NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
NSString
*
path
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:[
NSString
stringWithFormat
:
@"%@"
,
_taskModel
.
uuid
]];
NSString
*
fullPath
=
[
path
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
UIImage
*
image00
=
[
UIImage
image
:
image
fillSize
:
CGSizeMake
((
kScreenWidth
-
60
)
/
2
,
90
)];
...
...
@@ -250,13 +291,23 @@
cell
=
[[
InpectPictureCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
identifier
];
}
NSString
*
imageName0
=
_imageNameArray
[(
indexPath
.
row
-
1
)
*
2
];
NSString
*
fullPath0
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName0
];
// NSString *fullPath0 = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName0];
NSLog
(
@"qqqqw==== %ld"
,
(
indexPath
.
row
-
1
)
*
2
);
NSString
*
path0
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:[
NSString
stringWithFormat
:
@"%@"
,
_taskModel
.
uuid
]];
NSString
*
fullPath0
=
[
path0
stringByAppendingPathComponent
:
imageName0
];
UIImage
*
image0
=
[
UIImage
imageWithContentsOfFile
:
fullPath0
];
UIImage
*
image00
=
[
UIImage
image
:
image0
fillSize
:
CGSizeMake
((
kScreenWidth
-
60
)
/
2
,
90
)];
[
cell
.
photoButton1
setImage
:
image00
forState
:
UIControlStateNormal
];
NSLog
(
@"qqqq==== %ld"
,
(
indexPath
.
row
-
1
)
*
2
+
1
);
NSString
*
imageName1
=
_imageNameArray
[(
indexPath
.
row
-
1
)
*
2
+
1
];
NSString
*
fullPath1
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName1
];
// NSString *fullPath1 = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName1];
NSString
*
path1
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:[
NSString
stringWithFormat
:
@"%@"
,
_taskModel
.
uuid
]];
NSString
*
fullPath1
=
[
path1
stringByAppendingPathComponent
:
imageName1
];
UIImage
*
image1
=
[
UIImage
imageWithContentsOfFile
:
fullPath1
];
UIImage
*
image11
=
[
UIImage
image
:
image1
fillSize
:
CGSizeMake
((
kScreenWidth
-
60
)
/
2
,
90
)];
...
...
@@ -355,7 +406,11 @@
NSMutableArray
*
imageArray
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
_imageNameArray
.
count
;
i
++
)
{
NSString
*
imageName
=
_imageNameArray
[
i
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
//NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
NSString
*
path
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:[
NSString
stringWithFormat
:
@"%@"
,
_taskModel
.
uuid
]];
NSString
*
fullPath
=
[
path
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
NSData
*
imageData
=
UIImageJPEGRepresentation
(
image
,
0
.
01
);
NSString
*
imageBase64
=
[
imageData
base64EncodedStringWithOptions
:
0
];
...
...
@@ -391,6 +446,19 @@
alert
.
delegate
=
self
;
alert
.
tag
=
39429234
;
[
alert
show
];
dispatch_async
(
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
),
^
{
NSString
*
path
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:[
NSString
stringWithFormat
:
@"%@"
,
_taskModel
.
uuid
]];
NSArray
*
files
=
[[
NSFileManager
defaultManager
]
subpathsAtPath
:
path
];
for
(
NSString
*
p
in
files
)
{
NSError
*
error
;
NSString
*
paths
=
[
path
stringByAppendingPathComponent
:
p
];
if
([[
NSFileManager
defaultManager
]
fileExistsAtPath
:
paths
])
{
[[
NSFileManager
defaultManager
]
removeItemAtPath
:
paths
error
:
&
error
];
}
}
});
}
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/ViewController/InspectUploadedViewController.m
View file @
0fa012c4
...
...
@@ -130,6 +130,7 @@
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
imageView
.
tag
-
1113
;
largeVC
.
allImageArray
=
_allImageURL
;
largeVC
.
pictureSaveMode
=
PictureNetWorkMode
;
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
// CheckPicViewController *checkVC = [[CheckPicViewController alloc] init];
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/ViewController/RankDetailViewController.m
View file @
0fa012c4
...
...
@@ -169,6 +169,7 @@
{
LargePictureViewController
*
largePVC
=
[[
LargePictureViewController
alloc
]
init
];
largePVC
.
allImageArray
=
_allImageArray
;
largePVC
.
pictureSaveMode
=
PictureNetWorkMode
;
largePVC
.
index
=
btn
.
tag
-
1112
;
[
self
.
navigationController
pushViewController
:
largePVC
animated
:
YES
];
...
...
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