From 3508cab25ea5c9e703aaaf8ad5b811080b1cf896 Mon Sep 17 00:00:00 2001 From: lianxiang <13052344590@163.com> Date: Sun, 23 Sep 2018 01:30:29 +0800 Subject: [PATCH] add --- GIGA.xcodeproj/project.pbxproj | 248 +++++++++++++++++- .../login/app_logo.imageset/Contents.json | 8 + .../bg_moreandmore_red.imageset/Contents.json | 13 + .../bg_moreandmore_red@2x.png | Bin 0 -> 818 bytes .../img_camera.imageset/Contents.json | 13 + .../img_camera.imageset/img_camera@2x.png | Bin 0 -> 3504 bytes .../img_holder.imageset/Contents.json | 13 + .../img_holder.imageset/img_holder@2x.png | Bin 0 -> 2313 bytes GIGA/Common/GiGaHelper.m | 3 +- GIGA/Common/GiGaNetTool/GiGaNetManager.h | 7 +- GIGA/Common/GiGaNetTool/GiGaNetManager.m | 57 +++- GIGA/Common/GiGaUserDB/GIGaUserFileHelper.h | 7 + GIGA/Common/GiGaUserDB/GIGaUserFileHelper.m | 88 +++++++ .../Controller/SJPhotoAlbumsController.h | 14 + .../Controller/SJPhotoAlbumsController.m | 135 ++++++++++ .../Controller/SJPhotoPickerNavController.h | 13 + .../Controller/SJPhotoPickerNavController.m | 38 +++ .../Controller/SJPickPhotoController.h | 16 ++ .../Controller/SJPickPhotoController.m | 240 +++++++++++++++++ .../Controller/SJPreviewPhotoController.h | 27 ++ .../Controller/SJPreviewPhotoController.m | 215 +++++++++++++++ .../SJPhotoPicker/Macro/SJPhotoPickerMacro.h | 34 +++ .../Manager/SJPhotoPickerManager.h | 23 ++ .../Manager/SJPhotoPickerManager.m | 84 ++++++ .../Views/SJPhotoPicker/Models/SJAlbumModel.h | 17 ++ .../Views/SJPhotoPicker/Models/SJAlbumModel.m | 13 + .../Views/SJPhotoPicker/Models/SJPhotoModel.h | 36 +++ .../Views/SJPhotoPicker/Models/SJPhotoModel.m | 25 ++ .../Views/SJPhotoPicker/SJPhotoPicker.h | 24 ++ .../Views/SJPhotoPicker/SJPhotoPicker.m | 71 +++++ .../Sources/photopicker_back.png | Bin 0 -> 1078 bytes .../Sources/photopicker_back@2x.png | Bin 0 -> 1258 bytes .../Sources/photopicker_back@3x.png | Bin 0 -> 1311 bytes .../SJPhotoPicker/Views/SJPhotoAlbumCell.h | 16 ++ .../SJPhotoPicker/Views/SJPhotoAlbumCell.m | 102 +++++++ .../SJPhotoPicker/Views/SJPhotoPickerNavBar.h | 30 +++ .../SJPhotoPicker/Views/SJPhotoPickerNavBar.m | 145 ++++++++++ .../Views/SJPhotoPickerRaidoButton.h | 19 ++ .../Views/SJPhotoPickerRaidoButton.m | 45 ++++ .../Views/SJPhotoPickerToolBar.h | 22 ++ .../Views/SJPhotoPickerToolBar.m | 99 +++++++ .../SJPhotoPicker/Views/SJPickPhotoCell.h | 27 ++ .../SJPhotoPicker/Views/SJPickPhotoCell.m | 125 +++++++++ .../SJPhotoPicker/Views/SJPreviewPhotoCell.h | 21 ++ .../SJPhotoPicker/Views/SJPreviewPhotoCell.m | 127 +++++++++ GIGA/Config/GIGA.h | 3 +- GIGA/GIGA.pch | 1 + .../Controller/GIGaMaskShareViewController.m | 122 ++++++++- .../Mask/Controller/GiGaFlingCommitVC.m | 6 +- .../Controller/GiGaMaskTaskViewController.m | 5 +- .../Mask/Controller/ShareViewController.m | 138 +++++++++- .../Exercises/Controller/GiGaQuestionVC.m | 16 +- .../Exercises/Controller/MaskTestResultVC.m | 4 +- .../Exercises/Controller/SHareTestImageVC.h | 14 - .../Exercises/Controller/SHareTestImageVC.m | 43 --- .../Exercises/Controller/SHareTestImageVC.xib | 22 -- .../MaskSharesViews/MaskActionSheetViewCell.h | 15 ++ .../MaskSharesViews/MaskActionSheetViewCell.m | 29 ++ .../MaskActionSheetViewCell.xib | 50 ++++ .../MaskTimeShareActionSheet.h | 15 ++ .../MaskTimeShareActionSheet.m | 116 ++++++++ .../Controller/GiGaFeedBackViewController.m | 179 ++++++++++++- .../Me/Controller/GiGaUserViewController.m | 2 +- .../FeedViews/GIGaFeedImagsCollectionCell.h | 17 ++ .../FeedViews/GIGaFeedImagsCollectionCell.m | 20 ++ .../FeedViews/GIGaFeedImagsCollectionCell.xib | 78 ++++++ .../View/FeedViews/GIGaFeedPhontosViewCell.h | 19 ++ .../View/FeedViews/GIGaFeedPhontosViewCell.m | 188 +++++++++++++ .../Me/View/FeedViews/GIGaFeedQQViewCell.h | 15 ++ .../Me/View/FeedViews/GIGaFeedQQViewCell.m | 24 ++ .../Me/View/FeedViews/GIGaFeedQQViewCell.xib | 57 ++++ .../View/FeedViews/GiGaFeedContentViewCell.h | 17 ++ .../View/FeedViews/GiGaFeedContentViewCell.m | 61 +++++ .../FeedViews/GiGaFeedContentViewCell.xib | 74 ++++++ .../View/FeedViews/GiGaFeedImagsActionCell.h | 14 + .../View/FeedViews/GiGaFeedImagsActionCell.m | 18 ++ .../FeedViews/GiGaFeedImagsActionCell.xib | 65 +++++ .../View/FeedViews/GiGaFeedLeiIingViewCell.h | 14 + .../View/FeedViews/GiGaFeedLeiIingViewCell.m | 24 ++ .../FeedViews/GiGaFeedLeiIingViewCell.xib | 69 +++++ 80 files changed, 3687 insertions(+), 127 deletions(-) create mode 100644 GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/Contents.json create mode 100644 GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/bg_moreandmore_red@2x.png create mode 100644 GIGA/Assets.xcassets/userCenter/img_camera.imageset/Contents.json create mode 100644 GIGA/Assets.xcassets/userCenter/img_camera.imageset/img_camera@2x.png create mode 100644 GIGA/Assets.xcassets/userCenter/img_holder.imageset/Contents.json create mode 100644 GIGA/Assets.xcassets/userCenter/img_holder.imageset/img_holder@2x.png create mode 100755 GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoAlbumsController.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoAlbumsController.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoPickerNavController.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoPickerNavController.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Controller/SJPickPhotoController.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Controller/SJPickPhotoController.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Controller/SJPreviewPhotoController.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Controller/SJPreviewPhotoController.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Macro/SJPhotoPickerMacro.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Manager/SJPhotoPickerManager.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Manager/SJPhotoPickerManager.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Models/SJAlbumModel.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Models/SJAlbumModel.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Models/SJPhotoModel.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Models/SJPhotoModel.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/SJPhotoPicker.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/SJPhotoPicker.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Sources/photopicker_back.png create mode 100755 GIGA/Common/Views/SJPhotoPicker/Sources/photopicker_back@2x.png create mode 100755 GIGA/Common/Views/SJPhotoPicker/Sources/photopicker_back@3x.png create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoAlbumCell.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoAlbumCell.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerNavBar.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerNavBar.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerRaidoButton.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerRaidoButton.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerToolBar.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerToolBar.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPickPhotoCell.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPickPhotoCell.m create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPreviewPhotoCell.h create mode 100755 GIGA/Common/Views/SJPhotoPicker/Views/SJPreviewPhotoCell.m delete mode 100644 GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.h delete mode 100644 GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.m delete mode 100644 GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.xib create mode 100644 GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.h create mode 100644 GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.m create mode 100644 GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.xib create mode 100644 GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.h create mode 100644 GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.m create mode 100644 GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.h create mode 100644 GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.m create mode 100644 GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.xib create mode 100644 GIGA/Modules/Me/View/FeedViews/GIGaFeedPhontosViewCell.h create mode 100644 GIGA/Modules/Me/View/FeedViews/GIGaFeedPhontosViewCell.m create mode 100644 GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.h create mode 100644 GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.m create mode 100644 GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.xib create mode 100644 GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.h create mode 100644 GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.m create mode 100644 GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.xib create mode 100644 GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.h create mode 100644 GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.m create mode 100644 GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.xib create mode 100644 GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.h create mode 100644 GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.m create mode 100644 GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.xib diff --git a/GIGA.xcodeproj/project.pbxproj b/GIGA.xcodeproj/project.pbxproj index 7f1808f..116e732 100644 --- a/GIGA.xcodeproj/project.pbxproj +++ b/GIGA.xcodeproj/project.pbxproj @@ -91,8 +91,6 @@ 836EE5D42136454500F0ABB2 /* RegistGetSMSCodeRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 836EE5D32136454500F0ABB2 /* RegistGetSMSCodeRequest.m */; }; 836EE5D7213645E300F0ABB2 /* GiGaBaseAPiRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 836EE5D6213645E300F0ABB2 /* GiGaBaseAPiRequest.m */; }; 836EE5DA2136716100F0ABB2 /* NSTimer+Convenience.m in Sources */ = {isa = PBXBuildFile; fileRef = 836EE5D82136716000F0ABB2 /* NSTimer+Convenience.m */; }; - 8376B81A2154816800AB79F8 /* SHareTestImageVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B8182154816800AB79F8 /* SHareTestImageVC.m */; }; - 8376B81B2154816800AB79F8 /* SHareTestImageVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8376B8192154816800AB79F8 /* SHareTestImageVC.xib */; }; 8376B81E2154897700AB79F8 /* GIGaUserFileHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B81D2154897700AB79F8 /* GIGaUserFileHelper.m */; }; 8376B8202154913E00AB79F8 /* city.json in Resources */ = {isa = PBXBuildFile; fileRef = 8376B81F2154913E00AB79F8 /* city.json */; }; 8376B8232154927300AB79F8 /* GIGaMaskShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B8222154927300AB79F8 /* GIGaMaskShareViewController.m */; }; @@ -113,6 +111,38 @@ 83773FBF214791E10014EE4C /* GIGaQuestionSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 83773FBE214791E10014EE4C /* GIGaQuestionSlider.m */; }; 83773FC221479FED0014EE4C /* UIColor+HexColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 83773FC121479FED0014EE4C /* UIColor+HexColor.m */; }; 83773FC52147A5CC0014EE4C /* MaskQuestionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83773FC42147A5CC0014EE4C /* MaskQuestionView.m */; }; + 8382DF9D2155F1A200BBA5A5 /* MaskTimeShareActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DF9C2155F1A200BBA5A5 /* MaskTimeShareActionSheet.m */; }; + 8382DFA12155F68800BBA5A5 /* MaskActionSheetViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DF9F2155F68800BBA5A5 /* MaskActionSheetViewCell.m */; }; + 8382DFA22155F68800BBA5A5 /* MaskActionSheetViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8382DFA02155F68800BBA5A5 /* MaskActionSheetViewCell.xib */; }; + 8382DFA72156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFA52156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.m */; }; + 8382DFA82156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8382DFA62156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.xib */; }; + 8382DFAC215626CE00BBA5A5 /* GiGaFeedContentViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFAA215626CE00BBA5A5 /* GiGaFeedContentViewCell.m */; }; + 8382DFAD215626CE00BBA5A5 /* GiGaFeedContentViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8382DFAB215626CE00BBA5A5 /* GiGaFeedContentViewCell.xib */; }; + 8382DFB121562B0A00BBA5A5 /* GIGaFeedQQViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFAF21562B0A00BBA5A5 /* GIGaFeedQQViewCell.m */; }; + 8382DFB221562B0A00BBA5A5 /* GIGaFeedQQViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8382DFB021562B0A00BBA5A5 /* GIGaFeedQQViewCell.xib */; }; + 8382DFB521562C6600BBA5A5 /* GIGaFeedPhontosViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFB421562C6600BBA5A5 /* GIGaFeedPhontosViewCell.m */; }; + 8382DFB92156389200BBA5A5 /* GIGaFeedImagsCollectionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFB72156389200BBA5A5 /* GIGaFeedImagsCollectionCell.m */; }; + 8382DFBA2156389200BBA5A5 /* GIGaFeedImagsCollectionCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8382DFB82156389200BBA5A5 /* GIGaFeedImagsCollectionCell.xib */; }; + 8382DFBE21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFBC21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.m */; }; + 8382DFBF21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8382DFBD21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.xib */; }; + 8382DFE721564A1F00BBA5A5 /* SJPhotoPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFC121564A1F00BBA5A5 /* SJPhotoPicker.m */; }; + 8382DFE821564A1F00BBA5A5 /* SJPhotoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFC321564A1F00BBA5A5 /* SJPhotoModel.m */; }; + 8382DFE921564A1F00BBA5A5 /* SJAlbumModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFC521564A1F00BBA5A5 /* SJAlbumModel.m */; }; + 8382DFEA21564A1F00BBA5A5 /* SJPhotoAlbumsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFC821564A1F00BBA5A5 /* SJPhotoAlbumsController.m */; }; + 8382DFEB21564A1F00BBA5A5 /* SJPreviewPhotoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFC921564A1F00BBA5A5 /* SJPreviewPhotoController.m */; }; + 8382DFEC21564A1F00BBA5A5 /* SJPickPhotoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFCB21564A1F00BBA5A5 /* SJPickPhotoController.m */; }; + 8382DFED21564A1F00BBA5A5 /* SJPhotoPickerNavController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFCE21564A1F00BBA5A5 /* SJPhotoPickerNavController.m */; }; + 8382DFEE21564A1F00BBA5A5 /* SJPhotoPickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFD121564A1F00BBA5A5 /* SJPhotoPickerManager.m */; }; + 8382DFEF21564A1F00BBA5A5 /* photopicker_back.png in Resources */ = {isa = PBXBuildFile; fileRef = 8382DFD721564A1F00BBA5A5 /* photopicker_back.png */; }; + 8382DFF021564A1F00BBA5A5 /* photopicker_back@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8382DFD821564A1F00BBA5A5 /* photopicker_back@3x.png */; }; + 8382DFF121564A1F00BBA5A5 /* photopicker_back@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8382DFD921564A1F00BBA5A5 /* photopicker_back@2x.png */; }; + 8382DFF221564A1F00BBA5A5 /* SJPickPhotoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFDD21564A1F00BBA5A5 /* SJPickPhotoCell.m */; }; + 8382DFF321564A1F00BBA5A5 /* SJPreviewPhotoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFDE21564A1F00BBA5A5 /* SJPreviewPhotoCell.m */; }; + 8382DFF421564A1F00BBA5A5 /* SJPhotoAlbumCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFDF21564A1F00BBA5A5 /* SJPhotoAlbumCell.m */; }; + 8382DFF521564A1F00BBA5A5 /* SJPhotoPickerNavBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFE021564A1F00BBA5A5 /* SJPhotoPickerNavBar.m */; }; + 8382DFF621564A1F00BBA5A5 /* SJPhotoPickerToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFE121564A1F00BBA5A5 /* SJPhotoPickerToolBar.m */; }; + 8382DFF721564A1F00BBA5A5 /* SJPhotoPickerRaidoButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8382DFE221564A1F00BBA5A5 /* SJPhotoPickerRaidoButton.m */; }; + 8382DFF921564E0C00BBA5A5 /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8382DFF821564E0C00BBA5A5 /* Photos.framework */; }; 83835BA0212E43BD001480F2 /* GiGaMasssagesVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835B9F212E43BD001480F2 /* GiGaMasssagesVC.m */; }; 83835BA7212E4748001480F2 /* MAssaageCenterCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BA5212E4748001480F2 /* MAssaageCenterCell.m */; }; 83835BA8212E4748001480F2 /* MAssaageCenterCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83835BA6212E4748001480F2 /* MAssaageCenterCell.xib */; }; @@ -359,9 +389,6 @@ 836EE5D6213645E300F0ABB2 /* GiGaBaseAPiRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaBaseAPiRequest.m; sourceTree = ""; }; 836EE5D82136716000F0ABB2 /* NSTimer+Convenience.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+Convenience.m"; sourceTree = ""; }; 836EE5D92136716000F0ABB2 /* NSTimer+Convenience.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTimer+Convenience.h"; sourceTree = ""; }; - 8376B8172154816800AB79F8 /* SHareTestImageVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SHareTestImageVC.h; sourceTree = ""; }; - 8376B8182154816800AB79F8 /* SHareTestImageVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SHareTestImageVC.m; sourceTree = ""; }; - 8376B8192154816800AB79F8 /* SHareTestImageVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SHareTestImageVC.xib; sourceTree = ""; }; 8376B81C2154897700AB79F8 /* GIGaUserFileHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaUserFileHelper.h; sourceTree = ""; }; 8376B81D2154897700AB79F8 /* GIGaUserFileHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGaUserFileHelper.m; sourceTree = ""; }; 8376B81F2154913E00AB79F8 /* city.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = city.json; sourceTree = ""; }; @@ -396,6 +423,61 @@ 83773FC121479FED0014EE4C /* UIColor+HexColor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIColor+HexColor.m"; sourceTree = ""; }; 83773FC32147A5CC0014EE4C /* MaskQuestionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskQuestionView.h; sourceTree = ""; }; 83773FC42147A5CC0014EE4C /* MaskQuestionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskQuestionView.m; sourceTree = ""; }; + 8382DF9B2155F1A200BBA5A5 /* MaskTimeShareActionSheet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskTimeShareActionSheet.h; sourceTree = ""; }; + 8382DF9C2155F1A200BBA5A5 /* MaskTimeShareActionSheet.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskTimeShareActionSheet.m; sourceTree = ""; }; + 8382DF9E2155F68800BBA5A5 /* MaskActionSheetViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskActionSheetViewCell.h; sourceTree = ""; }; + 8382DF9F2155F68800BBA5A5 /* MaskActionSheetViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskActionSheetViewCell.m; sourceTree = ""; }; + 8382DFA02155F68800BBA5A5 /* MaskActionSheetViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MaskActionSheetViewCell.xib; sourceTree = ""; }; + 8382DFA42156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaFeedLeiIingViewCell.h; sourceTree = ""; }; + 8382DFA52156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaFeedLeiIingViewCell.m; sourceTree = ""; }; + 8382DFA62156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GiGaFeedLeiIingViewCell.xib; sourceTree = ""; }; + 8382DFA9215626CE00BBA5A5 /* GiGaFeedContentViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaFeedContentViewCell.h; sourceTree = ""; }; + 8382DFAA215626CE00BBA5A5 /* GiGaFeedContentViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaFeedContentViewCell.m; sourceTree = ""; }; + 8382DFAB215626CE00BBA5A5 /* GiGaFeedContentViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GiGaFeedContentViewCell.xib; sourceTree = ""; }; + 8382DFAE21562B0A00BBA5A5 /* GIGaFeedQQViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaFeedQQViewCell.h; sourceTree = ""; }; + 8382DFAF21562B0A00BBA5A5 /* GIGaFeedQQViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGaFeedQQViewCell.m; sourceTree = ""; }; + 8382DFB021562B0A00BBA5A5 /* GIGaFeedQQViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GIGaFeedQQViewCell.xib; sourceTree = ""; }; + 8382DFB321562C6600BBA5A5 /* GIGaFeedPhontosViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaFeedPhontosViewCell.h; sourceTree = ""; }; + 8382DFB421562C6600BBA5A5 /* GIGaFeedPhontosViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGaFeedPhontosViewCell.m; sourceTree = ""; }; + 8382DFB62156389200BBA5A5 /* GIGaFeedImagsCollectionCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaFeedImagsCollectionCell.h; sourceTree = ""; }; + 8382DFB72156389200BBA5A5 /* GIGaFeedImagsCollectionCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGaFeedImagsCollectionCell.m; sourceTree = ""; }; + 8382DFB82156389200BBA5A5 /* GIGaFeedImagsCollectionCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GIGaFeedImagsCollectionCell.xib; sourceTree = ""; }; + 8382DFBB21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaFeedImagsActionCell.h; sourceTree = ""; }; + 8382DFBC21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaFeedImagsActionCell.m; sourceTree = ""; }; + 8382DFBD21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GiGaFeedImagsActionCell.xib; sourceTree = ""; }; + 8382DFC121564A1F00BBA5A5 /* SJPhotoPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPhotoPicker.m; sourceTree = ""; }; + 8382DFC321564A1F00BBA5A5 /* SJPhotoModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPhotoModel.m; sourceTree = ""; }; + 8382DFC421564A1F00BBA5A5 /* SJAlbumModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJAlbumModel.h; sourceTree = ""; }; + 8382DFC521564A1F00BBA5A5 /* SJAlbumModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJAlbumModel.m; sourceTree = ""; }; + 8382DFC621564A1F00BBA5A5 /* SJPhotoModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPhotoModel.h; sourceTree = ""; }; + 8382DFC821564A1F00BBA5A5 /* SJPhotoAlbumsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPhotoAlbumsController.m; sourceTree = ""; }; + 8382DFC921564A1F00BBA5A5 /* SJPreviewPhotoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPreviewPhotoController.m; sourceTree = ""; }; + 8382DFCA21564A1F00BBA5A5 /* SJPhotoPickerNavController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPhotoPickerNavController.h; sourceTree = ""; }; + 8382DFCB21564A1F00BBA5A5 /* SJPickPhotoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPickPhotoController.m; sourceTree = ""; }; + 8382DFCC21564A1F00BBA5A5 /* SJPreviewPhotoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPreviewPhotoController.h; sourceTree = ""; }; + 8382DFCD21564A1F00BBA5A5 /* SJPhotoAlbumsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPhotoAlbumsController.h; sourceTree = ""; }; + 8382DFCE21564A1F00BBA5A5 /* SJPhotoPickerNavController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPhotoPickerNavController.m; sourceTree = ""; }; + 8382DFCF21564A1F00BBA5A5 /* SJPickPhotoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPickPhotoController.h; sourceTree = ""; }; + 8382DFD121564A1F00BBA5A5 /* SJPhotoPickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPhotoPickerManager.m; sourceTree = ""; }; + 8382DFD221564A1F00BBA5A5 /* SJPhotoPickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPhotoPickerManager.h; sourceTree = ""; }; + 8382DFD421564A1F00BBA5A5 /* SJPhotoPickerMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPhotoPickerMacro.h; sourceTree = ""; }; + 8382DFD521564A1F00BBA5A5 /* SJPhotoPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPhotoPicker.h; sourceTree = ""; }; + 8382DFD721564A1F00BBA5A5 /* photopicker_back.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = photopicker_back.png; sourceTree = ""; }; + 8382DFD821564A1F00BBA5A5 /* photopicker_back@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "photopicker_back@3x.png"; sourceTree = ""; }; + 8382DFD921564A1F00BBA5A5 /* photopicker_back@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "photopicker_back@2x.png"; sourceTree = ""; }; + 8382DFDB21564A1F00BBA5A5 /* SJPhotoPickerRaidoButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPhotoPickerRaidoButton.h; sourceTree = ""; }; + 8382DFDC21564A1F00BBA5A5 /* SJPhotoPickerToolBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPhotoPickerToolBar.h; sourceTree = ""; }; + 8382DFDD21564A1F00BBA5A5 /* SJPickPhotoCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPickPhotoCell.m; sourceTree = ""; }; + 8382DFDE21564A1F00BBA5A5 /* SJPreviewPhotoCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPreviewPhotoCell.m; sourceTree = ""; }; + 8382DFDF21564A1F00BBA5A5 /* SJPhotoAlbumCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPhotoAlbumCell.m; sourceTree = ""; }; + 8382DFE021564A1F00BBA5A5 /* SJPhotoPickerNavBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPhotoPickerNavBar.m; sourceTree = ""; }; + 8382DFE121564A1F00BBA5A5 /* SJPhotoPickerToolBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPhotoPickerToolBar.m; sourceTree = ""; }; + 8382DFE221564A1F00BBA5A5 /* SJPhotoPickerRaidoButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJPhotoPickerRaidoButton.m; sourceTree = ""; }; + 8382DFE321564A1F00BBA5A5 /* SJPhotoPickerNavBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPhotoPickerNavBar.h; sourceTree = ""; }; + 8382DFE421564A1F00BBA5A5 /* SJPhotoAlbumCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPhotoAlbumCell.h; sourceTree = ""; }; + 8382DFE521564A1F00BBA5A5 /* SJPreviewPhotoCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPreviewPhotoCell.h; sourceTree = ""; }; + 8382DFE621564A1F00BBA5A5 /* SJPickPhotoCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJPickPhotoCell.h; sourceTree = ""; }; + 8382DFF821564E0C00BBA5A5 /* Photos.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Photos.framework; path = System/Library/Frameworks/Photos.framework; sourceTree = SDKROOT; }; 83835B9E212E43BD001480F2 /* GiGaMasssagesVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaMasssagesVC.h; sourceTree = ""; }; 83835B9F212E43BD001480F2 /* GiGaMasssagesVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaMasssagesVC.m; sourceTree = ""; }; 83835BA4212E4748001480F2 /* MAssaageCenterCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MAssaageCenterCell.h; sourceTree = ""; }; @@ -557,6 +639,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8382DFF921564E0C00BBA5A5 /* Photos.framework in Frameworks */, 8361B41721217DA000238FEB /* Foundation.framework in Frameworks */, 8357ADD52123F5EC000816F2 /* libsqlite3.tbd in Frameworks */, 8361B42321217DFF00238FEB /* libresolv.tbd in Frameworks */, @@ -654,6 +737,7 @@ 8340BFAC213E7374008F22E4 /* Views */ = { isa = PBXGroup; children = ( + 8382DFC021564A1F00BBA5A5 /* SJPhotoPicker */, 833DE8E02150169F009D4329 /* JYAddressPicker */, 83901143214E20B1004CA790 /* LYSDatePickerController */, 8338F6B62142504E00B4780B /* CustomSwitch */, @@ -990,6 +1074,7 @@ 8361B42A212180A100238FEB /* View */ = { isa = PBXGroup; children = ( + 8382DFA3215622C600BBA5A5 /* FeedViews */, 8342FD7E2150F94F00D141F4 /* AppVerionDescCells */, 838762CF214B9CAA0039D241 /* userInfoView */, 83BFAE64213CCF10004EF801 /* GiGaMineUserViewCell.h */, @@ -1089,10 +1174,126 @@ 8376B8422154CEC800AB79F8 /* MaskShareBoootomViewCell.h */, 8376B8432154CEC800AB79F8 /* MaskShareBoootomViewCell.m */, 8376B8442154CEC800AB79F8 /* MaskShareBoootomViewCell.xib */, + 8382DF9B2155F1A200BBA5A5 /* MaskTimeShareActionSheet.h */, + 8382DF9C2155F1A200BBA5A5 /* MaskTimeShareActionSheet.m */, + 8382DF9E2155F68800BBA5A5 /* MaskActionSheetViewCell.h */, + 8382DF9F2155F68800BBA5A5 /* MaskActionSheetViewCell.m */, + 8382DFA02155F68800BBA5A5 /* MaskActionSheetViewCell.xib */, ); path = MaskSharesViews; sourceTree = ""; }; + 8382DFA3215622C600BBA5A5 /* FeedViews */ = { + isa = PBXGroup; + children = ( + 8382DFA42156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.h */, + 8382DFA52156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.m */, + 8382DFA62156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.xib */, + 8382DFA9215626CE00BBA5A5 /* GiGaFeedContentViewCell.h */, + 8382DFAA215626CE00BBA5A5 /* GiGaFeedContentViewCell.m */, + 8382DFAB215626CE00BBA5A5 /* GiGaFeedContentViewCell.xib */, + 8382DFAE21562B0A00BBA5A5 /* GIGaFeedQQViewCell.h */, + 8382DFAF21562B0A00BBA5A5 /* GIGaFeedQQViewCell.m */, + 8382DFB021562B0A00BBA5A5 /* GIGaFeedQQViewCell.xib */, + 8382DFB321562C6600BBA5A5 /* GIGaFeedPhontosViewCell.h */, + 8382DFB421562C6600BBA5A5 /* GIGaFeedPhontosViewCell.m */, + 8382DFB62156389200BBA5A5 /* GIGaFeedImagsCollectionCell.h */, + 8382DFB72156389200BBA5A5 /* GIGaFeedImagsCollectionCell.m */, + 8382DFB82156389200BBA5A5 /* GIGaFeedImagsCollectionCell.xib */, + 8382DFBB21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.h */, + 8382DFBC21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.m */, + 8382DFBD21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.xib */, + ); + path = FeedViews; + sourceTree = ""; + }; + 8382DFC021564A1F00BBA5A5 /* SJPhotoPicker */ = { + isa = PBXGroup; + children = ( + 8382DFC121564A1F00BBA5A5 /* SJPhotoPicker.m */, + 8382DFC221564A1F00BBA5A5 /* Models */, + 8382DFC721564A1F00BBA5A5 /* Controller */, + 8382DFD021564A1F00BBA5A5 /* Manager */, + 8382DFD321564A1F00BBA5A5 /* Macro */, + 8382DFD521564A1F00BBA5A5 /* SJPhotoPicker.h */, + 8382DFD621564A1F00BBA5A5 /* Sources */, + 8382DFDA21564A1F00BBA5A5 /* Views */, + ); + path = SJPhotoPicker; + sourceTree = ""; + }; + 8382DFC221564A1F00BBA5A5 /* Models */ = { + isa = PBXGroup; + children = ( + 8382DFC321564A1F00BBA5A5 /* SJPhotoModel.m */, + 8382DFC421564A1F00BBA5A5 /* SJAlbumModel.h */, + 8382DFC521564A1F00BBA5A5 /* SJAlbumModel.m */, + 8382DFC621564A1F00BBA5A5 /* SJPhotoModel.h */, + ); + path = Models; + sourceTree = ""; + }; + 8382DFC721564A1F00BBA5A5 /* Controller */ = { + isa = PBXGroup; + children = ( + 8382DFC821564A1F00BBA5A5 /* SJPhotoAlbumsController.m */, + 8382DFC921564A1F00BBA5A5 /* SJPreviewPhotoController.m */, + 8382DFCA21564A1F00BBA5A5 /* SJPhotoPickerNavController.h */, + 8382DFCB21564A1F00BBA5A5 /* SJPickPhotoController.m */, + 8382DFCC21564A1F00BBA5A5 /* SJPreviewPhotoController.h */, + 8382DFCD21564A1F00BBA5A5 /* SJPhotoAlbumsController.h */, + 8382DFCE21564A1F00BBA5A5 /* SJPhotoPickerNavController.m */, + 8382DFCF21564A1F00BBA5A5 /* SJPickPhotoController.h */, + ); + path = Controller; + sourceTree = ""; + }; + 8382DFD021564A1F00BBA5A5 /* Manager */ = { + isa = PBXGroup; + children = ( + 8382DFD121564A1F00BBA5A5 /* SJPhotoPickerManager.m */, + 8382DFD221564A1F00BBA5A5 /* SJPhotoPickerManager.h */, + ); + path = Manager; + sourceTree = ""; + }; + 8382DFD321564A1F00BBA5A5 /* Macro */ = { + isa = PBXGroup; + children = ( + 8382DFD421564A1F00BBA5A5 /* SJPhotoPickerMacro.h */, + ); + path = Macro; + sourceTree = ""; + }; + 8382DFD621564A1F00BBA5A5 /* Sources */ = { + isa = PBXGroup; + children = ( + 8382DFD721564A1F00BBA5A5 /* photopicker_back.png */, + 8382DFD821564A1F00BBA5A5 /* photopicker_back@3x.png */, + 8382DFD921564A1F00BBA5A5 /* photopicker_back@2x.png */, + ); + path = Sources; + sourceTree = ""; + }; + 8382DFDA21564A1F00BBA5A5 /* Views */ = { + isa = PBXGroup; + children = ( + 8382DFDB21564A1F00BBA5A5 /* SJPhotoPickerRaidoButton.h */, + 8382DFDC21564A1F00BBA5A5 /* SJPhotoPickerToolBar.h */, + 8382DFDD21564A1F00BBA5A5 /* SJPickPhotoCell.m */, + 8382DFDE21564A1F00BBA5A5 /* SJPreviewPhotoCell.m */, + 8382DFDF21564A1F00BBA5A5 /* SJPhotoAlbumCell.m */, + 8382DFE021564A1F00BBA5A5 /* SJPhotoPickerNavBar.m */, + 8382DFE121564A1F00BBA5A5 /* SJPhotoPickerToolBar.m */, + 8382DFE221564A1F00BBA5A5 /* SJPhotoPickerRaidoButton.m */, + 8382DFE321564A1F00BBA5A5 /* SJPhotoPickerNavBar.h */, + 8382DFE421564A1F00BBA5A5 /* SJPhotoAlbumCell.h */, + 8382DFE521564A1F00BBA5A5 /* SJPreviewPhotoCell.h */, + 8382DFE621564A1F00BBA5A5 /* SJPickPhotoCell.h */, + ); + path = Views; + sourceTree = ""; + }; 83835B9D212E4335001480F2 /* MessageCenter */ = { isa = PBXGroup; children = ( @@ -1157,9 +1358,6 @@ 83835BC2212E677C001480F2 /* GiGaQuestionVC.m */, 8384643F214A4BFF00F12B33 /* MaskTestResultVC.h */, 83846440214A4BFF00F12B33 /* MaskTestResultVC.m */, - 8376B8172154816800AB79F8 /* SHareTestImageVC.h */, - 8376B8182154816800AB79F8 /* SHareTestImageVC.m */, - 8376B8192154816800AB79F8 /* SHareTestImageVC.xib */, ); path = Controller; sourceTree = ""; @@ -1417,6 +1615,7 @@ F3264CFCC2F2D369DC49BD1A /* Frameworks */ = { isa = PBXGroup; children = ( + 8382DFF821564E0C00BBA5A5 /* Photos.framework */, 8376B87C2154F0B100AB79F8 /* JSONModel.framework */, 8357ADD42123F5EC000816F2 /* libsqlite3.tbd */, 8361B42221217DFF00238FEB /* libresolv.tbd */, @@ -1546,22 +1745,26 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8382DFBF21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.xib in Resources */, 8376B8292154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.xib in Resources */, 83346AC6212BBC8C0054D597 /* GiGaRegistViewController.xib in Resources */, 8351474C21523B7400B25A88 /* GIGaUserChangeMobleCell.xib in Resources */, 8376B83C2154CE8C00AB79F8 /* MaskTimeShareViewCell.xib in Resources */, 838762DE214B9F140039D241 /* GIGaUserWeChatViewCell.xib in Resources */, 83BFAE6D213CD0E3004EF801 /* GiGaMineInfoViewCell.xib in Resources */, - 8376B81B2154816800AB79F8 /* SHareTestImageVC.xib in Resources */, + 8382DFA82156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.xib in Resources */, 8376B82E2154A35100AB79F8 /* MaskTimeTimeViewCell.xib in Resources */, 8361B3D6212155C300238FEB /* LaunchScreen.storyboard in Resources */, 838762E3214B9F580039D241 /* GiGaUserSexViewCell.xib in Resources */, 838388DA2130046D00D14C53 /* emojizone.mp4 in Resources */, 83A22720212AC8C100B3E75C /* GiGaUserLoginVC.xib in Resources */, 838762D4214B9D120039D241 /* GIGaUserInfoAvatorCell.xib in Resources */, + 8382DFBA2156389200BBA5A5 /* GIGaFeedImagsCollectionCell.xib in Resources */, 838388C4212F934400D14C53 /* pomodoSound.m4a in Resources */, + 8382DFF021564A1F00BBA5A5 /* photopicker_back@3x.png in Resources */, 8376B8462154CEC800AB79F8 /* MaskShareBoootomViewCell.xib in Resources */, 83BFAE78213CDE91004EF801 /* GiGaSettingsViewCell.xib in Resources */, + 8382DFA22155F68800BBA5A5 /* MaskActionSheetViewCell.xib in Resources */, 83346AC1212BB50A0054D597 /* PassWordResetVC.xib in Resources */, 83BDC0592147B89900E74E0D /* GiGaAnswerViewCell.xib in Resources */, 8351473D215215C500B25A88 /* GiGAUserInfoCell.xib in Resources */, @@ -1570,9 +1773,11 @@ 838762D9214B9EF80039D241 /* GIGaUserIDViewCell.xib in Resources */, 838762E8214B9FA60039D241 /* GIGaUserCityViewCell.xib in Resources */, 8342FD8B2151095100D141F4 /* AppVersionLogoCell.xib in Resources */, + 8382DFEF21564A1F00BBA5A5 /* photopicker_back.png in Resources */, 83BFAE68213CCF10004EF801 /* GiGaMineUserViewCell.xib in Resources */, 8376B8202154913E00AB79F8 /* city.json in Resources */, 8351474221521C2A00B25A88 /* GIGaChangePassVC.xib in Resources */, + 8382DFAD215626CE00BBA5A5 /* GiGaFeedContentViewCell.xib in Resources */, 8340BFA9213E65CA008F22E4 /* GIGACommonLocalizabe.strings in Resources */, 83835BA8212E4748001480F2 /* MAssaageCenterCell.xib in Resources */, 8361B3D3212155C300238FEB /* Assets.xcassets in Resources */, @@ -1584,6 +1789,8 @@ 83835BB0212E4FCD001480F2 /* MessageListViewCell.xib in Resources */, 835147322151E4EF00B25A88 /* GIGaAboutUsVC.xib in Resources */, 8342FD832150FA1500D141F4 /* AppVersionDescCell.xib in Resources */, + 8382DFF121564A1F00BBA5A5 /* photopicker_back@2x.png in Resources */, + 8382DFB221562B0A00BBA5A5 /* GIGaFeedQQViewCell.xib in Resources */, 8338F6B12142182200B4780B /* MaskTime.png in Resources */, 83346ACF212BD7830054D597 /* GiGaWebViewController.xib in Resources */, ); @@ -1684,6 +1891,7 @@ buildActionMask = 2147483647; files = ( 835060AD212D4D0C007E6220 /* GiGaFileNanager.m in Sources */, + 8382DFF621564A1F00BBA5A5 /* SJPhotoPickerToolBar.m in Sources */, 83846441214A4BFF00F12B33 /* MaskTestResultVC.m in Sources */, 83346AC5212BBC8C0054D597 /* GiGaRegistViewController.m in Sources */, 83346AD7212C18F50054D597 /* GiGaAppGaurdVC.m in Sources */, @@ -1695,6 +1903,8 @@ 838762D8214B9EF80039D241 /* GIGaUserIDViewCell.m in Sources */, 838500DC2137F3F7003514A3 /* GiGaAttributedLabel.m in Sources */, 83BFAE7B213D3F3A004EF801 /* MaskTimeCircularProgressView.m in Sources */, + 8382DFF721564A1F00BBA5A5 /* SJPhotoPickerRaidoButton.m in Sources */, + 8382DFF321564A1F00BBA5A5 /* SJPreviewPhotoCell.m in Sources */, 8314D2112133ABE500B458BF /* WeiIXinApiManager.m in Sources */, 83BDC0582147B89900E74E0D /* GiGaAnswerViewCell.m in Sources */, 83BC8A862148BE8A00820437 /* NYSliderPopover.m in Sources */, @@ -1718,10 +1928,14 @@ 8384F0E821533528002C19F0 /* MaskResultPercentCell.m in Sources */, 83835BB3212E50ED001480F2 /* ActiveMesagelistVC.m in Sources */, 83835BC3212E677C001480F2 /* GiGaQuestionVC.m in Sources */, + 8382DFB121562B0A00BBA5A5 /* GIGaFeedQQViewCell.m in Sources */, 83A2271F212AC8C100B3E75C /* GiGaUserLoginVC.m in Sources */, 83901177214E20B2004CA790 /* LYSDatePickerTypeTimeDelegate.m in Sources */, + 8382DFB521562C6600BBA5A5 /* GIGaFeedPhontosViewCell.m in Sources */, 83346ACE212BD7830054D597 /* GiGaWebViewController.m in Sources */, 8357ADD82124027D000816F2 /* GiGaUserDefault.m in Sources */, + 8382DFE821564A1F00BBA5A5 /* SJPhotoModel.m in Sources */, + 8382DFF521564A1F00BBA5A5 /* SJPhotoPickerNavBar.m in Sources */, 8384F0F121538146002C19F0 /* MaskResultCandView.m in Sources */, 83835BB6212E5174001480F2 /* GiGaServiceViewController.m in Sources */, 835147352152003700B25A88 /* GiGaFeedBackViewController.m in Sources */, @@ -1739,7 +1953,9 @@ 83901178214E20B2004CA790 /* LYSDatePickerItem.m in Sources */, 8342FD8A2151095100D141F4 /* AppVersionLogoCell.m in Sources */, 8384F0EB21533542002C19F0 /* MaskResultMinViewCell.m in Sources */, + 8382DFE921564A1F00BBA5A5 /* SJAlbumModel.m in Sources */, 83773FC221479FED0014EE4C /* UIColor+HexColor.m in Sources */, + 8382DFEE21564A1F00BBA5A5 /* SJPhotoPickerManager.m in Sources */, 83901172214E20B2004CA790 /* LYSDatePickerTypeDayAndTimeDelegate.m in Sources */, 835060A9212D38EE007E6220 /* GiGaStartAdView.m in Sources */, 83928FFA2134D8F60077D2E8 /* GiGaFlyingCommitInputView.m in Sources */, @@ -1753,20 +1969,24 @@ 8376B8452154CEC800AB79F8 /* MaskShareBoootomViewCell.m in Sources */, 83835BD0212E8B9C001480F2 /* GiGaQuestionModel.m in Sources */, 83835BAF212E4FCD001480F2 /* MessageListViewCell.m in Sources */, + 8382DFF221564A1F00BBA5A5 /* SJPickPhotoCell.m in Sources */, 8361B3D9212155C300238FEB /* main.m in Sources */, 83773FBF214791E10014EE4C /* GIGaQuestionSlider.m in Sources */, 83901179214E20B2004CA790 /* LYSDatePickerTypeBase.m in Sources */, 835060A2212D1225007E6220 /* GiGaMeViewController.m in Sources */, 8361B3CB212155C200238FEB /* AppDelegate.m in Sources */, + 8382DFB92156389200BBA5A5 /* GIGaFeedImagsCollectionCell.m in Sources */, 8351474621521CC500B25A88 /* GiGaChangePhoneNumberVC.m in Sources */, 838388C8212F9C4200D14C53 /* GiGaLocalNotificationManager.m in Sources */, 83835BBC212E60E5001480F2 /* MessageDetailViewController.m in Sources */, + 8382DF9D2155F1A200BBA5A5 /* MaskTimeShareActionSheet.m in Sources */, + 8382DFEC21564A1F00BBA5A5 /* SJPickPhotoController.m in Sources */, 83835BCD212E856A001480F2 /* NSString+MD5.m in Sources */, 8340BFA2213E60DD008F22E4 /* GIGAMBHUDHelper.m in Sources */, 8376B8322154A39200AB79F8 /* MaskTimeEndActionViewCell.m in Sources */, 8345C13621414D3B00051717 /* NSString+Unicode.m in Sources */, - 8376B81A2154816800AB79F8 /* SHareTestImageVC.m in Sources */, 83835BC7212E7BBF001480F2 /* GiGaNavTitileView.m in Sources */, + 8382DFBE21563C2D00BBA5A5 /* GiGaFeedImagsActionCell.m in Sources */, 8361B4322121832800238FEB /* GiGaBaseViewController.m in Sources */, 8338F6B92142504E00B4780B /* LXCustomSwith.m in Sources */, 8357ADD32123C7C6000816F2 /* GiGaAPIResult.m in Sources */, @@ -1783,14 +2003,17 @@ 83BFAE67213CCF10004EF801 /* GiGaMineUserViewCell.m in Sources */, 8392900C2134F9F80077D2E8 /* GiGaCommentView.m in Sources */, 839290062134F4240077D2E8 /* LXDanMuManager.m in Sources */, + 8382DFEB21564A1F00BBA5A5 /* SJPreviewPhotoController.m in Sources */, 8376B81E2154897700AB79F8 /* GIGaUserFileHelper.m in Sources */, 8376B8362154C74300AB79F8 /* ShareViewController.m in Sources */, 833DE8E52150169F009D4329 /* JYAddressPicker.m in Sources */, 834127212152AEFB001DDB36 /* GIGaMaskTimeUseRecordVC.m in Sources */, 83901171214E20B2004CA790 /* LYSDatePickerLabel.m in Sources */, 838762E2214B9F580039D241 /* GiGaUserSexViewCell.m in Sources */, + 8382DFAC215626CE00BBA5A5 /* GiGaFeedContentViewCell.m in Sources */, 839290052134F4240077D2E8 /* LXDanMuTrackView.m in Sources */, 83E40B2F21218BA0008149C4 /* GiGaUserViewController.m in Sources */, + 8382DFE721564A1F00BBA5A5 /* SJPhotoPicker.m in Sources */, 83901170214E20B2004CA790 /* LYSDateHeaderViewController.m in Sources */, 835060A5212D3536007E6220 /* AppDelegate+GiGaConfig.m in Sources */, 835147312151E4EF00B25A88 /* GIGaAboutUsVC.m in Sources */, @@ -1805,14 +2028,19 @@ 836EE5D42136454500F0ABB2 /* RegistGetSMSCodeRequest.m in Sources */, 8361B42E2121812000238FEB /* GiGaServerConfig.m in Sources */, 838762DD214B9F140039D241 /* GIGaUserWeChatViewCell.m in Sources */, + 8382DFA72156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.m in Sources */, + 8382DFA12155F68800BBA5A5 /* MaskActionSheetViewCell.m in Sources */, 8340BFAF213E739D008F22E4 /* GiGaNoNetWorkView.m in Sources */, 836EE5DA2136716100F0ABB2 /* NSTimer+Convenience.m in Sources */, 83A22712212A9EA900B3E75C /* UIView+Sizes.m in Sources */, 839290092134F4C40077D2E8 /* GiGaFlingCommitVC.m in Sources */, 83BFAE70213CDB29004EF801 /* GiMaskTimeHistoryVC.m in Sources */, + 8382DFEA21564A1F00BBA5A5 /* SJPhotoAlbumsController.m in Sources */, 83A22718212ABDFF00B3E75C /* GiGaBlockButton.m in Sources */, + 8382DFED21564A1F00BBA5A5 /* SJPhotoPickerNavController.m in Sources */, 83928FFE2134F37D0077D2E8 /* GiGaSocketRocketUtility.m in Sources */, 83A2270C212A97ED00B3E75C /* MaskViewBootomWaringView.m in Sources */, + 8382DFF421564A1F00BBA5A5 /* SJPhotoAlbumCell.m in Sources */, 8390117A214E20B2004CA790 /* LYSDatePickerController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/GIGA/Assets.xcassets/login/app_logo.imageset/Contents.json b/GIGA/Assets.xcassets/login/app_logo.imageset/Contents.json index dcc2bef..6b531c0 100644 --- a/GIGA/Assets.xcassets/login/app_logo.imageset/Contents.json +++ b/GIGA/Assets.xcassets/login/app_logo.imageset/Contents.json @@ -1,9 +1,17 @@ { "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, { "idiom" : "universal", "filename" : "app_logo@2x.png", "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], "info" : { diff --git a/GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/Contents.json b/GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/Contents.json new file mode 100644 index 0000000..21974b7 --- /dev/null +++ b/GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "bg_moreandmore_red@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/bg_moreandmore_red@2x.png b/GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/bg_moreandmore_red@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..692af16927115d39bc2623c8ad122c8960f99804 GIT binary patch literal 818 zcmV-21I_%2P)Px%>`6pHR5%fplwC+uVHn5HyR#2>Je)aGqy>Q&r3BsdLD7|MLgo-t5DKruuDpmO z{D_44RY3&Rggpbs!%9OLj5InML2`=1y&6V;kC;rXqBAPUHOBgx7n#7=&Uu zAaeAqtf)hMeccE=CtKjWK}{wX#$?%;pW(~%$=RAU9+Kr@LD%mae#ZWZqS!jHwe{Va zN4A*HY5L|$d1Gso0LL6ij8QnSky0jwP}tH2hn10D&d zQol?H=|e%3grc7Tr}GDv9RvfkGk{LvU!pikNgztZ(^>Po-C=^jl%RtFhl9iamEuK* zO$k<^)6;eR6FNIaF#w(o?(FoI4Wi;PMY*7*(~Gnw!7F%p;2!OTihng-cUv;fl-<#| zqMX+>?LD5+5rUzc2)El?$^zlP)r=v(M!jr61Yxm46x;4>Z%0es8vavVfXtZ?=r>Yz zwVxmaEeQn3Ew1bIke!*L$%bIC^Y;4sF4-i9Zf!)8hH%uOy>z4C-cTYjV%nxI2*NPg zs4PE$?#(2pZH(Q-otZL=v$Z|jFxT@D*}odX*8c)XgbzQar|WgrpJZok?ei~Y_n%D3JJjY`r{ow1MT z(49ysfRO3Yd4qT9nT=Kupv60jj42I3`a9gB?8^8;N`c wg?z@Tq4*`Xb%HbYYA_yuD$L9j$}i~u4=&*k$VJL9WB>pF07*qoM6N<$f|pKPx?YDq*vRCodHoePXqR~g6IVcF%?E+Vg8*j?TPLor}1YAKQuf-U83Ng9g~(uzfC zZH%-M)J7<+O-pR6v5KX|Xj_UEwgf?tVpV)lO&^LWEDO6V?9!FCEa0;5_4f@sliAsO z&Ye4R@0~Nly~)kFbG~!FbI$*NzVp6!a(Y}NS6y9Q|BDwduIlLMn36oGWOCwAqmM zN9R%XF+zHA=1R-U%V(yEECDT#Ciur<;cg?Cm4pG5lUj)n7^FagDHSY!YQu*h@ti zR^e*j#z^oOWbIX@hiq|mb+v2rzicGzZWVZtRn4UKcPe=b{#!J0^P8HQ?$XE|iL#0? znx~to(Gye%AbTFt+Ewyo{b^!6%)Qkab-&) zxO_wa!cNds-Y(Mxt7N+oCL4YA_4O|jc%D^+z|VUGAgvzKmO|S8_|&?L62-FEm3^5& z0a@`#`S=?i3K%n#F?P5yKG`mW(PwQU@Z9)7!EgT&fQQ~~ZEZVGpFS<4@#qyLj6Ul& zd>@QTf(H{2C}NdFx~J$B?!#cSC)V{YzMqIn)DO+HvAbwvcjJ~b89k5ry1sg#PQI&z zd<-HV-TLCLq0IQz+S=NOoD2i5sbIdCdu)O^TQF|ixYs0XxS&|qN|Zcj7a3gk_UhH^ z>!qcoC+)%pay84>CXDU$qeReJ7lEHb(^sKNyPsUa|G)TlSW*RD&N2WcT8Y=$m50&OcPDUrp> z;PMaw25*n))WgG2n$Ph9EItCA-M`}f zg5RDY@Nb=Fn$1EXY=|xpL-;zKJdnAE0EE1+(}sl&&82Nro%RXGMM;}Z$+akB_jmv! zJE`mmUx3{~<(IuLIOJ*!# z%t=PE{jd;17E!;DYBBhcgFN#tZYvJ9~*EXU?1{W@FKDWk>%R(UHpKDgdcu#40X;=3-S(VO6WGXN551m}70EZGm0-n(N%OXd zpNX!KgaKa8rAwFOh4NVrL6hSPRmAxluB^*_=rDdiEbSF6E$we_s`71QlL%nnA;U{l znU3{`n4{b~xOdW=$+?s+mn@^)Zex zMs4!4#ls1}ate~xF$ma>tDF!s=emHdm*l1*l+x^NB>b1eidAVKE4_UA@~?4kA*@kr zsYW%4SVM0>{E-gKPLQAHP|8H^mvv;t6M_X+ar$T({?gRiHJ3BU&x&{*>HcjLVbuQn z0Az#?6bSkjps&Pj(uLE>Ao@^#e*TTzy%w-H=RaI3V1C@t#$N=yr zz9GFbV%M((S~ z2*Oy+CpS)?00;=M9;co^lHzkmFJ%A3>QG7Ir>)weH1CJ7JwgQ8s(@VZJp*R1RfYSh_Ng?$Ked$q2%z zy~@4=peEWEBlQrSO>?nI6BS39M^zjz{EZ-tg6Ymk_%dl_|4SBvm1~9&rpu!j+*s-~ zg|LH`xx4E5DNZRV=V_XFjzr9}!mp$%BAx7fe@h|u&)W#X*yfN=NLcO~)34+-Ha4#H z5)wH@jQ%?`X((4gG;ur;89^A^9P$mpBdQW2Tjk}_5L-JNNn1I!ph5+N#gl`Dy&CTq z^E(eve+F?0pU{not9|5H+g#GVQxynV9Tn=&D!JeOMp&2>x}c!oSsdjlCCHiuxUR0+ z(-cl*6#62%l?QUj(<6|k+~AbF`*|5d*x-Qx0YsRHE0z@{D-k86_Ys!0 z04qP1NcePwF_tjEYl5`J)b>aH0EYCAb5Fyv-tZ&6WYaK~FewlKc0k%XYW*^vqkU7d zh1JB{Pa4xmt6USt2$9i*MG&Hi`X$d3AZ;7Bn;+P$K<`re%sHm^SrH5(ZblF$ndO9T zHTMdd$f=Mf|0a~m>cd&$-;chDkhLQMMkct9I%N|IgtfgxKIZbm-C(`~Fi(c-fIpi- zhPtPLI^j{T5Pr!7sgj3X?9Q|H@}Tlu{evU>3@R}sVdA}p}WmvHc_ z;fty@b|2=7=r!HVSi)j~#adeUUDbKVin8uGWBRbHLq5p@1%xFDT)LtOVXeBv=^wJ9 z+0>QM6dC=m@(_^ZkpWhV5T<=Igaa@`O({^e=L15tSVQRhAv$dB0m3F{cw$j=uFAOWZHy94Y=;Lu^$W8$YSD^fLn#aj@VFS560`i$A z@O+4o;X$x1u!->&h9$4`Uj4&2BIIC}|K#@+n~1VUCEFVZh_f5k%V{ppbCx0_7gFuY z>b9ISC4IncI2g`A_Y$7v2!rhf&U5I$_DjI%0ZItFh2Osy@@zE(0enLMa`&+fBz;`? zing10zK+j#JN*O400bbbk}rQRi_Jl@>d$8& zYCE4!`avQeg-(dDNS@eg`8cny-VSNgNJKu7P{eb_{8M?P9O-hw>I%5Y?nn);9I@L& eKlKkM`T0K$dL5;bw#&5u0000Px-!%0LzRCodHooS2|MHq&6RS+;>jsRVNx8w{ol64(e0TzPSYHMrPbBwgw zC=Y`4!FMMZ4fc-8=hIU$@HeGi0aFoZZCDMV!XU~`WS$204J+i+GGkyTHBCmG8Lew< zAq;|aB*PQns@56(`&=2AN$uAm(5@g#Yhj+nab@82$C5Je9KzHG5%&sS&|4<++KUnp zQu^bS1r3@bH}@D4`txo%=urCh_=rUe?B?}Add|u~m^VlmUX&s1Wdn&%gAc(b@DK17 z&wxgyZeTDN3wi;|-b9!YHT0I=;2&VwBRF+q;LU*naR{bcMB|edy(P@8F&Q6sXp1iz z!T@|f9>e)$3G=RzX&pZQlpjK_OOiMR;x@|O)%d3if0WH)ywh}ow+tC5a5~GVvY&+M zZe&WHbJcqK&VQ^?WSd=*T1C^_2;{&9&o(1{>T{ATiydThF;%e{^L$i+Q zEvhRO(o+v*lwTZEcbI!Oi3g=WoBT@BuI^w0_zc9Y_%@Q~Osh5cOFxtmR2Td~R>LBE z>cK-Id}T@ITn+&0$qnFPFc38FmEagd5OFqc-W}#sXb$l2{X&CMU_5R~|&^L*36LtX~@*KLc93{~l}s+rTP5TuOH{ z8e>`N+hw(iiU))3R)8X(rfte*w4)Y$P}H8Nms@a50f)LYmh$H9vdFW{Nfo#6g_9tGnABqmljl&@+y=V!=QQFZ-e_<1FmN2u6S8KP7Xa;D zvv!P-C10a`y4Kzu6J@j)X zm1TJzdDnG)On__YDVt;RWa_SZVff@81Ec2{tbT+jy8SJwRlP8}~YGF`gRFoox^w}}~+}zbJ%*6(? zU(#E?G5oo@s#X|=G5s!1UxQukS16lRtuQctMGWh&$M|z~=RPH4wVqF{J{X#!(I;24 z&}xsSXY_UT4PXt!$qtU08gV;NVZBl5O5(0I{JFczA`HZw$eE1;BZ2i*!@tS9mOP(= zMFNEBy{l=`)S8TZ(KUc`c~0E2I_CgI6%gnIFwY8@z_*q>Gr$F)b5Zq)UQ(tTSP!D? zFC0A+RpyY180K7A?$iEiJB`>2Oa(hZmZoh&`a1kAUh~;iHz!WC; zp^OF`z*)`$7v^xb65@gaRJ}g!-*RjKzXENB*cWKH>;-f^i?avfGL*uft1ytH9g7Qq zp0G<{I-kA;q=~1sp`~dGW?d#XVG!kD8v8!bBH5l`n$|Dto`YhNauEhmbUQi+Bo$>l zd9^#{51<7p-7#5rYq&Et&4*n^Z}~aXS{*9OMHt%i7&tpYyL20TFPIA{EjGs$hCvO1 zL%_LU5aC~}`yux&q;Y2m1(+?aC4g+0*hQ3{38_@ORNALw@w{Waz z%S;%E8OE6ok2%|GvJfRK2K801oG1EYpG8K^hvN&o^D>HfR{{paskn`@Md~q0{yc6v`K+h>r~p2_ zhyig3#HD5WS;yX*wwE|>aEM#4Zy?Xp;6tzpl;umK#NE?O*YR#(Fc=GZ0n3{IZZQz1 zKRK5Jt=)So9|M{#8OS5Z%H}73y&&O^^0miDE--LML5r5Z2*Hr{EE%*^?5*?+JclUt zLD=RV6TIQ5g|C@K@BPctFd)ubEIPIj2E}%PtI0GTXxF5-d>IhO4C@>UAtRp}d;4L`=jbvR1 jR)B@zH3V7DG1C48LPv*`V!VSa00000NkvXXu0mjf(?vcQ literal 0 HcmV?d00001 diff --git a/GIGA/Common/GiGaHelper.m b/GIGA/Common/GiGaHelper.m index 0c0c686..dfce4ca 100644 --- a/GIGA/Common/GiGaHelper.m +++ b/GIGA/Common/GiGaHelper.m @@ -228,11 +228,10 @@ if (jsonString == nil) { return nil; } - //⚠️ 13.2.0库编码采用 isoLatin1 + //⚠️ NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; - //NSData *jsonData = [jsonString dataUsingEncoding:NSISOLatin1StringEncoding]; NSError *err; NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers diff --git a/GIGA/Common/GiGaNetTool/GiGaNetManager.h b/GIGA/Common/GiGaNetTool/GiGaNetManager.h index 6c7b9cb..acb4a11 100644 --- a/GIGA/Common/GiGaNetTool/GiGaNetManager.h +++ b/GIGA/Common/GiGaNetTool/GiGaNetManager.h @@ -22,10 +22,15 @@ typedef void (^responseBlock)(NSDictionary *responseDict, NSDictionary *response // 测试题 , 登录 body 传参 +(void)userbodyRequest:(NSString *)url params:(NSDictionary *)param completionHandler:(nullable void (^)(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error))completionHandler; -//上传图片 +//上传图片 1张 +(void)uploadImage:(NSString *)url imgData:(NSData *)imgData parms:(NSDictionary *)parms responseBlock:(responseBlock)block; ++(void)uploadImage:(NSString *)url + imageNames:(NSArray *)imageNames + parms:(NSDictionary *)parms + responseBlock:(responseBlock)block; + @end diff --git a/GIGA/Common/GiGaNetTool/GiGaNetManager.m b/GIGA/Common/GiGaNetTool/GiGaNetManager.m index 56e9a5c..1eb029b 100644 --- a/GIGA/Common/GiGaNetTool/GiGaNetManager.m +++ b/GIGA/Common/GiGaNetTool/GiGaNetManager.m @@ -10,7 +10,7 @@ #import "AFNetworking.h" #import "GiGaServerConfig.h" #import "GiGaUserDefault.h" - +#import "GIGaUserFileHelper.h" @interface GiGaNetManager() @end @@ -130,7 +130,7 @@ [task resume]; } - +//上传1张 +(void)uploadImage:(NSString *)url imgData:(NSData *)imgData parms:(NSDictionary *)parms @@ -182,6 +182,55 @@ }]; } - - +//上传多张 ++(void)uploadImage:(NSString *)url + imageNames:(NSArray *)imageNames + parms:(NSDictionary *)parms + responseBlock:(responseBlock)block +{ + AFHTTPSessionManager*manager=[[AFHTTPSessionManager alloc] init]; + manager.responseSerializer=[AFHTTPResponseSerializer serializer]; + NSString *token = [GiGaUserDefault getCurentToken]; + if (token) { + [manager.requestSerializer setValue:token forHTTPHeaderField:@"token"]; + } + + NSString *fullurl = [NSString stringWithFormat:@"%@%@",[GiGaServerConfig getMainUrl],url]; + [manager POST:fullurl parameters:parms constructingBodyWithBlock:^(id _Nonnull formData) { + + for (NSUInteger i= 0; i < imageNames.count; i ++) { + //上传时使用当前的系统事件作为文件名 +// NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; +// +// formatter.dateFormat = @"yyyyMMddHHmmss"; +// +// NSString *str = [formatter stringFromDate:[NSDate date]]; + + NSString *fileName = [NSString stringWithFormat:@"%@.png", imageNames[i]]; + //服务器上传文件的字段和类型 + UIImage *image =[GIGaUserFileHelper getUserFeedbackImag:imageNames[i]] ; + NSData *imgData = UIImagePNGRepresentation(image); + [formData appendPartWithFileData:imgData name:@"file" fileName:fileName mimeType:@"image/png"]; + + [formData appendPartWithFormData:imgData name:fileName]; + } + + } progress:^(NSProgress * _Nonnull uploadProgress) { + + } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { + + NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; + NSLog(@"%@", dict); + NSDictionary *headerFields = [(NSHTTPURLResponse *)task.response allHeaderFields]; + if (block) { + block(dict, headerFields, nil); + } + + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { + NSDictionary *headerFields = [(NSHTTPURLResponse *)task.response allHeaderFields]; + if (block) { + block(nil, headerFields, error); + } + }]; +} @end diff --git a/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.h b/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.h index e08e9d3..f61e420 100644 --- a/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.h +++ b/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.h @@ -15,6 +15,13 @@ + (UIImage *) scaleFromImage: (UIImage *) image toSize: (CGSize) size; + (UIImage *)thumbnailWithImageWithoutScale:(UIImage *)image size:(CGSize)asize; ++(void)savaShareImange:(NSString *)fileName image:(UIImage *)image; ++(UIImage *)zipScaleWithImage:(UIImage *)sourceImage; ++(UIImage *)getUserShareImage:(NSString *)imageName; ++(void)delectShareImage:(NSString *)imageName; ++(void)saveUserFeedbackImag:(NSString *)imagename image:(UIImage *)image; ++(UIImage *)getUserFeedbackImag:(NSString *)imageName; ++(void)delectAllfeedimages; @end diff --git a/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.m b/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.m index 0650dbd..9244b02 100644 --- a/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.m +++ b/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.m @@ -20,6 +20,33 @@ } ++(void)savaShareImange:(NSString *)fileName image:(UIImage *)image{ + + NSData*imageData=UIImageJPEGRepresentation(image,1.0f); + NSString *fullPath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:fileName]; + [imageData writeToFile:fullPath atomically:YES]; + +} + ++(void)delectShareImage:(NSString *)imageName{ + + //删除文件夹及文件级内的文件: + NSString *fullPath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:imageName]; + NSFileManager *fileManager = [NSFileManager defaultManager];[fileManager removeItemAtPath:fullPath error:nil]; + +} + ++(UIImage *)getUserShareImage:(NSString *)imageName{ + + + NSString*fullpath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:imageName]; + UIImage*saveImage=[[UIImage alloc]initWithContentsOfFile:fullpath]; + if (!saveImage) { + saveImage = [UIImage imageNamed:@"sharebg_1"]; + } + return saveImage; +} + + (UIImage *)getUserAvatorWith:(NSString *)userId{ if (!userId) { @@ -81,4 +108,65 @@ return newimage; } + ++(UIImage *)zipScaleWithImage:(UIImage *)sourceImage{ + //进行图像尺寸的压缩 + CGSize imageSize = sourceImage.size; + //取出要压缩的image尺寸 + CGFloat width = imageSize.width; + //图片宽度 + CGFloat height = imageSize.height; + //图片高度 //1.宽高大于1280(宽高比不按照2来算,按照1来算) + if (width>1280||height>1280) { if (width>height) { CGFloat scale = height/width; width = 1280; height = width*scale; + + }else{ CGFloat scale = width/height; + height = 1280; width = height*scale; + + } + //2.宽大于1280高小于1280 + + }else if(width>1280||height<1280){ + CGFloat scale = height/width; + width = 1280; + height = width*scale; + //3.宽小于1280高大于1280 + + }else if(width<1280||height>1280){ + CGFloat scale = width/height; height = 1280; width = height*scale; + //4.宽高都小于1280 + + }else{ + + } + //进行尺寸重绘 + UIGraphicsBeginImageContext(CGSizeMake(width, height)); + [sourceImage drawInRect:CGRectMake(0,0,width,height)]; UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); + return newImage; + +} + ++(void)saveUserFeedbackImag:(NSString *)imagename image:(UIImage *)image +{ + + + NSData*imageData=UIImagePNGRepresentation(image); + NSString *fullPath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:[NSString stringWithFormat:@"gigafeed/%@.png",imagename]]; + NSLog(@"fullPath%@",fullPath); + [imageData writeToFile:fullPath atomically:YES]; +} + ++(UIImage *)getUserFeedbackImag:(NSString *)imageName{ + NSString*fullpath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:[NSString stringWithFormat:@"gigafeed/%@.png",imageName]]; + UIImage*saveImage=[[UIImage alloc]initWithContentsOfFile:fullpath]; + + return saveImage; +} + ++(void)delectAllfeedimages{ + + NSString *fullPath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:[NSString stringWithFormat:@"gigafeed/"]]; + NSFileManager *fileManager = [NSFileManager defaultManager];[fileManager removeItemAtPath:fullPath error:nil]; + +} + @end diff --git a/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoAlbumsController.h b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoAlbumsController.h new file mode 100755 index 0000000..a54a577 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoAlbumsController.h @@ -0,0 +1,14 @@ +// +// SJPhotoAlbumsController.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import +#import + +@interface SJPhotoAlbumsController : UIViewController + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoAlbumsController.m b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoAlbumsController.m new file mode 100755 index 0000000..bebdb41 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoAlbumsController.m @@ -0,0 +1,135 @@ +// +// SJPhotoAlbumsController.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPhotoAlbumsController.h" +#import "SJPhotoPickerMacro.h" + +#import "SJPhotoAlbumCell.h" + +#import "SJPickPhotoController.h" +#import "SJPhotoPickerManager.h" +#import "SJAlbumModel.h" + +@interface SJPhotoAlbumsController () + +@property (nonatomic,strong) UITableView *tableView; + +/** + * 相册数组 + */ +@property (nonatomic, strong) NSMutableArray *albumArray; + +@end + +static NSString *ID_SJPhotoAlbumCell = @"sJPhotoAlbumCell"; + + +@implementation SJPhotoAlbumsController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self setupDatas]; + [self setupViews]; + + + SJPickPhotoController *vc = [[SJPickPhotoController alloc] init]; + SJAlbumModel *model = [[SJAlbumModel alloc] init]; + model = self.albumArray[0]; + vc.assetResult = model.assetResult; + [self.navigationController pushViewController:vc animated:NO]; + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + + +#pragma mark 数据初始化 +- (void)setupDatas { + + [[SJPhotoPickerManager shareSJPhotoPickerManager] requestAlbumsWithType:PHAssetCollectionTypeSmartAlbum albumResult:^(NSArray *albumArray) { + self.albumArray = [albumArray mutableCopy]; + }]; + [self.tableView reloadData]; +} + +#pragma mark 视图初始化 +- (void)setupViews { + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"取消" style:(UIBarButtonItemStylePlain) target:self action:@selector(rightBarBtnAction:)]; + + // tableView + { + self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W,SCREEN_H) style:(UITableViewStyleGrouped)]; + self.tableView.delegate = self; + self.tableView.dataSource = self; + [self.tableView registerClass:[SJPhotoAlbumCell class] forCellReuseIdentifier:ID_SJPhotoAlbumCell]; + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + self.tableView.backgroundColor = [UIColor whiteColor]; + [self.view addSubview:self.tableView]; + } + +} + +#pragma mark- UITableViewDelegate DataSource + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.albumArray.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + SJPhotoAlbumCell *cell = [tableView dequeueReusableCellWithIdentifier:ID_SJPhotoAlbumCell forIndexPath:indexPath]; + if (!cell) { + cell = [[SJPhotoAlbumCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:ID_SJPhotoAlbumCell]; + } + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + + SJAlbumModel *model = self.albumArray[indexPath.row]; + + cell.title = [NSString stringWithFormat:@"%@(%lu)",model.title,model.assetResult.count]; + [[SJPhotoPickerManager shareSJPhotoPickerManager] requestImageForPHAsset:model.assetResult[0] targetSize:CGSizeMake(55, 55) imageResult:^(UIImage *image) { + cell.img = image; + }]; + + return cell; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return 55; +} +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + + return 5.0f; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { + return 0.01f; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + + SJPickPhotoController *vc = [[SJPickPhotoController alloc] init]; + SJAlbumModel *model = self.albumArray[indexPath.row]; + vc.assetResult = model.assetResult; + vc.title = model.title; + [self.navigationController pushViewController:vc animated:YES]; +} + +- (void)rightBarBtnAction:(UIBarButtonItem *)sender { + + [self.navigationController dismissViewControllerAnimated:YES completion:nil]; +} + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoPickerNavController.h b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoPickerNavController.h new file mode 100755 index 0000000..a914388 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoPickerNavController.h @@ -0,0 +1,13 @@ +// +// SJPhotoPickerNavController.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import + +@interface SJPhotoPickerNavController : UINavigationController + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoPickerNavController.m b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoPickerNavController.m new file mode 100755 index 0000000..06b7f4d --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPhotoPickerNavController.m @@ -0,0 +1,38 @@ +// +// SJPhotoPickerNavController.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPhotoPickerNavController.h" +#import "SJPhotoAlbumsController.h" +#import "SJPhotoPickerMacro.h" +@interface SJPhotoPickerNavController () + +@end + +@implementation SJPhotoPickerNavController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self.navigationBar setBarTintColor:NAVBAR_CLOOUR]; + [self.navigationBar setTintColor:[UIColor whiteColor]]; + + [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}]; + + SJPhotoAlbumsController *vc = [[SJPhotoAlbumsController alloc] init]; + vc.title = @"相册"; + [self pushViewController:vc animated:NO]; + + +} +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + + + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Controller/SJPickPhotoController.h b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPickPhotoController.h new file mode 100755 index 0000000..52c23b5 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPickPhotoController.h @@ -0,0 +1,16 @@ +// +// SJPickPhotoController.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import +#import + +@interface SJPickPhotoController : UIViewController + +@property (nonatomic, strong) PHFetchResult *assetResult; + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Controller/SJPickPhotoController.m b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPickPhotoController.m new file mode 100755 index 0000000..28f71a6 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPickPhotoController.m @@ -0,0 +1,240 @@ +// SJPickPhotoController.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPickPhotoController.h" + +#import "SJPhotoPicker.h" +#import "SJPhotoPickerMacro.h" + +#import "SJPhotoModel.h" + +#import "SJPickPhotoCell.h" +#import "SJPhotoPickerToolBar.h" + +#import "SJPreviewPhotoController.h" + +@interface SJPickPhotoController () + +@property (nonatomic, strong) UICollectionView *collectionView; +@property (nonatomic, strong) SJPhotoPickerToolBar *toolBar; + +/** + * 所有照片 + */ +@property (nonatomic, strong) NSMutableArray *photoArray; +/** + * 选择的照片 + */ +@property (nonatomic, strong) NSMutableArray *pickedArray; + +@end + +static NSString *ID_SJPickPhotoCell = @"sJPickPhotoCell"; + +@implementation SJPickPhotoController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self setupDatas]; + [self setupViews]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +#pragma mark 数据初始化 +- (void)setupDatas { + // photoArray + { + self.photoArray = [NSMutableArray array]; + + for (PHAsset *asset in self.assetResult) { + + SJPhotoModel *model = [[SJPhotoModel alloc] init]; + model.asset = asset; + model.inAlbumIndex = self.photoArray.count; + model.pickedIndex = 0; + model.isPicked = NO; + [self.photoArray addObject:model]; + } + [self.collectionView reloadData]; + } + // pickedArray + { + self.pickedArray = [NSMutableArray array]; + } +} + +#pragma mark 视图初始化 +- (void)setupViews { + + self.view.backgroundColor = [UIColor whiteColor]; + + if (self.title.length == 0) { + self.title = @"所有照片"; + } + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"取消" style:(UIBarButtonItemStylePlain) target:self action:@selector(rightBarBtnAction:)]; + + // collectionView + { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 5.0f; + layout.minimumInteritemSpacing = 0.0f; + self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 5, SCREEN_W, SCREEN_H - 49) collectionViewLayout:layout]; + self.collectionView.delegate = self; + self.collectionView.dataSource = self; + [self.collectionView registerClass:[SJPickPhotoCell class] forCellWithReuseIdentifier:ID_SJPickPhotoCell]; + self.collectionView.backgroundColor = [UIColor whiteColor]; + self.collectionView.pagingEnabled = NO; + [self.view addSubview:self.collectionView]; + } + + // toolBar + { + self.toolBar = [[SJPhotoPickerToolBar alloc] init]; + [self.toolBar.leftBtn addTarget:self action:@selector(previewPhotoAction:) forControlEvents:(UIControlEventTouchUpInside)]; + [self.toolBar.rightBtn addTarget:self action:@selector(sureBtnAction:) forControlEvents:(UIControlEventTouchUpInside)]; + [self.view addSubview:self.toolBar]; + } +} + +#pragma mark- UICollectionViewDelegate DataSource +#pragma mark- +- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { + return 1; +} + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.photoArray.count; +} + +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + + SJPickPhotoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID_SJPickPhotoCell forIndexPath:indexPath]; + + cell.backgroundColor = [UIColor yellowColor]; + + SJPhotoModel *model = self.photoArray[indexPath.row]; + [cell setModel:model]; + + __weak typeof(cell) weakCell = cell; + + cell.pickBtnBlock = ^(SJPhotoModel *curPickModel) { + [self changeCell:weakCell WithModel:curPickModel]; + }; + return cell; +} + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + return CGSizeMake(Image_W, Image_W); + +} + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + + SJPreviewPhotoController *vc = [[SJPreviewPhotoController alloc] init]; + vc.delegate = self; + vc.curIndex = indexPath.row; + vc.previewArray = [self.photoArray mutableCopy]; + [self.navigationController pushViewController:vc animated:YES]; +} + +#pragma mark- 点击事件 +#pragma mark- + +#pragma mark 预览 +- (void)previewPhotoAction:(UIButton *)sender { + + if (self.pickedArray.count > 0) { + + SJPreviewPhotoController *vc = [[SJPreviewPhotoController alloc] init]; + vc.delegate = self; + vc.curIndex = self.pickedArray.count - 1; + vc.previewArray = [self.pickedArray mutableCopy]; + [self.navigationController pushViewController:vc animated:YES]; + } +} + +#pragma mark 取消 +- (void)rightBarBtnAction:(UIBarButtonItem *)sender { + + [self.navigationController dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma mark 确定 +- (void)sureBtnAction:(UIButton *)sender { + + NSMutableArray *assetArray = [NSMutableArray array]; + for (SJPhotoModel *model in self.pickedArray) { + PHAsset *asset = model.asset; + [assetArray addObject:asset]; + } + if (assetArray.count > MAXCOUNT) { + GIGA_ShowToast(@"最多6张"); + return; + } + + SJPhotoPicker *photoPicker = [SJPhotoPicker shareSJPhotoPicker]; + photoPicker.photoPickerBlock(assetArray); + + [self.navigationController dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma mark- 其他方法 +#pragma mark- + +#pragma mark 通过改变改变model值,改变cell状态 +- (void)pickedArrayChangeWithModel:(SJPhotoModel *)model { + + NSIndexPath *changedIndexP =[NSIndexPath indexPathForItem:model.inAlbumIndex inSection:0]; + SJPickPhotoCell *changedCell = (SJPickPhotoCell *)[self.collectionView cellForItemAtIndexPath:changedIndexP]; + [self changeCell:changedCell WithModel:model]; +} + + + +- (void)changeCell:(SJPickPhotoCell *)changedCell WithModel:(SJPhotoModel *)changedModel { + + if (changedModel.isPicked) { + + [changedCell modelChangePickedIndex:self.pickedArray.count + 1]; + [self.pickedArray addObject:changedModel]; + + } + else { + + [self.pickedArray removeObject:changedModel]; + + // 更新剩下选择的图片 + for (int i = 0; i < self.pickedArray.count; i ++) { + + SJPhotoModel *otherPickedModel = self.pickedArray[i]; + + if (otherPickedModel.pickedIndex > changedModel.pickedIndex) { + + otherPickedModel.pickedIndex -= 1; + + NSIndexPath *indexP =[NSIndexPath indexPathForItem:otherPickedModel.inAlbumIndex inSection:0]; + SJPickPhotoCell *otherCell = (SJPickPhotoCell *)[self.collectionView cellForItemAtIndexPath:indexP]; + + [otherCell modelChangePickedIndex:otherPickedModel.pickedIndex]; + + } + } + // 更新 取消选择的图片 + [changedCell modelChangePickedIndex:0]; + } + + // 更改工具栏状态信息 + [self.toolBar changePickedIndex:self.pickedArray.count]; +} + + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Controller/SJPreviewPhotoController.h b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPreviewPhotoController.h new file mode 100755 index 0000000..51af3b0 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPreviewPhotoController.h @@ -0,0 +1,27 @@ +// +// SJPreviewPhotoController.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + + +#import + +#import "SJPhotoModel.h" + +@protocol SJPreviewPhotoControllerDelegate + +- (void)pickedArrayChangeWithModel:(SJPhotoModel *)model; + +@end + +@interface SJPreviewPhotoController : UIViewController + +@property (nonatomic, strong) NSMutableArray *previewArray; +@property (nonatomic, assign) NSInteger curIndex; + +@property (nonatomic, strong) id delegate; + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Controller/SJPreviewPhotoController.m b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPreviewPhotoController.m new file mode 100755 index 0000000..4478041 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Controller/SJPreviewPhotoController.m @@ -0,0 +1,215 @@ +// +// SJPreviewPhotoController.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPreviewPhotoController.h" + +#import + +#import "SJPhotoPickerNavBar.h" +#import "SJPhotoPickerToolBar.h" +#import "SJPreviewPhotoCell.h" + +#import "SJPhotoPicker.h" + +@interface SJPreviewPhotoController () + +@property (nonatomic, strong) UICollectionView *collectionView; +@property (nonatomic, strong) SJPhotoPickerToolBar *toolBar; +@property (nonatomic, strong) SJPhotoPickerNavBar *navBar; + +@property (nonatomic, strong) UIView *backView; +@property (nonatomic, strong) NSMutableArray *pickedArray; +@property (nonatomic, strong) SJPhotoModel *operatingModel; + +@end + +static NSString *ID_SJPreviewPhotoCell = @"sJPreviewPhotoCell"; + + +@implementation SJPreviewPhotoController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self setupDatas]; + [self setupViews]; + +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + + [self.navigationController setNavigationBarHidden:YES animated:NO]; +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + [self.navigationController setNavigationBarHidden:NO animated:NO]; +} + + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +#pragma mark 数据初始化 +- (void)setupDatas { + + self.pickedArray = [NSMutableArray array]; + + for (SJPhotoModel *model in self.previewArray) { + if (model.isPicked) { + [self.pickedArray addObject:model]; + } + } + [self.collectionView reloadData]; +} + +#pragma mark 视图初始化 +- (void)setupViews { + + // collectionView + { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 0.0f; + layout.minimumInteritemSpacing = 0.0f; + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + + self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, -64, SCREEN_W, SCREEN_H + 64) collectionViewLayout:layout]; + self.collectionView.pagingEnabled = YES; + self.collectionView.showsHorizontalScrollIndicator = NO; + self.collectionView.delegate = self; + self.collectionView.dataSource = self; + [self.collectionView registerClass:[SJPreviewPhotoCell class] forCellWithReuseIdentifier:ID_SJPreviewPhotoCell]; + self.collectionView.backgroundColor = [UIColor whiteColor]; + [self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:self.curIndex inSection:0] atScrollPosition:(UICollectionViewScrollPositionNone) animated:NO]; + self.operatingModel = [self.previewArray lastObject]; + [self.view addSubview:self.collectionView]; + } + + // nav + { + + self.navBar = [[SJPhotoPickerNavBar alloc] init]; + self.navBar.delegate = self; + self.operatingModel = self.previewArray[self.curIndex]; + + if (self.title.length == 0) { + self.navBar.leftBtnTitle = @""; + } + self.navBar.barTitle = [NSString stringWithFormat:@"%lu/%lu",(unsigned long)self.curIndex + 1,(unsigned long)self.previewArray.count]; + + if (self.operatingModel.isPicked) { + + [self.navBar setRightBtnTitleIndex:self.operatingModel.pickedIndex]; + } + [self.view addSubview:self.navBar]; + + } + + // toolBar + { + self.toolBar = [[SJPhotoPickerToolBar alloc] init]; + self.toolBar.backgroundColor = [UIColor colorWithRed:220/255.0 green:220/255.0 blue:220/255.0 alpha:0.3]; + self.toolBar.rightBtn.backgroundColor = NAVBAR_CLOOUR; + [self.toolBar.rightBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)]; + + self.toolBar.leftBtn.hidden = YES; + [self.toolBar.rightBtn addTarget:self action:@selector(sureBtnAction:) forControlEvents:(UIControlEventTouchUpInside)]; + [self.view addSubview:self.toolBar]; + } +} + +#pragma mark- UICollectionViewDelegate DataSource +#pragma mark- +- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { + return 1; +} + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.previewArray.count; +} + +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + + SJPreviewPhotoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID_SJPreviewPhotoCell forIndexPath:indexPath]; + cell.zoomScale = 1.0; + SJPhotoModel *model = self.previewArray[indexPath.item]; + cell.asset = model.asset; + cell.singleTapEvent = ^(){ + [self.toolBar changeHideState]; + [self.navBar changeHideState]; + }; + return cell; +} + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + return CGSizeMake(SCREEN_W, SCREEN_H); + +} + +- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { + + NSInteger index = (NSInteger)scrollView.contentOffset.x / SCREEN_W; + + self.operatingModel = self.previewArray[index]; + + self.navBar.barTitle = [NSString stringWithFormat:@"%lu/%lu",index + 1,(unsigned long)self.previewArray.count]; + [self.navBar setRightBtnTitleIndex:self.operatingModel.pickedIndex]; + +} + +#pragma mark- 点击事件 +#pragma mark- + +#pragma mark 单选框点击(SJ...NavBarDelegate) +- (void)rightBtnAction:(UIButton *)sender { + + self.operatingModel.isPicked = !self.operatingModel.isPicked; + + // 代理传值 + [self.delegate pickedArrayChangeWithModel:self.operatingModel]; + + if (self.operatingModel.isPicked) { + + NSInteger pickedIndex = self.pickedArray.count + 1; + self.operatingModel.pickedIndex = pickedIndex; + [self.pickedArray addObject:self.operatingModel]; + [self.navBar setRightBtnTitleIndex:pickedIndex]; + } + else { + [self.pickedArray removeObject:self.operatingModel]; + + self.operatingModel.pickedIndex = 0; + for (int i = 0; i < self.pickedArray.count; i ++) { + SJPhotoModel *model = self.pickedArray[i]; + model.pickedIndex = i + 1; + } + [self.navBar setRightBtnTitleIndex:0]; + } +} + +#pragma mark 确定按钮 +- (void)sureBtnAction:(UIButton *)sender { + NSMutableArray *assetArray = [NSMutableArray array]; + for (SJPhotoModel *model in self.pickedArray) { + PHAsset *asset = model.asset; + [assetArray addObject:asset]; + } + if (assetArray.count > MAXCOUNT) { + GIGA_ShowToast(@"最多6张"); + return; + } + SJPhotoPicker *photoPicker = [SJPhotoPicker shareSJPhotoPicker]; + photoPicker.photoPickerBlock(assetArray); + + [self.navigationController dismissViewControllerAnimated:YES completion:nil]; +} + + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Macro/SJPhotoPickerMacro.h b/GIGA/Common/Views/SJPhotoPicker/Macro/SJPhotoPickerMacro.h new file mode 100755 index 0000000..26a3439 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Macro/SJPhotoPickerMacro.h @@ -0,0 +1,34 @@ + +// +// SJPhotoPickerMacro.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/17. +// Copyright © 2016年 S.J. All rights reserved. +// + +#ifndef SJPhotoPickerMacro_h +#define SJPhotoPickerMacro_h + + +#define SCREEN_W CGRectGetWidth([UIScreen mainScreen].bounds) +#define SCREEN_H CGRectGetHeight([UIScreen mainScreen].bounds) + +#define Image_W (SCREEN_W - 15.0) / 4.0 + +#define MAXCOUNT 6 +#define NAVBAR_CLOOUR [UIColor colorWithRed:131/255.0 green:10/255.0 blue:10/255.0 alpha:1] + + +/** + * Notification + */ + +#define PICKEDARRAY_SJNOTIFY_CHANGE @"SJPhotoPickedArrayChangeNotification" // 选择图片图片数组中数据改变 + +#import "SJPhotoPickerManager.h" + + + + +#endif /* SJPhotoPickerMacro_h */ diff --git a/GIGA/Common/Views/SJPhotoPicker/Manager/SJPhotoPickerManager.h b/GIGA/Common/Views/SJPhotoPicker/Manager/SJPhotoPickerManager.h new file mode 100755 index 0000000..84394e4 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Manager/SJPhotoPickerManager.h @@ -0,0 +1,23 @@ +// +// SJPhotoPickerManager.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import +#import + +typedef void(^ImageBlcok)(UIImage *image); + +typedef void(^AlbumBlock)(NSArray *albumArray); + +@interface SJPhotoPickerManager : NSObject + ++ (instancetype)shareSJPhotoPickerManager; + +- (void)requestImageForPHAsset:(PHAsset *)asset targetSize:(CGSize)targetSize imageResult:(ImageBlcok)imageBlock; +- (void)requestAlbumsWithType:(PHAssetCollectionType)type albumResult:(AlbumBlock)albumBlock; + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Manager/SJPhotoPickerManager.m b/GIGA/Common/Views/SJPhotoPicker/Manager/SJPhotoPickerManager.m new file mode 100755 index 0000000..ea919d6 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Manager/SJPhotoPickerManager.m @@ -0,0 +1,84 @@ +// +// SJPhotoPickerManager.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPhotoPickerManager.h" + +#import "SJAlbumModel.h" + +@interface SJPhotoPickerManager() + +@end + + +@implementation SJPhotoPickerManager + ++ (instancetype)shareSJPhotoPickerManager { + + static SJPhotoPickerManager *manager = nil; + + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + if (!manager) { + manager = [[SJPhotoPickerManager alloc] init]; + } + }); + return manager; +} + +- (void)requestImageForPHAsset:(PHAsset *)asset targetSize:(CGSize)targetSize imageResult:(ImageBlcok)imageBlock { + + // 使用PHImageManager从PHAsset中请求图片 + PHImageManager *imageManager = [[PHImageManager alloc] init]; + + + + PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init]; + options.resizeMode = PHImageRequestOptionsResizeModeExact; + options.networkAccessAllowed = YES; + [imageManager requestImageForAsset:asset targetSize:targetSize contentMode:PHImageContentModeAspectFit options:options resultHandler:^(UIImage * _Nullable result, NSDictionary * _Nullable info) { + if (result) { + imageBlock(result); + } + }]; + +} + +- (void)requestAlbumsWithType:(PHAssetCollectionType)type albumResult:(AlbumBlock)albumBlock { + + // 列出所有相册智能相册 + PHFetchResult *assetCollectionResult = [PHAssetCollection fetchAssetCollectionsWithType:type subtype:PHAssetCollectionSubtypeAlbumRegular options:nil]; + + + NSMutableArray *albumArray = [NSMutableArray array]; + // 这时 smartAlbums 中保存的应该是各个智能相册对应的 PHAssetCollection + for (NSInteger i = 0; i < assetCollectionResult.count; i++) { + + // 获取一个相册(PHAssetCollection) + PHCollection *collection = assetCollectionResult[i]; + if ([collection class] == [PHAssetCollection class]) { + + PHAssetCollection *assetCollection = (PHAssetCollection *)collection; + + + PHFetchResult *assetResult = [PHAsset fetchAssetsInAssetCollection:assetCollection options:nil]; + + if (assetResult.count != 0) { + + SJAlbumModel *model = [[SJAlbumModel alloc] init]; + model.title = collection.localizedTitle; + model.assetResult = assetResult; + + [albumArray addObject:model]; + } + } + albumBlock(albumArray); + } + +} + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Models/SJAlbumModel.h b/GIGA/Common/Views/SJPhotoPicker/Models/SJAlbumModel.h new file mode 100755 index 0000000..52a8322 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Models/SJAlbumModel.h @@ -0,0 +1,17 @@ +// +// SJAlbumModel.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import +#import + +@interface SJAlbumModel : NSObject + +@property (nonatomic, strong) PHFetchResult *assetResult; +@property (nonatomic, strong) NSString *title; + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Models/SJAlbumModel.m b/GIGA/Common/Views/SJPhotoPicker/Models/SJAlbumModel.m new file mode 100755 index 0000000..7724467 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Models/SJAlbumModel.m @@ -0,0 +1,13 @@ +// +// SJAlbumModel.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJAlbumModel.h" + +@implementation SJAlbumModel + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Models/SJPhotoModel.h b/GIGA/Common/Views/SJPhotoPicker/Models/SJPhotoModel.h new file mode 100755 index 0000000..696e088 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Models/SJPhotoModel.h @@ -0,0 +1,36 @@ +// +// SJPhotoModel.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import +#import + +@interface SJPhotoModel : NSObject + +/** + * 图片资源 + */ +@property (nonatomic, strong) PHAsset *asset; + +/** + * 选中的次序起始值为1 , 0表示没被选中 + */ +@property (nonatomic, assign) NSInteger pickedIndex; + +/** + * 在相册中次序起始值为 0 + */ +@property (nonatomic, assign) NSInteger inAlbumIndex; + +/** + * 是否选中 YES——选择 NO——取消选择 + */ +@property (nonatomic, assign) BOOL isPicked; + + + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Models/SJPhotoModel.m b/GIGA/Common/Views/SJPhotoPicker/Models/SJPhotoModel.m new file mode 100755 index 0000000..1983ce6 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Models/SJPhotoModel.m @@ -0,0 +1,25 @@ +// +// SJPhotoModel.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPhotoModel.h" + +@implementation SJPhotoModel + +-(id)copyWithZone:(NSZone *)zone { + + SJPhotoModel *modelCopy = [[[self class] allocWithZone:zone] init]; + + modelCopy.asset = self.asset; + modelCopy.pickedIndex = self.pickedIndex; + modelCopy.inAlbumIndex = self.inAlbumIndex; + + return modelCopy; + +} + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/SJPhotoPicker.h b/GIGA/Common/Views/SJPhotoPicker/SJPhotoPicker.h new file mode 100755 index 0000000..504c374 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/SJPhotoPicker.h @@ -0,0 +1,24 @@ +// +// SJPhotoPicker.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/23. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import +#import + +#import "SJPhotoPickerManager.h" + +typedef void(^SJPhotoPickerBlock)(NSArray *assets); + +@interface SJPhotoPicker : NSObject + +@property (nonatomic, strong) SJPhotoPickerBlock photoPickerBlock; + ++ (instancetype)shareSJPhotoPicker; + +- (void) showPhotoPickerToController:(UIViewController *)controller pickedAssets:(SJPhotoPickerBlock)photoPickerBlcok; + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/SJPhotoPicker.m b/GIGA/Common/Views/SJPhotoPicker/SJPhotoPicker.m new file mode 100755 index 0000000..cef5836 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/SJPhotoPicker.m @@ -0,0 +1,71 @@ +// +// SJPhotoPicker.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/23. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPhotoPicker.h" +#import "SJPhotoPickerNavController.h" + +@implementation SJPhotoPicker + ++ (instancetype)shareSJPhotoPicker { + + static SJPhotoPicker *photoPicker = nil; + + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + if (!photoPicker) { + photoPicker = [[SJPhotoPicker alloc] init]; + } + }); + return photoPicker; +} + +- (void) showPhotoPickerToController:(UIViewController *)controller pickedAssets:(SJPhotoPickerBlock)photoPickerBlcok { + + + + [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status){ + dispatch_async(dispatch_get_main_queue(), ^{ + switch (status) { + + case PHAuthorizationStatusNotDetermined: + { + NSLog(@"用户还没有做出选择"); + break; + } + case PHAuthorizationStatusAuthorized: + { + + NSLog(@"用户允许当前应用访问相册"); + SJPhotoPickerNavController *vc = [[SJPhotoPickerNavController alloc] init]; + [controller presentViewController:vc animated:YES completion:nil]; + self.photoPickerBlock = photoPickerBlcok; + + break; + } + case PHAuthorizationStatusDenied: + { + NSLog(@"用户拒绝当前应用访问相册,我们需要提醒用户打开访问开关"); + break; + } + case PHAuthorizationStatusRestricted: + { + NSLog(@"家长控制,不允许访问"); + break; + } + default: + { + NSLog(@"default"); + break; + } + } + }); + }]; +} + + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Sources/photopicker_back.png b/GIGA/Common/Views/SJPhotoPicker/Sources/photopicker_back.png new file mode 100755 index 0000000000000000000000000000000000000000..b890b8d5b0df2e81185a3ee6c6e15f58b5347fd8 GIT binary patch literal 1078 zcmaJ=T}TvB6dsk#j7)m661k30TJ8Mo{|v4_?d;}aYq~DEkIl|pbwI|UhrO4{W`|4`RKl}JpKUwzUSOyQHQJj-4NcE~H3qeAc$6yM|>h#$+u#=){ z4r%EO&LmHY3ep+b#W0R;5;jG3b~~o5Oh62>a7;5I^p~g4X`rbQdL)qKl4cZ+YkheO z4(A8bN`68SRJywhbUGpt&>@zAqfZ*P=tStEu1I3{n597xf+r&MmZ?l~5JZs$L4XN* z6fPJ7A%Woop^!gx40t&{z;Zs;$9cRy(a(u~FWCNQlFd>_#gr7^&P8?+dK_a@WZ7IU z$K-qrvc_0m5CoRI*li^R3EGOKnOH*xa24e&n!*v9INd5iH_Nhy zz1=3#FxHVxmS;G(q!KWh{6AFJ%V-;?;2*#L6t>gTCS+64MpKqTE^f5VO=XHv3(6Q- zX@n+AT^t-o7}?{<1kq@*YoL8ZGgOqbJBplSQcM^&mJJ0aqzFw^7)?_}pXBcq;^Da8 z7Yp)yEGT%xaVZ?&Lw-LW-~xdXS3=5^4h>x5s%5UgRph$kpqnJK1TF0xRO1%XL9uL6 ztL#OpsJG2kD|!jXDsow3hIKFZugfkSkqL6c^5~LHdHA70Cf*{WjW@a-|GjjhoeL=3-MY_G&QJ`g-m2!s=|{ zaO2Lq2WQ{jzj)-^%k}1_rP}%P)N+V;f;S-1m){TkrEb+?Sk)4M-1;pSkcG-v4 zq}24xJX@vryZ0+8WTx0Eg`4^s_!c;)W@LI)6{QAO`Gq7`WhYyvDB0U7*i={n4aiL` zNmQuF&B-gas<2f8n`;GRgM{^!6u?SKvTcwn`Gt*5rFf&&$x70H< zH8(dg*HJJsFf`RSFxEFV&^0o)GBL0+F;aj6C7^9ZDQQ+gE^bh}fIM5JjFOT9D}DX) z@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7^KE~&-IMVSR9nfZANAQKal z@=Hr>m4GgVcpG8yO|TwcUn|eN;*!L?m$yW|qz-7AD57W`>5YW|qb-&aOsg zCT5mq#^#15PB6VL`N^fZsd*(Zy(tL2mN@l-l0$9*&}Ns^qRg_?6t|-MTm`VVtuk@D z#SEu;P`xR*-C~YYuRhQ*`k=@~ifot=Fa?2_@T3dmz!QIJ9x%lh0h6}uy~ke}7#O2G zT^vIyZmpU2+l$Fjr2VVsB8^E-T&gUmT_$)oH31gUZ+{!G%x&>ZQHqmgU#&=8=sRa>xV3t z_Y1!4j$vG6tMrSZ{o{=F8s}Y7t==i0Y7|#m^}%x8qSy=Si&o{%>&{@ek-n&I5oJ<7 zQ-gb6PXz147a_n(bl1Sm*l{&)L zRE*|vAKNDIuKHBwv{~MIisciYpI_yYcKVHI=b5nLDNDafu5GJ&S-(Q2yYT4`8U}fi7AzZCsS=07?{;ELn2Bde0{8v^K*7iAWdWaj57fJ{tG z$}cUkRRX#c;)UD-xUqS~&|m@vn0`fKfxe-h0mw@*g}%P{mFDKcRTq~8r6Sym)!^cg z%7Rq=pw#00(xPNw#HA^NtSYc_E=o--$uA1Y&(DE{Vn9ZINq%ugeu09sGdR=~G{Q6U zQu51-HNkp(eXTt6ic1pnl2bihY?Xkf=w)W6SQ)#RIXXHSnVT59ni(3pnpwD67`mAn zm^m6dJ35;Ovh3yF(Y4oqFIdx}x*l&!(sh-2mp)f*AH5S8K%t9<9ci=YJ|H z)PK+r;c;Aia94&I^P&S*8PVKdTtgk@ryOili)h^@@IYzG!E$by%m$%d-7K*hGFvXr z6-kivWs@qI{b?GP$%|OK_~!?%ZE?7+*)R6X+tPIrTV2rsbq^EG9R8eudAdK^i+Wrp zAGp-#%l>CAtNyK%AG(?CoE90}c)mdQ)N0oHqX+h}dwoz8GCiLm{g0>db)EP1CkH+- z3YlI`5Rv)CU2=ARaJB9zLMqp#1&U&bZ>ZOqj}I)MQiWxGY325 zPJEqau6cMxpMTSCkB}%Wjf5{s#cn&7u9 + +@interface SJPhotoAlbumCell : UITableViewCell + +@property (nonatomic, strong) NSString *title; +@property (nonatomic, strong) UIImage *img; + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoAlbumCell.m b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoAlbumCell.m new file mode 100755 index 0000000..8c92dea --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoAlbumCell.m @@ -0,0 +1,102 @@ +// +// SJPhotoAlbumCell.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPhotoAlbumCell.h" +#import "SJPhotoPickerMacro.h" + +@interface SJPhotoAlbumCell() + +@property (nonatomic, strong) UIImageView *imgView; +@property (nonatomic, strong) UILabel *titleLab; +@property (nonatomic, strong) UILabel *underLine; + +@end + + +@implementation SJPhotoAlbumCell + +- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + [self s_setupCellView]; + + } + return self; +} + +- (void)s_setupCellView { + + CGFloat X_Padding = 15.0; + self.imgView = [[UIImageView alloc] initWithFrame:CGRectMake(X_Padding, 0, 55, 54)]; + self.imgView.backgroundColor= [UIColor blueColor]; + [self.contentView addSubview:self.imgView]; + + self.titleLab = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.imgView.frame) + 15 , 0,SCREEN_W - CGRectGetWidth(self.imgView.frame) - 15 * 2 - 30, 54)]; + [self.contentView addSubview:self.titleLab]; + + + self.underLine = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.imgView.frame) + 15 , CGRectGetMaxY(self.titleLab.frame),SCREEN_W - CGRectGetWidth(self.imgView.frame) - 15 * 2, 1)]; + self.underLine.backgroundColor = [UIColor colorWithRed:236/255.0 green:236/255.0 blue:236/255.0 alpha:1]; + [self.contentView addSubview:self.underLine]; + +} + +- (NSString *)title { + return self.title; +} + +- (void)setTitle:(NSString *)title { + self.titleLab.attributedText = [self attributedString:title]; +} + +- (UIImage *)img { + return self.img; +} + +- (void)setImg:(UIImage *)img { + self.imgView.image = img; +} + + +/** + * 更改字符串的前两个空格之间字符串的颜色 + * + * @param txt 要改变颜色的字符床 + * + * @return 改变后的字符串 + */ +- (NSMutableAttributedString *)attributedString:(NSString *)txt { + + // 查找出前两个空格的位置 + NSInteger start = 0; + NSInteger end = 0; + NSRange countRange = NSMakeRange(0, 0); + + NSString *leftString = @"("; + int leftAsciiCode = [leftString characterAtIndex:0]; // 65 + + NSString *rightString = @")"; + int rightAsciiCode = [rightString characterAtIndex:0]; // 65 + + for (int i = 0 ; i < txt.length; i ++) { + if ([txt characterAtIndex:i] == leftAsciiCode) { + start = i; + } + + if([txt characterAtIndex:i] == rightAsciiCode){ + end = i; + } + countRange = NSMakeRange(start, end - start + 1); + } + // 改变范围内字符颜色 + NSMutableAttributedString *attributeStr = [[NSMutableAttributedString alloc] initWithString:txt]; + [attributeStr addAttribute:NSForegroundColorAttributeName value:[UIColor lightGrayColor] range:countRange]; + return attributeStr; +} + +@end \ No newline at end of file diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerNavBar.h b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerNavBar.h new file mode 100755 index 0000000..9280cc8 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerNavBar.h @@ -0,0 +1,30 @@ +// +// SJPhotoPickerNavBar.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + + +#import + +@protocol SJPhotoPickerNavBarDelegate + +@optional +- (void)leftBtnAction:(UIButton *)sender; +- (void)rightBtnAction:(UIButton *)sender; + +@end + +@interface SJPhotoPickerNavBar : UIView + +@property (nonatomic, strong) id delegate; + +@property (nonatomic, assign) NSInteger rightBtnTitleIndex; +@property (nonatomic, strong) NSString *barTitle; +@property (nonatomic, strong) NSString *leftBtnTitle; + +- (void)changeHideState; + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerNavBar.m b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerNavBar.m new file mode 100755 index 0000000..b9ebbcc --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerNavBar.m @@ -0,0 +1,145 @@ +// +// SJPhotoPickerNavBar.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPhotoPickerNavBar.h" + +#import "SJPhotoPickerMacro.h" + +#import "SJPhotoPickerRaidoButton.h" + +@interface SJPhotoPickerNavBar() + +@property (nonatomic, strong) UIButton *leftBtn; +@property (nonatomic, strong) UILabel *titleLab; +@property (nonatomic, strong) SJPhotoPickerRaidoButton *rightBtn; + +@property (nonatomic, assign) BOOL barHide; + +@end + +@implementation SJPhotoPickerNavBar + +- (instancetype)init { + self = [super initWithFrame:CGRectMake(0, 0, SCREEN_W, 64)]; + if (self) { + [self setupViews]; + } + return self; +} + +- (void)setupViews { + + self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6]; + self.barHide = NO; + + // leftBtn + { + self.leftBtn = [UIButton buttonWithType:(UIButtonTypeCustom)]; + self.leftBtn.frame = CGRectMake(0, 20, 70, 44); + [self.leftBtn setTitleColor:[UIColor colorWithWhite:0.5 alpha:0.5] forState:(UIControlStateHighlighted)]; + + [self.leftBtn setImageEdgeInsets:UIEdgeInsetsMake(0, -5, 0, 0)]; + [self.leftBtn setImage:[UIImage imageNamed:@"photopicker_back"] forState:(UIControlStateNormal)]; + + [self.leftBtn addTarget:self action:@selector(leftBtnAction:) forControlEvents:(UIControlEventTouchUpInside)]; + [self addSubview:self.leftBtn]; + + } + + // titleLab + { + self.titleLab = [[UILabel alloc] init]; + self.titleLab.font = [UIFont systemFontOfSize:16]; + self.titleLab.textColor = [UIColor whiteColor]; + self.titleLab.textAlignment = NSTextAlignmentCenter; + [self addSubview:self.titleLab]; + } + + // rightBtn + { + self.rightBtn = [[SJPhotoPickerRaidoButton alloc] initWithFrame:CGRectMake(SCREEN_W - 35, 31, 20, 20)]; + [self.rightBtn addTarget:self action:@selector(rightBtnAction:) forControlEvents:(UIControlEventTouchUpInside)]; + [self addSubview:self.rightBtn]; + + } +} + +- (void)setRightBtnTitleIndex:(NSInteger)rightBtnTitleIndex { + _rightBtnTitleIndex = rightBtnTitleIndex; + [self.rightBtn setPickedIndex:rightBtnTitleIndex]; + +} + +- (void)setLeftBtnTitle:(NSString *)leftBtnTitle { + + _leftBtnTitle = leftBtnTitle; + + CGFloat titleWidth = [self widthWithString:leftBtnTitle textFontSize:16]; + + self.leftBtn.frame = CGRectMake(10, 20, titleWidth + 20, 44); + [self.leftBtn setTitle:leftBtnTitle forState:(UIControlStateNormal)]; +} + +- (void)setBarTitle:(NSString *)barTitle { + + _barTitle = barTitle; + + CGFloat titleWidth = [self widthWithString:barTitle textFontSize:16]; + self.titleLab.frame = CGRectMake((SCREEN_W - titleWidth) * 0.5, 20, titleWidth, 44); + self.titleLab.text = barTitle; +} + +- (void)leftBtnAction:(UIButton *)sender { + + UIViewController *vc = [self getCurrentViewController]; + if (vc.navigationController) { + [vc.navigationController popViewControllerAnimated:YES]; + } +} + +- (void)rightBtnAction:(UIButton *)sender { + [self.delegate rightBtnAction:sender]; +} + +- (void)changeHideState { + + self.barHide = !self.barHide; + + if (self.barHide) { + [UIView animateWithDuration:0.3 animations:^{ + self.frame = CGRectMake(0, -64, SCREEN_W, 64); + }]; + } + else { + [UIView animateWithDuration:0.3 animations:^{ + self.frame = CGRectMake(0, 0, SCREEN_W, 64); + }]; + } + +} + + +/** 获取当前View的控制器对象 */ +-(UIViewController *)getCurrentViewController{ + UIResponder *next = [self nextResponder]; + do { + if ([next isKindOfClass:[UIViewController class]]) { + return (UIViewController *)next; + } + next = [next nextResponder]; + } while (next != nil); + return nil; +} + + +- (CGFloat)widthWithString:(NSString *)text textFontSize:(CGFloat)size { + CGRect rect = [text boundingRectWithSize:CGSizeMake(LONG_MAX, 8)options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]} context:nil]; + return rect.size.width; +} + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerRaidoButton.h b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerRaidoButton.h new file mode 100755 index 0000000..7f90cf1 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerRaidoButton.h @@ -0,0 +1,19 @@ +// +// SJPhotoPickerRaidoButton.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import + +typedef void(^RadioButtonTouchedBlock)(); + +@interface SJPhotoPickerRaidoButton : UIButton + +@property (nonatomic, assign) NSInteger pickedIndex; + +@property (nonatomic, strong) RadioButtonTouchedBlock touchedBlock; + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerRaidoButton.m b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerRaidoButton.m new file mode 100755 index 0000000..bf72627 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerRaidoButton.m @@ -0,0 +1,45 @@ +// +// SJPhotoPickerRaidoButton.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPhotoPickerRaidoButton.h" +#import "SJPhotoPickerMacro.h" + +@implementation SJPhotoPickerRaidoButton + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self s_setupViews]; + } + return self; +} + +- (void)s_setupViews { + + self.titleLabel.font = [UIFont systemFontOfSize:13]; + self.layer.cornerRadius = CGRectGetWidth(self.frame) * 0.5; + self.layer.masksToBounds = YES; + self.layer.borderWidth = 1; + self.layer.borderColor = [UIColor whiteColor].CGColor; + +} + +- (void)setPickedIndex:(NSInteger)pickedIndex{ + + if (pickedIndex != 0) { + self.backgroundColor = NAVBAR_CLOOUR; + [self setTitle:[NSString stringWithFormat:@"%ld",pickedIndex] forState:(UIControlStateNormal)]; + } + else { + self.backgroundColor = [UIColor colorWithRed:148/255.0 green:148/255.0 blue:148/255.0 alpha:0.6]; + [self setTitle:@"" forState:(UIControlStateNormal)]; + } +} + + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerToolBar.h b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerToolBar.h new file mode 100755 index 0000000..98736aa --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerToolBar.h @@ -0,0 +1,22 @@ +// +// SJPhotoPickerToolBar.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import +#import "SJPhotoPickerMacro.h" + +@interface SJPhotoPickerToolBar : UIView + +@property (nonatomic, strong) UIButton *leftBtn; +@property (nonatomic, strong) UIButton *rightBtn; + + +- (void)changePickedIndex:(NSInteger) pickedIndex; +- (void)changeHideState; + + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerToolBar.m b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerToolBar.m new file mode 100755 index 0000000..14644c1 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPhotoPickerToolBar.m @@ -0,0 +1,99 @@ +// +// SJPhotoPickerToolBar.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/22. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPhotoPickerToolBar.h" +#import "SJPhotoPickerMacro.h" + +@interface SJPhotoPickerToolBar() + +@property (nonatomic, assign) BOOL barHide; + +@end; + +@implementation SJPhotoPickerToolBar + +- (instancetype)init { + + self = [super init]; + + if (self) { + self.frame = CGRectMake(0, SCREEN_H - 44, SCREEN_W, 44); + [self s_setupViews]; + } + + return self; +} + +- (void)s_setupViews { + + self.layer.shadowOffset = CGSizeMake(0, -0.3); + self.layer.shadowColor= [UIColor lightGrayColor].CGColor; + self.layer.shadowRadius = 1; + self.layer.shadowOpacity = 1; + + self.backgroundColor = [UIColor colorWithRed:245/255.0 green:245/255.0 blue:245/255.0 alpha:0.9]; + + self.leftBtn = [UIButton buttonWithType:(UIButtonTypeCustom)]; + self.leftBtn.frame = CGRectMake(5, 7, 60, 30); + [self.leftBtn setTitleColor:NAVBAR_CLOOUR forState:(UIControlStateNormal)]; + self.leftBtn.titleLabel.font = [UIFont systemFontOfSize:16]; + [self.leftBtn setTitle:@"预览" forState:(UIControlStateNormal)]; + [self addSubview:self.leftBtn]; + + self.rightBtn = [UIButton buttonWithType:(UIButtonTypeCustom)]; + self.rightBtn.frame = CGRectMake(SCREEN_W - 75, 7, 65, 30); + self.rightBtn.backgroundColor = NAVBAR_CLOOUR; + [self.rightBtn setTitleColor:[UIColor colorWithRed:195/255.0 green:195/255.0 blue:195/255.0 alpha:1] forState:(UIControlStateNormal)]; + self.rightBtn.layer.cornerRadius = 2; + self.rightBtn.layer.masksToBounds = YES; + self.rightBtn.titleLabel.font = [UIFont systemFontOfSize:14]; + [self.rightBtn setTitle:@"确定" forState:(UIControlStateNormal)]; + [self addSubview:self.rightBtn]; + + self.barHide = NO; + +} + +- (void)changePickedIndex:(NSInteger) pickedIndex { + if (pickedIndex == 0) { + + [self.leftBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)]; + self.rightBtn.backgroundColor = NAVBAR_CLOOUR; + self.leftBtn.backgroundColor = NAVBAR_CLOOUR; + [self.rightBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)]; + [self.rightBtn setTitle:@"确定" forState:(UIControlStateNormal)]; + } + else { + + self.rightBtn.backgroundColor = NAVBAR_CLOOUR; + self.leftBtn.backgroundColor = NAVBAR_CLOOUR; + [self.rightBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)]; + [self.rightBtn setTitle:[NSString stringWithFormat:@"确定(%lu)",(unsigned long)pickedIndex] forState:(UIControlStateNormal)]; + [self.leftBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)]; + } + +} + +- (void)changeHideState { + + self.barHide = !self.barHide; + + if (self.barHide) { + [UIView animateWithDuration:0.3 animations:^{ + self.frame = CGRectMake(0, SCREEN_H, SCREEN_W, 44); + }]; + } + else { + [UIView animateWithDuration:0.3 animations:^{ + self.frame = CGRectMake(0, SCREEN_H - 44, SCREEN_W, 44); + }]; + } + +} + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPickPhotoCell.h b/GIGA/Common/Views/SJPhotoPicker/Views/SJPickPhotoCell.h new file mode 100755 index 0000000..9b5e476 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPickPhotoCell.h @@ -0,0 +1,27 @@ +// +// SJPickPhotoCell.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import +#import + +#import "SJPhotoPickerMacro.h" + +#import "SJPhotoModel.h" + +typedef void(^PickBtnBlock)(SJPhotoModel *curPickModel); +typedef void(^ModelChangeBlock)(SJPhotoModel *modifiedModel); + +@interface SJPickPhotoCell : UICollectionViewCell + +@property (nonatomic, strong) SJPhotoModel *model; + +@property (nonatomic, strong) PickBtnBlock pickBtnBlock; + +- (void)modelChangePickedIndex:(NSInteger)pickedIndex; + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPickPhotoCell.m b/GIGA/Common/Views/SJPhotoPicker/Views/SJPickPhotoCell.m new file mode 100755 index 0000000..14a3719 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPickPhotoCell.m @@ -0,0 +1,125 @@ +// +// SJPickPhotoCell.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPickPhotoCell.h" + +#import "SJPhotoPickerManager.h" +#import "SJPhotoPickerMacro.h" + +@interface SJPickPhotoCell() + +@property (nonatomic, strong) UIImageView *imgView; +@property (nonatomic, strong) UIButton *pickBtn; + +@end + +@implementation SJPickPhotoCell + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self setupViews]; + } + return self; +} + +- (void)setupViews { + + // imgView + { + self.imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0,Image_W, Image_W)]; + self.imgView.contentMode = UIViewContentModeScaleAspectFit; + self.imgView.backgroundColor = NAVBAR_CLOOUR; + [self.contentView addSubview:self.imgView]; + } + + // pickBtn + { + self.pickBtn = [UIButton buttonWithType:(UIButtonTypeCustom)]; + self.pickBtn.frame = CGRectMake(CGRectGetMaxX(self.imgView.frame) - CGRectGetWidth(self.imgView.frame) * 0.35,CGRectGetWidth(self.imgView.frame) * 0.05, CGRectGetWidth(self.imgView.frame) * 0.3, CGRectGetWidth(self.imgView.frame) * 0.3); + + self.pickBtn.layer.cornerRadius = CGRectGetWidth(self.pickBtn.frame) * 0.5; + self.pickBtn.layer.masksToBounds = YES; + self.pickBtn.layer.borderWidth = 1; + self.pickBtn.layer.borderColor = [UIColor whiteColor].CGColor; + + self.pickBtn.titleLabel.font = [UIFont systemFontOfSize:13]; + self.pickBtn.backgroundColor = NAVBAR_CLOOUR; + + [self.pickBtn addTarget:self action:@selector(pickBtnAction:) forControlEvents:(UIControlEventTouchUpInside)]; + + [self.contentView addSubview:self.pickBtn]; + } +} + +- (void)setModel:(SJPhotoModel *)model { + + _model = model; + + [[SJPhotoPickerManager shareSJPhotoPickerManager] requestImageForPHAsset:model.asset targetSize:CGSizeMake(Image_W, Image_W) imageResult:^(UIImage *image) { + if (image) { + self.imgView.image = image; + } + }]; + + if (model.pickedIndex != 0) { + + [self.pickBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.pickedIndex] forState:(UIControlStateNormal)]; + self.pickBtn.backgroundColor = NAVBAR_CLOOUR; + } + else { + + [self.pickBtn setTitle:@"" forState:(UIControlStateNormal)]; + self.pickBtn.backgroundColor = [UIColor colorWithRed:148/255.0 green:148/255.0 blue:148/255.0 alpha:0.6]; + } +} + + +- (void)modelChangePickedIndex:(NSInteger)pickedIndex{ + + if (pickedIndex != 0) { + self.model.pickedIndex = pickedIndex; + self.model.isPicked = YES; + [self.pickBtn setTitle:[NSString stringWithFormat:@"%ld",(long)pickedIndex] forState:(UIControlStateNormal)]; + self.pickBtn.backgroundColor = NAVBAR_CLOOUR; + [self showOscillatoryAnimationWithLayer:self.pickBtn.layer]; + } + else { + self.model.pickedIndex = 0; + self.model.isPicked = NO; + [self.pickBtn setTitle:@"" forState:(UIControlStateNormal)]; + self.pickBtn.backgroundColor = [UIColor colorWithRed:148/255.0 green:148/255.0 blue:148/255.0 alpha:0.6]; + } +} + +- (void)showOscillatoryAnimationWithLayer:(CALayer *)layer { + + NSNumber *animationScale1 = @(1.15); + NSNumber *animationScale2 = @(0.85); + NSNumber *animationScale3 = @(1.0); + + [UIView animateWithDuration:0.15 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{ + [layer setValue:animationScale1 forKeyPath:@"transform.scale"]; + } completion:^(BOOL finished) { + [UIView animateWithDuration:0.15 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{ + [layer setValue:animationScale2 forKeyPath:@"transform.scale"]; + } completion:^(BOOL finished) { + [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{ + [layer setValue:animationScale3 forKeyPath:@"transform.scale"]; + } completion:nil]; + }]; + }]; +} + +- (void)pickBtnAction:(UIButton *)sender { + + self.model.isPicked = !self.model.isPicked; + self.pickBtnBlock(self.model); +} + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPreviewPhotoCell.h b/GIGA/Common/Views/SJPhotoPicker/Views/SJPreviewPhotoCell.h new file mode 100755 index 0000000..17acd9b --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPreviewPhotoCell.h @@ -0,0 +1,21 @@ +// +// SJPreviewPhotoCell.h +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import +#import + +typedef void(^SingleTapEventBlock)(void); + +@interface SJPreviewPhotoCell : UICollectionViewCell + +@property (nonatomic, strong) PHAsset *asset; +@property (nonatomic, assign) CGFloat zoomScale; + +@property (nonatomic, strong) SingleTapEventBlock singleTapEvent; + +@end diff --git a/GIGA/Common/Views/SJPhotoPicker/Views/SJPreviewPhotoCell.m b/GIGA/Common/Views/SJPhotoPicker/Views/SJPreviewPhotoCell.m new file mode 100755 index 0000000..a5d7742 --- /dev/null +++ b/GIGA/Common/Views/SJPhotoPicker/Views/SJPreviewPhotoCell.m @@ -0,0 +1,127 @@ +// +// SJPreviewPhotoCell.m +// SJPhotoPickerDemo +// +// Created by Jaesun on 16/8/19. +// Copyright © 2016年 S.J. All rights reserved. +// + +#import "SJPreviewPhotoCell.h" + +#import "SJPhotoPickerMacro.h" + +@interface SJPreviewPhotoCell() + +@property (nonatomic, strong) UIImageView *imgView; + +@property (nonatomic, strong) UIScrollView *scrollView; + +@end + +@implementation SJPreviewPhotoCell + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self setupViews]; + } + return self; +} + +- (void)setupViews { + + self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H)]; + self.scrollView.delegate = self; + self.scrollView.maximumZoomScale = 4.0; + self.scrollView.minimumZoomScale = 1.0; + + self.scrollView.contentSize = CGSizeMake(SCREEN_W, SCREEN_H); + [self.contentView addSubview:self.scrollView]; + self.imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H)]; + self.imgView.contentMode = UIViewContentModeScaleAspectFit; + [self.scrollView addSubview:self.imgView]; + + UITapGestureRecognizer *singleTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapGestureAction:)]; + [self.scrollView addGestureRecognizer:singleTapGesture]; + + UITapGestureRecognizer *doubleTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTapGestureAction:)]; + [doubleTapGesture setNumberOfTapsRequired:2]; // Default is 1 + [self.scrollView addGestureRecognizer:doubleTapGesture]; + + // 如果满足双击条件,单击事件触发失败,防止双击时单击事件同时被触发 + [singleTapGesture requireGestureRecognizerToFail:doubleTapGesture]; +} + +- (void)setAsset:(PHAsset *)asset { + + _asset = asset; + + [[SJPhotoPickerManager shareSJPhotoPickerManager] requestImageForPHAsset:asset targetSize:PHImageManagerMaximumSize imageResult:^(UIImage *image) { + if (image) { + self.imgView.image = image; + CGFloat scale_H = SCREEN_H / image.size.height; + CGFloat scale_W = SCREEN_W / image.size.width; + + CGSize size; + if (scale_H > scale_W) { + size = CGSizeMake(SCREEN_W, scale_W * image.size.height); + } + else if (scale_H < scale_W) { + size = CGSizeMake(scale_H * image.size.width, SCREEN_H); + } + self.imgView.frame = CGRectMake(0, 0, size.width, size.height); + self.imgView.center = self.scrollView.center; + } + }]; +} + +- (void)setZoomScale:(CGFloat)zoomScale { + _zoomScale = zoomScale; + [UIView animateWithDuration:0.3 animations:^{ + self.scrollView.zoomScale = zoomScale; + }]; + +} + +- (void)scrollViewDidZoom:(UIScrollView *)scrollView { + + CGSize viewSize = self.imgView.frame.size; + CGPoint centerPoint; + + if (viewSize.width<=CGRectGetWidth(self.bounds) && viewSize.height<=CGRectGetHeight(self.bounds)) { + centerPoint = CGPointMake(CGRectGetWidth(self.bounds)*0.5f, CGRectGetHeight(self.bounds)*0.5f); + + }else if (viewSize.width>=CGRectGetWidth(self.bounds) && viewSize.height>=CGRectGetHeight(self.bounds) ){ + centerPoint = CGPointMake(scrollView.contentSize.width*0.5f, scrollView.contentSize.height*0.5f); + + }else if (viewSize.width<=CGRectGetWidth(self.bounds) && viewSize.height>=CGRectGetHeight(self.bounds) ){ + centerPoint = CGPointMake(CGRectGetWidth(self.bounds)*0.5f, scrollView.contentSize.height*0.5f); + + }else if ((viewSize.width >= CGRectGetWidth(self.bounds)) && (viewSize.height <= CGRectGetHeight(self.bounds))){ + centerPoint = CGPointMake(scrollView.contentSize.width*0.5f, CGRectGetHeight(self.bounds)*0.5f); + } + self.imgView.center = centerPoint; +} + +- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { + return self.imgView; +} + +- (void)singleTapGestureAction:(UITapGestureRecognizer *)sender { + + self.singleTapEvent(); + +} + +- (void)doubleTapGestureAction:(UITapGestureRecognizer *)sender { + if (self.zoomScale == 4) { + self.zoomScale = 1; + }else { + CGFloat newScale = self.zoomScale * 2.0f; + self.zoomScale = newScale; + } + +} + + +@end diff --git a/GIGA/Config/GIGA.h b/GIGA/Config/GIGA.h index 2bfbaff..be81d7b 100644 --- a/GIGA/Config/GIGA.h +++ b/GIGA/Config/GIGA.h @@ -114,6 +114,7 @@ alpha:((float)(rgbValue & 0xFF))/255.0] //HUD #define HUD_DISPLAY_DURATION 2 #define HUD_TIMEOUT_DURATION 8 - +//分享图片文件名 +#define kUSERSHAREA_IMAGENAME @"mask_share" #endif /* GIGA_h */ diff --git a/GIGA/GIGA.pch b/GIGA/GIGA.pch index e7f218e..0e28d5b 100644 --- a/GIGA/GIGA.pch +++ b/GIGA/GIGA.pch @@ -18,6 +18,7 @@ #import #endif +#import "GiGaUserDefault.h" #import "GIGA.h" //#import "AFNetworking.h" diff --git a/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.m b/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.m index efc2ca8..b63f479 100644 --- a/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.m +++ b/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.m @@ -11,8 +11,10 @@ #import "MaskTimeTimeViewCell.h" #import "MaskTimeEndActionViewCell.h" #import "ShareViewController.h" - -@interface GIGaMaskShareViewController () +#import "MaskTimeShareActionSheet.h" +#import "GIGaUserFileHelper.h" +#import +@interface GIGaMaskShareViewController () @end @@ -99,7 +101,36 @@ #pragma mark changeBackBtnAction -(void)changeBackBtnAction{ + MaskTimeShareActionSheet * sheet = [[MaskTimeShareActionSheet alloc] initWithFrame:CGRectMake(0, 0, KMainW, KMainH)]; + [sheet show:^(NSUInteger index) { + switch (index) { + case 0: + {//手机 + [self photosAlbum]; + } + break; + case 1: + { + //系统 + [GIGaUserFileHelper delectShareImage:kUSERSHAREA_IMAGENAME]; + ShareViewController *share = [[ShareViewController alloc] init]; + [self presentViewController:share animated:NO completion:nil]; + + } + break; + case 2: + { + //自拍 + [self takePhoto]; + } + break; + default: + break; + } + + }]; + [self.view addSubview:sheet]; } #pragma mark share @@ -110,4 +141,91 @@ } +#pragma mark 相册 +-(void)photosAlbum{ + UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES; + + //相册 + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { + //权限 + + imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + [self presentViewController:imagePickerController animated:YES completion:nil]; + + }else{ + + NSString *errorStr = @"应用相权册限受限,请在设置中启用"; + [self jxt_showAlertWithTitle:@"" message:errorStr appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + alertMaker.addActionCancelTitle(@"取消"); + alertMaker.addActionDefaultTitle(@"去开启"); + + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + if (buttonIndex == 1) { + NSURL *url = [NSURL URLWithString:@"prefs:root=Photos"]; + if ([[UIApplication sharedApplication] canOpenURL:url]) { + [[UIApplication sharedApplication] openURL:url]; + } + + } + }]; + } + +} + +-(void)takePhoto{ + + UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES; + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { + + //权限判断应用是否有使用相机的权限 + NSString *mediaType = AVMediaTypeVideo;//读取媒体类型 + AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];//读取设备授权状态 + if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){ + NSString *errorStr = @"应用相机权限受限,请在设置中启用"; + [self jxt_showAlertWithTitle:@"" message:errorStr appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + alertMaker.addActionCancelTitle(@"取消"); + alertMaker.addActionDefaultTitle(@"去开启"); + + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + + if (buttonIndex == 1) { + + NSString *urlStr = @"App-Prefs:root=Photos"; + if (@available(iOS 10.0, *)) { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr] options:@{} completionHandler:nil]; + } else { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]]; + // Fallback on earlier versions + } + } + }]; + return; + } + + // 设置数据源 + imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; + [self presentViewController:imagePickerController animated:YES completion:nil]; + + } + +} +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + GILog(@"info:%@",info); + [picker dismissViewControllerAnimated:YES completion:nil] + ; + + UIImage*img=[info objectForKey:UIImagePickerControllerEditedImage]; + UIImage *small = [GIGaUserFileHelper zipScaleWithImage:img]; + [GIGaUserFileHelper savaShareImange:kUSERSHAREA_IMAGENAME image:small]; + + ShareViewController *share = [[ShareViewController alloc] init]; + [self presentViewController:share animated:NO completion:nil]; +} + +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{ + [picker dismissViewControllerAnimated:YES completion:nil]; +} + + @end diff --git a/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m b/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m index c885b48..a4a97be 100644 --- a/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m +++ b/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m @@ -122,13 +122,15 @@ -(void)connetction{ - NSURL* url = [[NSURL alloc] initWithString:@"http://wsyts.s1.natapp.cc"]; + //@"connectParams":@{@"token":@""} NSString *token = [GiGaUserDefault getCurentToken]; if (!token) { token = @""; } - SocketManager *manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @NO, @"forcePolling": @YES,@"extraHeaders":@{@"device":@"ios"},@"token":token}]; + NSString *urlstr = [NSString stringWithFormat:@"http://wsyts.s1.natapp.cc"]; + NSURL* url = [[NSURL alloc] initWithString:urlstr]; + SocketManager *manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @NO, @"forcePolling": @YES,@"extraHeaders":@{@"device":@"ios"},@"connectParams":@{@"token":token}}]; _manager = manager; _client = manager.defaultSocket; diff --git a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m index daef913..0fe7044 100644 --- a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m +++ b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m @@ -502,9 +502,9 @@ // resultVC.model = model; // [self.navigationController pushViewController:resultVC animated:YES]; - [self showAlertGoShareMaskTime]; + //[self showAlertGoShareMaskTime]; + - return; GiGaQuestionVC *questionVC = [[GiGaQuestionVC alloc] init]; [self.navigationController pushViewController:questionVC animated:YES]; @@ -667,6 +667,7 @@ - (void)progressDidFish{ NSLog(@"结束"); [self maskTimeEnd]; + [self showAlertGoShareMaskTime]; } - (void)didReceiveMemoryWarning { diff --git a/GIGA/Modules/Mask/Controller/ShareViewController.m b/GIGA/Modules/Mask/Controller/ShareViewController.m index 21db49f..dd0dda7 100644 --- a/GIGA/Modules/Mask/Controller/ShareViewController.m +++ b/GIGA/Modules/Mask/Controller/ShareViewController.m @@ -10,9 +10,10 @@ #import "MaskTimeShareViewCell.h" #import "MaskShareTimeMidViewCell.h" #import "MaskShareBoootomViewCell.h" - - -@interface ShareViewController () +#import "MaskTimeShareActionSheet.h" +#import "GIGaUserFileHelper.h" +#import +@interface ShareViewController () @property(nonatomic,strong) UITableView *tab; @property(nonatomic,strong) UIImageView *backimageview ; @property(nonatomic) int curentImageIndex ; @@ -27,9 +28,11 @@ _curentImageIndex = 0; UIImageView *backimageview = [[UIImageView alloc] init]; + backimageview.contentMode = UIViewContentModeScaleAspectFill; backimageview.frame = CGRectMake(0, 0,self.view.frame.size.width, self.view.frame.size.height); backimageview.userInteractionEnabled = YES; - backimageview.image = [UIImage imageNamed:@"sharebg_1"]; + backimageview.image = [GIGaUserFileHelper getUserShareImage:kUSERSHAREA_IMAGENAME]; + // self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"sharebg_1"]]; self.backimageview = backimageview; [self.view addSubview:backimageview]; @@ -37,7 +40,7 @@ UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; backBtn.frame = CGRectMake(20,44, 40, 40); [backBtn setImage:[UIImage imageNamed:@"btn_moment_back"] forState:UIControlStateNormal]; - backBtn.backgroundColor = [UIColor redColor]; + [backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:backBtn]; [self.view insertSubview:backimageview atIndex:0]; @@ -145,19 +148,132 @@ -(void)changeAction{ - _curentImageIndex ++; - if (_curentImageIndex == 4) { - _curentImageIndex = 0; + + + MaskTimeShareActionSheet * sheet = [[MaskTimeShareActionSheet alloc] initWithFrame:CGRectMake(0, 0, KMainW, KMainH)]; + [sheet show:^(NSUInteger index) { + switch (index) { + case 0: + {//手机 + [self photosAlbum]; + } + break; + case 1: + { + //系统 + self->_curentImageIndex ++; + if (self->_curentImageIndex == 4) { + self->_curentImageIndex = 0; + } + NSArray *images = @[@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5",@"sharebg_1"]; + + [self.backimageview setImage:[UIImage imageNamed: images[self->_curentImageIndex]]]; + + } + break; + case 2: + { + //自拍 + [self takePhoto]; + } + break; + default: + break; + } + + }]; + + [self.view addSubview:sheet]; + +} +#pragma mark 相册 +-(void)photosAlbum{ + UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES; + + //相册 + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { + //权限 + + imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + [self presentViewController:imagePickerController animated:YES completion:nil]; + + }else{ + + NSString *errorStr = @"应用相权册限受限,请在设置中启用"; + [self jxt_showAlertWithTitle:@"" message:errorStr appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + alertMaker.addActionCancelTitle(@"取消"); + alertMaker.addActionDefaultTitle(@"去开启"); + + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + if (buttonIndex == 1) { + NSURL *url = [NSURL URLWithString:@"prefs:root=Photos"]; + if ([[UIApplication sharedApplication] canOpenURL:url]) { + [[UIApplication sharedApplication] openURL:url]; + } + + } + }]; } - NSArray *images = @[@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5",@"sharebg_1"]; - [self.backimageview setImage:[UIImage imageNamed: images[_curentImageIndex]]]; +} + +-(void)takePhoto{ + UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES; + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { + + //权限判断应用是否有使用相机的权限 + NSString *mediaType = AVMediaTypeVideo;//读取媒体类型 + AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];//读取设备授权状态 + if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){ + NSString *errorStr = @"应用相机权限受限,请在设置中启用"; + [self jxt_showAlertWithTitle:@"" message:errorStr appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + alertMaker.addActionCancelTitle(@"取消"); + alertMaker.addActionDefaultTitle(@"去开启"); + + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + + if (buttonIndex == 1) { + + NSString *urlStr = @"App-Prefs:root=Photos"; + if (@available(iOS 10.0, *)) { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr] options:@{} completionHandler:nil]; + } else { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]]; + // Fallback on earlier versions + } + } + }]; + return; + } + + // 设置数据源 + imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; + [self presentViewController:imagePickerController animated:YES completion:nil]; + + } + +} +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + GILog(@"info:%@",info); + [picker dismissViewControllerAnimated:YES completion:nil] + ; + + UIImage*img=[info objectForKey:UIImagePickerControllerEditedImage]; + UIImage *small = [GIGaUserFileHelper zipScaleWithImage:img]; + [GIGaUserFileHelper savaShareImange:kUSERSHAREA_IMAGENAME image:small]; + + ShareViewController *share = [[ShareViewController alloc] init]; + [self presentViewController:share animated:NO completion:nil]; +} + +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{ + [picker dismissViewControllerAnimated:YES completion:nil]; } -(void)shareBtnAction{ - } @end diff --git a/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m b/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m index 3f8f84b..5c399ab 100644 --- a/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m +++ b/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m @@ -356,6 +356,7 @@ } + -(void)submitAnswer{ NSDictionary *params = @{@"singleChoiceList":self.answerArray}; @@ -375,8 +376,19 @@ BOOL isUserLogin = [GiGaUserDefault isUserLogin]; if (isUserLogin) { //展示结果 - MaskTestResultVC *reusltVC = [[MaskTestResultVC alloc] init]; - [self.navigationController pushViewController:reusltVC animated:YES]; + NSDictionary *dic = @{ + @"dryness":@"0.41", + @"drynessPercent":@"41%", + @"mask":@"", + @"minute":@"19", + @"oiliness":@"0.59", + @"oilinessPercent":@"59%" + }; + MaskTestResult *model =[[MaskTestResult alloc] initWithDictionary:dic error:nil]; + MaskTestResultVC *resultVC = [[MaskTestResultVC alloc] init]; + resultVC.model = model; + [self.navigationController pushViewController:resultVC animated:YES]; + }else{ [self jxt_showAlertWithTitle:@"对不起您还没有登录" message:@"请登录后查看肤质测试结果" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { alertMaker.addActionCancelTitle(@"返回首页"); diff --git a/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m b/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m index 783de2e..5f544d1 100644 --- a/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m +++ b/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m @@ -10,7 +10,7 @@ #import "MaskResultMinViewCell.h" #import "MaskResultPercentCell.h" #import "MaskResultShareViewCell.h" -#import "SHareTestImageVC.h" + #import "GiGaFileNanager.h" @@ -130,7 +130,7 @@ table.frame = savedFrame; UIGraphicsEndImageContext(); - [[GiGaFileNanager shareInstance] saveImaeToAlBum:image]; + [[GiGaFileNanager shareInstance] saveImaeToAlBum:image]; return image; diff --git a/GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.h b/GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.h deleted file mode 100644 index 5a3b85b..0000000 --- a/GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// SHareTestImageVC.h -// GIGA -// -// Created by lianxiang on 2018/9/21. -// Copyright © 2018年 com.giga.ios. All rights reserved. -// - -#import "GiGaBaseViewController.h" - -@interface SHareTestImageVC : GiGaBaseViewController -@property (nonatomic,strong) UIImage *image ; - -@end diff --git a/GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.m b/GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.m deleted file mode 100644 index 9119cd5..0000000 --- a/GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.m +++ /dev/null @@ -1,43 +0,0 @@ -// -// SHareTestImageVC.m -// GIGA -// -// Created by lianxiang on 2018/9/21. -// Copyright © 2018年 com.giga.ios. All rights reserved. -// - -#import "SHareTestImageVC.h" - -@interface SHareTestImageVC () - -@end - -@implementation SHareTestImageVC - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view from its nib. - UIImageView *ima = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,self.view.frame.size.height)]; - ima.contentMode = UIViewContentModeScaleAspectFit; - - ima.image = self.image; - [self.view addSubview:ima]; - -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ - -@end diff --git a/GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.xib b/GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.xib deleted file mode 100644 index 1d9f256..0000000 --- a/GIGA/Modules/Mask/Exercises/Controller/SHareTestImageVC.xib +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.h b/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.h new file mode 100644 index 0000000..77c1cbb --- /dev/null +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.h @@ -0,0 +1,15 @@ +// +// MaskActionSheetViewCell.h +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface MaskActionSheetViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *sheetTitle; +-(void)comfirmTitles:(NSIndexPath *)indepath; + +@end diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.m b/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.m new file mode 100644 index 0000000..4b71f73 --- /dev/null +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.m @@ -0,0 +1,29 @@ +// +// MaskActionSheetViewCell.m +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "MaskActionSheetViewCell.h" + +@implementation MaskActionSheetViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} +-(void)comfirmTitles:(NSIndexPath *)indepath +{ + NSArray *titles = @[@"手机相册",@"系统相册",@"自拍"]; + self.sheetTitle.text = titles[indepath.row]; + +} +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.xib b/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.xib new file mode 100644 index 0000000..27658fc --- /dev/null +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.xib @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.h b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.h new file mode 100644 index 0000000..6209ba9 --- /dev/null +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.h @@ -0,0 +1,15 @@ +// +// MaskTimeShareActionSheet.h +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import +typedef void (^actionSheetAction)(NSUInteger index); +@interface MaskTimeShareActionSheet : UIView +@property(nonatomic,copy) actionSheetAction action; +-(void)show:(actionSheetAction)action; + +@end diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.m b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.m new file mode 100644 index 0000000..70c6aeb --- /dev/null +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.m @@ -0,0 +1,116 @@ +// +// MaskTimeShareActionSheet.m +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "MaskTimeShareActionSheet.h" +#import "MaskActionSheetViewCell.h" + +@interface MaskTimeShareActionSheet() +@property(nonatomic,strong) UITableView *tabview; +@end + +@implementation MaskTimeShareActionSheet + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3]; ; + [self creatUI]; + } + return self; +} + +-(void)creatUI{ + + + + UIView *holdview =[[UIView alloc] init]; + holdview.frame =CGRectMake(0,KMainH - 216 - 60 -20 , KMainW, 216 + 60 +20); + holdview.backgroundColor = [UIColor whiteColor]; +// CGRect backRect= holdview.frame; +// +// UIBezierPath *maskPath=[UIBezierPath bezierPathWithRoundedRect:backRect byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(15, 15)]; +// CAShapeLayer *maskLayer =[[CAShapeLayer alloc] init]; +// maskLayer.frame = backRect; +// maskLayer.path = maskPath.CGPath; +// holdview.layer.mask = maskLayer; + holdview.layer.masksToBounds = YES; + holdview.layer.cornerRadius = 10; + [self addSubview:holdview]; + + self.tabview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KMainW, 216 + 60) style:UITableViewStylePlain]; + self.tabview.backgroundColor = [UIColor whiteColor]; + self.tabview.separatorStyle = UITableViewCellSeparatorStyleNone; + self.tabview.delegate = self; + self.tabview.scrollEnabled = NO; + self.tabview.dataSource = self; + + UIButton *cancleBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + [cancleBtn setTitle:@"取消" forState:UIControlStateNormal]; + [cancleBtn setTitleColor:GIGARGB(165,165, 165, 1) forState:UIControlStateNormal]; + [cancleBtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside]; + + cancleBtn.frame = CGRectMake(0,1, KMainW,60); + + self.tabview.tableFooterView = cancleBtn; + [holdview addSubview:self.tabview]; + + + +} + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + + return 3; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + MaskActionSheetViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskActionSheetViewCell"]; + if (!cell) { + cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskActionSheetViewCell" owner:self options:nil] lastObject]; + } + [cell comfirmTitles:indexPath]; + return cell; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + return 54; +} +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (self.action) { + self.action(indexPath.row); + [self cancleDissmiss]; + } +} + +-(void)show:(actionSheetAction)action{ + + self.action = action; + +} +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ + if ([touches anyObject].view != self.tabview) { + [self cancleDissmiss]; + } + +} + +-(void)cancelAction{ + [self cancleDissmiss]; +} + +-(void)cancleDissmiss{ + [UIView animateWithDuration:1.0 animations:^{ + self.tabview.frame = CGRectMake(0, KMainH - 216, KMainW, 0); + }]; + [self removeFromSuperview]; +} + + +@end diff --git a/GIGA/Modules/Me/Controller/GiGaFeedBackViewController.m b/GIGA/Modules/Me/Controller/GiGaFeedBackViewController.m index a54fdf8..6dd1c1d 100644 --- a/GIGA/Modules/Me/Controller/GiGaFeedBackViewController.m +++ b/GIGA/Modules/Me/Controller/GiGaFeedBackViewController.m @@ -7,6 +7,13 @@ // #import "GiGaFeedBackViewController.h" +#import "GIGaFeedQQViewCell.h" +#import "GIGaFeedPhontosViewCell.h" +#import "GiGaFeedContentViewCell.h" +#import "GiGaFeedLeiIingViewCell.h" +#import "SJPhotoPicker.h" +#import "GiGaNetManager.h" +#import "GiGaAPIResult.h" @interface GiGaFeedBackViewController () @@ -17,7 +24,171 @@ - (void)viewDidLoad { [super viewDidLoad]; [self addNavTitile:@"意见反馈"]; + + [self.view addSubview:self.tableView]; + self.tableView.delegate = self; + self.tableView.dataSource = self; + self.tableView.backgroundColor = GIGA_MAIN_BGCOLOR; + self.tableView.separatorStyle = UITableViewCellSelectionStyleNone; + self.tableView.sectionFooterHeight = 0; + self.tableView.estimatedSectionFooterHeight= 0; + self.tableView.estimatedSectionHeaderHeight = 0; + + + self.tableView.frame = CGRectMake(0, 1, KMainW, self.view.bounds.size.height - SAFE_NAV_HEIGHT); + + [self.tableView registerClass:[GIGaFeedPhontosViewCell class] forCellReuseIdentifier:@"GIGaFeedPhontosViewCell"]; // Do any additional setup after loading the view. + UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 80)]; + UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; + btn.layer.masksToBounds = YES; + btn.layer.cornerRadius = 20; + btn.frame = CGRectMake((self.view.frame.size.width - 245) /2 , 20, 245,40); + btn.backgroundColor = [UIColor whiteColor]; + NSAttributedString *atti = [GiGaHelper stringWithText:@"提交" textColor:GIGA_MAIN_BGCOLOR textFont:GIGA_TEXTFONTBOLD(18) leterSpace:0]; + [btn addTarget:self action:@selector(tijiaoAction) forControlEvents:UIControlEventTouchUpInside]; + [btn setAttributedTitle:atti forState:UIControlStateNormal]; + [footer addSubview:btn]; + self.tableView.tableFooterView = footer; + + +} +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ + return 4; +} +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return 1; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + if (indexPath.section == 0) { + GiGaFeedLeiIingViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GiGaFeedLeiIingViewCell"]; + if (!cell) { + cell = [[[NSBundle mainBundle] loadNibNamed:@"GiGaFeedLeiIingViewCell" owner:self options:nil] lastObject]; + } + return cell; + }else if (indexPath.section == 1){ + GiGaFeedContentViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GiGaFeedContentViewCell"]; + if (!cell) { + cell = [[[NSBundle mainBundle] loadNibNamed:@"GiGaFeedContentViewCell" owner:self options:nil] lastObject]; + } + return cell; + }else if (indexPath.section == 2){ + GIGaFeedQQViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GIGaFeedQQViewCell"]; + if (!cell) { + cell = [[[NSBundle mainBundle] loadNibNamed:@"GIGaFeedQQViewCell" owner:self options:nil] lastObject]; + } + return cell; + }else if (indexPath.section == 3){ + + GIGaFeedPhontosViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GIGaFeedPhontosViewCell"]; + if (!cell) { + cell = [[GIGaFeedPhontosViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"GIGaFeedPhontosViewCell"];; + } + + __weak typeof(cell) weakCell = cell; + cell.pickerBalock = ^{ + [[SJPhotoPicker shareSJPhotoPicker] showPhotoPickerToController:self pickedAssets:^(NSArray *assets) { + // 添加按钮6张以上被遮挡可不写 +// if ((weakCell.images.count + assets.count) > 6) { +// GIGA_ShowToast(@"最多六张"); +// return ; +// } + [weakCell.images addObjectsFromArray:assets]; + //weakSelf.images = [NSMutableArray arrayWithArray:assets]; + [weakCell.collectionView reloadData]; + + }]; + }; + + return cell; + } + + return nil; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + if (indexPath.section == 0) { + return 40; + }else if (indexPath.section == 1){ + return 142; + }else if (indexPath.section == 2){ + return 40; + }else if (indexPath.section == 3){ + return 218; + } + return 0; +} +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ + if (section == 3) { + return 36; + }else{ + return 12; + } +} + +- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ + if (section == 3) { + UIView *view = [[UIView alloc] init]; + UILabel *label = [[UILabel alloc] init]; + label.frame = CGRectMake(15,0, 200, 36); + label.font = GIGA_TEXTFONTMEDIUM(13); + label.text= @"上传图片(最多6张)"; + label.textColor = [UIColor whiteColor]; + [view addSubview:label]; + return view; + } + UIView *view = [[UIView alloc] init]; + + return view; +} + + +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ + return 0.1; +} + +#pragma mark 提交 + +-(void)tijiaoAction{ + GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]]; + NSArray *names =cell.imageNames; + + NSLog(@"names:%@",names); + + GiGaFeedLeiIingViewCell *kindcell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; + if ([kindcell.kidLabel.text isEqualToString:@"选择反馈类型"]) { + GIGA_ShowToast(@"请选择评论类型"); + return; + } + + GiGaFeedContentViewCell *contencell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1]]; + + if (contencell.contentFiled.text.length==0) { + GIGA_ShowToast(@"请输入评论"); + return; + } + + GIGaFeedQQViewCell *qqcell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:3]]; + if (qqcell.QTextFiled.text.length == 0) { + qqcell.QTextFiled.text = @""; + } + + + if (names.count <= 0) { + GIGA_ShowToast(@"请选择图片"); + return; + } + + [GiGaNetManager uploadImage:@"sys/sysdict/v1/maskproposaltype" imageNames:names parms:@{} responseBlock:^(NSDictionary *responseDict, NSDictionary *responseHeaderFields, NSError *error) { + if (error) { + GILog(@"err:%@",error.localizedDescription); + }else{ + GiGaAPIResult *result = [[GiGaAPIResult alloc] initWithDictionary:responseDict]; + GIGA_ShowToast(result.message); + } + }]; + } - (void)didReceiveMemoryWarning { @@ -25,14 +196,6 @@ // Dispose of any resources that can be recreated. } -/* -#pragma mark - Navigation -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ @end diff --git a/GIGA/Modules/Me/Controller/GiGaUserViewController.m b/GIGA/Modules/Me/Controller/GiGaUserViewController.m index 694fff3..c7c3a3f 100644 --- a/GIGA/Modules/Me/Controller/GiGaUserViewController.m +++ b/GIGA/Modules/Me/Controller/GiGaUserViewController.m @@ -298,7 +298,7 @@ } int leng = [GiGaHelper convertToInt: self.user.nickName]; - if ( leng >40 ) { + if ( self.user.nickName.length >40 ) { GIGA_ShowToast(@"用户名1-40字符长度") return; } diff --git a/GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.h b/GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.h new file mode 100644 index 0000000..2f610f5 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.h @@ -0,0 +1,17 @@ +// +// GIGaFeedImagsCollectionCell.h +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface GIGaFeedImagsCollectionCell : UICollectionViewCell +@property (weak, nonatomic) IBOutlet UIImageView *uploadImageView; +@property (weak, nonatomic) IBOutlet UIButton *delecBtn; +@property (weak, nonatomic) IBOutlet UIView *holdView; +@property (weak, nonatomic) IBOutlet UIImageView *holdImageView; + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.m b/GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.m new file mode 100644 index 0000000..8982474 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.m @@ -0,0 +1,20 @@ +// +// GIGaFeedImagsCollectionCell.m +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GIGaFeedImagsCollectionCell.h" + +@implementation GIGaFeedImagsCollectionCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code + [self.holdView bringSubviewToFront:self.delecBtn]; + +} + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.xib b/GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.xib new file mode 100644 index 0000000..a856ba8 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GIGaFeedImagsCollectionCell.xib @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/Me/View/FeedViews/GIGaFeedPhontosViewCell.h b/GIGA/Modules/Me/View/FeedViews/GIGaFeedPhontosViewCell.h new file mode 100644 index 0000000..42293b5 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GIGaFeedPhontosViewCell.h @@ -0,0 +1,19 @@ +// +// GIGaFeedPhontosViewCell.h +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import +#import +typedef void(^GiGaPhotoPickerBlock)(void); +@interface GIGaFeedPhontosViewCell : UITableViewCell +@property(nonatomic,copy) GiGaPhotoPickerBlock pickerBalock; +@property(nonatomic,strong) NSMutableArray *images; +@property(nonatomic,strong) UICollectionView *collectionView; +-(void)photoPikerComplete:(GiGaPhotoPickerBlock)pikerComplete; +@property(nonatomic,strong) NSMutableArray *imageNames; + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GIGaFeedPhontosViewCell.m b/GIGA/Modules/Me/View/FeedViews/GIGaFeedPhontosViewCell.m new file mode 100644 index 0000000..27c5d05 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GIGaFeedPhontosViewCell.m @@ -0,0 +1,188 @@ +// +// GIGaFeedPhontosViewCell.m +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GIGaFeedPhontosViewCell.h" +#import "GIGaFeedImagsCollectionCell.h" +#import "GiGaFeedImagsActionCell.h" +#import "SJPhotoPickerManager.h" +#import "SJPhotoPicker.h" +#import "GIGaUserFileHelper.h" + +@interface GIGaFeedPhontosViewCell() + + +@end + +@implementation GIGaFeedPhontosViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ + + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + self.selectionStyle = UITableViewCellSelectionStyleNone; + _images = [NSMutableArray new]; + + [self creatUI]; + + } + return self; +} +- (NSMutableArray *)imageNames{ + if (!_imageNames) { + _imageNames = [NSMutableArray new]; + } + return _imageNames; +} +-(void)creatUI{ + + UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init]; + flowLayout.minimumLineSpacing = 1; + flowLayout.minimumInteritemSpacing = .1; + + CGFloat width = (KMainW-15*2 - 22*2)/3; + flowLayout.itemSize = CGSizeMake(width,width); + //展示两行 + //CGFloat HCELL= (itemH*1+1)*2; + + _collectionView=[[UICollectionView alloc]initWithFrame:CGRectMake(0,0,KMainW, 218) collectionViewLayout:flowLayout]; + + _collectionView.delegate=self; + _collectionView.dataSource=self; + _collectionView.bounces=NO; + _collectionView.scrollEnabled=NO; + _collectionView.showsVerticalScrollIndicator=NO; + _collectionView.backgroundColor = GIGA_MAIN_BGCOLOR; + [self addSubview:_collectionView]; + [_collectionView registerNib:[UINib nibWithNibName:@"GiGaFeedImagsActionCell" bundle:nil] forCellWithReuseIdentifier:@"GiGaFeedImagsActionCell"]; + [_collectionView registerNib:[UINib nibWithNibName:@"GIGaFeedImagsCollectionCell" bundle:nil] forCellWithReuseIdentifier:@"GIGaFeedImagsCollectionCell"]; + +} + +#pragma mark + +- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { + + return 1; +} + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + + return 1 + self.images.count; +} + +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + if (indexPath.row == self.images.count) { + GiGaFeedImagsActionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GiGaFeedImagsActionCell" forIndexPath:indexPath]; + if (!cell) { + cell = [[[NSBundle mainBundle] loadNibNamed:@"GiGaFeedImagsActionCell" owner:self options:nil] lastObject]; + } + [cell.imageAdd addTarget:self action:@selector(addBtnAction:) forControlEvents:UIControlEventTouchUpInside]; + return cell; + } + + GIGaFeedImagsCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GIGaFeedImagsCollectionCell" forIndexPath:indexPath]; + if (!cell) { + cell = [[[NSBundle mainBundle] loadNibNamed:@"GIGaFeedImagsCollectionCell" owner:self options:nil] lastObject]; + } + + cell.delecBtn.tag = indexPath.row; + [cell.delecBtn addTarget:self action:@selector(delecBtnAction:) forControlEvents:UIControlEventTouchUpInside]; + //PHImageManagerMaximumSize + [self.imageNames removeAllObjects]; + [[SJPhotoPickerManager shareSJPhotoPickerManager] requestImageForPHAsset:self.images[indexPath.row] targetSize:CGSizeMake(200, 200) imageResult:^(UIImage *image) { + cell.uploadImageView.image = image; + if (image) { + cell.holdImageView.hidden = YES; + }else{ + cell.holdImageView.hidden = NO; + } + cell.holdView.backgroundColor = [UIColor clearColor]; + NSString *name = [NSString stringWithFormat:@"gigafeed_index%ld",(long)indexPath.row]; + [GIGaUserFileHelper saveUserFeedbackImag:name image:image]; + if ([self.imageNames containsObject: name]) { + [self.imageNames removeObject:name]; + } + + [self.imageNames addObject:name]; + + }]; + + return cell; +} + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath +{ + + CGFloat width = (KMainW-15*2 - 22*2)/3; + CGSize itemSize = CGSizeMake(width,width); + return itemSize; + +} + +//距离上下左右的间距 +-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section +{ + + + return UIEdgeInsetsMake(0,15,0, 15); + +} + +-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section +{ + //设置最小的列间距 + + return 22.0f; + +} + +-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section +{ + //设置最小的行间距 + + return 10.0f; + +} + +-(void)delecBtnAction:(UIButton *)btn{ + GILog(@"删除"); + NSUInteger index = btn.tag; + [self.images removeObjectAtIndex:index]; + [GIGaUserFileHelper delectAllfeedimages]; + [self.imageNames removeAllObjects]; + [self.collectionView reloadData]; + +} + +-(void)addBtnAction:(UIButton*)btn{ + + if (self.pickerBalock) { + self.pickerBalock(); + } + +} + +- (void)photoPikerComplete:(GiGaPhotoPickerBlock)pikerComplete{ + + if (self.pickerBalock) { + self.pickerBalock = pikerComplete; + } +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.h b/GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.h new file mode 100644 index 0000000..7674daa --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.h @@ -0,0 +1,15 @@ +// +// GIGaFeedQQViewCell.h +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface GIGaFeedQQViewCell : UITableViewCell + +@property (weak, nonatomic) IBOutlet UITextField *QTextFiled; + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.m b/GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.m new file mode 100644 index 0000000..a793a1e --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.m @@ -0,0 +1,24 @@ +// +// GIGaFeedQQViewCell.m +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GIGaFeedQQViewCell.h" + +@implementation GIGaFeedQQViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.xib b/GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.xib new file mode 100644 index 0000000..2297124 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GIGaFeedQQViewCell.xib @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.h b/GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.h new file mode 100644 index 0000000..3d7d3a5 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.h @@ -0,0 +1,17 @@ +// +// GiGaFeedContentViewCell.h +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface GiGaFeedContentViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UITextView *contentFiled; +@property (weak, nonatomic) IBOutlet UILabel *holdLabe; +@property (weak, nonatomic) IBOutlet UILabel *numberCountLabe; +@property (nonatomic,strong) NSString *textMAx; + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.m b/GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.m new file mode 100644 index 0000000..2f956aa --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.m @@ -0,0 +1,61 @@ +// +// GiGaFeedContentViewCell.m +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GiGaFeedContentViewCell.h" + +@implementation GiGaFeedContentViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code + self.contentFiled.delegate =self; +} + +- (void)textViewDidBeginEditing:(UITextView *)textView{ + if (textView == self.contentFiled) { + self.holdLabe.hidden = YES; + } + +} +- (void)textViewDidChange:(UITextView *)textView +{ + if (textView == self.contentFiled) { + if (textView.text.length == 0) { + self.holdLabe.hidden = NO; + } + + if ( textView.text.length <=100 ) { + + self.numberCountLabe.text = [NSString stringWithFormat:@"%lu/100",(unsigned long)textView.text.length]; + self.contentFiled.text = textView.text; + self.textMAx = textView.text; + }else{ + textView.text = self.textMAx; + } + + } +} + +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ + + +// if ( textView.text.length >100 ) { +// +// return NO; +// } + return YES; +} + + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.xib b/GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.xib new file mode 100644 index 0000000..7b068b8 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GiGaFeedContentViewCell.xib @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.h b/GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.h new file mode 100644 index 0000000..79a881b --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.h @@ -0,0 +1,14 @@ +// +// GiGaFeedImagsActionCell.h +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface GiGaFeedImagsActionCell : UICollectionViewCell +@property (weak, nonatomic) IBOutlet UIButton *imageAdd; + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.m b/GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.m new file mode 100644 index 0000000..c327637 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.m @@ -0,0 +1,18 @@ +// +// GiGaFeedImagsActionCell.m +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GiGaFeedImagsActionCell.h" + +@implementation GiGaFeedImagsActionCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.xib b/GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.xib new file mode 100644 index 0000000..3b97e26 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GiGaFeedImagsActionCell.xib @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.h b/GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.h new file mode 100644 index 0000000..77ef243 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.h @@ -0,0 +1,14 @@ +// +// GiGaFeedLeiIingViewCell.h +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface GiGaFeedLeiIingViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *kidLabel; + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.m b/GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.m new file mode 100644 index 0000000..d455919 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.m @@ -0,0 +1,24 @@ +// +// GiGaFeedLeiIingViewCell.m +// GIGA +// +// Created by lianxiang on 2018/9/22. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GiGaFeedLeiIingViewCell.h" + +@implementation GiGaFeedLeiIingViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.xib b/GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.xib new file mode 100644 index 0000000..adc5364 --- /dev/null +++ b/GIGA/Modules/Me/View/FeedViews/GiGaFeedLeiIingViewCell.xib @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +