Browse Source

Merge branch 'dev_sign_in' into dev_1.8.6

Steven 1 năm trước cách đây
mục cha
commit
b0d3d33eeb

+ 8 - 12
MiMoLive/MiMoLive.xcodeproj/project.pbxproj

@@ -15,6 +15,7 @@
 		3A5B52CF2D68300900BF6E64 /* MOThemeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5B52CE2D68300900BF6E64 /* MOThemeManager.m */; };
 		3A5D6F8F2D840776007AFCE1 /* MOSayHiModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5D6F8E2D840776007AFCE1 /* MOSayHiModel.m */; };
 		3AAAB1BC2D7D479600989FD5 /* MOLiveSayHiView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AAAB1BB2D7D479600989FD5 /* MOLiveSayHiView.m */; };
+		3A71C4DC2D881E9F00B1CFA0 /* MOCountryAndRecommendVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A71C4DB2D881E9F00B1CFA0 /* MOCountryAndRecommendVC.m */; };
 		3AD883192D389A7C00D46254 /* NSBundle+language.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AD883182D389A7C00D46254 /* NSBundle+language.m */; };
 		3AE9AC222D3A30FF00D3A953 /* MOBeautySettingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AE9AC212D3A30FF00D3A953 /* MOBeautySettingView.m */; };
 		3AE9AC252D3A4B7D00D3A953 /* MOBeautyFilterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AE9AC242D3A4B7D00D3A953 /* MOBeautyFilterView.m */; };
@@ -733,8 +734,6 @@
 		A67908FE2C0C84BD001B73AE /* MOTaskEnterView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A67908FD2C0C84BD001B73AE /* MOTaskEnterView.xib */; };
 		A67909042C0CAFB4001B73AE /* MOAnchorTaskData.m in Sources */ = {isa = PBXBuildFile; fileRef = A67909012C0CAFB4001B73AE /* MOAnchorTaskData.m */; };
 		A67909052C0CAFB4001B73AE /* MOTasksBiGo.m in Sources */ = {isa = PBXBuildFile; fileRef = A67909032C0CAFB4001B73AE /* MOTasksBiGo.m */; };
-		A67AB9102D7ED49500670C51 /* MOCountryAndRecommendVC.m in Sources */ = {isa = PBXBuildFile; fileRef = A67AB90E2D7ED49500670C51 /* MOCountryAndRecommendVC.m */; };
-		A67AB9112D7ED49500670C51 /* MOCountryAndRecommendVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = A67AB90F2D7ED49500670C51 /* MOCountryAndRecommendVC.xib */; };
 		A67AB9152D7EE79B00670C51 /* MOAccountSecurityVC.m in Sources */ = {isa = PBXBuildFile; fileRef = A67AB9132D7EE79B00670C51 /* MOAccountSecurityVC.m */; };
 		A67AB9162D7EE79B00670C51 /* MOAccountSecurityVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = A67AB9142D7EE79B00670C51 /* MOAccountSecurityVC.xib */; };
 		A67AB91C2D7EFA4800670C51 /* MOSecurityStatusCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A67AB91A2D7EFA4800670C51 /* MOSecurityStatusCell.m */; };
@@ -1648,6 +1647,8 @@
 		3A5D6F8E2D840776007AFCE1 /* MOSayHiModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MOSayHiModel.m; sourceTree = "<group>"; };
 		3AAAB1BA2D7D479600989FD5 /* MOLiveSayHiView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MOLiveSayHiView.h; sourceTree = "<group>"; };
 		3AAAB1BB2D7D479600989FD5 /* MOLiveSayHiView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MOLiveSayHiView.m; sourceTree = "<group>"; };
+		3A71C4DA2D881E9F00B1CFA0 /* MOCountryAndRecommendVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MOCountryAndRecommendVC.h; sourceTree = "<group>"; };
+		3A71C4DB2D881E9F00B1CFA0 /* MOCountryAndRecommendVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MOCountryAndRecommendVC.m; sourceTree = "<group>"; };
 		3AD883172D389A7C00D46254 /* NSBundle+language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+language.h"; sourceTree = "<group>"; };
 		3AD883182D389A7C00D46254 /* NSBundle+language.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+language.m"; sourceTree = "<group>"; };
 		3AE9AC202D3A30FF00D3A953 /* MOBeautySettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MOBeautySettingView.h; sourceTree = "<group>"; };
@@ -2854,9 +2855,6 @@
 		A67909022C0CAFB4001B73AE /* MOTasksBiGo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MOTasksBiGo.h; sourceTree = "<group>"; };
 		A67909032C0CAFB4001B73AE /* MOTasksBiGo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MOTasksBiGo.m; sourceTree = "<group>"; };
 		A67909062C0CAFBA001B73AE /* MOAnchorTaskDataModels.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MOAnchorTaskDataModels.h; sourceTree = "<group>"; };
-		A67AB90D2D7ED49500670C51 /* MOCountryAndRecommendVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MOCountryAndRecommendVC.h; sourceTree = "<group>"; };
-		A67AB90E2D7ED49500670C51 /* MOCountryAndRecommendVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MOCountryAndRecommendVC.m; sourceTree = "<group>"; };
-		A67AB90F2D7ED49500670C51 /* MOCountryAndRecommendVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MOCountryAndRecommendVC.xib; sourceTree = "<group>"; };
 		A67AB9122D7EE79B00670C51 /* MOAccountSecurityVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MOAccountSecurityVC.h; sourceTree = "<group>"; };
 		A67AB9132D7EE79B00670C51 /* MOAccountSecurityVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MOAccountSecurityVC.m; sourceTree = "<group>"; };
 		A67AB9142D7EE79B00670C51 /* MOAccountSecurityVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MOAccountSecurityVC.xib; sourceTree = "<group>"; };
@@ -4983,9 +4981,8 @@
 				A60A0F5A2AD434C800421EA4 /* MOAnchorRecommendVC.h */,
 				A60A0F5B2AD434C800421EA4 /* MOAnchorRecommendVC.m */,
 				A60A0F5C2AD434C800421EA4 /* MOAnchorRecommendVC.xib */,
