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
d24f65b9
Commit
d24f65b9
authored
9 years ago
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片添加左右滑动 放大
parent
b8f86f8d
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
575 additions
and
77 deletions
+575
-77
project.pbxproj
redstar.xcodeproj/project.pbxproj
+6
-0
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
+29
-0
LargePictureViewController.m
redstar/Classes/Module/Check/LargePictureViewController.m
+182
-0
LookOnLineDetailViewController.m
...ineDetail/ViewController/LookOnLineDetailViewController.m
+75
-13
OnLineResultDetailCell.h
...ion/OnLine/LookOnLineResult/Cell/OnLineResultDetailCell.h
+7
-1
OnLineResultDetailCell.m
...ion/OnLine/LookOnLineResult/Cell/OnLineResultDetailCell.m
+47
-17
OnLineResultFootView.h
...ction/OnLine/LookOnLineResult/View/OnLineResultFootView.h
+9
-0
OnLineResultFootView.m
...ction/OnLine/LookOnLineResult/View/OnLineResultFootView.m
+10
-2
OnLineResultViewController.m
...kOnLineResult/ViewController/OnLineResultViewController.m
+58
-5
PictureTextTableCell.m
...unction/Picture/PictureDetail/Cell/PictureTextTableCell.m
+1
-4
PictureStoryViewController.m
...PictureDetail/ViewController/PictureStoryViewController.m
+30
-11
PictureTableCell.m
...dule/Function/Picture/PictureList/Cell/PictureTableCell.m
+2
-0
AddQuestionViewController.m
...on/AddQuestion/ViewController/AddQuestionViewController.m
+15
-6
QuestionDescribeCell.h
...ction/Question/QuestionDetail/Cell/QuestionDescribeCell.h
+8
-0
QuestionDescribeCell.m
...ction/Question/QuestionDetail/Cell/QuestionDescribeCell.m
+12
-0
QuestionDetailViewController.m
...stionDetail/ViewController/QuestionDetailViewController.m
+26
-2
InspectUpLoadFootView.m
...fMouth/Inspect/InspectDetail/View/InspectUpLoadFootView.m
+3
-1
InspectNotUploadViewController.m
...ectDetail/ViewController/InspectNotUploadViewController.m
+14
-6
InspectUploadedViewController.m
...pectDetail/ViewController/InspectUploadedViewController.m
+20
-3
RankDetailViewController.m
...king/RankDetail/ViewController/RankDetailViewController.m
+19
-4
No files found.
redstar.xcodeproj/project.pbxproj
View file @
d24f65b9
...
...
@@ -88,6 +88,7 @@
849B2F711C0CA22F005D809F
/* AnnoContentTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
849B2F701C0CA22F005D809F
/* AnnoContentTableViewCell.m */
;
};
849B2F741C0CA60E005D809F
/* AnnounceDetailFootView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
849B2F731C0CA60E005D809F
/* AnnounceDetailFootView.m */
;
};
849B2F771C0CABE6005D809F
/* AnnounceDetailModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
849B2F761C0CABE6005D809F
/* AnnounceDetailModel.m */
;
};
849F3F271C438A8300080F91
/* LargePictureViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
849F3F261C438A8300080F91
/* LargePictureViewController.m */
;
};
84A2270E1C229409002766DC
/* RankPickView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84A2270D1C229409002766DC
/* RankPickView.m */
;
};
84A673881C0B50B4000F828E
/* OnLineCompleteViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84A673871C0B50B4000F828E
/* OnLineCompleteViewController.m */
;
};
84A6738E1C0BE2D0000F828E
/* OnLineCompleteCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84A6738D1C0BE2D0000F828E
/* OnLineCompleteCell.m */
;
};
...
...
@@ -351,6 +352,8 @@
849B2F731C0CA60E005D809F
/* AnnounceDetailFootView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
AnnounceDetailFootView.m
;
sourceTree
=
"<group>"
;
};
849B2F751C0CABE6005D809F
/* AnnounceDetailModel.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
AnnounceDetailModel.h
;
sourceTree
=
"<group>"
;
};
849B2F761C0CABE6005D809F
/* AnnounceDetailModel.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
AnnounceDetailModel.m
;
sourceTree
=
"<group>"
;
};
849F3F251C438A8300080F91
/* LargePictureViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
LargePictureViewController.h
;
sourceTree
=
"<group>"
;
};
849F3F261C438A8300080F91
/* LargePictureViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
LargePictureViewController.m
;
sourceTree
=
"<group>"
;
};
84A2270C1C229409002766DC
/* RankPickView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
RankPickView.h
;
sourceTree
=
"<group>"
;
};
84A2270D1C229409002766DC
/* RankPickView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
RankPickView.m
;
sourceTree
=
"<group>"
;
};
84A673861C0B50B4000F828E
/* OnLineCompleteViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
OnLineCompleteViewController.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -691,6 +694,8 @@
children
=
(
841D24F61BEB473C0005CC9F
/* CheckPicViewController.h */
,
841D24F71BEB473C0005CC9F
/* CheckPicViewController.m */
,
849F3F251C438A8300080F91
/* LargePictureViewController.h */
,
849F3F261C438A8300080F91
/* LargePictureViewController.m */
,
);
path
=
Check
;
sourceTree
=
"<group>"
;
...
...
@@ -2537,6 +2542,7 @@
8474C5911BE78A85007DCF19
/* QuestionListTableCell.m in Sources */
,
8490C4D71BF9DF1D006B6569
/* PictureStoryViewController.m in Sources */
,
84D554EE1C0EDFB8006C9AD0
/* SearchViewController.m in Sources */
,
849F3F271C438A8300080F91
/* LargePictureViewController.m in Sources */
,
84A673C01C0C7AEB000F828E
/* FuncItem.m in Sources */
,
84F1669B1BE715E40061D350
/* ZanButton.m in Sources */
,
84D863701C1148EC00E4F4CC
/* InspectPicAddCell.m in Sources */
,
...
...
This diff is collapsed.
Click to expand it.
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
d24f65b9
No preview for this file type
This diff is collapsed.
Click to expand it.
redstar/Classes/Macro/Url.h
View file @
d24f65b9
...
...
@@ -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/"
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Check/LargePictureViewController.h
0 → 100644
View file @
d24f65b9
//
// LargePictureViewController.h
// redstar
//
// Created by admin on 16/1/8.
// Copyright © 2016年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef
NS_ENUM
(
NSInteger
,
PictureSaveMode
)
{
PictureNetWorkMode
=
0
,
PictureLocalMode
=
1
};
@interface
LargePictureViewController
:
UIViewController
<
UIScrollViewDelegate
>
{
CGFloat
offset
;
}
@property
(
nonatomic
,
strong
)
NSArray
*
allImageArray
;
@property
(
nonatomic
,
assign
)
NSInteger
index
;
@property
(
nonatomic
,
strong
)
UIScrollView
*
imageScrollView
;
@property
(
nonatomic
,
assign
)
PictureSaveMode
pictureSaveMode
;
-
(
CGRect
)
zoomRectForScale
:(
float
)
scale
inView
:(
UIScrollView
*
)
scrollView
withCenter
:(
CGPoint
)
center
;
@end
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Check/LargePictureViewController.m
0 → 100644
View file @
d24f65b9
//
// LargePictureViewController.m
// redstar
//
// Created by admin on 16/1/8.
// Copyright © 2016年 ZWF. All rights reserved.
//
#import "LargePictureViewController.h"
#import <UIImageView+WebCache.h>
@interface
LargePictureViewController
()
@property
float
scale_
;
@end
@implementation
LargePictureViewController
@synthesize
imageScrollView
;
@synthesize
scale_
;
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
offset
=
0
.
0
;
scale_
=
1
.
0
;
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
imageScrollView
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
(
-
20
,
-
15
,
(
kScreenWidth
+
40
),
(
kScreenHeight
-
20
))];
self
.
imageScrollView
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
imageScrollView
.
scrollEnabled
=
YES
;
self
.
imageScrollView
.
pagingEnabled
=
YES
;
self
.
imageScrollView
.
delegate
=
self
;
//self.imageScrollView.contentSize = CGSizeMake((kScreenWidth + 40) * _allImageArray.count, (kScreenHeight - 20));
self
.
imageScrollView
.
contentSize
=
CGSizeMake
((
kScreenWidth
+
40
)
*
_allImageArray
.
count
,
0
);
self
.
imageScrollView
.
contentOffset
=
CGPointMake
(
self
.
index
*
(
kScreenWidth
+
40
),
0
);
for
(
int
i
=
0
;
i
<
_allImageArray
.
count
;
i
++
){
UITapGestureRecognizer
*
doubleTap
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
handleDoubleTap
:
)];
[
doubleTap
setNumberOfTapsRequired
:
2
];
UIScrollView
*
s
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
((
kScreenWidth
+
40
)
*
i
,
0
,
(
kScreenWidth
+
40
),
(
kScreenHeight
-
20
))];
s
.
backgroundColor
=
[
UIColor
clearColor
];
//s.contentSize = CGSizeMake((kScreenWidth + 40), (kScreenHeight - 20));
s
.
contentSize
=
CGSizeMake
((
kScreenWidth
+
40
),
0
);
s
.
showsHorizontalScrollIndicator
=
NO
;
s
.
showsVerticalScrollIndicator
=
NO
;
s
.
delegate
=
self
;
s
.
minimumZoomScale
=
1
.
0
;
s
.
maximumZoomScale
=
3
.
0
;
s
.
tag
=
i
+
1
;
[
s
setZoomScale
:
1
.
0
];
UIImageView
*
imageview
=
[[
UIImageView
alloc
]
init
];
if
(
self
.
pictureSaveMode
==
PictureLocalMode
)
{
NSString
*
imageName
=
_allImageArray
[
i
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
imageview
.
image
=
image
;
}
else
{
[
imageview
sd_setImageWithURL
:
_allImageArray
[
i
]
placeholderImage
:[
UIImage
imageNamed
:
@"default_pic"
]];
}
imageview
.
frame
=
CGRectMake
(
20
,
0
,
kScreenWidth
,
(
kScreenHeight
-
20
));
[
imageview
setContentMode
:
UIViewContentModeScaleAspectFit
];
imageview
.
userInteractionEnabled
=
YES
;
imageview
.
tag
=
i
+
1
;
[
imageview
addGestureRecognizer
:
doubleTap
];
[
s
addSubview
:
imageview
];
[
self
.
imageScrollView
addSubview
:
s
];
}
[
self
.
view
addSubview
:
self
.
imageScrollView
];
}
#pragma mark - ScrollView delegate
-
(
UIView
*
)
viewForZoomingInScrollView
:
(
UIScrollView
*
)
scrollView
{
for
(
UIView
*
v
in
scrollView
.
subviews
){
return
v
;
}
return
nil
;
}
-
(
void
)
scrollViewDidEndDecelerating
:
(
UIScrollView
*
)
scrollView
{
if
(
scrollView
==
self
.
imageScrollView
){
CGFloat
x
=
scrollView
.
contentOffset
.
x
;
if
(
x
==
offset
){
}
else
{
offset
=
x
;
for
(
UIScrollView
*
s
in
scrollView
.
subviews
){
if
([
s
isKindOfClass
:[
UIScrollView
class
]]){
[
s
setZoomScale
:
1
.
0
];
UIImageView
*
image
=
[[
s
subviews
]
objectAtIndex
:
0
];
image
.
frame
=
CGRectMake
(
20
,
0
,
kScreenWidth
,
(
kScreenHeight
-
20
));
}
}
}
}
}
-
(
void
)
scrollViewDidZoom
:
(
UIScrollView
*
)
scrollView
{
NSLog
(
@"Did zoom!"
);
UIView
*
v
=
[
scrollView
.
subviews
objectAtIndex
:
0
];
if
([
v
isKindOfClass
:[
UIImageView
class
]]){
if
(
scrollView
.
zoomScale
<
1
.
0
){
// v.center = CGPointMake(scrollView.frame.size.width/2.0, scrollView.frame.size.height/2.0);
}
}
}
#pragma mark -
-
(
void
)
handleDoubleTap
:
(
UIGestureRecognizer
*
)
gesture
{
float
newScale
=
[(
UIScrollView
*
)
gesture
.
view
.
superview
zoomScale
]
*
1
.
5
;
CGRect
zoomRect
=
[
self
zoomRectForScale
:
newScale
inView
:(
UIScrollView
*
)
gesture
.
view
.
superview
withCenter
:
[
gesture
locationInView
:
gesture
.
view
]];
UIView
*
view
=
gesture
.
view
.
superview
;
if
([
view
isKindOfClass
:[
UIScrollView
class
]]){
UIScrollView
*
s
=
(
UIScrollView
*
)
view
;
[
s
zoomToRect
:
zoomRect
animated
:
YES
];
}
}
#pragma mark - Utility methods
-
(
CGRect
)
zoomRectForScale
:
(
float
)
scale
inView
:
(
UIScrollView
*
)
scrollView
withCenter
:
(
CGPoint
)
center
{
CGRect
zoomRect
;
zoomRect
.
size
.
height
=
[
scrollView
frame
].
size
.
height
/
scale
;
zoomRect
.
size
.
width
=
[
scrollView
frame
].
size
.
width
/
scale
;
zoomRect
.
origin
.
x
=
center
.
x
-
(
zoomRect
.
size
.
width
/
2
.
0
);
zoomRect
.
origin
.
y
=
center
.
y
-
(
zoomRect
.
size
.
height
/
2
.
0
);
return
zoomRect
;
}
-
(
CGRect
)
resizeImageSize
:
(
CGRect
)
rect
{
// NSLog(@"x:%f y:%f width:%f height:%f ", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
CGRect
newRect
;
CGSize
newSize
;
CGPoint
newOri
;
CGSize
oldSize
=
rect
.
size
;
if
(
oldSize
.
width
>=
kScreenWidth
||
oldSize
.
height
>=
(
kScreenHeight
-
20
)){
float
scale
=
(
oldSize
.
width
/
kScreenWidth
>
oldSize
.
height
/
(
kScreenHeight
-
20
)?
oldSize
.
width
/
kScreenWidth
:
oldSize
.
height
/
(
kScreenHeight
-
20
));
newSize
.
width
=
oldSize
.
width
/
scale
;
newSize
.
height
=
oldSize
.
height
/
scale
;
}
else
{
newSize
=
oldSize
;
}
newOri
.
x
=
(
kScreenWidth
-
newSize
.
width
)
/
2
.
0
;
newOri
.
y
=
((
kScreenHeight
-
20
)
-
newSize
.
height
)
/
2
.
0
;
newRect
.
size
=
newSize
;
newRect
.
origin
=
newOri
;
return
newRect
;
}
@end
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/OnLine/LookOnLineDetail/ViewController/LookOnLineDetailViewController.m
View file @
d24f65b9
...
...
@@ -19,14 +19,16 @@
#define kOnLineInspectPicAddCell @"onLineInspectPicAddCell"
#import "InpectPictureCell.h"
#define kOnLineInpectPictureCell @"onLineInpectPictureCell"
#import "LargePictureViewController.h"
#define kLookOnLineDetailCell @"LookOnLineDetailCell"
@interface
LookOnLineDetailViewController
()
<
UIAlertViewDelegate
,
UITableViewDelegate
,
UITableViewDataSource
,
UINavigationControllerDelegate
,
UIImagePickerControllerDelegate
>
@interface
LookOnLineDetailViewController
()
<
UIAlertViewDelegate
,
UITableViewDelegate
,
UITableViewDataSource
,
UINavigationControllerDelegate
,
UIImagePickerControllerDelegate
,
UIActionSheetDelegate
>
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
LookOnLineDetailView
*
headerView
;
@property
(
nonatomic
,
strong
)
LookOnLineFootView
*
footView
;
@property
(
nonatomic
,
strong
)
UIActionSheet
*
selectActionSheet
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
imageNameArray
;
@property
(
nonatomic
,
assign
)
int
rowNumber
;
...
...
@@ -97,23 +99,37 @@
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
//- (void)createImagePicker:(UIButton *)sender
//{
// if (sender.tag == 22011) {
// _rowNumber++;
// }
//
// if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"找不到相机" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
// [alert show];
// } else {
// UIImagePickerController *picker = [[UIImagePickerController alloc] init];
// picker.delegate = self;
// picker.sourceType = UIImagePickerControllerSourceTypeCamera;
// picker.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
// picker.videoQuality = UIImagePickerControllerQualityTypeLow;
// [self presentViewController:picker animated:YES completion:nil];
// }
//}
-
(
void
)
createImagePicker
:
(
UIButton
*
)
sender
{
self
.
selectActionSheet
=
[[
UIActionSheet
alloc
]
initWithTitle
:
nil
delegate
:
self
cancelButtonTitle
:
@"取消"
destructiveButtonTitle
:
nil
otherButtonTitles
:
@"直接拍照上传"
,
@"从本地相册选择"
,
nil
];
_selectActionSheet
.
delegate
=
self
;
_selectActionSheet
.
tag
=
999283
;
[
_selectActionSheet
showInView
:
self
.
view
];
if
(
sender
.
tag
==
22011
)
{
_rowNumber
++
;
}
if
(
!
[
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
nil
message
:
@"找不到相机"
delegate
:
nil
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
}
else
{
UIImagePickerController
*
picker
=
[[
UIImagePickerController
alloc
]
init
];
picker
.
delegate
=
self
;
picker
.
sourceType
=
UIImagePickerControllerSourceTypeCamera
;
picker
.
modalTransitionStyle
=
UIModalTransitionStyleFlipHorizontal
;
picker
.
videoQuality
=
UIImagePickerControllerQualityTypeLow
;
[
self
presentViewController
:
picker
animated
:
YES
completion
:
nil
];
}
}
...
...
@@ -132,6 +148,46 @@
[
imageData
writeToFile
:
fullPath
atomically
:
NO
];
}
-
(
void
)
showLookOnLinePic
:
(
UIButton
*
)
sender
{
LargePictureViewController
*
lager
=
[[
LargePictureViewController
alloc
]
init
];
lager
.
index
=
sender
.
tag
-
1118
;
lager
.
pictureSaveMode
=
PictureLocalMode
;
lager
.
allImageArray
=
_imageNameArray
;
[
self
.
navigationController
pushViewController
:
lager
animated
:
YES
];
}
#pragma mark - UIActionSheetDelegate
-
(
void
)
actionSheet
:
(
UIActionSheet
*
)
actionSheet
didDismissWithButtonIndex
:
(
NSInteger
)
buttonIndex
{
if
(
actionSheet
.
tag
==
999283
)
{
if
(
buttonIndex
==
0
)
{
if
(
!
[
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
nil
message
:
@"找不到相机"
delegate
:
nil
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
}
else
{
UIImagePickerController
*
picker
=
[[
UIImagePickerController
alloc
]
init
];
picker
.
delegate
=
self
;
picker
.
sourceType
=
UIImagePickerControllerSourceTypeCamera
;
picker
.
modalTransitionStyle
=
UIModalTransitionStyleFlipHorizontal
;
picker
.
videoQuality
=
UIImagePickerControllerQualityTypeLow
;
[
self
presentViewController
:
picker
animated
:
YES
completion
:
nil
];
}
}
else
if
(
buttonIndex
==
1
){
UIImagePickerController
*
picker
=
[[
UIImagePickerController
alloc
]
init
];
picker
.
sourceType
=
UIImagePickerControllerSourceTypePhotoLibrary
;
picker
.
delegate
=
self
;
//设置选择后的图片可被编辑
picker
.
allowsEditing
=
YES
;
[
self
presentViewController
:
picker
animated
:
YES
completion
:
nil
];
}
}
}
#pragma mark - TableView Delegate/DateSource
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
...
...
@@ -228,6 +284,8 @@
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
[
cell
.
photoButton1
setImage
:
image
forState
:
UIControlStateNormal
];
cell
.
photoButton1
.
tag
=
1118
+
_imageNameArray
.
count
-
1
;
[
cell
.
photoButton1
addTarget
:
self
action
:
@selector
(
showLookOnLinePic
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
cell
.
photoButton2
.
tag
=
22011
;
[
cell
.
photoButton2
addTarget
:
self
action
:
@selector
(
createImagePicker
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
...
...
@@ -252,11 +310,15 @@
NSString
*
imageName0
=
_imageNameArray
[(
indexPath
.
row
)
*
2
];
NSString
*
fullPath0
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName0
];
UIImage
*
image0
=
[
UIImage
imageWithContentsOfFile
:
fullPath0
];
[
cell
.
photoButton1
addTarget
:
self
action
:
@selector
(
showLookOnLinePic
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
cell
.
photoButton1
.
tag
=
1118
+
(
indexPath
.
row
)
*
2
;
[
cell
.
photoButton1
setImage
:
image0
forState
:
UIControlStateNormal
];
NSString
*
imageName1
=
_imageNameArray
[(
indexPath
.
row
)
*
2
+
1
];
NSString
*
fullPath1
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName1
];
UIImage
*
image1
=
[
UIImage
imageWithContentsOfFile
:
fullPath1
];
[
cell
.
photoButton2
addTarget
:
self
action
:
@selector
(
showLookOnLinePic
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
cell
.
photoButton2
.
tag
=
1118
+
(
indexPath
.
row
)
*
2
+
1
;
[
cell
.
photoButton2
setImage
:
image1
forState
:
UIControlStateNormal
];
return
cell
;
}
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/OnLine/LookOnLineResult/Cell/OnLineResultDetailCell.h
View file @
d24f65b9
...
...
@@ -7,11 +7,17 @@
//
#import <UIKit/UIKit.h>
@protocol
OnLineResultDetailCellDelegate
<
NSObject
>
-
(
void
)
showOnLineStorePicture
:
(
UIButton
*
)
sender
;
@end
@interface
OnLineResultDetailCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UILabel
*
shopNameLabel
;
@property
(
nonatomic
,
strong
)
UIView
*
whiteView
;
@property
(
nonatomic
,
assign
)
id
<
OnLineResultDetailCellDelegate
>
delegate
;
@property
(
nonatomic
,
strong
)
UILabel
*
addressLabel
;
@property
(
nonatomic
,
strong
)
UIScrollView
*
showScrollView
;
// 轮播图
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/OnLine/LookOnLineResult/Cell/OnLineResultDetailCell.m
View file @
d24f65b9
...
...
@@ -22,30 +22,60 @@
-
(
void
)
setupScrollViewWithStorePictures
:(
NSArray
*
)
storePictures
{
int
imageCount
=
4
;
CGFloat
marginW
=
5
.
0
;
CGFloat
imageViewW
=
90
+
2
*
marginW
;
CGFloat
imageViewH
=
self
.
showScrollView
.
bounds
.
size
.
height
-
4
;
if
(
storePictures
.
count
==
0
)
{
NSInteger
imageCount
=
4
;
self
.
showScrollView
.
contentSize
=
CGSizeMake
(
imageCount
*
imageViewW
,
imageViewH
+
4
);
for
(
int
i
=
0
;
i
<
imageCount
;
i
++
)
{
UIButton
*
button
=
[[
UIButton
alloc
]
init
];
button
.
tag
=
1117
+
i
;
// 这是真正的
// NSDictionary *dict = (NSDictionary *)storePictures[i];
// 这是假的
NSDictionary
*
dict
=
[
NSDictionary
dictionary
];
NSURL
*
imageUrl
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
dict
[
@"fileUrl"
]]];
[
button
sd_setImageWithURL
:
imageUrl
forState
:
UIControlStateNormal
placeholderImage
:
[
UIImage
imageNamed
:
@"default_pic"
]];
button
.
frame
=
CGRectMake
(
i
*
imageViewW
+
2
,
2
,
imageViewW
-
2
*
marginW
,
imageViewH
);
[
button
addTarget
:
self
action
:
@selector
(
showBigPic
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
showScrollView
addSubview
:
button
];
}
}
else
{
NSInteger
imageCount
=
storePictures
.
count
;
self
.
showScrollView
.
contentSize
=
CGSizeMake
(
imageCount
*
imageViewW
,
imageViewH
+
4
);
for
(
int
i
=
0
;
i
<
imageCount
;
i
++
)
{
UIButton
*
button
=
[[
UIButton
alloc
]
init
];
button
.
tag
=
1117
+
i
;
// 这是真正的
NSDictionary
*
dict
=
(
NSDictionary
*
)
storePictures
[
i
];
// 这是假的
// NSDictionary *dict = [NSDictionary dictionary];
NSURL
*
imageUrl
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
dict
[
@"fileUrl"
]]];
[
button
sd_setImageWithURL
:
imageUrl
forState
:
UIControlStateNormal
placeholderImage
:
[
UIImage
imageNamed
:
@"default_pic"
]];
button
.
frame
=
CGRectMake
(
i
*
imageViewW
+
2
,
2
,
imageViewW
-
2
*
marginW
,
imageViewH
);
[
button
addTarget
:
self
action
:
@selector
(
showBigPic
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
showScrollView
addSubview
:
button
];
}
}
self
.
showScrollView
.
contentSize
=
CGSizeMake
(
imageCount
*
imageViewW
,
imageViewH
+
4
);
for
(
int
i
=
0
;
i
<
imageCount
;
i
++
)
{
UIButton
*
button
=
[[
UIButton
alloc
]
init
];
// 这是真正的
// NSDictionary *dict = (NSDictionary *)self.storePictures[i];
// 这是假的
NSDictionary
*
dict
=
[
NSDictionary
dictionary
];
NSURL
*
imageUrl
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
dict
[
@"fileUrl"
]]];
[
button
sd_setImageWithURL
:
imageUrl
forState
:
UIControlStateNormal
placeholderImage
:
[
UIImage
imageNamed
:
@"default_pic"
]];
button
.
frame
=
CGRectMake
(
i
*
imageViewW
+
2
,
2
,
imageViewW
-
2
*
marginW
,
imageViewH
);
//[button addTarget:self action:@selector(showBigPic:) forControlEvents:UIControlEventTouchUpInside];
[
self
.
showScrollView
addSubview
:
button
];
}
}
-
(
void
)
showBigPic
:(
UIButton
*
)
sender
{
if
(
_delegate
&&
[
_delegate
respondsToSelector
:
@selector
(
showOnLineStorePicture
:)])
{
[
_delegate
showOnLineStorePicture
:
sender
];
}
}
-
(
UILabel
*
)
shopNameLabel
{
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/OnLine/LookOnLineResult/View/OnLineResultFootView.h
View file @
d24f65b9
...
...
@@ -8,10 +8,19 @@
#import <UIKit/UIKit.h>
@protocol
OnLineResultFootViewDelegate
<
NSObject
>
-
(
void
)
showOnLinePicture
:
(
UITapGestureRecognizer
*
)
sender
;
@end
@interface
OnLineResultFootView
:
UIView
@property
(
nonatomic
,
strong
)
UILabel
*
introLabel
;
@property
(
nonatomic
,
strong
)
UIButton
*
returnButton
;
@property
(
nonatomic
,
strong
)
UITextView
*
textView
;
@property
(
nonatomic
,
assign
)
id
<
OnLineResultFootViewDelegate
>
delegate
;
-
(
instancetype
)
initWithPicArray
:(
NSArray
*
)
picArray
;
@end
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/OnLine/LookOnLineResult/View/OnLineResultFootView.m
View file @
d24f65b9
...
...
@@ -109,11 +109,12 @@
for
(
int
i
=
0
;
i
<
picArray
.
count
;
i
++
)
{
UIImageView
*
imageView
=
[[
UIImageView
alloc
]
init
];
imageView
.
userInteractionEnabled
=
YES
;
imageView
.
tag
=
1116
+
i
;
NSDictionary
*
dict
=
(
NSDictionary
*
)
picArray
[
i
];
NSURL
*
imageUrl
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
dict
[
@"fileUrl"
]]];
[
imageView
sd_setImageWithURL
:
imageUrl
placeholderImage
:[
UIImage
imageNamed
:
@"default_pic"
]];
//
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageCilck:)];
//
[imageView addGestureRecognizer:tap];
UITapGestureRecognizer
*
tap
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
imageCilck
:
)];
[
imageView
addGestureRecognizer
:
tap
];
int
j
=
0
;
if
((
i
+
1
)
%
2
==
0
)
{
j
=
(
i
+
1
)
/
2
;
...
...
@@ -139,4 +140,11 @@
self
.
height
=
165
+
answerRow
*
(
imageH
+
imageMaginY
)
+
65
;
}
-
(
void
)
imageCilck
:(
UITapGestureRecognizer
*
)
sender
{
if
(
_delegate
&&
[
_delegate
respondsToSelector
:
@selector
(
showOnLinePicture
:)])
{
[
_delegate
showOnLinePicture
:
sender
];
}
}
@end
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/OnLine/LookOnLineResult/ViewController/OnLineResultViewController.m
View file @
d24f65b9
...
...
@@ -9,6 +9,7 @@
#import "OnLineResultViewController.h"
#import "OnLineResultDetailCell.h"
#import "OnLineResultFootView.h"
#import "LargePictureViewController.h"
#import "CommentWithStarView.h"
#import "StoreDetailModel.h"
...
...
@@ -16,13 +17,15 @@
#define kOnLineResultDetailCell @"lookOnLineResultDetailCell"
@interface
OnLineResultViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
UITextViewDelegate
,
UIAlertViewDelegate
>
@interface
OnLineResultViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
UITextViewDelegate
,
UIAlertViewDelegate
,
OnLineResultFootViewDelegate
,
OnLineResultDetailCellDelegate
>
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
OnLineResultFootView
*
footView
;
@property
(
nonatomic
,
strong
)
UIView
*
backGroundView
;
@property
(
nonatomic
,
strong
)
CommentWithStarView
*
commentView
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allImageURL
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allStoreImageURL
;
@end
@implementation
OnLineResultViewController
...
...
@@ -35,6 +38,9 @@
[
self
setupNav
];
self
.
allImageURL
=
[
NSMutableArray
array
];
self
.
allStoreImageURL
=
[
NSMutableArray
array
];
if
([[[
UIDevice
currentDevice
]
systemVersion
]
floatValue
]
>=
7
.
0
)
{
self
.
edgesForExtendedLayout
=
UIRectEdgeNone
;
self
.
extendedLayoutIncludesOpaqueBars
=
NO
;
...
...
@@ -45,6 +51,33 @@
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
self
.
tableView
.
tableFooterView
=
self
.
footView
;
// 现场照片
for
(
int
i
=
0
;
i
<
_storeDetail
.
attachments
.
count
;
i
++
)
{
NSDictionary
*
dict
=
(
NSDictionary
*
)
_storeDetail
.
attachments
[
i
];
NSURL
*
imageUrl
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
dict
[
@"fileUrl"
]]];
[
_allImageURL
addObject
:
imageUrl
];
}
// 现场照片
if
(
_storeDetail
.
storePictures
.
count
==
0
)
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
NSURL
*
imageUrl
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@"
,
kRedStarURL
]];
[
_allStoreImageURL
addObject
:
imageUrl
];
}
}
else
{
for
(
int
i
=
0
;
i
<
_storeDetail
.
storePictures
.
count
;
i
++
)
{
NSDictionary
*
dict
=
(
NSDictionary
*
)
_storeDetail
.
storePictures
[
i
];
NSURL
*
imageUrl
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
dict
[
@"fileUrl"
]]];
[
_allStoreImageURL
addObject
:
imageUrl
];
}
}
}
#pragma mark - Private Mothods
...
...
@@ -125,6 +158,25 @@
}];
}
#pragma mark - OnLineFooterViewDelegate
-
(
void
)
showOnLinePicture
:
(
UITapGestureRecognizer
*
)
sender
{
// 获取到点击的显示图片的按钮
UIImageView
*
imageView
=
(
UIImageView
*
)
sender
.
view
;
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
imageView
.
tag
-
1116
;
largeVC
.
allImageArray
=
_allImageURL
;
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
}
-
(
void
)
showOnLineStorePicture
:
(
UIButton
*
)
sender
{
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
sender
.
tag
-
1117
;
largeVC
.
allImageArray
=
_allStoreImageURL
;
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
}
#pragma mark - UITextView Delegate
-
(
void
)
textViewDidBeginEditing
:
(
UITextView
*
)
textView
{
...
...
@@ -163,8 +215,7 @@
if
(
range
.
location
>=
500
)
{
return
NO
;
}
else
{
}
else
{
return
YES
;
}
}
...
...
@@ -183,6 +234,7 @@
cell
=
[[
OnLineResultDetailCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kOnLineResultDetailCell
storePictures
:
_storeDetail
.
storePictures
];
}
cell
.
contentView
.
backgroundColor
=
kResultTitleBackColor
;
cell
.
delegate
=
self
;
cell
.
shopNameLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
_storeDetail
.
store_name
];
cell
.
whiteView
.
backgroundColor
=
[
UIColor
whiteColor
];
cell
.
addressLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
_storeDetail
.
storeAddress
];
...
...
@@ -246,7 +298,7 @@
_tableView
.
showsHorizontalScrollIndicator
=
NO
;
_tableView
.
rowHeight
=
UITableViewAutomaticDimension
;
_tableView
.
estimatedRowHeight
=
200
.
0
;
[
_tableView
registerClass
:[
OnLineResultDetailCell
class
]
forCellReuseIdentifier
:
kOnLineResultDetailCell
];
//
[_tableView registerClass:[OnLineResultDetailCell class] forCellReuseIdentifier:kOnLineResultDetailCell];
[
self
.
view
addSubview
:
_tableView
];
NSLayoutConstraint
*
tableTop
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
...
...
@@ -267,9 +319,10 @@
-
(
OnLineResultFootView
*
)
footView
{
if
(
!
_footView
)
{
_footView
=
[[
OnLineResultFootView
alloc
]
initWithPicArray
:
_storeDetail
.
storePicture
s
];
_footView
=
[[
OnLineResultFootView
alloc
]
initWithPicArray
:
_storeDetail
.
attachment
s
];
[
_footView
.
returnButton
addTarget
:
self
action
:
@selector
(
returnClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
_footView
.
textView
.
text
=
_storeDetail
.
processNote
;
_footView
.
delegate
=
self
;
}
return
_footView
;
}
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/Picture/PictureDetail/Cell/PictureTextTableCell.m
View file @
d24f65b9
...
...
@@ -29,10 +29,6 @@
_bigImageView
=
[[
UIImageView
alloc
]
init
];
_bigImageView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_bigImageView
.
userInteractionEnabled
=
YES
;
// _bigImageView.contentMode = UIViewContentModeScaleAspectFit;
// _bigImageView.autoresizesSubviews = YES;
// _bigImageView.autoresizingMask =
// UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[
_bigImageView
setContentScaleFactor
:[[
UIScreen
mainScreen
]
scale
]];
_bigImageView
.
contentMode
=
UIViewContentModeScaleAspectFill
;
_bigImageView
.
autoresizingMask
=
UIViewAutoresizingFlexibleHeight
;
...
...
@@ -58,6 +54,7 @@
self
.
bigHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_bigImageView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
_bigH
];
[
self
.
contentView
addConstraint
:
_bigHeight
];
}
return
_bigImageView
;
}
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/Picture/PictureDetail/ViewController/PictureStoryViewController.m
View file @
d24f65b9
...
...
@@ -22,6 +22,7 @@
#import <MBProgressHUD.h>
#import "CommentModel.h"
#import "CommonFunc.h"
#import "LargePictureViewController.h"
#import <UIImageView+WebCache.h>
#import <UIButton+WebCache.h>
...
...
@@ -45,7 +46,7 @@
@property
(
nonatomic
,
copy
)
NSString
*
pictureUuid
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
imageNameArray
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
realImageArray
;
@end
...
...
@@ -63,7 +64,7 @@
[
super
viewDidLoad
];
self
.
picTextArray
=
[
NSMutableArray
array
];
self
.
imageNam
eArray
=
[
NSMutableArray
array
];
self
.
realImag
eArray
=
[
NSMutableArray
array
];
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
automaticallyAdjustsScrollViewInsets
=
NO
;
...
...
@@ -76,6 +77,8 @@
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
self
.
imageNameArray
=
[
NSMutableArray
array
];
[
self
requestPicturePraiseDetail
];
}
...
...
@@ -84,14 +87,12 @@
-
(
void
)
requestPicturePraiseDetail
{
NSString
*
user_uuid
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_uuid"
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@%@?userUuid=%@"
,
kRedStarURL
,
kPicturePraiseDetailURL
,
self
.
uuid
,
user_uuid
];
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
HttpClient
*
http
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
[
http
getPicturePraiseDetailWithCompletion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"图说口碑详情 res ===%@, error = %@"
,
response
,
error
);
NSDictionary
*
dataDict
=
response
[
@"data"
];
PictureDetailModel
*
picDetail
=
[[
PictureDetailModel
alloc
]
init
];
...
...
@@ -112,6 +113,11 @@
[
picText
setValuesForKeysWithDictionary
:
picTextDict
];
[
_picTextArray
addObject
:
picText
];
if
(
picText
.
fileName
.
length
!=
0
)
{
NSString
*
imgFileUrl
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
picText
.
fileUrl
];
[
_realImageArray
addObject
:
imgFileUrl
];
}
NSString
*
imageUrl
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
picTextDict
[
@"fileUrl"
]];
[[
SDWebImageDownloader
sharedDownloader
]
downloadImageWithURL
:[
NSURL
URLWithString
:
imageUrl
]
options
:
SDWebImageDownloaderUseNSURLCache
progress
:
nil
completed
:^
(
UIImage
*
image
,
NSData
*
data
,
NSError
*
error
,
BOOL
finished
)
{
...
...
@@ -123,7 +129,6 @@
}
else
{
imageName
=
[
CommonFunc
md5Data
:
data
];
NSString
*
fullPath
=
[[
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
)
objectAtIndex
:
0
]
stringByAppendingPathComponent
:[
NSString
stringWithFormat
:
@"%@"
,
imageName
]];
// [_imageNameArray addObject:imageName];
[
data
writeToFile
:
fullPath
atomically
:
NO
];
}
...
...
@@ -146,8 +151,6 @@
}];
}
//
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}];
...
...
@@ -321,9 +324,25 @@
-
(
void
)
tapClick
:
(
UIGestureRecognizer
*
)
sender
{
UIImageView
*
showImageView
=
(
UIImageView
*
)
sender
.
view
;
CheckPicViewController
*
checkVC
=
[[
CheckPicViewController
alloc
]
init
];
checkVC
.
checkImage
=
showImageView
.
image
;
[
self
.
navigationController
pushViewController
:
checkVC
animated
:
YES
];
PictureTextTableCell
*
cell
=
(
PictureTextTableCell
*
)
showImageView
.
superview
.
superview
;
NSIndexPath
*
indexPath
=
[
_tableView
indexPathForCell
:
cell
];
NSLog
(
@"indexPath.row ==== %ld"
,
indexPath
.
row
);
PicTextModel
*
picText
=
_picTextArray
[
indexPath
.
row
];
NSString
*
imageHttp
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
picText
.
fileUrl
];
NSLog
(
@"imageHttp === %@"
,
imageHttp
);
NSInteger
index
=
[
_realImageArray
indexOfObject
:
imageHttp
];
NSLog
(
@"indexxxxxxxxx====== %ld"
,
index
);
// 获取到点击的显示图片的按钮
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
index
;
largeVC
.
pictureSaveMode
=
PictureNetWorkMode
;
largeVC
.
allImageArray
=
_realImageArray
;
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
// CheckPicViewController *checkVC = [[CheckPicViewController alloc] init];
// checkVC.checkImage = showImageView.image;
// [self.navigationController pushViewController:checkVC animated:YES];
}
-
(
void
)
didReceiveMemoryWarning
{
...
...
@@ -390,6 +409,7 @@
}
else
if
(
indexPath
.
section
==
1
)
{
PicTextModel
*
picText
=
_picTextArray
[
indexPath
.
row
];
if
(
picText
.
fileName
.
length
==
0
)
{
PictureTextTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kPictureTextTableViewCell
];
if
(
!
cell
)
{
...
...
@@ -641,7 +661,6 @@
HttpClient
*
http
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
__block
PictureStoryViewController
*
weakSelf
=
self
;
[
http
getPicturePraiseDetailWithCompletion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"图说口碑详情 res ===%@, error = %@"
,
response
,
error
);
NSDictionary
*
dataDict
=
response
[
@"data"
];
PictureDetailModel
*
picDetail
=
[[
PictureDetailModel
alloc
]
init
];
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/Picture/PictureList/Cell/PictureTableCell.m
View file @
d24f65b9
...
...
@@ -86,6 +86,8 @@
if
(
!
_titleImageView
)
{
_titleImageView
=
[[
UIImageView
alloc
]
init
];
_titleImageView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_titleImageView
.
contentMode
=
UIViewContentModeScaleAspectFill
;
_titleImageView
.
clipsToBounds
=
YES
;
[
self
.
contentView
addSubview
:
_titleImageView
];
NSLayoutConstraint
*
titleImageTop
=
[
NSLayoutConstraint
constraintWithItem
:
_titleImageView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
28
];
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/Question/AddQuestion/ViewController/AddQuestionViewController.m
View file @
d24f65b9
...
...
@@ -19,6 +19,7 @@
#import <MBProgressHUD.h>
#import "AddQuestionTableCell.h"
#import "UIImage+Fit.h"
#import "LargePictureViewController.h"
#define kPhotoTag 3339922
...
...
@@ -188,12 +189,18 @@
}
-
(
void
)
showPicture
:
(
UIButton
*
)
sender
{
CheckPicViewController
*
checkVC
=
[[
CheckPicViewController
alloc
]
init
];
NSString
*
imageName
=
_imageNameArray
[
sender
.
tag
-
kPhotoTag
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
checkVC
.
checkImage
=
image
;
[
self
.
navigationController
pushViewController
:
checkVC
animated
:
YES
];
LargePictureViewController
*
lager
=
[[
LargePictureViewController
alloc
]
init
];
lager
.
index
=
sender
.
tag
-
kPhotoTag
;
lager
.
pictureSaveMode
=
PictureLocalMode
;
lager
.
allImageArray
=
_imageNameArray
;
[
self
.
navigationController
pushViewController
:
lager
animated
:
YES
];
// CheckPicViewController *checkVC = [[CheckPicViewController alloc] init];
// NSString *imageName = _imageNameArray[sender.tag - kPhotoTag];
// NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
// UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
// checkVC.checkImage = image;
// [self.navigationController pushViewController:checkVC animated:YES];
}
-
(
void
)
addTableView
...
...
@@ -507,6 +514,8 @@
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
UIImage
*
image00
=
[
UIImage
image
:
image
fillSize
:
CGSizeMake
((
kScreenWidth
-
60
)
/
2
,
90
)];
cell
.
photoButton1
.
tag
=
kPhotoTag
+
_imageNameArray
.
count
-
1
;
[
cell
.
photoButton1
addTarget
:
self
action
:
@selector
(
showPicture
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
cell
.
photoButton1
setImage
:
image00
forState
:
UIControlStateNormal
];
cell
.
photoButton2
.
tag
=
2201
;
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/Question/QuestionDetail/Cell/QuestionDescribeCell.h
View file @
d24f65b9
...
...
@@ -9,6 +9,12 @@
#import <UIKit/UIKit.h>
#import "QuestionDetailModel.h"
@protocol
QuestionDescribeDelegate
<
NSObject
>
-
(
void
)
showPicture
:
(
UITapGestureRecognizer
*
)
sender
;
@end
@interface
QuestionDescribeCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
// 标题
@property
(
nonatomic
,
strong
)
UILabel
*
describeLabel
;
// 描述
...
...
@@ -24,4 +30,6 @@
@property
(
nonatomic
,
strong
)
QuestionDetailModel
*
questionDetail
;
@property
(
nonatomic
,
assign
)
id
<
QuestionDescribeDelegate
>
delegate
;
@end
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/Question/QuestionDetail/Cell/QuestionDescribeCell.m
View file @
d24f65b9
...
...
@@ -72,10 +72,15 @@
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
UIImageView
*
imageView
=
[[
UIImageView
alloc
]
init
];
imageView
.
tag
=
1115
+
i
;
imageView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
NSDictionary
*
imageDict
=
questionDetail
.
attachments
[
i
];
NSURL
*
imageURL
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
imageDict
[
@"fileUrl"
]]];
[
imageView
sd_setImageWithURL
:
imageURL
placeholderImage
:[
UIImage
imageNamed
:
@"default_pic"
]];
UITapGestureRecognizer
*
tap
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
bigImageCilck
:
)];
[
imageView
addGestureRecognizer
:
tap
];
[
self
.
pictureView
addSubview
:
imageView
];
int
j
=
0
;
...
...
@@ -137,6 +142,13 @@
}
}
-
(
void
)
bigImageCilck
:
(
UITapGestureRecognizer
*
)
sender
{
if
(
_delegate
&&
[
_delegate
respondsToSelector
:
@selector
(
showPicture
:)])
{
[
_delegate
showPicture
:
sender
];
}
}
#pragma mark - lazy loading
-
(
UILabel
*
)
titleLabel
{
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/Question/QuestionDetail/ViewController/QuestionDetailViewController.m
View file @
d24f65b9
...
...
@@ -10,6 +10,7 @@
#import "QuestionDetailCell.h"
#import "QuestionCommentCell.h"
#import "QuestionDescribeCell.h"
#import "LargePictureViewController.h"
#import "CommentView.h"
#import "HttpClient.h"
...
...
@@ -21,7 +22,7 @@
#define kQuestionDetailCell @"QuestionDetailCell" // 问题详情
#define kQuestionCommentCell @"QuestionCommentCell" // 评论
#define kQuestionDescribeCell @"QuestionDescribeCell" // 问题描述
@interface
QuestionDetailViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
UIAlertViewDelegate
,
UITextViewDelegate
>
@interface
QuestionDetailViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
UIAlertViewDelegate
,
UITextViewDelegate
,
QuestionDescribeDelegate
>
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
UIView
*
backGroundView
;
...
...
@@ -30,6 +31,8 @@
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allCommentArray
;
@property
(
nonatomic
,
assign
)
int
clickNumber
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allImageURL
;
@end
@implementation
QuestionDetailViewController
...
...
@@ -38,6 +41,8 @@
{
[
super
viewDidLoad
];
self
.
allImageURL
=
[
NSMutableArray
array
];
if
([[[
UIDevice
currentDevice
]
systemVersion
]
floatValue
]
>=
7
.
0
)
{
self
.
edgesForExtendedLayout
=
UIRectEdgeNone
;
self
.
extendedLayoutIncludesOpaqueBars
=
NO
;
...
...
@@ -94,6 +99,16 @@
[
comment
setValuesForKeysWithDictionary
:
dict
];
[
_allCommentArray
addObject
:
comment
];
}
for
(
int
i
=
0
;
i
<
_questionDetailModel
.
attachments
.
count
;
i
++
)
{
UIImageView
*
imageView
=
[[
UIImageView
alloc
]
init
];
imageView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
NSDictionary
*
imageDict
=
_questionDetailModel
.
attachments
[
i
];
NSURL
*
imageURL
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
imageDict
[
@"fileUrl"
]]];
[
_allImageURL
addObject
:
imageURL
];
}
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
[
self
.
tableView
reloadData
];
}];
...
...
@@ -259,7 +274,15 @@
}
}
-
(
void
)
showPicture
:
(
UITapGestureRecognizer
*
)
sender
{
// 获取到点击的显示图片的按钮
UIImageView
*
imageView
=
(
UIImageView
*
)
sender
.
view
;
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
imageView
.
tag
-
1115
;
largeVC
.
allImageArray
=
_allImageURL
;
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
}
#pragma mark - UItextDelegate
-
(
void
)
textViewDidBeginEditing
:
(
UITextView
*
)
textView
...
...
@@ -341,6 +364,7 @@
if
(
!
cell
)
{
cell
=
[[
QuestionDescribeCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kQuestionDescribeCell
];
}
cell
.
delegate
=
self
;
cell
.
questionDetail
=
self
.
questionDetailModel
;
return
cell
;
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/View/InspectUpLoadFootView.m
View file @
d24f65b9
...
...
@@ -46,10 +46,12 @@
// 现场照片
for
(
int
i
=
0
;
i
<
answerAttachments
.
count
;
i
++
)
{
UIImageView
*
imageView
=
[[
UIImageView
alloc
]
init
];
imageView
.
tag
=
1113
+
i
;
imageView
.
userInteractionEnabled
=
YES
;
NSDictionary
*
dict
=
(
NSDictionary
*
)
answerAttachments
[
i
];
NSURL
*
imageUrl
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
dict
[
@"fileUrl"
]]];
//imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView
.
contentMode
=
UIViewContentModeScaleAspectFill
;
imageView
.
clipsToBounds
=
YES
;
[
imageView
sd_setImageWithURL
:
imageUrl
placeholderImage
:[
UIImage
imageNamed
:
@"default_pic"
]];
UITapGestureRecognizer
*
tap
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
imageCilck
:
)];
[
imageView
addGestureRecognizer
:
tap
];
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/ViewController/InspectNotUploadViewController.m
View file @
d24f65b9
...
...
@@ -17,6 +17,7 @@
#import "CheckPicViewController.h"
#import "InspectTaskViewController.h"
#import "LargePictureViewController.h"
#import "InspectAddCell.h"
#import "InspectPicAddCell.h"
...
...
@@ -96,12 +97,19 @@
-
(
void
)
showPicture
:
(
UIButton
*
)
sender
{
CheckPicViewController
*
checkVC
=
[[
CheckPicViewController
alloc
]
init
];
NSString
*
imageName
=
_imageNameArray
[
sender
.
tag
-
kPhotoTag
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
checkVC
.
checkImage
=
image
;
[
self
.
navigationController
pushViewController
:
checkVC
animated
:
YES
];
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
sender
.
tag
-
kPhotoTag
;
largeVC
.
allImageArray
=
_imageNameArray
;
largeVC
.
pictureSaveMode
=
PictureLocalMode
;
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
// CheckPicViewController *checkVC = [[CheckPicViewController alloc] init];
// NSString *imageName = _imageNameArray[sender.tag - kPhotoTag];
// NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
// UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
// checkVC.checkImage = image;
// [self.navigationController pushViewController:checkVC animated:YES];
}
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/ViewController/InspectUploadedViewController.m
View file @
d24f65b9
...
...
@@ -10,6 +10,7 @@
#import "InspectNotUpLoadCell.h"
#import "InspectUpLoadFootView.h"
#import "CheckPicViewController.h"
#import "LargePictureViewController.h"
#define kInspectnotLoadTableViewCell @"InspectnotLoadTableViewCell"
#define kInspectReferencePicCell @"InspectReferencePiccell"
...
...
@@ -18,6 +19,9 @@
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
InspectUpLoadFootView
*
footerView
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allImageURL
;
@end
@implementation
InspectUploadedViewController
...
...
@@ -27,6 +31,7 @@
self
.
view
.
backgroundColor
=
kSectionBackGroundColor
;
self
.
allImageURL
=
[
NSMutableArray
array
];
UILabel
*
customLab
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
100
,
30
)];
[
customLab
setTextColor
:[
UIColor
whiteColor
]];
customLab
.
textAlignment
=
NSTextAlignmentCenter
;
...
...
@@ -46,6 +51,13 @@
[
self
.
tableView
registerClass
:[
InspectNotUpLoadCell
class
]
forCellReuseIdentifier
:
kInspectnotLoadTableViewCell
];
self
.
tableView
.
tableFooterView
=
self
.
footerView
;
_tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
for
(
int
i
=
0
;
i
<
self
.
taskModel
.
answerAttachments
.
count
;
i
++
)
{
NSDictionary
*
dict
=
(
NSDictionary
*
)
self
.
taskModel
.
answerAttachments
[
i
];
NSURL
*
imageUrl
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
dict
[
@"fileUrl"
]]];
[
_allImageURL
addObject
:
imageUrl
];
}
}
-
(
void
)
didReceiveMemoryWarning
{
...
...
@@ -115,9 +127,14 @@
{
// 获取到点击的显示图片的按钮
UIImageView
*
imageView
=
(
UIImageView
*
)
sender
.
view
;
CheckPicViewController
*
checkVC
=
[[
CheckPicViewController
alloc
]
init
];
checkVC
.
checkImage
=
imageView
.
image
;
[
self
.
navigationController
pushViewController
:
checkVC
animated
:
YES
];
LargePictureViewController
*
largeVC
=
[[
LargePictureViewController
alloc
]
init
];
largeVC
.
index
=
imageView
.
tag
-
1113
;
largeVC
.
allImageArray
=
_allImageURL
;
[
self
.
navigationController
pushViewController
:
largeVC
animated
:
YES
];
// CheckPicViewController *checkVC = [[CheckPicViewController alloc] init];
// checkVC.checkImage = imageView.image;
// [self.navigationController pushViewController:checkVC animated:YES];
}
...
...
This diff is collapsed.
Click to expand it.
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/ViewController/RankDetailViewController.m
View file @
d24f65b9
...
...
@@ -24,6 +24,7 @@
#import <UIButton+WebCache.h>
#import <RATreeView.h>
#import "LargePictureViewController.h"
#define kRankDetailCell @"RankDetailTableCell"
#define kRankSectionTableCell @"RankSectionTableviewCell"
...
...
@@ -40,6 +41,8 @@
@property
(
nonatomic
,
strong
)
UIView
*
backGroundView
;
@property
(
nonatomic
,
strong
)
CommentView
*
commentView
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allImageArray
;
@end
@implementation
RankDetailViewController
...
...
@@ -49,6 +52,7 @@
self
.
navigationController
.
navigationBar
.
hidden
=
NO
;
self
.
tabBarController
.
tabBar
.
hidden
=
YES
;
}
-
(
void
)
viewDidLoad
...
...
@@ -80,6 +84,8 @@
[
self
.
commentButton
setTitle
:
@"添加评论"
forState
:
UIControlStateNormal
];
// 请求口碑排名详情
[
self
requestRankingDetail
];
self
.
allImageArray
=
[
NSMutableArray
array
];
}
...
...
@@ -146,9 +152,13 @@
for
(
int
i
=
0
;
i
<
imageCount
;
i
++
)
{
UIButton
*
button
=
[[
UIButton
alloc
]
init
];
button
.
tag
=
1112
+
i
;
NSDictionary
*
dict
=
(
NSDictionary
*
)
self
.
storePictures
[
i
];
NSURL
*
imageUrl
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
dict
[
@"fileUrl"
]]];
[
button
sd_setImageWithURL
:
imageUrl
forState
:
UIControlStateNormal
placeholderImage
:
[
UIImage
imageNamed
:
@"default_pic"
]];
[
_allImageArray
addObject
:
imageUrl
];
[
button
sd_setImageWithURL
:
imageUrl
forState
:
UIControlStateNormal
placeholderImage
:
[
UIImage
imageNamed
:
@"default_pic"
]
completed
:^
(
UIImage
*
image
,
NSError
*
error
,
SDImageCacheType
cacheType
,
NSURL
*
imageURL
)
{
//[_allImageArray addObject:image];
}];
button
.
frame
=
CGRectMake
(
i
*
imageViewW
+
2
,
2
,
imageViewW
-
2
*
marginW
,
imageViewH
);
[
button
addTarget
:
self
action
:
@selector
(
showBigPic
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
rankDetailHeaderView
.
rankDetailView
.
showScrollView
addSubview
:
button
];
...
...
@@ -159,9 +169,14 @@
-
(
void
)
showBigPic
:
(
UIButton
*
)
btn
{
CheckPicViewController
*
checkVC
=
[[
CheckPicViewController
alloc
]
init
];
checkVC
.
checkImage
=
btn
.
imageView
.
image
;
[
self
.
navigationController
pushViewController
:
checkVC
animated
:
YES
];
LargePictureViewController
*
largePVC
=
[[
LargePictureViewController
alloc
]
init
];
largePVC
.
allImageArray
=
_allImageArray
;
largePVC
.
index
=
btn
.
tag
-
1112
;
[
self
.
navigationController
pushViewController
:
largePVC
animated
:
YES
];
// CheckPicViewController *checkVC = [[CheckPicViewController alloc] init];
// checkVC.checkImage = btn.imageView.image;
// [self.navigationController pushViewController:checkVC animated:YES];
}
// 返回上一页面
...
...
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