Commit ddab2987 authored by admin's avatar admin

完成sop主界面

parent 88f94923
...@@ -120,6 +120,9 @@ ...@@ -120,6 +120,9 @@
84CEB1721C2946EC0072ED0A /* StoreDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB1711C2946EC0072ED0A /* StoreDetailModel.m */; }; 84CEB1721C2946EC0072ED0A /* StoreDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB1711C2946EC0072ED0A /* StoreDetailModel.m */; };
84CF0F1E1BE9B40400C855CE /* InspectDetailFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */; }; 84CF0F1E1BE9B40400C855CE /* InspectDetailFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */; };
84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0FA11BE9EDA900C855CE /* TakePhotoView.m */; }; 84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0FA11BE9EDA900C855CE /* TakePhotoView.m */; };
84D2F5171C2CD3D400651EFB /* SOPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D2F5161C2CD3D400651EFB /* SOPViewController.m */; };
84D2F51A1C2CE67500651EFB /* SOPTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D2F5191C2CE67500651EFB /* SOPTableView.m */; };
84D2F5201C2D213400651EFB /* AttachmentTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D2F51F1C2D213400651EFB /* AttachmentTableViewCell.m */; };
84D3E5F01C04BC8C001FF1DD /* InspectUploadedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5EF1C04BC8C001FF1DD /* InspectUploadedViewController.m */; }; 84D3E5F01C04BC8C001FF1DD /* InspectUploadedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5EF1C04BC8C001FF1DD /* InspectUploadedViewController.m */; };
84D3E5F31C04BCD3001FF1DD /* InspectNotUploadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5F21C04BCD3001FF1DD /* InspectNotUploadViewController.m */; }; 84D3E5F31C04BCD3001FF1DD /* InspectNotUploadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5F21C04BCD3001FF1DD /* InspectNotUploadViewController.m */; };
84D3E5F91C04BD8E001FF1DD /* InspectNotUpLoadCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5F81C04BD8E001FF1DD /* InspectNotUpLoadCell.m */; }; 84D3E5F91C04BD8E001FF1DD /* InspectNotUpLoadCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5F81C04BD8E001FF1DD /* InspectNotUpLoadCell.m */; };
...@@ -405,6 +408,12 @@ ...@@ -405,6 +408,12 @@
84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectDetailFooterView.m; sourceTree = "<group>"; }; 84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectDetailFooterView.m; sourceTree = "<group>"; };
84CF0FA01BE9EDA900C855CE /* TakePhotoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TakePhotoView.h; sourceTree = "<group>"; }; 84CF0FA01BE9EDA900C855CE /* TakePhotoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TakePhotoView.h; sourceTree = "<group>"; };
84CF0FA11BE9EDA900C855CE /* TakePhotoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TakePhotoView.m; sourceTree = "<group>"; }; 84CF0FA11BE9EDA900C855CE /* TakePhotoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TakePhotoView.m; sourceTree = "<group>"; };
84D2F5151C2CD3D400651EFB /* SOPViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SOPViewController.h; sourceTree = "<group>"; };
84D2F5161C2CD3D400651EFB /* SOPViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SOPViewController.m; sourceTree = "<group>"; };
84D2F5181C2CE67500651EFB /* SOPTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SOPTableView.h; sourceTree = "<group>"; };
84D2F5191C2CE67500651EFB /* SOPTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SOPTableView.m; sourceTree = "<group>"; };
84D2F51E1C2D213400651EFB /* AttachmentTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AttachmentTableViewCell.h; sourceTree = "<group>"; };
84D2F51F1C2D213400651EFB /* AttachmentTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AttachmentTableViewCell.m; sourceTree = "<group>"; };
84D3E5EE1C04BC8C001FF1DD /* InspectUploadedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectUploadedViewController.h; sourceTree = "<group>"; }; 84D3E5EE1C04BC8C001FF1DD /* InspectUploadedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectUploadedViewController.h; sourceTree = "<group>"; };
84D3E5EF1C04BC8C001FF1DD /* InspectUploadedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectUploadedViewController.m; sourceTree = "<group>"; }; 84D3E5EF1C04BC8C001FF1DD /* InspectUploadedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectUploadedViewController.m; sourceTree = "<group>"; };
84D3E5F11C04BCD3001FF1DD /* InspectNotUploadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectNotUploadViewController.h; sourceTree = "<group>"; }; 84D3E5F11C04BCD3001FF1DD /* InspectNotUploadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectNotUploadViewController.h; sourceTree = "<group>"; };
...@@ -721,6 +730,7 @@ ...@@ -721,6 +730,7 @@
8426A4AD1BDF0CD600E5FDF5 /* Standard */ = { 8426A4AD1BDF0CD600E5FDF5 /* Standard */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
84D2F5111C2CD3C300651EFB /* SOPCategarys */,
84CC34D91C09538E002F10E2 /* StandardHandout */, 84CC34D91C09538E002F10E2 /* StandardHandout */,
84CC34D51C094557002F10E2 /* Cell */, 84CC34D51C094557002F10E2 /* Cell */,
8426A4AE1BDF0CD600E5FDF5 /* View */, 8426A4AE1BDF0CD600E5FDF5 /* View */,
...@@ -1464,6 +1474,8 @@ ...@@ -1464,6 +1474,8 @@
children = ( children = (
849B2F6F1C0CA22F005D809F /* AnnoContentTableViewCell.h */, 849B2F6F1C0CA22F005D809F /* AnnoContentTableViewCell.h */,
849B2F701C0CA22F005D809F /* AnnoContentTableViewCell.m */, 849B2F701C0CA22F005D809F /* AnnoContentTableViewCell.m */,
84D2F51E1C2D213400651EFB /* AttachmentTableViewCell.h */,
84D2F51F1C2D213400651EFB /* AttachmentTableViewCell.m */,
); );
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1869,6 +1881,41 @@ ...@@ -1869,6 +1881,41 @@
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
84D2F5111C2CD3C300651EFB /* SOPCategarys */ = {
isa = PBXGroup;
children = (
84D2F5121C2CD3C300651EFB /* Cell */,
84D2F5131C2CD3C300651EFB /* View */,
84D2F5141C2CD3C300651EFB /* ViewController */,
);
path = SOPCategarys;
sourceTree = "<group>";
};
84D2F5121C2CD3C300651EFB /* Cell */ = {
isa = PBXGroup;
children = (
);
path = Cell;
sourceTree = "<group>";
};
84D2F5131C2CD3C300651EFB /* View */ = {
isa = PBXGroup;
children = (
84D2F5181C2CE67500651EFB /* SOPTableView.h */,
84D2F5191C2CE67500651EFB /* SOPTableView.m */,
);
path = View;
sourceTree = "<group>";
};
84D2F5141C2CD3C300651EFB /* ViewController */ = {
isa = PBXGroup;
children = (
84D2F5151C2CD3D400651EFB /* SOPViewController.h */,
84D2F5161C2CD3D400651EFB /* SOPViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
};
84DB9BC11BDCD49900822CC4 /* CustomDropMenu */ = { 84DB9BC11BDCD49900822CC4 /* CustomDropMenu */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -2269,6 +2316,7 @@ ...@@ -2269,6 +2316,7 @@
8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */, 8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */,
8409BDFD1C281ACD00354460 /* TreeView.m in Sources */, 8409BDFD1C281ACD00354460 /* TreeView.m in Sources */,
8409BDFB1C281ACD00354460 /* TreeNodeModel.m in Sources */, 8409BDFB1C281ACD00354460 /* TreeNodeModel.m in Sources */,
84D2F5171C2CD3D400651EFB /* SOPViewController.m in Sources */,
84CC34D11C093C5E002F10E2 /* LookOnLineViewController.m in Sources */, 84CC34D11C093C5E002F10E2 /* LookOnLineViewController.m in Sources */,
84D863731C11923F00E4F4CC /* AddQuestionTableCell.m in Sources */, 84D863731C11923F00E4F4CC /* AddQuestionTableCell.m in Sources */,
84D8257F1BDD2F7E00CC61F7 /* MineTableFooterView.m in Sources */, 84D8257F1BDD2F7E00CC61F7 /* MineTableFooterView.m in Sources */,
...@@ -2289,6 +2337,7 @@ ...@@ -2289,6 +2337,7 @@
848A201D1C180C1900422FAB /* OnLineCompleteDetailCell.m in Sources */, 848A201D1C180C1900422FAB /* OnLineCompleteDetailCell.m in Sources */,
84CEB16F1C2946DB0072ED0A /* OnLineDetailModel.m in Sources */, 84CEB16F1C2946DB0072ED0A /* OnLineDetailModel.m in Sources */,
84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */, 84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */,
84D2F51A1C2CE67500651EFB /* SOPTableView.m in Sources */,
84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */, 84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */,
8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */, 8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */,
84AD4F491BF4BC0600BFB37C /* RankDetailTableCell.m in Sources */, 84AD4F491BF4BC0600BFB37C /* RankDetailTableCell.m in Sources */,
...@@ -2314,6 +2363,7 @@ ...@@ -2314,6 +2363,7 @@
8473E3881C1BBFF600960257 /* InspectTaskDetailCell.m in Sources */, 8473E3881C1BBFF600960257 /* InspectTaskDetailCell.m in Sources */,
84F57C9C1BECA73800DDEEB1 /* StarBar.m in Sources */, 84F57C9C1BECA73800DDEEB1 /* StarBar.m in Sources */,
84F57C4C1BEC785E00DDEEB1 /* AddQuestionViewController.m in Sources */, 84F57C4C1BEC785E00DDEEB1 /* AddQuestionViewController.m in Sources */,
84D2F5201C2D213400651EFB /* AttachmentTableViewCell.m in Sources */,
84C9729F1C1ADD17003A3276 /* PictureCommentTableCell.m in Sources */, 84C9729F1C1ADD17003A3276 /* PictureCommentTableCell.m in Sources */,
849A18461C152EBA00071600 /* AddPictureTableCell.m in Sources */, 849A18461C152EBA00071600 /* AddPictureTableCell.m in Sources */,
84D80EB51BF714BE00A10EA4 /* GroupItems.m in Sources */, 84D80EB51BF714BE00A10EA4 /* GroupItems.m in Sources */,
......
...@@ -119,4 +119,7 @@ ...@@ -119,4 +119,7 @@
// 获取下级组织 // 获取下级组织
#define kQueryLowerOrgsURL @"redstar-server/rest/organization/queryLowerOrgs" #define kQueryLowerOrgsURL @"redstar-server/rest/organization/queryLowerOrgs"
// 口碑标注附件列表
#define kGetAttachmentsURL @"redstar-server/rest/standardpraise/get_attachments"
#endif /* Url_h */ #endif /* Url_h */
//
// AttachmentTableViewCell.h
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AttachmentTableViewCell : UITableViewCell
@property (nonatomic, strong) UIButton *nameBtn;
@property (nonatomic, strong) UIButton *downloadBtn;
@end
//
// AttachmentTableViewCell.m
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "AttachmentTableViewCell.h"
@implementation AttachmentTableViewCell
- (UIButton *)nameBtn
{
if (!_nameBtn) {
_nameBtn = [[UIButton alloc] init];
_nameBtn.backgroundColor = [UIColor grayColor];
_nameBtn.translatesAutoresizingMaskIntoConstraints = NO;
_nameBtn.layer.cornerRadius = 4.0;
[self.contentView addSubview:_nameBtn];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_nameBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:lineViewTop];
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_nameBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-20];
[self.contentView addConstraint:lineViewRight];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_nameBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
[self.contentView addConstraint:lineViewBottom];
NSLayoutConstraint *lineViewLeft = [NSLayoutConstraint constraintWithItem:_nameBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:10];
[self.contentView addConstraint:lineViewLeft];
NSLayoutConstraint *lineViewHeight = [NSLayoutConstraint constraintWithItem:_nameBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:35];
[self.contentView addConstraint:lineViewHeight];
}
return _nameBtn;
}
- (UIButton *)downloadBtn
{
if (!_downloadBtn) {
_downloadBtn = [[UIButton alloc] init];
_downloadBtn.backgroundColor = [UIColor grayColor];
_downloadBtn.translatesAutoresizingMaskIntoConstraints = NO;
_downloadBtn.layer.cornerRadius = 4.0;
[self.contentView addSubview:_downloadBtn];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_downloadBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:lineViewTop];
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_downloadBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:lineViewRight];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_downloadBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
[self.contentView addConstraint:lineViewBottom];
NSLayoutConstraint *lineViewLeft = [NSLayoutConstraint constraintWithItem:_downloadBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:10];
[self.contentView addConstraint:lineViewLeft];
}
return _downloadBtn;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
...@@ -15,8 +15,10 @@ ...@@ -15,8 +15,10 @@
#import "AnnounceDetailModel.h" #import "AnnounceDetailModel.h"
#define kAnnounceContentCell @"AnnoContentTableViewCell" #import "AttachmentTableViewCell.h"
#define kAnnounceContentCell @"AnnoContentTableViewCell"
#define kAttachmentTableViewCell @"AttachmentTableViewCell"
@interface AnnoDetailViewController ()<UITableViewDataSource, UITableViewDelegate> @interface AnnoDetailViewController ()<UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
...@@ -43,7 +45,7 @@ ...@@ -43,7 +45,7 @@
NSString *url = [NSString stringWithFormat:@"%@%@%@", kRedStarURL, kAnnounceDetailURL, self.affiche_uuid]; NSString *url = [NSString stringWithFormat:@"%@%@%@", kRedStarURL, kAnnounceDetailURL, self.affiche_uuid];
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url]; HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
[httpCilent getAnnounceDetailWithCompletion:^(id response, NSError *error) { [httpCilent getAnnounceDetailWithCompletion:^(id response, NSError *error) {
NSLog(@"anno详情 = %@", response); NSLog(@"anno 公告详情 = %@", response);
NSDictionary *dict = response[@"data"]; NSDictionary *dict = response[@"data"];
AnnounceDetailModel *annoDetail = [AnnounceDetailModel announceDetailModelWithDict:dict]; AnnounceDetailModel *annoDetail = [AnnounceDetailModel announceDetailModelWithDict:dict];
_annoDetail = annoDetail; _annoDetail = annoDetail;
...@@ -94,6 +96,15 @@ ...@@ -94,6 +96,15 @@
} }
- (void)showFile:(UIButton *)sender
{
}
- (void)downloadFile:(UIButton *)sender
{
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
...@@ -103,26 +114,42 @@ ...@@ -103,26 +114,42 @@
#pragma mark - UITableView Delegate/DataSource #pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
return 1; return 1 + _annoDetail.attachmentUrls.count;
} }
// cell显示的内容 // cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
if (indexPath.row == 0) {
AnnoContentTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAnnounceContentCell]; AnnoContentTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAnnounceContentCell];
if (!cell) { if (!cell) {
cell = [[AnnoContentTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAnnounceContentCell]; cell = [[AnnoContentTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAnnounceContentCell];
}
cell.titleLabel.text = @"内容";
NSString *str = [NSString stringWithFormat:@"<style> html{ font-size: 15px; color: #444444 } </style>%@", _annoDetail.content];
NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
cell.contentLabel.attributedText = attrStr;
cell.backgroundColor = kAnnounceHeaderColor;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else {
AttachmentTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAttachmentTableViewCell];
if (!cell) {
cell = [[AttachmentTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAttachmentTableViewCell];
}
NSDictionary *dict = _annoDetail.attachmentUrls[indexPath.row - 1];
NSString *name = dict[@"fileName"];
[cell.nameBtn setTitle:name forState:UIControlStateNormal];
[cell.downloadBtn setTitle:@"下载" forState:UIControlStateNormal];
[cell.nameBtn addTarget:self action:@selector(showFile:) forControlEvents:UIControlEventTouchUpInside];
[cell.downloadBtn addTarget:self action:@selector(downloadFile:) forControlEvents:UIControlEventTouchUpInside];
return cell;
} }
cell.titleLabel.text = @"内容";
NSString *str = [NSString stringWithFormat:@"<style> html{ font-size: 15px; color: #444444 } </style>%@", _annoDetail.content];
NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
cell.contentLabel.attributedText = attrStr;
cell.backgroundColor = kAnnounceHeaderColor;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} }
...@@ -140,7 +167,7 @@ ...@@ -140,7 +167,7 @@
_tableView.tableHeaderView = self.headerView; _tableView.tableHeaderView = self.headerView;
_tableView.tableFooterView = self.footerView; _tableView.tableFooterView = self.footerView;
[_tableView registerClass:[AnnoContentTableViewCell class] forCellReuseIdentifier:kAnnounceContentCell]; [_tableView registerClass:[AnnoContentTableViewCell class] forCellReuseIdentifier:kAnnounceContentCell];
[_tableView registerClass:[AttachmentTableViewCell class] forCellReuseIdentifier:kAttachmentTableViewCell];
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
......
//
// SOPTableView.h
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol SOPTableViewDelegate <NSObject>
- (void)selectRowWithDetailTitle:(NSString *)detailTitle;
@end
@interface SOPTableView : UITableView
@property (nonatomic, assign) id <SOPTableViewDelegate> sop_delegate;
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style titleArray:(NSArray *)titleArray;
- (instancetype)initWithTitleArray:(NSArray *)titleArray;
@end
//
// SOPTableView.m
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "SOPTableView.h"
@interface SOPTableView () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) NSArray *titleArray;
@end
@implementation SOPTableView
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style titleArray:(NSArray *)titleArray
{
self = [super initWithFrame:frame style:style];
if (self) {
_titleArray = titleArray;
[self setup];
}
return self;
}
- (instancetype)initWithTitleArray:(NSArray *)titleArray
{
self = [super init];
if (self) {
_titleArray = titleArray;
[self setup];
}
return self;
}
- (void)setup
{
self.delegate = self;
self.dataSource = self;
}
#pragma mark - UItableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return _titleArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"cell333"];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell333"];
}
cell.textLabel.text = _titleArray[indexPath.row];
cell.textLabel.font = [UIFont systemFontOfSize:15.0];
cell.textLabel.textColor = kLightBlack;
cell.textLabel.numberOfLines = 0;
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (_sop_delegate && [_sop_delegate respondsToSelector:@selector(selectRowWithDetailTitle:)]) {
[_sop_delegate selectRowWithDetailTitle:_titleArray[indexPath.row]];
}
}
@end
//
// SOPViewController.h
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SOPViewController : UIViewController
@end
//
// SOPViewController.m
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "SOPViewController.h"
#import "GroupTabBar.h"
#import "GroupItems.h"
#import "SOPTableView.h"
#import "HttpClient.h"
#define SELECTED_VIEW_CONTROLLER_TAG 39998
@interface SOPViewController () <GroupTabBarDelegate, SOPTableViewDelegate>
@property (nonatomic, strong) GroupTabBar *groupTabBar;
@property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) NSArray *titleArray1;
@property (nonatomic, strong) NSArray *titleArray2;
@property (nonatomic, strong) NSArray *titleArray3;
@property (nonatomic, strong) NSArray *titleArray4;
@property (nonatomic, strong) NSArray *titleArray5;
@property (nonatomic, strong) NSArray *titleArray6;
@property (nonatomic, strong) NSArray *titleArray7;
@property (nonatomic, strong) NSArray *titleArray8;
@property (nonatomic, strong) NSString *detailTitle;
@property (nonatomic, strong) UIButton *resetBtn;
@property (nonatomic, strong) UIButton *queryBtn;
@end
@implementation SOPViewController
- (void)viewDidLoad
{
[super viewDidLoad];
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
self.titleArray = [NSArray arrayWithObjects:@"质量管理",@"价格管理",@"现场服务",@"售后服务",@"环境管理",@"现场管理", @"400呼叫管理",@"单品管理",nil];
self.titleArray1 = [NSArray arrayWithObjects:@"商品环保、质量检测管理规定",@"商品资质管理规定",@"三年质保管理规定",@"商品绿色展陈管理规定",@" 附件:绿色展陈操作手册", nil];
self.titleArray2 = [NSArray arrayWithObjects:@"商品标价签管理规定",@"商品调价管理规定",@"商场全国大促活动执行管理规定",@"商户促销活动管理规定",@"“全场最低七折”管理规定", nil];
self.titleArray3 = [NSArray arrayWithObjects:@"商场现场服务基本规定",@"便民服务管理规定",@"营业员管理规定",@"播音管理规定",@"商场实施管理者“顾客之声VOC”管理规定", @"30天无理由退货管理规定",@"15分钟退单管理规定",@"商场全员顾客服务规范管理规定",@" 附件:停车场安全员岗位车辆指挥标准手势手册",@"设计免费咨询管理规定",nil];
self.titleArray4 = [NSArray arrayWithObjects:@"商场客诉处理管理规定",@"先行赔付管理规定",@"商品质量保证金管理规定",@"送货跟单回访管理规定", nil];
self.titleArray5 = [NSArray arrayWithObjects:@"商场基础环境管理规定",@"口碑商场环境管理规定",@" 附件:室内地面维修养护规范",@" 附件:商户装修“五区管理法”规定",@" 附件:喷水池管理规范", @"商场停车场管理规定",@"商场洗手间管理规范",@"商场综合物料管理规定",nil];
self.titleArray6 = [NSArray arrayWithObjects:@"楼层日常巡场管理规定",@"商户进/出货管理规定",@"商户进场管理规定",@"商户撤场管理规定",@"商户信用等级评定管理规定", nil];
self.titleArray7 = [NSArray arrayWithObjects:@"呼叫中心商场虚拟座席远程管理规定", nil];
self.titleArray8 = [NSArray arrayWithObjects:@"商品信息管理规定", nil];
[self setupNav];
[self setGroupBar];
[self.resetBtn addTarget:self action:@selector(resetClick:) forControlEvents:UIControlEventTouchUpInside];
[self.queryBtn addTarget:self action:@selector(queryClick:) forControlEvents:UIControlEventTouchUpInside];
}
- (void)resetClick:(UIButton *)sender
{
}
- (void)queryClick:(UIButton *)sender
{
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kGetAttachmentsURL];
HttpClient *http = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{@"type":@"sop",
@"category1":_titleArray[_groupTabBar.selectNumber],
@"category2":_detailTitle
};
[http getAttachmentsWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"7.1 口碑标注附件列表 = %@, error = %@", response, error);
}];
}
- (void)setupNav
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"SOP分类查询"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
}
- (void)setGroupBar
{
self.groupTabBar = [[GroupTabBar alloc] initWithFrame:CGRectMake(0, 0, 120, kScreenHeight - 64 - 60)];
_groupTabBar.delegate = self;
[self.view addSubview:_groupTabBar];
NSInteger selectedIndex = 0;
NSIndexPath *selectedIndexPath = [NSIndexPath indexPathForRow:selectedIndex inSection:0];
SOPTableView *tableView1 = [[SOPTableView alloc] initWithTitleArray:_titleArray1];
tableView1.sop_delegate = self;
GroupItems *tableItem1 = [[GroupItems alloc] initWithTitle:_titleArray[0] view:tableView1];
SOPTableView *tableView2 = [[SOPTableView alloc] initWithTitleArray:_titleArray2];
tableView2.sop_delegate = self;
GroupItems *tableItem2 = [[GroupItems alloc] initWithTitle:_titleArray[1] view:tableView2];
SOPTableView *tableView3 = [[SOPTableView alloc] initWithTitleArray:_titleArray3];
tableView3.sop_delegate = self;
GroupItems *tableItem3 = [[GroupItems alloc] initWithTitle:_titleArray[2] view:tableView3];
SOPTableView *tableView4 = [[SOPTableView alloc] initWithTitleArray:_titleArray4];
tableView4.sop_delegate = self;
GroupItems *tableItem4 = [[GroupItems alloc] initWithTitle:_titleArray[3] view:tableView4];
SOPTableView *tableView5 = [[SOPTableView alloc] initWithTitleArray:_titleArray5];
tableView5.sop_delegate = self;
GroupItems *tableItem5 = [[GroupItems alloc] initWithTitle:_titleArray[4] view:tableView5];
SOPTableView *tableView6 = [[SOPTableView alloc] initWithTitleArray:_titleArray6];
tableView6.sop_delegate = self;
GroupItems *tableItem6 = [[GroupItems alloc] initWithTitle:_titleArray[5] view:tableView6];
SOPTableView *tableView7 = [[SOPTableView alloc] initWithTitleArray:_titleArray7];
tableView7.sop_delegate = self;
GroupItems *tableItem7 = [[GroupItems alloc] initWithTitle:_titleArray[6] view:tableView7];
SOPTableView *tableView8 = [[SOPTableView alloc] initWithTitleArray:_titleArray8];
tableView8.sop_delegate = self;
GroupItems *tableItem8 = [[GroupItems alloc] initWithTitle:_titleArray[7] view:tableView8];
[tableView1 selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
[tableView2 selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
[tableView3 selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
[tableView4 selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
[tableView5 selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
[tableView6 selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
[tableView7 selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
[tableView8 selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
[self.view insertSubview:tableView1 belowSubview:_groupTabBar];
[self.view insertSubview:tableView2 belowSubview:_groupTabBar];
[self.view insertSubview:tableView3 belowSubview:_groupTabBar];
[self.view insertSubview:tableView4 belowSubview:_groupTabBar];
[self.view insertSubview:tableView5 belowSubview:_groupTabBar];
[self.view insertSubview:tableView6 belowSubview:_groupTabBar];
[self.view insertSubview:tableView7 belowSubview:_groupTabBar];
[self.view insertSubview:tableView8 belowSubview:_groupTabBar];
_groupTabBar.items = @[tableItem1, tableItem2, tableItem3, tableItem4, tableItem5, tableItem6, tableItem7, tableItem8];
[_groupTabBar showIndex:0];
}
-(void)doBack:(id)sender
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
#pragma mark - SOPTableViewDelegate
- (void)selectRowWithDetailTitle:(NSString *)detailTitle
{
_detailTitle = detailTitle;
}
#pragma mark - GroupTabBarDelegate
- (void)switchView:(UIView *)view
{
UIView *currentView = [self.view viewWithTag:SELECTED_VIEW_CONTROLLER_TAG];
[currentView removeFromSuperview];
currentView = nil;
view.frame = CGRectMake(self.groupTabBar.frame.size.width,0,kScreenWidth - self.groupTabBar.frame.size.width, self.groupTabBar.size.height);
view.tag = SELECTED_VIEW_CONTROLLER_TAG;
[self.view insertSubview:view belowSubview:_groupTabBar];
}
#pragma mark - lazy loading
- (UIButton *)resetBtn
{
if (!_resetBtn) {
_resetBtn = [[UIButton alloc] init];
_resetBtn.backgroundColor = [UIColor grayColor];
_resetBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_resetBtn setTitle:@"重置" forState:UIControlStateNormal];
_resetBtn.layer.cornerRadius = 4.0;
[self.view addSubview:_resetBtn];
NSLayoutConstraint *lineViewHeight = [NSLayoutConstraint constraintWithItem:_resetBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[self.view addConstraint:lineViewHeight];
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_resetBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-10];
[self.view addConstraint:lineViewRight];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_resetBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-7.5];
[self.view addConstraint:lineViewBottom];
NSLayoutConstraint *lineViewLeft = [NSLayoutConstraint constraintWithItem:_resetBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.view addConstraint:lineViewLeft];
}
return _resetBtn;
}
- (UIButton *)queryBtn
{
if (!_queryBtn) {
_queryBtn = [[UIButton alloc] init];
_queryBtn.backgroundColor = kNavigationBarColor;
_queryBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_queryBtn setTitle:@"查看附件" forState:UIControlStateNormal];
_queryBtn.layer.cornerRadius = 4.0;
[self.view addSubview:_queryBtn];
NSLayoutConstraint *lineViewHeight = [NSLayoutConstraint constraintWithItem:_queryBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[self.view addConstraint:lineViewHeight];
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_queryBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.view addConstraint:lineViewRight];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_queryBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-7.5];
[self.view addConstraint:lineViewBottom];
NSLayoutConstraint *lineViewLeft = [NSLayoutConstraint constraintWithItem:_queryBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:10];
[self.view addConstraint:lineViewLeft];
}
return _queryBtn;
}
@end
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "StandardViewController.h" #import "StandardViewController.h"
#import "StandardTableViewCell.h" #import "StandardTableViewCell.h"
#import "HandOutViewController.h" #import "HandOutViewController.h"
#import "SOPViewController.h"
#define kStandardTableViewCell @"standardTableViewCell" #define kStandardTableViewCell @"standardTableViewCell"
@interface StandardViewController ()<UITableViewDelegate, UITableViewDataSource> @interface StandardViewController ()<UITableViewDelegate, UITableViewDataSource>
...@@ -102,14 +103,20 @@ ...@@ -102,14 +103,20 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
if (indexPath.section == 0) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"该功能正在努力开发中!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil]; SOPViewController *sopVC = [[SOPViewController alloc] init];
[alert show]; [self.navigationController pushViewController:sopVC animated:YES];
} else if (indexPath.section == 1) {
// if (indexPath.section == 1) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"该功能正在努力开发中!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// HandOutViewController *hoandOutVC = [[HandOutViewController alloc] init]; // HandOutViewController *hoandOutVC = [[HandOutViewController alloc] init];
// [self.navigationController pushViewController:hoandOutVC animated:YES]; // [self.navigationController pushViewController:hoandOutVC animated:YES];
// } } else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"该功能正在努力开发中!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
}
} }
#pragma mark - lazy laoding #pragma mark - lazy laoding
......
...@@ -495,12 +495,12 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -495,12 +495,12 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
// [alert show]; // [alert show];
// return; // return;
LookOnLineViewController *lookOnLine = [[LookOnLineViewController alloc] init]; // LookOnLineViewController *lookOnLine = [[LookOnLineViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:lookOnLine]; // nav = [[UINavigationController alloc] initWithRootViewController:lookOnLine];
// StandardViewController *standardVC = [[StandardViewController alloc] init]; StandardViewController *standardVC = [[StandardViewController alloc] init];
// nav = [[UINavigationController alloc] initWithRootViewController:standardVC]; nav = [[UINavigationController alloc] initWithRootViewController:standardVC];
} else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) { } else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) {
PictureViewController *pictureVC = [[PictureViewController alloc] init]; PictureViewController *pictureVC = [[PictureViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:pictureVC]; nav = [[UINavigationController alloc] initWithRootViewController:pictureVC];
......
...@@ -122,4 +122,7 @@ typedef void (^completionBlock) (id response, NSError *error); ...@@ -122,4 +122,7 @@ typedef void (^completionBlock) (id response, NSError *error);
// 查询下级参数 // 查询下级参数
- (void)queryLowerOrgsWithParameters:(id)parameters completion:(completionBlock)completion; - (void)queryLowerOrgsWithParameters:(id)parameters completion:(completionBlock)completion;
// 获取口碑标准的附件列表
- (void)getAttachmentsWithParameters:(id)parameters completion:(completionBlock)completion;
@end @end
...@@ -419,4 +419,15 @@ ...@@ -419,4 +419,15 @@
}]; }];
} }
// 获取口碑标准的附件列表
- (void)getAttachmentsWithParameters:(id)parameters completion:(completionBlock)completion
{
[self postParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment