CNLiveCMineViewModuleImpl.m 7.41 KB
//
//  CNLiveCMineViewModuleImpl.m
//  CNLiveCMineModule_Example
//
//  Created by open on 2021/12/29.
//  Copyright © 2021 杨苓玉. All rights reserved.
//

#import "CNLiveCMineViewModuleImpl.h"
#import <CNLiveUserManagement/CNUserInfoManager.h>
//CNLiveSDK
#import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h>
@implementation CNLiveCMineViewModuleImpl
#define CNUserShareModel CNUserShareManager.userInfoModel

/// 我的积分跳转主工程我的客服界面
-(void)pushCMineInteContentForCMainPlatFromCurrentVC:(UIViewController *)currentVC
{
    
}


/// 我的积分跳转主工程webView界面
/// @param url 链接地址
- (void)pushCMineInteContentForCMainWebViewWithURL:(nonnull NSString *)url statue:(CNLiveCMineIntePushWebViewStatue)statue {
    
}

- (void)pushCMineInteContentForCMainCustomFunctionVCParam:(nonnull NSDictionary *)param CurrentVC:(nonnull UIViewController *)currentVC {
    
}


/// 积分任务跳转到不同界面去完成
/// @param param 参数
-(void)pushCMineInteContentForCMainCustomFunctionVCParam:(NSDictionary *)param
{
    NSLog(@"跳转不同积分任务=>%@",param);
}
- (void)pushCMinePagesEvent:(NSString *)event{
//    [CNLiveStatClick event:event];
}
- (void)saveImageWithImage:(UIImage *)image{
//    [[CNVideoAndImageTool sharedCNVideoAndImageTool] saveMediaDataForPhoto:self.codeView.image Video:nil AblumForComplterBlock:^(BOOL success) {
//        
//        [QMUITips hideAllToastInView:AppKeyWindow animated:YES];
//        
//        if(success){
//            [QMUITips showSucceed:@"已保存到相册" inView:AppKeyWindow hideAfterDelay:1.5];
//        }else{
//            [QMUITips showError:@"保存图片失败" inView:AppKeyWindow hideAfterDelay:1.5];
//        }
//    }];

}

/// 获取二维码
/// @param fromT 需要参数
/// @param type 需要参数
- (UIImage *)loadSGQRCodeGenImage:(NSString *)fromT type:(NSString *)type{
//    NSDictionary *dic = @{@"content":[EncryptAndDecrypt base64StringFromText:fromT encryptKey:AppDESKey],@"type":type};
//    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
//    UIImage *image = [SGQRCodeGenerateManager generateWithLogoQRCodeData:jsonStr logoImageName:@"ewm_lcon" logoScaleToSuperView:0.2];
    return [UIImage new];
}
- (void)appLoginOut:(BOOL)closePush{
//    //退出登录
//    [CNLiveBBASMModuleService accountLogout];
//    /*** app音视频退出 ***/
//    [[NSNotificationCenter defaultCenter] postNotificationName:WjjChatAudioOrVideoNotifacation object:nil];
//
//    [CNAudioOrVideoMananger InitializeDefault];
//    [[CNAudioPlayerManager sharedInstance] stopPlaying];
//    [[TIMManager sharedInstance] removeMessageListener:[IMAPlatform sharedInstance].conversationMgr];
//    UITabBarController *tabbarVC = (UITabBarController *)[AppDelegate sharedAppDelegate].window.rootViewController;
//    UINavigationController *nav = [tabbarVC.viewControllers firstObject];
//    CNAttentionViewController *attentionVC = [nav.viewControllers firstObject];
//    [attentionVC removeAllObserver];
//
//    /**关闭人工客服通道*/
//    [[CNSobotManager manager] outCurrentUser:NO];
//
//    /**退出IM连接*/
//    [[IMAPlatform sharedInstance] logout:^{
//        [CNLiveDataStepManager requestStepWithLoginOutWithMethod:[CNUserInfoManager manager].userInfoModel.uid];
//        [[CNHomePageLoginIMManger manager] removeAllObserver];
//        [[NSNotificationCenter defaultCenter] postNotificationName:kIMAMSG_logoutNotification object:nil];
//        [CNUserInfoManager loginOut];
//        #pragma mark -清空上海电商用户信息
//        [[AppDelegate sharedAppDelegate] enterLoginUI];
//        [CNShareExtensionGroup deleteMyInfoInShareGroup];
////                    [CNShareExtensionModel loginOutTIMPlatServer];
//        [[NSUserDefaults standardUserDefaults] setValue:nil forKey:@"findStrangerSwitch"];
//        [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"TouristsLoginChannelId"];//游客模式
//        [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"TouristsLoginClassifyId"];
//        [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"TouristsLoginUrl"];
//        [[NSUserDefaults standardUserDefaults] setBool:NO forKey:CNWjjIsYiDongBoxUserKey];
//        [[NSUserDefaults standardUserDefaults] setBool:NO forKey:CNWjjRemoteControlStatusKey];
//        [[NSUserDefaults standardUserDefaults] synchronize];
//        [[DSCnliveShopSDKManager sharedManager] loginUser:@""];
//        [AppDelegate sharedAppDelegate].loginPrepositionUrl = @"";
//
//        NSLog(@"----------清除");
//
//    } fail:^(int code, NSString *msg) {
//        [CNLiveDataStepManager requestStepWithLoginOutWithMethod:[CNUserInfoManager manager].userInfoModel.uid];
//        [[CNHomePageLoginIMManger manager] removeAllObserver];
//        [[NSNotificationCenter defaultCenter] postNotificationName:kIMAMSG_logoutNotification object:nil];
//
//        [CNUserInfoManager loginOut];
//        #pragma mark -清空上海电商用户信息
//        [[AppDelegate sharedAppDelegate] enterLoginUI];
//        [CNShareExtensionGroup deleteMyInfoInShareGroup];
////                    [CNShareExtensionModel loginOutTIMPlatServer];
//        [[NSUserDefaults standardUserDefaults] setValue:nil forKey:@"findStrangerSwitch"];
//        [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"TouristsLoginChannelId"];//游客模式
//        [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"TouristsLoginClassifyId"];
//        [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"TouristsLoginUrl"];
//        [[NSUserDefaults standardUserDefaults] setBool:NO forKey:CNWjjIsYiDongBoxUserKey];
//        [[NSUserDefaults standardUserDefaults] setBool:NO forKey:CNWjjRemoteControlStatusKey];
//        [[NSUserDefaults standardUserDefaults] synchronize];
//        [[DSCnliveShopSDKManager sharedManager] loginUser:@""];
//        [AppDelegate sharedAppDelegate].loginPrepositionUrl = @"";
//        NSLog(@"----------清除");
//  }];
}
- (void)sendMessageWithCodeType:(CNLiveMobileType) type mobile:(NSString *)pNumber contryCode:(NSString *)contryCode verificationCode:(NSString *)verifiCode success:(void(^)(id result))success failure:(void(^)(NSDictionary *errorDic))failure{
    if (type == CNLiveMobileTypeRegisen) {
        [CNLiveUserSystemCenter verificationCodeType:VerificationCodeTypeRegister mobile:pNumber countryCode:contryCode success:^(id result) {
            if (success) {
                success(result);
            }
            
        } failure:^(NSDictionary *errorDic) {
            
            if (failure) {
                failure(errorDic);
            }
            
        }];
    }else if (type == CNLiveMobileTypeUpdate){
        [CNLiveUserSystemCenter updateMobileWithUid:CNUserShareModel.uid mobile:pNumber countryCode:contryCode verificationCode:verifiCode success:^(id result) {
            if (success) {
                success(result);
            }
            
        } failure:^(NSDictionary *errorDic) {
            if (failure) {
                failure(errorDic);
            }
        }];
    }
   
}
- (void)pushCMineContentForCMainPlatWithType:(NSInteger)type param:(NSDictionary *)param contentVC:(UIViewController *)contetVC{
    
}
- (void)skipType:(NSString*)type to:(NSString*)to shopType:(NSString*)shopType currentVC:(UIViewController*)currentVC{
    
}
@end