Commit 0355bbc0303739d48d8abe22d27b04ccdaed76fa

Authored by liushiyu
1 parent e97fc403

0.0.8

CNLiveCommunitModule.podspec
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 8
9 Pod::Spec.new do |s| 9 Pod::Spec.new do |s|
10 s.name = 'CNLiveCommunitModule' 10 s.name = 'CNLiveCommunitModule'
11 - s.version = '0.0.7' 11 + s.version = '0.0.8'
12 s.summary = 'A short description of CNLiveCommunitModule.' 12 s.summary = 'A short description of CNLiveCommunitModule.'
13 13
14 # This description is used to generate tags and improve search results. 14 # This description is used to generate tags and improve search results.
CNLiveCommunitModule/Classes/Core/CNLiveCommunitHeader.h
@@ -59,5 +59,5 @@ @@ -59,5 +59,5 @@
59 59
60 static NSString *const kCNLiveCommuntyNBhdIdIdentifier = @"kCNLiveCommuntyNBhdIdIdentifier"; 60 static NSString *const kCNLiveCommuntyNBhdIdIdentifier = @"kCNLiveCommuntyNBhdIdIdentifier";
61 static NSString *const kCNLiveCommuntyNBhdNameIdentifier = @"kCNLiveCommuntyNBhdNameIdentifier"; 61 static NSString *const kCNLiveCommuntyNBhdNameIdentifier = @"kCNLiveCommuntyNBhdNameIdentifier";
62 - 62 +static NSString *const kCNLiveCommuntyNBhdPhoneIdentifier = @"kCNLiveCommuntyNBhdPhoneIdentifier";
63 #endif /* CNLiveCommunitHeader_h */ 63 #endif /* CNLiveCommunitHeader_h */
CNLiveCommunitModule/Classes/Model/CNLiveCommuntyHomeModel.h
@@ -51,6 +51,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -51,6 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
51 @property (nonatomic, copy) NSString *name; 51 @property (nonatomic, copy) NSString *name;
52 @property (nonatomic, copy) NSString *locality; 52 @property (nonatomic, copy) NSString *locality;
53 @property (nonatomic, copy) NSString *address; 53 @property (nonatomic, copy) NSString *address;
  54 +@property (nonatomic, copy) NSString *propertyPhone;
54 @end 55 @end
55 56
56 @interface CNLiveCommuntyActivityHomeListModel : NSObject 57 @interface CNLiveCommuntyActivityHomeListModel : NSObject
CNLiveCommunitModule/Classes/Model/CNLiveCommuntyHomeModel.m
@@ -126,6 +126,9 @@ MJCodingImplementation @@ -126,6 +126,9 @@ MJCodingImplementation
126 self.imgUrl = oldValue; 126 self.imgUrl = oldValue;
127 } 127 }
128 } 128 }
  129 + if ([oldValue isNotBlank] && [property.name isEqualToString:@"amount"]) {
  130 + oldValue = [NSString stringWithFormat:@"%.2f",[oldValue floatValue]/100];
  131 + }
129 return oldValue; 132 return oldValue;
130 } 133 }
131 134
@@ -366,6 +369,9 @@ MJCodingImplementation @@ -366,6 +369,9 @@ MJCodingImplementation
366 [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; 369 [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"];
367 self.signupEndTimeString = [dateFormatter stringFromDate:detaildate]; 370 self.signupEndTimeString = [dateFormatter stringFromDate:detaildate];
368 } 371 }
  372 + if ([oldValue isNotBlank] && [property.name isEqualToString:@"unitPrice"]) {
  373 + oldValue = [NSString stringWithFormat:@"%.2f",[oldValue floatValue]/100];
  374 + }
369 return oldValue; 375 return oldValue;
370 } 376 }
371 377
@@ -542,6 +548,9 @@ MJCodingImplementation @@ -542,6 +548,9 @@ MJCodingImplementation
542 [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; 548 [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"];
543 self.updateTimeString = [dateFormatter stringFromDate:detaildate]; 549 self.updateTimeString = [dateFormatter stringFromDate:detaildate];
544 } 550 }
  551 + if ([oldValue isNotBlank] && [property.name isEqualToString:@"unitPrice"]) {
  552 + oldValue = [NSString stringWithFormat:@"%.2f",[oldValue floatValue]/100];
  553 + }
