xiongzhu 7 yıl önce
ebeveyn
işleme
87ab39aed8
20 değiştirilmiş dosya ile 1455 ekleme ve 533 silme
  1. 5 2
      .gitignore
  2. 16 0
      model.xcodeproj/project.pbxproj
  3. 82 104
      model/AppDelegate.m
  4. 23 0
      model/Assets.xcassets/个人中心/icon_chenggong.imageset/Contents.json
  5. BIN
      model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong.png
  6. BIN
      model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong@2x.png
  7. BIN
      model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong@3x.png
  8. 72 55
      model/Classes/Controllers/Controller/MineVC/MineNewViewController.m
  9. 17 0
      model/Classes/Controllers/Controller/MyProfileVC/HobbyViewController.h
  10. 188 0
      model/Classes/Controllers/Controller/MyProfileVC/HobbyViewController.m
  11. 16 21
      model/Classes/Controllers/Controller/MyProfileVC/InfoEditViewController.m
  12. 160 122
      model/Classes/Controllers/Controller/MyProfileVC/ModelCardController.m
  13. 35 34
      model/Classes/Controllers/Controller/MyProfileVC/ModelTagViewController.m
  14. 65 61
      model/Classes/Controllers/Controller/MyWalletVC/BindPhoneController.m
  15. 3 2
      model/Classes/Controllers/Controller/MyWalletVC/MyWalletController.m
  16. 19 0
      model/Classes/Controllers/Controller/MyWalletVC/WithdrawController.h
  17. 270 0
      model/Classes/Controllers/Controller/MyWalletVC/WithdrawController.m
  18. 344 0
      model/Classes/Controllers/Controller/MyWalletVC/WithdrawController.xib
  19. 129 121
      model/Classes/Controllers/Controller/MyWalletVC/WithdrawalController.m
  20. 11 11
      model/Classes/Controllers/Controller/ShareVC/ShareCardController.m

+ 5 - 2
.gitignore

@@ -68,8 +68,11 @@ fastlane/test_output
 # https://github.com/johnno1962/injectionforxcode
 
 iOSInjectionProject/
-.DS_Store
+
 ### Objective-C Patch ###
 
 
-# End of https://www.gitignore.io/api/objective-c
+# End of https://www.gitignore.io/api/objective-c
+
+.DS_Store
+.idea

+ 16 - 0
model.xcodeproj/project.pbxproj

@@ -353,6 +353,7 @@
 		2FA1AF98212ACDEF005F12CA /* AgreementViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2FA1AF94212ACDEE005F12CA /* AgreementViewController.m */; };
 		2FA1AF99212ACDEF005F12CA /* AgreementViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2FA1AF95212ACDEE005F12CA /* AgreementViewController.xib */; };
 		2FA1AF9D212ACDFF005F12CA /* WYWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2FA1AF9C212ACDFF005F12CA /* WYWebView.m */; };
+		3A004A6D21917D4C009A989E /* HobbyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A004A6C21917D4C009A989E /* HobbyViewController.m */; };
 		3A44C12A218A0E7A0021DA3F /* MyModelController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A44C124218A0E790021DA3F /* MyModelController.m */; };
 		3A44C12B218A0E7A0021DA3F /* MyModelController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A44C125218A0E790021DA3F /* MyModelController.xib */; };
 		3A44C12C218A0E7A0021DA3F /* MyMemberController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A44C126218A0E790021DA3F /* MyMemberController.m */; };
@@ -377,6 +378,8 @@
 		3AC5CA04218BDDC700D4ACAC /* RankCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AC5CA02218BDDC700D4ACAC /* RankCell.xib */; };
 		3AC5CA07218BEB3E00D4ACAC /* RankHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AC5CA06218BEB3E00D4ACAC /* RankHeader.m */; };
 		3AC5CA09218BEB4B00D4ACAC /* RankHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AC5CA08218BEB4B00D4ACAC /* RankHeader.xib */; };
+		3ACF405621919448002C69D3 /* WithdrawController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3ACF405321919448002C69D3 /* WithdrawController.m */; };
+		3ACF405721919448002C69D3 /* WithdrawController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3ACF405521919448002C69D3 /* WithdrawController.xib */; };
 		3AE8C7AA218B2E550069D147 /* ModelCardController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AE8C7A9218B2E550069D147 /* ModelCardController.m */; };
 		3AE8C7AD218B49890069D147 /* IntroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AE8C7AC218B49890069D147 /* IntroView.m */; };
 		3AE8C7AF218B49EC0069D147 /* IntroView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AE8C7AE218B49EC0069D147 /* IntroView.xib */; };
@@ -1128,6 +1131,8 @@
 		2FA1AF96212ACDEF005F12CA /* privateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = privateViewController.h; sourceTree = "<group>"; };
 		2FA1AF9B212ACDFF005F12CA /* WYWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WYWebView.h; sourceTree = "<group>"; };
 		2FA1AF9C212ACDFF005F12CA /* WYWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WYWebView.m; sourceTree = "<group>"; };
+		3A004A6B21917D4C009A989E /* HobbyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HobbyViewController.h; sourceTree = "<group>"; };
+		3A004A6C21917D4C009A989E /* HobbyViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HobbyViewController.m; sourceTree = "<group>"; };
 		3A44C124218A0E790021DA3F /* MyModelController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyModelController.m; sourceTree = "<group>"; };
 		3A44C125218A0E790021DA3F /* MyModelController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyModelController.xib; sourceTree = "<group>"; };
 		3A44C126218A0E790021DA3F /* MyMemberController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyMemberController.m; sourceTree = "<group>"; };
@@ -1164,6 +1169,9 @@
 		3AC5CA05218BEB3E00D4ACAC /* RankHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RankHeader.h; sourceTree = "<group>"; };
 		3AC5CA06218BEB3E00D4ACAC /* RankHeader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RankHeader.m; sourceTree = "<group>"; };
 		3AC5CA08218BEB4B00D4ACAC /* RankHeader.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RankHeader.xib; sourceTree = "<group>"; };
+		3ACF405321919448002C69D3 /* WithdrawController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WithdrawController.m; sourceTree = "<group>"; };
+		3ACF405421919448002C69D3 /* WithdrawController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WithdrawController.h; sourceTree = "<group>"; };
+		3ACF405521919448002C69D3 /* WithdrawController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WithdrawController.xib; sourceTree = "<group>"; };
 		3AE8C7A8218B2E550069D147 /* ModelCardController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModelCardController.h; sourceTree = "<group>"; };
 		3AE8C7A9218B2E550069D147 /* ModelCardController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ModelCardController.m; sourceTree = "<group>"; };
 		3AE8C7AB218B49890069D147 /* IntroView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IntroView.h; sourceTree = "<group>"; };
@@ -2869,6 +2877,8 @@
 				8848C65D21080FDD00EDB121 /* ModelPhotoViewController.m */,
 				8848C65F2108103600EDB121 /* ModelHonorViewController.h */,
 				8848C6602108103600EDB121 /* ModelHonorViewController.m */,
+				3A004A6B21917D4C009A989E /* HobbyViewController.h */,
+				3A004A6C21917D4C009A989E /* HobbyViewController.m */,
 			);
 			path = MyProfileVC;
 			sourceTree = "<group>";
@@ -2897,6 +2907,9 @@
 				9EA6D16A20FE356900953CE3 /* WalletDetailsController.m */,
 				2F8D25672114706400CD7347 /* WithdrawalDetailController.h */,
 				2F8D25682114706400CD7347 /* WithdrawalDetailController.m */,
+				3ACF405421919448002C69D3 /* WithdrawController.h */,
+				3ACF405321919448002C69D3 /* WithdrawController.m */,
+				3ACF405521919448002C69D3 /* WithdrawController.xib */,
 			);
 			path = MyWalletVC;
 			sourceTree = "<group>";
@@ -2990,6 +3003,7 @@
 				2F4A8945211ADB00006D7DD3 /* TwoImageCell.xib in Resources */,
 				3AF450032185BD2E00ABEAEB /* SettingsViewController.xib in Resources */,
 				2FA1AF99212ACDEF005F12CA /* AgreementViewController.xib in Resources */,
+				3ACF405721919448002C69D3 /* WithdrawController.xib in Resources */,
 				2F4A8924211ADACF006D7DD3 /* DetailOneImageViewController.xib in Resources */,
 				2F8D24B821131B3900CD7347 /* personalImage.xib in Resources */,
 				2F8D26C521183D7300CD7347 /* NIMKitEmoticon.bundle in Resources */,
@@ -3342,6 +3356,7 @@
 				2F8D273C21183D7400CD7347 /* NIMKitSwitcherCell.m in Sources */,
 				2F8D278421183D9000CD7347 /* renderer_rgb.c in Sources */,
 				EF812F7520FF1755004A6A35 /* MBProgressHUD+YanC.m in Sources */,
+				3A004A6D21917D4C009A989E /* HobbyViewController.m in Sources */,
 				8848C66A210813D300EDB121 /* PhotoCollectionViewCell.m in Sources */,
 				2F8D24A621131B0500CD7347 /* UIScreen+Sports.m in Sources */,
 				2F8D270E21183D7400CD7347 /* NIMNotificationContentConfig.m in Sources */,
@@ -3461,6 +3476,7 @@
 				2F8D248C21131A7A00CD7347 /* JSONHTTPClient.m in Sources */,
 				2F8D26C821183D7300CD7347 /* NIMGroupedData.m in Sources */,
 				2F8D278F21183D9000CD7347 /* ijksdl_timer.c in Sources */,
+				3ACF405621919448002C69D3 /* WithdrawController.m in Sources */,
 				EF7B0C1D20FC6A810078781D /* IncreaseBalanceController.m in Sources */,
 				2F8D26FB21183D7400CD7347 /* NIMAdvancedTeamMemberCell.m in Sources */,
 				2F8D270121183D7400CD7347 /* NIMTimestampModel.m in Sources */,

+ 82 - 104
model/AppDelegate.m

@@ -20,7 +20,8 @@
 @import PushKit;
 
 NSString *NTESNotificationLogout = @"NTESNotificationLogout";
-@interface AppDelegate ()<NIMLoginManagerDelegate,PKPushRegistryDelegate,WXApiDelegate>
+
+@interface AppDelegate () <NIMLoginManagerDelegate, PKPushRegistryDelegate, WXApiDelegate>
 
 @end
 
@@ -31,27 +32,27 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
     // Override point for customization after application launch.
     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
     self.window.backgroundColor = [UIColor whiteColor];
-    
-    
-    NSString *appKey        = @"c545b95fd20d5a20d0d1220dc6831e4d";
-    NIMSDKOption *option    = [NIMSDKOption optionWithAppKey:appKey];
-    option.apnsCername      = apnsCernameStr;
-    option.pkCername        = @"nil";
+
+
+    NSString *appKey = @"c545b95fd20d5a20d0d1220dc6831e4d";
+    NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
+    option.apnsCername = apnsCernameStr;
+    option.pkCername = @"nil";
     [[NIMSDK sharedSDK] registerWithOption:option];
     [[NIMSDK sharedSDK].loginManager addDelegate:self];
     [[NIMKit sharedKit] registerLayoutConfig:[TestCellLayoutConfig new]];
-    
+
     [NIMSDKConfig sharedConfig].enabledHttpsForInfo = NO;
-    
+
     //    [[NIMSDK sharedSDK] registerWithAppID:@"c545b95fd20d5a20d0d1220dc6831e4d"
     //                                  cerName:@"push"];
-    
+
     //    [self registerAPNs];
-    
+
     [self setupServices];
     [self registerPushService];
-    
-    
+
+
 //    //判断更控制器
 //    NSString *key = @"CFBundleShortVersionString";
 //    // 获得当前软件的版本号
@@ -72,18 +73,17 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
 //
 //        [self setupMainViewController];
 //    }
-    
+
     [self setupMainViewController];
     // 显示窗口
     [self.window makeKeyAndVisible];
-    
+
     [WXApi registerApp:@"wx2a873aba839dbb4b" enableMTA:YES];
-    
+
     return YES;
 }
 
-- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
-{
+- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
     return [WXApi handleOpenURL:url delegate:self];
 }
 
@@ -94,32 +94,29 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
     return [WXApi handleOpenURL:url delegate:self];
 }
 
-- (void)setupMainViewController
-{
+- (void)setupMainViewController {
     NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
     NSString *accid = [user objectForKey:@"accid"];
     NSString *token = [user objectForKey:@"token"];
 //    NSString *token = @"333";
 
     //如果有缓存用户名密码推荐使用自动登录
-    if ([accid length] && [token length])
-    {
+    if ([accid length] && [token length]) {
         NIMAutoLoginData *loginData = [[NIMAutoLoginData alloc] init];
         loginData.account = accid;
         loginData.token = token;
         [Helper sharedAccount].accid = accid;
         [Helper sharedAccount].token = token;
         [[[NIMSDK sharedSDK] loginManager] autoLogin:loginData];
-        
+
         ModelRootViewController *mineVc = [[ModelRootViewController alloc] init];
         self.window.rootViewController = mineVc;
-    }else{
+    } else {
         [self setupLoginViewController];
     }
 }
 
-- (void)setupLoginViewController
-{
+- (void)setupLoginViewController {
     [self.window.rootViewController dismissViewControllerAnimated:YES completion:nil];
     LoginViewController *loginController = [[LoginViewController alloc] init];
     UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:loginController];
@@ -128,20 +125,20 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
 
 
 #pragma mark - 注销
--(void)logout:(NSNotification *)note
-{
+
+- (void)logout:(NSNotification *)note {
     [self doLogout];
 }
 
-- (void)doLogout
-{
+- (void)doLogout {
     //    [[NTESLoginManager sharedManager] setCurrentLoginData:nil];
     //    [[NTESServiceManager sharedManager] destory];
     [self setupLoginViewController];
 }
 
 #pragma NIMLoginManagerDelegate
-- (void)onAutoLoginFailed:(NSError *)error{
+
+- (void)onAutoLoginFailed:(NSError *)error {
     NSLog(@"AutoLoginFailed");
     [self showAutoLoginErrorAlert:error];
 }
@@ -149,18 +146,17 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
 - (void)onLogin:(NIMLoginStep)step {
 }
 
-- (void)onMultiLoginClientsChanged{
-    
+- (void)onMultiLoginClientsChanged {
+
     NSLog(@"被t");
 }
 
--(void)onKick:(NIMKickReason)code clientType:(NIMLoginClientType)clientType
-{
+- (void)onKick:(NIMKickReason)code clientType:(NIMLoginClientType)clientType {
     NSLog(@"onCLick");
     NSString *reason = @"你被踢下线";
     switch (code) {
         case NIMKickReasonByClient:
-        case NIMKickReasonByClientManually:{
+        case NIMKickReasonByClientManually: {
             //            NSString *clientName = [NTESClientUtil clientName:clientType];
             //            reason = clientName.length ? [NSString stringWithFormat:@"你的帐号被%@端踢出下线,请注意帐号信息安全",clientName] : @"你的帐号被踢出下线,请注意帐号信息安全";
             reason = @"你的帐号被踢出下线,请注意帐号信息安全";
@@ -173,7 +169,7 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
             break;
     }
     [MBProgressHUD showTextHUD:@"超时" inView:self.window hideAfterDelay:1];
-    
+
     [[[NIMSDK sharedSDK] loginManager] logout:^(NSError *error) {
         [[NSNotificationCenter defaultCenter] postNotificationName:NTESNotificationLogout object:nil];
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"下线通知" message:reason delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
@@ -182,38 +178,32 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
     }];
 }
 
-- (void)setupServices
-{
+- (void)setupServices {
     //    [[NTESLogManager sharedManager] start];
     [[NTESNotificationCenter sharedCenter] start];
     //    [[NTESSubscribeManager sharedManager] start];
     //    [[NTESRedPacketManager sharedManager] start];
 }
 
-- (void)registerAPNs
-{
-    if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)])
-    {
-        UIUserNotificationType types = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |      UIRemoteNotificationTypeAlert;
+- (void)registerAPNs {
+    if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)]) {
+        UIUserNotificationType types = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert;
         UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types
                                                                                  categories:nil];
         [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
         [[UIApplication sharedApplication] registerForRemoteNotifications];
-    }
-    else
-    {
-        UIRemoteNotificationType types = UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound |        UIRemoteNotificationTypeBadge;
+    } else {
+        UIRemoteNotificationType types = UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge;
         [[UIApplication sharedApplication] registerForRemoteNotificationTypes:types];
     }
 }
 
-- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
-{
+- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
     [[NIMSDK sharedSDK] updateApnsToken:deviceToken];
-    NSLog(@"deviceToken=============%@",deviceToken);
+    NSLog(@"deviceToken=============%@", deviceToken);
 }
 
-- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
+- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
     NSLog(@"receive remote notification:  %@", userInfo);
     //    [UIApplication sharedApplication].applicationIconBadgeNumber  =  0;
     //    completionHandler(UIBackgroundFetchResultNewData);
@@ -222,103 +212,92 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
     // Required, iOS 7 Support
     completionHandler(UIBackgroundFetchResultNewData);
-    if([UIApplication sharedApplication].applicationState == UIApplicationStateActive)
-    {  //此时app在前台运行,我的做法是弹出一个alert,告诉用户有一条推送,用户可以选择查看或者忽略
+    if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {  //此时app在前台运行,我的做法是弹出一个alert,告诉用户有一条推送,用户可以选择查看或者忽略
 //                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"推送消息"
 //                                                                 message:@"您有一条新的推送消息!"
 //                                                                delegate:self
 //                                                       cancelButtonTitle:@"取消"
 //                                                       otherButtonTitles:@"查看",nil];
 //                [alert show];
-        
+
     } else {
-        
+
         //这里是app未运行或者在后台,通过点击手机通知栏的推送消息打开app时可以在这里进行处理,比如,拿到推送里的内容或者附加      字段(假设,推送里附加了一个url为 www.baidu.com),那么你就可以拿到这个url,然后进行跳转到相应店web页,当然,不一定必须是web页,也可以是你app里的任意一个controll,跳转的话用navigation或者模态视图都可以
     }
-    
+
     //这里设置app的图片的角标为0,红色但角标就会消失
-    [UIApplication sharedApplication].applicationIconBadgeNumber  =  0;
+    [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
     completionHandler(UIBackgroundFetchResultNewData);
-    
+
 }
 
-- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
-{
-    NSLog(@"fail to get apns token :%@",error);
+- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
+    NSLog(@"fail to get apns token :%@", error);
 }
 
 #pragma mark PKPushRegistryDelegate
-- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type
-{
-    if ([type isEqualToString:PKPushTypeVoIP])
-    {
+
+- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type {
+    if ([type isEqualToString:PKPushTypeVoIP]) {
         [[NIMSDK sharedSDK] updatePushKitToken:credentials.token];
     }
 }
 
-- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type
-{
-    NSLog(@"receive payload %@ type %@",payload.dictionaryPayload,type);
+- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type {
+    NSLog(@"receive payload %@ type %@", payload.dictionaryPayload, type);
     NSNumber *badge = payload.dictionaryPayload[@"aps"][@"badge"];
-    if ([badge isKindOfClass:[NSNumber class]])
-    {
+    if ([badge isKindOfClass:[NSNumber class]]) {
         [UIApplication sharedApplication].applicationIconBadgeNumber = [badge integerValue];
     }
 }
 
-- (void)pushRegistry:(PKPushRegistry *)registry didInvalidatePushTokenForType:(NSString *)type
-{
-    NSLog(@"registry %@ invalidate %@",registry,type);
+- (void)pushRegistry:(PKPushRegistry *)registry didInvalidatePushTokenForType:(NSString *)type {
+    NSLog(@"registry %@ invalidate %@", registry, type);
 }
 
 
 #pragma mark - misc
-- (void)registerPushService
-{
-    if (@available(iOS 11.0, *))
-    {
+
+- (void)registerPushService {
+    if (@available(iOS 11.0, *)) {
         UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
-        [center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert) completionHandler:^(BOOL granted, NSError * _Nullable error) {
-            if (!granted)
-            {
+        [center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert) completionHandler:^(BOOL granted, NSError *_Nullable error) {
+            if (!granted) {
                 dispatch_async_main_safe(^{
                     [[UIApplication sharedApplication].keyWindow makeToast:@"请开启推送功能否则无法收到推送通知" duration:2.0 position:CSToastPositionCenter];
                 })
             }
         }];
-    }
-    else
-    {
+    } else {
         UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
         UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types
                                                                                  categories:nil];
         [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
     }
-    
+
     [[UIApplication sharedApplication] registerForRemoteNotifications];
-    
-    
+
+
     //pushkit
     PKPushRegistry *pushRegistry = [[PKPushRegistry alloc] initWithQueue:dispatch_get_main_queue()];
     pushRegistry.delegate = self;
     pushRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP];
-    
+
 }
 
 #pragma mark - 登录错误回调
-- (void)showAutoLoginErrorAlert:(NSError *)error
-{
+
+- (void)showAutoLoginErrorAlert:(NSError *)error {
     NSString *message = [NTESSessionUtil formatAutoLoginMessage:error];
     UIAlertController *vc = [UIAlertController alertControllerWithTitle:@"自动登录失败"
                                                                 message:message
                                                          preferredStyle:UIAlertControllerStyleAlert];
-    
+
     if ([error.domain isEqualToString:NIMLocalErrorDomain] &&
-        error.code == NIMLocalErrorCodeAutoLoginRetryLimit)
-    {
+            error.code == NIMLocalErrorCodeAutoLoginRetryLimit) {
         UIAlertAction *retryAction = [UIAlertAction actionWithTitle:@"重试"
                                                               style:UIAlertActionStyleCancel
-                                                            handler:^(UIAlertAction * _Nonnull action) {
+                                                            handler:^(UIAlertAction *_Nonnull action) {
                                                                 //                                                                NTESLoginData *data = [[NTESLoginManager sharedManager] currentLoginData];
                                                                 NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
                                                                 NSString *account = [user objectForKey:@"accid"];
@@ -326,24 +305,23 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
                                                                 //
                                                                 //                                                                NSString *account = [data account];
                                                                 //                                                                NSString *token = [data token];
-                                                                if ([account length] && [token length])
-                                                                {
+                                                                if ([account length] && [token length]) {
                                                                     NIMAutoLoginData *loginData = [[NIMAutoLoginData alloc] init];
                                                                     loginData.account = account;
                                                                     loginData.token = token;
-                                                                    
+
                                                                     [[[NIMSDK sharedSDK] loginManager] autoLogin:loginData];
                                                                 }
                                                             }];
         [vc addAction:retryAction];
     }
-    
-    LoginViewController *lVc = [[LoginViewController alloc]init];
-    
-    
+
+    LoginViewController *lVc = [[LoginViewController alloc] init];
+
+
     UIAlertAction *logoutAction = [UIAlertAction actionWithTitle:@"注销"
                                                            style:UIAlertActionStyleDestructive
-                                                         handler:^(UIAlertAction * _Nonnull action) {
+                                                         handler:^(UIAlertAction *_Nonnull action) {
                                                              [[[NIMSDK sharedSDK] loginManager] logout:^(NSError *error) {
                                                                  [[NSNotificationCenter defaultCenter] postNotificationName:NTESNotificationLogout object:nil];
                                                                  [self.window.rootViewController presentViewController:lVc
@@ -352,8 +330,8 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
                                                              }];
                                                          }];
     [vc addAction:logoutAction];
-    
-    
+
+
     [self.window.rootViewController presentViewController:vc
                                                  animated:YES
                                                completion:nil];

+ 23 - 0
model/Assets.xcassets/个人中心/icon_chenggong.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "icon_chenggong.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "icon_chenggong@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "icon_chenggong@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong.png


BIN
model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong@2x.png


BIN
model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong@3x.png


+ 72 - 55
model/Classes/Controllers/Controller/MineVC/MineNewViewController.m

@@ -21,25 +21,25 @@
 #import "ModelCardController.h"
 #import "RankController.h"
 
-@interface MineNewViewController (){
+@interface MineNewViewController () {
     BOOL online;
 }
 @property(weak, nonatomic) IBOutlet UIView *headView;
 @property(weak, nonatomic) IBOutlet UIView *bgView;
 @property(weak, nonatomic) IBOutlet UILabel *nameLabel;
-@property (weak, nonatomic) IBOutlet UIView *avatarBg;
+@property(weak, nonatomic) IBOutlet UIView *avatarBg;
 @property(weak, nonatomic) IBOutlet UIImageView *avatarView;
-@property (weak, nonatomic) IBOutlet UIView *container1;
-@property (weak, nonatomic) IBOutlet UIView *container2;
-@property (weak, nonatomic) IBOutlet UIView *incomeView;
-@property (weak, nonatomic) IBOutlet UILabel *incomeLabel;
-@property (weak, nonatomic) IBOutlet UISwitch *onlineSwitch;
-@property (weak, nonatomic) IBOutlet UIView *modelCardView;
-@property (weak, nonatomic) IBOutlet UIView *skillView;
+@property(weak, nonatomic) IBOutlet UIView *container1;
+@property(weak, nonatomic) IBOutlet UIView *container2;
+@property(weak, nonatomic) IBOutlet UIView *incomeView;
+@property(weak, nonatomic) IBOutlet UILabel *incomeLabel;
+@property(weak, nonatomic) IBOutlet UISwitch *onlineSwitch;
+@property(weak, nonatomic) IBOutlet UIView *modelCardView;
+@property(weak, nonatomic) IBOutlet UIView *skillView;
 
-@property (weak, nonatomic) IBOutlet UIView *switchView;
-@property (weak, nonatomic) IBOutlet UIView *switchIndicatorView;
-@property (weak, nonatomic) IBOutlet UIView *transformView;
+@property(weak, nonatomic) IBOutlet UIView *switchView;
+@property(weak, nonatomic) IBOutlet UIView *switchIndicatorView;
+@property(weak, nonatomic) IBOutlet UIView *transformView;
 @end
 
 @implementation MineNewViewController
@@ -56,9 +56,9 @@
     self.nameLabel.userInteractionEnabled = YES;
     self.avatarBg.layer.cornerRadius = 43;
     self.avatarView.layer.cornerRadius = 35;
-    self.avatarView.layer.masksToBounds = YES; 
+    self.avatarView.layer.masksToBounds = YES;
     self.avatarView.userInteractionEnabled = YES;
-    
+
     online = YES;
 }
 
@@ -67,7 +67,7 @@
     [self getDataFromNetworking];
 }
 
--(void)viewDidLayoutSubviews{
+- (void)viewDidLayoutSubviews {
     [super viewDidLayoutSubviews];
     CAGradientLayer *gl = [CAGradientLayer layer];
     gl.frame = CGRectMake(0, 0, self.headView.frame.size.width, 104 + [[UIApplication sharedApplication] statusBarFrame].size.height);
@@ -76,51 +76,52 @@
     gl.colors = @[(__bridge id) [UIColor colorWithRed:251 / 255.0 green:92 / 255.0 blue:163 / 255.0 alpha:1].CGColor, (__bridge id) [UIColor colorWithRed:253 / 255.0 green:127 / 255.0 blue:141 / 255.0 alpha:1].CGColor];
     gl.locations = @[@(0), @(1.0f)];
     [self.headView.layer addSublayer:gl];
-    
+
     UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bgView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(30, 30)];
     CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
     maskLayer.frame = self.bgView.bounds;
     maskLayer.path = maskPath.CGPath;
     self.bgView.layer.mask = maskLayer;
-    
+
     self.container1.layer.cornerRadius = 12;
-    self.container1.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.08].CGColor;
-    self.container1.layer.shadowOffset = CGSizeMake(0,6);
+    self.container1.layer.shadowColor = [UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.08].CGColor;
+    self.container1.layer.shadowOffset = CGSizeMake(0, 6);
     self.container1.layer.shadowOpacity = 1;
     self.container1.layer.shadowRadius = 12;
-    
+
     self.container2.layer.cornerRadius = 12;
-    self.container2.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.08].CGColor;
-    self.container2.layer.shadowOffset = CGSizeMake(0,6);
+    self.container2.layer.shadowColor = [UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.08].CGColor;
+    self.container2.layer.shadowOffset = CGSizeMake(0, 6);
     self.container2.layer.shadowOpacity = 1;
     self.container2.layer.shadowRadius = 12;
-    
+
     self.incomeView.layer.cornerRadius = 17;
-    self.incomeView.layer.shadowColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:0.36].CGColor;
-    self.incomeView.layer.shadowOffset = CGSizeMake(0,8);
+    self.incomeView.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
+    self.incomeView.layer.shadowOffset = CGSizeMake(0, 8);
     self.incomeView.layer.shadowOpacity = 1;
     self.incomeView.layer.shadowRadius = 10;
 }
 
 - (void)viewDidAppear:(BOOL)animated {
     [super viewDidAppear:animated];
-    NSNumber* intro = [[NSUserDefaults standardUserDefaults] objectForKey:@"intro"];
+    NSNumber *intro = [[NSUserDefaults standardUserDefaults] objectForKey:@"intro"];
     if (!intro) {
         __weak MineNewViewController *this = self;
-        IntroView* introView = [[IntroView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)
+        IntroView *introView = [[IntroView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)
                                                         confirm:^{
                                                             ModelCardController *modelCardVC = [[ModelCardController alloc] init];
-                                                            modelCardVC.type = @"init"; modelCardVC.hidesBottomBarWhenPushed = YES;
+                                                            modelCardVC.type = @"init";
+                                                            modelCardVC.hidesBottomBarWhenPushed = YES;
                                                             [this.navigationController pushViewController:modelCardVC animated:YES];
                                                         }
                                                          cancel:^{
-                                                             
+
                                                          }];
-        UIWindow * window=[[[UIApplication sharedApplication] delegate] window];
-        CGRect rect1 = [self.modelCardView convertRect: self.modelCardView.bounds toView:window];
+        UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
+        CGRect rect1 = [self.modelCardView convertRect:self.modelCardView.bounds toView:window];
         introView.icon1left.constant = rect1.origin.x + rect1.size.width / 2 - 43;
         introView.icon1top.constant = rect1.origin.y + rect1.size.height / 2 - 43 - [[UIApplication sharedApplication] statusBarFrame].size.height;
-        CGRect rect2 = [self.skillView convertRect: self.skillView.bounds toView:window];
+        CGRect rect2 = [self.skillView convertRect:self.skillView.bounds toView:window];
         introView.icon2left.constant = rect2.origin.x + rect2.size.width / 2 - 43;
         [window addSubview:introView];
         [introView updateConstraints];
@@ -138,7 +139,7 @@
     NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser user].modelpk, @"modelpk", nil];
     [YanCNetWorkManager requestPostWithURLStr:Url_refreshLogin(PublicUrl) parameters:dic finish:^(id dataDic) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
-        
+
         NSString *issuccess = dataDic[@"msg"];
         if ([issuccess isEqualToString:@"success"]) {
             ModelUser *user = [ModelUser modelUser];
@@ -149,38 +150,38 @@
             user.pk = dataDic[@"data"][@"pk"];
             user.qrcode = dataDic[@"data"][@"qrcode"];
             [ModelUser save:user];
-            
+
             self.nameLabel.text = [NSString stringWithFormat:@"%@", dataDic[@"data"][@"pet"]];
             [self.avatarView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", PublicUrl, dataDic[@"data"][@"hphoto"]]] placeholderImage:[UIImage imageNamed:@"morentouxiang"]];
             online = user.is_a;
             [self setSwitchState:user.is_a];
-           
+
 //            if ([dataDic[@"data"][@"hasred"] isEqualToString:@"1"]) {
 //                self.notificationView.hidden = NO;
 //            }else{
 //                self.notificationView.hidden = YES;
 //            }
-            
+
             [self getIncomeFromNetworking];
         } else {
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
 
--(void)getIncomeFromNetworking{
-    
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser modelUser].pk,@"memberpk", nil];
+- (void)getIncomeFromNetworking {
+
+    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser modelUser].pk, @"memberpk", nil];
     [YanCNetWorkManager requestPostWithURLStr:Url_getIncomeToday(PublicUrl) parameters:dic finish:^(id dataDic) {
         NSString *issuccess = dataDic[@"msg"];
         if ([issuccess isEqualToString:@"success"]) {
             self.incomeLabel.text = [NSString stringWithFormat:@"今日收入 %@元", dataDic[@"count"]];
-        }else {
+        } else {
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    }enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
@@ -202,8 +203,8 @@
         case 3: {
             UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"确定申请首页推荐展示?" preferredStyle:UIAlertControllerStyleAlert];
             [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
-            [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-                NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser modelUser].modelpk,@"modelpk", nil];
+            [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
+                NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser modelUser].modelpk, @"modelpk", nil];
                 [YanCNetWorkManager requestPostWithURLStr:Url_applyRecommend(PublicUrl)
                                                parameters:dic
                                                    finish:^(id res) {
@@ -221,7 +222,7 @@
             [self presentViewController:alert animated:YES completion:nil];
         }
         case 4: {
-            PromoteController* vc = [[PromoteController alloc] init];
+            PromoteController *vc = [[PromoteController alloc] init];
             vc.hidesBottomBarWhenPushed = YES;
             [self.navigationController pushViewController:vc animated:YES];
             break;
@@ -239,21 +240,21 @@
             [self.navigationController pushViewController:myWalletVC animated:YES];
             break;
         }
-        case 7:{
+        case 7: {
             PlatformActivityController *activityVC = [[PlatformActivityController alloc] init];
             activityVC.hidesBottomBarWhenPushed = YES;
             [self.navigationController pushViewController:activityVC animated:YES];
             break;
         }
-        case 8:{
+        case 8: {
             AboutUsViewController *aboutUsVC = [[AboutUsViewController alloc] init];
             aboutUsVC.hidesBottomBarWhenPushed = YES;
             [self.navigationController pushViewController:aboutUsVC animated:YES];
             break;
         }
-        case 9:{
+        case 9: {
             [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                 [MBProgressHUD hideHUDForView:self.view];
                 [MBProgressHUD showInfo:@"清理完成"];
             });
@@ -275,7 +276,7 @@
 }
 
 - (void)updateOnline:(BOOL)state {
-    __weak MineNewViewController* this = self;
+    __weak MineNewViewController *this = self;
     NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser modelUser].modelpk, @"modelpk", @(state), @"state", nil];
     [YanCNetWorkManager requestPostWithURLStr:Url_setOnline(PublicUrl)
                                    parameters:dic
@@ -285,9 +286,25 @@
                                                online = state;
                                                [this setSwitchState:state];
                                                if (online) {
-                                                   [MBProgressHUD showInfo:@"您已开启在线模式"];
+                                                   MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:[UIApplication sharedApplication].keyWindow animated:YES];
+                                                   hud.mode = MBProgressHUDModeText;
+                                                   hud.detailsLabel.text = @"您已开启在线状态\n将优先排序获得更多商业订单";
+                                                   hud.detailsLabel.font = [UIFont boldSystemFontOfSize:16];
+                                                   hud.margin = 15.f;
+                                                   hud.removeFromSuperViewOnHide = YES;
+                                                   [hud.bezelView setBackgroundColor:[UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.8]];
+                                                   hud.contentColor = [UIColor whiteColor];
+                                                   [hud hideAnimated:YES afterDelay:2];
                                                } else {
-                                                   [MBProgressHUD showInfo:@"您已开启离线模式,别人将无法呼叫您"];
+                                                   MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:[UIApplication sharedApplication].keyWindow animated:YES];
+                                                   hud.mode = MBProgressHUDModeText;
+                                                   hud.detailsLabel.text = @"您已开启离线状态\n客户无法及时联系您将造成经济损失";
+                                                   hud.detailsLabel.font = [UIFont boldSystemFontOfSize:16];
+                                                   hud.margin = 15.f;
+                                                   hud.removeFromSuperViewOnHide = YES;
+                                                   [hud.bezelView setBackgroundColor:[UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.8]];
+                                                   hud.contentColor = [UIColor whiteColor];
+                                                   [hud hideAnimated:YES afterDelay:2];
                                                }
                                            } else {
                                                [MBProgressHUD showInfo:@"请求失败!"];
@@ -305,7 +322,7 @@
                             options:UIViewAnimationOptionCurveEaseOut
                          animations:^{
                              self.switchView.backgroundColor = [UIColor whiteColor];
-                             self.switchIndicatorView.backgroundColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:1];
+                             self.switchIndicatorView.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:1];
                              self.transformView.transform = CGAffineTransformMakeTranslation(0, 0);
                          }
                          completion:nil];
@@ -314,7 +331,7 @@
                               delay:0
                             options:UIViewAnimationOptionCurveEaseOut
                          animations:^{
-                             self.switchView.backgroundColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.3];
+                             self.switchView.backgroundColor = [UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.3];
                              self.switchIndicatorView.backgroundColor = [UIColor whiteColor];
                              self.transformView.transform = CGAffineTransformMakeTranslation(-32, 0);
                          }
@@ -323,7 +340,7 @@
 }
 
 - (IBAction)tapRank:(id)sender {
-    RankController* rankVC = [[RankController alloc] init];
+    RankController *rankVC = [[RankController alloc] init];
     rankVC.hidesBottomBarWhenPushed = YES;
     [self.navigationController pushViewController:rankVC animated:YES];
 }

+ 17 - 0
model/Classes/Controllers/Controller/MyProfileVC/HobbyViewController.h

@@ -0,0 +1,17 @@
+//
+//  HobbyViewController.h
+//  model
+//
+//  Created by Drew on 2018/11/6.
+//  Copyright © 2018 Mine. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface HobbyViewController : ModelBaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 188 - 0
model/Classes/Controllers/Controller/MyProfileVC/HobbyViewController.m

@@ -0,0 +1,188 @@
+//
+//  HobbyViewController.m
+//  model
+//
+//  Created by Drew on 2018/11/6.
+//  Copyright © 2018 Mine. All rights reserved.
+//
+
+#import "HobbyViewController.h"
+#import "TagCollectionViewCell.h"
+#import <TTGTagCollectionView/TTGTagCollectionView.h>
+
+@interface HobbyViewController () <TTGTagCollectionViewDelegate, TTGTagCollectionViewDataSource>
+
+@property(nonatomic, strong) UILabel *infoLabel;
+@property(nonatomic, strong) TTGTagCollectionView *listTagView;
+@property(nonatomic, strong) NSMutableArray *dataSource;
+@property(strong, nonatomic) NSMutableArray <UIView *> *tagViews;
+@property(nonatomic, strong) NSMutableArray *selectTag;
+
+@end
+
+@implementation HobbyViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    [self configUI];
+}
+
+- (void)configUI {
+    self.view.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
+    self.title = @"兴趣爱好";
+    self.navigationController.navigationBar.tintColor = RGBValueColor(0x333333, 1);
+    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(handleSave)];
+    self.infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, ScreenWidth - 40, 20)];
+    self.infoLabel.font = [UIFont systemFontOfSize:14];
+    self.infoLabel.text = @"选择你的兴趣爱好(至多选6个)";
+    self.infoLabel.textColor = RGBValueColor(0x666666, 1);
+    [self.view addSubview:self.infoLabel];
+
+    self.listTagView = [[TTGTagCollectionView alloc] initWithFrame:CGRectMake(20, 60, ScreenWidth - 40, ScreenHeight - 60)];
+    self.listTagView.delegate = self;
+    self.listTagView.dataSource = self;
+    self.listTagView.verticalSpacing = 10;
+    self.listTagView.horizontalSpacing = 15;
+    [self.view addSubview:self.listTagView];
+    _tagViews = [NSMutableArray new];
+    NSArray *hobbyArray = @[@"网球", @"高尔夫球", @"桌球", @"滑板", @"跑步", @"瑜伽", @"游泳", @"健身", @"篮球", @"足球",
+            @"机车", @"看电影", @"话剧", @"逛街", @"葡萄酒", @"美食", @"蹦迪", @"唱歌", @"跳舞", @"宅女"];
+    [self.dataSource addObjectsFromArray:hobbyArray];
+    for (NSString *hobby in  hobbyArray) {
+        [_tagViews addObject:[self newButtonWithTitle:hobby]];
+    }
+    [self.listTagView reload];
+}
+
+#pragma mark - TTGTagCollectionViewDelegate
+
+- (CGSize)tagCollectionView:(TTGTagCollectionView *)tagCollectionView sizeForTagAtIndex:(NSUInteger)index {
+
+    return _tagViews[index].frame.size;
+}
+
+- (void)tagCollectionView:(TTGTagCollectionView *)tagCollectionView didSelectTag:(UIView *)tagView atIndex:(NSUInteger)index {
+
+}
+
+- (BOOL)tagCollectionView:(TTGTagCollectionView *)tagCollectionView shouldSelectTag:(UIView *)tagView atIndex:(NSUInteger)index {
+    return YES;
+}
+
+#pragma mark - TTGTagCollectionViewDataSource
+
+- (NSUInteger)numberOfTagsInTagCollectionView:(TTGTagCollectionView *)tagCollectionView {
+
+    return _tagViews.count;
+}
+
+- (UIView *)tagCollectionView:(TTGTagCollectionView *)tagCollectionView tagViewForIndex:(NSUInteger)index {
+
+    return _tagViews[index];
+}
+
+#pragma mark - Private methods
+
+- (UIButton *)newButtonWithTitle:(NSString *)title {
+    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
+    UIColor *selectColor = [self randomColors][arc4random() % 12];
+    button.titleLabel.font = [UIFont systemFontOfSize:14];
+    [button setTitle:title forState:UIControlStateNormal];
+    [button sizeToFit];
+    button.layer.masksToBounds = YES;
+    button.layer.cornerRadius = 15.0f;
+    [button setTitleColor:selectColor forState:UIControlStateNormal];
+    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
+    button.layer.borderWidth = 1.f;
+    button.layer.borderColor = selectColor.CGColor;
+    [self expandSizeForView:button extraWidth:15 extraHeight:4];
+    [button addTarget:self action:@selector(onTap:) forControlEvents:UIControlEventTouchUpInside];
+    return button;
+}
+
+- (void)expandSizeForView:(UIView *)view extraWidth:(CGFloat)extraWidth extraHeight:(CGFloat)extraHeight {
+    CGRect frame = view.frame;
+    frame.size.width += extraWidth;
+    frame.size.height += extraHeight;
+    view.frame = frame;
+}
+
+- (void)onTap:(UIButton *)sender {
+    if (!sender.selected && self.selectTag.count == 6) {
+        [MBProgressHUD showOnlyText:@"最多选择6个"];
+    } else {
+        sender.selected = !sender.selected;
+        NSString *hobby = self.dataSource[[self.tagViews indexOfObject:sender]];
+
+        if (sender.selected) {
+            sender.backgroundColor = sender.titleLabel.textColor;
+            [self.selectTag addObject:hobby];
+        } else {
+            sender.backgroundColor = [UIColor whiteColor];
+            [self.selectTag removeObject:hobby];
+        }
+    }
+}
+
+- (void)handleSave {
+    if (self.selectTag.count == 0) {
+        [MBProgressHUD showOnlyText:@"最少选择一个"];
+        return;
+    }
+    [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
+                                   parameters:@{@"modelpk": [ModelUser user].modelpk, @"hobby": [self.selectTag componentsJoinedByString:@" "]}
+                                       finish:^(id dataDic) {
+                                           if ([dataDic[@"msg"] isEqualToString:@"success"]) {
+                                               [self.navigationController popViewControllerAnimated:YES];
+                                           }
+                                       }
+                                      enError:^(NSError *error) {
+
+                                      }];
+}
+
+- (NSMutableArray *)dataSource {
+    if (!_dataSource) {
+        _dataSource = [NSMutableArray array];
+    }
+    return _dataSource;
+}
+
+- (NSMutableArray *)selectTag {
+    if (!_selectTag) {
+        _selectTag = [NSMutableArray array];
+    }
+    return _selectTag;
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+/*
+ Text自适应
+ */
+- (CGFloat)calculateSizeWithFont:(NSInteger)Font Text:(NSString *)Text {
+    NSDictionary *attr = @{NSFontAttributeName: [UIFont systemFontOfSize:Font]};
+    CGRect rect = [Text boundingRectWithSize:CGSizeMake(MAXFLOAT, 20)
+                                     options:NSStringDrawingUsesLineFragmentOrigin
+                                  attributes:attr
+                                     context:nil];
+    return rect.size.width;
+}
+
+- (NSArray *)randomColors {
+    return @[RGBValueColor(0xfc7d77, 1), RGBValueColor(0x25e6b9, 1), RGBValueColor(0xd2adfb, 1), RGBValueColor(0xff9dbc, 1), RGBValueColor(0xff6b9e, 1), RGBValueColor(0x5cdee0, 1), RGBValueColor(0xf29a76, 1), RGBValueColor(0x49c9f0, 1), RGBValueColor(0xef87b4, 1), RGBValueColor(0xb3d465, 1), RGBValueColor(0xf8b551, 1), RGBValueColor(0xf80c269, 1)];
+}
+/*
+#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

+ 16 - 21
model/Classes/Controllers/Controller/MyProfileVC/InfoEditViewController.m

@@ -10,7 +10,7 @@
 
 @interface InfoEditViewController ()
 
-@property (nonatomic, strong) UITextField *infoTextField;
+@property(nonatomic, strong) UITextField *infoTextField;
 
 @end
 
@@ -23,51 +23,51 @@
 }
 
 - (void)configUI {
-    
+
     self.view.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
     self.navigationController.navigationBar.tintColor = RGBValueColor(0x333333, 1);
     self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(handleSave)];
-    
+
     self.infoTextField = [[UITextField alloc] initWithFrame:CGRectMake(0, 10, ScreenWidth, 40)];
     self.infoTextField.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 40)];
     self.infoTextField.leftViewMode = UITextFieldViewModeAlways;
     self.infoTextField.backgroundColor = [UIColor whiteColor];
     [self.view addSubview:self.infoTextField];
-    
+
     switch (_editType) {
         case InfoEditTypeName:
             self.title = @"用户名";
             self.infoTextField.placeholder = @"请输入用户名";
             self.infoTextField.text = [ModelUser modelUser].pet;
             break;
-            
+
         case InfoEditTypeAge:
             self.title = @"年龄";
             self.infoTextField.placeholder = @"请输入年龄";
             self.infoTextField.text = [ModelUser modelUser].age;
             self.infoTextField.keyboardType = UIKeyboardTypeNumberPad;
             break;
-            
+
         case InfoEditTypeHeight:
             self.title = @"身高";
             self.infoTextField.placeholder = @"请输入身高(cm)";
             self.infoTextField.text = [ModelUser modelUser].hei;
             self.infoTextField.keyboardType = UIKeyboardTypeDecimalPad;
             break;
-            
+
         case InfoEditTypeWeight:
             self.title = @"体重";
             self.infoTextField.placeholder = @"请输入体重(kg)";
             self.infoTextField.text = [ModelUser modelUser].wei;
             self.infoTextField.keyboardType = UIKeyboardTypeDecimalPad;
             break;
-            
+
         case InfoEditTypeSigature:
             self.title = @"个性签名";
             self.infoTextField.text = [ModelUser modelUser].lname;
             self.infoTextField.placeholder = @"请输入个性签名";
             break;
-            
+
         case InfoEditTypeVprice:
             self.title = @"视频单价";
             self.infoTextField.text = [ModelUser modelUser].vprice;
@@ -99,22 +99,17 @@
     }
 }
 
-- (void)handleSave{
-    
+- (void)handleSave {
     if (self.infoTextField.text.length != 0) {
         [self.infoTextField resignFirstResponder];
-        
         if (_editType == InfoEditTypeVprice) {
             NSInteger price = [self.infoTextField.text integerValue];
-            
             if (price < 6 || price > 49) {
                 [MBProgressHUD showOnlyText:@"视频单价不能小于6元或大于49元" controller:self];
                 return;
             }
         }
-        
         [self handleInfo:self.infoTextField.text];
-
     }
 }
 
@@ -130,10 +125,10 @@
         case InfoEditTypeHeight:
             paramterKey = @"hei";
             break;
-         case InfoEditTypeWeight:
+        case InfoEditTypeWeight:
             paramterKey = @"wei";
             break;
-         case InfoEditTypeSigature:
+        case InfoEditTypeSigature:
             paramterKey = @"lname";
             break;
         case InfoEditTypeVprice:
@@ -156,15 +151,15 @@
     }
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
 
-    [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl) parameters:@{paramterKey:info,@"modelpk":[ModelUser user].modelpk} finish:^(id dataDic) {
-        
+    [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl) parameters:@{paramterKey: info, @"modelpk": [ModelUser user].modelpk} finish:^(id dataDic) {
+
         [MBProgressHUD hideHUDForView:self.view animated:YES];
         if (self.complete) {
             self.complete(info);
         }
         [self.navigationController popViewControllerAnimated:YES];
-    } enError:^(NSError *error) {
-        
+    }                                 enError:^(NSError *error) {
+
     }];
 }
 

+ 160 - 122
model/Classes/Controllers/Controller/MyProfileVC/ModelCardController.m

@@ -15,32 +15,35 @@
 #import <BRPickerView.h>
 #import "MySkillsController.h"
 #import "ShareCardController.h"
+#import "HobbyViewController.h"
 
-@interface ModelCardController ()<UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
+@interface ModelCardController () <UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
     ModelUser *tempUser;
 }
 
-@property (nonatomic, strong) UITableView *tableView;
-@property (nonatomic, strong) NSArray *titlesArr;
-@property (nonatomic, strong) NSArray *conentArr;
-
-@property (nonatomic, strong) UITableViewCell *nameCell;
-@property (nonatomic, strong) UITableViewCell *ageCell;
-@property (nonatomic, strong) UITableViewCell *heiCell;
-@property (nonatomic, strong) UITableViewCell *weiCell;
-@property (nonatomic, strong) UITableViewCell *waiBustHipCell; // 三围
-@property (nonatomic, strong) UITableViewCell *photoCell;
-@property (nonatomic, strong) UITableViewCell *areaCell; //地区(int类型,可空)
-@property (nonatomic, strong) UITableViewCell *occupationCell; //职业
-@property (nonatomic, strong) UITableViewCell *spdjCell;//视频单价
-@property (nonatomic, strong) UITableViewCell *fgbqCell;//风格标签
-@property (nonatomic, strong) UITableViewCell *lnameCell; //个性签名
-@property (nonatomic, strong) UITableViewCell *wdryCell; // 我的荣誉
-@property (nonatomic, strong) UITableViewCell *constellationCell; // 星座
-@property (nonatomic, strong) UITableViewCell *collegeCell; // 学校
-@property (nonatomic, strong) UITableViewCell *hobbyCell; // 爱好
-
-@property (nonatomic, strong) NSMutableArray *areaArray;
+@property(nonatomic, strong) UITableView *tableView;
+@property(nonatomic, strong) NSArray *titlesArr;
+@property(nonatomic, strong) NSArray *conentArr;
+
+@property(nonatomic, strong) UITableViewCell *nameCell;
+@property(nonatomic, strong) UITableViewCell *ageCell;
+@property(nonatomic, strong) UITableViewCell *heiCell;
+@property(nonatomic, strong) UITableViewCell *weiCell;
+@property(nonatomic, strong) UITableViewCell *waiBustHipCell; // 三围
+@property(nonatomic, strong) UITableViewCell *photoCell;
+@property(nonatomic, strong) UITableViewCell *areaCell; //地区(int类型,可空)
+@property(nonatomic, strong) UITableViewCell *occupationCell; //职业
+@property(nonatomic, strong) UITableViewCell *spdjCell;//视频单价
+@property(nonatomic, strong) UITableViewCell *fgbqCell;//风格标签
+@property(nonatomic, strong) UITableViewCell *lnameCell; //个性签名
+@property(nonatomic, strong) UITableViewCell *wdryCell; // 我的荣誉
+@property(nonatomic, strong) UITableViewCell *constellationCell; // 星座
+@property(nonatomic, strong) UITableViewCell *collegeCell; // 学校
+@property(nonatomic, strong) UITableViewCell *hobbyCell; // 爱好
+
+@property(nonatomic, strong) NSMutableArray *areaArray;
+@property(nonatomic, strong) NSArray *jobArray;
+@property(nonatomic, strong) NSArray *constellationArray;
 
 @end
 
@@ -48,35 +51,35 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    
+
     self.title = @"模卡资料";
-    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
     btn.frame = CGRectMake(0, 0, 40, 40);
     [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
-    btn.imageEdgeInsets =  UIEdgeInsetsMake(0, -20, 0, 0);
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
     [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
-    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
     self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
-    
+
     self.titlesArr = @[@[@"照片"],
-                       @[@"姓名"],
-                       @[@"个性签名"],
-                       @[@"视频单价"],
-                       @[@"身高",@"体重",@"三围",@"地区",@"年龄",@"职业",@"星座",@"毕业院校",@"兴趣爱好"],
-                       @[@"我的标签"],
-                       @[@"我的荣誉"]];
+            @[@"姓名"],
+            @[@"个性签名"],
+            @[@"视频单价"],
+            @[@"身高", @"体重", @"三围", @"地区", @"年龄", @"职业", @"星座", @"毕业院校", @"兴趣爱好"],
+            @[@"我的标签"],
+            @[@"我的荣誉"]];
     self.conentArr = @[@[@""],
-                       @[@""],
-                       @[@""],
-                       @[@""],
-                       @[@"",@"",@"",@"",@"",@"",@"",@"",@""],
-                       @[@""],
-                       @[@""]];
-    
+            @[@""],
+            @[@""],
+            @[@""],
+            @[@"", @"", @"", @"", @"", @"", @"", @"", @""],
+            @[@""],
+            @[@""]];
     self.areaArray = [NSMutableArray array];
+    self.jobArray = @[@"空姐", @"职业模特", @"白领", @"演员", @"护士", @"学生", @"老师", @"品酒师", @"其他"];
+    self.constellationArray = @[@"水瓶座", @"双鱼座", @"白羊座", @"金牛座", @"双子座", @"巨蟹座", @"狮子座", @"处女座", @"天秤座", @"天蝎座", @"射手座", @"魔蝎座"];
 
-    
     UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 10)];
     headerView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
     //
@@ -84,11 +87,11 @@
     footerView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
     UIButton *bindingBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     bindingBtn.frame = CGRectMake(20, 39, ScreenWidth - 40, 44);
-    
-    bindingBtn.layer.backgroundColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:1].CGColor;
+
+    bindingBtn.layer.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:1].CGColor;
     bindingBtn.layer.cornerRadius = 22;
-    bindingBtn.layer.shadowColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:0.36].CGColor;
-    bindingBtn.layer.shadowOffset = CGSizeMake(0,8);
+    bindingBtn.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
+    bindingBtn.layer.shadowOffset = CGSizeMake(0, 8);
     bindingBtn.layer.shadowOpacity = 1;
     bindingBtn.layer.shadowRadius = 10;
     if ([@"init" isEqualToString:self.type]) {
@@ -100,7 +103,7 @@
     [bindingBtn setTitleColor:RGBValueColor(0xffffff, 1.0) forState:UIControlStateNormal];
     [bindingBtn addTarget:self action:@selector(bindingBtnAction) forControlEvents:UIControlEventTouchUpInside];
     [footerView addSubview:bindingBtn];
-    
+
     self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight) style:UITableViewStylePlain];
     //    self.tableView.scrollEnabled = NO;
     self.tableView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
@@ -111,7 +114,7 @@
     self.tableView.tableHeaderView = headerView;
     self.tableView.tableFooterView = footerView;
     [self.view addSubview:self.tableView];
-    self.view.backgroundColor = [UIColor colorWithRed:242/255.0 green:244/255.0 blue:245/255.0 alpha:1];
+    self.view.backgroundColor = [UIColor colorWithRed:242 / 255.0 green:244 / 255.0 blue:245 / 255.0 alpha:1];
     [self getAreaData];
 }
 
@@ -137,18 +140,18 @@
     [YanCNetWorkManager requestGETWithURLStr:Url_getArea(PublicUrl) parameters:@{} finish:^(id dataDic) {
         [self.areaArray addObjectsFromArray:dataDic[@"data"]];
         [self.tableView reloadData];
-    } enError:^(NSError *error) {
-        
+    }                                enError:^(NSError *error) {
+
     }];
 }
 
 - (void)getModelData {
-    [YanCNetWorkManager requestGETWithURLStr:Url_getModelData(PublicUrl) parameters:@{@"modelpk":[ModelUser user].modelpk} finish:^(id dataDic) {
+    [YanCNetWorkManager requestGETWithURLStr:Url_getModelData(PublicUrl) parameters:@{@"modelpk": [ModelUser user].modelpk} finish:^(id dataDic) {
         [[ModelUser modelUser] setValuesForKeysWithDictionary:[dataDic[@"data"] firstObject]];
         tempUser = [ModelUser mj_objectWithKeyValues:[dataDic[@"data"] firstObject]];
         [self.tableView reloadData];
-    } enError:^(NSError *error) {
-        
+    }                                enError:^(NSError *error) {
+
     }];
 }
 
@@ -157,19 +160,20 @@
 }
 
 #pragma mark -- UITableViewDelegate, UITableViewDataSource
--(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return self.titlesArr.count;
 }
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return ((NSDictionary*)self.titlesArr[section]).count;
+    return ((NSDictionary *) self.titlesArr[section]).count;
 }
 
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-    static NSString *reuseIdentifier=@"cellID";
+    static NSString *reuseIdentifier = @"cellID";
     UITableViewCell *modelCell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
     if (modelCell == nil) {
-        modelCell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
+        modelCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
     }
     modelCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
     modelCell.selectionStyle = UITableViewCellSelectionStyleNone;
@@ -178,11 +182,11 @@
     modelCell.textLabel.font = [UIFont systemFontOfSize:14.0];
     modelCell.detailTextLabel.font = [UIFont systemFontOfSize:14.0];
     modelCell.textLabel.text = self.titlesArr[indexPath.section][indexPath.row];
-    
+
     NSString *rowTitle = self.titlesArr[indexPath.section][indexPath.row];
     if ([@"照片" isEqualToString:rowTitle]) {
         self.photoCell = modelCell;
-        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@张照片",tempUser.photocount];
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@张照片", tempUser.photocount];
     } else if ([@"姓名" isEqualToString:rowTitle]) {
         self.nameCell = modelCell;
         modelCell.detailTextLabel.text = tempUser.pet;
@@ -191,16 +195,16 @@
         modelCell.detailTextLabel.text = tempUser.lname;
     } else if ([@"视频单价" isEqualToString:rowTitle]) {
         self.spdjCell = modelCell;
-        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@元/分钟",tempUser.vprice];
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@元/分钟", tempUser.vprice];
     } else if ([@"身高" isEqualToString:rowTitle]) {
         self.heiCell = modelCell;
-        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@cm",tempUser.hei];
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@cm", tempUser.hei];
     } else if ([@"体重" isEqualToString:rowTitle]) {
         self.weiCell = modelCell;
-        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@kg",tempUser.wei];
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@kg", tempUser.wei];
     } else if ([@"三围" isEqualToString:rowTitle]) {
         self.waiBustHipCell = modelCell;
-        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@/%@/%@",tempUser.bust,tempUser.wai,tempUser.hip];
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@/%@/%@", tempUser.bust, tempUser.wai, tempUser.hip];
     } else if ([@"地区" isEqualToString:rowTitle]) {
         self.areaCell = modelCell;
         modelCell.detailTextLabel.text = @"";
@@ -276,7 +280,7 @@
             for (NSDictionary *dic in self.areaArray) {
                 if ([dic[@"name"] isEqualToString:selectValue]) {
                     [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
-                                                   parameters:@{@"area":dic[@"pk"],@"modelpk":[ModelUser user].modelpk}
+                                                   parameters:@{@"area": dic[@"pk"], @"modelpk": [ModelUser user].modelpk}
                                                        finish:^(id dataDic) {
                                                            if ([dataDic[@"msg"] isEqualToString:@"success"]) {
                                                                [MBProgressHUD showSuccess:@"修改成功"];
@@ -284,10 +288,10 @@
                                                            } else {
                                                                [MBProgressHUD showError:@"修改失败"];
                                                            }
-                                                           
+
                                                        }
                                                       enError:^(NSError *error) {
-                                                          
+
                                                       }];
                 }
             }
@@ -297,21 +301,51 @@
         infoVc.editType = InfoEditTypeAge;
         [self.navigationController pushViewController:infoVc animated:YES];
     } else if ([@"职业" isEqualToString:rowTitle]) {
-        InfoEditViewController *infoVc = [InfoEditViewController new];
-        infoVc.editType = InfoEditTypeOccupation;
-        [self.navigationController pushViewController:infoVc animated:YES];
+        // InfoEditViewController *infoVc = [InfoEditViewController new];
+        // infoVc.editType = InfoEditTypeOccupation;
+        // [self.navigationController pushViewController:infoVc animated:YES];
+        [BRStringPickerView showStringPickerWithTitle:@"请选择职业" dataSource:self.jobArray defaultSelValue:nil resultBlock:^(id selectValue) {
+            [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
+                                           parameters:@{@"occupation": selectValue, @"modelpk": [ModelUser user].modelpk}
+                                               finish:^(id dataDic) {
+                                                   if ([dataDic[@"msg"] isEqualToString:@"success"]) {
+                                                       [MBProgressHUD showSuccess:@"修改成功"];
+                                                       cell.detailTextLabel.text = selectValue;
+                                                   } else {
+                                                       [MBProgressHUD showError:@"修改失败"];
+                                                   }
+
+                                               }
+                                              enError:^(NSError *error) {
+
+                                              }];
+        }];
     } else if ([@"星座" isEqualToString:rowTitle]) {
-        InfoEditViewController *infoVc = [InfoEditViewController new];
-        infoVc.editType = InfoEditTypeConstellation;
-        [self.navigationController pushViewController:infoVc animated:YES];
+        // InfoEditViewController *infoVc = [InfoEditViewController new];
+        // infoVc.editType = InfoEditTypeConstellation;
+        // [self.navigationController pushViewController:infoVc animated:YES];
+        [BRStringPickerView showStringPickerWithTitle:@"请选择星座" dataSource:self.constellationArray defaultSelValue:nil resultBlock:^(id selectValue) {
+            [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
+                                           parameters:@{@"constellation": selectValue, @"modelpk": [ModelUser user].modelpk}
+                                               finish:^(id dataDic) {
+                                                   if ([dataDic[@"msg"] isEqualToString:@"success"]) {
+                                                       [MBProgressHUD showSuccess:@"修改成功"];
+                                                       cell.detailTextLabel.text = selectValue;
+                                                   } else {
+                                                       [MBProgressHUD showError:@"修改失败"];
+                                                   }
+                                               }
+                                              enError:^(NSError *error) {
+
+                                              }];
+        }];
     } else if ([@"毕业院校" isEqualToString:rowTitle]) {
         InfoEditViewController *infoVc = [InfoEditViewController new];
         infoVc.editType = InfoEditTypeCollege;
         [self.navigationController pushViewController:infoVc animated:YES];
     } else if ([@"兴趣爱好" isEqualToString:rowTitle]) {
-        InfoEditViewController *infoVc = [InfoEditViewController new];
-        infoVc.editType = InfoEditTypeHobby;
-        [self.navigationController pushViewController:infoVc animated:YES];
+        HobbyViewController *hobbyVC = [[HobbyViewController alloc] init];
+        [self.navigationController pushViewController:hobbyVC animated:YES];
     } else if ([@"我的标签" isEqualToString:rowTitle]) {
         ModelTagViewController *tagVC = [ModelTagViewController new];
         [self.navigationController pushViewController:tagVC animated:YES];
@@ -322,57 +356,59 @@
 }
 
 #pragma mark -- 保存按钮
+
 - (void)bindingBtnAction {
-    NSLog(@"name %@", self.nameCell.textLabel.text);
-    if (self.nameCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写姓名" controller:self];
+    if ([tempUser.photocount intValue] < 5) {
+        [self.view makeToast:@"请至少上传5张照片" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"age %@", self.ageCell.textLabel.text);
-    if (self.ageCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写年龄" controller:self];
+    if (tempUser.pet.length == 0) {
+        [self.view makeToast:@"请填写姓名" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"heiCell %@", self.heiCell.textLabel.text);
-    if (self.heiCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写身高" controller:self];
+    if (tempUser.lname.length == 0) {
+        [self.view makeToast:@"请填写个性签名" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"体重 %@", self.weiCell.textLabel.text);
-    if (self.weiCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写体重" controller:self];
+    if (tempUser.vprice.length == 0) {
+        [self.view makeToast:@"请填写视频单价" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"三围 %@", self.nameCell.textLabel.text);
-    if (self.nameCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写三围" controller:self];
+    if (tempUser.hei.length == 0 || [@"0" isEqualToString:tempUser.hei]) {
+        [self.view makeToast:@"请填写身高" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"地区 %@", self.areaCell.textLabel.text);
-    if (self.areaCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写地区" controller:self];
+    if (tempUser.wei.length == 0 || [@"0" isEqualToString:tempUser.wei]) {
+        [self.view makeToast:@"请填写体重" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    if (![[ModelUser user].modelpk isEqualToString:@"51"]) {
-        NSLog(@"视频单价 %@", self.spdjCell.textLabel.text);
-        if (self.spdjCell.textLabel.text.length == 0) {
-            [MBProgressHUD showOnlyText:@"请选择填写视频单价" controller:self];
-            return;
-        }
+    if (tempUser.bust.length == 0) {
+        [self.view makeToast:@"请填写三围" duration:2.0 position:CSToastPositionCenter];
+        return;
     }
-    NSLog(@"风格标签 %@", self.fgbqCell.textLabel.text);
-    if (self.fgbqCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写标签" controller:self];
+    if (tempUser.area.length == 0) {
+        [self.view makeToast:@"请填写地区" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"个人签名 %@", self.lnameCell.textLabel.text);
-    if (self.lnameCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写签名" controller:self];
+    if (tempUser.age.length == 0) {
+        [self.view makeToast:@"请填写年龄" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-//    [MBProgressHUD showSuccess:@"保存成功"];
-//    [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
-    
+    if (tempUser.occupation.length == 0) {
+        [self.view makeToast:@"请填写职业" duration:2.0 position:CSToastPositionCenter];
+        return;
+    }
+    if (tempUser.constellation.length == 0) {
+        [self.view makeToast:@"请填写星座" duration:2.0 position:CSToastPositionCenter];
+        return;
+    }
+    if (tempUser.college.length == 0) {
+        [self.view makeToast:@"请填写毕业院校" duration:2.0 position:CSToastPositionCenter];
+        return;
+    }
+    // [MBProgressHUD showSuccess:@"保存成功"];
+    // [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
+
     if ([@"init" isEqualToString:self.type]) {
         MySkillsController *mySkillsVC = [[MySkillsController alloc] init];
         [self.navigationController pushViewController:mySkillsVC animated:YES];
@@ -383,24 +419,26 @@
 }
 
 #pragma mark -- 网络请求
+
 - (void)postDataFromNetworking {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     ModelUser *modelUser = [ModelUser user];
-    
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:modelUser.modelpk,@"modelpk",self.lnameCell.textLabel.text,@"lname", nil];
-    
-    [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl) parameters:dic finish:^(id dataDic) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-
-        NSString *issuccess = dataDic[@"msg"];
-        if ([issuccess isEqualToString:@"success"]) {
-           [MBProgressHUD showSuccess:@"保存成功"];
-        } else {
-    
-        }
-    } enError:^(NSError *error) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-    }];
+    NSDictionary *dic = @{@"modelpk": modelUser.modelpk, @"lname": self.lnameCell.textLabel.text};
+    [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
+                                   parameters:dic
+                                       finish:^(id dataDic) {
+                                           [MBProgressHUD hideHUDForView:self.view animated:YES];
+
+                                           NSString *issuccess = dataDic[@"msg"];
+                                           if ([issuccess isEqualToString:@"success"]) {
+                                               [MBProgressHUD showSuccess:@"保存成功"];
+                                           } else {
+
+                                           }
+                                       }
+                                      enError:^(NSError *error) {
+                                          [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                      }];
 }
 
 @end

+ 35 - 34
model/Classes/Controllers/Controller/MyProfileVC/ModelTagViewController.m

@@ -9,17 +9,18 @@
 #import "ModelTagViewController.h"
 #import "TagCollectionViewCell.h"
 #import <TTGTagCollectionView/TTGTagCollectionView.h>
-@interface ModelTagViewController ()<TTGTagCollectionViewDelegate, TTGTagCollectionViewDataSource>
 
-@property (nonatomic, strong) UILabel *infoLabel;
+@interface ModelTagViewController () <TTGTagCollectionViewDelegate, TTGTagCollectionViewDataSource>
 
-@property (nonatomic, strong) TTGTagCollectionView *listTagView;
+@property(nonatomic, strong) UILabel *infoLabel;
 
-@property (nonatomic, strong) NSMutableArray *dataSource;
+@property(nonatomic, strong) TTGTagCollectionView *listTagView;
 
-@property (strong, nonatomic) NSMutableArray <UIView *> *tagViews;
+@property(nonatomic, strong) NSMutableArray *dataSource;
 
-@property (nonatomic, strong) NSMutableArray *selectTag;
+@property(strong, nonatomic) NSMutableArray <UIView *> *tagViews;
+
+@property(nonatomic, strong) NSMutableArray *selectTag;
 
 
 @end
@@ -27,13 +28,13 @@
 @implementation ModelTagViewController
 
 - (void)viewDidLoad {
-    
+
     [super viewDidLoad];
     [self configUI];
     [self requestModelStyle];
 }
 
-- (void) configUI {
+- (void)configUI {
     self.view.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
     self.title = @"风格标签";
     self.navigationController.navigationBar.tintColor = RGBValueColor(0x333333, 1);
@@ -43,10 +44,10 @@
     self.infoLabel.text = @"选择符合你的风格标签 (至多选择3个)";
     self.infoLabel.textColor = RGBValueColor(0x666666, 1);
     [self.view addSubview:self.infoLabel];
-    
+
     self.listTagView = [[TTGTagCollectionView alloc] initWithFrame:CGRectMake(20, 60, ScreenWidth - 40, ScreenHeight - 60)];
     self.listTagView.delegate = self;
-    self.listTagView.dataSource =  self;
+    self.listTagView.dataSource = self;
     self.listTagView.verticalSpacing = 10;
     self.listTagView.horizontalSpacing = 15;
     [self.view addSubview:self.listTagView];
@@ -54,42 +55,42 @@
 }
 
 - (void)requestModelStyle {
-    
-    [YanCNetWorkManager requestGETWithURLStr:URl_getModelStyle(PublicUrl) parameters:@{@"modelpk":[ModelUser user].modelpk} finish:^(id dataDic) {
+
+    [YanCNetWorkManager requestGETWithURLStr:URl_getModelStyle(PublicUrl) parameters:@{@"modelpk": [ModelUser user].modelpk} finish:^(id dataDic) {
         for (NSDictionary *dic in dataDic[@"data"]) {
             TagStyleModel *model = [TagStyleModel mj_objectWithKeyValues:dic];
             [self.selectTag addObject:model.pk];
         }
         [self requestData];
-    } enError:^(NSError *error) {
-        
+    }                                enError:^(NSError *error) {
+
     }];
 }
 
 - (void)requestData {
-    
+
     [YanCNetWorkManager requestGETWithURLStr:Url_getStyle(PublicUrl) parameters:@{} finish:^(id dataDic) {
         for (NSDictionary *dic in dataDic[@"data"]) {
             TagStyleModel *model = [TagStyleModel mj_objectWithKeyValues:dic];
             [_tagViews addObject:[self newButtonWithTitle:model]];
             [self.dataSource addObject:model];
         }
-       [self.listTagView reload];
-       
-    } enError:^(NSError *error) {
-        
+        [self.listTagView reload];
+
+    }                                enError:^(NSError *error) {
+
     }];
 }
 
 #pragma mark - TTGTagCollectionViewDelegate
 
 - (CGSize)tagCollectionView:(TTGTagCollectionView *)tagCollectionView sizeForTagAtIndex:(NSUInteger)index {
-  
+
     return _tagViews[index].frame.size;
 }
 
 - (void)tagCollectionView:(TTGTagCollectionView *)tagCollectionView didSelectTag:(UIView *)tagView atIndex:(NSUInteger)index {
-    
+
 }
 
 - (BOOL)tagCollectionView:(TTGTagCollectionView *)tagCollectionView shouldSelectTag:(UIView *)tagView atIndex:(NSUInteger)index {
@@ -99,18 +100,18 @@
 #pragma mark - TTGTagCollectionViewDataSource
 
 - (NSUInteger)numberOfTagsInTagCollectionView:(TTGTagCollectionView *)tagCollectionView {
- 
+
     return _tagViews.count;
 }
 
 - (UIView *)tagCollectionView:(TTGTagCollectionView *)tagCollectionView tagViewForIndex:(NSUInteger)index {
-   
+
     return _tagViews[index];
 }
 
 #pragma mark - Private methods
 
-- (UIButton *)newButtonWithTitle:(TagStyleModel *)title  {
+- (UIButton *)newButtonWithTitle:(TagStyleModel *)title {
     UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
     UIColor *selectColor = [[self randomColors] objectAtIndex:arc4random() % 12];
     button.titleLabel.font = [UIFont systemFontOfSize:14];
@@ -122,7 +123,7 @@
     [button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
     button.layer.borderWidth = 1.f;
     button.layer.borderColor = selectColor.CGColor;
-  
+
     for (NSString *pk in self.selectTag) {
         if ([pk isEqualToString:title.pk]) {
             button.backgroundColor = button.titleLabel.textColor;
@@ -130,9 +131,9 @@
         }
     }
     [self expandSizeForView:button extraWidth:15 extraHeight:4];
-    
+
     [button addTarget:self action:@selector(onTap:) forControlEvents:UIControlEventTouchUpInside];
-    
+
     return button;
 }
 
@@ -160,17 +161,17 @@
     }
 }
 
-- (void)handleSave{
+- (void)handleSave {
     if (self.selectTag.count == 0) {
         [MBProgressHUD showOnlyText:@"最少选择一个"];
         return;
     }
-    [YanCNetWorkManager requestPostWithURLStr:Url_SetStyle(PublicUrl) parameters:@{@"modelpk":[ModelUser user].modelpk, @"stylepks":[self.selectTag componentsJoinedByString:@","]} finish:^(id dataDic) {
+    [YanCNetWorkManager requestPostWithURLStr:Url_SetStyle(PublicUrl) parameters:@{@"modelpk": [ModelUser user].modelpk, @"stylepks": [self.selectTag componentsJoinedByString:@","]} finish:^(id dataDic) {
         if ([dataDic[@"msg"] isEqualToString:@"success"]) {
             [self.navigationController popViewControllerAnimated:YES];
         }
-    } enError:^(NSError *error) {
-        
+    }                                 enError:^(NSError *error) {
+
     }];
 }
 
@@ -196,8 +197,8 @@
 /*
  Text自适应
  */
--(CGFloat)calculateSizeWithFont:(NSInteger)Font Text:(NSString *)Text{
-    NSDictionary *attr = @{NSFontAttributeName : [UIFont systemFontOfSize:Font]};
+- (CGFloat)calculateSizeWithFont:(NSInteger)Font Text:(NSString *)Text {
+    NSDictionary *attr = @{NSFontAttributeName: [UIFont systemFontOfSize:Font]};
     CGRect rect = [Text boundingRectWithSize:CGSizeMake(MAXFLOAT, 20)
                                      options:NSStringDrawingUsesLineFragmentOrigin
                                   attributes:attr
@@ -206,7 +207,7 @@
 }
 
 - (NSArray *)randomColors {
-    return @[RGBValueColor(0xfc7d77, 1),RGBValueColor(0x25e6b9, 1),RGBValueColor(0xd2adfb, 1),RGBValueColor(0xff9dbc, 1),RGBValueColor(0xff6b9e, 1),RGBValueColor(0x5cdee0, 1),RGBValueColor(0xf29a76, 1),RGBValueColor(0x49c9f0, 1),RGBValueColor(0xef87b4, 1),RGBValueColor(0xb3d465, 1),RGBValueColor(0xf8b551, 1),RGBValueColor(0xf80c269, 1)];
+    return @[RGBValueColor(0xfc7d77, 1), RGBValueColor(0x25e6b9, 1), RGBValueColor(0xd2adfb, 1), RGBValueColor(0xff9dbc, 1), RGBValueColor(0xff6b9e, 1), RGBValueColor(0x5cdee0, 1), RGBValueColor(0xf29a76, 1), RGBValueColor(0x49c9f0, 1), RGBValueColor(0xef87b4, 1), RGBValueColor(0xb3d465, 1), RGBValueColor(0xf8b551, 1), RGBValueColor(0xf80c269, 1)];
 }
 /*
 #pragma mark - Navigation

+ 65 - 61
model/Classes/Controllers/Controller/MyWalletVC/BindPhoneController.m

@@ -10,19 +10,18 @@
 #import "TableDefaultCell.h"
 #import "TableWithVerificationCodeCell.h"
 
-@interface BindPhoneController ()<UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate>
-{
+@interface BindPhoneController () <UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
     NSString *zhifubaoAccount;
     NSString *zhifubaoName;
     NSString *phoneNum;
     NSString *verifyCode;
     NSString *randomCode;
 }
-@property (nonatomic, strong) UITableView *tableView;
-@property (nonatomic, strong) TableDefaultCell *accountCell;
-@property (nonatomic, strong) TableDefaultCell *nameCell;
-@property (nonatomic, strong) TableDefaultCell *phoneCell;
-@property (nonatomic, strong) TableWithVerificationCodeCell *verificationCodeCell;
+@property(nonatomic, strong) UITableView *tableView;
+@property(nonatomic, strong) TableDefaultCell *accountCell;
+@property(nonatomic, strong) TableDefaultCell *nameCell;
+@property(nonatomic, strong) TableDefaultCell *phoneCell;
+@property(nonatomic, strong) TableWithVerificationCodeCell *verificationCodeCell;
 @end
 
 @implementation BindPhoneController
@@ -43,7 +42,8 @@
 }
 
 #pragma mark -- 收起键盘
--(void)keyboardHide:(UITapGestureRecognizer*)tap{
+
+- (void)keyboardHide:(UITapGestureRecognizer *)tap {
     [self.view endEditing:YES];
 }
 
@@ -55,14 +55,14 @@
 - (void)creatNavBar {
     self.title = @"绑定手机";
     //
-    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
     btn.frame = CGRectMake(0, 0, 40, 40);
     [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
-    btn.imageEdgeInsets =  UIEdgeInsetsMake(0, -20, 0, 0);
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
     [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
-    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
-    
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+
     //    nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整
     self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
 }
@@ -72,11 +72,11 @@
 }
 
 - (void)creatSubViews {
-    
+
     //
     UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 16)];
     headerView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
-    
+
     //
     UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - 220)];
     footerView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
@@ -152,41 +152,43 @@
 }
 
 #pragma mark -- 绑定按钮
+
 - (void)bindingBtnAction {
-    
+
     if (zhifubaoAccount.length == 0) {
         [MBProgressHUD showInfo:@"请输入支付宝账户"];
         return;
     }
-    
+
     if (zhifubaoName.length == 0) {
         [MBProgressHUD showInfo:@"请输入账户姓名"];
         return;
     }
-    
+
     if (phoneNum.length == 0) {
         [MBProgressHUD showInfo:@"请填写正确的手机号"];
         return;
     }
-    
+
     if (verifyCode.length == 0 || ![verifyCode isEqualToString:randomCode]) {
         [MBProgressHUD showInfo:@"请填写正确的验证码"];
         return;
     }
-    
+
     [self postBindingRequestToNetworking];
 }
 
 #pragma mark -- 网络请求
--(void)postBindingRequestToNetworking{
-    
+
+- (void)postBindingRequestToNetworking {
+
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     ModelUser *modelUser = [ModelUser user];
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:modelUser.modelpk,@"modelpk",zhifubaoAccount,@"alipayid",zhifubaoName,@"name", nil];
-    
+    NSDictionary *dic = @{@"modelpk": modelUser.modelpk, @"alipayid": zhifubaoAccount, @"name": zhifubaoName};
+
     [YanCNetWorkManager requestPostWithURLStr:Url_alipayoutcashmodify(PublicUrl) parameters:dic finish:^(id dataDic) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
-        
+
         NSString *issuccess = dataDic[@"msg"];
         if ([issuccess isEqualToString:@"success"]) {
             [MBProgressHUD showSuccess:@"绑定成功"];
@@ -194,72 +196,73 @@
         } else {
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
 
 
 #pragma mark -- 倒计时
+
 - (void)codeBtnAction {
-    
+
     if ([Helper valiMobile:phoneNum]) {
         [self getVerifyCode];
         [self startCountdownAction];
-    }else{
+    } else {
         [MBProgressHUD showInfo:@"请填写正确的手机号"];
     }
 }
 
--(void)getVerifyCode{
+- (void)getVerifyCode {
     NSString *sn = @"SDK-FHD-010-00328";
     //NSString *md5Pwd = [MD5String md5String:[NSString stringWithFormat:@"%@%@",sn,password]];
     NSString *Md5Pwd = @"54774CB6E781A142206F756B3E18142C";
     int a = arc4random() % 100000;
-    
+
     randomCode = [NSString stringWithFormat:@"%06d", a];
-    
-    NSString *content = [NSString stringWithFormat:@"【千模科技】您正在进行提现账号绑定,验证码%@,5分钟内有效。请勿泄露。来千模多挣钱,有钱日子天天过年。非本人操作,请勿理会。",randomCode];
-    
-    NSString *str = [NSString stringWithFormat:@"http://sdk.entinfo.cn:8061/mdsmssend.ashx?sn=%@&pwd=%@&mobile=%@&content=%@&ext=&stime=&rrid=&msgfmt=",sn,Md5Pwd,phoneNum,content];
-    
-    AFHTTPSessionManager *manager =[AFHTTPSessionManager manager];
+
+    NSString *content = [NSString stringWithFormat:@"【千模科技】您正在进行提现账号绑定,验证码%@,5分钟内有效。请勿泄露。来千模多挣钱,有钱日子天天过年。非本人操作,请勿理会。", randomCode];
+
+    NSString *str = [NSString stringWithFormat:@"http://sdk.entinfo.cn:8061/mdsmssend.ashx?sn=%@&pwd=%@&mobile=%@&content=%@&ext=&stime=&rrid=&msgfmt=", sn, Md5Pwd, phoneNum, content];
+
+    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
     manager.responseSerializer = [AFHTTPResponseSerializer serializer];
     [manager GET:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
-        NSString *result = [[NSString alloc]initWithData:responseObject encoding:NSUTF8StringEncoding];
-        
-        NSLog(@"%@",result);
-    } failure:^(NSURLSessionDataTask *task, NSError *error) {
-        NSLog(@"%@",error);
+        NSString *result = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
+
+        NSLog(@"%@", result);
+    }    failure:^(NSURLSessionDataTask *task, NSError *error) {
+        NSLog(@"%@", error);
     }];
 }
 
 //获取验证码按钮开始倒计时响应事件
-- (void)startCountdownAction{
+- (void)startCountdownAction {
     __block int timeout = 60;//倒计时时间
-    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0);
-    dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER,0, 0,queue);
-    dispatch_source_set_timer(_timer,dispatch_walltime(NULL,0),1.0*NSEC_PER_SEC,0); //每秒执行
+    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
+    dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
+    dispatch_source_set_timer(_timer, dispatch_walltime(NULL, 0), 1.0 * NSEC_PER_SEC, 0); //每秒执行
     dispatch_source_set_event_handler(_timer, ^{
-        if(timeout <= 1){//倒计时结束,关闭
+        if (timeout <= 1) {//倒计时结束,关闭
             dispatch_source_cancel(_timer);
             dispatch_async(dispatch_get_main_queue(), ^{
                 //设置界面的按钮显示根据自己需求设置
-                [self.verificationCodeCell.codeBtn setTitle:@"重新获取"forState:UIControlStateNormal];
+                [self.verificationCodeCell.codeBtn setTitle:@"重新获取" forState:UIControlStateNormal];
                 self.verificationCodeCell.codeBtn.userInteractionEnabled = YES;
             });
-        }else{
+        } else {
             int seconds = timeout;
             NSString *strTime = [NSString stringWithFormat:@"%.2d", seconds];
             dispatch_async(dispatch_get_main_queue(), ^{
                 //让按钮变为不可点击的灰色
                 //并且关掉按钮的交互
-                
+
                 self.verificationCodeCell.codeBtn.userInteractionEnabled = NO;
                 //设置界面的按钮显示根据自己需求设置
                 [UIView beginAnimations:nil context:nil];
                 [UIView setAnimationDuration:1];
-                [self.verificationCodeCell.codeBtn setTitle:[NSString stringWithFormat:@"%@s",strTime]forState:UIControlStateNormal];
+                [self.verificationCodeCell.codeBtn setTitle:[NSString stringWithFormat:@"%@s", strTime] forState:UIControlStateNormal];
                 [UIView commitAnimations];
             });
             timeout--;
@@ -269,29 +272,30 @@
 }
 
 #pragma mark -- UITextFieldDelegate
-- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
-    
-    if([textField viewWithTag:1002]){
-        if(string.length > 0 && (![NSString amtchString:string checkString:@"[0-9]"]||[textField.text length]==11)){
+
+- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
+
+    if ([textField viewWithTag:1002]) {
+        if (string.length > 0 && (![NSString amtchString:string checkString:@"[0-9]"] || [textField.text length] == 11)) {
             return NO;
         }
-    } else if([textField viewWithTag:1003]) {
-        if(string.length > 0 && [textField.text length] == 6){
+    } else if ([textField viewWithTag:1003]) {
+        if (string.length > 0 && [textField.text length] == 6) {
             return NO;
         }
     }
     return YES;
 }
 
-- (void)textFieldDidEndEditing:(UITextField *)textField{
-    
-    if([textField viewWithTag:1000]){
+- (void)textFieldDidEndEditing:(UITextField *)textField {
+
+    if ([textField viewWithTag:1000]) {
         zhifubaoAccount = textField.text;
-    }else if ([textField viewWithTag:1001]){
+    } else if ([textField viewWithTag:1001]) {
         zhifubaoName = textField.text;
-    }else if ([textField viewWithTag:1002]){
+    } else if ([textField viewWithTag:1002]) {
         phoneNum = textField.text;
-    }else if ([textField viewWithTag:1003]){
+    } else if ([textField viewWithTag:1003]) {
         verifyCode = textField.text;
     }
 }

+ 3 - 2
model/Classes/Controllers/Controller/MyWalletVC/MyWalletController.m

@@ -11,6 +11,7 @@
 #import "IncreaseBalanceController.h"
 #import "WalletDetailsController.h"
 #import "MyWalletCell.h"
+#import "WithdrawController.h"
 
 @interface MyWalletController ()<UITableViewDelegate, UITableViewDataSource>
 @property (nonatomic, strong) UITableView *tableView;
@@ -165,8 +166,8 @@
     
     if (indexPath.section == 0) {
         //  提现
-        WithdrawalController *withdrawalVC = [[WithdrawalController alloc] init];
-        withdrawalVC.passBackAmount = ^(NSString *string) {
+        WithdrawController *withdrawalVC = [[WithdrawController alloc] init];
+        withdrawalVC.callback = ^(NSString *string) {
             self.amount = string;
             NSString *str = [NSString stringWithFormat:@"%@元",self.amount];
             NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:str];

+ 19 - 0
model/Classes/Controllers/Controller/MyWalletVC/WithdrawController.h

@@ -0,0 +1,19 @@
+//
+//  WithdrawController.h
+//  千模
+//
+//  Created by Drew on 2018/11/4.
+//  Copyright © 2018年 MUMEI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef void(^callback)(NSString *string);
+
+@interface WithdrawController : UIViewController
+@property(nonatomic, copy) callback callback;
+@end
+
+NS_ASSUME_NONNULL_END

+ 270 - 0
model/Classes/Controllers/Controller/MyWalletVC/WithdrawController.m

@@ -0,0 +1,270 @@
+//
+//  WithdrawController.m
+//  千模
+//
+//  Created by Drew on 2018/11/4.
+//  Copyright © 2018年 MUMEI. All rights reserved.
+//
+
+#import "WithdrawController.h"
+#import "BindPhoneController.h"
+
+@interface WithdrawController () <UITextFieldDelegate> {
+    NSString *amount;
+    NSString *useAmount;
+    NSString *name;
+    NSString *account;
+}
+@property(weak, nonatomic) IBOutlet UILabel *labelName;
+@property(weak, nonatomic) IBOutlet UILabel *labelAccount;
+@property(weak, nonatomic) IBOutlet UITextField *tfAmount;
+@property(weak, nonatomic) IBOutlet UILabel *labelAvailable;
+@property(weak, nonatomic) IBOutlet UIButton *btnSubmit;
+@property(weak, nonatomic) IBOutlet UIView *successView;
+@property(weak, nonatomic) IBOutlet UIButton *btnBack;
+
+@end
+
+@implementation WithdrawController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
+    btn.frame = CGRectMake(0, 0, 40, 40);
+    [btn setImage:[UIImage imageNamed:@"backBtn"] forState:UIControlStateNormal];
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
+    [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
+    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+    nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整
+    self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
+    self.navigationItem.title = @"申请提现";
+
+    self.btnSubmit.layer.cornerRadius = 22;
+    self.btnSubmit.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
+    self.btnSubmit.layer.shadowOffset = CGSizeMake(0, 8);
+    self.btnSubmit.layer.shadowOpacity = 1;
+    self.btnSubmit.layer.shadowRadius = 10;
+
+    self.btnBack.layer.cornerRadius = 22;
+    self.btnBack.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
+    self.btnBack.layer.shadowOffset = CGSizeMake(0, 8);
+    self.btnBack.layer.shadowOpacity = 1;
+    self.btnBack.layer.shadowRadius = 10;
+
+    self.tfAmount.delegate = self;
+    useAmount = @"0";
+
+    self.labelName.text = @"去绑定";
+    self.labelName.font = [UIFont systemFontOfSize:14];
+    self.labelName.textColor = [UIColor colorWithHexString:@"#AAACAD"];
+
+    self.labelAccount.text = @"去绑定";
+    self.labelAccount.font = [UIFont systemFontOfSize:14];
+    self.labelAccount.textColor = [UIColor colorWithHexString:@"#AAACAD"];
+
+    NSString *holderStr3 = @"请输入提现金额";
+    NSMutableAttributedString *placeholder3 = [[NSMutableAttributedString alloc] initWithString:holderStr3];
+    [placeholder3 addAttribute:NSFontAttributeName
+                         value:[UIFont systemFontOfSize:14]
+                         range:NSMakeRange(0, holderStr3.length)];
+    self.tfAmount.attributedPlaceholder = placeholder3;
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
+    [self.navigationController.navigationBar setShadowImage:[UIImage new]];
+    [self getDataFromNetworking];
+}
+
+- (void)viewWillDisappear:(BOOL)animated {
+    [super viewWillDisappear:animated];
+    [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
+    [self.navigationController.navigationBar setShadowImage:nil];
+}
+
+- (void)updateUI {
+    self.labelAvailable.text = [NSString stringWithFormat:@"最多可提现%@元", useAmount];
+    if (name.length > 0 && account.length > 0) {
+        self.labelName.text = name;
+        self.labelName.font = [UIFont systemFontOfSize:16];
+        self.labelName.textColor = [UIColor blackColor];
+        self.labelAccount.text = account;
+        self.labelAccount.font = [UIFont systemFontOfSize:16];
+        self.labelAccount.textColor = [UIColor blackColor];
+    } else {
+        self.labelName.text = @"去绑定";
+        self.labelName.font = [UIFont systemFontOfSize:14];
+        self.labelName.textColor = [UIColor colorWithHexString:@"#AAACAD"];
+        self.labelAccount.text = @"去绑定";
+        self.labelAccount.font = [UIFont systemFontOfSize:14];
+        self.labelAccount.textColor = [UIColor colorWithHexString:@"#AAACAD"];
+       }
+}
+
+- (void)backClick {
+    if (self.callback) {
+        self.callback(amount);
+    }
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+- (IBAction)bindAlipay:(id)sender {
+    BindPhoneController *bindPhoneVC = [[BindPhoneController alloc] init];
+    [self.navigationController pushViewController:bindPhoneVC animated:YES];
+}
+
+- (void)getDataFromNetworking {
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    ModelUser *modelUser = [ModelUser user];
+    NSDictionary *dic = @{@"modelpk": modelUser.modelpk};
+
+    [YanCNetWorkManager requestPostWithURLStr:Url_alipayoutcashload(PublicUrl)
+                                   parameters:dic
+                                       finish:^(id dataDic) {
+                                           [MBProgressHUD hideHUDForView:self.view animated:YES];
+
+                                           NSString *issuccess = dataDic[@"msg"];
+                                           if ([issuccess isEqualToString:@"success"]) {
+                                               NSDictionary *data = dataDic[@"data"];
+                                               amount = data[@"coin_a"];
+                                               useAmount = data[@"coin_use"];
+                                               name = data[@"name"];
+                                               account = data[@"alipayid"];
+
+                                               [self updateUI];
+
+                                           } else {
+                                               [MBProgressHUD showInfo:@"请求失败!"];
+                                           }
+                                       }
+                                      enError:^(NSError *error) {
+                                          [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                      }];
+}
+
+- (IBAction)back:(id)sender {
+    [self backClick];
+}
+
+- (IBAction)submit:(id)sender {
+    NSString *fee = self.tfAmount.text;
+    if (name.length == 0) {
+        [MBProgressHUD showInfo:@"请先绑定提现账号"];
+        return;
+    }
+    if (account.length == 0) {
+        [MBProgressHUD showInfo:@"请先绑定提现账号"];
+        return;
+    }
+    if (fee.length == 0) {
+        [MBProgressHUD showInfo:@"请输入提现金额"];
+        return;
+    }
+    NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:fee];
+    if ([number doubleValue] <= 0) {
+        [MBProgressHUD showInfo:@"请输入正确的金额"];
+        return;
+    }
+    if ([number doubleValue] > [useAmount doubleValue]) {
+        [MBProgressHUD showInfo:[NSString stringWithFormat:@"最多可提现%@元", useAmount]];
+        return;
+    }
+    NSDictionary *dic = @{@"modelpk": [ModelUser user].modelpk, @"fee": fee};
+    [YanCNetWorkManager requestPostWithURLStr:Url_alipayoutcash(PublicUrl)
+                                   parameters:dic
+                                       finish:^(id dataDic) {
+                                           [MBProgressHUD hideHUDForView:self.view animated:YES];
+
+                                           NSString *issuccess = dataDic[@"msg"];
+                                           if ([issuccess isEqualToString:@"success"]) {
+                                               NSDictionary *data = dataDic[@"data"];
+                                               amount = data[@"coin_a"];
+                                               useAmount = data[@"coin_use"];
+                                               name = data[@"name"];
+                                               account = data[@"alipayid"];
+                                               [self updateUI];
+                                               self.tfAmount.text = @"";
+                                               self.successView.hidden = NO;
+                                           } else {
+                                               [self.view makeToast:@"提现申请提交失败" duration:2 position:CSToastPositionCenter];
+                                           }
+                                       }
+                                      enError:^(NSError *error) {
+                                          [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                      }];
+}
+
+/*
+#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.
+}
+*/
+#pragma mark - textFieldDelegate
+
+//长度判断
+
+- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
+    if (textField == self.tfAmount) {
+        NSScanner *scanner = [NSScanner scannerWithString:string];
+        NSCharacterSet *numbers;
+        NSRange pointRange = [textField.text rangeOfString:@"."];
+        if ((pointRange.length > 0) && (pointRange.location < range.location || pointRange.location > range.location + range.length)) {
+            numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
+        } else {
+            numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789."];
+        }
+        if ([textField.text isEqualToString:@""] && [string isEqualToString:@"."]) {
+            return NO;
+        }
+        short remain = 2;//默认保留2位小数
+        NSString *tempStr = [textField.text stringByAppendingString:string];  // 原来的字符+当前输入的字符
+        NSUInteger strlen = [tempStr length];
+        if (pointRange.length > 0 && pointRange.location > 0) {//判断输入框内是否含有“.”。
+            if ([string isEqualToString:@"."]) { //当输入框内已经含有“.”时,如果再输入“.”则被视为无效。
+                return NO;
+            }
+            if (strlen > 0 && (strlen - pointRange.location) > remain + 1) {//当输入框内已经含有“.”,当字符串长度减去小数点前面的字符串长度大于需要要保留的小数点位数,则视当次输入无效。
+                return NO;
+            }
+        }
+        NSRange zeroRange = [textField.text rangeOfString:@"0"];
+        if (zeroRange.length == 1 && zeroRange.location == 0) {//判断输入框第一个字符是否为“0”
+            if (![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1) {//当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。
+                textField.text = string;
+                return NO;
+            } else {
+                if (pointRange.length == 0 && pointRange.location > 0) {//当输入框第一个字符为“0”时,并且没有“.”字符时,如果当此输入的字符为“0”,则视当此输入无效。
+                    if ([string isEqualToString:@"0"]) {
+                        return NO;
+                    }
+                }
+            }
+        }
+        NSString *buffer;
+        if (![scanner scanCharactersFromSet:numbers intoString:&buffer] && ([string length] != 0)) {
+            return NO;
+        }
+        // 大于10亿的时候不能再编辑
+        if ([tempStr longLongValue] >= 1000000000) {
+            return NO;
+        }
+    }
+
+    if ([string isEqualToString:@"."]) {
+        if (range.location + 2 < textField.text.length) {
+            NSMutableString *notFormatString = [[NSMutableString alloc] initWithString:[textField.text substringWithRange:NSMakeRange(0, range.location + 2)]];
+            [notFormatString insertString:@"." atIndex:range.location];
+            textField.text = notFormatString;
+            return false;
+        }
+    }
+    return YES;
+}
+
+@end

+ 344 - 0
model/Classes/Controllers/Controller/MyWalletVC/WithdrawController.xib

@@ -0,0 +1,344 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WithdrawController">
+            <connections>
+                <outlet property="btnBack" destination="heT-fX-6n4" id="tOh-sz-8jj"/>
+                <outlet property="btnSubmit" destination="vmf-9R-aOa" id="WYE-1C-1XT"/>
+                <outlet property="labelAccount" destination="UMA-cT-4VH" id="9FP-3M-CLT"/>
+                <outlet property="labelAvailable" destination="1fH-be-sTQ" id="Z7s-Qa-fgr"/>
+                <outlet property="labelName" destination="egB-i2-3ft" id="wdQ-2O-FMc"/>
+                <outlet property="successView" destination="CdW-aY-9uI" id="tyN-Cg-Q1x"/>
+                <outlet property="tfAmount" destination="R0x-ie-Q30" id="rnZ-Uv-tWi"/>
+                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6xe-8n-tM6">
+                    <rect key="frame" x="20" y="35" width="335" height="121"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jUd-7Z-4v3">
+                            <rect key="frame" x="0.0" y="0.0" width="335" height="60"/>
+                            <subviews>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="姓名" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JOB-ge-uXV">
+                                    <rect key="frame" x="15" y="21.5" width="29" height="17"/>
+                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="egB-i2-3ft">
+                                    <rect key="frame" x="115" y="19.5" width="205" height="21"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstItem="egB-i2-3ft" firstAttribute="centerY" secondItem="jUd-7Z-4v3" secondAttribute="centerY" id="3d6-4S-2Xh"/>
+                                <constraint firstItem="JOB-ge-uXV" firstAttribute="leading" secondItem="jUd-7Z-4v3" secondAttribute="leading" constant="15" id="GpG-UR-zUp"/>
+                                <constraint firstItem="egB-i2-3ft" firstAttribute="leading" secondItem="JOB-ge-uXV" secondAttribute="leading" constant="100" id="IcJ-hv-EJD"/>
+                                <constraint firstItem="JOB-ge-uXV" firstAttribute="centerY" secondItem="jUd-7Z-4v3" secondAttribute="centerY" id="RXw-1c-cor"/>
+                                <constraint firstAttribute="trailing" secondItem="egB-i2-3ft" secondAttribute="trailing" constant="15" id="uYN-Mr-Ngo"/>
+                            </constraints>
+                        </view>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aAc-zf-3Wk">
+                            <rect key="frame" x="15" y="60" width="305" height="1"/>
+                            <color key="backgroundColor" red="0.94901960784313721" green="0.95686274509803915" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="1" id="Raa-Hk-Ium"/>
+                            </constraints>
+                        </view>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xwE-Lg-wQu">
+                            <rect key="frame" x="0.0" y="61" width="335" height="60"/>
+                            <subviews>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="支付宝账号" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="11f-Hj-hj6">
+                                    <rect key="frame" x="15" y="21.5" width="71.5" height="17"/>
+                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UMA-cT-4VH">
+                                    <rect key="frame" x="115" y="19.5" width="205" height="21"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstItem="11f-Hj-hj6" firstAttribute="centerY" secondItem="xwE-Lg-wQu" secondAttribute="centerY" id="VrA-5S-STE"/>
+                                <constraint firstAttribute="trailing" secondItem="UMA-cT-4VH" secondAttribute="trailing" constant="15" id="lS2-a3-ewf"/>
+                                <constraint firstItem="UMA-cT-4VH" firstAttribute="centerY" secondItem="xwE-Lg-wQu" secondAttribute="centerY" id="pZJ-7C-xkE"/>
+                                <constraint firstItem="11f-Hj-hj6" firstAttribute="leading" secondItem="xwE-Lg-wQu" secondAttribute="leading" constant="15" id="sT6-Fj-e9c"/>
+                                <constraint firstItem="UMA-cT-4VH" firstAttribute="leading" secondItem="11f-Hj-hj6" secondAttribute="leading" constant="100" id="yJ0-pJ-nsP"/>
+                            </constraints>
+                        </view>
+                    </subviews>
+                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstItem="xwE-Lg-wQu" firstAttribute="leading" secondItem="6xe-8n-tM6" secondAttribute="leading" id="1H5-Cw-gBM"/>
+                        <constraint firstItem="aAc-zf-3Wk" firstAttribute="top" secondItem="jUd-7Z-4v3" secondAttribute="bottom" id="MqD-IS-kga"/>
+                        <constraint firstAttribute="trailing" secondItem="aAc-zf-3Wk" secondAttribute="trailing" constant="15" id="Qro-fz-RLm"/>
+                        <constraint firstAttribute="height" constant="121" id="STh-sb-UIJ"/>
+                        <constraint firstItem="aAc-zf-3Wk" firstAttribute="leading" secondItem="6xe-8n-tM6" secondAttribute="leading" constant="15" id="YIK-ac-UZF"/>
+                        <constraint firstAttribute="trailing" secondItem="xwE-Lg-wQu" secondAttribute="trailing" id="beT-gS-dc7"/>
+                        <constraint firstAttribute="trailing" secondItem="jUd-7Z-4v3" secondAttribute="trailing" id="ebJ-9I-21p"/>
+                        <constraint firstAttribute="bottom" secondItem="xwE-Lg-wQu" secondAttribute="bottom" id="moP-Ws-2Gd"/>
+                        <constraint firstItem="jUd-7Z-4v3" firstAttribute="top" secondItem="6xe-8n-tM6" secondAttribute="top" id="r9s-Ay-ZLc"/>
+                        <constraint firstItem="xwE-Lg-wQu" firstAttribute="top" secondItem="aAc-zf-3Wk" secondAttribute="bottom" id="rpy-MN-eVX"/>
+                        <constraint firstItem="jUd-7Z-4v3" firstAttribute="leading" secondItem="6xe-8n-tM6" secondAttribute="leading" id="saC-1p-KBW"/>
+                        <constraint firstItem="xwE-Lg-wQu" firstAttribute="height" secondItem="jUd-7Z-4v3" secondAttribute="height" id="xZS-JW-A02"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
+                            <integer key="value" value="8"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                    <connections>
+                        <outletCollection property="gestureRecognizers" destination="rzH-jR-7y6" appends="YES" id="cRb-ZK-S9S"/>
+                    </connections>
+                </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zDZ-zE-3Hd">
+                    <rect key="frame" x="20" y="166" width="335" height="80"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="提现金额" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rZh-JC-lks">
+                            <rect key="frame" x="15" y="20" width="57.5" height="17"/>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="最多可提现0元" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1fH-be-sTQ">
+                            <rect key="frame" x="15" y="47" width="88" height="16"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                            <color key="textColor" red="1" green="0.25098039215686274" blue="0.58431372549019611" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入提现金额" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="R0x-ie-Q30">
+                            <rect key="frame" x="103" y="0.0" width="217" height="80"/>
+                            <nil key="textColor"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                            <textInputTraits key="textInputTraits" keyboardType="decimalPad"/>
+                        </textField>
+                    </subviews>
+                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstAttribute="bottom" secondItem="1fH-be-sTQ" secondAttribute="bottom" constant="17" id="9Od-8h-rjW"/>
+                        <constraint firstAttribute="height" constant="80" id="A78-c1-RSs"/>
+                        <constraint firstAttribute="trailing" secondItem="R0x-ie-Q30" secondAttribute="trailing" constant="15" id="CkI-1g-RBW"/>
+                        <constraint firstItem="R0x-ie-Q30" firstAttribute="leading" secondItem="1fH-be-sTQ" secondAttribute="trailing" id="FeJ-Lj-Cyv"/>
+                        <constraint firstItem="R0x-ie-Q30" firstAttribute="top" secondItem="zDZ-zE-3Hd" secondAttribute="top" id="KV8-xS-MOq"/>
+                        <constraint firstItem="1fH-be-sTQ" firstAttribute="leading" secondItem="zDZ-zE-3Hd" secondAttribute="leading" constant="15" id="RLc-Im-pgK"/>
+                        <constraint firstAttribute="bottom" secondItem="R0x-ie-Q30" secondAttribute="bottom" id="hbr-GP-FfC"/>
+                        <constraint firstItem="rZh-JC-lks" firstAttribute="leading" secondItem="zDZ-zE-3Hd" secondAttribute="leading" constant="15" id="jh8-3H-yow"/>
+                        <constraint firstItem="rZh-JC-lks" firstAttribute="top" secondItem="zDZ-zE-3Hd" secondAttribute="top" constant="20" id="lHf-xK-HDf"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
+                            <integer key="value" value="8"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qqL-Yc-aUx">
+                    <rect key="frame" x="20" y="256" width="335" height="80.5"/>
+                    <attributedString key="attributedText">
+                        <fragment content="1.">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" metaFont="system"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="用户每周可提现一次,平台会在周五结算发放。">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" size="13" name=".PingFangSC-Regular"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="
2.1000-5000">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" metaFont="system"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="元手续费为">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" size="13" name=".PingFangSC-Regular"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="5">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" metaFont="system"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="元。">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" size="13" name=".PingFangSC-Regular"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="
3.5000-10000">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" metaFont="system"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="元手续费">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" size="13" name=".PingFangSC-Regular"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="10">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" metaFont="system"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="元。">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" size="13" name=".PingFangSC-Regular"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="
4.10000">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" metaFont="system"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="元以上扣">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" size="13" name=".PingFangSC-Regular"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="0.2%">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" metaFont="system"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                        <fragment content="手续费。">
+                            <attributes>
+                                <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <font key="NSFont" size="13" name=".PingFangSC-Regular"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
+                            </attributes>
+                        </fragment>
+                    </attributedString>
+                    <nil key="highlightedColor"/>
+                </label>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vmf-9R-aOa">
+                    <rect key="frame" x="20" y="456" width="335" height="44"/>
+                    <color key="backgroundColor" red="1" green="0.25098039220000001" blue="0.58431372550000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="44" id="kxT-rL-hAS"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
+                    <state key="normal" title="提交申请">
+                        <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    </state>
+                    <connections>
+                        <action selector="submit:" destination="-1" eventType="touchUpInside" id="DLq-AJ-ox0"/>
+                    </connections>
+                </button>
+                <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CdW-aY-9uI">
+                    <rect key="frame" x="0.0" y="20" width="375" height="647"/>
+                    <subviews>
+                        <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_chenggong" translatesAutoresizingMaskIntoConstraints="NO" id="itG-Uh-Fp1">
+                            <rect key="frame" x="126.5" y="38" width="122" height="122"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="122" id="Zr0-f9-M5q"/>
+                                <constraint firstAttribute="width" constant="122" id="wBv-UQ-Aoq"/>
+                            </constraints>
+                        </imageView>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="申请提交成功" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GO6-89-7x9">
+                            <rect key="frame" x="144.5" y="186" width="86" height="17"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <nil key="textColor"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="heT-fX-6n4">
+                            <rect key="frame" x="20" y="311" width="335" height="44"/>
+                            <color key="backgroundColor" red="1" green="0.25098039220000001" blue="0.58431372550000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="44" id="7tv-r3-1O7"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
+                            <state key="normal" title="返回">
+                                <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            </state>
+                            <connections>
+                                <action selector="back:" destination="-1" eventType="touchUpInside" id="qrO-mz-LAj"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" red="0.94901960784313721" green="0.95686274509803915" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstItem="heT-fX-6n4" firstAttribute="top" secondItem="GO6-89-7x9" secondAttribute="bottom" constant="108" id="EA0-ud-lBg"/>
+                        <constraint firstItem="GO6-89-7x9" firstAttribute="centerX" secondItem="CdW-aY-9uI" secondAttribute="centerX" id="KyO-Tg-gIA"/>
+                        <constraint firstAttribute="trailing" secondItem="heT-fX-6n4" secondAttribute="trailing" constant="20" id="cw7-U0-csW"/>
+                        <constraint firstItem="GO6-89-7x9" firstAttribute="top" secondItem="itG-Uh-Fp1" secondAttribute="bottom" constant="26" id="esN-6O-maH"/>
+                        <constraint firstItem="itG-Uh-Fp1" firstAttribute="top" secondItem="CdW-aY-9uI" secondAttribute="top" constant="38" id="rJ5-2V-ufi"/>
+                        <constraint firstItem="itG-Uh-Fp1" firstAttribute="centerX" secondItem="CdW-aY-9uI" secondAttribute="centerX" id="riW-Tm-V7X"/>
+                        <constraint firstItem="heT-fX-6n4" firstAttribute="leading" secondItem="CdW-aY-9uI" secondAttribute="leading" constant="20" id="scG-xn-IxH"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <color key="backgroundColor" red="0.94901960784313721" green="0.95686274509803915" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="CdW-aY-9uI" firstAttribute="trailing" secondItem="Q5M-cg-NOt" secondAttribute="trailing" id="2c7-8R-VA8"/>
+                <constraint firstItem="vmf-9R-aOa" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="20" id="6xi-I1-J4n"/>
+                <constraint firstItem="zDZ-zE-3Hd" firstAttribute="top" secondItem="6xe-8n-tM6" secondAttribute="bottom" constant="10" id="AyA-eI-8Ac"/>
+                <constraint firstItem="zDZ-zE-3Hd" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="20" id="Gc9-8L-ear"/>
+                <constraint firstItem="qqL-Yc-aUx" firstAttribute="top" secondItem="zDZ-zE-3Hd" secondAttribute="bottom" constant="10" id="Hpv-pC-SCY"/>
+                <constraint firstItem="CdW-aY-9uI" firstAttribute="bottom" secondItem="Q5M-cg-NOt" secondAttribute="bottom" id="HyQ-iI-JGc"/>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="qqL-Yc-aUx" secondAttribute="trailing" constant="20" id="O00-YZ-2Ne"/>
+                <constraint firstItem="qqL-Yc-aUx" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="20" id="UW8-qU-M9H"/>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="zDZ-zE-3Hd" secondAttribute="trailing" constant="20" id="Vwv-O4-Qwl"/>
+                <constraint firstItem="6xe-8n-tM6" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" constant="15" id="ZbI-W2-kcl"/>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="vmf-9R-aOa" secondAttribute="trailing" constant="20" id="gAx-uM-Xcv"/>
+                <constraint firstItem="6xe-8n-tM6" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="20" id="k8c-Ig-dpv"/>
+                <constraint firstItem="CdW-aY-9uI" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="mFK-wg-Gjd"/>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="vmf-9R-aOa" secondAttribute="bottom" constant="167" id="szE-p6-7Te"/>
+                <constraint firstItem="CdW-aY-9uI" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" id="vTd-IR-cf1"/>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="6xe-8n-tM6" secondAttribute="trailing" constant="20" id="yyk-qa-sx8"/>
+            </constraints>
+            <viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
+            <point key="canvasLocation" x="130.40000000000001" y="152.47376311844079"/>
+        </view>
+        <tapGestureRecognizer id="rzH-jR-7y6">
+            <connections>
+                <action selector="bindAlipay:" destination="-1" id="W0N-gM-FqL"/>
+            </connections>
+        </tapGestureRecognizer>
+    </objects>
+    <resources>
+        <image name="icon_chenggong" width="122" height="122"/>
+    </resources>
+</document>

+ 129 - 121
model/Classes/Controllers/Controller/MyWalletVC/WithdrawalController.m

@@ -9,19 +9,18 @@
 #import "WithdrawalController.h"
 #import "BindPhoneController.h"
 
-@interface WithdrawalController ()<UITextFieldDelegate>
-{
+@interface WithdrawalController () <UITextFieldDelegate> {
     NSString *amount;
     NSString *useAmount;
     NSString *name;
     NSString *account;
 }
-@property (nonatomic, strong) UILabel *moneyLabel;
-@property (nonatomic, strong) UILabel *totalMoneyLabel;
-@property (nonatomic, strong) UILabel *withdrawalLabel;
-@property (nonatomic, strong) UILabel *accountNameLabel;
-@property (nonatomic, strong) UILabel *phoneLabel;
-@property (nonatomic, strong) UITextField *priceTF; //提现金额
+@property(nonatomic, strong) UILabel *moneyLabel;
+@property(nonatomic, strong) UILabel *totalMoneyLabel;
+@property(nonatomic, strong) UILabel *withdrawalLabel;
+@property(nonatomic, strong) UILabel *accountNameLabel;
+@property(nonatomic, strong) UILabel *phoneLabel;
+@property(nonatomic, strong) UITextField *priceTF; //提现金额
 @end
 
 @implementation WithdrawalController
@@ -31,8 +30,8 @@
     self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
     [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
     [self.navigationController.navigationBar setShadowImage:[UIImage new]];
-    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
-    
+    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]}];
+
     [self getDataFromNetworking];
 }
 
@@ -46,7 +45,7 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    
+
     self.view.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
     //设置导航条
     [self creatNavBar];
@@ -63,20 +62,20 @@
     self.title = @"提现";
 
     //返回
-    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
     btn.frame = CGRectMake(0, 0, 40, 40);
     [btn setImage:[UIImage imageNamed:@"fanhui1"] forState:UIControlStateNormal];
-    btn.imageEdgeInsets =  UIEdgeInsetsMake(0, -20, 0, 0);
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
     [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
-    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
-    
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+
     //    nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整
     self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
 }
 
 - (void)backClick {
-    
+
     if (self.passBackAmount) {
         self.passBackAmount(amount);
     }
@@ -84,64 +83,64 @@
 }
 
 - (void)creatSubViews {
-    
+
     CGFloat headerHeight = (HeightStatusBar == 44) ? 277 : 233;
     UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, headerHeight)];
     UIImageView *bgView = [[UIImageView alloc] initWithFrame:headerView.bounds];
     [bgView setImage:[UIImage imageNamed:@"jianbianbeijing"]];
     [headerView addSubview:bgView];
-    
+
     //
     UIImageView *verticalImageView = [[UIImageView alloc] initWithFrame:CGRectMake(ScreenWidth / 2, headerHeight - 125, 1, 75)];
     verticalImageView.image = [UIImage imageNamed:@"shufenge"];
     [headerView addSubview:verticalImageView];
-    
+
     //
-    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, Height_NaviBar + 50, ScreenWidth/2, 14)];
+    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, Height_NaviBar + 50, ScreenWidth / 2, 14)];
     titleLabel.text = @"资产总额";
     titleLabel.textAlignment = NSTextAlignmentCenter;
     titleLabel.font = [UIFont systemFontOfSize:14];
     titleLabel.textColor = RGBValueColor(0xffffff, 1.0);
     [headerView addSubview:titleLabel];
-    
+
     //
-    self.moneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(titleLabel.frame) + 25, ScreenWidth/2, 30)];
+    self.moneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(titleLabel.frame) + 25, ScreenWidth / 2, 30)];
     self.moneyLabel.textAlignment = NSTextAlignmentCenter;
     self.moneyLabel.textColor = RGBValueColor(0xffffff, 1.0);
     NSString *str = @"0元";
     NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:str];
-    [attrString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:30] range:NSMakeRange(0,str.length - 1)];
-    [attrString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(str.length - 1,1)];
+    [attrString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:30] range:NSMakeRange(0, str.length - 1)];
+    [attrString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(str.length - 1, 1)];
     self.moneyLabel.attributedText = attrString;
     [headerView addSubview:self.moneyLabel];
-    
+
     //
-    UILabel *moneyTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(verticalImageView.frame), Height_NaviBar + 50, ScreenWidth/2, 14)];
+    UILabel *moneyTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(verticalImageView.frame), Height_NaviBar + 50, ScreenWidth / 2, 14)];
     moneyTitleLabel.text = @"可提现";
     moneyTitleLabel.textAlignment = NSTextAlignmentCenter;
     moneyTitleLabel.font = [UIFont systemFontOfSize:14];
     moneyTitleLabel.textColor = RGBValueColor(0xffffff, 1.0);
     [headerView addSubview:moneyTitleLabel];
-    
+
     //
-    self.totalMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(verticalImageView.frame), CGRectGetMaxY(moneyTitleLabel.frame) + 25, ScreenWidth/2, 30)];
+    self.totalMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(verticalImageView.frame), CGRectGetMaxY(moneyTitleLabel.frame) + 25, ScreenWidth / 2, 30)];
     self.totalMoneyLabel.textAlignment = NSTextAlignmentCenter;
     self.totalMoneyLabel.textColor = RGBValueColor(0xffffff, 1.0);
     NSString *str1 = @"0元";
     NSMutableAttributedString *attrString1 = [[NSMutableAttributedString alloc] initWithString:str1];
-    [attrString1 addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:30] range:NSMakeRange(0,str1.length - 1)];
-    [attrString1 addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(str1.length - 1,1)];
+    [attrString1 addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:30] range:NSMakeRange(0, str1.length - 1)];
+    [attrString1 addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(str1.length - 1, 1)];
     self.totalMoneyLabel.attributedText = attrString1;
     [headerView addSubview:self.totalMoneyLabel];
-    
+
     [self.view addSubview:headerView];
-    
+
     // 白色背景 views
     UIImageView *whiteImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(headerView.frame) + 10, ScreenWidth, 163)];
     whiteImageView.userInteractionEnabled = YES;
     whiteImageView.image = [UIImage imageNamed:@"beisebeijing"];
     [self.view addSubview:whiteImageView];
-    
+
     //我的提现账户
     UILabel *accountlabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 0, ScreenWidth / 2 - 20, 56)];
     accountlabel.textAlignment = NSTextAlignmentLeft;
@@ -149,7 +148,7 @@
     accountlabel.text = @"我的提现账户";
     accountlabel.font = [UIFont systemFontOfSize:16];
     [whiteImageView addSubview:accountlabel];
-    
+
     //管理提现账户
     UILabel *managerAccountlabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenWidth / 2, 0, ScreenWidth / 2 - 40, 56)];
     managerAccountlabel.textAlignment = NSTextAlignmentRight;
@@ -157,7 +156,7 @@
     managerAccountlabel.text = @"管理提现账户";
     managerAccountlabel.font = [UIFont systemFontOfSize:16];
     [whiteImageView addSubview:managerAccountlabel];
-    
+
     //右箭头
     UIImageView *arrowView = [[UIImageView alloc] initWithFrame:CGRectMake(ScreenWidth - 28, 22.5, 8, 14)];
     arrowView.image = [UIImage imageNamed:@"youjiantou"];
@@ -166,12 +165,12 @@
     clickBtn.frame = CGRectMake(ScreenWidth / 2, 0, ScreenWidth / 2, 56);
     [clickBtn addTarget:self action:@selector(clickBtn) forControlEvents:UIControlEventTouchUpInside];
     [whiteImageView addSubview:clickBtn];
-    
+
     //分割线
     UIImageView *lineView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 56, ScreenWidth, 1)];
     lineView.image = [UIImage imageNamed:@"fengexian"];
     [whiteImageView addSubview:lineView];
-    
+
     //提现账户(支付宝
     self.withdrawalLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(lineView.frame) + 17, ScreenWidth, 14)];
     self.withdrawalLabel.textAlignment = NSTextAlignmentLeft;
@@ -179,7 +178,7 @@
     self.withdrawalLabel.font = [UIFont systemFontOfSize:14.0];
     self.withdrawalLabel.text = @"提现账户(支付宝)";
     [whiteImageView addSubview:self.withdrawalLabel];
-    
+
     //账户姓名(支付宝)
     self.accountNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(self.withdrawalLabel.frame) + 17, ScreenWidth, 14)];
     self.accountNameLabel.textAlignment = NSTextAlignmentLeft;
@@ -187,7 +186,7 @@
     self.accountNameLabel.font = [UIFont systemFontOfSize:14.0];
     self.accountNameLabel.text = @"账户姓名(支付宝)";
     [whiteImageView addSubview:self.accountNameLabel];
-    
+
     //未绑定手机
     self.phoneLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(self.accountNameLabel.frame) + 17, ScreenWidth, 14)];
     self.phoneLabel.textAlignment = NSTextAlignmentLeft;
@@ -195,12 +194,12 @@
     self.phoneLabel.font = [UIFont systemFontOfSize:14.0];
     self.phoneLabel.text = @"未绑定支付宝";
     [whiteImageView addSubview:self.phoneLabel];
-    
+
     //金额输入框背景
-    UIImageView *amtBg = [[UIImageView alloc]initWithFrame:CGRectMake(20, CGRectGetMaxY(whiteImageView.frame) + 55, ScreenWidth - 40, 45)];
+    UIImageView *amtBg = [[UIImageView alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(whiteImageView.frame) + 55, ScreenWidth - 40, 45)];
     amtBg.image = [UIImage imageNamed:@"chakan"];
     [self.view addSubview:amtBg];
-    
+
     //金额输入框
     UITextField *priceTF = [[UITextField alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(whiteImageView.frame) + 64, ScreenWidth - 40, 30)];
     priceTF.textAlignment = NSTextAlignmentCenter;
@@ -212,7 +211,7 @@
     priceTF.delegate = self;
     [self.view addSubview:priceTF];
     self.priceTF = priceTF;
-    
+
     //提现按钮
     UIButton *withdrawalBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     withdrawalBtn.frame = CGRectMake(20, CGRectGetMaxY(priceTF.frame) + 20, ScreenWidth - 40, 45);
@@ -225,58 +224,64 @@
 
 
 #pragma mark -- 网络请求
+
 - (void)getDataFromNetworking {
-    
+
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     ModelUser *modelUser = [ModelUser user];
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:modelUser.modelpk,@"modelpk", nil];
-    
-    [YanCNetWorkManager requestPostWithURLStr:Url_alipayoutcashload(PublicUrl) parameters:dic finish:^(id dataDic) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-        
-        NSString *issuccess = dataDic[@"msg"];
-        if ([issuccess isEqualToString:@"success"]) {
-            NSDictionary *dic = dataDic[@"data"];
-            amount = dic[@"coin_a"];
-            useAmount = dic[@"coin_use"];
-            name = dic[@"name"];
-            account = dic[@"alipayid"];
-            
-            [self updateUI];
-        } else {
-            [MBProgressHUD showInfo:@"请求失败!"];
-        }
-    } enError:^(NSError *error) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-    }];
+    NSDictionary *dic = @{@"modelpk": modelUser.modelpk};
+
+    [YanCNetWorkManager requestPostWithURLStr:Url_alipayoutcashload(PublicUrl)
+                                   parameters:dic
+                                       finish:^(id dataDic) {
+                                           [MBProgressHUD hideHUDForView:self.view animated:YES];
+
+                                           NSString *issuccess = dataDic[@"msg"];
+                                           if ([issuccess isEqualToString:@"success"]) {
+                                               NSDictionary *data = dataDic[@"data"];
+                                               amount = data[@"coin_a"];
+                                               useAmount = data[@"coin_use"];
+                                               name = data[@"name"];
+                                               account = data[@"alipayid"];
+
+                                               [self updateUI];
+                                           } else {
+                                               [MBProgressHUD showInfo:@"请求失败!"];
+                                           }
+                                       }
+                                      enError:^(NSError *error) {
+                                          [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                      }];
 }
 
 #pragma mark -- 刷新界面
