Commit c85a2c399ff21814cfd13fc5235491eb5769c6ab
1 parent
ffa729b4
0.0.2
Showing
87 changed files
with
3449 additions
and
898 deletions
CNLiveCMineModule.podspec
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | |
| 9 | 9 | Pod::Spec.new do |s| |
| 10 | 10 | s.name = 'CNLiveCMineModule' |
| 11 | - s.version = '0.0.1' | |
| 11 | + s.version = '0.0.2' | |
| 12 | 12 | s.summary = '网家家C端个人中心' |
| 13 | 13 | |
| 14 | 14 | # This description is used to generate tags and improve search results. |
| ... | ... | @@ -29,7 +29,7 @@ TODO: Add long description of the pod here. |
| 29 | 29 | # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>' |
| 30 | 30 | |
| 31 | 31 | s.ios.deployment_target = '10.0' |
| 32 | - s.prefix_header_contents = '#import "CNLiveCMineModule.h"' | |
| 32 | + s.prefix_header_contents = '#import "CNLiveCMineHeader.h"' | |
| 33 | 33 | s.static_framework = true |
| 34 | 34 | |
| 35 | 35 | |
| ... | ... | @@ -37,25 +37,29 @@ TODO: Add long description of the pod here. |
| 37 | 37 | # s.resource_bundles = { |
| 38 | 38 | # 'CNLiveCMineModule' => ['CNLiveCMineModule/Assets/*.png'] |
| 39 | 39 | # } |
| 40 | - | |
| 41 | - s.public_header_files = 'Pod/Classes/**/*.h' | |
| 40 | + s.resources = "CNLiveCMineModule/Assets/**/*.bundle" | |
| 41 | + s.source_files = "CNLiveCMineModule/Classes/**/*.{h,m,mm,pch}" | |
| 42 | + s.public_header_files = 'Pod/Classes/**/*.h' | |
| 42 | 43 | # s.frameworks = 'UIKit', 'MapKit' |
| 43 | 44 | # s.dependency 'AFNetworking', '~> 2.3' |
| 44 | 45 | s.dependency 'CNLiveBaseKit' |
| 45 | 46 | s.dependency 'CNLiveNewTripartiteManagement/YYCategories' |
| 46 | 47 | s.dependency 'CNLiveNewTripartiteManagement/YYText' |
| 47 | - s.dependency 'CNLiveNewTripartiteManagement/QMUIKit' | |
| 48 | + s.dependency 'CNLiveNewTripartiteManagement/PGDatePicker' | |
| 48 | 49 | s.dependency 'CNLiveNewTripartiteManagement/Masonry' |
| 50 | + s.dependency 'CNLiveNewTripartiteManagement/DZNEmptyDataSet' | |
| 49 | 51 | s.dependency 'CNLiveCustomUI' |
| 52 | + s.dependency 'CNLiveCustomControl' | |
| 50 | 53 | s.dependency 'CNLiveRequestBastKit' |
| 51 | 54 | s.dependency 'CNLiveBusinessTools' |
| 52 | 55 | s.dependency 'CNLiveNewTripartiteManagement/SDWebImage' |
| 53 | 56 | s.dependency 'CNLiveNewTripartiteManagement/MJExtension' |
| 54 | 57 | s.dependency 'CNLiveBusinessBaseModule' |
| 55 | 58 | s.dependency 'JXCategoryView' |
| 59 | + s.dependency 'JXPagingView/Pager' | |
| 56 | 60 | s.dependency 'CNLiveSDK/CNLiveStat' |
| 57 | - s.dependency 'CNLivePhotoBrowser' | |
| 58 | - s.dependency 'CNLiveNewIMAManagerKit' | |
| 59 | - s.dependency 'libksygpulive' | |
| 61 | +# s.dependency 'CNLivePhotoBrowser' | |
| 62 | +# s.dependency 'CNLiveNewIMAManagerKit' | |
| 63 | + # s.dependency 'libksygpulive' | |
| 60 | 64 | end |
| 61 | 65 | ... | ... |
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/Root.plist
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| 3 | +<plist version="1.0"> | |
| 4 | +<dict> | |
| 5 | + <key>StringsTable</key> | |
| 6 | + <string>Root</string> | |
| 7 | + <key>PreferenceSpecifiers</key> | |
| 8 | + <array> | |
| 9 | + <dict> | |
| 10 | + <key>Type</key> | |
| 11 | + <string>PSGroupSpecifier</string> | |
| 12 | + <key>Title</key> | |
| 13 | + <string>Group</string> | |
| 14 | + </dict> | |
| 15 | + <dict> | |
| 16 | + <key>Type</key> | |
| 17 | + <string>PSTextFieldSpecifier</string> | |
| 18 | + <key>Title</key> | |
| 19 | + <string>Name</string> | |
| 20 | + <key>Key</key> | |
| 21 | + <string>name_preference</string> | |
| 22 | + <key>DefaultValue</key> | |
| 23 | + <string></string> | |
| 24 | + <key>IsSecure</key> | |
| 25 | + <false/> | |
| 26 | + <key>KeyboardType</key> | |
| 27 | + <string>Alphabet</string> | |
| 28 | + <key>AutocapitalizationType</key> | |
| 29 | + <string>None</string> | |
| 30 | + <key>AutocorrectionType</key> | |
| 31 | + <string>No</string> | |
| 32 | + </dict> | |
| 33 | + <dict> | |
| 34 | + <key>Type</key> | |
| 35 | + <string>PSToggleSwitchSpecifier</string> | |
| 36 | + <key>Title</key> | |
| 37 | + <string>Enabled</string> | |
| 38 | + <key>Key</key> | |
| 39 | + <string>enabled_preference</string> | |
| 40 | + <key>DefaultValue</key> | |
| 41 | + <true/> | |
| 42 | + </dict> | |
| 43 | + <dict> | |
| 44 | + <key>Type</key> | |
| 45 | + <string>PSSliderSpecifier</string> | |
| 46 | + <key>Key</key> | |
| 47 | + <string>slider_preference</string> | |
| 48 | + <key>DefaultValue</key> | |
| 49 | + <real>0.5</real> | |
| 50 | + <key>MinimumValue</key> | |
| 51 | + <integer>0</integer> | |
| 52 | + <key>MaximumValue</key> | |
| 53 | + <integer>1</integer> | |
| 54 | + <key>MinimumValueImage</key> | |
| 55 | + <string></string> | |
| 56 | + <key>MaximumValueImage</key> | |
| 57 | + <string></string> | |
| 58 | + </dict> | |
| 59 | + </array> | |
| 60 | +</dict> | |
| 61 | +</plist> | ... | ... |
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_announ@2x.png
0 → 100644
2.7 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_announ@3x.png
0 → 100644
5.36 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_date_tira@2x.png
0 → 100644
1.96 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_date_tira@3x.png
0 → 100644
2.26 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_empty@2x.png
0 → 100644
10 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_empty@3x.png
0 → 100644
26.3 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_gold_coins@2x.png
0 → 100644
5.44 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_gold_coins@3x.png
0 → 100644
10.8 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_gold_select@2x.png
0 → 100644
1.13 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_gold_select@3x.png
0 → 100644
2.06 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_header_back_groud@2x.png
0 → 100644
54 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_header_back_groud@3x.png
0 → 100644
149 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_header_custom_service@2x.png
0 → 100644
1.19 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_header_custom_service@3x.png
0 → 100644
2.28 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_header_rules@2x.png
0 → 100644
1 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_header_rules@3x.png
0 → 100644
1.91 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_item_task@2x.png
0 → 100644
5.6 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_item_task@3x.png
0 → 100644
11 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_tag_new@2x.png
0 → 100644
1.88 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_tag_new@3x.png
0 → 100644
3.79 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_task_groud@2x.png
0 → 100644
113 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_task_groud@3x.png
0 → 100644
263 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_task_inte_fail@2x.png
0 → 100644
2.76 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_task_inte_fail@3x.png
0 → 100644
5.15 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_task_inte_success@2x.png
0 → 100644
5.34 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_content_task_inte_success@3x.png
0 → 100644
8.83 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_detail_header_groud@2x.png
0 → 100644
84.3 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_detail_header_groud@3x.png
0 → 100644
379 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_inte_detail@2x.png
0 → 100644
263 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_inte_detail@3x.png
0 → 100644
457 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_more@2x.png
0 → 100644
333 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_more@3x.png
0 → 100644
578 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_push_back@2x.png
0 → 100644
332 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_push_back@3x.png
0 → 100644
579 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_push_mall@2x.png
0 → 100644
8.5 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_push_mall@3x.png
0 → 100644
16.6 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_push_more@2x.png
0 → 100644
319 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_push_more@3x.png
0 → 100644
746 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_push_white_back@2x.png
0 → 100644
320 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_push_white_back@3x.png
0 → 100644
539 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_yellow_more@2x.png
0 → 100644
341 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/c_mine_skip_yellow_more@3x.png
0 → 100644
608 Bytes
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/en.lproj/Root.strings
0 → 100644
CNLiveCMineModule/Classes/CNLiveCMineHeader.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineHeader.h | |
| 3 | +// Pods | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/28. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#ifndef CNLiveCMineHeader_h | |
| 9 | +#define CNLiveCMineHeader_h | |
| 10 | + | |
| 11 | +#import <CNLiveBaseKit/CNLiveBaseKit.h> | |
| 12 | +#import <YYCategories/YYCategories.h> | |
| 13 | +#import <QMUIKit/QMUIKit.h> | |
| 14 | +#import <Masonry/Masonry.h> | |
| 15 | +#import <JXPagingView/JXPagerView.h> | |
| 16 | +#import <CNLiveCustomControl/CNLiveCustomControl.h> | |
| 17 | +#import <CNLiveBusinessTools/CNLiveRespCacheManager.h> | |
| 18 | +#import <SDWebImage/SDWebImage.h> | |
| 19 | +#import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h> | |
| 20 | +#import <PGDatePicker/PGDatePicker.h> | |
| 21 | +#import <PGDatePicker/PGDatePickManager.h> | |
| 22 | +#import <MJExtension/MJExtension.h> | |
| 23 | +#import <CNLiveCustomUI/CNLiveRefreshHeader.h> | |
| 24 | +#import <CNLiveCustomUI/CNLiveRefreshFooter.h> | |
| 25 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | |
| 26 | +#import <CNLiveBusinessTools/CNLiveBusinessTools.h> | |
| 27 | +#import <YYText/YYText.h> | |
| 28 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | |
| 29 | +#import <JXCategoryView/JXCategoryView.h> | |
| 30 | + | |
| 31 | +#import "CNLiveCMineInteAnnouListViewController.h" | |
| 32 | +#import "CNLiveCMineInteDetailViewController.h" | |
| 33 | +#import "CNLiveCMineInteTaskViewController.h" | |
| 34 | +#import "CNLiveCMineInteViewController.h" | |
| 35 | +#import "CNLiveCMineModule.h" | |
| 36 | +#import "CNLiveCMineService.h" | |
| 37 | +#import "CNLiveCMineProtocol.h" | |
| 38 | +#endif /* CNLiveCMineHeader_h */ | ... | ... |
CNLiveCMineModule/Classes/CNLiveCMineModule.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineModule.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/28. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveCMineModule : NSObject | |
| 13 | + | |
| 14 | +/// 跳转工程中的我的积分界面 | |
| 15 | ++(void)pushVCWithInteView; | |
| 16 | +@end | |
| 17 | + | |
| 18 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/CNLiveCMineModule.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineModule.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/28. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineModule.h" | |
| 9 | + | |
| 10 | +@implementation CNLiveCMineModule | |
| 11 | + | |
| 12 | +/// 跳转工程中的我的积分界面 | |
| 13 | ++(void)pushVCWithInteView | |
| 14 | +{ | |
| 15 | + [[CNLiveCMineModule navigationViewController] pushViewController:[CNLiveCMineInteViewController new] animated:YES]; | |
| 16 | +} | |
| 17 | + | |
| 18 | + | |
| 19 | +#pragma mark = 私有方法 | |
| 20 | ++ (UINavigationController *)navigationViewController | |
| 21 | +{ | |
| 22 | + | |
| 23 | + if ([[UIApplication sharedApplication].keyWindow.rootViewController isKindOfClass:[UINavigationController class]]) | |
| 24 | + { | |
| 25 | + return (UINavigationController *)[UIApplication sharedApplication].keyWindow.rootViewController; | |
| 26 | + } | |
| 27 | + else if ([[UIApplication sharedApplication].keyWindow.rootViewController isKindOfClass:[UITabBarController class]]) | |
| 28 | + { | |
| 29 | + UIViewController *selectVc = [((UITabBarController *)[UIApplication sharedApplication].keyWindow.rootViewController) selectedViewController]; | |
| 30 | + if ([selectVc isKindOfClass:[UINavigationController class]]) | |
| 31 | + { | |
| 32 | + return (UINavigationController *)selectVc; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + return nil; | |
| 36 | +} | |
| 37 | +@end | ... | ... |
CNLiveCMineModule/Classes/CNLiveCMineProtocol.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineProtocol.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/28. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import "CNLiveCMineInteViewModel.h" | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | +/// 我的组件与工程对接协议 | |
| 14 | +@protocol CNLiveCMineProtocol <NSObject> | |
| 15 | + | |
| 16 | + | |
| 17 | +/// 我的积分跳转主工程webView界面 | |
| 18 | +/// @param url 链接地址 | |
| 19 | +-(void)pushCMineInteContentForCMainWebViewWithURL:(NSString *)url statue:(CNLiveCMineIntePushWebViewStatue)statue; | |
| 20 | + | |
| 21 | +/// 我的积分跳转主工程我的客服界面 | |
| 22 | +-(void)pushCMineInteContentForCMainPlatFromCustomerMedthod; | |
| 23 | + | |
| 24 | +/// 我的积分调用主工程中的友盟统计 | |
| 25 | +-(void)pushCMineInteContentForCMainUMengStatisticaMedthod; | |
| 26 | + | |
| 27 | +@end | |
| 28 | + | |
| 29 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/CNLiveCMineService.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineService.h | |
| 3 | +// AFNetworking | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/27. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import "CNLiveCMineProtocol.h" | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | + | |
| 14 | +@interface CNLiveCMineService : NSObject | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | +#pragma mark = 工具方法 = | |
| 19 | + | |
| 20 | +/// 获取代理协议,与主工程交互 | |
| 21 | ++ (id<CNLiveCMineProtocol>)shareMineProtocol; | |
| 22 | + | |
| 23 | +/// 获取图片 | |
| 24 | +/// @param imageName 图片名 | |
| 25 | ++ (UIImage *)imageWithMineName:(NSString *)imageName; | |
| 26 | +@end | |
| 27 | + | |
| 28 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/CNLiveCMineService.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineService.m | |
| 3 | +// AFNetworking | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/27. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineService.h" | |
| 9 | + | |
| 10 | +@BeeHiveMod(CNLiveCMineService) | |
| 11 | +@interface CNLiveCMineService() <BHModuleProtocol> | |
| 12 | + | |
| 13 | +@property (nonatomic, strong) id<CNLiveCMineProtocol> protocol; | |
| 14 | + | |
| 15 | +@end | |
| 16 | + | |
| 17 | +@implementation CNLiveCMineService | |
| 18 | + | |
| 19 | ++(instancetype)shareCMineServiceManager | |
| 20 | +{ | |
| 21 | + static CNLiveCMineService *mineService = nil; | |
| 22 | + static dispatch_once_t onceToken; | |
| 23 | + dispatch_once(&onceToken, ^{ | |
| 24 | + mineService = [[CNLiveCMineService alloc] init]; | |
| 25 | + }); | |
| 26 | + return mineService; | |
| 27 | +} | |
| 28 | + | |
| 29 | +/// 获取代理协议,与主工程交互 | |
| 30 | ++ (id<CNLiveCMineProtocol>)shareMineProtocol | |
| 31 | +{ | |
| 32 | + return [CNLiveCMineService shareCMineServiceManager].protocol; | |
| 33 | +} | |
| 34 | + | |
| 35 | +/// 启动方法 | |
| 36 | +/// @param context 上下文 | |
| 37 | +-(void)modInit:(BHContext *)context | |
| 38 | +{ | |
| 39 | + [CNLiveCMineService shareCMineServiceManager].protocol = [NSClassFromString(@"CNLiveCMineViewModuleImpl") new]; | |
| 40 | + | |
| 41 | +} | |
| 42 | + | |
| 43 | +#pragma mark = 工具方法 = | |
| 44 | +/// 获取图片 | |
| 45 | +/// @param imageName 图片名 | |
| 46 | ++ (UIImage *)imageWithMineName:(NSString *)imageName | |
| 47 | +{ | |
| 48 | + NSString * path = [[NSBundle bundleForClass:NSClassFromString(@"CNLiveCMineService")] pathForResource:@"CNLiveCMineModule" ofType:@"bundle"]; | |
| 49 | + UIImage * image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@", path, imageName]]; | |
| 50 | + return image; | |
| 51 | +} | |
| 52 | +@end | ... | ... |
CNLiveCMineModule/Classes/Manager/CNLiveCMineDefine.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// CNLiveCMineDefine.h | |
| 3 | -// Pods | |
| 4 | -// | |
| 5 | -// Created by CNLive on 2021/12/21. | |
| 6 | -// | |
| 7 | - | |
| 8 | -#ifndef CNLiveCMineDefine_h | |
| 9 | -#define CNLiveCMineDefine_h | |
| 10 | - | |
| 11 | -#define RGBCOLOR(r,g,b) \ | |
| 12 | -[UIColor colorWithRed:r/256.f green:g/256.f blue:b/256.f alpha:1.f] | |
| 13 | - | |
| 14 | -#define RGBACOLOR(r,g,b,a) \ | |
| 15 | -[UIColor colorWithRed:r/256.f green:g/256.f blue:b/256.f alpha:a] | |
| 16 | - | |
| 17 | -//协议调取方法 | |
| 18 | -#define CNMessageSend(instance,protocol,message) [(id<protocol>)(instance) message] | |
| 19 | - | |
| 20 | - | |
| 21 | -#endif /* CNLiveCMineDefine_h */ |
CNLiveCMineModule/Classes/Manager/CNLiveCMineModule.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// CNLiveCMineModule.h | |
| 3 | -// Pods | |
| 4 | -// | |
| 5 | -// Created by CNLive on 2021/12/21. | |
| 6 | -// | |
| 7 | - | |
| 8 | -#ifndef CNLiveCMineModule_h | |
| 9 | -#define CNLiveCMineModule_h | |
| 10 | - | |
| 11 | -#import <CNLiveBaseKit/CNLiveBaseKit.h> | |
| 12 | -#import "CNLiveCMineDefine.h" | |
| 13 | -#import <YYCategories/YYCategories.h> | |
| 14 | -#import <QMUIKit/QMUIKit.h> | |
| 15 | -#import <Masonry/Masonry.h> | |
| 16 | -#import <SDWebImage/SDWebImage.h> | |
| 17 | -#import <MJExtension/MJExtension.h> | |
| 18 | -#import <CNLiveBusinessTools/CNLiveBusinessTools.h> | |
| 19 | -#import <YYText/YYText.h> | |
| 20 | -#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | |
| 21 | -#import <JXCategoryView/JXCategoryView.h> | |
| 22 | -#import <CNLivePhotoBrowser/UIViewController+CNLivePhotoBrowserStatusBar.h> | |
| 23 | -#import <CNLiveNewIMAManagerKit/CNLiveNewIMAManagerKit.h> | |
| 24 | - | |
| 25 | -#endif /* CNLiveCMineModule_h */ |
CNLiveCMineModule/Classes/Manager/YYKeychain.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// YYKeychain.h | |
| 3 | -// YYKit <https://github.com/ibireme/YYKit> | |
| 4 | -// | |
| 5 | -// Created by ibireme on 14/10/15. | |
| 6 | -// Copyright (c) 2015 ibireme. | |
| 7 | -// | |
| 8 | -// This source code is licensed under the MIT-style license found in the | |
| 9 | -// LICENSE file in the root directory of this source tree. | |
| 10 | -// | |
| 11 | - | |
| 12 | -#import <Foundation/Foundation.h> | |
| 13 | - | |
| 14 | -@class YYKeychainItem; | |
| 15 | - | |
| 16 | -NS_ASSUME_NONNULL_BEGIN | |
| 17 | - | |
| 18 | -/** | |
| 19 | - A wrapper for system keychain API. | |
| 20 | - | |
| 21 | - Inspired by [SSKeychain](https://github.com/soffes/sskeychain) 😜 | |
| 22 | - */ | |
| 23 | -@interface YYKeychain : NSObject | |
| 24 | - | |
| 25 | -#pragma mark - Convenience method for keychain | |
| 26 | -///============================================================================= | |
| 27 | -/// @name Convenience method for keychain | |
| 28 | -///============================================================================= | |
| 29 | - | |
| 30 | -/** | |
| 31 | - Returns the password for a given account and service, or `nil` if not found or | |
| 32 | - an error occurs. | |
| 33 | - | |
| 34 | - @param serviceName The service for which to return the corresponding password. | |
| 35 | - This value must not be nil. | |
| 36 | - | |
| 37 | - @param account The account for which to return the corresponding password. | |
| 38 | - This value must not be nil. | |
| 39 | - | |
| 40 | - @param error On input, a pointer to an error object. If an error occurs, | |
| 41 | - this pointer is set to an actual error object containing the error information. | |
| 42 | - You may specify nil for this parameter if you do not want the error information. | |
| 43 | - See `YYKeychainErrorCode`. | |
| 44 | - | |
| 45 | - @return Password string, or nil when not found or error occurs. | |
| 46 | - */ | |
| 47 | -+ (nullable NSString *)getPasswordForService:(NSString *)serviceName | |
| 48 | - account:(NSString *)account | |
| 49 | - error:(NSError **)error; | |
| 50 | -+ (nullable NSString *)getPasswordForService:(NSString *)serviceName | |
| 51 | - account:(NSString *)account; | |
| 52 | - | |
| 53 | -/** | |
| 54 | - Deletes a password from the Keychain. | |
| 55 | - | |
| 56 | - @param serviceName The service for which to return the corresponding password. | |
| 57 | - This value must not be nil. | |
| 58 | - | |
| 59 | - @param account The account for which to return the corresponding password. | |
| 60 | - This value must not be nil. | |
| 61 | - | |
| 62 | - @param error On input, a pointer to an error object. If an error occurs, | |
| 63 | - this pointer is set to an actual error object containing the error information. | |
| 64 | - You may specify nil for this parameter if you do not want the error information. | |
| 65 | - See `YYKeychainErrorCode`. | |
| 66 | - | |
| 67 | - @return Whether succeed. | |
| 68 | - */ | |
| 69 | -+ (BOOL)deletePasswordForService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error; | |
| 70 | -+ (BOOL)deletePasswordForService:(NSString *)serviceName account:(NSString *)account; | |
| 71 | - | |
| 72 | -/** | |
| 73 | - Insert or update the password for a given account and service. | |
| 74 | - | |
| 75 | - @param password The new password. | |
| 76 | - | |
| 77 | - @param serviceName The service for which to return the corresponding password. | |
| 78 | - This value must not be nil. | |
| 79 | - | |
| 80 | - @param account The account for which to return the corresponding password. | |
| 81 | - This value must not be nil. | |
| 82 | - | |
| 83 | - @param error On input, a pointer to an error object. If an error occurs, | |
| 84 | - this pointer is set to an actual error object containing the error information. | |
| 85 | - You may specify nil for this parameter if you do not want the error information. | |
| 86 | - See `YYKeychainErrorCode`. | |
| 87 | - | |
| 88 | - @return Whether succeed. | |
| 89 | - */ | |
| 90 | -+ (BOOL)setPassword:(NSString *)password | |
| 91 | - forService:(NSString *)serviceName | |
| 92 | - account:(NSString *)account | |
| 93 | - error:(NSError **)error; | |
| 94 | -+ (BOOL)setPassword:(NSString *)password | |
| 95 | - forService:(NSString *)serviceName | |
| 96 | - account:(NSString *)account; | |
| 97 | - | |
| 98 | - | |
| 99 | -#pragma mark - Full query for keychain (SQL-like) | |
| 100 | -///============================================================================= | |
| 101 | -/// @name Full query for keychain (SQL-like) | |
| 102 | -///============================================================================= | |
| 103 | - | |
| 104 | -/** | |
| 105 | - Insert an item into keychain. | |
| 106 | - | |
| 107 | - @discussion The service,account,password is required. If there's item exist | |
| 108 | - already, an error occurs and insert fail. | |
| 109 | - | |
| 110 | - @param item The item to insert. | |
| 111 | - | |
| 112 | - @param error On input, a pointer to an error object. If an error occurs, | |
| 113 | - this pointer is set to an actual error object containing the error information. | |
| 114 | - You may specify nil for this parameter if you do not want the error information. | |
| 115 | - See `YYKeychainErrorCode`. | |
| 116 | - | |
| 117 | - @return Whether succeed. | |
| 118 | - */ | |
| 119 | -+ (BOOL)insertItem:(YYKeychainItem *)item error:(NSError **)error; | |
| 120 | -+ (BOOL)insertItem:(YYKeychainItem *)item; | |
| 121 | - | |
| 122 | -/** | |
| 123 | - Update item in keychain. | |
| 124 | - | |
| 125 | - @discussion The service,account,password is required. If there's no item exist | |
| 126 | - already, an error occurs and insert fail. | |
| 127 | - | |
| 128 | - @param item The item to insert. | |
| 129 | - | |
| 130 | - @param error On input, a pointer to an error object. If an error occurs, | |
| 131 | - this pointer is set to an actual error object containing the error information. | |
| 132 | - You may specify nil for this parameter if you do not want the error information. | |
| 133 | - See `YYKeychainErrorCode`. | |
| 134 | - | |
| 135 | - @return Whether succeed. | |
| 136 | - */ | |
| 137 | -+ (BOOL)updateItem:(YYKeychainItem *)item error:(NSError **)error; | |
| 138 | -+ (BOOL)updateItem:(YYKeychainItem *)item; | |
| 139 | - | |
| 140 | -/** | |
| 141 | - Delete items from keychain. | |
| 142 | - | |
| 143 | - @discussion The service,account,password is required. If there's item exist | |
| 144 | - already, an error occurs and insert fail. | |
| 145 | - | |
| 146 | - @param item The item to update. | |
| 147 | - | |
| 148 | - @param error On input, a pointer to an error object. If an error occurs, | |
| 149 | - this pointer is set to an actual error object containing the error information. | |
| 150 | - You may specify nil for this parameter if you do not want the error information. | |
| 151 | - See `YYKeychainErrorCode`. | |
| 152 | - | |
| 153 | - @return Whether succeed. | |
| 154 | - */ | |
| 155 | -+ (BOOL)deleteItem:(YYKeychainItem *)item error:(NSError **)error; | |
| 156 | -+ (BOOL)deleteItem:(YYKeychainItem *)item; | |
| 157 | - | |
| 158 | -/** | |
| 159 | - Find an item from keychain. | |
| 160 | - | |
| 161 | - @discussion The service,account is optinal. It returns only one item if there | |
| 162 | - exist multi. | |
| 163 | - | |
| 164 | - @param item The item for query. | |
| 165 | - | |
| 166 | - @param error On input, a pointer to an error object. If an error occurs, | |
| 167 | - this pointer is set to an actual error object containing the error information. | |
| 168 | - You may specify nil for this parameter if you do not want the error information. | |
| 169 | - See `YYKeychainErrorCode`. | |
| 170 | - | |
| 171 | - @return An item or nil. | |
| 172 | - */ | |
| 173 | -+ (nullable YYKeychainItem *)selectOneItem:(YYKeychainItem *)item error:(NSError **)error; | |
| 174 | -+ (nullable YYKeychainItem *)selectOneItem:(YYKeychainItem *)item; | |
| 175 | - | |
| 176 | -/** | |
| 177 | - Find all items matches the query. | |
| 178 | - | |
| 179 | - @discussion The service,account is optinal. It returns all item matches by the | |
| 180 | - query. | |
| 181 | - | |
| 182 | - @param item The item for query. | |
| 183 | - | |
| 184 | - @param error On input, a pointer to an error object. If an error occurs, | |
| 185 | - this pointer is set to an actual error object containing the error information. | |
| 186 | - You may specify nil for this parameter if you do not want the error information. | |
| 187 | - See `YYKeychainErrorCode`. | |
| 188 | - | |
| 189 | - @return An array of YYKeychainItem. | |
| 190 | - */ | |
| 191 | -+ (nullable NSArray<YYKeychainItem *> *)selectItems:(YYKeychainItem *)item error:(NSError **)error; | |
| 192 | -+ (nullable NSArray<YYKeychainItem *> *)selectItems:(YYKeychainItem *)item; | |
| 193 | - | |
| 194 | -@end | |
| 195 | - | |
| 196 | - | |
| 197 | - | |
| 198 | - | |
| 199 | -#pragma mark - Const | |
| 200 | - | |
| 201 | -/** | |
| 202 | - Error code in YYKeychain API. | |
| 203 | - */ | |
| 204 | -typedef NS_ENUM (NSUInteger, YYKeychainErrorCode) { | |
| 205 | - YYKeychainErrorUnimplemented = 1, ///< Function or operation not implemented. | |
| 206 | - YYKeychainErrorIO, ///< I/O error (bummers) | |
| 207 | - YYKeychainErrorOpWr, ///< File already open with with write permission. | |
| 208 | - YYKeychainErrorParam, ///< One or more parameters passed to a function where not valid. | |
| 209 | - YYKeychainErrorAllocate, ///< Failed to allocate memory. | |
| 210 | - YYKeychainErrorUserCancelled, ///< User cancelled the operation. | |
| 211 | - YYKeychainErrorBadReq, ///< Bad parameter or invalid state for operation. | |
| 212 | - YYKeychainErrorInternalComponent, ///< Internal... | |
| 213 | - YYKeychainErrorNotAvailable, ///< No keychain is available. You may need to restart your computer. | |
| 214 | - YYKeychainErrorDuplicateItem, ///< The specified item already exists in the keychain. | |
| 215 | - YYKeychainErrorItemNotFound, ///< The specified item could not be found in the keychain. | |
| 216 | - YYKeychainErrorInteractionNotAllowed, ///< User interaction is not allowed. | |
| 217 | - YYKeychainErrorDecode, ///< Unable to decode the provided data. | |
| 218 | - YYKeychainErrorAuthFailed, ///< The user name or passphrase you entered is not. | |
| 219 | -}; | |
| 220 | - | |
| 221 | - | |
| 222 | -/** | |
| 223 | - When query to return the item's data, the error | |
| 224 | - errSecInteractionNotAllowed will be returned if the item's data is not | |
| 225 | - available until a device unlock occurs. | |
| 226 | - */ | |
| 227 | -typedef NS_ENUM (NSUInteger, YYKeychainAccessible) { | |
| 228 | - YYKeychainAccessibleNone = 0, ///< no value | |
| 229 | - | |
| 230 | - /** Item data can only be accessed | |
| 231 | - while the device is unlocked. This is recommended for items that only | |
| 232 | - need be accesible while the application is in the foreground. Items | |
| 233 | - with this attribute will migrate to a new device when using encrypted | |
| 234 | - backups. */ | |
| 235 | - YYKeychainAccessibleWhenUnlocked, | |
| 236 | - | |
| 237 | - /** Item data can only be | |
| 238 | - accessed once the device has been unlocked after a restart. This is | |
| 239 | - recommended for items that need to be accesible by background | |
| 240 | - applications. Items with this attribute will migrate to a new device | |
| 241 | - when using encrypted backups.*/ | |
| 242 | - YYKeychainAccessibleAfterFirstUnlock, | |
| 243 | - | |
| 244 | - /** Item data can always be accessed | |
| 245 | - regardless of the lock state of the device. This is not recommended | |
| 246 | - for anything except system use. Items with this attribute will migrate | |
| 247 | - to a new device when using encrypted backups.*/ | |
| 248 | - YYKeychainAccessibleAlways, | |
| 249 | - | |
| 250 | - /** Item data can | |
| 251 | - only be accessed while the device is unlocked. This class is only | |
| 252 | - available if a passcode is set on the device. This is recommended for | |
| 253 | - items that only need to be accessible while the application is in the | |
| 254 | - foreground. Items with this attribute will never migrate to a new | |
| 255 | - device, so after a backup is restored to a new device, these items | |
| 256 | - will be missing. No items can be stored in this class on devices | |
| 257 | - without a passcode. Disabling the device passcode will cause all | |
| 258 | - items in this class to be deleted.*/ | |
| 259 | - YYKeychainAccessibleWhenPasscodeSetThisDeviceOnly, | |
| 260 | - | |
| 261 | - /** Item data can only | |
| 262 | - be accessed while the device is unlocked. This is recommended for items | |
| 263 | - that only need be accesible while the application is in the foreground. | |
| 264 | - Items with this attribute will never migrate to a new device, so after | |
| 265 | - a backup is restored to a new device, these items will be missing. */ | |
| 266 | - YYKeychainAccessibleWhenUnlockedThisDeviceOnly, | |
| 267 | - | |
| 268 | - /** Item data can | |
| 269 | - only be accessed once the device has been unlocked after a restart. | |
| 270 | - This is recommended for items that need to be accessible by background | |
| 271 | - applications. Items with this attribute will never migrate to a new | |
| 272 | - device, so after a backup is restored to a new device these items will | |
| 273 | - be missing.*/ | |
| 274 | - YYKeychainAccessibleAfterFirstUnlockThisDeviceOnly, | |
| 275 | - | |
| 276 | - /** Item data can always | |
| 277 | - be accessed regardless of the lock state of the device. This option | |
| 278 | - is not recommended for anything except system use. Items with this | |
| 279 | - attribute will never migrate to a new device, so after a backup is | |
| 280 | - restored to a new device, these items will be missing.*/ | |
| 281 | - YYKeychainAccessibleAlwaysThisDeviceOnly, | |
| 282 | -}; | |
| 283 | - | |
| 284 | -/** | |
| 285 | - Whether the item in question can be synchronized. | |
| 286 | - */ | |
| 287 | -typedef NS_ENUM (NSUInteger, YYKeychainQuerySynchronizationMode) { | |
| 288 | - | |
| 289 | - /** Default, Don't care for synchronization */ | |
| 290 | - YYKeychainQuerySynchronizationModeAny = 0, | |
| 291 | - | |
| 292 | - /** Is not synchronized */ | |
| 293 | - YYKeychainQuerySynchronizationModeNo, | |
| 294 | - | |
| 295 | - /** To add a new item which can be synced to other devices, or to obtain | |
| 296 | - synchronized results from a query*/ | |
| 297 | - YYKeychainQuerySynchronizationModeYes, | |
| 298 | -} NS_AVAILABLE_IOS (7_0); | |
| 299 | - | |
| 300 | - | |
| 301 | -#pragma mark - Item | |
| 302 | - | |
| 303 | -/** | |
| 304 | - Wrapper for keychain item/query. | |
| 305 | - */ | |
| 306 | -@interface YYKeychainItem : NSObject <NSCopying> | |
| 307 | - | |
| 308 | -@property (nullable, nonatomic, copy) NSString *service; ///< kSecAttrService | |
| 309 | -@property (nullable, nonatomic, copy) NSString *account; ///< kSecAttrAccount | |
| 310 | -@property (nullable, nonatomic, copy) NSData *passwordData; ///< kSecValueData | |
| 311 | -@property (nullable, nonatomic, copy) NSString *password; ///< shortcut for `passwordData` | |
| 312 | -@property (nullable, nonatomic, copy) id <NSCoding> passwordObject; ///< shortcut for `passwordData` | |
| 313 | - | |
| 314 | -@property (nullable, nonatomic, copy) NSString *label; ///< kSecAttrLabel | |
| 315 | -@property (nullable, nonatomic, copy) NSNumber *type; ///< kSecAttrType (FourCC) | |
| 316 | -@property (nullable, nonatomic, copy) NSNumber *creater; ///< kSecAttrCreator (FourCC) | |
| 317 | -@property (nullable, nonatomic, copy) NSString *comment; ///< kSecAttrComment | |
| 318 | -@property (nullable, nonatomic, copy) NSString *descr; ///< kSecAttrDescription | |
| 319 | -@property (nullable, nonatomic, readonly, strong) NSDate *modificationDate; ///< kSecAttrModificationDate | |
| 320 | -@property (nullable, nonatomic, readonly, strong) NSDate *creationDate; ///< kSecAttrCreationDate | |
| 321 | -@property (nullable, nonatomic, copy) NSString *accessGroup; ///< kSecAttrAccessGroup | |
| 322 | - | |
| 323 | -@property (nonatomic) YYKeychainAccessible accessible; ///< kSecAttrAccessible | |
| 324 | -@property (nonatomic) YYKeychainQuerySynchronizationMode synchronizable NS_AVAILABLE_IOS(7_0); ///< kSecAttrSynchronizable | |
| 325 | - | |
| 326 | -@end | |
| 327 | - | |
| 328 | -NS_ASSUME_NONNULL_END |
CNLiveCMineModule/Classes/Manager/YYKeychain.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// YYKeychain.m | |
| 3 | -// YYKit <https://github.com/ibireme/YYKit> | |
| 4 | -// | |
| 5 | -// Created by ibireme on 14/10/15. | |
| 6 | -// Copyright (c) 2015 ibireme. | |
| 7 | -// | |
| 8 | -// This source code is licensed under the MIT-style license found in the | |
| 9 | -// LICENSE file in the root directory of this source tree. | |
| 10 | -// | |
| 11 | - | |
| 12 | -#import "YYKeychain.h" | |
| 13 | -#import "UIDevice+YYAdd.h" | |
| 14 | -//#import "YYKitMacro.h" | |
| 15 | -#import <Security/Security.h> | |
| 16 | - | |
| 17 | - | |
| 18 | -static YYKeychainErrorCode YYKeychainErrorCodeFromOSStatus(OSStatus status) { | |
| 19 | - switch (status) { | |
| 20 | - case errSecUnimplemented: return YYKeychainErrorUnimplemented; | |
| 21 | - case errSecIO: return YYKeychainErrorIO; | |
| 22 | - case errSecOpWr: return YYKeychainErrorOpWr; | |
| 23 | - case errSecParam: return YYKeychainErrorParam; | |
| 24 | - case errSecAllocate: return YYKeychainErrorAllocate; | |
| 25 | - case errSecUserCanceled: return YYKeychainErrorUserCancelled; | |
| 26 | - case errSecBadReq: return YYKeychainErrorBadReq; | |
| 27 | - case errSecInternalComponent: return YYKeychainErrorInternalComponent; | |
| 28 | - case errSecNotAvailable: return YYKeychainErrorNotAvailable; | |
| 29 | - case errSecDuplicateItem: return YYKeychainErrorDuplicateItem; | |
| 30 | - case errSecItemNotFound: return YYKeychainErrorItemNotFound; | |
| 31 | - case errSecInteractionNotAllowed: return YYKeychainErrorInteractionNotAllowed; | |
| 32 | - case errSecDecode: return YYKeychainErrorDecode; | |
| 33 | - case errSecAuthFailed: return YYKeychainErrorAuthFailed; | |
| 34 | - default: return 0; | |
| 35 | - } | |
| 36 | -} | |
| 37 | - | |
| 38 | -static NSString *YYKeychainErrorDesc(YYKeychainErrorCode code) { | |
| 39 | - switch (code) { | |
| 40 | - case YYKeychainErrorUnimplemented: | |
| 41 | - return @"Function or operation not implemented."; | |
| 42 | - case YYKeychainErrorIO: | |
| 43 | - return @"I/O error (bummers)"; | |
| 44 | - case YYKeychainErrorOpWr: | |
| 45 | - return @"ile already open with with write permission."; | |
| 46 | - case YYKeychainErrorParam: | |
| 47 | - return @"One or more parameters passed to a function where not valid."; | |
| 48 | - case YYKeychainErrorAllocate: | |
| 49 | - return @"Failed to allocate memory."; | |
| 50 | - case YYKeychainErrorUserCancelled: | |
| 51 | - return @"User canceled the operation."; | |
| 52 | - case YYKeychainErrorBadReq: | |
| 53 | - return @"Bad parameter or invalid state for operation."; | |
| 54 | - case YYKeychainErrorInternalComponent: | |
| 55 | - return @"Inrernal Component"; | |
| 56 | - case YYKeychainErrorNotAvailable: | |
| 57 | - return @"No keychain is available. You may need to restart your computer."; | |
| 58 | - case YYKeychainErrorDuplicateItem: | |
| 59 | - return @"The specified item already exists in the keychain."; | |
| 60 | - case YYKeychainErrorItemNotFound: | |
| 61 | - return @"The specified item could not be found in the keychain."; | |
| 62 | - case YYKeychainErrorInteractionNotAllowed: | |
| 63 | - return @"User interaction is not allowed."; | |
| 64 | - case YYKeychainErrorDecode: | |
| 65 | - return @"Unable to decode the provided data."; | |
| 66 | - case YYKeychainErrorAuthFailed: | |
| 67 | - return @"The user name or passphrase you entered is not"; | |
| 68 | - default: | |
| 69 | - break; | |
| 70 | - } | |
| 71 | - return nil; | |
| 72 | -} | |
| 73 | - | |
| 74 | -static NSString *YYKeychainAccessibleStr(YYKeychainAccessible e) { | |
| 75 | - switch (e) { | |
| 76 | - case YYKeychainAccessibleWhenUnlocked: | |
| 77 | - return (__bridge NSString *)(kSecAttrAccessibleWhenUnlocked); | |
| 78 | - case YYKeychainAccessibleAfterFirstUnlock: | |
| 79 | - return (__bridge NSString *)(kSecAttrAccessibleAfterFirstUnlock); | |
| 80 | - case YYKeychainAccessibleAlways: | |
| 81 | - return (__bridge NSString *)(kSecAttrAccessibleAlways); | |
| 82 | - case YYKeychainAccessibleWhenPasscodeSetThisDeviceOnly: | |
| 83 | - return (__bridge NSString *)(kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly); | |
| 84 | - case YYKeychainAccessibleWhenUnlockedThisDeviceOnly: | |
| 85 | - return (__bridge NSString *)(kSecAttrAccessibleWhenUnlockedThisDeviceOnly); | |
| 86 | - case YYKeychainAccessibleAfterFirstUnlockThisDeviceOnly: | |
| 87 | - return (__bridge NSString *)(kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly); | |
| 88 | - case YYKeychainAccessibleAlwaysThisDeviceOnly: | |
| 89 | - return (__bridge NSString *)(kSecAttrAccessibleAlwaysThisDeviceOnly); | |
| 90 | - default: | |
| 91 | - return nil; | |
| 92 | - } | |
| 93 | -} | |
| 94 | - | |
| 95 | -static YYKeychainAccessible YYKeychainAccessibleEnum(NSString *s) { | |
| 96 | - if ([s isEqualToString:(__bridge NSString *)kSecAttrAccessibleWhenUnlocked]) | |
| 97 | - return YYKeychainAccessibleWhenUnlocked; | |
| 98 | - if ([s isEqualToString:(__bridge NSString *)kSecAttrAccessibleAfterFirstUnlock]) | |
| 99 | - return YYKeychainAccessibleAfterFirstUnlock; | |
| 100 | - if ([s isEqualToString:(__bridge NSString *)kSecAttrAccessibleAlways]) | |
| 101 | - return YYKeychainAccessibleAlways; | |
| 102 | - if ([s isEqualToString:(__bridge NSString *)kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly]) | |
| 103 | - return YYKeychainAccessibleWhenPasscodeSetThisDeviceOnly; | |
| 104 | - if ([s isEqualToString:(__bridge NSString *)kSecAttrAccessibleWhenUnlockedThisDeviceOnly]) | |
| 105 | - return YYKeychainAccessibleWhenUnlockedThisDeviceOnly; | |
| 106 | - if ([s isEqualToString:(__bridge NSString *)kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly]) | |
| 107 | - return YYKeychainAccessibleAfterFirstUnlockThisDeviceOnly; | |
| 108 | - if ([s isEqualToString:(__bridge NSString *)kSecAttrAccessibleAlwaysThisDeviceOnly]) | |
| 109 | - return YYKeychainAccessibleAlwaysThisDeviceOnly; | |
| 110 | - return YYKeychainAccessibleNone; | |
| 111 | -} | |
| 112 | - | |
| 113 | -static id YYKeychainQuerySynchonizationID(YYKeychainQuerySynchronizationMode mode) { | |
| 114 | - switch (mode) { | |
| 115 | - case YYKeychainQuerySynchronizationModeAny: | |
| 116 | - return (__bridge id)(kSecAttrSynchronizableAny); | |
| 117 | - case YYKeychainQuerySynchronizationModeNo: | |
| 118 | - return (__bridge id)kCFBooleanFalse; | |
| 119 | - case YYKeychainQuerySynchronizationModeYes: | |
| 120 | - return (__bridge id)kCFBooleanTrue; | |
| 121 | - default: | |
| 122 | - return (__bridge id)(kSecAttrSynchronizableAny); | |
| 123 | - } | |
| 124 | -} | |
| 125 | - | |
| 126 | -static YYKeychainQuerySynchronizationMode YYKeychainQuerySynchonizationEnum(NSNumber *num) { | |
| 127 | - if ([num isEqualToNumber:@NO]) return YYKeychainQuerySynchronizationModeNo; | |
| 128 | - if ([num isEqualToNumber:@YES]) return YYKeychainQuerySynchronizationModeYes; | |
| 129 | - return YYKeychainQuerySynchronizationModeAny; | |
| 130 | -} | |
| 131 | - | |
| 132 | -@interface YYKeychainItem () | |
| 133 | -@property (nonatomic, readwrite, strong) NSDate *modificationDate; | |
| 134 | -@property (nonatomic, readwrite, strong) NSDate *creationDate; | |
| 135 | -@end | |
| 136 | - | |
| 137 | -@implementation YYKeychainItem | |
| 138 | - | |
| 139 | - | |
| 140 | -- (void)setPasswordObject:(id <NSCoding> )object { | |
| 141 | - self.passwordData = [NSKeyedArchiver archivedDataWithRootObject:object]; | |
| 142 | -} | |
| 143 | - | |
| 144 | -- (id <NSCoding> )passwordObject { | |
| 145 | - if ([self.passwordData length]) { | |
| 146 | - return [NSKeyedUnarchiver unarchiveObjectWithData:self.passwordData]; | |
| 147 | - } | |
| 148 | - return nil; | |
| 149 | -} | |
| 150 | - | |
| 151 | -- (void)setPassword:(NSString *)password { | |
| 152 | - self.passwordData = [password dataUsingEncoding:NSUTF8StringEncoding]; | |
| 153 | -} | |
| 154 | - | |
| 155 | -- (NSString *)password { | |
| 156 | - if ([self.passwordData length]) { | |
| 157 | - return [[NSString alloc] initWithData:self.passwordData encoding:NSUTF8StringEncoding]; | |
| 158 | - } | |
| 159 | - return nil; | |
| 160 | -} | |
| 161 | - | |
| 162 | -- (NSMutableDictionary *)queryDic { | |
| 163 | - NSMutableDictionary *dic = [NSMutableDictionary new]; | |
| 164 | - | |
| 165 | - dic[(__bridge id)kSecClass] = (__bridge id)kSecClassGenericPassword; | |
| 166 | - | |
| 167 | - if (self.account) dic[(__bridge id)kSecAttrAccount] = self.account; | |
| 168 | - if (self.service) dic[(__bridge id)kSecAttrService] = self.service; | |
| 169 | - | |
| 170 | - if (![UIDevice currentDevice].isSimulator) { | |
| 171 | - // Remove the access group if running on the iPhone simulator. | |
| 172 | - // | |
| 173 | - // Apps that are built for the simulator aren't signed, so there's no keychain access group | |
| 174 | - // for the simulator to check. This means that all apps can see all keychain items when run | |
| 175 | - // on the simulator. | |
| 176 | - // | |
| 177 | - // If a SecItem contains an access group attribute, SecItemAdd and SecItemUpdate on the | |
| 178 | - // simulator will return -25243 (errSecNoAccessForItem). | |
| 179 | - // | |
| 180 | - // The access group attribute will be included in items returned by SecItemCopyMatching, | |
| 181 | - // which is why we need to remove it before updating the item. | |
| 182 | - if (self.accessGroup) dic[(__bridge id)kSecAttrAccessGroup] = self.accessGroup; | |
| 183 | - } | |
| 184 | - | |
| 185 | - if (kiOS7Later) { | |
| 186 | - dic[(__bridge id)kSecAttrSynchronizable] = YYKeychainQuerySynchonizationID(self.synchronizable); | |
| 187 | - } | |
| 188 | - | |
| 189 | - return dic; | |
| 190 | -} | |
| 191 | - | |
| 192 | -- (NSMutableDictionary *)dic { | |
| 193 | - NSMutableDictionary *dic = [NSMutableDictionary new]; | |
| 194 | - | |
| 195 | - dic[(__bridge id)kSecClass] = (__bridge id)kSecClassGenericPassword; | |
| 196 | - | |
| 197 | - if (self.account) dic[(__bridge id)kSecAttrAccount] = self.account; | |
| 198 | - if (self.service) dic[(__bridge id)kSecAttrService] = self.service; | |
| 199 | - if (self.label) dic[(__bridge id)kSecAttrLabel] = self.label; | |
| 200 | - | |
| 201 | - if (![UIDevice currentDevice].isSimulator) { | |
| 202 | - // Remove the access group if running on the iPhone simulator. | |
| 203 | - // | |
| 204 | - // Apps that are built for the simulator aren't signed, so there's no keychain access group | |
| 205 | - // for the simulator to check. This means that all apps can see all keychain items when run | |
| 206 | - // on the simulator. | |
| 207 | - // | |
| 208 | - // If a SecItem contains an access group attribute, SecItemAdd and SecItemUpdate on the | |
| 209 | - // simulator will return -25243 (errSecNoAccessForItem). | |
| 210 | - // | |
| 211 | - // The access group attribute will be included in items returned by SecItemCopyMatching, | |
| 212 | - // which is why we need to remove it before updating the item. | |
| 213 | - if (self.accessGroup) dic[(__bridge id)kSecAttrAccessGroup] = self.accessGroup; | |
| 214 | - } | |
| 215 | - | |
| 216 | - if (kiOS7Later) { | |
| 217 | - dic[(__bridge id)kSecAttrSynchronizable] = YYKeychainQuerySynchonizationID(self.synchronizable); | |
| 218 | - } | |
| 219 | - | |
| 220 | - if (self.accessible) dic[(__bridge id)kSecAttrAccessible] = YYKeychainAccessibleStr(self.accessible); | |
| 221 | - if (self.passwordData) dic[(__bridge id)kSecValueData] = self.passwordData; | |
| 222 | - if (self.type) dic[(__bridge id)kSecAttrType] = self.type; | |
| 223 | - if (self.creater) dic[(__bridge id)kSecAttrCreator] = self.creater; | |
| 224 | - if (self.comment) dic[(__bridge id)kSecAttrComment] = self.comment; | |
| 225 | - if (self.descr) dic[(__bridge id)kSecAttrDescription] = self.descr; | |
| 226 | - | |
| 227 | - return dic; | |
| 228 | -} | |
| 229 | - | |
| 230 | -- (instancetype)initWithDic:(NSDictionary *)dic { | |
| 231 | - if (dic.count == 0) return nil; | |
| 232 | - self = self.init; | |
| 233 | - | |
| 234 | - self.service = dic[(__bridge id)kSecAttrService]; | |
| 235 | - self.account = dic[(__bridge id)kSecAttrAccount]; | |
| 236 | - self.passwordData = dic[(__bridge id)kSecValueData]; | |
| 237 | - self.label = dic[(__bridge id)kSecAttrLabel]; | |
| 238 | - self.type = dic[(__bridge id)kSecAttrType]; | |
| 239 | - self.creater = dic[(__bridge id)kSecAttrCreator]; | |
| 240 | - self.comment = dic[(__bridge id)kSecAttrComment]; | |
| 241 | - self.descr = dic[(__bridge id)kSecAttrDescription]; | |
| 242 | - self.modificationDate = dic[(__bridge id)kSecAttrModificationDate]; | |
| 243 | - self.creationDate = dic[(__bridge id)kSecAttrCreationDate]; | |
| 244 | - self.accessGroup = dic[(__bridge id)kSecAttrAccessGroup]; | |
| 245 | - self.accessible = YYKeychainAccessibleEnum(dic[(__bridge id)kSecAttrAccessible]); | |
| 246 | - self.synchronizable = YYKeychainQuerySynchonizationEnum(dic[(__bridge id)kSecAttrSynchronizable]); | |
| 247 | - | |
| 248 | - return self; | |
| 249 | -} | |
| 250 | - | |
| 251 | -- (id)copyWithZone:(NSZone *)zone { | |
| 252 | - YYKeychainItem *item = [YYKeychainItem new]; | |
| 253 | - item.service = self.service; | |
| 254 | - item.account = self.account; | |
| 255 | - item.passwordData = self.passwordData; | |
| 256 | - item.label = self.label; | |
| 257 | - item.type = self.type; | |
| 258 | - item.creater = self.creater; | |
| 259 | - item.comment = self.comment; | |
| 260 | - item.descr = self.descr; | |
| 261 | - item.modificationDate = self.modificationDate; | |
| 262 | - item.creationDate = self.creationDate; | |
| 263 | - item.accessGroup = self.accessGroup; | |
| 264 | - item.accessible = self.accessible; | |
| 265 | - item.synchronizable = self.synchronizable; | |
| 266 | - return item; | |
| 267 | -} | |
| 268 | - | |
| 269 | -- (NSString *)description { | |
| 270 | - NSMutableString *str = @"".mutableCopy; | |
| 271 | - [str appendString:@"YYKeychainItem:{\n"]; | |
| 272 | - if (self.service) [str appendFormat:@" service:%@,\n", self.service]; | |
| 273 | - if (self.account) [str appendFormat:@" service:%@,\n", self.account]; | |
| 274 | - if (self.password) [str appendFormat:@" service:%@,\n", self.password]; | |
| 275 | - if (self.label) [str appendFormat:@" service:%@,\n", self.label]; | |
| 276 | - if (self.type) [str appendFormat:@" service:%@,\n", self.type]; | |
| 277 | - if (self.creater) [str appendFormat:@" service:%@,\n", self.creater]; | |
| 278 | - if (self.comment) [str appendFormat:@" service:%@,\n", self.comment]; | |
| 279 | - if (self.descr) [str appendFormat:@" service:%@,\n", self.descr]; | |
| 280 | - if (self.modificationDate) [str appendFormat:@" service:%@,\n", self.modificationDate]; | |
| 281 | - if (self.creationDate) [str appendFormat:@" service:%@,\n", self.creationDate]; | |
| 282 | - if (self.accessGroup) [str appendFormat:@" service:%@,\n", self.accessGroup]; | |
| 283 | - [str appendString:@"}"]; | |
| 284 | - return str; | |
| 285 | -} | |
| 286 | - | |
| 287 | -@end | |
| 288 | - | |
| 289 | - | |
| 290 | - | |
| 291 | -@implementation YYKeychain | |
| 292 | - | |
| 293 | -+ (NSString *)getPasswordForService:(NSString *)serviceName | |
| 294 | - account:(NSString *)account | |
| 295 | - error:(NSError **)error { | |
| 296 | - if (!serviceName || !account) { | |
| 297 | - if (error) *error = [YYKeychain errorWithCode:errSecParam]; | |
| 298 | - return nil; | |
| 299 | - } | |
| 300 | - | |
| 301 | - YYKeychainItem *item = [YYKeychainItem new]; | |
| 302 | - item.service = serviceName; | |
| 303 | - item.account = account; | |
| 304 | - YYKeychainItem *result = [self selectOneItem:item error:error]; | |
| 305 | - return result.password; | |
| 306 | -} | |
| 307 | - | |
| 308 | -+ (nullable NSString *)getPasswordForService:(NSString *)serviceName | |
| 309 | - account:(NSString *)account { | |
| 310 | - return [self getPasswordForService:serviceName account:account error:NULL]; | |
| 311 | -} | |
| 312 | - | |
| 313 | -+ (BOOL)deletePasswordForService:(NSString *)serviceName | |
| 314 | - account:(NSString *)account | |
| 315 | - error:(NSError **)error { | |
| 316 | - if (!serviceName || !account) { | |
| 317 | - if (error) *error = [YYKeychain errorWithCode:errSecParam]; | |
| 318 | - return NO; | |
| 319 | - } | |
| 320 | - | |
| 321 | - YYKeychainItem *item = [YYKeychainItem new]; | |
| 322 | - item.service = serviceName; | |
| 323 | - item.account = account; | |
| 324 | - return [self deleteItem:item error:error]; | |
| 325 | -} | |
| 326 | - | |
| 327 | -+ (BOOL)deletePasswordForService:(NSString *)serviceName account:(NSString *)account { | |
| 328 | - return [self deletePasswordForService:serviceName account:account error:NULL]; | |
| 329 | -} | |
| 330 | - | |
| 331 | -+ (BOOL)setPassword:(NSString *)password | |
| 332 | - forService:(NSString *)serviceName | |
| 333 | - account:(NSString *)account | |
| 334 | - error:(NSError **)error { | |
| 335 | - if (!password || !serviceName || !account) { | |
| 336 | - if (error) *error = [YYKeychain errorWithCode:errSecParam]; | |
| 337 | - return NO; | |
| 338 | - } | |
| 339 | - YYKeychainItem *item = [YYKeychainItem new]; | |
| 340 | - item.service = serviceName; | |
| 341 | - item.account = account; | |
| 342 | - YYKeychainItem *result = [self selectOneItem:item error:NULL]; | |
| 343 | - if (result) { | |
| 344 | - result.password = password; | |
| 345 | - return [self updateItem:result error:error]; | |
| 346 | - } else { | |
| 347 | - item.password = password; | |
| 348 | - return [self insertItem:item error:error]; | |
| 349 | - } | |
| 350 | -} | |
| 351 | - | |
| 352 | -+ (BOOL)setPassword:(NSString *)password | |
| 353 | - forService:(NSString *)serviceName | |
| 354 | - account:(NSString *)account { | |
| 355 | - return [self setPassword:password forService:serviceName account:account error:NULL]; | |
| 356 | -} | |
| 357 | - | |
| 358 | -+ (BOOL)insertItem:(YYKeychainItem *)item error:(NSError **)error { | |
| 359 | - if (!item.service || !item.account || !item.passwordData) { | |
| 360 | - if (error) *error = [YYKeychain errorWithCode:errSecParam]; | |
| 361 | - return NO; | |
| 362 | - } | |
| 363 | - | |
| 364 | - NSMutableDictionary *query = [item dic]; | |
| 365 | - OSStatus status = status = SecItemAdd((__bridge CFDictionaryRef)query, NULL); | |
| 366 | - if (status != errSecSuccess) { | |
| 367 | - if (error) *error = [YYKeychain errorWithCode:status]; | |
| 368 | - return NO; | |
| 369 | - } | |
| 370 | - | |
| 371 | - return YES; | |
| 372 | -} | |
| 373 | - | |
| 374 | -+ (BOOL)insertItem:(YYKeychainItem *)item { | |
| 375 | - return [self insertItem:item error:NULL]; | |
| 376 | -} | |
| 377 | - | |
| 378 | -+ (BOOL)updateItem:(YYKeychainItem *)item error:(NSError **)error { | |
| 379 | - if (!item.service || !item.account || !item.passwordData) { | |
| 380 | - if (error) *error = [YYKeychain errorWithCode:errSecParam]; | |
| 381 | - return NO; | |
| 382 | - } | |
| 383 | - | |
| 384 | - NSMutableDictionary *query = [item queryDic]; | |
| 385 | - NSMutableDictionary *update = [item dic]; | |
| 386 | - [update removeObjectForKey:(__bridge id)kSecClass]; | |
| 387 | - if (!query || !update) return NO; | |
| 388 | - OSStatus status = status = SecItemUpdate((__bridge CFDictionaryRef)query, (__bridge CFDictionaryRef)update); | |
| 389 | - if (status != errSecSuccess) { | |
| 390 | - if (error) *error = [YYKeychain errorWithCode:status]; | |
| 391 | - return NO; | |
| 392 | - } | |
| 393 | - | |
| 394 | - return YES; | |
| 395 | -} | |
| 396 | - | |
| 397 | -+ (BOOL)updateItem:(YYKeychainItem *)item { | |
| 398 | - return [self updateItem:item error:NULL]; | |
| 399 | -} | |
| 400 | - | |
| 401 | -+ (BOOL)deleteItem:(YYKeychainItem *)item error:(NSError **)error { | |
| 402 | - if (!item.service || !item.account) { | |
| 403 | - if (error) *error = [YYKeychain errorWithCode:errSecParam]; | |
| 404 | - return NO; | |
| 405 | - } | |
| 406 | - | |
| 407 | - NSMutableDictionary *query = [item dic]; | |
| 408 | - OSStatus status = SecItemDelete((__bridge CFDictionaryRef)query); | |
| 409 | - if (status != errSecSuccess) { | |
| 410 | - if (error) *error = [YYKeychain errorWithCode:status]; | |
| 411 | - return NO; | |
| 412 | - } | |
| 413 | - | |
| 414 | - return YES; | |
| 415 | -} | |
| 416 | - | |
| 417 | -+ (BOOL)deleteItem:(YYKeychainItem *)item { | |
| 418 | - return [self deleteItem:item error:NULL]; | |
| 419 | -} | |
| 420 | - | |
| 421 | -+ (YYKeychainItem *)selectOneItem:(YYKeychainItem *)item error:(NSError **)error { | |
| 422 | - if (!item.service || !item.account) { | |
| 423 | - if (error) *error = [YYKeychain errorWithCode:errSecParam]; | |
| 424 | - return nil; | |
| 425 | - } | |
| 426 | - | |
| 427 | - NSMutableDictionary *query = [item dic]; | |
| 428 | - query[(__bridge id)kSecMatchLimit] = (__bridge id)kSecMatchLimitOne; | |
| 429 | - query[(__bridge id)kSecReturnAttributes] = @YES; | |
| 430 | - query[(__bridge id)kSecReturnData] = @YES; | |
| 431 | - | |
| 432 | - OSStatus status; | |
| 433 | - CFTypeRef result = NULL; | |
| 434 | - status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result); | |
| 435 | - if (status != errSecSuccess) { | |
| 436 | - if (error) *error = [[self class] errorWithCode:status]; | |
| 437 | - return nil; | |
| 438 | - } | |
| 439 | - if (!result) return nil; | |
| 440 | - | |
| 441 | - NSDictionary *dic = nil; | |
| 442 | - if (CFGetTypeID(result) == CFDictionaryGetTypeID()) { | |
| 443 | - dic = (__bridge NSDictionary *)(result); | |
| 444 | - } else if (CFGetTypeID(result) == CFArrayGetTypeID()){ | |
| 445 | - dic = [(__bridge NSArray *)(result) firstObject]; | |
| 446 | - if (![dic isKindOfClass:[NSDictionary class]]) dic = nil; | |
| 447 | - } | |
| 448 | - if (!dic.count) return nil; | |
| 449 | - return [[YYKeychainItem alloc] initWithDic:dic]; | |
| 450 | -} | |
| 451 | - | |
| 452 | -+ (YYKeychainItem *)selectOneItem:(YYKeychainItem *)item { | |
| 453 | - return [self selectOneItem:item error:NULL]; | |
| 454 | -} | |
| 455 | - | |
| 456 | -+ (NSArray *)selectItems:(YYKeychainItem *)item error:(NSError **)error { | |
| 457 | - NSMutableDictionary *query = [item dic]; | |
| 458 | - query[(__bridge id)kSecMatchLimit] = (__bridge id)kSecMatchLimitAll; | |
| 459 | - query[(__bridge id)kSecReturnAttributes] = @YES; | |
| 460 | - query[(__bridge id)kSecReturnData] = @YES; | |
| 461 | - | |
| 462 | - OSStatus status; | |
| 463 | - CFTypeRef result = NULL; | |
| 464 | - status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result); | |
| 465 | - if (status != errSecSuccess && error != NULL) { | |
| 466 | - *error = [[self class] errorWithCode:status]; | |
| 467 | - return nil; | |
| 468 | - } | |
| 469 | - | |
| 470 | - NSMutableArray *res = [NSMutableArray new]; | |
| 471 | - NSDictionary *dic = nil; | |
| 472 | - if (CFGetTypeID(result) == CFDictionaryGetTypeID()) { | |
| 473 | - dic = (__bridge NSDictionary *)(result); | |
| 474 | - YYKeychainItem *item = [[YYKeychainItem alloc] initWithDic:dic]; | |
| 475 | - if (item) [res addObject:item]; | |
| 476 | - } else if (CFGetTypeID(result) == CFArrayGetTypeID()){ | |
| 477 | - for (NSDictionary *dic in (__bridge NSArray *)(result)) { | |
| 478 | - YYKeychainItem *item = [[YYKeychainItem alloc] initWithDic:dic]; | |
| 479 | - if (item) [res addObject:item]; | |
| 480 | - } | |
| 481 | - } | |
| 482 | - | |
| 483 | - return res; | |
| 484 | -} | |
| 485 | - | |
| 486 | -+ (NSArray *)selectItems:(YYKeychainItem *)item { | |
| 487 | - return [self selectItems:item error:NULL]; | |
| 488 | -} | |
| 489 | - | |
| 490 | -+ (NSError *)errorWithCode:(OSStatus)osCode { | |
| 491 | - YYKeychainErrorCode code = YYKeychainErrorCodeFromOSStatus(osCode); | |
| 492 | - NSString *desc = YYKeychainErrorDesc(code); | |
| 493 | - NSDictionary *userInfo = desc ? @{ NSLocalizedDescriptionKey : desc } : nil; | |
| 494 | - return [NSError errorWithDomain:@"com.ibireme.yykit.keychain" code:code userInfo:userInfo]; | |
| 495 | -} | |
| 496 | - | |
| 497 | -@end |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteAnnouListViewController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteAnnouListViewController.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/30. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | |
| 9 | +#import "CNLiveCMineInteModel.h" | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveCMineInteAnnouListViewController : CNCommonListViewController | |
| 13 | + | |
| 14 | +/// 初始化公告栏界面 | |
| 15 | +/// @param annouModel 数据源 | |
| 16 | +- (instancetype)initWithAnnouModel:(CNLiveCMineInteListModel *)annouModel; | |
| 17 | + | |
| 18 | +@end | |
| 19 | + | |
| 20 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteAnnouListViewController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteAnnouListViewController.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/30. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteAnnouListViewController.h" | |
| 9 | +#import "CNLiveCMineInteCollectionViewCell.h" | |
| 10 | +@interface CNLiveCMineInteAnnouListViewController () | |
| 11 | +@property (nonatomic, strong) CNLiveNavigationBar * navigationBar;//导航栏 | |
| 12 | +@property (nonatomic, strong) CNLiveCMineInteListModel * annouModel; | |
| 13 | +@end | |
| 14 | + | |
| 15 | +@implementation CNLiveCMineInteAnnouListViewController | |
| 16 | + | |
| 17 | +-(void)viewWillAppear:(BOOL)animated | |
| 18 | +{ | |
| 19 | + [super viewWillAppear:animated]; | |
| 20 | + self.navigationController.navigationBarHidden = YES; | |
| 21 | +} | |
| 22 | +-(void)viewWillDisappear:(BOOL)animated | |
| 23 | +{ | |
| 24 | + [super viewWillDisappear:animated]; | |
| 25 | + self.navigationController.navigationBarHidden = NO; | |
| 26 | +} | |
| 27 | + | |
| 28 | +- (instancetype)initWithAnnouModel:(CNLiveCMineInteListModel *)annouModel | |
| 29 | +{ | |
| 30 | + self = [super init]; | |
| 31 | + if (self) { | |
| 32 | + _annouModel = annouModel; | |
| 33 | + } | |
| 34 | + return self; | |
| 35 | +} | |
| 36 | +- (void)viewDidLoad { | |
| 37 | + [super viewDidLoad]; | |
| 38 | + // Do any additional setup after loading the view. | |
| 39 | + self.view.backgroundColor = UIColorHex(0xf9f9f9); | |
| 40 | + [self.view addSubview:self.navigationBar]; | |
| 41 | +} | |
| 42 | +- (void)initTableView | |
| 43 | +{ | |
| 44 | + [super initTableView]; | |
| 45 | + self.tableView.dataSource = self; | |
| 46 | + self.tableView.delegate = self; | |
| 47 | + self.tableView.backgroundColor = UIColorHex(0xf9f9f9); | |
| 48 | + self.tableView.contentInset = UIEdgeInsetsMake(10, 0, 5, 0); | |
| 49 | + self.tableView.showsVerticalScrollIndicator = NO; | |
| 50 | + self.tableView.showsHorizontalScrollIndicator = NO; | |
| 51 | + self.tableView.tableFooterView = [[UIView alloc] init]; | |
| 52 | + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| 53 | +} | |
| 54 | +-(void)layoutTableView | |
| 55 | +{ | |
| 56 | + [super layoutTableView]; | |
| 57 | + self.tableView.frame = CGRectMake(0, kNavigationBarHeight, SCREEN_WIDTH, kScreenHeight - kNavigationBarHeight); | |
| 58 | +} | |
| 59 | +#pragma mark = | |
| 60 | + | |
| 61 | +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | |
| 62 | +{ | |
| 63 | + return 1; | |
| 64 | +} | |
| 65 | + | |
| 66 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
| 67 | +{ | |
| 68 | + return self.annouModel.list.count; | |
| 69 | +} | |
| 70 | + | |
| 71 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
| 72 | +{ | |
| 73 | + CNLiveCMineAnnouTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCMineAnnouTableViewCell"]; | |
| 74 | + if (!cell) { | |
| 75 | + cell = [[CNLiveCMineAnnouTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCMineAnnouTableViewCell"]; | |
| 76 | + } | |
| 77 | + CNLiveCMineInteListSubModel * annouModel = self.annouModel.list[indexPath.row]; | |
| 78 | + cell.annouModel = annouModel; | |
| 79 | + return cell; | |
| 80 | +} | |
| 81 | + | |
| 82 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | |
| 83 | +{ | |
| 84 | + return 70.0; | |
| 85 | +} | |
| 86 | + | |
| 87 | +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | |
| 88 | +{ | |
| 89 | + CNLiveCMineInteListSubModel * annouModel = self.annouModel.list[indexPath.row]; | |
| 90 | + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:annouModel.shareUrl statue:CNLiveCMineIntePushWebViewStatueAnnotationDetail]; | |
| 91 | +} | |
| 92 | +#pragma mark = getter | |
| 93 | +- (CNLiveNavigationBar *)navigationBar { | |
| 94 | + if (!_navigationBar) { | |
| 95 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 96 | + _navigationBar.leftImage = [CNLiveCMineService imageWithMineName:@"c_mine_skip_push_back"]; | |
| 97 | + __weak typeof(self) weakSelf = self; | |
| 98 | + _navigationBar.lineHidden = YES; | |
| 99 | + _navigationBar.backgroundColor = [UIColor whiteColor]; | |
| 100 | + _navigationBar.onClickLeftButton = ^{ | |
| 101 | + [weakSelf.navigationController popViewControllerAnimated:YES]; | |
| 102 | + }; | |
| 103 | + _navigationBar.title.text = @"公告栏"; | |
| 104 | + _navigationBar.title.textColor = UIColorHex(#3A3A3A); | |
| 105 | + _navigationBar.right.hidden = YES; | |
| 106 | + } | |
| 107 | + return _navigationBar; | |
| 108 | +} | |
| 109 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteDetaiListlViewController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteDetaiListlViewController.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/29. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | |
| 9 | +#import "CNLiveCMineInteDetailViewController.h" | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | +@interface CNLiveCMineInteDetaiListlViewController : CNCommonListViewController<JXPagerViewListViewDelegate> | |
| 14 | + | |
| 15 | +/// 初始化列表界面 | |
| 16 | +/// @param detailVC 列表控制器 | |
| 17 | +/// @param currentType 1-全部 2-获取 3-支出 | |
| 18 | +/// @param currentInte 当前积分 | |
| 19 | +/// @param currentMonth 当前时间 | |
| 20 | +- (instancetype)initWithDetailVC:(CNLiveCMineInteDetailViewController *)detailVC | |
| 21 | + currentType:(NSInteger)currentType | |
| 22 | + currentInte:(NSString *)currentInte | |
| 23 | + currentMonth:(NSString *)currentMonth; | |
| 24 | + | |
| 25 | +/// 请求获取参数 | |
| 26 | +/// @param pageNo 页数 | |
| 27 | +/// @param currentMonth 当前月份 | |
| 28 | +/// @param currentType 当前状态 | |
| 29 | +-(void)requestDataSourceWithPageNo:(NSInteger)pageNo CurrentMonth:(NSString *)currentMonth CurrentType:(NSInteger)currentType; | |
| 30 | + | |
| 31 | +@property (nonatomic, copy) NSString * currentInte;//总积分 | |
| 32 | +@property (nonatomic, copy) NSString * currentMonth; /// 当前选择时间 | |
| 33 | +@property (nonatomic, assign) NSInteger currentType; /// 当前页面类型 | |
| 34 | + | |
| 35 | +/// 滚动回调 | |
| 36 | +@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView); | |
| 37 | + | |
| 38 | +@end | |
| 39 | + | |
| 40 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteDetaiListlViewController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteDetaiListlViewController.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/29. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteDetaiListlViewController.h" | |
| 9 | +#import "CNLiveCMineInteCollectionViewCell.h" | |
| 10 | +@interface CNLiveCMineInteDetaiListlViewController ()<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate> | |
| 11 | +@property (nonatomic, weak) CNLiveCMineInteDetailViewController * detailVC; | |
| 12 | +@property (nonatomic, strong) CNLiveCMineInteDetailModel * listModel;//数据源 | |
| 13 | +@property (nonatomic, strong) CNLiveRefreshFooter * footerView;//加载 | |
| 14 | +@property (nonatomic, assign) NSInteger pageNo; | |
| 15 | +@end | |
| 16 | + | |
| 17 | +@implementation CNLiveCMineInteDetaiListlViewController | |
| 18 | + | |
| 19 | +- (instancetype)initWithDetailVC:(CNLiveCMineInteDetailViewController *)detailVC | |
| 20 | + currentType:(NSInteger)currentType | |
| 21 | + currentInte:(NSString *)currentInte | |
| 22 | + currentMonth:(NSString *)currentMonth | |
| 23 | +{ | |
| 24 | + self = [super init]; | |
| 25 | + if (self) { | |
| 26 | + _currentMonth = currentMonth; | |
| 27 | + _currentInte = currentInte; | |
| 28 | + _currentType = currentType; | |
| 29 | + _detailVC = detailVC; | |
| 30 | + _pageNo = 1; | |
| 31 | + } | |
| 32 | + return self; | |
| 33 | +} | |
| 34 | + | |
| 35 | +- (void)viewDidLoad { | |
| 36 | + [super viewDidLoad]; | |
| 37 | + // Do any additional setup after loading the view. | |
| 38 | + self.view.backgroundColor = kWhiteColor; | |
| 39 | + | |
| 40 | + [self addMainRefreshView]; | |
| 41 | + | |
| 42 | + [self requestDataSourceWithPageNo:1 CurrentMonth:self.currentMonth CurrentType:self.currentType]; | |
| 43 | +} | |
| 44 | + | |
| 45 | +-(void)requestDataSourceWithPageNo:(NSInteger)pageNo CurrentMonth:(NSString *)currentMonth CurrentType:(NSInteger)currentType | |
| 46 | +{ | |
| 47 | + __weak typeof(self) weakSelf = self; | |
| 48 | + self.pageNo = pageNo; | |
| 49 | + self.currentType = currentType; | |
| 50 | + self.currentMonth = currentMonth; | |
| 51 | + [CNLiveCMineInteViewModel requestWithIntegraDetailWithCurrentMonth:currentMonth currentType:currentType pageNo:pageNo CompleterBlock:^(CNLiveCMineInteDetailModel * _Nonnull listModel) { | |
| 52 | + listModel.currentInte = weakSelf.currentInte; | |
| 53 | + weakSelf.listModel = listModel; | |
| 54 | + weakSelf.detailVC.headerView.detailModel = listModel; | |
| 55 | + [weakSelf.tableView reloadData]; | |
| 56 | + [weakSelf.tableView.mj_footer endRefreshing]; | |
| 57 | + [weakSelf.detailVC.pagingView.mainTableView.mj_header endRefreshing]; | |
| 58 | + if (!listModel.hasNext) [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData]; | |
| 59 | + weakSelf.tableView.mj_footer = listModel.integralList.count == 0 ? nil : weakSelf.footerView; | |
| 60 | + }]; | |
| 61 | +} | |
| 62 | + | |
| 63 | +-(void)addMainRefreshView | |
| 64 | +{ | |
| 65 | + __weak typeof(self) weakSelf = self; | |
| 66 | + if (!self.tableView.mj_footer) { | |
| 67 | + self.footerView = [CNLiveRefreshFooter footerWithRefreshingBlock:^{ | |
| 68 | + weakSelf.pageNo ++; | |
| 69 | + [weakSelf requestDataSourceWithPageNo:weakSelf.pageNo CurrentMonth:weakSelf.currentMonth CurrentType:weakSelf.currentType]; | |
| 70 | + }]; | |
| 71 | + self.tableView.mj_footer = self.footerView; | |
| 72 | + } | |
| 73 | + | |
| 74 | + if (self.detailVC.pagingView.mainTableView.mj_header) return; | |
| 75 | + CNLiveRefreshHeader * headerRefresh = [CNLiveRefreshHeader headerWithRefreshingBlock:^{ | |
| 76 | + weakSelf.pageNo = 1; | |
| 77 | + [weakSelf requestDataSourceWithPageNo:weakSelf.pageNo CurrentMonth:weakSelf.currentMonth CurrentType:weakSelf.currentType]; | |
| 78 | + }]; | |
| 79 | + headerRefresh.isShowWhite = YES; | |
| 80 | + self.detailVC.pagingView.mainTableView.mj_header = headerRefresh; | |
| 81 | +} | |
| 82 | +- (void)initTableView | |
| 83 | +{ | |
| 84 | + [super initTableView]; | |
| 85 | + self.tableView.dataSource = self; | |
| 86 | + self.tableView.delegate = self; | |
| 87 | + self.tableView.emptyDataSetSource = self; | |
| 88 | + self.tableView.emptyDataSetDelegate = self; | |
| 89 | + self.tableView.showsVerticalScrollIndicator = NO; | |
| 90 | + self.tableView.showsHorizontalScrollIndicator = NO; | |
| 91 | + self.tableView.tableFooterView = [[UIView alloc] init]; | |
| 92 | + self.tableView.separatorInset = UIEdgeInsetsMake(0, 10, 0, 10); | |
| 93 | +} | |
| 94 | +-(void)layoutTableView | |
| 95 | +{ | |
| 96 | + [super layoutTableView]; | |
| 97 | + self.tableView.height = kScreenHeight - kNavigationBarHeight - 44; | |
| 98 | +} | |
| 99 | +#pragma mark - DZNEmptyDataSetSource Methods | |
| 100 | +- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView | |
| 101 | +{ | |
| 102 | + return [[NSAttributedString alloc] initWithString:@"现在没有相关内容哦" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]}]; | |
| 103 | +} | |
| 104 | +-(UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView | |
| 105 | +{ | |
| 106 | + return [CNLiveCMineService imageWithMineName:@"c_mine_content_empty"]; | |
| 107 | +} | |
| 108 | +- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView | |
| 109 | +{ | |
| 110 | + return [UIColor whiteColor]; | |
| 111 | +} | |
| 112 | + | |
| 113 | +- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView | |
| 114 | +{ | |
| 115 | + return 0; | |
| 116 | +} | |
| 117 | + | |
| 118 | +- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView | |
| 119 | +{ | |
| 120 | + return YES; | |
| 121 | +} | |
| 122 | + | |
| 123 | +- (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView | |
| 124 | +{ | |
| 125 | + return NO; | |
| 126 | +} | |
| 127 | + | |
| 128 | +- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView | |
| 129 | +{ | |
| 130 | + return YES; | |
| 131 | +} | |
| 132 | + | |
| 133 | +#pragma mark = | |
| 134 | + | |
| 135 | +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | |
| 136 | +{ | |
| 137 | + return 1; | |
| 138 | +} | |
| 139 | + | |
| 140 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
| 141 | +{ | |
| 142 | + return self.listModel.integralList.count; | |
| 143 | +} | |
| 144 | + | |
| 145 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
| 146 | +{ | |
| 147 | + CNLiveCMineDetailTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; | |
| 148 | + if (!cell) { | |
| 149 | + cell = [[CNLiveCMineDetailTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; | |
| 150 | + } | |
| 151 | + cell.listModel = self.listModel.integralList[indexPath.row]; | |
| 152 | + return cell; | |
| 153 | +} | |
| 154 | + | |
| 155 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | |
| 156 | +{ | |
| 157 | + return 70.0; | |
| 158 | +} | |
| 159 | + | |
| 160 | +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | |
| 161 | +{ | |
| 162 | + CNLiveCMineInteDetailListModel * listModel = self.listModel.integralList[indexPath.row]; | |
| 163 | + if ([listModel.state isEqualToString:@"1"]) { | |
| 164 | + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:cn_API_Managemall(@"/html/select_good/1/#/pointsExchangeRecords?type=3") statue:CNLiveCMineIntePushWebViewStatueTask]; | |
| 165 | + } | |
| 166 | +} | |
| 167 | + | |
| 168 | +- (void)scrollViewDidScroll:(UIScrollView *)scrollView { | |
| 169 | + if (self.scrollCallback) self.scrollCallback(scrollView); | |
| 170 | +} | |
| 171 | + | |
| 172 | +#pragma mark = | |
| 173 | + | |
| 174 | +- (UIScrollView *)listScrollView { | |
| 175 | + return self.tableView; | |
| 176 | +} | |
| 177 | + | |
| 178 | +- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback { | |
| 179 | + self.scrollCallback = callback; | |
| 180 | +} | |
| 181 | + | |
| 182 | +- (UIView *)listView { | |
| 183 | + return self.view; | |
| 184 | +} | |
| 185 | + | |
| 186 | + | |
| 187 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteDetailViewController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteDetailViewController.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/29. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | |
| 9 | +#import "CNLiveCMineInteDetailHeaderView.h" | |
| 10 | +#import "CNLiveCMineInteModel.h" | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | +@interface CNLiveCMineInteDetailViewController : CNCommonViewController<PGDatePickerDelegate> | |
| 14 | + | |
| 15 | +@property (nonatomic, strong) CNLiveCMineInteDetailHeaderView * headerView;//头视图 | |
| 16 | +@property (nonatomic, strong) JXPagerView *pagingView; | |
| 17 | + | |
| 18 | +/// 初始化积分明细界面 | |
| 19 | +/// @param inte 积分 | |
| 20 | +- (instancetype)initWithInte:(NSString *)inte; | |
| 21 | + | |
| 22 | +@end | |
| 23 | + | |
| 24 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteDetailViewController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteDetailViewController.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/29. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteDetailViewController.h" | |
| 9 | +#import "CNLiveCMineInteDetaiListlViewController.h" | |
| 10 | +#import "CNLiveCMineInteHeaderCustomView.h" | |
| 11 | +static NSInteger const kCNLiveSectionTitleHeight = 44;//标题显示 | |
| 12 | +static NSInteger const kCNLiveSectionHeaderHeight = 120;//头视图高度 | |
| 13 | + | |
| 14 | +@interface CNLiveCMineInteDetailViewController ()<JXCategoryViewDelegate,JXPagerViewDelegate> | |
| 15 | +@property (nonatomic, strong) NSMutableArray<CNLiveCMineInteDetaiListlViewController *> *viewControllers; | |
| 16 | +@property (nonatomic, strong) CNLiveNavigationBar * navigationBar;//导航栏 | |
| 17 | +@property (nonatomic, strong) JXCategoryTitleView *categoryView; | |
| 18 | +@property (nonatomic, strong) UIImageView * backView; | |
| 19 | + | |
| 20 | +@property (nonatomic, assign) CGFloat header_height;//高度 | |
| 21 | +@property (nonatomic, assign) NSInteger currentType;//1-全部 2-获取 3-支出 | |
| 22 | +@property (nonatomic, copy) NSString * inte;//总积分 | |
| 23 | +@property (nonatomic, copy) NSString * currentMonth;//时间 | |
| 24 | +@end | |
| 25 | + | |
| 26 | +@implementation CNLiveCMineInteDetailViewController | |
| 27 | + | |
| 28 | +-(void)viewWillAppear:(BOOL)animated | |
| 29 | +{ | |
| 30 | + [super viewWillAppear:animated]; | |
| 31 | + self.navigationController.navigationBarHidden = YES; | |
| 32 | +} | |
| 33 | +-(void)viewWillDisappear:(BOOL)animated | |
| 34 | +{ | |
| 35 | + [super viewWillDisappear:animated]; | |
| 36 | + self.navigationController.navigationBarHidden = NO; | |
| 37 | +} | |
| 38 | + | |
| 39 | +- (instancetype)initWithInte:(NSString *)inte | |
| 40 | +{ | |
| 41 | + self = [super init]; | |
| 42 | + if (self) { | |
| 43 | + _inte = inte; | |
| 44 | + } | |
| 45 | + return self; | |
| 46 | +} | |
| 47 | + | |
| 48 | +- (void)viewDidLoad { | |
| 49 | + [super viewDidLoad]; | |
| 50 | + // Do any additional setup after loading the view. | |
| 51 | + self.header_height = kCNLiveSectionHeaderHeight + kNavigationBarHeight + (kCNLiveSectionTitleHeight/2); | |
| 52 | + self.view.backgroundColor = UIColorHex(0xffffff); | |
| 53 | + | |
| 54 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
| 55 | + [dateFormatter setDateFormat:@"yyyy-MM"]; | |
| 56 | + self.currentMonth = [dateFormatter stringFromDate:[NSDate date]]; | |
| 57 | + | |
| 58 | + [self.view addSubview:self.backView]; | |
| 59 | + [self.view addSubview:self.pagingView]; | |
| 60 | + [self.view addSubview:self.navigationBar]; | |
| 61 | +} | |
| 62 | + | |
| 63 | +#pragma mark - JXPagingViewDelegate | |
| 64 | + | |
| 65 | +- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView { | |
| 66 | + __weak typeof(self) weakSelf = self; | |
| 67 | + self.headerView = [[CNLiveCMineInteDetailHeaderView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kCNLiveSectionHeaderHeight)]; | |
| 68 | + self.headerView.backgroundColor = [UIColor clearColor]; | |
| 69 | + self.headerView.selectWithDateBlock = ^{ | |
| 70 | + [CNLiveCMineInteHeaderCustomView showWithSelectMonthDateForCurrentVC:weakSelf]; | |
| 71 | + }; | |
| 72 | + return self.headerView; | |
| 73 | +} | |
| 74 | + | |
| 75 | +- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView { | |
| 76 | + return kCNLiveSectionHeaderHeight; | |
| 77 | +} | |
| 78 | + | |
| 79 | +- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { | |
| 80 | + return kCNLiveSectionTitleHeight; | |
| 81 | +} | |
| 82 | + | |
| 83 | +- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { | |
| 84 | + return self.categoryView; | |
| 85 | +} | |
| 86 | + | |
| 87 | +- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView { | |
| 88 | + return 3; | |
| 89 | +} | |
| 90 | + | |
| 91 | +- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index { | |
| 92 | + return self.viewControllers[index]; | |
| 93 | +} | |
| 94 | + | |
| 95 | +- (void)pagerView:(JXPagerView *)pagerView mainTableViewDidScroll:(UIScrollView *)scrollView { | |
| 96 | + | |
| 97 | + CGFloat offsetY = scrollView.contentOffset.y; | |
| 98 | + self.backView.height = offsetY < 0 ? self.header_height + fabs(offsetY) : self.header_height - fabs(offsetY); | |
| 99 | +} | |
| 100 | + | |
| 101 | +-(UIStatusBarStyle)preferredStatusBarStyle | |
| 102 | +{ | |
| 103 | + return UIStatusBarStyleLightContent; | |
| 104 | +} | |
| 105 | +#pragma mark - PGDatePickerDelegate !!!!!!!!!!!!!!!!!!!!!!! | |
| 106 | +- (void)datePicker:(PGDatePicker *)datePicker didSelectDate:(NSDateComponents *)dateComponents { | |
| 107 | + | |
| 108 | + dateComponents.day = 1; | |
| 109 | + NSCalendar * calendar = [NSCalendar currentCalendar]; | |
| 110 | + NSDate * date = [calendar dateFromComponents:dateComponents]; | |
| 111 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
| 112 | + [dateFormatter setLocale:[NSLocale currentLocale]]; | |
| 113 | + [dateFormatter setDateFormat:@"yyyy-MM"]; | |
| 114 | + self.currentMonth = [dateFormatter stringFromDate:date]; | |
| 115 | + | |
| 116 | + CNLiveCMineInteDetaiListlViewController * listView01 = self.viewControllers[0]; | |
| 117 | + [listView01 requestDataSourceWithPageNo:1 CurrentMonth:self.currentMonth CurrentType:1]; | |
| 118 | + CNLiveCMineInteDetaiListlViewController * listView02 = self.viewControllers[1]; | |
| 119 | + [listView02 requestDataSourceWithPageNo:1 CurrentMonth:self.currentMonth CurrentType:2]; | |
| 120 | + CNLiveCMineInteDetaiListlViewController * listView03 = self.viewControllers[2]; | |
| 121 | + [listView03 requestDataSourceWithPageNo:1 CurrentMonth:self.currentMonth CurrentType:3]; | |
| 122 | +} | |
| 123 | +#pragma mark = | |
| 124 | +-(NSMutableArray<CNLiveCMineInteDetaiListlViewController *> *)viewControllers | |
| 125 | +{ | |
| 126 | + if (!_viewControllers) { | |
| 127 | + _viewControllers = [[NSMutableArray alloc] initWithArray:@[ | |
| 128 | + [[CNLiveCMineInteDetaiListlViewController alloc] initWithDetailVC:self currentType:1 currentInte:self.inte currentMonth:self.currentMonth], | |
| 129 | + [[CNLiveCMineInteDetaiListlViewController alloc] initWithDetailVC:self currentType:2 currentInte:self.inte currentMonth:self.currentMonth], | |
| 130 | + [[CNLiveCMineInteDetaiListlViewController alloc] initWithDetailVC:self currentType:3 currentInte:self.inte currentMonth:self.currentMonth] | |
| 131 | + ]]; | |
| 132 | + } | |
| 133 | + return _viewControllers; | |
| 134 | +} | |
| 135 | + | |
| 136 | +#pragma mark = getter | |
| 137 | +-(JXPagerView *)pagingView | |
| 138 | +{ | |
| 139 | + if (_pagingView == nil) { | |
| 140 | + _pagingView = [[JXPagerView alloc] initWithDelegate:self listContainerType:JXPagerListContainerType_CollectionView]; | |
| 141 | + _pagingView.frame = CGRectMake(0, kNavigationBarHeight, KScreenWidth, KScreenHeight); | |
| 142 | + _pagingView.backgroundColor = kClearColor; | |
| 143 | + _pagingView.mainTableView.backgroundColor = kClearColor; | |
| 144 | + _pagingView.pinSectionHeaderVerticalOffset = kCNLiveSectionTitleHeight; | |
| 145 | + _pagingView.automaticallyDisplayListVerticalScrollIndicator = NO; | |
| 146 | + _pagingView.listContainerView.categoryNestPagingEnabled = YES; | |
| 147 | + self.categoryView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView; | |
| 148 | + } | |
| 149 | + return _pagingView; | |
| 150 | +} | |
| 151 | +- (JXCategoryTitleView *)categoryView { | |
| 152 | + if (_categoryView == nil) { | |
| 153 | + _categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kCNLiveSectionTitleHeight)]; | |
| 154 | + _categoryView.titles = @[@"全部",@"获取",@"支出"]; | |
| 155 | + _categoryView.titleFont = [UIFont systemFontOfSize:15.0f]; | |
| 156 | + _categoryView.titleSelectedFont = [UIFont systemFontOfSize:16.0f]; | |
| 157 | + _categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:16.0f]; | |
| 158 | + _categoryView.titleColor = UIColorHex(#999999); | |
| 159 | + _categoryView.titleSelectedColor = UIColorHex(#333333); | |
| 160 | + _categoryView.collectionView.backgroundColor = [UIColor clearColor]; | |
| 161 | + _categoryView.backgroundColor = [UIColor clearColor]; | |
| 162 | + _categoryView.delegate = self; | |
| 163 | + | |
| 164 | + JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; | |
| 165 | + lineView.indicatorColor = UIColorHex(#F85C4C); | |
| 166 | + lineView.verticalMargin = 5; | |
| 167 | + lineView.indicatorWidth = 10; | |
| 168 | + _categoryView.indicators = @[lineView]; | |
| 169 | + | |
| 170 | + UIView * radiusView = [[UIView alloc] initWithFrame:CGRectMake(15, 0, kScreenWidth - 30, kCNLiveSectionTitleHeight)]; | |
| 171 | + radiusView.backgroundColor = [UIColor whiteColor]; | |
| 172 | + radiusView.layer.shadowColor = [UIColor blackColor].CGColor; | |
| 173 | + radiusView.layer.shadowOffset = CGSizeMake(0, 0); | |
| 174 | + radiusView.layer.shadowOpacity = 0.3; | |
| 175 | + radiusView.layer.shadowRadius = 8; | |
| 176 | + radiusView.layer.cornerRadius = 10; | |
| 177 | + [_categoryView insertSubview:radiusView belowSubview:_categoryView.collectionView]; | |
| 178 | + | |
| 179 | + } | |
| 180 | + return _categoryView; | |
| 181 | +} | |
| 182 | + | |
| 183 | +- (CNLiveNavigationBar *)navigationBar { | |
| 184 | + if (!_navigationBar) { | |
| 185 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 186 | + _navigationBar.leftImage = [CNLiveCMineService imageWithMineName:@"c_mine_skip_push_white_back"]; | |
| 187 | + __weak typeof(self) weakSelf = self; | |
| 188 | + _navigationBar.lineHidden = YES; | |
| 189 | + _navigationBar.backgroundColor = [UIColor clearColor]; | |
| 190 | + _navigationBar.onClickLeftButton = ^{ | |
| 191 | + [weakSelf.navigationController popViewControllerAnimated:YES]; | |
| 192 | + }; | |
| 193 | + _navigationBar.title.text = @"积分明细"; | |
| 194 | + _navigationBar.title.textColor = [UIColor whiteColor]; | |
| 195 | + _navigationBar.right.hidden = YES; | |
| 196 | + } | |
| 197 | + return _navigationBar; | |
| 198 | +} | |
| 199 | +-(UIImageView *)backView | |
| 200 | +{ | |
| 201 | + if (!_backView) { | |
| 202 | + _backView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kCNLiveSectionHeaderHeight + kNavigationBarHeight + (kCNLiveSectionTitleHeight/2))]; | |
| 203 | + _backView.contentMode = UIViewContentModeScaleToFill; | |
| 204 | + _backView.clipsToBounds = YES; | |
| 205 | + _backView.backgroundColor = [UIColor whiteColor]; | |
| 206 | + _backView.image = [CNLiveCMineService imageWithMineName:@"c_mine_detail_header_groud"]; | |
| 207 | + } | |
| 208 | + return _backView; | |
| 209 | +} | |
| 210 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteTaskListViewController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteTaskListViewController.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/30. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveCMineInteTaskListViewController : CNCommonListViewController<JXPagerViewListViewDelegate> | |
| 13 | + | |
| 14 | +/// 初始化任务列表 | |
| 15 | +/// @param taskArray 数据源 | |
| 16 | +- (instancetype)initWithTaskArray:(NSArray *)taskArray; | |
| 17 | + | |
| 18 | +/// 滚动回调 | |
| 19 | +@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView); | |
| 20 | + | |
| 21 | +@end | |
| 22 | + | |
| 23 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteTaskListViewController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteTaskListViewController.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/30. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteTaskListViewController.h" | |
| 9 | +#import "CNLiveCMineInteCollectionViewCell.h" | |
| 10 | +@interface CNLiveCMineInteTaskListViewController () | |
| 11 | + | |
| 12 | +@property (nonatomic, strong) NSArray * taskArray;//数据源 | |
| 13 | + | |
| 14 | +@end | |
| 15 | + | |
| 16 | +@implementation CNLiveCMineInteTaskListViewController | |
| 17 | + | |
| 18 | +/// 初始化任务列表 | |
| 19 | +/// @param taskArray 数据源 | |
| 20 | +- (instancetype)initWithTaskArray:(NSArray *)taskArray; | |
| 21 | +{ | |
| 22 | + self = [super init]; | |
| 23 | + if (self) { | |
| 24 | + _taskArray = taskArray; | |
| 25 | + } | |
| 26 | + return self; | |
| 27 | +} | |
| 28 | +- (void)viewDidLoad { | |
| 29 | + [super viewDidLoad]; | |
| 30 | + // Do any additional setup after loading the view. | |
| 31 | + self.view.backgroundColor = UIColorHex(0xf9f9f9); | |
| 32 | +} | |
| 33 | +- (void)initTableView | |
| 34 | +{ | |
| 35 | + [super initTableView]; | |
| 36 | + self.tableView.dataSource = self; | |
| 37 | + self.tableView.delegate = self; | |
| 38 | + self.tableView.backgroundColor = UIColorHex(0xf5f5f5); | |
| 39 | + self.tableView.showsVerticalScrollIndicator = NO; | |
| 40 | + self.tableView.showsHorizontalScrollIndicator = NO; | |
| 41 | + self.tableView.tableFooterView = [[UIView alloc] init]; | |
| 42 | + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| 43 | +} | |
| 44 | +-(void)layoutTableView | |
| 45 | +{ | |
| 46 | + [super layoutTableView]; | |
| 47 | + self.tableView.height = kScreenHeight - kNavigationBarHeight - 184; | |
| 48 | +} | |
| 49 | +#pragma mark = | |
| 50 | + | |
| 51 | +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | |
| 52 | +{ | |
| 53 | + return 1; | |
| 54 | +} | |
| 55 | + | |
| 56 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
| 57 | +{ | |
| 58 | + return self.taskArray.count; | |
| 59 | +} | |
| 60 | + | |
| 61 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
| 62 | +{ | |
| 63 | + CNLiveCMineTaskTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCMineInteTaskListViewController"]; | |
| 64 | + if (!cell) { | |
| 65 | + cell = [[CNLiveCMineTaskTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCMineInteTaskListViewController"]; | |
| 66 | + } | |
| 67 | + cell.taskModel = self.taskArray[indexPath.row]; | |
| 68 | + return cell; | |
| 69 | +} | |
| 70 | + | |
| 71 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | |
| 72 | +{ | |
| 73 | + return 70.0; | |
| 74 | +} | |
| 75 | + | |
| 76 | +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | |
| 77 | +{ | |
| 78 | + CNLiveCMineInteTaskListItemModel * taskModel = self.taskArray[indexPath.row]; | |
| 79 | + if(taskModel.times < taskModel.totalCount) { | |
| 80 | + NSLog(@"可以点击"); | |
| 81 | + } | |
| 82 | +} | |
| 83 | + | |
| 84 | +- (void)scrollViewDidScroll:(UIScrollView *)scrollView { | |
| 85 | + if (self.scrollCallback) self.scrollCallback(scrollView); | |
| 86 | +} | |
| 87 | +#pragma mark = | |
| 88 | + | |
| 89 | +- (UIScrollView *)listScrollView { | |
| 90 | + return self.tableView; | |
| 91 | +} | |
| 92 | + | |
| 93 | +- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback { | |
| 94 | + self.scrollCallback = callback; | |
| 95 | +} | |
| 96 | + | |
| 97 | +- (UIView *)listView { | |
| 98 | + return self.view; | |
| 99 | +} | |
| 100 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteTaskViewController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteTaskViewController.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/30. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | |
| 9 | +#import "CNLiveCMineInteModel.h" | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | +@interface CNLiveCMineInteTaskViewController : CNCommonViewController | |
| 14 | + | |
| 15 | +/// 初始化任务列表 | |
| 16 | +/// @param taskModel 数据源 | |
| 17 | +- (instancetype)initWithTaskModel:(CNLiveCMineInteTaskListModel *)taskModel; | |
| 18 | + | |
| 19 | +@end | |
| 20 | + | |
| 21 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteTaskViewController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteTaskViewController.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/30. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteTaskViewController.h" | |
| 9 | +#import "CNLiveCMineInteTaskListViewController.h" | |
| 10 | +static NSInteger const kCNLiveSectionTitleHeight = 44;//标题显示 | |
| 11 | +static NSInteger const kCNLiveSectionHeaderHeight = 140;//头视图高度 | |
| 12 | + | |
| 13 | +@interface CNLiveCMineInteTaskViewController ()<JXCategoryViewDelegate,JXPagerViewDelegate> | |
| 14 | +@property (nonatomic, strong) NSMutableArray<CNLiveCMineInteTaskListViewController *> *viewControllers; | |
| 15 | +@property (nonatomic, strong) CNLiveCMineInteTaskListModel * taskModel;//数据源 | |
| 16 | +@property (nonatomic, strong) CNLiveNavigationBar * navigationBar;//导航栏 | |
| 17 | +@property (nonatomic, strong) JXCategoryTitleView *categoryView; | |
| 18 | +@property (nonatomic, strong) JXPagerView *pagingView; | |
| 19 | +@property (nonatomic, strong) UIImageView * backView; | |
| 20 | + | |
| 21 | +@property (nonatomic, assign) CGFloat header_height;//高度 | |
| 22 | + | |
| 23 | +@end | |
| 24 | + | |
| 25 | +@implementation CNLiveCMineInteTaskViewController | |
| 26 | +-(void)viewWillAppear:(BOOL)animated | |
| 27 | +{ | |
| 28 | + [super viewWillAppear:animated]; | |
| 29 | + self.navigationController.navigationBarHidden = YES; | |
| 30 | +} | |
| 31 | +-(void)viewWillDisappear:(BOOL)animated | |
| 32 | +{ | |
| 33 | + [super viewWillDisappear:animated]; | |
| 34 | + self.navigationController.navigationBarHidden = NO; | |
| 35 | +} | |
| 36 | + | |
| 37 | +- (instancetype)initWithTaskModel:(CNLiveCMineInteTaskListModel *)taskModel | |
| 38 | +{ | |
| 39 | + self = [super init]; | |
| 40 | + if (self) { | |
| 41 | + _taskModel = taskModel; | |
| 42 | + } | |
| 43 | + return self; | |
| 44 | +} | |
| 45 | +- (void)viewDidLoad { | |
| 46 | + [super viewDidLoad]; | |
| 47 | + // Do any additional setup after loading the view. | |
| 48 | + self.header_height = kCNLiveSectionHeaderHeight + (kCNLiveSectionTitleHeight/2); | |
| 49 | + self.view.backgroundColor = UIColorHex(0xf9f9f9); | |
| 50 | + | |
| 51 | + [self.view addSubview:self.backView]; | |
| 52 | + [self.view addSubview:self.pagingView]; | |
| 53 | + [self.view addSubview:self.navigationBar]; | |
| 54 | +} | |
| 55 | +#pragma mark - JXPagingViewDelegate | |
| 56 | + | |
| 57 | +- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView { | |
| 58 | + UIView * headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kCNLiveSectionHeaderHeight)]; | |
| 59 | + headerView.backgroundColor = [UIColor clearColor]; | |
| 60 | + return headerView; | |
| 61 | +} | |
| 62 | + | |
| 63 | +- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView { | |
| 64 | + return kCNLiveSectionHeaderHeight; | |
| 65 | +} | |
| 66 | + | |
| 67 | +- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { | |
| 68 | + return kCNLiveSectionTitleHeight; | |
| 69 | +} | |
| 70 | + | |
| 71 | +- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { | |
| 72 | + return self.categoryView; | |
| 73 | +} | |
| 74 | + | |
| 75 | +- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView { | |
| 76 | + return 2; | |
| 77 | +} | |
| 78 | + | |
| 79 | +- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index { | |
| 80 | + return self.viewControllers[index]; | |
| 81 | +} | |
| 82 | + | |
| 83 | +- (void)pagerView:(JXPagerView *)pagerView mainTableViewDidScroll:(UIScrollView *)scrollView { | |
| 84 | + | |
| 85 | + CGFloat offsetY = scrollView.contentOffset.y; | |
| 86 | + self.backView.height = offsetY < 0 ? self.header_height + fabs(offsetY) : self.header_height; | |
| 87 | + self.backView.width = offsetY < 0 ? SCREEN_WIDTH + fabs(offsetY) : SCREEN_WIDTH; | |
| 88 | + self.backView.left = self.backView.width > SCREEN_WIDTH ? -(self.backView.width - SCREEN_WIDTH)/2 : 0; | |
| 89 | +} | |
| 90 | + | |
| 91 | +-(UIStatusBarStyle)preferredStatusBarStyle | |
| 92 | +{ | |
| 93 | + return UIStatusBarStyleDefault; | |
| 94 | +} | |
| 95 | +#pragma mark = | |
| 96 | +-(NSMutableArray<CNLiveCMineInteTaskListViewController *> *)viewControllers | |
| 97 | +{ | |
| 98 | + if (!_viewControllers) { | |
| 99 | + _viewControllers = [[NSMutableArray alloc] initWithArray:@[ | |
| 100 | + [[CNLiveCMineInteTaskListViewController alloc] initWithTaskArray:self.taskModel.dailyTask], | |
| 101 | + [[CNLiveCMineInteTaskListViewController alloc] initWithTaskArray:self.taskModel.firstTask] | |
| 102 | + ]]; | |
| 103 | + } | |
| 104 | + return _viewControllers; | |
| 105 | +} | |
| 106 | + | |
| 107 | +#pragma mark = getter | |
| 108 | +-(JXPagerView *)pagingView | |
| 109 | +{ | |
| 110 | + if (_pagingView == nil) { | |
| 111 | + _pagingView = [[JXPagerView alloc] initWithDelegate:self listContainerType:JXPagerListContainerType_CollectionView]; | |
| 112 | + _pagingView.frame = CGRectMake(0, kNavigationBarHeight, KScreenWidth, KScreenHeight); | |
| 113 | + _pagingView.backgroundColor = kClearColor; | |
| 114 | + _pagingView.mainTableView.backgroundColor = kClearColor; | |
| 115 | + _pagingView.pinSectionHeaderVerticalOffset = kCNLiveSectionHeaderHeight; | |
| 116 | + _pagingView.automaticallyDisplayListVerticalScrollIndicator = NO; | |
| 117 | + _pagingView.listContainerView.categoryNestPagingEnabled = YES; | |
| 118 | + self.categoryView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView; | |
| 119 | + } | |
| 120 | + return _pagingView; | |
| 121 | +} | |
| 122 | +- (JXCategoryTitleView *)categoryView { | |
| 123 | + if (_categoryView == nil) { | |
| 124 | + _categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kCNLiveSectionTitleHeight)]; | |
| 125 | + _categoryView.titles = @[@"每日任务",@"首次任务"]; | |
| 126 | + _categoryView.titleFont = [UIFont systemFontOfSize:15.0f]; | |
| 127 | + _categoryView.titleSelectedFont = [UIFont systemFontOfSize:16.0f]; | |
| 128 | + _categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:16.0f]; | |
| 129 | + _categoryView.titleColor = UIColorHex(#999999); | |
| 130 | + _categoryView.titleSelectedColor = UIColorHex(#333333); | |
| 131 | + _categoryView.collectionView.backgroundColor = [UIColor clearColor]; | |
| 132 | + _categoryView.backgroundColor = [UIColor clearColor]; | |
| 133 | + _categoryView.separatorLineShowEnabled = YES; | |
| 134 | + _categoryView.delegate = self; | |
| 135 | + | |
| 136 | + JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; | |
| 137 | + lineView.indicatorColor = UIColorHex(#0AC94A); | |
| 138 | + lineView.verticalMargin = 5; | |
| 139 | + lineView.indicatorWidth = 10; | |
| 140 | + _categoryView.indicators = @[lineView]; | |
| 141 | + | |
| 142 | + UIView * radiusView = [[UIView alloc] initWithFrame:CGRectMake(15, 0, kScreenWidth - 30, kCNLiveSectionTitleHeight)]; | |
| 143 | + radiusView.backgroundColor = [UIColor whiteColor]; | |
| 144 | + radiusView.layer.shadowColor = [UIColor blackColor].CGColor; | |
| 145 | + radiusView.layer.shadowOffset = CGSizeMake(0, 0); | |
| 146 | + radiusView.layer.shadowOpacity = 0.3; | |
| 147 | + radiusView.layer.shadowRadius = 8; | |
| 148 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 30, kCNLiveSectionTitleHeight) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)]; | |
| 149 | + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | |
| 150 | + maskLayer.path = maskPath.CGPath; | |
| 151 | + radiusView.layer.mask = maskLayer; | |
| 152 | + [_categoryView insertSubview:radiusView belowSubview:_categoryView.collectionView]; | |
| 153 | + | |
| 154 | + } | |
| 155 | + return _categoryView; | |
| 156 | +} | |
| 157 | + | |
| 158 | +- (CNLiveNavigationBar *)navigationBar { | |
| 159 | + if (!_navigationBar) { | |
| 160 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 161 | + _navigationBar.leftImage = [CNLiveCMineService imageWithMineName:@"c_mine_skip_push_back"]; | |
| 162 | + __weak typeof(self) weakSelf = self; | |
| 163 | + _navigationBar.lineHidden = YES; | |
| 164 | + _navigationBar.backgroundColor = [UIColor whiteColor]; | |
| 165 | + _navigationBar.onClickLeftButton = ^{ | |
| 166 | + [weakSelf.navigationController popViewControllerAnimated:YES]; | |
| 167 | + }; | |
| 168 | + _navigationBar.title.text = @"做任务 赚积分"; | |
| 169 | + _navigationBar.title.textColor = UIColorHex(#3A3A3A); | |
| 170 | + _navigationBar.right.hidden = YES; | |
| 171 | + } | |
| 172 | + return _navigationBar; | |
| 173 | +} | |
| 174 | +-(UIImageView *)backView | |
| 175 | +{ | |
| 176 | + if (!_backView) { | |
| 177 | + _backView = [[UIImageView alloc] initWithFrame:CGRectMake(0, kNavigationBarHeight, kScreenWidth, kCNLiveSectionHeaderHeight + (kCNLiveSectionTitleHeight/2))]; | |
| 178 | + _backView.contentMode = UIViewContentModeScaleToFill; | |
| 179 | + _backView.clipsToBounds = YES; | |
| 180 | + _backView.backgroundColor = UIColorHex(0xf9f9f9); | |
| 181 | + _backView.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_task_groud"]; | |
| 182 | + } | |
| 183 | + return _backView; | |
| 184 | +} | |
| 185 | + | |
| 186 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteViewController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteViewController.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/27. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveCMineInteViewController : CNCommonViewController | |
| 13 | + | |
| 14 | +@end | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteViewController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteViewController.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/27. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteViewController.h" | |
| 9 | +#import "CNLiveCMineInteCollectionViewCell.h" | |
| 10 | +#import "CNLiveCMineInteHeaderCustomView.h" | |
| 11 | +#import "CNLiveCMineInteHeaderView.h" | |
| 12 | +#import "CNLiveCMineInteViewModel.h" | |
| 13 | +#import "CNLiveCMineInteModel.h" | |
| 14 | +@interface CNLiveCMineInteViewController ()<UICollectionViewDelegate,UICollectionViewDataSource> | |
| 15 | +@property (nonatomic, strong) NSMutableArray * dataArray;//总数据源 | |
| 16 | +@property (nonatomic, strong) CNLiveCMineInteScoreModel * scoreModel; //签到数据 | |
| 17 | +@property (nonatomic, strong) CNLiveCMineInteTaskListModel * taskModel;//任务列表及积分数据 | |
| 18 | +@property (nonatomic, strong) CNLiveCMineInteListModel * announModel; //公告数据 | |
| 19 | +@property (nonatomic, strong) CNLiveCMineInteListModel * activModel; //活动数据 | |
| 20 | + | |
| 21 | +@property (nonatomic, strong) CNLiveNavigationBar * navigationBar;//导航栏 | |
| 22 | +@property (nonatomic, strong) UICollectionView * mainCollectionView;//主界面 | |
| 23 | +@property (nonatomic, strong) UIImageView * backView; | |
| 24 | +@end | |
| 25 | + | |
| 26 | +@implementation CNLiveCMineInteViewController | |
| 27 | + | |
| 28 | +-(void)viewWillAppear:(BOOL)animated | |
| 29 | +{ | |
| 30 | + [super viewWillAppear:animated]; | |
| 31 | + self.navigationController.navigationBarHidden = YES; | |
| 32 | +} | |
| 33 | +-(void)viewWillDisappear:(BOOL)animated | |
| 34 | +{ | |
| 35 | + [super viewWillDisappear:animated]; | |
| 36 | + self.navigationController.navigationBarHidden = NO; | |
| 37 | +} | |
| 38 | +-(void)reloadDataSource | |
| 39 | +{ | |
| 40 | + __weak typeof(self) weakSelf = self; | |
| 41 | + [QMUITips showLoadingInView:self.view]; | |
| 42 | + [CNLiveCMineInteViewModel requestWithIntegraTaskWithSignMedthodForCompleterBlock:^(NSMutableArray * _Nonnull dataArray, NSString * _Nonnull errorMessage) { | |
| 43 | + [QMUITips hideAllTipsInView:weakSelf.view]; | |
| 44 | + weakSelf.dataArray = dataArray; | |
| 45 | + weakSelf.scoreModel = ![dataArray[0] isKindOfClass:NSString.class]?dataArray[0]:nil; | |
| 46 | + weakSelf.taskModel = ![dataArray[1] isKindOfClass:NSString.class]?dataArray[1]:nil; | |
| 47 | + weakSelf.announModel = ![dataArray[2] isKindOfClass:NSString.class]?dataArray[2]:nil; | |
| 48 | + weakSelf.activModel = ![dataArray[3] isKindOfClass:NSString.class]?dataArray[3]:nil; | |
| 49 | + [weakSelf.mainCollectionView reloadData]; | |
| 50 | + }]; | |
| 51 | +} | |
| 52 | +- (void)viewDidLoad { | |
| 53 | + [super viewDidLoad]; | |
| 54 | + // Do any additional setup after loading the view. | |
| 55 | + self.view.backgroundColor = UIColorHex(0xffffff); | |
| 56 | + [self.view addSubview:self.navigationBar]; | |
| 57 | + [self.view addSubview:self.backView]; | |
| 58 | + [self.view addSubview:self.mainCollectionView]; | |
| 59 | + [self reloadDataSource]; | |
| 60 | +} | |
| 61 | +#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource | |
| 62 | +- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView | |
| 63 | +{ | |
| 64 | + return 1; | |
| 65 | +} | |
| 66 | +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section | |
| 67 | +{ | |
| 68 | + return self.activModel.list.count; | |
| 69 | +} | |
| 70 | +-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath | |
| 71 | +{ | |
| 72 | + CNLiveCMineInteCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([CNLiveCMineInteCollectionViewCell class]) forIndexPath:indexPath]; | |
| 73 | + CNLiveCMineInteListSubModel * taskModel = self.activModel.list[indexPath.row]; | |
| 74 | + cell.taskModel = taskModel; | |
| 75 | + return cell; | |
| 76 | +} | |
| 77 | +-(UIEdgeInsets)collectionView:(UICollectionView*)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section | |
| 78 | +{ | |
| 79 | + return UIEdgeInsetsMake(5, 5, 0, 5); | |
| 80 | +} | |
| 81 | +-(CGSize)collectionView:(UICollectionView*)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section | |
| 82 | +{ | |
| 83 | + return CGSizeMake(kScreenWidth, 270); | |
| 84 | +} | |
| 85 | +- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString*)kind atIndexPath:(NSIndexPath*)indexPath { | |
| 86 | + // 判断返回表头类型 还是表尾类型 | |
| 87 | + if([kind isEqualToString:UICollectionElementKindSectionHeader]) { | |
| 88 | + CNLiveCMineInteHeaderView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass(CNLiveCMineInteHeaderView.class) forIndexPath:indexPath]; | |
| 89 | + headerView.backgroundColor= [UIColor clearColor]; | |
| 90 | + [headerView setupWithScoreModel:self.scoreModel taskModel:self.taskModel announModel:self.announModel]; | |
| 91 | + __weak typeof(self) weakSelf = self; | |
| 92 | + [headerView setClickActionBlock:^(CNLiveCMineInteScoreModel * _Nonnull scoreModel, CNLiveCMineInteTaskListModel * _Nonnull taskModel, CNLiveCMineInteListModel * _Nonnull announModel, CNLiveCMineInteHeaderClick headerClick) { | |
| 93 | + if (headerClick == CNLiveCMineInteHeaderClickDetail) { | |
| 94 | + CNLiveCMineInteDetailViewController * inteView = [[CNLiveCMineInteDetailViewController alloc] initWithInte:taskModel.integral]; | |
| 95 | + [weakSelf.navigationController pushViewController:inteView animated:YES]; | |
| 96 | + } else if (headerClick == CNLiveCMineInteHeaderClickAnnotation) { | |
| 97 | + CNLiveCMineInteAnnouListViewController * annouView = [[CNLiveCMineInteAnnouListViewController alloc] initWithAnnouModel:announModel]; | |
| 98 | + [weakSelf.navigationController pushViewController:annouView animated:YES]; | |
| 99 | + } else { | |
| 100 | + NSString * url = cn_API_Managemall(@"/html/select_good/1/#/pointsMall"); | |
| 101 | + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:url statue:CNLiveCMineIntePushWebViewStatueRule]; | |
| 102 | + } | |
| 103 | + }]; | |
| 104 | + return headerView; | |
| 105 | + } | |
| 106 | + return nil; | |
| 107 | +} | |
| 108 | +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath | |
| 109 | +{ | |
| 110 | + CNLiveCMineInteListSubModel * model = self.activModel.list[indexPath.row]; | |
| 111 | + if ([model.contentId isEqualToString:@"21"]) {//跳转原生 | |
| 112 | + CNLiveCMineInteTaskViewController * taskView = [[CNLiveCMineInteTaskViewController alloc] initWithTaskModel:self.taskModel]; | |
| 113 | + [self.navigationController pushViewController:taskView animated:YES]; | |
| 114 | + }else{ | |
| 115 | + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:model.thirdUrl statue:CNLiveCMineIntePushWebViewStatueTask]; | |
| 116 | + } | |
| 117 | +} | |
| 118 | +-(void)scrollViewDidScroll:(UIScrollView *)scrollView | |
| 119 | +{ | |
| 120 | + CGFloat offsetY = scrollView.contentOffset.y; | |
| 121 | + self.mainCollectionView.backgroundColor = [UIColor colorWithWhite:1 alpha:(offsetY/200.0f)]; | |
| 122 | +} | |
| 123 | +#pragma mark = getter | |
| 124 | +-(UICollectionView *)mainCollectionView | |
| 125 | +{ | |
| 126 | + if (!_mainCollectionView) { | |
| 127 | + CGFloat item_w = (KScreenWidth - 30)/3; | |
| 128 | + UICollectionViewFlowLayout * layout = [[UICollectionViewFlowLayout alloc] init]; | |
| 129 | + layout.itemSize = CGSizeMake(item_w, item_w * 1.25); | |
| 130 | + layout.scrollDirection = UICollectionViewScrollDirectionVertical; | |
| 131 | + _mainCollectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, kNavigationBarHeight, KScreenWidth, KScreenHeight - kNavigationBarHeight - kVerticalBottomSafeHeight) collectionViewLayout:layout]; | |
| 132 | + _mainCollectionView.delegate = self; | |
| 133 | + _mainCollectionView.dataSource = self; | |
| 134 | + _mainCollectionView.backgroundColor = [UIColor clearColor]; | |
| 135 | + _mainCollectionView.showsVerticalScrollIndicator = NO; | |
| 136 | + _mainCollectionView.showsHorizontalScrollIndicator = NO; | |
| 137 | + [_mainCollectionView registerClass:[CNLiveCMineInteCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass(CNLiveCMineInteCollectionViewCell.class)]; | |
| 138 | + [_mainCollectionView registerClass:[CNLiveCMineInteHeaderView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass(CNLiveCMineInteHeaderView.class)]; | |
| 139 | + } | |
| 140 | + return _mainCollectionView; | |
| 141 | +} | |
| 142 | +- (CNLiveNavigationBar *)navigationBar { | |
| 143 | + if (!_navigationBar) { | |
| 144 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 145 | + _navigationBar.leftImage = [CNLiveCMineService imageWithMineName:@"c_mine_skip_push_back"]; | |
| 146 | + __weak typeof(self) weakSelf = self; | |
| 147 | + _navigationBar.lineHidden = YES; | |
| 148 | + _navigationBar.backgroundColor = UIColorHex(0xFFE9EA); | |
| 149 | + _navigationBar.onClickLeftButton = ^{ | |
| 150 | + [weakSelf.navigationController popViewControllerAnimated:YES]; | |
| 151 | + }; | |
| 152 | + _navigationBar.title.text = @"我的积分"; | |
| 153 | + _navigationBar.right.hidden = NO; | |
| 154 | + _navigationBar.rightImage = [CNLiveCMineService imageWithMineName:@"c_mine_skip_push_more"]; | |
| 155 | + _navigationBar.right.frame = CGRectMake(KScreenWidth - 44, kStatusHeight, 44, 44); | |
| 156 | + [_navigationBar.right setContentHorizontalAlignment:UIControlContentHorizontalAlignmentCenter]; | |
| 157 | + [_navigationBar.right setUserInteractionEnabled:YES]; | |
| 158 | + _navigationBar.onClickRightButton = ^{ | |
| 159 | + [CNLiveCMineInteHeaderCustomView showHeaderAlertViewWithCurrentVC:weakSelf CompleterBlock:^(CNLiveCMineInteHeaderClick headerClick) { | |
| 160 | + if (headerClick == CNLiveCMineInteHeaderClickRule) { | |
| 161 | + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:@"" statue:CNLiveCMineIntePushWebViewStatueRule]; | |
| 162 | + } | |
| 163 | + if (headerClick == CNLiveCMineInteHeaderClickService) { | |
| 164 | + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainPlatFromCustomerMedthod]; | |
| 165 | + } | |
| 166 | + }]; | |
| 167 | + }; | |
| 168 | + } | |
| 169 | + return _navigationBar; | |
| 170 | +} | |
| 171 | +-(UIImageView *)backView | |
| 172 | +{ | |
| 173 | + if (!_backView) { | |
| 174 | + _backView = [[UIImageView alloc] initWithFrame:CGRectMake(0, kNavigationBarHeight, kScreenWidth, 200)]; | |
| 175 | + _backView.contentMode = UIViewContentModeScaleAspectFill; | |
| 176 | + _backView.clipsToBounds = YES; | |
| 177 | + _backView.backgroundColor = [UIColor whiteColor]; | |
| 178 | + _backView.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_header_back_groud"]; | |
| 179 | + } | |
| 180 | + return _backView; | |
| 181 | +} | |
| 182 | + | |
| 183 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/Model/CNLiveCMineInteModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteModel.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/27. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +@class CNLiveCMineInteTaskListItemModel; | |
| 10 | +@class CNLiveCMineInteListProductModel; | |
| 11 | +@class CNLiveCMineInteListSubModel; | |
| 12 | +@class CNLiveCMineInteDetailListModel; | |
| 13 | +NS_ASSUME_NONNULL_BEGIN | |
| 14 | + | |
| 15 | + | |
| 16 | +@interface CNLiveCMineInteModel : NSObject | |
| 17 | +@end | |
| 18 | + | |
| 19 | +/** | |
| 20 | + { | |
| 21 | + status = 1, | |
| 22 | + scores = [1000,2000,3000,4000,5000,6000,7000], | |
| 23 | + score = 1000, | |
| 24 | + times = 1, | |
| 25 | + url = http://wjjh5test.cnlive.com/rewardRules.html | |
| 26 | + } | |
| 27 | + CNIntegralSignInUrl 签到接口返回数据 | |
| 28 | + */ | |
| 29 | +@interface CNLiveCMineInteScoreModel : NSObject | |
| 30 | +@property (nonatomic, strong) NSArray * scores; | |
| 31 | +/**1 为第一次签到显示签到弹框,其他不显示*/ | |
| 32 | +@property (nonatomic, copy) NSString * status; | |
| 33 | +@property (nonatomic, copy) NSString * score; | |
| 34 | +@property (nonatomic, copy) NSString * times; | |
| 35 | +@property (nonatomic, copy) NSString * url; | |
| 36 | +@end | |
| 37 | + | |
| 38 | +/** | |
| 39 | + CNIntegralGetTasksUrl 任务列表接口返回数据 | |
| 40 | + */ | |
| 41 | +@interface CNLiveCMineInteTaskListModel : NSObject<NSCoding> | |
| 42 | +@property (nonatomic, copy) NSString *integral; | |
| 43 | +@property (nonatomic, strong) NSArray *dailyTask; | |
| 44 | +@property (nonatomic, strong) NSArray *firstTask; | |
| 45 | +@end | |
| 46 | + | |
| 47 | +@interface CNLiveCMineInteTaskListItemModel : NSObject<NSCoding> | |
| 48 | +@property (nonatomic, copy) NSString *icon; | |
| 49 | +@property (nonatomic, copy) NSString *score; | |
| 50 | +@property (nonatomic, copy) NSString *status; | |
| 51 | +@property (nonatomic, copy) NSString *taskId; | |
| 52 | +@property (nonatomic, copy) NSString *taskType; | |
| 53 | +@property (nonatomic, assign) NSInteger times; | |
| 54 | +@property (nonatomic, copy) NSString *title; | |
| 55 | +@property (nonatomic, assign) NSInteger totalCount; | |
| 56 | +@property (nonatomic, copy) NSString *url; | |
| 57 | +@end | |
| 58 | + | |
| 59 | +/** | |
| 60 | + /contentApi/getBlockContents 接口返回公告数据 && CNGetSpListUrl 积分乐园接口返回数据 | |
| 61 | + */ | |
| 62 | +@interface CNLiveCMineInteListModel : NSObject<NSCoding> | |
| 63 | +@property (nonatomic, nullable, strong) NSNumber *pageNum; | |
| 64 | +@property (nonatomic, nullable, strong) NSNumber *pageSize; | |
| 65 | +@property (nonatomic, nullable, strong) NSNumber *size; | |
| 66 | +@property (nonatomic, nullable, strong) NSNumber *startRow; | |
| 67 | +@property (nonatomic, nullable, strong) NSNumber *endRow; | |
| 68 | +@property (nonatomic, nullable, strong) NSNumber *total; | |
| 69 | +@property (nonatomic, nullable, strong) NSNumber *pages; | |
| 70 | +@property (nonatomic, nullable, copy) NSArray<CNLiveCMineInteListSubModel *> *list; | |
| 71 | +@property (nonatomic, nullable, strong) NSNumber *prePage; | |
| 72 | +@property (nonatomic, nullable, strong) NSNumber *nextPage; | |
| 73 | +@property (nonatomic, nullable, strong) NSNumber *isFirstPage; | |
| 74 | +@property (nonatomic, nullable, strong) NSNumber *isLastPage; | |
| 75 | +@property (nonatomic, nullable, strong) NSNumber *hasPreviousPage; | |
| 76 | +@property (nonatomic, nullable, strong) NSNumber *hasNextPage; | |
| 77 | +@property (nonatomic, nullable, strong) NSNumber *navigatePages; | |
| 78 | +@property (nonatomic, nullable, copy) NSString *navigatepageNums; | |
| 79 | +@property (nonatomic, nullable, strong) NSNumber *navigateFirstPage; | |
| 80 | +@property (nonatomic, nullable, strong) NSNumber *navigateLastPage; | |
| 81 | +@property (nonatomic, nullable, strong) NSNumber *lastPage; | |
| 82 | +@property (nonatomic, nullable, strong) NSNumber *firstPage; | |
| 83 | +@end | |
| 84 | +@interface CNLiveCMineInteListProductModel: NSObject<NSCoding> | |
| 85 | +@property (nonatomic, nullable, copy) NSString *productId; | |
| 86 | +@property (nonatomic, nullable, copy) NSString *productTitle; | |
| 87 | +@property (nonatomic, nullable, copy) NSString *productImg; | |
| 88 | +@property (nonatomic, nullable, strong) NSNumber *albumProductType; | |
| 89 | +@property (nonatomic, nullable, strong) NSNumber *productType; | |
| 90 | +@property (nonatomic, nullable, copy) NSString *androidRmb; | |
| 91 | +@property (nonatomic, nullable, copy) NSString *androidOriginalRmb; | |
| 92 | +@property (nonatomic, nullable, copy) NSString *iosOriginalRmb; | |
| 93 | +@property (nonatomic, nullable, copy) NSString *iosRmb; | |
| 94 | +@property (nonatomic, nullable, copy) NSString *point; | |
| 95 | +@property (nonatomic, nullable, copy) NSString *promCode; | |
| 96 | +@property (nonatomic, nullable, copy) NSString *orderingGuide; | |
| 97 | +@property (nonatomic, nullable, copy) NSString *activityDesc; | |
| 98 | +@property (nonatomic, nullable, copy) NSString *siteId; | |
| 99 | +@property (nonatomic, nullable, copy) NSString *validPeriod; | |
| 100 | +@property (nonatomic, nullable, copy) NSString *expiryDate; | |
| 101 | +@property (nonatomic, nullable, copy) NSString *effectiveDate; | |
| 102 | +@property (nonatomic, nullable, strong) NSNumber *check; | |
| 103 | +@end | |
| 104 | +@interface CNLiveCMineInteListSubModel: NSObject<NSCoding> | |
| 105 | +@property (nonatomic, nullable, copy) NSString *title; | |
| 106 | +@property (nonatomic, nullable, copy) NSString *subTitle; | |
| 107 | +@property (nonatomic, nullable, copy) NSString *status; | |
| 108 | +@property (nonatomic, nullable, copy) NSString *poster; | |
| 109 | +@property (nonatomic, nullable, copy) NSString *transverseImg; | |
| 110 | +@property (nonatomic, nullable, copy) NSString *verticalImg; | |
| 111 | +@property (nonatomic, nullable, copy) NSString *contentId; | |
| 112 | +@property (nonatomic, nullable, copy) NSString *pid; | |
| 113 | +@property (nonatomic, nullable, copy) NSString *witnessId; | |
| 114 | +@property (nonatomic, nullable, copy) NSString *h5Url; | |
| 115 | +@property (nonatomic, nullable, copy) NSString *tagName; | |
| 116 | +@property (nonatomic, nullable, copy) NSString *tag; | |
| 117 | +@property (nonatomic, nullable, copy) NSString *toType; | |
| 118 | +@property (nonatomic, nullable, copy) NSString *liveChannel; | |
| 119 | +@property (nonatomic, nullable, copy) NSString *author; | |
| 120 | +@property (nonatomic, nullable, copy) NSString *desc; | |
| 121 | +@property (nonatomic, nullable, copy) NSString *duration; | |
| 122 | +@property (nonatomic, nullable, copy) NSString *model; | |
| 123 | +@property (nonatomic, nullable, copy) NSString *goods; | |
| 124 | +@property (nonatomic, nullable, copy) NSString *number; | |
| 125 | +@property (nonatomic, nullable, copy) NSString *thirdUrl; | |
| 126 | +@property (nonatomic, nullable, copy) NSString *publishTime; | |
| 127 | +@property (nonatomic, nullable, copy) NSString *imageArray; | |
| 128 | +@property (nonatomic, nullable, copy) NSString *imageSize; | |
| 129 | +@property (nonatomic, nullable, copy) NSString *imageType; | |
| 130 | +@property (nonatomic, nullable, copy) NSString *liveType; | |
| 131 | +@property (nonatomic, nullable, copy) NSString *channelId; | |
| 132 | +@property (nonatomic, nullable, copy) NSString *mediaImg; | |
| 133 | +@property (nonatomic, nullable, copy) NSString *mediaUrl; | |
| 134 | +@property (nonatomic, nullable, copy) NSString *predetermine; | |
| 135 | +@property (nonatomic, nullable, copy) NSString *trailerId; | |
| 136 | +@property (nonatomic, nullable, copy) NSString *isHorizontalScreen; | |
| 137 | +@property (nonatomic, nullable, copy) NSString *shareUrl; | |
| 138 | +@property (nonatomic, nullable, copy) NSString *weight; | |
| 139 | +@property (nonatomic, nullable, copy) NSString *spID; | |
| 140 | +@property (nonatomic, nullable, copy) NSString *spName; | |
| 141 | +@property (nonatomic, nullable, copy) NSString *spIcon; | |
| 142 | +@property (nonatomic, nullable, copy) NSString *spectators; | |
| 143 | +@property (nonatomic, nullable, copy) NSString *cmccActiveId; | |
| 144 | +@property (nonatomic, nullable, strong) CNLiveCMineInteListProductModel *product; | |
| 145 | +@property (nonatomic, nullable, copy) NSString *aproduct; | |
| 146 | +@property (nonatomic, nullable, copy) NSString *spInfo; | |
| 147 | +@property (nonatomic, nullable, copy) NSString *showType; | |
| 148 | +@property (nonatomic, nullable, copy) NSString *downloadType; | |
| 149 | +@property (nonatomic, nullable, copy) NSString *colours; | |
| 150 | +@property (nonatomic, nullable, copy) NSString *icon; | |
| 151 | +@property (nonatomic, nullable, copy) NSString *videoURL; | |
| 152 | +@property (nonatomic, nullable, copy) NSString *address; | |
| 153 | +@property (nonatomic, nullable, copy) NSString *coordinate; | |
| 154 | +@property (nonatomic, nullable, copy) NSString *sTo; | |
| 155 | +@property (nonatomic, nullable, copy) NSString *sType; | |
| 156 | +@property (nonatomic, nullable, copy) NSString *sShowType; | |
| 157 | +@property (nonatomic, nullable, copy) NSString *source; | |
| 158 | +@property (nonatomic, nullable, copy) NSString *time; | |
| 159 | +@property (nonatomic, nullable, copy) NSString *tool; | |
| 160 | + | |
| 161 | +@property (nonatomic, nullable, copy) NSString *isEmpty;//1标识是不是后台一个数据都没有返回 | |
| 162 | +@end | |
| 163 | + | |
| 164 | +/** | |
| 165 | + /Daren/integral/integralRecordNew.action 获取积分明细(新) | |
| 166 | + */ | |
| 167 | +@interface CNLiveCMineInteDetailModel : NSObject<NSCoding> | |
| 168 | +/**是否有下一页*/ | |
| 169 | +@property (nonatomic, assign) BOOL hasNext; | |
| 170 | +/**获取积分*/ | |
| 171 | +@property (nonatomic, assign) NSInteger obtainIntegral; | |
| 172 | +@property (nonatomic, strong) NSArray<CNLiveCMineInteDetailListModel *> *integralList; | |
| 173 | +/**支出积分*/ | |
| 174 | +@property (nonatomic, assign) NSInteger payIntegral; | |
| 175 | +/**当前展示的日期 自定义的*/ | |
| 176 | +@property (nonatomic, copy) NSString *date_string; | |
| 177 | +/**当前的总积分 自定义的*/ | |
| 178 | +@property (nonatomic, copy) NSString *currentInte; | |
| 179 | +@end | |
| 180 | +@interface CNLiveCMineInteDetailListModel : NSObject<NSCoding> | |
| 181 | +/**1-跳转 2-不跳转*/ | |
| 182 | +@property (nonatomic, copy) NSString *state; | |
| 183 | +/**积分*/ | |
| 184 | +@property (nonatomic, copy) NSString *integral; | |
| 185 | +/**积分描述*/ | |
| 186 | +@property (nonatomic, copy) NSString *integralDesc; | |
| 187 | +/**兑换时间*/ | |
| 188 | +@property (nonatomic, copy) NSString *exchangeTime; | |
| 189 | +@end | |
| 190 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/Model/CNLiveCMineInteModel.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteModel.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/27. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteModel.h" | |
| 9 | + | |
| 10 | +@implementation CNLiveCMineInteModel | |
| 11 | +MJCodingImplementation | |
| 12 | + | |
| 13 | +@end | |
| 14 | + | |
| 15 | +@implementation CNLiveCMineInteScoreModel | |
| 16 | +MJCodingImplementation | |
| 17 | + | |
| 18 | +@end | |
| 19 | + | |
| 20 | +@implementation CNLiveCMineInteTaskListModel | |
| 21 | +MJCodingImplementation | |
| 22 | ++ (NSDictionary *)mj_objectClassInArray{ | |
| 23 | + return @{ | |
| 24 | + @"dailyTask" : @"CNLiveCMineInteTaskListItemModel", | |
| 25 | + @"firstTask" : @"CNLiveCMineInteTaskListItemModel" | |
| 26 | + }; | |
| 27 | +} | |
| 28 | +@end | |
| 29 | + | |
| 30 | +@implementation CNLiveCMineInteTaskListItemModel | |
| 31 | +MJCodingImplementation | |
| 32 | +@end | |
| 33 | + | |
| 34 | +@implementation CNLiveCMineInteListModel | |
| 35 | +MJCodingImplementation | |
| 36 | ++ (NSDictionary *)mj_objectClassInArray{ | |
| 37 | + return @{ | |
| 38 | + @"list" : @"CNLiveCMineInteListSubModel" | |
| 39 | + }; | |
| 40 | +} | |
| 41 | +@end | |
| 42 | + | |
| 43 | +@implementation CNLiveCMineInteListSubModel | |
| 44 | +MJCodingImplementation | |
| 45 | + | |
| 46 | +@end | |
| 47 | + | |
| 48 | +@implementation CNLiveCMineInteListProductModel | |
| 49 | +MJCodingImplementation | |
| 50 | + | |
| 51 | +@end | |
| 52 | + | |
| 53 | +@implementation CNLiveCMineInteDetailModel | |
| 54 | +MJCodingImplementation | |
| 55 | ++ (NSDictionary *)mj_objectClassInArray{ | |
| 56 | + return @{ | |
| 57 | + @"integralList" : @"CNLiveCMineInteDetailListModel" | |
| 58 | + }; | |
| 59 | +} | |
| 60 | +@end | |
| 61 | + | |
| 62 | +@implementation CNLiveCMineInteDetailListModel | |
| 63 | +MJCodingImplementation | |
| 64 | + | |
| 65 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteCollectionViewCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteCollectionViewCell.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/28. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveCMineInteCollectionViewCell : UICollectionViewCell | |
| 13 | + | |
| 14 | +@property (nonatomic, strong) CNLiveCMineInteListSubModel * taskModel; | |
| 15 | + | |
| 16 | +@end | |
| 17 | + | |
| 18 | +@interface CNLiveCMineDetailTableViewCell : UITableViewCell | |
| 19 | + | |
| 20 | +@property (nonatomic, strong) CNLiveCMineInteDetailListModel * listModel; | |
| 21 | + | |
| 22 | +@end | |
| 23 | + | |
| 24 | +@interface CNLiveCMineTaskTableViewCell : UITableViewCell | |
| 25 | + | |
| 26 | +@property (nonatomic, strong) CNLiveCMineInteTaskListItemModel * taskModel; | |
| 27 | + | |
| 28 | +@end | |
| 29 | + | |
| 30 | +@interface CNLiveCMineAnnouTableViewCell : UITableViewCell | |
| 31 | + | |
| 32 | +@property (nonatomic, strong) CNLiveCMineInteListSubModel * annouModel; | |
| 33 | + | |
| 34 | +@end | |
| 35 | + | |
| 36 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteCollectionViewCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteCollectionViewCell.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/28. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteCollectionViewCell.h" | |
| 9 | +@interface CNLiveCMineInteCollectionViewCell() | |
| 10 | +@property (nonatomic, strong) UIImageView * imageView; | |
| 11 | +@property (nonatomic, strong) UIImageView * newView; | |
| 12 | +@property (nonatomic, strong) UILabel * nameLabel; | |
| 13 | +@property (nonatomic, strong) UILabel * descLabel; | |
| 14 | +@end | |
| 15 | + | |
| 16 | +@implementation CNLiveCMineInteCollectionViewCell | |
| 17 | + | |
| 18 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 19 | +{ | |
| 20 | + self = [super initWithFrame:frame]; | |
| 21 | + if (self) { | |
| 22 | + self.backgroundColor = UIColorHex(0xFCFDFD); | |
| 23 | + self.layer.cornerRadius = 5; | |
| 24 | + self.layer.masksToBounds = YES;//超出父视图部分不显示。 | |
| 25 | + self.layer.borderColor = UIColorHex(0xF9FAFB).CGColor; | |
| 26 | + self.layer.borderWidth = 1; | |
| 27 | + | |
| 28 | + [self.contentView addSubview:self.imageView]; | |
| 29 | + [self.contentView addSubview:self.nameLabel]; | |
| 30 | + [self.contentView addSubview:self.descLabel]; | |
| 31 | + [self.contentView addSubview:self.newView]; | |
| 32 | + } | |
| 33 | + return self; | |
| 34 | +} | |
| 35 | +-(void)layoutSubviews | |
| 36 | +{ | |
| 37 | + [super layoutSubviews]; | |
| 38 | + __weak typeof(self) weakSelf = self; | |
| 39 | + [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 40 | + make.centerX.mas_equalTo(weakSelf); | |
| 41 | + make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(10); | |
| 42 | + make.size.mas_equalTo(50); | |
| 43 | + }]; | |
| 44 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 45 | + make.centerX.mas_equalTo(weakSelf); | |
| 46 | + make.top.mas_equalTo(weakSelf.imageView.mas_bottom).offset(10); | |
| 47 | + }]; | |
| 48 | + [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 49 | + make.centerX.mas_equalTo(weakSelf); | |
| 50 | + make.top.mas_equalTo(weakSelf.nameLabel.mas_bottom).offset(10); | |
| 51 | + }]; | |
| 52 | + [self.newView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 53 | + make.centerX.mas_equalTo(weakSelf.contentView).offset(20); | |
| 54 | + make.top.mas_equalTo(weakSelf.contentView).offset(5); | |
| 55 | + }]; | |
| 56 | +} | |
| 57 | +-(void)setTaskModel:(CNLiveCMineInteListSubModel *)taskModel | |
| 58 | +{ | |
| 59 | + _taskModel = taskModel; | |
| 60 | + | |
| 61 | + if ([taskModel.isEmpty isEqualToString:@"1"]) { | |
| 62 | + self.imageView.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_item_task"]; | |
| 63 | + }else{ | |
| 64 | + [self.imageView sd_setImageWithURL:[NSURL URLWithString:taskModel.poster] placeholderImage:nil]; | |
| 65 | + } | |
| 66 | + self.nameLabel.text = taskModel.title; | |
| 67 | + self.descLabel.text = taskModel.subTitle; | |
| 68 | + self.newView.hidden = ![taskModel.tag isEqualToString:@"1"]; | |
| 69 | +} | |
| 70 | +#pragma mark = | |
| 71 | +-(UIImageView *)imageView | |
| 72 | +{ | |
| 73 | + if (!_imageView) { | |
| 74 | + _imageView = [[UIImageView alloc] initWithFrame:CGRectZero]; | |
| 75 | + _imageView.contentMode = UIViewContentModeScaleToFill; | |
| 76 | + _imageView.backgroundColor = [UIColor clearColor]; | |
| 77 | + } | |
| 78 | + return _imageView; | |
| 79 | +} | |
| 80 | +-(UIImageView *)newView | |
| 81 | +{ | |
| 82 | + if (!_newView) { | |
| 83 | + _newView = [[UIImageView alloc] initWithFrame:CGRectZero]; | |
| 84 | + _newView.contentMode = UIViewContentModeScaleAspectFill; | |
| 85 | + _newView.backgroundColor = [UIColor clearColor]; | |
| 86 | + _newView.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_tag_new"]; | |
| 87 | + _newView.hidden = YES; | |
| 88 | + } | |
| 89 | + return _newView; | |
| 90 | +} | |
| 91 | +-(UILabel *)nameLabel | |
| 92 | +{ | |
| 93 | + if (!_nameLabel) { | |
| 94 | + _nameLabel = [[UILabel alloc] init]; | |
| 95 | + _nameLabel.numberOfLines = 1; | |
| 96 | + _nameLabel.textAlignment = NSTextAlignmentCenter; | |
| 97 | + _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | |
| 98 | + _nameLabel.textColor = UIColorHex(0x333333); | |
| 99 | + _nameLabel.font = UIFontCNMake(15); | |
| 100 | + _nameLabel.font = UIFontBoldCNMake(15); | |
| 101 | + _nameLabel.text = @""; | |
| 102 | + } | |
| 103 | + return _nameLabel; | |
| 104 | +} | |
| 105 | +-(UILabel *)descLabel | |
| 106 | +{ | |
| 107 | + if (!_descLabel) { | |
| 108 | + _descLabel = [[UILabel alloc] init]; | |
| 109 | + _descLabel.numberOfLines = 1; | |
| 110 | + _descLabel.textAlignment = NSTextAlignmentCenter; | |
| 111 | + _descLabel.lineBreakMode = NSLineBreakByTruncatingTail; | |
| 112 | + _descLabel.textColor = UIColorHex(0x999999); | |
| 113 | + _descLabel.font = UIFontCNMake(10); | |
| 114 | + _descLabel.text = @""; | |
| 115 | + } | |
| 116 | + return _descLabel; | |
| 117 | +} | |
| 118 | +@end | |
| 119 | + | |
| 120 | + | |
| 121 | +@interface CNLiveCMineDetailTableViewCell() | |
| 122 | +@property (nonatomic, strong) UILabel * nameLabel; | |
| 123 | +@property (nonatomic, strong) UILabel * dateLabel; | |
| 124 | +@property (nonatomic, strong) UILabel * coinsLabel; | |
| 125 | +@property (nonatomic, strong) QMUIButton * lookButton; | |
| 126 | +@end | |
| 127 | + | |
| 128 | + | |
| 129 | +@implementation CNLiveCMineDetailTableViewCell | |
| 130 | + | |
| 131 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | |
| 132 | +{ | |
| 133 | + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { | |
| 134 | + self.contentView.backgroundColor = [UIColor whiteColor]; | |
| 135 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 136 | + [self.contentView addSubview:self.nameLabel]; | |
| 137 | + [self.contentView addSubview:self.dateLabel]; | |
| 138 | + [self.contentView addSubview:self.coinsLabel]; | |
| 139 | + [self.contentView addSubview:self.lookButton]; | |
| 140 | + } | |
| 141 | + return self; | |
| 142 | +} | |
| 143 | +-(void)layoutSubviews | |
| 144 | +{ | |
| 145 | + [super layoutSubviews]; | |
| 146 | + __weak typeof(self) weakSelf = self; | |
| 147 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 148 | + make.top.mas_equalTo(weakSelf.contentView).offset(15); | |
| 149 | + make.left.mas_equalTo(weakSelf.contentView).offset(10); | |
| 150 | + }]; | |
| 151 | + [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 152 | + make.left.mas_equalTo(weakSelf.contentView).offset(10); | |
| 153 | + make.bottom.mas_equalTo(weakSelf.contentView).offset(-15); | |
| 154 | + }]; | |
| 155 | + [self.coinsLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 156 | + make.centerY.mas_equalTo(weakSelf.contentView); | |
| 157 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-15); | |
| 158 | + }]; | |
| 159 | + [self.lookButton mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 160 | + make.top.mas_equalTo(weakSelf.coinsLabel.mas_bottom).offset(5); | |
| 161 | + make.right.mas_equalTo(weakSelf.contentView).offset(-15); | |
| 162 | + }]; | |
| 163 | +} | |
| 164 | +-(void)setListModel:(CNLiveCMineInteDetailListModel *)listModel | |
| 165 | +{ | |
| 166 | + _listModel = listModel; | |
| 167 | + | |
| 168 | + self.nameLabel.text = listModel.integralDesc; | |
| 169 | + self.dateLabel.text = listModel.exchangeTime; | |
| 170 | + self.coinsLabel.text = listModel.integral; | |
| 171 | + self.coinsLabel.textColor = [listModel.integral cn_containsString:@"-"]?UIColorHex(0x00C657):UIColorHex(0xF5A623); | |
| 172 | + self.lookButton.hidden = [listModel.state isEqualToString:@"2"]; | |
| 173 | + if ([listModel.state isEqualToString:@"1"]) { | |
| 174 | + __weak typeof(self) weakSelf = self; | |
| 175 | + [self.coinsLabel mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 176 | + make.centerY.mas_equalTo(weakSelf.contentView).offset(-10); | |
| 177 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-15); | |
| 178 | + }]; | |
| 179 | + [self.lookButton mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 180 | + make.top.mas_equalTo(weakSelf.coinsLabel.mas_bottom).offset(5); | |
| 181 | + make.right.mas_equalTo(weakSelf.contentView).offset(-15); | |
| 182 | + }]; | |
| 183 | + } | |
| 184 | +} | |
| 185 | +#pragma mark = | |
| 186 | +-(UILabel *)nameLabel | |
| 187 | +{ | |
| 188 | + if (!_nameLabel) { | |
| 189 | + _nameLabel = [[UILabel alloc] init]; | |
| 190 | + _nameLabel.numberOfLines = 1; | |
| 191 | + _nameLabel.textAlignment = NSTextAlignmentCenter; | |
| 192 | + _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | |
| 193 | + _nameLabel.textColor = UIColorHex(0x333333); | |
| 194 | + _nameLabel.font = UIFontCNMake(15); | |
| 195 | + _nameLabel.font = UIFontBoldCNMake(15); | |
| 196 | + } | |
| 197 | + return _nameLabel; | |
| 198 | +} | |
| 199 | +-(UILabel *)dateLabel | |
| 200 | +{ | |
| 201 | + if (!_dateLabel) { | |
| 202 | + _dateLabel = [[UILabel alloc] init]; | |
| 203 | + _dateLabel.numberOfLines = 1; | |
| 204 | + _dateLabel.textAlignment = NSTextAlignmentCenter; | |
| 205 | + _dateLabel.lineBreakMode = NSLineBreakByTruncatingTail; | |
| 206 | + _dateLabel.textColor = UIColorHex(0x999999); | |
| 207 | + _dateLabel.font = UIFontCNMake(10); | |
| 208 | + } | |
| 209 | + return _dateLabel; | |
| 210 | +} | |
| 211 | +-(UILabel *)coinsLabel | |
| 212 | +{ | |
| 213 | + if (!_coinsLabel) { | |
| 214 | + _coinsLabel = [[UILabel alloc] init]; | |
| 215 | + _coinsLabel.numberOfLines = 1; | |
| 216 | + _coinsLabel.textAlignment = NSTextAlignmentCenter; | |
| 217 | + _coinsLabel.lineBreakMode = NSLineBreakByTruncatingTail; | |
| 218 | + _coinsLabel.textColor = UIColorHex(0x00C657); | |
| 219 | + _coinsLabel.font = UIFontCNMake(15); | |
| 220 | + } | |
| 221 | + return _coinsLabel; | |
| 222 | +} | |
| 223 | +-(QMUIButton *)lookButton | |
| 224 | +{ | |
| 225 | + if (!_lookButton) { | |
| 226 | + _lookButton = [[QMUIButton alloc] init]; | |
| 227 | + [_lookButton setTitle:@"去看看" forState:UIControlStateNormal]; | |
| 228 | + [_lookButton setImage:[CNLiveCMineService imageWithMineName:@"c_mine_skip_more"] forState:UIControlStateNormal]; | |
| 229 | + [_lookButton setTitleColor:UIColorHex(0x999999) forState:UIControlStateNormal]; | |
| 230 | + _lookButton.titleLabel.font = UIFontCNMake(14); | |
| 231 | + _lookButton.backgroundColor = [UIColor clearColor]; | |
| 232 | + _lookButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; | |
| 233 | + _lookButton.spacingBetweenImageAndTitle = 1; | |
| 234 | + _lookButton.userInteractionEnabled = NO; | |
| 235 | + _lookButton.imagePosition = QMUIButtonImagePositionRight; | |
| 236 | + _lookButton.hidden = YES; | |
| 237 | + } | |
| 238 | + return _lookButton; | |
| 239 | +} | |
| 240 | +@end | |
| 241 | + | |
| 242 | +@interface CNLiveCMineTaskTableViewCell() | |
| 243 | +@property (nonatomic, strong) UIView * mainView; | |
| 244 | +@property (nonatomic, strong) UIImageView *leftImage; | |
| 245 | +@property (nonatomic, strong) UILabel *titleLabel; | |
| 246 | +@property (nonatomic, strong) UILabel *pointLabel; | |
| 247 | +@property (nonatomic, strong) UILabel *progressLabel; | |
| 248 | +@property (nonatomic, strong) QMUIButton *completeBtn; | |
| 249 | +@end | |
| 250 | + | |
| 251 | +@implementation CNLiveCMineTaskTableViewCell | |
| 252 | + | |
| 253 | +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ | |
| 254 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 255 | + if (self) { | |
| 256 | + self.contentView.backgroundColor = UIColorHex(0xf5f5f5); | |
| 257 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 258 | + [self.contentView addSubview:self.mainView]; | |
| 259 | + [self.mainView addSubview:self.leftImage]; | |
| 260 | + [self.mainView addSubview:self.titleLabel]; | |
| 261 | + [self.mainView addSubview:self.pointLabel]; | |
| 262 | + | |
| 263 | + [self.mainView addSubview:self.progressLabel]; | |
| 264 | + [self.mainView addSubview:self.completeBtn]; | |
| 265 | + } | |
| 266 | + return self; | |
| 267 | +} | |
| 268 | +-(void)layoutSubviews | |
| 269 | +{ | |
| 270 | + [super layoutSubviews]; | |
| 271 | + __weak typeof(self) weakSelf = self; | |
| 272 | + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 273 | + make.top.bottom.mas_equalTo(weakSelf.contentView); | |
| 274 | + make.left.mas_equalTo(weakSelf.contentView).offset(15); | |
| 275 | + make.right.mas_equalTo(weakSelf.contentView).offset(-15); | |
| 276 | + }]; | |
| 277 | + [self.leftImage mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 278 | + make.centerY.equalTo(weakSelf.mainView); | |
| 279 | + make.left.equalTo(weakSelf.mainView.mas_left).with.offset(10); | |
| 280 | + make.size.offset(40); | |
| 281 | + }]; | |
| 282 | + [self.completeBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 283 | + make.centerY.equalTo(weakSelf.mainView); | |
| 284 | + make.right.equalTo(weakSelf.mainView.mas_right).offset(-10); | |
| 285 | + make.height.offset(30); | |
| 286 | + make.width.offset(70); | |
| 287 | + }]; | |
| 288 | + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 289 | + make.top.equalTo(weakSelf.mainView.mas_top).with.offset(15); | |
| 290 | + make.left.equalTo(weakSelf.leftImage.mas_right).with.offset(10); | |
| 291 | + make.right.equalTo(weakSelf.completeBtn.mas_left).with.offset(-10); | |
| 292 | + }]; | |
| 293 | + [self.pointLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 294 | + make.bottom.equalTo(weakSelf.mainView.mas_bottom).with.offset(-15); | |
| 295 | + make.left.equalTo(weakSelf.leftImage.mas_right).with.offset(10); | |
| 296 | + }]; | |
| 297 | + [self.progressLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 298 | + make.centerY.equalTo(weakSelf.pointLabel); | |
| 299 | + make.left.equalTo(weakSelf.pointLabel.mas_right).with.offset(10); | |
| 300 | + }]; | |
| 301 | + | |
| 302 | + self.completeBtn.layer.cornerRadius = 15.0; | |
| 303 | + self.completeBtn.layer.masksToBounds = YES; | |
| 304 | +} | |
| 305 | +-(void)setTaskModel:(CNLiveCMineInteTaskListItemModel *)taskModel | |
| 306 | +{ | |
| 307 | + _taskModel = taskModel; | |
| 308 | + | |
| 309 | + [self.leftImage sd_setImageWithURL:[NSURL URLWithString:taskModel.icon] completed:nil]; | |
| 310 | + self.titleLabel.text = taskModel.title; | |
| 311 | + self.pointLabel.text = [NSString stringWithFormat:@"积分值+%@",taskModel.score]; | |
| 312 | + | |
| 313 | + NSString *timesStr = [NSString stringWithFormat:@"完成%ld/%ld",(long)taskModel.times,(long)taskModel.totalCount]; | |
| 314 | + NSString *times = [NSString stringWithFormat:@"%ld",(long)taskModel.times]; | |
| 315 | + NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithString:timesStr]; | |
| 316 | + NSRange range = [timesStr rangeOfString:times]; | |
| 317 | + [str addAttribute:NSForegroundColorAttributeName value:UIColorHex(0x23D41E) range:range]; | |
| 318 | + self.progressLabel.attributedText = str; | |
| 319 | + | |
| 320 | + if(taskModel.times >= taskModel.totalCount) { | |
| 321 | + [self.completeBtn setTitle:@"已完成" forState:UIControlStateNormal]; | |
| 322 | + [self.completeBtn setImage:nil forState:UIControlStateNormal]; | |
| 323 | + self.completeBtn.backgroundColor = UIColorHex(0xF0F0F0); | |
| 324 | + [self.completeBtn setTitleColor:UIColorHex(0x999999) forState:UIControlStateNormal]; | |
| 325 | + }else{ | |
| 326 | + [self setCompleterBtnType:taskModel.taskId]; | |
| 327 | + [self.completeBtn setImage:[CNLiveCMineService imageWithMineName:@"c_mine_skip_yellow_more"] forState:UIControlStateNormal]; | |
| 328 | + self.completeBtn.backgroundColor = UIColorMakeWithRGBA(245, 166, 35, 0.1); | |
| 329 | + [self.completeBtn setTitleColor:UIColorHex(0xF5A623) forState:UIControlStateNormal]; | |
| 330 | + } | |
| 331 | +} | |
| 332 | +-(void)clickCompleteBtn:(QMUIButton *)button | |
| 333 | +{ | |
| 334 | + | |
| 335 | +} | |
| 336 | +- (void)setCompleterBtnType:(NSString *)type { | |
| 337 | + | |
| 338 | + if([type isEqualToString:@"update_face"]||[type isEqualToString:@"update_nick"]){//头像 昵称 | |
| 339 | + [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal]; | |
| 340 | + } | |
| 341 | + else if ([type isEqualToString:@"publish_witness"]){//发布目击者 | |
| 342 | + [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal]; | |
| 343 | + } | |
| 344 | + else if ([type isEqualToString:@"add_friend"]){//添加好友 | |
| 345 | + [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal]; | |
| 346 | + } | |
| 347 | + else if ([type isEqualToString:@"publish_moment"]){//生活圈 | |
| 348 | + [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal]; | |
| 349 | + } | |
| 350 | + else if ([type isEqualToString:@"share_video"]){//分享目击者视频 | |
| 351 | + [_completeBtn setTitle:@"去分享" forState:UIControlStateNormal]; | |
| 352 | + } | |
| 353 | + else if ([type isEqualToString:@"share_article"]){//分享文章 | |
| 354 | + [_completeBtn setTitle:@"去分享" forState:UIControlStateNormal]; | |
| 355 | + } | |
| 356 | + else if ([type isEqualToString:@"publish_comment"]){//评论 | |
| 357 | + [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal]; | |
| 358 | + } | |
| 359 | + else if ([type isEqualToString:@"read_article"]){//看文章-> 视讯中国 -> 今日要闻 | |
| 360 | + [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal]; | |
| 361 | + } | |
| 362 | + else if ([type isEqualToString:@"customer_feedback"]){//帮助与反馈 | |
| 363 | + [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal]; | |
| 364 | + } | |
| 365 | + else if ([type isEqualToString:@"watch_video"]){//看视频 -> 视讯中国 -> 目击者 | |
| 366 | + [_completeBtn setTitle:@"去观看" forState:UIControlStateNormal]; | |
| 367 | + } | |
| 368 | + else if ([type isEqualToString:@"check_in"]){//签到 | |
| 369 | + [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal]; | |
| 370 | + } | |
| 371 | + else if ([type isEqualToString:@"listen_novel"]){//听小说 | |
| 372 | + [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal]; | |
| 373 | + } | |
| 374 | +} | |
| 375 | +#pragma mark - Lazy loading | |
| 376 | +-(UIView *)mainView | |
| 377 | +{ | |
| 378 | + if (!_mainView) { | |
| 379 | + _mainView = [[UIView alloc] init]; | |
| 380 | + _mainView.backgroundColor = [UIColor whiteColor]; | |
| 381 | + } | |
| 382 | + return _mainView; | |
| 383 | +} | |
| 384 | +- (UIImageView *)leftImage{ | |
| 385 | + if (!_leftImage) { | |
| 386 | + _leftImage = [[UIImageView alloc] init]; | |
| 387 | + _leftImage.userInteractionEnabled = YES; | |
| 388 | + } | |
| 389 | + return _leftImage; | |
| 390 | +} | |
| 391 | +- (UILabel *)titleLabel{ | |
| 392 | + if(_titleLabel == nil){ | |
| 393 | + _titleLabel = [[UILabel alloc] init]; | |
| 394 | + _titleLabel.textColor = UIColorHex(0x282828); | |
| 395 | + _titleLabel.font = UIFontCNMake(16); | |
| 396 | + _titleLabel.userInteractionEnabled = YES; | |
| 397 | + } | |
| 398 | + return _titleLabel; | |
| 399 | + | |
| 400 | +} | |
| 401 | +- (UILabel *)pointLabel{ | |
| 402 | + if(_pointLabel == nil){ | |
| 403 | + _pointLabel = [[UILabel alloc] init]; | |
| 404 | + _pointLabel.textColor = UIColorHex(0x9B9B9B); | |
| 405 | + _pointLabel.font = UIFontCNMake(12); | |
| 406 | + _pointLabel.userInteractionEnabled = YES; | |
| 407 | + } | |
| 408 | + return _pointLabel; | |
| 409 | + | |
| 410 | +} | |
| 411 | +- (UILabel *)progressLabel{ | |
| 412 | + if(_progressLabel == nil){ | |
| 413 | + _progressLabel = [[UILabel alloc] init]; | |
| 414 | + _progressLabel.textColor = UIColorHex(0x9B9B9B); | |
| 415 | + _progressLabel.font = UIFontCNMake(12); | |
| 416 | + _progressLabel.userInteractionEnabled = YES; | |
| 417 | + } | |
| 418 | + return _progressLabel; | |
| 419 | +} | |
| 420 | + | |
| 421 | +-(QMUIButton *)completeBtn | |
| 422 | +{ | |
| 423 | + if (!_completeBtn) { | |
| 424 | + _completeBtn = [[QMUIButton alloc] init]; | |
| 425 | + [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal]; | |
| 426 | + [_completeBtn setImage:[CNLiveCMineService imageWithMineName:@"c_mine_skip_yellow_more"] forState:UIControlStateNormal]; | |
| 427 | + [_completeBtn setTitleColor:UIColorHex(0xF5A623) forState:UIControlStateNormal]; | |
| 428 | + _completeBtn.titleLabel.font = [UIFont systemFontOfSize:12]; | |
| 429 | + _completeBtn.titleLabel.font = [UIFont boldSystemFontOfSize:12]; | |
| 430 | + _completeBtn.spacingBetweenImageAndTitle = 0; | |
| 431 | + _completeBtn.backgroundColor = UIColorMakeWithRGBA(245, 166, 35, 0.1); | |
| 432 | + _completeBtn.imagePosition = QMUIButtonImagePositionRight; | |
| 433 | + [_completeBtn addTarget:self action:@selector(clickCompleteBtn:) forControlEvents:UIControlEventTouchUpInside]; | |
| 434 | + } | |
| 435 | + return _completeBtn; | |
| 436 | +} | |
| 437 | +@end | |
| 438 | + | |
| 439 | +@interface CNLiveCMineAnnouTableViewCell () | |
| 440 | +@property (nonatomic, strong) UIView * mainView; | |
| 441 | +@property (nonatomic, strong) UILabel * tagLabel; | |
| 442 | +@property (nonatomic, strong) UILabel * nameLabel; | |
| 443 | +@property (nonatomic, strong) UILabel * dateLabel; | |
| 444 | +@property (nonatomic, strong) UIImageView * moreView; | |
| 445 | +@end | |
| 446 | + | |
| 447 | +@implementation CNLiveCMineAnnouTableViewCell | |
| 448 | + | |
| 449 | +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ | |
| 450 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 451 | + if (self) { | |
| 452 | + self.contentView.backgroundColor = UIColorHex(0xf9f9f9); | |
| 453 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 454 | + [self.contentView addSubview:self.mainView]; | |
| 455 | + [self.mainView addSubview:self.tagLabel]; | |
| 456 | + [self.mainView addSubview:self.nameLabel]; | |
| 457 | + [self.mainView addSubview:self.dateLabel]; | |
| 458 | + [self.mainView addSubview:self.moreView]; | |
| 459 | + | |
| 460 | + __weak typeof(self) weakSelf = self; | |
| 461 | + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 462 | + make.top.mas_equalTo(weakSelf.contentView).offset(5); | |
| 463 | + make.bottom.mas_equalTo(weakSelf.contentView).offset(-5); | |
| 464 | + make.left.mas_equalTo(weakSelf.contentView).offset(15); | |
| 465 | + make.right.mas_equalTo(weakSelf.contentView).offset(-15); | |
| 466 | + }]; | |
| 467 | + [self.moreView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 468 | + make.centerY.mas_equalTo(weakSelf.mainView); | |
| 469 | + make.right.mas_equalTo(weakSelf.mainView).offset(-10); | |
| 470 | + make.size.mas_equalTo(15); | |
| 471 | + }]; | |
| 472 | + [self.tagLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 473 | + make.top.left.mas_equalTo(weakSelf.mainView).offset(10); | |
| 474 | + make.height.mas_equalTo(15); | |
| 475 | + }]; | |
| 476 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 477 | + make.top.left.mas_equalTo(weakSelf.mainView).offset(10); | |
| 478 | + make.right.mas_equalTo(weakSelf.moreView.mas_left).offset(-10); | |
| 479 | + }]; | |
| 480 | + [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 481 | + make.bottom.mas_equalTo(weakSelf.mainView.mas_bottom).offset(-10); | |
| 482 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(10); | |
| 483 | + make.right.mas_equalTo(weakSelf.moreView.mas_left).offset(-10); | |
| 484 | + }]; | |
| 485 | + } | |
| 486 | + return self; | |
| 487 | +} | |
| 488 | + | |
| 489 | +-(void)setAnnouModel:(CNLiveCMineInteListSubModel *)annouModel | |
| 490 | +{ | |
| 491 | + _annouModel = annouModel; | |
| 492 | + self.nameLabel.text = annouModel.title; | |
| 493 | + self.dateLabel.text = annouModel.publishTime; | |
| 494 | + | |
| 495 | + if ([annouModel.tag isEqualToString:@"1"]) { | |
| 496 | + self.tagLabel.backgroundColor = UIColorHex(#F5A623); | |
| 497 | + self.tagLabel.text = @" 置顶 "; | |
| 498 | + | |
| 499 | + __weak typeof(self) weakSelf = self; | |
| 500 | + [self.nameLabel mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 501 | + make.centerY.mas_equalTo(weakSelf.tagLabel); | |
| 502 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(60); | |
| 503 | + make.right.mas_equalTo(weakSelf.moreView.mas_left).offset(-10); | |
| 504 | + }]; | |
| 505 | + } | |
| 506 | +} | |
| 507 | +#pragma mark - Lazy loading | |
| 508 | +-(UIView *)mainView | |
| 509 | +{ | |
| 510 | + if (!_mainView) { | |
| 511 | + _mainView = [[UIView alloc] init]; | |
| 512 | + _mainView.backgroundColor = [UIColor whiteColor]; | |
| 513 | + _mainView.layer.cornerRadius = 8; | |
| 514 | + _mainView.layer.masksToBounds = YES; | |
| 515 | + } | |
| 516 | + return _mainView; | |
| 517 | +} | |
| 518 | +-(UILabel *)nameLabel | |
| 519 | +{ | |
| 520 | + if (!_nameLabel) { | |
| 521 | + _nameLabel = [[UILabel alloc] init]; | |
| 522 | + _nameLabel.numberOfLines = 1; | |
| 523 | + _nameLabel.textAlignment = NSTextAlignmentLeft; | |
| 524 | + _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | |
| 525 | + _nameLabel.textColor = UIColorHex(0x333333); | |
| 526 | + _nameLabel.font = UIFontCNMake(15); | |
| 527 | + _nameLabel.font = UIFontBoldCNMake(15); | |
| 528 | + } | |
| 529 | + return _nameLabel; | |
| 530 | +} | |
| 531 | +-(UILabel *)dateLabel | |
| 532 | +{ | |
| 533 | + if (!_dateLabel) { | |
| 534 | + _dateLabel = [[UILabel alloc] init]; | |
| 535 | + _dateLabel.numberOfLines = 1; | |
| 536 | + _dateLabel.textAlignment = NSTextAlignmentLeft; | |
| 537 | + _dateLabel.lineBreakMode = NSLineBreakByTruncatingTail; | |
| 538 | + _dateLabel.textColor = UIColorHex(0x999999); | |
| 539 | + _dateLabel.font = UIFontCNMake(10); | |
| 540 | + } | |
| 541 | + return _dateLabel; | |
| 542 | +} | |
| 543 | +-(UILabel *)tagLabel | |
| 544 | +{ | |
| 545 | + if (!_tagLabel) { | |
| 546 | + _tagLabel = [[UILabel alloc] init]; | |
| 547 | + _tagLabel.numberOfLines = 1; | |
| 548 | + _tagLabel.textAlignment = NSTextAlignmentLeft; | |
| 549 | + _tagLabel.lineBreakMode = NSLineBreakByTruncatingTail; | |
| 550 | + _tagLabel.textColor = [UIColor whiteColor]; | |
| 551 | + _tagLabel.font = [UIFont systemFontOfSize:10]; | |
| 552 | + _tagLabel.font = [UIFont boldSystemFontOfSize:10]; | |
| 553 | + _tagLabel.layer.cornerRadius = 3; | |
| 554 | + _tagLabel.layer.masksToBounds = YES; | |
| 555 | + } | |
| 556 | + return _tagLabel; | |
| 557 | +} | |
| 558 | +- (UIImageView *)moreView{ | |
| 559 | + if (!_moreView) { | |
| 560 | + _moreView = [[UIImageView alloc] init]; | |
| 561 | + _moreView.image = [CNLiveCMineService imageWithMineName:@"c_mine_skip_inte_detail"]; | |
| 562 | + _moreView.contentMode = UIViewContentModeScaleAspectFill; | |
| 563 | + } | |
| 564 | + return _moreView; | |
| 565 | +} | |
| 566 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteDetailHeaderView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteDetailHeaderView.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/29. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +#import "CNLiveCMineInteModel.h" | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveCMineInteDetailHeaderView : UIView | |
| 13 | + | |
| 14 | +/// 数据源 | |
| 15 | +@property (nonatomic, strong) CNLiveCMineInteDetailModel * detailModel; | |
| 16 | + | |
| 17 | +/// 点击日期选择器 | |
| 18 | +@property (nonatomic, copy) void(^selectWithDateBlock)(void); | |
| 19 | + | |
| 20 | +@end | |
| 21 | + | |
| 22 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteDetailHeaderView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteDetailHeaderView.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/29. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteDetailHeaderView.h" | |
| 9 | + | |
| 10 | +@interface CNLiveCMineInteDetailHeaderView() | |
| 11 | +@property (nonatomic, strong) UILabel * inteLabel; | |
| 12 | +@property (nonatomic, strong) QMUIButton * dateButton; | |
| 13 | +@property (nonatomic, strong) UILabel * spendLabel;//支出 | |
| 14 | +@property (nonatomic, strong) UILabel * obtaLabel;//获取 | |
| 15 | +@end | |
| 16 | + | |
| 17 | +@implementation CNLiveCMineInteDetailHeaderView | |
| 18 | + | |
| 19 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 20 | +{ | |
| 21 | + self = [super initWithFrame:frame]; | |
| 22 | + if (self) { | |
| 23 | + [self addSubview:self.inteLabel]; | |
| 24 | + [self addSubview:self.dateButton]; | |
| 25 | + [self addSubview:self.obtaLabel]; | |
| 26 | + [self addSubview:self.spendLabel]; | |
| 27 | + } | |
| 28 | + return self; | |
| 29 | +} | |
| 30 | +-(void)setDetailModel:(CNLiveCMineInteDetailModel *)detailModel | |
| 31 | +{ | |
| 32 | + _detailModel = detailModel; | |
| 33 | + | |
| 34 | + NSMutableAttributedString * coin_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@积分",detailModel.currentInte]]; | |
| 35 | + [coin_string addAttribute:NSFontAttributeName value:UIFontCNMake(12) range:[coin_string.string rangeOfString:@"积分"]]; | |
| 36 | + [coin_string addAttribute:NSFontAttributeName value:UIFontBoldCNMake(35) range:NSMakeRange(0, [coin_string.string rangeOfString:@"积分"].location)]; | |
| 37 | + self.inteLabel.attributedText = coin_string; | |
| 38 | + | |
| 39 | + NSMutableAttributedString * spend_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"获取 %ld",(long)detailModel.payIntegral]]; | |
| 40 | + [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[spend_string.string rangeOfString:@"获取"]]; | |
| 41 | + [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [spend_string.string rangeOfString:@"获取"].location)]; | |
| 42 | + [spend_string addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:[spend_string.string rangeOfString:@"获取"]]; | |
| 43 | + [spend_string addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, [spend_string.string rangeOfString:@"获取"].location)]; | |
| 44 | + self.spendLabel.attributedText = spend_string; | |
| 45 | + | |
| 46 | + NSMutableAttributedString * obta_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"支出%ld",(long)detailModel.obtainIntegral]]; | |
| 47 | + [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[obta_string.string rangeOfString:@"支出"]]; | |
| 48 | + [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [obta_string.string rangeOfString:@"支出"].location)]; | |
| 49 | + [obta_string addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:[obta_string.string rangeOfString:@"支出"]]; | |
| 50 | + [obta_string addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, [obta_string.string rangeOfString:@"支出"].location)]; | |
| 51 | + self.obtaLabel.attributedText = obta_string; | |
| 52 | + | |
| 53 | + NSArray * array = [detailModel.date_string componentsSeparatedByString:@"-"]; | |
| 54 | + [self.dateButton setTitle:[NSString stringWithFormat:@"%@年%@月",array.firstObject,array.lastObject] forState:UIControlStateNormal]; | |
| 55 | +} | |
| 56 | +-(void)layoutSubviews | |
| 57 | +{ | |
| 58 | + [super layoutSubviews]; | |
| 59 | + __weak typeof(self) weakSelf = self; | |
| 60 | + [self.inteLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 61 | + make.left.top.mas_equalTo(weakSelf).offset(10); | |
| 62 | + }]; | |
| 63 | + [self.dateButton mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 64 | + make.left.mas_equalTo(weakSelf).offset(10); | |
| 65 | + make.top.mas_equalTo(weakSelf.inteLabel.mas_bottom).offset(30); | |
| 66 | + }]; | |
| 67 | + [self.obtaLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 68 | + make.centerY.mas_equalTo(weakSelf.dateButton); | |
| 69 | + make.right.mas_equalTo(weakSelf.mas_right).offset(-5); | |
| 70 | + }]; | |
| 71 | + [self.spendLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 72 | + make.centerY.mas_equalTo(weakSelf.dateButton); | |
| 73 | + make.right.mas_equalTo(weakSelf.obtaLabel.mas_left).offset(-5); | |
| 74 | + }]; | |
| 75 | +} | |
| 76 | +-(void)pushDateSelectAction:(QMUIButton *)button | |
| 77 | +{ | |
| 78 | + if (self.selectWithDateBlock) self.selectWithDateBlock(); | |
| 79 | +} | |
| 80 | +#pragma mark = | |
| 81 | +- (UILabel *)inteLabel | |
| 82 | +{ | |
| 83 | + if (!_inteLabel) { | |
| 84 | + _inteLabel = [[UILabel alloc] init]; | |
| 85 | + _inteLabel.backgroundColor = [UIColor clearColor]; | |
| 86 | + _inteLabel.textColor = UIColorHex(#FFFFFF); | |
| 87 | + } | |
| 88 | + return _inteLabel; | |
| 89 | +} | |
| 90 | +- (UILabel *)spendLabel | |
| 91 | +{ | |
| 92 | + if (!_spendLabel) { | |
| 93 | + _spendLabel = [[UILabel alloc] init]; | |
| 94 | + _spendLabel.backgroundColor = [UIColor clearColor]; | |
| 95 | + _spendLabel.textColor = UIColorHex(#FFFFFF); | |
| 96 | + } | |
| 97 | + return _spendLabel; | |
| 98 | +} | |
| 99 | +- (UILabel *)obtaLabel | |
| 100 | +{ | |
| 101 | + if (!_obtaLabel) { | |
| 102 | + _obtaLabel = [[UILabel alloc] init]; | |
| 103 | + _obtaLabel.backgroundColor = [UIColor clearColor]; | |
| 104 | + _obtaLabel.textColor = UIColorHex(#FFFFFF); | |
| 105 | + } | |
| 106 | + return _obtaLabel; | |
| 107 | +} | |
| 108 | +-(QMUIButton *)dateButton | |
| 109 | +{ | |
| 110 | + if (!_dateButton) { | |
| 111 | + _dateButton = [[QMUIButton alloc] init]; | |
| 112 | + [_dateButton setImage:[CNLiveCMineService imageWithMineName:@"c_mine_content_date_tira"] forState:UIControlStateNormal]; | |
| 113 | + [_dateButton setTitleColor:UIColorHex(0xFFFFFF) forState:UIControlStateNormal]; | |
| 114 | + _dateButton.titleLabel.font = [UIFont systemFontOfSize:12]; | |
| 115 | + _dateButton.backgroundColor = [UIColor clearColor]; | |
| 116 | + _dateButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; | |
| 117 | + _dateButton.spacingBetweenImageAndTitle = 2.5; | |
| 118 | + _dateButton.imageEdgeInsets = UIEdgeInsetsMake(0, 2.5, 0, 2.5); | |
| 119 | + _dateButton.imagePosition = QMUIButtonImagePositionLeft; | |
| 120 | + [_dateButton addTarget:self action:@selector(pushDateSelectAction:) forControlEvents:UIControlEventTouchUpInside]; | |
| 121 | + } | |
| 122 | + return _dateButton; | |
| 123 | +} | |
| 124 | + | |
| 125 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderCustomView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteHeaderCustomView.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/29. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveCMineInteHeaderCustomView : UIView | |
| 13 | + | |
| 14 | + | |
| 15 | +/// 显示自定义弹框 | |
| 16 | +/// @param currentVC 当前显示控制器 | |
| 17 | +/// @param completerBlock 点击回调 | |
| 18 | ++(void)showHeaderAlertViewWithCurrentVC:(UIViewController *)currentVC CompleterBlock:(void(^)(CNLiveCMineInteHeaderClick headerClick))completerBlock; | |
| 19 | + | |
| 20 | +/// 显示提示框 | |
| 21 | +/// @param scoreIntergal 积分 | |
| 22 | +/// @param statue 状态 | |
| 23 | ++(void)showWithScoreViewForScoreIntergal:(NSString *)scoreIntergal Statue:(BOOL)statue; | |
| 24 | + | |
| 25 | +/// 显示选择样式 | |
| 26 | +/// @param currentVC 当前界面 | |
| 27 | ++(void)showWithSelectMonthDateForCurrentVC:(CNLiveCMineInteDetailViewController *)currentVC; | |
| 28 | + | |
| 29 | + | |
| 30 | +@end | |
| 31 | + | |
| 32 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderCustomView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteHeaderCustomView.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/29. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteHeaderCustomView.h" | |
| 9 | +#import "CNLiveCMineInteViewModel.h" | |
| 10 | +@implementation CNLiveCMineInteHeaderCustomView | |
| 11 | + | |
| 12 | +/// 显示自定义弹框 | |
| 13 | +/// @param currentVC 当前显示控制器 | |
| 14 | +/// @param completerBlock 点击回调 | |
| 15 | ++(void)showHeaderAlertViewWithCurrentVC:(UIViewController *)currentVC CompleterBlock:(void(^)(CNLiveCMineInteHeaderClick))completerBlock | |
| 16 | +{ | |
| 17 | + __block UIView * contentView = [currentVC.view viewWithTag:1000]; | |
| 18 | + if (!contentView) { | |
| 19 | + contentView = [[UIView alloc] initWithFrame:CGRectMake(0, kNavigationBarHeight, kScreenWidth, kScreenHeight - kNavigationBarHeight)]; | |
| 20 | + contentView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.3]; | |
| 21 | + contentView.tag = 1000; | |
| 22 | + contentView.userInteractionEnabled = YES; | |
| 23 | + [currentVC.view addSubview:contentView]; | |
| 24 | + UITapGestureRecognizer * contentTap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { | |
| 25 | + [contentView removeFromSuperview]; | |
| 26 | + }]; | |
| 27 | + [contentView addGestureRecognizer:contentTap]; | |
| 28 | + }else{ | |
| 29 | + [contentView removeFromSuperview]; | |
| 30 | + } | |
| 31 | + UIView * headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 0)]; | |
| 32 | + headerView.backgroundColor = UIColorHex(0xFFE9EA); | |
| 33 | + [contentView addSubview:headerView]; | |
| 34 | + | |
| 35 | + CGFloat itemW = (SCREEN_WIDTH - 45)/2; | |
| 36 | + UIView * tapView01 = [[UIView alloc] initWithFrame:CGRectMake(15, 10, itemW, 30)]; | |
| 37 | + tapView01.backgroundColor = [UIColor whiteColor]; | |
| 38 | + tapView01.layer.cornerRadius = 8; | |
| 39 | + tapView01.layer.masksToBounds = YES; | |
| 40 | + tapView01.userInteractionEnabled = YES; | |
| 41 | + UITapGestureRecognizer * tap01 = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { | |
| 42 | + [contentView removeFromSuperview]; | |
| 43 | + if (completerBlock) completerBlock(CNLiveCMineInteHeaderClickService); | |
| 44 | + }]; | |
| 45 | + [tapView01 addGestureRecognizer:tap01]; | |
| 46 | + | |
| 47 | + QMUIButton * titleButton01 = [[QMUIButton alloc] init]; | |
| 48 | + [titleButton01 setTitle:@"平台客服" forState:UIControlStateNormal]; | |
| 49 | + [titleButton01 setImage:[CNLiveCMineService imageWithMineName:@"c_mine_skip_more"] forState:UIControlStateNormal]; | |
| 50 | + [titleButton01 setTitleColor:UIColorHex(0x481A19) forState:UIControlStateNormal]; | |
| 51 | + titleButton01.titleLabel.font = UIFontCNMake(14); | |
| 52 | + titleButton01.backgroundColor = [UIColor clearColor]; | |
| 53 | + titleButton01.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; | |
| 54 | + titleButton01.spacingBetweenImageAndTitle = 1; | |
| 55 | + titleButton01.userInteractionEnabled = NO; | |
| 56 | + titleButton01.imagePosition = QMUIButtonImagePositionRight; | |
| 57 | + [tapView01 addSubview:titleButton01]; | |
| 58 | + [titleButton01 mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 59 | + make.centerY.mas_equalTo(tapView01); | |
| 60 | + make.height.mas_equalTo(30); | |
| 61 | + make.centerX.mas_equalTo(tapView01).offset(15); | |
| 62 | + }]; | |
| 63 | + | |
| 64 | + UIImageView * iconView01 = [[UIImageView alloc] init]; | |
| 65 | + iconView01.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_header_custom_service"]; | |
| 66 | + [tapView01 addSubview:iconView01]; | |
| 67 | + [iconView01 mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 68 | + make.centerY.mas_equalTo(tapView01); | |
| 69 | + make.size.mas_equalTo(20); | |
| 70 | + make.right.mas_equalTo(titleButton01.mas_left).offset(-5); | |
| 71 | + }]; | |
| 72 | + | |
| 73 | + UIView * tapView02 = [[UIView alloc] initWithFrame:CGRectMake(itemW + 30, 10, itemW, 30)]; | |
| 74 | + tapView02.backgroundColor = [UIColor whiteColor]; | |
| 75 | + tapView02.layer.cornerRadius = 8; | |
| 76 | + tapView02.layer.masksToBounds = YES; | |
| 77 | + tapView02.userInteractionEnabled = YES; | |
| 78 | + UITapGestureRecognizer * tap02 = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { | |
| 79 | + [contentView removeFromSuperview]; | |
| 80 | + if (completerBlock) completerBlock(CNLiveCMineInteHeaderClickRule); | |
| 81 | + }]; | |
| 82 | + [tapView02 addGestureRecognizer:tap02]; | |
| 83 | + | |
| 84 | + QMUIButton * titleButton02 = [[QMUIButton alloc] init]; | |
| 85 | + [titleButton02 setTitle:@"积分规则" forState:UIControlStateNormal]; | |
| 86 | + [titleButton02 setImage:[CNLiveCMineService imageWithMineName:@"c_mine_skip_more"] forState:UIControlStateNormal]; | |
| 87 | + [titleButton02 setTitleColor:UIColorHex(0x481A19) forState:UIControlStateNormal]; | |
| 88 | + titleButton02.titleLabel.font = UIFontCNMake(14); | |
| 89 | + titleButton02.backgroundColor = [UIColor clearColor]; | |
| 90 | + titleButton02.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; | |
| 91 | + titleButton02.spacingBetweenImageAndTitle = 1; | |
| 92 | + titleButton02.userInteractionEnabled = NO; | |
| 93 | + titleButton02.imagePosition = QMUIButtonImagePositionRight; | |
| 94 | + [tapView02 addSubview:titleButton02]; | |
| 95 | + [titleButton02 mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 96 | + make.centerY.mas_equalTo(tapView02); | |
| 97 | + make.centerX.mas_equalTo(tapView02).offset(15); | |
| 98 | + }]; | |
| 99 | + | |
| 100 | + UIImageView * iconView02 = [[UIImageView alloc] init]; | |
| 101 | + iconView02.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_header_rules"]; | |
| 102 | + [tapView02 addSubview:iconView02]; | |
| 103 | + [iconView02 mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 104 | + make.centerY.mas_equalTo(tapView02); | |
| 105 | + make.size.mas_equalTo(20); | |
| 106 | + make.right.mas_equalTo(titleButton02.mas_left).offset(-5); | |
| 107 | + }]; | |
| 108 | + | |
| 109 | + [UIView animateWithDuration:.5 animations:^{ | |
| 110 | + headerView.height = 50; | |
| 111 | + } completion:^(BOOL finished) { | |
| 112 | + if (finished) { | |
| 113 | + [headerView addSubview:tapView01]; | |
| 114 | + [headerView addSubview:tapView02]; | |
| 115 | + } | |
| 116 | + }]; | |
| 117 | +} | |
| 118 | + | |
| 119 | +/// 显示提示框 | |
| 120 | +/// @param scoreIntergal 积分 | |
| 121 | +/// @param statue 状态 | |
| 122 | ++(void)showWithScoreViewForScoreIntergal:(NSString *)scoreIntergal Statue:(BOOL)statue | |
| 123 | +{ | |
| 124 | + UIWindow *window = [UIApplication sharedApplication].keyWindow;; | |
| 125 | + | |
| 126 | + UIView * mainView = [[UIView alloc] init]; | |
| 127 | + mainView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6]; | |
| 128 | + mainView.layer.masksToBounds = YES; | |
| 129 | + mainView.layer.cornerRadius = 10; | |
| 130 | + [window addSubview:mainView]; | |
| 131 | + [mainView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 132 | + make.width.mas_equalTo(160); | |
| 133 | + make.height.mas_equalTo(120); | |
| 134 | + make.center.mas_equalTo(window); | |
| 135 | + }]; | |
| 136 | + | |
| 137 | + UIImageView * imageView = [[UIImageView alloc] init]; | |
| 138 | + imageView.backgroundColor = [UIColor clearColor]; | |
| 139 | + imageView.image = [CNLiveCMineService imageWithMineName:statue ? @"c_mine_content_task_inte_success" : @"c_mine_content_task_inte_fail"]; | |
| 140 | + imageView.contentMode = UIViewContentModeScaleAspectFit; | |
| 141 | + [mainView addSubview:imageView]; | |
| 142 | + [imageView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 143 | + make.centerX.mas_equalTo(mainView); | |
| 144 | + make.top.mas_equalTo(20); | |
| 145 | + make.width.mas_equalTo(45); | |
| 146 | + make.height.mas_equalTo(35); | |
| 147 | + }]; | |
| 148 | + | |
| 149 | + UILabel * nameLabel = [[UILabel alloc] init]; | |
| 150 | + nameLabel.text = statue ? [NSString stringWithFormat:@"+%@积分",scoreIntergal] : @""; | |
| 151 | + nameLabel.textColor = kWhiteColor; | |
| 152 | + nameLabel.font = [UIFont systemFontOfSize:16]; | |
| 153 | + nameLabel.font = [UIFont boldSystemFontOfSize:16]; | |
| 154 | + nameLabel.textAlignment = NSTextAlignmentCenter; | |
| 155 | + [mainView addSubview:nameLabel]; | |
| 156 | + [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 157 | + make.centerX.mas_equalTo(mainView); | |
| 158 | + make.top.mas_equalTo(imageView.mas_bottom).offset(10); | |
| 159 | + }]; | |
| 160 | + | |
| 161 | + | |
| 162 | + UILabel * stateLabel = [[UILabel alloc] init]; | |
| 163 | + stateLabel.text = statue ? @"签到成功" : @"签到失败"; | |
| 164 | + stateLabel.textColor = kWhiteColor; | |
| 165 | + stateLabel.font = [UIFont systemFontOfSize:13]; | |
| 166 | + stateLabel.font = [UIFont boldSystemFontOfSize:13]; | |
| 167 | + stateLabel.textAlignment = NSTextAlignmentCenter; | |
| 168 | + [mainView addSubview:stateLabel]; | |
| 169 | + [stateLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 170 | + make.centerX.mas_equalTo(mainView); | |
| 171 | + make.top.mas_equalTo(nameLabel.mas_bottom).offset(10); | |
| 172 | + }]; | |
| 173 | + | |
| 174 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
| 175 | + [mainView removeFromSuperview]; | |
| 176 | + }); | |
| 177 | +} | |
| 178 | + | |
| 179 | +/// 显示选择样式 | |
| 180 | +/// @param currentVC 当前界面 | |
| 181 | ++(void)showWithSelectMonthDateForCurrentVC:(CNLiveCMineInteDetailViewController *)currentVC | |
| 182 | +{ | |
| 183 | + PGDatePickManager *datePickManager = [[PGDatePickManager alloc] init]; | |
| 184 | + datePickManager.style = PGDatePickManagerStyleSheet; | |
| 185 | + datePickManager.isShadeBackground = true; | |
| 186 | + datePickManager.cancelButtonTextColor = RGB(136, 136, 136); | |
| 187 | + datePickManager.confirmButtonTextColor = RGB(33, 188, 35); | |
| 188 | + PGDatePicker *datePicker = datePickManager.datePicker; | |
| 189 | + datePicker.isHiddenMiddleText = false; | |
| 190 | + datePicker.delegate = currentVC; | |
| 191 | + datePicker.datePickerType = PGDatePickerTypeLine; | |
| 192 | + datePicker.datePickerMode = PGDatePickerModeYearAndMonth; | |
| 193 | + datePicker.lineBackgroundColor = RGB(232, 232, 232); | |
| 194 | + datePicker.textColorOfSelectedRow = KBlack51Color; | |
| 195 | + datePicker.textColorOfOtherRow = RGB(169, 169, 169); | |
| 196 | + | |
| 197 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; | |
| 198 | + dateFormatter.dateFormat = @"yyyy-MM"; | |
| 199 | + //获取当前时间日期 | |
| 200 | + NSString *dateStr = [dateFormatter stringFromDate:[NSDate date]]; | |
| 201 | + datePicker.minimumDate = [dateFormatter dateFromString: @"2017-01"]; | |
| 202 | + datePicker.maximumDate = [dateFormatter dateFromString: dateStr]; | |
| 203 | + [currentVC presentViewController:datePickManager animated:false completion:nil]; | |
| 204 | +} | |
| 205 | + | |
| 206 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderSignView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteHeaderSignView.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/28. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +#import "CNLiveCMineInteModel.h" | |
| 10 | +#import "CNLiveCMineInteViewModel.h" | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | +@interface CNLiveCMineInteHeaderSignView : UIView | |
| 14 | + | |
| 15 | +/// 数据进行赋值 | |
| 16 | +/// @param scoreModel 签到数据 | |
| 17 | +/// @param taskModel 任务数据 | |
| 18 | +/// @param announModel 公告数据 | |
| 19 | +-(void)setupWithScoreModel:(CNLiveCMineInteScoreModel *)scoreModel | |
| 20 | + taskModel:(CNLiveCMineInteTaskListModel *)taskModel | |
| 21 | + announModel:(CNLiveCMineInteListModel *)announModel; | |
| 22 | + | |
| 23 | +/// 对点击结果进行响应 | |
| 24 | +@property (nonatomic, copy) ClickActionBlock clickActionBlock; | |
| 25 | + | |
| 26 | +@end | |
| 27 | + | |
| 28 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderSignView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteHeaderSignView.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/28. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteHeaderSignView.h" | |
| 9 | + | |
| 10 | +@interface CNLiveCMineInteHeaderSignView() | |
| 11 | +@property (nonatomic, strong) CNLiveCMineInteScoreModel * scoreModel; //签到数据 | |
| 12 | +@property (nonatomic, strong) CNLiveCMineInteTaskListModel * taskModel;//任务列表及积分数据 | |
| 13 | +@property (nonatomic, strong) CNLiveCMineInteListModel * announModel; //公告数据 | |
| 14 | +@property (nonatomic, strong) CNLiveCMineInteListModel * activModel; //活动数据 | |
| 15 | + | |
| 16 | +@property (nonatomic, strong) UIView * topView; | |
| 17 | +@property (nonatomic, strong) CAShapeLayer *topMaskLayer; | |
| 18 | +@property (nonatomic, strong) CAGradientLayer *topGradientLayer; | |
| 19 | +@property (nonatomic, strong) UILabel * nameLabel;// | |
| 20 | +@property (nonatomic, strong) UIView * bottemView; | |
| 21 | +@property (nonatomic, strong) QMUIMarqueeLabel * annouLabel;//公告label | |
| 22 | +@property (nonatomic, strong) UIImageView * iconView; | |
| 23 | +@property (nonatomic, strong) UIImageView * moreView; | |
| 24 | +@property (nonatomic, strong) UIButton * clearButton; | |
| 25 | + | |
| 26 | +@property (nonatomic, strong) UILabel * titleLabel; | |
| 27 | +@property (nonatomic, strong) NSMutableArray * coinsViews; | |
| 28 | +@property (nonatomic, strong) NSMutableArray * numberViews; | |
| 29 | +@end | |
| 30 | + | |
| 31 | +@implementation CNLiveCMineInteHeaderSignView | |
| 32 | + | |
| 33 | +- (instancetype)init | |
| 34 | +{ | |
| 35 | + self = [super init]; | |
| 36 | + if (self) { | |
| 37 | + self.coinsViews = [[NSMutableArray alloc] init]; | |
| 38 | + self.numberViews = [[NSMutableArray alloc] init]; | |
| 39 | + [self addSubview:self.bottemView]; | |
| 40 | + [self addSubview:self.topView]; | |
| 41 | + [self addSubview:self.titleLabel]; | |
| 42 | + [self.topView addSubview:self.nameLabel]; | |
| 43 | + | |
| 44 | + [self.bottemView addSubview:self.annouLabel]; | |
| 45 | + [self.bottemView addSubview:self.iconView]; | |
| 46 | + [self.bottemView addSubview:self.moreView]; | |
| 47 | + [self.bottemView addSubview:self.clearButton]; | |
| 48 | + [self setupWithCoinsVeiw]; | |
| 49 | + } | |
| 50 | + return self; | |
| 51 | +} | |
| 52 | +-(void)setupWithCoinsVeiw | |
| 53 | +{ | |
| 54 | + UIView * coinsView = [[UIView alloc] initWithFrame:CGRectMake(5, 40, SCREEN_WIDTH - 30, 70)]; | |
| 55 | + coinsView.backgroundColor = [UIColor clearColor]; | |
| 56 | + [self.topView addSubview:coinsView]; | |
| 57 | + | |
| 58 | + CGFloat item_w = (SCREEN_WIDTH - 60)/7; | |
| 59 | + for (int i = 0; i < 7; i++) { | |
| 60 | + UIView * temp_v = [[UIView alloc] initWithFrame:CGRectMake(i * (item_w + 5), 0, item_w, 70)]; | |
| 61 | + temp_v.backgroundColor = [UIColor clearColor]; | |
| 62 | + [coinsView addSubview:temp_v]; | |
| 63 | + | |
| 64 | + UIImageView * coinsV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, item_w, 50)]; | |
| 65 | + coinsV.image = [UIImage imageWithColor:[UIColor colorWithWhite:0 alpha:0.3]]; | |
| 66 | + coinsV.layer.masksToBounds = YES; | |
| 67 | + coinsV.layer.cornerRadius = 5; | |
| 68 | + [temp_v addSubview:coinsV]; | |
| 69 | + [self.coinsViews addObject:coinsV]; | |
| 70 | + | |
| 71 | + UIImageView * coins = [[UIImageView alloc] initWithFrame:CGRectMake((item_w - 30)/2, 5, 30, 30)]; | |
| 72 | + coins.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_gold_coins"]; | |
| 73 | + coins.backgroundColor = [UIColor clearColor]; | |
| 74 | + [coinsV addSubview:coins]; | |
| 75 | + | |
| 76 | + UILabel * numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 30, item_w, 20)]; | |
| 77 | + numberLabel.backgroundColor = [UIColor clearColor]; | |
| 78 | + numberLabel.textColor = [UIColor whiteColor]; | |
| 79 | + numberLabel.textAlignment = NSTextAlignmentCenter; | |
| 80 | + numberLabel.font = [UIFont systemFontOfSize:10]; | |
| 81 | + [coinsV addSubview:numberLabel]; | |
| 82 | + [self.numberViews addObject:numberLabel]; | |
| 83 | + | |
| 84 | + UILabel * dayLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 50, item_w, 20)]; | |
| 85 | + dayLabel.backgroundColor = [UIColor clearColor]; | |
| 86 | + dayLabel.textColor = [UIColor whiteColor]; | |
| 87 | + dayLabel.textAlignment = NSTextAlignmentCenter; | |
| 88 | + dayLabel.font = [UIFont systemFontOfSize:14]; | |
| 89 | + dayLabel.text = [NSString stringWithFormat:@"%d天",i+1]; | |
| 90 | + [temp_v addSubview:dayLabel]; | |
| 91 | + } | |
| 92 | +} | |
| 93 | +-(void)layoutSubviews | |
| 94 | +{ | |
| 95 | + [super layoutSubviews]; | |
| 96 | + __weak typeof(self) weakSelf = self; | |
| 97 | + [self.topView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 98 | + make.top.left.right.mas_equalTo(weakSelf); | |
| 99 | + make.bottom.mas_equalTo(weakSelf).offset(-40); | |
| 100 | + }]; | |
| 101 | + [self.bottemView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 102 | + make.top.mas_equalTo(weakSelf.topView.mas_bottom).offset(-15); | |
| 103 | + make.left.right.mas_equalTo(weakSelf); | |
| 104 | + make.bottom.mas_equalTo(weakSelf); | |
| 105 | + }]; | |
| 106 | + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 107 | + make.top.mas_equalTo(weakSelf.bottemView.mas_bottom).offset(10); | |
| 108 | + make.left.mas_equalTo(weakSelf.mas_left); | |
| 109 | + }]; | |
| 110 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 111 | + make.top.left.mas_equalTo(weakSelf).offset(15); | |
| 112 | + }]; | |
| 113 | + [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 114 | + make.centerY.mas_equalTo(weakSelf.bottemView).offset(5); | |
| 115 | + make.left.mas_equalTo(weakSelf.bottemView.mas_left).offset(30); | |
| 116 | + }]; | |
| 117 | + [self.moreView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 118 | + make.centerY.mas_equalTo(weakSelf.iconView); | |
| 119 | + make.right.mas_equalTo(weakSelf.bottemView.mas_right).offset(-20); | |
| 120 | + }]; | |
| 121 | + [self.annouLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 122 | + make.centerY.mas_equalTo(weakSelf.iconView); | |
| 123 | + make.left.mas_equalTo(weakSelf.iconView.mas_right).offset(20); | |
| 124 | + make.right.mas_equalTo(weakSelf.moreView.mas_left).offset(-10); | |
| 125 | + }]; | |
| 126 | + [self.clearButton mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 127 | + make.edges.mas_equalTo(weakSelf.bottemView); | |
| 128 | + }]; | |
| 129 | + self.topMaskLayer.frame = self.topView.bounds; | |
| 130 | + self.topGradientLayer.frame = self.topView.frame; | |
| 131 | +} | |
| 132 | + | |
| 133 | +/// 数据进行赋值 | |
| 134 | +/// @param scoreModel 签到数据 | |
| 135 | +/// @param taskModel 任务数据 | |
| 136 | +/// @param announModel 公告数据 | |
| 137 | +-(void)setupWithScoreModel:(CNLiveCMineInteScoreModel *)scoreModel | |
| 138 | + taskModel:(CNLiveCMineInteTaskListModel *)taskModel | |
| 139 | + announModel:(CNLiveCMineInteListModel *)announModel | |
| 140 | +{ | |
| 141 | + _scoreModel = scoreModel; | |
| 142 | + _taskModel = taskModel; | |
| 143 | + _announModel = announModel; | |
| 144 | + NSArray * array = [scoreModel.scores.firstObject componentsSeparatedByString:@","]; | |
| 145 | + NSInteger index = [array indexOfObject:scoreModel.score]; | |
| 146 | + for (int i = 0; i < self.numberViews.count; i++) { | |
| 147 | + UILabel * numberLabel = self.numberViews[i]; | |
| 148 | + UIImageView * coinsV = self.coinsViews[i]; | |
| 149 | + numberLabel.text = [NSString stringWithFormat:@"+%@",array.count >= self.numberViews.count ? array[i] : @""]; | |
| 150 | + numberLabel.textColor = index >= i ? [UIColor blackColor] : [UIColor whiteColor]; | |
| 151 | + coinsV.image = index >= i ? [CNLiveCMineService imageWithMineName:@"c_mine_content_gold_select"] : [UIImage imageWithColor:[UIColor colorWithWhite:0 alpha:0.3]]; | |
| 152 | + } | |
| 153 | + self.nameLabel.text = [NSString stringWithFormat:@"已连续签到 %ld天",index + 1]; | |
| 154 | + | |
| 155 | + self.bottemView.hidden = announModel.list.count == 0; | |
| 156 | + self.iconView.hidden = announModel.list.count == 0; | |
| 157 | + self.moreView.hidden = announModel.list.count == 0; | |
| 158 | + self.annouLabel.hidden = announModel.list.count == 0; | |
| 159 | + if (announModel.list.count > 0) { | |
| 160 | + NSMutableArray * listArray = announModel.list.mutableCopy; | |
| 161 | + NSArray * tempArray = announModel.list.count > 5 ? [listArray subarrayWithRange:NSMakeRange(0, 4)] : listArray; | |
| 162 | + NSMutableString * tempString = [[NSMutableString alloc] init]; | |
| 163 | + for (CNLiveCMineInteListSubModel * subModel in tempArray) { | |
| 164 | + [tempString appendFormat:@"%@ ",subModel.title]; | |
| 165 | + } | |
| 166 | + self.annouLabel.text = tempString; | |
| 167 | + } | |
| 168 | +} | |
| 169 | +-(void)pushAnnouMedthod:(UIButton *)button | |
| 170 | +{ | |
| 171 | + if (self.clickActionBlock) self.clickActionBlock(self.scoreModel, self.taskModel, self.announModel,CNLiveCMineInteHeaderClickAnnotation); | |
| 172 | +} | |
| 173 | +#pragma mark = | |
| 174 | +-(UILabel *)titleLabel | |
| 175 | +{ | |
| 176 | + if (!_titleLabel) { | |
| 177 | + _titleLabel = [[UILabel alloc] init]; | |
| 178 | + _titleLabel.textColor = [UIColor blackColor]; | |
| 179 | + _titleLabel.font = UIFontCNMake(15); | |
| 180 | + _titleLabel.font = UIFontBoldCNMake(15); | |
| 181 | + _titleLabel.text = @"积分乐园"; | |
| 182 | + } | |
| 183 | + return _titleLabel; | |
| 184 | +} | |
| 185 | +-(UILabel *)nameLabel | |
| 186 | +{ | |
| 187 | + if (!_nameLabel) { | |
| 188 | + _nameLabel = [[UILabel alloc] init]; | |
| 189 | + _nameLabel.textColor = [UIColor whiteColor]; | |
| 190 | + _nameLabel.font = UIFontCNMake(15); | |
| 191 | + _nameLabel.font = UIFontBoldCNMake(15); | |
| 192 | + } | |
| 193 | + return _nameLabel; | |
| 194 | +} | |
| 195 | +-(UIButton *)clearButton | |
| 196 | +{ | |
| 197 | + if (!_clearButton) { | |
| 198 | + _clearButton = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 199 | + _clearButton.backgroundColor = [UIColor clearColor]; | |
| 200 | + [_clearButton addTarget:self action:@selector(pushAnnouMedthod:) forControlEvents:UIControlEventTouchUpInside]; | |
| 201 | + } | |
| 202 | + return _clearButton; | |
| 203 | +} | |
| 204 | +-(QMUIMarqueeLabel *)annouLabel | |
| 205 | +{ | |
| 206 | + if (!_annouLabel) { | |
| 207 | + _annouLabel = [[QMUIMarqueeLabel alloc] qmui_initWithFont:[UIFont fontWithName:@"PingFangSC-Medium" size:13] textColor:UIColorHex(666666)]; | |
| 208 | + _annouLabel.textAlignment = NSTextAlignmentCenter; | |
| 209 | + _annouLabel.automaticallyValidateVisibleFrame = NO; | |
| 210 | + [_annouLabel qmui_calculateHeightAfterSetAppearance]; | |
| 211 | + _annouLabel.shouldFadeAtEdge = YES; | |
| 212 | + _annouLabel.backgroundColor = kWhiteColor; | |
| 213 | + _annouLabel.fadeWidthPercent = 0.1; | |
| 214 | + _annouLabel.pauseDurationWhenMoveToEdge = 0; | |
| 215 | + _annouLabel.speed = 1;// 调节滚动速度 | |
| 216 | + } | |
| 217 | + return _annouLabel; | |
| 218 | +} | |
| 219 | +-(UIImageView *)iconView | |
| 220 | +{ | |
| 221 | + if (!_iconView) { | |
| 222 | + _iconView = [[UIImageView alloc] initWithFrame:CGRectZero]; | |
| 223 | + _iconView.contentMode = UIViewContentModeScaleAspectFill; | |
| 224 | + _iconView.backgroundColor = [UIColor whiteColor]; | |
| 225 | + _iconView.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_announ"]; | |
| 226 | + } | |
| 227 | + return _iconView; | |
| 228 | +} | |
| 229 | +-(UIImageView *)moreView | |
| 230 | +{ | |
| 231 | + if (!_moreView) { | |
| 232 | + _moreView = [[UIImageView alloc] initWithFrame:CGRectZero]; | |
| 233 | + _moreView.contentMode = UIViewContentModeScaleAspectFill; | |
| 234 | + _moreView.backgroundColor = [UIColor whiteColor]; | |
| 235 | + _moreView.image = [CNLiveCMineService imageWithMineName:@"c_mine_skip_more"]; | |
| 236 | + } | |
| 237 | + return _moreView; | |
| 238 | +} | |
| 239 | +- (UIView *)topView | |
| 240 | +{ | |
| 241 | + if (!_topView) { | |
| 242 | + _topView = [[UIView alloc] init]; | |
| 243 | + _topView.backgroundColor = [UIColor whiteColor]; | |
| 244 | + | |
| 245 | + CAGradientLayer *topGradientLayer = [CAGradientLayer layer]; | |
| 246 | + topGradientLayer.colors = @[(__bridge id)UIColorHex(0xfe7b72).CGColor, (__bridge id)UIColorHex(0xf85948).CGColor]; | |
| 247 | + topGradientLayer.locations = @[@0.5, @1.0]; | |
| 248 | + topGradientLayer.startPoint = CGPointMake(0, 0); | |
| 249 | + topGradientLayer.endPoint = CGPointMake(1.0, 0); | |
| 250 | + [_topView.layer addSublayer:topGradientLayer]; | |
| 251 | + _topGradientLayer = topGradientLayer; | |
| 252 | + | |
| 253 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 110) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)]; | |
| 254 | + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | |
| 255 | + maskLayer.path = maskPath.CGPath; | |
| 256 | + _topView.layer.mask = maskLayer; | |
| 257 | + _topMaskLayer = maskLayer; | |
| 258 | + } | |
| 259 | + return _topView; | |
| 260 | +} | |
| 261 | +-(UIView *)bottemView | |
| 262 | +{ | |
| 263 | + if (!_bottemView) { | |
| 264 | + _bottemView = [[UIView alloc] init]; | |
| 265 | + _bottemView.backgroundColor = [UIColor whiteColor]; | |
| 266 | + _bottemView.layer.cornerRadius = 12; | |
| 267 | + _bottemView.layer.masksToBounds = YES;//超出父视图部分不显示。 | |
| 268 | + _bottemView.layer.borderColor = UIColorMakeWithRGBA(234, 7, 15, 0.3).CGColor; | |
| 269 | + _bottemView.layer.borderWidth = 0.5; | |
| 270 | + } | |
| 271 | + return _bottemView; | |
| 272 | +} | |
| 273 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteHeaderView.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/27. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +#import "CNLiveCMineInteModel.h" | |
| 10 | +#import "CNLiveCMineInteViewModel.h" | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | +@interface CNLiveCMineInteHeaderView : UICollectionReusableView | |
| 14 | + | |
| 15 | +/// 对headerView的数据进行赋值 | |
| 16 | +/// @param scoreModel 签到数据 | |
| 17 | +/// @param taskModel 任务数据 | |
| 18 | +/// @param announModel 公告数据 | |
| 19 | +-(void)setupWithScoreModel:(CNLiveCMineInteScoreModel *)scoreModel | |
| 20 | + taskModel:(CNLiveCMineInteTaskListModel *)taskModel | |
| 21 | + announModel:(CNLiveCMineInteListModel *)announModel; | |
| 22 | + | |
| 23 | +/// 对点击结果进行响应 | |
| 24 | +@property (nonatomic, copy) ClickActionBlock clickActionBlock; | |
| 25 | + | |
| 26 | +@end | |
| 27 | + | |
| 28 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteHeaderView.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/27. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteHeaderView.h" | |
| 9 | +#import "CNLiveCMineInteHeaderSignView.h" | |
| 10 | +#import "CNLiveCMineHeader.h" | |
| 11 | +@interface CNLiveCMineInteHeaderView() | |
| 12 | +@property (nonatomic, strong) QMUIButton * detailBtn; | |
| 13 | +@property (nonatomic, strong) UILabel * inteLabel; | |
| 14 | +@property (nonatomic, strong) UIButton * pushMallBtn; | |
| 15 | +@property (nonatomic, strong) CNLiveCMineInteHeaderSignView * signView; | |
| 16 | + | |
| 17 | +@property (nonatomic, strong) CNLiveCMineInteScoreModel * scoreModel; //签到数据 | |
| 18 | +@property (nonatomic, strong) CNLiveCMineInteTaskListModel * taskModel;//任务列表及积分数据 | |
| 19 | +@property (nonatomic, strong) CNLiveCMineInteListModel * announModel; //公告数据 | |
| 20 | +@property (nonatomic, strong) CNLiveCMineInteListModel * activModel; //活动数据 | |
| 21 | +@end | |
| 22 | + | |
| 23 | +@implementation CNLiveCMineInteHeaderView | |
| 24 | + | |
| 25 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 26 | +{ | |
| 27 | + self = [super initWithFrame:frame]; | |
| 28 | + if (self) { | |
| 29 | + [self addSubview:self.detailBtn]; | |
| 30 | + [self addSubview:self.inteLabel]; | |
| 31 | + [self addSubview:self.pushMallBtn]; | |
| 32 | + [self addSubview:self.signView]; | |
| 33 | + } | |
| 34 | + return self; | |
| 35 | +} | |
| 36 | +-(void)layoutSubviews | |
| 37 | +{ | |
| 38 | + [super layoutSubviews]; | |
| 39 | + __weak typeof(self) weakSelf = self; | |
| 40 | + [self.detailBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 41 | + make.top.mas_equalTo(weakSelf).offset(10); | |
| 42 | + make.left.mas_equalTo(weakSelf).offset(15); | |
| 43 | + make.width.mas_equalTo(100); | |
| 44 | + make.height.mas_equalTo(25); | |
| 45 | + }]; | |
| 46 | + [self.inteLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 47 | + make.top.mas_equalTo(weakSelf.detailBtn.mas_bottom).offset(5); | |
| 48 | + make.left.mas_equalTo(weakSelf).offset(15); | |
| 49 | + }]; | |
| 50 | + [self.pushMallBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 51 | + make.bottom.mas_equalTo(weakSelf.inteLabel.mas_bottom).offset(-5); | |
| 52 | + make.right.mas_equalTo(weakSelf); | |
| 53 | + }]; | |
| 54 | + [self.signView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 55 | + make.left.mas_equalTo(weakSelf).offset(10); | |
| 56 | + make.right.mas_equalTo(weakSelf).offset(-10); | |
| 57 | + make.top.mas_equalTo(weakSelf.inteLabel.mas_bottom).offset(15); | |
| 58 | + make.height.mas_equalTo(150); | |
| 59 | + }]; | |
| 60 | +} | |
| 61 | +-(void)pushMallAction:(UIButton *)btn | |
| 62 | +{ | |
| 63 | + if (self.clickActionBlock) self.clickActionBlock(self.scoreModel, self.taskModel, self.announModel,CNLiveCMineInteHeaderClickMall); | |
| 64 | +} | |
| 65 | +-(void)pushScoreDetailAction:(UIButton *)btn | |
| 66 | +{ | |
| 67 | + if (self.clickActionBlock) self.clickActionBlock(self.scoreModel, self.taskModel, self.announModel,CNLiveCMineInteHeaderClickDetail); | |
| 68 | +} | |
| 69 | +#pragma mark = | |
| 70 | +/// 对headerView的数据进行赋值 | |
| 71 | +/// @param scoreModel 签到数据 | |
| 72 | +/// @param taskModel 任务数据 | |
| 73 | +/// @param announModel 公告数据 | |
| 74 | +-(void)setupWithScoreModel:(CNLiveCMineInteScoreModel *)scoreModel | |
| 75 | + taskModel:(CNLiveCMineInteTaskListModel *)taskModel | |
| 76 | + announModel:(CNLiveCMineInteListModel *)announModel | |
| 77 | +{ | |
| 78 | + _scoreModel = scoreModel; | |
| 79 | + _taskModel = taskModel; | |
| 80 | + _announModel = announModel; | |
| 81 | + [self.signView setupWithScoreModel:scoreModel taskModel:taskModel announModel:announModel]; | |
| 82 | + NSMutableAttributedString * coin_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@积分",[taskModel.integral isNotBlank]?taskModel.integral:@"0"]]; | |
| 83 | + [coin_string addAttribute:NSFontAttributeName value:UIFontCNMake(12) range:[coin_string.string rangeOfString:@"积分"]]; | |
| 84 | + [coin_string addAttribute:NSFontAttributeName value:UIFontBoldCNMake(30) range:NSMakeRange(0, [coin_string.string rangeOfString:@"积分"].location)]; | |
| 85 | + self.inteLabel.attributedText = coin_string; | |
| 86 | +} | |
| 87 | +#pragma mark = | |
| 88 | +-(CNLiveCMineInteHeaderSignView *)signView | |
| 89 | +{ | |
| 90 | + if (!_signView) { | |
| 91 | + __weak typeof(self) weakSelf = self; | |
| 92 | + _signView = [[CNLiveCMineInteHeaderSignView alloc] init]; | |
| 93 | + _signView.backgroundColor = [UIColor clearColor]; | |
| 94 | + _signView.clickActionBlock = ^(CNLiveCMineInteScoreModel * _Nonnull scoreModel, CNLiveCMineInteTaskListModel * _Nonnull taskModel, CNLiveCMineInteListModel * _Nonnull announModel, CNLiveCMineInteHeaderClick headerClick) { | |
| 95 | + if (weakSelf.clickActionBlock) weakSelf.clickActionBlock(scoreModel, taskModel, announModel, headerClick); | |
| 96 | + }; | |
| 97 | + } | |
| 98 | + return _signView; | |
| 99 | +} | |
| 100 | +-(UIButton *)pushMallBtn | |
| 101 | +{ | |
| 102 | + if (!_pushMallBtn) { | |
| 103 | + _pushMallBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 104 | + _pushMallBtn.backgroundColor = [UIColor clearColor]; | |
| 105 | + [_pushMallBtn setImage:[CNLiveCMineService imageWithMineName:@"c_mine_skip_push_mall"] forState:UIControlStateNormal]; | |
| 106 | + [_pushMallBtn addTarget:self action:@selector(pushMallAction:) forControlEvents:UIControlEventTouchUpInside]; | |
| 107 | + } | |
| 108 | + return _pushMallBtn; | |
| 109 | +} | |
| 110 | +-(QMUIButton *)detailBtn | |
| 111 | +{ | |
| 112 | + if (!_detailBtn) { | |
| 113 | + _detailBtn = [[QMUIButton alloc] init]; | |
| 114 | + [_detailBtn setTitle:@"积分明细" forState:UIControlStateNormal]; | |
| 115 | + [_detailBtn setImage:[CNLiveCMineService imageWithMineName:@"c_mine_skip_inte_detail"] forState:UIControlStateNormal]; | |
| 116 | + [_detailBtn setTitleColor:UIColorHex(0x481A19) forState:UIControlStateNormal]; | |
| 117 | + _detailBtn.titleLabel.font = UIFontCNMake(14); | |
| 118 | + _detailBtn.backgroundColor = [UIColor clearColor]; | |
| 119 | + _detailBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; | |
| 120 | + _detailBtn.spacingBetweenImageAndTitle = 1; | |
| 121 | + _detailBtn.imagePosition = QMUIButtonImagePositionRight; | |
| 122 | + [_detailBtn addTarget:self action:@selector(pushScoreDetailAction:) forControlEvents:UIControlEventTouchUpInside]; | |
| 123 | + } | |
| 124 | + return _detailBtn; | |
| 125 | +} | |
| 126 | +- (UILabel *)inteLabel | |
| 127 | +{ | |
| 128 | + if (!_inteLabel) { | |
| 129 | + _inteLabel = [[UILabel alloc] init]; | |
| 130 | + _inteLabel.backgroundColor = [UIColor clearColor]; | |
| 131 | + _inteLabel.textColor = UIColorHex(0x481A19); | |
| 132 | + } | |
| 133 | + return _inteLabel; | |
| 134 | +} | |
| 135 | +@end | ... | ... |
CNLiveCMineModule/Classes/inte/ViewModel/CNLiveCMineInteViewModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteViewModel.h | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/27. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import "CNLiveCMineInteModel.h" | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | + | |
| 13 | +typedef enum : NSUInteger { | |
| 14 | + CNLiveCMineInteHeaderClickDetail = 1,//积分明细 | |
| 15 | + CNLiveCMineInteHeaderClickService,//平台客服 | |
| 16 | + CNLiveCMineInteHeaderClickRule,//积分规则 | |
| 17 | + CNLiveCMineInteHeaderClickAnnotation,//公告 | |
| 18 | + CNLiveCMineInteHeaderClickMall,//积分商城 | |
| 19 | +} CNLiveCMineInteHeaderClick; | |
| 20 | + | |
| 21 | +typedef enum : NSUInteger { | |
| 22 | + CNLiveCMineIntePushWebViewStatueMall,//商城 调主工程 | |
| 23 | + CNLiveCMineIntePushWebViewStatueRule,//积分规则 调主工程 | |
| 24 | + CNLiveCMineIntePushWebViewStatueTask,//积分乐园 调主工程 | |
| 25 | + CNLiveCMineIntePushWebViewStatueExchange,//积分兑换 调主工程 | |
| 26 | + CNLiveCMineIntePushWebViewStatueAnnotationDetail,//公告详情页 调主工程 | |
| 27 | +} CNLiveCMineIntePushWebViewStatue; | |
| 28 | + | |
| 29 | +typedef void(^ClickActionBlock)(CNLiveCMineInteScoreModel * scoreModel, | |
| 30 | + CNLiveCMineInteTaskListModel* taskModel, | |
| 31 | + CNLiveCMineInteListModel * announModel, | |
| 32 | + CNLiveCMineInteHeaderClick headerClick); | |
| 33 | + | |
| 34 | +@interface CNLiveCMineInteViewModel : NSObject | |
| 35 | + | |
| 36 | +/// 请求获取我的积分页面四个接口 | |
| 37 | +/// @param completerBlock 请求结果返回 | |
| 38 | ++(void)requestWithIntegraTaskWithSignMedthodForCompleterBlock:(void(^)(NSMutableArray * dataArray, NSString * errorMessage))completerBlock; | |
| 39 | + | |
| 40 | + | |
| 41 | +/// 获取积分明细(新) | |
| 42 | +/// @param currentMonth 时间格式 2021-12 | |
| 43 | +/// @param currentType 1-全部 2-获取 3-支出 | |
| 44 | +/// @param pageNo 页码(默认1) | |
| 45 | +/// @param completerBlock 结果返回 | |
| 46 | ++(void)requestWithIntegraDetailWithCurrentMonth:(NSString *)currentMonth currentType:(NSInteger)currentType pageNo:(NSInteger)pageNo CompleterBlock:(void(^)(CNLiveCMineInteDetailModel * listModel))completerBlock; | |
| 47 | + | |
| 48 | +@end | |
| 49 | + | |
| 50 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/ViewModel/CNLiveCMineInteViewModel.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineInteViewModel.m | |
| 3 | +// CNLiveCMineModule | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/27. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveCMineInteViewModel.h" | |
| 9 | +#import "CNLiveCMineInteHeaderCustomView.h" | |
| 10 | +@implementation CNLiveCMineInteViewModel | |
| 11 | + | |
| 12 | ++(void)requestWithIntegraTaskWithSignMedthodForCompleterBlock:(void (^)(NSMutableArray * , NSString *))completerBlock | |
| 13 | +{ | |
| 14 | + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainUMengStatisticaMedthod]; | |
| 15 | + NSDictionary * param = @{ | |
| 16 | + @"sid":[CNUserInfoManager manager].userInfoModel.uid | |
| 17 | + }; | |
| 18 | + | |
| 19 | + NSDictionary * param01 = @{ | |
| 20 | + @"channelId":@"21", | |
| 21 | + @"modelId":@"", | |
| 22 | + @"page":@"1", | |
| 23 | + @"pageSize":@"10" | |
| 24 | + }; | |
| 25 | + | |
| 26 | + NSDictionary * param02 = @{ | |
| 27 | + @"blockId":@"21", | |
| 28 | + @"userId":[CNUserInfoManager manager].userInfoModel.uid, | |
| 29 | + @"type":@"", | |
| 30 | + @"page":@"1", | |
| 31 | + @"pageSize":@"10" | |
| 32 | + }; | |
| 33 | + | |
| 34 | + __block CNLiveNetworking * signInNetworking = [CNLiveNetworking createBatchOrChainNetworkWithMethod:CNLiveRequestMethodPOST URLString:cn_API_Host(@"/Daren/integral/checkIn.action") Param:param]; | |
| 35 | + signInNetworking.tag = 1000; | |
| 36 | + signInNetworking.isShowDataResult = YES; | |
| 37 | + signInNetworking.allowRequestDefaultArgument = YES; | |
| 38 | + signInNetworking.resultResponseAsynchronously = NO; | |
| 39 | + | |
| 40 | + __block CNLiveNetworking * inteGetNetworking = [CNLiveNetworking createBatchOrChainNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Host(@"/Daren/integral/getTasks.action") Param:param]; | |
| 41 | + inteGetNetworking.tag = 1001; | |
| 42 | + inteGetNetworking.isShowDataResult = YES; | |
| 43 | + inteGetNetworking.allowRequestDefaultArgument = YES; | |
| 44 | + inteGetNetworking.resultResponseAsynchronously = NO; | |
| 45 | + | |
| 46 | + __block CNLiveNetworking * spListNetworking = [CNLiveNetworking createBatchOrChainNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/contentApi/getList") Param:param01]; | |
| 47 | + spListNetworking.tag = 1002; | |
| 48 | + spListNetworking.isShowDataResult = YES; | |
| 49 | + spListNetworking.allowRequestDefaultArgument = YES; | |
| 50 | + spListNetworking.resultResponseAsynchronously = NO; | |
| 51 | + | |
| 52 | + __block CNLiveNetworking * blockNetworking = [CNLiveNetworking createBatchOrChainNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/contentApi/getBlockContents") Param:param02]; | |
| 53 | + blockNetworking.tag = 1003; | |
| 54 | + blockNetworking.isShowDataResult = YES; | |
| 55 | + blockNetworking.allowRequestDefaultArgument = YES; | |
| 56 | + blockNetworking.resultResponseAsynchronously = NO; | |
| 57 | + | |
| 58 | + [CNLiveNetworkManager requestBatchWithArray:@[signInNetworking,inteGetNetworking,spListNetworking,blockNetworking] CompletionBlock:^(NSArray *resultArray) { | |
| 59 | + @try { | |
| 60 | + NSMutableArray * tempArray = [[NSMutableArray alloc] init]; | |
| 61 | + for (CNLiveNetworking * networking in resultArray) { | |
| 62 | + if (networking.tag == 1000 && ![tempArray containsObject:signInNetworking]) { | |
| 63 | + [tempArray addObject:networking]; | |
| 64 | + } | |
| 65 | + if (networking.tag == 1001 && ![tempArray containsObject:inteGetNetworking]) { | |
| 66 | + [tempArray addObject:networking]; | |
| 67 | + } | |
| 68 | + if (networking.tag == 1002 && ![tempArray containsObject:spListNetworking]) { | |
| 69 | + [tempArray addObject:networking]; | |
| 70 | + } | |
| 71 | + if (networking.tag == 1003 && ![tempArray containsObject:blockNetworking]) { | |
| 72 | + [tempArray addObject:networking]; | |
| 73 | + } | |
| 74 | + } | |
| 75 | + NSMutableArray * tempArray01 = [[NSMutableArray alloc] initWithArray:@[@"",@"",@"",@""]]; | |
| 76 | + for (CNLiveNetworking * networking in tempArray) { | |
| 77 | + if (networking.tag == 1000) { | |
| 78 | + if (!networking.error) { | |
| 79 | + CNLiveCMineInteScoreModel * scoreModel = [CNLiveCMineInteScoreModel mj_objectWithKeyValues:networking.responseObject]; | |
| 80 | + [tempArray01 replaceObjectAtIndex:0 withObject:scoreModel]; | |
| 81 | + if ([scoreModel.status isEqualToString:@"1"]) [CNLiveCMineInteHeaderCustomView showWithScoreViewForScoreIntergal:scoreModel.score Statue:YES]; | |
| 82 | + } | |
| 83 | + } | |
| 84 | + if (networking.tag == 1001) { | |
| 85 | + if (!networking.error) { | |
| 86 | + CNLiveCMineInteTaskListModel * listModel = [CNLiveCMineInteTaskListModel mj_objectWithKeyValues:networking.responseObject]; | |
| 87 | + [tempArray01 replaceObjectAtIndex:1 withObject:listModel]; | |
| 88 | + [CNLiveRespCacheManager cachePathWithObject:listModel FileName:NSStringFromClass(CNLiveCMineInteTaskListModel.class)]; | |
| 89 | + }else{ | |
| 90 | + CNLiveCMineInteTaskListModel * listModel = (CNLiveCMineInteTaskListModel *)[CNLiveRespCacheManager objectCacheWithFileName:NSStringFromClass(CNLiveCMineInteTaskListModel.class)]; | |
| 91 | + if (listModel) { | |
| 92 | + [tempArray01 replaceObjectAtIndex:1 withObject:listModel]; | |
| 93 | + } | |
| 94 | + } | |
| 95 | + } | |
| 96 | + if (networking.tag == 1002) { | |
| 97 | + if (!networking.error) { | |
| 98 | + CNLiveCMineInteListModel * spListModel = [CNLiveCMineInteListModel mj_objectWithKeyValues:networking.responseObject]; | |
| 99 | + [tempArray01 replaceObjectAtIndex:2 withObject:spListModel]; | |
| 100 | + } | |
| 101 | + } | |
| 102 | + if (networking.tag == 1003) { | |
| 103 | + if (!networking.error) { | |
| 104 | + CNLiveCMineInteListModel * spListModel = [CNLiveCMineInteListModel mj_objectWithKeyValues:networking.responseObject]; | |
| 105 | + if (spListModel.list.count == 0) { | |
| 106 | + NSMutableArray * tempArray = [[NSMutableArray alloc] init]; | |
| 107 | + CNLiveCMineInteListSubModel * subModel = [[CNLiveCMineInteListSubModel alloc] init]; | |
| 108 | + subModel.contentId = @"21"; | |
| 109 | + subModel.poster = @"c_mine_content_item_task"; | |
| 110 | + subModel.title = @"做任务"; | |
| 111 | + subModel.subTitle = @"赚取更多积分"; | |
| 112 | + subModel.isEmpty = @"1"; | |
| 113 | + spListModel.list = tempArray; | |
| 114 | + } | |
| 115 | + [tempArray01 replaceObjectAtIndex:3 withObject:spListModel]; | |
| 116 | + [CNLiveRespCacheManager cachePathWithObject:spListModel FileName:NSStringFromClass(CNLiveCMineInteListModel.class)]; | |
| 117 | + }else{ | |
| 118 | + CNLiveCMineInteListModel * spListModel = (CNLiveCMineInteListModel *)[CNLiveRespCacheManager objectCacheWithFileName:NSStringFromClass(CNLiveCMineInteListModel.class)]; | |
| 119 | + if (!spListModel) { | |
| 120 | + CNLiveCMineInteListModel * spListModel = [[CNLiveCMineInteListModel alloc] init]; | |
| 121 | + NSMutableArray * tempArray = [[NSMutableArray alloc] init]; | |
| 122 | + CNLiveCMineInteListSubModel * subModel = [[CNLiveCMineInteListSubModel alloc] init]; | |
| 123 | + subModel.contentId = @"21"; | |
| 124 | + subModel.poster = @"c_mine_content_item_task"; | |
| 125 | + subModel.title = @"做任务"; | |
| 126 | + subModel.subTitle = @"赚取更多积分"; | |
| 127 | + subModel.isEmpty = @"1"; | |
| 128 | + spListModel.list = tempArray; | |
| 129 | + } | |
| 130 | + if (spListModel) { | |
| 131 | + [tempArray01 replaceObjectAtIndex:3 withObject:spListModel]; | |
| 132 | + } | |
| 133 | + } | |
| 134 | + } | |
| 135 | + } | |
| 136 | + if (completerBlock) completerBlock(tempArray01,nil); | |
| 137 | + | |
| 138 | + } @catch (NSException *exception) { | |
| 139 | + NSLog(@"异常了"); | |
| 140 | + if (completerBlock) completerBlock(nil,@"获取失败"); | |
| 141 | + } | |
| 142 | + }]; | |
| 143 | +} | |
| 144 | + | |
| 145 | +/// 获取积分明细(新) | |
| 146 | +/// @param currentMonth 时间格式 2021-12 | |
| 147 | +/// @param currentType 1-全部 2-获取 3-支出 | |
| 148 | +/// @param pageNo 页码(默认1) | |
| 149 | +/// @param completerBlock 结果返回 | |
| 150 | ++(void)requestWithIntegraDetailWithCurrentMonth:(NSString *)currentMonth currentType:(NSInteger)currentType pageNo:(NSInteger)pageNo CompleterBlock:(void(^)(CNLiveCMineInteDetailModel *))completerBlock | |
| 151 | +{ | |
| 152 | + NSDictionary * paramDict = @{ | |
| 153 | + @"sid":[CNUserInfoManager manager].userInfoModel.uid, | |
| 154 | + @"currentMonth":currentMonth, | |
| 155 | + @"type":[NSString stringWithFormat:@"%ld",currentType], | |
| 156 | + @"pageNo":[NSString stringWithFormat:@"%ld",pageNo], | |
| 157 | + @"pageSize":@"10" | |
| 158 | + }; | |
| 159 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 160 | + [CNLiveNetworking setupShowDataResult:YES]; | |
| 161 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:cn_API_Host(@"/Daren/integral/integralRecordNew.action") Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 162 | + CNLiveCMineInteDetailModel * listModel = [CNLiveCMineInteDetailModel mj_objectWithKeyValues:responseObject]; | |
| 163 | + listModel.date_string = currentMonth; | |
| 164 | + if (!error && listModel && completerBlock) completerBlock(listModel); | |
| 165 | + }]; | |
| 166 | +} | |
| 167 | + | |
| 168 | +@end | ... | ... |
Example/CNLiveCMineModule.xcodeproj/project.pbxproj
| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; |
| 23 | 23 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; |
| 24 | 24 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; |
| 25 | + 7900B456277BF103001CC115 /* CNLiveCMineViewModuleImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7900B455277BF103001CC115 /* CNLiveCMineViewModuleImpl.m */; }; | |
| 25 | 26 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; |
| 26 | 27 | 88731B515F7A0496959F5A1C /* Pods_CNLiveCMineModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 130B9380A777E212AEB45D18 /* Pods_CNLiveCMineModule_Tests.framework */; }; |
| 27 | 28 | /* End PBXBuildFile section */ |
| ... | ... | @@ -60,9 +61,11 @@ |
| 60 | 61 | 625EF279CB8B01D64C6A1A20 /* Pods_CNLiveCMineModule_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveCMineModule_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; |
| 61 | 62 | 6F73DCC6F12FE6943EB5009C /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; |
| 62 | 63 | 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; |
| 64 | + 7900B454277BF103001CC115 /* CNLiveCMineViewModuleImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveCMineViewModuleImpl.h; sourceTree = "<group>"; }; | |
| 65 | + 7900B455277BF103001CC115 /* CNLiveCMineViewModuleImpl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveCMineViewModuleImpl.m; sourceTree = "<group>"; }; | |
| 63 | 66 | 8098C304961155DEB9CF1284 /* Pods-CNLiveCMineModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCMineModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveCMineModule_Tests/Pods-CNLiveCMineModule_Tests.release.xcconfig"; sourceTree = "<group>"; }; |
| 64 | 67 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; |
| 65 | - 9D3FF658F60BFF2571211A3D /* CNLiveCMineModule.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveCMineModule.podspec; path = ../CNLiveCMineModule.podspec; sourceTree = "<group>"; }; | |
| 68 | + 9D3FF658F60BFF2571211A3D /* CNLiveCMineModule.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveCMineModule.podspec; path = ../CNLiveCMineModule.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; | |
| 66 | 69 | A01134F0716FF93B67CCEC16 /* Pods-CNLiveCMineModule_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCMineModule_Example.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveCMineModule_Example/Pods-CNLiveCMineModule_Example.debug.xcconfig"; sourceTree = "<group>"; }; |
| 67 | 70 | AE8604E2F11D71DD0CBEFEC1 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; }; |
| 68 | 71 | C9612848A8ACD5FE2A7150F3 /* Pods-CNLiveCMineModule_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCMineModule_Example.release.xcconfig"; path = "Target Support Files/Pods-CNLiveCMineModule_Example/Pods-CNLiveCMineModule_Example.release.xcconfig"; sourceTree = "<group>"; }; |
| ... | ... | @@ -140,6 +143,8 @@ |
| 140 | 143 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, |
| 141 | 144 | 6003F5A8195388D20070C39A /* Images.xcassets */, |
| 142 | 145 | 6003F594195388D20070C39A /* Supporting Files */, |
| 146 | + 7900B454277BF103001CC115 /* CNLiveCMineViewModuleImpl.h */, | |
| 147 | + 7900B455277BF103001CC115 /* CNLiveCMineViewModuleImpl.m */, | |
| 143 | 148 | ); |
| 144 | 149 | name = "Example for CNLiveCMineModule"; |
| 145 | 150 | path = CNLiveCMineModule; |
| ... | ... | @@ -334,23 +339,24 @@ |
| 334 | 339 | "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", |
| 335 | 340 | "${BUILT_PRODUCTS_DIR}/CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.framework", |
| 336 | 341 | "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework", |
| 337 | - "${BUILT_PRODUCTS_DIR}/CNLiveCacheManagerKit/CNLiveCacheManagerKit.framework", | |
| 342 | + "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework", | |
| 338 | 343 | "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework", |
| 344 | + "${BUILT_PRODUCTS_DIR}/CNLiveCustomControl/CNLiveCustomControl.framework", | |
| 339 | 345 | "${BUILT_PRODUCTS_DIR}/CNLiveCustomUI/CNLiveCustomUI.framework", |
| 340 | 346 | "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", |
| 341 | 347 | "${BUILT_PRODUCTS_DIR}/CNLiveNewTripartiteManagement/CNLiveNewTripartiteManagement.framework", |
| 342 | 348 | "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", |
| 343 | 349 | "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework", |
| 344 | - "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", | |
| 345 | - "${BUILT_PRODUCTS_DIR}/GPUImage/GPUImage.framework", | |
| 350 | + "${BUILT_PRODUCTS_DIR}/DZNEmptyDataSet/DZNEmptyDataSet.framework", | |
| 346 | 351 | "${BUILT_PRODUCTS_DIR}/JXCategoryView/JXCategoryView.framework", |
| 352 | + "${BUILT_PRODUCTS_DIR}/JXPagingView/JXPagingView.framework", | |
| 347 | 353 | "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", |
| 348 | 354 | "${BUILT_PRODUCTS_DIR}/MJRefresh/MJRefresh.framework", |
| 349 | 355 | "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework", |
| 356 | + "${BUILT_PRODUCTS_DIR}/PGDatePicker/PGDatePicker.framework", | |
| 357 | + "${BUILT_PRODUCTS_DIR}/PGPickerView/PGPickerView.framework", | |
| 350 | 358 | "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework", |
| 351 | 359 | "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", |
| 352 | - "${PODS_ROOT}/TXIMSDK_iOS/ImSDK.framework", | |
| 353 | - "${BUILT_PRODUCTS_DIR}/YBImageBrowser/YBImageBrowser.framework", | |
| 354 | 360 | "${BUILT_PRODUCTS_DIR}/YYAsyncLayer/YYAsyncLayer.framework", |
| 355 | 361 | "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework", |
| 356 | 362 | "${BUILT_PRODUCTS_DIR}/YYCategories/YYCategories.framework", |
| ... | ... | @@ -360,7 +366,6 @@ |
| 360 | 366 | "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework", |
| 361 | 367 | "${BUILT_PRODUCTS_DIR}/YYText/YYText.framework", |
| 362 | 368 | "${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework", |
| 363 | - "${BUILT_PRODUCTS_DIR}/libksygpulive/libksygpulive.framework", | |
| 364 | 369 | ); |
| 365 | 370 | name = "[CP] Embed Pods Frameworks"; |
| 366 | 371 | outputPaths = ( |
| ... | ... | @@ -369,23 +374,24 @@ |
| 369 | 374 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", |
| 370 | 375 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessBaseModule.framework", |
| 371 | 376 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework", |
| 372 | - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCacheManagerKit.framework", | |
| 377 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework", | |
| 373 | 378 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework", |
| 379 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomControl.framework", | |
| 374 | 380 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomUI.framework", |
| 375 | 381 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", |
| 376 | 382 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveNewTripartiteManagement.framework", |
| 377 | 383 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", |
| 378 | 384 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework", |
| 379 | - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework", | |
| 380 | - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GPUImage.framework", | |
| 385 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DZNEmptyDataSet.framework", | |
| 381 | 386 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JXCategoryView.framework", |
| 387 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JXPagingView.framework", | |
| 382 | 388 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", |
| 383 | 389 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJRefresh.framework", |
| 384 | 390 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", |
| 391 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PGDatePicker.framework", | |
| 392 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PGPickerView.framework", | |
| 385 | 393 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework", |
| 386 | 394 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", |
| 387 | - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ImSDK.framework", | |
| 388 | - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YBImageBrowser.framework", | |
| 389 | 395 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYAsyncLayer.framework", |
| 390 | 396 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework", |
| 391 | 397 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCategories.framework", |
| ... | ... | @@ -395,7 +401,6 @@ |
| 395 | 401 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework", |
| 396 | 402 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYText.framework", |
| 397 | 403 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYWebImage.framework", |
| 398 | - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libksygpulive.framework", | |
| 399 | 404 | ); |
| 400 | 405 | runOnlyForDeploymentPostprocessing = 0; |
| 401 | 406 | shellPath = /bin/sh; |
| ... | ... | @@ -409,11 +414,11 @@ |
| 409 | 414 | ); |
| 410 | 415 | inputPaths = ( |
| 411 | 416 | "${PODS_ROOT}/Target Support Files/Pods-CNLiveCMineModule_Example/Pods-CNLiveCMineModule_Example-resources.sh", |
| 412 | - "${PODS_CONFIGURATION_BUILD_DIR}/CNLivePhotoBrowser/CNLivePhotoBrowser.bundle", | |
| 417 | + "${PODS_ROOT}/../../CNLiveCMineModule/Assets/CNLiveCMineModule.bundle", | |
| 413 | 418 | ); |
| 414 | 419 | name = "[CP] Copy Pods Resources"; |
| 415 | 420 | outputPaths = ( |
| 416 | - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLivePhotoBrowser.bundle", | |
| 421 | + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveCMineModule.bundle", | |
| 417 | 422 | ); |
| 418 | 423 | runOnlyForDeploymentPostprocessing = 0; |
| 419 | 424 | shellPath = /bin/sh; |
| ... | ... | @@ -451,6 +456,7 @@ |
| 451 | 456 | files = ( |
| 452 | 457 | 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */, |
| 453 | 458 | 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */, |
| 459 | + 7900B456277BF103001CC115 /* CNLiveCMineViewModuleImpl.m in Sources */, | |
| 454 | 460 | 6003F59A195388D20070C39A /* main.m in Sources */, |
| 455 | 461 | ); |
| 456 | 462 | runOnlyForDeploymentPostprocessing = 0; |
| ... | ... | @@ -579,10 +585,12 @@ |
| 579 | 585 | baseConfigurationReference = A01134F0716FF93B67CCEC16 /* Pods-CNLiveCMineModule_Example.debug.xcconfig */; |
| 580 | 586 | buildSettings = { |
| 581 | 587 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 588 | + CURRENT_PROJECT_VERSION = 2.0.5.21.12.28.15; | |
| 582 | 589 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 583 | 590 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 584 | 591 | GCC_PREFIX_HEADER = "CNLiveCMineModule/CNLiveCMineModule-Prefix.pch"; |
| 585 | 592 | INFOPLIST_FILE = "CNLiveCMineModule/CNLiveCMineModule-Info.plist"; |
| 593 | + MARKETING_VERSION = 2.0.5; | |
| 586 | 594 | MODULE_NAME = ExampleApp; |
| 587 | 595 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; |
| 588 | 596 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| ... | ... | @@ -596,10 +604,12 @@ |
| 596 | 604 | baseConfigurationReference = C9612848A8ACD5FE2A7150F3 /* Pods-CNLiveCMineModule_Example.release.xcconfig */; |
| 597 | 605 | buildSettings = { |
| 598 | 606 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 607 | + CURRENT_PROJECT_VERSION = 2.0.5.21.12.28.15; | |
| 599 | 608 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 600 | 609 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 601 | 610 | GCC_PREFIX_HEADER = "CNLiveCMineModule/CNLiveCMineModule-Prefix.pch"; |
| 602 | 611 | INFOPLIST_FILE = "CNLiveCMineModule/CNLiveCMineModule-Info.plist"; |
| 612 | + MARKETING_VERSION = 2.0.5; | |
| 603 | 613 | MODULE_NAME = ExampleApp; |
| 604 | 614 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; |
| 605 | 615 | PRODUCT_NAME = "$(TARGET_NAME)"; | ... | ... |
Example/CNLiveCMineModule/CNLIVEAppDelegate.m
| ... | ... | @@ -7,14 +7,56 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "CNLIVEAppDelegate.h" |
| 10 | +#import "CNLIVEViewController.h" | |
| 11 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | |
| 12 | +#import <CNLiveEnvironment/CNLiveEnvironment.h> | |
| 13 | +#import <CNLiveEnvironment/CNLiveEnvironmentManager.h> | |
| 14 | +#import <CNLiveUserManagement/CNUserInfoManager.h> | |
| 10 | 15 | |
| 11 | 16 | @implementation CNLIVEAppDelegate |
| 12 | 17 | |
| 13 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
| 14 | 19 | { |
| 15 | 20 | // Override point for customization after application launch. |
| 21 | + [CNLiveEnvironmentManager setEnvironment:CNLiveDebugAppStore];//CNLiveDebugAppStore];//CNLiveProductionAppStore//CNLiveTestFlight | |
| 22 | + | |
| 23 | + [BHContext shareInstance].application = application; | |
| 24 | + [BHContext shareInstance].launchOptions = launchOptions; | |
| 25 | + [BHContext shareInstance].moduleConfigName = @"CNLiveBeeHive.bundle/BeeHive.bundle/BeeHive"; | |
| 26 | + [BHContext shareInstance].serviceConfigName = @"CNLiveBeeHive.bundle/BeeHive.bundle/BHService"; | |
| 27 | + [BeeHive shareInstance].enableException = YES; | |
| 28 | + | |
| 29 | + [super application:application didFinishLaunchingWithOptions:launchOptions]; | |
| 30 | + | |
| 31 | + [CNUserInfoManager manager].userInfoModel.uid = @"353001"; | |
| 32 | + | |
| 33 | + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
| 34 | + self.window.backgroundColor = [UIColor whiteColor]; | |
| 35 | + | |
| 36 | + self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[CNLIVEViewController alloc] init]]; | |
| 37 | + | |
| 38 | + [self.window makeKeyAndVisible]; | |
| 39 | + | |
| 40 | + [self setParamNet]; | |
| 41 | + | |
| 16 | 42 | return YES; |
| 17 | 43 | } |
| 44 | +-(void)setParamNet | |
| 45 | +{ | |
| 46 | + NSMutableDictionary * mDict = [[NSMutableDictionary alloc] init]; | |
| 47 | + [mDict setValue:[CNUserInfoManager manager].userInfoModel.uid forKey:@"loginSid"]; | |
| 48 | + [mDict setValue:@"com.cnlive.CNLiveNetAdd.debug" forKey:@"platform_id"]; | |
| 49 | + [mDict setValue:[[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""] forKey:@"uuid"]; | |
| 50 | + [mDict setValue:@"i" forKey:@"plat"]; | |
| 51 | + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"ver"]; | |
| 52 | + [mDict setObject:AppId forKey:@"appId"]; | |
| 53 | + [mDict setObject:[CNUserInfoManager manager].userInfoModel.uid forKey:@"sid"]; | |
| 54 | + [CNLiveNetworking setupDefaultParam:mDict]; | |
| 55 | + [CNLiveNetworking setupShowResult:NO]; | |
| 56 | + [CNLiveNetworking setupSignKey:APPKey]; | |
| 57 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 58 | + [CNLiveNetworking setResponseSerializerType:CNLiveResponseSerializerJSON]; | |
| 59 | +} | |
| 18 | 60 | |
| 19 | 61 | - (void)applicationWillResignActive:(UIApplication *)application |
| 20 | 62 | { | ... | ... |
Example/CNLiveCMineModule/CNLIVEViewController.m
| ... | ... | @@ -7,13 +7,19 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "CNLIVEViewController.h" |
| 10 | - | |
| 10 | +#import "CNLiveCMineModule.h" | |
| 11 | 11 | @interface CNLIVEViewController () |
| 12 | 12 | |
| 13 | 13 | @end |
| 14 | 14 | |
| 15 | 15 | @implementation CNLIVEViewController |
| 16 | 16 | |
| 17 | +-(void)viewDidAppear:(BOOL)animated | |
| 18 | +{ | |
| 19 | + [super viewDidAppear:animated]; | |
| 20 | + [CNLiveCMineModule pushVCWithInteView]; | |
| 21 | +} | |
| 22 | + | |
| 17 | 23 | - (void)viewDidLoad |
| 18 | 24 | { |
| 19 | 25 | [super viewDidLoad]; | ... | ... |
Example/CNLiveCMineModule/CNLiveCMineModule-Info.plist
| ... | ... | @@ -2,8 +2,13 @@ |
| 2 | 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 3 | 3 | <plist version="1.0"> |
| 4 | 4 | <dict> |
| 5 | + <key>NSAppTransportSecurity</key> | |
| 6 | + <dict> | |
| 7 | + <key>NSAllowsArbitraryLoads</key> | |
| 8 | + <true/> | |
| 9 | + </dict> | |
| 5 | 10 | <key>CFBundleDevelopmentRegion</key> |
| 6 | - <string>en</string> | |
| 11 | + <string>zh_CN</string> | |
| 7 | 12 | <key>CFBundleDisplayName</key> |
| 8 | 13 | <string>${PRODUCT_NAME}</string> |
| 9 | 14 | <key>CFBundleExecutable</key> |
| ... | ... | @@ -17,11 +22,11 @@ |
| 17 | 22 | <key>CFBundlePackageType</key> |
| 18 | 23 | <string>APPL</string> |
| 19 | 24 | <key>CFBundleShortVersionString</key> |
| 20 | - <string>1.0</string> | |
| 25 | + <string>$(MARKETING_VERSION)</string> | |
| 21 | 26 | <key>CFBundleSignature</key> |
| 22 | 27 | <string>????</string> |
| 23 | 28 | <key>CFBundleVersion</key> |
| 24 | - <string>1.0</string> | |
| 29 | + <string>$(CURRENT_PROJECT_VERSION)</string> | |
| 25 | 30 | <key>LSRequiresIPhoneOS</key> |
| 26 | 31 | <true/> |
| 27 | 32 | <key>UILaunchStoryboardName</key> | ... | ... |
Example/CNLiveCMineModule/CNLiveCMineViewModuleImpl.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineViewModuleImpl.h | |
| 3 | +// CNLiveCMineModule_Example | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/29. | |
| 6 | +// Copyright © 2021 杨苓玉. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <Foundation/Foundation.h> | |
| 10 | +#import <CNLiveCMineModule/CNLiveCMineProtocol.h> | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | +@interface CNLiveCMineViewModuleImpl : NSObject<CNLiveCMineProtocol> | |
| 14 | + | |
| 15 | +@end | |
| 16 | + | |
| 17 | +NS_ASSUME_NONNULL_END | ... | ... |
Example/CNLiveCMineModule/CNLiveCMineViewModuleImpl.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCMineViewModuleImpl.m | |
| 3 | +// CNLiveCMineModule_Example | |
| 4 | +// | |
| 5 | +// Created by open on 2021/12/29. | |
| 6 | +// Copyright © 2021 杨苓玉. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveCMineViewModuleImpl.h" | |
| 10 | + | |
| 11 | +@implementation CNLiveCMineViewModuleImpl | |
| 12 | + | |
| 13 | +/// 我的积分跳转主工程我的客服界面 | |
| 14 | +-(void)pushCMineInteContentForCMainPlatFromCustomerMedthod | |
| 15 | +{ | |
| 16 | + | |
| 17 | +} | |
| 18 | + | |
| 19 | +/// 我的积分调用主工程中的友盟统计 | |
| 20 | +-(void)pushCMineInteContentForCMainUMengStatisticaMedthod | |
| 21 | +{ | |
| 22 | + // [MobClick event:@"config_click_checkIn"]; | |
| 23 | +} | |
| 24 | + | |
| 25 | +/// 我的积分跳转主工程webView界面 | |
| 26 | +/// @param url 链接地址 | |
| 27 | +- (void)pushCMineInteContentForCMainWebViewWithURL:(nonnull NSString *)url statue:(CNLiveCMineIntePushWebViewStatue)statue { | |
| 28 | + | |
| 29 | +} | |
| 30 | + | |
| 31 | + | |
| 32 | +@end | ... | ... |