Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-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
张杰
Opple-iOS
Commits
b364a629
Commit
b364a629
authored
Nov 30, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改项说明:彻底修复分享商品图片偶发性失败《图片过大》
parent
99549096
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
165 additions
and
131 deletions
+165
-131
ClientViewController.m
Class/ClientViewController.m
+48
-40
CustomTabbarController.m
Class/Tabbar/CustomTabbarController.m
+1
-3
UserViewController.m
Class/UserViewController.m
+43
-35
Info.plist
Lighting/Info.plist
+1
-1
BaseViewController.m
Tools/BaseViewController.m
+1
-1
ExperienceCentreViewController.m
Tools/ExperienceCentreViewController.m
+48
-38
PrefixHeader.pch
Tools/PrefixHeader.pch
+2
-2
ShareGoodsViewController.m
Tools/ShareGoodsViewController.m
+21
-11
No files found.
Class/ClientViewController.m
View file @
b364a629
...
@@ -103,7 +103,7 @@
...
@@ -103,7 +103,7 @@
self
.
addpersonInformationButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
addpersonInformationButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
changePersonInformationButton
.
layer
.
masksToBounds
=
YES
;
self
.
changePersonInformationButton
.
layer
.
masksToBounds
=
YES
;
self
.
changePersonInformationButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
changePersonInformationButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
indexPage
=
1
;
self
.
indexPage
=
ONE
;
self
.
customerHeader
.
userInteractionEnabled
=
YES
;
self
.
customerHeader
.
userInteractionEnabled
=
YES
;
[
self
.
customerHeader
addGestureRecognizer
:[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
customerHeaderClckAction
:)]];
[
self
.
customerHeader
addGestureRecognizer
:[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
customerHeaderClckAction
:)]];
//隐藏更改客户按钮
//隐藏更改客户按钮
...
@@ -347,45 +347,53 @@
...
@@ -347,45 +347,53 @@
[
self
ErrorMBProgressView
:
@"请先设置当前客户"
];
[
self
ErrorMBProgressView
:
@"请先设置当前客户"
];
return
;
return
;
}
}
UIAlertController
*
alertView
=
[
UIAlertController
alertControllerWithTitle
:
nil
message
:
nil
preferredStyle
:
UIAlertControllerStyleAlert
];
// 判断应用是否有使用相机的权限
UIImagePickerController
*
PcCamera
=
[[
UIImagePickerController
alloc
]
init
];
if
(
!
[
BaseViewController
determineCameraPermissions
]){
PcCamera
.
delegate
=
self
;
UIAlertController
*
alertVC
=
[
UIAlertController
alertControllerWithTitle
:
@"提示"
message
:
@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机"
preferredStyle
:
UIAlertControllerStyleAlert
];
[
DeviceDirectionManager
instance
].
isHorizontal
=
YES
;
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"知道了"
style
:
UIAlertActionStyleCancel
handler
:
nil
]];
__weak
typeof
(
self
)
weakSelf
=
self
;
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"拍照"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
//拍照
}
else
{
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
UIAlertController
*
alertView
=
[
UIAlertController
alertControllerWithTitle
:
nil
message
:
nil
preferredStyle
:
UIAlertControllerStyleAlert
];
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypeCamera
];
UIImagePickerController
*
PcCamera
=
[[
UIImagePickerController
alloc
]
init
];
PcCamera
.
allowsEditing
=
YES
;
PcCamera
.
delegate
=
self
;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
DeviceDirectionManager
instance
].
isHorizontal
=
YES
;
[
weakSelf
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
__weak
typeof
(
self
)
weakSelf
=
self
;
});
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"拍照"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
}
//拍照
else
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
{
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypeCamera
];
[
weakSelf
ErrorMBProgressView
:
@"相机无法使用"
];
PcCamera
.
allowsEditing
=
YES
;
}
dispatch_async
(
dispatch_get_main_queue
(),
^
{
}]];
[
weakSelf
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"从相册选择"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
});
//从相册中选择
}
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypePhotoLibrary
])
{
else
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypePhotoLibrary
];
{
PcCamera
.
allowsEditing
=
YES
;
[
weakSelf
ErrorMBProgressView
:
@"相机无法使用"
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
}
[
weakSelf
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
}]];
});
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"从相册选择"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
}
//从相册中选择
else
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypePhotoLibrary
])
{
{
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypePhotoLibrary
];
[
weakSelf
ErrorMBProgressView
:
@"相册无法打开"
];
PcCamera
.
allowsEditing
=
YES
;
}
dispatch_async
(
dispatch_get_main_queue
(),
^
{
}]];
[
weakSelf
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
});
[
alertView
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
}]];
else
dispatch_async
(
dispatch_get_main_queue
(),
^
{
{
[
weakSelf
presentViewController
:
alertView
animated
:
YES
completion
:
nil
];
[
weakSelf
ErrorMBProgressView
:
@"相册无法打开"
];
});
}
}]];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
alertView
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}]];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
weakSelf
presentViewController
:
alertView
animated
:
YES
completion
:
nil
];
});
}
}
}
#pragma mark -拍照、从相册选择
#pragma mark -拍照、从相册选择
...
...
Class/Tabbar/CustomTabbarController.m
View file @
b364a629
...
@@ -254,9 +254,7 @@
...
@@ -254,9 +254,7 @@
// 判断应用是否有使用相机的权限
// 判断应用是否有使用相机的权限
if
(
!
[
BaseViewController
determineCameraPermissions
]){
if
(
!
[
BaseViewController
determineCameraPermissions
]){
UIAlertController
*
alertVC
=
[
UIAlertController
alertControllerWithTitle
:
@"提示"
message
:
@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机"
preferredStyle
:
UIAlertControllerStyleAlert
];
UIAlertController
*
alertVC
=
[
UIAlertController
alertControllerWithTitle
:
@"提示"
message
:
@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机"
preferredStyle
:
UIAlertControllerStyleAlert
];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"知道了"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"知道了"
style
:
UIAlertActionStyleCancel
handler
:
nil
]];
[[
UIApplication
sharedApplication
]
openURL
:[
NSURL
URLWithString
:
UIApplicationOpenSettingsURLString
]];
}]];
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
}
else
{
}
else
{
...
...
Class/UserViewController.m
View file @
b364a629
...
@@ -77,42 +77,50 @@
...
@@ -77,42 +77,50 @@
#pragma mark -用户头像点击
#pragma mark -用户头像点击
-
(
void
)
userHeaderClickAction
:
(
UITapGestureRecognizer
*
)
tap
-
(
void
)
userHeaderClickAction
:
(
UITapGestureRecognizer
*
)
tap
{
{
UIAlertController
*
alertView
=
[
UIAlertController
alertControllerWithTitle
:
nil
message
:
nil
preferredStyle
:
UIAlertControllerStyleAlert
];
// 判断应用是否有使用相机的权限
UIImagePickerController
*
PcCamera
=
[[
UIImagePickerController
alloc
]
init
];
if
(
!
[
BaseViewController
determineCameraPermissions
]){
PcCamera
.
delegate
=
self
;
UIAlertController
*
alertVC
=
[
UIAlertController
alertControllerWithTitle
:
@"提示"
message
:
@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机"
preferredStyle
:
UIAlertControllerStyleAlert
];
[
DeviceDirectionManager
instance
].
isHorizontal
=
YES
;
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"知道了"
style
:
UIAlertActionStyleCancel
handler
:
nil
]];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"拍照"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
//拍照
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
}
else
{
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypeCamera
];
UIAlertController
*
alertView
=
[
UIAlertController
alertControllerWithTitle
:
nil
message
:
nil
preferredStyle
:
UIAlertControllerStyleAlert
];
PcCamera
.
allowsEditing
=
YES
;
UIImagePickerController
*
PcCamera
=
[[
UIImagePickerController
alloc
]
init
];
[
self
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
PcCamera
.
delegate
=
self
;
}
[
DeviceDirectionManager
instance
].
isHorizontal
=
YES
;
else
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"拍照"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
{
//拍照
[
DeviceDirectionManager
instance
].
isHorizontal
=
NO
;
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
[
self
ErrorMBProgressView
:
@"相机无法使用"
];
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypeCamera
];
}
PcCamera
.
allowsEditing
=
YES
;
}]];
[
self
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"从相册选择"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
}
//从相册中选择
else
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypePhotoLibrary
])
{
{
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypePhotoLibrary
];
[
DeviceDirectionManager
instance
].
isHorizontal
=
NO
;
PcCamera
.
allowsEditing
=
YES
;
[
self
ErrorMBProgressView
:
@"相机无法使用"
];
[
self
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
}
}
}]];
else
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"从相册选择"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
{
//从相册中选择
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypePhotoLibrary
])
{
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypePhotoLibrary
];
PcCamera
.
allowsEditing
=
YES
;
[
self
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
}
else
{
[
DeviceDirectionManager
instance
].
isHorizontal
=
NO
;
[
self
ErrorMBProgressView
:
@"相册无法打开"
];
}
}]];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
DeviceDirectionManager
instance
].
isHorizontal
=
NO
;
[
DeviceDirectionManager
instance
].
isHorizontal
=
NO
;
[
self
ErrorMBProgressView
:
@"相册无法打开"
];
[
alertView
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
}]];
}]];
[
self
presentViewController
:
alertView
animated
:
YES
completion
:
nil
];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
}
[
DeviceDirectionManager
instance
].
isHorizontal
=
NO
;
}
[
alertView
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}]];
[
self
presentViewController
:
alertView
animated
:
YES
completion
:
nil
];
}
#pragma mark -拍照、从相册选择
#pragma mark -拍照、从相册选择
#pragma -mark -UIImagePickerControllerDelegate
#pragma -mark -UIImagePickerControllerDelegate
...
...
Lighting/Info.plist
View file @
b364a629
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
欧立方
<
/string
>
<
string
>
欧立方
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.2.
8
<
/string
>
<
string
>
1.2.
9
<
/string
>
<
k
e
y
>
CFBundleURLTypes
<
/k
e
y
>
<
k
e
y
>
CFBundleURLTypes
<
/k
e
y
>
<
a
rr
a
y
>
<
a
rr
a
y
>
<
d
i
c
t
>
<
d
i
c
t
>
...
...
Tools/BaseViewController.m
View file @
b364a629
...
@@ -155,7 +155,7 @@
...
@@ -155,7 +155,7 @@
-
(
void
)
ShowProgressView
:
(
double
)
progress
-
(
void
)
ShowProgressView
:
(
double
)
progress
{
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
self
.
TCHud
.
mode
=
MBProgressHUDModeDeterminate
HorizontalBar
;
self
.
TCHud
.
mode
=
MBProgressHUDModeDeterminate
;
self
.
TCHud
.
labelText
=
@"上传中...."
;
self
.
TCHud
.
labelText
=
@"上传中...."
;
self
.
TCHud
.
labelFont
=
[
UIFont
systemFontOfSize
:
12
];
self
.
TCHud
.
labelFont
=
[
UIFont
systemFontOfSize
:
12
];
self
.
TCHud
.
progress
=
progress
;
self
.
TCHud
.
progress
=
progress
;
...
...
Tools/ExperienceCentreViewController.m
View file @
b364a629
...
@@ -263,7 +263,9 @@
...
@@ -263,7 +263,9 @@
[
self
ErrorMBProgressView
:
@"没有选择需要分享的商品"
];
[
self
ErrorMBProgressView
:
@"没有选择需要分享的商品"
];
return
;
return
;
}
}
UIImageWriteToSavedPhotosAlbum
([
self
capture
],
self
,
@selector
(
image
:
didFinishSavingWithError
:
contextInfo
:
),
NULL
);
dispatch_async
(
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
),
^
{
UIImageWriteToSavedPhotosAlbum
([
self
capture
],
self
,
@selector
(
image
:
didFinishSavingWithError
:
contextInfo
:
),
NULL
);
});
ShareGoodsViewController
*
shareController
=
[[
ShareGoodsViewController
alloc
]
init
];
ShareGoodsViewController
*
shareController
=
[[
ShareGoodsViewController
alloc
]
init
];
//商品id拼接
//商品id拼接
NSMutableString
*
goodsID
=
[[
NSMutableString
alloc
]
init
];
NSMutableString
*
goodsID
=
[[
NSMutableString
alloc
]
init
];
...
@@ -291,43 +293,51 @@
...
@@ -291,43 +293,51 @@
#pragma mark -拍照
#pragma mark -拍照
-
(
IBAction
)
TakingPhotoButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
TakingPhotoButtonClickAction
:
(
UIButton
*
)
sender
{
// 判断应用是否有使用相机的权限
sender
.
selected
=
YES
;
if
(
!
[
BaseViewController
determineCameraPermissions
]){
UIAlertController
*
alertView
=
[
UIAlertController
alertControllerWithTitle
:
nil
message
:
nil
preferredStyle
:
UIAlertControllerStyleAlert
];
UIAlertController
*
alertVC
=
[
UIAlertController
alertControllerWithTitle
:
@"提示"
message
:
@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机"
preferredStyle
:
UIAlertControllerStyleAlert
];
UIImagePickerController
*
PcCamera
=
[[
UIImagePickerController
alloc
]
init
];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"知道了"
style
:
UIAlertActionStyleCancel
handler
:
nil
]];
PcCamera
.
delegate
=
self
;
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
[
DeviceDirectionManager
instance
].
isHorizontal
=
YES
;
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"拍照"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
}
else
{
//拍照
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
sender
.
selected
=
YES
;
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypeCamera
];
UIAlertController
*
alertView
=
[
UIAlertController
alertControllerWithTitle
:
nil
message
:
nil
preferredStyle
:
UIAlertControllerStyleAlert
];
PcCamera
.
allowsEditing
=
YES
;
UIImagePickerController
*
PcCamera
=
[[
UIImagePickerController
alloc
]
init
];
[
self
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
PcCamera
.
delegate
=
self
;
}
[
DeviceDirectionManager
instance
].
isHorizontal
=
YES
;
else
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"拍照"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
{
//拍照
[
self
ErrorMBProgressView
:
@"相机无法使用"
];
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
sender
.
selected
=
NO
;
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypeCamera
];
}
PcCamera
.
allowsEditing
=
YES
;
}]];
[
self
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"从相册选择"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
}
//从相册中选择
else
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypePhotoLibrary
])
{
{
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypePhotoLibrary
];
[
self
ErrorMBProgressView
:
@"相机无法使用"
];
PcCamera
.
allowsEditing
=
YES
;
sender
.
selected
=
NO
;
[
self
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
}
}
}]];
else
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"从相册选择"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
{
//从相册中选择
[
self
ErrorMBProgressView
:
@"相册无法打开"
];
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypePhotoLibrary
])
{
sender
.
selected
=
NO
;
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypePhotoLibrary
];
}
PcCamera
.
allowsEditing
=
YES
;
}]];
[
self
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
}
self
.
takingPicturesButton
.
selected
=
NO
;
else
[
alertView
dismissViewControllerAnimated
:
YES
completion
:
nil
];
{
}]];
[
self
ErrorMBProgressView
:
@"相册无法打开"
];
[
self
presentViewController
:
alertView
animated
:
YES
completion
:
nil
];
sender
.
selected
=
NO
;
}
}]];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
self
.
takingPicturesButton
.
selected
=
NO
;
[
alertView
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}]];
[
self
presentViewController
:
alertView
animated
:
YES
completion
:
nil
];
}
}
}
#pragma mark -拍照、从相册选择
#pragma mark -拍照、从相册选择
...
...
Tools/PrefixHeader.pch
View file @
b364a629
...
@@ -146,12 +146,12 @@
...
@@ -146,12 +146,12 @@
/**
/**
* 服务器测试地址
* 服务器测试地址
*/
*/
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
//
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
//**
//**
// * 服务器正式地址
// * 服务器正式地址
// */
// */
//
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL]
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL]
/**
/**
* 搜索框输入通知
* 搜索框输入通知
...
...
Tools/ShareGoodsViewController.m
View file @
b364a629
...
@@ -16,13 +16,14 @@
...
@@ -16,13 +16,14 @@
-
(
void
)
viewDidLoad
{
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
super
viewDidLoad
];
// Do any additional setup after loading the view from its nib.
}
}
-
(
void
)
didReceiveMemoryWarning
{
#pragma mark - 压缩图片
[
super
didReceiveMemoryWarning
];
-
(
void
)
setShareImage
:
(
UIImage
*
)
shareImage
// Dispose of any resources that can be recreated.
{
_shareImage
=
[
UIImage
imageWithData
:
UIImageJPEGRepresentation
(
shareImage
,
0
.
2
)];
}
}
#pragma mark -分享
#pragma mark -分享
-
(
IBAction
)
ShareWeiChatAntWeiboAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
ShareWeiChatAntWeiboAction
:
(
UIButton
*
)
sender
{
...
@@ -53,28 +54,37 @@
...
@@ -53,28 +54,37 @@
NSString
*
goodsID
=
[
self
.
goodsIds
substringToIndex
:[
self
.
goodsIds
length
]
-
1
];
NSString
*
goodsID
=
[
self
.
goodsIds
substringToIndex
:[
self
.
goodsIds
length
]
-
1
];
NSDictionary
*
parameterDict
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:[
goodsID
substringToIndex
:
self
.
goodsIds
.
length
-
1
],
@"goodsIds"
,
@""
,
@"title"
,
@""
,
@"remark"
,
nil
];
NSDictionary
*
parameterDict
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:[
goodsID
substringToIndex
:
self
.
goodsIds
.
length
-
1
],
@"goodsIds"
,
@""
,
@"title"
,
@""
,
@"remark"
,
nil
];
//上传图片
//上传图片
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
mode
=
MBProgressHUDModeDeterminate
;
hud
.
labelText
=
@"上传中...."
;
hud
.
removeFromSuperViewOnHide
=
YES
;
[[
NetworkRequestClassManager
Manager
]
UploadImageWithURL
:
SERVERREQUESTURL
(
SHARE
)
WithRequestType
:
ZERO
WithImageDatas
:
imageData
WithParameter
:
parameterDict
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
UploadImageWithURL
:
SERVERREQUESTURL
(
SHARE
)
WithRequestType
:
ZERO
WithImageDatas
:
imageData
WithParameter
:
parameterDict
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
NSString
*
shareWeb
=
returnValue
[
@"data"
][
@"url"
];
NSString
*
shareWeb
=
returnValue
[
@"data"
][
@"url"
];
[
weakS
elf
callSharePlatform
:
shareWeb
withPlatformTag
:
sender
withTitle
:
ShareTitle
];
[
s
elf
callSharePlatform
:
shareWeb
withPlatformTag
:
sender
withTitle
:
ShareTitle
];
}
else
}
else
{
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithprogressBlock
:^
(
double
progress
)
{
}
WithprogressBlock
:^
(
double
progress
)
{
if
(
progress
>=
1
)
{
if
(
progress
>=
1
)
{
weakSelf
.
TCHud
.
labelText
=
@"上传完成"
;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
hud
hide
:
YES
];
});
}
else
{
}
else
{
[
weakSelf
ShowProgressView
:
progress
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
hud
.
progress
=
progress
;
});
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
weakSelf
ErrorMBProgressView
:
NETWORK
];
[
hud
hide
:
YES
];
}
WithFailureBlock
:^
(
NSError
*
error
)
{
}
WithFailureBlock
:^
(
NSError
*
error
)
{
weakSelf
.
TCHud
.
labelText
=
@"上传失败"
;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
hud
.
labelText
=
@"上传失败"
;
[
hud
hide
:
YES
afterDelay
:
1
];
});
}];
}];
}
}
}
}
...
...
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