Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
xffruit
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
张杰
xffruit
Commits
6762b7ed
Commit
6762b7ed
authored
Mar 03, 2016
by
管鹏飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
『修改行情反馈』界面及『图片预览』bug修复、性能优化 Sandy
parent
efffd68d
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
231 additions
and
122 deletions
+231
-122
project.pbxproj
XFFruit.xcodeproj/project.pbxproj
+9
-3
ICRAppMacro.h
XFFruit/Macro/ICRAppMacro.h
+1
-0
JavenImages.h
XFFruit/ViewControllers/FeedBack/JavenImages.h
+20
-0
JavenImages.m
XFFruit/ViewControllers/FeedBack/JavenImages.m
+39
-0
HGPhWViewController.m
...ers/FeedBack/TakePhotos/HGPhotoWall/HGPhWViewController.m
+40
-33
HGPhotoWall.m
...Controllers/FeedBack/TakePhotos/HGPhotoWall/HGPhotoWall.m
+3
-4
WriteFeedbackViewController.m
...it/ViewControllers/FeedBack/WriteFeedbackViewController.m
+119
-82
No files found.
XFFruit.xcodeproj/project.pbxproj
View file @
6762b7ed
...
...
@@ -211,6 +211,7 @@
72F9D4881BA8065500795A00
/* PurchaseNoticeListCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72F9D4871BA8065500795A00
/* PurchaseNoticeListCell.m */
;
};
72F9D48B1BA8582100795A00
/* NoticeBoltView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
72F9D48A1BA8582100795A00
/* NoticeBoltView.m */
;
};
871F9F047CDDAC523E4358DC
/* libPods.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
86D33EC280C440156ED1B976
/* libPods.a */
;
};
ABFA26061C87D38800274481
/* JavenImages.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
ABFA26051C87D38800274481
/* JavenImages.m */
;
};
C10214CD1AD8FE200024637E
/* ICRStoreDetailViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C10214CC1AD8FE200024637E
/* ICRStoreDetailViewController.m */
;
};
C10214CE1AD8FE200024637E
/* ICRStoreDetailViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C10214CC1AD8FE200024637E
/* ICRStoreDetailViewController.m */
;
};
C10214D21AD904F30024637E
/* ICRPatrolPlanViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C10214D11AD904F30024637E
/* ICRPatrolPlanViewController.m */
;
};
...
...
@@ -871,6 +872,8 @@
72F9D48A1BA8582100795A00
/* NoticeBoltView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
NoticeBoltView.m
;
sourceTree
=
"<group>"
;
};
7DDFB1D460448C3B45118195
/* Pods.release.xcconfig */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
text.xcconfig
;
name
=
Pods.release.xcconfig
;
path
=
"Pods/Target Support Files/Pods/Pods.release.xcconfig"
;
sourceTree
=
"<group>"
;
};
86D33EC280C440156ED1B976
/* libPods.a */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
archive.ar
;
includeInIndex
=
0
;
path
=
libPods.a
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
ABFA26041C87D38800274481
/* JavenImages.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
JavenImages.h
;
sourceTree
=
"<group>"
;
};
ABFA26051C87D38800274481
/* JavenImages.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
JavenImages.m
;
sourceTree
=
"<group>"
;
};
C10214CB1AD8FE200024637E
/* ICRStoreDetailViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ICRStoreDetailViewController.h
;
sourceTree
=
"<group>"
;
};
C10214CC1AD8FE200024637E
/* ICRStoreDetailViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ICRStoreDetailViewController.m
;
sourceTree
=
"<group>"
;
};
C10214D01AD904F30024637E
/* ICRPatrolPlanViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ICRPatrolPlanViewController.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1437,6 +1440,8 @@
359788621C868EB8009205AA
/* XFDB.m */
,
359788631C868EB8009205AA
/* XFPhoto.h */
,
359788641C868EB8009205AA
/* XFPhoto.m */
,
ABFA26041C87D38800274481
/* JavenImages.h */
,
ABFA26051C87D38800274481
/* JavenImages.m */
,
);
path
=
FeedBack
;
sourceTree
=
"<group>"
;
...
...
@@ -3121,6 +3126,7 @@
C18AEA961AD1425D00A1DB7B
/* ICRDataBaseController.m in Sources */
,
C1E9F5781B2E440A00BF1356
/* JTRecordView.m in Sources */
,
724171711B9D30660094DF55
/* ChooseVendorViewController.m in Sources */
,
ABFA26061C87D38800274481
/* JavenImages.m in Sources */
,
7217E9F31B72364300FE5C1D
/* SurveyCell.m in Sources */
,
C112BC511AD971C500F75F58
/* ICRTaskItemView.m in Sources */
,
7217E9EE1B72364300FE5C1D
/* MaskCell.m in Sources */
,
...
...
@@ -3451,7 +3457,7 @@
CLANG_WARN_UNREACHABLE_CODE
=
YES
;
CLANG_WARN__DUPLICATE_METHOD_MATCH
=
YES
;
CODE_SIGN_IDENTITY
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone D
istribution: Shanghai Gomore Information Technology Co.,Ltd
"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone D
eveloper
"
;
COPY_PHASE_STRIP
=
NO
;
ENABLE_STRICT_OBJC_MSGSEND
=
YES
;
GCC_C_LANGUAGE_STANDARD
=
gnu99
;
...
...
@@ -3496,7 +3502,7 @@
CLANG_WARN_UNREACHABLE_CODE
=
YES
;
CLANG_WARN__DUPLICATE_METHOD_MATCH
=
YES
;
CODE_SIGN_IDENTITY
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone D
istribution: Shanghai Gomore Information Technology Co.,Ltd
"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone D
eveloper: Fanfan Cui (7S27LB84E2)
"
;
COPY_PHASE_STRIP
=
NO
;
ENABLE_NS_ASSERTIONS
=
NO
;
ENABLE_STRICT_OBJC_MSGSEND
=
YES
;
...
...
@@ -3548,7 +3554,7 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CODE_SIGN_IDENTITY
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer
: Fanfan Cui (7S27LB84E2)
"
;
COPYING_PRESERVES_HFS_DATA
=
NO
;
ENABLE_BITCODE
=
NO
;
GCC_PREFIX_HEADER
=
"XFFruit/XFFruit-Prefix.pch"
;
...
...
XFFruit/Macro/ICRAppMacro.h
View file @
6762b7ed
...
...
@@ -53,6 +53,7 @@
#import "Warehouse.h"
#import "Accounttitle.h"
#import "UserWarehouse.h"
#import "JavenImages.h"
...
...
XFFruit/ViewControllers/FeedBack/JavenImages.h
0 → 100644
View file @
6762b7ed
//
// JavenImages.h
// XFFruit
//
// Created by Jonathan on 16/3/3.
// Copyright © 2016年 Xummer. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface
JavenImages
:
NSObject
@property
(
nonatomic
,
strong
)
NSMutableArray
*
imageArr
;
+
(
instancetype
)
shareInstance
;
-
(
void
)
insertImages
:(
NSArray
*
)
array
;
-
(
void
)
insertAImage
:(
UIImage
*
)
image
;
-
(
void
)
removeAllImage
;
@end
XFFruit/ViewControllers/FeedBack/JavenImages.m
0 → 100644
View file @
6762b7ed
//
// JavenImages.m
// XFFruit
//
// Created by Jonathan on 16/3/3.
// Copyright © 2016年 Xummer. All rights reserved.
//
#import "JavenImages.h"
@implementation
JavenImages
static
JavenImages
*
_instance
;
+
(
instancetype
)
shareInstance
{
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
_instance
=
[[
JavenImages
alloc
]
init
];
_instance
.
imageArr
=
[
NSMutableArray
array
];
});
return
_instance
;
}
-
(
void
)
insertImages
:
(
NSArray
*
)
array
{
for
(
UIImage
*
image
in
array
)
{
[
_instance
.
imageArr
addObject
:
image
];
}
}
-
(
void
)
insertAImage
:
(
UIImage
*
)
image
{
[
_instance
.
imageArr
addObject
:
image
];
}
-
(
void
)
removeAllImage
{
[
_instance
.
imageArr
removeAllObjects
];
}
@end
XFFruit/ViewControllers/FeedBack/TakePhotos/HGPhotoWall/HGPhWViewController.m
View file @
6762b7ed
...
...
@@ -55,21 +55,22 @@ static HGPhWViewController *_instance = nil;
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
self
.
title
=
@"图片预览"
;
[
self
initHGPhW
];
//
[self initHGPhW];
[
self
initData
];
self
.
imgesMuArr
=
[
NSMutableArray
array
];
}
-
(
void
)
viewDidDisappear
:
(
BOOL
)
animated
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
kimgsFiles
object
:
self
];
}
-
(
void
)
initData
{
self
.
imgesMuArr
=
[
NSMutableArray
array
];
// self.allImgsMuArr = [NSMutableArray array];
// self.allImgAssets = [NSMutableArray array];
NSArray
*
arrData
=
[[
XFDB
sharedInstance
]
fetchAllPhotosFromLocal
];
for
(
int
count
=
0
;
count
<
arrData
.
count
;
count
++
)
{
XFPhoto
*
xfphoto
=
arrData
[
count
];
[
self
addOnePhoto
:[
UIImage
imageWithData
:
xfphoto
.
photoData
]];
}
//
self.imgesMuArr = [NSMutableArray array];
//
//
self.allImgsMuArr = [NSMutableArray array];
//
//
self.allImgAssets = [NSMutableArray array];
//
NSArray *arrData = [[XFDB sharedInstance]fetchAllPhotosFromLocal];
//
for (int count = 0; count < arrData.count; count ++) {
//
XFPhoto *xfphoto = arrData[count];
//
[self addOnePhoto:[UIImage imageWithData:xfphoto.photoData]];
//
}
}
-
(
void
)
initHGPhW
{
self
.
edgesForExtendedLayout
=
NO
;
...
...
@@ -94,7 +95,7 @@ static HGPhWViewController *_instance = nil;
_photoWall
.
delegate
=
self
;
#pragma 初始化原来的图片数据 从数据库中读出
[
_photoWall
setPhotos
:
nil
];
//
[
_photoWall
setPhotos
:
[
JavenImages
shareInstance
].
imageArr
];
//
// @"http://www.weiphone.com/images_v3/logo.png",nil]];
[
_photoWall
setEditModel
:
YES
];
...
...
@@ -232,24 +233,25 @@ static HGPhWViewController *_instance = nil;
UIImage
*
img
=
[
info
objectForKey
:
UIImagePickerControllerOriginalImage
];
[
self
addOnePhoto
:
img
];
NSData
*
imgData
=
UIImagePNGRepresentation
(
img
);
[
self
savePhotoToDB
:
imgData
];
//
NSData *imgData = UIImagePNGRepresentation(img);
//
[self savePhotoToDB:imgData];
// [self.allImgsMuArr addObject:imgData];
[[
JavenImages
shareInstance
]
insertAImage
:
img
];
[
self
scrollViewContentHeight
];
[
picker
DismissModalViewControllerAnimated
:
YES
];
}
#pragma 把选择的图片放入到本地数据库中
-
(
void
)
savePhotoToDB
:
(
NSData
*
)
imgData
{
XFPhoto
*
xfphoto
=
[[
XFPhoto
alloc
]
initWithPhotoData
:
imgData
];
BOOL
isSave
=
[[
XFDB
sharedInstance
]
savePhoto
:
xfphoto
];
if
(
isSave
)
{
NSLog
(
@"保存成功"
);
}
else
{
NSLog
(
@"保存失败"
);
}
//
XFPhoto *xfphoto = [[XFPhoto alloc]initWithPhotoData:imgData];
// BOOL isSave = [[setImage
sharedInstance]savePhoto:xfphoto];
//
if (isSave) {
//
NSLog(@"保存成功");
//
} else {
//
NSLog(@"保存失败");
//
}
}
#pragma mark - ZYQAssetPickerController Delegate
-
(
void
)
assetPickerController
:
(
ZYQAssetPickerController
*
)
picker
didFinishPickingAssets
:
(
NSArray
*
)
assets
{
...
...
@@ -259,19 +261,18 @@ static HGPhWViewController *_instance = nil;
[
_imgesMuArr
removeAllObjects
];
}
// dispatch_async(dispatch_get_global_queue(0, 0), ^{
for
(
int
i
=
0
;
i
<
assets
.
count
;
i
++
)
{
ALAsset
*
asset
=
assets
[
i
];
CGImageRef
ref
=
[[
asset
defaultRepresentation
]
fullResolutionImage
];
UIImage
*
img
=
[[
UIImage
alloc
]
initWithCGImage
:
ref
];
NSData
*
imgData
=
UIImagePNGRepresentation
(
img
);
[
self
savePhotoToDB
:
imgData
];
// UIImage *tempImg = [UIImage imageWithCGImage:[asset po]];
[
self
.
imgesMuArr
addObject
:
img
];
//[UIImage imageNamed:@"AttachCamera"]
// [self.allImgsMuArr addObject:imgData];
}
[[
JavenImages
shareInstance
]
insertImages
:
_imgesMuArr
];
[
self
addPhotosWithArrayImgs
:
_imgesMuArr
];
// });
[
self
scrollViewContentHeight
];
[
picker
popoverPresentationController
];
...
...
@@ -279,7 +280,7 @@ static HGPhWViewController *_instance = nil;
#pragma 调整scrollView内容视图内容高度
-
(
void
)
scrollViewContentHeight
{
NSArray
*
arr
=
[
[
XFDB
sharedInstance
]
fetchAllPhotosFromLocal
]
;
NSArray
*
arr
=
[
JavenImages
shareInstance
].
imageArr
;
NSInteger
count
=
1
;
if
((
arr
.
count
+
1
)
%
kImagCount
)
{
count
+=
(
arr
.
count
+
1
)
/
kImagCount
+
1
;
...
...
@@ -290,6 +291,12 @@ static HGPhWViewController *_instance = nil;
self
.
scrollV
.
contentSize
=
_photoWall
.
size
;
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
[
self
.
view
removeAllSubViews
];
[
self
initHGPhW
];
}
#pragma 确定选择的照片
-
(
void
)
surePhoto
{
...
...
XFFruit/ViewControllers/FeedBack/TakePhotos/HGPhotoWall/HGPhotoWall.m
View file @
6762b7ed
...
...
@@ -87,7 +87,7 @@
CGFloat
originy
=
[[
dictionaryTemp
objectForKey
:
kImagePositiony
]
floatValue
];
HGPhoto
*
photoTemp
=
[[
HGPhoto
alloc
]
initWithOrigin
:
CGPointMake
(
originx
,
originy
)
andLength
:
kImagWH
];
//[[HGPhoto alloc] initWithOrigin:CGPointMake(originx, originy)];
photoTemp
.
delegate
=
self
;
[
photoTemp
setPhoto
Url
:[
photos
objectAtIndex
:
i
]];
[
photoTemp
setPhoto
Img
:[
photos
objectAtIndex
:
i
]];
[
self
addSubview
:
photoTemp
];
[
self
.
arrayPhotos
addObject
:
photoTemp
];
}
...
...
@@ -141,9 +141,7 @@
x
=
kPadding
*
(
col
+
1
)
+
kImagCount
*
col
;
y
=
15
.
0
/
568
*
self
.
height
+
kImagWH
*
row
+
row
*
kPadding
;
[
self
.
arrayPositions
addObject
:[
NSDictionary
dictionaryWithObjectsAndKeys
:[
NSString
stringWithFormat
:
@"%f"
,
x
],
kImagePositionx
,[
NSString
stringWithFormat
:
@"%f"
,
y
],
kImagePositiony
,
nil
]
];
// if (_arrayPositions.count % 4 ) {
// <#statements#>
// }
NSUInteger
index
=
[
self
.
arrayPhotos
count
]
-
1
;
NSDictionary
*
dictionaryTemp
=
[
self
.
arrayPositions
objectAtIndex
:
index
];
CGFloat
originx
=
[[
dictionaryTemp
objectForKey
:
kImagePositionx
]
floatValue
];
...
...
@@ -273,6 +271,7 @@
}
else
{
count
=
[
self
.
arrayPhotos
count
]
-
1
;
}
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
NSDictionary
*
dictionaryTemp
=
[
self
.
arrayPositions
objectAtIndex
:
i
];
CGFloat
originx
=
[[
dictionaryTemp
objectForKey
:
kImagePositionx
]
floatValue
];
...
...
XFFruit/ViewControllers/FeedBack/WriteFeedbackViewController.m
View file @
6762b7ed
...
...
@@ -33,6 +33,8 @@
@property
(
strong
,
nonatomic
)
UIActionSheet
*
m_actionSheet
;
@property
(
strong
,
nonatomic
)
NSMutableArray
*
imgesMuArr
;
@property
(
strong
,
nonatomic
)
SurveyResult
*
surveyResult
;
@property
(
strong
,
nonatomic
)
UIImageView
*
headImageView
;
@property
(
nonatomic
,
strong
)
UIImageView
*
noImageHeadView
;
//@property (strong, nonatomic) NSDictionary *surveyResultDict;
//@property (strong, nonatomic) HGPhWViewController *hgphVC;
...
...
@@ -84,9 +86,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
-
(
void
)
initData
{
self
.
imgesMuArr
=
[
NSMutableArray
array
];
ICRUserUtil
*
user
=
[
ICRUserUtil
sharedInstance
];
// self.surveyResultDict = @{@"userUuid":user.userId,@"userCode":@"",@"userName":@"",@"price":[NSNull null],@"unit":[NSNull null],@"place":[NSNull null],@"capacity":[NSNull null],@"quality":[NSNull null]};
void
(
^
succ
)(
id
)
=
^
(
id
data
){
};
...
...
@@ -123,25 +123,20 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
backView
.
backgroundColor
=
HexColor
(
@"7ebf74"
);
//ICR_TABBAR_TINT_COLOR;
[
self
.
view
addSubview
:
backView
];
UIImageView
*
imgV
=
[[
UIImageView
alloc
]
init
];
imgV
.
userInteractionEnabled
=
YES
;
//[img originImage:img scaleToSize:CGSizeMake(50,50)];//(imgV.width / 2.0, imgV.height / 2.0)];
//[img originImage:img scaleToSize:CGSizeMake(50,50)];//(imgV.width / 2.0, imgV.height / 2.0)];
UITapGestureRecognizer
*
tpGes
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
selectPhotos
:
)];
tpGes
.
numberOfTapsRequired
=
1
;
[
imgV
addGestureRecognizer
:
tpGes
];
[
backView
addSubview
:
imgV
];
_headImageView
=
imgV
;
NSArray
*
photosArr
=
[[
XFDB
sharedInstance
]
fetchAllPhotosFromLocal
];
if
(
photosArr
.
count
>
0
)
{
//if ([JavenImages shareInstance].imageArr.count > 0) {
imgV
.
frame
=
backView
.
frame
;
XFPhoto
*
xfphonto
=
(
XFPhoto
*
)
photosArr
[
0
];
// NSData *da = xfphonto.photoData;
imgV
.
image
=
[
UIImage
imageWithData
:
xfphonto
.
photoData
];
UIImage
*
img
=
[
UIImage
imageWithData
:
xfphonto
.
photoData
];
//imgV.image = [JavenImages shareInstance].imageArr[0];
UIButton
*
btn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
btn
.
frame
=
(
CGRect
){
...
...
@@ -163,24 +158,29 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
[
delbtn
addTarget
:
self
action
:
@selector
(
photosDisplay
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
delbtn
setBackgroundImage
:[
UIImage
imageNamed
:
@"xf_delete_pic"
]
forState
:
UIControlStateNormal
];
[
imgV
addSubview
:
delbtn
];
}
else
{
imgV
.
frame
=
(
CGRect
){
_headImageView
.
hidden
=
YES
;
_noImageHeadView
=
[[
UIImageView
alloc
]
init
];
_noImageHeadView
.
userInteractionEnabled
=
YES
;
UITapGestureRecognizer
*
tpGes2
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
selectPhotos
:
)];
tpGes2
.
numberOfTapsRequired
=
1
;
[
_noImageHeadView
addGestureRecognizer
:
tpGes2
];
[
backView
addSubview
:
_noImageHeadView
];
_noImageHeadView
.
frame
=
(
CGRect
){
.
origin
.
x
=
backView
.
width
/
4
.
0
,
.
origin
.
y
=
backView
.
height
/
4
.
0
,
.
size
.
width
=
backView
.
width
/
2
.
0
,
.
size
.
height
=
backView
.
height
/
2
.
0
};
UIImage
*
img
=
[
UIImage
imageNamed
:
@"xf_camera_no_pic"
];
imgV
.
image
=
img
;
}
_noImageHeadView
.
image
=
[
UIImage
imageNamed
:
@"xf_camera_no_pic"
];
}
-
(
void
)
buildContent
{
self
.
tableViewInfo
=
[[
IBTTableViewInfo
alloc
]
initWithFrame
:
CGRectMake
(
10
,
self
.
view
.
height
*
0
.
4
,
self
.
view
.
width
-
20
,
IBT_DEFAULT_CELL_HEIGHT
*
6
)
initWithFrame
:
CGRectMake
(
10
,
self
.
view
.
height
*
0
.
4
,
self
.
view
.
width
-
20
,
IBT_DEFAULT_CELL_HEIGHT
*
7
)
style
:
UITableViewStylePlain
];
...
...
@@ -248,9 +248,25 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
text
:
_surveyResult
.
quality
];
[
cellInfo
addUserInfoValue
:
titleColor
forKey
:
CInfoTitleColorKey
];
cellInfo
.
fCellHeight
=
fCellHeight
;
[
secInfo
addCell
:
cellInfo
];
//备注
cellInfo
=
[
IBTTableViewCellInfo
editorCellForSel
:
nil
target
:
nil
title
:
@"备注:"
margin
:
0
tip
:
nil
autoCorrect
:
NO
focus
:
NO
text
:
nil
];
[
cellInfo
addUserInfoValue
:
titleColor
forKey
:
CInfoTitleColorKey
];
cellInfo
.
fCellHeight
=
fCellHeight
;
[
secInfo
addCell
:
cellInfo
];
[
self
.
tableViewInfo
addSection
:
secInfo
];
IBTTableView
*
tableView
=
[
_tableViewInfo
getTableView
];
...
...
@@ -320,20 +336,17 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
// NSURL *imgUrl = [info objectForKey:UIImagePickerControllerReferenceURL];
UIImage
*
img
=
[
info
objectForKey
:
UIImagePickerControllerOriginalImage
];
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
// HGPhWViewController *hgPhVc = [[HGPhWViewController alloc]init];
// hgPhVc.img = img;
NSData
*
imgData
=
UIImagePNGRepresentation
(
img
);
[
self
savePhotoToDB
:
imgData
];
[
self
PushViewController
:[
HGPhWViewController
shareInstance
]
animated
:
YES
];
// hgPhVc.url = [NSString stringWithContentsOfURL:imgUrl encoding:NSUTF8StringEncoding error:nil];
// NSData *imgData = UIImagePNGRepresentation(img);
// [self savePhotoToDB:imgData];
[[
JavenImages
shareInstance
]
insertAImage
:
img
];
[
self
pushToHGphVC
];
}
//在图片上加图片
-
(
void
)
selectPhotos
:
(
UIGestureRecognizer
*
)
tpGe
{
NSArray
*
photosArr
=
[[
XFDB
sharedInstance
]
fetchAllPhotosFromLocal
];
if
(
photos
Arr
.
count
>
0
)
{
//
NSArray *photosArr = [[XFDB sharedInstance] fetchAllPhotosFromLocal];
if
(
[
JavenImages
shareInstance
].
image
Arr
.
count
>
0
)
{
[
self
photosDisplay
];
}
else
{
self
.
m_actionSheet
=
[[
UIActionSheet
alloc
]
initWithTitle
:
nil
delegate
:
self
cancelButtonTitle
:
@"取消"
destructiveButtonTitle
:
nil
otherButtonTitles
:
@"打开照相机"
,
@"从手机相册获取"
,
nil
];
...
...
@@ -355,20 +368,18 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
}
for
(
int
i
=
0
;
i
<
assets
.
count
;
i
++
)
{
ALAsset
*
asset
=
assets
[
i
];
//获取url
// UIImage *img = [[UIImage alloc]initWithCGImage:[asset thumbnail]];
CGImageRef
ref
=
[[
asset
defaultRepresentation
]
fullResolutionImage
];
UIImage
*
img
=
[[
UIImage
alloc
]
initWithCGImage
:
ref
];
NSData
*
imgData
=
UIImagePNGRepresentation
(
img
);
[
self
savePhotoToDB
:
imgData
];
// UIImage *tempImg = [UIImage imageWithCGImage:[asset po]];
[
self
.
imgesMuArr
addObject
:
img
];
//[UIImage imageNamed:@"AttachCamera"]
}
[[
JavenImages
shareInstance
]
insertImages
:
self
.
imgesMuArr
];
// [[HGPhWViewController shareInstance] addPhotosWithArrayImgs:_imgesMuArr];
[
self
PushViewController
:[
HGPhWViewController
shareInstance
]
animated
:
YES
];
[
self
pushToHGphVC
];
}
...
...
@@ -450,7 +461,10 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
-
(
NSDictionary
*
)
getSurveyResult
{
ICRUserUtil
*
userU
=
[
ICRUserUtil
sharedInstance
];
NSDictionary
*
dict
=
@{
@"userUuid"
:
userU
.
userId
,
@"userCode"
:
userU
.
userCode
,
@"userName"
:
userU
.
userName
,
@"unit"
:
@""
,
NSDictionary
*
dict
=
@{
@"userUuid"
:
userU
.
userId
,
@"userCode"
:
userU
.
userCode
,
@"userName"
:
userU
.
userName
,
@"unit"
:
@""
,
@"price"
:
[
self
getTextFieldTextWithRow
:
kfeedbackCellPrice
],
@"place"
:
[
self
getTextFieldTextWithRow
:
kfeedbackCellPlace
],
@"capacity"
:
[
self
getTextFieldTextWithRow
:
kfeedbackCellCapacity
],
...
...
@@ -480,14 +494,37 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
return
data
;
}
#pragma mark ----跳转到图片展示界面----
-
(
void
)
pushToHGphVC
{
HGPhWViewController
*
hgphVC
=
[[
HGPhWViewController
alloc
]
init
];
[
self
PushViewController
:
hgphVC
animated
:
NO
];
}
-
(
void
)
dealloc
{
[[
JavenImages
shareInstance
]
removeAllImage
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
if
([
JavenImages
shareInstance
].
imageArr
.
count
>
0
)
{
_headImageView
.
image
=
[
JavenImages
shareInstance
].
imageArr
[
0
];
_headImageView
.
hidden
=
NO
;
_noImageHeadView
.
hidden
=
YES
;
}
else
{
_noImageHeadView
.
hidden
=
NO
;
}
}
#pragma 把选择的图片放入到本地数据库中
-
(
void
)
savePhotoToDB
:
(
NSData
*
)
imgData
{
XFPhoto
*
xfphoto
=
[[
XFPhoto
alloc
]
initWithPhotoData
:
imgData
];
BOOL
isSave
=
[[
XFDB
sharedInstance
]
savePhoto
:
xfphoto
];
if
(
isSave
)
{
NSLog
(
@"保存成功"
);
}
else
{
NSLog
(
@"保存失败"
);
}
//
XFPhoto *xfphoto = [[XFPhoto alloc]initWithPhotoData:imgData];
//
BOOL isSave = [[XFDB sharedInstance]savePhoto:xfphoto];
//
if (isSave) {
//
NSLog(@"保存成功");
//
} else {
//
NSLog(@"保存失败");
//
}
}
@end
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