Commit 0775be415595a4e6be10506a9a403a6827c40cd2
1 parent
18922fb0
适配大字体
Showing
20 changed files
with
94 additions
and
73 deletions
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.19' | |
| 11 | + s.version = '0.0.20' | |
| 12 | 12 | s.summary = '我的服务内容' |
| 13 | 13 | |
| 14 | 14 | # This description is used to generate tags and improve search results. |
| ... | ... | @@ -53,5 +53,6 @@ TODO: Add long description of the pod here. |
| 53 | 53 | s.dependency 'CNLiveUserManagement' |
| 54 | 54 | s.dependency 'CNLiveEnvironment' |
| 55 | 55 | s.dependency 'CNLiveCustomControl' |
| 56 | + s.dependency 'CNLiveCustomUI' | |
| 56 | 57 | |
| 57 | 58 | end | ... | ... |
CNLiveCServiceModule/Classes/Manager/CNLiveCServicePCH.h
CNLiveCServiceModule/Classes/View/CNLIveCategoryCell.m
| ... | ... | @@ -58,7 +58,9 @@ |
| 58 | 58 | _model = model; |
| 59 | 59 | [self.logoView sd_setImageWithURL:[NSURL URLWithString:model.icon]]; |
| 60 | 60 | self.titleLabel.text = model.title; |
| 61 | + _titleLabel.font = UIFontCNMake(15); | |
| 61 | 62 | self.subTitle.text = model.desc; |
| 63 | + _subTitle.font = UIFontCNMake(12); | |
| 62 | 64 | } |
| 63 | 65 | - (UIImageView *)logoView{ |
| 64 | 66 | if (!_logoView) { |
| ... | ... | @@ -73,7 +75,7 @@ |
| 73 | 75 | { |
| 74 | 76 | if (!_titleLabel) { |
| 75 | 77 | _titleLabel = [[UILabel alloc] init]; |
| 76 | - _titleLabel.font = UIFontMake(15); | |
| 78 | + _titleLabel.font = UIFontCNMake(15); | |
| 77 | 79 | _titleLabel.textColor = CNLiveColorWithHexString(@"#666666"); |
| 78 | 80 | _titleLabel.textAlignment = NSTextAlignmentLeft; |
| 79 | 81 | } |
| ... | ... | @@ -85,7 +87,7 @@ |
| 85 | 87 | if (!_subTitle) { |
| 86 | 88 | _subTitle = [[UILabel alloc] init]; |
| 87 | 89 | _subTitle.textColor = CNLiveColorWithHexString(@"#A9A9A9"); |
| 88 | - _subTitle.font = UIFontMake(12); | |
| 90 | + _subTitle.font = UIFontCNMake(12); | |
| 89 | 91 | } |
| 90 | 92 | return _subTitle; |
| 91 | 93 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveAlertTipView.m
| ... | ... | @@ -50,8 +50,6 @@ |
| 50 | 50 | }]; |
| 51 | 51 | [tipView.notShowBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
| 52 | 52 | make.bottom.equalTo(tipView.cancelBtn.mas_top).offset(-10); |
| 53 | - make.width.offset(125); | |
| 54 | - make.height.offset(20); | |
| 55 | 53 | make.left.equalTo(tipView).offset(15); |
| 56 | 54 | }]; |
| 57 | 55 | |
| ... | ... | @@ -99,7 +97,7 @@ |
| 99 | 97 | _titleLabel = [[UILabel alloc] init]; |
| 100 | 98 | _titleLabel.textAlignment = NSTextAlignmentCenter; |
| 101 | 99 | _titleLabel.textColor = CNLiveColorWithHexString(@"#333333"); |
| 102 | - _titleLabel.font = UIFontMake(17); | |
| 100 | + _titleLabel.font = UIFontCNMake(17); | |
| 103 | 101 | } |
| 104 | 102 | return _titleLabel; |
| 105 | 103 | } |
| ... | ... | @@ -108,7 +106,7 @@ |
| 108 | 106 | if (!_messageLabel) { |
| 109 | 107 | _messageLabel = [[UITextView alloc] init]; |
| 110 | 108 | _messageLabel.textColor = CNLiveColorWithHexString(@"#333333"); |
| 111 | - _messageLabel.font = UIFontMake(13); | |
| 109 | + _messageLabel.font = UIFontCNMake(13); | |
| 112 | 110 | _messageLabel.editable = NO; |
| 113 | 111 | } |
| 114 | 112 | return _messageLabel; |
| ... | ... | @@ -120,7 +118,7 @@ |
| 120 | 118 | _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 121 | 119 | [_cancelBtn setTitleColor:CNLiveColorWithHexString(@"#999999") forState:UIControlStateNormal]; |
| 122 | 120 | _cancelBtn.layer.cornerRadius = 21; |
| 123 | - _cancelBtn.titleLabel.font = UIFontMake(16); | |
| 121 | + _cancelBtn.titleLabel.font = UIFontCNMake(16); | |
| 124 | 122 | _cancelBtn.backgroundColor = CNLiveColorWithHexString(@"#EEEEEE"); |
| 125 | 123 | } |
| 126 | 124 | return _cancelBtn; |
| ... | ... | @@ -131,7 +129,7 @@ |
| 131 | 129 | _sureBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 132 | 130 | [_sureBtn setTitleColor:kWhiteColor forState:UIControlStateNormal]; |
| 133 | 131 | _sureBtn.layer.cornerRadius = 21; |
| 134 | - _sureBtn.titleLabel.font = UIFontMake(16); | |
| 132 | + _sureBtn.titleLabel.font = UIFontCNMake(16); | |
| 135 | 133 | [_sureBtn setBackgroundImage:[UIImage gradientVerticalImageWithColors:@[CNLiveColorWithHexString(@"#FFAA4A"),CNLiveColorWithHexString(@"#EC5645")] rect:CGRectMake(0, 0, 120, 39)] forState:UIControlStateNormal]; |
| 136 | 134 | _sureBtn.clipsToBounds = YES; |
| 137 | 135 | } |
| ... | ... | @@ -149,8 +147,9 @@ |
| 149 | 147 | [_notShowBtn setTitleColor:CNLiveColorWithHexString(@"#F5A623") forState:UIControlStateNormal]; |
| 150 | 148 | [_notShowBtn setTitle:@"我已阅读并同意" forState:UIControlStateSelected]; |
| 151 | 149 | [_notShowBtn setTitleColor:CNLiveColorWithHexString(@"#F5A623") forState:UIControlStateSelected]; |
| 152 | - _notShowBtn.titleLabel.font = UIFontMake(14); | |
| 150 | + _notShowBtn.titleLabel.font = UIFontCNMake(14); | |
| 153 | 151 | [_notShowBtn addTarget:self action:@selector(notShowBtnClick:) forControlEvents:UIControlEventTouchUpInside]; |
| 152 | + [_notShowBtn sizeToFit]; | |
| 154 | 153 | } |
| 155 | 154 | return _notShowBtn; |
| 156 | 155 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveChineServiceCell.m
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | [self.subTitle mas_makeConstraints:^(MASConstraintMaker *make) { |
| 41 | 41 | make.left.equalTo(self.titleLabel); |
| 42 | 42 | make.top.equalTo(self.logoView.mas_centerY).offset(2); |
| 43 | - make.right.equalTo(self.contentView).offset(-17); | |
| 43 | + make.right.equalTo(self.contentView); | |
| 44 | 44 | }]; |
| 45 | 45 | } |
| 46 | 46 | |
| ... | ... | @@ -50,7 +50,9 @@ |
| 50 | 50 | _model = model; |
| 51 | 51 | [self.logoView sd_setImageWithURL:[NSURL URLWithString:model.icon]]; |
| 52 | 52 | self.titleLabel.text = model.title; |
| 53 | + _titleLabel.font = UIFontCNMake(13); | |
| 53 | 54 | self.subTitle.text = model.desc; |
| 55 | + _subTitle.font = UIFontCNMake(10); | |
| 54 | 56 | } |
| 55 | 57 | - (UIImageView *)logoView{ |
| 56 | 58 | if (!_logoView) { |
| ... | ... | @@ -65,8 +67,7 @@ |
| 65 | 67 | { |
| 66 | 68 | if (!_titleLabel) { |
| 67 | 69 | _titleLabel = [[UILabel alloc] init]; |
| 68 | - _titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; | |
| 69 | - _titleLabel.font = UIFontMake(13); | |
| 70 | + _titleLabel.font = UIFontCNMake(11); | |
| 70 | 71 | _titleLabel.textColor = CNLiveColorWithHexString(@"#4A4A4A"); |
| 71 | 72 | _titleLabel.textAlignment = NSTextAlignmentLeft; |
| 72 | 73 | } |
| ... | ... | @@ -78,7 +79,7 @@ |
| 78 | 79 | if (!_subTitle) { |
| 79 | 80 | _subTitle = [[UILabel alloc] init]; |
| 80 | 81 | _subTitle.textColor = CNLiveColorWithHexString(@"#A9A9A9"); |
| 81 | - _subTitle.font = UIFontMake(10); | |
| 82 | + _subTitle.font = UIFontCNMake(10); | |
| 82 | 83 | } |
| 83 | 84 | return _subTitle; |
| 84 | 85 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveGoodsOrVideoHeaderView.m
| ... | ... | @@ -58,6 +58,9 @@ |
| 58 | 58 | #pragma mark - Setting&&Getting |
| 59 | 59 | - (void)setPageModel:(CNliveServicePageModel *)pageModel |
| 60 | 60 | { |
| 61 | + _titlelabel.font = UIFontBoldCNMake(17); | |
| 62 | + _subTitle.font = UIFontCNMake(12); | |
| 63 | + _moreBtn.titleLabel.font = UIFontCNMake(12); | |
| 61 | 64 | _pageModel = pageModel; |
| 62 | 65 | self.titlelabel.text = pageModel.blockName; |
| 63 | 66 | [self.titlelabel sizeToFit]; |
| ... | ... | @@ -105,7 +108,7 @@ |
| 105 | 108 | { |
| 106 | 109 | if (!_titlelabel) { |
| 107 | 110 | _titlelabel = [[UILabel alloc] init]; |
| 108 | - _titlelabel.font = UIFontBoldMake(17); | |
| 111 | + _titlelabel.font = UIFontBoldCNMake(17); | |
| 109 | 112 | _titlelabel.textColor = CNLiveColorWithHexString(@"#999999"); |
| 110 | 113 | } |
| 111 | 114 | return _titlelabel; |
| ... | ... | @@ -114,7 +117,7 @@ |
| 114 | 117 | { |
| 115 | 118 | if (!_subTitle) { |
| 116 | 119 | _subTitle = [[UILabel alloc] init]; |
| 117 | - _subTitle.font = UIFontMake(12); | |
| 120 | + _subTitle.font = UIFontCNMake(12); | |
| 118 | 121 | _subTitle.textColor = CNLiveColorWithHexString(@"#333333"); |
| 119 | 122 | } |
| 120 | 123 | return _subTitle; |
| ... | ... | @@ -126,7 +129,7 @@ |
| 126 | 129 | [_moreBtn setImage:[UIImage loadCServiceBundle:@"object_more"] forState:UIControlStateNormal]; |
| 127 | 130 | [_moreBtn setTitle:@"更多" forState:UIControlStateNormal]; |
| 128 | 131 | [_moreBtn setTitleColor:CNLiveColorWithHexString(@"#999695") forState:UIControlStateNormal]; |
| 129 | - _moreBtn.titleLabel.font = UIFontMake(12); | |
| 132 | + _moreBtn.titleLabel.font = UIFontCNMake(12); | |
| 130 | 133 | _moreBtn.imagePosition = QMUIButtonImagePositionRight; |
| 131 | 134 | [_moreBtn addTarget:self action:@selector(moreButtonClick) forControlEvents:UIControlEventTouchUpInside]; |
| 132 | 135 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveMainSearch.m
| ... | ... | @@ -107,7 +107,7 @@ |
| 107 | 107 | _searchField.returnKeyType = UIReturnKeySearch; |
| 108 | 108 | _searchField.clearButtonMode = UITextFieldViewModeAlways; |
| 109 | 109 | _searchField.textColor = CNLiveColorWithHexString(@"#333333"); |
| 110 | - _searchField.font = UIFontMake(14); | |
| 110 | + _searchField.font = UIFontCNMake(14); | |
| 111 | 111 | } |
| 112 | 112 | return _searchField; |
| 113 | 113 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveSearchHeaderView.m
| ... | ... | @@ -56,8 +56,8 @@ |
| 56 | 56 | self.lineView.hidden = NO; |
| 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 | - [string addAttribute:NSFontAttributeName value:UIFontMake(12) range:NSMakeRange(0, string.length)]; | |
| 60 | - [string addAttribute:NSFontAttributeName value:UIFontBoldMake(17) range:NSMakeRange(0, model.title.length)]; | |
| 59 | + [string addAttribute:NSFontAttributeName value:UIFontCNMake(12) range:NSMakeRange(0, string.length)]; | |
| 60 | + [string addAttribute:NSFontAttributeName value:UIFontBoldCNMake(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; | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveSearchHistoryCell.m
| ... | ... | @@ -34,13 +34,14 @@ |
| 34 | 34 | #pragma mark - Setting&&Getting |
| 35 | 35 | - (void)setModel:(CNLiveHistoryModel *)model |
| 36 | 36 | { |
| 37 | + _history.font = UIFontCNMake(12); | |
| 37 | 38 | self.history.text = model.title; |
| 38 | 39 | } |
| 39 | 40 | - (UILabel *)history |
| 40 | 41 | { |
| 41 | 42 | if (!_history) { |
| 42 | 43 | _history = [[UILabel alloc] init]; |
| 43 | - _history.font = UIFontMake(12); | |
| 44 | + _history.font = UIFontCNMake(11); | |
| 44 | 45 | _history.textColor = CNLiveColorWithHexString(@"#4A4A4A"); |
| 45 | 46 | _history.textAlignment = NSTextAlignmentCenter; |
| 46 | 47 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveSearchHotsCell.m
| ... | ... | @@ -38,6 +38,7 @@ |
| 38 | 38 | #pragma mark - Setting&&Getting |
| 39 | 39 | - (void)setModel:(CNLiveSearchModel *)model |
| 40 | 40 | { |
| 41 | + _titleLabel.font = UIFontCNMake(11); | |
| 41 | 42 | _model = model; |
| 42 | 43 | [self.logoView sd_setImageWithURL:[NSURL URLWithString:model.icon]]; |
| 43 | 44 | self.titleLabel.text = model.title; |
| ... | ... | @@ -57,7 +58,7 @@ |
| 57 | 58 | if (!_titleLabel) { |
| 58 | 59 | _titleLabel = [[UILabel alloc] init]; |
| 59 | 60 | _titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; |
| 60 | - _titleLabel.font = UIFontMake(13); | |
| 61 | + _titleLabel.font = UIFontCNMake(11); | |
| 61 | 62 | _titleLabel.textColor = CNLiveColorWithHexString(@"#4A4A4A"); |
| 62 | 63 | _titleLabel.textAlignment = NSTextAlignmentCenter; |
| 63 | 64 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveSearchHotsFooterView.h
CNLiveCServiceModule/Classes/View/CNLiveSearchHotsFooterView.m
| ... | ... | @@ -55,7 +55,7 @@ |
| 55 | 55 | _clearBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 56 | 56 | [_clearBtn setTitle:@"清空记录" forState:UIControlStateNormal]; |
| 57 | 57 | [_clearBtn setTitleColor:CNLiveColorWithHexString(@"#00CD1E") forState:UIControlStateNormal]; |
| 58 | - _clearBtn.titleLabel.font = UIFontMake(13); | |
| 58 | + _clearBtn.titleLabel.font = UIFontCNMake(13); | |
| 59 | 59 | [_clearBtn sizeToFit]; |
| 60 | 60 | [_clearBtn addTarget:self action:@selector(clearAction) forControlEvents:UIControlEventTouchUpInside]; |
| 61 | 61 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveSearchListCell.m
CNLiveCServiceModule/Classes/View/CNLiveServiceChinasCell.m
| ... | ... | @@ -44,6 +44,7 @@ |
| 44 | 44 | _model = model; |
| 45 | 45 | if (model.subTitle && ![model.subTitle isEqualToString:@""]) { |
| 46 | 46 | self.subTitle.hidden = NO; |
| 47 | + _subTitle.font = UIFontCNMake(14); | |
| 47 | 48 | self.subTitle.text = [NSString stringWithFormat:@" %@",model.subTitle];; |
| 48 | 49 | [self.cycleView mas_remakeConstraints:^(MASConstraintMaker *make) { |
| 49 | 50 | make.top.equalTo(self.subTitle.mas_bottom).offset(-1); |
| ... | ... | @@ -67,7 +68,7 @@ |
| 67 | 68 | { |
| 68 | 69 | if (!_subTitle) { |
| 69 | 70 | _subTitle = [[UILabel alloc] init]; |
| 70 | - _subTitle.font = UIFontMake(14); | |
| 71 | + _subTitle.font = UIFontCNMake(14); | |
| 71 | 72 | _subTitle.textColor = UIColorHex(#333333); |
| 72 | 73 | _subTitle.backgroundColor = UIColorHex(#F9FAFB); |
| 73 | 74 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveServiceLookCell.m
| ... | ... | @@ -79,6 +79,8 @@ |
| 79 | 79 | #pragma mark - Setting&&Getting |
| 80 | 80 | - (void)setModel:(CNliveServicePageModel *)model |
| 81 | 81 | { |
| 82 | + _titleLabel.font = UIFontBoldCNMake(17); | |
| 83 | + _subTitlelabel.font = UIFontCNMake(12); | |
| 82 | 84 | _model = model; |
| 83 | 85 | [self.backImage sd_setImageWithURL:[NSURL URLWithString:model.background]]; |
| 84 | 86 | NSArray *dataArr = [self sqereList:model.contents]; |
| ... | ... | @@ -101,7 +103,7 @@ |
| 101 | 103 | { |
| 102 | 104 | if (!_titleLabel) { |
| 103 | 105 | _titleLabel = [[UILabel alloc] init]; |
| 104 | - _titleLabel.font = UIFontBoldMake(17); | |
| 106 | + _titleLabel.font = UIFontBoldCNMake(17); | |
| 105 | 107 | _titleLabel.textColor = CNLiveColorWithHexString(@"#1F74E9"); |
| 106 | 108 | _titleLabel.textAlignment = NSTextAlignmentLeft; |
| 107 | 109 | } |
| ... | ... | @@ -111,7 +113,7 @@ |
| 111 | 113 | { |
| 112 | 114 | if (!_subTitlelabel) { |
| 113 | 115 | _subTitlelabel = [[UILabel alloc] init]; |
| 114 | - _subTitlelabel.font = UIFontMake(12); | |
| 116 | + _subTitlelabel.font = UIFontCNMake(12); | |
| 115 | 117 | _subTitlelabel.textColor = CNLiveColorWithHexString(@"#1F74E9"); |
| 116 | 118 | _subTitlelabel.textAlignment = NSTextAlignmentLeft; |
| 117 | 119 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveServiceOrLookCell.m
| ... | ... | @@ -9,7 +9,6 @@ |
| 9 | 9 | @interface CNLiveServiceOrLookCell() |
| 10 | 10 | @property (nonatomic, strong) UIImageView *logoImage; |
| 11 | 11 | @property (nonatomic, strong) UILabel *titleLabel; |
| 12 | -@property (nonatomic, strong) UILabel *describe; | |
| 13 | 12 | @property (nonatomic, strong) QMUIButton *rightBtn; |
| 14 | 13 | @end |
| 15 | 14 | |
| ... | ... | @@ -19,7 +18,6 @@ |
| 19 | 18 | if (self) { |
| 20 | 19 | [self.contentView addSubview:self.logoImage]; |
| 21 | 20 | [self.contentView addSubview:self.titleLabel]; |
| 22 | - [self.contentView addSubview:self.describe]; | |
| 23 | 21 | [self.contentView addSubview:self.rightBtn]; |
| 24 | 22 | [self makeSubViewsLayout]; |
| 25 | 23 | } |
| ... | ... | @@ -40,28 +38,31 @@ |
| 40 | 38 | [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
| 41 | 39 | make.left.equalTo(self.logoImage.mas_right).offset(10); |
| 42 | 40 | make.centerY.equalTo(self.logoImage); |
| 43 | - }]; | |
| 44 | - [self.describe mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 45 | - make.left.equalTo(self.titleLabel.mas_right).offset(7); | |
| 46 | - make.centerY.equalTo(self.logoImage); | |
| 47 | - make.right.equalTo(self.rightBtn.mas_left).offset(-5); | |
| 41 | + make.right.equalTo(self.rightBtn.mas_left).offset(-10); | |
| 48 | 42 | }]; |
| 49 | 43 | } |
| 50 | 44 | #pragma mark - Setting&&getting |
| 51 | 45 | - (void)setModel:(CnLivePageContentModel *)model |
| 52 | 46 | { |
| 47 | + _titleLabel.font = UIFontCNMake(10); | |
| 53 | 48 | _model = model; |
| 54 | 49 | [self.logoImage sd_setImageWithURL:[NSURL URLWithString:model.poster]]; |
| 55 | - self.titleLabel.text = model.title; | |
| 50 | + NSMutableAttributedString *string = nil; | |
| 51 | + if (model.subTitle && [model.subTitle isKindOfClass:[NSString class]]) { | |
| 52 | + string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %@",model.title,model.subTitle]]; | |
| 53 | + }else{ | |
| 54 | + string = [[NSMutableAttributedString alloc] initWithString:model.title]; | |
| 55 | + } | |
| 56 | + | |
| 57 | + [string addAttribute:NSFontAttributeName value:UIFontCNMake(13) range:NSMakeRange(0, model.title.length)]; | |
| 58 | + [string addAttribute:NSForegroundColorAttributeName value:CNLiveColorWithHexString(@"#333333") range:NSMakeRange(0, model.title.length)]; | |
| 59 | + self.titleLabel.attributedText =string; | |
| 56 | 60 | [self.titleLabel sizeToFit]; |
| 57 | - self.describe.text = model.subTitle; | |
| 58 | - [self.describe sizeToFit]; | |
| 59 | 61 | } |
| 60 | 62 | - (void)setType:(CNLiveCellShowType)type |
| 61 | 63 | { |
| 62 | 64 | _type = type; |
| 63 | 65 | if (type == CNLiveCellShowTypeService) { |
| 64 | - self.describe.hidden = YES; | |
| 65 | 66 | [self.rightBtn setImage:[UIImage loadCServiceBundle:@"service_right"] forState:UIControlStateNormal]; |
| 66 | 67 | [self.rightBtn mas_remakeConstraints:^(MASConstraintMaker *make) { |
| 67 | 68 | make.right.equalTo(self.contentView).offset(-10); |
| ... | ... | @@ -70,7 +71,6 @@ |
| 70 | 71 | make.height.offset(18); |
| 71 | 72 | }]; |
| 72 | 73 | }else{ |
| 73 | - self.describe.hidden = NO; | |
| 74 | 74 | self.rightBtn.layer.cornerRadius = 9; |
| 75 | 75 | [self.rightBtn setTitle:@"进入 " forState:UIControlStateNormal]; |
| 76 | 76 | [self.rightBtn setImage:[UIImage loadCServiceBundle:@"service_enter"] forState:UIControlStateNormal]; |
| ... | ... | @@ -95,30 +95,18 @@ |
| 95 | 95 | { |
| 96 | 96 | if (!_titleLabel) { |
| 97 | 97 | _titleLabel = [[UILabel alloc] init]; |
| 98 | - _titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; | |
| 99 | - _titleLabel.font = UIFontMake(13); | |
| 100 | - _titleLabel.textColor = CNLiveColorWithHexString(@"#333333"); | |
| 98 | + _titleLabel.font = UIFontCNMake(10); | |
| 99 | + _titleLabel.textColor = CNLiveColorWithHexString(@"#A9A9A9"); | |
| 101 | 100 | _titleLabel.textAlignment = NSTextAlignmentLeft; |
| 102 | 101 | } |
| 103 | 102 | return _titleLabel; |
| 104 | 103 | } |
| 105 | -- (UILabel *)describe | |
| 106 | -{ | |
| 107 | - if (!_describe) { | |
| 108 | - _describe = [[UILabel alloc] init]; | |
| 109 | - _describe.lineBreakMode = NSLineBreakByTruncatingMiddle; | |
| 110 | - _describe.font = UIFontMake(10); | |
| 111 | - _describe.textColor = CNLiveColorWithHexString(@"#A9A9A9"); | |
| 112 | - _describe.textAlignment = NSTextAlignmentLeft; | |
| 113 | - } | |
| 114 | - return _describe; | |
| 115 | -} | |
| 116 | 104 | - (QMUIButton *)rightBtn |
| 117 | 105 | { |
| 118 | 106 | if (!_rightBtn) { |
| 119 | 107 | _rightBtn = [QMUIButton buttonWithType:UIButtonTypeCustom]; |
| 120 | 108 | _rightBtn.userInteractionEnabled = NO; |
| 121 | - _rightBtn.titleLabel.font = UIFontMake(10); | |
| 109 | + _rightBtn.titleLabel.font = UIFontCNMake(10); | |
| 122 | 110 | _rightBtn.imagePosition = QMUIButtonImagePositionRight; |
| 123 | 111 | [_rightBtn setTitleColor:kWhiteColor forState:UIControlStateNormal]; |
| 124 | 112 | } | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveVideoRecommendCell.m
| ... | ... | @@ -57,6 +57,10 @@ |
| 57 | 57 | #pragma mark - Setting&&getting |
| 58 | 58 | - (void)setModel:(CnLivePageContentModel *)model |
| 59 | 59 | { |
| 60 | + _titleLabel.font = UIFontCNMake(11); | |
| 61 | + _price.font = UIFontCNMake(11); | |
| 62 | + _oldPrice.font = UIFontCNMake(9); | |
| 63 | + _lookNum.titleLabel.font = UIFontCNMake(11); | |
| 60 | 64 | [_logoImage sd_setImageWithURL:[NSURL URLWithString:model.poster]]; |
| 61 | 65 | if (_type == CNLiveCellShowTypeHot) { |
| 62 | 66 | self.titleLabel.hidden = YES; |
| ... | ... | @@ -108,8 +112,8 @@ |
| 108 | 112 | NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:[model.desc dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&error]; |
| 109 | 113 | NSString *nowStr = dic[@"price"]; |
| 110 | 114 | NSMutableAttributedString *price = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"¥ %@",nowStr]]; |
| 111 | - [price addAttribute:NSFontAttributeName value:UIFontMake(15) range:NSMakeRange(0, price.length)]; | |
| 112 | - [price addAttribute:NSFontAttributeName value:UIFontMake(10) range:NSMakeRange(0, 1)]; | |
| 115 | + [price addAttribute:NSFontAttributeName value:UIFontCNMake(15) range:NSMakeRange(0, price.length)]; | |
| 116 | + [price addAttribute:NSFontAttributeName value:UIFontCNMake(10) range:NSMakeRange(0, 1)]; | |
| 113 | 117 | self.price.attributedText = price; |
| 114 | 118 | [self.price sizeToFit]; |
| 115 | 119 | NSString *oldStr = dic[@"prices"]; |
| ... | ... | @@ -156,7 +160,7 @@ |
| 156 | 160 | { |
| 157 | 161 | if (!_titleLabel) { |
| 158 | 162 | _titleLabel = [[UILabel alloc] init]; |
| 159 | - _titleLabel.font = UIFontMake(13); | |
| 163 | + _titleLabel.font = UIFontCNMake(11); | |
| 160 | 164 | _titleLabel.textColor = CNLiveColorWithHexString(@"#333333"); |
| 161 | 165 | _titleLabel.textAlignment = NSTextAlignmentLeft; |
| 162 | 166 | } |
| ... | ... | @@ -166,8 +170,7 @@ |
| 166 | 170 | { |
| 167 | 171 | if (!_price) { |
| 168 | 172 | _price = [[UILabel alloc] init]; |
| 169 | - _price.lineBreakMode = NSLineBreakByTruncatingMiddle; | |
| 170 | - _price.font = UIFontMake(12); | |
| 173 | + _price.font = UIFontCNMake(12); | |
| 171 | 174 | _price.textColor = CNLiveColorWithHexString(@"#FC1541"); |
| 172 | 175 | _price.textAlignment = NSTextAlignmentLeft; |
| 173 | 176 | } |
| ... | ... | @@ -177,8 +180,7 @@ |
| 177 | 180 | { |
| 178 | 181 | if (!_oldPrice) { |
| 179 | 182 | _oldPrice = [[UILabel alloc] init]; |
| 180 | - _oldPrice.lineBreakMode = NSLineBreakByTruncatingMiddle; | |
| 181 | - _oldPrice.font = UIFontMake(9); | |
| 183 | + _oldPrice.font = UIFontCNMake(9); | |
| 182 | 184 | _oldPrice.textColor = CNLiveColorWithHexString(@"#B4B4B4"); |
| 183 | 185 | _oldPrice.textAlignment = NSTextAlignmentLeft; |
| 184 | 186 | } |
| ... | ... | @@ -191,7 +193,7 @@ |
| 191 | 193 | _lookNum = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 192 | 194 | [_lookNum setImage:[UIImage loadCServiceBundle:@"listen"] forState:UIControlStateNormal]; |
| 193 | 195 | [_lookNum setTitleColor:CNLiveColorWithHexString(@"#9F9F9F") forState:UIControlStateNormal]; |
| 194 | - _lookNum.titleLabel.font = UIFontMake(11); | |
| 196 | + _lookNum.titleLabel.font = UIFontCNMake(11); | |
| 195 | 197 | } |
| 196 | 198 | return _lookNum; |
| 197 | 199 | } | ... | ... |
CNLiveCServiceModule/Classes/ViewController/CNLiveServiceSearchVC.m
| ... | ... | @@ -317,7 +317,7 @@ static NSString *HistoryFootID = @"HistoryFootID"; |
| 317 | 317 | _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 318 | 318 | [_cancelBtn setTitle:@"取消" forState:UIControlStateNormal]; |
| 319 | 319 | [_cancelBtn setTitleColor:CNLiveColorWithHexString(@"#00CD1E") forState:UIControlStateNormal]; |
| 320 | - _cancelBtn.titleLabel.font = UIFontMake(14); | |
| 320 | + _cancelBtn.titleLabel.font = UIFontCNMake(14); | |
| 321 | 321 | _cancelBtn.backgroundColor = kClearColor; |
| 322 | 322 | [_cancelBtn sizeToFit]; |
| 323 | 323 | [ _cancelBtn addTarget:self action:@selector(cancelBtnClick) forControlEvents:UIControlEventTouchUpInside]; | ... | ... |
CNLiveCServiceModule/Classes/ViewController/CNLiveServiceVC.m
| ... | ... | @@ -43,6 +43,7 @@ static NSString *CNGoodsOrVideoheaderID = @"CNLiveGoodsOrVideoHeaderView"; |
| 43 | 43 | - (void)requestService{ |
| 44 | 44 | self.isError = NO; |
| 45 | 45 | if (![CNLiveNetworking isNetworking]) { |
| 46 | + [_listCollectionView.mj_header endRefreshing]; | |
| 46 | 47 | if (self.dataSource.count>0 && self.pageListSource.count>0) { |
| 47 | 48 | return; |
| 48 | 49 | } |
| ... | ... | @@ -61,11 +62,7 @@ static NSString *CNGoodsOrVideoheaderID = @"CNLiveGoodsOrVideoHeaderView"; |
| 61 | 62 | self.hots = hots; |
| 62 | 63 | dispatch_group_leave(requestGroup); |
| 63 | 64 | } error:^{ |
| 64 | - | |
| 65 | 65 | strongself |
| 66 | - if (self.dataSource.count>0 && self.pageListSource.count>0) { | |
| 67 | - return; | |
| 68 | - } | |
| 69 | 66 | self.isError = YES; |
| 70 | 67 | dispatch_group_leave(requestGroup); |
| 71 | 68 | }]; |
| ... | ... | @@ -74,21 +71,21 @@ static NSString *CNGoodsOrVideoheaderID = @"CNLiveGoodsOrVideoHeaderView"; |
| 74 | 71 | weakSelf.pageListSource = dataArray; |
| 75 | 72 | dispatch_group_leave(requestGroup); |
| 76 | 73 | } error:^{ |
| 77 | - | |
| 78 | 74 | strongself |
| 79 | - if (self.dataSource.count>0 && self.pageListSource.count>0) { | |
| 80 | - return; | |
| 81 | - } | |
| 82 | 75 | self.isError = YES; |
| 83 | 76 | dispatch_group_leave(requestGroup); |
| 84 | 77 | }]; |
| 85 | 78 | dispatch_group_notify(requestGroup, dispatch_get_main_queue(), ^{ |
| 86 | 79 | strongself |
| 80 | + [self.listCollectionView.mj_header endRefreshing]; | |
| 87 | 81 | if (!self.isError) { |
| 88 | 82 | if (self.dataSource.count>0||self.pageListSource.count>0) { |
| 89 | 83 | [self.listCollectionView reloadData]; |
| 90 | 84 | } |
| 91 | 85 | }else{ |
| 86 | + if (self.dataSource.count>0||self.pageListSource.count>0) { | |
| 87 | + return; | |
| 88 | + } | |
| 92 | 89 | [self showEmptyViewWithImage:[UIImage loadCServiceBundle:@"service_failure"] text:@"加载失败,请点击重试" detailText:nil buttonTitle:@" 重试 " buttonAction:@selector(requestService)]; |
| 93 | 90 | self.emptyView.frame = CGRectMake(0, NavigationContentTop, SCREEN_WIDTH, SCREEN_HEIGHT-NavigationContentTop); |
| 94 | 91 | [self setCNAPIErrorEmptyView]; |
| ... | ... | @@ -102,6 +99,7 @@ static NSString *CNGoodsOrVideoheaderID = @"CNLiveGoodsOrVideoHeaderView"; |
| 102 | 99 | } |
| 103 | 100 | - (void)viewDidLoad { |
| 104 | 101 | [super viewDidLoad]; |
| 102 | + [self requestService]; | |
| 105 | 103 | self.view.backgroundColor = [UIColor whiteColor]; |
| 106 | 104 | [self.view addSubview:self.topBackView]; |
| 107 | 105 | [self.view sendSubviewToBack:self.topBackView]; |
| ... | ... | @@ -113,7 +111,6 @@ static NSString *CNGoodsOrVideoheaderID = @"CNLiveGoodsOrVideoHeaderView"; |
| 113 | 111 | { |
| 114 | 112 | [super viewWillAppear:animated]; |
| 115 | 113 | self.navigationController.navigationBarHidden = YES; |
| 116 | - [self requestService]; | |
| 117 | 114 | } |
| 118 | 115 | |
| 119 | 116 | - (void)viewWillDisappear:(BOOL)animated |
| ... | ... | @@ -273,6 +270,9 @@ static NSString *CNGoodsOrVideoheaderID = @"CNLiveGoodsOrVideoHeaderView"; |
| 273 | 270 | [_listCollectionView registerClass:[CNLiveRecommendCell class] forCellWithReuseIdentifier:CNRecommendCellID]; |
| 274 | 271 | [_listCollectionView registerClass:[CNLiveSearchHeaderView class] forSupplementaryViewOfKind:@"UICollectionElementKindSectionHeader" withReuseIdentifier:CNServiceheaderID]; |
| 275 | 272 | [_listCollectionView registerClass:[CNLiveGoodsOrVideoHeaderView class] forSupplementaryViewOfKind:@"UICollectionElementKindSectionHeader" withReuseIdentifier:CNGoodsOrVideoheaderID]; |
| 273 | + _listCollectionView.mj_header = [CNLiveRefreshHeader headerWithRefreshingBlock:^{ | |
| 274 | + [self requestService]; | |
| 275 | + }]; | |
| 276 | 276 | } |
| 277 | 277 | return _listCollectionView; |
| 278 | 278 | } | ... | ... |
Example/CNLiveCServiceModule.xcodeproj/project.pbxproj
| ... | ... | @@ -345,10 +345,12 @@ |
| 345 | 345 | "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework", |
| 346 | 346 | "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", |
| 347 | 347 | "${BUILT_PRODUCTS_DIR}/CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.framework", |
| 348 | + "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework", | |
| 348 | 349 | "${BUILT_PRODUCTS_DIR}/CNLiveCServiceModule/CNLiveCServiceModule.framework", |
| 349 | 350 | "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework", |
| 350 | 351 | "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework", |
| 351 | 352 | "${BUILT_PRODUCTS_DIR}/CNLiveCustomControl/CNLiveCustomControl.framework", |
| 353 | + "${BUILT_PRODUCTS_DIR}/CNLiveCustomUI/CNLiveCustomUI.framework", | |
| 352 | 354 | "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", |
| 353 | 355 | "${BUILT_PRODUCTS_DIR}/CNLiveNewTripartiteManagement/CNLiveNewTripartiteManagement.framework", |
| 354 | 356 | "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", |
| ... | ... | @@ -359,7 +361,15 @@ |
| 359 | 361 | "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework", |
| 360 | 362 | "${BUILT_PRODUCTS_DIR}/SDCycleScrollView/SDCycleScrollView.framework", |
| 361 | 363 | "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", |
| 364 | + "${BUILT_PRODUCTS_DIR}/YYAsyncLayer/YYAsyncLayer.framework", | |
| 365 | + "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework", | |
| 362 | 366 | "${BUILT_PRODUCTS_DIR}/YYCategories/YYCategories.framework", |
| 367 | + "${BUILT_PRODUCTS_DIR}/YYDispatchQueuePool/YYDispatchQueuePool.framework", | |
| 368 | + "${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework", | |
| 369 | + "${BUILT_PRODUCTS_DIR}/YYKeyboardManager/YYKeyboardManager.framework", | |
| 370 | + "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework", | |
| 371 | + "${BUILT_PRODUCTS_DIR}/YYText/YYText.framework", | |
| 372 | + "${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework", | |
| 363 | 373 | ); |
| 364 | 374 | name = "[CP] Embed Pods Frameworks"; |
| 365 | 375 | outputPaths = ( |
| ... | ... | @@ -367,10 +377,12 @@ |
| 367 | 377 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework", |
| 368 | 378 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", |
| 369 | 379 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessBaseModule.framework", |
| 380 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework", | |
| 370 | 381 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCServiceModule.framework", |
| 371 | 382 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework", |
| 372 | 383 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework", |
| 373 | 384 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomControl.framework", |
| 385 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomUI.framework", | |
| 374 | 386 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", |
| 375 | 387 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveNewTripartiteManagement.framework", |
| 376 | 388 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", |
| ... | ... | @@ -381,7 +393,15 @@ |
| 381 | 393 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework", |
| 382 | 394 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDCycleScrollView.framework", |
| 383 | 395 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", |
| 396 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYAsyncLayer.framework", | |
| 397 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework", | |
| 384 | 398 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCategories.framework", |
| 399 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYDispatchQueuePool.framework", | |
| 400 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework", | |
| 401 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYKeyboardManager.framework", | |
| 402 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework", | |
| 403 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYText.framework", | |
| 404 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYWebImage.framework", | |
| 385 | 405 | ); |
| 386 | 406 | runOnlyForDeploymentPostprocessing = 0; |
| 387 | 407 | shellPath = /bin/sh; | ... | ... |