From 27e27d5d12757ac2cd2cba0ac1b7ce58736f1340 Mon Sep 17 00:00:00 2001 From: lianxiang <13052344590@163.com> Date: Tue, 18 Sep 2018 20:13:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GIGA.xcodeproj/project.pbxproj | 46 ++++ .../userCenter/btn_job.imageset/Contents.json | 8 + .../userjob_down.imageset/Contents.json | 8 + .../userjob_up.imageset/Contents.json | 8 + GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.h | 1 + GIGA/Common/GiGaHelper.h | 2 + GIGA/Common/GiGaHelper.m | 17 ++ GIGA/Common/GiGaNetTool/GiGaBaseAPiRequest.h | 6 + GIGA/Common/GiGaNetTool/GiGaBaseAPiRequest.m | 10 + GIGA/Common/GiGaNetTool/GiGaNetManager.h | 8 +- GIGA/Common/GiGaNetTool/GiGaNetManager.m | 52 +++- GIGA/Common/GiGaUserDB/GIGaFileManager.h | 18 ++ GIGA/Common/GiGaUserDB/GIGaFileManager.m | 87 +++++++ GIGA/Common/GiGaUserDB/GiGaUserManager.m | 2 +- GIGA/Config/ApiRequestConfig.h | 3 +- GIGA/Config/GIGA.h | 4 +- GIGA/Info.plist | 12 + .../LogIn/Controller/GiGaUserLoginVC.m | 1 + .../Controller/GiGaMaskTaskViewController.m | 13 + .../Me/Controller/AppVerionDescriptionVC.h | 13 + .../Me/Controller/AppVerionDescriptionVC.m | 133 ++++++++++ .../Me/Controller/GiGaMeViewController.m | 16 ++ .../Me/Controller/GiGaUserViewController.m | 238 ++++++++++++++++-- GIGA/Modules/Me/Controller/GiSysSettingsVC.m | 27 +- GIGA/Modules/Me/Model/VersionModel.h | 17 ++ GIGA/Modules/Me/Model/VersionModel.m | 21 ++ .../AppVerionDescCells/AppVersionDescCell.h | 14 ++ .../AppVerionDescCells/AppVersionDescCell.m | 26 ++ .../AppVerionDescCells/AppVersionDescCell.xib | 53 ++++ .../AppVerionDescCells/AppVersionLogoCell.h | 13 + .../AppVerionDescCells/AppVersionLogoCell.m | 24 ++ .../AppVerionDescCells/AppVersionLogoCell.xib | 51 ++++ GIGA/Modules/Me/View/GiGaMineUserViewCell.m | 1 + GIGA/Modules/Me/View/GiGaSettingsViewCell.m | 3 +- GIGA/Modules/Me/View/GiGaSettingsViewCell.xib | 40 +-- .../View/userInfoView/GIGaUserCityViewCell.m | 1 + .../Me/View/userInfoView/GIGaUserIDViewCell.m | 7 - .../userInfoView/GIGaUserInfoAvatorCell.h | 1 + .../userInfoView/GIGaUserInfoAvatorCell.xib | 2 +- .../userInfoView/GIGaUserWeChatViewCell.h | 2 + .../userInfoView/GIGaUserWeChatViewCell.m | 18 +- .../userInfoView/GIGaUserWeChatViewCell.xib | 8 +- 42 files changed, 981 insertions(+), 54 deletions(-) create mode 100644 GIGA/Common/GiGaUserDB/GIGaFileManager.h create mode 100644 GIGA/Common/GiGaUserDB/GIGaFileManager.m create mode 100644 GIGA/Modules/Me/Controller/AppVerionDescriptionVC.h create mode 100644 GIGA/Modules/Me/Controller/AppVerionDescriptionVC.m create mode 100644 GIGA/Modules/Me/Model/VersionModel.h create mode 100644 GIGA/Modules/Me/Model/VersionModel.m create mode 100644 GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.h create mode 100644 GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.m create mode 100644 GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.xib create mode 100644 GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.h create mode 100644 GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.m create mode 100644 GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.xib diff --git a/GIGA.xcodeproj/project.pbxproj b/GIGA.xcodeproj/project.pbxproj index 4794b8b..850166e 100644 --- a/GIGA.xcodeproj/project.pbxproj +++ b/GIGA.xcodeproj/project.pbxproj @@ -32,6 +32,13 @@ 8340BFAB213E665D008F22E4 /* GIGAUserLocalizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8340BFAA213E665D008F22E4 /* GIGAUserLocalizable.strings */; }; 8340BFAF213E739D008F22E4 /* GiGaNoNetWorkView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8340BFAE213E739D008F22E4 /* GiGaNoNetWorkView.m */; }; 8342D9FD2131150200D16B1D /* 4481.wav in Resources */ = {isa = PBXBuildFile; fileRef = 8342D9FC2131150200D16B1D /* 4481.wav */; }; + 8342FD7A2150C51100D141F4 /* GIGaFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8342FD792150C51100D141F4 /* GIGaFileManager.m */; }; + 8342FD7D2150F94600D141F4 /* AppVerionDescriptionVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8342FD7C2150F94600D141F4 /* AppVerionDescriptionVC.m */; }; + 8342FD822150FA1500D141F4 /* AppVersionDescCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8342FD802150FA1500D141F4 /* AppVersionDescCell.m */; }; + 8342FD832150FA1500D141F4 /* AppVersionDescCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8342FD812150FA1500D141F4 /* AppVersionDescCell.xib */; }; + 8342FD862150FD5200D141F4 /* VersionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8342FD852150FD5200D141F4 /* VersionModel.m */; }; + 8342FD8A2151095100D141F4 /* AppVersionLogoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8342FD882151095100D141F4 /* AppVersionLogoCell.m */; }; + 8342FD8B2151095100D141F4 /* AppVersionLogoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8342FD892151095100D141F4 /* AppVersionLogoCell.xib */; }; 8345C13621414D3B00051717 /* NSString+Unicode.m in Sources */ = {isa = PBXBuildFile; fileRef = 8345C13521414D3B00051717 /* NSString+Unicode.m */; }; 8349585C212511040064DB6C /* AppDelegate+ThirdParty.m in Sources */ = {isa = PBXBuildFile; fileRef = 8349585B212511040064DB6C /* AppDelegate+ThirdParty.m */; }; 835060A2212D1225007E6220 /* GiGaMeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 835060A1212D1225007E6220 /* GiGaMeViewController.m */; }; @@ -217,6 +224,18 @@ 8340BFAD213E739D008F22E4 /* GiGaNoNetWorkView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaNoNetWorkView.h; sourceTree = ""; }; 8340BFAE213E739D008F22E4 /* GiGaNoNetWorkView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaNoNetWorkView.m; sourceTree = ""; }; 8342D9FC2131150200D16B1D /* 4481.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = 4481.wav; sourceTree = ""; }; + 8342FD782150C51100D141F4 /* GIGaFileManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaFileManager.h; sourceTree = ""; }; + 8342FD792150C51100D141F4 /* GIGaFileManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGaFileManager.m; sourceTree = ""; }; + 8342FD7B2150F94600D141F4 /* AppVerionDescriptionVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppVerionDescriptionVC.h; sourceTree = ""; }; + 8342FD7C2150F94600D141F4 /* AppVerionDescriptionVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppVerionDescriptionVC.m; sourceTree = ""; }; + 8342FD7F2150FA1500D141F4 /* AppVersionDescCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppVersionDescCell.h; sourceTree = ""; }; + 8342FD802150FA1500D141F4 /* AppVersionDescCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppVersionDescCell.m; sourceTree = ""; }; + 8342FD812150FA1500D141F4 /* AppVersionDescCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AppVersionDescCell.xib; sourceTree = ""; }; + 8342FD842150FD5200D141F4 /* VersionModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VersionModel.h; sourceTree = ""; }; + 8342FD852150FD5200D141F4 /* VersionModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VersionModel.m; sourceTree = ""; }; + 8342FD872151095100D141F4 /* AppVersionLogoCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppVersionLogoCell.h; sourceTree = ""; }; + 8342FD882151095100D141F4 /* AppVersionLogoCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppVersionLogoCell.m; sourceTree = ""; }; + 8342FD892151095100D141F4 /* AppVersionLogoCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AppVersionLogoCell.xib; sourceTree = ""; }; 8345C13421414D3B00051717 /* NSString+Unicode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+Unicode.h"; sourceTree = ""; }; 8345C13521414D3B00051717 /* NSString+Unicode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+Unicode.m"; sourceTree = ""; }; 8349585A212511040064DB6C /* AppDelegate+ThirdParty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+ThirdParty.h"; sourceTree = ""; }; @@ -558,6 +577,19 @@ path = Views; sourceTree = ""; }; + 8342FD7E2150F94F00D141F4 /* AppVerionDescCells */ = { + isa = PBXGroup; + children = ( + 8342FD7F2150FA1500D141F4 /* AppVersionDescCell.h */, + 8342FD802150FA1500D141F4 /* AppVersionDescCell.m */, + 8342FD812150FA1500D141F4 /* AppVersionDescCell.xib */, + 8342FD872151095100D141F4 /* AppVersionLogoCell.h */, + 8342FD882151095100D141F4 /* AppVersionLogoCell.m */, + 8342FD892151095100D141F4 /* AppVersionLogoCell.xib */, + ); + path = AppVerionDescCells; + sourceTree = ""; + }; 835060A6212D38BC007E6220 /* GiGaStartAdView */ = { isa = PBXGroup; children = ( @@ -640,6 +672,8 @@ 8357ADC82123BFCA000816F2 /* GiGaUserManager.m */, 8357ADD62124027D000816F2 /* GiGaUserDefault.h */, 8357ADD72124027D000816F2 /* GiGaUserDefault.m */, + 8342FD782150C51100D141F4 /* GIGaFileManager.h */, + 8342FD792150C51100D141F4 /* GIGaFileManager.m */, ); path = GiGaUserDB; sourceTree = ""; @@ -855,6 +889,8 @@ children = ( 8357ADC32123BEBD000816F2 /* GiGaUser.h */, 8357ADC42123BEBD000816F2 /* GiGaUser.m */, + 8342FD842150FD5200D141F4 /* VersionModel.h */, + 8342FD852150FD5200D141F4 /* VersionModel.m */, ); path = Model; sourceTree = ""; @@ -862,6 +898,7 @@ 8361B42A212180A100238FEB /* View */ = { isa = PBXGroup; children = ( + 8342FD7E2150F94F00D141F4 /* AppVerionDescCells */, 838762CF214B9CAA0039D241 /* userInfoView */, 83BFAE64213CCF10004EF801 /* GiGaMineUserViewCell.h */, 83BFAE65213CCF10004EF801 /* GiGaMineUserViewCell.m */, @@ -889,6 +926,8 @@ 83BFAE6F213CDB29004EF801 /* GiMaskTimeHistoryVC.m */, 83BFAE71213CDB58004EF801 /* GiSysSettingsVC.h */, 83BFAE72213CDB58004EF801 /* GiSysSettingsVC.m */, + 8342FD7B2150F94600D141F4 /* AppVerionDescriptionVC.h */, + 8342FD7C2150F94600D141F4 /* AppVerionDescriptionVC.m */, ); path = Controller; sourceTree = ""; @@ -1359,6 +1398,7 @@ 83346AD1212BF5B70054D597 /* useragreement.html in Resources */, 838762D9214B9EF80039D241 /* GIGaUserIDViewCell.xib in Resources */, 838762E8214B9FA60039D241 /* GIGaUserCityViewCell.xib in Resources */, + 8342FD8B2151095100D141F4 /* AppVersionLogoCell.xib in Resources */, 83BFAE68213CCF10004EF801 /* GiGaMineUserViewCell.xib in Resources */, 8340BFA9213E65CA008F22E4 /* GIGACommonLocalizabe.strings in Resources */, 83835BA8212E4748001480F2 /* MAssaageCenterCell.xib in Resources */, @@ -1368,6 +1408,7 @@ 8340BFAB213E665D008F22E4 /* GIGAUserLocalizable.strings in Resources */, 8342D9FD2131150200D16B1D /* 4481.wav in Resources */, 83835BB0212E4FCD001480F2 /* MessageListViewCell.xib in Resources */, + 8342FD832150FA1500D141F4 /* AppVersionDescCell.xib in Resources */, 8338F6B12142182200B4780B /* MaskTime.png in Resources */, 83346ACF212BD7830054D597 /* GiGaWebViewController.xib in Resources */, ); @@ -1490,6 +1531,7 @@ 8384643E214A484400F12B33 /* MaskTestResult.m in Sources */, 83346AD4212BFF6E0054D597 /* UserGuardViewController.m in Sources */, 83BC8A8A2148D28300820437 /* QustionAnswer.m in Sources */, + 8342FD7D2150F94600D141F4 /* AppVerionDescriptionVC.m in Sources */, 8357ADC92123BFCA000816F2 /* GiGaUserManager.m in Sources */, 8390116F214E20B2004CA790 /* LYSDatePickerViewController.m in Sources */, 83835BB3212E50ED001480F2 /* ActiveMesagelistVC.m in Sources */, @@ -1509,6 +1551,7 @@ 8357ADCD2123C091000816F2 /* GiGaNetManager.m in Sources */, 838388D4212FB7D700D14C53 /* JXTAlertView.m in Sources */, 83901178214E20B2004CA790 /* LYSDatePickerItem.m in Sources */, + 8342FD8A2151095100D141F4 /* AppVersionLogoCell.m in Sources */, 83773FC221479FED0014EE4C /* UIColor+HexColor.m in Sources */, 83901172214E20B2004CA790 /* LYSDatePickerTypeDayAndTimeDelegate.m in Sources */, 835060A9212D38EE007E6220 /* GiGaStartAdView.m in Sources */, @@ -1535,6 +1578,7 @@ 8338F6B92142504E00B4780B /* LXCustomSwith.m in Sources */, 8357ADD32123C7C6000816F2 /* GiGaAPIResult.m in Sources */, 8340BF9E213E3846008F22E4 /* SHineLabel.m in Sources */, + 8342FD862150FD5200D141F4 /* VersionModel.m in Sources */, 838762D3214B9D120039D241 /* GIGaUserInfoAvatorCell.m in Sources */, 8361B4352121836700238FEB /* GiGaBaseNavViewController.m in Sources */, 835060B3212D54C2007E6220 /* GiGaAdDetailViewController.m in Sources */, @@ -1546,6 +1590,7 @@ 8392900C2134F9F80077D2E8 /* GiGaCommentView.m in Sources */, 839290062134F4240077D2E8 /* LXDanMuManager.m in Sources */, 833DE8E52150169F009D4329 /* JYAddressPicker.m in Sources */, + 8342FD7A2150C51100D141F4 /* GIGaFileManager.m in Sources */, 83901171214E20B2004CA790 /* LYSDatePickerLabel.m in Sources */, 838762E2214B9F580039D241 /* GiGaUserSexViewCell.m in Sources */, 839290052134F4240077D2E8 /* LXDanMuTrackView.m in Sources */, @@ -1556,6 +1601,7 @@ 83E40B2B21218B6F008149C4 /* GiGaExercisesViewController.m in Sources */, 8390117B214E20B2004CA790 /* LYSDatePickerHeaderView.m in Sources */, 838762E7214B9FA60039D241 /* GIGaUserCityViewCell.m in Sources */, + 8342FD822150FA1500D141F4 /* AppVersionDescCell.m in Sources */, 83BFAE77213CDE91004EF801 /* GiGaSettingsViewCell.m in Sources */, 83835BA7212E4748001480F2 /* MAssaageCenterCell.m in Sources */, 836EE5D42136454500F0ABB2 /* RegistGetSMSCodeRequest.m in Sources */, diff --git a/GIGA/Assets.xcassets/userCenter/btn_job.imageset/Contents.json b/GIGA/Assets.xcassets/userCenter/btn_job.imageset/Contents.json index c801e5d..de1957f 100644 --- a/GIGA/Assets.xcassets/userCenter/btn_job.imageset/Contents.json +++ b/GIGA/Assets.xcassets/userCenter/btn_job.imageset/Contents.json @@ -1,9 +1,17 @@ { "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, { "idiom" : "universal", "filename" : "btn_job@2x.png", "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], "info" : { diff --git a/GIGA/Assets.xcassets/userCenter/userjob_down.imageset/Contents.json b/GIGA/Assets.xcassets/userCenter/userjob_down.imageset/Contents.json index 5ee2f80..6a38e70 100644 --- a/GIGA/Assets.xcassets/userCenter/userjob_down.imageset/Contents.json +++ b/GIGA/Assets.xcassets/userCenter/userjob_down.imageset/Contents.json @@ -1,9 +1,17 @@ { "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, { "idiom" : "universal", "filename" : "userjob_down@2x.png", "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], "info" : { diff --git a/GIGA/Assets.xcassets/userCenter/userjob_up.imageset/Contents.json b/GIGA/Assets.xcassets/userCenter/userjob_up.imageset/Contents.json index 42105d6..9d6d985 100644 --- a/GIGA/Assets.xcassets/userCenter/userjob_up.imageset/Contents.json +++ b/GIGA/Assets.xcassets/userCenter/userjob_up.imageset/Contents.json @@ -1,9 +1,17 @@ { "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, { "idiom" : "universal", "filename" : "userjob_up@2x.png", "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], "info" : { diff --git a/GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.h b/GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.h index 0c2928d..d076547 100644 --- a/GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.h +++ b/GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.h @@ -32,4 +32,5 @@ title:(NSString *)aTitle; + (void)messageAddto:(UIView *)aView title:(NSString *)aTitle; + @end diff --git a/GIGA/Common/GiGaHelper.h b/GIGA/Common/GiGaHelper.h index b83b761..50ab310 100644 --- a/GIGA/Common/GiGaHelper.h +++ b/GIGA/Common/GiGaHelper.h @@ -65,5 +65,7 @@ */ +(BOOL)checkPassWord:(NSString *)pass; +// ++(int)convertToInt:(NSString*)strtemp; @end diff --git a/GIGA/Common/GiGaHelper.m b/GIGA/Common/GiGaHelper.m index e2c59c1..0c0c686 100644 --- a/GIGA/Common/GiGaHelper.m +++ b/GIGA/Common/GiGaHelper.m @@ -265,4 +265,21 @@ return NO; } +//获取中英文字符长度 ++(int)convertToInt:(NSString*)strtemp +{ + int strlength = 0; + char* p = (char*)[strtemp cStringUsingEncoding:NSUnicodeStringEncoding]; + for (int i=0 ; i<[strtemp lengthOfBytesUsingEncoding:NSUnicodeStringEncoding] ;i++) { + if (*p) { + p++; + strlength++; + } + else { + p++; + } + + } + return strlength; +} @end diff --git a/GIGA/Common/GiGaNetTool/GiGaBaseAPiRequest.h b/GIGA/Common/GiGaNetTool/GiGaBaseAPiRequest.h index 8ae5754..488fc51 100644 --- a/GIGA/Common/GiGaNetTool/GiGaBaseAPiRequest.h +++ b/GIGA/Common/GiGaNetTool/GiGaBaseAPiRequest.h @@ -131,4 +131,10 @@ typedef void (^GiGaRequestResultBlock)(GiGaAPIResult *result); //+ (NSString *)resizeImageUrl:(NSString *)originImageUrl // size:(CGSize)size; + ++(void)userTokenTimeOutGologinFromVC:(UIViewController *)vc; + + + + @end diff --git a/GIGA/Common/GiGaNetTool/GiGaBaseAPiRequest.m b/GIGA/Common/GiGaNetTool/GiGaBaseAPiRequest.m index 4af7ea4..7d8c89e 100644 --- a/GIGA/Common/GiGaNetTool/GiGaBaseAPiRequest.m +++ b/GIGA/Common/GiGaNetTool/GiGaBaseAPiRequest.m @@ -10,6 +10,7 @@ #import "GiGaServerConfig.h" #import #import "GiGaNetManager.h" +#import "GiGaUserLoginVC.h" @implementation GiGaBaseAPiRequest @@ -159,4 +160,13 @@ } ++(void)userTokenTimeOutGologinFromVC:(UIViewController *)vc{ + + GiGaUserLoginVC *userlogInVC= [[GiGaUserLoginVC alloc] init]; + GiGaBaseNavViewController *baseNav = [[GiGaBaseNavViewController alloc] initWithRootViewController:userlogInVC]; + [vc presentViewController:baseNav animated:YES completion:nil]; + +} + + @end diff --git a/GIGA/Common/GiGaNetTool/GiGaNetManager.h b/GIGA/Common/GiGaNetTool/GiGaNetManager.h index 778f1ca..6c7b9cb 100644 --- a/GIGA/Common/GiGaNetTool/GiGaNetManager.h +++ b/GIGA/Common/GiGaNetTool/GiGaNetManager.h @@ -19,9 +19,13 @@ typedef void (^responseBlock)(NSDictionary *responseDict, NSDictionary *response success:(void (^)(id response))success failure:(void (^)(NSError *err))failure; -// 测试题 , 登录 +// 测试题 , 登录 body 传参 +(void)userbodyRequest:(NSString *)url params:(NSDictionary *)param completionHandler:(nullable void (^)(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error))completionHandler; - +//上传图片 ++(void)uploadImage:(NSString *)url + imgData:(NSData *)imgData + parms:(NSDictionary *)parms + responseBlock:(responseBlock)block; @end diff --git a/GIGA/Common/GiGaNetTool/GiGaNetManager.m b/GIGA/Common/GiGaNetTool/GiGaNetManager.m index dcd33f0..56e9a5c 100644 --- a/GIGA/Common/GiGaNetTool/GiGaNetManager.m +++ b/GIGA/Common/GiGaNetTool/GiGaNetManager.m @@ -131,7 +131,57 @@ } - ++(void)uploadImage:(NSString *)url + imgData:(NSData *)imgData + 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"]; + } + + [manager POST:url parameters:parms constructingBodyWithBlock:^(id _Nonnull formData) { + + //上传时使用当前的系统事件作为文件名 + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + + formatter.dateFormat = @"yyyyMMddHHmmss"; + + NSString *str = [formatter stringFromDate:[NSDate date]]; + + NSString *fileName = [NSString stringWithFormat:@"%@.jpg", str]; + //服务器上传文件的字段和类型 + + [formData appendPartWithFileData:imgData name:@"file" fileName:fileName mimeType:@"image/jpeg"]; + NSString *userId = [GiGaUserDefault getCurentUserId]; + if (!userId) { + userId = @"avator123"; + } + + [formData appendPartWithFormData:imgData name:userId]; + + } 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/GIGaFileManager.h b/GIGA/Common/GiGaUserDB/GIGaFileManager.h new file mode 100644 index 0000000..0cf42c5 --- /dev/null +++ b/GIGA/Common/GiGaUserDB/GIGaFileManager.h @@ -0,0 +1,18 @@ +// +// GIGaFileManager.h +// GIGA +// +// Created by lianxiang on 2018/9/18. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface GIGaFileManager : NSObject ++(void)savaUserAvatorWith:(NSString *)userId image:(UIImage *)image; ++(UIImage *)getUserAvatorWith:(NSString *)userId; ++ (UIImage *) scaleFromImage: (UIImage *) image toSize: (CGSize) size; ++ (UIImage *)thumbnailWithImageWithoutScale:(UIImage *)image size:(CGSize)asize; + + +@end diff --git a/GIGA/Common/GiGaUserDB/GIGaFileManager.m b/GIGA/Common/GiGaUserDB/GIGaFileManager.m new file mode 100644 index 0000000..e064675 --- /dev/null +++ b/GIGA/Common/GiGaUserDB/GIGaFileManager.m @@ -0,0 +1,87 @@ + +// +// GIGaFileManager.m +// GIGA +// +// Created by lianxiang on 2018/9/18. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GIGaFileManager.h" + +@implementation GIGaFileManager + ++(void)savaUserAvatorWith:(NSString *)userId image:(UIImage *)image{ + if (!userId) { + GILog(@"userID nil !!!"); + return; + } + NSData*imageData=UIImageJPEGRepresentation(image,1.0f); + NSString *fullPath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:userId]; + [imageData writeToFile:fullPath atomically:YES]; + +} + ++ (UIImage *)getUserAvatorWith:(NSString *)userId{ + + if (!userId) { + GILog(@"userID nil !!!"); + return nil; + } + NSString*fullpath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:userId]; + UIImage*saveImage=[[UIImage alloc]initWithContentsOfFile:fullpath]; + if (!saveImage) { + saveImage = [UIImage imageNamed:@"img_circle_avatar"]; + } + return saveImage; + +} + +// 改变图像的尺寸,方便上传服务器 ++ (UIImage *) scaleFromImage: (UIImage *) image toSize: (CGSize) size +{ + UIGraphicsBeginImageContext(size); + [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; + UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return newImage; +} +//保持原来的长宽比,生成一个缩略图 ++ (UIImage *)thumbnailWithImageWithoutScale:(UIImage *)image size:(CGSize)asize +{ + UIImage *newimage; + if (nil == image) { + newimage = nil; + } + else{ + CGSize oldsize = image.size; + CGRect rect; + if (asize.width/asize.height > oldsize.width/oldsize.height) { + rect.size.width = asize.width*oldsize.height/oldsize.width; + // rect.size.height = asize.height*oldsize.height/oldsize.width; + rect.size.height = asize.width*oldsize.height/oldsize.width; + rect.origin.x = (asize.width - rect.size.width)/2; + + rect.origin.y = 0; + } + else{ + //rect.size.width = asize.width; + rect.size.width = asize.height*oldsize.width/oldsize.height; + rect.size.height = asize.height*oldsize.width/oldsize.height; + rect.origin.x = 0; + rect.origin.y = (asize.height - rect.size.height)/2; + + } + UIGraphicsBeginImageContext(asize); + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]); + UIRectFill(CGRectMake(0, 0, asize.width, asize.height));//clear background + [image drawInRect:rect]; + newimage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + } + return newimage; + +} + +@end diff --git a/GIGA/Common/GiGaUserDB/GiGaUserManager.m b/GIGA/Common/GiGaUserDB/GiGaUserManager.m index c35a58d..6ce50f1 100644 --- a/GIGA/Common/GiGaUserDB/GiGaUserManager.m +++ b/GIGA/Common/GiGaUserDB/GiGaUserManager.m @@ -101,7 +101,7 @@ const static NSInteger GIGADB_USER_VER = 0;//当前数据库版本号 NSString *useriD = [GiGaUserDefault getCurentUserId]; NSArray *usrA= [_store getObjectById:useriD fromTable:GIGA_USER_TABLE]; if (usrA && usrA.count > 0) { - //self.user = usrA[0]; + NSDictionary *userdic = usrA[0]; GiGaUser *user = [[GiGaUser alloc] initWithDictionary:userdic error:nil];; self.user = user; diff --git a/GIGA/Config/ApiRequestConfig.h b/GIGA/Config/ApiRequestConfig.h index 1699c67..9c3ad75 100644 --- a/GIGA/Config/ApiRequestConfig.h +++ b/GIGA/Config/ApiRequestConfig.h @@ -19,6 +19,7 @@ #define kFixUserInfo @"user/v1/editinfo" //头像上传 #define kUploadAvator @"sys/oss/v1/upload" - +//版本说明 +#define kAPiAPPVersion @"sys/maskversionarticle/v1/list" #endif /* ApiRequestConfig_h */ diff --git a/GIGA/Config/GIGA.h b/GIGA/Config/GIGA.h index 8658bd2..ed9168b 100644 --- a/GIGA/Config/GIGA.h +++ b/GIGA/Config/GIGA.h @@ -47,6 +47,8 @@ UD_SYNC #define kUserLoginSuccessNoti @"gigaUserloginSuccess" //退出登录 #define kUserLogOutNotify @"userLogOutNotify" +//用户头像修改 +#define kUserAvatorUpdateNoti @"userAvatorUpdate" //微信登陆授权成功 #define kWeiXinAuthrization_Success @"WXAuthSuccess" @@ -86,7 +88,7 @@ alpha:((float)(rgbValue & 0xFF))/255.0] //X //底部工具栏需要为home indicator留出34pt边距 -#define PhoneX_BottomMargin ([UIScreen mainScreen].bounds.size.height == 44.0 ? 34.0 :0.0) +#define PhoneX_BottomMargin ([[UIApplication sharedApplication] statusBarFrame].size.height == 44.0 ? 34.0 :0.0) //状态栏高度由20pt变成44pt,导航栏以上变化64->88。 #define PhoneX_TopMargin ([[UIApplication sharedApplication] statusBarFrame].size.height == 44.0 ? 24.0 :0.0) diff --git a/GIGA/Info.plist b/GIGA/Info.plist index 4768a60..af1c123 100644 --- a/GIGA/Info.plist +++ b/GIGA/Info.plist @@ -41,6 +41,14 @@ wx1fa33defa5cbc8dd + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + Prefs + + CFBundleVersion 1 @@ -55,6 +63,10 @@ NSAllowsArbitraryLoads + NSCameraUsageDescription + 是否允许此App使用您的 相机? + NSPhotoLibraryUsageDescription + 是否允许此App使用您的相册? UIBackgroundModes audio diff --git a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m index 427bad3..daddf1e 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m +++ b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m @@ -246,6 +246,7 @@ @"code":notification.object[@"code"], @"grant_type":@"authorization_code" }; + [WeiIXinApiManager weixinAccessTokeRequstUrl:@"https://api.weixin.qq.com/sns/oauth2/access_token" parameters:param success:^(id response) { NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingAllowFragments error:nil]; GILog(@"access_token back -->%@",dict); diff --git a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m index ff82d43..6d937f2 100644 --- a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m +++ b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m @@ -502,6 +502,7 @@ NC_ADD_TARGET_NAME_OBJECT(self, @selector(pushToAppAdDetailView),APP_PUSHTO_DETAILVIEW, nil) ; NC_ADD_TARGET_NAME_OBJECT(self, @selector(userLoginNotify), kUserLoginSuccessNoti, nil); NC_ADD_TARGET_NAME_OBJECT(self, @selector(userlogOutNotify), kUserLogOutNotify, nil); + NC_ADD_TARGET_NAME_OBJECT(self, @selector(userAvatorUpDate), kUserAvatorUpdateNoti, nil) ; } #pragma mark 广告详情 @@ -530,6 +531,9 @@ NC_REMOVE_NAME(self, USER_GUARD_DISSMISS, nil); NC_REMOVE_NAME(self, APP_GUARD_DISSMISS, nil); NC_REMOVE_NAME(self, APP_PUSHTO_DETAILVIEW, nil); + NC_REMOVE_NAME(self, kUserAvatorUpdateNoti, nil); + NC_REMOVE_NAME(self, kUserLogOutNotify, nil); + NC_REMOVE_NAME(self, kUserLoginSuccessNoti, nil); } #pragma mark 新手引导 @@ -671,4 +675,13 @@ } +#pragma mark -用户头像更新 +-(void)userAvatorUpDate{ + GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser]; + if (user.headImgUrl && ![user.headImgUrl isKindOfClass:[NSNull class]] ) { + [self refreshUserIcon:user.headImgUrl]; + } + +} + @end diff --git a/GIGA/Modules/Me/Controller/AppVerionDescriptionVC.h b/GIGA/Modules/Me/Controller/AppVerionDescriptionVC.h new file mode 100644 index 0000000..2fa095c --- /dev/null +++ b/GIGA/Modules/Me/Controller/AppVerionDescriptionVC.h @@ -0,0 +1,13 @@ +// +// AppVerionDescriptionVC.h +// GIGA +// +// Created by lianxiang on 2018/9/18. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GiGaBaseViewController.h" + +@interface AppVerionDescriptionVC : GiGaBaseViewController + +@end diff --git a/GIGA/Modules/Me/Controller/AppVerionDescriptionVC.m b/GIGA/Modules/Me/Controller/AppVerionDescriptionVC.m new file mode 100644 index 0000000..1bd51c5 --- /dev/null +++ b/GIGA/Modules/Me/Controller/AppVerionDescriptionVC.m @@ -0,0 +1,133 @@ +// +// AppVerionDescriptionVC.m +// GIGA +// +// Created by lianxiang on 2018/9/18. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "AppVerionDescriptionVC.h" +#import "AppVersionDescCell.h" +#import "GiGaBaseAPiRequest.h" +#import "VersionModel.h" +#import "AppVersionLogoCell.h" + +@interface AppVerionDescriptionVC () +@property (nonatomic,strong) NSMutableArray *versionsArr; +@property (nonatomic) int currntPage ; +@property (nonatomic) int totalPage ; +@end + +@implementation AppVerionDescriptionVC + +- (void)viewDidLoad { + [super viewDidLoad]; + _currntPage = 1; + _totalPage = 1; + self.versionsArr = [[NSMutableArray alloc] init]; + [self.view addSubview:self.tableView]; + self.tableView.delegate = self; + self.tableView.dataSource = self; + self.tableView.backgroundColor = [UIColor whiteColor]; + 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 requstListDatas]; +} + + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ + return 1 + self.versionsArr.count; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + + return 1; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + if (indexPath.section == 0) { + AppVersionLogoCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AppVersionLogoCell"]; + + if(!cell){ + cell = [[[NSBundle mainBundle] loadNibNamed:@"AppVersionLogoCell" owner:self options:nil] lastObject]; + } + return cell; + + } + + AppVersionDescCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AppVersionDescCell"]; + + if(!cell){ + cell = [[[NSBundle mainBundle] loadNibNamed:@"AppVersionDescCell" owner:self options:nil] lastObject]; + } + return cell; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (indexPath.section == 0) { + + return 173.f; + + }else{ + + return 92 + 25 * self.versionsArr.count; + } +} + +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ + return 0.1; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ + if (section == 0){ + return 0.1; + }else if (section == 1){ + return 12; + } + return 4; +} + +-(void)requstListDatas{ + + GiGaBaseAPiRequest *reuqest = [GiGaBaseAPiRequest initWithRequestPath:kAPiAPPVersion method:RequestPostMethod parms:@{}]; + [reuqest requstDataWithResult:^(GiGaAPIResult *result) { + if (result.success) { + GILog(@"%@",result.dic); + self->_currntPage = [result.dic[@"currPage"] intValue]; + self->_totalPage = [result.dic[@"totalPage"] intValue]; + NSDictionary *pagedic = result.dic[@"page"]; + NSArray *listArr = pagedic[@"list"]; + + for (NSDictionary *dic in listArr) { + VersionModel *model = [[VersionModel alloc] initWithDictionary:dic error:nil]; + [self.versionsArr addObject:model]; + } + + [self.tableView reloadData]; + + } + }]; + +} + +- (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/Me/Controller/GiGaMeViewController.m b/GIGA/Modules/Me/Controller/GiGaMeViewController.m index c2f8f54..8cf8e9c 100644 --- a/GIGA/Modules/Me/Controller/GiGaMeViewController.m +++ b/GIGA/Modules/Me/Controller/GiGaMeViewController.m @@ -15,6 +15,7 @@ #import "UINavigationBar+Custom.h" #import "GiGaBaseAPiRequest.h" #import "GiGaUserManager.h" +#import "UIImageView+WebCache.h" @interface GiGaMeViewController () @property (nonatomic,strong) GiGaUser *user; @@ -39,6 +40,21 @@ self.tableView.bounces = NO; self.tableView.frame = CGRectMake(0, 1, KMainW, self.view.bounds.size.height - SAFE_NAV_HEIGHT); [self loadUserInfo]; + NC_ADD_TARGET_NAME_OBJECT(self, @selector(userAvatorUpDate), kUserAvatorUpdateNoti, nil) ; +} + +-(void)dealloc{ + NC_REMOVE_NAME(self, kUserAvatorUpdateNoti, nil); +} + +-(void)userAvatorUpDate{ + + GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser]; + if (user.headImgUrl && ![user.headImgUrl isKindOfClass:[NSNull class]] ) { + GiGaMineUserViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; + NSURL *url = [NSURL URLWithString:user.headImgUrl]; + [cell.userAvator sd_setImageWithURL:url]; + } } diff --git a/GIGA/Modules/Me/Controller/GiGaUserViewController.m b/GIGA/Modules/Me/Controller/GiGaUserViewController.m index 5c7b151..d9e392d 100644 --- a/GIGA/Modules/Me/Controller/GiGaUserViewController.m +++ b/GIGA/Modules/Me/Controller/GiGaUserViewController.m @@ -18,8 +18,14 @@ #import "JYAddressPicker.h" #import "GiGaBaseAPiRequest.h" #import "GiGaUserJobViewCell.h" +#import +#import "GIGaFileManager.h" +#import "GiGaUserDefault.h" +#import "GiGaNetManager.h" +#import "GiGaServerConfig.h" +#import "GiGaAPIResult.h" -@interface GiGaUserViewController () +@interface GiGaUserViewController () @property (nonatomic,strong) GiGaUser *user; @property (nonatomic,strong) NSMutableArray *jobArr; @property (nonatomic) BOOL jobSpread; @@ -69,7 +75,6 @@ self.tableView.bounces = YES; self.tableView.frame = CGRectMake(0, 1, KMainW,self.view.bounds.size.height - SAFE_NAV_HEIGHT); [self.tableView registerClass: [GiGaUserJobViewCell class] forCellReuseIdentifier:@"GiGaUserJobViewCell"]; - } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ @@ -95,21 +100,25 @@ GIGaUserInfoAvatorCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GIGaUserInfoAvatorCell"]; if(!cell){ cell = [[[NSBundle mainBundle] loadNibNamed:@"GIGaUserInfoAvatorCell" owner:self options:nil] lastObject]; + UITapGestureRecognizer *tapGestrue = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(userAvatorClick)]; + [cell.userAvator addGestureRecognizer:tapGestrue]; } [cell loadCellData:indexPath user:self.user]; return cell; - }else if (indexPath.section == 1 && indexPath.row < 2){ + + }else if (indexPath.section == 1 && indexPath.row ==0){ GIGaUserIDViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GIGaUserIDViewCell"]; if(!cell){ cell = [[[NSBundle mainBundle] loadNibNamed:@"GIGaUserIDViewCell" owner:self options:nil] lastObject]; } - [cell loadCellData:indexPath user: self.user]; + [cell loadCellData:indexPath user: self.user]; + return cell; - }else if (indexPath.section == 1 && indexPath.row == 2){ + }else if (indexPath.section == 1 && indexPath.row <= 2){ GIGaUserWeChatViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GIGaUserWeChatViewCell"]; if(!cell){ cell = [[[NSBundle mainBundle] loadNibNamed:@"GIGaUserWeChatViewCell" owner:self options:nil] lastObject]; @@ -139,6 +148,7 @@ cell = [[[NSBundle mainBundle] loadNibNamed:@"GIGaUserCityViewCell" owner:self options:nil] lastObject]; } [cell loadCellData:indexPath user:self.user]; + return cell; }else if (indexPath.section == 3){ static NSString *cellID = @"GiGaUserJobViewCell"; @@ -148,13 +158,10 @@ } [cell userSelectjobAction:^() { - self.jobSpread = !self.jobSpread; [tableView reloadSections:[NSIndexSet indexSetWithIndex:3] withRowAnimation:UITableViewRowAnimationNone]; - }]; [cell setButtnImage:self.jobSpread with:self.jobArr]; - [cell userSelectjob:^(NSString *title) { self.user.occupationCode = title; [tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:3 inSection:2]] withRowAnimation:UITableViewRowAnimationNone]; @@ -162,7 +169,6 @@ return cell; } - return nil; } @@ -182,19 +188,49 @@ }]; }else if (indexPath.section == 2 && indexPath.row == 2){ - JYAddressPicker *addressPicker = [JYAddressPicker jy_showAt:self]; + + NSMutableArray *defalutvaluses = [NSMutableArray new]; + if (self.user.provinceId && ![self.user.provinceId isKindOfClass:[NSNull class]]) { + [defalutvaluses addObject:self.user.provinceId]; + }else{ + [defalutvaluses addObject:@""]; + } + if (self.user.cityId && ![self.user.cityId isKindOfClass:[NSNull class]]) { + [defalutvaluses addObject:self.user.cityId]; + }else{ + [defalutvaluses addObject:@""]; + } + if (self.user.areaId && ![self.user.areaId isKindOfClass:[NSNull class]]) { + [defalutvaluses addObject:self.user.areaId]; + }else{ + [defalutvaluses addObject:@""]; + } + + JYAddressPicker *addressPicker = [JYAddressPicker jy_showAt:self defaultShow:defalutvaluses]; + //JYAddressPicker *addressPicker = [JYAddressPicker jy_showAt:self]; weakify(self); addressPicker.selectedItemBlock = ^(NSArray *addressArr) { NSString *province = [addressArr objectAtIndex:0][@"name"]; + NSString *provinceID = [addressArr objectAtIndex:0][@"id"]; + NSString *city = [addressArr objectAtIndex:1][@"name"]; + NSString *cityID = [addressArr objectAtIndex:1][@"id"]; + NSString *county = [addressArr objectAtIndex:2][@"name"]; + NSString *countyID = [addressArr objectAtIndex:2][@"id"]; + NSString *addres = [NSString stringWithFormat:@"%@%@%@",province,city,county]; GILog(@"%@",addres); GIGaUserCityViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; weakSelf.user.provinceName = province; + weakSelf.user.provinceId = provinceID; + weakSelf.user.cityName = city; + weakSelf.user.cityId = cityID; + weakSelf.user.areaName = county; + weakSelf.user.areaId = countyID; [cell loadCellData:indexPath user:self.user]; }; @@ -249,10 +285,24 @@ #pragma mark - 保存用户信息 -(void)saveUserInfo{ + GIGaUserWeChatViewCell *nickcell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]]; + + self.user.nickName = nickcell.weiXinCount.text; + + GIGaUserWeChatViewCell *chatcell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:1]]; + self.user.weixin = chatcell.weiXinCount.text; + + if (!self.user.nickName || [self.user.nickName isKindOfClass:[NSNull class]]) { self.user.nickName = @""; } + int leng = [GiGaHelper convertToInt: self.user.nickName]; + if ( leng >40 ) { + GIGA_ShowToast(@"用户名1-40字符长度") + return; + } + if (!self.user.weixin || [self.user.weixin isKindOfClass:[NSNull class]]) { self.user.weixin = @""; } @@ -264,10 +314,21 @@ self.user.occupationCode = @""; } + if (!self.user.provinceId|| [self.user.provinceId isKindOfClass:[NSNull class]]) { + self.user.provinceId = @""; + } + if (!self.user.cityId|| [self.user.cityId isKindOfClass:[NSNull class]]) { + self.user.cityId = @""; + } + if (!self.user.areaId|| [self.user.areaId isKindOfClass:[NSNull class]]) { + self.user.areaId = @""; + } + + [self.view makeToastActivity:CSToastPositionCenter]; NSDictionary *param = @{ - @"provinceId":@"1_11", - @"cityId":@"1_11", - @"areaId":@"1_11_8", + @"provinceId":self.user.provinceId, + @"cityId":self.user.cityId, + @"areaId":self.user.areaId, @"nickName":self.user.nickName, @"weixin":self.user.weixin, @"sexCode":[NSString stringWithFormat:@"%d",self.user.sexCode], @@ -278,13 +339,19 @@ GiGaBaseAPiRequest *api =[GiGaBaseAPiRequest initWithRequestPath:kFixUserInfo method:RequestPostMethod parms:param]; [api requstDataWithResult:^(GiGaAPIResult *result) { + [self.view hideToastActivity]; if (result.success) { GIGA_ShowToast(@"修改成功"); + [[GiGaUserManager shareUser] saveUser:self.user]; + }else{ GIGA_ShowToast(result.dic[@"msg"]); + if (result.code == 401) { + //token失效 + [GiGaBaseAPiRequest userTokenTimeOutGologinFromVC:self]; + } } }]; - } #pragma mark - 获取职业数据 @@ -293,21 +360,158 @@ GiGaBaseAPiRequest *api =[GiGaBaseAPiRequest initWithRequestPath:kApiOccuption method:RequestPostMethod parms:param]; [api requstDataWithResult:^(GiGaAPIResult *result) { if (result.success) { - GILog(@"%@",result.dic); + // GILog(@"%@",result.dic); NSDictionary *dic = result.dic; NSArray *josA = dic[@"list"]; for (NSDictionary *jobDic in josA ) { [self.jobArr addObject:jobDic[@"dictLabel"]]; } - [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:3] withRowAnimation:UITableViewRowAnimationNone]; }else{ + NSString *msg = result.dic[@"msg"]; GIGA_ShowToast(msg); } - }]; } +#pragma mark - 用户头像点击 +-(void)userAvatorClick{ + [self showCameraAndPhotoAlert]; +} + +-(void)showCameraAndPhotoAlert{ + + UIAlertController *alertSheet = [UIAlertController alertControllerWithTitle:@"选择头像" message:nil preferredStyle:UIAlertControllerStyleActionSheet]; UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES; + + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { + UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + + //权限判断应用是否有使用相机的权限 + 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]; }]; + [alertSheet addAction:cameraAction]; + + } + //相册 + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { + //权限 + + UIAlertAction *photoAction = [UIAlertAction actionWithTitle:@"从手机相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + [self presentViewController:imagePickerController animated:YES completion:nil]; + + }]; + + [alertSheet addAction:photoAction]; + + }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]; + } + + } + }]; + } + + UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]; + [alertSheet addAction:cancelAction]; + [self presentViewController:alertSheet animated:YES completion:nil]; + +} + +-(void)camreaAction{ + + +} + +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + GILog(@"info:%@",info); + [picker dismissViewControllerAnimated:YES completion:nil] + ; + + UIImage*img=[info objectForKey:UIImagePickerControllerEditedImage]; + UIImage *samall = [GIGaFileManager thumbnailWithImageWithoutScale:img size:CGSizeMake(300, 300)]; + NSString *userid = [GiGaUserDefault getCurentUserId]; + [GIGaFileManager savaUserAvatorWith:userid image:samall]; + GIGaUserInfoAvatorCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; + cell.userAvator.image = samall; + [self uploadImage:samall]; + +} + +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{ + [picker dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma mark upload image + +-(void)uploadImage:(UIImage *)image{ + + [self.view makeToastActivity:CSToastPositionCenter]; + NSString *url = [NSString stringWithFormat:@"%@%@",[GiGaServerConfig getMainUrl],kUploadAvator]; + //NSString *userID = [GiGaUserDefault getCurentUserId]; + //UIImage *avator =[GIGaFileManager getUserAvatorWith:userID]; + NSData*imageData=UIImageJPEGRepresentation(image,1.0f); + + [GiGaNetManager uploadImage:url imgData:imageData parms:@{@"file":@"file"} responseBlock:^(NSDictionary *responseDict, NSDictionary *responseHeaderFields, NSError *error) { + [self.view hideToastActivity]; + GiGaAPIResult *reullt = [[GiGaAPIResult alloc] initWithDictionary:responseDict]; + if (error) { + GILog(@"eror:%@",error.localizedDescription); + return ; + } + if (reullt.success) { + GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser]; + NSString *newurl = responseDict[@"url"]; + self.user.headImgUrl = newurl; + if (newurl) { + user.headImgUrl = newurl; + } + [[GiGaUserManager shareUser] saveUser:user]; + NC_POST_NAME_OBJECT(kUserAvatorUpdateNoti, nil); + GIGA_ShowToast(@"👮‍♀️修改成功") + }else{ + GIGA_ShowToast(reullt.message); + } + }]; + +} + @end diff --git a/GIGA/Modules/Me/Controller/GiSysSettingsVC.m b/GIGA/Modules/Me/Controller/GiSysSettingsVC.m index baba345..0452232 100644 --- a/GIGA/Modules/Me/Controller/GiSysSettingsVC.m +++ b/GIGA/Modules/Me/Controller/GiSysSettingsVC.m @@ -11,6 +11,7 @@ #import "JXTAlertController.h" #import "GiGaUserDefault.h" #import "GiGaUserManager.h" +#import "AppVerionDescriptionVC.h" @interface GiSysSettingsVC () @@ -56,12 +57,32 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - [tableView deselectRowAtIndexPath:indexPath animated:YES]; + if (indexPath.row == 0) { + [self jxt_showAlertWithTitle:@"提示" message:@"确定清楚缓存?" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + alertMaker.addActionCancelTitle(@"取消"); + alertMaker.addActionDefaultTitle(@"确定"); + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + if (buttonIndex == 1) { + GiGaSettingsViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; + cell.cachLabe.text = @"0M"; + + } + + }]; + }else if (indexPath.row == 1){ + + }else if (indexPath.row == 2){ + + }else if (indexPath.row == 3){ + AppVerionDescriptionVC *verVC =[[AppVerionDescriptionVC alloc] init]; + [self.navigationController pushViewController:verVC animated:YES]; + } + } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - return 54; + return 44; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ @@ -120,7 +141,7 @@ } }]; } - +//http://yts.s1.natapp.cc/mask/clearZear.html -(void)userlogOut{ [[GiGaUserManager shareUser] loginOut]; diff --git a/GIGA/Modules/Me/Model/VersionModel.h b/GIGA/Modules/Me/Model/VersionModel.h new file mode 100644 index 0000000..2f3b859 --- /dev/null +++ b/GIGA/Modules/Me/Model/VersionModel.h @@ -0,0 +1,17 @@ +// +// VersionModel.h +// GIGA +// +// Created by lianxiang on 2018/9/18. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface VersionModel : JSONModel +@property (nonatomic,copy) NSString *content; +@property (nonatomic,copy) NSString *createTime; +@property (nonatomic,copy) NSString *ver_id; +@property (nonatomic,copy) NSString *title; +@property (nonatomic,copy) NSString *type; +@end diff --git a/GIGA/Modules/Me/Model/VersionModel.m b/GIGA/Modules/Me/Model/VersionModel.m new file mode 100644 index 0000000..f4e0a75 --- /dev/null +++ b/GIGA/Modules/Me/Model/VersionModel.m @@ -0,0 +1,21 @@ +// +// VersionModel.m +// GIGA +// +// Created by lianxiang on 2018/9/18. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "VersionModel.h" + +@implementation VersionModel + ++(JSONKeyMapper *)keyMapper{ + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{@"ver_id":@"id"}]; +} + ++ (BOOL)propertyIsOptional:(NSString *)propertyName{ + + return YES; +} +@end diff --git a/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.h b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.h new file mode 100644 index 0000000..460acbc --- /dev/null +++ b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.h @@ -0,0 +1,14 @@ +// +// AppVersionDescCell.h +// GIGA +// +// Created by lianxiang on 2018/9/18. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface AppVersionDescCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *VersionDescLabel; + +@end diff --git a/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.m b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.m new file mode 100644 index 0000000..8d714dc --- /dev/null +++ b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.m @@ -0,0 +1,26 @@ +// +// AppVersionDescCell.m +// GIGA +// +// Created by lianxiang on 2018/9/18. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "AppVersionDescCell.h" + +@implementation AppVersionDescCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code + //self.VersionDescLabel.text = @"1.版本有优化\n2.版本有优化\n3.版本有优化\n4.版本有优化\n5.版本有优化\n"; + +} + +- (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/AppVerionDescCells/AppVersionDescCell.xib b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.xib new file mode 100644 index 0000000..2f40937 --- /dev/null +++ b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionDescCell.xib @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.h b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.h new file mode 100644 index 0000000..e2dc509 --- /dev/null +++ b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.h @@ -0,0 +1,13 @@ +// +// AppVersionLogoCell.h +// GIGA +// +// Created by lianxiang on 2018/9/18. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface AppVersionLogoCell : UITableViewCell + +@end diff --git a/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.m b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.m new file mode 100644 index 0000000..84bd1a2 --- /dev/null +++ b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.m @@ -0,0 +1,24 @@ +// +// AppVersionLogoCell.m +// GIGA +// +// Created by lianxiang on 2018/9/18. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "AppVersionLogoCell.h" + +@implementation AppVersionLogoCell + +- (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/AppVerionDescCells/AppVersionLogoCell.xib b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.xib new file mode 100644 index 0000000..97ce20a --- /dev/null +++ b/GIGA/Modules/Me/View/AppVerionDescCells/AppVersionLogoCell.xib @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/Me/View/GiGaMineUserViewCell.m b/GIGA/Modules/Me/View/GiGaMineUserViewCell.m index eba6d95..960cb71 100644 --- a/GIGA/Modules/Me/View/GiGaMineUserViewCell.m +++ b/GIGA/Modules/Me/View/GiGaMineUserViewCell.m @@ -25,6 +25,7 @@ } + -(void)loadUserinfoWith:(GiGaUser *)user{ if (user.headImgUrl && ![user.nickName isKindOfClass:[NSNull class]]) { diff --git a/GIGA/Modules/Me/View/GiGaSettingsViewCell.m b/GIGA/Modules/Me/View/GiGaSettingsViewCell.m index 1ea855e..161200d 100644 --- a/GIGA/Modules/Me/View/GiGaSettingsViewCell.m +++ b/GIGA/Modules/Me/View/GiGaSettingsViewCell.m @@ -21,7 +21,8 @@ if(indexPath.row == 0){ self.cachLabe.hidden = NO; - + int M = arc4random() % 5; + self.cachLabe.text = [NSString stringWithFormat:@"%dM",M]; } self.descLabel.text = listArr[indexPath.row]; diff --git a/GIGA/Modules/Me/View/GiGaSettingsViewCell.xib b/GIGA/Modules/Me/View/GiGaSettingsViewCell.xib index ec11e5b..b87230a 100644 --- a/GIGA/Modules/Me/View/GiGaSettingsViewCell.xib +++ b/GIGA/Modules/Me/View/GiGaSettingsViewCell.xib @@ -12,41 +12,50 @@ - + - + - - + + - + + + + + + + + - + - + + + - + @@ -57,4 +66,7 @@ + + + diff --git a/GIGA/Modules/Me/View/userInfoView/GIGaUserCityViewCell.m b/GIGA/Modules/Me/View/userInfoView/GIGaUserCityViewCell.m index c607e81..95d9b82 100644 --- a/GIGA/Modules/Me/View/userInfoView/GIGaUserCityViewCell.m +++ b/GIGA/Modules/Me/View/userInfoView/GIGaUserCityViewCell.m @@ -42,6 +42,7 @@ }else{ self.detalTitle.text = [NSString stringWithFormat:@"%@%@%@",user.provinceName,user.cityName,user.areaName]; } + }else if (indexPath.section == 2 && indexPath.row == 3){ self.cityLabel.text = @"职业"; if (user.occupationCode && ![user.occupationCode isKindOfClass:[NSNull class]] && ![user.occupationCode isEqualToString:@""]) { diff --git a/GIGA/Modules/Me/View/userInfoView/GIGaUserIDViewCell.m b/GIGA/Modules/Me/View/userInfoView/GIGaUserIDViewCell.m index e664b60..fa47680 100644 --- a/GIGA/Modules/Me/View/userInfoView/GIGaUserIDViewCell.m +++ b/GIGA/Modules/Me/View/userInfoView/GIGaUserIDViewCell.m @@ -21,13 +21,6 @@ self.IdLabel.text = user.userId; self.userTitle.text = @"用户ID"; - }else if (indexPath.section == 1 && indexPath.row == 1){ - self.userTitle.text = @"昵称"; - if (user.nickName && ![user.nickName isKindOfClass:[NSNull class]]) { - self.IdLabel.text = user.nickName; - }else{ - self.IdLabel.text = @"昵称"; - } } } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { diff --git a/GIGA/Modules/Me/View/userInfoView/GIGaUserInfoAvatorCell.h b/GIGA/Modules/Me/View/userInfoView/GIGaUserInfoAvatorCell.h index d775022..db4944c 100644 --- a/GIGA/Modules/Me/View/userInfoView/GIGaUserInfoAvatorCell.h +++ b/GIGA/Modules/Me/View/userInfoView/GIGaUserInfoAvatorCell.h @@ -11,4 +11,5 @@ @interface GIGaUserInfoAvatorCell : UITableViewCell @property (weak, nonatomic) IBOutlet UIImageView *userAvator; -(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user; + @end diff --git a/GIGA/Modules/Me/View/userInfoView/GIGaUserInfoAvatorCell.xib b/GIGA/Modules/Me/View/userInfoView/GIGaUserInfoAvatorCell.xib index f09fdda..b0ea76c 100644 --- a/GIGA/Modules/Me/View/userInfoView/GIGaUserInfoAvatorCell.xib +++ b/GIGA/Modules/Me/View/userInfoView/GIGaUserInfoAvatorCell.xib @@ -19,7 +19,7 @@ - + diff --git a/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.h b/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.h index 1377332..c5cc8b9 100644 --- a/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.h +++ b/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.h @@ -9,6 +9,8 @@ #import @interface GIGaUserWeChatViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *descTitle; @property (weak, nonatomic) IBOutlet UITextField *weiXinCount; + -(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user; @end diff --git a/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.m b/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.m index 4181d02..9fad609 100644 --- a/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.m +++ b/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.m @@ -17,11 +17,23 @@ } -(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user{ - if (user.weixin && ![user.weixin isKindOfClass:[NSNull class]]) { - self.weiXinCount.text = user.weixin; - } + if (indexPath.section == 1 && indexPath.row == 1) { + //昵称 + self.descTitle.text = @"昵称"; + self.weiXinCount.placeholder = @"请输入用户昵称"; + if (user.nickName && ![user.nickName isKindOfClass:[NSNull class]] && ![user.nickName isEqualToString:@""]) { + + self.weiXinCount.text= user.nickName; + } + }else if (indexPath.section == 1 && indexPath.row == 2){ + //微信 + if (user.weixin && ![user.weixin isKindOfClass:[NSNull class]] && ![user.weixin isEqualToString:@""]) { + self.weiXinCount.text = user.weixin; + } + } } + - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; diff --git a/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.xib b/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.xib index 5526abe..95e0a09 100644 --- a/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.xib +++ b/GIGA/Modules/Me/View/userInfoView/GIGaUserWeChatViewCell.xib @@ -20,12 +20,15 @@ - + @@ -45,6 +48,7 @@ +