-				A67AB90D2D7ED49500670C51 /* MOCountryAndRecommendVC.h */,
-				A67AB90E2D7ED49500670C51 /* MOCountryAndRecommendVC.m */,
-				A67AB90F2D7ED49500670C51 /* MOCountryAndRecommendVC.xib */,
+				3A71C4DA2D881E9F00B1CFA0 /* MOCountryAndRecommendVC.h */,
+				3A71C4DB2D881E9F00B1CFA0 /* MOCountryAndRecommendVC.m */,
 			);
 			path = Welcome;
 			sourceTree = "<group>";
@@ -11054,7 +11051,6 @@
 				A6CBECA42B22C41100B949CC /* Localizable.strings in Resources */,
 				A6F0F5C42CD8A46A0047B965 /* EaseIMKit.bundle in Resources */,
 				A686EFBE2C0DA77C004FA294 /* MOAnchorTaskRuleView.xib in Resources */,
-				A67AB9112D7ED49500670C51 /* MOCountryAndRecommendVC.xib in Resources */,
 				A6A147412C9C2DE2005F7A6D /* MOHPMedalCollectionViewCell.xib in Resources */,
 				A6AAFD9D2CEDD8C5004C4D59 /* MOLiveWameCenterReusableView.xib in Resources */,
 				A6F4DFC62D5C4DDB00A72496 /* beauty_base.json in Resources */,
@@ -12360,6 +12356,7 @@
 				A6272B522B0F4401006464EB /* YYTextKeyboardManager.m in Sources */,
 				A6A3FDEB2AFCDDFD0069D768 /* MOShowLivePagesVC.m in Sources */,
 				A669ADEE2C6627F3003F3D75 /* MOApplicationTableView.m in Sources */,
+				3A71C4DC2D881E9F00B1CFA0 /* MOCountryAndRecommendVC.m in Sources */,
 				A6A08FA82B38285300ECE79D /* MOMedalTypeView.m in Sources */,
 				A695B2EC2AE14C140072644D /* MOImagePickerController.m in Sources */,
 				A6F0F5B32CD8A46A0047B965 /* EaseFileAttributeHelper.m in Sources */,
@@ -12511,7 +12508,6 @@
 				A608EBDC2AE6A9810092317D /* MOFriendListView.m in Sources */,
 				A62477EA2AD5314D000C2E10 /* BigBtn.m in Sources */,
 				A62D4F082D2D2C1600A67F88 /* MONormalTipBadgeView.m in Sources */,
-				A67AB9102D7ED49500670C51 /* MOCountryAndRecommendVC.m in Sources */,
 				A680E9BC2ADEBE9700DDFEC3 /* Reachability+More.m in Sources */,
 				A61A8D142D22881A00D71489 /* QGBaseAnimatedImageFrame.m in Sources */,
 				A6C563102B6A7D220068F266 /* MOEventData.m in Sources */,
@@ -12853,7 +12849,7 @@
 					"$(inherited)",
 					"$(PROJECT_DIR)/MiMoLive/3rdParty/EMVoiceConvert",
 				);
-				MARKETING_VERSION = 1.8.6;
+				MARKETING_VERSION = 1.8.7;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-l\"sqlite3\"",
@@ -13007,7 +13003,7 @@
 					"$(inherited)",
 					"$(PROJECT_DIR)/MiMoLive/3rdParty/EMVoiceConvert",
 				);
-				MARKETING_VERSION = 1.8.6;
+				MARKETING_VERSION = 1.8.7;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-l\"sqlite3\"",

+ 125 - 2
MiMoLive/MiMoLive/Classes/Login/ViewController/MOLoginChooseVC.m

@@ -11,6 +11,7 @@
 #import "MOFirstInfoSetVC.h"
 #import "MOWebViewController.h"
 #import "UIImage+YYAdd.h"
+#import "MOCountryAndRecommendVC.h"
 
 @interface MOLoginChooseVC ()
 
@@ -26,6 +27,11 @@
 @property (weak, nonatomic) IBOutlet UIImageView *centerImgView;
 @property (weak, nonatomic) IBOutlet UIImageView *bottomImgView;
 
+//第三方平台信息
+@property (nonatomic, copy) NSString *nickname;//昵称
+@property (nonatomic, copy) NSString *avatar;//头像
+
+@property (nonatomic, copy) NSString *headImgUrl;//上传头像成功后的url
 
 @end
 
@@ -282,7 +288,24 @@
                 [MBProgressHUD hideHUD];
                 if(data != nil && ([data[@"code"]integerValue] == 0 || [data[@"code"]integerValue] == 200)){
                     //授权成功
-                    [weakSelf toNextVCWithData:data];
+                    int regGuide = [data[@"regGuide"] intValue];
+                    if (regGuide == 1) {//需要自己调用信息设置接口
+                        NSDictionary *thirdProfileDict = (NSDictionary *)data[@"thirdProfile"];
+                        weakSelf.nickname = thirdProfileDict[@"nickname"];
+                        weakSelf.avatar = thirdProfileDict[@"avatar"];
+                        if (weakSelf.avatar.length > 0) {
+                            [weakSelf handleAvatarCompleteBlock:^(BOOL success) {
+                                [weakSelf settingInfo];
+                            }];
+                        } else {
+                            [weakSelf settingInfo];
+                        }
+                    } else if (regGuide == 2) {//跳转到推荐页
+                        MOCountryAndRecommendVC *vc = [[MOCountryAndRecommendVC alloc] init];
+                        [weakSelf.navigationController pushViewController:vc animated:YES];
+                    } else {
+                        [weakSelf toNextVCWithData:data];
+                    }
                 }
                 else{
                     kShowNetError(data)
@@ -305,6 +328,89 @@
     }];
 }
 
+/// 处理头像
+- (void)handleAvatarCompleteBlock:(void (^)(BOOL success))completeBlock{
+    WEAKSELF
+    [MOTools fetchAndStoreImageWithUrl:self.avatar completeBlock:^(UIImage * _Nonnull image) {
+        if (image) {
+            NSDictionary *dict = @{@"type":@(1),
+                                   @"suffix":@"jpg"};
+            [kHttpManager getBaseOssS3WithParams:dict andBlock:^(id  _Nonnull data, NSError * _Nonnull error) {
+                if(kCode_Success){
+                    NSDictionary *tempDict = data[@"data"];
+                    
+                    NSString *baseUrl = [MODataManager objectOrNilForKey:@"preSignUrl" fromDictionary:tempDict];
+                    
+                    self.headImgUrl = [MODataManager objectOrNilForKey:@"fileUrl" fromDictionary:tempDict];
+
+                    NSData *imageData = UIImageJPEGRepresentation(image, 1);
+                    
+                    [kHttpManager sendSingleChatImage:imageData params:nil type:@"image/jpg" andBaseUrl:baseUrl withUploadProgressHandler:^(NSProgress * uploadProgress) {
+                        float progress = 1.0*uploadProgress.completedUnitCount/uploadProgress.totalUnitCount;
+                        NSLog(@"Image upload Progress: %.2f%%", progress * 100);
+                    } andCompletionBlock:^(id  _Nonnull data, NSError * _Nonnull error) {
+                        if(error == nil){
+                            NSLog(@"图片上传成功~");
+                            completeBlock(YES);
+                        } else {
+                            completeBlock(NO);
+                        }
+                    }];
+                }
+                else{
+                    kShowNetError(data)
+                }
+            }];
+        }
+    }];
+}
+
+//设置信息
+- (void)settingInfo {
+    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
+    if (self.headImgUrl.length > 0) {
+        [dict setObject:self.headImgUrl forKey:@"avatar"];
+    }
+    if (self.nickname.length > 0) {
+        [dict setObject:self.nickname forKey:@"nickname"];
+    }
+    
+    WEAKSELF
+    [kHttpManager toSettingInfoWithParams:dict andBlock:^(id  _Nonnull data, NSError * _Nonnull error) {
+        if(kCode_Success){
+            
+            [MBProgressHUD showTipMessageInWindow:NSLocalString(@"mimo_common_success")];
+            
+            NSDictionary *baseDict = data[@"data"];
+            
+            //更新头像
+            NSString *avatarString = [MODataManager objectOrNilForKey:@"avatar" fromDictionary:baseDict];
+            if(avatarString.length > 0){
+                [[NSUserDefaults standardUserDefaults] setObject:avatarString forKey:kAvatar];
+            }
+            
+            //更新性别信息
+            NSInteger gender = [[MODataManager objectOrNilForKey:@"gender" fromDictionary:baseDict] integerValue];
+            [[NSUserDefaults standardUserDefaults] setObject:@(gender) forKey:kGender];
+            
+            //更新昵称信息
+            NSString *nickNameString = [MODataManager objectOrNilForKey:@"nickname" fromDictionary:baseDict];
+            if(nickNameString.length > 0){
+                [[NSUserDefaults standardUserDefaults] setObject:nickNameString forKey:kNickName];
+            }
+            [[NSUserDefaults standardUserDefaults] synchronize];
+            
+            MOMainTabController *mainTabbar = [MOMainTabController sharedSingleton];
+            [mainTabbar toResetSetupTabbar];
+            [UIApplication sharedApplication].keyWindow.rootViewController = mainTabbar;
+            [mainTabbar ChangeNeedShowAlert];
+        }
+        else{
+            kShowNetError(data)
+        }
+    }];
+}
+
 - (IBAction)googleLoginClick:(id)sender {
     
 //    if(!self.isAgreeAM){
@@ -331,7 +437,24 @@
                 [MBProgressHUD hideHUD];
                 if(data != nil && ([data[@"code"]integerValue] == 0 || [data[@"code"]integerValue] == 200)){
                     //授权成功
-                    [weakSelf toNextVCWithData:data];
+                    int regGuide = [data[@"regGuide"] intValue];
+                    if (regGuide == 1) {//需要自己调用信息设置接口
+                        NSDictionary *thirdProfileDict = (NSDictionary *)data[@"thirdProfile"];
+                        weakSelf.nickname = thirdProfileDict[@"nickname"];
+                        weakSelf.avatar = thirdProfileDict[@"avatar"];
+                        if (weakSelf.avatar.length > 0) {
+                            [weakSelf handleAvatarCompleteBlock:^(BOOL success) {
+                                [weakSelf settingInfo];
+                            }];
+                        } else {
+                            [weakSelf settingInfo];
+                        }
+                    } else if (regGuide == 2) {//跳转到推荐页
+                        MOCountryAndRecommendVC *vc = [[MOCountryAndRecommendVC alloc] init];
+                        [weakSelf.navigationController pushViewController:vc animated:YES];
+                    } else {
+                        [weakSelf toNextVCWithData:data];
+                    }
                 }
                 else{
                     kShowNetError(data)

+ 28 - 2
MiMoLive/MiMoLive/Classes/Main/Controller/MOMainTabController.m

@@ -38,6 +38,9 @@
 #import "MOBeautyResDataModels.h"
 #import "TEUIConfig.h"
 
+#import "MOFirstInfoSetVC.h"
+#import "MOCountryAndRecommendVC.h"
+
 static MOMainTabController *_sharedSingleton = nil;
 static dispatch_once_t onceToken;
 
@@ -177,6 +180,7 @@ static dispatch_once_t onceToken;
     ReceiveNotification(@selector(noBindPhoenTipShow), @"kNotification_NoBindPhone")//没有绑定手机 - 点赞活动
     ReceiveNotification(@selector(toCheckTheIMStatus), @"kNotification_CheckTheIMStatus")//检测IM连接状态
     ReceiveNotification(@selector(toOpenTheLiveRoom), @"kNotification_OpenTheLiveRoom")//开播
+    ReceiveNotification(@selector(toJudgeShowAlertView), @"kNotification_MOCountryAndRecommendVCDismiss")//选择语言和推荐主播页面退出通知
 }
 
 - (void)noBindPhoenTipShow{
@@ -496,9 +500,31 @@ static dispatch_once_t onceToken;
 
 //有可能有弹窗的方法
 - (void)mayBeShowAlertAction{
+    WEAKSELF
+    [kHttpManager getGuideWithParams:nil andBlock:^(id  _Nonnull data, NSError * _Nonnull error) {
+        if (kCode_Success) {
+            int regGuide = [data[@"data"][@"regGuide"] intValue];
+            if (regGuide == 1) {
+                MOFirstInfoSetVC *vc = [[MOFirstInfoSetVC alloc] init];
+                [weakSelf loginPageActionWithVC:vc];
+            } else if (regGuide == 2) {
+                MOCountryAndRecommendVC *vc = [[MOCountryAndRecommendVC alloc] init];
+                [weakSelf loginPageActionWithVC:vc];
+            } else {
+                [NSObject cancelPreviousPerformRequestsWithTarget:weakSelf selector:@selector(toJudgeShowAlertView) object:nil];
+                [weakSelf performSelector:@selector(toJudgeShowAlertView) withObject:nil afterDelay:0.5];
+            }
+        }
+    }];
     
-    [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(toJudgeShowAlertView) object:nil];
-    [self performSelector:@selector(toJudgeShowAlertView) withObject:nil afterDelay:0.5];
+
+}
+
+- (void)loginPageActionWithVC:(UIViewController *)vc {
+    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
+    nav.modalPresentationStyle = UIModalPresentationFullScreen;
+    [nav.navigationBar setHidden:YES];
+    [self presentModalViewController:nav animated:YES];
 }
 
 - (void)toJudgeShowAlertView{

+ 1 - 0
MiMoLive/MiMoLive/Classes/Square/Model/CountryList/MOCountryList.h

@@ -16,6 +16,7 @@
 @property (nonatomic, strong) NSString *first;
 @property (nonatomic, strong) NSString *icon;
 @property (nonatomic, strong) NSString *name;
+@property (nonatomic, strong) NSString *icon2;
 
 @property (nonatomic, strong) NSString *id;
 

+ 5 - 4
MiMoLive/MiMoLive/Classes/Square/Model/CountryList/MOCountryList.m

@@ -13,6 +13,7 @@ NSString *const kMOCountryListNum = @"num";
 NSString *const kMOCountryListFirst = @"first";
 NSString *const kMOCountryListIcon = @"icon";
 NSString *const kMOCountryListName = @"name";
+NSString *const kMOCountryListIcon2 = @"icon2";
 
 NSString *const kMOCountryListId = @"id";
 
@@ -48,7 +49,7 @@ NSString *const kMOCountryListId = @"id";
             self.first = [self objectOrNilForKey:kMOCountryListFirst fromDictionary:dict];
             self.icon = [self objectOrNilForKey:kMOCountryListIcon fromDictionary:dict];
             self.name = [self objectOrNilForKey:kMOCountryListName fromDictionary:dict];
-
+        self.icon2 = [self objectOrNilForKey:kMOCountryListIcon2 fromDictionary:dict];
         self.id = [self objectOrNilForKey:kMOCountryListId fromDictionary:dict];
     }
     
@@ -63,7 +64,7 @@ NSString *const kMOCountryListId = @"id";
     [mutableDict setValue:self.first forKey:kMOCountryListFirst];
     [mutableDict setValue:self.icon forKey:kMOCountryListIcon];
     [mutableDict setValue:self.name forKey:kMOCountryListName];
-    
+    [mutableDict setValue:self.icon2 forKey:kMOCountryListIcon2];
     [mutableDict setValue:self.id forKey:kMOCountryListId];
 
     return [NSDictionary dictionaryWithDictionary:mutableDict];
@@ -90,7 +91,7 @@ NSString *const kMOCountryListId = @"id";
     self.first = [aDecoder decodeObjectForKey:kMOCountryListFirst];
     self.icon = [aDecoder decodeObjectForKey:kMOCountryListIcon];
     self.name = [aDecoder decodeObjectForKey:kMOCountryListName];
-    
+    self.icon2 = [aDecoder decodeObjectForKey:kMOCountryListIcon2];
     self.id = [aDecoder decodeObjectForKey:kMOCountryListId];
     return self;
 }
@@ -103,7 +104,7 @@ NSString *const kMOCountryListId = @"id";
     [aCoder encodeObject:_first forKey:kMOCountryListFirst];
     [aCoder encodeObject:_icon forKey:kMOCountryListIcon];
     [aCoder encodeObject:_name forKey:kMOCountryListName];
-    
+    [aCoder encodeObject:_icon2 forKey:kMOCountryListIcon2];
     [aCoder encodeObject:_id forKey:kMOCountryListId];
 }
 

