Commit 84ad80c4108d12f3deeea31e1aefaa4f13e8dfb6
1 parent
bf530c6b
提交
Showing
11 changed files
with
176 additions
and
14 deletions
CNLiveServiceCenterModule.podspec
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Controller/CNLiveBServiceCenterController.m
| ... | ... | @@ -13,6 +13,14 @@ |
| 13 | 13 | #import "CNLiveBServiceHelpLearnCell.h" |
| 14 | 14 | #import "CNLiveBServiceCenterModel.h" |
| 15 | 15 | #import "CNLiveBServiceWorkCell.h" |
| 16 | +#import <CNLiveEnvironment/CNLiveEnvironment.h> | |
| 17 | +#import <CNLiveRequestBastKit/CNLiveNetworkRequest.h> | |
| 18 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | |
| 19 | +#import <CNLiveUserManagement/CNUserInfoManager.h> | |
| 20 | +#import <CNLiveBeeHive/CNLiveBeeHive.h> | |
| 21 | +#import "CNLiveBOrganizationValidationProtocol.h" | |
| 22 | + | |
| 23 | +#define CNLiveBGetServiceStatusUrl cn_API_OpenApi2(@"/user/readWJJBStatusById") | |
| 16 | 24 | |
| 17 | 25 | |
| 18 | 26 | @interface CNLiveBServiceCenterController ()<UITableViewDataSource,UITableViewDelegate> |
| ... | ... | @@ -23,6 +31,9 @@ |
| 23 | 31 | /** 列表 */ |
| 24 | 32 | @property (nonatomic , strong) UITableView *tableView; |
| 25 | 33 | |
| 34 | +/** 状态部分*/ | |
| 35 | + | |
| 36 | + | |
| 26 | 37 | @end |
| 27 | 38 | |
| 28 | 39 | @implementation CNLiveBServiceCenterController |
| ... | ... | @@ -47,6 +58,7 @@ |
| 47 | 58 | - (void)viewWillAppear:(BOOL)animated { |
| 48 | 59 | [super viewWillAppear:animated]; |
| 49 | 60 | self.navigationController.navigationBarHidden = YES; |
| 61 | +// [self loadStatus]; | |
| 50 | 62 | } |
| 51 | 63 | |
| 52 | 64 | - (void)viewDidLoad { |
| ... | ... | @@ -57,6 +69,8 @@ |
| 57 | 69 | |
| 58 | 70 | - (void)viewDidAppear:(BOOL)animated { |
| 59 | 71 | [super viewDidAppear:animated]; |
| 72 | + | |
| 73 | + | |
| 60 | 74 | } |
| 61 | 75 | |
| 62 | 76 | - (void)viewDidDisappear:(BOOL)animated { |
| ... | ... | @@ -210,6 +224,13 @@ |
| 210 | 224 | /** 点击cell实现 */ |
| 211 | 225 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
| 212 | 226 | |
| 227 | + if (indexPath.section == 0) { | |
| 228 | + if (indexPath.row == 1) { | |
| 229 | + id<CNLiveBOrganizationValidationProtocol> organizationValidationProtocol = [[BeeHive shareInstance] createService:@protocol(CNLiveBOrganizationValidationProtocol)]; | |
| 230 | + UIViewController *vc = [organizationValidationProtocol getOrganizationValidationController:@{}]; | |
| 231 | + [self.navigationController pushViewController:vc animated:YES]; | |
| 232 | + } | |
| 233 | + } | |
| 213 | 234 | |
| 214 | 235 | |
| 215 | 236 | } |
| ... | ... | @@ -239,6 +260,51 @@ |
| 239 | 260 | |
| 240 | 261 | #pragma mark - |
| 241 | 262 | #pragma mark - *** 接口 *** |
| 263 | +- (void)loadStatus{ | |
| 264 | +#pragma mark - TODO:请求路径刷新 | |
| 265 | + | |
| 266 | + NSString *strUrl = CNLiveBGetServiceStatusUrl; | |
| 267 | + NSString *appId = [NSString stringWithFormat:@"%@",AppId]; | |
| 268 | + NSString *uid = [NSString stringWithFormat:@"%@",@"10514333"];//CNUserShareModel.uid | |
| 269 | + NSString *token = [NSString stringWithFormat:@"%@",@"RkFYeLkl/u5S7tW8UcOkT/BgxDgw4wRl2IcNNhtX0dlnOLY/PL7CjnmmJyhKGpkj"];//CNUserShareModel.token | |
| 270 | +// //将参数进行排序,用 a=b&c=d 的拼接成字符串,最后拼上 key=AppKey | |
| 271 | +// NSString *sortString = [NSString stringWithFormat:@"%@&key=%@", [TIMTools sortParameters:params], APPKey]; | |
| 272 | +// //对排序过的参数进行sha1加密,并转成大写 | |
| 273 | +// NSString *signString = [[TIMTools sha1:sortString] uppercaseString]; | |
| 274 | +#pragma mark - TODO:请求路径刷新 | |
| 275 | + NSDictionary *dict = @{ | |
| 276 | + @"appId":appId, | |
| 277 | + @"uid":uid, | |
| 278 | + @"clientPlat":@"i", | |
| 279 | + @"token":token, | |
| 280 | +// @"sign":@"2A5F8868275C4562801D8F75DDE21D2BF9CA156F", | |
| 281 | + }; | |
| 282 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 283 | + [CNLiveNetworking setupShowDataResult:NO]; | |
| 284 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 285 | + | |
| 286 | + NSLog(@"获取用户状态数据 = %@",responseObject); | |
| 287 | + | |
| 288 | + NSString *resultCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]]; | |
| 289 | + NSError *err = nil; | |
| 290 | + id data = nil; | |
| 291 | + if([resultCode isEqualToString:@"0"]) { | |
| 292 | + data = responseObject[@"data"]; | |
| 293 | + } else { | |
| 294 | + @try { | |
| 295 | + err = [[NSError alloc] initWithDomain:responseObject[@"errorMessage"] code:[resultCode integerValue] userInfo:nil]; | |
| 296 | + } @catch (NSException *exception) { | |
| 297 | + err = [[NSError alloc] initWithDomain:@"接口异常" code:500 userInfo:nil]; | |
| 298 | + } | |
| 299 | + } | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + }]; | |
| 304 | + | |
| 305 | + | |
| 306 | +} | |
| 307 | + | |
| 242 | 308 | |
| 243 | 309 | #pragma mark - |
| 244 | 310 | #pragma mark - *** 私有属性 *** | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Service/CNLiveBCenterService.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBCenterService.h | |
| 3 | +// CNLiveServiceCenterModule | |
| 4 | +// | |
| 5 | +// Created by 梁星国 on 2020/4/15. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import "CNLiveBServiceCenterProtocol.h" | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | +@interface CNLiveBCenterService : NSObject | |
| 14 | + | |
| 15 | +@end | |
| 16 | + | |
| 17 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Service/CNLiveBCenterService.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBCenterService.m | |
| 3 | +// CNLiveServiceCenterModule | |
| 4 | +// | |
| 5 | +// Created by 梁星国 on 2020/4/15. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveBCenterService.h" | |
| 9 | +#import "CNLiveBServiceCenterController.h" | |
| 10 | + | |
| 11 | +@interface CNLiveBCenterService()<CNLiveBServiceCenterProtocol> | |
| 12 | + | |
| 13 | +/** shopVC */ | |
| 14 | +@property (nonatomic ,strong) CNLiveBServiceCenterController * serviceCenterVC; | |
| 15 | + | |
| 16 | +@end | |
| 17 | + | |
| 18 | +@BeeHiveService(CNLiveBServiceCenterProtocol, CNLiveBCenterService) | |
| 19 | + | |
| 20 | +@implementation CNLiveBCenterService | |
| 21 | + | |
| 22 | +- (UIViewController *)serviceCenterViewController | |
| 23 | +{ | |
| 24 | + CNLiveBServiceCenterController *serviceCenterVC = (CNLiveBServiceCenterController *)[self getServicceCenterViewController]; | |
| 25 | + return serviceCenterVC; | |
| 26 | +} | |
| 27 | + | |
| 28 | +- (UIViewController *)getServicceCenterViewController | |
| 29 | +{ | |
| 30 | + if (!_serviceCenterVC) { | |
| 31 | + _serviceCenterVC = [[CNLiveBServiceCenterController alloc] init]; | |
| 32 | + } | |
| 33 | + return _serviceCenterVC; | |
| 34 | +} | |
| 35 | + | |
| 36 | +@end | |
| 37 | + | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceCenterHeaderView.h
| ... | ... | @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN |
| 16 | 16 | /*** 服务页面背景 ***/ |
| 17 | 17 | @property (nonatomic, strong) UIImageView *bgHeaderImageV; |
| 18 | 18 | |
| 19 | -- (void)configUI:(CNLiveBServiceCenterModel *)model; | |
| 19 | +- (void)configUIWithIsWjj:(NSInteger)isWjj isPerson:(NSInteger)isPerson isEnterprise:(NSInteger)isEnterprise; | |
| 20 | 20 | |
| 21 | 21 | @property (nonatomic, strong) CNLiveBServiceCenterModel *model; |
| 22 | 22 | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceCenterHeaderView.m
| ... | ... | @@ -10,6 +10,11 @@ |
| 10 | 10 | #import <Masonry/Masonry.h> |
| 11 | 11 | #import "UIImage+Service.h" |
| 12 | 12 | #import <CNLiveBaseKit/CNLiveBaseKit.h> |
| 13 | +#import <SDWebImage/SDWebImage.h> | |
| 14 | +#import <CNLiveEnvironment/CNLiveEnvironment.h> | |
| 15 | +#import <CNLiveRequestBastKit/CNLiveNetworkRequest.h> | |
| 16 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | |
| 17 | +#import <CNLiveUserManagement/CNUserInfoManager.h> | |
| 13 | 18 | |
| 14 | 19 | |
| 15 | 20 | |
| ... | ... | @@ -122,18 +127,13 @@ |
| 122 | 127 | UITapGestureRecognizer *enterViewTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(enterViewTap:)]; |
| 123 | 128 | [self.enterView addGestureRecognizer:enterViewTap]; |
| 124 | 129 | |
| 125 | - | |
| 126 | - | |
| 127 | - | |
| 128 | - | |
| 129 | - //测试 | |
| 130 | - self.userImageV.image = [UIImage imageNamedFromService:@"service_person"]; | |
| 131 | - self.userNameL.text = @"用户昵称"; | |
| 132 | - self.locationL.text = @"北京 朝阳"; | |
| 133 | - | |
| 134 | - | |
| 135 | - | |
| 136 | - | |
| 130 | + //用户信息 | |
| 131 | + NSString *userImagUrl = [NSString stringWithFormat:@"%@",CNUserShareModel.faceUrl]; | |
| 132 | + [self.userImageV sd_setImageWithURL:[NSURL URLWithString:userImagUrl] placeholderImage:[UIImage imageNamedFromService:@"service_person"]]; | |
| 133 | + NSString *userName = [NSString stringWithFormat:@"%@",CNUserShareModel.nickname]; | |
| 134 | + self.userNameL.text = userName; | |
| 135 | + NSString *userLoc = [NSString stringWithFormat:@"%@",CNUserShareModel.location]; | |
| 136 | + self.locationL.text = userLoc; | |
| 137 | 137 | |
| 138 | 138 | } |
| 139 | 139 | |
| ... | ... | @@ -196,7 +196,7 @@ |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | #pragma mark - editUI |
| 199 | -- (void)configUI:(CNLiveBServiceCenterModel *)model { | |
| 199 | +- (void)configUIWithIsWjj:(NSInteger)isWjj isPerson:(NSInteger)isPerson isEnterprise:(NSInteger)isEnterprise { | |
| 200 | 200 | |
| 201 | 201 | |
| 202 | 202 | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceCertificationCell.m
| ... | ... | @@ -34,6 +34,7 @@ |
| 34 | 34 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; |
| 35 | 35 | if (self) { |
| 36 | 36 | [self setupUI]; |
| 37 | + | |
| 37 | 38 | } |
| 38 | 39 | return self; |
| 39 | 40 | } |
| ... | ... | @@ -54,6 +55,8 @@ |
| 54 | 55 | #pragma mark - ***setupUI*** |
| 55 | 56 | - (void)setupUI { |
| 56 | 57 | |
| 58 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 59 | + | |
| 57 | 60 | [self setBackgroundColor:[UIColor whiteColor]]; |
| 58 | 61 | [self addSubview:self.cellBGimageV]; |
| 59 | 62 | [self addSubview:self.titleL]; | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceHelpLearnCell.m
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceWorkCell.m
Example/CNLiveServiceCenterModule.xcodeproj/project.pbxproj
| ... | ... | @@ -383,6 +383,7 @@ |
| 383 | 383 | "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", |
| 384 | 384 | "${BUILT_PRODUCTS_DIR}/CNLiveICloudPicker/CNLiveICloudPicker.framework", |
| 385 | 385 | "${BUILT_PRODUCTS_DIR}/CNLiveImagePickerController/CNLiveImagePickerController.framework", |
| 386 | + "${BUILT_PRODUCTS_DIR}/CNLiveModuleServiceProtocols/CNLiveModuleServiceProtocols.framework", | |
| 386 | 387 | "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", |
| 387 | 388 | "${BUILT_PRODUCTS_DIR}/CNLiveServiceCenterModule/CNLiveServiceCenterModule.framework", |
| 388 | 389 | "${BUILT_PRODUCTS_DIR}/CNLiveTripartiteManagement/CNLiveTripartiteManagement.framework", |
| ... | ... | @@ -427,6 +428,7 @@ |
| 427 | 428 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", |
| 428 | 429 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveICloudPicker.framework", |
| 429 | 430 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveImagePickerController.framework", |
| 431 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveModuleServiceProtocols.framework", | |
| 430 | 432 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", |
| 431 | 433 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveServiceCenterModule.framework", |
| 432 | 434 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveTripartiteManagement.framework", | ... | ... |
Example/CNLiveServiceCenterModule/CNLIVEBAppDelegate.m
| ... | ... | @@ -7,12 +7,20 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "CNLIVEBAppDelegate.h" |
| 10 | +#import <CNLiveRequestBastKit/CNLiveNetworkRequest.h> | |
| 11 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | |
| 12 | +#import <CNLiveUserManagement/CNUserInfoManager.h> | |
| 13 | +#import <CNLiveEnvironment/CNLiveEnvironment.h> | |
| 14 | + | |
| 15 | +static NSString * uuid; | |
| 10 | 16 | |
| 11 | 17 | @implementation CNLIVEBAppDelegate |
| 12 | 18 | |
| 13 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
| 14 | 20 | { |
| 15 | 21 | // Override point for customization after application launch. |
| 22 | + [self networkParamAction]; | |
| 23 | + [self appUUIDString]; | |
| 16 | 24 | return YES; |
| 17 | 25 | } |
| 18 | 26 | |
| ... | ... | @@ -43,4 +51,29 @@ |
| 43 | 51 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. |
| 44 | 52 | } |
| 45 | 53 | |
| 54 | +- (void)networkParamAction { | |
| 55 | + NSMutableDictionary * mDict = [[NSMutableDictionary alloc] init]; | |
| 56 | + [mDict setValue:@"10514333" forKey:@"loginSid"]; | |
| 57 | + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"] forKey:@"platform_id"]; | |
| 58 | + [mDict setValue:[self appUUIDString] forKey:@"uuid"]; | |
| 59 | + [mDict setValue:@"i" forKey:@"plat"]; | |
| 60 | + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"ver"]; | |
| 61 | + [mDict setObject:AppId forKey:@"appId"]; | |
| 62 | + [CNLiveNetworking setupDefaultParam:mDict]; | |
| 63 | + [CNLiveNetworking setupShowResult:NO]; | |
| 64 | + [CNLiveNetworking setupSignKey:APPKey]; | |
| 65 | + NSLog(@"打印appkey%@",APPKey); | |
| 66 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 67 | + [CNLiveNetworking setResponseSerializerType:CNLiveResponseSerializerJSON]; | |
| 68 | + | |
| 69 | +} | |
| 70 | +- (NSString *)appUUIDString | |
| 71 | + { | |
| 72 | + static dispatch_once_t onceToken; | |
| 73 | + dispatch_once(&onceToken, ^{ | |
| 74 | + uuid = [[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""]; | |
| 75 | + }); | |
| 76 | + return uuid; | |
| 77 | + } | |
| 78 | + | |
| 46 | 79 | @end | ... | ... |