--(void)updateUI{
-    
-    NSString *str = [NSString stringWithFormat:@"%@元",amount];
+
+- (void)updateUI {
+
+    NSString *str = [NSString stringWithFormat:@"%@元", amount];
     NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:str];
-    [attrString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:30] range:NSMakeRange(0,str.length - 1)];
-    [attrString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(str.length - 1,1)];
+    [attrString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:30] range:NSMakeRange(0, str.length - 1)];
+    [attrString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(str.length - 1, 1)];
     self.moneyLabel.attributedText = attrString;
-    
-    NSString *str1 = [NSString stringWithFormat:@"%@元",useAmount];
+
+    NSString *str1 = [NSString stringWithFormat:@"%@元", useAmount];
     NSMutableAttributedString *attrString1 = [[NSMutableAttributedString alloc] initWithString:str1];
-    [attrString1 addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:30] range:NSMakeRange(0,str1.length - 1)];
-    [attrString1 addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(str1.length - 1,1)];
+    [attrString1 addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:30] range:NSMakeRange(0, str1.length - 1)];
+    [attrString1 addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(str1.length - 1, 1)];
     self.totalMoneyLabel.attributedText = attrString1;
-    
-    self.withdrawalLabel.text = [NSString stringWithFormat:@"提现账户(支付宝):%@",account];
-    self.accountNameLabel.text = [NSString stringWithFormat:@"账户姓名(支付宝):%@",name];
-    
-    if (account.length>0 && name.length>0) {
+
+    self.withdrawalLabel.text = [NSString stringWithFormat:@"提现账户(支付宝):%@", account];
+    self.accountNameLabel.text = [NSString stringWithFormat:@"账户姓名(支付宝):%@", name];
+
+    if (account.length > 0 && name.length > 0) {
         self.phoneLabel.hidden = YES;
-    }else{
+    } else {
         self.phoneLabel.hidden = NO;
     }
 }
 
 #pragma mark -- 管理我的账户
+
 - (void)clickBtn {
     NSLog(@"管理我的账户");
     BindPhoneController *bindPhoneVC = [[BindPhoneController alloc] init];
@@ -284,57 +289,60 @@
 }
 
 #pragma mark -- 提现
+
 - (void)withdrawalBtnAction {
-    
+
     if (account.length == 0 || name.length == 0) {
         [MBProgressHUD showInfo:@"请先去绑定支付宝"];
         return;
     }
-    
+
     if (self.priceTF.text.length == 0) {
         [MBProgressHUD showInfo:@"请输入提现金额"];
         return;
     }
-    
+
     if ([self.priceTF.text doubleValue] > [useAmount doubleValue]) {
         [MBProgressHUD showInfo:@"提现金额不能大于可提现总额"];
         return;
     }
-    
+
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     ModelUser *modelUser = [ModelUser user];
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:modelUser.modelpk,@"modelpk",self.priceTF.text,@"fee", nil];
-    
+    NSDictionary *dic = @{@"modelpk": modelUser.modelpk, @"fee": self.priceTF.text};
+
     [YanCNetWorkManager requestPostWithURLStr:Url_alipayoutcash(PublicUrl) parameters:dic finish:^(id dataDic) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-        
-        NSString *issuccess = dataDic[@"msg"];
-        if ([issuccess isEqualToString:@"success"]) {
-            NSDictionary *dic = dataDic[@"data"];
-            amount = dic[@"coin_a"];
-            useAmount = dic[@"coin_use"];
-            name = dic[@"name"];
-            account = dic[@"alipayid"];
-            
-            [self updateUI];
-            self.priceTF.text = @"";
-            [MBProgressHUD showInfo:@"提现成功"];
-        } else {
-            [MBProgressHUD showInfo:@"提现失败!"];
-        }
-    } enError:^(NSError *error) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-    }];
+                [MBProgressHUD hideHUDForView:self.view animated:YES];
+
+                NSString *issuccess = dataDic[@"msg"];
+                if ([issuccess isEqualToString:@"success"]) {
+                    NSDictionary *dic = dataDic[@"data"];
+                    amount = dic[@"coin_a"];
+                    useAmount = dic[@"coin_use"];
+                    name = dic[@"name"];
+                    account = dic[@"alipayid"];
+
+                    [self updateUI];
+                    self.priceTF.text = @"";
+                    [MBProgressHUD showInfo:@"提现成功"];
+                } else {
+                    [MBProgressHUD showInfo:@"提现失败!"];
+                }
+            }
+                                      enError:^(NSError *error) {
+                                          [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                      }];
 }
 
 #pragma mark ----- UITextFieldDelegate
+
 - (void)textFieldDidEndEditing:(UITextField *)textField {
     NSLog(@"textField.text = %@", textField.text);
 }
 
 - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
     if (textField.tag == 1000) {
-        if(![self isValidAboutInputText:textField shouldChangeCharactersInRange:range replacementString:string decimalNumber:2]) {
+        if (![self isValidAboutInputText:textField shouldChangeCharactersInRange:range replacementString:string decimalNumber:2]) {
             return NO;
         }
     }
@@ -344,46 +352,46 @@
 //输入框中只能输入数字和小数点,且小数点只能输入一位,参数number 可以设置小数的位数,该函数在-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string调用;
 
 - (BOOL)isValidAboutInputText:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string decimalNumber:(NSInteger)number {
-    
-    NSScanner      *scanner    = [NSScanner scannerWithString:string];
+
+    NSScanner *scanner = [NSScanner scannerWithString:string];
     NSCharacterSet *numbers;
-    NSRange         pointRange = [textField.text rangeOfString:@"."];
-    if ( (pointRange.length > 0) && (pointRange.location < range.location  || pointRange.location > range.location + range.length) ){
+    NSRange pointRange = [textField.text rangeOfString:@"."];
+    if ((pointRange.length > 0) && (pointRange.location < range.location || pointRange.location > range.location + range.length)) {
         numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
-    }else{
+    } else {
         numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789."];
     }
-    if ( [textField.text isEqualToString:@""] && [string isEqualToString:@"."] ){
+    if ([textField.text isEqualToString:@""] && [string isEqualToString:@"."]) {
         return NO;
     }
     short remain = number; //保留 number位小数
     NSString *tempStr = [textField.text stringByAppendingString:string];
     NSUInteger strlen = [tempStr length];
-    if(pointRange.length > 0 && pointRange.location > 0){ //判断输入框内是否含有“.”。
-        if([string isEqualToString:@"."]){ //当输入框内已经含有“.”时,如果再输入“.”则被视为无效。
+    if (pointRange.length > 0 && pointRange.location > 0) { //判断输入框内是否含有“.”。
+        if ([string isEqualToString:@"."]) { //当输入框内已经含有“.”时,如果再输入“.”则被视为无效。
             return NO;
         }
-        if(strlen > 0 && (strlen - pointRange.location) > remain+1){ //当输入框内已经含有“.”,当字符串长度减去小数点前面的字符串长度大于需要要保留的小数点位数,则视当次输入无效。
+        if (strlen > 0 && (strlen - pointRange.location) > remain + 1) { //当输入框内已经含有“.”,当字符串长度减去小数点前面的字符串长度大于需要要保留的小数点位数,则视当次输入无效。
             return NO;
         }
     }
     NSRange zeroRange = [textField.text rangeOfString:@"0"];
-    if(zeroRange.length == 1 && zeroRange.location == 0){ //判断输入框第一个字符是否为“0”
-        if(![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1){ //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。
+    if (zeroRange.length == 1 && zeroRange.location == 0) { //判断输入框第一个字符是否为“0”
+        if (![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1) { //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。
             textField.text = string;
             return NO;
-        }else{
-            if(pointRange.length == 0 && pointRange.location > 0){ //当输入框第一个字符为“0”时,并且没有“.”字符时,如果当此输入的字符为“0”,则视当此输入无效。
-                if([string isEqualToString:@"0"]){
+        } else {
+            if (pointRange.length == 0 && pointRange.location > 0) { //当输入框第一个字符为“0”时,并且没有“.”字符时,如果当此输入的字符为“0”,则视当此输入无效。
+                if ([string isEqualToString:@"0"]) {
                     return NO;
                 }
             }
         }
     }
     NSString *buffer;
-    if ( ![scanner scanCharactersFromSet:numbers intoString:&buffer] && ([string length] != 0) ){
+    if (![scanner scanCharactersFromSet:numbers intoString:&buffer] && ([string length] != 0)) {
         return NO;
-    }else{
+    } else {
         return YES;
     }
 }

+ 11 - 11
model/Classes/Controllers/Controller/ShareVC/ShareCardController.m

@@ -12,7 +12,7 @@
 #import <WXApi.h>
 #import "SharePopViewController.h"
 
-@interface ShareCardController ()<ShareDelegate>
+@interface ShareCardController () <ShareDelegate>
 
 @end
 
@@ -20,21 +20,21 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    
+
     self.title = @"我的模卡";
-    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
     btn.frame = CGRectMake(0, 0, 40, 40);
     [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
-    btn.imageEdgeInsets =  UIEdgeInsetsMake(0, -20, 0, 0);
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
     [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
-    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
     self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
     UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon_fenxiang"] style:UIBarButtonItemStylePlain target:self action:@selector(share)];
     rightItem.tintColor = [UIColor colorWithHexString:@"#666666"];
     self.navigationItem.rightBarButtonItem = rightItem;
-    
-    WKWebView* webView = [[WKWebView alloc] init];
+
+    WKWebView *webView = [[WKWebView alloc] init];
     [self.view addSubview:webView];
     [webView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.equalTo(self.view.mas_left);
@@ -42,9 +42,9 @@
         make.top.equalTo(self.mas_topLayoutGuide);
         make.bottom.equalTo(self.mas_bottomLayoutGuide);
     }];
-    
+
     [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@?modelpk=%@&preview=1", PublicUrl, @"/modelCard.jsp", [ModelUser user].modelpk]]]];
-    
+
 }
 
 - (void)backClick {
@@ -58,11 +58,11 @@
 }
 
 - (void)shareWxSession {
-    [self shareToWechat:WXSceneSession withTitle:@"我的模卡" description:@"千模" url:[NSString stringWithFormat:@"%@%@?modelpk=%@", PublicUrl, @"/modelCard.jsp", [ModelUser user].modelpk]];
+    [self shareToWechat:WXSceneSession withTitle:@"千模" description:[NSString stringWithFormat:@"%@%@", [ModelUser user].pet, @",千模平台优秀模特,马上跟她视频认识一下吧。"] url:[NSString stringWithFormat:@"%@%@?modelpk=%@", PublicUrl, @"/modelCard.jsp", [ModelUser user].modelpk]];
 }
 
 - (void)shareWxTimeline {
-    [self shareToWechat:WXSceneTimeline withTitle:@"我的模卡" description:@"千模" url:[NSString stringWithFormat:@"%@%@?modelpk=%@", PublicUrl, @"/modelCard.jsp", [ModelUser user].modelpk]];
+    [self shareToWechat:WXSceneTimeline withTitle:@"千模" description:[NSString stringWithFormat:@"%@%@", [ModelUser user].pet, @",千模平台优秀模特,马上跟她视频认识一下吧。"] url:[NSString stringWithFormat:@"%@%@?modelpk=%@", PublicUrl, @"/modelCard.jsp", [ModelUser user].modelpk]];
 }
 
 - (void)shareToWechat:(enum WXScene)scene withTitle:(NSString *)title description:(NSString *)description url:(NSString *)url {