+ 345 - 10
MiMoLive/MiMoLive/Classes/Welcome/MOCountryAndRecommendVC.m

@@ -1,13 +1,28 @@
 //
-//  MOCountryAndRecommendVC.m
+//  MOCountryAndRecommendVC.h
 //  MiMoLive
 //
 //  Created by SuperC on 2025/3/10.
 //
 
 #import "MOCountryAndRecommendVC.h"
+#import "MOLanguageItemView.h"
+#import "MORecommendFlowLayout.h"
+#import "MORecommendAnchorCell.h"
 
-@interface MOCountryAndRecommendVC ()
+@interface MOCountryAndRecommendVC ()<UICollectionViewDelegate, UICollectionViewDataSource>
+
+@property (nonatomic, strong) UIImageView *bgImgView;
+@property (nonatomic, strong) UIImageView *topImgView;
+@property (nonatomic, strong) UIScrollView *scrollView;
+@property (nonatomic, strong) UIView *scrollContainerView;
+@property (nonatomic, strong) MOLanguageItemView *countryView;
+@property (nonatomic, strong) NSMutableArray *countryArr;
+@property (nonatomic, strong) MOCountryList *selectModel;
+@property (nonatomic, strong) UILabel *recommendTitle;
+@property (nonatomic, strong) UICollectionView *collectionView;
+@property (nonatomic, strong) NSMutableArray *dataArr;
+@property (nonatomic, strong) UIButton *finishBtn;
 
 @end
 
@@ -15,17 +30,337 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    // Do any additional setup after loading the view from its nib.
+
+    [self setupUI];
+    [self getHttpDataAboutCountry];
+    [self getAnchorRecommendListData];
+}
+
+/// 推荐主播
+- (void)getAnchorRecommendListData{
+    WEAKSELF
+    [kHttpManager getAnchorRecommendListWithParams:nil andBlock:^(id  _Nonnull data, NSError * _Nonnull error) {
+        if(kCode_Success){
+            
+            NSLog(@"%@",[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:data options:0 error:nil] encoding:NSUTF8StringEncoding]);
+            MOUserRecomList *baseModle = [MOUserRecomList modelObjectWithDictionary:data[@"data"]];
+            
+            for (MOUserProfile *object in baseModle.userBase) {
+                object.isSelect = YES;
+            }
+            
+            weakSelf.dataArr = [baseModle.userBase mutableCopy];
+            [weakSelf.collectionView reloadData];
+        }
+        else{
+            kShowNetError(data)
+        }
+    }];
+}
+
+//获取国家列表
+- (void)getHttpDataAboutCountry{
+    WEAKSELF
+    [kHttpManager getCountryAndRegionListWithParams:nil andBlock:^(id  _Nonnull data, NSError * _Nonnull error) {
+        __strong typeof(weakSelf) self = weakSelf;
+        
+        if(kCode_Success){
+            NSLog(@"%@",[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:data options:0 error:nil] encoding:NSUTF8StringEncoding]);
+            
+            MOCountryBaseData *countryBase = [MOCountryBaseData modelObjectWithDictionary:data[@"data"]];
+            
+            if(countryBase.countryList.count > 0){
+                MOCountryList *firstObject = countryBase.countryList.firstObject;
+                firstObject.isChoose = YES;
+                
+                self.selectModel = firstObject;
+            }
+            
+            
+            self.countryArr = [countryBase.countryList mutableCopy];
+
+            self.countryView.dataArr = [self.countryArr mutableCopy];
+            
+            [self updataUIWithProperty];
+        }
+        else
+        {
+            kShowNetError(data)
+        }
+    }];
+}
+
+- (void)updataUIWithProperty{
+    CGFloat height = 155.0;
+    if(self.countryArr.count > 0){
+        height = ceil(self.countryArr.count / 2.0) * 50 + 55.0;
+    }
+    [self.countryView mas_updateConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(height);
+    }];
 }
 
-/*
-#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.
+- (void)setupUI{
+    [self.view addSubview:self.bgImgView];
+    [self.bgImgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.mas_equalTo(0);
+    }];
+    
+    [self.view addSubview:self.topImgView];
+    [self.topImgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.left.right.mas_equalTo(0);
+        make.height.mas_equalTo(kScaleWidth(285));
+    }];
+    
+    [self.view addSubview:self.scrollView];
+    [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(STATUS_BAR_HEIGHT + 17);
+        make.left.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(HOME_KEY_HEIGHT - 74);
+        make.width.mas_equalTo(SCREENWIDTH);
+    }];
+    
+    [self.scrollView addSubview:self.scrollContainerView];
+    [self.scrollContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(self.scrollView);
+        make.width.equalTo(self.scrollView);
+    }];
+    
+    [self.scrollContainerView addSubview:self.countryView];
+    [self.countryView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.left.right.mas_equalTo(0);
+        make.height.mas_equalTo(155);
+    }];
+    
+    [self.scrollContainerView addSubview:self.recommendTitle];
+    [self.recommendTitle mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.countryView.mas_bottom).offset(41);
+        make.left.mas_equalTo(26);
+    }];
+    
+    [self.scrollContainerView addSubview:self.collectionView];
+    [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.recommendTitle.mas_bottom).offset(18);
+        make.left.mas_equalTo(24);
+        make.right.mas_equalTo(-24);
+        make.height.mas_equalTo(555);
+    }];
+    
+    [self.scrollContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.bottom.equalTo(self.collectionView).offset(20);
+    }];
+
+    [self.view addSubview:self.finishBtn];
+    CGFloat bottomOffset = KIsiPhoneX ? 20 : 0;
+    [self.finishBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(20);
+        make.right.mas_equalTo(-20);
+        make.height.mas_equalTo(80);
+        make.bottom.mas_equalTo(-bottomOffset);
+    }];
+}
+
+- (void)finishBtnAction {
+    [self followTheRecommand];
 }
-*/
+
+- (void)followTheRecommand{
+    NSMutableArray *arr = [NSMutableArray array];
+    
+    for (MOUserProfile *object in self.dataArr) {
+        if(object.isSelect){
+            [arr addObject:object.id];
+        }
+    }
+    
+    if(arr.count == 0){
+        [self setUserInfoAboutCountyWith:self.selectModel];
+    } else{
+        NSDictionary *dict = @{@"type":@"1",
+                               @"target":arr};
+        
+        WEAKSELF
+        [kHttpManager toSubmitForFollowWithParams:dict andBlock:^(id  _Nonnull data, NSError * _Nonnull error) {
+            if(kCode_Success){
+//                [MBProgressHUD showTipMessageInWindow:NSLocalString(@"mimo_common_success")];
+                [weakSelf setUserInfoAboutCountyWith:weakSelf.selectModel];
+            }
+            else{
+                kShowNetError(data)
+            }
+        }];
+    }
+}
+
+- (void)setUserInfoAboutCountyWith:(MOCountryList *)model{
+    
+    WEAKSELF
+    if(model.code.length == 0){
+        return;
+    }
+    
+    NSString *countryStr = model.code;
+    
+    NSDictionary *dict = @{@"country":countryStr};
+    
+    [kHttpManager toSettingInfoWithParams:dict andBlock:^(id  _Nonnull data, NSError * _Nonnull error) {
+        if(kCode_Success){
+            [MBProgressHUD showTipMessageInWindow:NSLocalString(@"mimo_common_success")];
+            [weakSelf performSelector:@selector(toMainVC) withObject:nil afterDelay:1.0];
+        }
+        else{
+            kShowNetError(data)
+        }
+    }];
+}
+
+- (void)toMainVC {
+    SendNotification(@"kNotification_MOCountryAndRecommendVCDismiss")//选择语言和推荐主播页面退出通知
+    if (self.navigationController.presentingViewController) {//如果是present出来的要dismiss
+        [self.navigationController dismissViewControllerAnimated:YES completion:nil];
+    }
+    
+    MOMainTabController *mainTabbar = [MOMainTabController sharedSingleton];
+    [mainTabbar toResetSetupTabbar];
+    [UIApplication sharedApplication].keyWindow.rootViewController = mainTabbar;
+}
+
+#pragma mark --UICollectionViewDatasource & delegate
+- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
+    return 1;
+}
+
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
+    return self.dataArr.count;
+}
+
+-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
+
+    MOUserProfile *model = self.dataArr[indexPath.row];
+    MORecommendAnchorCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:MORecommendAnchorCell_ID forIndexPath:indexPath];
+    
+    cell.cellModel = model;
+    WEAKSELF
+    cell.itemClickBlock = ^(MOUserProfile * _Nonnull cellModel) {
+        
+        for (MOUserProfile *object in weakSelf.dataArr) {
+            if([cellModel.id isEqualToString:object.id]){
+                object.isSelect = !object.isSelect;
+                break;
+            }
+        }
+        
+        [weakSelf.collectionView reloadData];
+        
+    };
+    
+    return cell;
+}
+                        
+
+- (UIImageView *)bgImgView {
+    if (!_bgImgView) {
+        _bgImgView = [[UIImageView alloc] init];
+        NSArray *bgImgColorArr = @[[MOTools colorWithHexString:@"#EDF1FD" alpha:1.0],[MOTools colorWithHexString:@"#FAFAFC" alpha:1.0]];
+        UIImage *bgImage = [MOTools createGradientRectImageWithBounds:CGRectMake(0, 0, SCREENWIDTH, SCREENHEIGHT) Colors:bgImgColorArr GradientType:1];
+        _bgImgView.image = bgImage;
+    }
+    return _bgImgView;
+}
+
+- (UIImageView *)topImgView {
+    if (!_topImgView) {
+        _topImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_welcome_top_bg"]];
+    }
+    return _topImgView;
+}
+
+- (UIScrollView *)scrollView {
+    if (!_scrollView) {
+        _scrollView = [[UIScrollView alloc] init];
+        _scrollView.backgroundColor = [UIColor clearColor];
+        _scrollView.alwaysBounceVertical = YES;
+        _scrollView.bounces = YES;
+    }
+    return _scrollView;
+}
+
+- (UIView *)scrollContainerView {
+    if (!_scrollContainerView) {
+        _scrollContainerView = [[UIView alloc] init];
+        _scrollContainerView.backgroundColor = [UIColor clearColor];
+    }
+    return _scrollContainerView;
+}
+
+- (MOLanguageItemView *)countryView {
+    if (!_countryView) {
+        _countryView = [[MOLanguageItemView alloc] init];
+        _countryView.titleLab.text = @"Select country";
+        WEAKSELF
+        _countryView.selectBlock = ^(MOCountryList * _Nonnull itemModel) {
+            weakSelf.selectModel = itemModel;
+        };
+    }
+    return _countryView;
+}
+
+- (UILabel *)recommendTitle {
+    if (!_recommendTitle) {
+        _recommendTitle = [[UILabel alloc] init];
+        _recommendTitle.text = @"Anchor Recommend";
+        _recommendTitle.font = [MOTextTools getTheFontWithSize:20.0 AndFontName:@"Akrobat"];
+        _recommendTitle.textColor = [MOTools colorWithHexString:@"#282828" alpha:1.0];
+        _recommendTitle.textAlignment = NSTextAlignmentLeft;
+        _recommendTitle.numberOfLines = 0;
+    }
+    return _recommendTitle;
+}
+
+
+- (UICollectionView *)collectionView {
+    if (!_collectionView) {
+        MORecommendFlowLayout *flow = [[MORecommendFlowLayout alloc] init];
+        flow.itemSize = CGSizeMake(90.0, 120.0);
+        flow.minimumLineSpacing = 10.0;//行间距
+        flow.minimumInteritemSpacing = 10.0;//列间距
+        _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, SCREENWIDTH, 400) collectionViewLayout:flow];
+        [_collectionView registerNib:[UINib nibWithNibName:@"MORecommendAnchorCell" bundle:nil] forCellWithReuseIdentifier:@"MORecommendAnchorCell_ID"];
+        _collectionView.contentInset = UIEdgeInsetsMake(18, 0, 20, 0);
+        _collectionView.scrollEnabled = NO;
+        
+        _collectionView.layer.masksToBounds = YES;
+        _collectionView.layer.cornerRadius = 13;
+        _collectionView.dataSource = self;
+        _collectionView.delegate = self;
+    }
+    return _collectionView;
+}
+
+- (NSMutableArray *)dataArr{
+    if(!_dataArr){
+        _dataArr = [NSMutableArray array];
+    }
+    
+    return _dataArr;
+}
+
+- (UIButton *)finishBtn {
+    if (!_finishBtn) {
+        _finishBtn = [[UIButton alloc] init];
+        [_finishBtn setImage:[UIImage imageNamed:@"icon_next_step"] forState:UIControlStateNormal];
+        [_finishBtn setFont:[MOTextTools getTheFontWithSize:20.0 AndFontName:@"Akrobat"]];
+        [_finishBtn setTitle:@"Finish" forState:UIControlStateNormal];
+        [_finishBtn setTitleColor:[MOTools colorWithHexString:@"#000000"] forState:UIControlStateNormal];
+        _finishBtn.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
+        _finishBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 0);
+        [_finishBtn addTarget:self action:@selector(finishBtnAction) forControlEvents:UIControlEventTouchUpInside];
+        [_finishBtn setBackgroundImage:[UIImage imageNamed:@"icon_next_step_btn_bg_apple"] forState:UIControlStateNormal];
+    }
+    return _finishBtn;
+}
+
 
 @end

+ 0 - 22
MiMoLive/MiMoLive/Classes/Welcome/MOCountryAndRecommendVC.xib

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
-        <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="MOCountryAndRecommendVC">
-            <connections>
-                <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"/>
-            <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
-            <viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
-        </view>
-    </objects>
-</document>

+ 3 - 2
MiMoLive/MiMoLive/Classes/Welcome/MOFirstInfoSetVC.m

@@ -10,6 +10,7 @@
 #import "MOImagePickerController.h"
 #import "MOAnchorRecommendVC.h"
 #import "UIImage+YYAdd.h"
+#import "MOCountryAndRecommendVC.h"
 
 @interface MOFirstInfoSetVC ()<TZImagePickerControllerDelegate>
 
@@ -203,7 +204,7 @@
     [kHttpManager toSettingInfoWithParams:dict andBlock:^(id  _Nonnull data, NSError * _Nonnull error) {
         if(kCode_Success){
             
-            [MBProgressHUD showTipMessageInWindow:NSLocalString(@"mimo_common_success")];
+//            [MBProgressHUD showTipMessageInWindow:NSLocalString(@"mimo_common_success")];
             
             NSDictionary *baseDict = data[@"data"];
             
@@ -224,7 +225,7 @@
             }
             [[NSUserDefaults standardUserDefaults] synchronize];
             
-            POLanguageVC *vc = [[POLanguageVC alloc] init];
+            MOCountryAndRecommendVC *vc = [[MOCountryAndRecommendVC alloc] init];
             [weakSelf.navigationController pushViewController:vc animated:YES];
         }
         else{

+ 1 - 1
MiMoLive/MiMoLive/Classes/Welcome/View/MOLanguageItemCell.h

@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
 @interface MOLanguageItemCell : UICollectionViewCell
 
 @property (nonatomic, strong) UIView *bgView;
-
+@property (nonatomic, strong) UIImageView *iconImgView;
 @property (nonatomic, strong) UILabel *titleLab;
 
 @property (nonatomic, strong) UIImageView *selectImg;

+ 22 - 7
MiMoLive/MiMoLive/Classes/Welcome/View/MOLanguageItemCell.m

@@ -24,14 +24,19 @@
 {
     [self bgView];
     
-    self.bgView.layer.cornerRadius = 54.0 / 2.0;
+    self.bgView.layer.cornerRadius = 15;
     self.bgView.layer.masksToBounds = YES;
     
+    [self.bgView addSubview:self.iconImgView];
+    [self.iconImgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(9);
+        make.centerY.mas_equalTo(0);
+        make.size.mas_equalTo(CGSizeMake(16, 16));
+    }];
+    
     [self.bgView addSubview:self.titleLab];
     [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.equalTo(self.bgView);
-        make.right.equalTo(self.bgView);
-        make.centerY.equalTo(self.bgView.mas_centerY);
+        make.center.mas_equalTo(0);
         make.height.greaterThanOrEqualTo(@16.0);
     }];
     
@@ -47,11 +52,11 @@
     _model = model;
     
     self.titleLab.text = model.name;
-    
+    [self.iconImgView sd_setImageWithURL:[NSURL URLWithString:model.icon2]];
     if(model.isChoose)
     {
         self.bgView.backgroundColor = [MOTools colorWithHexString:@"#0BDDFC" alpha:1.0];
-        self.titleLab.textColor = [MOTools colorWithHexString:@"#FFFFFF" alpha:1.0];
+        self.titleLab.textColor = [MOTools colorWithHexString:@"#282828" alpha:1.0];
 //        self.selectImg.hidden = NO;
         
     }
@@ -79,13 +84,23 @@
     return _bgView;
 }
 
+- (UIImageView *)iconImgView {
+    if (!_iconImgView) {
+        _iconImgView = [[UIImageView alloc] init];
+        _iconImgView.contentMode = UIViewContentModeScaleAspectFill;
+        _iconImgView.layer.cornerRadius = 8;
+        _iconImgView.layer.masksToBounds = YES;
+    }
+    return _iconImgView;
+}
+
 - (UILabel *)titleLab
 {
     if (!_titleLab)
     {
         _titleLab = [[UILabel alloc] init];
         _titleLab.text = @"";
-        _titleLab.font = [MOTextTools getTheFontWithSize:20.0 AndFontName:@"Akrobat"];
+        _titleLab.font = [MOTextTools getTheFontWithSize:18.0 AndFontName:@"Akrobat"];
         _titleLab.textColor = [MOTools colorWithHexString:@"#ABABAB" alpha:1.0];
         _titleLab.textAlignment = NSTextAlignmentCenter;
         _titleLab.numberOfLines = 0;

+ 12 - 11
MiMoLive/MiMoLive/Classes/Welcome/View/MOLanguageItemView.m

@@ -61,9 +61,9 @@
     
     [self addSubview:self.collectionView];
     [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make){
-        make.top.equalTo(self).offset(70.0);
-        make.left.equalTo(self).offset(27.0);
-        make.right.equalTo(self).offset(-27.0);
+        make.top.equalTo(self.titleLab.mas_bottom).offset(15);
+        make.left.equalTo(self).offset(24.0);
+        make.right.equalTo(self).offset(-24.0);
         make.bottom.equalTo(self);
     }];
 }
@@ -114,7 +114,7 @@
         _titleLab = [[UILabel alloc] init];
         _titleLab.text = @"";
         _titleLab.font = [MOTextTools getTheFontWithSize:20.0 AndFontName:@"Akrobat"];
-        _titleLab.textColor = [MOTools colorWithHexString:@"#737373" alpha:1.0];
+        _titleLab.textColor = [MOTools colorWithHexString:@"#282828" alpha:1.0];
         _titleLab.textAlignment = NSTextAlignmentLeft;
         _titleLab.numberOfLines = 0;
  
@@ -128,19 +128,20 @@
     {
         UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc] init];
         
-        CGFloat width = (SCREENWIDTH - 13.0 - 27.0 * 2.0) / 2.0;
-        CGFloat height = 54.0;
+        CGFloat width = (SCREENWIDTH - 39.0 * 2.0 - 10) / 2.0;
+        CGFloat height = 30.0;
         
         flow.itemSize = CGSizeMake(width, height);
-        flow.minimumLineSpacing = 12.0;//行间距
-        flow.minimumInteritemSpacing = 12.0;//列间距
-        flow.sectionInset = UIEdgeInsetsMake(9, 0, 0, 0);
+        flow.minimumLineSpacing = 10;//行间距
+        flow.minimumInteritemSpacing = 10;//列间距
+        flow.sectionInset = UIEdgeInsetsMake(15, 15, 15, 15);
         _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, (SCREENWIDTH - 12.0 * 2), 100) collectionViewLayout:flow];
         _collectionView.allowsMultipleSelection = YES;
-        _collectionView.backgroundColor = [UIColor clearColor];
+        _collectionView.backgroundColor = [MOTools colorWithHexString:@"#FFFFFF"];
         
         [_collectionView registerClass:[MOLanguageItemCell class] forCellWithReuseIdentifier:MOLanguageItemCell_ID];
-        
+        _collectionView.layer.masksToBounds = YES;
+        _collectionView.layer.cornerRadius = 13;
         _collectionView.dataSource = self;
         _collectionView.delegate = self;
     }

+ 2 - 0
MiMoLive/MiMoLive/Global/NetManager/MOAPIUrl.h

@@ -20,6 +20,8 @@ typedef enum
 
 #pragma mark =========== Login ============
 
+//用户引导信息 - 获取用户引导状态
+#define KNetPath_Code_Guide      @"/user/guide/get"
 //密码登入
 #define KNetPath_Code_PwdEnter      @"/user/login/pwd/enter"
 //验证码登入

+ 4 - 0
MiMoLive/MiMoLive/Global/NetManager/MOHttpManager.h

@@ -25,6 +25,10 @@ NS_ASSUME_NONNULL_BEGIN
 
 #pragma mark =========== Login ============
 
+/// 用户引导信息 - 获取用户引导状态
+/// result=引导状态,(0=无注册引导,1=进入编辑资料页面,2=进入关注主播页面)
+- (void)getGuideWithParams:(id)params andBlock:(void (^)(id data, NSError *error))block;
+
 /// 登录,手机 + 密码 - 登入
 /// - Parameters:
 ///   - params: 参数

+ 19 - 0
MiMoLive/MiMoLive/Global/NetManager/MOHttpManager.m

@@ -38,6 +38,25 @@
 }
 
 #pragma mark =========== Login ============
+/// 用户引导信息 - 获取用户引导状态
+/// result=引导状态,(0=无注册引导,1=进入编辑资料页面,2=进入关注主播页面)
+- (void)getGuideWithParams:(id)params andBlock:(void (^)(id data, NSError *error))block {
+    [[MONetAPIClient sharedJsonClient] requestJsonDataWithPath:[NSString stringWithFormat:@"%@",KNetPath_Code_Guide] withParams:params withMethodType:Post andBlock:^(id data, NSError *error)
+     {
+        if (data)
+        {
+            if ([self handleError:data])
+            {
+                block(data, nil);
+            }
+        }
+        else
+        {
+            block(nil, error);
+        }
+    }];
+}
+
 /// 登录,手机 + 密码 - 登入
 /// - Parameters:
 ///   - params: 参数