545 } 554 }
546 555
547 return oldValue; 556 return oldValue;
CNLiveCommunitModule/Classes/View/CNLiveCommuntSignUpView.h
@@ -69,9 +69,10 @@ NS_ASSUME_NONNULL_BEGIN @@ -69,9 +69,10 @@ NS_ASSUME_NONNULL_BEGIN
69 @property (nonatomic, strong) UILabel * cententLabel; 69 @property (nonatomic, strong) UILabel * cententLabel;
70 @property (nonatomic, strong) WKWebView * webView; 70 @property (nonatomic, strong) WKWebView * webView;
71 71
  72 +@property (nonatomic, copy) void(^reloadWebViewBlock)(CGFloat viewHeight);
72 @property (nonatomic, copy) NSString * desc; 73 @property (nonatomic, copy) NSString * desc;
73 74
74 -+(CNLiveCommuntSignUpTextViewCell *)setTableView:(UITableView *)tableView Desc:(NSString *)desc; 75 ++(CNLiveCommuntSignUpTextViewCell *)setTableView:(UITableView *)tableView Desc:(NSString *)desc ReloadWebViewBlock:(void(^)(CGFloat viewHeight))reloadWebViewBlock;
75 @end 76 @end
76 77
77 @interface CNLiveCommuntSignUpOrderViewCell : UITableViewCell 78 @interface CNLiveCommuntSignUpOrderViewCell : UITableViewCell
CNLiveCommunitModule/Classes/View/CNLiveCommuntSignUpView.m
@@ -357,12 +357,13 @@ @@ -357,12 +357,13 @@
357 357
358 @implementation CNLiveCommuntSignUpTextViewCell 358 @implementation CNLiveCommuntSignUpTextViewCell
359 359
360 -+(CNLiveCommuntSignUpTextViewCell *)setTableView:(UITableView *)tableView Desc:(nonnull NSString *)desc 360 ++(CNLiveCommuntSignUpTextViewCell *)setTableView:(UITableView *)tableView Desc:(nonnull NSString *)desc ReloadWebViewBlock:(nonnull void (^)(CGFloat))reloadWebViewBlock
361 { 361 {
362 CNLiveCommuntSignUpTextViewCell * textCell = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSignUpTextViewCell"]; 362 CNLiveCommuntSignUpTextViewCell * textCell = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSignUpTextViewCell"];
363 if (!textCell) { 363 if (!textCell) {
364 textCell = [[CNLiveCommuntSignUpTextViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSignUpTextViewCell"]; 364 textCell = [[CNLiveCommuntSignUpTextViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSignUpTextViewCell"];
365 } 365 }
  366 + textCell.reloadWebViewBlock = reloadWebViewBlock;
366 textCell.desc = desc; 367 textCell.desc = desc;
367 return textCell; 368 return textCell;
368 } 369 }
@@ -417,7 +418,7 @@ @@ -417,7 +418,7 @@
417 _webView.allowsBackForwardNavigationGestures = NO;//打开网页间的 滑动返回 418 _webView.allowsBackForwardNavigationGestures = NO;//打开网页间的 滑动返回
418 _webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal; 419 _webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal;
419 if (@available(iOS 9.0, *)) _webView.allowsLinkPreview = NO; 420 if (@available(iOS 9.0, *)) _webView.allowsLinkPreview = NO;
420 - 421 + _webView.scrollView.bounces = NO;
421 } 422 }
422 return _webView; 423 return _webView;
423 } 424 }
@@ -851,7 +852,16 @@ @@ -851,7 +852,16 @@
851 [_phoneButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_order_phone"] forState:UIControlStateNormal]; 852 [_phoneButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_order_phone"] forState:UIControlStateNormal];
852 [_phoneButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_order_phone"] forState:UIControlStateHighlighted]; 853 [_phoneButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_order_phone"] forState:UIControlStateHighlighted];
853 } 854 }
854 - 855 +}
  856 +-(void)phoneAction
  857 +{
  858 + UIAlertController * alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
  859 + [alert addAction:[UIAlertAction actionWithTitle:self.createModel.mobile style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  860 + NSMutableString* str = [[NSMutableString alloc] initWithFormat:@"tel:%@",self.createModel.mobile];
  861 + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str] options:@{} completionHandler:NULL];
  862 + }]];
  863 + [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:NULL]];
  864 + [[self displayViewController] presentViewController:alert animated:YES completion:nil];
855 } 865 }
856 -(void)layoutSubviews 866 -(void)layoutSubviews
857 { 867 {
@@ -905,6 +915,7 @@ @@ -905,6 +915,7 @@
905 _phoneButton.titleLabel.font = [UIFont boldSystemFontOfSize:12]; 915 _phoneButton.titleLabel.font = [UIFont boldSystemFontOfSize:12];
906 _phoneButton.imagePosition = QMUIButtonImagePositionLeft; 916 _phoneButton.imagePosition = QMUIButtonImagePositionLeft;
907 _phoneButton.spacingBetweenImageAndTitle = 3; 917 _phoneButton.spacingBetweenImageAndTitle = 3;
  918 + [_phoneButton addTarget:self action:@selector(phoneAction) forControlEvents:UIControlEventTouchUpInside];
908 } 919 }
909 return _phoneButton; 920 return _phoneButton;
910 } 921 }
CNLiveCommunitModule/Classes/View/CNLiveCommuntSubView.m
@@ -723,7 +723,7 @@ @@ -723,7 +723,7 @@
723 { 723 {
724 NSString * name = [self.subDict stringValueForKey:@"name" default:@""]; 724 NSString * name = [self.subDict stringValueForKey:@"name" default:@""];
725 if ([name isEqualToString:@"联系人"] && textField.text.length > 15) { 725 if ([name isEqualToString:@"联系人"] && textField.text.length > 15) {
726 - [QMUITips showWithText:@"联系人限制20个以内,超出将进行截取" inView:([UIApplication sharedApplication].delegate).window hideAfterDelay:1.5]; 726 + [QMUITips showWithText:@"联系人限制15个以内,超出将进行截取" inView:([UIApplication sharedApplication].delegate).window hideAfterDelay:1.5];
727 textField.text = [textField.text substringAtRange:NSMakeRange(0, 15)]; 727 textField.text = [textField.text substringAtRange:NSMakeRange(0, 15)];
728 } 728 }
729 if ([name isEqualToString:@"联系地址"] && textField.text.length > 50) { 729 if ([name isEqualToString:@"联系地址"] && textField.text.length > 50) {
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntInformViewController.m
@@ -103,7 +103,9 @@ @@ -103,7 +103,9 @@
103 } 103 }
104 -(UIView *)setTableViewFooterView 104 -(UIView *)setTableViewFooterView
105 { 105 {
106 - UIView * footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 90)]; 106 + NSString * phone = [[NSUserDefaults standardUserDefaults] objectForKey:kCNLiveCommuntyNBhdPhoneIdentifier];
  107 +
  108 + UIView * footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, [phone isNotBlank]?90:70)];
107 footerView.backgroundColor = [UIColor whiteColor]; 109 footerView.backgroundColor = [UIColor whiteColor];
108 110
109 YYLabel * phoneLabel = [[YYLabel alloc] initWithFrame:CGRectMake(0, 5, kScreenWidth, 20)]; 111 YYLabel * phoneLabel = [[YYLabel alloc] initWithFrame:CGRectMake(0, 5, kScreenWidth, 20)];
@@ -111,18 +113,25 @@ @@ -111,18 +113,25 @@
111 phoneLabel.textAlignment = NSTextAlignmentCenter; 113 phoneLabel.textAlignment = NSTextAlignmentCenter;
112 phoneLabel.textVerticalAlignment = YYTextVerticalAlignmentCenter; 114 phoneLabel.textVerticalAlignment = YYTextVerticalAlignmentCenter;
113 phoneLabel.numberOfLines = 0; 115 phoneLabel.numberOfLines = 0;
  116 + phoneLabel.hidden = ![phone isNotBlank];
114 phoneLabel.backgroundColor = [UIColor whiteColor]; 117 phoneLabel.backgroundColor = [UIColor whiteColor];
115 -  
116 - NSString * string = @"您也可以拨打物业电话 400-9001933"; 118 +
  119 + NSString * string = [NSString stringWithFormat:@"您也可以拨打物业电话 %@",phone];
117 NSMutableAttributedString *textAttributedString = [[NSMutableAttributedString alloc] initWithString:string]; 120 NSMutableAttributedString *textAttributedString = [[NSMutableAttributedString alloc] initWithString:string];
118 textAttributedString.yy_font = [UIFont systemFontOfSize:10]; 121 textAttributedString.yy_font = [UIFont systemFontOfSize:10];
119 textAttributedString.yy_color = UIColorHex(#B4B4B4); 122 textAttributedString.yy_color = UIColorHex(#B4B4B4);
120 textAttributedString.yy_alignment = NSTextAlignmentCenter; 123 textAttributedString.yy_alignment = NSTextAlignmentCenter;
121 - [textAttributedString yy_setTextHighlightRange:[string rangeOfString:@"400-9001933"] 124 + [textAttributedString yy_setTextHighlightRange:[string rangeOfString:phone]
122 color:[UIColor qmui_colorWithHexString:@"0091FF"] 125 color:[UIColor qmui_colorWithHexString:@"0091FF"]
123 backgroundColor:[UIColor qmui_colorWithHexString:@"0091FF"] 126 backgroundColor:[UIColor qmui_colorWithHexString:@"0091FF"]
124 tapAction:^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect){ 127 tapAction:^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect){
125 - NSLog(@"点击电话了"); 128 + UIAlertController * alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
  129 + [alert addAction:[UIAlertAction actionWithTitle:phone style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  130 + NSMutableString* str = [[NSMutableString alloc] initWithFormat:@"tel:%@",phone];
  131 + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str] options:@{} completionHandler:NULL];
  132 + }]];
  133 + [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:NULL]];
  134 + [[self displayViewController] presentViewController:alert animated:YES completion:nil];
126 }]; 135 }];
127 phoneLabel.attributedText = textAttributedString; 136 phoneLabel.attributedText = textAttributedString;
128 [footerView addSubview:phoneLabel]; 137 [footerView addSubview:phoneLabel];
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntSignUpViewController.m
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 @property (nonatomic, strong) CNLiveCommuntyActivityDetailModel * detailModel; 11 @property (nonatomic, strong) CNLiveCommuntyActivityDetailModel * detailModel;
12 @property (nonatomic, strong) NSMutableArray * userArray; 12 @property (nonatomic, strong) NSMutableArray * userArray;
13 @property (nonatomic, copy) NSString * activityId; 13 @property (nonatomic, copy) NSString * activityId;
  14 +@property (nonatomic, assign) CGFloat viewHeight;
14 @end 15 @end
15 16
16 @implementation CNLiveCommuntSignUpViewController 17 @implementation CNLiveCommuntSignUpViewController
@@ -21,6 +22,7 @@ @@ -21,6 +22,7 @@
21 { 22 {
22 self = [super initWithStyle:style]; 23 self = [super initWithStyle:style];
23 if (self) { 24 if (self) {
  25 + _viewHeight = 0.0;
24 _activityId = activityId; 26 _activityId = activityId;
25 } 27 }
26 return self; 28 return self;
@@ -160,7 +162,7 @@ @@ -160,7 +162,7 @@
160 CNLiveCommuntyResultViewController * resultVC = [[CNLiveCommuntyResultViewController alloc] initWithSignUpModel:signUpModel activityId:handworkId]; 162 CNLiveCommuntyResultViewController * resultVC = [[CNLiveCommuntyResultViewController alloc] initWithSignUpModel:signUpModel activityId:handworkId];
161 [weakSelf.navigationController pushViewController:resultVC animated:YES]; 163 [weakSelf.navigationController pushViewController:resultVC animated:YES];
162 }else{ 164 }else{
163 - [[CNLiveCommuntyModule shareInstance].protocol pushMainProjectWithPayManagerWithOrderId:signUpModel.order.idStr price:weakSelf.detailModel.unitPrice body:weakSelf.detailModel.name]; 165 + [[CNLiveCommuntyModule shareInstance].protocol pushMainProjectWithPayManagerWithOrderId:signUpModel.order.idStr price:[NSString stringWithFormat:@"%.2f",(weakSelf.userArray.count * [weakSelf.detailModel.unitPrice floatValue])] body:weakSelf.detailModel.name];
164 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(payResultSuccessNNotification:) name:@"kIMAMSG_CommunityPaySuccessNotification" object:nil]; 166 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(payResultSuccessNNotification:) name:@"kIMAMSG_CommunityPaySuccessNotification" object:nil];
165 } 167 }
166 }]; 168 }];
@@ -226,7 +228,11 @@ @@ -226,7 +228,11 @@
226 userView.delegate = self; 228 userView.delegate = self;
227 return userView; 229 return userView;
228 }else{ 230 }else{
229 - return [CNLiveCommuntSignUpTextViewCell setTableView:tableView Desc:self.detailModel.processDesc]; 231 + __weak typeof(self) weakSelf = self;
  232 + return [CNLiveCommuntSignUpTextViewCell setTableView:tableView Desc:self.detailModel.processDesc ReloadWebViewBlock:^(CGFloat viewHeight) {
  233 + weakSelf.viewHeight = viewHeight;
  234 + [weakSelf.tableView reloadData];
  235 + }];
230 } 236 }
231 } 237 }
232 -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 238 -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyHomeListViewController.m
@@ -141,6 +141,8 @@ @@ -141,6 +141,8 @@
141 [[NSUserDefaults standardUserDefaults] synchronize]; 141 [[NSUserDefaults standardUserDefaults] synchronize];
142 [[NSUserDefaults standardUserDefaults] setObject:listModel.name forKey:kCNLiveCommuntyNBhdNameIdentifier]; 142 [[NSUserDefaults standardUserDefaults] setObject:listModel.name forKey:kCNLiveCommuntyNBhdNameIdentifier];
143 [[NSUserDefaults standardUserDefaults] synchronize]; 143 [[NSUserDefaults standardUserDefaults] synchronize];
  144 + [[NSUserDefaults standardUserDefaults] setObject:listModel.propertyPhone forKey:kCNLiveCommuntyNBhdPhoneIdentifier];
  145 + [[NSUserDefaults standardUserDefaults] synchronize];
