|
|
@@ -36,6 +36,8 @@
|
|
|
|
|
|
@interface OrderDetailViewController ()
|
|
|
|
|
|
+@property (nonatomic,assign) BOOL showModels;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation OrderDetailViewController
|
|
|
@@ -95,6 +97,7 @@
|
|
|
self.label_net_err.layer.cornerRadius=15;
|
|
|
self.label_net_err.layer.masksToBounds=true;
|
|
|
|
|
|
+ self.showModels = YES;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1092,8 +1095,28 @@
|
|
|
|
|
|
}
|
|
|
break;
|
|
|
- case 2:
|
|
|
+ case 2:{
|
|
|
labeltitle= @"Models";
|
|
|
+
|
|
|
+ NSString* btntitle=nil ;
|
|
|
+ if(self.showModels)
|
|
|
+ {
|
|
|
+ btntitle=@"Hide";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ btntitle=@"Show";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ UIButton * btn =[[UIButton alloc] initWithFrame:CGRectMake(tableView.bounds.size.width-50-15, 0, 50, 33)];
|
|
|
+ btn.tag=section;
|
|
|
+
|
|
|
+ [btn addTarget:self action:@selector(HideSction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+
|
|
|
+ [btn setTitle:btntitle forState:UIControlStateNormal];
|
|
|
+ [myView addSubview:btn];
|
|
|
+
|
|
|
+ }
|
|
|
break;
|
|
|
case 3:
|
|
|
labeltitle= @"Price Info";
|
|
|
@@ -1133,10 +1156,29 @@
|
|
|
|
|
|
*/
|
|
|
|
|
|
- self.showMore=!self.showMore;
|
|
|
- NSRange range = NSMakeRange(1, 1);
|
|
|
- NSIndexSet *sectionToReload = [NSIndexSet indexSetWithIndexesInRange:range];
|
|
|
- [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
|
|
|
+ switch (sender.tag) {
|
|
|
+ case 0:{
|
|
|
+
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 1:{
|
|
|
+ self.showMore=!self.showMore;
|
|
|
+ NSRange range = NSMakeRange(1, 1);
|
|
|
+ NSIndexSet *sectionToReload = [NSIndexSet indexSetWithIndexesInRange:range];
|
|
|
+ [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2:{
|
|
|
+ self.showModels = !self.showModels;
|
|
|
+
|
|
|
+ NSIndexSet *sectionToReload = [NSIndexSet indexSetWithIndex:2];
|
|
|
+ [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1184,8 +1226,12 @@
|
|
|
|
|
|
if(section==2)
|
|
|
{
|
|
|
- int count =[[self.content_data valueForKey:@"model_count"] intValue];
|
|
|
- return count;
|
|
|
+ if (self.showModels) {
|
|
|
+ int count =[[self.content_data valueForKey:@"model_count"] intValue];
|
|
|
+ return count;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
}
|
|
|
if(section==3)
|
|
|
return 5;
|