Commit 0a5f7c4ec190567f8818ae3ff288b15646f3eda7
1 parent
7643f0cd
0.0.1
Showing
118 changed files
with
7481 additions
and
1 deletions
.gitignore
0 → 100644
| 1 | +# OS X | |
| 2 | +.DS_Store | |
| 3 | + | |
| 4 | +# Xcode | |
| 5 | +build/ | |
| 6 | +Products/ | |
| 7 | +*.pbxuser | |
| 8 | +!default.pbxuser | |
| 9 | +*.mode1v3 | |
| 10 | +!default.mode1v3 | |
| 11 | +*.mode2v3 | |
| 12 | +!default.mode2v3 | |
| 13 | +*.perspectivev3 | |
| 14 | +!default.perspectivev3 | |
| 15 | +xcuserdata/ | |
| 16 | +*.xccheckout | |
| 17 | +profile | |
| 18 | +*.moved-aside | |
| 19 | +DerivedData | |
| 20 | +*.hmap | |
| 21 | +*.ipa | |
| 22 | + | |
| 23 | +# Bundler | |
| 24 | +.bundle | |
| 25 | + | |
| 26 | +# Add this line if you want to avoid checking in source code from Carthage dependencies. | |
| 27 | +# Carthage/Checkouts | |
| 28 | + | |
| 29 | +Carthage/Build | |
| 30 | + | |
| 31 | +# We recommend against adding the Pods directory to your .gitignore. However | |
| 32 | +# you should judge for yourself, the pros and cons are mentioned at: | |
| 33 | +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control | |
| 34 | +# | |
| 35 | +# Note: if you ignore the Pods directory, make sure to uncomment | |
| 36 | +# `pod install` in .travis.yml | |
| 37 | +# | |
| 38 | +# Pods/ | ... | ... |
.travis.yml
0 → 100644
| 1 | +# references: | |
| 2 | +# * https://www.objc.io/issues/6-build-tools/travis-ci/ | |
| 3 | +# * https://github.com/supermarin/xcpretty#usage | |
| 4 | + | |
| 5 | +osx_image: xcode7.3 | |
| 6 | +language: objective-c | |
| 7 | +# cache: cocoapods | |
| 8 | +# podfile: Example/Podfile | |
| 9 | +# before_install: | |
| 10 | +# - gem install cocoapods # Since Travis is not always on latest version | |
| 11 | +# - pod install --project-directory=Example | |
| 12 | +script: | |
| 13 | +- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/CNLiveMyOrder.xcworkspace -scheme CNLiveMyOrder-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty | |
| 14 | +- pod lib lint | ... | ... |
CNLiveMyOrder.podspec
0 → 100644
| 1 | +# | |
| 2 | +# Be sure to run `pod lib lint CNLiveMyOrder.podspec' to ensure this is a | |
| 3 | +# valid spec before submitting. | |
| 4 | +# | |
| 5 | +# Any lines starting with a # are optional, but their use is encouraged | |
| 6 | +# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html | |
| 7 | +# | |
| 8 | + | |
| 9 | +Pod::Spec.new do |s| | |
| 10 | + s.name = 'CNLiveMyOrder' | |
| 11 | + s.version = '0.0.1' | |
| 12 | + s.summary = 'A short description of CNLiveMyOrder.' | |
| 13 | + s.description = <<-DESC | |
| 14 | +TODO: Add long description of the pod here. | |
| 15 | + DESC | |
| 16 | + | |
| 17 | + s.homepage = 'http://bj.gitlab.cnlive.com/ios-team/CNLiveMyOrder' | |
| 18 | + # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' | |
| 19 | + s.license = { :type => 'MIT', :file => 'LICENSE' } | |
| 20 | + s.author = { '殷巧娟' => '1427945373@qq.com' } | |
| 21 | + s.source = { :git => 'http://bj.gitlab.cnlive.com/ios-team/CNLiveMyOrder.git', :tag => s.version.to_s } | |
| 22 | + # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>' | |
| 23 | + | |
| 24 | + s.ios.deployment_target = '9.0' | |
| 25 | + s.subspec 'Model' do |model| | |
| 26 | + model.dependency 'CNLiveTripartiteManagement/Realm' | |
| 27 | + model.dependency 'CNLiveTripartiteManagement/MJExtension' | |
| 28 | + model.dependency 'CNLiveBaseKit' | |
| 29 | + model.source_files = 'CNLiveMyOrder/Classes/Model/*.{h,m}' | |
| 30 | + end | |
| 31 | + s.subspec 'View' do |view| | |
| 32 | + view.dependency 'CNLiveTripartiteManagement/QMUIKit' | |
| 33 | + view.dependency 'CNLiveMyOrder/Model' | |
| 34 | + view.dependency 'CNLiveBaseKit' | |
| 35 | + view.dependency 'CNLiveTripartiteManagement/Masonry' | |
| 36 | + view.dependency 'CNLiveCommonCategory' | |
| 37 | + view.dependency 'CNLiveTripartiteManagement/FLAnimatedImage' | |
| 38 | + view.dependency 'CNLiveTripartiteManagement/SDWebImage' | |
| 39 | + view.dependency 'CNLiveTripartiteManagement/YYKit' | |
| 40 | + view.dependency 'CNLiveRequestBastKit' | |
| 41 | + view.dependency 'CNLiveTripartiteManagement/MJRefresh' | |
| 42 | + view.dependency 'CNLiveCustomUI/CNLiveBasicsUI' | |
| 43 | + view.dependency 'CNLiveTripartiteManagement/MJExtension' | |
| 44 | + view.dependency 'CNLiveEnvironmentConfiguration' | |
| 45 | + view.dependency 'CNLiveUserManagement' | |
| 46 | + view.source_files = 'CNLiveMyOrder/Classes/View/*.{h,m}' | |
| 47 | + end | |
| 48 | + s.subspec 'Controller' do |controller| | |
| 49 | + #controller.dependency 'CNLiveMyOrder/Model' | |
| 50 | + controller.dependency 'CNLiveCommonClass' | |
| 51 | + controller.dependency 'CNLiveMyOrder/View' | |
| 52 | + controller.source_files = 'CNLiveMyOrder/Classes/Controller/*.{h,m}' | |
| 53 | + end | |
| 54 | + s.source_files = 'CNLiveMyOrder/Classes/**/*' | |
| 55 | + | |
| 56 | + s.resource_bundles = { | |
| 57 | + 'CNLiveMyOrder' => ['CNLiveMyOrder/Assets/CNLiveMyOrder.bundle'] | |
| 58 | + } | |
| 59 | + | |
| 60 | + # s.public_header_files = 'Pod/Classes/**/*.h' | |
| 61 | + s.frameworks = 'UIKit', 'Foundation' | |
| 62 | + # s.dependency 'AFNetworking', '~> 2.3' | |
| 63 | +end | ... | ... |
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/dd_quanbumeiyou.png
0 → 100644
3.84 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/dd_quanbumeiyou@2x.png
0 → 100644
4.72 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/dd_quanbumeiyou@3x.png
0 → 100644
11.5 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/dd_sixindaren.png
0 → 100644
1.23 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/dd_sixindaren@2x.png
0 → 100644
1.69 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/dd_sixindaren@3x.png
0 → 100644
2.23 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/dd_tuikuanchenggong.png
0 → 100644
14.8 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/dd_tuikuanchenggong@2x.png
0 → 100644
14.9 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/dd_tuikuanchenggong@3x.png
0 → 100644
15.2 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/drd_xing_quan.png
0 → 100644
1.2 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/drd_xing_quan@2x.png
0 → 100644
1.6 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/drd_xing_quan@3x.png
0 → 100644
2.09 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/ewm_lcon.png
0 → 100644
13.5 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/ewm_lcon@2x.png
0 → 100644
30.7 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/ewm_lcon@3x.png
0 → 100644
64.2 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/pyq_gengduo.png
0 → 100644
1.05 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/pyq_gengduo@2x.png
0 → 100644
1.24 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/pyq_gengduo@3x.png
0 → 100644
1.51 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/touxiang2.png
0 → 100644
2.99 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/touxiang2@2x.png
0 → 100644
4.4 KB
CNLiveMyOrder/Assets/CNLiveMyOrder.bundle/touxiang2@3x.png
0 → 100644
9.71 KB
CNLiveMyOrder/Classes/Controller/CNLiveMineOrderController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveMineOrderController.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNCommonViewController.h" | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveMineOrderController : CNCommonViewController | |
| 13 | +- (instancetype)initWithType:(NSInteger)type;//0全部 1待付款 2待收货 3待评价 | |
| 14 | +@end | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Controller/CNLiveMineOrderController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveMineOrderController.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveMineOrderController.h" | |
| 9 | +#import "CNLiveSegmentView.h" | |
| 10 | +#import "CNLiveBaseKit.h" | |
| 11 | +#import "UIColor+CNLiveExtension.h" | |
| 12 | +#import "CNLiveOrderListCommonView.h" | |
| 13 | +#define Segment_Height 50 | |
| 14 | +#define kViewCommonGrayColor [UIColor colorWithRed:0.97 green:0.97 blue:0.97 alpha:1.00] | |
| 15 | +@interface CNLiveMineOrderController ()<UIScrollViewDelegate> | |
| 16 | +@property (nonatomic, strong) CNLiveSegmentView *segmentView; | |
| 17 | +@property (nonatomic, strong) NSArray *orderDataArr; | |
| 18 | +@property (nonatomic, assign) NSInteger curSeleIndex; //0全部 1待付款 2待收货 3待评价 | |
| 19 | +@property (nonatomic, assign) CGFloat oldx; | |
| 20 | +@property (nonatomic, strong) UIScrollView *scrollView; | |
| 21 | +@property (nonatomic, strong) NSMutableArray *titleLists; | |
| 22 | +@property (nonatomic, strong) UIView *line; | |
| 23 | +@property (nonatomic, strong) UIButton *tempBtn; | |
| 24 | +@property (nonatomic, strong) CNLiveOrderListCommonView *allTblView; | |
| 25 | +@property (nonatomic, strong) CNLiveOrderListCommonView *payTblView; | |
| 26 | +@property (nonatomic, strong) CNLiveOrderListCommonView *goodsTblView; | |
| 27 | +@property (nonatomic, strong) CNLiveOrderListCommonView *evaluateTblView; | |
| 28 | +@end | |
| 29 | + | |
| 30 | +@implementation CNLiveMineOrderController | |
| 31 | + | |
| 32 | +- (instancetype)initWithType:(NSInteger)type { | |
| 33 | + if (self = [super init]) { | |
| 34 | + _curSeleIndex = type; | |
| 35 | + } | |
| 36 | + return self; | |
| 37 | +} | |
| 38 | +- (void)viewWillAppear:(BOOL)animated{ | |
| 39 | + [super viewWillAppear:animated]; | |
| 40 | + self.tabBarController.tabBar.hidden = YES; | |
| 41 | + self.navigationController.navigationBarHidden = NO; | |
| 42 | + [self refreshData]; | |
| 43 | + | |
| 44 | +} | |
| 45 | +- (void)viewDidLoad { | |
| 46 | + [super viewDidLoad]; | |
| 47 | + [self addTitleLables]; | |
| 48 | + [self serviceOrder]; | |
| 49 | + | |
| 50 | +} | |
| 51 | +#pragma mark - 服务订单 | |
| 52 | +- (void)serviceOrder { | |
| 53 | + [self.view addSubview:self.segmentView]; | |
| 54 | + [self.view addSubview:self.scrollView]; | |
| 55 | + [self.scrollView addSubview:self.allTblView]; | |
| 56 | + [self.scrollView addSubview:self.payTblView]; | |
| 57 | + [self.scrollView addSubview:self.goodsTblView]; | |
| 58 | + [self.scrollView addSubview:self.evaluateTblView]; | |
| 59 | +} | |
| 60 | + /** 添加标题栏 */ | |
| 61 | +- (void)addTitleLables { | |
| 62 | + UIScrollView *navScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 180, 44)]; | |
| 63 | + navScrollView.backgroundColor = [UIColor cyanColor]; | |
| 64 | + navScrollView.showsHorizontalScrollIndicator = NO; | |
| 65 | + navScrollView.showsVerticalScrollIndicator = NO; | |
| 66 | + // self.navigationItem.titleView = navScrollView; | |
| 67 | + UIView *line = [[UIView alloc]initWithFrame:CGRectMake(20, navScrollView.height-4, 50, 4)]; | |
| 68 | + line.backgroundColor = CNLiveColorWithHexString(KGreenColor); | |
| 69 | + line.layer.masksToBounds = YES; | |
| 70 | + line.layer.cornerRadius = 1; | |
| 71 | + [navScrollView addSubview:line]; | |
| 72 | + _line = line; | |
| 73 | + CGFloat lblW = navScrollView.width/self.titleLists.count; | |
| 74 | + CGFloat lblH = navScrollView.height-line.height; | |
| 75 | + CGFloat lblY = 0; | |
| 76 | + for (int i = 0; i < _titleLists.count; i++) { | |
| 77 | + CGFloat lblX = i * lblW; | |
| 78 | + UIButton *royalBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 79 | + royalBtn.frame = CGRectMake(lblX, lblY, lblW, lblH); | |
| 80 | + royalBtn.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size: 15]; | |
| 81 | + | |
| 82 | + if (0 == i) { | |
| 83 | + _tempBtn = royalBtn; | |
| 84 | + _tempBtn.selected = YES; | |
| 85 | + } | |
| 86 | + | |
| 87 | + royalBtn.tag = i; | |
| 88 | + royalBtn.userInteractionEnabled = YES; | |
| 89 | + [royalBtn addTarget:self action:@selector(lblClick:) forControlEvents:UIControlEventTouchUpInside]; | |
| 90 | + [royalBtn setTitle:_titleLists[i] forState:UIControlStateNormal]; | |
| 91 | + [royalBtn setTitleColor:CNLiveColorWithHexString(@"#4A4A4A") forState:UIControlStateNormal]; | |
| 92 | + [royalBtn setTitleColor:CNLiveColorWithHexString(KGreenColor) forState:UIControlStateSelected]; | |
| 93 | + royalBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; | |
| 94 | + | |
| 95 | + [navScrollView addSubview:royalBtn]; | |
| 96 | + } | |
| 97 | + self.navigationItem.titleView = navScrollView; | |
| 98 | +} | |
| 99 | +#pragma mark - Action | |
| 100 | + /** 标题栏label的点击事件 */ | |
| 101 | +- (void)lblClick:(UIButton *)sender{ | |
| 102 | +// _tempBtn.selected = NO; | |
| 103 | +// sender.selected = YES; | |
| 104 | +// _tempBtn = sender; | |
| 105 | +// _line.x = (sender.width-_line.width)*0.5+sender.width*sender.tag; | |
| 106 | +// if(sender.tag == 0){ | |
| 107 | +// _segmentView.hidden = NO; | |
| 108 | +// _scrollView.hidden = NO; | |
| 109 | +// | |
| 110 | +// [_tempBtn setTitleColor:CNLiveColorWithHexString(KGreenColor) forState:UIControlStateSelected]; | |
| 111 | +// _line.backgroundColor = CNLiveColorWithHexString(KGreenColor); | |
| 112 | +// | |
| 113 | +// self.vc.view.hidden = YES; | |
| 114 | +// [self.vc.view removeFromSuperview]; | |
| 115 | +// | |
| 116 | +// }else{ | |
| 117 | +// _segmentView.hidden = YES; | |
| 118 | +// _scrollView.hidden = YES; | |
| 119 | +// | |
| 120 | +// [_tempBtn setTitleColor:CNLiveColorWithHexString(@"#FF725C") forState:UIControlStateSelected]; | |
| 121 | +// _line.backgroundColor = CNLiveColorWithHexString(@"#FF725C"); | |
| 122 | +// | |
| 123 | +// [self.view addSubview:self.vc.view]; | |
| 124 | +// self.vc.view.hidden = NO; | |
| 125 | +// | |
| 126 | +// } | |
| 127 | +} | |
| 128 | +#pragma mark - Data | |
| 129 | + //刷新数据 | |
| 130 | +- (void)refreshData { | |
| 131 | + | |
| 132 | + switch (_curSeleIndex) { | |
| 133 | + case 0: { | |
| 134 | + [_allTblView refreshData]; | |
| 135 | + } | |
| 136 | + break; | |
| 137 | + | |
| 138 | + case 1: { | |
| 139 | + [_payTblView refreshData]; | |
| 140 | + } | |
| 141 | + break; | |
| 142 | + | |
| 143 | + case 2: { | |
| 144 | + [_goodsTblView refreshData]; | |
| 145 | + } | |
| 146 | + break; | |
| 147 | + | |
| 148 | + case 3: { | |
| 149 | + [_evaluateTblView refreshData]; | |
| 150 | + } | |
| 151 | + break; | |
| 152 | + | |
| 153 | + default: | |
| 154 | + break; | |
| 155 | + } | |
| 156 | +} | |
| 157 | +#pragma mark - Lazy | |
| 158 | +- (CNLiveSegmentView *)segmentView{ | |
| 159 | + __weak typeof(self) weakSelf = self; | |
| 160 | + if (!_segmentView) { | |
| 161 | + _segmentView = [[CNLiveSegmentView alloc] initWithFrame:CGRectMake(0, kNavigationBarHeight, KScreenWidth, Segment_Height) titles:@[@"全部",@"待付款", @"待收货", @"待评价"] curIndex:_curSeleIndex selectedBlock:^(NSInteger index) { | |
| 162 | + CGFloat x = index * self.view.width; | |
| 163 | + weakSelf.curSeleIndex = index; | |
| 164 | + [_scrollView setContentOffset:CGPointMake(x, 0) animated:NO]; | |
| 165 | + | |
| 166 | + [self refreshData]; | |
| 167 | + }]; | |
| 168 | + } | |
| 169 | + return _segmentView; | |
| 170 | +} | |
| 171 | +- (NSMutableArray *)titleLists{ | |
| 172 | + if (_titleLists == nil) { | |
| 173 | + _titleLists = [NSMutableArray arrayWithObjects:@"服务订单",@"商品订单",nil]; | |
| 174 | + } | |
| 175 | + return _titleLists; | |
| 176 | +} | |
| 177 | +- (UIScrollView *)scrollView{ | |
| 178 | + if (!_scrollView) { | |
| 179 | + _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, kNavigationBarHeight+Segment_Height, KScreenWidth, KScreenHeight-kNavigationBarHeight-Segment_Height)]; | |
| 180 | + _scrollView.contentSize = CGSizeMake(KScreenWidth * 4, KScreenHeight - kNavigationBarHeight - Segment_Height); | |
| 181 | + _scrollView.pagingEnabled = YES; | |
| 182 | + _scrollView.showsVerticalScrollIndicator = NO; | |
| 183 | + _scrollView.showsHorizontalScrollIndicator = NO; | |
| 184 | + _scrollView.bounces = NO; | |
| 185 | + _scrollView.delegate = self; | |
| 186 | + _scrollView.scrollEnabled = NO; | |
| 187 | + } | |
| 188 | + return _scrollView; | |
| 189 | +} | |
| 190 | +- (CNLiveOrderListCommonView *)allTblView{ | |
| 191 | + if (!_allTblView) { | |
| 192 | + _allTblView = [[CNLiveOrderListCommonView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, _scrollView.height) orderStatus:@"0"]; | |
| 193 | + } | |
| 194 | + return _allTblView; | |
| 195 | +} | |
| 196 | + | |
| 197 | +- (CNLiveOrderListCommonView *)payTblView{ | |
| 198 | + if (!_payTblView) { | |
| 199 | + _payTblView = [[CNLiveOrderListCommonView alloc] initWithFrame:CGRectMake(KScreenWidth, 0, KScreenWidth, KScreenHeight-kNavigationBarHeight-44) orderStatus:@"1"]; | |
| 200 | + } | |
| 201 | + return _payTblView; | |
| 202 | +} | |
| 203 | + | |
| 204 | +- (CNLiveOrderListCommonView *)goodsTblView{ | |
| 205 | + if (!_goodsTblView) { | |
| 206 | + _goodsTblView = [[CNLiveOrderListCommonView alloc] initWithFrame:CGRectMake(2*KScreenWidth, 0, KScreenWidth, KScreenHeight-kNavigationBarHeight-44) orderStatus:@"2"]; | |
| 207 | + } | |
| 208 | + return _goodsTblView; | |
| 209 | +} | |
| 210 | + | |
| 211 | +- (CNLiveOrderListCommonView *)evaluateTblView{ | |
| 212 | + if (!_evaluateTblView) { | |
| 213 | + _evaluateTblView = [[CNLiveOrderListCommonView alloc] initWithFrame:CGRectMake(3*KScreenWidth, 0, KScreenWidth, KScreenHeight-kNavigationBarHeight-44) orderStatus:@"3"]; | |
| 214 | + } | |
| 215 | + return _evaluateTblView; | |
| 216 | +} | |
| 217 | + | |
| 218 | + | |
| 219 | +@end | |
| 220 | + | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveAdminAddressModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveAdminAddressModel.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveAdminAddressModel : NSObject | |
| 13 | +@property (nonatomic, strong) NSString *contactName; //收货人 | |
| 14 | +@property (nonatomic, strong) NSString *contactPhone; //电话 | |
| 15 | +@property (nonatomic, strong) NSString *address; //地址 | |
| 16 | +@property (nonatomic, strong) NSString *contactId; //Id | |
| 17 | +@property (nonatomic, strong) NSString *defaultContact; //默认地址 | |
| 18 | +@property (nonatomic, assign) BOOL localDefault; //本地默认地址 | |
| 19 | +@property (nonatomic, assign) BOOL fromChat; | |
| 20 | +- (CGFloat)rowHeight; | |
| 21 | +@end | |
| 22 | + | |
| 23 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveAdminAddressModel.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveAdminAddressModel.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveAdminAddressModel.h" | |
| 9 | +#import "CNLiveBaseKit.h" | |
| 10 | +@interface CNLiveAdminAddressModel () | |
| 11 | +@property (nonatomic, assign) CGFloat height; | |
| 12 | +@end | |
| 13 | + | |
| 14 | +@implementation CNLiveAdminAddressModel | |
| 15 | +- (CGFloat)rowHeight { | |
| 16 | + | |
| 17 | + if (_height) { | |
| 18 | + return _height; | |
| 19 | + } else { | |
| 20 | + return [self calculateHeight]; | |
| 21 | + } | |
| 22 | + | |
| 23 | + return 0; | |
| 24 | +} | |
| 25 | + | |
| 26 | +- (CGFloat)calculateHeight { | |
| 27 | + | |
| 28 | + if (self.fromChat) { | |
| 29 | + CGSize size = CGSizeZero; | |
| 30 | + if (self.localDefault) { | |
| 31 | + size = [[NSString stringWithFormat:@"收货地址: %@", _address] textSizeIn:CGSizeMake(KScreenWidth-100, HUGE_VAL) font:[UIFont systemFontOfSize:13.0f]]; | |
| 32 | + } else { | |
| 33 | + size = [[NSString stringWithFormat:@"收货地址: %@", _address] textSizeIn:CGSizeMake(KScreenWidth-70, HUGE_VAL) font:[UIFont systemFontOfSize:13.0f]]; | |
| 34 | + } | |
| 35 | + | |
| 36 | + _height = size.height+42+16; | |
| 37 | + return size.height+42+16; //42:地址上边距 16:地址下边距 | |
| 38 | + | |
| 39 | + } else { | |
| 40 | + /* | |
| 41 | + 上白 20 | |
| 42 | + 收货人 size1 | |
| 43 | + 收货人下地址上 16 | |
| 44 | + 地址 size | |
| 45 | + 地址下白线上 19 | |
| 46 | + 线 0.5 | |
| 47 | + 线下button上 18 | |
| 48 | + button 29 | |
| 49 | + button下 18 | |
| 50 | + | |
| 51 | + */ | |
| 52 | + CGSize size = [[NSString stringWithFormat:@"收货地址: %@", _address] textSizeIn:CGSizeMake(KScreenWidth-40, HUGE_VAL) font:UIFontCNMake(15)]; | |
| 53 | + CGSize size1 = [@"收货人" textSizeIn:CGSizeMake(KScreenWidth-40, HUGE_VAL) font:UIFontCNMake(15)];//收货人的字体高度 | |
| 54 | + | |
| 55 | + _height = 20+size1.height+16+size.height+19+0.5+18+29*RATIO+22; | |
| 56 | + return _height; //20:收货人高度 40:底部button高度 | |
| 57 | + | |
| 58 | + } | |
| 59 | + | |
| 60 | +} | |
| 61 | + | |
| 62 | +@end | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveDefaultAddressItem.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveDefaultAddressItem.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveDefaultAddressItem : NSObject | |
| 13 | +@property (nonatomic ,copy) NSString *defaultContactAddress; //地址 | |
| 14 | +@property (nonatomic ,copy) NSString *defaultContactName; //名称 | |
| 15 | +@property (nonatomic ,copy) NSString *defaultContactPhone; //联系电话 | |
| 16 | +@end | |
| 17 | + | |
| 18 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveDefaultAddressItem.m
0 → 100644
CNLiveMyOrder/Classes/Model/CNLiveEditGoodsModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveEditGoodsModel.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveEditGoodsModel : NSObject | |
| 13 | +@property (nonatomic, strong) NSString *title; | |
| 14 | +@property (nonatomic, assign) NSInteger quantity; | |
| 15 | +@property (nonatomic, assign) CGFloat price; | |
| 16 | +@property (nonatomic, strong) NSString *goodsId; | |
| 17 | +@end | |
| 18 | + | |
| 19 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveEditGoodsModel.m
0 → 100644
CNLiveMyOrder/Classes/Model/CNLiveMineOrderItem.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveMineOrderItem.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import "CNLiveOrderList.h" | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +typedef NS_ENUM(NSUInteger, CNLiveMineOrderItemType) { | |
| 13 | + CNLiveMineOrderItemTypeIcon = 0, | |
| 14 | + CNLiveMineOrderItemTypeKind, | |
| 15 | + CNLiveMineOrderItemTypeServiceType, | |
| 16 | + CNLiveMineOrderItemTypeFee, | |
| 17 | + CNLiveMineOrderItemTypeTotal, | |
| 18 | + CNLiveMineOrderItemTypeFunction, | |
| 19 | + CNLiveMineOrderItemTypeAddress | |
| 20 | +}; | |
| 21 | +@interface CNLiveMineOrderItem : NSObject | |
| 22 | +@property (nonatomic, strong) CNLiveOrderList *orderList; | |
| 23 | +@property (nonatomic, assign) CNLiveMineOrderItemType type; | |
| 24 | +@end | |
| 25 | +typedef NS_ENUM(NSUInteger, CNLiveMineOrderButtonItemType) { | |
| 26 | + CNLiveMineOrderButtonItemTypeCancel = 0, //取消订单 | |
| 27 | + CNLiveMineOrderButtonItemTypeError, //订单有误 | |
| 28 | + CNLiveMineOrderButtonItemTypeConfirm, //确认订单 | |
| 29 | + CNLiveMineOrderButtonItemTypeEvaluate, //评价 | |
| 30 | + CNLiveMineOrderButtonItemTypeDelete, //删除订单 | |
| 31 | + CNLiveMineOrderButtonItemTypeContactDaRen, //联系达人 | |
| 32 | + CNLiveMineOrderButtonItemTypePay, //付款 | |
| 33 | + CNLiveMineOrderButtonItemTypeReminder, //催单 | |
| 34 | + CNLiveMineOrderButtonItemTypeRefund, //申请退款 | |
| 35 | + CNLiveMineOrderButtonItemTypeRefundDetail, //退款详情 | |
| 36 | + CNLiveMineOrderButtonItemTypeConfirmReceipt, //确认收货 | |
| 37 | + CNLiveMineOrderButtonItemTypeConfirmLogistics, //查看物流 | |
| 38 | +}; | |
| 39 | + | |
| 40 | +typedef NS_ENUM(NSUInteger, CNLiveMineOrderButtonType) { | |
| 41 | + CNLiveMineOrderButtonTypeGray = 0, | |
| 42 | + CNLiveMineOrderButtonTypeRed, | |
| 43 | +}; | |
| 44 | +@interface CNLiveMineOrderButtonItem : NSObject | |
| 45 | +@property (nonatomic, strong) NSString *title; | |
| 46 | +@property (nonatomic, assign) NSInteger tag; | |
| 47 | +@property (nonatomic, assign) CNLiveMineOrderButtonType type; | |
| 48 | ++ (CNLiveMineOrderButtonItem *)title:(NSString *)title type:(CNLiveMineOrderButtonType)type tag:(CNLiveMineOrderButtonItemType)tag; | |
| 49 | +@end | |
| 50 | +NS_ASSUME_NONNULL_END | |
| 51 | + | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveMineOrderItem.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveMineOrderItem.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveMineOrderItem.h" | |
| 9 | + | |
| 10 | +@implementation CNLiveMineOrderItem | |
| 11 | + | |
| 12 | + @end | |
| 13 | + | |
| 14 | +@implementation CNLiveMineOrderButtonItem | |
| 15 | + | |
| 16 | ++ (CNLiveMineOrderButtonItem *)title:(NSString *)title type:(CNLiveMineOrderButtonType)type tag:(CNLiveMineOrderButtonItemType)tag { | |
| 17 | + CNLiveMineOrderButtonItem *item = [[CNLiveMineOrderButtonItem alloc] init]; | |
| 18 | + item.title = title; | |
| 19 | + item.type = type; | |
| 20 | + item.tag = tag; | |
| 21 | + return item; | |
| 22 | +} | |
| 23 | +@end | |
| 24 | + | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveOrderContactItem.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderContactItem.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveOrderContactItem : NSObject | |
| 13 | +@property (nonatomic ,copy) NSString *contactName; //名字 | |
| 14 | +@property (nonatomic ,copy) NSString *contactAddress; //地址 | |
| 15 | +@property (nonatomic ,copy) NSString *contactPhone; //联系电话 | |
| 16 | +@end | |
| 17 | + | |
| 18 | +NS_ASSUME_NONNULL_END | |
| 19 | + | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveOrderContactItem.m
0 → 100644
CNLiveMyOrder/Classes/Model/CNLiveOrderList.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderList.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import "CNLiveOrderListIconBean.h" | |
| 10 | +#import "CNLiveOrderListOrderItem.h" | |
| 11 | +#import "CNLiveOrderContactItem.h" | |
| 12 | +#import "CNLiveOrderRefundItem.h" | |
| 13 | +#import "CNLiveDefaultAddressItem.h" | |
| 14 | +NS_ASSUME_NONNULL_BEGIN | |
| 15 | + | |
| 16 | +@interface CNLiveOrderList : NSObject | |
| 17 | +@property (nonatomic ,strong) CNLiveOrderListIconBean *iconBean; //达人信息 | |
| 18 | +@property (nonatomic ,strong) CNLiveOrderListOrderItem *orderItem; //订单内容 | |
| 19 | +@property (nonatomic ,strong) CNLiveOrderRefundItem *refundMsg; //退款详情 | |
| 20 | +@property (nonatomic ,strong) CNLiveOrderContactItem *contactMsg; //收货人信息 | |
| 21 | +@property (nonatomic ,strong) CNLiveDefaultAddressItem *defaultContactMsg; //默认收货地址 | |
| 22 | +@end | |
| 23 | + | |
| 24 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveOrderList.m
0 → 100644
CNLiveMyOrder/Classes/Model/CNLiveOrderListIconBean.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderListIconBean.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveOrderListIconBean : NSObject | |
| 13 | +@property (nonatomic ,copy) NSString *nickName; //昵称 | |
| 14 | +@property (nonatomic ,copy) NSString *userId; //id | |
| 15 | +@property (nonatomic ,copy) NSString *image; //头像 | |
| 16 | +@end | |
| 17 | + | |
| 18 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveOrderListIconBean.m
0 → 100644
CNLiveMyOrder/Classes/Model/CNLiveOrderListOrderItem.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderListOrderItem.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import <Realm/Realm.h> | |
| 10 | +#import "CNLiveEditGoodsModel.h" | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | +RLM_ARRAY_TYPE(CNLiveEditGoodsModel) | |
| 13 | +@interface CNLiveOrderListOrderItem : NSObject | |
| 14 | +@property (nonatomic ,copy) NSString *transactionId; //后台内部流水号 | |
| 15 | +@property (nonatomic ,copy) NSString *serviceImage; // | |
| 16 | +@property (nonatomic ,copy) NSString *nickName; //昵称 | |
| 17 | +@property (nonatomic ,copy) NSString *categoryName; //服务名称 | |
| 18 | +@property (nonatomic ,copy) NSString *confirmTime; //确认时间 | |
| 19 | +@property (nonatomic ,copy) NSString *createTime; //生成时间 | |
| 20 | +@property (nonatomic ,copy) NSString *deliveryTime; //发货时间 | |
| 21 | +@property (nonatomic ,copy) NSString *payTime; //支付时间 | |
| 22 | +@property (nonatomic ,copy) NSString *takeDeliveryTime; //收货时间 | |
| 23 | +@property (nonatomic ,copy) NSString *title; //标题 | |
| 24 | +@property (nonatomic ,copy) NSString *distributionContent; //配送方式名称 | |
| 25 | +@property (nonatomic ,copy) NSString *distributionType; //配送方式Id | |
| 26 | +@property (nonatomic ,copy) NSString *category; //服务类别Id | |
| 27 | +@property (nonatomic ,copy) NSString *orderId; //流水号 | |
| 28 | +@property (nonatomic ,copy) NSString *orderType; //订单类型 0.普通订单 1.二维码订单 3.d金色飞鹰 | |
| 29 | +@property (nonatomic ,copy) NSString *note; // | |
| 30 | +@property (nonatomic ,assign) NSInteger countdown; //倒计时 | |
| 31 | +@property (nonatomic ,assign) NSInteger status; //状态 | |
| 32 | +@property (nonatomic ,assign) float fee; //服务费 | |
| 33 | +@property (nonatomic ,assign) float price; //单价 | |
| 34 | +@property (nonatomic ,assign) float freight; //运费 | |
| 35 | +@property (nonatomic ,assign) NSInteger quantity; //数量 | |
| 36 | +@property (nonatomic ,assign) CGFloat totalPrice; //实际支付金额 | |
| 37 | +@property (nonatomic ,assign) CGFloat goodsTotalPrice; //商品总价 | |
| 38 | +@property (nonatomic ,assign) BOOL commentable; //是否已经评论 | |
| 39 | +@property (nonatomic ,assign) BOOL refundable; //可否退款 | |
| 40 | +@property (nonatomic ,strong) NSArray <CNLiveEditGoodsModel *><CNLiveEditGoodsModel>* goodsInfo; //商品列表 | |
| 41 | + | |
| 42 | + //获取订单列表页cellHeight | |
| 43 | +- (CGFloat)cellHeight; | |
| 44 | + | |
| 45 | +@end | |
| 46 | + | |
| 47 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveOrderListOrderItem.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderListOrderItem.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveOrderListOrderItem.h" | |
| 9 | +#import "MJExtension.h" | |
| 10 | +#import "CNLiveBaseKit.h" | |
| 11 | +@interface CNLiveOrderListOrderItem () | |
| 12 | +@property (nonatomic , assign) CGFloat height; | |
| 13 | +@end | |
| 14 | + | |
| 15 | +@implementation CNLiveOrderListOrderItem | |
| 16 | +- (instancetype)init | |
| 17 | + { | |
| 18 | + if (self = [super init]) { | |
| 19 | + [self loadModel]; | |
| 20 | + } | |
| 21 | + return self; | |
| 22 | + } | |
| 23 | + | |
| 24 | +- (void)loadModel | |
| 25 | + { | |
| 26 | + [CNLiveOrderListOrderItem mj_setupObjectClassInArray:^NSDictionary *{ | |
| 27 | + return @{@"goodsInfo":[CNLiveEditGoodsModel class]}; | |
| 28 | + }]; | |
| 29 | + } | |
| 30 | + | |
| 31 | +- (CGFloat)cellHeight { | |
| 32 | + | |
| 33 | + if (_height) { | |
| 34 | + return _height; | |
| 35 | + } | |
| 36 | + | |
| 37 | + NSInteger goodsCount = 0; | |
| 38 | + if ([self.goodsInfo count] > 0) { | |
| 39 | + goodsCount = [self.goodsInfo count]; | |
| 40 | + } else { | |
| 41 | + goodsCount = 1; | |
| 42 | + } | |
| 43 | + | |
| 44 | + // _height = 44 + goodsCount*25+42 + 40 + 51 + 10; | |
| 45 | + _height = 44*RATIO + goodsCount*80*RATIO + 42*RATIO + 5*RATIO + 51*RATIO + 10; | |
| 46 | + | |
| 47 | + return _height; | |
| 48 | + | |
| 49 | +} | |
| 50 | + | |
| 51 | + @end | |
| 52 | + | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveOrderModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderModel.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import "CNLiveOrderList.h" | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | +RLM_ARRAY_TYPE(CNLiveOrderList) | |
| 12 | +@interface CNLiveOrderModel : NSObject | |
| 13 | +@property (nonatomic ,assign) NSInteger total;// | |
| 14 | +@property (nonatomic ,assign) NSInteger pageNo;// | |
| 15 | +@property (nonatomic ,assign) NSInteger pageSize;// | |
| 16 | +@property (nonatomic ,assign) NSInteger current;// | |
| 17 | +@property (nonatomic ,assign) NSInteger totalPage;// | |
| 18 | +@property (nonatomic ,assign) BOOL last;// | |
| 19 | +@property (nonatomic ,assign) BOOL hasPrev;// | |
| 20 | +@property (nonatomic ,assign) BOOL hasNext;// | |
| 21 | +@property (nonatomic ,assign) BOOL first;// | |
| 22 | +@property (nonatomic ,strong) NSArray <CNLiveOrderList *><CNLiveOrderList>* orderList;//订单列表 | |
| 23 | +@end | |
| 24 | + | |
| 25 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveOrderModel.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderModel.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | + | |
| 9 | +#import "CNLiveOrderModel.h" | |
| 10 | +#import "MJExtension.h" | |
| 11 | +@implementation CNLiveOrderModel | |
| 12 | +- (instancetype)init | |
| 13 | +{ | |
| 14 | + if (self = [super init]) { | |
| 15 | + [self loadModel]; | |
| 16 | + } | |
| 17 | + return self; | |
| 18 | +} | |
| 19 | + | |
| 20 | +- (void)loadModel | |
| 21 | +{ | |
| 22 | + [CNLiveOrderModel mj_setupObjectClassInArray:^NSDictionary *{ | |
| 23 | + return @{@"orderList":[CNLiveOrderList class]}; | |
| 24 | + }]; | |
| 25 | +} | |
| 26 | +@end | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveOrderRefundItem.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderRefundItem.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import <Realm/Realm.h> | |
| 10 | +#import "CNLiveRefundImgPathItem.h" | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | +RLM_ARRAY_TYPE(CNLiveRefundImgPathItem) | |
| 13 | +@interface CNLiveOrderRefundItem : NSObject | |
| 14 | +@property (nonatomic ,copy) NSString *note; //备注 | |
| 15 | +@property (nonatomic ,copy) NSString *payType; //类型,微信还是支付宝 | |
| 16 | +@property (nonatomic ,copy) NSString *refundTime; //退款完成时间 | |
| 17 | +@property (nonatomic ,copy) NSString *sellerAcceptTime; //达人受理时间 | |
| 18 | +@property (nonatomic ,copy) NSString *platAcceptTime; //平台受理时间 | |
| 19 | +@property (nonatomic ,copy) NSString *applyTime; //申请退款时间 | |
| 20 | +@property (nonatomic ,copy) NSString *cause; //退款原因 | |
| 21 | +@property (nonatomic ,assign) float refundSum; //退款金额 | |
| 22 | +@property (nonatomic ,copy) NSString *reasonForRefusal; //拒绝退款原因 | |
| 23 | +@property (nonatomic ,strong) NSArray <CNLiveRefundImgPathItem *><CNLiveRefundImgPathItem>* imgPathArray;//图片URL数组 | |
| 24 | + | |
| 25 | +@end | |
| 26 | + | |
| 27 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveOrderRefundItem.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderRefundItem.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveOrderRefundItem.h" | |
| 9 | +#import "MJExtension.h" | |
| 10 | +@implementation CNLiveOrderRefundItem | |
| 11 | +- (instancetype)init | |
| 12 | +{ | |
| 13 | + if (self = [super init]) { | |
| 14 | + [self loadModel]; | |
| 15 | + } | |
| 16 | + return self; | |
| 17 | +} | |
| 18 | + | |
| 19 | +- (void)loadModel | |
| 20 | +{ | |
| 21 | + [CNLiveOrderRefundItem mj_setupObjectClassInArray:^NSDictionary *{ | |
| 22 | + return @{@"imgPathArray":[CNLiveRefundImgPathItem class]}; | |
| 23 | + }]; | |
| 24 | +} | |
| 25 | +@end | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveRefundImgPathItem.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveRefundImgPathItem.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveRefundImgPathItem : NSObject | |
| 13 | +@property (nonatomic, copy) NSString *imagePath; | |
| 14 | +@property (nonatomic, copy) NSString *thumbnailPath; | |
| 15 | +@end | |
| 16 | + | |
| 17 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Model/CNLiveRefundImgPathItem.m
0 → 100644
CNLiveMyOrder/Classes/Model/DSAddressModel.h
0 → 100644
| 1 | +// | |
| 2 | +// DSAddressModel.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface DSAddressModel : NSObject | |
| 13 | +/** | |
| 14 | + 地址id | |
| 15 | +*/ | |
| 16 | +@property (nonatomic,copy) NSString * id; | |
| 17 | +/** | |
| 18 | + 名称 | |
| 19 | +*/ | |
| 20 | +@property (nonatomic,copy) NSString * name; | |
| 21 | +/** | |
| 22 | + 联系电话 | |
| 23 | +*/ | |
| 24 | +@property (nonatomic,copy) NSString * phone; | |
| 25 | +/** | |
| 26 | + 用户填写的详细地址 | |
| 27 | +*/ | |
| 28 | +@property (nonatomic,copy) NSString * write_address; | |
| 29 | +/** | |
| 30 | + 详细地址 | |
| 31 | +*/ | |
| 32 | +@property (nonatomic,copy) NSString * address; | |
| 33 | +/** | |
| 34 | + 省id 0为没选择 | |
| 35 | +*/ | |
| 36 | +@property (nonatomic,copy) NSString * province_id; | |
| 37 | +/** | |
| 38 | + 市id 0为没选择 | |
| 39 | +*/ | |
| 40 | +@property (nonatomic,copy) NSString * city_id; | |
| 41 | +/** | |
| 42 | + 区县id 0为没选择 | |
| 43 | +*/ | |
| 44 | +@property (nonatomic,copy) NSString * area_id; | |
| 45 | +/** | |
| 46 | + 2为默认地址 其他为普通 | |
| 47 | +*/ | |
| 48 | +@property (nonatomic,assign) NSUInteger state; | |
| 49 | +/** | |
| 50 | + 用户id | |
| 51 | + */ | |
| 52 | +@property (nonatomic,copy) NSString * uid; | |
| 53 | +/** | |
| 54 | + 省市县名称 | |
| 55 | +*/ | |
| 56 | +@property (nonatomic,copy) NSString * city_name; | |
| 57 | +@end | |
| 58 | + | |
| 59 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/Model/DSAddressModel.m
0 → 100644
CNLiveMyOrder/Classes/View/CNCutDown.h
0 → 100644
| 1 | +// | |
| 2 | +// CNCutDown.h | |
| 3 | +// CNLiveNetAdd | |
| 4 | +// | |
| 5 | +// Created by iOS on 2018/3/13. | |
| 6 | +// Copyright © 2018年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <Foundation/Foundation.h> | |
| 10 | + | |
| 11 | +@interface CNCutDown : NSObject | |
| 12 | + | |
| 13 | +- (instancetype)initWithDuration:(NSInteger)duration interval:(NSInteger)interval unitEvent:(void(^)(NSInteger seconds))unit zeroEvent:(void(^)(void))zero; | |
| 14 | + | |
| 15 | +- (void)destroyTimer; | |
| 16 | + | |
| 17 | +@end | ... | ... |
CNLiveMyOrder/Classes/View/CNCutDown.m
0 → 100644
| 1 | +// | |
| 2 | +// CNCutDown.m | |
| 3 | +// CNLiveNetAdd | |
| 4 | +// | |
| 5 | +// Created by iOS on 2018/3/13. | |
| 6 | +// Copyright © 2018年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNCutDown.h" | |
| 10 | + | |
| 11 | +typedef void(^UnitEvent)(NSInteger seconds); | |
| 12 | +typedef void(^ZeroEvent)(void); | |
| 13 | + | |
| 14 | +@interface CNCutDown () | |
| 15 | +{ | |
| 16 | + NSTimer *_timer; | |
| 17 | + NSInteger _duration; | |
| 18 | + NSInteger _interval; | |
| 19 | +} | |
| 20 | + | |
| 21 | +@property (nonatomic, copy) UnitEvent unitEvent; | |
| 22 | +@property (nonatomic, copy) ZeroEvent zeroEvent; | |
| 23 | + | |
| 24 | +@end | |
| 25 | + | |
| 26 | +@implementation CNCutDown | |
| 27 | + | |
| 28 | +- (instancetype)initWithDuration:(NSInteger)duration interval:(NSInteger)interval unitEvent:(void (^)(NSInteger))unit zeroEvent:(void (^)(void))zero | |
| 29 | +{ | |
| 30 | + self = [super init]; | |
| 31 | + if (self) { | |
| 32 | + | |
| 33 | + self.unitEvent = unit; | |
| 34 | + self.zeroEvent = zero; | |
| 35 | + _duration = duration; | |
| 36 | + _interval = interval; | |
| 37 | + | |
| 38 | + _timer = [NSTimer scheduledTimerWithTimeInterval:1. target:self selector:@selector(cutdown) userInfo:nil repeats:YES]; | |
| 39 | + | |
| 40 | + } | |
| 41 | + return self; | |
| 42 | +} | |
| 43 | + | |
| 44 | +- (void)cutdown { | |
| 45 | + | |
| 46 | + _duration--; | |
| 47 | + | |
| 48 | + if (_duration == 0) { | |
| 49 | + | |
| 50 | + if (self.zeroEvent) { | |
| 51 | + self.zeroEvent(); | |
| 52 | + } | |
| 53 | + | |
| 54 | + if (_timer && [_timer isValid]) { | |
| 55 | + [_timer invalidate]; | |
| 56 | + _timer = nil; | |
| 57 | + } | |
| 58 | + | |
| 59 | + return; | |
| 60 | + } | |
| 61 | + | |
| 62 | + NSInteger remainder = _duration % _interval; | |
| 63 | + if (remainder == 0) { | |
| 64 | + if (self.unitEvent) { | |
| 65 | + self.unitEvent(_duration); | |
| 66 | + } | |
| 67 | + } | |
| 68 | + | |
| 69 | +} | |
| 70 | + | |
| 71 | +- (void)destroyTimer { | |
| 72 | + | |
| 73 | + if (_timer && [_timer isValid]) { | |
| 74 | + [_timer invalidate]; | |
| 75 | + _timer = nil; | |
| 76 | + } | |
| 77 | + | |
| 78 | +} | |
| 79 | + | |
| 80 | +@end | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveMineOrderTableViewCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveMineOrderTableViewCell.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <QMUIKit/QMUIKit.h> | |
| 9 | +#import "CNLiveOrderList.h" | |
| 10 | +#import "CNLiveMineOrderItem.h" | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | +@protocol CNLiveMineOrderTableViewCellDelegate <NSObject> | |
| 13 | + | |
| 14 | +- (void)cellWithOrderModel:(CNLiveOrderList *)model type:(CNLiveMineOrderButtonItemType)type; | |
| 15 | +@end | |
| 16 | +@interface CNLiveMineOrderTableViewCell : QMUITableViewCell | |
| 17 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 18 | +@property (nonatomic, assign) id<CNLiveMineOrderTableViewCellDelegate> delegate; | |
| 19 | + | |
| 20 | +- (void)configOrderList:(CNLiveOrderList *)list delegate:(id<CNLiveMineOrderTableViewCellDelegate>)delegate; | |
| 21 | +@end | |
| 22 | + | |
| 23 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveMineOrderTableViewCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveMineOrderTableViewCell.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveMineOrderTableViewCell.h" | |
| 9 | +#import "CNLiveMineOrderView.h" | |
| 10 | +#import "Masonry.h" | |
| 11 | +#import "CNLiveBaseKit.h" | |
| 12 | +#import "CNLiveOrderEventHandle.h" | |
| 13 | +#define Line_H 0.5 | |
| 14 | +/** 通用的间距值 */ | |
| 15 | +CGFloat const ZXMargin = 10; | |
| 16 | +@interface CNLiveMineOrderTableViewCell () | |
| 17 | +@property (nonatomic, strong) CNLiveIconView *iconView; | |
| 18 | +@property (nonatomic, strong) CNLiveKindView *kindView; | |
| 19 | +@property (nonatomic, strong) CNLiveTotalView *totalView; | |
| 20 | +@property (nonatomic, strong) CNLiveFuncView *funcView; | |
| 21 | +@property (nonatomic, strong) UIView *line1; | |
| 22 | +@property (nonatomic, strong) UIView *line2; | |
| 23 | +@property (nonatomic, strong) UIView *line3; | |
| 24 | +@end | |
| 25 | + | |
| 26 | +@implementation CNLiveMineOrderTableViewCell | |
| 27 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { | |
| 28 | + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { | |
| 29 | + self.backgroundColor = kWeChatBgColor; | |
| 30 | + [self initSubView]; | |
| 31 | + self.selectionStyle = UITableViewCellSelectionStyleGray; | |
| 32 | + } | |
| 33 | + return self; | |
| 34 | +} | |
| 35 | +- (void)initSubView{ | |
| 36 | + __weak typeof(self) weakSelf = self; | |
| 37 | + [self.contentView addSubview:self.iconView]; | |
| 38 | + [self.contentView addSubview:self.kindView]; | |
| 39 | + [self.contentView addSubview:self.totalView]; | |
| 40 | + [self.contentView addSubview:self.funcView]; | |
| 41 | + [self.contentView addSubview:self.line1]; | |
| 42 | + [self.contentView addSubview:self.line3]; | |
| 43 | + | |
| 44 | + [self p_addMasonry]; | |
| 45 | + self.funcView.funcBlock = ^(CNLiveMineOrderButtonItemType tag) { | |
| 46 | + | |
| 47 | + if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(cellWithOrderModel:type:)]) { | |
| 48 | + [weakSelf.delegate cellWithOrderModel:weakSelf.list type:tag]; | |
| 49 | + } | |
| 50 | + }; | |
| 51 | + self.iconView.darenHomeBlock = ^(CNLiveOrderList *list) { | |
| 52 | + // [CNOrderEventHandle darenHome:list]; | |
| 53 | + }; | |
| 54 | +} | |
| 55 | +- (void)configOrderList:(CNLiveOrderList *)list delegate:(id<CNLiveMineOrderTableViewCellDelegate>)delegate { | |
| 56 | + self.list = list; | |
| 57 | + self.delegate = delegate; | |
| 58 | + _iconView.list = list; | |
| 59 | + _kindView.list = list; | |
| 60 | + _totalView.list = list; | |
| 61 | + [self configFuncItems:list]; | |
| 62 | +} | |
| 63 | +-(void)setFrame:(CGRect)frame { | |
| 64 | + frame.size.height -= ZXMargin; | |
| 65 | + [super setFrame:frame]; | |
| 66 | +} | |
| 67 | +/** | |
| 68 | + * ((0-待确认,1-允许修改,2-取消订单,3-待支付,4-取消确认, 5-待发货,6-待收货,7-已收货,8-申请退款,9-确认退款,10-拒绝退款,11-退款失败,12-退款成功) | |
| 69 | +*/ | |
| 70 | +- (void)configFuncItems:(CNLiveOrderList *)list { | |
| 71 | + | |
| 72 | + CNLiveOrderListOrderItem *orderItem = list.orderItem; | |
| 73 | + | |
| 74 | + self.totalView.list = list; | |
| 75 | + | |
| 76 | + if (orderItem.status == 3) { //待支付 | |
| 77 | + [self funcItemType:1 statusText:@"等待买家付款"]; | |
| 78 | + } | |
| 79 | + | |
| 80 | + if (orderItem.status == 4) { //取消确认 | |
| 81 | + [self funcItemType:5 statusText:@"交易关闭"]; | |
| 82 | + } | |
| 83 | + | |
| 84 | + if (orderItem.status == 5) { //待发货 | |
| 85 | + [self funcItemType:2 statusText:@"待发货"]; | |
| 86 | + } | |
| 87 | + | |
| 88 | + if (orderItem.status == 6) { //已发货 | |
| 89 | + [self funcItemType:2 statusText:@"待收货"]; | |
| 90 | + } | |
| 91 | + | |
| 92 | + if (orderItem.status == 7) { //已收货,若已评价显示交易成功,未评价显示待评价 | |
| 93 | + if (orderItem.commentable == true) { | |
| 94 | + [self funcItemType:3 statusText:@"待评价"]; | |
| 95 | + } else { | |
| 96 | + [self funcItemType:0 statusText:@"交易成功"]; | |
| 97 | + } | |
| 98 | + | |
| 99 | + } | |
| 100 | + | |
| 101 | + if (orderItem.status == 8 || orderItem.status == 9) { //确认退款和申请退款为退款中状态 | |
| 102 | + [self funcItemType:4 statusText:@"退款中"]; | |
| 103 | + } | |
| 104 | + | |
| 105 | + if (orderItem.status == 11) { //退款失败 | |
| 106 | + [self funcItemType:6 statusText:@"退款中"]; | |
| 107 | + } | |
| 108 | + | |
| 109 | + if (orderItem.status == 10) { //拒绝退款 | |
| 110 | + [self funcItemType:2 statusText:@"退款失败"]; | |
| 111 | + } | |
| 112 | + | |
| 113 | + if (orderItem.status == 12) { //退款成功 | |
| 114 | + [self funcItemType:4 statusText:@"退款成功"]; | |
| 115 | + } | |
| 116 | + | |
| 117 | +} | |
| 118 | +- (void)funcItemType:(NSInteger)type statusText:(NSString *)text { | |
| 119 | + | |
| 120 | + [_iconView setStatusLabText:text]; | |
| 121 | + | |
| 122 | + switch (type) { | |
| 123 | + case 0: { //交易成功 | |
| 124 | + | |
| 125 | + CNLiveMineOrderButtonItem *btnItem1 = [CNLiveMineOrderButtonItem title:@"删除订单" type:CNLiveMineOrderButtonTypeGray tag:CNLiveMineOrderButtonItemTypeDelete]; | |
| 126 | + _funcView.funcItems = @[btnItem1]; | |
| 127 | + | |
| 128 | + } | |
| 129 | + break; | |
| 130 | + | |
| 131 | + case 1: { //代付款 | |
| 132 | + | |
| 133 | + CNLiveMineOrderButtonItem *btnItem2 = [CNLiveMineOrderButtonItem title:@"取消订单" type:CNLiveMineOrderButtonTypeGray tag:CNLiveMineOrderButtonItemTypeCancel]; | |
| 134 | + | |
| 135 | + CNLiveMineOrderButtonItem *btnItem3 = [CNLiveMineOrderButtonItem title:@"付款" type:CNLiveMineOrderButtonTypeRed tag:CNLiveMineOrderButtonItemTypePay]; | |
| 136 | + | |
| 137 | + _funcView.funcItems = @[btnItem3, btnItem2]; | |
| 138 | + | |
| 139 | + } | |
| 140 | + break; | |
| 141 | + | |
| 142 | + case 2: { //待收货 | |
| 143 | + | |
| 144 | + if (_list.orderItem.refundable == true) { | |
| 145 | + | |
| 146 | + CNLiveMineOrderButtonItem *btnItem1 = [CNLiveMineOrderButtonItem title:@"申请退款" type:CNLiveMineOrderButtonTypeRed tag:CNLiveMineOrderButtonItemTypeRefund]; | |
| 147 | + | |
| 148 | + CNLiveMineOrderButtonItem *btnItem3 = [CNLiveMineOrderButtonItem title:@"我要催单" type:CNLiveMineOrderButtonTypeGray tag:CNLiveMineOrderButtonItemTypeReminder]; | |
| 149 | + | |
| 150 | + _funcView.funcItems = @[btnItem1, btnItem3]; | |
| 151 | + | |
| 152 | + } else { | |
| 153 | + | |
| 154 | + CNLiveMineOrderButtonItem *btnItem3 = [CNLiveMineOrderButtonItem title:@"我要催单" type:CNLiveMineOrderButtonTypeGray tag:CNLiveMineOrderButtonItemTypeReminder]; | |
| 155 | + | |
| 156 | + CNLiveMineOrderButtonItem *btnItem4 = [CNLiveMineOrderButtonItem title:@"确认收货" type:CNLiveMineOrderButtonTypeRed tag:CNLiveMineOrderButtonItemTypeConfirmReceipt]; | |
| 157 | + | |
| 158 | + if (_list.orderItem.status == 5) { | |
| 159 | + _funcView.funcItems = @[btnItem3]; | |
| 160 | + } else { | |
| 161 | + _funcView.funcItems = @[btnItem4, btnItem3]; | |
| 162 | + } | |
| 163 | + | |
| 164 | + } | |
| 165 | + | |
| 166 | + } | |
| 167 | + break; | |
| 168 | + | |
| 169 | + case 3: { //待评价 | |
| 170 | + | |
| 171 | + CNLiveMineOrderButtonItem *btnItem1 = [CNLiveMineOrderButtonItem title:@"删除订单" type:CNLiveMineOrderButtonTypeGray tag:CNLiveMineOrderButtonItemTypeDelete]; | |
| 172 | + CNLiveMineOrderButtonItem *btnItem2 = [CNLiveMineOrderButtonItem title:@"评价" type:CNLiveMineOrderButtonTypeGray tag:CNLiveMineOrderButtonItemTypeEvaluate]; | |
| 173 | + | |
| 174 | + _funcView.funcItems = @[btnItem1, btnItem2]; | |
| 175 | + | |
| 176 | + } | |
| 177 | + break; | |
| 178 | + | |
| 179 | + case 4: { //退款 | |
| 180 | + | |
| 181 | + CNLiveMineOrderButtonItem *btnItem2 = [CNLiveMineOrderButtonItem title:@"退款详情" type:CNLiveMineOrderButtonTypeGray tag:CNLiveMineOrderButtonItemTypeRefundDetail]; | |
| 182 | + | |
| 183 | + _funcView.funcItems = @[btnItem2]; | |
| 184 | + | |
| 185 | + } | |
| 186 | + break; | |
| 187 | + | |
| 188 | + case 5: { //交易关闭 | |
| 189 | + | |
| 190 | + CNLiveMineOrderButtonItem *btnItem1 = [CNLiveMineOrderButtonItem title:@"删除订单" type:CNLiveMineOrderButtonTypeGray tag:CNLiveMineOrderButtonItemTypeDelete]; | |
| 191 | + | |
| 192 | + _funcView.funcItems = @[btnItem1]; | |
| 193 | + | |
| 194 | + } | |
| 195 | + break; | |
| 196 | + | |
| 197 | + case 6: { //退款失败 | |
| 198 | + | |
| 199 | + CNLiveMineOrderButtonItem *btnItem2 = [CNLiveMineOrderButtonItem title:@"退款详情" type:CNLiveMineOrderButtonTypeGray tag:CNLiveMineOrderButtonItemTypeRefundDetail]; | |
| 200 | + | |
| 201 | + CNLiveMineOrderButtonItem *btnItem3 = [CNLiveMineOrderButtonItem title:@"申请退款" type:CNLiveMineOrderButtonTypeRed tag:CNLiveMineOrderButtonItemTypeRefund]; | |
| 202 | + | |
| 203 | + _funcView.funcItems = @[btnItem3, btnItem2]; | |
| 204 | + | |
| 205 | + } | |
| 206 | + break; | |
| 207 | + | |
| 208 | + case 7: { //拒绝退款 | |
| 209 | + | |
| 210 | + CNLiveMineOrderButtonItem *btnItem1 = [CNLiveMineOrderButtonItem title:@"申请退款" type:CNLiveMineOrderButtonTypeRed tag:CNLiveMineOrderButtonItemTypeRefund]; | |
| 211 | + | |
| 212 | + CNLiveMineOrderButtonItem *btnItem3 = [CNLiveMineOrderButtonItem title:@"我要催单" type:CNLiveMineOrderButtonTypeGray tag:CNLiveMineOrderButtonItemTypeReminder]; | |
| 213 | + | |
| 214 | + CNLiveMineOrderButtonItem *btnItem4 = [CNLiveMineOrderButtonItem title:@"确认收货" type:CNLiveMineOrderButtonTypeRed tag:CNLiveMineOrderButtonItemTypeConfirmReceipt]; | |
| 215 | + | |
| 216 | + _funcView.funcItems = @[btnItem4, btnItem1, btnItem3]; | |
| 217 | + | |
| 218 | + } | |
| 219 | + break; | |
| 220 | + | |
| 221 | + default: | |
| 222 | + break; | |
| 223 | + } | |
| 224 | + | |
| 225 | +} | |
| 226 | + | |
| 227 | +- (void)p_addMasonry { | |
| 228 | + | |
| 229 | + [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 230 | + make.top.left.right.mas_equalTo(self.contentView); | |
| 231 | + make.height.mas_equalTo(44*RATIO); | |
| 232 | + }]; | |
| 233 | + | |
| 234 | + [self.line1 mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 235 | + make.left.mas_equalTo(self.contentView); | |
| 236 | + make.size.mas_equalTo(CGSizeMake(KScreenWidth, 0.5)); | |
| 237 | + make.bottom.mas_equalTo(self.iconView.mas_bottom); | |
| 238 | + }]; | |
| 239 | + | |
| 240 | + [self.kindView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 241 | + make.left.right.mas_equalTo(self.contentView); | |
| 242 | + make.top.mas_equalTo(self.iconView.mas_bottom); | |
| 243 | + }]; | |
| 244 | + [self.totalView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 245 | + make.left.right.mas_equalTo(self.contentView); | |
| 246 | + make.top.mas_equalTo(self.kindView.mas_bottom); | |
| 247 | + make.height.mas_equalTo(40*RATIO); | |
| 248 | + }]; | |
| 249 | + | |
| 250 | + [self.line3 mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 251 | + make.left.mas_equalTo(self.contentView); | |
| 252 | + make.size.mas_equalTo(CGSizeMake(KScreenWidth, 0.5)); | |
| 253 | + make.bottom.mas_equalTo(self.totalView.mas_bottom); | |
| 254 | + }]; | |
| 255 | + | |
| 256 | + [self.funcView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 257 | + make.left.right.mas_equalTo(self.contentView); | |
| 258 | + make.top.mas_equalTo(self.totalView.mas_bottom); | |
| 259 | + make.height.mas_equalTo(51*RATIO); | |
| 260 | + }]; | |
| 261 | + | |
| 262 | +} | |
| 263 | + | |
| 264 | +#pragma mark - | |
| 265 | +#pragma mark - Getter | |
| 266 | +- (CNLiveIconView *)iconView{ | |
| 267 | + if (!_iconView) { | |
| 268 | + _iconView = [[CNLiveIconView alloc] init]; | |
| 269 | + _iconView.smallIcon = YES; | |
| 270 | + } | |
| 271 | + return _iconView; | |
| 272 | +} | |
| 273 | + | |
| 274 | +- (CNLiveKindView *)kindView{ | |
| 275 | + if (!_kindView) { | |
| 276 | + _kindView = [[CNLiveKindView alloc] init]; | |
| 277 | + } | |
| 278 | + return _kindView; | |
| 279 | +} | |
| 280 | + | |
| 281 | +- (CNLiveTotalView *)totalView{ | |
| 282 | + if (!_totalView) { | |
| 283 | + _totalView = [[CNLiveTotalView alloc] init]; | |
| 284 | + } | |
| 285 | + return _totalView; | |
| 286 | +} | |
| 287 | + | |
| 288 | +- (CNLiveFuncView *)funcView{ | |
| 289 | + if (!_funcView) { | |
| 290 | + _funcView = [[CNLiveFuncView alloc] init]; | |
| 291 | + } | |
| 292 | + return _funcView; | |
| 293 | +} | |
| 294 | + | |
| 295 | +- (UIView *)line1{ | |
| 296 | + if (!_line1) { | |
| 297 | + _line1 = [[UIView alloc] init]; | |
| 298 | + _line1.backgroundColor = KGray227Color; | |
| 299 | + } | |
| 300 | + return _line1; | |
| 301 | +} | |
| 302 | + | |
| 303 | +- (UIView *)line2{ | |
| 304 | + if (!_line2) { | |
| 305 | + _line2 = [[UIView alloc] init]; | |
| 306 | + _line2.backgroundColor = KCommonLineColor; | |
| 307 | + } | |
| 308 | + return _line2; | |
| 309 | +} | |
| 310 | + | |
| 311 | +- (UIView *)line3{ | |
| 312 | + if (!_line3) { | |
| 313 | + _line3 = [[UIView alloc] init]; | |
| 314 | + _line3.backgroundColor = KGray227Color; | |
| 315 | + } | |
| 316 | + return _line3; | |
| 317 | +} | |
| 318 | + | |
| 319 | +@end | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveMineOrderView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveMineOrderView.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +#import "CNLiveMineOrderItem.h" | |
| 10 | +#import "DSAddressModel.h" | |
| 11 | +#import "CNLiveSelectRefundButton.h" | |
| 12 | +#import "FLAnimatedImageView.h" | |
| 13 | +NS_ASSUME_NONNULL_BEGIN | |
| 14 | + | |
| 15 | +@interface CNLiveMineOrderView : UIView | |
| 16 | + @property (nonatomic, strong) CNLiveMineOrderItem *item; | |
| 17 | +- (void)setTitle:(NSString *)title; | |
| 18 | + @end | |
| 19 | +/** | |
| 20 | + * 头像view | |
| 21 | + */ | |
| 22 | +typedef void(^DarenHomeBlock)(CNLiveOrderList *list); | |
| 23 | +@interface CNLiveIconView : UIView | |
| 24 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 25 | +@property (nonatomic, assign) BOOL smallIcon; | |
| 26 | +@property (nonatomic, copy) DarenHomeBlock darenHomeBlock; | |
| 27 | + | |
| 28 | +- (void)setStatusLabText:(NSString *)text; | |
| 29 | +@end | |
| 30 | +/** | |
| 31 | + * 订单内容view | |
| 32 | + */ | |
| 33 | +@interface CNLiveKindView : UIView | |
| 34 | + | |
| 35 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 36 | + | |
| 37 | +@end | |
| 38 | +/** | |
| 39 | + * 服务内容view | |
| 40 | + */ | |
| 41 | +@interface CNLiveServiceTypeView : UIView | |
| 42 | + | |
| 43 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 44 | + | |
| 45 | +@end | |
| 46 | + | |
| 47 | +/** | |
| 48 | + * 服务费view / 总价 | |
| 49 | + */ | |
| 50 | +@interface CNLiveOrderNormalView : UIView | |
| 51 | + | |
| 52 | +@property (nonatomic, assign) BOOL isFee; | |
| 53 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 54 | + | |
| 55 | +- (void)setTitle:(NSString *)title subTitle:(NSString *)subTitle; | |
| 56 | +@end | |
| 57 | +/** | |
| 58 | + * 总价view | |
| 59 | + */ | |
| 60 | +@interface CNLiveTotalView : UIView | |
| 61 | + | |
| 62 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 63 | +@end | |
| 64 | +/** | |
| 65 | + * 实付金额view | |
| 66 | + */ | |
| 67 | +@interface CNLiveActuallyPaidView : UIView | |
| 68 | + | |
| 69 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 70 | + | |
| 71 | +@end | |
| 72 | +/** | |
| 73 | + * 收货地址view | |
| 74 | + */ | |
| 75 | +@protocol CNLiveAddressViewDelegate <NSObject> | |
| 76 | + | |
| 77 | +- (void)selectedAddressComplete; | |
| 78 | + | |
| 79 | +@end | |
| 80 | +@interface CNLiveAddressView : UIView | |
| 81 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 82 | +@property (nonatomic, assign) BOOL allowEdit; | |
| 83 | +@property (nonatomic, assign) id<CNLiveAddressViewDelegate> delegate; | |
| 84 | +@property (nonatomic, strong) DSAddressModel *addressModel; | |
| 85 | + | |
| 86 | +/** | |
| 87 | + 更新首选地址 | |
| 88 | + @param address 地址 | |
| 89 | +*/ | |
| 90 | +- (void)updateFirstAddress:(id)address; | |
| 91 | + | |
| 92 | +@end | |
| 93 | +/** | |
| 94 | + * 功能按钮view | |
| 95 | + */ | |
| 96 | + | |
| 97 | +typedef void(^CNOrderFuncViewBlock)(CNLiveMineOrderButtonItemType tag); | |
| 98 | +@interface CNLiveFuncView : UIView | |
| 99 | + | |
| 100 | +@property (nonatomic, strong) NSArray<CNLiveMineOrderButtonItem *> *funcItems; | |
| 101 | +@property (nonatomic, strong) CNOrderFuncViewBlock funcBlock; | |
| 102 | +@end | |
| 103 | + | |
| 104 | + | |
| 105 | +/** | |
| 106 | + * 待收货状态view | |
| 107 | + */ | |
| 108 | +@interface CNLiveWaitReceivingView : UIView | |
| 109 | + | |
| 110 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 111 | +@end | |
| 112 | +/** | |
| 113 | + * 达人端,订单编号view | |
| 114 | + */ | |
| 115 | +@interface CNLiveRefundNumView : UIView | |
| 116 | + | |
| 117 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 118 | + | |
| 119 | +- (void)setStatusLabText:(NSString *)text; | |
| 120 | + | |
| 121 | +@end | |
| 122 | + | |
| 123 | + | |
| 124 | +/** | |
| 125 | + * 交易状态view | |
| 126 | + */ | |
| 127 | +@interface CNLiveOrderDetailStatusView : UIView | |
| 128 | + | |
| 129 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 130 | + | |
| 131 | +- (void)updateCutdown:(NSInteger)seconds; | |
| 132 | + | |
| 133 | +@end | |
| 134 | + | |
| 135 | +/** | |
| 136 | + * 联系达人view | |
| 137 | + */ | |
| 138 | + | |
| 139 | +typedef void(^ContactDarenBlock)(CNLiveOrderList *list); | |
| 140 | +@interface CNLiveContactDarenView : UIView | |
| 141 | + | |
| 142 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 143 | +@property (nonatomic, copy) ContactDarenBlock contactDarenBlock; | |
| 144 | +@end | |
| 145 | + | |
| 146 | +/** | |
| 147 | + * 退款流程view | |
| 148 | + */ | |
| 149 | +@interface CNLiveRefundProcessView : UIView | |
| 150 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 151 | +@end | |
| 152 | +/** | |
| 153 | + * 退款失败view | |
| 154 | + */ | |
| 155 | +@interface CNLiveRefundFailView : UIView | |
| 156 | + | |
| 157 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 158 | + | |
| 159 | +@end | |
| 160 | + | |
| 161 | +/** | |
| 162 | + * 退款原因view | |
| 163 | + */ | |
| 164 | +typedef void(^ReasonHandle)(void); | |
| 165 | +@interface CNLiveRefundReasonView : UIView | |
| 166 | + | |
| 167 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 168 | +@property (nonatomic, copy) ReasonHandle handle; | |
| 169 | +@property (nonatomic, strong) CNLiveSelectRefundButton *reasonBtn; | |
| 170 | + | |
| 171 | +- (void)setReasonText:(NSString *)text showMore:(BOOL)show; | |
| 172 | + | |
| 173 | +@end | |
| 174 | +/** | |
| 175 | + * 退款金额 | |
| 176 | + */ | |
| 177 | +@interface CNLiveRefundSumView : UIView | |
| 178 | + | |
| 179 | +@property (nonatomic, strong) UITextField *sumTextField; | |
| 180 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 181 | +@end | |
| 182 | + | |
| 183 | +/** | |
| 184 | + * 退款说明 | |
| 185 | + */ | |
| 186 | +@interface CNLiveRefundNoteView : UIView | |
| 187 | + | |
| 188 | +@property (nonatomic, strong) UITextField *noteTextField; | |
| 189 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 190 | +@end | |
| 191 | +/** | |
| 192 | + * 退款原因和说明,退款详情页面使用 | |
| 193 | + */ | |
| 194 | +@interface CNLiveRefundReasonAndNoteView : UIView | |
| 195 | + | |
| 196 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 197 | + | |
| 198 | +@end | |
| 199 | +/** | |
| 200 | + * 退款详情凭证view | |
| 201 | + */ | |
| 202 | +@protocol CNLiveRefundVoucherViewDelegate <NSObject> | |
| 203 | + | |
| 204 | +@optional | |
| 205 | +- (void)picSelected:(NSArray *)imagesArr urls:(NSArray *)urls thumbUrlsArr:(NSArray *)thumbUrlsArr selectedView:(FLAnimatedImageView *)selectedView Index:(NSInteger)index; | |
| 206 | + | |
| 207 | +@end | |
| 208 | +@interface CNLiveRefundVoucherView : UIView | |
| 209 | + | |
| 210 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 211 | +@property (nonatomic, assign) id<CNLiveRefundVoucherViewDelegate> delegate; | |
| 212 | +@end | |
| 213 | +/** | |
| 214 | + * 评价星星view | |
| 215 | + */ | |
| 216 | + | |
| 217 | +@protocol CNLiveEvaluateStarViewDelegate <NSObject> | |
| 218 | + | |
| 219 | +- (void)updateScore:(CGFloat)score; | |
| 220 | + | |
| 221 | +@end | |
| 222 | +@interface CNLiveEvaluateStarView : UIView | |
| 223 | + | |
| 224 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 225 | +@property (nonatomic, assign) id<CNLiveEvaluateStarViewDelegate> delagete; | |
| 226 | +@end | |
| 227 | + | |
| 228 | +/** | |
| 229 | + * 订单相关时间view | |
| 230 | + */ | |
| 231 | +@interface CNLiveOrderTimeView : UIView | |
| 232 | + | |
| 233 | +@property (nonatomic, strong) CNLiveOrderList *list; | |
| 234 | + | |
| 235 | +@end | |
| 236 | + | |
| 237 | +NS_ASSUME_NONNULL_END | |
| 238 | + | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveMineOrderView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveMineOrderView.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveMineOrderView.h" | |
| 9 | +#import "CNLiveVoucherView.h" | |
| 10 | +#import "UIColor+CNLiveExtension.h" | |
| 11 | +#import "Masonry.h" | |
| 12 | +#import "UIImageView+WebCache.h" | |
| 13 | +#import <QMUIKit/QMUIKit.h> | |
| 14 | +#import "CNLiveCommonCategory.h" | |
| 15 | +#import "CNLiveBaseKit.h" | |
| 16 | +#define Large_Font [UIFont systemFontOfSize:15.0f] | |
| 17 | +#define Default_Font [UIFont systemFontOfSize:15.0f] | |
| 18 | +#define Small_Font [UIFont systemFontOfSize:14.0f] | |
| 19 | + | |
| 20 | +#define Icon_Width 40 | |
| 21 | +#define Small_Icon_Width 30 | |
| 22 | +#define Default_Space 15 | |
| 23 | +//25 | |
| 24 | +#define OrderContent_H 80 | |
| 25 | +#define kDefaultUserIcon [UIImage imageNamed:@"touxiang2"] | |
| 26 | +@interface CNLiveMineOrderView () | |
| 27 | +@property (nonatomic, strong) UILabel *titleLab; | |
| 28 | +@end | |
| 29 | +@implementation CNLiveMineOrderView | |
| 30 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 31 | + self = [super initWithFrame:frame]; | |
| 32 | + if (self) { | |
| 33 | + self.backgroundColor = [UIColor whiteColor]; | |
| 34 | + [self addSubview:self.titleLab]; | |
| 35 | + [self p_addMasonry]; | |
| 36 | + } | |
| 37 | + return self; | |
| 38 | +} | |
| 39 | +- (void)setTitle:(NSString *)title { | |
| 40 | + _titleLab.text = title; | |
| 41 | +} | |
| 42 | +- (void)p_addMasonry { | |
| 43 | + | |
| 44 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 45 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 46 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 47 | + }]; | |
| 48 | + | |
| 49 | +} | |
| 50 | +#pragma mark - Getter | |
| 51 | +- (UILabel *)titleLab { | |
| 52 | + if (!_titleLab) { | |
| 53 | + _titleLab = [[UILabel alloc] init]; | |
| 54 | + _titleLab.font = UIFontCNMake(15); | |
| 55 | + } | |
| 56 | + return _titleLab; | |
| 57 | +} | |
| 58 | +@end | |
| 59 | +#pragma mark - CNLiveIconView | |
| 60 | +@interface CNLiveIconView () | |
| 61 | +@property (nonatomic, strong) UIImageView *iconView; | |
| 62 | +@property (nonatomic, strong) QMUIButton *nameBtn; | |
| 63 | +@property (nonatomic ,strong) UIImageView *detailView; | |
| 64 | +@property (nonatomic ,strong) QMUILabel *statusLab; | |
| 65 | +@end | |
| 66 | +@implementation CNLiveIconView | |
| 67 | + | |
| 68 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 69 | + self = [super initWithFrame:frame]; | |
| 70 | + if (self) { | |
| 71 | + | |
| 72 | + self.backgroundColor = [UIColor whiteColor]; | |
| 73 | + [self addSubview:self.iconView]; | |
| 74 | + [self addSubview:self.nameBtn]; | |
| 75 | + [self addSubview:self.detailView]; | |
| 76 | + [self addSubview:self.statusLab]; | |
| 77 | + } | |
| 78 | + return self; | |
| 79 | +} | |
| 80 | +- (void)setSmallIcon:(BOOL)smallIcon { | |
| 81 | + | |
| 82 | + if (smallIcon) { | |
| 83 | + | |
| 84 | + self.iconView.layer.cornerRadius = 15; | |
| 85 | + | |
| 86 | + [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 87 | + make.left.mas_equalTo(self.mas_left).mas_offset(15); | |
| 88 | + make.width.height.mas_equalTo(Small_Icon_Width); | |
| 89 | + make.top.mas_equalTo(10); | |
| 90 | + }]; | |
| 91 | + | |
| 92 | + [self.nameBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 93 | + make.centerY.mas_equalTo(self.iconView.mas_centerY); | |
| 94 | + make.left.mas_equalTo(self.iconView.mas_right).mas_offset(Default_Space); | |
| 95 | + }]; | |
| 96 | + | |
| 97 | + [self.detailView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 98 | + make.centerY.mas_equalTo(self.iconView.mas_centerY); | |
| 99 | + make.left.mas_equalTo(self.nameBtn.mas_right).mas_offset(Default_Space); | |
| 100 | + make.right.mas_lessThanOrEqualTo(self.statusLab.mas_left).mas_offset(-Default_Space); | |
| 101 | + }]; | |
| 102 | + | |
| 103 | + [self.statusLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 104 | + make.centerY.mas_equalTo(self.iconView.mas_centerY); | |
| 105 | + make.right.mas_equalTo(self.mas_right).mas_offset(-15); | |
| 106 | + }]; | |
| 107 | + } else { | |
| 108 | + [self p_addMasonry]; | |
| 109 | + } | |
| 110 | + | |
| 111 | +} | |
| 112 | +- (void)setList:(CNLiveOrderList *)list { | |
| 113 | + _list = list; | |
| 114 | + CNLiveOrderListIconBean *iconBean = list.iconBean; | |
| 115 | + [self.iconView sd_setImageWithURL:[NSURL URLWithString:iconBean.image] placeholderImage:kDefaultUserIcon]; | |
| 116 | + [self.nameBtn setTitle:iconBean.nickName forState:UIControlStateNormal]; | |
| 117 | + | |
| 118 | +} | |
| 119 | + | |
| 120 | +- (void)setStatusLabText:(NSString *)text { | |
| 121 | + self.statusLab.text = text; | |
| 122 | +} | |
| 123 | + | |
| 124 | +- (void)nameBtnDidSelected { | |
| 125 | + if (self.darenHomeBlock) { | |
| 126 | + self.darenHomeBlock(_list); | |
| 127 | + } | |
| 128 | +} | |
| 129 | + | |
| 130 | +#pragma mark - Masonry | |
| 131 | +- (void)p_addMasonry { | |
| 132 | + | |
| 133 | + [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 134 | + make.left.mas_equalTo(self.mas_left).mas_offset(Default_Space); | |
| 135 | + make.width.height.mas_equalTo(Icon_Width); | |
| 136 | + make.top.mas_equalTo(21); | |
| 137 | + }]; | |
| 138 | + | |
| 139 | + [self.nameBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 140 | + make.centerY.mas_equalTo(self.iconView.mas_centerY); | |
| 141 | + make.left.mas_equalTo(self.iconView.mas_right).mas_offset(10); | |
| 142 | + }]; | |
| 143 | + | |
| 144 | + [self.detailView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 145 | + make.centerY.mas_equalTo(self.iconView.mas_centerY); | |
| 146 | + make.left.mas_equalTo(self.nameBtn.mas_right).mas_offset(10); | |
| 147 | + }]; | |
| 148 | + | |
| 149 | +} | |
| 150 | +#pragma mark - Getter | |
| 151 | +- (UIImageView *)iconView{ | |
| 152 | + if (!_iconView) { | |
| 153 | + _iconView = [UIImageView new]; | |
| 154 | + _iconView.backgroundColor = kRedColor; | |
| 155 | + _iconView.layer.masksToBounds = YES; | |
| 156 | + _iconView.layer.cornerRadius = 20; | |
| 157 | + } | |
| 158 | + return _iconView; | |
| 159 | +} | |
| 160 | + | |
| 161 | +- (UIImageView *)detailView{ | |
| 162 | + if (!_detailView) { | |
| 163 | + _detailView = [UIImageView new]; | |
| 164 | + _detailView.image = [UIImage imageNamed:@"pyq_gengduo"]; | |
| 165 | + } | |
| 166 | + return _detailView; | |
| 167 | +} | |
| 168 | + | |
| 169 | +- (QMUIButton *)nameBtn{ | |
| 170 | + if (!_nameBtn) { | |
| 171 | + _nameBtn = [QMUIButton buttonWithType:UIButtonTypeCustom]; | |
| 172 | + [_nameBtn setTitle:@"昵称" forState:UIControlStateNormal]; | |
| 173 | + _nameBtn.titleLabel.font = UIFontCNMake(15); | |
| 174 | + [_nameBtn addTarget:self action:@selector(nameBtnDidSelected) forControlEvents:UIControlEventTouchUpInside]; | |
| 175 | + [_nameBtn setTitleColor:KTextBlackColor forState:UIControlStateNormal]; | |
| 176 | + _nameBtn.qmui_outsideEdge = UIEdgeInsetsMake(-20, -50, -20, -50); | |
| 177 | + } | |
| 178 | + return _nameBtn; | |
| 179 | +} | |
| 180 | + | |
| 181 | +- (QMUILabel *)statusLab { | |
| 182 | + if (!_statusLab) { | |
| 183 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 184 | + label.backgroundColor = [UIColor clearColor]; | |
| 185 | + label.textColor = KOrderRedColor; | |
| 186 | + label.font = UIFontCNMake(15); | |
| 187 | + label.textAlignment = NSTextAlignmentRight; | |
| 188 | + _statusLab = label; | |
| 189 | + } | |
| 190 | + return _statusLab; | |
| 191 | +} | |
| 192 | + | |
| 193 | +@end | |
| 194 | +#pragma mark - | |
| 195 | +#pragma mark - OrderListContentTitleView | |
| 196 | +@interface OrderListContentTitleView : UIView | |
| 197 | +@property (nonatomic, strong) UILabel *titleLab; | |
| 198 | +@property (nonatomic, strong) UILabel *quantityLab; | |
| 199 | +@property (nonatomic, strong) UILabel *priceLab; | |
| 200 | +@end | |
| 201 | + | |
| 202 | +@implementation OrderListContentTitleView | |
| 203 | + | |
| 204 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 205 | + self = [super initWithFrame:frame]; | |
| 206 | + if (self) { | |
| 207 | + self.backgroundColor = kWhiteColor; | |
| 208 | + [self addSubview:self.titleLab]; | |
| 209 | + [self addSubview:self.quantityLab]; | |
| 210 | + [self addSubview:self.priceLab]; | |
| 211 | + [self p_addMasonry]; | |
| 212 | + } | |
| 213 | + return self; | |
| 214 | +} | |
| 215 | + | |
| 216 | +- (void)p_addMasonry { | |
| 217 | + | |
| 218 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 219 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 220 | + make.top.mas_equalTo(self).mas_offset(17); | |
| 221 | + make.right.mas_equalTo(self.quantityLab.mas_left).mas_offset(-14); | |
| 222 | + }]; | |
| 223 | + | |
| 224 | + [self.priceLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 225 | + make.right.mas_equalTo(self).mas_offset(-Default_Space); | |
| 226 | + make.top.mas_equalTo(self.titleLab.mas_top); | |
| 227 | + make.width.mas_equalTo(self.mas_width).multipliedBy(0.2); | |
| 228 | + }]; | |
| 229 | + | |
| 230 | + [self.quantityLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 231 | + make.right.mas_equalTo(self.priceLab.mas_left).mas_offset(-10); | |
| 232 | + make.top.mas_equalTo(self.titleLab.mas_top); | |
| 233 | + make.width.mas_equalTo(self.mas_width).multipliedBy(0.2); | |
| 234 | + }]; | |
| 235 | + | |
| 236 | +} | |
| 237 | + | |
| 238 | +#pragma mark - | |
| 239 | +#pragma mark - Getter | |
| 240 | +- (UILabel *)titleLab{ | |
| 241 | + if (!_titleLab) { | |
| 242 | + _titleLab = [[UILabel alloc] init]; | |
| 243 | + _titleLab.text = @"种类"; | |
| 244 | + _titleLab.font = UIFontCNMake(15); | |
| 245 | + _titleLab.textColor = KTextBlackColor; | |
| 246 | + _titleLab.textAlignment = NSTextAlignmentLeft; | |
| 247 | + } | |
| 248 | + return _titleLab; | |
| 249 | +} | |
| 250 | + | |
| 251 | +- (UILabel *)quantityLab{ | |
| 252 | + if (!_quantityLab) { | |
| 253 | + _quantityLab = [[UILabel alloc] init]; | |
| 254 | + _quantityLab.text = @"数量"; | |
| 255 | + _quantityLab.font = UIFontCNMake(15); | |
| 256 | + _quantityLab.textColor = KTextBlackColor; | |
| 257 | + _quantityLab.textAlignment = NSTextAlignmentCenter; | |
| 258 | + } | |
| 259 | + return _quantityLab; | |
| 260 | +} | |
| 261 | + | |
| 262 | +- (UILabel *)priceLab{ | |
| 263 | + if (!_priceLab) { | |
| 264 | + _priceLab = [[UILabel alloc] init]; | |
| 265 | + _priceLab.text = @"价格"; | |
| 266 | + _priceLab.font = UIFontCNMake(15); | |
| 267 | + _priceLab.textColor = KTextBlackColor; | |
| 268 | + _priceLab.textAlignment = NSTextAlignmentRight; | |
| 269 | + } | |
| 270 | + return _priceLab; | |
| 271 | +} | |
| 272 | +@end | |
| 273 | +#pragma mark - | |
| 274 | +#pragma mark - CNLiveOrderListContentItemView | |
| 275 | +#import "CNLiveEditGoodsModel.h" | |
| 276 | +#import "YYKit.h" | |
| 277 | +@interface CNLiveOrderListContentItemView : UIView | |
| 278 | + | |
| 279 | +@property (nonatomic, strong) UILabel *titleLab; | |
| 280 | +@property (nonatomic, strong) UILabel *quantityLab; | |
| 281 | +@property (nonatomic, strong) UILabel *priceLab; | |
| 282 | +@property (nonatomic, strong) UILabel *bottomLine; | |
| 283 | +@property (nonatomic, strong) CNLiveEditGoodsModel *model; | |
| 284 | +@end | |
| 285 | + | |
| 286 | +@implementation CNLiveOrderListContentItemView | |
| 287 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 288 | + self = [super initWithFrame:frame]; | |
| 289 | + if (self) { | |
| 290 | + [self addSubview:self.titleLab]; | |
| 291 | + [self addSubview:self.quantityLab]; | |
| 292 | + [self addSubview:self.priceLab]; | |
| 293 | + [self addSubview:self.bottomLine]; | |
| 294 | + | |
| 295 | + [self p_addMasonry]; | |
| 296 | + } | |
| 297 | + return self; | |
| 298 | +} | |
| 299 | + | |
| 300 | +- (void)setModel:(CNLiveEditGoodsModel *)model { | |
| 301 | + _model = model; | |
| 302 | + _titleLab.text = [model.title stringByURLDecode]; | |
| 303 | + _quantityLab.text = [NSString stringWithFormat:@"x %ld", model.quantity]; | |
| 304 | + _priceLab.text = [NSString stringWithFormat:@"¥ %.2f", model.price]; | |
| 305 | + | |
| 306 | + | |
| 307 | + NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:_priceLab.text]; | |
| 308 | + [string addAttribute:NSFontAttributeName value:UIFontCNMake(13) range:NSMakeRange(0, 1)]; | |
| 309 | + _priceLab.attributedText = string; | |
| 310 | +} | |
| 311 | + | |
| 312 | +- (void)p_addMasonry { | |
| 313 | + | |
| 314 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 315 | + make.left.mas_equalTo(20); | |
| 316 | + make.top.mas_equalTo(20); | |
| 317 | + make.width.mas_equalTo(KScreenWidth - 50); | |
| 318 | + make.height.mas_equalTo(14); | |
| 319 | + }]; | |
| 320 | + [self.priceLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 321 | + make.left.mas_equalTo(self.titleLab.mas_left); | |
| 322 | + make.top.mas_equalTo(self.titleLab.mas_bottom).offset(15); | |
| 323 | + make.width.mas_equalTo(KScreenWidth - 80); | |
| 324 | + make.height.mas_equalTo(15); | |
| 325 | + }]; | |
| 326 | + | |
| 327 | + [self.quantityLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 328 | + make.right.mas_equalTo(self.mas_right).mas_offset(-14); | |
| 329 | + make.bottom.mas_equalTo(self.priceLab.mas_bottom); | |
| 330 | + make.width.mas_equalTo(50); | |
| 331 | + make.height.mas_equalTo(13); | |
| 332 | + }]; | |
| 333 | + [self.bottomLine mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 334 | + make.left.mas_equalTo(15); | |
| 335 | + make.bottom.mas_equalTo(self.mas_bottom).offset(-0.5); | |
| 336 | + make.width.mas_equalTo(KScreenWidth - 30); | |
| 337 | + make.height.mas_equalTo(0.5); | |
| 338 | + }]; | |
| 339 | +} | |
| 340 | + | |
| 341 | +#pragma mark - | |
| 342 | +#pragma mark - Getter | |
| 343 | +- (UILabel *)titleLab { | |
| 344 | + if (!_titleLab) { | |
| 345 | + _titleLab = [[UILabel alloc] init]; | |
| 346 | + _titleLab.font = UIFontCNMake(15); | |
| 347 | + _titleLab.textColor = [UIColor blackColor]; | |
| 348 | + _titleLab.textAlignment = NSTextAlignmentLeft; | |
| 349 | + } | |
| 350 | + return _titleLab; | |
| 351 | +} | |
| 352 | + | |
| 353 | +- (UILabel *)quantityLab{ | |
| 354 | + if (!_quantityLab) { | |
| 355 | + _quantityLab = [[UILabel alloc] init]; | |
| 356 | + _quantityLab.font = UIFontCNMake(15); | |
| 357 | + _quantityLab.textColor = [UIColor blackColor]; | |
| 358 | + _quantityLab.textAlignment = NSTextAlignmentCenter; | |
| 359 | + } | |
| 360 | + return _quantityLab; | |
| 361 | +} | |
| 362 | + | |
| 363 | +- (UILabel *)priceLab{ | |
| 364 | + if (!_priceLab) { | |
| 365 | + _priceLab = [[UILabel alloc] init]; | |
| 366 | + _priceLab.font = UIFontCNMake(15); | |
| 367 | + _priceLab.textColor = [UIColor blackColor]; | |
| 368 | + _priceLab.textAlignment = NSTextAlignmentLeft; | |
| 369 | + } | |
| 370 | + return _priceLab; | |
| 371 | +} | |
| 372 | +- (UILabel *)bottomLine{ | |
| 373 | + if (!_bottomLine) { | |
| 374 | + _bottomLine = [[UILabel alloc] init]; | |
| 375 | + _bottomLine.backgroundColor = KGray227Color; | |
| 376 | + } | |
| 377 | + return _bottomLine; | |
| 378 | +} | |
| 379 | +@end | |
| 380 | +@interface OrderListContentCollectView : UIView | |
| 381 | + | |
| 382 | +@property (nonatomic, strong) NSMutableArray *modelArr; | |
| 383 | + @property (nonatomic ,strong) NSArray <CNLiveEditGoodsModel *><CNLiveEditGoodsModel>* goodsInfo; | |
| 384 | + | |
| 385 | +@end | |
| 386 | +@implementation OrderListContentCollectView | |
| 387 | + | |
| 388 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 389 | + self = [super initWithFrame:frame]; | |
| 390 | + if (self) { | |
| 391 | + self.backgroundColor = kWhiteColor; | |
| 392 | + } | |
| 393 | + return self; | |
| 394 | +} | |
| 395 | + | |
| 396 | +- (void)setModelArr:(NSMutableArray *)modelArr { | |
| 397 | + | |
| 398 | + __block CNLiveOrderListContentItemView *tempView; | |
| 399 | + [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; | |
| 400 | + | |
| 401 | + for (int i = 0 ; i < modelArr.count; i ++ ) { | |
| 402 | + | |
| 403 | + CNLiveOrderListContentItemView *contentView = [[CNLiveOrderListContentItemView alloc] init]; | |
| 404 | + contentView.model = (CNLiveEditGoodsModel *)modelArr[i]; | |
| 405 | + [self addSubview:contentView]; | |
| 406 | + | |
| 407 | + [contentView mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 408 | + make.left.right.mas_equalTo(self); | |
| 409 | + make.height.mas_equalTo(OrderContent_H); | |
| 410 | + if (tempView) { | |
| 411 | + make.top.mas_equalTo(tempView.mas_bottom); | |
| 412 | + } else { | |
| 413 | + make.top.mas_equalTo(0); | |
| 414 | + } | |
| 415 | + | |
| 416 | + tempView = contentView; | |
| 417 | + | |
| 418 | + }]; | |
| 419 | + | |
| 420 | + } | |
| 421 | + | |
| 422 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 423 | + make.height.mas_equalTo(OrderContent_H*modelArr.count); | |
| 424 | + }]; | |
| 425 | +} | |
| 426 | + | |
| 427 | +- (void)setGoodsInfo:(NSArray<CNLiveEditGoodsModel *><CNLiveEditGoodsModel> *)goodsInfo { | |
| 428 | + | |
| 429 | + __block CNLiveOrderListContentItemView *tempView; | |
| 430 | + | |
| 431 | + [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; | |
| 432 | + | |
| 433 | + for (int i = 0 ; i < goodsInfo.count; i ++ ) { | |
| 434 | + CNLiveOrderListContentItemView *contentView = [[CNLiveOrderListContentItemView alloc] init]; | |
| 435 | + contentView.model = (CNLiveEditGoodsModel *)goodsInfo[i]; | |
| 436 | + [self addSubview:contentView]; | |
| 437 | + [contentView mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 438 | + make.left.right.mas_equalTo(self); | |
| 439 | + make.height.mas_equalTo(OrderContent_H); | |
| 440 | + if (tempView) { | |
| 441 | + make.top.mas_equalTo(tempView.mas_bottom); | |
| 442 | + } else { | |
| 443 | + make.top.mas_equalTo(0); | |
| 444 | + } | |
| 445 | + tempView = contentView; | |
| 446 | + }]; | |
| 447 | + } | |
| 448 | + | |
| 449 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 450 | + make.height.mas_equalTo(OrderContent_H*[goodsInfo count]); | |
| 451 | + }]; | |
| 452 | +} | |
| 453 | +@end | |
| 454 | +#pragma mark - | |
| 455 | +#pragma mark - CNLiveKindView | |
| 456 | +@interface CNLiveKindView () | |
| 457 | +@property (nonatomic, strong) OrderListContentTitleView *titleView; | |
| 458 | +@property (nonatomic, strong) OrderListContentCollectView *contentCollectView; | |
| 459 | +@end | |
| 460 | + | |
| 461 | +@implementation CNLiveKindView | |
| 462 | + | |
| 463 | +- (instancetype)initWithFrame:(CGRect)frame { | |
| 464 | + self = [super initWithFrame:frame]; | |
| 465 | + if (self) { | |
| 466 | + self.backgroundColor = [UIColor whiteColor]; | |
| 467 | + // [self addSubview:self.titleView]; | |
| 468 | + [self addSubview:self.contentCollectView]; | |
| 469 | + [self p_addMasonry]; | |
| 470 | + } | |
| 471 | + return self; | |
| 472 | +} | |
| 473 | + | |
| 474 | +- (void)setList:(CNLiveOrderList *)list { | |
| 475 | + | |
| 476 | + CNLiveOrderListOrderItem *orderItem = list.orderItem; | |
| 477 | + | |
| 478 | + if ([orderItem.goodsInfo count] > 0) { | |
| 479 | + _contentCollectView.goodsInfo = orderItem.goodsInfo; | |
| 480 | + } else { | |
| 481 | + NSMutableArray *modelArr = [[NSMutableArray alloc] init]; | |
| 482 | + CNLiveEditGoodsModel *goodsModel = [[CNLiveEditGoodsModel alloc] init]; | |
| 483 | + goodsModel.title = orderItem.title; | |
| 484 | + goodsModel.quantity = orderItem.quantity; | |
| 485 | + goodsModel.price = orderItem.price; | |
| 486 | + [modelArr addObject:goodsModel]; | |
| 487 | + _contentCollectView.modelArr = modelArr; | |
| 488 | + } | |
| 489 | + | |
| 490 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 491 | + make.bottom.mas_equalTo(self.contentCollectView.mas_bottom).mas_offset(5); | |
| 492 | + }]; | |
| 493 | +} | |
| 494 | + | |
| 495 | +- (void)p_addMasonry { | |
| 496 | + [self.contentCollectView mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 497 | + make.left.mas_equalTo(0); | |
| 498 | + make.top.mas_equalTo(self); | |
| 499 | + make.right.mas_equalTo(self); | |
| 500 | + }]; | |
| 501 | +} | |
| 502 | + | |
| 503 | +#pragma mark - Getter | |
| 504 | +- (OrderListContentTitleView *)titleView{ | |
| 505 | + if (!_titleView) { | |
| 506 | + _titleView = [[OrderListContentTitleView alloc] init]; | |
| 507 | + } | |
| 508 | + return _titleView; | |
| 509 | +} | |
| 510 | + | |
| 511 | +- (OrderListContentCollectView *)contentCollectView{ | |
| 512 | + if (!_contentCollectView) { | |
| 513 | + _contentCollectView = [[OrderListContentCollectView alloc] init]; | |
| 514 | + } | |
| 515 | + return _contentCollectView; | |
| 516 | +} | |
| 517 | +@end | |
| 518 | +#pragma mark - | |
| 519 | +#pragma mark - CNLiveServiceTypeView | |
| 520 | +@interface CNLiveServiceTypeView () | |
| 521 | + | |
| 522 | + @property (nonatomic, strong) QMUILabel *titleLab; | |
| 523 | + @property (nonatomic, strong) QMUILabel *subTitle; | |
| 524 | + | |
| 525 | + @end | |
| 526 | + | |
| 527 | +@implementation CNLiveServiceTypeView | |
| 528 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 529 | + self = [super initWithFrame:frame]; | |
| 530 | + if (self) { | |
| 531 | + self.backgroundColor = [UIColor whiteColor]; | |
| 532 | + [self addSubview:self.titleLab]; | |
| 533 | + [self addSubview:self.subTitle]; | |
| 534 | + [self p_addMasonry]; | |
| 535 | + } | |
| 536 | + return self; | |
| 537 | +} | |
| 538 | + | |
| 539 | +- (void)setList:(CNLiveOrderList *)list { | |
| 540 | + | |
| 541 | + CNLiveOrderListOrderItem *orderItem = list.orderItem; | |
| 542 | + self.subTitle.text = orderItem.categoryName; | |
| 543 | + | |
| 544 | +} | |
| 545 | + | |
| 546 | +- (void)p_addMasonry { | |
| 547 | + | |
| 548 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 549 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 550 | + make.left.mas_equalTo(15); | |
| 551 | + }]; | |
| 552 | + | |
| 553 | + [self.subTitle mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 554 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 555 | + make.right.mas_equalTo(self.mas_right).mas_offset(-15); | |
| 556 | + }]; | |
| 557 | + | |
| 558 | +} | |
| 559 | + | |
| 560 | +#pragma mark - Getter | |
| 561 | +- (QMUILabel *)titleLab { | |
| 562 | + if (!_titleLab) { | |
| 563 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 564 | + label.textColor = KTextBlackColor; | |
| 565 | + label.font = UIFontCNMake(15); | |
| 566 | + label.text = @"服务内容"; | |
| 567 | + _titleLab = label; | |
| 568 | + } | |
| 569 | + return _titleLab; | |
| 570 | +} | |
| 571 | + | |
| 572 | +- (QMUILabel *)subTitle { | |
| 573 | + if (!_subTitle) { | |
| 574 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 575 | + label.textColor = KGray101Color; | |
| 576 | + label.font = UIFontCNMake(15); | |
| 577 | + label.textAlignment = NSTextAlignmentRight; | |
| 578 | + _subTitle = label; | |
| 579 | + } | |
| 580 | + return _subTitle; | |
| 581 | +} | |
| 582 | +@end | |
| 583 | +#pragma mark - | |
| 584 | +#pragma mark - CNFeeView | |
| 585 | +@interface CNLiveOrderNormalView () | |
| 586 | +@property (nonatomic, strong) QMUILabel *titleLab; | |
| 587 | +@property (nonatomic, strong) QMUILabel *subTitle; | |
| 588 | +@end | |
| 589 | + | |
| 590 | +@implementation CNLiveOrderNormalView | |
| 591 | + | |
| 592 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 593 | + self = [super initWithFrame:frame]; | |
| 594 | + if (self) { | |
| 595 | + self.backgroundColor = [UIColor whiteColor]; | |
| 596 | + [self addSubview:self.titleLab]; | |
| 597 | + [self addSubview:self.subTitle]; | |
| 598 | + [self p_addMasonry]; | |
| 599 | + } | |
| 600 | + return self; | |
| 601 | +} | |
| 602 | + | |
| 603 | +- (void)setList:(CNLiveOrderList *)list { | |
| 604 | + CNLiveOrderListOrderItem *orderItem = list.orderItem; | |
| 605 | + if (_isFee) { | |
| 606 | + _titleLab.text = @"服务费"; | |
| 607 | + _subTitle.text = [NSString stringWithFormat:@"%.2f", (float)orderItem.fee]; | |
| 608 | + } else { | |
| 609 | + _titleLab.text = @"总价"; | |
| 610 | + _subTitle.text = [NSString stringWithFormat:@"%.2f",orderItem.totalPrice]; | |
| 611 | + } | |
| 612 | +} | |
| 613 | +- (void)setTitle:(NSString *)title subTitle:(NSString *)subTitle { | |
| 614 | + _titleLab.text = title; | |
| 615 | + _subTitle.text = [NSString stringWithFormat:@"%@", subTitle]; | |
| 616 | +} | |
| 617 | +- (void)p_addMasonry { | |
| 618 | + | |
| 619 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 620 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 621 | + make.left.mas_equalTo(15); | |
| 622 | + }]; | |
| 623 | + | |
| 624 | + [self.subTitle mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 625 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 626 | + make.right.mas_equalTo(self.mas_right).mas_offset(-15); | |
| 627 | + }]; | |
| 628 | + | |
| 629 | +} | |
| 630 | + | |
| 631 | +#pragma mark - Getter | |
| 632 | +- (QMUILabel *)titleLab { | |
| 633 | + if (!_titleLab) { | |
| 634 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 635 | + label.textColor = KTextBlackColor; | |
| 636 | + label.font = UIFontCNMake(15); | |
| 637 | + label.text = @"服务费"; | |
| 638 | + _titleLab = label; | |
| 639 | + } | |
| 640 | + return _titleLab; | |
| 641 | +} | |
| 642 | + | |
| 643 | +- (QMUILabel *)subTitle { | |
| 644 | + if (!_subTitle) { | |
| 645 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 646 | + label.textColor = KGray101Color; | |
| 647 | + label.font = UIFontCNMake(15); | |
| 648 | + label.textAlignment = NSTextAlignmentRight; | |
| 649 | + _subTitle = label; | |
| 650 | + } | |
| 651 | + return _subTitle; | |
| 652 | +} | |
| 653 | +@end | |
| 654 | +#pragma mark - | |
| 655 | +#pragma mark - CNTotalView | |
| 656 | +@interface CNLiveTotalView () | |
| 657 | +@property (nonatomic, strong) QMUILabel *totalLab; | |
| 658 | +@end | |
| 659 | +@implementation CNLiveTotalView | |
| 660 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 661 | + self = [super initWithFrame:frame]; | |
| 662 | + if (self) { | |
| 663 | + self.backgroundColor = [UIColor whiteColor]; | |
| 664 | + [self addSubview:self.totalLab]; | |
| 665 | + [self p_addMasonry]; | |
| 666 | + } | |
| 667 | + return self; | |
| 668 | +} | |
| 669 | + | |
| 670 | +- (void)setList:(CNLiveOrderList *)list { | |
| 671 | + CNLiveOrderListOrderItem *orderItem = list.orderItem; | |
| 672 | + _totalLab.text = [NSString stringWithFormat:@"实付金额: ¥ %.2f元", orderItem.totalPrice]; | |
| 673 | +} | |
| 674 | + | |
| 675 | +- (void)p_addMasonry { | |
| 676 | + | |
| 677 | + [self.totalLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 678 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 679 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 680 | + }]; | |
| 681 | +} | |
| 682 | + | |
| 683 | +#pragma mark - Getter | |
| 684 | +- (QMUILabel *)totalLab { | |
| 685 | + if (!_totalLab) { | |
| 686 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 687 | + label.font = UIFontCNMake(13); | |
| 688 | + label.textColor = KTextBlackColor; | |
| 689 | + label.textAlignment = NSTextAlignmentRight; | |
| 690 | + label.numberOfLines = 0; | |
| 691 | + _totalLab = label; | |
| 692 | + } | |
| 693 | + return _totalLab; | |
| 694 | +} | |
| 695 | +@end | |
| 696 | +#pragma mark - | |
| 697 | +#pragma mark - CNLiveActuallyPaidView | |
| 698 | +@interface CNLiveActuallyPaidView () | |
| 699 | +@property (nonatomic, strong) UILabel *totalTitleLab; | |
| 700 | +@property (nonatomic, strong) UILabel *totalLab; | |
| 701 | +@property (nonatomic, strong) UILabel *freightTitleLab; | |
| 702 | +@property (nonatomic, strong) UILabel *freightLab; | |
| 703 | +@property (nonatomic, strong) UILabel *feeTitleLab; | |
| 704 | +@property (nonatomic, strong) UILabel *feeLab; | |
| 705 | +@property (nonatomic, strong) UILabel *actuallyTitleLab; | |
| 706 | +@property (nonatomic, strong) UILabel *actuallyLab; | |
| 707 | +@property (nonatomic, strong) UIView *line; | |
| 708 | +@end | |
| 709 | + | |
| 710 | +@implementation CNLiveActuallyPaidView | |
| 711 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 712 | + self = [super initWithFrame:frame]; | |
| 713 | + if (self) { | |
| 714 | + self.backgroundColor = [UIColor whiteColor]; | |
| 715 | + [self addSubview:self.totalLab]; | |
| 716 | + [self addSubview:self.totalTitleLab]; | |
| 717 | + [self addSubview:self.freightLab]; | |
| 718 | + [self addSubview:self.freightTitleLab]; | |
| 719 | + [self addSubview:self.feeLab]; | |
| 720 | + [self addSubview:self.feeTitleLab]; | |
| 721 | + [self addSubview:self.actuallyLab]; | |
| 722 | + [self addSubview:self.actuallyTitleLab]; | |
| 723 | + [self addSubview:self.line]; | |
| 724 | + [self p_addMasonry]; | |
| 725 | + } | |
| 726 | + return self; | |
| 727 | +} | |
| 728 | + | |
| 729 | +- (void)setList:(CNLiveOrderList *)list { | |
| 730 | + CNLiveOrderListOrderItem *orderItem = list.orderItem; | |
| 731 | + _totalLab.text = [NSString stringWithFormat:@"¥ %.2f", orderItem.goodsTotalPrice]; | |
| 732 | + _freightLab.text = [NSString stringWithFormat:@"¥ %.2f", orderItem.freight]; | |
| 733 | + _feeLab.text = [NSString stringWithFormat:@"¥ %.2f", orderItem.fee]; | |
| 734 | + _actuallyLab.text = [NSString stringWithFormat:@"¥ %.2f", orderItem.totalPrice]; | |
| 735 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 736 | + make.bottom.mas_equalTo(self.actuallyTitleLab.mas_bottom).mas_offset(17); | |
| 737 | + }]; | |
| 738 | +} | |
| 739 | + | |
| 740 | +- (void)p_addMasonry { | |
| 741 | + | |
| 742 | + [self.totalTitleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 743 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 744 | + make.top.mas_equalTo(self).mas_offset(18); | |
| 745 | + }]; | |
| 746 | + | |
| 747 | + [self.totalLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 748 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 749 | + make.top.mas_equalTo(self.totalTitleLab); | |
| 750 | + }]; | |
| 751 | + | |
| 752 | + [self.freightTitleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 753 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 754 | + make.top.mas_equalTo(self.totalTitleLab.mas_bottom).mas_offset(6); | |
| 755 | + }]; | |
| 756 | + | |
| 757 | + [self.freightLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 758 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 759 | + make.top.mas_equalTo(self.freightTitleLab); | |
| 760 | + }]; | |
| 761 | + | |
| 762 | + [self.feeTitleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 763 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 764 | + make.top.mas_equalTo(self.freightTitleLab.mas_bottom).mas_offset(6); | |
| 765 | + }]; | |
| 766 | + | |
| 767 | + [self.feeLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 768 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 769 | + make.top.mas_equalTo(self.feeTitleLab); | |
| 770 | + }]; | |
| 771 | + | |
| 772 | + [self.line mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 773 | + make.left.right.mas_equalTo(self); | |
| 774 | + make.top.mas_equalTo(self.feeTitleLab.mas_bottom).mas_offset(10); | |
| 775 | + make.size.mas_equalTo(CGSizeMake(KScreenWidth, 0.5)); | |
| 776 | + }]; | |
| 777 | + | |
| 778 | + [self.actuallyTitleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 779 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 780 | + make.top.mas_equalTo(self.line.mas_bottom).mas_offset(12); | |
| 781 | + }]; | |
| 782 | + | |
| 783 | + [self.actuallyLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 784 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 785 | + make.top.mas_equalTo(self.actuallyTitleLab); | |
| 786 | + }]; | |
| 787 | +} | |
| 788 | + | |
| 789 | +#pragma mark - Getter | |
| 790 | +- (UILabel *)totalLab { | |
| 791 | + if (!_totalLab) { | |
| 792 | + UILabel* label = [[UILabel alloc]init]; | |
| 793 | + label.font = UIFontCNMake(12); | |
| 794 | + label.textColor = KGray153Color; | |
| 795 | + label.textAlignment = NSTextAlignmentRight; | |
| 796 | + _totalLab = label; | |
| 797 | + } | |
| 798 | + return _totalLab; | |
| 799 | +} | |
| 800 | + | |
| 801 | +- (UILabel *)freightLab { | |
| 802 | + if (!_freightLab) { | |
| 803 | + UILabel* label = [[UILabel alloc]init]; | |
| 804 | + label.font = UIFontCNMake(12); | |
| 805 | + label.textColor = KGray153Color; | |
| 806 | + label.textAlignment = NSTextAlignmentRight; | |
| 807 | + _freightLab = label; | |
| 808 | + } | |
| 809 | + return _freightLab; | |
| 810 | +} | |
| 811 | + | |
| 812 | +- (UILabel *)feeLab { | |
| 813 | + if (!_feeLab) { | |
| 814 | + UILabel* label = [[UILabel alloc]init]; | |
| 815 | + label.font = UIFontCNMake(12); | |
| 816 | + label.textColor = KGray153Color; | |
| 817 | + label.textAlignment = NSTextAlignmentRight; | |
| 818 | + _feeLab = label; | |
| 819 | + } | |
| 820 | + return _feeLab; | |
| 821 | +} | |
| 822 | + | |
| 823 | +- (UILabel *)actuallyLab { | |
| 824 | + if (!_actuallyLab) { | |
| 825 | + UILabel* label = [[UILabel alloc]init]; | |
| 826 | + label.font = UIFontCNMake(14); | |
| 827 | + label.textColor = RGB(242, 48, 48); | |
| 828 | + label.textAlignment = NSTextAlignmentRight; | |
| 829 | + _actuallyLab = label; | |
| 830 | + } | |
| 831 | + return _actuallyLab; | |
| 832 | +} | |
| 833 | + | |
| 834 | +- (UILabel *)totalTitleLab { | |
| 835 | + if (!_totalTitleLab) { | |
| 836 | + UILabel* label = [[UILabel alloc]init]; | |
| 837 | + label.font = UIFontCNMake(12); | |
| 838 | + label.textColor = KGray153Color; | |
| 839 | + label.text = @"商品总价"; | |
| 840 | + _totalTitleLab = label; | |
| 841 | + } | |
| 842 | + return _totalTitleLab; | |
| 843 | +} | |
| 844 | + | |
| 845 | +- (UILabel *)freightTitleLab { | |
| 846 | + if (!_freightTitleLab) { | |
| 847 | + UILabel* label = [[UILabel alloc]init]; | |
| 848 | + label.font = UIFontCNMake(12); | |
| 849 | + label.textColor = KGray153Color; | |
| 850 | + label.text = @"运费(快递)"; | |
| 851 | + _freightTitleLab = label; | |
| 852 | + } | |
| 853 | + return _freightTitleLab; | |
| 854 | +} | |
| 855 | + | |
| 856 | +- (UILabel *)feeTitleLab { | |
| 857 | + if (!_feeTitleLab) { | |
| 858 | + UILabel* label = [[UILabel alloc]init]; | |
| 859 | + label.font = UIFontCNMake(12); | |
| 860 | + label.textColor = KGray153Color; | |
| 861 | + label.text = @"服务费"; | |
| 862 | + _feeTitleLab = label; | |
| 863 | + } | |
| 864 | + return _feeTitleLab; | |
| 865 | +} | |
| 866 | + | |
| 867 | +- (UILabel *)actuallyTitleLab { | |
| 868 | + if (!_actuallyTitleLab) { | |
| 869 | + UILabel* label = [[UILabel alloc]init]; | |
| 870 | + label.font = UIFontCNMake(14); | |
| 871 | + label.textColor = RGB(63, 68, 71); | |
| 872 | + label.text = @"实付金额"; | |
| 873 | + _actuallyTitleLab = label; | |
| 874 | + } | |
| 875 | + return _actuallyTitleLab; | |
| 876 | +} | |
| 877 | + | |
| 878 | +- (UIView *)line{ | |
| 879 | + if (!_line) { | |
| 880 | + _line = [[UIView alloc] init]; | |
| 881 | + _line.backgroundColor = KGray227Color; | |
| 882 | + } | |
| 883 | + return _line; | |
| 884 | +} | |
| 885 | +@end | |
| 886 | +#pragma mark - | |
| 887 | +#pragma mark - CNLiveAddressView | |
| 888 | +#import "DSAddressModel.h" | |
| 889 | +@interface CNLiveAddressView () | |
| 890 | +@property (nonatomic, strong) QMUILabel *nameLab; | |
| 891 | +@property (nonatomic, strong) QMUILabel *phoneLab; | |
| 892 | +@property (nonatomic, strong) QMUILabel *addressLab; | |
| 893 | +@property (nonatomic, strong) QMUILabel *selectAddressLab; | |
| 894 | +@property (nonatomic, strong) UIImageView *moreImg; | |
| 895 | + | |
| 896 | +@end | |
| 897 | +@implementation CNLiveAddressView | |
| 898 | + | |
| 899 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 900 | + self = [super initWithFrame:frame]; | |
| 901 | + if (self) { | |
| 902 | + self.backgroundColor = [UIColor whiteColor]; | |
| 903 | + [self addSubview:self.nameLab]; | |
| 904 | + [self addSubview:self.phoneLab]; | |
| 905 | + [self addSubview:self.addressLab]; | |
| 906 | + [self addSubview:self.selectAddressLab]; | |
| 907 | + [self addSubview:self.moreImg]; | |
| 908 | + [self p_addMasonry]; | |
| 909 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(editAddress)]; | |
| 910 | + //修改地址 | |
| 911 | +// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateCurrentAddress:) name:kDSEditAddressNotification object:nil]; | |
| 912 | + //增加地址 | |
| 913 | +// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addAddress:) name:kDSAddAddressNotification object:nil]; | |
| 914 | + | |
| 915 | + [self addGestureRecognizer:tap]; | |
| 916 | + } | |
| 917 | + return self; | |
| 918 | +} | |
| 919 | + | |
| 920 | +- (void)editAddress { | |
| 921 | + | |
| 922 | + if (self.allowEdit) { | |
| 923 | +#pragma mark -TODO:这个地方等把电商framework导进来,再改 | |
| 924 | +// [self.superview layoutIfNeeded]; | |
| 925 | +// DSAddressViewController *sendVC = [[DSAddressViewController alloc] init]; | |
| 926 | +// weakself | |
| 927 | +// sendVC.selectAddressCallBack = ^(DSAddressModel *addressObj) { | |
| 928 | +// weakSelf.addressLab.text = [NSString stringWithFormat:@"收货地址: %@", addressObj.address]; | |
| 929 | +// weakSelf.nameLab.text = [NSString stringWithFormat:@"收货人: %@", addressObj.name];; | |
| 930 | +// weakSelf.phoneLab.text = [NSString stringWithFormat:@"联系电话: %@" ,addressObj.phone]; | |
| 931 | +// weakSelf.addressModel = addressObj; | |
| 932 | +// weakSelf.selectAddressLab.hidden = YES; | |
| 933 | +// | |
| 934 | +// dispatch_async(dispatch_get_main_queue(), ^{ | |
| 935 | +// if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(selectedAddressComplete)]) { | |
| 936 | +// [weakSelf.delegate selectedAddressComplete]; | |
| 937 | +// } | |
| 938 | +// }); | |
| 939 | +// }; | |
| 940 | +// [[AppDelegate sharedAppDelegate] pushViewController:sendVC withBackTitle:@" "]; | |
| 941 | + } | |
| 942 | + | |
| 943 | +} | |
| 944 | +//- (void)setAddressModel:(CNLiveAdminAddressModel *)addressModel{ | |
| 945 | +// _addressModel = addressModel; | |
| 946 | +// if (_addressModel== nil) { | |
| 947 | +// _nameLab.text = @""; | |
| 948 | +// _phoneLab.text = @""; | |
| 949 | +// _addressLab.text = @""; | |
| 950 | +// } | |
| 951 | +//} | |
| 952 | +- (void)setAllowEdit:(BOOL)allowEdit { | |
| 953 | + _allowEdit = allowEdit; | |
| 954 | + _moreImg.hidden = !allowEdit; | |
| 955 | + if (allowEdit) { | |
| 956 | + self.selectAddressLab.hidden = NO; | |
| 957 | + self.moreImg.hidden = NO; | |
| 958 | + | |
| 959 | + [self.selectAddressLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 960 | + make.top.mas_equalTo(self).mas_offset(27); | |
| 961 | + make.left.mas_equalTo(Default_Space); | |
| 962 | + make.right.mas_equalTo(self.moreImg.mas_left).mas_offset(-Default_Space); | |
| 963 | + }]; | |
| 964 | + | |
| 965 | + [self.moreImg mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 966 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 967 | + make.centerY.mas_equalTo(self.selectAddressLab.mas_centerY); | |
| 968 | + make.size.mas_equalTo(CGSizeMake(7, 14)); | |
| 969 | + }]; | |
| 970 | + | |
| 971 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 972 | + make.bottom.mas_equalTo(self.selectAddressLab.mas_bottom).mas_offset(27); | |
| 973 | + }]; | |
| 974 | + } | |
| 975 | +} | |
| 976 | + | |
| 977 | +- (void)setList:(CNLiveOrderList *)list { | |
| 978 | + | |
| 979 | + _list = list; | |
| 980 | + if (![NSString isEmpty:_list.contactMsg.contactPhone]) { | |
| 981 | + CNLiveOrderContactItem *contactItem = list.contactMsg; | |
| 982 | + _nameLab.text = [NSString stringWithFormat:@"收货人: %@", contactItem.contactName]; | |
| 983 | + _phoneLab.text = [NSString stringWithFormat:@"联系电话: %@", contactItem.contactPhone]; | |
| 984 | + _addressLab.text = [NSString stringWithFormat:@"收货地址: %@", contactItem.contactAddress]; | |
| 985 | + self.selectAddressLab.hidden = YES; | |
| 986 | + _moreImg.hidden = YES; | |
| 987 | + | |
| 988 | + } | |
| 989 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 990 | + make.bottom.mas_equalTo(self.addressLab.mas_bottom).mas_offset(Default_Space); | |
| 991 | + }]; | |
| 992 | + | |
| 993 | +} | |
| 994 | +- (void)updateFirstAddress:(DSAddressModel *)address | |
| 995 | + { | |
| 996 | + if (![NSString isEmpty:address.id]) { | |
| 997 | + //前提存在首选地址 | |
| 998 | + if ([NSString isEmpty:_list.contactMsg.contactPhone]) | |
| 999 | + { | |
| 1000 | + //如果是刚生成的订单才显示首选地址 | |
| 1001 | + _nameLab.text = [NSString stringWithFormat:@"收货人: %@", address.name]; | |
| 1002 | + _phoneLab.text = [NSString stringWithFormat:@"联系电话: %@", address.phone]; | |
| 1003 | + _addressLab.text = [NSString stringWithFormat:@"收货地址: %@", address.address]; | |
| 1004 | + self.addressModel = address; | |
| 1005 | + self.selectAddressLab.hidden = YES; | |
| 1006 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 1007 | + make.bottom.mas_equalTo(self.addressLab.mas_bottom).mas_offset(Default_Space); | |
| 1008 | + }]; | |
| 1009 | + } | |
| 1010 | + } | |
| 1011 | + | |
| 1012 | + } | |
| 1013 | +- (void)updateCurrentAddress:(NSNotification *)noti | |
| 1014 | + { | |
| 1015 | + DSAddressModel *addressModel = noti.object; | |
| 1016 | + if ([addressModel.id isEqualToString:self.addressModel.id]) { | |
| 1017 | + self.addressLab.text = [NSString stringWithFormat:@"收货地址: %@", addressModel.address]; | |
| 1018 | + self.nameLab.text = [NSString stringWithFormat:@"收货人: %@", addressModel.name];; | |
| 1019 | + self.phoneLab.text = [NSString stringWithFormat:@"联系电话: %@" ,addressModel.phone]; | |
| 1020 | + self.addressModel = addressModel; | |
| 1021 | + self.selectAddressLab.hidden = YES; | |
| 1022 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 1023 | + if (self.delegate && [self.delegate respondsToSelector:@selector(selectedAddressComplete)]) { | |
| 1024 | + [self.delegate selectedAddressComplete]; | |
| 1025 | + } | |
| 1026 | + }); | |
| 1027 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 1028 | + make.bottom.mas_equalTo(self.addressLab.mas_bottom).mas_offset(Default_Space); | |
| 1029 | + }]; | |
| 1030 | + } | |
| 1031 | + | |
| 1032 | + } | |
| 1033 | +- (void)addAddress:(NSNotification *)noti{ | |
| 1034 | + DSAddressModel *addressModel = noti.object; | |
| 1035 | + if (self.addressModel == nil) { | |
| 1036 | + //如果还没地址,就把添加的第一个地址作显示出来 | |
| 1037 | + self.addressLab.text = [NSString stringWithFormat:@"收货地址: %@", addressModel.address]; | |
| 1038 | + self.nameLab.text = [NSString stringWithFormat:@"收货人: %@", addressModel.name];; | |
| 1039 | + self.phoneLab.text = [NSString stringWithFormat:@"联系电话: %@" ,addressModel.phone]; | |
| 1040 | + self.addressModel = addressModel; | |
| 1041 | + self.selectAddressLab.hidden = YES; | |
| 1042 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 1043 | + if (self.delegate && [self.delegate respondsToSelector:@selector(selectedAddressComplete)]) { | |
| 1044 | + [self.delegate selectedAddressComplete]; | |
| 1045 | + } | |
| 1046 | + }); | |
| 1047 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 1048 | + make.bottom.mas_equalTo(self.addressLab.mas_bottom).mas_offset(Default_Space); | |
| 1049 | + }]; | |
| 1050 | + } | |
| 1051 | +} | |
| 1052 | +- (void)p_addMasonry { | |
| 1053 | + | |
| 1054 | + [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1055 | + make.top.mas_equalTo(self).mas_offset(Default_Space); | |
| 1056 | + make.left.mas_equalTo(Default_Space); | |
| 1057 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 1058 | + }]; | |
| 1059 | + | |
| 1060 | + [self.phoneLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1061 | + make.top.mas_equalTo(self.nameLab.mas_bottom).mas_offset(10); | |
| 1062 | + make.left.mas_equalTo(Default_Space); | |
| 1063 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 1064 | + }]; | |
| 1065 | + | |
| 1066 | + [self.addressLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1067 | + make.top.mas_equalTo(self.phoneLab.mas_bottom).mas_offset(10); | |
| 1068 | + make.left.mas_equalTo(Default_Space); | |
| 1069 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 1070 | + }]; | |
| 1071 | + | |
| 1072 | +} | |
| 1073 | + | |
| 1074 | +#pragma mark - Getter | |
| 1075 | +- (QMUILabel *)nameLab { | |
| 1076 | + if (!_nameLab) { | |
| 1077 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 1078 | + label.font = UIFontCNMake(15); | |
| 1079 | + label.textColor = KGray102Color; | |
| 1080 | + _nameLab = label; | |
| 1081 | + } | |
| 1082 | + return _nameLab; | |
| 1083 | +} | |
| 1084 | + | |
| 1085 | +- (QMUILabel *)phoneLab { | |
| 1086 | + if (!_phoneLab) { | |
| 1087 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 1088 | + label.font = UIFontCNMake(15); | |
| 1089 | + label.textColor = KGray102Color; | |
| 1090 | + _phoneLab = label; | |
| 1091 | + } | |
| 1092 | + return _phoneLab; | |
| 1093 | +} | |
| 1094 | + | |
| 1095 | +- (QMUILabel *)addressLab { | |
| 1096 | + if (!_addressLab) { | |
| 1097 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 1098 | + label.font = UIFontCNMake(15); | |
| 1099 | + label.textColor = KGray102Color; | |
| 1100 | + label.numberOfLines = 0; | |
| 1101 | + _addressLab = label; | |
| 1102 | + } | |
| 1103 | + return _addressLab; | |
| 1104 | +} | |
| 1105 | + | |
| 1106 | +- (QMUILabel *)selectAddressLab { | |
| 1107 | + if (!_selectAddressLab) { | |
| 1108 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 1109 | + label.font = UIFontCNMake(16); | |
| 1110 | + label.textColor = KTextBlackColor; | |
| 1111 | + label.numberOfLines = 0; | |
| 1112 | + label.text = @"您现在还没有选择地址,请点击选择!"; | |
| 1113 | + _selectAddressLab = label; | |
| 1114 | + } | |
| 1115 | + return _selectAddressLab; | |
| 1116 | +} | |
| 1117 | + | |
| 1118 | +- (UIImageView *)moreImg{ | |
| 1119 | + if (!_moreImg) { | |
| 1120 | + _moreImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pyq_gengduo"]]; | |
| 1121 | + _moreImg.hidden = YES; | |
| 1122 | + } | |
| 1123 | + return _moreImg; | |
| 1124 | +} | |
| 1125 | +@end | |
| 1126 | +#pragma mark - | |
| 1127 | +#pragma mark - CNLiveFuncView | |
| 1128 | +@interface CNLiveFuncView () | |
| 1129 | + | |
| 1130 | +@end | |
| 1131 | +@implementation CNLiveFuncView | |
| 1132 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 1133 | + self = [super initWithFrame:frame]; | |
| 1134 | + if (self) { | |
| 1135 | + self.backgroundColor = [UIColor whiteColor]; | |
| 1136 | + } | |
| 1137 | + return self; | |
| 1138 | +} | |
| 1139 | + | |
| 1140 | +- (void)buttonDidClicked:(UIButton *)sender { | |
| 1141 | + if (self.funcBlock) { | |
| 1142 | + self.funcBlock(sender.tag); | |
| 1143 | + } | |
| 1144 | +} | |
| 1145 | +- (void)setFuncItems:(NSArray<CNLiveMineOrderButtonItem *> *)funcItems { | |
| 1146 | + CGSize size; | |
| 1147 | + UIFont *font; | |
| 1148 | + if (KScreenWidth == 320) { | |
| 1149 | + size = CGSizeMake((320-15*5)/4*RATIO, 25*RATIO); | |
| 1150 | + font = UIFontCNMake(12); | |
| 1151 | + } else { | |
| 1152 | + size = CGSizeMake(70*RATIO, 29*RATIO); | |
| 1153 | + font = UIFontCNMake(14); | |
| 1154 | + } | |
| 1155 | + NSInteger i = 0; | |
| 1156 | + | |
| 1157 | + [self removeAllSubviews]; | |
| 1158 | + | |
| 1159 | + for (CNLiveMineOrderButtonItem *item in funcItems) { | |
| 1160 | + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 1161 | + [button setTitle:item.title forState:UIControlStateNormal]; | |
| 1162 | + if (item.type == CNLiveMineOrderButtonTypeGray) { | |
| 1163 | + [button setTitleColor:KOrderButtonGrayColor forState:UIControlStateNormal]; | |
| 1164 | + button.layer.borderColor = KGray195Color.CGColor; | |
| 1165 | + [button setBackgroundImage:CNLiveUIImageWithColor(kWhiteColor) forState:UIControlStateNormal]; | |
| 1166 | + [button setBackgroundImage:CNLiveUIImageWithColor(RGB(238, 238, 238)) forState:UIControlStateHighlighted]; | |
| 1167 | + | |
| 1168 | + } else { | |
| 1169 | + [button setTitleColor:KOrderRedColor forState:UIControlStateNormal]; | |
| 1170 | + button.layer.borderColor = KOrderRedColor.CGColor; | |
| 1171 | + [button setBackgroundImage:CNLiveUIImageWithColor(kWhiteColor) forState:UIControlStateNormal]; | |
| 1172 | + [button setBackgroundImage:CNLiveUIImageWithColor(RGB(254,135,155)) forState:UIControlStateHighlighted]; | |
| 1173 | + } | |
| 1174 | + button.layer.borderWidth = 1; | |
| 1175 | + button.layer.cornerRadius = 6; | |
| 1176 | + button.layer.masksToBounds = YES; | |
| 1177 | + button.titleLabel.font = font; | |
| 1178 | + button.tag = item.tag; | |
| 1179 | + [button addTarget:self action:@selector(buttonDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | |
| 1180 | + [self addSubview:button]; | |
| 1181 | + CGFloat right = i*(size.width + 10 ) + 10; | |
| 1182 | + [button mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1183 | + make.size.mas_equalTo(size); | |
| 1184 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 1185 | + make.right.mas_equalTo(self.mas_right).mas_offset(-right); | |
| 1186 | + }]; | |
| 1187 | + i++; | |
| 1188 | + } | |
| 1189 | +} | |
| 1190 | +@end | |
| 1191 | +#pragma mark - | |
| 1192 | +#pragma mark - CNLiveWaitReceivingView | |
| 1193 | +@interface CNLiveWaitReceivingView () | |
| 1194 | +@property (nonatomic, strong) UILabel *statusLab; | |
| 1195 | +@property (nonatomic, strong) UILabel *timeLab; | |
| 1196 | +@end | |
| 1197 | +@implementation CNLiveWaitReceivingView | |
| 1198 | + | |
| 1199 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 1200 | + self = [super initWithFrame:frame]; | |
| 1201 | + if (self) { | |
| 1202 | + self.backgroundColor = [UIColor orangeColor]; | |
| 1203 | + [self addSubview:self.statusLab]; | |
| 1204 | + [self addSubview:self.timeLab]; | |
| 1205 | + [self p_addMasonry]; | |
| 1206 | + } | |
| 1207 | + return self; | |
| 1208 | +} | |
| 1209 | + | |
| 1210 | +- (void)p_addMasonry { | |
| 1211 | + | |
| 1212 | + [self.statusLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1213 | + make.left.mas_equalTo(self).mas_offset(2*Default_Space); | |
| 1214 | + make.top.mas_equalTo(self).mas_offset(Default_Space); | |
| 1215 | + make.height.mas_equalTo(20); | |
| 1216 | + }]; | |
| 1217 | + | |
| 1218 | + [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1219 | + make.left.mas_equalTo(self).mas_offset(2*Default_Space); | |
| 1220 | + make.top.mas_equalTo(self.statusLab.mas_bottom); | |
| 1221 | + make.height.mas_equalTo(17); | |
| 1222 | + }]; | |
| 1223 | +} | |
| 1224 | + | |
| 1225 | +#pragma mark - Getter | |
| 1226 | +- (UILabel *)statusLab{ | |
| 1227 | + if (!_statusLab) { | |
| 1228 | + _statusLab = [[UILabel alloc] init]; | |
| 1229 | + _statusLab.textColor = [UIColor whiteColor]; | |
| 1230 | + _statusLab.font = UIFontCNMake(17); | |
| 1231 | + _statusLab.text = @"待收货"; | |
| 1232 | + } | |
| 1233 | + return _statusLab; | |
| 1234 | +} | |
| 1235 | + | |
| 1236 | +- (UILabel *)timeLab{ | |
| 1237 | + if (!_timeLab) { | |
| 1238 | + _timeLab = [[UILabel alloc] init]; | |
| 1239 | + _timeLab.textColor = [UIColor whiteColor]; | |
| 1240 | + _timeLab.font = UIFontCNMake(15); | |
| 1241 | + _timeLab.text = @"还有6天2小时自动确认"; | |
| 1242 | + } | |
| 1243 | + return _timeLab; | |
| 1244 | +} | |
| 1245 | +@end | |
| 1246 | +#pragma mark - | |
| 1247 | +#pragma mark - CNLiveRefundNumView | |
| 1248 | +@interface CNLiveRefundNumView () | |
| 1249 | +@property (nonatomic, strong) UIButton *chatBtn; | |
| 1250 | +@property (nonatomic, strong) UILabel *numberLab; | |
| 1251 | +@property (nonatomic, strong) UILabel *statusLab; | |
| 1252 | +@end | |
| 1253 | +@implementation CNLiveRefundNumView | |
| 1254 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 1255 | + self = [super initWithFrame:frame]; | |
| 1256 | + if (self) { | |
| 1257 | + self.backgroundColor = [UIColor whiteColor]; | |
| 1258 | + [self addSubview:self.chatBtn]; | |
| 1259 | + [self addSubview:self.numberLab]; | |
| 1260 | + [self addSubview:self.statusLab]; | |
| 1261 | + [self p_addMasonry]; | |
| 1262 | + } | |
| 1263 | + return self; | |
| 1264 | +} | |
| 1265 | + | |
| 1266 | +- (void)setList:(CNLiveOrderList *)list { | |
| 1267 | + CNLiveOrderListOrderItem *orderItem = list.orderItem; | |
| 1268 | + _numberLab.text = [NSString stringWithFormat:@"订单编号: %@", orderItem.orderId]; | |
| 1269 | +} | |
| 1270 | +- (void)setStatusLabText:(NSString *)text { | |
| 1271 | + _statusLab.text = text; | |
| 1272 | +} | |
| 1273 | +- (void)p_addMasonry { | |
| 1274 | + [self.chatBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1275 | + make.left.top.mas_equalTo(self).mas_offset(Default_Space); | |
| 1276 | + make.size.mas_equalTo(CGSizeMake(40, 40)); | |
| 1277 | + }]; | |
| 1278 | + [self.numberLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1279 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 1280 | + make.left.mas_equalTo(self.chatBtn.mas_right).mas_offset(Default_Space); | |
| 1281 | + }]; | |
| 1282 | + | |
| 1283 | + [self.statusLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1284 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 1285 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 1286 | + }]; | |
| 1287 | + | |
| 1288 | +} | |
| 1289 | + | |
| 1290 | +#pragma mark - Getter | |
| 1291 | +- (UIButton *)chatBtn{ | |
| 1292 | + if (!_chatBtn) { | |
| 1293 | + _chatBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 1294 | + [_chatBtn setImage:[UIImage imageNamed:@"icon_tabbar_lab"] forState:UIControlStateNormal]; | |
| 1295 | + } | |
| 1296 | + return _chatBtn; | |
| 1297 | +} | |
| 1298 | + | |
| 1299 | +- (UILabel *)numberLab{ | |
| 1300 | + if (!_numberLab) { | |
| 1301 | + _numberLab = [[UILabel alloc] init]; | |
| 1302 | + _numberLab.font = UIFontCNMake(15); | |
| 1303 | + } | |
| 1304 | + return _numberLab; | |
| 1305 | +} | |
| 1306 | + | |
| 1307 | +- (UILabel *)statusLab{ | |
| 1308 | + if (!_statusLab) { | |
| 1309 | + _statusLab = [[UILabel alloc] init]; | |
| 1310 | + _statusLab.font = UIFontCNMake(15); | |
| 1311 | + _statusLab.textColor = kRedColor; | |
| 1312 | + _statusLab.textAlignment = NSTextAlignmentRight; | |
| 1313 | + } | |
| 1314 | + return _statusLab; | |
| 1315 | +} | |
| 1316 | +@end | |
| 1317 | +#pragma mark - | |
| 1318 | +#pragma mark - CNLiveOrderDetailStatusView | |
| 1319 | +@interface CNLiveOrderDetailStatusView () | |
| 1320 | +@property (nonatomic, strong) UILabel *sumLab; | |
| 1321 | +@property (nonatomic, strong) UILabel *numberLab; | |
| 1322 | +@property (nonatomic, strong) UILabel *statusLab; | |
| 1323 | +@property (nonatomic, strong) UILabel *receivingLab; | |
| 1324 | +@property (nonatomic, strong) UIButton *copyingBtn; | |
| 1325 | +@end | |
| 1326 | +@implementation CNLiveOrderDetailStatusView | |
| 1327 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 1328 | + self = [super initWithFrame:frame]; | |
| 1329 | + if (self) { | |
| 1330 | + self.backgroundColor = CNLiveColorWithHexString(KGrayColor); | |
| 1331 | + [self addSubview:self.statusLab]; | |
| 1332 | + [self addSubview:self.numberLab]; | |
| 1333 | + [self addSubview:self.sumLab]; | |
| 1334 | + [self addSubview:self.receivingLab]; | |
| 1335 | + [self addSubview:self.copyingBtn]; | |
| 1336 | + [self p_addMasonry]; | |
| 1337 | + } | |
| 1338 | + return self; | |
| 1339 | +} | |
| 1340 | + | |
| 1341 | +- (void)setList:(CNLiveOrderList *)list { | |
| 1342 | + _list = list; | |
| 1343 | + CNLiveOrderListOrderItem *orderItem = list.orderItem; | |
| 1344 | + CNLiveOrderRefundItem *refundItem = list.refundMsg; | |
| 1345 | + _numberLab.text = [NSString stringWithFormat:@"订单编号: %@", orderItem.orderId]; | |
| 1346 | + if (orderItem.status == 0) { //待确认 | |
| 1347 | + _statusLab.text = @"交易状态: 待确认"; | |
| 1348 | + _sumLab.text = [NSString stringWithFormat:@"实付金额: %.2f元 (包含服务费: %.2f元)", (float)orderItem.totalPrice, (float)orderItem.fee]; | |
| 1349 | + } | |
| 1350 | + if (orderItem.status == 1) { //待修改 | |
| 1351 | + _statusLab.text = @"交易状态: 待修改"; | |
| 1352 | + _sumLab.text = [NSString stringWithFormat:@"实付金额: %.2f元 (包含服务费: %.2f元)", (float)orderItem.totalPrice, (float)orderItem.fee]; | |
| 1353 | + } | |
| 1354 | + if (orderItem.status == 2) { //订单已取消 | |
| 1355 | + _statusLab.text = @"交易状态: 订单已取消"; | |
| 1356 | + _sumLab.text = [NSString stringWithFormat:@"实付金额: %.2f元 (包含服务费: %.2f元)", (float)orderItem.totalPrice , (float)orderItem.fee]; | |
| 1357 | + } | |
| 1358 | + if (orderItem.status == 3) { //待支付 | |
| 1359 | + _statusLab.text = @"交易状态: 待付款"; | |
| 1360 | + _sumLab.text = [NSString stringWithFormat:@"实付金额: %.2f元 (包含服务费: %.2f元)", (float)orderItem.totalPrice, (float)orderItem.fee]; | |
| 1361 | + } | |
| 1362 | + | |
| 1363 | + if (orderItem.status == 4) { //取消确认 | |
| 1364 | + _statusLab.text = @"交易状态: 交易关闭"; | |
| 1365 | + _sumLab.hidden = YES; | |
| 1366 | + } | |
| 1367 | + | |
| 1368 | + if (orderItem.status == 5) { //待发货 | |
| 1369 | + _statusLab.text = @"交易状态: 待发货"; | |
| 1370 | + _sumLab.text = [NSString stringWithFormat:@"实付金额: %.2f元 (包含服务费: %.2f元)", (float)orderItem.totalPrice, (float)orderItem.fee]; | |
| 1371 | + | |
| 1372 | + [self.sumLab mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 1373 | + make.left.mas_equalTo(self.statusLab); | |
| 1374 | + make.top.mas_equalTo(self.numberLab.mas_bottom).mas_offset(9); | |
| 1375 | + }]; | |
| 1376 | + } | |
| 1377 | + | |
| 1378 | + if (orderItem.status == 6) { //待收货 | |
| 1379 | + _statusLab.text = @"交易状态: 待收货"; | |
| 1380 | + _receivingLab.text = [NSString stringWithFormat:@"收货时间: 还有5天自动确认"]; | |
| 1381 | + _sumLab.text = [NSString stringWithFormat:@"实付金额: %.2f元 (包含服务费: %.2f元)", (float)orderItem.totalPrice, (float)orderItem.fee]; | |
| 1382 | + | |
| 1383 | + [self.receivingLab mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 1384 | + make.left.mas_equalTo(self.statusLab); | |
| 1385 | + make.top.mas_equalTo(self.numberLab.mas_bottom).mas_offset(9); | |
| 1386 | + make.height.mas_equalTo(17); | |
| 1387 | + }]; | |
| 1388 | + | |
| 1389 | + [self.sumLab mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 1390 | + make.left.mas_equalTo(self.statusLab); | |
| 1391 | + make.top.mas_equalTo(self.receivingLab.mas_bottom).mas_offset(9); | |
| 1392 | + }]; | |
| 1393 | + } | |
| 1394 | + | |
| 1395 | + if (orderItem.status == 7) { //已收货,若已评价显示交易成功,未评价显示待评价 | |
| 1396 | + | |
| 1397 | + if (!orderItem.commentable) { | |
| 1398 | + _statusLab.text = @"交易状态: 交易成功"; | |
| 1399 | + } | |
| 1400 | + else | |
| 1401 | + _statusLab.text = @"交易状态: 待评价"; | |
| 1402 | + | |
| 1403 | + _sumLab.text = [NSString stringWithFormat:@"实付金额: %.2f元 (包含服务费: %.2f元)", (float)orderItem.totalPrice, (float)orderItem.fee]; | |
| 1404 | + | |
| 1405 | + [self.receivingLab mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 1406 | + make.left.mas_equalTo(self.statusLab); | |
| 1407 | + make.top.mas_equalTo(self.numberLab.mas_bottom).mas_offset(9); | |
| 1408 | + make.height.mas_equalTo(0); | |
| 1409 | + }]; | |
| 1410 | + | |
| 1411 | + [self.sumLab mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 1412 | + make.left.mas_equalTo(self.statusLab); | |
| 1413 | + make.top.mas_equalTo(self.numberLab.mas_bottom).mas_offset(9); | |
| 1414 | + }]; | |
| 1415 | + } | |
| 1416 | + | |
| 1417 | + if (orderItem.status == 8 || orderItem.status == 9 || orderItem.status == 11) { //确认退款和申请退款为退款中状态 | |
| 1418 | + _statusLab.text = @"交易状态: 退款中"; | |
| 1419 | + _sumLab.text = [NSString stringWithFormat:@"退款金额: %.2f元 (包含服务费: %.2f元)", (float)refundItem.refundSum, (float)orderItem.fee]; | |
| 1420 | + } | |
| 1421 | + | |
| 1422 | + if (orderItem.status == 10) { //退款失败 | |
| 1423 | + _statusLab.text = @"交易状态: 退款失败"; | |
| 1424 | + _sumLab.text = [NSString stringWithFormat:@"退款金额: %.2f元 (包含服务费: %.2f元)", (float)refundItem.refundSum, (float)orderItem.fee]; | |
| 1425 | + } | |
| 1426 | + | |
| 1427 | + if (orderItem.status == 12) { //退款成功 | |
| 1428 | + _statusLab.text = @"交易状态: 退款成功"; | |
| 1429 | + _sumLab.text = [NSString stringWithFormat:@"退款金额: %.2f元 (包含服务费: %.2f元)", (float)refundItem.refundSum, (float)orderItem.fee]; | |
| 1430 | + } | |
| 1431 | + | |
| 1432 | + [self mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 1433 | + make.left.top.mas_equalTo(0); | |
| 1434 | + make.width.mas_equalTo(kScreenWidth); | |
| 1435 | + make.bottom.mas_equalTo(self.sumLab.mas_bottom).mas_offset(21); | |
| 1436 | + }]; | |
| 1437 | +} | |
| 1438 | + | |
| 1439 | +- (void)copyingBtnDidSelected { | |
| 1440 | + | |
| 1441 | + CNLiveOrderListOrderItem *orderItem = _list.orderItem; | |
| 1442 | + | |
| 1443 | + UIPasteboard*pasteboard = [UIPasteboard generalPasteboard]; | |
| 1444 | + pasteboard.string = orderItem.orderId; | |
| 1445 | +// [[HUDHelper sharedInstance] tipMessage:@"复制成功且可以粘贴对应编号"]; | |
| 1446 | +} | |
| 1447 | +- (void)updateCutdown:(NSInteger)seconds { | |
| 1448 | + | |
| 1449 | + int days = (int)(seconds/(3600*24)); | |
| 1450 | + int hours = (int)((seconds - days*24*3600)/3600); | |
| 1451 | + int minute = (int)(seconds - days*24*3600 - hours*3600)/60; | |
| 1452 | + | |
| 1453 | + if (days == 0) { | |
| 1454 | + | |
| 1455 | + if (hours == 0) { | |
| 1456 | + _receivingLab.text = [NSString stringWithFormat:@"收货时间: 还有%d分自动确认", minute]; | |
| 1457 | + } else { | |
| 1458 | + _receivingLab.text = [NSString stringWithFormat:@"收货时间: 还有%d小时%d分自动确认", hours, minute]; | |
| 1459 | + } | |
| 1460 | + | |
| 1461 | + } else { | |
| 1462 | + _receivingLab.text = [NSString stringWithFormat:@"收货时间: 还有%d天%d小时%d分自动确认", days, hours, minute]; | |
| 1463 | + } | |
| 1464 | + | |
| 1465 | + NSLog(@"%@", _receivingLab.text); | |
| 1466 | + | |
| 1467 | +} | |
| 1468 | +- (void)p_addMasonry { | |
| 1469 | + | |
| 1470 | + [self.statusLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1471 | + make.top.mas_equalTo(self).mas_offset(21); | |
| 1472 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 1473 | + }]; | |
| 1474 | + | |
| 1475 | + [self.numberLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1476 | + make.left.mas_equalTo(self.statusLab); | |
| 1477 | + make.top.mas_equalTo(self.statusLab.mas_bottom).mas_offset(9); | |
| 1478 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 1479 | + }]; | |
| 1480 | + | |
| 1481 | + [self.copyingBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1482 | + make.size.mas_equalTo(CGSizeMake(85*RATIO, 20*RATIO)); | |
| 1483 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 1484 | + make.centerY.mas_equalTo(self.statusLab.mas_centerY); | |
| 1485 | + }]; | |
| 1486 | + | |
| 1487 | + [self.sumLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1488 | + make.left.mas_equalTo(self.statusLab); | |
| 1489 | + make.top.mas_equalTo(self.numberLab.mas_bottom).mas_offset(9); | |
| 1490 | + }]; | |
| 1491 | + | |
| 1492 | +} | |
| 1493 | + | |
| 1494 | +#pragma mark - Getter | |
| 1495 | +- (UILabel *)numberLab{ | |
| 1496 | + if (!_numberLab) { | |
| 1497 | + _numberLab = [[UILabel alloc] init]; | |
| 1498 | + _numberLab.font = UIFontCNMake(15); | |
| 1499 | + _numberLab.textColor = [UIColor whiteColor]; | |
| 1500 | + } | |
| 1501 | + return _numberLab; | |
| 1502 | +} | |
| 1503 | + | |
| 1504 | +- (UILabel *)statusLab{ | |
| 1505 | + if (!_statusLab) { | |
| 1506 | + _statusLab = [[UILabel alloc] init]; | |
| 1507 | + _statusLab.font = UIFontCNMake(15); | |
| 1508 | + _statusLab.textColor = [UIColor whiteColor]; | |
| 1509 | + } | |
| 1510 | + return _statusLab; | |
| 1511 | +} | |
| 1512 | + | |
| 1513 | +- (UILabel *)sumLab{ | |
| 1514 | + if (!_sumLab) { | |
| 1515 | + _sumLab = [[UILabel alloc] init]; | |
| 1516 | + _sumLab.font = UIFontCNMake(15); | |
| 1517 | + _sumLab.textColor = [UIColor whiteColor]; | |
| 1518 | + } | |
| 1519 | + return _sumLab; | |
| 1520 | +} | |
| 1521 | + | |
| 1522 | +- (UILabel *)receivingLab{ | |
| 1523 | + if (!_receivingLab) { | |
| 1524 | + _receivingLab = [[UILabel alloc] init]; | |
| 1525 | + _receivingLab.font = UIFontCNMake(15); | |
| 1526 | + _receivingLab.textColor = [UIColor whiteColor]; | |
| 1527 | + } | |
| 1528 | + return _receivingLab; | |
| 1529 | +} | |
| 1530 | + | |
| 1531 | +- (UIButton *)copyingBtn{ | |
| 1532 | + if (!_copyingBtn) { | |
| 1533 | + _copyingBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 1534 | + [_copyingBtn setTitle:@"复制编号" forState:UIControlStateNormal]; | |
| 1535 | + [_copyingBtn setImage:[UIImage imageNamed:@"dd_fuzhi2"] forState:UIControlStateNormal]; | |
| 1536 | + [_copyingBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | |
| 1537 | + _copyingBtn.titleLabel.font = UIFontCNMake(14); | |
| 1538 | + [_copyingBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 5, 0, 0)]; | |
| 1539 | + [_copyingBtn addTarget:self action:@selector(copyingBtnDidSelected) forControlEvents:UIControlEventTouchUpInside]; | |
| 1540 | + } | |
| 1541 | + return _copyingBtn; | |
| 1542 | +} | |
| 1543 | +@end | |
| 1544 | +#pragma mark - | |
| 1545 | +#pragma mark - CNLiveContactDarenView | |
| 1546 | +@interface CNLiveContactDarenView () | |
| 1547 | +@property (nonatomic, strong) UIButton *contactBtn; | |
| 1548 | +@end | |
| 1549 | +@implementation CNLiveContactDarenView | |
| 1550 | + | |
| 1551 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 1552 | + self = [super initWithFrame:frame]; | |
| 1553 | + if (self) { | |
| 1554 | + self.backgroundColor = [UIColor whiteColor]; | |
| 1555 | + [self addSubview:self.contactBtn]; | |
| 1556 | + [self p_addMasonry]; | |
| 1557 | + } | |
| 1558 | + return self; | |
| 1559 | +} | |
| 1560 | + | |
| 1561 | +- (void)contactBtnDidSelected { | |
| 1562 | + if (self.contactDarenBlock) { | |
| 1563 | + self.contactDarenBlock(_list); | |
| 1564 | + } | |
| 1565 | +} | |
| 1566 | + | |
| 1567 | +- (void)setList:(CNLiveOrderList *)list { | |
| 1568 | + _list = list; | |
| 1569 | +} | |
| 1570 | + | |
| 1571 | +- (void)p_addMasonry { | |
| 1572 | + | |
| 1573 | + [self.contactBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1574 | + make.size.mas_equalTo(CGSizeMake(120, 40)); | |
| 1575 | + make.center.mas_equalTo(self.center); | |
| 1576 | + }]; | |
| 1577 | + | |
| 1578 | +} | |
| 1579 | + | |
| 1580 | +#pragma mark - Getter | |
| 1581 | +- (UIButton *)contactBtn{ | |
| 1582 | + if (!_contactBtn) { | |
| 1583 | + _contactBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 1584 | + [_contactBtn setImage:[UIImage imageNamed:@"dd_sixindaren"] forState:UIControlStateNormal]; | |
| 1585 | + [_contactBtn setTitle:@"联系达人" forState:UIControlStateNormal]; | |
| 1586 | + [_contactBtn setTitleColor:KTextBlackColor forState:UIControlStateNormal]; | |
| 1587 | + _contactBtn.titleLabel.font = UIFontCNMake(14); | |
| 1588 | + [_contactBtn addTarget:self action:@selector(contactBtnDidSelected) forControlEvents:UIControlEventTouchUpInside]; | |
| 1589 | + _contactBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, -10); | |
| 1590 | + } | |
| 1591 | + return _contactBtn; | |
| 1592 | +} | |
| 1593 | +@end | |
| 1594 | +#pragma mark - | |
| 1595 | +#pragma mark - CNLiveCurRefundPrecessView | |
| 1596 | +@interface CNLiveCurRefundPrecessView : UIView | |
| 1597 | +@property (nonatomic, strong) UILabel *titleLab; | |
| 1598 | +@property (nonatomic, strong) UILabel *subTitleLab; | |
| 1599 | +@end | |
| 1600 | +@implementation CNLiveCurRefundPrecessView | |
| 1601 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 1602 | + self = [super initWithFrame:frame]; | |
| 1603 | + if (self) { | |
| 1604 | + self.backgroundColor = [UIColor whiteColor]; | |
| 1605 | + [self addSubview:self.titleLab]; | |
| 1606 | + [self addSubview:self.subTitleLab]; | |
| 1607 | + [self p_addMasonry]; | |
| 1608 | + } | |
| 1609 | + return self; | |
| 1610 | +} | |
| 1611 | + | |
| 1612 | +- (void)setTitle:(NSString *)title subTitle:(NSString *)subTitle { | |
| 1613 | + _titleLab.text = title; | |
| 1614 | + _subTitleLab.text = subTitle; | |
| 1615 | +} | |
| 1616 | + | |
| 1617 | +- (void)p_addMasonry { | |
| 1618 | + | |
| 1619 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1620 | + make.left.top.right.mas_equalTo(self); | |
| 1621 | + make.height.mas_equalTo(self).multipliedBy(0.6); | |
| 1622 | + }]; | |
| 1623 | + | |
| 1624 | + [self.subTitleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1625 | + make.left.right.mas_equalTo(self); | |
| 1626 | + make.top.mas_equalTo(self.titleLab.mas_bottom); | |
| 1627 | + make.height.mas_equalTo(self).multipliedBy(0.4); | |
| 1628 | + }]; | |
| 1629 | +} | |
| 1630 | + | |
| 1631 | +#pragma mark - Getter | |
| 1632 | +- (UILabel *)titleLab { | |
| 1633 | + if (!_titleLab) { | |
| 1634 | + _titleLab = [[UILabel alloc] init]; | |
| 1635 | + _titleLab.font = UIFontCNMake(14); | |
| 1636 | + _titleLab.textColor = KUserInfoGrayColor; | |
| 1637 | + _titleLab.textAlignment = NSTextAlignmentCenter; | |
| 1638 | + } | |
| 1639 | + return _titleLab; | |
| 1640 | +} | |
| 1641 | + | |
| 1642 | +- (UILabel *)subTitleLab { | |
| 1643 | + if (!_subTitleLab) { | |
| 1644 | + _subTitleLab = [[UILabel alloc] init]; | |
| 1645 | + _subTitleLab.font = UIFontCNMake(10); | |
| 1646 | + _subTitleLab.textColor = KUserInfoGrayColor; | |
| 1647 | + _subTitleLab.textAlignment = NSTextAlignmentCenter; | |
| 1648 | + _subTitleLab.adjustsFontSizeToFitWidth = YES; | |
| 1649 | + } | |
| 1650 | + return _subTitleLab; | |
| 1651 | +} | |
| 1652 | +@end | |
| 1653 | +#pragma mark - | |
| 1654 | +#pragma mark - CNLiveRefundProcessView | |
| 1655 | +@interface CNLiveRefundProcessView () | |
| 1656 | +@property (nonatomic, strong) UILabel *titleLab; //退款流程 | |
| 1657 | +@property (nonatomic, strong) UILabel *accountLab; //退回到xx账户 | |
| 1658 | +@property (nonatomic, strong) UILabel *sumLab; //金额 | |
| 1659 | +@property (nonatomic, strong) UIView *firstView; //第一个圆点 | |
| 1660 | +@property (nonatomic, strong) UIView *sencondView; //第二个圆点 | |
| 1661 | +@property (nonatomic, strong) UIView *thirdView; //第三个圆点 | |
| 1662 | +@property (nonatomic, strong) UIView *leftLine; //左边线 | |
| 1663 | +@property (nonatomic, strong) UIView *rightLine; //右边线 | |
| 1664 | +@property (nonatomic, strong) CNLiveCurRefundPrecessView *sellerView; | |
| 1665 | +@property (nonatomic, strong) CNLiveCurRefundPrecessView *platformView; | |
| 1666 | +@property (nonatomic, strong) CNLiveCurRefundPrecessView *successView; | |
| 1667 | +@property (nonatomic, strong) UIImageView *firstSuccView; | |
| 1668 | +@property (nonatomic, strong) UIImageView *secondSuccView; | |
| 1669 | +@property (nonatomic, strong) UIImageView *thirdSuccView; | |
| 1670 | +@property (nonatomic, strong) UIView *splitLine; | |
| 1671 | +@end | |
| 1672 | + | |
| 1673 | +@implementation CNLiveRefundProcessView | |
| 1674 | + | |
| 1675 | +- (instancetype)init{ | |
| 1676 | + self = [super init]; | |
| 1677 | + if (self) { | |
| 1678 | + self.backgroundColor = [UIColor whiteColor]; | |
| 1679 | + [self addSubview:self.titleLab]; | |
| 1680 | + [self addSubview:self.accountLab]; | |
| 1681 | + [self addSubview:self.sumLab]; | |
| 1682 | + [self addSubview:self.firstView]; | |
| 1683 | + [self addSubview:self.sencondView]; | |
| 1684 | + [self addSubview:self.thirdView]; | |
| 1685 | + [self addSubview:self.leftLine]; | |
| 1686 | + [self addSubview:self.rightLine]; | |
| 1687 | + [self addSubview:self.sellerView]; | |
| 1688 | + [self addSubview:self.platformView]; | |
| 1689 | + [self addSubview:self.successView]; | |
| 1690 | + [self addSubview:self.firstSuccView]; | |
| 1691 | + [self addSubview:self.secondSuccView]; | |
| 1692 | + [self addSubview:self.thirdSuccView]; | |
| 1693 | + [self addSubview:self.splitLine]; | |
| 1694 | + | |
| 1695 | + } | |
| 1696 | + return self; | |
| 1697 | +} | |
| 1698 | + | |
| 1699 | +- (void)layoutSubviews { | |
| 1700 | + | |
| 1701 | + [self p_addMasonry]; | |
| 1702 | + | |
| 1703 | +} | |
| 1704 | + | |
| 1705 | +- (void)setList:(CNLiveOrderList *)list { | |
| 1706 | + | |
| 1707 | + CNLiveOrderRefundItem *refundItem = list.refundMsg; | |
| 1708 | + CNLiveOrderListOrderItem *orderItem = list.orderItem; | |
| 1709 | + | |
| 1710 | + if ([refundItem.payType isEqualToString:@"ali"]) { | |
| 1711 | + _accountLab.text = @"退回到支付宝"; | |
| 1712 | + } | |
| 1713 | + else if ([refundItem.payType isEqualToString:@"wjj"]) | |
| 1714 | + { | |
| 1715 | + _accountLab.text = @"退回网家家平台"; | |
| 1716 | + | |
| 1717 | + } | |
| 1718 | + else if ([refundItem.payType isEqualToString:@"union"]) | |
| 1719 | + { | |
| 1720 | + _accountLab.text = @"退回银行卡"; | |
| 1721 | + } | |
| 1722 | + else if ([refundItem.payType isEqualToString:@"wechat"]) | |
| 1723 | + { | |
| 1724 | + _accountLab.text = @"退回到微信"; | |
| 1725 | + } | |
| 1726 | + | |
| 1727 | + _sumLab.text = [NSString stringWithFormat:@"%.2f元", (float)refundItem.refundSum]; | |
| 1728 | + | |
| 1729 | + if (![NSString isEmpty:refundItem.sellerAcceptTime]) { | |
| 1730 | + | |
| 1731 | + _firstSuccView.hidden = NO; | |
| 1732 | + _secondSuccView.hidden = NO; | |
| 1733 | + _leftLine.backgroundColor = KYellowColor; | |
| 1734 | + | |
| 1735 | + [_sellerView setTitle:@"卖家退款" subTitle:refundItem.sellerAcceptTime]; | |
| 1736 | + [_platformView setTitle:@"平台受理" subTitle:refundItem.sellerAcceptTime]; | |
| 1737 | + } else { | |
| 1738 | + [_sellerView setTitle:@"卖家退款" subTitle:@""]; | |
| 1739 | + [_platformView setTitle:@"平台受理" subTitle:@""]; | |
| 1740 | + } | |
| 1741 | + | |
| 1742 | + if (orderItem.status == 12) { | |
| 1743 | + _thirdSuccView.hidden = NO; | |
| 1744 | + _firstSuccView.hidden = NO; | |
| 1745 | + _secondSuccView.hidden = NO; | |
| 1746 | + _leftLine.backgroundColor = KYellowColor; | |
| 1747 | + _rightLine.backgroundColor = KYellowColor; | |
| 1748 | + [_successView setTitle:@"退款成功" subTitle:refundItem.refundTime]; | |
| 1749 | + } | |
| 1750 | +} | |
| 1751 | + | |
| 1752 | +- (void)p_addMasonry { | |
| 1753 | + | |
| 1754 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1755 | + make.left.mas_equalTo(self).mas_offset(15); | |
| 1756 | + make.top.mas_equalTo(self).mas_offset(20); | |
| 1757 | + }]; | |
| 1758 | + | |
| 1759 | + [self.splitLine mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1760 | + make.left.mas_equalTo(self).mas_equalTo(Default_Space); | |
| 1761 | + make.top.mas_equalTo(self.titleLab.mas_bottom).mas_offset(20); | |
| 1762 | + make.size.mas_equalTo(CGSizeMake(KScreenWidth-20, 0.4)); | |
| 1763 | + }]; | |
| 1764 | + | |
| 1765 | + [self.accountLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1766 | + make.left.mas_equalTo(self).mas_offset(15); | |
| 1767 | + make.top.mas_equalTo(self.splitLine.mas_bottom).mas_offset(Default_Space); | |
| 1768 | + }]; | |
| 1769 | + | |
| 1770 | + [self.sumLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1771 | + make.top.mas_equalTo(self.accountLab); | |
| 1772 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 1773 | + }]; | |
| 1774 | + | |
| 1775 | + [self.firstView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1776 | + make.left.mas_equalTo(self).mas_offset(50); | |
| 1777 | + make.centerY.mas_equalTo(self.accountLab.mas_bottom).mas_offset(21.5); | |
| 1778 | + make.size.mas_equalTo(CGSizeMake(5, 5)); | |
| 1779 | + }]; | |
| 1780 | + | |
| 1781 | + [self.sencondView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1782 | + make.centerX.mas_equalTo(self.mas_centerX); | |
| 1783 | + make.centerY.mas_equalTo(self.accountLab.mas_bottom).mas_offset(21.5); | |
| 1784 | + make.size.mas_equalTo(CGSizeMake(5, 5)); | |
| 1785 | + }]; | |
| 1786 | + | |
| 1787 | + [self.thirdView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1788 | + make.right.mas_equalTo(self.mas_right).mas_offset(-50); | |
| 1789 | + make.centerY.mas_equalTo(self.accountLab.mas_bottom).mas_offset(21.5); | |
| 1790 | + make.size.mas_equalTo(CGSizeMake(5, 5)); | |
| 1791 | + }]; | |
| 1792 | + | |
| 1793 | + [self.leftLine mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1794 | + make.left.mas_equalTo(self.firstView.mas_centerX); | |
| 1795 | + make.right.mas_equalTo(self.sencondView.mas_centerX); | |
| 1796 | + make.centerY.mas_equalTo(self.firstView.mas_centerY); | |
| 1797 | + make.height.mas_equalTo(0.5); | |
| 1798 | + }]; | |
| 1799 | + | |
| 1800 | + [self.rightLine mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1801 | + make.left.mas_equalTo(self.sencondView.mas_centerX); | |
| 1802 | + make.right.mas_equalTo(self.thirdView.mas_centerX); | |
| 1803 | + make.centerY.mas_equalTo(self.firstView.mas_centerY); | |
| 1804 | + make.height.mas_equalTo(0.5); | |
| 1805 | + }]; | |
| 1806 | + | |
| 1807 | + CGFloat width = (KScreenWidth)/3; | |
| 1808 | + | |
| 1809 | + [self.sellerView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1810 | + make.top.mas_equalTo(self.firstView.mas_bottom).mas_offset(5); | |
| 1811 | + make.size.mas_equalTo(CGSizeMake(width, 40)); | |
| 1812 | + make.centerX.mas_equalTo(self.firstView.mas_centerX); | |
| 1813 | + }]; | |
| 1814 | + | |
| 1815 | + [self.platformView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1816 | + make.top.mas_equalTo(self.firstView.mas_bottom).mas_offset(5); | |
| 1817 | + make.size.mas_equalTo(CGSizeMake(width, 40)); | |
| 1818 | + make.centerX.mas_equalTo(self.sencondView.mas_centerX); | |
| 1819 | + }]; | |
| 1820 | + | |
| 1821 | + [self.successView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1822 | + make.top.mas_equalTo(self.firstView.mas_bottom).mas_offset(5); | |
| 1823 | + make.size.mas_equalTo(CGSizeMake(width, 40)); | |
| 1824 | + make.centerX.mas_equalTo(self.thirdView.mas_centerX); | |
| 1825 | + }]; | |
| 1826 | + | |
| 1827 | + [self.firstSuccView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1828 | + make.size.mas_equalTo(CGSizeMake(13, 13)); | |
| 1829 | + make.centerX.mas_equalTo(self.firstView.mas_centerX); | |
| 1830 | + make.centerY.mas_equalTo(self.firstView.mas_centerY); | |
| 1831 | + }]; | |
| 1832 | + | |
| 1833 | + [self.secondSuccView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1834 | + make.size.mas_equalTo(CGSizeMake(13, 13)); | |
| 1835 | + make.centerX.mas_equalTo(self.sencondView.mas_centerX); | |
| 1836 | + make.centerY.mas_equalTo(self.sencondView.mas_centerY); | |
| 1837 | + }]; | |
| 1838 | + | |
| 1839 | + [self.thirdSuccView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 1840 | + make.size.mas_equalTo(CGSizeMake(13, 13)); | |
| 1841 | + make.centerX.mas_equalTo(self.thirdView.mas_centerX); | |
| 1842 | + make.centerY.mas_equalTo(self.thirdView.mas_centerY); | |
| 1843 | + }]; | |
| 1844 | + | |
| 1845 | +} | |
| 1846 | + | |
| 1847 | +#pragma mark - Getter | |
| 1848 | +- (UILabel *)titleLab{ | |
| 1849 | + if (!_titleLab) { | |
| 1850 | + _titleLab = [[UILabel alloc] init]; | |
| 1851 | + _titleLab.font = UIFontCNMake(15); | |
| 1852 | + _titleLab.textColor = KTextBlackColor; | |
| 1853 | + _titleLab.text = @"退款流程"; | |
| 1854 | + } | |
| 1855 | + return _titleLab; | |
| 1856 | +} | |
| 1857 | + | |
| 1858 | +- (UIView *)splitLine{ | |
| 1859 | + if (!_splitLine) { | |
| 1860 | + _splitLine = [[UIView alloc] init]; | |
| 1861 | + _splitLine.backgroundColor = KGray195Color; | |
| 1862 | + } | |
| 1863 | + return _splitLine; | |
| 1864 | +} | |
| 1865 | + | |
| 1866 | +- (UILabel *)accountLab{ | |
| 1867 | + if (!_accountLab) { | |
| 1868 | + _accountLab = [[UILabel alloc] init]; | |
| 1869 | + _accountLab.font = UIFontCNMake(15); | |
| 1870 | + _accountLab.textColor = KTextBlackColor; | |
| 1871 | + } | |
| 1872 | + return _accountLab; | |
| 1873 | +} | |
| 1874 | + | |
| 1875 | +- (UILabel *)sumLab{ | |
| 1876 | + if (!_sumLab) { | |
| 1877 | + _sumLab = [[UILabel alloc] init]; | |
| 1878 | + _sumLab.textAlignment = NSTextAlignmentRight; | |
| 1879 | + _sumLab.font = UIFontCNMake(15); | |
| 1880 | + _sumLab.textColor = KTextBlackColor; | |
| 1881 | + | |
| 1882 | + } | |
| 1883 | + return _sumLab; | |
| 1884 | +} | |
| 1885 | + | |
| 1886 | +- (UIView *)firstView{ | |
| 1887 | + if (!_firstView) { | |
| 1888 | + _firstView = [[UIView alloc] init]; | |
| 1889 | + _firstView.layer.cornerRadius = 2.5; | |
| 1890 | + _firstView.backgroundColor = kLightGrayColor; | |
| 1891 | + } | |
| 1892 | + return _firstView; | |
| 1893 | +} | |
| 1894 | + | |
| 1895 | +- (UIView *)sencondView{ | |
| 1896 | + if (!_sencondView) { | |
| 1897 | + _sencondView = [[UIView alloc] init]; | |
| 1898 | + _sencondView.layer.cornerRadius = 2.5; | |
| 1899 | + _sencondView.backgroundColor = kLightGrayColor; | |
| 1900 | + } | |
| 1901 | + return _sencondView; | |
| 1902 | +} | |
| 1903 | + | |
| 1904 | +- (UIView *)thirdView{ | |
| 1905 | + if (!_thirdView) { | |
| 1906 | + _thirdView = [[UIView alloc] init]; | |
| 1907 | + _thirdView.layer.cornerRadius = 2.5; | |
| 1908 | + _thirdView.backgroundColor = kLightGrayColor; | |
| 1909 | + } | |
| 1910 | + return _thirdView; | |
| 1911 | +} | |
| 1912 | + | |
| 1913 | +- (UIView *)leftLine{ | |
| 1914 | + if (!_leftLine) { | |
| 1915 | + _leftLine = [[UIView alloc] init]; | |
| 1916 | + _leftLine.backgroundColor = kLightGrayColor; | |
| 1917 | + } | |
| 1918 | + return _leftLine; | |
| 1919 | +} | |
| 1920 | + | |
| 1921 | +- (UIView *)rightLine{ | |
| 1922 | + if (!_rightLine) { | |
| 1923 | + _rightLine = [[UIView alloc] init]; | |
| 1924 | + _rightLine.backgroundColor = kLightGrayColor; | |
| 1925 | + } | |
| 1926 | + return _rightLine; | |
| 1927 | +} | |
| 1928 | + | |
| 1929 | +- (CNLiveCurRefundPrecessView *)sellerView{ | |
| 1930 | + if (!_sellerView) { | |
| 1931 | + _sellerView = [[CNLiveCurRefundPrecessView alloc] init]; | |
| 1932 | + } | |
| 1933 | + return _sellerView; | |
| 1934 | +} | |
| 1935 | + | |
| 1936 | +- (CNLiveCurRefundPrecessView *)platformView{ | |
| 1937 | + if (!_platformView) { | |
| 1938 | + _platformView = [[CNLiveCurRefundPrecessView alloc] init]; | |
| 1939 | + } | |
| 1940 | + return _platformView; | |
| 1941 | +} | |
| 1942 | + | |
| 1943 | +- (CNLiveCurRefundPrecessView *)successView{ | |
| 1944 | + if (!_successView) { | |
| 1945 | + _successView = [[CNLiveCurRefundPrecessView alloc] init]; | |
| 1946 | + } | |
| 1947 | + return _successView; | |
| 1948 | +} | |
| 1949 | + | |
| 1950 | +- (UIImageView *)firstSuccView{ | |
| 1951 | + if (!_firstSuccView) { | |
| 1952 | + _firstSuccView = [[UIImageView alloc] init]; | |
| 1953 | + _firstSuccView.image = [UIImage imageNamed:@"dd_tuikuanchenggong"]; | |
| 1954 | + _firstSuccView.hidden = YES; | |
| 1955 | + } | |
| 1956 | + return _firstSuccView; | |
| 1957 | +} | |
| 1958 | + | |
| 1959 | +- (UIImageView *)secondSuccView{ | |
| 1960 | + if (!_secondSuccView) { | |
| 1961 | + _secondSuccView = [[UIImageView alloc] init]; | |
| 1962 | + _secondSuccView.image = [UIImage imageNamed:@"dd_tuikuanchenggong"]; | |
| 1963 | + _secondSuccView.hidden = YES; | |
| 1964 | + } | |
| 1965 | + return _secondSuccView; | |
| 1966 | +} | |
| 1967 | + | |
| 1968 | +- (UIImageView *)thirdSuccView{ | |
| 1969 | + if (!_thirdSuccView) { | |
| 1970 | + _thirdSuccView = [[UIImageView alloc] init]; | |
| 1971 | + _thirdSuccView.image = [UIImage imageNamed:@"dd_tuikuanchenggong"]; | |
| 1972 | + _thirdSuccView.hidden = YES; | |
| 1973 | + } | |
| 1974 | + return _thirdSuccView; | |
| 1975 | +} | |
| 1976 | +@end | |
| 1977 | +#pragma mark - | |
| 1978 | +#pragma mark - CNRefundFailView | |
| 1979 | +@interface CNLiveRefundFailView () | |
| 1980 | + | |
| 1981 | +@property (nonatomic, strong) UILabel *reasonLab; | |
| 1982 | + | |
| 1983 | +@end | |
| 1984 | + | |
| 1985 | +@implementation CNLiveRefundFailView | |
| 1986 | + | |
| 1987 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 1988 | + { | |
| 1989 | + self = [super initWithFrame:frame]; | |
| 1990 | + if (self) { | |
| 1991 | + self.backgroundColor = [UIColor whiteColor]; | |
| 1992 | + [self addSubview:self.reasonLab]; | |
| 1993 | + [self p_addMasonry]; | |
| 1994 | + } | |
| 1995 | + return self; | |
| 1996 | + } | |
| 1997 | + | |
| 1998 | +- (void)setList:(CNLiveOrderList *)list { | |
| 1999 | + CNLiveOrderRefundItem *refundItem = list.refundMsg; | |
| 2000 | + _reasonLab.text = [NSString stringWithFormat:@"退款失败原因: %@", refundItem.reasonForRefusal]; | |
| 2001 | + | |
| 2002 | + CGSize size = [_reasonLab.text textSizeIn:CGSizeMake(KScreenWidth-30, HUGE_VAL) font:UIFontCNMake(15)]; | |
| 2003 | + | |
| 2004 | + if (size.height < 55) { | |
| 2005 | + | |
| 2006 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 2007 | + make.height.mas_equalTo(55); | |
| 2008 | + }]; | |
| 2009 | + | |
| 2010 | + } else { | |
| 2011 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 2012 | + make.bottom.mas_equalTo(self.reasonLab.mas_bottom).mas_offset(20); | |
| 2013 | + }]; | |
| 2014 | + } | |
| 2015 | + | |
| 2016 | +} | |
| 2017 | + | |
| 2018 | +- (void)p_addMasonry { | |
| 2019 | + | |
| 2020 | + [self.reasonLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2021 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 2022 | + make.left.mas_equalTo(15); | |
| 2023 | + make.right.mas_equalTo(self.mas_right).mas_offset(-15); | |
| 2024 | + }]; | |
| 2025 | + | |
| 2026 | +} | |
| 2027 | + | |
| 2028 | +#pragma mark - Getter | |
| 2029 | +- (UILabel *)reasonLab | |
| 2030 | + { | |
| 2031 | + if (!_reasonLab) { | |
| 2032 | + _reasonLab = [[UILabel alloc] init]; | |
| 2033 | + _reasonLab.font = UIFontCNMake(15); | |
| 2034 | + _reasonLab.textColor = KOrderRedColor; | |
| 2035 | + _reasonLab.numberOfLines = 0; | |
| 2036 | + } | |
| 2037 | + return _reasonLab; | |
| 2038 | + } | |
| 2039 | + | |
| 2040 | +@end | |
| 2041 | +#pragma mark - | |
| 2042 | +#pragma mark - CNRefundReasonView | |
| 2043 | +@interface CNLiveRefundReasonView () | |
| 2044 | +@property (nonatomic, strong) UILabel *reasonLab; | |
| 2045 | +@end | |
| 2046 | + | |
| 2047 | +@implementation CNLiveRefundReasonView | |
| 2048 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 2049 | + { | |
| 2050 | + self = [super initWithFrame:frame]; | |
| 2051 | + if (self) { | |
| 2052 | + self.backgroundColor = [UIColor whiteColor]; | |
| 2053 | + [self addSubview:self.reasonLab]; | |
| 2054 | + [self addSubview:self.reasonBtn]; | |
| 2055 | + [self p_addMasonry]; | |
| 2056 | + } | |
| 2057 | + return self; | |
| 2058 | + } | |
| 2059 | + | |
| 2060 | +- (void)setReasonText:(NSString *)text showMore:(BOOL)show { | |
| 2061 | + _reasonBtn.hidden = !show; | |
| 2062 | + _reasonLab.text = text; | |
| 2063 | +} | |
| 2064 | + | |
| 2065 | +- (void)moreBtnDidSelected { | |
| 2066 | + if (self.handle) { | |
| 2067 | + self.handle(); | |
| 2068 | + } | |
| 2069 | +} | |
| 2070 | + | |
| 2071 | +- (void)p_addMasonry { | |
| 2072 | + | |
| 2073 | + [self.reasonLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2074 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 2075 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 2076 | + make.width.mas_equalTo(66); | |
| 2077 | + }]; | |
| 2078 | + | |
| 2079 | + [self.reasonBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2080 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 2081 | + make.left.mas_equalTo(self.reasonLab.mas_right).mas_offset(10); | |
| 2082 | + make.right.mas_equalTo(self.mas_right).mas_offset(-16); | |
| 2083 | + make.height.mas_equalTo(29); | |
| 2084 | + }]; | |
| 2085 | + | |
| 2086 | +} | |
| 2087 | + | |
| 2088 | +#pragma mark - Getter | |
| 2089 | +- (UILabel *)reasonLab | |
| 2090 | + { | |
| 2091 | + if (!_reasonLab) { | |
| 2092 | + _reasonLab = [[UILabel alloc] init]; | |
| 2093 | + _reasonLab.textColor = KTextBlackColor; | |
| 2094 | + _reasonLab.font = UIFontCNMake(15); | |
| 2095 | + _reasonLab.text = @"退款原因: "; | |
| 2096 | + } | |
| 2097 | + return _reasonLab;; | |
| 2098 | + } | |
| 2099 | + | |
| 2100 | +- (CNLiveSelectRefundButton *)reasonBtn | |
| 2101 | + { | |
| 2102 | + if (!_reasonBtn) { | |
| 2103 | + _reasonBtn = [CNLiveSelectRefundButton buttonWithType:UIButtonTypeCustom]; | |
| 2104 | + [_reasonBtn setTitle:@"点击选取退款原因" forState:UIControlStateNormal]; | |
| 2105 | + [_reasonBtn setTitleColor:KGray153Color forState:UIControlStateNormal]; | |
| 2106 | + [_reasonBtn setImage:[UIImage imageNamed:@"dd_xialajiantou"] forState:UIControlStateNormal]; | |
| 2107 | + [_reasonBtn addTarget:self action:@selector(moreBtnDidSelected) forControlEvents:UIControlEventTouchUpInside]; | |
| 2108 | + } | |
| 2109 | + return _reasonBtn; | |
| 2110 | +} | |
| 2111 | +@end | |
| 2112 | +@interface CNLiveRefundSumView ()<UITextFieldDelegate> | |
| 2113 | + | |
| 2114 | +@property (nonatomic, strong) UILabel *titleLab; | |
| 2115 | + | |
| 2116 | +@end | |
| 2117 | + | |
| 2118 | +@implementation CNLiveRefundSumView{ | |
| 2119 | + BOOL isHaveDian; | |
| 2120 | +} | |
| 2121 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 2122 | + { | |
| 2123 | + self = [super initWithFrame:frame]; | |
| 2124 | + if (self) { | |
| 2125 | + self.backgroundColor = [UIColor whiteColor]; | |
| 2126 | + [self addSubview:self.titleLab]; | |
| 2127 | + [self addSubview:self.sumTextField]; | |
| 2128 | + } | |
| 2129 | + return self; | |
| 2130 | + } | |
| 2131 | + | |
| 2132 | +- (void)layoutSubviews { | |
| 2133 | + [self p_addMasonry]; | |
| 2134 | +} | |
| 2135 | + | |
| 2136 | +- (void)p_addMasonry { | |
| 2137 | + | |
| 2138 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2139 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 2140 | + make.left.mas_equalTo(self.mas_left).mas_offset(Default_Space); | |
| 2141 | + }]; | |
| 2142 | + | |
| 2143 | + [self.sumTextField mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2144 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 2145 | + make.left.mas_equalTo(self.titleLab.mas_right).mas_offset(Default_Space); | |
| 2146 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 2147 | + }]; | |
| 2148 | + | |
| 2149 | +} | |
| 2150 | + | |
| 2151 | +#pragma mark - Getter | |
| 2152 | +- (UILabel *)titleLab | |
| 2153 | + { | |
| 2154 | + if (!_titleLab) { | |
| 2155 | + _titleLab = [[UILabel alloc] init]; | |
| 2156 | + _titleLab.font = UIFontCNMake(15); | |
| 2157 | + _titleLab.textColor = KTextBlackColor; | |
| 2158 | + _titleLab.text = @"退款金额: "; | |
| 2159 | + } | |
| 2160 | + return _titleLab; | |
| 2161 | + } | |
| 2162 | + | |
| 2163 | +- (UITextField *)sumTextField | |
| 2164 | + { | |
| 2165 | + if (!_sumTextField) { | |
| 2166 | + _sumTextField = [[UITextField alloc] init]; | |
| 2167 | + _sumTextField.keyboardType = UIKeyboardTypeDecimalPad; | |
| 2168 | + _sumTextField.placeholder = @"0.00"; | |
| 2169 | + _sumTextField.textColor = KTextBlackColor; | |
| 2170 | + _sumTextField.delegate = self; | |
| 2171 | + _sumTextField.font = UIFontCNMake(15); | |
| 2172 | + } | |
| 2173 | + return _sumTextField; | |
| 2174 | + } | |
| 2175 | +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(nonnull NSString *)string{ | |
| 2176 | + if ([textField.text rangeOfString:@"."].location == NSNotFound) { | |
| 2177 | + isHaveDian = NO; | |
| 2178 | + } | |
| 2179 | + | |
| 2180 | + if ([string length] > 0) { | |
| 2181 | + | |
| 2182 | + unichar single = [string characterAtIndex:0];//当前输入的字符 | |
| 2183 | + if ((single >= '0' && single <= '9') || single == '.') {//数据格式正确 | |
| 2184 | + | |
| 2185 | + //首字母不能为0和小数点 | |
| 2186 | + if([textField.text length] == 0){ | |
| 2187 | + if(single == '.') { | |
| 2188 | + // 第一个数字不能为小数点 | |
| 2189 | + [textField.text stringByReplacingCharactersInRange:range withString:@""]; | |
| 2190 | + return NO; | |
| 2191 | + } | |
| 2192 | + } | |
| 2193 | + //输入的字符是否是小数点 | |
| 2194 | + if (single == '.') { | |
| 2195 | + if(!isHaveDian)//text中还没有小数点 | |
| 2196 | + { | |
| 2197 | + isHaveDian = YES; | |
| 2198 | + return YES; | |
| 2199 | + | |
| 2200 | + }else{ | |
| 2201 | + // 已经输入过小数点了 | |
| 2202 | + [textField.text stringByReplacingCharactersInRange:range withString:@""]; | |
| 2203 | + return NO; | |
| 2204 | + } | |
| 2205 | + }else{ | |
| 2206 | + if (isHaveDian) {//存在小数点 | |
| 2207 | + | |
| 2208 | + //判断小数点的位数 | |
| 2209 | + NSRange ran = [textField.text rangeOfString:@"."]; | |
| 2210 | + if (range.location - ran.location <= 2) { | |
| 2211 | + return YES; | |
| 2212 | + }else{ | |
| 2213 | + // 最多输入两位小数 | |
| 2214 | + return NO; | |
| 2215 | + } | |
| 2216 | + }else{ | |
| 2217 | + return YES; | |
| 2218 | + } | |
| 2219 | + } | |
| 2220 | + }else{//输入的数据格式不正确 | |
| 2221 | + // 输入的格式不正确 | |
| 2222 | + [textField.text stringByReplacingCharactersInRange:range withString:@""]; | |
| 2223 | + return NO; | |
| 2224 | + } | |
| 2225 | + } | |
| 2226 | + else | |
| 2227 | + { | |
| 2228 | + return YES; | |
| 2229 | + } | |
| 2230 | +} | |
| 2231 | + @end | |
| 2232 | + | |
| 2233 | + | |
| 2234 | +@interface CNLiveRefundNoteView ()<UITextFieldDelegate> | |
| 2235 | + | |
| 2236 | +@property (nonatomic, strong) UILabel *titleLab; | |
| 2237 | + | |
| 2238 | +@end | |
| 2239 | + | |
| 2240 | +@implementation CNLiveRefundNoteView | |
| 2241 | + | |
| 2242 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 2243 | + { | |
| 2244 | + self = [super initWithFrame:frame]; | |
| 2245 | + if (self) { | |
| 2246 | + self.backgroundColor = [UIColor whiteColor]; | |
| 2247 | + [self addSubview:self.titleLab]; | |
| 2248 | + [self addSubview:self.noteTextField]; | |
| 2249 | + } | |
| 2250 | + return self; | |
| 2251 | + } | |
| 2252 | + | |
| 2253 | +- (void)layoutSubviews { | |
| 2254 | + [self p_addMasonry]; | |
| 2255 | +} | |
| 2256 | + | |
| 2257 | +#pragma mark - UITextFieldDelegate | |
| 2258 | +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { | |
| 2259 | + | |
| 2260 | + if (textField == self.noteTextField) { | |
| 2261 | + | |
| 2262 | + if (range.length == 1 && string.length == 0) { | |
| 2263 | + return YES; | |
| 2264 | + } | |
| 2265 | + | |
| 2266 | + else if (self.noteTextField.text.length >= 200) { | |
| 2267 | + self.noteTextField.text = [textField.text substringToIndex:200]; | |
| 2268 | + return NO; | |
| 2269 | + } | |
| 2270 | + } | |
| 2271 | + return YES; | |
| 2272 | +} | |
| 2273 | + | |
| 2274 | +- (void)p_addMasonry { | |
| 2275 | + | |
| 2276 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2277 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 2278 | + make.left.mas_equalTo(self.mas_left).mas_offset(Default_Space); | |
| 2279 | + make.width.mas_equalTo(70); | |
| 2280 | + }]; | |
| 2281 | + | |
| 2282 | + [self.noteTextField mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2283 | + make.centerY.mas_equalTo(self.mas_centerY); | |
| 2284 | + make.left.mas_equalTo(self.titleLab.mas_right).mas_offset(Default_Space); | |
| 2285 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 2286 | + }]; | |
| 2287 | + | |
| 2288 | +} | |
| 2289 | + | |
| 2290 | +#pragma mark - Getter | |
| 2291 | +- (UILabel *)titleLab | |
| 2292 | + { | |
| 2293 | + if (!_titleLab) { | |
| 2294 | + _titleLab = [[UILabel alloc] init]; | |
| 2295 | + _titleLab.textColor = KTextBlackColor; | |
| 2296 | + _titleLab.font = UIFontCNMake(15); | |
| 2297 | + _titleLab.text = @"退款说明: "; | |
| 2298 | + } | |
| 2299 | + return _titleLab; | |
| 2300 | + } | |
| 2301 | + | |
| 2302 | +- (UITextField *)noteTextField | |
| 2303 | + { | |
| 2304 | + if (!_noteTextField) { | |
| 2305 | + _noteTextField = [[UITextField alloc] init]; | |
| 2306 | + _noteTextField.placeholder = @"选填(文字限制在200字以内)"; | |
| 2307 | + _noteTextField.textColor = KTextBlackColor; | |
| 2308 | + _noteTextField.font = UIFontCNMake(15); | |
| 2309 | + _noteTextField.clearButtonMode = UITextFieldViewModeWhileEditing; | |
| 2310 | + _noteTextField.delegate = self; | |
| 2311 | + } | |
| 2312 | + return _noteTextField; | |
| 2313 | + } | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + @end | |
| 2318 | + | |
| 2319 | + | |
| 2320 | +#pragma mark - | |
| 2321 | +#pragma mark - CNLiveRefundReasonAndNoteView | |
| 2322 | +@interface CNLiveRefundReasonAndNoteView () | |
| 2323 | +@property (nonatomic, strong) UILabel *noteLab; | |
| 2324 | +@property (nonatomic, strong) UILabel *reasonLab; | |
| 2325 | +@end | |
| 2326 | + | |
| 2327 | +@implementation CNLiveRefundReasonAndNoteView | |
| 2328 | + | |
| 2329 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 2330 | + { | |
| 2331 | + self = [super initWithFrame:frame]; | |
| 2332 | + if (self) { | |
| 2333 | + self.backgroundColor = [UIColor whiteColor]; | |
| 2334 | + [self addSubview:self.noteLab]; | |
| 2335 | + [self addSubview:self.reasonLab]; | |
| 2336 | + [self p_addMasonry]; | |
| 2337 | + } | |
| 2338 | + return self; | |
| 2339 | + } | |
| 2340 | + | |
| 2341 | +- (void)setList:(CNLiveOrderList *)list { | |
| 2342 | + | |
| 2343 | + CNLiveOrderRefundItem *refundItem = list.refundMsg; | |
| 2344 | + NSString *note = [NSString isEmpty:refundItem.note] ? @"无" : refundItem.note; | |
| 2345 | + _noteLab.text = [NSString stringWithFormat:@"退款说明: %@", note]; | |
| 2346 | + _reasonLab.text = [NSString stringWithFormat:@"退款原因: %@", refundItem.cause]; | |
| 2347 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 2348 | + make.bottom.mas_equalTo(self.noteLab.mas_bottom).mas_offset(15); | |
| 2349 | + }]; | |
| 2350 | + | |
| 2351 | +} | |
| 2352 | + | |
| 2353 | +- (void)p_addMasonry { | |
| 2354 | + | |
| 2355 | + [self.reasonLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2356 | + make.top.mas_equalTo(self).mas_offset(15); | |
| 2357 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 2358 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 2359 | + }]; | |
| 2360 | + | |
| 2361 | + [self.noteLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2362 | + make.top.mas_equalTo(self.reasonLab.mas_bottom).mas_offset(Default_Space); | |
| 2363 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 2364 | + make.right.mas_equalTo(self.mas_right).mas_offset(-Default_Space); | |
| 2365 | + }]; | |
| 2366 | + | |
| 2367 | +} | |
| 2368 | + | |
| 2369 | +#pragma mark - Getter | |
| 2370 | +- (UILabel *)noteLab | |
| 2371 | + { | |
| 2372 | + if (!_noteLab) { | |
| 2373 | + _noteLab = [[UILabel alloc] init]; | |
| 2374 | + _noteLab.font = UIFontCNMake(14); | |
| 2375 | + _noteLab.textColor = KTextBlackColor; | |
| 2376 | + _noteLab.numberOfLines = 0; | |
| 2377 | + } | |
| 2378 | + return _noteLab; | |
| 2379 | + } | |
| 2380 | + | |
| 2381 | +- (UILabel *)reasonLab | |
| 2382 | + { | |
| 2383 | + if (!_reasonLab) { | |
| 2384 | + _reasonLab = [[UILabel alloc] init]; | |
| 2385 | + _reasonLab.font = UIFontCNMake(14); | |
| 2386 | + _reasonLab.textColor = KTextBlackColor; | |
| 2387 | + _reasonLab.numberOfLines = 0; | |
| 2388 | + } | |
| 2389 | + return _reasonLab; | |
| 2390 | + } | |
| 2391 | + | |
| 2392 | +@end | |
| 2393 | + | |
| 2394 | + | |
| 2395 | +#pragma mark - | |
| 2396 | +#pragma mark - CNLiveRefundVoucherView | |
| 2397 | +@interface CNLiveRefundVoucherView () | |
| 2398 | + | |
| 2399 | +@property (nonatomic, strong) UILabel *titleLab; | |
| 2400 | +@property (nonatomic, strong) CNLiveVoucherView *voucherView; | |
| 2401 | +@end | |
| 2402 | + | |
| 2403 | +@implementation CNLiveRefundVoucherView | |
| 2404 | + | |
| 2405 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 2406 | + { | |
| 2407 | + self = [super initWithFrame:frame]; | |
| 2408 | + if (self) { | |
| 2409 | + self.backgroundColor = [UIColor whiteColor]; | |
| 2410 | + [self addSubview:self.titleLab]; | |
| 2411 | + } | |
| 2412 | + return self; | |
| 2413 | + } | |
| 2414 | + | |
| 2415 | +- (void)setList:(CNLiveOrderList *)list { | |
| 2416 | + | |
| 2417 | + CNLiveOrderRefundItem *refundItem = list.refundMsg; | |
| 2418 | + | |
| 2419 | + if (refundItem.imgPathArray.count > 0) { | |
| 2420 | + | |
| 2421 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2422 | + make.left.mas_equalTo(self).mas_offset(15); | |
| 2423 | + make.top.mas_equalTo(self).mas_offset(15); | |
| 2424 | + make.right.mas_equalTo(self).mas_offset(-15); | |
| 2425 | + }]; | |
| 2426 | + | |
| 2427 | + self.voucherView.dataSource = refundItem.imgPathArray; | |
| 2428 | + | |
| 2429 | + CGFloat voucher_width = kScreenWidth-2*10; | |
| 2430 | + CGFloat image_width = (voucher_width-2*20)/3; | |
| 2431 | + CGFloat voucher_height = 0.0; | |
| 2432 | + | |
| 2433 | + if (refundItem.imgPathArray.count == 0) { | |
| 2434 | + voucher_height = 0; | |
| 2435 | + }else if (refundItem.imgPathArray.count <= 3) { | |
| 2436 | + voucher_height = image_width; | |
| 2437 | + }else if (refundItem.imgPathArray.count > 3 && refundItem.imgPathArray.count <= 6){ | |
| 2438 | + voucher_height = 2*image_width+20; | |
| 2439 | + }else if (refundItem.imgPathArray.count > 6 && refundItem.imgPathArray.count <= 9){ | |
| 2440 | + voucher_height = 3*image_width+2*20; | |
| 2441 | + } | |
| 2442 | + | |
| 2443 | + [self addSubview:self.voucherView]; | |
| 2444 | + | |
| 2445 | + [self.voucherView mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 2446 | + make.left.mas_equalTo(self).mas_offset(Default_Space); | |
| 2447 | + make.top.mas_equalTo(self.titleLab.mas_bottom).mas_offset(11); | |
| 2448 | + make.size.mas_equalTo(CGSizeMake(voucher_width, voucher_height)); | |
| 2449 | + }]; | |
| 2450 | + | |
| 2451 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 2452 | + make.bottom.mas_equalTo(self.voucherView.mas_bottom).mas_offset(2*Default_Space); | |
| 2453 | + }]; | |
| 2454 | + | |
| 2455 | + } | |
| 2456 | + | |
| 2457 | +} | |
| 2458 | + | |
| 2459 | +#pragma mark - Getter | |
| 2460 | +- (UILabel *)titleLab | |
| 2461 | + { | |
| 2462 | + if (!_titleLab) { | |
| 2463 | + _titleLab = [[UILabel alloc] init]; | |
| 2464 | + _titleLab.font = UIFontCNMake(14); | |
| 2465 | + _titleLab.textColor = KTextBlackColor; | |
| 2466 | + _titleLab.text = @"上传凭证"; | |
| 2467 | + _titleLab.numberOfLines = 0; | |
| 2468 | + } | |
| 2469 | + return _titleLab; | |
| 2470 | + } | |
| 2471 | + | |
| 2472 | +- (CNLiveVoucherView *)voucherView | |
| 2473 | + { | |
| 2474 | + if (!_voucherView) { | |
| 2475 | + _voucherView = [[CNLiveVoucherView alloc] init]; | |
| 2476 | + weakself | |
| 2477 | + _voucherView.picClick = ^(NSArray *imageViews, NSArray *urlsArr,NSArray *thumbUrlsArr, FLAnimatedImageView *selectedView,NSInteger index) { | |
| 2478 | + // if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(picSelected:urls:selectedView:)]) { | |
| 2479 | + // [weakSelf.delegate picSelected:imageViews urls:urlsArr selectedView:selectedView]; | |
| 2480 | + // } | |
| 2481 | + if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(picSelected:urls:thumbUrlsArr:selectedView:Index:)]) { | |
| 2482 | + [weakSelf.delegate picSelected:imageViews urls:urlsArr thumbUrlsArr:thumbUrlsArr selectedView:selectedView Index:index]; | |
| 2483 | + } | |
| 2484 | + }; | |
| 2485 | + } | |
| 2486 | + return _voucherView; | |
| 2487 | + } | |
| 2488 | + | |
| 2489 | +@end | |
| 2490 | + | |
| 2491 | +/* | |
| 2492 | +#import "CNStarsControl.h" | |
| 2493 | +@interface CNEvaluateStarView ()<CNStarsControlDelegate> | |
| 2494 | + | |
| 2495 | + @property (nonatomic, strong) CNStarsControl *starsControlView; | |
| 2496 | + @property (nonatomic, strong) UIImageView *iconImgView; | |
| 2497 | + @property (nonatomic, strong) UILabel *scoreLab; | |
| 2498 | + @property (nonatomic, strong) UILabel *titleLab; | |
| 2499 | + | |
| 2500 | + @end | |
| 2501 | + | |
| 2502 | +@implementation CNEvaluateStarView | |
| 2503 | + | |
| 2504 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 2505 | + { | |
| 2506 | + self = [super initWithFrame:frame]; | |
| 2507 | + if (self) { | |
| 2508 | + self.backgroundColor = [UIColor whiteColor]; | |
| 2509 | + [self addSubview:self.iconImgView]; | |
| 2510 | + [self addSubview:self.titleLab]; | |
| 2511 | + [self addSubview:self.starsControlView]; | |
| 2512 | + [self addSubview:self.scoreLab]; | |
| 2513 | + } | |
| 2514 | + return self; | |
| 2515 | + } | |
| 2516 | + | |
| 2517 | +- (void)setList:(CNOrderList *)list { | |
| 2518 | + CNOrderListIconBean *icon = list.iconBean; | |
| 2519 | + [_iconImgView sd_setImageWithURL:[NSURL URLWithString:icon.image] placeholderImage:kDefaultUserIcon]; | |
| 2520 | +} | |
| 2521 | + | |
| 2522 | +- (void)starsControl:(CNStarsControl *)starsControl didChangeScore:(CGFloat)score { | |
| 2523 | + _scoreLab.text = [NSString stringWithFormat:@"%.1f分",2*score]; | |
| 2524 | + | |
| 2525 | + if (self.delagete && [self.delagete respondsToSelector:@selector(updateScore:)]) { | |
| 2526 | + [self.delagete updateScore:score]; | |
| 2527 | + } | |
| 2528 | + | |
| 2529 | +} | |
| 2530 | + | |
| 2531 | + | |
| 2532 | +#pragma mark - Getter | |
| 2533 | +- (UIImageView *)iconImgView | |
| 2534 | + { | |
| 2535 | + if (!_iconImgView) { | |
| 2536 | + _iconImgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 21, 50, 50)]; | |
| 2537 | + _iconImgView.backgroundColor = kRedColor; | |
| 2538 | + _iconImgView.layer.masksToBounds = YES; | |
| 2539 | + _iconImgView.layer.cornerRadius = 25; | |
| 2540 | + } | |
| 2541 | + return _iconImgView; | |
| 2542 | + } | |
| 2543 | + | |
| 2544 | +- (UILabel *)scoreLab | |
| 2545 | + { | |
| 2546 | + if (!_scoreLab) { | |
| 2547 | + _scoreLab = [[UILabel alloc] initWithFrame:CGRectMake(KScreenWidth-60, 50, 50, 20)]; | |
| 2548 | + _scoreLab.font = UIFontCNMake(15); | |
| 2549 | + _scoreLab.textColor = KYellowColor; | |
| 2550 | + _scoreLab.textAlignment = NSTextAlignmentRight; | |
| 2551 | + _scoreLab.text = @"6.0分"; | |
| 2552 | + } | |
| 2553 | + return _scoreLab; | |
| 2554 | + } | |
| 2555 | + | |
| 2556 | +- (UILabel *)titleLab | |
| 2557 | + { | |
| 2558 | + if (!_titleLab) { | |
| 2559 | + _titleLab = [[UILabel alloc] initWithFrame:CGRectMake(_iconImgView.right+19, 20, 100, 20)]; | |
| 2560 | + _titleLab.font = UIFontCNMake(15); | |
| 2561 | + _titleLab.textColor = KTextBlackColor; | |
| 2562 | + _titleLab.text = @"达人评分"; | |
| 2563 | + } | |
| 2564 | + return _titleLab; | |
| 2565 | + } | |
| 2566 | + | |
| 2567 | +- (CNStarsControl *)starsControlView | |
| 2568 | + { | |
| 2569 | + if (!_starsControlView) { | |
| 2570 | + _starsControlView = [CNStarsControl.alloc initWithFrame:CGRectMake(_iconImgView.right+19, 36, 185 , 55) stars:5 starSize:CGSizeMake(25, 25) noramlStarImage:[UIImage imageNamed:@"drd_xing_kong"] highlightedStarImage:[UIImage imageNamed:@"drd_xing_quan"]]; | |
| 2571 | + _starsControlView.delegate = self; | |
| 2572 | + _starsControlView.allowFraction = YES; | |
| 2573 | + _starsControlView.score = 3.f; | |
| 2574 | + } | |
| 2575 | + return _starsControlView; | |
| 2576 | + } | |
| 2577 | + @end | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | +#pragma mark - | |
| 2582 | +#pragma mark - CNOrderTimeView | |
| 2583 | +@interface CNOrderTimeView () | |
| 2584 | + | |
| 2585 | + @property (nonatomic, strong) UILabel *timeLab; | |
| 2586 | + | |
| 2587 | + @end | |
| 2588 | + | |
| 2589 | +@implementation CNOrderTimeView | |
| 2590 | + | |
| 2591 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 2592 | + { | |
| 2593 | + self = [super initWithFrame:frame]; | |
| 2594 | + if (self) { | |
| 2595 | + self.backgroundColor = kWhiteColor; | |
| 2596 | + [self addSubview:self.timeLab]; | |
| 2597 | + [self p_addMasonry]; | |
| 2598 | + } | |
| 2599 | + return self; | |
| 2600 | + } | |
| 2601 | + | |
| 2602 | +- (void)setList:(CNOrderList *)list { | |
| 2603 | + | |
| 2604 | + CNOrderListOrderItem *item = list.orderItem; | |
| 2605 | + NSMutableString *timeText = [[NSMutableString alloc] init]; | |
| 2606 | + | |
| 2607 | + //创建时间 | |
| 2608 | + if (![NSString isEmpty:item.createTime]) { | |
| 2609 | + [timeText appendString:[NSString stringWithFormat:@"创建时间:%@", item.createTime]]; | |
| 2610 | + } | |
| 2611 | + | |
| 2612 | + //确认时间 | |
| 2613 | + if (![NSString isEmpty:item.confirmTime]) { | |
| 2614 | + [timeText appendString:[NSString stringWithFormat:@"\n确认时间:%@", item.confirmTime]]; | |
| 2615 | + } | |
| 2616 | + | |
| 2617 | + //付款时间 | |
| 2618 | + if (![NSString isEmpty:item.payTime]) { | |
| 2619 | + [timeText appendString:[NSString stringWithFormat:@"\n支付时间:%@", item.payTime]]; | |
| 2620 | + } | |
| 2621 | + | |
| 2622 | + //发货时间 | |
| 2623 | + if (![NSString isEmpty:item.deliveryTime]) { | |
| 2624 | + [timeText appendString:[NSString stringWithFormat:@"\n发货时间:%@", item.deliveryTime]]; | |
| 2625 | + } | |
| 2626 | + | |
| 2627 | + //收货时间 | |
| 2628 | + if (![NSString isEmpty:item.takeDeliveryTime]) { | |
| 2629 | + [timeText appendString:[NSString stringWithFormat:@"\n收货时间:%@", item.takeDeliveryTime]]; | |
| 2630 | + } | |
| 2631 | + | |
| 2632 | + NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init]; | |
| 2633 | + paraStyle.lineSpacing = 5; | |
| 2634 | + NSDictionary *dic = @{NSFontAttributeName:UIFontCNMake(12), NSParagraphStyleAttributeName:paraStyle}; | |
| 2635 | + NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:timeText attributes:dic]; | |
| 2636 | + | |
| 2637 | + _timeLab.attributedText = attributeStr; | |
| 2638 | + | |
| 2639 | + [self mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 2640 | + make.bottom.mas_equalTo(self.timeLab.mas_bottom).mas_offset(13); | |
| 2641 | + }]; | |
| 2642 | +} | |
| 2643 | + | |
| 2644 | +- (void)p_addMasonry { | |
| 2645 | + | |
| 2646 | + [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 2647 | + make.left.mas_equalTo(self).mas_offset(14); | |
| 2648 | + make.top.mas_equalTo(self).mas_offset(14); | |
| 2649 | + make.right.mas_equalTo(self.mas_right).mas_offset(-14); | |
| 2650 | + }]; | |
| 2651 | + | |
| 2652 | +} | |
| 2653 | + | |
| 2654 | +#pragma mark - Getter | |
| 2655 | +- (UILabel *)timeLab | |
| 2656 | + { | |
| 2657 | + if (!_timeLab) { | |
| 2658 | + _timeLab = [[UILabel alloc] init]; | |
| 2659 | + _timeLab.textColor = KGray153Color; | |
| 2660 | + _timeLab.font = UIFontCNMake(12); | |
| 2661 | + _timeLab.numberOfLines = 0; | |
| 2662 | + } | |
| 2663 | + return _timeLab; | |
| 2664 | + } | |
| 2665 | + | |
| 2666 | + @end | |
| 2667 | + | |
| 2668 | +*/ | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveNoOrderView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveNoOrderView.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveNoOrderView : UIView | |
| 13 | +- (void)setImageName:(NSString *)imageName title:(NSString *)title customTopH:(CGFloat)topH; | |
| 14 | +@end | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveNoOrderView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveNoOrderView.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveNoOrderView.h" | |
| 9 | +#import "Masonry.h" | |
| 10 | +#import <QMUIKit/QMUIKit.h> | |
| 11 | +#import "CNLiveCommonCategory.h" | |
| 12 | +#import "CNLiveBaseKit.h" | |
| 13 | +@interface CNLiveNoOrderView () | |
| 14 | +@property (nonatomic ,strong) UIImageView * iconView; | |
| 15 | +@property (nonatomic ,strong) QMUILabel * noOrderLbl; | |
| 16 | +@end | |
| 17 | + | |
| 18 | +@implementation CNLiveNoOrderView | |
| 19 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 20 | + { | |
| 21 | + if (self = [super initWithFrame:frame]) { | |
| 22 | + self.backgroundColor = kWhiteColor; | |
| 23 | + [self initSubViews]; | |
| 24 | + } | |
| 25 | + return self; | |
| 26 | + } | |
| 27 | + | |
| 28 | +- (void)initSubViews | |
| 29 | + { | |
| 30 | + self.iconView = [[UIImageView alloc] init]; | |
| 31 | + [self addSubview:self.iconView]; | |
| 32 | + | |
| 33 | + self.noOrderLbl = [[QMUILabel alloc] init]; | |
| 34 | + self.noOrderLbl.font = UIFontMake(15); | |
| 35 | + self.noOrderLbl.textColor = KSubTitleGrayColor; | |
| 36 | + self.noOrderLbl.textAlignment = NSTextAlignmentCenter; | |
| 37 | + [self addSubview:self.noOrderLbl]; | |
| 38 | + | |
| 39 | + [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 40 | + make.width.height.mas_equalTo(80); | |
| 41 | + make.centerX.mas_equalTo(self.mas_centerX); | |
| 42 | + make.top.mas_equalTo(self.mas_top).mas_offset(56); | |
| 43 | + }]; | |
| 44 | + | |
| 45 | + [self.noOrderLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 46 | + make.top.mas_equalTo(self.iconView.mas_bottom).mas_offset(10); | |
| 47 | + make.centerX.mas_equalTo(self.mas_centerX); | |
| 48 | + }]; | |
| 49 | + | |
| 50 | + } | |
| 51 | + | |
| 52 | +- (void)setImageName:(NSString *)imageName title:(NSString *)title customTopH:(CGFloat)topH{ | |
| 53 | + self.noOrderLbl.text = title; | |
| 54 | + self.iconView.image = [UIImage imageNamed:imageName]; | |
| 55 | + | |
| 56 | + if (topH) { | |
| 57 | + [self.iconView mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 58 | + make.top.mas_equalTo(self).mas_offset(topH); | |
| 59 | + }]; | |
| 60 | + } | |
| 61 | + | |
| 62 | +} | |
| 63 | + | |
| 64 | + | |
| 65 | +@end | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveOrderEventHandle.h
0 → 100644
CNLiveMyOrder/Classes/View/CNLiveOrderEventHandle.m
0 → 100644
CNLiveMyOrder/Classes/View/CNLiveOrderListCommonView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderListCommonView.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveOrderListCommonView : UIView | |
| 13 | + //订单状态 0-全部,1-代付款,2-待收货,3-待评价,4-全部退款 ,5退款中 | |
| 14 | +- (instancetype)initWithFrame:(CGRect)frame orderStatus:(NSString *)status; | |
| 15 | + | |
| 16 | +- (void)refreshData; | |
| 17 | +@end | |
| 18 | + | |
| 19 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveOrderListCommonView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveOrderListCommonView.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveOrderListCommonView.h" | |
| 9 | +#import "CNLiveOrderModel.h" | |
| 10 | +#import "CNLiveMineOrderTableViewCell.h" | |
| 11 | +#import "CNLiveNoOrderView.h" | |
| 12 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | |
| 13 | +#import "CNLiveBaseKit.h" | |
| 14 | +#import <QMUIKit/QMUIKit.h> | |
| 15 | +#import "MJRefresh.h" | |
| 16 | +#import "CNErrorOrNoNetView.h" | |
| 17 | +#import "CNLiveOrderEventHandle.h" | |
| 18 | +#import "CNLiveMineOrderItem.h" | |
| 19 | +#import "MJExtension.h" | |
| 20 | +#import "CNLiveEnvironmentConfiguration.h" | |
| 21 | +#import "CNUserInfoManager.h" | |
| 22 | +@interface CNLiveOrderListCommonView ()<UITableViewDelegate,UITableViewDataSource,CNLiveMineOrderTableViewCellDelegate> { | |
| 23 | +NSString *_status; //订单状态 0-全部,1-代付款,2-待收货,3-待评价,4-全部退款 ,5退款中(全部只返回123数据) | |
| 24 | +NSInteger _page; | |
| 25 | +BOOL _next; | |
| 26 | +} | |
| 27 | +@property (nonatomic, strong) NSMutableArray *listArr; //数据源 | |
| 28 | +@property (nonatomic, strong) UITableView *tableView; | |
| 29 | +@property (nonatomic, strong) CNLiveNoOrderView *noDataView; | |
| 30 | +@end | |
| 31 | + | |
| 32 | +@implementation CNLiveOrderListCommonView | |
| 33 | +- (instancetype)initWithFrame:(CGRect)frame orderStatus:(NSString *)status | |
| 34 | + { | |
| 35 | + self = [super initWithFrame:frame]; | |
| 36 | + if (self) { | |
| 37 | + self.backgroundColor = kWeChatBgColor; | |
| 38 | + _status = status; | |
| 39 | + [self setNoDataViewByStatus:[status integerValue]]; | |
| 40 | + [self addSubview:self.tableView]; | |
| 41 | + } | |
| 42 | + return self; | |
| 43 | + } | |
| 44 | + | |
| 45 | +- (void)refreshData { | |
| 46 | + _page = 1; | |
| 47 | + _next = YES; | |
| 48 | + [self requestDataWithPage:_page refresh:YES]; | |
| 49 | +} | |
| 50 | + | |
| 51 | +- (void)requestDataWithPage:(NSInteger)page refresh:(BOOL)refresh { | |
| 52 | + | |
| 53 | + [QMUITips showLoadingInView:self]; | |
| 54 | + NSDictionary *param = @{@"appId":AppId, | |
| 55 | + @"sid":@"10511059", | |
| 56 | + @"status":_status, | |
| 57 | + @"pageNo":[NSString stringWithFormat:@"%ld", (long)page], | |
| 58 | + @"pageSize":@"15"}; | |
| 59 | + [CNLiveNetworking setCacheVersion:page]; | |
| 60 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNGetOrderListUrl Param:param CacheType:CNLiveNetworkCacheTypeCacheNetwork CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 61 | + | |
| 62 | + [QMUITips hideAllToastInView:self animated:YES]; | |
| 63 | + | |
| 64 | + if (!error) { | |
| 65 | + | |
| 66 | + if (refresh) { | |
| 67 | + _page = 1; | |
| 68 | + [self.listArr removeAllObjects]; | |
| 69 | + [self.tableView.mj_header endRefreshing]; | |
| 70 | + } else { | |
| 71 | + [self.tableView.mj_footer endRefreshing]; | |
| 72 | + } | |
| 73 | + | |
| 74 | + CNLiveOrderModel *model = [CNLiveOrderModel mj_objectWithKeyValues:[responseObject objectForKey:@"data"]]; | |
| 75 | + | |
| 76 | + _next = model.hasNext; | |
| 77 | + _tableView.mj_footer.hidden = !_next; | |
| 78 | + | |
| 79 | + if (model.orderList.count == 0) { | |
| 80 | + //noData | |
| 81 | + [self.tableView addSubview:self.noDataView]; | |
| 82 | + | |
| 83 | + } else { | |
| 84 | + | |
| 85 | + [self.noDataView removeFromSuperview]; | |
| 86 | + | |
| 87 | + for (CNLiveOrderList *orderList in model.orderList) { | |
| 88 | + [_listArr addObject:orderList]; | |
| 89 | + } | |
| 90 | + } | |
| 91 | + | |
| 92 | + [self.tableView reloadData]; | |
| 93 | + | |
| 94 | + } else { | |
| 95 | + | |
| 96 | + [QMUITips showError:error.localizedDescription inView:self hideAfterDelay:1.5]; | |
| 97 | + | |
| 98 | + if (refresh) { | |
| 99 | + [self.tableView.mj_header endRefreshing]; | |
| 100 | + } else { | |
| 101 | + [self.tableView.mj_footer endRefreshing]; | |
| 102 | + } | |
| 103 | + | |
| 104 | + if (error.code == -1009) { | |
| 105 | + [self showErrorRetryType:RetryTypeNoNet]; | |
| 106 | + } else { | |
| 107 | + [self showErrorRetryType:RetryTypeError]; | |
| 108 | + } | |
| 109 | + | |
| 110 | + } | |
| 111 | + }]; | |
| 112 | + | |
| 113 | + | |
| 114 | +} | |
| 115 | + | |
| 116 | +- (void)showErrorRetryType:(RetryType)type { | |
| 117 | + | |
| 118 | + [CNErrorOrNoNetView showErrorByType:type view:self hidenRetry:self.listArr.count > 0 handle:^{ | |
| 119 | + [self refreshData]; | |
| 120 | + }]; | |
| 121 | +} | |
| 122 | + | |
| 123 | + //刷新 | |
| 124 | +- (void)refreshList { | |
| 125 | + [self requestDataWithPage:1 refresh:YES]; | |
| 126 | +} | |
| 127 | + | |
| 128 | + //加载更多 | |
| 129 | +- (void)loadMoreData { | |
| 130 | + | |
| 131 | + _page += 1; | |
| 132 | + | |
| 133 | + if (_next) { | |
| 134 | + [self requestDataWithPage:_page refresh:NO]; | |
| 135 | + } | |
| 136 | +} | |
| 137 | + | |
| 138 | +- (void)setNoDataViewByStatus:(NSInteger)status { | |
| 139 | + | |
| 140 | + switch (status) { | |
| 141 | + case 0: | |
| 142 | + [self.noDataView setImageName:@"dd_quanbumeiyou" title:@"目前没有订单" customTopH:0]; | |
| 143 | + break; | |
| 144 | + | |
| 145 | + case 1: | |
| 146 | + [self.noDataView setImageName:@"dd_wufukuan" title:@"目前没有订单需要付款" customTopH:0]; | |
| 147 | + break; | |
| 148 | + | |
| 149 | + case 2: | |
| 150 | + [self.noDataView setImageName:@"dd_wushouhuo" title:@"目前没有订单需要收货" customTopH:0]; | |
| 151 | + break; | |
| 152 | + | |
| 153 | + case 3: | |
| 154 | + [self.noDataView setImageName:@"dd_wupingjia" title:@"目前没有订单需要评价" customTopH:0]; | |
| 155 | + break; | |
| 156 | + default: | |
| 157 | + break; | |
| 158 | + } | |
| 159 | + | |
| 160 | +} | |
| 161 | + | |
| 162 | +#pragma mark - | |
| 163 | +#pragma mark - CNMineOrderTableViewCellDelegate | |
| 164 | +- (void)cellWithOrderModel:(CNLiveOrderList *)model type:(CNLiveMineOrderButtonItemType)type { | |
| 165 | + /* | |
| 166 | + | |
| 167 | + switch (type) { | |
| 168 | + case CNLiveMineOrderButtonItemTypeCancel: { //取消订单 | |
| 169 | + [CNLiveOrderEventHandle cancelOrder:model superView:self complete:^(BOOL ret) { | |
| 170 | + if (ret) { | |
| 171 | + [self refreshData]; | |
| 172 | + } | |
| 173 | + }]; | |
| 174 | + } | |
| 175 | + break; | |
| 176 | + | |
| 177 | + case CNLiveMineOrderButtonItemTypeEvaluate: { //评价订单 | |
| 178 | + | |
| 179 | + [CNLiveOrderEventHandle evaluateOrder:model]; | |
| 180 | + | |
| 181 | + } | |
| 182 | + break; | |
| 183 | + | |
| 184 | + case CNLiveMineOrderButtonItemTypeDelete: { //删除订单 | |
| 185 | + | |
| 186 | + [CNOrderEventHandle deleteOrder:model itemId:nil superView:self complete:^(BOOL ret) { | |
| 187 | + if (ret == YES) { | |
| 188 | + [self refreshData]; | |
| 189 | + } | |
| 190 | + }]; | |
| 191 | + | |
| 192 | + // [CNOrderEventHandle deleteOrder:model superView:self complete:^(BOOL ret) { | |
| 193 | + // | |
| 194 | + // if (ret == YES) { | |
| 195 | + // [self refreshData]; | |
| 196 | + // } | |
| 197 | + // }]; | |
| 198 | + } | |
| 199 | + break; | |
| 200 | + | |
| 201 | + case CNMineOrderButtonItemTypeContactDaRen: { //联系达人 | |
| 202 | + [CNOrderEventHandle contactUser:model pop:NO]; | |
| 203 | + } | |
| 204 | + break; | |
| 205 | + | |
| 206 | + case CNMineOrderButtonItemTypePay: { //去付款 | |
| 207 | + weakself | |
| 208 | + [CNOrderEventHandle pay:model payBlock:^(int code) { | |
| 209 | + if (code == 0) { | |
| 210 | + //支付成功 | |
| 211 | + [weakSelf refreshData]; | |
| 212 | + } | |
| 213 | + }]; | |
| 214 | + } | |
| 215 | + break; | |
| 216 | + | |
| 217 | + case CNMineOrderButtonItemTypeReminder: { //催单 | |
| 218 | + [CNOrderEventHandle reminderOrder:model superView:self complete:^(NSString *msg) { | |
| 219 | + [[HUDHelper sharedInstance] tipMessage:msg]; | |
| 220 | + }]; | |
| 221 | + } | |
| 222 | + break; | |
| 223 | + | |
| 224 | + case CNMineOrderButtonItemTypeRefund: { //申请退款 | |
| 225 | + [CNOrderEventHandle applyForRefund:model]; | |
| 226 | + } | |
| 227 | + break; | |
| 228 | + | |
| 229 | + case CNMineOrderButtonItemTypeRefundDetail: { //退款详情 | |
| 230 | + [CNOrderEventHandle refundDetail:model]; | |
| 231 | + } | |
| 232 | + break; | |
| 233 | + | |
| 234 | + case CNMineOrderButtonItemTypeConfirmReceipt: { //确认收货 | |
| 235 | + | |
| 236 | + [CNOrderEventHandle confirmRecv:model itemId:nil superView:self complete:^(BOOL ret) { | |
| 237 | + if (ret) { | |
| 238 | + [self refreshData]; | |
| 239 | + } | |
| 240 | + }]; | |
| 241 | + | |
| 242 | + // [CNOrderEventHandle confirmRecv:model superView:self complete:^(BOOL ret) { | |
| 243 | + // if (ret) { | |
| 244 | + // [self requestDataWithPage:0 refresh:YES]; | |
| 245 | + // } | |
| 246 | + // }]; | |
| 247 | + } | |
| 248 | + break; | |
| 249 | + | |
| 250 | + case CNMineOrderButtonItemTypeConfirmLogistics: { //查看物流 | |
| 251 | + | |
| 252 | + } | |
| 253 | + break; | |
| 254 | + | |
| 255 | + default: | |
| 256 | + break; | |
| 257 | + } | |
| 258 | + */ | |
| 259 | + | |
| 260 | +} | |
| 261 | + | |
| 262 | +#pragma mark - | |
| 263 | +#pragma mark - UITableViewDelegate,UITableViewDataSource | |
| 264 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 265 | + return self.listArr.count; | |
| 266 | +} | |
| 267 | + | |
| 268 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 269 | + | |
| 270 | + static NSString *cellId = @"CNMineOrderTableViewCell"; | |
| 271 | + CNLiveMineOrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId]; | |
| 272 | + if (!cell) { | |
| 273 | + cell = [[CNLiveMineOrderTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; | |
| 274 | + } | |
| 275 | + CNLiveOrderList *model = _listArr[indexPath.row]; | |
| 276 | + cell.delegate = self; | |
| 277 | + [cell configOrderList:model delegate:self]; | |
| 278 | + return cell; | |
| 279 | +} | |
| 280 | + | |
| 281 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 282 | + CNLiveOrderList *model = _listArr[indexPath.row]; | |
| 283 | + return [model.orderItem cellHeight]; | |
| 284 | +} | |
| 285 | + | |
| 286 | +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 287 | + [self.tableView qmui_clearsSelection]; | |
| 288 | + CNLiveMineOrderTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; | |
| 289 | +// [CNLiveOrderEventHandle orderDetail:cell.list]; | |
| 290 | + | |
| 291 | +} | |
| 292 | + | |
| 293 | + | |
| 294 | +#pragma mark - | |
| 295 | +#pragma mark - Getter | |
| 296 | +- (NSMutableArray *)listArr | |
| 297 | + { | |
| 298 | + if (!_listArr) { | |
| 299 | + _listArr = [[NSMutableArray alloc] init]; | |
| 300 | + } | |
| 301 | + return _listArr; | |
| 302 | + } | |
| 303 | + | |
| 304 | +- (UITableView *)tableView | |
| 305 | + { | |
| 306 | + if (!_tableView) { | |
| 307 | + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, self.height) style:UITableViewStylePlain]; | |
| 308 | + _tableView.backgroundColor = kWeChatBgColor; | |
| 309 | + _tableView.delegate = self; | |
| 310 | + _tableView.dataSource = self; | |
| 311 | + _tableView.tableFooterView = [UIView new]; | |
| 312 | + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| 313 | + _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(refreshList)]; | |
| 314 | + _tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)]; | |
| 315 | + } | |
| 316 | + return _tableView; | |
| 317 | + } | |
| 318 | + | |
| 319 | +- (CNLiveNoOrderView *)noDataView | |
| 320 | + { | |
| 321 | + if (!_noDataView) { | |
| 322 | + _noDataView = [[CNLiveNoOrderView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, self.height)]; | |
| 323 | + } | |
| 324 | + return _noDataView; | |
| 325 | + } | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | +@end | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveSegmentView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSegmentView.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | +typedef void(^SelectedBlock)(NSInteger index); | |
| 12 | +@interface CNLiveSegmentView : UIView | |
| 13 | +- (instancetype)initWithFrame:(CGRect)frame titles:(NSArray *)titles curIndex:(NSInteger)index selectedBlock:(SelectedBlock)selectedBlock; | |
| 14 | + //改变选择的btn | |
| 15 | +- (void)setSelectedBtn:(NSInteger)idx; | |
| 16 | +@end | |
| 17 | + | |
| 18 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveSegmentView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSegmentView.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveSegmentView.h" | |
| 9 | +#import "Masonry.h" | |
| 10 | +#import "CNLiveBaseKit.h" | |
| 11 | +#import "UIColor+CNLiveExtension.h" | |
| 12 | +#define Button_W KScreenWidth/count | |
| 13 | +@interface CNLiveSegmentView () | |
| 14 | +{ | |
| 15 | + NSInteger _index; | |
| 16 | + NSMutableArray *_buttonsArr; | |
| 17 | + NSMutableArray *_linesArr; | |
| 18 | + UIButton *_lastButton; | |
| 19 | + NSInteger count; | |
| 20 | +} | |
| 21 | +@property (nonatomic, strong) UIView *curLine; | |
| 22 | +@property (nonatomic, copy) SelectedBlock selectedBlock; | |
| 23 | +@property (nonatomic, strong) UIView *bottomLine; | |
| 24 | + | |
| 25 | +@end | |
| 26 | + | |
| 27 | +@implementation CNLiveSegmentView | |
| 28 | +- (instancetype)initWithFrame:(CGRect)frame titles:(NSArray *)titles curIndex:(NSInteger)index selectedBlock:(SelectedBlock)selectedBlock{ | |
| 29 | + self = [super initWithFrame:frame]; | |
| 30 | + if (self) { | |
| 31 | + self.backgroundColor = [UIColor whiteColor]; | |
| 32 | + count = titles.count; | |
| 33 | + _index = index; | |
| 34 | + _buttonsArr = [NSMutableArray new]; | |
| 35 | + _linesArr = [NSMutableArray new]; | |
| 36 | + | |
| 37 | + self.selectedBlock = selectedBlock; | |
| 38 | + [self addSubview:self.curLine]; | |
| 39 | + [self addSubview:self.bottomLine]; | |
| 40 | + [self addSubviews:titles]; | |
| 41 | + } | |
| 42 | + return self; | |
| 43 | +} | |
| 44 | + | |
| 45 | +- (void)addSubviews:(NSArray *)titles { | |
| 46 | + | |
| 47 | + for (int i = 0; i < titles.count; i ++) { | |
| 48 | + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 49 | + [button setTitle:titles[i] forState:UIControlStateNormal]; | |
| 50 | + [button setTitleColor:KTextBlackColor forState:UIControlStateNormal]; | |
| 51 | + button.titleLabel.font = UIFontCNMake(14);//[UIFont systemFontOfSize:14]; | |
| 52 | + button.tag = 10000+i; | |
| 53 | + [button addTarget:self action:@selector(buttonDidSelected:) forControlEvents:UIControlEventTouchUpInside]; | |
| 54 | + [self addSubview:button]; | |
| 55 | + [_buttonsArr addObject:button]; | |
| 56 | + | |
| 57 | + if (_index == i) { | |
| 58 | + _lastButton = button; | |
| 59 | + [button setTitleColor:CNLiveColorWithHexString(KGreenColor) forState:UIControlStateNormal]; | |
| 60 | + } | |
| 61 | + | |
| 62 | + if (i < titles.count-1) { | |
| 63 | + UIView *verticaLine = [[UIView alloc] init]; | |
| 64 | + verticaLine.backgroundColor = KGray195Color; | |
| 65 | + [self addSubview:verticaLine]; | |
| 66 | + [_linesArr addObject:verticaLine]; | |
| 67 | + } | |
| 68 | + } | |
| 69 | + | |
| 70 | + [_buttonsArr mas_distributeViewsAlongAxis:MASAxisTypeHorizontal withFixedItemLength:Button_W leadSpacing:0 tailSpacing:0]; | |
| 71 | + [_buttonsArr mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 72 | + make.top.mas_equalTo(0); | |
| 73 | + make.height.mas_equalTo(self.height); | |
| 74 | + }]; | |
| 75 | + | |
| 76 | + | |
| 77 | + CGFloat lineSapce = (KScreenWidth-(count-1)*0.5)/count; | |
| 78 | + [_linesArr mas_distributeViewsAlongAxis:MASAxisTypeHorizontal withFixedItemLength:0.5 leadSpacing:lineSapce tailSpacing:lineSapce]; | |
| 79 | + [_linesArr mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 80 | + //距离顶部的距离 | |
| 81 | + make.top.mas_equalTo(19); | |
| 82 | + make.height.mas_equalTo(15); | |
| 83 | + }]; | |
| 84 | + | |
| 85 | + UIButton *curBtn = _buttonsArr[_index]; | |
| 86 | + CGFloat x = _index*(Button_W)+10; | |
| 87 | + [self.curLine mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 88 | + make.size.mas_equalTo(CGSizeMake(Button_W-20, 2)); | |
| 89 | + make.left.mas_equalTo(self).mas_offset(x); | |
| 90 | + make.bottom.mas_equalTo(curBtn.mas_bottom); | |
| 91 | + }]; | |
| 92 | + | |
| 93 | + [self.bottomLine mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 94 | + make.size.mas_equalTo(CGSizeMake(KScreenWidth, 0.5)); | |
| 95 | + make.left.mas_equalTo(self); | |
| 96 | + make.bottom.mas_equalTo(self.mas_bottom); | |
| 97 | + }]; | |
| 98 | + | |
| 99 | +} | |
| 100 | + | |
| 101 | +- (void)buttonDidSelected:(UIButton *)button { | |
| 102 | + | |
| 103 | + [_lastButton setTitleColor:KTextBlackColor forState:UIControlStateNormal]; | |
| 104 | + [button setTitleColor:CNLiveColorWithHexString(KGreenColor) forState:UIControlStateNormal]; | |
| 105 | + _lastButton = button; | |
| 106 | + | |
| 107 | + [self.curLine mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 108 | + make.size.mas_equalTo(CGSizeMake(Button_W-20, 2)); | |
| 109 | + make.centerX.mas_equalTo(button.mas_centerX); | |
| 110 | + make.bottom.mas_equalTo(button.mas_bottom); | |
| 111 | + }]; | |
| 112 | + | |
| 113 | + if (self.selectedBlock) { | |
| 114 | + self.selectedBlock(button.tag - 10000); | |
| 115 | + } | |
| 116 | + | |
| 117 | +} | |
| 118 | +- (void)setSelectedBtn:(NSInteger)idx{ | |
| 119 | + UIButton *button = _buttonsArr[idx]; | |
| 120 | + [_lastButton setTitleColor:KTextBlackColor forState:UIControlStateNormal]; | |
| 121 | + [button setTitleColor:CNLiveColorWithHexString(KGreenColor) forState:UIControlStateNormal]; | |
| 122 | + _lastButton = button; | |
| 123 | + | |
| 124 | + [self.curLine mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 125 | + make.size.mas_equalTo(CGSizeMake(Button_W-20, 2)); | |
| 126 | + make.centerX.mas_equalTo(button.mas_centerX); | |
| 127 | + make.bottom.mas_equalTo(button.mas_bottom); | |
| 128 | + }]; | |
| 129 | +} | |
| 130 | +#pragma mark - | |
| 131 | +#pragma mark - Getter | |
| 132 | +- (UIView *)curLine{ | |
| 133 | + if (!_curLine) { | |
| 134 | + _curLine = [[UIView alloc] init]; | |
| 135 | + _curLine.backgroundColor = CNLiveColorWithHexString(KGreenColor); | |
| 136 | + } | |
| 137 | + return _curLine; | |
| 138 | +} | |
| 139 | + | |
| 140 | +- (UIView *)bottomLine{ | |
| 141 | + if (!_bottomLine) { | |
| 142 | + _bottomLine = [[UIView alloc] init]; | |
| 143 | + _bottomLine.backgroundColor = KGray195Color; | |
| 144 | + } | |
| 145 | + return _bottomLine; | |
| 146 | +} | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + @end | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveSelectRefundButton.h
0 → 100644
CNLiveMyOrder/Classes/View/CNLiveSelectRefundButton.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSelectRefundButton.m | |
| 3 | +// AFNetworking | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/13. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveSelectRefundButton.h" | |
| 9 | +#import "CNLiveBaseKit.h" | |
| 10 | +#define scale 0.6 | |
| 11 | +@implementation CNLiveSelectRefundButton | |
| 12 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 13 | + self = [super initWithFrame:frame]; | |
| 14 | + if (self) { | |
| 15 | + self.titleLabel.font = [UIFont systemFontOfSize:15.0f]; | |
| 16 | + self.titleLabel.textAlignment = NSTextAlignmentLeft; | |
| 17 | + self.layer.borderColor = KGray195Color.CGColor; | |
| 18 | + self.layer.borderWidth = 0.5; | |
| 19 | + } | |
| 20 | + | |
| 21 | + return self; | |
| 22 | +} | |
| 23 | +- (CGRect)imageRectForContentRect:(CGRect)contentRect { | |
| 24 | + | |
| 25 | + CGFloat titleW = [self widthForTitleString:[self titleForState:UIControlStateNormal] ContentRect:contentRect]; | |
| 26 | + CGFloat titleX = 10;//(CGRectGetWidth(contentRect)-titleW-imageWH)/2; | |
| 27 | + if (titleX < 0) { | |
| 28 | + titleX = 0; | |
| 29 | + } | |
| 30 | + CGRect rect = CGRectMake(titleX+titleW , (CGRectGetHeight(contentRect)-6)/2, 12, 6); | |
| 31 | + | |
| 32 | + return rect; | |
| 33 | + | |
| 34 | + | |
| 35 | +} | |
| 36 | + | |
| 37 | +- (CGRect)titleRectForContentRect:(CGRect)contentRect { | |
| 38 | + CGFloat titleW = [self widthForTitleString:[self titleForState:UIControlStateNormal] ContentRect:contentRect]; | |
| 39 | + CGFloat titleX = 10;//(CGRectGetWidth(contentRect)-titleW-imageWH)/2; | |
| 40 | + if (titleX < 0) { | |
| 41 | + titleX = 0; | |
| 42 | + } | |
| 43 | + CGRect rect = CGRectMake(titleX, 0, titleW , CGRectGetHeight(contentRect)); | |
| 44 | + | |
| 45 | + return rect; | |
| 46 | + | |
| 47 | +} | |
| 48 | + | |
| 49 | +#pragma mark 计算标题内容宽度 | |
| 50 | +- (CGFloat)widthForTitleString:(NSString *)string ContentRect:(CGRect)contentRect{ | |
| 51 | + if (string) { | |
| 52 | + CGSize constraint = contentRect.size; | |
| 53 | + NSAttributedString* attributedText = [[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName: self.titleLabel.font}]; | |
| 54 | + CGRect rect = [attributedText boundingRectWithSize:constraint options:NSStringDrawingUsesLineFragmentOrigin context:nil]; | |
| 55 | + CGSize size = rect.size; | |
| 56 | + CGFloat width = MAX(size.width, 30); | |
| 57 | + CGFloat imageW = [self imageForState:UIControlStateNormal].size.width; | |
| 58 | + | |
| 59 | + if (width+imageW > CGRectGetWidth(contentRect)) { // 当标题和图片宽度超过按钮宽度时不能越界 | |
| 60 | + return CGRectGetWidth(contentRect) - imageW; | |
| 61 | + } | |
| 62 | + return width+10; | |
| 63 | + } | |
| 64 | + else { | |
| 65 | + return CGRectGetWidth(contentRect)/2; | |
| 66 | + } | |
| 67 | +} | |
| 68 | +@end | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveVoucherView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveVoucherView.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +#import "FLAnimatedImage.h" | |
| 10 | +@class CNLiveRefundImgPathItem; | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | +typedef void(^VoucherViewBlock)(NSArray *imageViews, NSArray *urlsArr,NSArray *thumbUrlsArr, FLAnimatedImageView *selectedView,NSInteger index); | |
| 14 | +@interface CNLiveVoucherView : UIView | |
| 15 | +@property (nonatomic, strong) NSArray <CNLiveRefundImgPathItem *> *dataSource; | |
| 16 | + | |
| 17 | +@property (nonatomic ,copy) VoucherViewBlock picClick; | |
| 18 | +@end | |
| 19 | + | |
| 20 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveMyOrder/Classes/View/CNLiveVoucherView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveVoucherView.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveVoucherView.h" | |
| 9 | +#import "CNLiveRefundImgPathItem.h" | |
| 10 | +#import "CNLiveBaseKit.h" | |
| 11 | +#import "UIImageView+WebCache.h" | |
| 12 | +#import "QMUIKit.h" | |
| 13 | +#define kDefaultPicIcon(width) [UIImage qmui_imageWithColor:[UIColor qmui_colorWithHexString:@"#f2f2f2"] size:CGSizeMake(width, width) cornerRadius:0] | |
| 14 | +#define kGAP 10 | |
| 15 | + | |
| 16 | +@interface CNLiveVoucherView () | |
| 17 | +{ | |
| 18 | + NSMutableArray *_imageViews; | |
| 19 | +} | |
| 20 | +@property (nonatomic, strong) UILabel *titleLab; | |
| 21 | +@end | |
| 22 | + | |
| 23 | +@implementation CNLiveVoucherView | |
| 24 | + | |
| 25 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 26 | + self = [super initWithFrame:frame]; | |
| 27 | + if (self) { | |
| 28 | + _imageViews = [[NSMutableArray alloc] init]; | |
| 29 | + } | |
| 30 | + return self; | |
| 31 | +} | |
| 32 | + | |
| 33 | +- (void)setDataSource:(NSArray <CNLiveRefundImgPathItem *> *)dataSource { | |
| 34 | + | |
| 35 | + _dataSource = dataSource; | |
| 36 | + [_imageViews removeAllObjects]; | |
| 37 | + | |
| 38 | + CGFloat jgg_width = KScreenWidth-2*kGAP; | |
| 39 | + | |
| 40 | + CGFloat imageWidth = (jgg_width-2*kGAP)/3; | |
| 41 | + CGFloat imageHeight = imageWidth; | |
| 42 | + | |
| 43 | + for (NSUInteger i=0; i<dataSource.count; i++) { | |
| 44 | + FLAnimatedImageView *iv = [[FLAnimatedImageView alloc]initWithFrame:CGRectMake(0+(imageWidth+kGAP)*(i%3),floorf(i/3.0)*(imageHeight+kGAP),imageWidth, imageHeight)]; | |
| 45 | + iv.contentMode = UIViewContentModeScaleAspectFill; | |
| 46 | + [iv sd_setImageWithURL:[NSURL URLWithString:dataSource[i].thumbnailPath] placeholderImage:kDefaultPicIcon(imageWidth)]; | |
| 47 | + iv.userInteractionEnabled = YES;//默认关闭NO,打开就可以接受点击事件 | |
| 48 | + [iv setClipsToBounds:YES]; | |
| 49 | + iv.tag = i; | |
| 50 | + [self addSubview:iv]; | |
| 51 | + [_imageViews addObject:iv]; | |
| 52 | + | |
| 53 | + UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapImageAction:)]; | |
| 54 | + [iv addGestureRecognizer:singleTap]; | |
| 55 | + } | |
| 56 | + | |
| 57 | +} | |
| 58 | + | |
| 59 | +- (void)tapImageAction:(UITapGestureRecognizer *)tap { | |
| 60 | + | |
| 61 | + FLAnimatedImageView *tapView = (FLAnimatedImageView *)tap.view; | |
| 62 | + | |
| 63 | + NSMutableArray *thumbArrs =[[NSMutableArray alloc] init]; | |
| 64 | + NSMutableArray *oriArrs =[[NSMutableArray alloc] init]; | |
| 65 | + | |
| 66 | + for (CNLiveRefundImgPathItem *item in self.dataSource) { | |
| 67 | + [thumbArrs addObject:item.thumbnailPath]; | |
| 68 | + [oriArrs addObject:item.imagePath]; | |
| 69 | + } | |
| 70 | + | |
| 71 | + if (self.picClick) { | |
| 72 | + self.picClick(_imageViews, oriArrs, thumbArrs, tapView,tap.view.tag); | |
| 73 | + } | |
| 74 | + | |
| 75 | +} | |
| 76 | + | |
| 77 | +@end | ... | ... |
CNLiveMyOrder/Classes/View/CNMineOrderCell.h
0 → 100644
CNLiveMyOrder/Classes/View/CNMineOrderCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNMineOrderCell.m | |
| 3 | +// CNLiveNetAdd | |
| 4 | +// | |
| 5 | +// Created by 张旭 on 2018/3/2. | |
| 6 | +// Copyright © 2018年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNMineOrderCell.h" | |
| 10 | +#import "QMUIKit.h" | |
| 11 | +#import "Masonry.h" | |
| 12 | +#import "CNLiveBaseKit.h" | |
| 13 | +CGFloat const ZXOrderMargin = 10; | |
| 14 | +#define kToolGrayColor [UIColor colorWithRed:0.94 green:0.94 blue:0.94 alpha:1.00] | |
| 15 | +@interface CNMineOrderCell () | |
| 16 | + | |
| 17 | +@property (nonatomic ,strong) UIImageView * iconView; | |
| 18 | +@property (nonatomic ,strong) QMUILabel * nameLbl; | |
| 19 | +@property (nonatomic ,strong) UIImageView * detailView; | |
| 20 | +@property (nonatomic ,strong) QMUILabel * waitPayLbl; | |
| 21 | +@property (nonatomic ,strong) UIView * line; | |
| 22 | +@property (nonatomic ,strong) UIView * line1; | |
| 23 | +@property (nonatomic ,strong) UIView * line2; | |
| 24 | +@property (nonatomic ,strong) UIView * line3; | |
| 25 | +@property (nonatomic ,strong) UIView * line4; | |
| 26 | +@property (nonatomic ,strong) QMUILabel * categoryLbl; | |
| 27 | +@property (nonatomic ,strong) QMUILabel * countLbl; | |
| 28 | +@property (nonatomic ,strong) QMUILabel * priceLbl; | |
| 29 | +@property (nonatomic ,strong) QMUILabel * cateTitleLbl; | |
| 30 | +@property (nonatomic ,strong) QMUILabel * countTitleLbl; | |
| 31 | +@property (nonatomic ,strong) QMUILabel * priceTitleLbl; | |
| 32 | +@property (nonatomic ,strong) QMUILabel * serviceLbl; | |
| 33 | +@property (nonatomic ,strong) QMUILabel * serviceTitleLbl; | |
| 34 | +@property (nonatomic ,strong) QMUILabel * feeLbl; | |
| 35 | +@property (nonatomic ,strong) QMUILabel * feeTitleLbl; | |
| 36 | +@property (nonatomic ,strong) QMUILabel * totalFeeLbl; | |
| 37 | +@property (nonatomic ,strong) QMUIButton * contactBtn; | |
| 38 | +@property (nonatomic ,strong) QMUIButton * cancelOrderBtn; | |
| 39 | +@property (nonatomic ,strong) QMUIButton * payBtn; | |
| 40 | +@property (nonatomic ,strong) QMUIButton * detailOrderBtn; | |
| 41 | + | |
| 42 | +@end | |
| 43 | + | |
| 44 | +@implementation CNMineOrderCell | |
| 45 | + | |
| 46 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | |
| 47 | +{ | |
| 48 | + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { | |
| 49 | + [self initSubView]; | |
| 50 | + self.selectionStyle = UITableViewCellSelectionStyleGray; | |
| 51 | + } | |
| 52 | + return self; | |
| 53 | +} | |
| 54 | + | |
| 55 | +- (void)initSubView | |
| 56 | +{ | |
| 57 | + [self.contentView addSubview:self.line]; | |
| 58 | + [self.contentView addSubview:self.line1]; | |
| 59 | + [self.contentView addSubview:self.line2]; | |
| 60 | + [self.contentView addSubview:self.line3]; | |
| 61 | + [self.contentView addSubview:self.line4]; | |
| 62 | + [self.contentView addSubview:self.iconView]; | |
| 63 | + [self.contentView addSubview:self.nameLbl]; | |
| 64 | + [self.contentView addSubview:self.detailView]; | |
| 65 | + [self.contentView addSubview:self.waitPayLbl]; | |
| 66 | + [self.contentView addSubview:self.categoryLbl]; | |
| 67 | + [self.contentView addSubview:self.countLbl]; | |
| 68 | + [self.contentView addSubview:self.priceLbl]; | |
| 69 | + [self.contentView addSubview:self.cateTitleLbl]; | |
| 70 | + [self.contentView addSubview:self.countTitleLbl]; | |
| 71 | + [self.contentView addSubview:self.priceTitleLbl]; | |
| 72 | + [self.contentView addSubview:self.serviceLbl]; | |
| 73 | + [self.contentView addSubview:self.serviceTitleLbl]; | |
| 74 | + [self.contentView addSubview:self.feeLbl]; | |
| 75 | + [self.contentView addSubview:self.feeTitleLbl]; | |
| 76 | + [self.contentView addSubview:self.totalFeeLbl]; | |
| 77 | + [self.contentView addSubview:self.contactBtn]; | |
| 78 | + [self.contentView addSubview:self.cancelOrderBtn]; | |
| 79 | + [self.contentView addSubview:self.payBtn]; | |
| 80 | + [self.contentView addSubview:self.detailOrderBtn]; | |
| 81 | +} | |
| 82 | + | |
| 83 | +- (void)layoutSubviews | |
| 84 | +{ | |
| 85 | + [super layoutSubviews]; | |
| 86 | + [self relayoutFrameOfSubViews]; | |
| 87 | +} | |
| 88 | + | |
| 89 | +- (void)relayoutFrameOfSubViews | |
| 90 | +{ | |
| 91 | + [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 92 | + make.left.mas_equalTo(self.mas_left).mas_offset(12); | |
| 93 | + make.width.height.mas_equalTo(40); | |
| 94 | + make.top.mas_equalTo(10); | |
| 95 | + }]; | |
| 96 | + | |
| 97 | + [self.nameLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 98 | + make.centerY.mas_equalTo(self.iconView.mas_centerY); | |
| 99 | + make.left.mas_equalTo(self.iconView.mas_right).mas_offset(10); | |
| 100 | + }]; | |
| 101 | + | |
| 102 | + [self.detailView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 103 | + make.centerY.mas_equalTo(self.iconView.mas_centerY); | |
| 104 | + make.left.mas_equalTo(self.nameLbl.mas_right).mas_offset(12); | |
| 105 | + make.right.mas_lessThanOrEqualTo(self.waitPayLbl.mas_left).mas_offset(-10); | |
| 106 | + }]; | |
| 107 | + | |
| 108 | + [self.waitPayLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 109 | + make.centerY.mas_equalTo(self.iconView.mas_centerY); | |
| 110 | + make.right.mas_equalTo(self.mas_right).mas_offset(-12); | |
| 111 | + }]; | |
| 112 | + | |
| 113 | + [self.line mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 114 | + make.width.mas_equalTo(KScreenWidth); | |
| 115 | + make.height.mas_equalTo(1); | |
| 116 | + make.top.mas_equalTo(self.iconView.mas_bottom).mas_offset(8); | |
| 117 | + }]; | |
| 118 | + | |
| 119 | + [self.categoryLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 120 | + make.left.mas_equalTo(self.iconView.mas_left); | |
| 121 | + make.top.mas_equalTo(self.iconView.mas_bottom).mas_offset(18); | |
| 122 | + }]; | |
| 123 | + | |
| 124 | + [self.countLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 125 | + make.centerY.mas_equalTo(self.categoryLbl.mas_centerY); | |
| 126 | + make.right.mas_equalTo(self.priceLbl.mas_left).mas_offset(-60); | |
| 127 | + }]; | |
| 128 | + | |
| 129 | + [self.priceLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 130 | + make.centerY.mas_equalTo(self.categoryLbl.mas_centerY); | |
| 131 | + make.right.mas_equalTo(self.waitPayLbl.mas_right); | |
| 132 | + }]; | |
| 133 | + | |
| 134 | + [self.cateTitleLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 135 | + make.left.mas_equalTo(self.categoryLbl.mas_left); | |
| 136 | + make.top.mas_equalTo(self.categoryLbl.mas_bottom).mas_offset(16); | |
| 137 | + make.right.mas_lessThanOrEqualTo(self.countLbl.mas_left).mas_offset(-20); | |
| 138 | + }]; | |
| 139 | + [self.cateTitleLbl setContentCompressionResistancePriority:100 forAxis:UILayoutConstraintAxisHorizontal];//小于 数量优先级即可,使时间lbl优先显示 | |
| 140 | + | |
| 141 | + [self.countTitleLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 142 | + make.centerY.mas_equalTo(self.cateTitleLbl.mas_centerY); | |
| 143 | + make.centerX.mas_equalTo(self.countLbl.mas_centerX); | |
| 144 | + }]; | |
| 145 | + [self.countTitleLbl setContentCompressionResistancePriority:300 forAxis:UILayoutConstraintAxisHorizontal]; | |
| 146 | + | |
| 147 | + [self.priceTitleLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 148 | + make.centerY.mas_equalTo(self.cateTitleLbl.mas_centerY); | |
| 149 | + make.right.mas_equalTo(self.waitPayLbl.mas_right); | |
| 150 | + }]; | |
| 151 | + | |
| 152 | + [self.line1 mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 153 | + make.width.mas_equalTo(self.line.mas_width); | |
| 154 | + make.height.mas_equalTo(1); | |
| 155 | + make.top.mas_equalTo(self.cateTitleLbl.mas_bottom).mas_offset(10); | |
| 156 | + }]; | |
| 157 | + | |
| 158 | + [self.serviceLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 159 | + make.left.mas_equalTo(self.iconView.mas_left); | |
| 160 | + make.top.mas_equalTo(self.cateTitleLbl.mas_bottom).mas_offset(36); | |
| 161 | + }]; | |
| 162 | + | |
| 163 | + [self.serviceTitleLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 164 | + make.centerY.mas_equalTo(self.serviceLbl.mas_centerY); | |
| 165 | + make.right.mas_equalTo(self.waitPayLbl.mas_right); | |
| 166 | + }]; | |
| 167 | + | |
| 168 | + [self.line2 mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 169 | + make.width.mas_equalTo(self.line.mas_width); | |
| 170 | + make.height.mas_equalTo(1); | |
| 171 | + make.top.mas_equalTo(self.serviceLbl.mas_bottom).mas_offset(14); | |
| 172 | + }]; | |
| 173 | + | |
| 174 | + [self.feeLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 175 | + make.left.mas_equalTo(self.serviceLbl.mas_left); | |
| 176 | + make.top.mas_equalTo(self.serviceLbl.mas_bottom).mas_offset(38); | |
| 177 | + }]; | |
| 178 | + | |
| 179 | + [self.feeTitleLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 180 | + make.centerY.mas_equalTo(self.feeLbl.mas_centerY); | |
| 181 | + make.right.mas_equalTo(self.waitPayLbl.mas_right); | |
| 182 | + }]; | |
| 183 | + | |
| 184 | + [self.line3 mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 185 | + make.width.mas_equalTo(self.line.mas_width); | |
| 186 | + make.height.mas_equalTo(4); | |
| 187 | + make.top.mas_equalTo(self.feeLbl.mas_bottom).mas_offset(12); | |
| 188 | + }]; | |
| 189 | + | |
| 190 | + [self.totalFeeLbl mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 191 | + make.top.mas_equalTo(self.feeLbl.mas_bottom).mas_offset(24); | |
| 192 | + make.left.mas_equalTo(self.serviceLbl.mas_left); | |
| 193 | + make.right.mas_lessThanOrEqualTo(self.mas_right).mas_offset(-12); | |
| 194 | + }]; | |
| 195 | + | |
| 196 | + [self.line4 mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 197 | + make.width.mas_equalTo(self.mas_width); | |
| 198 | + make.height.mas_equalTo(1); | |
| 199 | + make.top.mas_equalTo(self.totalFeeLbl.mas_bottom).mas_offset(18); | |
| 200 | + }]; | |
| 201 | + | |
| 202 | + [self.detailOrderBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 203 | + make.top.mas_equalTo(self.iconView.mas_top); | |
| 204 | + make.left.mas_equalTo(self.mas_left); | |
| 205 | + make.right.mas_equalTo(self.mas_right); | |
| 206 | + make.bottom.mas_equalTo(self.line4.mas_bottom); | |
| 207 | + }]; | |
| 208 | + self.detailOrderBtn.backgroundColor = kRedColor; | |
| 209 | + | |
| 210 | + [self.contactBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 211 | + make.top.mas_equalTo(self.totalFeeLbl.mas_bottom).mas_offset(32); | |
| 212 | + make.right.mas_equalTo(self.cancelOrderBtn.mas_left).mas_offset(-14); | |
| 213 | + make.width.mas_equalTo(64); | |
| 214 | + make.height.mas_equalTo(24); | |
| 215 | + }]; | |
| 216 | + | |
| 217 | + [self.cancelOrderBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 218 | + make.top.mas_equalTo(self.contactBtn.mas_top); | |
| 219 | + make.right.mas_equalTo(self.payBtn.mas_left).mas_offset(-14); | |
| 220 | + make.width.mas_equalTo(self.contactBtn.mas_width); | |
| 221 | + make.height.mas_equalTo(self.contactBtn.mas_height); | |
| 222 | + }]; | |
| 223 | + | |
| 224 | + [self.payBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 225 | + make.top.mas_equalTo(self.contactBtn.mas_top); | |
| 226 | + make.right.mas_equalTo(self.mas_right).mas_offset(-14); | |
| 227 | + make.width.mas_equalTo(self.contactBtn.mas_width); | |
| 228 | + make.height.mas_equalTo(self.contactBtn.mas_height); | |
| 229 | + }]; | |
| 230 | + | |
| 231 | +} | |
| 232 | + | |
| 233 | +//重写的目的:拦截所有设置cell frame的操作 | |
| 234 | +-(void)setFrame:(CGRect)frame | |
| 235 | +{ | |
| 236 | + frame.size.height -= ZXOrderMargin; | |
| 237 | +// frame.origin.y += ZXMargin; | |
| 238 | + | |
| 239 | + [super setFrame:frame]; | |
| 240 | +} | |
| 241 | + | |
| 242 | +#pragma mark - Action | |
| 243 | +- (void)contactAction | |
| 244 | +{ | |
| 245 | + | |
| 246 | +} | |
| 247 | + | |
| 248 | +- (void)cancelOrderAction | |
| 249 | +{ | |
| 250 | + | |
| 251 | +} | |
| 252 | + | |
| 253 | +- (void)payAction | |
| 254 | +{ | |
| 255 | + | |
| 256 | +} | |
| 257 | + | |
| 258 | +- (void)detailOrderAction | |
| 259 | +{ | |
| 260 | + | |
| 261 | +} | |
| 262 | + | |
| 263 | +#pragma mark - Getter | |
| 264 | +- (UIImageView *)iconView | |
| 265 | +{ | |
| 266 | + if (!_iconView) { | |
| 267 | + _iconView = [UIImageView new]; | |
| 268 | + _iconView.backgroundColor = kRedColor; | |
| 269 | + _iconView.layer.masksToBounds = YES; | |
| 270 | + _iconView.layer.cornerRadius = 20; | |
| 271 | + } | |
| 272 | + return _iconView; | |
| 273 | +} | |
| 274 | + | |
| 275 | +- (UIImageView *)detailView | |
| 276 | +{ | |
| 277 | + if (!_detailView) { | |
| 278 | + _detailView = [UIImageView new]; | |
| 279 | + _detailView.image = [UIImage imageNamed:@"my_detail"]; | |
| 280 | + } | |
| 281 | + return _detailView; | |
| 282 | +} | |
| 283 | + | |
| 284 | +- (QMUIButton *)contactBtn | |
| 285 | +{ | |
| 286 | + if (!_contactBtn) | |
| 287 | + { | |
| 288 | + _contactBtn = [[QMUIButton alloc] init]; | |
| 289 | + _contactBtn.layer.borderColor = kBlackColor.CGColor; | |
| 290 | + _contactBtn.layer.borderWidth = 1; | |
| 291 | + [_contactBtn setTitle:@"联系达人" forState:UIControlStateNormal]; | |
| 292 | + [_contactBtn setTitleColor:kBlackColor forState:UIControlStateNormal]; | |
| 293 | + [_contactBtn.titleLabel setFont:UIFontMake(13)]; | |
| 294 | + [_contactBtn addTarget:self action:@selector(contactAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 295 | + } | |
| 296 | + return _contactBtn; | |
| 297 | +} | |
| 298 | + | |
| 299 | +- (QMUIButton *)cancelOrderBtn | |
| 300 | +{ | |
| 301 | + if (!_cancelOrderBtn) | |
| 302 | + { | |
| 303 | + _cancelOrderBtn = [[QMUIButton alloc] init]; | |
| 304 | + _cancelOrderBtn.layer.borderColor = kBlackColor.CGColor; | |
| 305 | + _cancelOrderBtn.layer.borderWidth = 1; | |
| 306 | + [_cancelOrderBtn setTitle:@"取消订单" forState:UIControlStateNormal]; | |
| 307 | + [_cancelOrderBtn.titleLabel setFont:UIFontMake(13)]; | |
| 308 | + [_cancelOrderBtn setTitleColor:kBlackColor forState:UIControlStateNormal]; | |
| 309 | + [_cancelOrderBtn addTarget:self action:@selector(cancelOrderAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 310 | + } | |
| 311 | + return _cancelOrderBtn; | |
| 312 | +} | |
| 313 | + | |
| 314 | +- (QMUIButton *)payBtn | |
| 315 | +{ | |
| 316 | + if (!_payBtn) | |
| 317 | + { | |
| 318 | + _payBtn = [[QMUIButton alloc] init]; | |
| 319 | + _payBtn.layer.borderColor = kRedColor.CGColor; | |
| 320 | + _payBtn.layer.borderWidth = 1; | |
| 321 | + [_payBtn setTitle:@"付款" forState:UIControlStateNormal]; | |
| 322 | + [_payBtn.titleLabel setFont:UIFontMake(13)]; | |
| 323 | + [_payBtn setTitleColor:kRedColor forState:UIControlStateNormal]; | |
| 324 | + [_payBtn addTarget:self action:@selector(payAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 325 | + } | |
| 326 | + return _payBtn; | |
| 327 | +} | |
| 328 | + | |
| 329 | +- (QMUIButton *)detailOrderBtn | |
| 330 | +{ | |
| 331 | + if (!_detailOrderBtn) | |
| 332 | + { | |
| 333 | + _detailOrderBtn = [[QMUIButton alloc] init]; | |
| 334 | + [_detailOrderBtn addTarget:self action:@selector(detailOrderAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 335 | + } | |
| 336 | + return _detailOrderBtn; | |
| 337 | +} | |
| 338 | + | |
| 339 | +- (UIView *)line | |
| 340 | +{ | |
| 341 | + if (!_line) | |
| 342 | + { | |
| 343 | + _line = [[UIView alloc] init]; | |
| 344 | + _line.backgroundColor = kToolGrayColor; | |
| 345 | + } | |
| 346 | + return _line; | |
| 347 | +} | |
| 348 | + | |
| 349 | +- (UIView *)line1 | |
| 350 | +{ | |
| 351 | + if (!_line1) | |
| 352 | + { | |
| 353 | + _line1 = [[UIView alloc] init]; | |
| 354 | + _line1.backgroundColor = kToolGrayColor; | |
| 355 | + } | |
| 356 | + return _line1; | |
| 357 | +} | |
| 358 | + | |
| 359 | +- (UIView *)line2 | |
| 360 | +{ | |
| 361 | + if (!_line2) | |
| 362 | + { | |
| 363 | + _line2 = [[UIView alloc] init]; | |
| 364 | + _line2.backgroundColor = kToolGrayColor; | |
| 365 | + } | |
| 366 | + return _line2; | |
| 367 | +} | |
| 368 | + | |
| 369 | +- (UIView *)line3 | |
| 370 | +{ | |
| 371 | + if (!_line3) | |
| 372 | + { | |
| 373 | + _line3 = [[UIView alloc] init]; | |
| 374 | + _line3.backgroundColor = kToolGrayColor; | |
| 375 | + } | |
| 376 | + return _line3; | |
| 377 | +} | |
| 378 | + | |
| 379 | +- (UIView *)line4 | |
| 380 | +{ | |
| 381 | + if (!_line4) | |
| 382 | + { | |
| 383 | + _line4 = [[UIView alloc] init]; | |
| 384 | + _line4.backgroundColor = kToolGrayColor; | |
| 385 | + } | |
| 386 | + return _line4; | |
| 387 | +} | |
| 388 | + | |
| 389 | +- (QMUILabel *)nameLbl { | |
| 390 | + if (!_nameLbl) { | |
| 391 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 392 | + label.backgroundColor = [UIColor clearColor]; | |
| 393 | + label.textColor = kBlackColor; | |
| 394 | + label.font = [UIFont systemFontOfSize:17.0f]; | |
| 395 | + label.textAlignment = NSTextAlignmentLeft; | |
| 396 | + label.text = @"昵称"; | |
| 397 | + _nameLbl = label; | |
| 398 | + } | |
| 399 | + return _nameLbl; | |
| 400 | +} | |
| 401 | + | |
| 402 | +- (QMUILabel *)waitPayLbl { | |
| 403 | + if (!_waitPayLbl) { | |
| 404 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 405 | + label.backgroundColor = [UIColor clearColor]; | |
| 406 | + label.textColor = kRedColor; | |
| 407 | + label.font = [UIFont systemFontOfSize:17.0f]; | |
| 408 | + label.textAlignment = NSTextAlignmentLeft; | |
| 409 | + label.text = @"等待买家付款"; | |
| 410 | + _waitPayLbl = label; | |
| 411 | + } | |
| 412 | + return _waitPayLbl; | |
| 413 | +} | |
| 414 | + | |
| 415 | +- (QMUILabel *)categoryLbl { | |
| 416 | + if (!_categoryLbl) { | |
| 417 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 418 | + label.backgroundColor = [UIColor clearColor]; | |
| 419 | + label.textColor = kBlackColor; | |
| 420 | + label.font = [UIFont systemFontOfSize:15.0f]; | |
| 421 | + label.textAlignment = NSTextAlignmentLeft; | |
| 422 | + label.text = @"种类"; | |
| 423 | + _categoryLbl = label; | |
| 424 | + } | |
| 425 | + return _categoryLbl; | |
| 426 | +} | |
| 427 | + | |
| 428 | +- (QMUILabel *)countLbl { | |
| 429 | + if (!_countLbl) { | |
| 430 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 431 | + label.backgroundColor = [UIColor clearColor]; | |
| 432 | + label.textColor = kBlackColor; | |
| 433 | + label.font = [UIFont systemFontOfSize:15.0f]; | |
| 434 | + label.textAlignment = NSTextAlignmentLeft; | |
| 435 | + label.text = @"数量"; | |
| 436 | + _countLbl = label; | |
| 437 | + } | |
| 438 | + return _countLbl; | |
| 439 | +} | |
| 440 | + | |
| 441 | +- (QMUILabel *)priceLbl { | |
| 442 | + if (!_priceLbl) { | |
| 443 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 444 | + label.backgroundColor = [UIColor clearColor]; | |
| 445 | + label.textColor = kBlackColor; | |
| 446 | + label.font = [UIFont systemFontOfSize:15.0f]; | |
| 447 | + label.textAlignment = NSTextAlignmentLeft; | |
| 448 | + label.text = @"价格"; | |
| 449 | + _priceLbl = label; | |
| 450 | + } | |
| 451 | + return _priceLbl; | |
| 452 | +} | |
| 453 | + | |
| 454 | +- (QMUILabel *)cateTitleLbl { | |
| 455 | + if (!_cateTitleLbl) { | |
| 456 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 457 | + label.backgroundColor = [UIColor clearColor]; | |
| 458 | + label.textColor = kGrayColor; | |
| 459 | + label.font = [UIFont systemFontOfSize:15.0f]; | |
| 460 | + label.textAlignment = NSTextAlignmentLeft; | |
| 461 | + label.text = @"种类标题种类标题种类标题种类标题种类标题种类标题种类标题种类标题"; | |
| 462 | + _cateTitleLbl = label; | |
| 463 | + } | |
| 464 | + return _cateTitleLbl; | |
| 465 | +} | |
| 466 | + | |
| 467 | +- (QMUILabel *)countTitleLbl { | |
| 468 | + if (!_countTitleLbl) { | |
| 469 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 470 | + label.backgroundColor = [UIColor clearColor]; | |
| 471 | + label.textColor = kGrayColor; | |
| 472 | + label.font = [UIFont systemFontOfSize:13.0f]; | |
| 473 | + label.textAlignment = NSTextAlignmentLeft; | |
| 474 | + label.text = @"100"; | |
| 475 | + _countTitleLbl = label; | |
| 476 | + } | |
| 477 | + return _countTitleLbl; | |
| 478 | +} | |
| 479 | + | |
| 480 | +- (QMUILabel *)priceTitleLbl { | |
| 481 | + if (!_priceTitleLbl) { | |
| 482 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 483 | + label.backgroundColor = [UIColor clearColor]; | |
| 484 | + label.textColor = kGrayColor; | |
| 485 | + label.font = [UIFont systemFontOfSize:13.0f]; | |
| 486 | + label.textAlignment = NSTextAlignmentLeft; | |
| 487 | + label.text = @"4000000.00"; | |
| 488 | + _priceTitleLbl = label; | |
| 489 | + } | |
| 490 | + return _priceTitleLbl; | |
| 491 | +} | |
| 492 | + | |
| 493 | +- (QMUILabel *)serviceLbl { | |
| 494 | + if (!_serviceLbl) { | |
| 495 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 496 | + label.backgroundColor = [UIColor clearColor]; | |
| 497 | + label.textColor = kGrayColor; | |
| 498 | + label.font = [UIFont systemFontOfSize:15.0f]; | |
| 499 | + label.textAlignment = NSTextAlignmentLeft; | |
| 500 | + label.text = @"服务内容"; | |
| 501 | + _serviceLbl = label; | |
| 502 | + } | |
| 503 | + return _serviceLbl; | |
| 504 | +} | |
| 505 | + | |
| 506 | +- (QMUILabel *)serviceTitleLbl { | |
| 507 | + if (!_serviceTitleLbl) { | |
| 508 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 509 | + label.backgroundColor = [UIColor clearColor]; | |
| 510 | + label.textColor = kGrayColor; | |
| 511 | + label.font = [UIFont systemFontOfSize:15.0f]; | |
| 512 | + label.textAlignment = NSTextAlignmentLeft; | |
| 513 | + label.text = @"服务标题"; | |
| 514 | + _serviceTitleLbl = label; | |
| 515 | + } | |
| 516 | + return _serviceTitleLbl; | |
| 517 | +} | |
| 518 | + | |
| 519 | +- (QMUILabel *)feeLbl { | |
| 520 | + if (!_feeLbl) { | |
| 521 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 522 | + label.backgroundColor = [UIColor clearColor]; | |
| 523 | + label.textColor = kBlackColor; | |
| 524 | + label.font = [UIFont systemFontOfSize:15.0f]; | |
| 525 | + label.textAlignment = NSTextAlignmentLeft; | |
| 526 | + label.text = @"服务费"; | |
| 527 | + _feeLbl = label; | |
| 528 | + } | |
| 529 | + return _feeLbl; | |
| 530 | +} | |
| 531 | + | |
| 532 | +- (QMUILabel *)feeTitleLbl { | |
| 533 | + if (!_feeTitleLbl) { | |
| 534 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 535 | + label.backgroundColor = [UIColor clearColor]; | |
| 536 | + label.textColor = kGrayColor; | |
| 537 | + label.font = [UIFont systemFontOfSize:15.0f]; | |
| 538 | + label.textAlignment = NSTextAlignmentLeft; | |
| 539 | + label.text = @"服务费价格"; | |
| 540 | + _feeTitleLbl = label; | |
| 541 | + } | |
| 542 | + return _feeTitleLbl; | |
| 543 | +} | |
| 544 | + | |
| 545 | +- (QMUILabel *)totalFeeLbl { | |
| 546 | + if (!_totalFeeLbl) { | |
| 547 | + QMUILabel* label = [[QMUILabel alloc]init]; | |
| 548 | + label.backgroundColor = [UIColor clearColor]; | |
| 549 | + label.textColor = kBlackColor; | |
| 550 | + label.font = [UIFont systemFontOfSize:15.0f]; | |
| 551 | + label.textAlignment = NSTextAlignmentLeft; | |
| 552 | + label.text = @"总价:元总价:元总价:元总价:元总价:元总价:元总价:元总价:元总价:元总价:元总价:元总价:元总价:元总价:元总价:元总价:元"; | |
| 553 | + _totalFeeLbl = label; | |
| 554 | + } | |
| 555 | + return _totalFeeLbl; | |
| 556 | +} | |
| 557 | +@end | ... | ... |
Example/CNLiveMyOrder.xcodeproj/project.pbxproj
0 → 100644
| 1 | +// !$*UTF8*$! | |
| 2 | +{ | |
| 3 | + archiveVersion = 1; | |
| 4 | + classes = { | |
| 5 | + }; | |
| 6 | + objectVersion = 46; | |
| 7 | + objects = { | |
| 8 | + | |
| 9 | +/* Begin PBXBuildFile section */ | |
| 10 | + 4B9114EFB6A1D7E3DBFDDD1B /* Pods_CNLiveMyOrder_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2BCB8CC95CBC2CBB080A74B /* Pods_CNLiveMyOrder_Tests.framework */; }; | |
| 11 | + 4E70634A22B277BC00888CE9 /* CNLiveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E70634922B277BC00888CE9 /* CNLiveViewController.m */; }; | |
| 12 | + 4E70635122B2781800888CE9 /* CNLiveSelectModuleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E70634E22B2781800888CE9 /* CNLiveSelectModuleView.m */; }; | |
| 13 | + 4E70635222B2781800888CE9 /* CNLiveSelectSubView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E70635022B2781800888CE9 /* CNLiveSelectSubView.m */; }; | |
| 14 | + 4E70635522B2782C00888CE9 /* CNLiveModuleSelectModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E70635422B2782C00888CE9 /* CNLiveModuleSelectModel.m */; }; | |
| 15 | + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; | |
| 16 | + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; | |
| 17 | + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; | |
| 18 | + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; | |
| 19 | + 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; | |
| 20 | + 6003F59E195388D20070C39A /* CNLiveAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* CNLiveAppDelegate.m */; }; | |
| 21 | + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; | |
| 22 | + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; | |
| 23 | + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; | |
| 24 | + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; | |
| 25 | + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; | |
| 26 | + 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; | |
| 27 | + 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; | |
| 28 | + 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; | |
| 29 | + CDF238D7B9EFDD675C7A63C7 /* Pods_CNLiveMyOrder_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5206772743651EE82CA905E /* Pods_CNLiveMyOrder_Example.framework */; }; | |
| 30 | +/* End PBXBuildFile section */ | |
| 31 | + | |
| 32 | +/* Begin PBXContainerItemProxy section */ | |
| 33 | + 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { | |
| 34 | + isa = PBXContainerItemProxy; | |
| 35 | + containerPortal = 6003F582195388D10070C39A /* Project object */; | |
| 36 | + proxyType = 1; | |
| 37 | + remoteGlobalIDString = 6003F589195388D20070C39A; | |
| 38 | + remoteInfo = CNLiveMyOrder; | |
| 39 | + }; | |
| 40 | +/* End PBXContainerItemProxy section */ | |
| 41 | + | |
| 42 | +/* Begin PBXFileReference section */ | |
| 43 | + 07F927BC51A284541E428AB0 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; | |
| 44 | + 4DED4DC26696E74F8AB61152 /* Pods-CNLiveMyOrder_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveMyOrder_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CNLiveMyOrder_Example/Pods-CNLiveMyOrder_Example.debug.xcconfig"; sourceTree = "<group>"; }; | |
| 45 | + 4E70634822B277BC00888CE9 /* CNLiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveViewController.h; sourceTree = "<group>"; }; | |
| 46 | + 4E70634922B277BC00888CE9 /* CNLiveViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveViewController.m; sourceTree = "<group>"; }; | |
| 47 | + 4E70634D22B2781800888CE9 /* CNLiveSelectSubView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveSelectSubView.h; sourceTree = "<group>"; }; | |
| 48 | + 4E70634E22B2781800888CE9 /* CNLiveSelectModuleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveSelectModuleView.m; sourceTree = "<group>"; }; | |
| 49 | + 4E70634F22B2781800888CE9 /* CNLiveSelectModuleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveSelectModuleView.h; sourceTree = "<group>"; }; | |
| 50 | + 4E70635022B2781800888CE9 /* CNLiveSelectSubView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveSelectSubView.m; sourceTree = "<group>"; }; | |
| 51 | + 4E70635322B2782C00888CE9 /* CNLiveModuleSelectModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveModuleSelectModel.h; sourceTree = "<group>"; }; | |
| 52 | + 4E70635422B2782C00888CE9 /* CNLiveModuleSelectModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveModuleSelectModel.m; sourceTree = "<group>"; }; | |
| 53 | + 5A8205D8E320A4328CC0AB56 /* Pods-CNLiveMyOrder_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveMyOrder_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-CNLiveMyOrder_Example/Pods-CNLiveMyOrder_Example.release.xcconfig"; sourceTree = "<group>"; }; | |
| 54 | + 6003F58A195388D20070C39A /* CNLiveMyOrder_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CNLiveMyOrder_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 55 | + 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; | |
| 56 | + 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; | |
| 57 | + 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; | |
| 58 | + 6003F595195388D20070C39A /* CNLiveMyOrder-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CNLiveMyOrder-Info.plist"; sourceTree = "<group>"; }; | |
| 59 | + 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; | |
| 60 | + 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; | |
| 61 | + 6003F59B195388D20070C39A /* CNLiveMyOrder-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CNLiveMyOrder-Prefix.pch"; sourceTree = "<group>"; }; | |
| 62 | + 6003F59C195388D20070C39A /* CNLiveAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveAppDelegate.h; sourceTree = "<group>"; }; | |
| 63 | + 6003F59D195388D20070C39A /* CNLiveAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveAppDelegate.m; sourceTree = "<group>"; }; | |
| 64 | + 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; | |
| 65 | + 6003F5AE195388D20070C39A /* CNLiveMyOrder_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CNLiveMyOrder_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 66 | + 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; | |
| 67 | + 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; }; | |
| 68 | + 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; | |
| 69 | + 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; }; | |
| 70 | + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; }; | |
| 71 | + 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; | |
| 72 | + 7E2231D1CD09644BE2939BDC /* Pods-CNLiveMyOrder_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveMyOrder_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CNLiveMyOrder_Tests/Pods-CNLiveMyOrder_Tests.release.xcconfig"; sourceTree = "<group>"; }; | |
| 73 | + 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; | |
| 74 | + A46D04E3D3BC114890403B29 /* Pods-CNLiveMyOrder_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveMyOrder_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CNLiveMyOrder_Tests/Pods-CNLiveMyOrder_Tests.debug.xcconfig"; sourceTree = "<group>"; }; | |
| 75 | + E05F3A1F311C382BF296C744 /* CNLiveMyOrder.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveMyOrder.podspec; path = ../CNLiveMyOrder.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; | |
| 76 | + E4060112DDCE275B1C95C7A8 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; }; | |
| 77 | + F2BCB8CC95CBC2CBB080A74B /* Pods_CNLiveMyOrder_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveMyOrder_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 78 | + F5206772743651EE82CA905E /* Pods_CNLiveMyOrder_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveMyOrder_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 79 | +/* End PBXFileReference section */ | |
| 80 | + | |
| 81 | +/* Begin PBXFrameworksBuildPhase section */ | |
| 82 | + 6003F587195388D20070C39A /* Frameworks */ = { | |
| 83 | + isa = PBXFrameworksBuildPhase; | |
| 84 | + buildActionMask = 2147483647; | |
| 85 | + files = ( | |
| 86 | + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, | |
| 87 | + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, | |
| 88 | + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, | |
| 89 | + CDF238D7B9EFDD675C7A63C7 /* Pods_CNLiveMyOrder_Example.framework in Frameworks */, | |
| 90 | + ); | |
| 91 | + runOnlyForDeploymentPostprocessing = 0; | |
| 92 | + }; | |
| 93 | + 6003F5AB195388D20070C39A /* Frameworks */ = { | |
| 94 | + isa = PBXFrameworksBuildPhase; | |
| 95 | + buildActionMask = 2147483647; | |
| 96 | + files = ( | |
| 97 | + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, | |
| 98 | + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, | |
| 99 | + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, | |
| 100 | + 4B9114EFB6A1D7E3DBFDDD1B /* Pods_CNLiveMyOrder_Tests.framework in Frameworks */, | |
| 101 | + ); | |
| 102 | + runOnlyForDeploymentPostprocessing = 0; | |
| 103 | + }; | |
| 104 | +/* End PBXFrameworksBuildPhase section */ | |
| 105 | + | |
| 106 | +/* Begin PBXGroup section */ | |
| 107 | + 4E70634722B277BC00888CE9 /* Controller */ = { | |
| 108 | + isa = PBXGroup; | |
| 109 | + children = ( | |
| 110 | + 4E70634822B277BC00888CE9 /* CNLiveViewController.h */, | |
| 111 | + 4E70634922B277BC00888CE9 /* CNLiveViewController.m */, | |
| 112 | + ); | |
| 113 | + path = Controller; | |
| 114 | + sourceTree = "<group>"; | |
| 115 | + }; | |
| 116 | + 4E70634B22B277C700888CE9 /* Model */ = { | |
| 117 | + isa = PBXGroup; | |
| 118 | + children = ( | |
| 119 | + 4E70635322B2782C00888CE9 /* CNLiveModuleSelectModel.h */, | |
| 120 | + 4E70635422B2782C00888CE9 /* CNLiveModuleSelectModel.m */, | |
| 121 | + ); | |
| 122 | + path = Model; | |
| 123 | + sourceTree = "<group>"; | |
| 124 | + }; | |
| 125 | + 4E70634C22B277CD00888CE9 /* View */ = { | |
| 126 | + isa = PBXGroup; | |
| 127 | + children = ( | |
| 128 | + 4E70634F22B2781800888CE9 /* CNLiveSelectModuleView.h */, | |
| 129 | + 4E70634E22B2781800888CE9 /* CNLiveSelectModuleView.m */, | |
| 130 | + 4E70634D22B2781800888CE9 /* CNLiveSelectSubView.h */, | |
| 131 | + 4E70635022B2781800888CE9 /* CNLiveSelectSubView.m */, | |
| 132 | + ); | |
| 133 | + path = View; | |
| 134 | + sourceTree = "<group>"; | |
| 135 | + }; | |
| 136 | + 5192FD96E5D6540BA563B4DC /* Pods */ = { | |
| 137 | + isa = PBXGroup; | |
| 138 | + children = ( | |
| 139 | + 4DED4DC26696E74F8AB61152 /* Pods-CNLiveMyOrder_Example.debug.xcconfig */, | |
| 140 | + 5A8205D8E320A4328CC0AB56 /* Pods-CNLiveMyOrder_Example.release.xcconfig */, | |
| 141 | + A46D04E3D3BC114890403B29 /* Pods-CNLiveMyOrder_Tests.debug.xcconfig */, | |
| 142 | + 7E2231D1CD09644BE2939BDC /* Pods-CNLiveMyOrder_Tests.release.xcconfig */, | |
| 143 | + ); | |
| 144 | + name = Pods; | |
| 145 | + sourceTree = "<group>"; | |
| 146 | + }; | |
| 147 | + 6003F581195388D10070C39A = { | |
| 148 | + isa = PBXGroup; | |
| 149 | + children = ( | |
| 150 | + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, | |
| 151 | + 6003F593195388D20070C39A /* Example for CNLiveMyOrder */, | |
| 152 | + 6003F5B5195388D20070C39A /* Tests */, | |
| 153 | + 6003F58C195388D20070C39A /* Frameworks */, | |
| 154 | + 6003F58B195388D20070C39A /* Products */, | |
| 155 | + 5192FD96E5D6540BA563B4DC /* Pods */, | |
| 156 | + ); | |
| 157 | + sourceTree = "<group>"; | |
| 158 | + }; | |
| 159 | + 6003F58B195388D20070C39A /* Products */ = { | |
| 160 | + isa = PBXGroup; | |
| 161 | + children = ( | |
| 162 | + 6003F58A195388D20070C39A /* CNLiveMyOrder_Example.app */, | |
| 163 | + 6003F5AE195388D20070C39A /* CNLiveMyOrder_Tests.xctest */, | |
| 164 | + ); | |
| 165 | + name = Products; | |
| 166 | + sourceTree = "<group>"; | |
| 167 | + }; | |
| 168 | + 6003F58C195388D20070C39A /* Frameworks */ = { | |
| 169 | + isa = PBXGroup; | |
| 170 | + children = ( | |
| 171 | + 6003F58D195388D20070C39A /* Foundation.framework */, | |
| 172 | + 6003F58F195388D20070C39A /* CoreGraphics.framework */, | |
| 173 | + 6003F591195388D20070C39A /* UIKit.framework */, | |
| 174 | + 6003F5AF195388D20070C39A /* XCTest.framework */, | |
| 175 | + F5206772743651EE82CA905E /* Pods_CNLiveMyOrder_Example.framework */, | |
| 176 | + F2BCB8CC95CBC2CBB080A74B /* Pods_CNLiveMyOrder_Tests.framework */, | |
| 177 | + ); | |
| 178 | + name = Frameworks; | |
| 179 | + sourceTree = "<group>"; | |
| 180 | + }; | |
| 181 | + 6003F593195388D20070C39A /* Example for CNLiveMyOrder */ = { | |
| 182 | + isa = PBXGroup; | |
| 183 | + children = ( | |
| 184 | + 4E70634C22B277CD00888CE9 /* View */, | |
| 185 | + 4E70634B22B277C700888CE9 /* Model */, | |
| 186 | + 4E70634722B277BC00888CE9 /* Controller */, | |
| 187 | + 6003F59C195388D20070C39A /* CNLiveAppDelegate.h */, | |
| 188 | + 6003F59D195388D20070C39A /* CNLiveAppDelegate.m */, | |
| 189 | + 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, | |
| 190 | + 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, | |
| 191 | + 6003F5A8195388D20070C39A /* Images.xcassets */, | |
| 192 | + 6003F594195388D20070C39A /* Supporting Files */, | |
| 193 | + ); | |
| 194 | + name = "Example for CNLiveMyOrder"; | |
| 195 | + path = CNLiveMyOrder; | |
| 196 | + sourceTree = "<group>"; | |
| 197 | + }; | |
| 198 | + 6003F594195388D20070C39A /* Supporting Files */ = { | |
| 199 | + isa = PBXGroup; | |
| 200 | + children = ( | |
| 201 | + 6003F595195388D20070C39A /* CNLiveMyOrder-Info.plist */, | |
| 202 | + 6003F596195388D20070C39A /* InfoPlist.strings */, | |
| 203 | + 6003F599195388D20070C39A /* main.m */, | |
| 204 | + 6003F59B195388D20070C39A /* CNLiveMyOrder-Prefix.pch */, | |
| 205 | + ); | |
| 206 | + name = "Supporting Files"; | |
| 207 | + sourceTree = "<group>"; | |
| 208 | + }; | |
| 209 | + 6003F5B5195388D20070C39A /* Tests */ = { | |
| 210 | + isa = PBXGroup; | |
| 211 | + children = ( | |
| 212 | + 6003F5BB195388D20070C39A /* Tests.m */, | |
| 213 | + 6003F5B6195388D20070C39A /* Supporting Files */, | |
| 214 | + ); | |
| 215 | + path = Tests; | |
| 216 | + sourceTree = "<group>"; | |
| 217 | + }; | |
| 218 | + 6003F5B6195388D20070C39A /* Supporting Files */ = { | |
| 219 | + isa = PBXGroup; | |
| 220 | + children = ( | |
| 221 | + 6003F5B7195388D20070C39A /* Tests-Info.plist */, | |
| 222 | + 6003F5B8195388D20070C39A /* InfoPlist.strings */, | |
| 223 | + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, | |
| 224 | + ); | |
| 225 | + name = "Supporting Files"; | |
| 226 | + sourceTree = "<group>"; | |
| 227 | + }; | |
| 228 | + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { | |
| 229 | + isa = PBXGroup; | |
| 230 | + children = ( | |
| 231 | + E05F3A1F311C382BF296C744 /* CNLiveMyOrder.podspec */, | |
| 232 | + 07F927BC51A284541E428AB0 /* README.md */, | |
| 233 | + E4060112DDCE275B1C95C7A8 /* LICENSE */, | |
| 234 | + ); | |
| 235 | + name = "Podspec Metadata"; | |
| 236 | + sourceTree = "<group>"; | |
| 237 | + }; | |
| 238 | +/* End PBXGroup section */ | |
| 239 | + | |
| 240 | +/* Begin PBXNativeTarget section */ | |
| 241 | + 6003F589195388D20070C39A /* CNLiveMyOrder_Example */ = { | |
| 242 | + isa = PBXNativeTarget; | |
| 243 | + buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveMyOrder_Example" */; | |
| 244 | + buildPhases = ( | |
| 245 | + 290E30F8015605051FE43152 /* [CP] Check Pods Manifest.lock */, | |
| 246 | + 6003F586195388D20070C39A /* Sources */, | |
| 247 | + 6003F587195388D20070C39A /* Frameworks */, | |
| 248 | + 6003F588195388D20070C39A /* Resources */, | |
| 249 | + 4433D788A469A7AD7B4C2F3B /* [CP] Embed Pods Frameworks */, | |
| 250 | + ); | |
| 251 | + buildRules = ( | |
| 252 | + ); | |
| 253 | + dependencies = ( | |
| 254 | + ); | |
| 255 | + name = CNLiveMyOrder_Example; | |
| 256 | + productName = CNLiveMyOrder; | |
| 257 | + productReference = 6003F58A195388D20070C39A /* CNLiveMyOrder_Example.app */; | |
| 258 | + productType = "com.apple.product-type.application"; | |
| 259 | + }; | |
| 260 | + 6003F5AD195388D20070C39A /* CNLiveMyOrder_Tests */ = { | |
| 261 | + isa = PBXNativeTarget; | |
| 262 | + buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveMyOrder_Tests" */; | |
| 263 | + buildPhases = ( | |
| 264 | + 133B436AA8E412D9C363361B /* [CP] Check Pods Manifest.lock */, | |
| 265 | + 6003F5AA195388D20070C39A /* Sources */, | |
| 266 | + 6003F5AB195388D20070C39A /* Frameworks */, | |
| 267 | + 6003F5AC195388D20070C39A /* Resources */, | |
| 268 | + ); | |
| 269 | + buildRules = ( | |
| 270 | + ); | |
| 271 | + dependencies = ( | |
| 272 | + 6003F5B4195388D20070C39A /* PBXTargetDependency */, | |
| 273 | + ); | |
| 274 | + name = CNLiveMyOrder_Tests; | |
| 275 | + productName = CNLiveMyOrderTests; | |
| 276 | + productReference = 6003F5AE195388D20070C39A /* CNLiveMyOrder_Tests.xctest */; | |
| 277 | + productType = "com.apple.product-type.bundle.unit-test"; | |
| 278 | + }; | |
| 279 | +/* End PBXNativeTarget section */ | |
| 280 | + | |
| 281 | +/* Begin PBXProject section */ | |
| 282 | + 6003F582195388D10070C39A /* Project object */ = { | |
| 283 | + isa = PBXProject; | |
| 284 | + attributes = { | |
| 285 | + CLASSPREFIX = CNLive; | |
| 286 | + LastUpgradeCheck = 0720; | |
| 287 | + ORGANIZATIONNAME = "殷巧娟"; | |
| 288 | + TargetAttributes = { | |
| 289 | + 6003F589195388D20070C39A = { | |
| 290 | + DevelopmentTeam = 94X49GG3ZW; | |
| 291 | + }; | |
| 292 | + 6003F5AD195388D20070C39A = { | |
| 293 | + TestTargetID = 6003F589195388D20070C39A; | |
| 294 | + }; | |
| 295 | + }; | |
| 296 | + }; | |
| 297 | + buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "CNLiveMyOrder" */; | |
| 298 | + compatibilityVersion = "Xcode 3.2"; | |
| 299 | + developmentRegion = English; | |
| 300 | + hasScannedForEncodings = 0; | |
| 301 | + knownRegions = ( | |
| 302 | + en, | |
| 303 | + Base, | |
| 304 | + ); | |
| 305 | + mainGroup = 6003F581195388D10070C39A; | |
| 306 | + productRefGroup = 6003F58B195388D20070C39A /* Products */; | |
| 307 | + projectDirPath = ""; | |
| 308 | + projectRoot = ""; | |
| 309 | + targets = ( | |
| 310 | + 6003F589195388D20070C39A /* CNLiveMyOrder_Example */, | |
| 311 | + 6003F5AD195388D20070C39A /* CNLiveMyOrder_Tests */, | |
| 312 | + ); | |
| 313 | + }; | |
| 314 | +/* End PBXProject section */ | |
| 315 | + | |
| 316 | +/* Begin PBXResourcesBuildPhase section */ | |
| 317 | + 6003F588195388D20070C39A /* Resources */ = { | |
| 318 | + isa = PBXResourcesBuildPhase; | |
| 319 | + buildActionMask = 2147483647; | |
| 320 | + files = ( | |
| 321 | + 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, | |
| 322 | + 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, | |
| 323 | + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, | |
| 324 | + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, | |
| 325 | + ); | |
| 326 | + runOnlyForDeploymentPostprocessing = 0; | |
| 327 | + }; | |
| 328 | + 6003F5AC195388D20070C39A /* Resources */ = { | |
| 329 | + isa = PBXResourcesBuildPhase; | |
| 330 | + buildActionMask = 2147483647; | |
| 331 | + files = ( | |
| 332 | + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, | |
| 333 | + ); | |
| 334 | + runOnlyForDeploymentPostprocessing = 0; | |
| 335 | + }; | |
| 336 | +/* End PBXResourcesBuildPhase section */ | |
| 337 | + | |
| 338 | +/* Begin PBXShellScriptBuildPhase section */ | |
| 339 | + 133B436AA8E412D9C363361B /* [CP] Check Pods Manifest.lock */ = { | |
| 340 | + isa = PBXShellScriptBuildPhase; | |
| 341 | + buildActionMask = 2147483647; | |
| 342 | + files = ( | |
| 343 | + ); | |
| 344 | + inputFileListPaths = ( | |
| 345 | + ); | |
| 346 | + inputPaths = ( | |
| 347 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | |
| 348 | + "${PODS_ROOT}/Manifest.lock", | |
| 349 | + ); | |
| 350 | + name = "[CP] Check Pods Manifest.lock"; | |
| 351 | + outputFileListPaths = ( | |
| 352 | + ); | |
| 353 | + outputPaths = ( | |
| 354 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveMyOrder_Tests-checkManifestLockResult.txt", | |
| 355 | + ); | |
| 356 | + runOnlyForDeploymentPostprocessing = 0; | |
| 357 | + shellPath = /bin/sh; | |
| 358 | + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | |
| 359 | + showEnvVarsInLog = 0; | |
| 360 | + }; | |
| 361 | + 290E30F8015605051FE43152 /* [CP] Check Pods Manifest.lock */ = { | |
| 362 | + isa = PBXShellScriptBuildPhase; | |
| 363 | + buildActionMask = 2147483647; | |
| 364 | + files = ( | |
| 365 | + ); | |
| 366 | + inputFileListPaths = ( | |
| 367 | + ); | |
| 368 | + inputPaths = ( | |
| 369 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | |
| 370 | + "${PODS_ROOT}/Manifest.lock", | |
| 371 | + ); | |
| 372 | + name = "[CP] Check Pods Manifest.lock"; | |
| 373 | + outputFileListPaths = ( | |
| 374 | + ); | |
| 375 | + outputPaths = ( | |
| 376 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveMyOrder_Example-checkManifestLockResult.txt", | |
| 377 | + ); | |
| 378 | + runOnlyForDeploymentPostprocessing = 0; | |
| 379 | + shellPath = /bin/sh; | |
| 380 | + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | |
| 381 | + showEnvVarsInLog = 0; | |
| 382 | + }; | |
| 383 | + 4433D788A469A7AD7B4C2F3B /* [CP] Embed Pods Frameworks */ = { | |
| 384 | + isa = PBXShellScriptBuildPhase; | |
| 385 | + buildActionMask = 2147483647; | |
| 386 | + files = ( | |
| 387 | + ); | |
| 388 | + inputFileListPaths = ( | |
| 389 | + ); | |
| 390 | + inputPaths = ( | |
| 391 | + "${SRCROOT}/Pods/Target Support Files/Pods-CNLiveMyOrder_Example/Pods-CNLiveMyOrder_Example-frameworks.sh", | |
| 392 | + "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", | |
| 393 | + "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework", | |
| 394 | + "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework", | |
| 395 | + "${BUILT_PRODUCTS_DIR}/CNLiveCommonClass/CNLiveCommonClass.framework", | |
| 396 | + "${BUILT_PRODUCTS_DIR}/CNLiveCustomUI/CNLiveCustomUI.framework", | |
| 397 | + "${BUILT_PRODUCTS_DIR}/CNLiveMyOrder/CNLiveMyOrder.framework", | |
| 398 | + "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", | |
| 399 | + "${BUILT_PRODUCTS_DIR}/CNLiveTripartiteManagement/CNLiveTripartiteManagement.framework", | |
| 400 | + "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework", | |
| 401 | + "${BUILT_PRODUCTS_DIR}/FLAnimatedImage/FLAnimatedImage.framework", | |
| 402 | + "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", | |
| 403 | + "${BUILT_PRODUCTS_DIR}/MJRefresh/MJRefresh.framework", | |
| 404 | + "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework", | |
| 405 | + "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework", | |
| 406 | + "${BUILT_PRODUCTS_DIR}/Realm/Realm.framework", | |
| 407 | + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", | |
| 408 | + "${BUILT_PRODUCTS_DIR}/YYKit/YYKit.framework", | |
| 409 | + ); | |
| 410 | + name = "[CP] Embed Pods Frameworks"; | |
| 411 | + outputFileListPaths = ( | |
| 412 | + ); | |
| 413 | + outputPaths = ( | |
| 414 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", | |
| 415 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework", | |
| 416 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework", | |
| 417 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonClass.framework", | |
| 418 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomUI.framework", | |
| 419 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveMyOrder.framework", | |
| 420 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", | |
| 421 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveTripartiteManagement.framework", | |
| 422 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework", | |
| 423 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FLAnimatedImage.framework", | |
| 424 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", | |
| 425 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJRefresh.framework", | |
| 426 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", | |
| 427 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework", | |
| 428 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework", | |
| 429 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", | |
| 430 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYKit.framework", | |
| 431 | + ); | |
| 432 | + runOnlyForDeploymentPostprocessing = 0; | |
| 433 | + shellPath = /bin/sh; | |
| 434 | + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CNLiveMyOrder_Example/Pods-CNLiveMyOrder_Example-frameworks.sh\"\n"; | |
| 435 | + showEnvVarsInLog = 0; | |
| 436 | + }; | |
| 437 | +/* End PBXShellScriptBuildPhase section */ | |
| 438 | + | |
| 439 | +/* Begin PBXSourcesBuildPhase section */ | |
| 440 | + 6003F586195388D20070C39A /* Sources */ = { | |
| 441 | + isa = PBXSourcesBuildPhase; | |
| 442 | + buildActionMask = 2147483647; | |
| 443 | + files = ( | |
| 444 | + 6003F59E195388D20070C39A /* CNLiveAppDelegate.m in Sources */, | |
| 445 | + 4E70635122B2781800888CE9 /* CNLiveSelectModuleView.m in Sources */, | |
| 446 | + 4E70635522B2782C00888CE9 /* CNLiveModuleSelectModel.m in Sources */, | |
| 447 | + 4E70634A22B277BC00888CE9 /* CNLiveViewController.m in Sources */, | |
| 448 | + 4E70635222B2781800888CE9 /* CNLiveSelectSubView.m in Sources */, | |
| 449 | + 6003F59A195388D20070C39A /* main.m in Sources */, | |
| 450 | + ); | |
| 451 | + runOnlyForDeploymentPostprocessing = 0; | |
| 452 | + }; | |
| 453 | + 6003F5AA195388D20070C39A /* Sources */ = { | |
| 454 | + isa = PBXSourcesBuildPhase; | |
| 455 | + buildActionMask = 2147483647; | |
| 456 | + files = ( | |
| 457 | + 6003F5BC195388D20070C39A /* Tests.m in Sources */, | |
| 458 | + ); | |
| 459 | + runOnlyForDeploymentPostprocessing = 0; | |
| 460 | + }; | |
| 461 | +/* End PBXSourcesBuildPhase section */ | |
| 462 | + | |
| 463 | +/* Begin PBXTargetDependency section */ | |
| 464 | + 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { | |
| 465 | + isa = PBXTargetDependency; | |
| 466 | + target = 6003F589195388D20070C39A /* CNLiveMyOrder_Example */; | |
| 467 | + targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; | |
| 468 | + }; | |
| 469 | +/* End PBXTargetDependency section */ | |
| 470 | + | |
| 471 | +/* Begin PBXVariantGroup section */ | |
| 472 | + 6003F596195388D20070C39A /* InfoPlist.strings */ = { | |
| 473 | + isa = PBXVariantGroup; | |
| 474 | + children = ( | |
| 475 | + 6003F597195388D20070C39A /* en */, | |
| 476 | + ); | |
| 477 | + name = InfoPlist.strings; | |
| 478 | + sourceTree = "<group>"; | |
| 479 | + }; | |
| 480 | + 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { | |
| 481 | + isa = PBXVariantGroup; | |
| 482 | + children = ( | |
| 483 | + 6003F5B9195388D20070C39A /* en */, | |
| 484 | + ); | |
| 485 | + name = InfoPlist.strings; | |
| 486 | + sourceTree = "<group>"; | |
| 487 | + }; | |
| 488 | + 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { | |
| 489 | + isa = PBXVariantGroup; | |
| 490 | + children = ( | |
| 491 | + 71719F9E1E33DC2100824A3D /* Base */, | |
| 492 | + ); | |
| 493 | + name = LaunchScreen.storyboard; | |
| 494 | + sourceTree = "<group>"; | |
| 495 | + }; | |
| 496 | +/* End PBXVariantGroup section */ | |
| 497 | + | |
| 498 | +/* Begin XCBuildConfiguration section */ | |
| 499 | + 6003F5BD195388D20070C39A /* Debug */ = { | |
| 500 | + isa = XCBuildConfiguration; | |
| 501 | + buildSettings = { | |
| 502 | + ALWAYS_SEARCH_USER_PATHS = NO; | |
| 503 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | |
| 504 | + CLANG_CXX_LIBRARY = "libc++"; | |
| 505 | + CLANG_ENABLE_MODULES = YES; | |
| 506 | + CLANG_ENABLE_OBJC_ARC = YES; | |
| 507 | + CLANG_WARN_BOOL_CONVERSION = YES; | |
| 508 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | |
| 509 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | |
| 510 | + CLANG_WARN_EMPTY_BODY = YES; | |
| 511 | + CLANG_WARN_ENUM_CONVERSION = YES; | |
| 512 | + CLANG_WARN_INT_CONVERSION = YES; | |
| 513 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | |
| 514 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | |
| 515 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | |
| 516 | + COPY_PHASE_STRIP = NO; | |
| 517 | + ENABLE_TESTABILITY = YES; | |
| 518 | + GCC_C_LANGUAGE_STANDARD = gnu99; | |
| 519 | + GCC_DYNAMIC_NO_PIC = NO; | |
| 520 | + GCC_OPTIMIZATION_LEVEL = 0; | |
| 521 | + GCC_PREPROCESSOR_DEFINITIONS = ( | |
| 522 | + "DEBUG=1", | |
| 523 | + "$(inherited)", | |
| 524 | + ); | |
| 525 | + GCC_SYMBOLS_PRIVATE_EXTERN = NO; | |
| 526 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | |
| 527 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | |
| 528 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | |
| 529 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | |
| 530 | + GCC_WARN_UNUSED_FUNCTION = YES; | |
| 531 | + GCC_WARN_UNUSED_VARIABLE = YES; | |
| 532 | + IPHONEOS_DEPLOYMENT_TARGET = 9.3; | |
| 533 | + ONLY_ACTIVE_ARCH = YES; | |
| 534 | + SDKROOT = iphoneos; | |
| 535 | + TARGETED_DEVICE_FAMILY = "1,2"; | |
| 536 | + }; | |
| 537 | + name = Debug; | |
| 538 | + }; | |
| 539 | + 6003F5BE195388D20070C39A /* Release */ = { | |
| 540 | + isa = XCBuildConfiguration; | |
| 541 | + buildSettings = { | |
| 542 | + ALWAYS_SEARCH_USER_PATHS = NO; | |
| 543 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | |
| 544 | + CLANG_CXX_LIBRARY = "libc++"; | |
| 545 | + CLANG_ENABLE_MODULES = YES; | |
| 546 | + CLANG_ENABLE_OBJC_ARC = YES; | |
| 547 | + CLANG_WARN_BOOL_CONVERSION = YES; | |
| 548 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | |
| 549 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | |
| 550 | + CLANG_WARN_EMPTY_BODY = YES; | |
| 551 | + CLANG_WARN_ENUM_CONVERSION = YES; | |
| 552 | + CLANG_WARN_INT_CONVERSION = YES; | |
| 553 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | |
| 554 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | |
| 555 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | |
| 556 | + COPY_PHASE_STRIP = YES; | |
| 557 | + ENABLE_NS_ASSERTIONS = NO; | |
| 558 | + GCC_C_LANGUAGE_STANDARD = gnu99; | |
| 559 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | |
| 560 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | |
| 561 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | |
| 562 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | |
| 563 | + GCC_WARN_UNUSED_FUNCTION = YES; | |
| 564 | + GCC_WARN_UNUSED_VARIABLE = YES; | |
| 565 | + IPHONEOS_DEPLOYMENT_TARGET = 9.3; | |
| 566 | + SDKROOT = iphoneos; | |
| 567 | + TARGETED_DEVICE_FAMILY = "1,2"; | |
| 568 | + VALIDATE_PRODUCT = YES; | |
| 569 | + }; | |
| 570 | + name = Release; | |
| 571 | + }; | |
| 572 | + 6003F5C0195388D20070C39A /* Debug */ = { | |
| 573 | + isa = XCBuildConfiguration; | |
| 574 | + baseConfigurationReference = 4DED4DC26696E74F8AB61152 /* Pods-CNLiveMyOrder_Example.debug.xcconfig */; | |
| 575 | + buildSettings = { | |
| 576 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |
| 577 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | |
| 578 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | |
| 579 | + GCC_PREFIX_HEADER = "CNLiveMyOrder/CNLiveMyOrder-Prefix.pch"; | |
| 580 | + INFOPLIST_FILE = "CNLiveMyOrder/CNLiveMyOrder-Info.plist"; | |
| 581 | + IPHONEOS_DEPLOYMENT_TARGET = 9.3; | |
| 582 | + MODULE_NAME = ExampleApp; | |
| 583 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | |
| 584 | + PRODUCT_NAME = "$(TARGET_NAME)"; | |
| 585 | + WRAPPER_EXTENSION = app; | |
| 586 | + }; | |
| 587 | + name = Debug; | |
| 588 | + }; | |
| 589 | + 6003F5C1195388D20070C39A /* Release */ = { | |
| 590 | + isa = XCBuildConfiguration; | |
| 591 | + baseConfigurationReference = 5A8205D8E320A4328CC0AB56 /* Pods-CNLiveMyOrder_Example.release.xcconfig */; | |
| 592 | + buildSettings = { | |
| 593 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |
| 594 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | |
| 595 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | |
| 596 | + GCC_PREFIX_HEADER = "CNLiveMyOrder/CNLiveMyOrder-Prefix.pch"; | |
| 597 | + INFOPLIST_FILE = "CNLiveMyOrder/CNLiveMyOrder-Info.plist"; | |
| 598 | + IPHONEOS_DEPLOYMENT_TARGET = 9.3; | |
| 599 | + MODULE_NAME = ExampleApp; | |
| 600 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | |
| 601 | + PRODUCT_NAME = "$(TARGET_NAME)"; | |
| 602 | + WRAPPER_EXTENSION = app; | |
| 603 | + }; | |
| 604 | + name = Release; | |
| 605 | + }; | |
| 606 | + 6003F5C3195388D20070C39A /* Debug */ = { | |
| 607 | + isa = XCBuildConfiguration; | |
| 608 | + baseConfigurationReference = A46D04E3D3BC114890403B29 /* Pods-CNLiveMyOrder_Tests.debug.xcconfig */; | |
| 609 | + buildSettings = { | |
| 610 | + BUNDLE_LOADER = "$(TEST_HOST)"; | |
| 611 | + FRAMEWORK_SEARCH_PATHS = ( | |
| 612 | + "$(SDKROOT)/Developer/Library/Frameworks", | |
| 613 | + "$(inherited)", | |
| 614 | + "$(DEVELOPER_FRAMEWORKS_DIR)", | |
| 615 | + ); | |
| 616 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | |
| 617 | + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; | |
| 618 | + GCC_PREPROCESSOR_DEFINITIONS = ( | |
| 619 | + "DEBUG=1", | |
| 620 | + "$(inherited)", | |
| 621 | + ); | |
| 622 | + INFOPLIST_FILE = "Tests/Tests-Info.plist"; | |
| 623 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | |
| 624 | + PRODUCT_NAME = "$(TARGET_NAME)"; | |
| 625 | + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CNLiveMyOrder_Example.app/CNLiveMyOrder_Example"; | |
| 626 | + WRAPPER_EXTENSION = xctest; | |
| 627 | + }; | |
| 628 | + name = Debug; | |
| 629 | + }; | |
| 630 | + 6003F5C4195388D20070C39A /* Release */ = { | |
| 631 | + isa = XCBuildConfiguration; | |
| 632 | + baseConfigurationReference = 7E2231D1CD09644BE2939BDC /* Pods-CNLiveMyOrder_Tests.release.xcconfig */; | |
| 633 | + buildSettings = { | |
| 634 | + BUNDLE_LOADER = "$(TEST_HOST)"; | |
| 635 | + FRAMEWORK_SEARCH_PATHS = ( | |
| 636 | + "$(SDKROOT)/Developer/Library/Frameworks", | |
| 637 | + "$(inherited)", | |
| 638 | + "$(DEVELOPER_FRAMEWORKS_DIR)", | |
| 639 | + ); | |
| 640 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | |
| 641 | + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; | |
| 642 | + INFOPLIST_FILE = "Tests/Tests-Info.plist"; | |
| 643 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | |
| 644 | + PRODUCT_NAME = "$(TARGET_NAME)"; | |
| 645 | + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CNLiveMyOrder_Example.app/CNLiveMyOrder_Example"; | |
| 646 | + WRAPPER_EXTENSION = xctest; | |
| 647 | + }; | |
| 648 | + name = Release; | |
| 649 | + }; | |
| 650 | +/* End XCBuildConfiguration section */ | |
| 651 | + | |
| 652 | +/* Begin XCConfigurationList section */ | |
| 653 | + 6003F585195388D10070C39A /* Build configuration list for PBXProject "CNLiveMyOrder" */ = { | |
| 654 | + isa = XCConfigurationList; | |
| 655 | + buildConfigurations = ( | |
| 656 | + 6003F5BD195388D20070C39A /* Debug */, | |
| 657 | + 6003F5BE195388D20070C39A /* Release */, | |
| 658 | + ); | |
| 659 | + defaultConfigurationIsVisible = 0; | |
| 660 | + defaultConfigurationName = Release; | |
| 661 | + }; | |
| 662 | + 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveMyOrder_Example" */ = { | |
| 663 | + isa = XCConfigurationList; | |
| 664 | + buildConfigurations = ( | |
| 665 | + 6003F5C0195388D20070C39A /* Debug */, | |
| 666 | + 6003F5C1195388D20070C39A /* Release */, | |
| 667 | + ); | |
| 668 | + defaultConfigurationIsVisible = 0; | |
| 669 | + defaultConfigurationName = Release; | |
| 670 | + }; | |
| 671 | + 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveMyOrder_Tests" */ = { | |
| 672 | + isa = XCConfigurationList; | |
| 673 | + buildConfigurations = ( | |
| 674 | + 6003F5C3195388D20070C39A /* Debug */, | |
| 675 | + 6003F5C4195388D20070C39A /* Release */, | |
| 676 | + ); | |
| 677 | + defaultConfigurationIsVisible = 0; | |
| 678 | + defaultConfigurationName = Release; | |
| 679 | + }; | |
| 680 | +/* End XCConfigurationList section */ | |
| 681 | + }; | |
| 682 | + rootObject = 6003F582195388D10070C39A /* Project object */; | |
| 683 | +} | ... | ... |
Example/CNLiveMyOrder.xcodeproj/xcshareddata/xcschemes/CNLiveMyOrder-Example.xcscheme
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<Scheme | |
| 3 | + LastUpgradeVersion = "0720" | |
| 4 | + version = "1.3"> | |
| 5 | + <BuildAction | |
| 6 | + parallelizeBuildables = "YES" | |
| 7 | + buildImplicitDependencies = "YES"> | |
| 8 | + <BuildActionEntries> | |
| 9 | + <BuildActionEntry | |
| 10 | + buildForTesting = "YES" | |
| 11 | + buildForRunning = "YES" | |
| 12 | + buildForProfiling = "YES" | |
| 13 | + buildForArchiving = "YES" | |
| 14 | + buildForAnalyzing = "YES"> | |
| 15 | + <BuildableReference | |
| 16 | + BuildableIdentifier = "primary" | |
| 17 | + BlueprintIdentifier = "6003F589195388D20070C39A" | |
| 18 | + BuildableName = "CNLiveMyOrder_Example.app" | |
| 19 | + BlueprintName = "CNLiveMyOrder_Example" | |
| 20 | + ReferencedContainer = "container:CNLiveMyOrder.xcodeproj"> | |
| 21 | + </BuildableReference> | |
| 22 | + </BuildActionEntry> | |
| 23 | + </BuildActionEntries> | |
| 24 | + </BuildAction> | |
| 25 | + <TestAction | |
| 26 | + buildConfiguration = "Debug" | |
| 27 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | |
| 28 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | |
| 29 | + shouldUseLaunchSchemeArgsEnv = "YES"> | |
| 30 | + <Testables> | |
| 31 | + <TestableReference | |
| 32 | + skipped = "NO"> | |
| 33 | + <BuildableReference | |
| 34 | + BuildableIdentifier = "primary" | |
| 35 | + BlueprintIdentifier = "6003F5AD195388D20070C39A" | |
| 36 | + BuildableName = "CNLiveMyOrder_Tests.xctest" | |
| 37 | + BlueprintName = "CNLiveMyOrder_Tests" | |
| 38 | + ReferencedContainer = "container:CNLiveMyOrder.xcodeproj"> | |
| 39 | + </BuildableReference> | |
| 40 | + </TestableReference> | |
| 41 | + </Testables> | |
| 42 | + <MacroExpansion> | |
| 43 | + <BuildableReference | |
| 44 | + BuildableIdentifier = "primary" | |
| 45 | + BlueprintIdentifier = "6003F589195388D20070C39A" | |
| 46 | + BuildableName = "CNLiveMyOrder_Example.app" | |
| 47 | + BlueprintName = "CNLiveMyOrder_Example" | |
| 48 | + ReferencedContainer = "container:CNLiveMyOrder.xcodeproj"> | |
| 49 | + </BuildableReference> | |
| 50 | + </MacroExpansion> | |
| 51 | + <AdditionalOptions> | |
| 52 | + </AdditionalOptions> | |
| 53 | + </TestAction> | |
| 54 | + <LaunchAction | |
| 55 | + buildConfiguration = "Debug" | |
| 56 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | |
| 57 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | |
| 58 | + launchStyle = "0" | |
| 59 | + useCustomWorkingDirectory = "NO" | |
| 60 | + ignoresPersistentStateOnLaunch = "NO" | |
| 61 | + debugDocumentVersioning = "YES" | |
| 62 | + debugServiceExtension = "internal" | |
| 63 | + allowLocationSimulation = "YES"> | |
| 64 | + <BuildableProductRunnable | |
| 65 | + runnableDebuggingMode = "0"> | |
| 66 | + <BuildableReference | |
| 67 | + BuildableIdentifier = "primary" | |
| 68 | + BlueprintIdentifier = "6003F589195388D20070C39A" | |
| 69 | + BuildableName = "CNLiveMyOrder_Example.app" | |
| 70 | + BlueprintName = "CNLiveMyOrder_Example" | |
| 71 | + ReferencedContainer = "container:CNLiveMyOrder.xcodeproj"> | |
| 72 | + </BuildableReference> | |
| 73 | + </BuildableProductRunnable> | |
| 74 | + <AdditionalOptions> | |
| 75 | + </AdditionalOptions> | |
| 76 | + </LaunchAction> | |
| 77 | + <ProfileAction | |
| 78 | + buildConfiguration = "Release" | |
| 79 | + shouldUseLaunchSchemeArgsEnv = "YES" | |
| 80 | + savedToolIdentifier = "" | |
| 81 | + useCustomWorkingDirectory = "NO" | |
| 82 | + debugDocumentVersioning = "YES"> | |
| 83 | + <BuildableProductRunnable | |
| 84 | + runnableDebuggingMode = "0"> | |
| 85 | + <BuildableReference | |
| 86 | + BuildableIdentifier = "primary" | |
| 87 | + BlueprintIdentifier = "6003F589195388D20070C39A" | |
| 88 | + BuildableName = "CNLiveMyOrder_Example.app" | |
| 89 | + BlueprintName = "CNLiveMyOrder_Example" | |
| 90 | + ReferencedContainer = "container:CNLiveMyOrder.xcodeproj"> | |
| 91 | + </BuildableReference> | |
| 92 | + </BuildableProductRunnable> | |
| 93 | + </ProfileAction> | |
| 94 | + <AnalyzeAction | |
| 95 | + buildConfiguration = "Debug"> | |
| 96 | + </AnalyzeAction> | |
| 97 | + <ArchiveAction | |
| 98 | + buildConfiguration = "Release" | |
| 99 | + revealArchiveInOrganizer = "YES"> | |
| 100 | + </ArchiveAction> | |
| 101 | +</Scheme> | ... | ... |
Example/CNLiveMyOrder/Base.lproj/LaunchScreen.storyboard
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | |
| 3 | + <device id="retina4_7" orientation="portrait"> | |
| 4 | + <adaptation id="fullscreen"/> | |
| 5 | + </device> | |
| 6 | + <dependencies> | |
| 7 | + <deployment identifier="iOS"/> | |
| 8 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> | |
| 9 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
| 10 | + </dependencies> | |
| 11 | + <scenes> | |
| 12 | + <!--View Controller--> | |
| 13 | + <scene sceneID="EHf-IW-A2E"> | |
| 14 | + <objects> | |
| 15 | + <viewController id="01J-lp-oVM" sceneMemberID="viewController"> | |
| 16 | + <layoutGuides> | |
| 17 | + <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/> | |
| 18 | + <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> | |
| 19 | + </layoutGuides> | |
| 20 | + <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | |
| 21 | + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | |
| 22 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
| 23 | + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 24 | + </view> | |
| 25 | + </viewController> | |
| 26 | + <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | |
| 27 | + </objects> | |
| 28 | + <point key="canvasLocation" x="53" y="375"/> | |
| 29 | + </scene> | |
| 30 | + </scenes> | |
| 31 | +</document> | ... | ... |
Example/CNLiveMyOrder/Base.lproj/Main.storyboard
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak"> | |
| 3 | + <device id="retina4_7" orientation="portrait"> | |
| 4 | + <adaptation id="fullscreen"/> | |
| 5 | + </device> | |
| 6 | + <dependencies> | |
| 7 | + <deployment identifier="iOS"/> | |
| 8 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> | |
| 9 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
| 10 | + </dependencies> | |
| 11 | + <scenes> | |
| 12 | + <!--View Controller--> | |
| 13 | + <scene sceneID="wQg-tq-qST"> | |
| 14 | + <objects> | |
| 15 | + <viewController id="whP-gf-Uak" customClass="CNLiveViewController" sceneMemberID="viewController"> | |
| 16 | + <layoutGuides> | |
| 17 | + <viewControllerLayoutGuide type="top" id="uEw-UM-LJ8"/> | |
| 18 | + <viewControllerLayoutGuide type="bottom" id="Mvr-aV-6Um"/> | |
| 19 | + </layoutGuides> | |
| 20 | + <view key="view" contentMode="scaleToFill" id="TpU-gO-2f1"> | |
| 21 | + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | |
| 22 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
| 23 | + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 24 | + </view> | |
| 25 | + </viewController> | |
| 26 | + <placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/> | |
| 27 | + </objects> | |
| 28 | + <point key="canvasLocation" x="305" y="433"/> | |
| 29 | + </scene> | |
| 30 | + </scenes> | |
| 31 | +</document> | ... | ... |
Example/CNLiveMyOrder/CNLiveAppDelegate.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveAppDelegate.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 06/13/2019. | |
| 6 | +// Copyright (c) 2019 殷巧娟. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +@import UIKit; | |
| 10 | + | |
| 11 | +@interface CNLiveAppDelegate : UIResponder <UIApplicationDelegate> | |
| 12 | + | |
| 13 | +@property (strong, nonatomic) UIWindow *window; | |
| 14 | + | |
| 15 | +@end | ... | ... |
Example/CNLiveMyOrder/CNLiveAppDelegate.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveAppDelegate.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 06/13/2019. | |
| 6 | +// Copyright (c) 2019 殷巧娟. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveAppDelegate.h" | |
| 10 | +#import "CNLiveViewController.h" | |
| 11 | +@implementation CNLiveAppDelegate | |
| 12 | + | |
| 13 | +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| 14 | +{ | |
| 15 | + self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; | |
| 16 | + self.window.backgroundColor = [UIColor whiteColor]; | |
| 17 | + CNLiveViewController *vc = [[CNLiveViewController alloc]init]; | |
| 18 | + UINavigationController *nav =[[UINavigationController alloc]initWithRootViewController:vc]; | |
| 19 | + self.window.rootViewController = nav; | |
| 20 | + [self.window makeKeyAndVisible]; | |
| 21 | + // Override point for customization after application launch. | |
| 22 | + return YES; | |
| 23 | +} | |
| 24 | + | |
| 25 | +- (void)applicationWillResignActive:(UIApplication *)application | |
| 26 | +{ | |
| 27 | + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. | |
| 28 | + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. | |
| 29 | +} | |
| 30 | + | |
| 31 | +- (void)applicationDidEnterBackground:(UIApplication *)application | |
| 32 | +{ | |
| 33 | + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. | |
| 34 | + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. | |
| 35 | +} | |
| 36 | + | |
| 37 | +- (void)applicationWillEnterForeground:(UIApplication *)application | |
| 38 | +{ | |
| 39 | + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. | |
| 40 | +} | |
| 41 | + | |
| 42 | +- (void)applicationDidBecomeActive:(UIApplication *)application | |
| 43 | +{ | |
| 44 | + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. | |
| 45 | +} | |
| 46 | + | |
| 47 | +- (void)applicationWillTerminate:(UIApplication *)application | |
| 48 | +{ | |
| 49 | + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | |
| 50 | +} | |
| 51 | + | |
| 52 | +@end | ... | ... |
Example/CNLiveMyOrder/CNLiveMyOrder-Info.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>CFBundleDevelopmentRegion</key> | |
| 6 | + <string>en</string> | |
| 7 | + <key>CFBundleDisplayName</key> | |
| 8 | + <string>${PRODUCT_NAME}</string> | |
| 9 | + <key>CFBundleExecutable</key> | |
| 10 | + <string>${EXECUTABLE_NAME}</string> | |
| 11 | + <key>CFBundleIdentifier</key> | |
| 12 | + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | |
| 13 | + <key>CFBundleInfoDictionaryVersion</key> | |
| 14 | + <string>6.0</string> | |
| 15 | + <key>CFBundleName</key> | |
| 16 | + <string>${PRODUCT_NAME}</string> | |
| 17 | + <key>CFBundlePackageType</key> | |
| 18 | + <string>APPL</string> | |
| 19 | + <key>CFBundleShortVersionString</key> | |
| 20 | + <string>1.0</string> | |
| 21 | + <key>CFBundleSignature</key> | |
| 22 | + <string>????</string> | |
| 23 | + <key>CFBundleVersion</key> | |
| 24 | + <string>1.0</string> | |
| 25 | + <key>LSRequiresIPhoneOS</key> | |
| 26 | + <true/> | |
| 27 | + <key>UILaunchStoryboardName</key> | |
| 28 | + <string>LaunchScreen</string> | |
| 29 | + <key>UIMainStoryboardFile</key> | |
| 30 | + <string>Main</string> | |
| 31 | + <key>UIRequiredDeviceCapabilities</key> | |
| 32 | + <array> | |
| 33 | + <string>armv7</string> | |
| 34 | + </array> | |
| 35 | + <key>UISupportedInterfaceOrientations</key> | |
| 36 | + <array> | |
| 37 | + <string>UIInterfaceOrientationPortrait</string> | |
| 38 | + <string>UIInterfaceOrientationLandscapeLeft</string> | |
| 39 | + <string>UIInterfaceOrientationLandscapeRight</string> | |
| 40 | + </array> | |
| 41 | + <key>UISupportedInterfaceOrientations~ipad</key> | |
| 42 | + <array> | |
| 43 | + <string>UIInterfaceOrientationPortrait</string> | |
| 44 | + <string>UIInterfaceOrientationPortraitUpsideDown</string> | |
| 45 | + <string>UIInterfaceOrientationLandscapeLeft</string> | |
| 46 | + <string>UIInterfaceOrientationLandscapeRight</string> | |
| 47 | + </array> | |
| 48 | +</dict> | |
| 49 | +</plist> | ... | ... |
Example/CNLiveMyOrder/CNLiveMyOrder-Prefix.pch
0 → 100644
| 1 | +// | |
| 2 | +// Prefix header | |
| 3 | +// | |
| 4 | +// The contents of this file are implicitly included at the beginning of every source file. | |
| 5 | +// | |
| 6 | + | |
| 7 | +#import <Availability.h> | |
| 8 | + | |
| 9 | +#ifndef __IPHONE_5_0 | |
| 10 | +#warning "This project uses features only available in iOS SDK 5.0 and later." | |
| 11 | +#endif | |
| 12 | + | |
| 13 | +#ifdef __OBJC__ | |
| 14 | + @import UIKit; | |
| 15 | + @import Foundation; | |
| 16 | +#endif | ... | ... |
Example/CNLiveMyOrder/Controller/CNLiveViewController.h
0 → 100644
Example/CNLiveMyOrder/Controller/CNLiveViewController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveViewController.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 06/13/2019. | |
| 6 | +// Copyright (c) 2019 殷巧娟. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveViewController.h" | |
| 10 | +#import "CNLiveModuleSelectModel.h" | |
| 11 | +#import "MJExtension.h" | |
| 12 | +#import "CNLiveSelectModuleView.h" | |
| 13 | +#import "CNLiveBaseKit.h" | |
| 14 | +#import "CNLiveMineOrderController.h" | |
| 15 | +@interface CNLiveViewController () | |
| 16 | +@property (nonatomic, strong) NSArray *orderDataArr; | |
| 17 | +@property (nonatomic, strong) CNLiveSelectModuleView *orderView; | |
| 18 | +@end | |
| 19 | + | |
| 20 | +@implementation CNLiveViewController | |
| 21 | + | |
| 22 | +- (void)viewDidLoad | |
| 23 | + { | |
| 24 | + [super viewDidLoad]; | |
| 25 | + [self loadPersonalCenter]; | |
| 26 | + [self.view addSubview:self.orderView]; | |
| 27 | + [self targetAction]; | |
| 28 | + | |
| 29 | + } | |
| 30 | +- (void)loadPersonalCenter { | |
| 31 | + NSArray *orderArray = @[ | |
| 32 | + @{ | |
| 33 | + @"title" : @"订单", | |
| 34 | + @"imgName" : @"my_order", | |
| 35 | + }, | |
| 36 | + @{ | |
| 37 | + @"title" : @"待付款", | |
| 38 | + @"imgName" : @"my_pending", | |
| 39 | + }, | |
| 40 | + @{ | |
| 41 | + @"title" : @"待收货", | |
| 42 | + @"imgName" : @"my_received", | |
| 43 | + }, | |
| 44 | + @{ | |
| 45 | + @"title" : @"待评价", | |
| 46 | + @"imgName" : @"my_evaluate", | |
| 47 | + }, | |
| 48 | + @{ | |
| 49 | + @"title" : @"售后退款", | |
| 50 | + @"imgName" : @"my_refund", | |
| 51 | + }, | |
| 52 | + ]; | |
| 53 | + NSMutableArray *arrayM = [[NSMutableArray alloc] init]; | |
| 54 | + for (NSDictionary *dic in orderArray) { | |
| 55 | + CNLiveModuleSelectModel *model = [CNLiveModuleSelectModel mj_objectWithKeyValues:dic]; | |
| 56 | + [arrayM addObject:model]; | |
| 57 | + } | |
| 58 | + self.orderDataArr = arrayM.copy; | |
| 59 | +} | |
| 60 | +- (void)targetAction { | |
| 61 | + __weak typeof(self) weakSelf = self; | |
| 62 | + self.orderView.selectModuleResultBlock = ^(NSInteger index) { | |
| 63 | + // NSLog(@"%ld",(long)index); | |
| 64 | + | |
| 65 | + switch (index) { | |
| 66 | + case 0: | |
| 67 | + { | |
| 68 | + CNLiveMineOrderController *vc = [[CNLiveMineOrderController alloc] initWithType:0]; | |
| 69 | + // [[AppDelegate sharedAppDelegate] pushViewController:vc withBackTitle:@" "]; | |
| 70 | + [weakSelf.navigationController pushViewController:vc animated:NO]; | |
| 71 | + } | |
| 72 | + break; | |
| 73 | + case 1: | |
| 74 | + { | |
| 75 | + CNLiveMineOrderController *vc = [[CNLiveMineOrderController alloc] initWithType:1]; | |
| 76 | + // [[AppDelegate sharedAppDelegate] pushViewController:vc withBackTitle:@" "]; | |
| 77 | + [weakSelf.navigationController pushViewController:vc animated:NO]; | |
| 78 | + } | |
| 79 | + break; | |
| 80 | + case 2: | |
| 81 | + { | |
| 82 | + CNLiveMineOrderController *vc = [[CNLiveMineOrderController alloc] initWithType:2]; | |
| 83 | + // [[AppDelegate sharedAppDelegate] pushViewController:vc withBackTitle:@" "]; | |
| 84 | + [weakSelf.navigationController pushViewController:vc animated:NO]; | |
| 85 | + } | |
| 86 | + break; | |
| 87 | + case 3: | |
| 88 | + { | |
| 89 | + CNLiveMineOrderController *vc = [[CNLiveMineOrderController alloc] initWithType:3]; | |
| 90 | + // [[AppDelegate sharedAppDelegate] pushViewController:vc withBackTitle:@" "]; | |
| 91 | + [weakSelf.navigationController pushViewController:vc animated:NO]; | |
| 92 | + } | |
| 93 | + break; | |
| 94 | + case 4: | |
| 95 | + { | |
| 96 | + // CNRefundController *vc = [[CNRefundController alloc] init]; | |
| 97 | + // [[AppDelegate sharedAppDelegate] pushViewController:vc withBackTitle:@" "]; | |
| 98 | + } | |
| 99 | + break; | |
| 100 | + default: | |
| 101 | + break; | |
| 102 | + } | |
| 103 | + }; | |
| 104 | + | |
| 105 | +} | |
| 106 | +- (CNLiveSelectModuleView *)orderView { | |
| 107 | + if (!_orderView) { | |
| 108 | + CGFloat width = MAX(375.0, KScreenWidth); | |
| 109 | + CGFloat height = (width-16)*129.0/359.0; | |
| 110 | + _orderView = [[CNLiveSelectModuleView alloc] initWithFrame:CGRectMake(8, 100, KScreenWidth-16, height) title:@"我的订单" isTurnAll:YES dataArr:self.orderDataArr eachLine:5 subHeight:height-40]; | |
| 111 | + _orderView.backgroundColor = kWhiteColor; | |
| 112 | + _orderView.layer.cornerRadius = 12; | |
| 113 | + _orderView.layer.masksToBounds = NO; | |
| 114 | + _orderView.layer.shadowColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:0.26].CGColor; | |
| 115 | + _orderView.layer.shadowOffset = CGSizeMake(0,2); | |
| 116 | + _orderView.layer.shadowOpacity = 1; | |
| 117 | + _orderView.layer.shadowRadius = 12; | |
| 118 | + } | |
| 119 | + return _orderView; | |
| 120 | +} | |
| 121 | +- (void)didReceiveMemoryWarning | |
| 122 | + { | |
| 123 | + [super didReceiveMemoryWarning]; | |
| 124 | + } | |
| 125 | + | |
| 126 | + @end | ... | ... |
Example/CNLiveMyOrder/Images.xcassets/AppIcon.appiconset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "iphone", | |
| 5 | + "size" : "20x20", | |
| 6 | + "scale" : "2x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "iphone", | |
| 10 | + "size" : "20x20", | |
| 11 | + "scale" : "3x" | |
| 12 | + }, | |
| 13 | + { | |
| 14 | + "idiom" : "iphone", | |
| 15 | + "size" : "29x29", | |
| 16 | + "scale" : "2x" | |
| 17 | + }, | |
| 18 | + { | |
| 19 | + "idiom" : "iphone", | |
| 20 | + "size" : "29x29", | |
| 21 | + "scale" : "3x" | |
| 22 | + }, | |
| 23 | + { | |
| 24 | + "idiom" : "iphone", | |
| 25 | + "size" : "40x40", | |
| 26 | + "scale" : "2x" | |
| 27 | + }, | |
| 28 | + { | |
| 29 | + "idiom" : "iphone", | |
| 30 | + "size" : "40x40", | |
| 31 | + "scale" : "3x" | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "idiom" : "iphone", | |
| 35 | + "size" : "60x60", | |
| 36 | + "scale" : "2x" | |
| 37 | + }, | |
| 38 | + { | |
| 39 | + "idiom" : "iphone", | |
| 40 | + "size" : "60x60", | |
| 41 | + "scale" : "3x" | |
| 42 | + }, | |
| 43 | + { | |
| 44 | + "idiom" : "ipad", | |
| 45 | + "size" : "20x20", | |
| 46 | + "scale" : "1x" | |
| 47 | + }, | |
| 48 | + { | |
| 49 | + "idiom" : "ipad", | |
| 50 | + "size" : "20x20", | |
| 51 | + "scale" : "2x" | |
| 52 | + }, | |
| 53 | + { | |
| 54 | + "idiom" : "ipad", | |
| 55 | + "size" : "29x29", | |
| 56 | + "scale" : "1x" | |
| 57 | + }, | |
| 58 | + { | |
| 59 | + "idiom" : "ipad", | |
| 60 | + "size" : "29x29", | |
| 61 | + "scale" : "2x" | |
| 62 | + }, | |
| 63 | + { | |
| 64 | + "idiom" : "ipad", | |
| 65 | + "size" : "40x40", | |
| 66 | + "scale" : "1x" | |
| 67 | + }, | |
| 68 | + { | |
| 69 | + "idiom" : "ipad", | |
| 70 | + "size" : "40x40", | |
| 71 | + "scale" : "2x" | |
| 72 | + }, | |
| 73 | + { | |
| 74 | + "idiom" : "ipad", | |
| 75 | + "size" : "76x76", | |
| 76 | + "scale" : "1x" | |
| 77 | + }, | |
| 78 | + { | |
| 79 | + "idiom" : "ipad", | |
| 80 | + "size" : "76x76", | |
| 81 | + "scale" : "2x" | |
| 82 | + }, | |
| 83 | + { | |
| 84 | + "idiom" : "ipad", | |
| 85 | + "size" : "83.5x83.5", | |
| 86 | + "scale" : "2x" | |
| 87 | + }, | |
| 88 | + { | |
| 89 | + "idiom" : "ios-marketing", | |
| 90 | + "size" : "1024x1024", | |
| 91 | + "scale" : "1x" | |
| 92 | + } | |
| 93 | + ], | |
| 94 | + "info" : { | |
| 95 | + "version" : 1, | |
| 96 | + "author" : "xcode" | |
| 97 | + } | |
| 98 | +} | ... | ... |
Example/CNLiveMyOrder/Images.xcassets/Contents.json
0 → 100644
Example/CNLiveMyOrder/Images.xcassets/my_evaluate.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "my_evaluate.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "filename" : "my_evaluate@2x.png", | |
| 11 | + "scale" : "2x" | |
| 12 | + }, | |
| 13 | + { | |
| 14 | + "idiom" : "universal", | |
| 15 | + "filename" : "my_evaluate@3x.png", | |
| 16 | + "scale" : "3x" | |
| 17 | + } | |
| 18 | + ], | |
| 19 | + "info" : { | |
| 20 | + "version" : 1, | |
| 21 | + "author" : "xcode" | |
| 22 | + } | |
| 23 | +} | |
| 0 | 24 | \ No newline at end of file | ... | ... |
Example/CNLiveMyOrder/Images.xcassets/my_evaluate.imageset/my_evaluate.png
0 → 100644
838 Bytes
Example/CNLiveMyOrder/Images.xcassets/my_evaluate.imageset/my_evaluate@2x.png
0 → 100644
2.09 KB
Example/CNLiveMyOrder/Images.xcassets/my_evaluate.imageset/my_evaluate@3x.png
0 → 100644
4.1 KB
Example/CNLiveMyOrder/Images.xcassets/my_order.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "my_order.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "filename" : "my_order@2x.png", | |
| 11 | + "scale" : "2x" | |
| 12 | + }, | |
| 13 | + { | |
| 14 | + "idiom" : "universal", | |
| 15 | + "filename" : "my_order@3x.png", | |
| 16 | + "scale" : "3x" | |
| 17 | + } | |
| 18 | + ], | |
| 19 | + "info" : { | |
| 20 | + "version" : 1, | |
| 21 | + "author" : "xcode" | |
| 22 | + } | |
| 23 | +} | |
| 0 | 24 | \ No newline at end of file | ... | ... |
Example/CNLiveMyOrder/Images.xcassets/my_order.imageset/my_order.png
0 → 100644
403 Bytes
Example/CNLiveMyOrder/Images.xcassets/my_order.imageset/my_order@2x.png
0 → 100644
623 Bytes
Example/CNLiveMyOrder/Images.xcassets/my_order.imageset/my_order@3x.png
0 → 100644
1.38 KB
Example/CNLiveMyOrder/Images.xcassets/my_pending.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "my_pending.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "filename" : "my_pending@2x.png", | |
| 11 | + "scale" : "2x" | |
| 12 | + }, | |
| 13 | + { | |
| 14 | + "idiom" : "universal", | |
| 15 | + "filename" : "my_pending@3x.png", | |
| 16 | + "scale" : "3x" | |
| 17 | + } | |
| 18 | + ], | |
| 19 | + "info" : { | |
| 20 | + "version" : 1, | |
| 21 | + "author" : "xcode" | |
| 22 | + } | |
| 23 | +} | |
| 0 | 24 | \ No newline at end of file | ... | ... |
Example/CNLiveMyOrder/Images.xcassets/my_pending.imageset/my_pending.png
0 → 100644
440 Bytes
Example/CNLiveMyOrder/Images.xcassets/my_pending.imageset/my_pending@2x.png
0 → 100644
732 Bytes
Example/CNLiveMyOrder/Images.xcassets/my_pending.imageset/my_pending@3x.png
0 → 100644
1.38 KB
Example/CNLiveMyOrder/Images.xcassets/my_received.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "my_received.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "filename" : "my_received@2x.png", | |
| 11 | + "scale" : "2x" | |
| 12 | + }, | |
| 13 | + { | |
| 14 | + "idiom" : "universal", | |
| 15 | + "filename" : "my_received@3x.png", | |
| 16 | + "scale" : "3x" | |
| 17 | + } | |
| 18 | + ], | |
| 19 | + "info" : { | |
| 20 | + "version" : 1, | |
| 21 | + "author" : "xcode" | |
| 22 | + } | |
| 23 | +} | |
| 0 | 24 | \ No newline at end of file | ... | ... |
Example/CNLiveMyOrder/Images.xcassets/my_received.imageset/my_received.png
0 → 100644
909 Bytes
Example/CNLiveMyOrder/Images.xcassets/my_received.imageset/my_received@2x.png
0 → 100644
2.33 KB
Example/CNLiveMyOrder/Images.xcassets/my_received.imageset/my_received@3x.png
0 → 100644
4.88 KB
Example/CNLiveMyOrder/Images.xcassets/my_refund.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "my_refund.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "filename" : "my_refund@2x.png", | |
| 11 | + "scale" : "2x" | |
| 12 | + }, | |
| 13 | + { | |
| 14 | + "idiom" : "universal", | |
| 15 | + "filename" : "my_refund@3x.png", | |
| 16 | + "scale" : "3x" | |
| 17 | + } | |
| 18 | + ], | |
| 19 | + "info" : { | |
| 20 | + "version" : 1, | |
| 21 | + "author" : "xcode" | |
| 22 | + } | |
| 23 | +} | |
| 0 | 24 | \ No newline at end of file | ... | ... |
Example/CNLiveMyOrder/Images.xcassets/my_refund.imageset/my_refund.png
0 → 100644
1.29 KB
Example/CNLiveMyOrder/Images.xcassets/my_refund.imageset/my_refund@2x.png
0 → 100644
3.32 KB
Example/CNLiveMyOrder/Images.xcassets/my_refund.imageset/my_refund@3x.png
0 → 100644
6.67 KB
Example/CNLiveMyOrder/Model/CNLiveModuleSelectModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveModuleSelectModel.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/12. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Realm/Realm.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveModuleSelectModel : RLMObject | |
| 13 | +@property (nonatomic, copy) NSString *title; | |
| 14 | +@property (nonatomic, copy) NSString *imgName; | |
| 15 | +@end | |
| 16 | + | |
| 17 | +NS_ASSUME_NONNULL_END | ... | ... |
Example/CNLiveMyOrder/Model/CNLiveModuleSelectModel.m
0 → 100644
Example/CNLiveMyOrder/View/CNLiveSelectModuleView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSelectModuleView.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/12. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +#import "CNLiveModuleSelectModel.h" | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | +typedef void(^CNSelectModuleResultBlock)(NSInteger index); | |
| 12 | +@interface CNLiveSelectModuleView : UIView | |
| 13 | +/** | |
| 14 | + index 999:查看全部 0:第一个cell,1:...向下顺延 | |
| 15 | + */ | |
| 16 | +@property (nonatomic, strong) CNSelectModuleResultBlock selectModuleResultBlock; | |
| 17 | + | |
| 18 | +- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title isTurnAll:(BOOL)isTurnAll dataArr:(NSArray <CNLiveModuleSelectModel *>*)dataArr eachLine:(NSInteger)eachLine subHeight:(CGFloat)subHeight; | |
| 19 | +- (void)reloadUI; | |
| 20 | +@end | |
| 21 | + | |
| 22 | +NS_ASSUME_NONNULL_END | ... | ... |
Example/CNLiveMyOrder/View/CNLiveSelectModuleView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSelectModuleView.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/12. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveSelectModuleView.h" | |
| 9 | +#import "CNLiveSelectSubView.h" | |
| 10 | +#import "QMUIKit.h" | |
| 11 | +#import "CNLiveBaseKit.h" | |
| 12 | +@interface CNLiveSelectModuleView () | |
| 13 | +{ | |
| 14 | + NSString *_title; | |
| 15 | + BOOL _isTurnAll; | |
| 16 | + NSArray <CNLiveModuleSelectModel *>*_dataArr; | |
| 17 | + NSArray <CNLiveSelectSubView *>*_subVArray; | |
| 18 | + NSInteger _eachLine; | |
| 19 | + CGFloat _subHeight; | |
| 20 | +} | |
| 21 | +@property (nonatomic, strong) UILabel *titleLabel; | |
| 22 | +@property (nonatomic, strong) QMUIButton *turnAllBtn; | |
| 23 | +@property (nonatomic, strong) UIView *lineV; | |
| 24 | +@end | |
| 25 | + | |
| 26 | +@implementation CNLiveSelectModuleView | |
| 27 | + | |
| 28 | +- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title isTurnAll:(BOOL)isTurnAll dataArr:(NSArray <CNLiveModuleSelectModel *>*)dataArr eachLine:(NSInteger)eachLine subHeight:(CGFloat)subHeight | |
| 29 | +{ | |
| 30 | + self = [super initWithFrame:frame]; | |
| 31 | + if (self) { | |
| 32 | + _title = title; | |
| 33 | + _isTurnAll = isTurnAll; | |
| 34 | + _dataArr = dataArr; | |
| 35 | + _eachLine = eachLine; | |
| 36 | + _subHeight = subHeight; | |
| 37 | + [self initSubView]; | |
| 38 | + } | |
| 39 | + return self; | |
| 40 | +} | |
| 41 | + | |
| 42 | +- (void)initSubView { | |
| 43 | + | |
| 44 | + [self addSubview:self.titleLabel]; | |
| 45 | + [self addSubview:self.turnAllBtn]; | |
| 46 | + self.turnAllBtn.right = self.width-8; | |
| 47 | + self.turnAllBtn.centerY = self.titleLabel.centerY; | |
| 48 | + [self addSubview:self.lineV]; | |
| 49 | + self.lineV.top = self.titleLabel.bottom+5; | |
| 50 | + | |
| 51 | + NSInteger count = 0; | |
| 52 | + NSMutableArray *arrayM = [[NSMutableArray alloc] init]; | |
| 53 | + for (CNLiveModuleSelectModel *model in _dataArr) { | |
| 54 | + @autoreleasepool { | |
| 55 | + | |
| 56 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTap:)]; | |
| 57 | + CGFloat width = self.width / _eachLine; | |
| 58 | + CGFloat height = _subHeight; | |
| 59 | + CNLiveSelectSubView *subV = [[CNLiveSelectSubView alloc] initWithFrame:CGRectMake((count%_eachLine)*width, self.lineV.bottom+(count/_eachLine)*height, width, height) title:model.title imgName:model.imgName]; | |
| 60 | + subV.exclusiveTouch = YES; | |
| 61 | + subV.tag = 1001+count; | |
| 62 | + [self addSubview:subV]; | |
| 63 | + [subV addGestureRecognizer:tap]; | |
| 64 | + [arrayM addObject:subV]; | |
| 65 | + | |
| 66 | + count++; | |
| 67 | + } | |
| 68 | + } | |
| 69 | + _subVArray = arrayM.copy; | |
| 70 | +} | |
| 71 | + | |
| 72 | +- (void)reloadUI { | |
| 73 | + | |
| 74 | + self.titleLabel.frame = CGRectMake(14, 14, 120*RATIO, 21*RATIO); | |
| 75 | + self.turnAllBtn.frame = CGRectMake(0, 0, 80*RATIO, 21*RATIO); | |
| 76 | + self.titleLabel.font = UIFontBoldCNMake(15); | |
| 77 | + self.turnAllBtn.titleLabel.font = UIFontCNMake(12); | |
| 78 | + self.turnAllBtn.frame = CGRectMake(0, 0, 80*RATIO, 21*RATIO); | |
| 79 | + self.turnAllBtn.right = self.width-8; | |
| 80 | + self.turnAllBtn.centerY = self.titleLabel.centerY; | |
| 81 | + | |
| 82 | + for (CNLiveSelectSubView *subV in _subVArray) { | |
| 83 | + [subV reloadUI]; | |
| 84 | + } | |
| 85 | +} | |
| 86 | + | |
| 87 | +#pragma mark - Action !!!!!!!!!!!!!!!!!!!!!!! | |
| 88 | +- (void)singleTap:(UITapGestureRecognizer *)tap { | |
| 89 | + | |
| 90 | + if (self.selectModuleResultBlock) { | |
| 91 | + self.selectModuleResultBlock(tap.view.tag - 1001); | |
| 92 | + } | |
| 93 | +} | |
| 94 | + | |
| 95 | +- (void)turnAllAction:(UIButton *)sender { | |
| 96 | + | |
| 97 | + if (self.selectModuleResultBlock) { | |
| 98 | + self.selectModuleResultBlock(sender.tag - 1001); | |
| 99 | + } | |
| 100 | +} | |
| 101 | + | |
| 102 | +- (UILabel *)titleLabel { | |
| 103 | + if (!_titleLabel) { | |
| 104 | + _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(14, 14, 120*RATIO, 21*RATIO)]; | |
| 105 | + _titleLabel.text = _title; | |
| 106 | + _titleLabel.font = UIFontBoldCNMake(15); | |
| 107 | + _titleLabel.textColor = kBlackColor; | |
| 108 | + } | |
| 109 | + return _titleLabel; | |
| 110 | +} | |
| 111 | + | |
| 112 | +- (QMUIButton *)turnAllBtn { | |
| 113 | + if (!_turnAllBtn) { | |
| 114 | + _turnAllBtn = [[QMUIButton alloc] initWithFrame:CGRectMake(0, 0, 80*RATIO, 21*RATIO)]; | |
| 115 | + [_turnAllBtn setTitle:@"查看全部 " forState:UIControlStateNormal]; | |
| 116 | + _turnAllBtn.titleLabel.font = UIFontCNMake(12); | |
| 117 | + [_turnAllBtn setTitleColor:RGBA(168, 168, 168, 1) forState:UIControlStateNormal]; | |
| 118 | + [_turnAllBtn setImage:[UIImage imageNamed:@"my_front"] forState:UIControlStateNormal]; | |
| 119 | + _turnAllBtn.imagePosition = QMUIButtonImagePositionRight; | |
| 120 | + _turnAllBtn.exclusiveTouch = YES; | |
| 121 | + _turnAllBtn.hidden = !_isTurnAll; | |
| 122 | + _turnAllBtn.tag = 1001+0; | |
| 123 | + [_turnAllBtn addTarget:self action:@selector(turnAllAction:) forControlEvents:UIControlEventTouchUpInside]; | |
| 124 | + } | |
| 125 | + return _turnAllBtn; | |
| 126 | +} | |
| 127 | + | |
| 128 | +- (UIView *)lineV { | |
| 129 | + if (!_lineV) { | |
| 130 | + _lineV = [[UIView alloc] init]; | |
| 131 | + _lineV.frame = CGRectMake(12,0,self.width-24,0.5); | |
| 132 | + _lineV.layer.backgroundColor = [UIColor colorWithRed:246/255.0 green:246/255.0 blue:246/255.0 alpha:1].CGColor; | |
| 133 | + } | |
| 134 | + return _lineV; | |
| 135 | +} | |
| 136 | + | |
| 137 | + | |
| 138 | +@end | ... | ... |
Example/CNLiveMyOrder/View/CNLiveSelectSubView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSelectSubView.h | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/12. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNLiveSelectSubView : UIView | |
| 13 | +- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title imgName:(NSString *)imgName; | |
| 14 | +- (void)reloadUI; | |
| 15 | +@end | |
| 16 | + | |
| 17 | +NS_ASSUME_NONNULL_END | ... | ... |
Example/CNLiveMyOrder/View/CNLiveSelectSubView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSelectSubView.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2019/6/12. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveSelectSubView.h" | |
| 9 | +#import "CNLiveBaseKit.h" | |
| 10 | +@interface CNLiveSelectSubView () | |
| 11 | +{ | |
| 12 | + NSString *_imgName; | |
| 13 | + NSString *_title; | |
| 14 | +} | |
| 15 | +@property (nonatomic, strong) UIImageView *subImgView; | |
| 16 | +@property (nonatomic, strong) UILabel *titleLab; | |
| 17 | +@end | |
| 18 | + | |
| 19 | +@implementation CNLiveSelectSubView | |
| 20 | +- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title imgName:(NSString *)imgName | |
| 21 | +{ | |
| 22 | + self = [super initWithFrame:frame]; | |
| 23 | + if (self) { | |
| 24 | + _title = title; | |
| 25 | + _imgName = imgName; | |
| 26 | + [self initSubView]; | |
| 27 | + } | |
| 28 | + return self; | |
| 29 | +} | |
| 30 | + | |
| 31 | +- (void)initSubView { | |
| 32 | + | |
| 33 | + [self addSubview:self.subImgView]; | |
| 34 | + self.subImgView.centerX = self.width*0.5; | |
| 35 | + [self addSubview:self.titleLab]; | |
| 36 | + self.titleLab.top = self.subImgView.bottom+15; | |
| 37 | +} | |
| 38 | + | |
| 39 | +- (void)reloadUI { | |
| 40 | + | |
| 41 | + self.titleLab.font = UIFontCNMake(12); | |
| 42 | +} | |
| 43 | + | |
| 44 | +- (UIImageView *)subImgView { | |
| 45 | + if (!_subImgView) { | |
| 46 | + _subImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 15, 26, 26)]; | |
| 47 | + _subImgView.contentMode = UIViewContentModeScaleAspectFit; | |
| 48 | + _subImgView.image = [UIImage imageNamed:_imgName]; | |
| 49 | + } | |
| 50 | + return _subImgView; | |
| 51 | +} | |
| 52 | + | |
| 53 | +- (UILabel *)titleLab { | |
| 54 | + if (!_titleLab) { | |
| 55 | + _titleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, 14)]; | |
| 56 | + _titleLab.text = _title; | |
| 57 | + _titleLab.textColor = RGBA(46, 45, 45, 1); | |
| 58 | + _titleLab.font = UIFontCNMake(12); | |
| 59 | + _titleLab.textAlignment = NSTextAlignmentCenter; | |
| 60 | + } | |
| 61 | + return _titleLab; | |
| 62 | +} | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | +@end | ... | ... |
Example/CNLiveMyOrder/en.lproj/InfoPlist.strings
0 → 100644
Example/CNLiveMyOrder/main.m
0 → 100644
| 1 | +// | |
| 2 | +// main.m | |
| 3 | +// CNLiveMyOrder | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 06/13/2019. | |
| 6 | +// Copyright (c) 2019 殷巧娟. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +@import UIKit; | |
| 10 | +#import "CNLiveAppDelegate.h" | |
| 11 | + | |
| 12 | +int main(int argc, char * argv[]) | |
| 13 | +{ | |
| 14 | + @autoreleasepool { | |
| 15 | + return UIApplicationMain(argc, argv, nil, NSStringFromClass([CNLiveAppDelegate class])); | |
| 16 | + } | |
| 17 | +} | ... | ... |
Example/Podfile
0 → 100644
| 1 | +source 'https://github.com/CocoaPods/Specs.git' | |
| 2 | +source ‘http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git’ | |
| 3 | +use_frameworks! | |
| 4 | +platform :ios, '9.0' | |
| 5 | + | |
| 6 | +target 'CNLiveMyOrder_Example' do | |
| 7 | + pod 'CNLiveMyOrder', :path => '../' | |
| 8 | + #pod 'CNLiveTripartiteManagement/Realm' | |
| 9 | + #pod 'CNLiveTripartiteManagement/MJExtension' | |
| 10 | + #pod 'CNLiveBaseKit' | |
| 11 | + # pod 'CNLiveTripartiteManagement/Masonry' | |
| 12 | + # pod 'CNLiveCommonCategory' | |
| 13 | + # pod 'CNLiveTripartiteManagement/FLAnimatedImage' | |
| 14 | + # pod 'YYKit' | |
| 15 | + # pod 'CNLiveRequestBastKit' | |
| 16 | + # pod 'CNLiveTripartiteManagement/MJRefresh' | |
| 17 | + #pod 'CNLiveCustomUI/CNLiveBasicsUI' | |
| 18 | + target 'CNLiveMyOrder_Tests' do | |
| 19 | + inherit! :search_paths | |
| 20 | + #pod 'CNLiveTripartiteManagement/Realm' | |
| 21 | + #pod 'CNLiveTripartiteManagement/MJExtension' | |
| 22 | + #pod 'CNLiveBaseKit' | |
| 23 | + # pod 'CNLiveTripartiteManagement/Masonry' | |
| 24 | + #pod 'CNLiveCommonCategory' | |
| 25 | + # pod 'CNLiveTripartiteManagement/FLAnimatedImage' | |
| 26 | + #pod 'YYKit' | |
| 27 | + #pod 'CNLiveRequestBastKit' | |
| 28 | + #pod 'CNLiveTripartiteManagement/MJRefresh' | |
| 29 | + # pod 'CNLiveCustomUI/CNLiveBasicsUI' | |
| 30 | + end | |
| 31 | +end | ... | ... |
Example/Tests/Tests-Info.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>CFBundleDevelopmentRegion</key> | |
| 6 | + <string>en</string> | |
| 7 | + <key>CFBundleExecutable</key> | |
| 8 | + <string>${EXECUTABLE_NAME}</string> | |
| 9 | + <key>CFBundleIdentifier</key> | |
| 10 | + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | |
| 11 | + <key>CFBundleInfoDictionaryVersion</key> | |
| 12 | + <string>6.0</string> | |
| 13 | + <key>CFBundlePackageType</key> | |
| 14 | + <string>BNDL</string> | |
| 15 | + <key>CFBundleShortVersionString</key> | |
| 16 | + <string>1.0</string> | |
| 17 | + <key>CFBundleSignature</key> | |
| 18 | + <string>????</string> | |
| 19 | + <key>CFBundleVersion</key> | |
| 20 | + <string>1</string> | |
| 21 | +</dict> | |
| 22 | +</plist> | ... | ... |
Example/Tests/Tests-Prefix.pch
0 → 100644
Example/Tests/Tests.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveMyOrderTests.m | |
| 3 | +// CNLiveMyOrderTests | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 06/13/2019. | |
| 6 | +// Copyright (c) 2019 殷巧娟. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +@import XCTest; | |
| 10 | + | |
| 11 | +@interface Tests : XCTestCase | |
| 12 | + | |
| 13 | +@end | |
| 14 | + | |
| 15 | +@implementation Tests | |
| 16 | + | |
| 17 | +- (void)setUp | |
| 18 | +{ | |
| 19 | + [super setUp]; | |
| 20 | + // Put setup code here. This method is called before the invocation of each test method in the class. | |
| 21 | +} | |
| 22 | + | |
| 23 | +- (void)tearDown | |
| 24 | +{ | |
| 25 | + // Put teardown code here. This method is called after the invocation of each test method in the class. | |
| 26 | + [super tearDown]; | |
| 27 | +} | |
| 28 | + | |
| 29 | +- (void)testExample | |
| 30 | +{ | |
| 31 | + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); | |
| 32 | +} | |
| 33 | + | |
| 34 | +@end | |
| 35 | + | ... | ... |
Example/Tests/en.lproj/InfoPlist.strings
0 → 100644
LICENSE
0 → 100644
| 1 | +Copyright (c) 2019 殷巧娟 <1427945373@qq.com> | |
| 2 | + | |
| 3 | +Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 4 | +of this software and associated documentation files (the "Software"), to deal | |
| 5 | +in the Software without restriction, including without limitation the rights | |
| 6 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 7 | +copies of the Software, and to permit persons to whom the Software is | |
| 8 | +furnished to do so, subject to the following conditions: | |
| 9 | + | |
| 10 | +The above copyright notice and this permission notice shall be included in | |
| 11 | +all copies or substantial portions of the Software. | |
| 12 | + | |
| 13 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 14 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 15 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 16 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 17 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 18 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
| 19 | +THE SOFTWARE. | ... | ... |
README.md
| 1 | -我的订单页面组件化 | |
| 2 | 1 | \ No newline at end of file |
| 2 | +# CNLiveMyOrder | |
| 3 | + | |
| 4 | +[](https://travis-ci.org/殷巧娟/CNLiveMyOrder) | |
| 5 | +[](https://cocoapods.org/pods/CNLiveMyOrder) | |
| 6 | +[](https://cocoapods.org/pods/CNLiveMyOrder) | |
| 7 | +[](https://cocoapods.org/pods/CNLiveMyOrder) | |
| 8 | + | |
| 9 | +## Example | |
| 10 | + | |
| 11 | +To run the example project, clone the repo, and run `pod install` from the Example directory first. | |
| 12 | + | |
| 13 | +## Requirements | |
| 14 | + | |
| 15 | +## Installation | |
| 16 | + | |
| 17 | +CNLiveMyOrder is available through [CocoaPods](https://cocoapods.org). To install | |
| 18 | +it, simply add the following line to your Podfile: | |
| 19 | + | |
| 20 | +```ruby | |
| 21 | +pod 'CNLiveMyOrder' | |
| 22 | +``` | |
| 23 | + | |
| 24 | +## Author | |
| 25 | + | |
| 26 | +殷巧娟, 1427945373@qq.com | |
| 27 | + | |
| 28 | +## License | |
| 29 | + | |
| 30 | +CNLiveMyOrder is available under the MIT license. See the LICENSE file for more info. | ... | ... |
_Pods.xcodeproj
0 → 120000