144 CNLiveCommuntViewController * homeView = [[CNLiveCommuntViewController alloc] initWithNBhdId:listModel.idStr]; 146 CNLiveCommuntViewController * homeView = [[CNLiveCommuntViewController alloc] initWithNBhdId:listModel.idStr];
145 [self.navigationController pushViewController:homeView animated:YES]; 147 [self.navigationController pushViewController:homeView animated:YES];
146 148
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyOrderViewController.m
@@ -161,7 +161,13 @@ @@ -161,7 +161,13 @@
161 { 161 {
162 MJWeakSelf 162 MJWeakSelf
163 if ([button.titleLabel.text isEqualToString:@"咨询电话"]) { 163 if ([button.titleLabel.text isEqualToString:@"咨询电话"]) {
164 - 164 + UIAlertController * alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
  165 + [alert addAction:[UIAlertAction actionWithTitle:self.createMdoel.phone style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  166 + NSMutableString* str = [[NSMutableString alloc] initWithFormat:@"tel:%@",self.createMdoel.phone];
  167 + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str] options:@{} completionHandler:NULL];
  168 + }]];
  169 + [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:NULL]];
  170 + [[self displayViewController] presentViewController:alert animated:YES completion:nil];
165 } 171 }
166 if ([button.titleLabel.text isEqualToString:@"取消订单"]) { 172 if ([button.titleLabel.text isEqualToString:@"取消订单"]) {
167 [CNLiveCommuntSignUpView showAlertViewWithMessage:@"确定取消订单后,此订单将失效" CompleterBlock:^{ 173 [CNLiveCommuntSignUpView showAlertViewWithMessage:@"确定取消订单后,此订单将失效" CompleterBlock:^{
Example/CNLiveCommunitModule/CNLIVEViewController.m
@@ -78,6 +78,11 @@ @@ -78,6 +78,11 @@
78 if (array.count != idx+1) [picString appendString:@","]; 78 if (array.count != idx+1) [picString appendString:@","];
79 }]; 79 }];
80 NSLog(@"===>%@",picString); 80 NSLog(@"===>%@",picString);
  81 + NSString * oldValue = @"1";
  82 + oldValue = [NSString stringWithFormat:@"%.2f",[oldValue floatValue]/100];
  83 + float unitPrice = [oldValue floatValue];
  84 + NSString * p = [NSString stringWithFormat:@"合计: ¥%.2f",(8 * unitPrice)];
  85 + NSLog(@"%@ =>%f ==>%@",oldValue,unitPrice,p);
81 } 86 }
82 87
83 -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 88 -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView