Commit 0a5f7c4ec190567f8818ae3ff288b15646f3eda7
1 parent
7643f0cd
0.0.1
Showing
63 changed files
with
4807 additions
and
0 deletions
Too many changes to show.
To preserve performance only 63 of 118 files are displayed.
.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 |