Commit b36fd8d86dd16e0935778ba5a138bb422e0303ee

Authored by yanglingyu
1 parent 99a0e80f

免责声明增加后台控制

CNLiveCServiceModule.podspec
... ... @@ -8,7 +8,7 @@
8 8  
9 9 Pod::Spec.new do |s|
10 10 s.name = 'CNLiveCServiceModule'
11   - s.version = '0.0.8'
  11 + s.version = '0.0.9'
12 12 s.summary = '我的服务内容'
13 13  
14 14 # This description is used to generate tags and improve search results.
... ...
CNLiveCServiceModule/Classes/Manager/CNLiveCServiceManagerBridge.h
... ... @@ -41,6 +41,8 @@ NS_ASSUME_NONNULL_BEGIN
41 41 * @param shopType shopType
42 42 */
43 43 + (void)jumpServiceController:(NSString *)serviceId
  44 + showAgreement:(NSString *)showAgreement
  45 + agreementDesc:(NSString *)agreementDesc
44 46 type:(NSString *)type
45 47 to:(NSString *)to
46 48 shopType:(NSString *)shopType
... ...
CNLiveCServiceModule/Classes/Manager/CNLiveCServiceManagerBridge.m
... ... @@ -10,8 +10,6 @@
10 10 #import "CNLiveServiceVC.h"
11 11 #import "CNLiveAlertTipView.h"
12 12  
13   -static NSString *NeverShowTip = @"NeverShowTip";
14   -
15 13 @implementation CNLiveCServiceManagerBridge
16 14 + (instancetype)shareManager{
17 15 static dispatch_once_t onceToken;
... ... @@ -31,17 +29,13 @@ static NSString *NeverShowTip = @"NeverShowTip";
31 29 return self;
32 30 }
33 31  
34   -+ (void)jumpServiceController:(NSString *)serviceId type:(NSString *)type to:(NSString *)to shopType:(NSString *)shopType controller:(UIViewController *)controller
  32 ++ (void)jumpServiceController:(NSString *)serviceId showAgreement:(nonnull NSString *)showAgreement agreementDesc:(nonnull NSString *)agreementDesc type:(NSString *)type to:(NSString *)to shopType:(NSString *)shopType controller:(UIViewController *)controller
35 33 {
36   - NSDate *beginDate = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithFormat:@"%@_%@",CNUserShareModelUid,serviceId]];
37   - if ([type isEqualToString:@"104"] && ![[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:@"%@_%@_%@",NeverShowTip,CNUserShareModelUid,serviceId]] && (!beginDate || [CNLiveCServiceManagerBridge prepareBeginTime:beginDate andNowTime:[NSDate date]])) {
38   - [CNLiveAlertTipView showTipsInViewSureBlock:^(BOOL neverShow) {
39   - [[NSUserDefaults standardUserDefaults] setBool:neverShow forKey:[NSString stringWithFormat:@"%@_%@_%@",NeverShowTip,CNUserShareModelUid,serviceId]];
40   - if (!neverShow) {
41   - [[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:[NSString stringWithFormat:@"%@_%@",CNUserShareModelUid,serviceId]];
42   - }
43   - [CNLiveServicePresent usedServiceWithServingId:serviceId];
44   - [CNLiveCServiceManagerBridge jumpServiceType:CNCServiceJumpTypeService service:serviceId type:type to:to shopType:shopType controller:controller];
  34 + if ([type isEqualToString:@"104"] && ![[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:@"%@_%@",CNUserShareModelUid,serviceId]] && showAgreement.boolValue) {
  35 + [CNLiveAlertTipView showTipsInViewDesc:agreementDesc sureBlock:^(BOOL neverShow) {
  36 + [[NSUserDefaults standardUserDefaults] setBool:neverShow forKey:[NSString stringWithFormat:@"%@_%@",CNUserShareModelUid,serviceId]];
  37 + [CNLiveServicePresent usedServiceWithServingId:serviceId];
  38 + [CNLiveCServiceManagerBridge jumpServiceType:CNCServiceJumpTypeService service:serviceId type:type to:to shopType:shopType controller:controller];
45 39 }];
46 40 }else{
47 41 [CNLiveServicePresent usedServiceWithServingId:serviceId];
... ...
CNLiveCServiceModule/Classes/Model/CNLiveSearchModel.h
... ... @@ -22,7 +22,10 @@ NS_ASSUME_NONNULL_BEGIN
22 22 @property (nonatomic,copy) NSString * id;
23 23 ///名称
24 24 @property (nonatomic,copy) NSString * title;
25   -
  25 +//是否展示免责
  26 +@property (nonatomic,copy) NSString * showAgreement;
  27 +//免责内容
  28 +@property (nonatomic,copy) NSString * agreementDesc;
26 29 ///图标
27 30 @property (nonatomic,copy) NSString * icon;
28 31 ///描述
... ...
CNLiveCServiceModule/Classes/View/CNLiveAlertTipView.h
... ... @@ -10,7 +10,7 @@
10 10 NS_ASSUME_NONNULL_BEGIN
11 11  
12 12 @interface CNLiveAlertTipView : UIView
13   -+ (void)showTipsInViewSureBlock:(void(^)(BOOL neverShow))sureBlock;
  13 ++ (void)showTipsInViewDesc:(NSString *)desc sureBlock:(void (^)(BOOL))sureBlock;
14 14 @end
15 15  
16 16 NS_ASSUME_NONNULL_END
... ...
CNLiveCServiceModule/Classes/View/CNLiveAlertTipView.m
... ... @@ -17,7 +17,7 @@
17 17  
18 18 @implementation CNLiveAlertTipView
19 19  
20   -+ (void)showTipsInViewSureBlock:(void (^)(BOOL))sureBlock
  20 ++ (void)showTipsInViewDesc:(NSString *)desc sureBlock:(void (^)(BOOL))sureBlock
21 21 {
22 22 CNLiveAlertTipView *tipView = [[CNLiveAlertTipView alloc] initWithFrame:CGRectMake(0, 0, 285, 379.5)];
23 23 tipView.backgroundColor = kWhiteColor;
... ... @@ -33,8 +33,7 @@
33 33 make.top.equalTo(tipView).offset(25);
34 34 make.centerX.mas_equalTo(tipView);
35 35 }];
36   -
37   -
  36 +
38 37 [tipView.cancelBtn setTitle:@"拒绝" forState:UIControlStateNormal];
39 38 [tipView.sureBtn setTitle:@"接受" forState:UIControlStateNormal];
40 39 [tipView.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
... ... @@ -56,7 +55,7 @@
56 55 make.left.equalTo(tipView).offset(15);
57 56 }];
58 57  
59   - tipView.messageLabel.text = [CNLiveAlertTipView noteFileTxt];
  58 + tipView.messageLabel.text = desc;
60 59 [tipView.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
61 60 make.top.equalTo(tipView.titleLabel.mas_bottom);
62 61 make.width.offset(255);
... ... @@ -84,6 +83,7 @@
84 83 #pragma mark - Action
85 84 -(void)notShowBtnClick:(UIButton *)sender{
86 85 sender.selected = !sender.isSelected;
  86 + self.sureBtn.enabled = sender.selected;
87 87 }
88 88 #pragma mark - Getting&&Setting
89 89 - (UILabel *)titleLabel
... ... @@ -124,7 +124,9 @@
124 124 [_sureBtn setTitleColor:kWhiteColor forState:UIControlStateNormal];
125 125 _sureBtn.layer.cornerRadius = 21;
126 126 _sureBtn.titleLabel.font = UIFontMake(16);
127   - _sureBtn.backgroundColor = [UIColor colorWithPatternImage:[UIImage gradientVerticalImageWithColors:@[CNLiveColorWithHexString(@"#FFAA4A"),CNLiveColorWithHexString(@"#EC5645")] rect:CGRectMake(0, 0, 120, 39)]];
  127 + [_sureBtn setBackgroundImage:[UIImage gradientVerticalImageWithColors:@[CNLiveColorWithHexString(@"#FFAA4A"),CNLiveColorWithHexString(@"#EC5645")] rect:CGRectMake(0, 0, 120, 39)] forState:UIControlStateNormal];
  128 + [_sureBtn setBackgroundImage:[UIImage imageWithColor:CNLiveColorWithHexString(@"#EEEEEE")] forState:UIControlStateDisabled];
  129 + _sureBtn.enabled = NO;
128 130 }
129 131 return _sureBtn;
130 132 }
... ... @@ -136,9 +138,9 @@
136 138 [_notShowBtn setImage:[UIImage loadCServiceBundle:@"tips_no"] forState:UIControlStateNormal];
137 139 [_notShowBtn setImage:[UIImage loadCServiceBundle:@"tips_select"] forState:UIControlStateSelected];
138 140 _notShowBtn.backgroundColor = kClearColor;
139   - [_notShowBtn setTitle:@"下次不再弹出" forState:UIControlStateNormal];
  141 + [_notShowBtn setTitle:@"我已阅读并同意" forState:UIControlStateNormal];
140 142 [_notShowBtn setTitleColor:CNLiveColorWithHexString(@"#F5A623") forState:UIControlStateNormal];
141   - [_notShowBtn setTitle:@"下次不再弹出" forState:UIControlStateSelected];
  143 + [_notShowBtn setTitle:@"我已阅读并同意" forState:UIControlStateSelected];
142 144 [_notShowBtn setTitleColor:CNLiveColorWithHexString(@"#F5A623") forState:UIControlStateSelected];
143 145 _notShowBtn.titleLabel.font = UIFontMake(14);
144 146 [_notShowBtn addTarget:self action:@selector(notShowBtnClick:) forControlEvents:UIControlEventTouchUpInside];
... ...
CNLiveCServiceModule/Classes/View/CNLiveChineServiceCell.m
... ... @@ -66,7 +66,7 @@
66 66 if (!_titleLabel) {
67 67 _titleLabel = [[UILabel alloc] init];
68 68 _titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
69   - _titleLabel.font = UIFontMake(11);
  69 + _titleLabel.font = UIFontMake(13);
70 70 _titleLabel.textColor = CNLiveColorWithHexString(@"#4A4A4A");
71 71 _titleLabel.textAlignment = NSTextAlignmentLeft;
72 72 }
... ...
CNLiveCServiceModule/Classes/View/CNLiveCycleCell.m
... ... @@ -53,7 +53,7 @@ static NSString *CNServiceOrLookID = @"CNLiveServiceOrLookCell";
53 53 }
54 54 if ([model isKindOfClass:[CNLiveSearchModel class]]) {
55 55 CNLiveSearchModel *searchModel = (CNLiveSearchModel *)model;
56   - [CNLiveCServiceManagerBridge jumpServiceController:searchModel.id type:searchModel.type to:searchModel.to shopType:searchModel.shopType controller:[CNLiveCServiceManagerBridge viewControllerFromView:self]];
  56 + [CNLiveCServiceManagerBridge jumpServiceController:searchModel.id showAgreement:searchModel.showAgreement agreementDesc:searchModel.agreementDesc type:searchModel.type to:searchModel.to shopType:searchModel.shopType controller:[CNLiveCServiceManagerBridge viewControllerFromView:self]];
57 57 }
58 58 if ([model isKindOfClass:[CnLivePageContentModel class]]) {
59 59 [CNLiveCServiceManagerBridge jumpViewControllerType:CNCServiceJumpTypeGetPage param:[model mj_keyValues] controller:[CNLiveCServiceManagerBridge viewControllerFromView:self]];
... ...
CNLiveCServiceModule/Classes/View/CNLiveGoodsOrVideoHeaderView.m
... ... @@ -105,7 +105,7 @@
105 105 {
106 106 if (!_titlelabel) {
107 107 _titlelabel = [[UILabel alloc] init];
108   - _titlelabel.font = UIFontMake(17);
  108 + _titlelabel.font = UIFontBoldMake(17);
109 109 _titlelabel.textColor = CNLiveColorWithHexString(@"#999999");
110 110 }
111 111 return _titlelabel;
... ...
CNLiveCServiceModule/Classes/View/CNLiveSearchHeaderView.m
... ... @@ -45,9 +45,9 @@
45 45 self.lineView.hidden = YES;
46 46 if (_type == CNServiceHeaderTypeService || _type == CNServiceHeaderTypeCategoryId) {
47 47 _titlelabel.textColor = CNLiveColorWithHexString(@"#333333");
48   - _titlelabel.font = UIFontMake(17);
  48 + _titlelabel.font = UIFontBoldMake(17);
49 49 }else{
50   - _titlelabel.font = UIFontMake(14);
  50 + _titlelabel.font = UIFontBoldMake(14);
51 51 _titlelabel.textColor = CNLiveColorWithHexString(@"#999999");
52 52 }
53 53 self.backgroundColor = kWhiteColor;
... ... @@ -57,7 +57,7 @@
57 57 self.backgroundColor = [UIColor colorWithPatternImage:[UIImage gradientVerticalImageWithColors:@[CNLiveColorWithHexString(@"#FEF2E0"),kWhiteColor] rect:self.bounds]];
58 58 NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@/正在使用",model.title]];
59 59 [string addAttribute:NSFontAttributeName value:UIFontMake(12) range:NSMakeRange(0, string.length)];
60   - [string addAttribute:NSFontAttributeName value:UIFontMake(17) range:NSMakeRange(0, model.title.length)];
  60 + [string addAttribute:NSFontAttributeName value:UIFontBoldMake(17) range:NSMakeRange(0, model.title.length)];
61 61 [string addAttribute:NSStrokeColorAttributeName value:CNLiveColorWithHexString(@"#999999") range:NSMakeRange(0, string.length)];
62 62 [string addAttribute:NSStrokeColorAttributeName value:CNLiveColorWithHexString(@"#4A4A4A") range:NSMakeRange(0, model.title.length)];
63 63 self.titlelabel.attributedText = string;
... ... @@ -79,7 +79,7 @@
79 79 {
80 80 if (!_titlelabel) {
81 81 _titlelabel = [[UILabel alloc] init];
82   - _titlelabel.font = UIFontMake(14);
  82 + _titlelabel.font = UIFontBoldMake(14);
83 83 _titlelabel.textColor = CNLiveColorWithHexString(@"#999999");
84 84 }
85 85 return _titlelabel;
... ...
CNLiveCServiceModule/Classes/View/CNLiveSearchHotsCell.m
... ... @@ -57,7 +57,7 @@
57 57 if (!_titleLabel) {
58 58 _titleLabel = [[UILabel alloc] init];
59 59 _titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
60   - _titleLabel.font = UIFontMake(11);
  60 + _titleLabel.font = UIFontMake(13);
61 61 _titleLabel.textColor = CNLiveColorWithHexString(@"#4A4A4A");
62 62 _titleLabel.textAlignment = NSTextAlignmentCenter;
63 63 }
... ...
CNLiveCServiceModule/Classes/View/CNLiveServiceChinasCell.m
... ... @@ -44,9 +44,9 @@
44 44 _model = model;
45 45 if (model.subTitle && ![model.subTitle isEqualToString:@""]) {
46 46 self.subTitle.hidden = NO;
47   - self.subTitle.text = model.subTitle;
  47 + self.subTitle.text = [NSString stringWithFormat:@" %@",model.subTitle];;
48 48 [self.cycleView mas_remakeConstraints:^(MASConstraintMaker *make) {
49   - make.top.equalTo(self.subTitle.mas_bottom);
  49 + make.top.equalTo(self.subTitle.mas_bottom).offset(-1);
50 50 make.bottom.equalTo(self);
51 51 make.left.equalTo(self.contentView).offset(15);
52 52 make.right.equalTo(self.contentView).offset(-15);
... ... @@ -69,7 +69,7 @@
69 69 _subTitle = [[UILabel alloc] init];
70 70 _subTitle.font = UIFontMake(14);
71 71 _subTitle.textColor = UIColorHex(#333333);
72   - _subTitle.backgroundColor = UIColorHex(#FCFDFD);
  72 + _subTitle.backgroundColor = UIColorHex(#F9FAFB);
73 73 }
74 74 return _subTitle;
75 75 }
... ...
CNLiveCServiceModule/Classes/View/CNLiveVideoRecommendCell.m
... ... @@ -152,7 +152,7 @@
152 152 {
153 153 if (!_titleLabel) {
154 154 _titleLabel = [[UILabel alloc] init];
155   - _titleLabel.font = UIFontMake(12);
  155 + _titleLabel.font = UIFontMake(13);
156 156 _titleLabel.textColor = CNLiveColorWithHexString(@"#333333");
157 157 _titleLabel.textAlignment = NSTextAlignmentLeft;
158 158 }
... ...
CNLiveCServiceModule/Classes/ViewController/CNLiveAllServiceVC.m
... ... @@ -127,7 +127,7 @@ static NSString *HistoryFootID = @"UICollectionFooterView";
127 127 CNLiveSearchHotsModel *model = self.dataSource[indexPath.section];
128 128 CNLiveSearchModel *model1 = [CNLiveSearchModel mj_objectWithKeyValues:model.lists[indexPath.row]];
129 129 [CNLiveServicePresent usedServiceWithServingId:model1.id];
130   - [CNLiveCServiceManagerBridge jumpServiceController:model1.id type:model1.type to:model1.to shopType:model1.shopType controller:self];
  130 + [CNLiveCServiceManagerBridge jumpServiceController:model1.id showAgreement:model1.showAgreement agreementDesc:model1.agreementDesc type:model1.type to:model1.to shopType:model1.shopType controller:self];
131 131 }
132 132 #pragma mark - UICollectionViewDataSource
133 133 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
... ...
CNLiveCServiceModule/Classes/ViewController/CNLiveMyServicesVC.m
... ... @@ -118,7 +118,7 @@ static NSString *HotListCellID = @"HotListCellID";
118 118 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
119 119  
120 120 CNLiveSearchModel *model1 = self.dataSource[indexPath.row];
121   - [CNLiveCServiceManagerBridge jumpServiceController:model1.id type:model1.type to:model1.to shopType:model1.shopType controller:self];
  121 + [CNLiveCServiceManagerBridge jumpServiceController:model1.id showAgreement:model1.showAgreement agreementDesc:model1.agreementDesc type:model1.type to:model1.to shopType:model1.shopType controller:self];
122 122  
123 123 }
124 124 #pragma mark - UICollectionViewDataSource
... ...
CNLiveCServiceModule/Classes/ViewController/CNLiveServiceSearchVC.m
... ... @@ -180,7 +180,7 @@ static NSString *HistoryFootID = @"HistoryFootID";
180 180 }
181 181 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
182 182 CNLiveSearchModel *model = self.dataListArr[indexPath.row];
183   - [CNLiveCServiceManagerBridge jumpServiceController:model.id type:model.type to:model.to shopType:model.shopType controller:self];
  183 + [CNLiveCServiceManagerBridge jumpServiceController:model.id showAgreement:model.showAgreement agreementDesc:model.agreementDesc type:model.type to:model.to shopType:model.shopType controller:self];
184 184 }
185 185 #pragma mark - UITableViewDataSource
186 186 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
... ... @@ -198,7 +198,7 @@ static NSString *HistoryFootID = @"HistoryFootID";
198 198 CNLiveSearchHotsModel *model = self.hDataSources[indexPath.section];
199 199 if ([model.title isEqualToString:@"热度推荐"]) {
200 200 CNLiveSearchModel *model1 = model.lists[indexPath.row];
201   - [CNLiveCServiceManagerBridge jumpServiceController:model1.id type:model1.type to:model1.to shopType:model1.shopType controller:self];
  201 + [CNLiveCServiceManagerBridge jumpServiceController:model1.id showAgreement:model1.showAgreement agreementDesc:model1.agreementDesc type:model1.type to:model1.to shopType:model1.shopType controller:self];
202 202 }else
203 203 {
204 204 CNLiveHistoryModel *model1 = model.lists[indexPath.row];
... ...