Commit efcef9fc036b3adc334f8326d3d378d14a6baf49
1 parent
0909d70e
商务合作开发完成
Showing
39 changed files
with
880 additions
and
39 deletions
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/cooperation/Contents.json
0 → 100644
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/cooperation/cooperation_icon.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "required_icon@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "required_icon@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/cooperation/cooperation_icon.imageset/required_icon@2x.png
0 → 100644
619 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/cooperation/cooperation_icon.imageset/required_icon@3x.png
0 → 100644
1014 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/cooperation/cooperation_tip.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "description_icon@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "description_icon@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/cooperation/cooperation_tip.imageset/description_icon@2x.png
0 → 100644
1.47 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/cooperation/cooperation_tip.imageset/description_icon@3x.png
0 → 100644
2.26 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/mine_cooperation.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "cooperation_icon@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "cooperation_icon@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/mine_cooperation.imageset/cooperation_icon@2x.png
0 → 100644
4.07 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/mine_cooperation.imageset/cooperation_icon@3x.png
0 → 100644
7.2 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/pagecontrol_no.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "pagecontrol_no@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "pagecontrol_no@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/pagecontrol_no.imageset/pagecontrol_no@2x.png
0 → 100644
295 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/pagecontrol_no.imageset/pagecontrol_no@3x.png
0 → 100644
389 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/pagecontrol_yes.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "pagecontrol_yes@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "pagecontrol_yes@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/pagecontrol_yes.imageset/pagecontrol_yes@2x.png
0 → 100644
331 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.xcassets/Mine/pagecontrol_yes.imageset/pagecontrol_yes@3x.png
0 → 100644
408 Bytes
CNLiveCMineModule/Classes/CNCMine/Present/CNMinePresent.h
| ... | ... | @@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN |
| 52 | 52 | /// 改版评价提交 |
| 53 | 53 | /// @param message 评价内容 |
| 54 | 54 | /// @param responseBlock 返回数据 |
| 55 | -+ (void)requestFeedback:(NSString *)message secceedBlock:(void(^)(void))responseBlock; | |
| 55 | ++ (void)requestFeedback:(NSString *)message withName:(NSString *)name withMobile:(NSString *)mobile sourceType:(NSInteger)sourceType secceedBlock:(void(^)(NSString *errorMessage))responseBlock; | |
| 56 | 56 | |
| 57 | 57 | + (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(void(^)(NSString *h5,NSString *title))success failure:(void(^)(NSError *error))failure; |
| 58 | 58 | /// 是否展示社区按钮 | ... | ... |
CNLiveCMineModule/Classes/CNCMine/Present/CNMinePresent.m
| ... | ... | @@ -216,11 +216,7 @@ |
| 216 | 216 | NSArray *tools = nil; |
| 217 | 217 | NSString *isOperating = [[NSUserDefaults standardUserDefaults] valueForKey:@"CNWjjIsOperating"]; |
| 218 | 218 | if (type == CNToolDatasourceTypeFirst) { |
| 219 | - tools = @[ | |
| 220 | - @{ | |
| 221 | - @"title":@"", | |
| 222 | - @"type":@(5), | |
| 223 | - @"lists":@[ | |
| 219 | + NSArray *tool = @[ | |
| 224 | 220 | @{ |
| 225 | 221 | @"title":@"收货地址", |
| 226 | 222 | @"img":@"mine_shipping_address", |
| ... | ... | @@ -271,19 +267,50 @@ |
| 271 | 267 | @"width":@((kScreenWidth -DS_adapt_length(40))/4), |
| 272 | 268 | @"cellHeight":@(DS_adapt_length(65)) |
| 273 | 269 | }, |
| 274 | - ], | |
| 275 | - }, | |
| 270 | + @{ | |
| 271 | + @"title":@"商务合作", | |
| 272 | + @"img":@"mine_cooperation", | |
| 273 | + @"isBlack":@(YES), | |
| 274 | + @"width":@((kScreenWidth -DS_adapt_length(40))/4), | |
| 275 | + @"cellHeight":@(DS_adapt_length(65)) | |
| 276 | + }, | |
| 276 | 277 | ]; |
| 277 | - NSMutableArray *toolArray = [NSMutableArray arrayWithArray:tools]; | |
| 278 | + NSMutableArray *toolArray = [NSMutableArray array]; | |
| 279 | + if (tool.count>=8) { | |
| 280 | + NSDictionary *toolDic = @{ | |
| 281 | + @"title":@"", | |
| 282 | + @"type":@(5), | |
| 283 | + @"lists":tool | |
| 284 | + }; | |
| 285 | + [toolArray addObject:toolDic]; | |
| 286 | + }else{ | |
| 287 | + [toolArray addObjectsFromArray:tool]; | |
| 288 | + } | |
| 278 | 289 | if([isOperating isEqualToString:@"1"]){ |
| 279 | - [toolArray addObject:@{ | |
| 280 | - @"title":@"路径工具", | |
| 281 | - @"img":@"mine_record", | |
| 282 | - @"isBlack":@(YES), | |
| 283 | - @"width":@((kScreenWidth -DS_adapt_length(40))/4), | |
| 284 | - @"cellHeight":@(DS_adapt_length(65)) | |
| 290 | + NSDictionary *dic = @{ | |
| 291 | + @"title":@"路径工具", | |
| 292 | + @"img":@"mine_record", | |
| 293 | + @"isBlack":@(YES), | |
| 294 | + @"width":@((kScreenWidth -DS_adapt_length(40))/4), | |
| 295 | + @"cellHeight":@(DS_adapt_length(65)) | |
| 296 | + }; | |
| 297 | + if (tool.count >= 8) { | |
| 298 | + NSDictionary *toolDic = @{ | |
| 299 | + @"title":@"", | |
| 300 | + @"type":@(5), | |
| 301 | + @"lists":@[dic] | |
| 302 | + }; | |
| 303 | + [toolArray addObject:toolDic]; | |
| 304 | + }else{ | |
| 305 | + [toolArray addObject:dic]; | |
| 306 | + toolArray = @[@{ | |
| 307 | + @"title":@"", | |
| 308 | + @"type":@(5), | |
| 309 | + @"lists":toolArray.copy | |
| 285 | 310 | }]; |
| 286 | 311 | } |
| 312 | + | |
| 313 | + } | |
| 287 | 314 | tools = toolArray.copy; |
| 288 | 315 | }else{ |
| 289 | 316 | NSArray *secondArr =@[ |
| ... | ... | @@ -354,6 +381,13 @@ |
| 354 | 381 | @"width":@((kScreenWidth -DS_adapt_length(40))/4), |
| 355 | 382 | @"cellHeight":@(DS_adapt_length(65)) |
| 356 | 383 | }, |
| 384 | + @{ | |
| 385 | + @"title":@"商务合作", | |
| 386 | + @"img":@"mine_cooperation", | |
| 387 | + @"isBlack":@(YES), | |
| 388 | + @"width":@((kScreenWidth -DS_adapt_length(40))/4), | |
| 389 | + @"cellHeight":@(DS_adapt_length(65)) | |
| 390 | + }, | |
| 357 | 391 | ], |
| 358 | 392 | |
| 359 | 393 | }, |
| ... | ... | @@ -365,7 +399,7 @@ |
| 365 | 399 | ]; |
| 366 | 400 | } |
| 367 | 401 | NSDictionary *toolDic = @{ |
| 368 | - @"title":@"我的工具", | |
| 402 | + @"title":@"我的服务", | |
| 369 | 403 | @"type":@(5), |
| 370 | 404 | @"lists":tools |
| 371 | 405 | }; |
| ... | ... | @@ -392,27 +426,19 @@ |
| 392 | 426 | } |
| 393 | 427 | }]; |
| 394 | 428 | } |
| 395 | -+ (void)requestFeedback:(NSString *)message secceedBlock:(void(^)(void))responseBlock | |
| 429 | ++ (void)requestFeedback:(NSString *)message withName:(NSString *)name withMobile:(NSString *)mobile sourceType:(NSInteger)sourceType secceedBlock:(nonnull void (^)(NSString * _Nonnull))responseBlock | |
| 396 | 430 | { |
| 397 | 431 | NSDictionary *params = @{ |
| 398 | 432 | @"sid": CNUserShareModel.uid?CNUserShareModel.uid:@"", |
| 433 | + @"name":name, | |
| 434 | + @"mobile":mobile, | |
| 399 | 435 | @"text":message, |
| 400 | 436 | @"modeltype":@"C", |
| 401 | - @"sourcetype":@"0", | |
| 437 | + @"sourcetype":@(sourceType), | |
| 402 | 438 | @"appId":AppId |
| 403 | 439 | }; |
| 404 | - [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:cn_API_Host(@"/Daren/feedback/collectFeedback.action") Param:params CacheType:NO CompletionBlock:^(NSURLSessionTask *requestTask, NSDictionary * responseObject, NSError *error) { | |
| 405 | - if ([responseObject[@"errorMessage"] isEqualToString:@"成功"]) { | |
| 406 | - if (responseBlock) responseBlock(); | |
| 407 | - if ([message isEqualToString:@"对我的页面改版满意"]) { | |
| 408 | - [QMUITips showSucceed:@"谢谢您的评价" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 409 | - }else{ | |
| 410 | - [QMUITips showSucceed:@"已收到吐槽" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 411 | - } | |
| 412 | - }else | |
| 413 | - { | |
| 414 | - [QMUITips showError:@"意见反馈信息提交失败,请稍后再试。" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 415 | - } | |
| 440 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNUpdateFeedbackUrl Param:params CacheType:NO CompletionBlock:^(NSURLSessionTask *requestTask, NSDictionary * responseObject, NSError *error) { | |
| 441 | + if (responseBlock) responseBlock(responseObject[@"errorMessage"]); | |
| 416 | 442 | }]; |
| 417 | 443 | } |
| 418 | 444 | ... | ... |
CNLiveCMineModule/Classes/CNCMine/View/CNEvaluaveView.m
| ... | ... | @@ -47,8 +47,18 @@ |
| 47 | 47 | - (void)evaBtnClick{ |
| 48 | 48 | [CNMineEvaAlertView setUpShowEvaluateAlertViewDoneBlock:^(NSString * _Nonnull chooseStr) { |
| 49 | 49 | [QMUITips showLoadingInView:AppKeyWindow]; |
| 50 | - [CNMinePresent requestFeedback:chooseStr secceedBlock:^{ | |
| 51 | - [QMUITips hideAllTips]; | |
| 50 | + [CNMinePresent requestFeedback:chooseStr withName:@"" withMobile:@"" sourceType:0 secceedBlock:^(NSString * _Nonnull errorMessage) { | |
| 51 | + [QMUITips hideAllTips]; | |
| 52 | + if ([errorMessage isEqualToString:@"成功"]) { | |
| 53 | + if ([chooseStr isEqualToString:@"对我的页面改版满意"]) { | |
| 54 | + [QMUITips showSucceed:@"谢谢您的评价" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 55 | + }else{ | |
| 56 | + [QMUITips showSucceed:@"已收到吐槽" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 57 | + } | |
| 58 | + }else | |
| 59 | + { | |
| 60 | + [QMUITips showError:@"意见反馈信息提交失败,请稍后再试。" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 61 | + } | |
| 52 | 62 | [[NSUserDefaults standardUserDefaults] setObject:@"down" forKey:HIDDENDETE]; |
| 53 | 63 | [self removeFromSuperview]; |
| 54 | 64 | }]; | ... | ... |
CNLiveCMineModule/Classes/CNCMine/View/CNListCollectionView.m
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | #import "CNMineTotleCollectViewController.h" |
| 16 | 16 | #import "CNMineWalletController.h" |
| 17 | 17 | #import "CNLiveAddDeviceController.h" |
| 18 | +#import "CNCooperationController.h" | |
| 18 | 19 | |
| 19 | 20 | @interface CNListCollectionView()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout> |
| 20 | 21 | |
| ... | ... | @@ -214,6 +215,10 @@ static NSString *CNWalletCellID = @"CNWalletCellID"; |
| 214 | 215 | }else if ([listModel.title isEqualToString:@"路径工具"]){ |
| 215 | 216 | [[CNLiveCMineService shareMineProtocol] pushCMineContentForCMainPlatWithType:25 param:@{} contentVC:[self displayViewController]]; |
| 216 | 217 | } |
| 218 | + else if ([listModel.title isEqualToString:@"商务合作"]){ | |
| 219 | + CNCooperationController *vc = [[CNCooperationController alloc] init]; | |
| 220 | + [[BaseAppDelegate sharedAppDelegate] pushViewController:vc]; | |
| 221 | + } | |
| 217 | 222 | } |
| 218 | 223 | |
| 219 | 224 | } | ... | ... |
CNLiveCMineModule/Classes/CNCMine/View/CNListHeaderView.m
| ... | ... | @@ -48,7 +48,7 @@ |
| 48 | 48 | - (void)moreBtnClick:(UIButton *)sender{ |
| 49 | 49 | if ([sender.titleLabel.text isEqualToString:@"查看全部"]) { |
| 50 | 50 | [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:cn_WjjH5_Host(@"/myActivityBenefits.html?isShowTitle=true") statue:CNLiveCMineIntePushWebViewStatueTask]; |
| 51 | - }else if ([sender.titleLabel.text isEqualToString:@"全部工具"]){ | |
| 51 | + }else if ([sender.titleLabel.text isEqualToString:@"全部服务"]){ | |
| 52 | 52 | CNMineToolsViewController *vc = [[CNMineToolsViewController alloc] init]; |
| 53 | 53 | [[BaseAppDelegate sharedAppDelegate] pushViewController:vc]; |
| 54 | 54 | } |
| ... | ... | @@ -70,7 +70,7 @@ |
| 70 | 70 | if ([titleName isEqualToString:@"福利活动"]) { |
| 71 | 71 | [self.moreBtn setTitle:@"查看全部" forState:UIControlStateNormal]; |
| 72 | 72 | }else{ |
| 73 | - [self.moreBtn setTitle:@"全部工具" forState:UIControlStateNormal]; | |
| 73 | + [self.moreBtn setTitle:@"全部服务" forState:UIControlStateNormal]; | |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | } | ... | ... |
CNLiveCMineModule/Classes/CNCMine/View/CNToolCycleCell.m
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | - (CNListCollectionView *)listView |
| 26 | 26 | { |
| 27 | 27 | if (!_listView) { |
| 28 | - _listView = [[CNListCollectionView alloc] initWithFrame:self.frame]; | |
| 28 | + _listView = [[CNListCollectionView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)]; | |
| 29 | 29 | } |
| 30 | 30 | return _listView; |
| 31 | 31 | } | ... | ... |
CNLiveCMineModule/Classes/CNCMine/View/CNToolView.m
| ... | ... | @@ -49,6 +49,7 @@ |
| 49 | 49 | _headerView.carCount = listModel.number; |
| 50 | 50 | } |
| 51 | 51 | _cycleView.dataSource = model.lists; |
| 52 | + _cycleView.localizationImageNamesGroup = model.lists; | |
| 52 | 53 | } |
| 53 | 54 | - (void)setScoreModel:(CNScoreModel *)scoreModel |
| 54 | 55 | { |
| ... | ... | @@ -64,13 +65,15 @@ |
| 64 | 65 | } |
| 65 | 66 | - (CNToolCycleView *)cycleView{ |
| 66 | 67 | if (!_cycleView) { |
| 67 | - _cycleView = [[CNToolCycleView alloc] init]; | |
| 68 | + _cycleView = [[CNToolCycleView alloc] initWithFrame:CGRectZero]; | |
| 68 | 69 | _cycleView.backgroundColor = kClearColor; |
| 69 | 70 | _cycleView.autoScroll = NO; |
| 70 | 71 | _cycleView.showPageControl = YES; |
| 71 | 72 | _cycleView.pageControlStyle = SDCycleScrollViewPageContolStyleAnimated; |
| 72 | 73 | _cycleView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter; |
| 73 | 74 | _cycleView.hidesForSinglePage = YES; |
| 75 | + _cycleView.currentPageDotImage = [UIImage imageNamed:@"pagecontrol_yes"]; | |
| 76 | + _cycleView.pageDotImage = [UIImage imageNamed:@"pagecontrol_no"]; | |
| 74 | 77 | _cycleView.pageControlDotSize = CGSizeMake(4, 4); |
| 75 | 78 | } |
| 76 | 79 | return _cycleView; | ... | ... |
CNLiveCMineModule/Classes/CNCMine/ViewController/CNLiveMineVC.m
| ... | ... | @@ -145,8 +145,18 @@ static NSString *const CNSobotNotification_NewMessage = @"CNSobotNotification_Ne |
| 145 | 145 | [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"showTimes"]; |
| 146 | 146 | [CNMineEvaAlertView setUpShowEvaluateAlertViewDoneBlock:^(NSString * _Nonnull chooseStr) { |
| 147 | 147 | [QMUITips showLoadingInView:AppKeyWindow]; |
| 148 | - [CNMinePresent requestFeedback:chooseStr secceedBlock:^{ | |
| 148 | + [CNMinePresent requestFeedback:chooseStr withName:@"" withMobile:@"" sourceType:0 secceedBlock:^(NSString * _Nonnull errorMessage) { | |
| 149 | 149 | [QMUITips hideAllTips]; |
| 150 | + if ([errorMessage isEqualToString:@"成功"]) { | |
| 151 | + if ([chooseStr isEqualToString:@"对我的页面改版满意"]) { | |
| 152 | + [QMUITips showSucceed:@"谢谢您的评价" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 153 | + }else{ | |
| 154 | + [QMUITips showSucceed:@"已收到吐槽" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 155 | + } | |
| 156 | + }else | |
| 157 | + { | |
| 158 | + [QMUITips showError:@"意见反馈信息提交失败,请稍后再试。" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 159 | + } | |
| 150 | 160 | [[NSUserDefaults standardUserDefaults] setObject:@"down" forKey:HIDDENDETE]; |
| 151 | 161 | [self.evaluateView removeFromSuperview]; |
| 152 | 162 | }]; | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/Model/CNCooperationModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNCooperationModel.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS on 2023/1/5. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNCooperationModel : NSObject | |
| 13 | + | |
| 14 | +@property (nonatomic, copy)NSString *title; | |
| 15 | +@property (nonatomic, copy)NSString *placeHolder; | |
| 16 | +@property (nonatomic)NSInteger type; | |
| 17 | +@end | |
| 18 | + | |
| 19 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/Model/CNCooperationModel.m
0 → 100644
CNLiveCMineModule/Classes/CNCSubMine/Present/CNCSubMinePresent.h
CNLiveCMineModule/Classes/CNCSubMine/Present/CNCSubMinePresent.m
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | |
| 8 | 8 | #import "CNCSubMinePresent.h" |
| 9 | 9 | #import "CNLiveCMineInteModel.h" |
| 10 | +#import "CNCooperationModel.h" | |
| 10 | 11 | |
| 11 | 12 | @interface CNCSubMinePresent () |
| 12 | 13 | @property (nonatomic, weak) NSTimer *timer; |
| ... | ... | @@ -513,4 +514,19 @@ |
| 513 | 514 | ]; |
| 514 | 515 | return [CNMessageNoteModel mj_objectArrayWithKeyValuesArray:array]; |
| 515 | 516 | } |
| 517 | ++ (NSArray *)getCooperationNameList{ | |
| 518 | + NSArray *array = @[ | |
| 519 | + @{ | |
| 520 | + @"title":@"公司名称", | |
| 521 | + @"placeHolder":@"请填写您的公司名称", | |
| 522 | + @"type":@(0) | |
| 523 | + }, | |
| 524 | + @{ | |
| 525 | + @"title":@"联系方式", | |
| 526 | + @"placeHolder":@"请填写手机号", | |
| 527 | + @"type":@(1) | |
| 528 | + }, | |
| 529 | + ]; | |
| 530 | + return [CNCooperationModel mj_objectArrayWithKeyValuesArray:array]; | |
| 531 | +} | |
| 516 | 532 | @end | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/View/CNCooperationDescribeView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNCooperationDescribeView.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS on 2023/1/5. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNCooperationDescribeView : UIView | |
| 13 | +@property (nonatomic, copy)void (^describeBlock)(NSString *str); | |
| 14 | +@end | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/View/CNCooperationDescribeView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNCooperationDescribeView.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS on 2023/1/5. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNCooperationDescribeView.h" | |
| 9 | +@interface CNCooperationDescribeView ()<QMUITextViewDelegate> | |
| 10 | +@property (nonatomic, strong)UIImageView *iconImage; | |
| 11 | +@property (nonatomic, strong)UILabel *titleLabel; | |
| 12 | +@property (nonatomic, strong)UIView *bgView; | |
| 13 | +@property (nonatomic, strong)QMUITextView *textView; | |
| 14 | +@property (nonatomic, strong)UILabel *numberLabel; | |
| 15 | +@end | |
| 16 | + | |
| 17 | +@implementation CNCooperationDescribeView | |
| 18 | +- (instancetype)init{ | |
| 19 | + if (self = [super init]) { | |
| 20 | + [self addSubview:self.iconImage]; | |
| 21 | + [self addSubview:self.titleLabel]; | |
| 22 | + [self addSubview:self.bgView]; | |
| 23 | + [self.bgView addSubview:self.numberLabel]; | |
| 24 | + [self.bgView addSubview:self.textView]; | |
| 25 | + [self.iconImage mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 26 | + make.left.mas_equalTo(12); | |
| 27 | + make.top.mas_equalTo(17); | |
| 28 | + make.width.height.mas_equalTo(7); | |
| 29 | + }]; | |
| 30 | + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 31 | + make.left.equalTo(self.iconImage.mas_right).offset(2); | |
| 32 | + make.top.mas_equalTo(15); | |
| 33 | + | |
| 34 | + }]; | |
| 35 | + [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 36 | + make.top.equalTo(self.titleLabel.mas_bottom).offset(12); | |
| 37 | + make.bottom.equalTo(self); | |
| 38 | + make.left.mas_equalTo(2); | |
| 39 | + make.right.mas_equalTo(-2); | |
| 40 | + }]; | |
| 41 | + [self.textView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 42 | + make.top.equalTo(self.titleLabel.mas_bottom).offset(12); | |
| 43 | + make.bottom.equalTo(self).offset(-24); | |
| 44 | + make.left.mas_equalTo(10); | |
| 45 | + make.right.mas_equalTo(-10); | |
| 46 | + }]; | |
| 47 | + [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 48 | + make.top.equalTo(self.textView.mas_bottom); | |
| 49 | + make.left.mas_equalTo(12); | |
| 50 | + make.right.mas_equalTo(-12); | |
| 51 | + }]; | |
| 52 | + } | |
| 53 | + return self; | |
| 54 | +} | |
| 55 | +#pragma mark - UITextViewDelegate | |
| 56 | +- (void)textViewDidChangeSelection:(UITextView *)textView{ | |
| 57 | + _numberLabel.text = [NSString stringWithFormat:@"%ld/300",self.textView.text.length]; | |
| 58 | +} | |
| 59 | +- (void)textViewDidEndEditing:(UITextView *)textView{ | |
| 60 | + if (self.describeBlock) { | |
| 61 | + self.describeBlock(textView.text); | |
| 62 | + } | |
| 63 | +} | |
| 64 | +#pragma mark - Getting | |
| 65 | +- (UIImageView *)iconImage{ | |
| 66 | + if (!_iconImage) { | |
| 67 | + _iconImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cooperation_icon"]]; | |
| 68 | + } | |
| 69 | + return _iconImage; | |
| 70 | +} | |
| 71 | +- (UILabel *)titleLabel{ | |
| 72 | + if (!_titleLabel) { | |
| 73 | + _titleLabel = [[UILabel alloc] init]; | |
| 74 | + _titleLabel.textColor = UIColorHex(#333333); | |
| 75 | + _titleLabel.font = UIFontCNMake(15); | |
| 76 | + _titleLabel.text = @"合作意向描述"; | |
| 77 | + } | |
| 78 | + return _titleLabel; | |
| 79 | +} | |
| 80 | +- (UIView *)bgView{ | |
| 81 | + if (!_bgView) { | |
| 82 | + _bgView = [[UIView alloc] init]; | |
| 83 | + _bgView.backgroundColor = UIColorWhite; | |
| 84 | + _bgView.layer.cornerRadius = 14; | |
| 85 | + _bgView.clipsToBounds = YES; | |
| 86 | + } | |
| 87 | + return _bgView; | |
| 88 | +} | |
| 89 | +- (QMUITextView *)textView{ | |
| 90 | + if (!_textView) { | |
| 91 | + _textView = [[QMUITextView alloc] init]; | |
| 92 | + _textView.delegate = self; | |
| 93 | + _textView.textColor = UIColorHex(#333333); | |
| 94 | + _textView.font = UIFontCNMake(15); | |
| 95 | + _textView.placeholder = @"请简短概要您的合作意向"; | |
| 96 | + _textView.placeholderColor = UIColorHex(#999999); | |
| 97 | + _textView.maximumTextLength = 300; | |
| 98 | + } | |
| 99 | + return _textView; | |
| 100 | +} | |
| 101 | +- (UILabel *)numberLabel{ | |
| 102 | + if (!_numberLabel) { | |
| 103 | + _numberLabel = [[UILabel alloc] init]; | |
| 104 | + _numberLabel.textColor = UIColorHex(#999999); | |
| 105 | + _numberLabel.font =UIFontCNMake(11); | |
| 106 | + _numberLabel.textAlignment = NSTextAlignmentRight; | |
| 107 | + _numberLabel.text = @"0/300"; | |
| 108 | + } | |
| 109 | + return _numberLabel; | |
| 110 | +} | |
| 111 | +@end | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/View/CNCooperationNameCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNCooperationNameCell.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS on 2023/1/5. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +@class CNCooperationModel; | |
| 11 | + | |
| 12 | +NS_ASSUME_NONNULL_BEGIN | |
| 13 | + | |
| 14 | +@interface CNCooperationNameCell : UITableViewCell | |
| 15 | +@property (nonatomic, strong)CNCooperationModel *model; | |
| 16 | +@property (nonatomic, copy)void (^telOrNameBlock)(NSInteger index,NSString *str); | |
| 17 | +@end | |
| 18 | + | |
| 19 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/View/CNCooperationNameCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNCooperationNameCell.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS on 2023/1/5. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNCooperationNameCell.h" | |
| 9 | +#import "CNCooperationModel.h" | |
| 10 | + | |
| 11 | +@interface CNCooperationNameCell ()<UITextFieldDelegate> | |
| 12 | +@property (nonatomic, strong)UIImageView *iconImage; | |
| 13 | +@property (nonatomic, strong)UILabel *titleLabel; | |
| 14 | +@property (nonatomic, strong)UITextField *field; | |
| 15 | +@property (nonatomic, strong)UIView *lineView; | |
| 16 | +@end | |
| 17 | + | |
| 18 | +@implementation CNCooperationNameCell | |
| 19 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ | |
| 20 | + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { | |
| 21 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 22 | + [self.contentView addSubview:self.iconImage]; | |
| 23 | + [self.contentView addSubview:self.titleLabel]; | |
| 24 | + [self.contentView addSubview:self.field]; | |
| 25 | + [self.contentView addSubview:self.lineView]; | |
| 26 | + [self.iconImage mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 27 | + make.left.mas_equalTo(12); | |
| 28 | + make.top.mas_equalTo(17); | |
| 29 | + make.width.height.mas_equalTo(7); | |
| 30 | + }]; | |
| 31 | + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 32 | + make.left.equalTo(self.iconImage.mas_right).offset(2); | |
| 33 | + make.top.mas_equalTo(15); | |
| 34 | + | |
| 35 | + }]; | |
| 36 | + [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 37 | + make.left.mas_equalTo(14); | |
| 38 | + make.right.mas_equalTo(-26); | |
| 39 | + make.bottom.equalTo(self); | |
| 40 | + make.height.mas_equalTo(1); | |
| 41 | + }]; | |
| 42 | + [self.field mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 43 | + make.left.equalTo(self.titleLabel); | |
| 44 | + make.bottom.equalTo(self.lineView.mas_top).offset(-3); | |
| 45 | + make.right.equalTo(self).offset(-10); | |
| 46 | + }]; | |
| 47 | + } | |
| 48 | + return self; | |
| 49 | +} | |
| 50 | +- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ | |
| 51 | + [self endEditing:YES]; | |
| 52 | +} | |
| 53 | +#pragma mark - UITextFieldDelegate | |
| 54 | +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ | |
| 55 | + if (self.model.type == 0) { | |
| 56 | + if (textField.text.length >=20 && [string isNotBlank]) { | |
| 57 | + return NO; | |
| 58 | + }else{ | |
| 59 | + return YES; | |
| 60 | + } | |
| 61 | + }else{ | |
| 62 | + if (textField.text.length >=15&& [string isNotBlank]) { | |
| 63 | + return NO; | |
| 64 | + }else{ | |
| 65 | + return YES; | |
| 66 | + } | |
| 67 | + } | |
| 68 | +} | |
| 69 | +- (void)textFieldDidChangeSelection:(UITextField *)textField{ | |
| 70 | + if (_model.type == 0) { | |
| 71 | + if (textField.text.length>20) { | |
| 72 | + textField.text = [textField.text substringToIndex:20]; | |
| 73 | + } | |
| 74 | + }else{ | |
| 75 | + if (textField.text.length>15) { | |
| 76 | + textField.text = [textField.text substringToIndex:15]; | |
| 77 | + } | |
| 78 | + } | |
| 79 | + | |
| 80 | +} | |
| 81 | +- (void)textFieldDidEndEditing:(UITextField *)textField{ | |
| 82 | + if (self.telOrNameBlock) { | |
| 83 | + self.telOrNameBlock(self.model.type, textField.text); | |
| 84 | + } | |
| 85 | +} | |
| 86 | +#pragma mark - Setting | |
| 87 | +- (void)setModel:(CNCooperationModel *)model{ | |
| 88 | + _model = model; | |
| 89 | + self.titleLabel.text = model.title; | |
| 90 | + self.field.placeholder = model.placeHolder; | |
| 91 | + if (model.type == 1) { | |
| 92 | + self.field.keyboardType = UIKeyboardTypeNumberPad; | |
| 93 | + }else{ | |
| 94 | + self.field.keyboardType = UIKeyboardTypeDefault; | |
| 95 | + } | |
| 96 | +} | |
| 97 | +#pragma mark - Getting | |
| 98 | +- (UIImageView *)iconImage{ | |
| 99 | + if (!_iconImage) { | |
| 100 | + _iconImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cooperation_icon"]]; | |
| 101 | + } | |
| 102 | + return _iconImage; | |
| 103 | +} | |
| 104 | +- (UILabel *)titleLabel{ | |
| 105 | + if (!_titleLabel) { | |
| 106 | + _titleLabel = [[UILabel alloc] init]; | |
| 107 | + _titleLabel.textColor = UIColorHex(#333333); | |
| 108 | + _titleLabel.font = UIFontCNMake(15); | |
| 109 | + } | |
| 110 | + return _titleLabel; | |
| 111 | +} | |
| 112 | +- (UITextField *)field{ | |
| 113 | + if (!_field) { | |
| 114 | + _field = [[UITextField alloc] init]; | |
| 115 | + _field.textColor = UIColorHex(#333333); | |
| 116 | + _field.font = UIFontCNMake(15); | |
| 117 | + _field.delegate = self; | |
| 118 | + } | |
| 119 | + return _field; | |
| 120 | +} | |
| 121 | +- (UIView *)lineView{ | |
| 122 | + if (!_lineView) { | |
| 123 | + _lineView = [[UIView alloc] init]; | |
| 124 | + _lineView.backgroundColor = UIColorHex(#EEEEEE); | |
| 125 | + } | |
| 126 | + return _lineView; | |
| 127 | +} | |
| 128 | +@end | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/View/CNCooperationNameView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNCooperationNameView.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS on 2023/1/5. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNCooperationNameView : UIView | |
| 13 | +@property (nonatomic, copy)void (^telOrNameBlock)(NSInteger index,NSString *str); | |
| 14 | +@end | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/View/CNCooperationNameView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNCooperationNameView.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS on 2023/1/5. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNCooperationNameView.h" | |
| 9 | +#import "CNCooperationNameCell.h" | |
| 10 | + | |
| 11 | +static NSString *const kCNCooperationNameCellID = @"kCNCooperationNameCellID"; | |
| 12 | + | |
| 13 | +@interface CNCooperationNameView ()<UITableViewDelegate,UITableViewDataSource> | |
| 14 | +@property (nonatomic, strong)UITableView *tableView; | |
| 15 | +@property (nonatomic, strong)NSArray *dataSource; | |
| 16 | +@end | |
| 17 | + | |
| 18 | +@implementation CNCooperationNameView | |
| 19 | + | |
| 20 | +- (instancetype)init{ | |
| 21 | + if (self = [super init]) { | |
| 22 | + self.backgroundColor = UIColorWhite; | |
| 23 | + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, kScreenWidth - 24, 161) cornerRadius:14]; | |
| 24 | + CAShapeLayer *maskLayer = [CAShapeLayer layer]; | |
| 25 | + maskLayer.path = path.CGPath; | |
| 26 | + self.layer.mask = maskLayer; | |
| 27 | + [self addSubview:self.tableView]; | |
| 28 | + [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 29 | + make.left.right.equalTo(self); | |
| 30 | + make.top.mas_equalTo(10); | |
| 31 | + make.bottom.mas_equalTo(-10); | |
| 32 | + }]; | |
| 33 | + } | |
| 34 | + return self; | |
| 35 | +} | |
| 36 | +#pragma mark - UITableViewDelegate | |
| 37 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| 38 | + return 141/2; | |
| 39 | +} | |
| 40 | +#pragma mark - UITableViewDataSource | |
| 41 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ | |
| 42 | + return self.dataSource.count; | |
| 43 | +} | |
| 44 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| 45 | + CNCooperationNameCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNCooperationNameCellID]; | |
| 46 | + cell.model = self.dataSource[indexPath.row]; | |
| 47 | + weakself | |
| 48 | + cell.telOrNameBlock = ^(NSInteger index, NSString * _Nonnull str) { | |
| 49 | + if (weakSelf.telOrNameBlock) { | |
| 50 | + weakSelf.telOrNameBlock(index, str); | |
| 51 | + } | |
| 52 | + }; | |
| 53 | + return cell; | |
| 54 | +} | |
| 55 | +#pragma mark - Getting | |
| 56 | +- (UITableView *)tableView{ | |
| 57 | + if (!_tableView) { | |
| 58 | + _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; | |
| 59 | + _tableView.delegate = self; | |
| 60 | + _tableView.dataSource = self; | |
| 61 | + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| 62 | + _tableView.showsVerticalScrollIndicator = NO; | |
| 63 | + _tableView.showsHorizontalScrollIndicator = NO; | |
| 64 | + _tableView.scrollEnabled = NO; | |
| 65 | + [_tableView registerClass:[CNCooperationNameCell class] forCellReuseIdentifier:kCNCooperationNameCellID]; | |
| 66 | + } | |
| 67 | + return _tableView; | |
| 68 | +} | |
| 69 | +- (NSArray *)dataSource{ | |
| 70 | + if (!_dataSource) { | |
| 71 | + _dataSource = [CNCSubMinePresent getCooperationNameList]; | |
| 72 | + } | |
| 73 | + return _dataSource; | |
| 74 | +} | |
| 75 | +@end | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/View/CNCooperationTipView.h
0 → 100644
CNLiveCMineModule/Classes/CNCSubMine/View/CNCooperationTipView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNCooperationTipView.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS on 2023/1/4. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNCooperationTipView.h" | |
| 9 | + | |
| 10 | +@interface CNCooperationTipView () | |
| 11 | +@property (nonatomic, strong)UIImageView *tipImage; | |
| 12 | +@property (nonatomic, strong)UILabel *tipLabel; | |
| 13 | +@end | |
| 14 | + | |
| 15 | +@implementation CNCooperationTipView | |
| 16 | +- (instancetype)init{ | |
| 17 | + if (self = [super init]) { | |
| 18 | + self.backgroundColor = UIColorHex(#FFFBED); | |
| 19 | + [self addSubview:self.tipImage]; | |
| 20 | + [self addSubview:self.tipLabel]; | |
| 21 | + [self.tipImage mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 22 | + make.left.equalTo(self).offset(16); | |
| 23 | + make.width.height.mas_equalTo(16); | |
| 24 | + make.centerY.equalTo(self); | |
| 25 | + }]; | |
| 26 | + [self.tipLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 27 | + make.left.equalTo(self.tipImage.mas_right).offset(4); | |
| 28 | + make.centerY.equalTo(self); | |
| 29 | + }]; | |
| 30 | + } | |
| 31 | + return self; | |
| 32 | +} | |
| 33 | + | |
| 34 | +#pragma mark - Getting | |
| 35 | +- (UIImageView *)tipImage{ | |
| 36 | + if (!_tipImage) { | |
| 37 | + _tipImage = [[UIImageView alloc] init]; | |
| 38 | + _tipImage.image = [UIImage imageNamed:@"cooperation_tip"]; | |
| 39 | + } | |
| 40 | + return _tipImage; | |
| 41 | +} | |
| 42 | +- (UILabel *)tipLabel{ | |
| 43 | + if (!_tipLabel) { | |
| 44 | + _tipLabel = [[UILabel alloc] init]; | |
| 45 | + _tipLabel.text = @"为保证合作顺利请正确填写相关信息"; | |
| 46 | + _tipLabel.textColor = UIColorHex(#666666); | |
| 47 | + _tipLabel.font = UIFontCNMake(14); | |
| 48 | + } | |
| 49 | + return _tipLabel; | |
| 50 | +} | |
| 51 | +@end | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/ViewController/CNCooperationController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNCooperationController.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS on 2023/1/4. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNCooperationController : CNCommonViewController | |
| 13 | + | |
| 14 | +@end | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/ViewController/CNCooperationController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNCooperationController.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS on 2023/1/4. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNCooperationController.h" | |
| 9 | +#import "CNCooperationTipView.h" | |
| 10 | +#import "CNCooperationNameView.h" | |
| 11 | +#import <IQKeyboardManager/IQKeyboardManager.h> | |
| 12 | +#import "CNCooperationDescribeView.h" | |
| 13 | + | |
| 14 | +@interface CNCooperationController () | |
| 15 | +@property (nonatomic, strong)CNLiveNavigationBar * navigationBar; | |
| 16 | +@property (nonatomic, strong)CNCooperationTipView *tipView;//头部提示 | |
| 17 | +@property (nonatomic, strong)CNCooperationNameView *nameView;//公司名称/电话号 | |
| 18 | +@property (nonatomic, strong)CNCooperationDescribeView *describeView;//合作意向描述 | |
| 19 | +@property (nonatomic, strong)UIButton *submitBtn; | |
| 20 | +///需要提交数据 | |
| 21 | +@property (nonatomic, strong)NSString *nameStr; | |
| 22 | +@property (nonatomic, strong)NSString *telStr; | |
| 23 | +@property (nonatomic, strong)NSString *descStr; | |
| 24 | +@end | |
| 25 | + | |
| 26 | +@implementation CNCooperationController | |
| 27 | + | |
| 28 | +- (void)viewDidLoad { | |
| 29 | + [super viewDidLoad]; | |
| 30 | + [self.view addSubview:self.navigationBar]; | |
| 31 | + [self.view addSubview:self.tipView]; | |
| 32 | + [self.view addSubview:self.nameView]; | |
| 33 | + [self.view addSubview:self.describeView]; | |
| 34 | + [self.view addSubview:self.submitBtn]; | |
| 35 | + self.view.backgroundColor = UIColorHex(#F6F7F9); | |
| 36 | + [IQKeyboardManager sharedManager].enable = YES; | |
| 37 | + [IQKeyboardManager sharedManager].enableAutoToolbar = YES; | |
| 38 | + | |
| 39 | + [self.tipView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 40 | + make.left.right.equalTo(self.view); | |
| 41 | + make.top.equalTo(self.navigationBar.mas_bottom); | |
| 42 | + make.height.mas_equalTo(40); | |
| 43 | + }]; | |
| 44 | + [self.nameView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 45 | + make.left.mas_equalTo(12); | |
| 46 | + make.right.mas_equalTo(-12); | |
| 47 | + make.top.equalTo(self.tipView .mas_bottom).offset(10); | |
| 48 | + make.height.mas_equalTo(161); | |
| 49 | + }]; | |
| 50 | + [self.describeView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 51 | + make.left.mas_equalTo(12); | |
| 52 | + make.right.mas_equalTo(-12); | |
| 53 | + make.top.equalTo(self.nameView.mas_bottom).offset(10); | |
| 54 | + make.height.mas_equalTo(298); | |
| 55 | + }]; | |
| 56 | + [self.submitBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 57 | + make.bottom.equalTo(self.mas_bottomLayoutGuide).offset(-10); | |
| 58 | + make.centerX.equalTo(self.view); | |
| 59 | + make.width.mas_equalTo(185); | |
| 60 | + make.height.mas_equalTo(40); | |
| 61 | + }]; | |
| 62 | + weakself | |
| 63 | + self.describeView.describeBlock = ^(NSString * _Nonnull str) { | |
| 64 | + weakSelf.descStr = str; | |
| 65 | + [weakSelf changeSubmitBtn]; | |
| 66 | + }; | |
| 67 | + self.nameView.telOrNameBlock = ^(NSInteger index, NSString * _Nonnull str) { | |
| 68 | + switch (index) { | |
| 69 | + case 0: | |
| 70 | + weakSelf.nameStr = str; | |
| 71 | + break; | |
| 72 | + case 1: | |
| 73 | + weakSelf.telStr = str; | |
| 74 | + break; | |
| 75 | + default: | |
| 76 | + break; | |
| 77 | + [weakSelf changeSubmitBtn]; | |
| 78 | + } | |
| 79 | + }; | |
| 80 | +} | |
| 81 | + | |
| 82 | +- (BOOL)preferredNavigationBarHidden{ | |
| 83 | + return YES; | |
| 84 | + | |
| 85 | +} | |
| 86 | +- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ | |
| 87 | + [self.view endEditing:YES]; | |
| 88 | +} | |
| 89 | +- (void)changeSubmitBtn{ | |
| 90 | + if ([self.nameStr isNotBlank]&&[self.telStr isNotBlank]&&[self.descStr isNotBlank]) { | |
| 91 | + [_submitBtn setBackgroundImage:[UIImage imageWithColor:UIColorHex(#8B37F5)] forState:UIControlStateNormal]; | |
| 92 | + }else{ | |
| 93 | + [_submitBtn setBackgroundImage:[UIImage imageWithColor:UIColorHex(#D9D9D9)] forState:UIControlStateNormal]; | |
| 94 | + } | |
| 95 | +} | |
| 96 | +#pragma mark - Action | |
| 97 | +- (void)submitBtnClick{ | |
| 98 | + if (![self.nameStr isNotBlank]) { | |
| 99 | + [QMUITips showWithText:@"请填写公司名称"]; | |
| 100 | + }else if (![self.telStr isNotBlank]){ | |
| 101 | + [QMUITips showWithText:@"请填写联系方式"]; | |
| 102 | + }else if (![self.descStr isNotBlank]){ | |
| 103 | + [QMUITips showWithText:@"请填写合作意向描述"]; | |
| 104 | + }else{ | |
| 105 | + weakself | |
| 106 | + [CNMinePresent requestFeedback:self.descStr withName:self.nameStr withMobile:self.telStr sourceType:2 secceedBlock:^(NSString * _Nonnull errorMessage) { | |
| 107 | + if ([errorMessage isEqualToString:@"成功"]) { | |
| 108 | + [QMUITips showSucceed:@"收到您的提交" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 109 | + [weakSelf.navigationController popViewControllerAnimated:YES]; | |
| 110 | + }else{ | |
| 111 | + [QMUITips showError:@"商务合作提交失败,请稍后再试。" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 112 | + } | |
| 113 | + }]; | |
| 114 | + } | |
| 115 | +} | |
| 116 | +#pragma mark - Getting | |
| 117 | +- (CNCooperationTipView *)tipView{ | |
| 118 | + if (!_tipView) { | |
| 119 | + _tipView = [[CNCooperationTipView alloc] init]; | |
| 120 | + } | |
| 121 | + return _tipView; | |
| 122 | +} | |
| 123 | +- (CNCooperationNameView *)nameView { | |
| 124 | + if (!_nameView) { | |
| 125 | + _nameView = [[CNCooperationNameView alloc] init]; | |
| 126 | + } | |
| 127 | + return _nameView; | |
| 128 | +} | |
| 129 | + | |
| 130 | +- (CNCooperationDescribeView *)describeView{ | |
| 131 | + if (!_describeView) { | |
| 132 | + _describeView = [[CNCooperationDescribeView alloc] init]; | |
| 133 | + CAGradientLayer *gl = [CAGradientLayer layer]; | |
| 134 | + gl.frame = CGRectMake(0,0,kScreenWidth - 24,298); | |
| 135 | + gl.startPoint = CGPointMake(0.5, 0); | |
| 136 | + gl.endPoint = CGPointMake(0.5, 1); | |
| 137 | + gl.colors = @[(__bridge id)[UIColor colorWithRed:238/255.0 green:238/255.0 blue:238/255.0 alpha:1.0].CGColor, (__bridge id)[UIColor colorWithRed:230/255.0 green:235/255.0 blue:254/255.0 alpha:1.0].CGColor, (__bridge id)[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0].CGColor]; | |
| 138 | + gl.locations = @[@(0), @(0), @(1.0f)]; | |
| 139 | + [_describeView.layer insertSublayer:gl atIndex:0]; | |
| 140 | + _describeView.layer.cornerRadius = 14; | |
| 141 | + _describeView.clipsToBounds = YES; | |
| 142 | + } | |
| 143 | + return _describeView; | |
| 144 | +} | |
| 145 | +- (UIButton *)submitBtn{ | |
| 146 | + if (!_submitBtn) { | |
| 147 | + _submitBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 148 | + [_submitBtn setBackgroundImage:[UIImage imageWithColor:UIColorHex(#D9D9D9)] forState:UIControlStateNormal]; | |
| 149 | + [_submitBtn setTitleColor:UIColorWhite forState:UIControlStateNormal]; | |
| 150 | + [_submitBtn setTitle:@"提交" forState:UIControlStateNormal]; | |
| 151 | + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 185, 40) cornerRadius:20]; | |
| 152 | + CAShapeLayer *maskLayer = [CAShapeLayer layer]; | |
| 153 | + maskLayer.path = path.CGPath; | |
| 154 | + _submitBtn.layer.mask = maskLayer; | |
| 155 | + [_submitBtn addTarget:self action:@selector(submitBtnClick) forControlEvents:UIControlEventTouchUpInside]; | |
| 156 | + } | |
| 157 | + return _submitBtn; | |
| 158 | +} | |
| 159 | +#pragma mark - Navigation | |
| 160 | + | |
| 161 | +- (CNLiveNavigationBar *)navigationBar{ | |
| 162 | + if (!_navigationBar) { | |
| 163 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 164 | + _navigationBar.title.text = @"商务合作"; | |
| 165 | + weakself | |
| 166 | + _navigationBar.onClickLeftButton = ^{ | |
| 167 | + [weakSelf.navigationController popViewControllerAnimated:YES]; | |
| 168 | + }; | |
| 169 | + } | |
| 170 | + return _navigationBar; | |
| 171 | +} | |
| 172 | + | |
| 173 | +@end | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/ViewController/CNMineToolsViewController.m
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | } |
| 29 | 29 | - (void)viewDidLoad { |
| 30 | 30 | [super viewDidLoad]; |
| 31 | - self.title = @"我的工具"; | |
| 31 | + self.title = @"我的服务"; | |
| 32 | 32 | self.view.backgroundColor = RGB(247, 246, 249); |
| 33 | 33 | [self.view addSubview:self.collectView]; |
| 34 | 34 | [self.collectView mas_makeConstraints:^(MASConstraintMaker *make) { |
| ... | ... | @@ -105,7 +105,7 @@ return CGSizeMake(collectionView.width,cellHeight); |
| 105 | 105 | // 头部视图 |
| 106 | 106 | // 代码初始化表头 |
| 107 | 107 | reusableView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HeaderReusableView" forIndexPath:indexPath]; |
| 108 | - reusableView.titleLable.text = indexPath.section == 0?@"常用工具":@"运动健康"; | |
| 108 | + reusableView.titleLable.text = indexPath.section == 0?@"常用服务":@"运动健康"; | |
| 109 | 109 | } |
| 110 | 110 | return reusableView; |
| 111 | 111 | ... | ... |